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    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
1547    #[builder(setter(into, strip_option), default)]
1548    pub expected_type: Option<ExistsType>,
1549}
1550#[derive(Builder, Debug, PartialEq)]
1551pub struct ContainerExportOpts {
1552    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1553    #[builder(setter(into, strip_option), default)]
1554    pub expand: Option<bool>,
1555    /// Force each layer of the exported image to use the specified compression algorithm.
1556    /// 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.
1557    #[builder(setter(into, strip_option), default)]
1558    pub forced_compression: Option<ImageLayerCompression>,
1559    /// Use the specified media types for the exported image's layers.
1560    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1561    #[builder(setter(into, strip_option), default)]
1562    pub media_types: Option<ImageMediaTypes>,
1563    /// Identifiers for other platform specific containers.
1564    /// Used for multi-platform image.
1565    #[builder(setter(into, strip_option), default)]
1566    pub platform_variants: Option<Vec<Id>>,
1567}
1568#[derive(Builder, Debug, PartialEq)]
1569pub struct ContainerExportImageOpts {
1570    /// Force each layer of the exported image to use the specified compression algorithm.
1571    /// 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.
1572    #[builder(setter(into, strip_option), default)]
1573    pub forced_compression: Option<ImageLayerCompression>,
1574    /// Use the specified media types for the exported image's layers.
1575    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1576    #[builder(setter(into, strip_option), default)]
1577    pub media_types: Option<ImageMediaTypes>,
1578    /// Identifiers for other platform specific containers.
1579    /// Used for multi-platform image.
1580    #[builder(setter(into, strip_option), default)]
1581    pub platform_variants: Option<Vec<Id>>,
1582}
1583#[derive(Builder, Debug, PartialEq)]
1584pub struct ContainerFileOpts {
1585    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1586    #[builder(setter(into, strip_option), default)]
1587    pub expand: Option<bool>,
1588}
1589#[derive(Builder, Debug, PartialEq)]
1590pub struct ContainerImportOpts<'a> {
1591    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
1592    #[builder(setter(into, strip_option), default)]
1593    pub tag: Option<&'a str>,
1594}
1595#[derive(Builder, Debug, PartialEq)]
1596pub struct ContainerPublishOpts {
1597    /// Force each layer of the published image to use the specified compression algorithm.
1598    /// 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.
1599    #[builder(setter(into, strip_option), default)]
1600    pub forced_compression: Option<ImageLayerCompression>,
1601    /// Use the specified media types for the published image's layers.
1602    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
1603    #[builder(setter(into, strip_option), default)]
1604    pub media_types: Option<ImageMediaTypes>,
1605    /// Identifiers for other platform specific containers.
1606    /// Used for multi-platform image.
1607    #[builder(setter(into, strip_option), default)]
1608    pub platform_variants: Option<Vec<Id>>,
1609}
1610#[derive(Builder, Debug, PartialEq)]
1611pub struct ContainerStatOpts {
1612    /// If specified, do not follow symlinks.
1613    #[builder(setter(into, strip_option), default)]
1614    pub do_not_follow_symlinks: Option<bool>,
1615}
1616#[derive(Builder, Debug, PartialEq)]
1617pub struct ContainerTerminalOpts<'a> {
1618    /// If set, override the container's default terminal command and invoke these command arguments instead.
1619    #[builder(setter(into, strip_option), default)]
1620    pub cmd: Option<Vec<&'a str>>,
1621    /// Provides Dagger access to the executed command.
1622    #[builder(setter(into, strip_option), default)]
1623    pub experimental_privileged_nesting: Option<bool>,
1624    /// 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.
1625    #[builder(setter(into, strip_option), default)]
1626    pub insecure_root_capabilities: Option<bool>,
1627}
1628#[derive(Builder, Debug, PartialEq)]
1629pub struct ContainerUpOpts<'a> {
1630    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1631    /// If empty, the container's default command is used.
1632    #[builder(setter(into, strip_option), default)]
1633    pub args: Option<Vec<&'a str>>,
1634    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1635    #[builder(setter(into, strip_option), default)]
1636    pub expand: Option<bool>,
1637    /// Provides Dagger access to the executed command.
1638    #[builder(setter(into, strip_option), default)]
1639    pub experimental_privileged_nesting: Option<bool>,
1640    /// 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.
1641    #[builder(setter(into, strip_option), default)]
1642    pub insecure_root_capabilities: Option<bool>,
1643    /// If set, skip the automatic init process injected into containers by default.
1644    /// 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.
1645    #[builder(setter(into, strip_option), default)]
1646    pub no_init: Option<bool>,
1647    /// List of frontend/backend port mappings to forward.
1648    /// Frontend is the port accepting traffic on the host, backend is the service port.
1649    #[builder(setter(into, strip_option), default)]
1650    pub ports: Option<Vec<PortForward>>,
1651    /// Bind each tunnel port to a random port on the host.
1652    #[builder(setter(into, strip_option), default)]
1653    pub random: Option<bool>,
1654    /// If the container has an entrypoint, prepend it to the args.
1655    #[builder(setter(into, strip_option), default)]
1656    pub use_entrypoint: Option<bool>,
1657}
1658#[derive(Builder, Debug, PartialEq)]
1659pub struct ContainerWithDefaultTerminalCmdOpts {
1660    /// Provides Dagger access to the executed command.
1661    #[builder(setter(into, strip_option), default)]
1662    pub experimental_privileged_nesting: Option<bool>,
1663    /// 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.
1664    #[builder(setter(into, strip_option), default)]
1665    pub insecure_root_capabilities: Option<bool>,
1666}
1667#[derive(Builder, Debug, PartialEq)]
1668pub struct ContainerWithDirectoryOpts<'a> {
1669    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
1670    #[builder(setter(into, strip_option), default)]
1671    pub exclude: Option<Vec<&'a str>>,
1672    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1673    #[builder(setter(into, strip_option), default)]
1674    pub expand: Option<bool>,
1675    /// Apply .gitignore rules when writing the directory.
1676    #[builder(setter(into, strip_option), default)]
1677    pub gitignore: Option<bool>,
1678    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
1679    #[builder(setter(into, strip_option), default)]
1680    pub include: Option<Vec<&'a str>>,
1681    /// A user:group to set for the directory and its contents.
1682    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1683    /// If the group is omitted, it defaults to the same as the user.
1684    #[builder(setter(into, strip_option), default)]
1685    pub owner: Option<&'a str>,
1686    #[builder(setter(into, strip_option), default)]
1687    pub permissions: Option<isize>,
1688}
1689#[derive(Builder, Debug, PartialEq)]
1690pub struct ContainerWithDockerHealthcheckOpts<'a> {
1691    /// Interval between running healthcheck. Example: "30s"
1692    #[builder(setter(into, strip_option), default)]
1693    pub interval: Option<&'a str>,
1694    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example: "3"
1695    #[builder(setter(into, strip_option), default)]
1696    pub retries: Option<isize>,
1697    /// When true, command must be a single element, which is run using the container's shell
1698    #[builder(setter(into, strip_option), default)]
1699    pub shell: Option<bool>,
1700    /// StartInterval configures the duration between checks during the startup phase. Example: "5s"
1701    #[builder(setter(into, strip_option), default)]
1702    pub start_interval: Option<&'a str>,
1703    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example: "0s"
1704    #[builder(setter(into, strip_option), default)]
1705    pub start_period: Option<&'a str>,
1706    /// Healthcheck timeout. Example: "3s"
1707    #[builder(setter(into, strip_option), default)]
1708    pub timeout: Option<&'a str>,
1709}
1710#[derive(Builder, Debug, PartialEq)]
1711pub struct ContainerWithEntrypointOpts {
1712    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
1713    #[builder(setter(into, strip_option), default)]
1714    pub keep_default_args: Option<bool>,
1715}
1716#[derive(Builder, Debug, PartialEq)]
1717pub struct ContainerWithEnvVariableOpts {
1718    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
1719    #[builder(setter(into, strip_option), default)]
1720    pub expand: Option<bool>,
1721}
1722#[derive(Builder, Debug, PartialEq)]
1723pub struct ContainerWithExecOpts<'a> {
1724    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1725    #[builder(setter(into, strip_option), default)]
1726    pub expand: Option<bool>,
1727    /// Exit codes this command is allowed to exit with without error
1728    #[builder(setter(into, strip_option), default)]
1729    pub expect: Option<ReturnType>,
1730    /// Provides Dagger access to the executed command.
1731    #[builder(setter(into, strip_option), default)]
1732    pub experimental_privileged_nesting: Option<bool>,
1733    /// Execute the command with all root capabilities. Like --privileged in Docker
1734    /// 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.
1735    #[builder(setter(into, strip_option), default)]
1736    pub insecure_root_capabilities: Option<bool>,
1737    /// Skip the automatic init process injected into containers by default.
1738    /// 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.
1739    #[builder(setter(into, strip_option), default)]
1740    pub no_init: Option<bool>,
1741    /// Redirect the command's standard error to a file in the container. Example: "./stderr.txt"
1742    #[builder(setter(into, strip_option), default)]
1743    pub redirect_stderr: Option<&'a str>,
1744    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
1745    #[builder(setter(into, strip_option), default)]
1746    pub redirect_stdin: Option<&'a str>,
1747    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
1748    #[builder(setter(into, strip_option), default)]
1749    pub redirect_stdout: Option<&'a str>,
1750    /// Content to write to the command's standard input. Example: "Hello world")
1751    #[builder(setter(into, strip_option), default)]
1752    pub stdin: Option<&'a str>,
1753    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
1754    #[builder(setter(into, strip_option), default)]
1755    pub use_entrypoint: Option<bool>,
1756}
1757#[derive(Builder, Debug, PartialEq)]
1758pub struct ContainerWithExposedPortOpts<'a> {
1759    /// Port description. Example: "payment API endpoint"
1760    #[builder(setter(into, strip_option), default)]
1761    pub description: Option<&'a str>,
1762    /// Skip the health check when run as a service.
1763    #[builder(setter(into, strip_option), default)]
1764    pub experimental_skip_healthcheck: Option<bool>,
1765    /// Network protocol. Example: "tcp"
1766    #[builder(setter(into, strip_option), default)]
1767    pub protocol: Option<NetworkProtocol>,
1768}
1769#[derive(Builder, Debug, PartialEq)]
1770pub struct ContainerWithFileOpts<'a> {
1771    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1772    #[builder(setter(into, strip_option), default)]
1773    pub expand: Option<bool>,
1774    /// A user:group to set for the file.
1775    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1776    /// If the group is omitted, it defaults to the same as the user.
1777    #[builder(setter(into, strip_option), default)]
1778    pub owner: Option<&'a str>,
1779    /// Permissions of the new file. Example: 0600
1780    #[builder(setter(into, strip_option), default)]
1781    pub permissions: Option<isize>,
1782}
1783#[derive(Builder, Debug, PartialEq)]
1784pub struct ContainerWithFilesOpts<'a> {
1785    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1786    #[builder(setter(into, strip_option), default)]
1787    pub expand: Option<bool>,
1788    /// A user:group to set for the files.
1789    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1790    /// If the group is omitted, it defaults to the same as the user.
1791    #[builder(setter(into, strip_option), default)]
1792    pub owner: Option<&'a str>,
1793    /// Permission given to the copied files (e.g., 0600).
1794    #[builder(setter(into, strip_option), default)]
1795    pub permissions: Option<isize>,
1796}
1797#[derive(Builder, Debug, PartialEq)]
1798pub struct ContainerWithMountedCacheOpts<'a> {
1799    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1800    #[builder(setter(into, strip_option), default)]
1801    pub expand: Option<bool>,
1802    /// A user:group to set for the mounted cache directory.
1803    /// 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.
1804    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1805    /// If the group is omitted, it defaults to the same as the user.
1806    #[builder(setter(into, strip_option), default)]
1807    pub owner: Option<&'a str>,
1808    /// Sharing mode of the cache volume.
1809    #[builder(setter(into, strip_option), default)]
1810    pub sharing: Option<CacheSharingMode>,
1811    /// Identifier of the directory to use as the cache volume's root.
1812    #[builder(setter(into, strip_option), default)]
1813    pub source: Option<Id>,
1814}
1815#[derive(Builder, Debug, PartialEq)]
1816pub struct ContainerWithMountedDirectoryOpts<'a> {
1817    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1818    #[builder(setter(into, strip_option), default)]
1819    pub expand: Option<bool>,
1820    /// A user:group to set for the mounted directory and its contents.
1821    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1822    /// If the group is omitted, it defaults to the same as the user.
1823    #[builder(setter(into, strip_option), default)]
1824    pub owner: Option<&'a str>,
1825    /// Mount the directory read-only.
1826    #[builder(setter(into, strip_option), default)]
1827    pub read_only: Option<bool>,
1828}
1829#[derive(Builder, Debug, PartialEq)]
1830pub struct ContainerWithMountedFileOpts<'a> {
1831    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1832    #[builder(setter(into, strip_option), default)]
1833    pub expand: Option<bool>,
1834    /// A user or user:group to set for the mounted file.
1835    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1836    /// If the group is omitted, it defaults to the same as the user.
1837    #[builder(setter(into, strip_option), default)]
1838    pub owner: Option<&'a str>,
1839}
1840#[derive(Builder, Debug, PartialEq)]
1841pub struct ContainerWithMountedSecretOpts<'a> {
1842    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1843    #[builder(setter(into, strip_option), default)]
1844    pub expand: Option<bool>,
1845    /// Permission given to the mounted secret (e.g., 0600).
1846    /// This option requires an owner to be set to be active.
1847    #[builder(setter(into, strip_option), default)]
1848    pub mode: Option<isize>,
1849    /// A user:group to set for the mounted secret.
1850    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1851    /// If the group is omitted, it defaults to the same as the user.
1852    #[builder(setter(into, strip_option), default)]
1853    pub owner: Option<&'a str>,
1854}
1855#[derive(Builder, Debug, PartialEq)]
1856pub struct ContainerWithMountedTempOpts {
1857    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1858    #[builder(setter(into, strip_option), default)]
1859    pub expand: Option<bool>,
1860    /// Size of the temporary directory in bytes.
1861    #[builder(setter(into, strip_option), default)]
1862    pub size: Option<isize>,
1863}
1864#[derive(Builder, Debug, PartialEq)]
1865pub struct ContainerWithNewFileOpts<'a> {
1866    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1867    #[builder(setter(into, strip_option), default)]
1868    pub expand: Option<bool>,
1869    /// A user:group to set for the file.
1870    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1871    /// If the group is omitted, it defaults to the same as the user.
1872    #[builder(setter(into, strip_option), default)]
1873    pub owner: Option<&'a str>,
1874    /// Permissions of the new file. Example: 0600
1875    #[builder(setter(into, strip_option), default)]
1876    pub permissions: Option<isize>,
1877}
1878#[derive(Builder, Debug, PartialEq)]
1879pub struct ContainerWithSymlinkOpts {
1880    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1881    #[builder(setter(into, strip_option), default)]
1882    pub expand: Option<bool>,
1883}
1884#[derive(Builder, Debug, PartialEq)]
1885pub struct ContainerWithUnixSocketOpts<'a> {
1886    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1887    #[builder(setter(into, strip_option), default)]
1888    pub expand: Option<bool>,
1889    /// A user:group to set for the mounted socket.
1890    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1891    /// If the group is omitted, it defaults to the same as the user.
1892    #[builder(setter(into, strip_option), default)]
1893    pub owner: Option<&'a str>,
1894}
1895#[derive(Builder, Debug, PartialEq)]
1896pub struct ContainerWithWorkdirOpts {
1897    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1898    #[builder(setter(into, strip_option), default)]
1899    pub expand: Option<bool>,
1900}
1901#[derive(Builder, Debug, PartialEq)]
1902pub struct ContainerWithoutDirectoryOpts {
1903    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1904    #[builder(setter(into, strip_option), default)]
1905    pub expand: Option<bool>,
1906}
1907#[derive(Builder, Debug, PartialEq)]
1908pub struct ContainerWithoutEntrypointOpts {
1909    /// Don't remove the default arguments when unsetting the entrypoint.
1910    #[builder(setter(into, strip_option), default)]
1911    pub keep_default_args: Option<bool>,
1912}
1913#[derive(Builder, Debug, PartialEq)]
1914pub struct ContainerWithoutExposedPortOpts {
1915    /// Port protocol to unexpose
1916    #[builder(setter(into, strip_option), default)]
1917    pub protocol: Option<NetworkProtocol>,
1918}
1919#[derive(Builder, Debug, PartialEq)]
1920pub struct ContainerWithoutFileOpts {
1921    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1922    #[builder(setter(into, strip_option), default)]
1923    pub expand: Option<bool>,
1924}
1925#[derive(Builder, Debug, PartialEq)]
1926pub struct ContainerWithoutFilesOpts {
1927    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1928    #[builder(setter(into, strip_option), default)]
1929    pub expand: Option<bool>,
1930}
1931#[derive(Builder, Debug, PartialEq)]
1932pub struct ContainerWithoutMountOpts {
1933    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1934    #[builder(setter(into, strip_option), default)]
1935    pub expand: Option<bool>,
1936}
1937#[derive(Builder, Debug, PartialEq)]
1938pub struct ContainerWithoutUnixSocketOpts {
1939    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1940    #[builder(setter(into, strip_option), default)]
1941    pub expand: Option<bool>,
1942}
1943impl IntoID<Id> for Container {
1944    fn into_id(
1945        self,
1946    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1947        Box::pin(async move { self.id().await })
1948    }
1949}
1950impl Loadable for Container {
1951    fn graphql_type() -> &'static str {
1952        "Container"
1953    }
1954    fn from_query(
1955        proc: Option<Arc<DaggerSessionProc>>,
1956        selection: Selection,
1957        graphql_client: DynGraphQLClient,
1958    ) -> Self {
1959        Self {
1960            proc,
1961            selection,
1962            graphql_client,
1963        }
1964    }
1965}
1966impl Container {
1967    /// Turn the container into a Service.
1968    /// Be sure to set any exposed ports before this conversion.
1969    ///
1970    /// # Arguments
1971    ///
1972    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1973    pub fn as_service(&self) -> Service {
1974        let query = self.selection.select("asService");
1975        Service {
1976            proc: self.proc.clone(),
1977            selection: query,
1978            graphql_client: self.graphql_client.clone(),
1979        }
1980    }
1981    /// Turn the container into a Service.
1982    /// Be sure to set any exposed ports before this conversion.
1983    ///
1984    /// # Arguments
1985    ///
1986    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1987    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
1988        let mut query = self.selection.select("asService");
1989        if let Some(args) = opts.args {
1990            query = query.arg("args", args);
1991        }
1992        if let Some(use_entrypoint) = opts.use_entrypoint {
1993            query = query.arg("useEntrypoint", use_entrypoint);
1994        }
1995        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
1996            query = query.arg(
1997                "experimentalPrivilegedNesting",
1998                experimental_privileged_nesting,
1999            );
2000        }
2001        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2002            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2003        }
2004        if let Some(expand) = opts.expand {
2005            query = query.arg("expand", expand);
2006        }
2007        if let Some(no_init) = opts.no_init {
2008            query = query.arg("noInit", no_init);
2009        }
2010        Service {
2011            proc: self.proc.clone(),
2012            selection: query,
2013            graphql_client: self.graphql_client.clone(),
2014        }
2015    }
2016    /// Package the container state as an OCI image, and return it as a tar archive
2017    ///
2018    /// # Arguments
2019    ///
2020    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2021    pub fn as_tarball(&self) -> File {
2022        let query = self.selection.select("asTarball");
2023        File {
2024            proc: self.proc.clone(),
2025            selection: query,
2026            graphql_client: self.graphql_client.clone(),
2027        }
2028    }
2029    /// Package the container state as an OCI image, and return it as a tar archive
2030    ///
2031    /// # Arguments
2032    ///
2033    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2034    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2035        let mut query = self.selection.select("asTarball");
2036        if let Some(platform_variants) = opts.platform_variants {
2037            query = query.arg("platformVariants", platform_variants);
2038        }
2039        if let Some(forced_compression) = opts.forced_compression {
2040            query = query.arg("forcedCompression", forced_compression);
2041        }
2042        if let Some(media_types) = opts.media_types {
2043            query = query.arg("mediaTypes", media_types);
2044        }
2045        File {
2046            proc: self.proc.clone(),
2047            selection: query,
2048            graphql_client: self.graphql_client.clone(),
2049        }
2050    }
2051    /// The combined buffered standard output and standard error stream of the last executed command
2052    /// Returns an error if no command was executed
2053    pub async fn combined_output(&self) -> Result<String, DaggerError> {
2054        let query = self.selection.select("combinedOutput");
2055        query.execute(self.graphql_client.clone()).await
2056    }
2057    /// Return the container's default arguments.
2058    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2059        let query = self.selection.select("defaultArgs");
2060        query.execute(self.graphql_client.clone()).await
2061    }
2062    /// Retrieve a directory from the container's root filesystem
2063    /// Mounts are included.
2064    ///
2065    /// # Arguments
2066    ///
2067    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2068    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2069    pub fn directory(&self, path: impl Into<String>) -> Directory {
2070        let mut query = self.selection.select("directory");
2071        query = query.arg("path", path.into());
2072        Directory {
2073            proc: self.proc.clone(),
2074            selection: query,
2075            graphql_client: self.graphql_client.clone(),
2076        }
2077    }
2078    /// Retrieve a directory from the container's root filesystem
2079    /// Mounts are included.
2080    ///
2081    /// # Arguments
2082    ///
2083    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2084    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2085    pub fn directory_opts(
2086        &self,
2087        path: impl Into<String>,
2088        opts: ContainerDirectoryOpts,
2089    ) -> Directory {
2090        let mut query = self.selection.select("directory");
2091        query = query.arg("path", path.into());
2092        if let Some(expand) = opts.expand {
2093            query = query.arg("expand", expand);
2094        }
2095        Directory {
2096            proc: self.proc.clone(),
2097            selection: query,
2098            graphql_client: self.graphql_client.clone(),
2099        }
2100    }
2101    /// Retrieves this container's configured docker healthcheck.
2102    pub fn docker_healthcheck(&self) -> HealthcheckConfig {
2103        let query = self.selection.select("dockerHealthcheck");
2104        HealthcheckConfig {
2105            proc: self.proc.clone(),
2106            selection: query,
2107            graphql_client: self.graphql_client.clone(),
2108        }
2109    }
2110    /// Return the container's OCI entrypoint.
2111    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2112        let query = self.selection.select("entrypoint");
2113        query.execute(self.graphql_client.clone()).await
2114    }
2115    /// Retrieves the value of the specified persistent environment variable.
2116    ///
2117    /// # Arguments
2118    ///
2119    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
2120    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2121        let mut query = self.selection.select("envVariable");
2122        query = query.arg("name", name.into());
2123        query.execute(self.graphql_client.clone()).await
2124    }
2125    /// Retrieves the list of persistent environment variables configured on the container.
2126    pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2127        let query = self.selection.select("envVariables");
2128        let query = query.select("id");
2129        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2130        Ok(ids
2131            .into_iter()
2132            .map(|id| EnvVariable {
2133                proc: self.proc.clone(),
2134                selection: crate::querybuilder::query()
2135                    .select("node")
2136                    .arg("id", &id.0)
2137                    .inline_fragment("EnvVariable"),
2138                graphql_client: self.graphql_client.clone(),
2139            })
2140            .collect())
2141    }
2142    /// check if a file or directory exists
2143    ///
2144    /// # Arguments
2145    ///
2146    /// * `path` - Path to check (e.g., "/file.txt").
2147    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2148    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2149        let mut query = self.selection.select("exists");
2150        query = query.arg("path", path.into());
2151        query.execute(self.graphql_client.clone()).await
2152    }
2153    /// check if a file or directory exists
2154    ///
2155    /// # Arguments
2156    ///
2157    /// * `path` - Path to check (e.g., "/file.txt").
2158    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2159    pub async fn exists_opts(
2160        &self,
2161        path: impl Into<String>,
2162        opts: ContainerExistsOpts,
2163    ) -> Result<bool, DaggerError> {
2164        let mut query = self.selection.select("exists");
2165        query = query.arg("path", path.into());
2166        if let Some(expected_type) = opts.expected_type {
2167            query = query.arg("expectedType", expected_type);
2168        }
2169        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2170            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2171        }
2172        query.execute(self.graphql_client.clone()).await
2173    }
2174    /// The exit code of the last executed command
2175    /// Returns an error if no command was executed
2176    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2177        let query = self.selection.select("exitCode");
2178        query.execute(self.graphql_client.clone()).await
2179    }
2180    /// EXPERIMENTAL API! Subject to change/removal at any time.
2181    /// Configures all available GPUs on the host to be accessible to this container.
2182    /// This currently works for Nvidia devices only.
2183    pub fn experimental_with_all_gp_us(&self) -> Container {
2184        let query = self.selection.select("experimentalWithAllGPUs");
2185        Container {
2186            proc: self.proc.clone(),
2187            selection: query,
2188            graphql_client: self.graphql_client.clone(),
2189        }
2190    }
2191    /// EXPERIMENTAL API! Subject to change/removal at any time.
2192    /// Configures the provided list of devices to be accessible to this container.
2193    /// This currently works for Nvidia devices only.
2194    ///
2195    /// # Arguments
2196    ///
2197    /// * `devices` - List of devices to be accessible to this container.
2198    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2199        let mut query = self.selection.select("experimentalWithGPU");
2200        query = query.arg(
2201            "devices",
2202            devices
2203                .into_iter()
2204                .map(|i| i.into())
2205                .collect::<Vec<String>>(),
2206        );
2207        Container {
2208            proc: self.proc.clone(),
2209            selection: query,
2210            graphql_client: self.graphql_client.clone(),
2211        }
2212    }
2213    /// Writes the container as an OCI tarball to the destination file path on the host.
2214    /// It can also export platform variants.
2215    ///
2216    /// # Arguments
2217    ///
2218    /// * `path` - Host's destination path (e.g., "./tarball").
2219    ///
2220    /// Path can be relative to the engine's workdir or absolute.
2221    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2222    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2223        let mut query = self.selection.select("export");
2224        query = query.arg("path", path.into());
2225        query.execute(self.graphql_client.clone()).await
2226    }
2227    /// Writes the container as an OCI tarball to the destination file path on the host.
2228    /// It can also export platform variants.
2229    ///
2230    /// # Arguments
2231    ///
2232    /// * `path` - Host's destination path (e.g., "./tarball").
2233    ///
2234    /// Path can be relative to the engine's workdir or absolute.
2235    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2236    pub async fn export_opts(
2237        &self,
2238        path: impl Into<String>,
2239        opts: ContainerExportOpts,
2240    ) -> Result<String, DaggerError> {
2241        let mut query = self.selection.select("export");
2242        query = query.arg("path", path.into());
2243        if let Some(platform_variants) = opts.platform_variants {
2244            query = query.arg("platformVariants", platform_variants);
2245        }
2246        if let Some(forced_compression) = opts.forced_compression {
2247            query = query.arg("forcedCompression", forced_compression);
2248        }
2249        if let Some(media_types) = opts.media_types {
2250            query = query.arg("mediaTypes", media_types);
2251        }
2252        if let Some(expand) = opts.expand {
2253            query = query.arg("expand", expand);
2254        }
2255        query.execute(self.graphql_client.clone()).await
2256    }
2257    /// Exports the container as an image to the host's container image store.
2258    ///
2259    /// # Arguments
2260    ///
2261    /// * `name` - Name of image to export to in the host's store
2262    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2263    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2264        let mut query = self.selection.select("exportImage");
2265        query = query.arg("name", name.into());
2266        query.execute(self.graphql_client.clone()).await
2267    }
2268    /// Exports the container as an image to the host's container image store.
2269    ///
2270    /// # Arguments
2271    ///
2272    /// * `name` - Name of image to export to in the host's store
2273    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2274    pub async fn export_image_opts(
2275        &self,
2276        name: impl Into<String>,
2277        opts: ContainerExportImageOpts,
2278    ) -> Result<Void, DaggerError> {
2279        let mut query = self.selection.select("exportImage");
2280        query = query.arg("name", name.into());
2281        if let Some(platform_variants) = opts.platform_variants {
2282            query = query.arg("platformVariants", platform_variants);
2283        }
2284        if let Some(forced_compression) = opts.forced_compression {
2285            query = query.arg("forcedCompression", forced_compression);
2286        }
2287        if let Some(media_types) = opts.media_types {
2288            query = query.arg("mediaTypes", media_types);
2289        }
2290        query.execute(self.graphql_client.clone()).await
2291    }
2292    /// Retrieves the list of exposed ports.
2293    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
2294    pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
2295        let query = self.selection.select("exposedPorts");
2296        let query = query.select("id");
2297        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2298        Ok(ids
2299            .into_iter()
2300            .map(|id| Port {
2301                proc: self.proc.clone(),
2302                selection: crate::querybuilder::query()
2303                    .select("node")
2304                    .arg("id", &id.0)
2305                    .inline_fragment("Port"),
2306                graphql_client: self.graphql_client.clone(),
2307            })
2308            .collect())
2309    }
2310    /// Retrieves a file at the given path.
2311    /// Mounts are included.
2312    ///
2313    /// # Arguments
2314    ///
2315    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2316    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2317    pub fn file(&self, path: impl Into<String>) -> File {
2318        let mut query = self.selection.select("file");
2319        query = query.arg("path", path.into());
2320        File {
2321            proc: self.proc.clone(),
2322            selection: query,
2323            graphql_client: self.graphql_client.clone(),
2324        }
2325    }
2326    /// Retrieves a file at the given path.
2327    /// Mounts are included.
2328    ///
2329    /// # Arguments
2330    ///
2331    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2332    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2333    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2334        let mut query = self.selection.select("file");
2335        query = query.arg("path", path.into());
2336        if let Some(expand) = opts.expand {
2337            query = query.arg("expand", expand);
2338        }
2339        File {
2340            proc: self.proc.clone(),
2341            selection: query,
2342            graphql_client: self.graphql_client.clone(),
2343        }
2344    }
2345    /// Download a container image, and apply it to the container state. All previous state will be lost.
2346    ///
2347    /// # Arguments
2348    ///
2349    /// * `address` - Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
2350    pub fn from(&self, address: impl Into<String>) -> Container {
2351        let mut query = self.selection.select("from");
2352        query = query.arg("address", address.into());
2353        Container {
2354            proc: self.proc.clone(),
2355            selection: query,
2356            graphql_client: self.graphql_client.clone(),
2357        }
2358    }
2359    /// A unique identifier for this Container.
2360    pub async fn id(&self) -> Result<Id, DaggerError> {
2361        let query = self.selection.select("id");
2362        query.execute(self.graphql_client.clone()).await
2363    }
2364    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
2365    pub async fn image_ref(&self) -> Result<String, DaggerError> {
2366        let query = self.selection.select("imageRef");
2367        query.execute(self.graphql_client.clone()).await
2368    }
2369    /// Reads the container from an OCI tarball.
2370    ///
2371    /// # Arguments
2372    ///
2373    /// * `source` - File to read the container from.
2374    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2375    pub fn import(&self, source: impl IntoID<Id>) -> Container {
2376        let mut query = self.selection.select("import");
2377        query = query.arg_lazy(
2378            "source",
2379            Box::new(move || {
2380                let source = source.clone();
2381                Box::pin(async move { source.into_id().await.unwrap().quote() })
2382            }),
2383        );
2384        Container {
2385            proc: self.proc.clone(),
2386            selection: query,
2387            graphql_client: self.graphql_client.clone(),
2388        }
2389    }
2390    /// Reads the container from an OCI tarball.
2391    ///
2392    /// # Arguments
2393    ///
2394    /// * `source` - File to read the container from.
2395    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2396    pub fn import_opts<'a>(
2397        &self,
2398        source: impl IntoID<Id>,
2399        opts: ContainerImportOpts<'a>,
2400    ) -> Container {
2401        let mut query = self.selection.select("import");
2402        query = query.arg_lazy(
2403            "source",
2404            Box::new(move || {
2405                let source = source.clone();
2406                Box::pin(async move { source.into_id().await.unwrap().quote() })
2407            }),
2408        );
2409        if let Some(tag) = opts.tag {
2410            query = query.arg("tag", tag);
2411        }
2412        Container {
2413            proc: self.proc.clone(),
2414            selection: query,
2415            graphql_client: self.graphql_client.clone(),
2416        }
2417    }
2418    /// Retrieves the value of the specified label.
2419    ///
2420    /// # Arguments
2421    ///
2422    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
2423    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2424        let mut query = self.selection.select("label");
2425        query = query.arg("name", name.into());
2426        query.execute(self.graphql_client.clone()).await
2427    }
2428    /// Retrieves the list of labels passed to container.
2429    pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
2430        let query = self.selection.select("labels");
2431        let query = query.select("id");
2432        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2433        Ok(ids
2434            .into_iter()
2435            .map(|id| Label {
2436                proc: self.proc.clone(),
2437                selection: crate::querybuilder::query()
2438                    .select("node")
2439                    .arg("id", &id.0)
2440                    .inline_fragment("Label"),
2441                graphql_client: self.graphql_client.clone(),
2442            })
2443            .collect())
2444    }
2445    /// Retrieves the list of paths where a directory is mounted.
2446    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2447        let query = self.selection.select("mounts");
2448        query.execute(self.graphql_client.clone()).await
2449    }
2450    /// The platform this container executes and publishes as.
2451    pub async fn platform(&self) -> Result<Platform, DaggerError> {
2452        let query = self.selection.select("platform");
2453        query.execute(self.graphql_client.clone()).await
2454    }
2455    /// Package the container state as an OCI image, and publish it to a registry
2456    /// Returns the fully qualified address of the published image, with digest
2457    ///
2458    /// # Arguments
2459    ///
2460    /// * `address` - The OCI address to publish to
2461    ///
2462    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
2463    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2464    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2465        let mut query = self.selection.select("publish");
2466        query = query.arg("address", address.into());
2467        query.execute(self.graphql_client.clone()).await
2468    }
2469    /// Package the container state as an OCI image, and publish it to a registry
2470    /// Returns the fully qualified address of the published image, with digest
2471    ///
2472    /// # Arguments
2473    ///
2474    /// * `address` - The OCI address to publish to
2475    ///
2476    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
2477    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2478    pub async fn publish_opts(
2479        &self,
2480        address: impl Into<String>,
2481        opts: ContainerPublishOpts,
2482    ) -> Result<String, DaggerError> {
2483        let mut query = self.selection.select("publish");
2484        query = query.arg("address", address.into());
2485        if let Some(platform_variants) = opts.platform_variants {
2486            query = query.arg("platformVariants", platform_variants);
2487        }
2488        if let Some(forced_compression) = opts.forced_compression {
2489            query = query.arg("forcedCompression", forced_compression);
2490        }
2491        if let Some(media_types) = opts.media_types {
2492            query = query.arg("mediaTypes", media_types);
2493        }
2494        query.execute(self.graphql_client.clone()).await
2495    }
2496    /// 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.
2497    pub fn rootfs(&self) -> Directory {
2498        let query = self.selection.select("rootfs");
2499        Directory {
2500            proc: self.proc.clone(),
2501            selection: query,
2502            graphql_client: self.graphql_client.clone(),
2503        }
2504    }
2505    /// Return file status
2506    ///
2507    /// # Arguments
2508    ///
2509    /// * `path` - Path to check (e.g., "/file.txt").
2510    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2511    pub fn stat(&self, path: impl Into<String>) -> Stat {
2512        let mut query = self.selection.select("stat");
2513        query = query.arg("path", path.into());
2514        Stat {
2515            proc: self.proc.clone(),
2516            selection: query,
2517            graphql_client: self.graphql_client.clone(),
2518        }
2519    }
2520    /// Return file status
2521    ///
2522    /// # Arguments
2523    ///
2524    /// * `path` - Path to check (e.g., "/file.txt").
2525    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2526    pub fn stat_opts(&self, path: impl Into<String>, opts: ContainerStatOpts) -> Stat {
2527        let mut query = self.selection.select("stat");
2528        query = query.arg("path", path.into());
2529        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2530            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2531        }
2532        Stat {
2533            proc: self.proc.clone(),
2534            selection: query,
2535            graphql_client: self.graphql_client.clone(),
2536        }
2537    }
2538    /// The buffered standard error stream of the last executed command
2539    /// Returns an error if no command was executed
2540    pub async fn stderr(&self) -> Result<String, DaggerError> {
2541        let query = self.selection.select("stderr");
2542        query.execute(self.graphql_client.clone()).await
2543    }
2544    /// The buffered standard output stream of the last executed command
2545    /// Returns an error if no command was executed
2546    pub async fn stdout(&self) -> Result<String, DaggerError> {
2547        let query = self.selection.select("stdout");
2548        query.execute(self.graphql_client.clone()).await
2549    }
2550    /// Forces evaluation of the pipeline in the engine.
2551    /// It doesn't run the default command if no exec has been set.
2552    pub async fn sync(&self) -> Result<Container, DaggerError> {
2553        let query = self.selection.select("sync");
2554        let id: Id = query.execute(self.graphql_client.clone()).await?;
2555        Ok(Container {
2556            proc: self.proc.clone(),
2557            selection: query
2558                .root()
2559                .select("node")
2560                .arg("id", &id.0)
2561                .inline_fragment("Container"),
2562            graphql_client: self.graphql_client.clone(),
2563        })
2564    }
2565    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2566    ///
2567    /// # Arguments
2568    ///
2569    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2570    pub fn terminal(&self) -> Container {
2571        let query = self.selection.select("terminal");
2572        Container {
2573            proc: self.proc.clone(),
2574            selection: query,
2575            graphql_client: self.graphql_client.clone(),
2576        }
2577    }
2578    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2579    ///
2580    /// # Arguments
2581    ///
2582    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2583    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2584        let mut query = self.selection.select("terminal");
2585        if let Some(cmd) = opts.cmd {
2586            query = query.arg("cmd", cmd);
2587        }
2588        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2589            query = query.arg(
2590                "experimentalPrivilegedNesting",
2591                experimental_privileged_nesting,
2592            );
2593        }
2594        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2595            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2596        }
2597        Container {
2598            proc: self.proc.clone(),
2599            selection: query,
2600            graphql_client: self.graphql_client.clone(),
2601        }
2602    }
2603    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
2604    /// Be sure to set any exposed ports before calling this api.
2605    ///
2606    /// # Arguments
2607    ///
2608    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2609    pub async fn up(&self) -> Result<Void, DaggerError> {
2610        let query = self.selection.select("up");
2611        query.execute(self.graphql_client.clone()).await
2612    }
2613    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
2614    /// Be sure to set any exposed ports before calling this api.
2615    ///
2616    /// # Arguments
2617    ///
2618    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2619    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
2620        let mut query = self.selection.select("up");
2621        if let Some(random) = opts.random {
2622            query = query.arg("random", random);
2623        }
2624        if let Some(ports) = opts.ports {
2625            query = query.arg("ports", ports);
2626        }
2627        if let Some(args) = opts.args {
2628            query = query.arg("args", args);
2629        }
2630        if let Some(use_entrypoint) = opts.use_entrypoint {
2631            query = query.arg("useEntrypoint", use_entrypoint);
2632        }
2633        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2634            query = query.arg(
2635                "experimentalPrivilegedNesting",
2636                experimental_privileged_nesting,
2637            );
2638        }
2639        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2640            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2641        }
2642        if let Some(expand) = opts.expand {
2643            query = query.arg("expand", expand);
2644        }
2645        if let Some(no_init) = opts.no_init {
2646            query = query.arg("noInit", no_init);
2647        }
2648        query.execute(self.graphql_client.clone()).await
2649    }
2650    /// Retrieves the user to be set for all commands.
2651    pub async fn user(&self) -> Result<String, DaggerError> {
2652        let query = self.selection.select("user");
2653        query.execute(self.graphql_client.clone()).await
2654    }
2655    /// Retrieves this container plus the given OCI annotation.
2656    ///
2657    /// # Arguments
2658    ///
2659    /// * `name` - The name of the annotation.
2660    /// * `value` - The value of the annotation.
2661    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2662        let mut query = self.selection.select("withAnnotation");
2663        query = query.arg("name", name.into());
2664        query = query.arg("value", value.into());
2665        Container {
2666            proc: self.proc.clone(),
2667            selection: query,
2668            graphql_client: self.graphql_client.clone(),
2669        }
2670    }
2671    /// Configures default arguments for future commands. Like CMD in Dockerfile.
2672    ///
2673    /// # Arguments
2674    ///
2675    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
2676    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
2677        let mut query = self.selection.select("withDefaultArgs");
2678        query = query.arg(
2679            "args",
2680            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2681        );
2682        Container {
2683            proc: self.proc.clone(),
2684            selection: query,
2685            graphql_client: self.graphql_client.clone(),
2686        }
2687    }
2688    /// Set the default command to invoke for the container's terminal API.
2689    ///
2690    /// # Arguments
2691    ///
2692    /// * `args` - The args of the command.
2693    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2694    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
2695        let mut query = self.selection.select("withDefaultTerminalCmd");
2696        query = query.arg(
2697            "args",
2698            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2699        );
2700        Container {
2701            proc: self.proc.clone(),
2702            selection: query,
2703            graphql_client: self.graphql_client.clone(),
2704        }
2705    }
2706    /// Set the default command to invoke for the container's terminal API.
2707    ///
2708    /// # Arguments
2709    ///
2710    /// * `args` - The args of the command.
2711    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2712    pub fn with_default_terminal_cmd_opts(
2713        &self,
2714        args: Vec<impl Into<String>>,
2715        opts: ContainerWithDefaultTerminalCmdOpts,
2716    ) -> Container {
2717        let mut query = self.selection.select("withDefaultTerminalCmd");
2718        query = query.arg(
2719            "args",
2720            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2721        );
2722        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2723            query = query.arg(
2724                "experimentalPrivilegedNesting",
2725                experimental_privileged_nesting,
2726            );
2727        }
2728        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2729            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2730        }
2731        Container {
2732            proc: self.proc.clone(),
2733            selection: query,
2734            graphql_client: self.graphql_client.clone(),
2735        }
2736    }
2737    /// Return a new container snapshot, with a directory added to its filesystem
2738    ///
2739    /// # Arguments
2740    ///
2741    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
2742    /// * `source` - Identifier of the directory to write
2743    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2744    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
2745        let mut query = self.selection.select("withDirectory");
2746        query = query.arg("path", path.into());
2747        query = query.arg_lazy(
2748            "source",
2749            Box::new(move || {
2750                let source = source.clone();
2751                Box::pin(async move { source.into_id().await.unwrap().quote() })
2752            }),
2753        );
2754        Container {
2755            proc: self.proc.clone(),
2756            selection: query,
2757            graphql_client: self.graphql_client.clone(),
2758        }
2759    }
2760    /// Return a new container snapshot, with a directory added to its filesystem
2761    ///
2762    /// # Arguments
2763    ///
2764    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
2765    /// * `source` - Identifier of the directory to write
2766    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2767    pub fn with_directory_opts<'a>(
2768        &self,
2769        path: impl Into<String>,
2770        source: impl IntoID<Id>,
2771        opts: ContainerWithDirectoryOpts<'a>,
2772    ) -> Container {
2773        let mut query = self.selection.select("withDirectory");
2774        query = query.arg("path", path.into());
2775        query = query.arg_lazy(
2776            "source",
2777            Box::new(move || {
2778                let source = source.clone();
2779                Box::pin(async move { source.into_id().await.unwrap().quote() })
2780            }),
2781        );
2782        if let Some(exclude) = opts.exclude {
2783            query = query.arg("exclude", exclude);
2784        }
2785        if let Some(include) = opts.include {
2786            query = query.arg("include", include);
2787        }
2788        if let Some(gitignore) = opts.gitignore {
2789            query = query.arg("gitignore", gitignore);
2790        }
2791        if let Some(owner) = opts.owner {
2792            query = query.arg("owner", owner);
2793        }
2794        if let Some(expand) = opts.expand {
2795            query = query.arg("expand", expand);
2796        }
2797        if let Some(permissions) = opts.permissions {
2798            query = query.arg("permissions", permissions);
2799        }
2800        Container {
2801            proc: self.proc.clone(),
2802            selection: query,
2803            graphql_client: self.graphql_client.clone(),
2804        }
2805    }
2806    /// Retrieves this container with the specificed docker healtcheck command set.
2807    ///
2808    /// # Arguments
2809    ///
2810    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
2811    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2812    pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
2813        let mut query = self.selection.select("withDockerHealthcheck");
2814        query = query.arg(
2815            "args",
2816            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2817        );
2818        Container {
2819            proc: self.proc.clone(),
2820            selection: query,
2821            graphql_client: self.graphql_client.clone(),
2822        }
2823    }
2824    /// Retrieves this container with the specificed docker healtcheck command set.
2825    ///
2826    /// # Arguments
2827    ///
2828    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
2829    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2830    pub fn with_docker_healthcheck_opts<'a>(
2831        &self,
2832        args: Vec<impl Into<String>>,
2833        opts: ContainerWithDockerHealthcheckOpts<'a>,
2834    ) -> Container {
2835        let mut query = self.selection.select("withDockerHealthcheck");
2836        query = query.arg(
2837            "args",
2838            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2839        );
2840        if let Some(shell) = opts.shell {
2841            query = query.arg("shell", shell);
2842        }
2843        if let Some(interval) = opts.interval {
2844            query = query.arg("interval", interval);
2845        }
2846        if let Some(timeout) = opts.timeout {
2847            query = query.arg("timeout", timeout);
2848        }
2849        if let Some(start_period) = opts.start_period {
2850            query = query.arg("startPeriod", start_period);
2851        }
2852        if let Some(start_interval) = opts.start_interval {
2853            query = query.arg("startInterval", start_interval);
2854        }
2855        if let Some(retries) = opts.retries {
2856            query = query.arg("retries", retries);
2857        }
2858        Container {
2859            proc: self.proc.clone(),
2860            selection: query,
2861            graphql_client: self.graphql_client.clone(),
2862        }
2863    }
2864    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
2865    ///
2866    /// # Arguments
2867    ///
2868    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
2869    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2870    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
2871        let mut query = self.selection.select("withEntrypoint");
2872        query = query.arg(
2873            "args",
2874            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2875        );
2876        Container {
2877            proc: self.proc.clone(),
2878            selection: query,
2879            graphql_client: self.graphql_client.clone(),
2880        }
2881    }
2882    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
2883    ///
2884    /// # Arguments
2885    ///
2886    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
2887    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2888    pub fn with_entrypoint_opts(
2889        &self,
2890        args: Vec<impl Into<String>>,
2891        opts: ContainerWithEntrypointOpts,
2892    ) -> Container {
2893        let mut query = self.selection.select("withEntrypoint");
2894        query = query.arg(
2895            "args",
2896            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2897        );
2898        if let Some(keep_default_args) = opts.keep_default_args {
2899            query = query.arg("keepDefaultArgs", keep_default_args);
2900        }
2901        Container {
2902            proc: self.proc.clone(),
2903            selection: query,
2904            graphql_client: self.graphql_client.clone(),
2905        }
2906    }
2907    /// Export environment variables from an env-file to the container.
2908    ///
2909    /// # Arguments
2910    ///
2911    /// * `source` - Identifier of the envfile
2912    pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
2913        let mut query = self.selection.select("withEnvFileVariables");
2914        query = query.arg_lazy(
2915            "source",
2916            Box::new(move || {
2917                let source = source.clone();
2918                Box::pin(async move { source.into_id().await.unwrap().quote() })
2919            }),
2920        );
2921        Container {
2922            proc: self.proc.clone(),
2923            selection: query,
2924            graphql_client: self.graphql_client.clone(),
2925        }
2926    }
2927    /// Set a new environment variable in the container.
2928    ///
2929    /// # Arguments
2930    ///
2931    /// * `name` - Name of the environment variable (e.g., "HOST").
2932    /// * `value` - Value of the environment variable. (e.g., "localhost").
2933    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2934    pub fn with_env_variable(
2935        &self,
2936        name: impl Into<String>,
2937        value: impl Into<String>,
2938    ) -> Container {
2939        let mut query = self.selection.select("withEnvVariable");
2940        query = query.arg("name", name.into());
2941        query = query.arg("value", value.into());
2942        Container {
2943            proc: self.proc.clone(),
2944            selection: query,
2945            graphql_client: self.graphql_client.clone(),
2946        }
2947    }
2948    /// Set a new environment variable in the container.
2949    ///
2950    /// # Arguments
2951    ///
2952    /// * `name` - Name of the environment variable (e.g., "HOST").
2953    /// * `value` - Value of the environment variable. (e.g., "localhost").
2954    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2955    pub fn with_env_variable_opts(
2956        &self,
2957        name: impl Into<String>,
2958        value: impl Into<String>,
2959        opts: ContainerWithEnvVariableOpts,
2960    ) -> Container {
2961        let mut query = self.selection.select("withEnvVariable");
2962        query = query.arg("name", name.into());
2963        query = query.arg("value", value.into());
2964        if let Some(expand) = opts.expand {
2965            query = query.arg("expand", expand);
2966        }
2967        Container {
2968            proc: self.proc.clone(),
2969            selection: query,
2970            graphql_client: self.graphql_client.clone(),
2971        }
2972    }
2973    /// Raise an error.
2974    ///
2975    /// # Arguments
2976    ///
2977    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
2978    pub fn with_error(&self, err: impl Into<String>) -> Container {
2979        let mut query = self.selection.select("withError");
2980        query = query.arg("err", err.into());
2981        Container {
2982            proc: self.proc.clone(),
2983            selection: query,
2984            graphql_client: self.graphql_client.clone(),
2985        }
2986    }
2987    /// Execute a command in the container, and return a new snapshot of the container state after execution.
2988    ///
2989    /// # Arguments
2990    ///
2991    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
2992    ///
2993    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
2994    ///
2995    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
2996    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2997    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
2998        let mut query = self.selection.select("withExec");
2999        query = query.arg(
3000            "args",
3001            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3002        );
3003        Container {
3004            proc: self.proc.clone(),
3005            selection: query,
3006            graphql_client: self.graphql_client.clone(),
3007        }
3008    }
3009    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3010    ///
3011    /// # Arguments
3012    ///
3013    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3014    ///
3015    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3016    ///
3017    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3018    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3019    pub fn with_exec_opts<'a>(
3020        &self,
3021        args: Vec<impl Into<String>>,
3022        opts: ContainerWithExecOpts<'a>,
3023    ) -> Container {
3024        let mut query = self.selection.select("withExec");
3025        query = query.arg(
3026            "args",
3027            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3028        );
3029        if let Some(use_entrypoint) = opts.use_entrypoint {
3030            query = query.arg("useEntrypoint", use_entrypoint);
3031        }
3032        if let Some(stdin) = opts.stdin {
3033            query = query.arg("stdin", stdin);
3034        }
3035        if let Some(redirect_stdin) = opts.redirect_stdin {
3036            query = query.arg("redirectStdin", redirect_stdin);
3037        }
3038        if let Some(redirect_stdout) = opts.redirect_stdout {
3039            query = query.arg("redirectStdout", redirect_stdout);
3040        }
3041        if let Some(redirect_stderr) = opts.redirect_stderr {
3042            query = query.arg("redirectStderr", redirect_stderr);
3043        }
3044        if let Some(expect) = opts.expect {
3045            query = query.arg("expect", expect);
3046        }
3047        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3048            query = query.arg(
3049                "experimentalPrivilegedNesting",
3050                experimental_privileged_nesting,
3051            );
3052        }
3053        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3054            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3055        }
3056        if let Some(expand) = opts.expand {
3057            query = query.arg("expand", expand);
3058        }
3059        if let Some(no_init) = opts.no_init {
3060            query = query.arg("noInit", no_init);
3061        }
3062        Container {
3063            proc: self.proc.clone(),
3064            selection: query,
3065            graphql_client: self.graphql_client.clone(),
3066        }
3067    }
3068    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3069    /// Exposed ports serve two purposes:
3070    /// - For health checks and introspection, when running services
3071    /// - For setting the EXPOSE OCI field when publishing the container
3072    ///
3073    /// # Arguments
3074    ///
3075    /// * `port` - Port number to expose. Example: 8080
3076    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3077    pub fn with_exposed_port(&self, port: isize) -> Container {
3078        let mut query = self.selection.select("withExposedPort");
3079        query = query.arg("port", port);
3080        Container {
3081            proc: self.proc.clone(),
3082            selection: query,
3083            graphql_client: self.graphql_client.clone(),
3084        }
3085    }
3086    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3087    /// Exposed ports serve two purposes:
3088    /// - For health checks and introspection, when running services
3089    /// - For setting the EXPOSE OCI field when publishing the container
3090    ///
3091    /// # Arguments
3092    ///
3093    /// * `port` - Port number to expose. Example: 8080
3094    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3095    pub fn with_exposed_port_opts<'a>(
3096        &self,
3097        port: isize,
3098        opts: ContainerWithExposedPortOpts<'a>,
3099    ) -> Container {
3100        let mut query = self.selection.select("withExposedPort");
3101        query = query.arg("port", port);
3102        if let Some(protocol) = opts.protocol {
3103            query = query.arg("protocol", protocol);
3104        }
3105        if let Some(description) = opts.description {
3106            query = query.arg("description", description);
3107        }
3108        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3109            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3110        }
3111        Container {
3112            proc: self.proc.clone(),
3113            selection: query,
3114            graphql_client: self.graphql_client.clone(),
3115        }
3116    }
3117    /// Return a container snapshot with a file added
3118    ///
3119    /// # Arguments
3120    ///
3121    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3122    /// * `source` - File to add
3123    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3124    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3125        let mut query = self.selection.select("withFile");
3126        query = query.arg("path", path.into());
3127        query = query.arg_lazy(
3128            "source",
3129            Box::new(move || {
3130                let source = source.clone();
3131                Box::pin(async move { source.into_id().await.unwrap().quote() })
3132            }),
3133        );
3134        Container {
3135            proc: self.proc.clone(),
3136            selection: query,
3137            graphql_client: self.graphql_client.clone(),
3138        }
3139    }
3140    /// Return a container snapshot with a file added
3141    ///
3142    /// # Arguments
3143    ///
3144    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3145    /// * `source` - File to add
3146    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3147    pub fn with_file_opts<'a>(
3148        &self,
3149        path: impl Into<String>,
3150        source: impl IntoID<Id>,
3151        opts: ContainerWithFileOpts<'a>,
3152    ) -> Container {
3153        let mut query = self.selection.select("withFile");
3154        query = query.arg("path", path.into());
3155        query = query.arg_lazy(
3156            "source",
3157            Box::new(move || {
3158                let source = source.clone();
3159                Box::pin(async move { source.into_id().await.unwrap().quote() })
3160            }),
3161        );
3162        if let Some(permissions) = opts.permissions {
3163            query = query.arg("permissions", permissions);
3164        }
3165        if let Some(owner) = opts.owner {
3166            query = query.arg("owner", owner);
3167        }
3168        if let Some(expand) = opts.expand {
3169            query = query.arg("expand", expand);
3170        }
3171        Container {
3172            proc: self.proc.clone(),
3173            selection: query,
3174            graphql_client: self.graphql_client.clone(),
3175        }
3176    }
3177    /// Retrieves this container plus the contents of the given files copied to the given path.
3178    ///
3179    /// # Arguments
3180    ///
3181    /// * `path` - Location where copied files should be placed (e.g., "/src").
3182    /// * `sources` - Identifiers of the files to copy.
3183    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3184    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
3185        let mut query = self.selection.select("withFiles");
3186        query = query.arg("path", path.into());
3187        query = query.arg("sources", sources);
3188        Container {
3189            proc: self.proc.clone(),
3190            selection: query,
3191            graphql_client: self.graphql_client.clone(),
3192        }
3193    }
3194    /// Retrieves this container plus the contents of the given files copied to the given path.
3195    ///
3196    /// # Arguments
3197    ///
3198    /// * `path` - Location where copied files should be placed (e.g., "/src").
3199    /// * `sources` - Identifiers of the files to copy.
3200    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3201    pub fn with_files_opts<'a>(
3202        &self,
3203        path: impl Into<String>,
3204        sources: Vec<Id>,
3205        opts: ContainerWithFilesOpts<'a>,
3206    ) -> Container {
3207        let mut query = self.selection.select("withFiles");
3208        query = query.arg("path", path.into());
3209        query = query.arg("sources", sources);
3210        if let Some(permissions) = opts.permissions {
3211            query = query.arg("permissions", permissions);
3212        }
3213        if let Some(owner) = opts.owner {
3214            query = query.arg("owner", owner);
3215        }
3216        if let Some(expand) = opts.expand {
3217            query = query.arg("expand", expand);
3218        }
3219        Container {
3220            proc: self.proc.clone(),
3221            selection: query,
3222            graphql_client: self.graphql_client.clone(),
3223        }
3224    }
3225    /// Retrieves this container plus the given label.
3226    ///
3227    /// # Arguments
3228    ///
3229    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3230    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
3231    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3232        let mut query = self.selection.select("withLabel");
3233        query = query.arg("name", name.into());
3234        query = query.arg("value", value.into());
3235        Container {
3236            proc: self.proc.clone(),
3237            selection: query,
3238            graphql_client: self.graphql_client.clone(),
3239        }
3240    }
3241    /// Retrieves this container plus a cache volume mounted at the given path.
3242    ///
3243    /// # Arguments
3244    ///
3245    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3246    /// * `cache` - Identifier of the cache volume to mount.
3247    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3248    pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
3249        let mut query = self.selection.select("withMountedCache");
3250        query = query.arg("path", path.into());
3251        query = query.arg_lazy(
3252            "cache",
3253            Box::new(move || {
3254                let cache = cache.clone();
3255                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3256            }),
3257        );
3258        Container {
3259            proc: self.proc.clone(),
3260            selection: query,
3261            graphql_client: self.graphql_client.clone(),
3262        }
3263    }
3264    /// Retrieves this container plus a cache volume mounted at the given path.
3265    ///
3266    /// # Arguments
3267    ///
3268    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3269    /// * `cache` - Identifier of the cache volume to mount.
3270    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3271    pub fn with_mounted_cache_opts<'a>(
3272        &self,
3273        path: impl Into<String>,
3274        cache: impl IntoID<Id>,
3275        opts: ContainerWithMountedCacheOpts<'a>,
3276    ) -> Container {
3277        let mut query = self.selection.select("withMountedCache");
3278        query = query.arg("path", path.into());
3279        query = query.arg_lazy(
3280            "cache",
3281            Box::new(move || {
3282                let cache = cache.clone();
3283                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3284            }),
3285        );
3286        if let Some(source) = opts.source {
3287            query = query.arg("source", source);
3288        }
3289        if let Some(sharing) = opts.sharing {
3290            query = query.arg("sharing", sharing);
3291        }
3292        if let Some(owner) = opts.owner {
3293            query = query.arg("owner", owner);
3294        }
3295        if let Some(expand) = opts.expand {
3296            query = query.arg("expand", expand);
3297        }
3298        Container {
3299            proc: self.proc.clone(),
3300            selection: query,
3301            graphql_client: self.graphql_client.clone(),
3302        }
3303    }
3304    /// Retrieves this container plus a directory mounted at the given path.
3305    ///
3306    /// # Arguments
3307    ///
3308    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3309    /// * `source` - Identifier of the mounted directory.
3310    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3311    pub fn with_mounted_directory(
3312        &self,
3313        path: impl Into<String>,
3314        source: impl IntoID<Id>,
3315    ) -> Container {
3316        let mut query = self.selection.select("withMountedDirectory");
3317        query = query.arg("path", path.into());
3318        query = query.arg_lazy(
3319            "source",
3320            Box::new(move || {
3321                let source = source.clone();
3322                Box::pin(async move { source.into_id().await.unwrap().quote() })
3323            }),
3324        );
3325        Container {
3326            proc: self.proc.clone(),
3327            selection: query,
3328            graphql_client: self.graphql_client.clone(),
3329        }
3330    }
3331    /// Retrieves this container plus a directory mounted at the given path.
3332    ///
3333    /// # Arguments
3334    ///
3335    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3336    /// * `source` - Identifier of the mounted directory.
3337    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3338    pub fn with_mounted_directory_opts<'a>(
3339        &self,
3340        path: impl Into<String>,
3341        source: impl IntoID<Id>,
3342        opts: ContainerWithMountedDirectoryOpts<'a>,
3343    ) -> Container {
3344        let mut query = self.selection.select("withMountedDirectory");
3345        query = query.arg("path", path.into());
3346        query = query.arg_lazy(
3347            "source",
3348            Box::new(move || {
3349                let source = source.clone();
3350                Box::pin(async move { source.into_id().await.unwrap().quote() })
3351            }),
3352        );
3353        if let Some(owner) = opts.owner {
3354            query = query.arg("owner", owner);
3355        }
3356        if let Some(read_only) = opts.read_only {
3357            query = query.arg("readOnly", read_only);
3358        }
3359        if let Some(expand) = opts.expand {
3360            query = query.arg("expand", expand);
3361        }
3362        Container {
3363            proc: self.proc.clone(),
3364            selection: query,
3365            graphql_client: self.graphql_client.clone(),
3366        }
3367    }
3368    /// Retrieves this container plus a file mounted at the given path.
3369    ///
3370    /// # Arguments
3371    ///
3372    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3373    /// * `source` - Identifier of the mounted file.
3374    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3375    pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3376        let mut query = self.selection.select("withMountedFile");
3377        query = query.arg("path", path.into());
3378        query = query.arg_lazy(
3379            "source",
3380            Box::new(move || {
3381                let source = source.clone();
3382                Box::pin(async move { source.into_id().await.unwrap().quote() })
3383            }),
3384        );
3385        Container {
3386            proc: self.proc.clone(),
3387            selection: query,
3388            graphql_client: self.graphql_client.clone(),
3389        }
3390    }
3391    /// Retrieves this container plus a file mounted at the given path.
3392    ///
3393    /// # Arguments
3394    ///
3395    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3396    /// * `source` - Identifier of the mounted file.
3397    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3398    pub fn with_mounted_file_opts<'a>(
3399        &self,
3400        path: impl Into<String>,
3401        source: impl IntoID<Id>,
3402        opts: ContainerWithMountedFileOpts<'a>,
3403    ) -> Container {
3404        let mut query = self.selection.select("withMountedFile");
3405        query = query.arg("path", path.into());
3406        query = query.arg_lazy(
3407            "source",
3408            Box::new(move || {
3409                let source = source.clone();
3410                Box::pin(async move { source.into_id().await.unwrap().quote() })
3411            }),
3412        );
3413        if let Some(owner) = opts.owner {
3414            query = query.arg("owner", owner);
3415        }
3416        if let Some(expand) = opts.expand {
3417            query = query.arg("expand", expand);
3418        }
3419        Container {
3420            proc: self.proc.clone(),
3421            selection: query,
3422            graphql_client: self.graphql_client.clone(),
3423        }
3424    }
3425    /// Retrieves this container plus a secret mounted into a file at the given path.
3426    ///
3427    /// # Arguments
3428    ///
3429    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3430    /// * `source` - Identifier of the secret to mount.
3431    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3432    pub fn with_mounted_secret(
3433        &self,
3434        path: impl Into<String>,
3435        source: impl IntoID<Id>,
3436    ) -> Container {
3437        let mut query = self.selection.select("withMountedSecret");
3438        query = query.arg("path", path.into());
3439        query = query.arg_lazy(
3440            "source",
3441            Box::new(move || {
3442                let source = source.clone();
3443                Box::pin(async move { source.into_id().await.unwrap().quote() })
3444            }),
3445        );
3446        Container {
3447            proc: self.proc.clone(),
3448            selection: query,
3449            graphql_client: self.graphql_client.clone(),
3450        }
3451    }
3452    /// Retrieves this container plus a secret mounted into a file at the given path.
3453    ///
3454    /// # Arguments
3455    ///
3456    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3457    /// * `source` - Identifier of the secret to mount.
3458    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3459    pub fn with_mounted_secret_opts<'a>(
3460        &self,
3461        path: impl Into<String>,
3462        source: impl IntoID<Id>,
3463        opts: ContainerWithMountedSecretOpts<'a>,
3464    ) -> Container {
3465        let mut query = self.selection.select("withMountedSecret");
3466        query = query.arg("path", path.into());
3467        query = query.arg_lazy(
3468            "source",
3469            Box::new(move || {
3470                let source = source.clone();
3471                Box::pin(async move { source.into_id().await.unwrap().quote() })
3472            }),
3473        );
3474        if let Some(owner) = opts.owner {
3475            query = query.arg("owner", owner);
3476        }
3477        if let Some(mode) = opts.mode {
3478            query = query.arg("mode", mode);
3479        }
3480        if let Some(expand) = opts.expand {
3481            query = query.arg("expand", expand);
3482        }
3483        Container {
3484            proc: self.proc.clone(),
3485            selection: query,
3486            graphql_client: self.graphql_client.clone(),
3487        }
3488    }
3489    /// 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.
3490    ///
3491    /// # Arguments
3492    ///
3493    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3494    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3495    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3496        let mut query = self.selection.select("withMountedTemp");
3497        query = query.arg("path", path.into());
3498        Container {
3499            proc: self.proc.clone(),
3500            selection: query,
3501            graphql_client: self.graphql_client.clone(),
3502        }
3503    }
3504    /// Retrieves this container plus a 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.
3505    ///
3506    /// # Arguments
3507    ///
3508    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3509    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3510    pub fn with_mounted_temp_opts(
3511        &self,
3512        path: impl Into<String>,
3513        opts: ContainerWithMountedTempOpts,
3514    ) -> Container {
3515        let mut query = self.selection.select("withMountedTemp");
3516        query = query.arg("path", path.into());
3517        if let Some(size) = opts.size {
3518            query = query.arg("size", size);
3519        }
3520        if let Some(expand) = opts.expand {
3521            query = query.arg("expand", expand);
3522        }
3523        Container {
3524            proc: self.proc.clone(),
3525            selection: query,
3526            graphql_client: self.graphql_client.clone(),
3527        }
3528    }
3529    /// Return a new container snapshot, with a file added to its filesystem with text content
3530    ///
3531    /// # Arguments
3532    ///
3533    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
3534    /// * `contents` - Contents of the new file. Example: "Hello world!"
3535    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3536    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3537        let mut query = self.selection.select("withNewFile");
3538        query = query.arg("path", path.into());
3539        query = query.arg("contents", contents.into());
3540        Container {
3541            proc: self.proc.clone(),
3542            selection: query,
3543            graphql_client: self.graphql_client.clone(),
3544        }
3545    }
3546    /// Return a new container snapshot, with a file added to its filesystem with text content
3547    ///
3548    /// # Arguments
3549    ///
3550    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
3551    /// * `contents` - Contents of the new file. Example: "Hello world!"
3552    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3553    pub fn with_new_file_opts<'a>(
3554        &self,
3555        path: impl Into<String>,
3556        contents: impl Into<String>,
3557        opts: ContainerWithNewFileOpts<'a>,
3558    ) -> Container {
3559        let mut query = self.selection.select("withNewFile");
3560        query = query.arg("path", path.into());
3561        query = query.arg("contents", contents.into());
3562        if let Some(permissions) = opts.permissions {
3563            query = query.arg("permissions", permissions);
3564        }
3565        if let Some(owner) = opts.owner {
3566            query = query.arg("owner", owner);
3567        }
3568        if let Some(expand) = opts.expand {
3569            query = query.arg("expand", expand);
3570        }
3571        Container {
3572            proc: self.proc.clone(),
3573            selection: query,
3574            graphql_client: self.graphql_client.clone(),
3575        }
3576    }
3577    /// Attach credentials for future publishing to a registry. Use in combination with publish
3578    ///
3579    /// # Arguments
3580    ///
3581    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
3582    /// * `username` - The username to authenticate with. Example: "alice"
3583    /// * `secret` - The API key, password or token to authenticate to this registry
3584    pub fn with_registry_auth(
3585        &self,
3586        address: impl Into<String>,
3587        username: impl Into<String>,
3588        secret: impl IntoID<Id>,
3589    ) -> Container {
3590        let mut query = self.selection.select("withRegistryAuth");
3591        query = query.arg("address", address.into());
3592        query = query.arg("username", username.into());
3593        query = query.arg_lazy(
3594            "secret",
3595            Box::new(move || {
3596                let secret = secret.clone();
3597                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3598            }),
3599        );
3600        Container {
3601            proc: self.proc.clone(),
3602            selection: query,
3603            graphql_client: self.graphql_client.clone(),
3604        }
3605    }
3606    /// Change the container's root filesystem. The previous root filesystem will be lost.
3607    ///
3608    /// # Arguments
3609    ///
3610    /// * `directory` - The new root filesystem.
3611    pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
3612        let mut query = self.selection.select("withRootfs");
3613        query = query.arg_lazy(
3614            "directory",
3615            Box::new(move || {
3616                let directory = directory.clone();
3617                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3618            }),
3619        );
3620        Container {
3621            proc: self.proc.clone(),
3622            selection: query,
3623            graphql_client: self.graphql_client.clone(),
3624        }
3625    }
3626    /// Set a new environment variable, using a secret value
3627    ///
3628    /// # Arguments
3629    ///
3630    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
3631    /// * `secret` - Identifier of the secret value.
3632    pub fn with_secret_variable(
3633        &self,
3634        name: impl Into<String>,
3635        secret: impl IntoID<Id>,
3636    ) -> Container {
3637        let mut query = self.selection.select("withSecretVariable");
3638        query = query.arg("name", name.into());
3639        query = query.arg_lazy(
3640            "secret",
3641            Box::new(move || {
3642                let secret = secret.clone();
3643                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3644            }),
3645        );
3646        Container {
3647            proc: self.proc.clone(),
3648            selection: query,
3649            graphql_client: self.graphql_client.clone(),
3650        }
3651    }
3652    /// Establish a runtime dependency from a container to a network service.
3653    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
3654    /// The service will be reachable from the container via the provided hostname alias.
3655    /// The service dependency will also convey to any files or directories produced by the container.
3656    ///
3657    /// # Arguments
3658    ///
3659    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
3660    /// * `service` - The target service
3661    pub fn with_service_binding(
3662        &self,
3663        alias: impl Into<String>,
3664        service: impl IntoID<Id>,
3665    ) -> Container {
3666        let mut query = self.selection.select("withServiceBinding");
3667        query = query.arg("alias", alias.into());
3668        query = query.arg_lazy(
3669            "service",
3670            Box::new(move || {
3671                let service = service.clone();
3672                Box::pin(async move { service.into_id().await.unwrap().quote() })
3673            }),
3674        );
3675        Container {
3676            proc: self.proc.clone(),
3677            selection: query,
3678            graphql_client: self.graphql_client.clone(),
3679        }
3680    }
3681    /// Return a snapshot with a symlink
3682    ///
3683    /// # Arguments
3684    ///
3685    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
3686    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
3687    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3688    pub fn with_symlink(
3689        &self,
3690        target: impl Into<String>,
3691        link_name: impl Into<String>,
3692    ) -> Container {
3693        let mut query = self.selection.select("withSymlink");
3694        query = query.arg("target", target.into());
3695        query = query.arg("linkName", link_name.into());
3696        Container {
3697            proc: self.proc.clone(),
3698            selection: query,
3699            graphql_client: self.graphql_client.clone(),
3700        }
3701    }
3702    /// Return a snapshot with a symlink
3703    ///
3704    /// # Arguments
3705    ///
3706    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
3707    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
3708    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3709    pub fn with_symlink_opts(
3710        &self,
3711        target: impl Into<String>,
3712        link_name: impl Into<String>,
3713        opts: ContainerWithSymlinkOpts,
3714    ) -> Container {
3715        let mut query = self.selection.select("withSymlink");
3716        query = query.arg("target", target.into());
3717        query = query.arg("linkName", link_name.into());
3718        if let Some(expand) = opts.expand {
3719            query = query.arg("expand", expand);
3720        }
3721        Container {
3722            proc: self.proc.clone(),
3723            selection: query,
3724            graphql_client: self.graphql_client.clone(),
3725        }
3726    }
3727    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
3728    ///
3729    /// # Arguments
3730    ///
3731    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
3732    /// * `source` - Identifier of the socket to forward.
3733    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3734    pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3735        let mut query = self.selection.select("withUnixSocket");
3736        query = query.arg("path", path.into());
3737        query = query.arg_lazy(
3738            "source",
3739            Box::new(move || {
3740                let source = source.clone();
3741                Box::pin(async move { source.into_id().await.unwrap().quote() })
3742            }),
3743        );
3744        Container {
3745            proc: self.proc.clone(),
3746            selection: query,
3747            graphql_client: self.graphql_client.clone(),
3748        }
3749    }
3750    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
3751    ///
3752    /// # Arguments
3753    ///
3754    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
3755    /// * `source` - Identifier of the socket to forward.
3756    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3757    pub fn with_unix_socket_opts<'a>(
3758        &self,
3759        path: impl Into<String>,
3760        source: impl IntoID<Id>,
3761        opts: ContainerWithUnixSocketOpts<'a>,
3762    ) -> Container {
3763        let mut query = self.selection.select("withUnixSocket");
3764        query = query.arg("path", path.into());
3765        query = query.arg_lazy(
3766            "source",
3767            Box::new(move || {
3768                let source = source.clone();
3769                Box::pin(async move { source.into_id().await.unwrap().quote() })
3770            }),
3771        );
3772        if let Some(owner) = opts.owner {
3773            query = query.arg("owner", owner);
3774        }
3775        if let Some(expand) = opts.expand {
3776            query = query.arg("expand", expand);
3777        }
3778        Container {
3779            proc: self.proc.clone(),
3780            selection: query,
3781            graphql_client: self.graphql_client.clone(),
3782        }
3783    }
3784    /// Retrieves this container with a different command user.
3785    ///
3786    /// # Arguments
3787    ///
3788    /// * `name` - The user to set (e.g., "root").
3789    pub fn with_user(&self, name: impl Into<String>) -> Container {
3790        let mut query = self.selection.select("withUser");
3791        query = query.arg("name", name.into());
3792        Container {
3793            proc: self.proc.clone(),
3794            selection: query,
3795            graphql_client: self.graphql_client.clone(),
3796        }
3797    }
3798    /// Set a new non-secret environment variable for future execs without invalidating exec cache when only its value changes.
3799    /// This is an expert-only escape hatch. If a volatile value affects observable exec results, stale cached results may be reused.
3800    ///
3801    /// # Arguments
3802    ///
3803    /// * `name` - Name of the volatile variable (e.g., "CI_RUN_ID").
3804    /// * `value` - Value of the volatile variable.
3805    pub fn with_volatile_variable(
3806        &self,
3807        name: impl Into<String>,
3808        value: impl Into<String>,
3809    ) -> Container {
3810        let mut query = self.selection.select("withVolatileVariable");
3811        query = query.arg("name", name.into());
3812        query = query.arg("value", value.into());
3813        Container {
3814            proc: self.proc.clone(),
3815            selection: query,
3816            graphql_client: self.graphql_client.clone(),
3817        }
3818    }
3819    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3820    ///
3821    /// # Arguments
3822    ///
3823    /// * `path` - The path to set as the working directory (e.g., "/app").
3824    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3825    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3826        let mut query = self.selection.select("withWorkdir");
3827        query = query.arg("path", path.into());
3828        Container {
3829            proc: self.proc.clone(),
3830            selection: query,
3831            graphql_client: self.graphql_client.clone(),
3832        }
3833    }
3834    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3835    ///
3836    /// # Arguments
3837    ///
3838    /// * `path` - The path to set as the working directory (e.g., "/app").
3839    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3840    pub fn with_workdir_opts(
3841        &self,
3842        path: impl Into<String>,
3843        opts: ContainerWithWorkdirOpts,
3844    ) -> Container {
3845        let mut query = self.selection.select("withWorkdir");
3846        query = query.arg("path", path.into());
3847        if let Some(expand) = opts.expand {
3848            query = query.arg("expand", expand);
3849        }
3850        Container {
3851            proc: self.proc.clone(),
3852            selection: query,
3853            graphql_client: self.graphql_client.clone(),
3854        }
3855    }
3856    /// Retrieves this container minus the given OCI annotation.
3857    ///
3858    /// # Arguments
3859    ///
3860    /// * `name` - The name of the annotation.
3861    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3862        let mut query = self.selection.select("withoutAnnotation");
3863        query = query.arg("name", name.into());
3864        Container {
3865            proc: self.proc.clone(),
3866            selection: query,
3867            graphql_client: self.graphql_client.clone(),
3868        }
3869    }
3870    /// Remove the container's default arguments.
3871    pub fn without_default_args(&self) -> Container {
3872        let query = self.selection.select("withoutDefaultArgs");
3873        Container {
3874            proc: self.proc.clone(),
3875            selection: query,
3876            graphql_client: self.graphql_client.clone(),
3877        }
3878    }
3879    /// Return a new container snapshot, with a directory removed from its filesystem
3880    ///
3881    /// # Arguments
3882    ///
3883    /// * `path` - Location of the directory to remove (e.g., ".github/").
3884    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3885    pub fn without_directory(&self, path: impl Into<String>) -> Container {
3886        let mut query = self.selection.select("withoutDirectory");
3887        query = query.arg("path", path.into());
3888        Container {
3889            proc: self.proc.clone(),
3890            selection: query,
3891            graphql_client: self.graphql_client.clone(),
3892        }
3893    }
3894    /// Return a new container snapshot, with a directory removed from its filesystem
3895    ///
3896    /// # Arguments
3897    ///
3898    /// * `path` - Location of the directory to remove (e.g., ".github/").
3899    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3900    pub fn without_directory_opts(
3901        &self,
3902        path: impl Into<String>,
3903        opts: ContainerWithoutDirectoryOpts,
3904    ) -> Container {
3905        let mut query = self.selection.select("withoutDirectory");
3906        query = query.arg("path", path.into());
3907        if let Some(expand) = opts.expand {
3908            query = query.arg("expand", expand);
3909        }
3910        Container {
3911            proc: self.proc.clone(),
3912            selection: query,
3913            graphql_client: self.graphql_client.clone(),
3914        }
3915    }
3916    /// Retrieves this container without a configured docker healtcheck command.
3917    pub fn without_docker_healthcheck(&self) -> Container {
3918        let query = self.selection.select("withoutDockerHealthcheck");
3919        Container {
3920            proc: self.proc.clone(),
3921            selection: query,
3922            graphql_client: self.graphql_client.clone(),
3923        }
3924    }
3925    /// Reset the container's OCI entrypoint.
3926    ///
3927    /// # Arguments
3928    ///
3929    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3930    pub fn without_entrypoint(&self) -> Container {
3931        let query = self.selection.select("withoutEntrypoint");
3932        Container {
3933            proc: self.proc.clone(),
3934            selection: query,
3935            graphql_client: self.graphql_client.clone(),
3936        }
3937    }
3938    /// Reset the container's OCI entrypoint.
3939    ///
3940    /// # Arguments
3941    ///
3942    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3943    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
3944        let mut query = self.selection.select("withoutEntrypoint");
3945        if let Some(keep_default_args) = opts.keep_default_args {
3946            query = query.arg("keepDefaultArgs", keep_default_args);
3947        }
3948        Container {
3949            proc: self.proc.clone(),
3950            selection: query,
3951            graphql_client: self.graphql_client.clone(),
3952        }
3953    }
3954    /// Retrieves this container minus the given environment variable.
3955    ///
3956    /// # Arguments
3957    ///
3958    /// * `name` - The name of the environment variable (e.g., "HOST").
3959    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
3960        let mut query = self.selection.select("withoutEnvVariable");
3961        query = query.arg("name", name.into());
3962        Container {
3963            proc: self.proc.clone(),
3964            selection: query,
3965            graphql_client: self.graphql_client.clone(),
3966        }
3967    }
3968    /// Unexpose a previously exposed port.
3969    ///
3970    /// # Arguments
3971    ///
3972    /// * `port` - Port number to unexpose
3973    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3974    pub fn without_exposed_port(&self, port: isize) -> Container {
3975        let mut query = self.selection.select("withoutExposedPort");
3976        query = query.arg("port", port);
3977        Container {
3978            proc: self.proc.clone(),
3979            selection: query,
3980            graphql_client: self.graphql_client.clone(),
3981        }
3982    }
3983    /// Unexpose a previously exposed port.
3984    ///
3985    /// # Arguments
3986    ///
3987    /// * `port` - Port number to unexpose
3988    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3989    pub fn without_exposed_port_opts(
3990        &self,
3991        port: isize,
3992        opts: ContainerWithoutExposedPortOpts,
3993    ) -> Container {
3994        let mut query = self.selection.select("withoutExposedPort");
3995        query = query.arg("port", port);
3996        if let Some(protocol) = opts.protocol {
3997            query = query.arg("protocol", protocol);
3998        }
3999        Container {
4000            proc: self.proc.clone(),
4001            selection: query,
4002            graphql_client: self.graphql_client.clone(),
4003        }
4004    }
4005    /// Retrieves this container with the file at the given path removed.
4006    ///
4007    /// # Arguments
4008    ///
4009    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4010    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4011    pub fn without_file(&self, path: impl Into<String>) -> Container {
4012        let mut query = self.selection.select("withoutFile");
4013        query = query.arg("path", path.into());
4014        Container {
4015            proc: self.proc.clone(),
4016            selection: query,
4017            graphql_client: self.graphql_client.clone(),
4018        }
4019    }
4020    /// Retrieves this container with the file at the given path removed.
4021    ///
4022    /// # Arguments
4023    ///
4024    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4025    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4026    pub fn without_file_opts(
4027        &self,
4028        path: impl Into<String>,
4029        opts: ContainerWithoutFileOpts,
4030    ) -> Container {
4031        let mut query = self.selection.select("withoutFile");
4032        query = query.arg("path", path.into());
4033        if let Some(expand) = opts.expand {
4034            query = query.arg("expand", expand);
4035        }
4036        Container {
4037            proc: self.proc.clone(),
4038            selection: query,
4039            graphql_client: self.graphql_client.clone(),
4040        }
4041    }
4042    /// Return a new container spanshot with specified files removed
4043    ///
4044    /// # Arguments
4045    ///
4046    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4047    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4048    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4049        let mut query = self.selection.select("withoutFiles");
4050        query = query.arg(
4051            "paths",
4052            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4053        );
4054        Container {
4055            proc: self.proc.clone(),
4056            selection: query,
4057            graphql_client: self.graphql_client.clone(),
4058        }
4059    }
4060    /// Return a new container spanshot with specified files removed
4061    ///
4062    /// # Arguments
4063    ///
4064    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4065    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4066    pub fn without_files_opts(
4067        &self,
4068        paths: Vec<impl Into<String>>,
4069        opts: ContainerWithoutFilesOpts,
4070    ) -> Container {
4071        let mut query = self.selection.select("withoutFiles");
4072        query = query.arg(
4073            "paths",
4074            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4075        );
4076        if let Some(expand) = opts.expand {
4077            query = query.arg("expand", expand);
4078        }
4079        Container {
4080            proc: self.proc.clone(),
4081            selection: query,
4082            graphql_client: self.graphql_client.clone(),
4083        }
4084    }
4085    /// Retrieves this container minus the given environment label.
4086    ///
4087    /// # Arguments
4088    ///
4089    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4090    pub fn without_label(&self, name: impl Into<String>) -> Container {
4091        let mut query = self.selection.select("withoutLabel");
4092        query = query.arg("name", name.into());
4093        Container {
4094            proc: self.proc.clone(),
4095            selection: query,
4096            graphql_client: self.graphql_client.clone(),
4097        }
4098    }
4099    /// Retrieves this container after unmounting everything at the given path.
4100    ///
4101    /// # Arguments
4102    ///
4103    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4104    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4105    pub fn without_mount(&self, path: impl Into<String>) -> Container {
4106        let mut query = self.selection.select("withoutMount");
4107        query = query.arg("path", path.into());
4108        Container {
4109            proc: self.proc.clone(),
4110            selection: query,
4111            graphql_client: self.graphql_client.clone(),
4112        }
4113    }
4114    /// Retrieves this container after unmounting everything at the given path.
4115    ///
4116    /// # Arguments
4117    ///
4118    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4119    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4120    pub fn without_mount_opts(
4121        &self,
4122        path: impl Into<String>,
4123        opts: ContainerWithoutMountOpts,
4124    ) -> Container {
4125        let mut query = self.selection.select("withoutMount");
4126        query = query.arg("path", path.into());
4127        if let Some(expand) = opts.expand {
4128            query = query.arg("expand", expand);
4129        }
4130        Container {
4131            proc: self.proc.clone(),
4132            selection: query,
4133            graphql_client: self.graphql_client.clone(),
4134        }
4135    }
4136    /// Retrieves this container without the registry authentication of a given address.
4137    ///
4138    /// # Arguments
4139    ///
4140    /// * `address` - Registry's address to remove the authentication from.
4141    ///
4142    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
4143    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4144        let mut query = self.selection.select("withoutRegistryAuth");
4145        query = query.arg("address", address.into());
4146        Container {
4147            proc: self.proc.clone(),
4148            selection: query,
4149            graphql_client: self.graphql_client.clone(),
4150        }
4151    }
4152    /// Retrieves this container minus the given environment variable containing the secret.
4153    ///
4154    /// # Arguments
4155    ///
4156    /// * `name` - The name of the environment variable (e.g., "HOST").
4157    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4158        let mut query = self.selection.select("withoutSecretVariable");
4159        query = query.arg("name", name.into());
4160        Container {
4161            proc: self.proc.clone(),
4162            selection: query,
4163            graphql_client: self.graphql_client.clone(),
4164        }
4165    }
4166    /// Retrieves this container with a previously added Unix socket removed.
4167    ///
4168    /// # Arguments
4169    ///
4170    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4171    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4172    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4173        let mut query = self.selection.select("withoutUnixSocket");
4174        query = query.arg("path", path.into());
4175        Container {
4176            proc: self.proc.clone(),
4177            selection: query,
4178            graphql_client: self.graphql_client.clone(),
4179        }
4180    }
4181    /// Retrieves this container with a previously added Unix socket removed.
4182    ///
4183    /// # Arguments
4184    ///
4185    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4186    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4187    pub fn without_unix_socket_opts(
4188        &self,
4189        path: impl Into<String>,
4190        opts: ContainerWithoutUnixSocketOpts,
4191    ) -> Container {
4192        let mut query = self.selection.select("withoutUnixSocket");
4193        query = query.arg("path", path.into());
4194        if let Some(expand) = opts.expand {
4195            query = query.arg("expand", expand);
4196        }
4197        Container {
4198            proc: self.proc.clone(),
4199            selection: query,
4200            graphql_client: self.graphql_client.clone(),
4201        }
4202    }
4203    /// Retrieves this container with an unset command user.
4204    /// Should default to root.
4205    pub fn without_user(&self) -> Container {
4206        let query = self.selection.select("withoutUser");
4207        Container {
4208            proc: self.proc.clone(),
4209            selection: query,
4210            graphql_client: self.graphql_client.clone(),
4211        }
4212    }
4213    /// Retrieves this container minus the given volatile environment variable.
4214    ///
4215    /// # Arguments
4216    ///
4217    /// * `name` - The name of the volatile environment variable (e.g., "CI_RUN_ID").
4218    pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4219        let mut query = self.selection.select("withoutVolatileVariable");
4220        query = query.arg("name", name.into());
4221        Container {
4222            proc: self.proc.clone(),
4223            selection: query,
4224            graphql_client: self.graphql_client.clone(),
4225        }
4226    }
4227    /// Unset the container's working directory.
4228    /// Should default to "/".
4229    pub fn without_workdir(&self) -> Container {
4230        let query = self.selection.select("withoutWorkdir");
4231        Container {
4232            proc: self.proc.clone(),
4233            selection: query,
4234            graphql_client: self.graphql_client.clone(),
4235        }
4236    }
4237    /// Retrieves the working directory for all commands.
4238    pub async fn workdir(&self) -> Result<String, DaggerError> {
4239        let query = self.selection.select("workdir");
4240        query.execute(self.graphql_client.clone()).await
4241    }
4242}
4243impl Exportable for Container {
4244    fn export(
4245        &self,
4246        path: impl Into<String>,
4247    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
4248        let mut query = self.selection.select("export");
4249        query = query.arg("path", path.into());
4250        let graphql_client = self.graphql_client.clone();
4251        async move { query.execute(graphql_client).await }
4252    }
4253    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4254        let query = self.selection.select("id");
4255        let graphql_client = self.graphql_client.clone();
4256        async move { query.execute(graphql_client).await }
4257    }
4258}
4259impl Node for Container {
4260    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4261        let query = self.selection.select("id");
4262        let graphql_client = self.graphql_client.clone();
4263        async move { query.execute(graphql_client).await }
4264    }
4265}
4266impl Syncer for Container {
4267    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4268        let query = self.selection.select("id");
4269        let graphql_client = self.graphql_client.clone();
4270        async move { query.execute(graphql_client).await }
4271    }
4272    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4273        let query = self.selection.select("sync");
4274        let graphql_client = self.graphql_client.clone();
4275        async move { query.execute(graphql_client).await }
4276    }
4277}
4278#[derive(Clone)]
4279pub struct CurrentModule {
4280    pub proc: Option<Arc<DaggerSessionProc>>,
4281    pub selection: Selection,
4282    pub graphql_client: DynGraphQLClient,
4283}
4284#[derive(Builder, Debug, PartialEq)]
4285pub struct CurrentModuleGeneratorsOpts<'a> {
4286    /// Only include generators matching the specified patterns
4287    #[builder(setter(into, strip_option), default)]
4288    pub include: Option<Vec<&'a str>>,
4289}
4290#[derive(Builder, Debug, PartialEq)]
4291pub struct CurrentModuleWorkdirOpts<'a> {
4292    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4293    #[builder(setter(into, strip_option), default)]
4294    pub exclude: Option<Vec<&'a str>>,
4295    /// Apply .gitignore filter rules inside the directory
4296    #[builder(setter(into, strip_option), default)]
4297    pub gitignore: Option<bool>,
4298    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4299    #[builder(setter(into, strip_option), default)]
4300    pub include: Option<Vec<&'a str>>,
4301}
4302impl IntoID<Id> for CurrentModule {
4303    fn into_id(
4304        self,
4305    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4306        Box::pin(async move { self.id().await })
4307    }
4308}
4309impl Loadable for CurrentModule {
4310    fn graphql_type() -> &'static str {
4311        "CurrentModule"
4312    }
4313    fn from_query(
4314        proc: Option<Arc<DaggerSessionProc>>,
4315        selection: Selection,
4316        graphql_client: DynGraphQLClient,
4317    ) -> Self {
4318        Self {
4319            proc,
4320            selection,
4321            graphql_client,
4322        }
4323    }
4324}
4325impl CurrentModule {
4326    /// The dependencies of the module.
4327    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
4328        let query = self.selection.select("dependencies");
4329        let query = query.select("id");
4330        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4331        Ok(ids
4332            .into_iter()
4333            .map(|id| Module {
4334                proc: self.proc.clone(),
4335                selection: crate::querybuilder::query()
4336                    .select("node")
4337                    .arg("id", &id.0)
4338                    .inline_fragment("Module"),
4339                graphql_client: self.graphql_client.clone(),
4340            })
4341            .collect())
4342    }
4343    /// The generated files and directories made on top of the module source's context directory.
4344    pub fn generated_context_directory(&self) -> Directory {
4345        let query = self.selection.select("generatedContextDirectory");
4346        Directory {
4347            proc: self.proc.clone(),
4348            selection: query,
4349            graphql_client: self.graphql_client.clone(),
4350        }
4351    }
4352    /// Return all generators defined by the module
4353    ///
4354    /// # Arguments
4355    ///
4356    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4357    pub fn generators(&self) -> GeneratorGroup {
4358        let query = self.selection.select("generators");
4359        GeneratorGroup {
4360            proc: self.proc.clone(),
4361            selection: query,
4362            graphql_client: self.graphql_client.clone(),
4363        }
4364    }
4365    /// Return all generators defined by the module
4366    ///
4367    /// # Arguments
4368    ///
4369    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4370    pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
4371        let mut query = self.selection.select("generators");
4372        if let Some(include) = opts.include {
4373            query = query.arg("include", include);
4374        }
4375        GeneratorGroup {
4376            proc: self.proc.clone(),
4377            selection: query,
4378            graphql_client: self.graphql_client.clone(),
4379        }
4380    }
4381    /// A unique identifier for this CurrentModule.
4382    pub async fn id(&self) -> Result<Id, DaggerError> {
4383        let query = self.selection.select("id");
4384        query.execute(self.graphql_client.clone()).await
4385    }
4386    /// The name of the module being executed in
4387    pub async fn name(&self) -> Result<String, DaggerError> {
4388        let query = self.selection.select("name");
4389        query.execute(self.graphql_client.clone()).await
4390    }
4391    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
4392    pub fn source(&self) -> Directory {
4393        let query = self.selection.select("source");
4394        Directory {
4395            proc: self.proc.clone(),
4396            selection: query,
4397            graphql_client: self.graphql_client.clone(),
4398        }
4399    }
4400    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4401    ///
4402    /// # Arguments
4403    ///
4404    /// * `path` - Location of the directory to access (e.g., ".").
4405    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4406    pub fn workdir(&self, path: impl Into<String>) -> Directory {
4407        let mut query = self.selection.select("workdir");
4408        query = query.arg("path", path.into());
4409        Directory {
4410            proc: self.proc.clone(),
4411            selection: query,
4412            graphql_client: self.graphql_client.clone(),
4413        }
4414    }
4415    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4416    ///
4417    /// # Arguments
4418    ///
4419    /// * `path` - Location of the directory to access (e.g., ".").
4420    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4421    pub fn workdir_opts<'a>(
4422        &self,
4423        path: impl Into<String>,
4424        opts: CurrentModuleWorkdirOpts<'a>,
4425    ) -> Directory {
4426        let mut query = self.selection.select("workdir");
4427        query = query.arg("path", path.into());
4428        if let Some(exclude) = opts.exclude {
4429            query = query.arg("exclude", exclude);
4430        }
4431        if let Some(include) = opts.include {
4432            query = query.arg("include", include);
4433        }
4434        if let Some(gitignore) = opts.gitignore {
4435            query = query.arg("gitignore", gitignore);
4436        }
4437        Directory {
4438            proc: self.proc.clone(),
4439            selection: query,
4440            graphql_client: self.graphql_client.clone(),
4441        }
4442    }
4443    /// 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.
4444    ///
4445    /// # Arguments
4446    ///
4447    /// * `path` - Location of the file to retrieve (e.g., "README.md").
4448    pub fn workdir_file(&self, path: impl Into<String>) -> File {
4449        let mut query = self.selection.select("workdirFile");
4450        query = query.arg("path", path.into());
4451        File {
4452            proc: self.proc.clone(),
4453            selection: query,
4454            graphql_client: self.graphql_client.clone(),
4455        }
4456    }
4457}
4458impl Node for CurrentModule {
4459    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4460        let query = self.selection.select("id");
4461        let graphql_client = self.graphql_client.clone();
4462        async move { query.execute(graphql_client).await }
4463    }
4464}
4465#[derive(Clone)]
4466pub struct DiffStat {
4467    pub proc: Option<Arc<DaggerSessionProc>>,
4468    pub selection: Selection,
4469    pub graphql_client: DynGraphQLClient,
4470}
4471impl IntoID<Id> for DiffStat {
4472    fn into_id(
4473        self,
4474    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4475        Box::pin(async move { self.id().await })
4476    }
4477}
4478impl Loadable for DiffStat {
4479    fn graphql_type() -> &'static str {
4480        "DiffStat"
4481    }
4482    fn from_query(
4483        proc: Option<Arc<DaggerSessionProc>>,
4484        selection: Selection,
4485        graphql_client: DynGraphQLClient,
4486    ) -> Self {
4487        Self {
4488            proc,
4489            selection,
4490            graphql_client,
4491        }
4492    }
4493}
4494impl DiffStat {
4495    /// Number of added lines for this path.
4496    pub async fn added_lines(&self) -> Result<isize, DaggerError> {
4497        let query = self.selection.select("addedLines");
4498        query.execute(self.graphql_client.clone()).await
4499    }
4500    /// A unique identifier for this DiffStat.
4501    pub async fn id(&self) -> Result<Id, DaggerError> {
4502        let query = self.selection.select("id");
4503        query.execute(self.graphql_client.clone()).await
4504    }
4505    /// Type of change.
4506    pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
4507        let query = self.selection.select("kind");
4508        query.execute(self.graphql_client.clone()).await
4509    }
4510    /// Previous path of the file, set only for renames.
4511    pub async fn old_path(&self) -> Result<String, DaggerError> {
4512        let query = self.selection.select("oldPath");
4513        query.execute(self.graphql_client.clone()).await
4514    }
4515    /// Path of the changed file or directory.
4516    pub async fn path(&self) -> Result<String, DaggerError> {
4517        let query = self.selection.select("path");
4518        query.execute(self.graphql_client.clone()).await
4519    }
4520    /// Number of removed lines for this path.
4521    pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
4522        let query = self.selection.select("removedLines");
4523        query.execute(self.graphql_client.clone()).await
4524    }
4525}
4526impl Node for DiffStat {
4527    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4528        let query = self.selection.select("id");
4529        let graphql_client = self.graphql_client.clone();
4530        async move { query.execute(graphql_client).await }
4531    }
4532}
4533#[derive(Clone)]
4534pub struct Directory {
4535    pub proc: Option<Arc<DaggerSessionProc>>,
4536    pub selection: Selection,
4537    pub graphql_client: DynGraphQLClient,
4538}
4539#[derive(Builder, Debug, PartialEq)]
4540pub struct DirectoryAsModuleOpts<'a> {
4541    /// An optional subpath of the directory which contains the module's configuration file.
4542    /// If not set, the module source code is loaded from the root of the directory.
4543    #[builder(setter(into, strip_option), default)]
4544    pub source_root_path: Option<&'a str>,
4545}
4546#[derive(Builder, Debug, PartialEq)]
4547pub struct DirectoryAsModuleSourceOpts<'a> {
4548    /// An optional subpath of the directory which contains the module's configuration file.
4549    /// If not set, the module source code is loaded from the root of the directory.
4550    #[builder(setter(into, strip_option), default)]
4551    pub source_root_path: Option<&'a str>,
4552}
4553#[derive(Builder, Debug, PartialEq)]
4554pub struct DirectoryDockerBuildOpts<'a> {
4555    /// Build arguments to use in the build.
4556    #[builder(setter(into, strip_option), default)]
4557    pub build_args: Option<Vec<BuildArg>>,
4558    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
4559    #[builder(setter(into, strip_option), default)]
4560    pub dockerfile: Option<&'a str>,
4561    /// If set, skip the automatic init process injected into containers created by RUN statements.
4562    /// 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.
4563    #[builder(setter(into, strip_option), default)]
4564    pub no_init: Option<bool>,
4565    /// The platform to build.
4566    #[builder(setter(into, strip_option), default)]
4567    pub platform: Option<Platform>,
4568    /// Secrets to pass to the build.
4569    /// They will be mounted at /run/secrets/[secret-name].
4570    #[builder(setter(into, strip_option), default)]
4571    pub secrets: Option<Vec<Id>>,
4572    /// A socket to use for SSH authentication during the build
4573    /// (e.g., for Dockerfile RUN --mount=type=ssh instructions).
4574    /// Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
4575    #[builder(setter(into, strip_option), default)]
4576    pub ssh: Option<Id>,
4577    /// Target build stage to build.
4578    #[builder(setter(into, strip_option), default)]
4579    pub target: Option<&'a str>,
4580}
4581#[derive(Builder, Debug, PartialEq)]
4582pub struct DirectoryEntriesOpts<'a> {
4583    /// Location of the directory to look at (e.g., "/src").
4584    #[builder(setter(into, strip_option), default)]
4585    pub path: Option<&'a str>,
4586}
4587#[derive(Builder, Debug, PartialEq)]
4588pub struct DirectoryExistsOpts {
4589    /// If specified, do not follow symlinks.
4590    #[builder(setter(into, strip_option), default)]
4591    pub do_not_follow_symlinks: Option<bool>,
4592    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
4593    #[builder(setter(into, strip_option), default)]
4594    pub expected_type: Option<ExistsType>,
4595}
4596#[derive(Builder, Debug, PartialEq)]
4597pub struct DirectoryExportOpts {
4598    /// 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.
4599    #[builder(setter(into, strip_option), default)]
4600    pub wipe: Option<bool>,
4601}
4602#[derive(Builder, Debug, PartialEq)]
4603pub struct DirectoryFilterOpts<'a> {
4604    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
4605    #[builder(setter(into, strip_option), default)]
4606    pub exclude: Option<Vec<&'a str>>,
4607    /// If set, apply .gitignore rules when filtering the directory.
4608    #[builder(setter(into, strip_option), default)]
4609    pub gitignore: Option<bool>,
4610    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
4611    #[builder(setter(into, strip_option), default)]
4612    pub include: Option<Vec<&'a str>>,
4613}
4614#[derive(Builder, Debug, PartialEq)]
4615pub struct DirectorySearchOpts<'a> {
4616    /// Allow the . pattern to match newlines in multiline mode.
4617    #[builder(setter(into, strip_option), default)]
4618    pub dotall: Option<bool>,
4619    /// Only return matching files, not lines and content
4620    #[builder(setter(into, strip_option), default)]
4621    pub files_only: Option<bool>,
4622    /// Glob patterns to match (e.g., "*.md")
4623    #[builder(setter(into, strip_option), default)]
4624    pub globs: Option<Vec<&'a str>>,
4625    /// Enable case-insensitive matching.
4626    #[builder(setter(into, strip_option), default)]
4627    pub insensitive: Option<bool>,
4628    /// Limit the number of results to return
4629    #[builder(setter(into, strip_option), default)]
4630    pub limit: Option<isize>,
4631    /// Interpret the pattern as a literal string instead of a regular expression.
4632    #[builder(setter(into, strip_option), default)]
4633    pub literal: Option<bool>,
4634    /// Enable searching across multiple lines.
4635    #[builder(setter(into, strip_option), default)]
4636    pub multiline: Option<bool>,
4637    /// Directory or file paths to search
4638    #[builder(setter(into, strip_option), default)]
4639    pub paths: Option<Vec<&'a str>>,
4640    /// Skip hidden files (files starting with .).
4641    #[builder(setter(into, strip_option), default)]
4642    pub skip_hidden: Option<bool>,
4643    /// Honor .gitignore, .ignore, and .rgignore files.
4644    #[builder(setter(into, strip_option), default)]
4645    pub skip_ignored: Option<bool>,
4646}
4647#[derive(Builder, Debug, PartialEq)]
4648pub struct DirectoryStatOpts {
4649    /// If specified, do not follow symlinks.
4650    #[builder(setter(into, strip_option), default)]
4651    pub do_not_follow_symlinks: Option<bool>,
4652}
4653#[derive(Builder, Debug, PartialEq)]
4654pub struct DirectoryTerminalOpts<'a> {
4655    /// If set, override the container's default terminal command and invoke these command arguments instead.
4656    #[builder(setter(into, strip_option), default)]
4657    pub cmd: Option<Vec<&'a str>>,
4658    /// If set, override the default container used for the terminal.
4659    #[builder(setter(into, strip_option), default)]
4660    pub container: Option<Id>,
4661    /// Provides Dagger access to the executed command.
4662    #[builder(setter(into, strip_option), default)]
4663    pub experimental_privileged_nesting: Option<bool>,
4664    /// 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.
4665    #[builder(setter(into, strip_option), default)]
4666    pub insecure_root_capabilities: Option<bool>,
4667}
4668#[derive(Builder, Debug, PartialEq)]
4669pub struct DirectoryWithDirectoryOpts<'a> {
4670    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4671    #[builder(setter(into, strip_option), default)]
4672    pub exclude: Option<Vec<&'a str>>,
4673    /// Apply .gitignore filter rules inside the directory
4674    #[builder(setter(into, strip_option), default)]
4675    pub gitignore: Option<bool>,
4676    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4677    #[builder(setter(into, strip_option), default)]
4678    pub include: Option<Vec<&'a str>>,
4679    /// A user:group to set for the copied directory and its contents.
4680    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
4681    /// If the group is omitted, it defaults to the same as the user.
4682    #[builder(setter(into, strip_option), default)]
4683    pub owner: Option<&'a str>,
4684    /// Permission given to the copied directory and contents (e.g., 0755).
4685    #[builder(setter(into, strip_option), default)]
4686    pub permissions: Option<isize>,
4687}
4688#[derive(Builder, Debug, PartialEq)]
4689pub struct DirectoryWithFileOpts<'a> {
4690    /// A user:group to set for the copied directory and its contents.
4691    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
4692    /// If the group is omitted, it defaults to the same as the user.
4693    #[builder(setter(into, strip_option), default)]
4694    pub owner: Option<&'a str>,
4695    /// Permission given to the copied file (e.g., 0600).
4696    #[builder(setter(into, strip_option), default)]
4697    pub permissions: Option<isize>,
4698}
4699#[derive(Builder, Debug, PartialEq)]
4700pub struct DirectoryWithFilesOpts {
4701    /// Permission given to the copied files (e.g., 0600).
4702    #[builder(setter(into, strip_option), default)]
4703    pub permissions: Option<isize>,
4704}
4705#[derive(Builder, Debug, PartialEq)]
4706pub struct DirectoryWithNewDirectoryOpts {
4707    /// Permission granted to the created directory (e.g., 0777).
4708    #[builder(setter(into, strip_option), default)]
4709    pub permissions: Option<isize>,
4710}
4711#[derive(Builder, Debug, PartialEq)]
4712pub struct DirectoryWithNewFileOpts {
4713    /// Permissions of the new file. Example: 0600
4714    #[builder(setter(into, strip_option), default)]
4715    pub permissions: Option<isize>,
4716}
4717impl IntoID<Id> for Directory {
4718    fn into_id(
4719        self,
4720    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4721        Box::pin(async move { self.id().await })
4722    }
4723}
4724impl Loadable for Directory {
4725    fn graphql_type() -> &'static str {
4726        "Directory"
4727    }
4728    fn from_query(
4729        proc: Option<Arc<DaggerSessionProc>>,
4730        selection: Selection,
4731        graphql_client: DynGraphQLClient,
4732    ) -> Self {
4733        Self {
4734            proc,
4735            selection,
4736            graphql_client,
4737        }
4738    }
4739}
4740impl Directory {
4741    /// Converts this directory to a local git repository
4742    pub fn as_git(&self) -> GitRepository {
4743        let query = self.selection.select("asGit");
4744        GitRepository {
4745            proc: self.proc.clone(),
4746            selection: query,
4747            graphql_client: self.graphql_client.clone(),
4748        }
4749    }
4750    /// Load the directory as a Dagger module source
4751    ///
4752    /// # Arguments
4753    ///
4754    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4755    pub fn as_module(&self) -> Module {
4756        let query = self.selection.select("asModule");
4757        Module {
4758            proc: self.proc.clone(),
4759            selection: query,
4760            graphql_client: self.graphql_client.clone(),
4761        }
4762    }
4763    /// Load the directory as a Dagger module source
4764    ///
4765    /// # Arguments
4766    ///
4767    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4768    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4769        let mut query = self.selection.select("asModule");
4770        if let Some(source_root_path) = opts.source_root_path {
4771            query = query.arg("sourceRootPath", source_root_path);
4772        }
4773        Module {
4774            proc: self.proc.clone(),
4775            selection: query,
4776            graphql_client: self.graphql_client.clone(),
4777        }
4778    }
4779    /// Load the directory as a Dagger module source
4780    ///
4781    /// # Arguments
4782    ///
4783    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4784    pub fn as_module_source(&self) -> ModuleSource {
4785        let query = self.selection.select("asModuleSource");
4786        ModuleSource {
4787            proc: self.proc.clone(),
4788            selection: query,
4789            graphql_client: self.graphql_client.clone(),
4790        }
4791    }
4792    /// Load the directory as a Dagger module source
4793    ///
4794    /// # Arguments
4795    ///
4796    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4797    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4798        let mut query = self.selection.select("asModuleSource");
4799        if let Some(source_root_path) = opts.source_root_path {
4800            query = query.arg("sourceRootPath", source_root_path);
4801        }
4802        ModuleSource {
4803            proc: self.proc.clone(),
4804            selection: query,
4805            graphql_client: self.graphql_client.clone(),
4806        }
4807    }
4808    /// Return the difference between this directory and another directory, typically an older snapshot.
4809    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
4810    ///
4811    /// # Arguments
4812    ///
4813    /// * `from` - The base directory snapshot to compare against
4814    pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
4815        let mut query = self.selection.select("changes");
4816        query = query.arg_lazy(
4817            "from",
4818            Box::new(move || {
4819                let from = from.clone();
4820                Box::pin(async move { from.into_id().await.unwrap().quote() })
4821            }),
4822        );
4823        Changeset {
4824            proc: self.proc.clone(),
4825            selection: query,
4826            graphql_client: self.graphql_client.clone(),
4827        }
4828    }
4829    /// Change the owner of the directory contents recursively.
4830    ///
4831    /// # Arguments
4832    ///
4833    /// * `path` - Path of the directory to change ownership of (e.g., "/").
4834    /// * `owner` - A user:group to set for the mounted directory and its contents.
4835    ///
4836    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
4837    ///
4838    /// If the group is omitted, it defaults to the same as the user.
4839    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
4840        let mut query = self.selection.select("chown");
4841        query = query.arg("path", path.into());
4842        query = query.arg("owner", owner.into());
4843        Directory {
4844            proc: self.proc.clone(),
4845            selection: query,
4846            graphql_client: self.graphql_client.clone(),
4847        }
4848    }
4849    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
4850    ///
4851    /// # Arguments
4852    ///
4853    /// * `other` - The directory to compare against
4854    pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
4855        let mut query = self.selection.select("diff");
4856        query = query.arg_lazy(
4857            "other",
4858            Box::new(move || {
4859                let other = other.clone();
4860                Box::pin(async move { other.into_id().await.unwrap().quote() })
4861            }),
4862        );
4863        Directory {
4864            proc: self.proc.clone(),
4865            selection: query,
4866            graphql_client: self.graphql_client.clone(),
4867        }
4868    }
4869    /// 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.
4870    pub async fn digest(&self) -> Result<String, DaggerError> {
4871        let query = self.selection.select("digest");
4872        query.execute(self.graphql_client.clone()).await
4873    }
4874    /// Retrieves a directory at the given path.
4875    ///
4876    /// # Arguments
4877    ///
4878    /// * `path` - Location of the directory to retrieve. Example: "/src"
4879    pub fn directory(&self, path: impl Into<String>) -> Directory {
4880        let mut query = self.selection.select("directory");
4881        query = query.arg("path", path.into());
4882        Directory {
4883            proc: self.proc.clone(),
4884            selection: query,
4885            graphql_client: self.graphql_client.clone(),
4886        }
4887    }
4888    /// 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.
4889    ///
4890    /// # Arguments
4891    ///
4892    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4893    pub fn docker_build(&self) -> Container {
4894        let query = self.selection.select("dockerBuild");
4895        Container {
4896            proc: self.proc.clone(),
4897            selection: query,
4898            graphql_client: self.graphql_client.clone(),
4899        }
4900    }
4901    /// 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.
4902    ///
4903    /// # Arguments
4904    ///
4905    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4906    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
4907        let mut query = self.selection.select("dockerBuild");
4908        if let Some(dockerfile) = opts.dockerfile {
4909            query = query.arg("dockerfile", dockerfile);
4910        }
4911        if let Some(platform) = opts.platform {
4912            query = query.arg("platform", platform);
4913        }
4914        if let Some(build_args) = opts.build_args {
4915            query = query.arg("buildArgs", build_args);
4916        }
4917        if let Some(target) = opts.target {
4918            query = query.arg("target", target);
4919        }
4920        if let Some(secrets) = opts.secrets {
4921            query = query.arg("secrets", secrets);
4922        }
4923        if let Some(no_init) = opts.no_init {
4924            query = query.arg("noInit", no_init);
4925        }
4926        if let Some(ssh) = opts.ssh {
4927            query = query.arg("ssh", ssh);
4928        }
4929        Container {
4930            proc: self.proc.clone(),
4931            selection: query,
4932            graphql_client: self.graphql_client.clone(),
4933        }
4934    }
4935    /// Returns a list of files and directories at the given path.
4936    ///
4937    /// # Arguments
4938    ///
4939    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4940    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
4941        let query = self.selection.select("entries");
4942        query.execute(self.graphql_client.clone()).await
4943    }
4944    /// Returns a list of files and directories at the given path.
4945    ///
4946    /// # Arguments
4947    ///
4948    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4949    pub async fn entries_opts<'a>(
4950        &self,
4951        opts: DirectoryEntriesOpts<'a>,
4952    ) -> Result<Vec<String>, DaggerError> {
4953        let mut query = self.selection.select("entries");
4954        if let Some(path) = opts.path {
4955            query = query.arg("path", path);
4956        }
4957        query.execute(self.graphql_client.clone()).await
4958    }
4959    /// check if a file or directory exists
4960    ///
4961    /// # Arguments
4962    ///
4963    /// * `path` - Path to check (e.g., "/file.txt").
4964    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4965    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
4966        let mut query = self.selection.select("exists");
4967        query = query.arg("path", path.into());
4968        query.execute(self.graphql_client.clone()).await
4969    }
4970    /// check if a file or directory exists
4971    ///
4972    /// # Arguments
4973    ///
4974    /// * `path` - Path to check (e.g., "/file.txt").
4975    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4976    pub async fn exists_opts(
4977        &self,
4978        path: impl Into<String>,
4979        opts: DirectoryExistsOpts,
4980    ) -> Result<bool, DaggerError> {
4981        let mut query = self.selection.select("exists");
4982        query = query.arg("path", path.into());
4983        if let Some(expected_type) = opts.expected_type {
4984            query = query.arg("expectedType", expected_type);
4985        }
4986        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
4987            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
4988        }
4989        query.execute(self.graphql_client.clone()).await
4990    }
4991    /// Writes the contents of the directory to a path on the host.
4992    ///
4993    /// # Arguments
4994    ///
4995    /// * `path` - Location of the copied directory (e.g., "logs/").
4996    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4997    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4998        let mut query = self.selection.select("export");
4999        query = query.arg("path", path.into());
5000        query.execute(self.graphql_client.clone()).await
5001    }
5002    /// Writes the contents of the directory to a path on the host.
5003    ///
5004    /// # Arguments
5005    ///
5006    /// * `path` - Location of the copied directory (e.g., "logs/").
5007    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5008    pub async fn export_opts(
5009        &self,
5010        path: impl Into<String>,
5011        opts: DirectoryExportOpts,
5012    ) -> Result<String, DaggerError> {
5013        let mut query = self.selection.select("export");
5014        query = query.arg("path", path.into());
5015        if let Some(wipe) = opts.wipe {
5016            query = query.arg("wipe", wipe);
5017        }
5018        query.execute(self.graphql_client.clone()).await
5019    }
5020    /// Retrieve a file at the given path.
5021    ///
5022    /// # Arguments
5023    ///
5024    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5025    pub fn file(&self, path: impl Into<String>) -> File {
5026        let mut query = self.selection.select("file");
5027        query = query.arg("path", path.into());
5028        File {
5029            proc: self.proc.clone(),
5030            selection: query,
5031            graphql_client: self.graphql_client.clone(),
5032        }
5033    }
5034    /// Return a snapshot with some paths included or excluded
5035    ///
5036    /// # Arguments
5037    ///
5038    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5039    pub fn filter(&self) -> Directory {
5040        let query = self.selection.select("filter");
5041        Directory {
5042            proc: self.proc.clone(),
5043            selection: query,
5044            graphql_client: self.graphql_client.clone(),
5045        }
5046    }
5047    /// Return a snapshot with some paths included or excluded
5048    ///
5049    /// # Arguments
5050    ///
5051    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5052    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5053        let mut query = self.selection.select("filter");
5054        if let Some(exclude) = opts.exclude {
5055            query = query.arg("exclude", exclude);
5056        }
5057        if let Some(include) = opts.include {
5058            query = query.arg("include", include);
5059        }
5060        if let Some(gitignore) = opts.gitignore {
5061            query = query.arg("gitignore", gitignore);
5062        }
5063        Directory {
5064            proc: self.proc.clone(),
5065            selection: query,
5066            graphql_client: self.graphql_client.clone(),
5067        }
5068    }
5069    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
5070    ///
5071    /// # Arguments
5072    ///
5073    /// * `name` - The name of the file or directory to search for
5074    /// * `start` - The path to start the search from
5075    pub async fn find_up(
5076        &self,
5077        name: impl Into<String>,
5078        start: impl Into<String>,
5079    ) -> Result<String, DaggerError> {
5080        let mut query = self.selection.select("findUp");
5081        query = query.arg("name", name.into());
5082        query = query.arg("start", start.into());
5083        query.execute(self.graphql_client.clone()).await
5084    }
5085    /// Returns a list of files and directories that matche the given pattern.
5086    ///
5087    /// # Arguments
5088    ///
5089    /// * `pattern` - Pattern to match (e.g., "*.md").
5090    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5091        let mut query = self.selection.select("glob");
5092        query = query.arg("pattern", pattern.into());
5093        query.execute(self.graphql_client.clone()).await
5094    }
5095    /// A unique identifier for this Directory.
5096    pub async fn id(&self) -> Result<Id, DaggerError> {
5097        let query = self.selection.select("id");
5098        query.execute(self.graphql_client.clone()).await
5099    }
5100    /// Returns the name of the directory.
5101    pub async fn name(&self) -> Result<String, DaggerError> {
5102        let query = self.selection.select("name");
5103        query.execute(self.graphql_client.clone()).await
5104    }
5105    /// Searches for content matching the given regular expression or literal string.
5106    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5107    ///
5108    /// # Arguments
5109    ///
5110    /// * `pattern` - The text to match.
5111    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5112    pub async fn search(
5113        &self,
5114        pattern: impl Into<String>,
5115    ) -> Result<Vec<SearchResult>, DaggerError> {
5116        let mut query = self.selection.select("search");
5117        query = query.arg("pattern", pattern.into());
5118        let query = query.select("id");
5119        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5120        Ok(ids
5121            .into_iter()
5122            .map(|id| SearchResult {
5123                proc: self.proc.clone(),
5124                selection: crate::querybuilder::query()
5125                    .select("node")
5126                    .arg("id", &id.0)
5127                    .inline_fragment("SearchResult"),
5128                graphql_client: self.graphql_client.clone(),
5129            })
5130            .collect())
5131    }
5132    /// Searches for content matching the given regular expression or literal string.
5133    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5134    ///
5135    /// # Arguments
5136    ///
5137    /// * `pattern` - The text to match.
5138    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5139    pub async fn search_opts<'a>(
5140        &self,
5141        pattern: impl Into<String>,
5142        opts: DirectorySearchOpts<'a>,
5143    ) -> Result<Vec<SearchResult>, DaggerError> {
5144        let mut query = self.selection.select("search");
5145        query = query.arg("pattern", pattern.into());
5146        if let Some(paths) = opts.paths {
5147            query = query.arg("paths", paths);
5148        }
5149        if let Some(globs) = opts.globs {
5150            query = query.arg("globs", globs);
5151        }
5152        if let Some(literal) = opts.literal {
5153            query = query.arg("literal", literal);
5154        }
5155        if let Some(multiline) = opts.multiline {
5156            query = query.arg("multiline", multiline);
5157        }
5158        if let Some(dotall) = opts.dotall {
5159            query = query.arg("dotall", dotall);
5160        }
5161        if let Some(insensitive) = opts.insensitive {
5162            query = query.arg("insensitive", insensitive);
5163        }
5164        if let Some(skip_ignored) = opts.skip_ignored {
5165            query = query.arg("skipIgnored", skip_ignored);
5166        }
5167        if let Some(skip_hidden) = opts.skip_hidden {
5168            query = query.arg("skipHidden", skip_hidden);
5169        }
5170        if let Some(files_only) = opts.files_only {
5171            query = query.arg("filesOnly", files_only);
5172        }
5173        if let Some(limit) = opts.limit {
5174            query = query.arg("limit", limit);
5175        }
5176        let query = query.select("id");
5177        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5178        Ok(ids
5179            .into_iter()
5180            .map(|id| SearchResult {
5181                proc: self.proc.clone(),
5182                selection: crate::querybuilder::query()
5183                    .select("node")
5184                    .arg("id", &id.0)
5185                    .inline_fragment("SearchResult"),
5186                graphql_client: self.graphql_client.clone(),
5187            })
5188            .collect())
5189    }
5190    /// Return file status
5191    ///
5192    /// # Arguments
5193    ///
5194    /// * `path` - Path to stat (e.g., "/file.txt").
5195    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5196    pub fn stat(&self, path: impl Into<String>) -> Stat {
5197        let mut query = self.selection.select("stat");
5198        query = query.arg("path", path.into());
5199        Stat {
5200            proc: self.proc.clone(),
5201            selection: query,
5202            graphql_client: self.graphql_client.clone(),
5203        }
5204    }
5205    /// Return file status
5206    ///
5207    /// # Arguments
5208    ///
5209    /// * `path` - Path to stat (e.g., "/file.txt").
5210    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5211    pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
5212        let mut query = self.selection.select("stat");
5213        query = query.arg("path", path.into());
5214        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5215            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5216        }
5217        Stat {
5218            proc: self.proc.clone(),
5219            selection: query,
5220            graphql_client: self.graphql_client.clone(),
5221        }
5222    }
5223    /// Force evaluation in the engine.
5224    pub async fn sync(&self) -> Result<Directory, DaggerError> {
5225        let query = self.selection.select("sync");
5226        let id: Id = query.execute(self.graphql_client.clone()).await?;
5227        Ok(Directory {
5228            proc: self.proc.clone(),
5229            selection: query
5230                .root()
5231                .select("node")
5232                .arg("id", &id.0)
5233                .inline_fragment("Directory"),
5234            graphql_client: self.graphql_client.clone(),
5235        })
5236    }
5237    /// Opens an interactive terminal in new container with this directory mounted inside.
5238    ///
5239    /// # Arguments
5240    ///
5241    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5242    pub fn terminal(&self) -> Directory {
5243        let query = self.selection.select("terminal");
5244        Directory {
5245            proc: self.proc.clone(),
5246            selection: query,
5247            graphql_client: self.graphql_client.clone(),
5248        }
5249    }
5250    /// Opens an interactive terminal in new container with this directory mounted inside.
5251    ///
5252    /// # Arguments
5253    ///
5254    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5255    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5256        let mut query = self.selection.select("terminal");
5257        if let Some(container) = opts.container {
5258            query = query.arg("container", container);
5259        }
5260        if let Some(cmd) = opts.cmd {
5261            query = query.arg("cmd", cmd);
5262        }
5263        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5264            query = query.arg(
5265                "experimentalPrivilegedNesting",
5266                experimental_privileged_nesting,
5267            );
5268        }
5269        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5270            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5271        }
5272        Directory {
5273            proc: self.proc.clone(),
5274            selection: query,
5275            graphql_client: self.graphql_client.clone(),
5276        }
5277    }
5278    /// Return a directory with changes from another directory applied to it.
5279    ///
5280    /// # Arguments
5281    ///
5282    /// * `changes` - Changes to apply to the directory
5283    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
5284        let mut query = self.selection.select("withChanges");
5285        query = query.arg_lazy(
5286            "changes",
5287            Box::new(move || {
5288                let changes = changes.clone();
5289                Box::pin(async move { changes.into_id().await.unwrap().quote() })
5290            }),
5291        );
5292        Directory {
5293            proc: self.proc.clone(),
5294            selection: query,
5295            graphql_client: self.graphql_client.clone(),
5296        }
5297    }
5298    /// Return a snapshot with a directory added
5299    ///
5300    /// # Arguments
5301    ///
5302    /// * `path` - Location of the written directory (e.g., "/src/").
5303    /// * `source` - Identifier of the directory to copy.
5304    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5305    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5306        let mut query = self.selection.select("withDirectory");
5307        query = query.arg("path", path.into());
5308        query = query.arg_lazy(
5309            "source",
5310            Box::new(move || {
5311                let source = source.clone();
5312                Box::pin(async move { source.into_id().await.unwrap().quote() })
5313            }),
5314        );
5315        Directory {
5316            proc: self.proc.clone(),
5317            selection: query,
5318            graphql_client: self.graphql_client.clone(),
5319        }
5320    }
5321    /// Return a snapshot with a directory added
5322    ///
5323    /// # Arguments
5324    ///
5325    /// * `path` - Location of the written directory (e.g., "/src/").
5326    /// * `source` - Identifier of the directory to copy.
5327    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5328    pub fn with_directory_opts<'a>(
5329        &self,
5330        path: impl Into<String>,
5331        source: impl IntoID<Id>,
5332        opts: DirectoryWithDirectoryOpts<'a>,
5333    ) -> Directory {
5334        let mut query = self.selection.select("withDirectory");
5335        query = query.arg("path", path.into());
5336        query = query.arg_lazy(
5337            "source",
5338            Box::new(move || {
5339                let source = source.clone();
5340                Box::pin(async move { source.into_id().await.unwrap().quote() })
5341            }),
5342        );
5343        if let Some(exclude) = opts.exclude {
5344            query = query.arg("exclude", exclude);
5345        }
5346        if let Some(include) = opts.include {
5347            query = query.arg("include", include);
5348        }
5349        if let Some(gitignore) = opts.gitignore {
5350            query = query.arg("gitignore", gitignore);
5351        }
5352        if let Some(owner) = opts.owner {
5353            query = query.arg("owner", owner);
5354        }
5355        if let Some(permissions) = opts.permissions {
5356            query = query.arg("permissions", permissions);
5357        }
5358        Directory {
5359            proc: self.proc.clone(),
5360            selection: query,
5361            graphql_client: self.graphql_client.clone(),
5362        }
5363    }
5364    /// Raise an error.
5365    ///
5366    /// # Arguments
5367    ///
5368    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
5369    pub fn with_error(&self, err: impl Into<String>) -> Directory {
5370        let mut query = self.selection.select("withError");
5371        query = query.arg("err", err.into());
5372        Directory {
5373            proc: self.proc.clone(),
5374            selection: query,
5375            graphql_client: self.graphql_client.clone(),
5376        }
5377    }
5378    /// Retrieves this directory plus the contents of the given file copied to the given path.
5379    ///
5380    /// # Arguments
5381    ///
5382    /// * `path` - Location of the copied file (e.g., "/file.txt").
5383    /// * `source` - Identifier of the file to copy.
5384    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5385    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5386        let mut query = self.selection.select("withFile");
5387        query = query.arg("path", path.into());
5388        query = query.arg_lazy(
5389            "source",
5390            Box::new(move || {
5391                let source = source.clone();
5392                Box::pin(async move { source.into_id().await.unwrap().quote() })
5393            }),
5394        );
5395        Directory {
5396            proc: self.proc.clone(),
5397            selection: query,
5398            graphql_client: self.graphql_client.clone(),
5399        }
5400    }
5401    /// Retrieves this directory plus the contents of the given file copied to the given path.
5402    ///
5403    /// # Arguments
5404    ///
5405    /// * `path` - Location of the copied file (e.g., "/file.txt").
5406    /// * `source` - Identifier of the file to copy.
5407    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5408    pub fn with_file_opts<'a>(
5409        &self,
5410        path: impl Into<String>,
5411        source: impl IntoID<Id>,
5412        opts: DirectoryWithFileOpts<'a>,
5413    ) -> Directory {
5414        let mut query = self.selection.select("withFile");
5415        query = query.arg("path", path.into());
5416        query = query.arg_lazy(
5417            "source",
5418            Box::new(move || {
5419                let source = source.clone();
5420                Box::pin(async move { source.into_id().await.unwrap().quote() })
5421            }),
5422        );
5423        if let Some(permissions) = opts.permissions {
5424            query = query.arg("permissions", permissions);
5425        }
5426        if let Some(owner) = opts.owner {
5427            query = query.arg("owner", owner);
5428        }
5429        Directory {
5430            proc: self.proc.clone(),
5431            selection: query,
5432            graphql_client: self.graphql_client.clone(),
5433        }
5434    }
5435    /// Retrieves this directory plus the contents of the given files copied to the given path.
5436    ///
5437    /// # Arguments
5438    ///
5439    /// * `path` - Location where copied files should be placed (e.g., "/src").
5440    /// * `sources` - Identifiers of the files to copy.
5441    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5442    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
5443        let mut query = self.selection.select("withFiles");
5444        query = query.arg("path", path.into());
5445        query = query.arg("sources", sources);
5446        Directory {
5447            proc: self.proc.clone(),
5448            selection: query,
5449            graphql_client: self.graphql_client.clone(),
5450        }
5451    }
5452    /// Retrieves this directory plus the contents of the given files copied to the given path.
5453    ///
5454    /// # Arguments
5455    ///
5456    /// * `path` - Location where copied files should be placed (e.g., "/src").
5457    /// * `sources` - Identifiers of the files to copy.
5458    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5459    pub fn with_files_opts(
5460        &self,
5461        path: impl Into<String>,
5462        sources: Vec<Id>,
5463        opts: DirectoryWithFilesOpts,
5464    ) -> Directory {
5465        let mut query = self.selection.select("withFiles");
5466        query = query.arg("path", path.into());
5467        query = query.arg("sources", sources);
5468        if let Some(permissions) = opts.permissions {
5469            query = query.arg("permissions", permissions);
5470        }
5471        Directory {
5472            proc: self.proc.clone(),
5473            selection: query,
5474            graphql_client: self.graphql_client.clone(),
5475        }
5476    }
5477    /// Retrieves this directory plus a new directory created at the given path.
5478    ///
5479    /// # Arguments
5480    ///
5481    /// * `path` - Location of the directory created (e.g., "/logs").
5482    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5483    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5484        let mut query = self.selection.select("withNewDirectory");
5485        query = query.arg("path", path.into());
5486        Directory {
5487            proc: self.proc.clone(),
5488            selection: query,
5489            graphql_client: self.graphql_client.clone(),
5490        }
5491    }
5492    /// Retrieves this directory plus a new directory created at the given path.
5493    ///
5494    /// # Arguments
5495    ///
5496    /// * `path` - Location of the directory created (e.g., "/logs").
5497    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5498    pub fn with_new_directory_opts(
5499        &self,
5500        path: impl Into<String>,
5501        opts: DirectoryWithNewDirectoryOpts,
5502    ) -> Directory {
5503        let mut query = self.selection.select("withNewDirectory");
5504        query = query.arg("path", path.into());
5505        if let Some(permissions) = opts.permissions {
5506            query = query.arg("permissions", permissions);
5507        }
5508        Directory {
5509            proc: self.proc.clone(),
5510            selection: query,
5511            graphql_client: self.graphql_client.clone(),
5512        }
5513    }
5514    /// Return a snapshot with a new file added
5515    ///
5516    /// # Arguments
5517    ///
5518    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5519    /// * `contents` - Contents of the new file. Example: "Hello world!"
5520    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5521    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5522        let mut query = self.selection.select("withNewFile");
5523        query = query.arg("path", path.into());
5524        query = query.arg("contents", contents.into());
5525        Directory {
5526            proc: self.proc.clone(),
5527            selection: query,
5528            graphql_client: self.graphql_client.clone(),
5529        }
5530    }
5531    /// Return a snapshot with a new file added
5532    ///
5533    /// # Arguments
5534    ///
5535    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5536    /// * `contents` - Contents of the new file. Example: "Hello world!"
5537    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5538    pub fn with_new_file_opts(
5539        &self,
5540        path: impl Into<String>,
5541        contents: impl Into<String>,
5542        opts: DirectoryWithNewFileOpts,
5543    ) -> Directory {
5544        let mut query = self.selection.select("withNewFile");
5545        query = query.arg("path", path.into());
5546        query = query.arg("contents", contents.into());
5547        if let Some(permissions) = opts.permissions {
5548            query = query.arg("permissions", permissions);
5549        }
5550        Directory {
5551            proc: self.proc.clone(),
5552            selection: query,
5553            graphql_client: self.graphql_client.clone(),
5554        }
5555    }
5556    /// Retrieves this directory with the given Git-compatible patch applied.
5557    ///
5558    /// # Arguments
5559    ///
5560    /// * `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").
5561    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5562        let mut query = self.selection.select("withPatch");
5563        query = query.arg("patch", patch.into());
5564        Directory {
5565            proc: self.proc.clone(),
5566            selection: query,
5567            graphql_client: self.graphql_client.clone(),
5568        }
5569    }
5570    /// Retrieves this directory with the given Git-compatible patch file applied.
5571    ///
5572    /// # Arguments
5573    ///
5574    /// * `patch` - File containing the patch to apply
5575    pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
5576        let mut query = self.selection.select("withPatchFile");
5577        query = query.arg_lazy(
5578            "patch",
5579            Box::new(move || {
5580                let patch = patch.clone();
5581                Box::pin(async move { patch.into_id().await.unwrap().quote() })
5582            }),
5583        );
5584        Directory {
5585            proc: self.proc.clone(),
5586            selection: query,
5587            graphql_client: self.graphql_client.clone(),
5588        }
5589    }
5590    /// Return a snapshot with a symlink
5591    ///
5592    /// # Arguments
5593    ///
5594    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5595    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5596    pub fn with_symlink(
5597        &self,
5598        target: impl Into<String>,
5599        link_name: impl Into<String>,
5600    ) -> Directory {
5601        let mut query = self.selection.select("withSymlink");
5602        query = query.arg("target", target.into());
5603        query = query.arg("linkName", link_name.into());
5604        Directory {
5605            proc: self.proc.clone(),
5606            selection: query,
5607            graphql_client: self.graphql_client.clone(),
5608        }
5609    }
5610    /// Retrieves this directory with all file/dir timestamps set to the given time.
5611    ///
5612    /// # Arguments
5613    ///
5614    /// * `timestamp` - Timestamp to set dir/files in.
5615    ///
5616    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
5617    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5618        let mut query = self.selection.select("withTimestamps");
5619        query = query.arg("timestamp", timestamp);
5620        Directory {
5621            proc: self.proc.clone(),
5622            selection: query,
5623            graphql_client: self.graphql_client.clone(),
5624        }
5625    }
5626    /// Return a snapshot with a subdirectory removed
5627    ///
5628    /// # Arguments
5629    ///
5630    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
5631    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5632        let mut query = self.selection.select("withoutDirectory");
5633        query = query.arg("path", path.into());
5634        Directory {
5635            proc: self.proc.clone(),
5636            selection: query,
5637            graphql_client: self.graphql_client.clone(),
5638        }
5639    }
5640    /// Return a snapshot with a file removed
5641    ///
5642    /// # Arguments
5643    ///
5644    /// * `path` - Path of the file to remove (e.g., "/file.txt").
5645    pub fn without_file(&self, path: impl Into<String>) -> Directory {
5646        let mut query = self.selection.select("withoutFile");
5647        query = query.arg("path", path.into());
5648        Directory {
5649            proc: self.proc.clone(),
5650            selection: query,
5651            graphql_client: self.graphql_client.clone(),
5652        }
5653    }
5654    /// Return a snapshot with files removed
5655    ///
5656    /// # Arguments
5657    ///
5658    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
5659    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5660        let mut query = self.selection.select("withoutFiles");
5661        query = query.arg(
5662            "paths",
5663            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5664        );
5665        Directory {
5666            proc: self.proc.clone(),
5667            selection: query,
5668            graphql_client: self.graphql_client.clone(),
5669        }
5670    }
5671}
5672impl Exportable for Directory {
5673    fn export(
5674        &self,
5675        path: impl Into<String>,
5676    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
5677        let mut query = self.selection.select("export");
5678        query = query.arg("path", path.into());
5679        let graphql_client = self.graphql_client.clone();
5680        async move { query.execute(graphql_client).await }
5681    }
5682    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5683        let query = self.selection.select("id");
5684        let graphql_client = self.graphql_client.clone();
5685        async move { query.execute(graphql_client).await }
5686    }
5687}
5688impl Node for Directory {
5689    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5690        let query = self.selection.select("id");
5691        let graphql_client = self.graphql_client.clone();
5692        async move { query.execute(graphql_client).await }
5693    }
5694}
5695impl Syncer for Directory {
5696    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5697        let query = self.selection.select("id");
5698        let graphql_client = self.graphql_client.clone();
5699        async move { query.execute(graphql_client).await }
5700    }
5701    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5702        let query = self.selection.select("sync");
5703        let graphql_client = self.graphql_client.clone();
5704        async move { query.execute(graphql_client).await }
5705    }
5706}
5707#[derive(Clone)]
5708pub struct Engine {
5709    pub proc: Option<Arc<DaggerSessionProc>>,
5710    pub selection: Selection,
5711    pub graphql_client: DynGraphQLClient,
5712}
5713impl IntoID<Id> for Engine {
5714    fn into_id(
5715        self,
5716    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5717        Box::pin(async move { self.id().await })
5718    }
5719}
5720impl Loadable for Engine {
5721    fn graphql_type() -> &'static str {
5722        "Engine"
5723    }
5724    fn from_query(
5725        proc: Option<Arc<DaggerSessionProc>>,
5726        selection: Selection,
5727        graphql_client: DynGraphQLClient,
5728    ) -> Self {
5729        Self {
5730            proc,
5731            selection,
5732            graphql_client,
5733        }
5734    }
5735}
5736impl Engine {
5737    /// The list of connected client IDs
5738    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
5739        let query = self.selection.select("clients");
5740        query.execute(self.graphql_client.clone()).await
5741    }
5742    /// A unique identifier for this Engine.
5743    pub async fn id(&self) -> Result<Id, DaggerError> {
5744        let query = self.selection.select("id");
5745        query.execute(self.graphql_client.clone()).await
5746    }
5747    /// The local engine cache state tracked by dagql
5748    pub fn local_cache(&self) -> EngineCache {
5749        let query = self.selection.select("localCache");
5750        EngineCache {
5751            proc: self.proc.clone(),
5752            selection: query,
5753            graphql_client: self.graphql_client.clone(),
5754        }
5755    }
5756    /// The name of the engine instance.
5757    pub async fn name(&self) -> Result<String, DaggerError> {
5758        let query = self.selection.select("name");
5759        query.execute(self.graphql_client.clone()).await
5760    }
5761}
5762impl Node for Engine {
5763    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5764        let query = self.selection.select("id");
5765        let graphql_client = self.graphql_client.clone();
5766        async move { query.execute(graphql_client).await }
5767    }
5768}
5769#[derive(Clone)]
5770pub struct EngineCache {
5771    pub proc: Option<Arc<DaggerSessionProc>>,
5772    pub selection: Selection,
5773    pub graphql_client: DynGraphQLClient,
5774}
5775#[derive(Builder, Debug, PartialEq)]
5776pub struct EngineCacheEntrySetOpts<'a> {
5777    #[builder(setter(into, strip_option), default)]
5778    pub key: Option<&'a str>,
5779}
5780#[derive(Builder, Debug, PartialEq)]
5781pub struct EngineCachePruneOpts<'a> {
5782    /// Override the maximum disk space to keep before pruning (e.g. "200GB" or "80%").
5783    #[builder(setter(into, strip_option), default)]
5784    pub max_used_space: Option<&'a str>,
5785    /// Override the minimum free disk space target during pruning (e.g. "20GB" or "20%").
5786    #[builder(setter(into, strip_option), default)]
5787    pub min_free_space: Option<&'a str>,
5788    /// Override the minimum disk space to retain during pruning (e.g. "500GB" or "10%").
5789    #[builder(setter(into, strip_option), default)]
5790    pub reserved_space: Option<&'a str>,
5791    /// Override the target disk space to keep after pruning (e.g. "200GB" or "50%").
5792    #[builder(setter(into, strip_option), default)]
5793    pub target_space: Option<&'a str>,
5794    /// Use the engine-wide default pruning policy if true, otherwise prune the whole cache of any releasable entries.
5795    #[builder(setter(into, strip_option), default)]
5796    pub use_default_policy: Option<bool>,
5797}
5798impl IntoID<Id> for EngineCache {
5799    fn into_id(
5800        self,
5801    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5802        Box::pin(async move { self.id().await })
5803    }
5804}
5805impl Loadable for EngineCache {
5806    fn graphql_type() -> &'static str {
5807        "EngineCache"
5808    }
5809    fn from_query(
5810        proc: Option<Arc<DaggerSessionProc>>,
5811        selection: Selection,
5812        graphql_client: DynGraphQLClient,
5813    ) -> Self {
5814        Self {
5815            proc,
5816            selection,
5817            graphql_client,
5818        }
5819    }
5820}
5821impl EngineCache {
5822    /// The current set of entries in the cache
5823    ///
5824    /// # Arguments
5825    ///
5826    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5827    pub fn entry_set(&self) -> EngineCacheEntrySet {
5828        let query = self.selection.select("entrySet");
5829        EngineCacheEntrySet {
5830            proc: self.proc.clone(),
5831            selection: query,
5832            graphql_client: self.graphql_client.clone(),
5833        }
5834    }
5835    /// The current set of entries in the cache
5836    ///
5837    /// # Arguments
5838    ///
5839    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5840    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5841        let mut query = self.selection.select("entrySet");
5842        if let Some(key) = opts.key {
5843            query = query.arg("key", key);
5844        }
5845        EngineCacheEntrySet {
5846            proc: self.proc.clone(),
5847            selection: query,
5848            graphql_client: self.graphql_client.clone(),
5849        }
5850    }
5851    /// A unique identifier for this EngineCache.
5852    pub async fn id(&self) -> Result<Id, DaggerError> {
5853        let query = self.selection.select("id");
5854        query.execute(self.graphql_client.clone()).await
5855    }
5856    /// The maximum bytes to keep in the cache without pruning.
5857    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5858        let query = self.selection.select("maxUsedSpace");
5859        query.execute(self.graphql_client.clone()).await
5860    }
5861    /// The target amount of free disk space the garbage collector will attempt to leave.
5862    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5863        let query = self.selection.select("minFreeSpace");
5864        query.execute(self.graphql_client.clone()).await
5865    }
5866    /// Prune the cache of releaseable entries
5867    ///
5868    /// # Arguments
5869    ///
5870    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5871    pub async fn prune(&self) -> Result<Void, DaggerError> {
5872        let query = self.selection.select("prune");
5873        query.execute(self.graphql_client.clone()).await
5874    }
5875    /// Prune the cache of releaseable entries
5876    ///
5877    /// # Arguments
5878    ///
5879    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5880    pub async fn prune_opts<'a>(
5881        &self,
5882        opts: EngineCachePruneOpts<'a>,
5883    ) -> Result<Void, DaggerError> {
5884        let mut query = self.selection.select("prune");
5885        if let Some(use_default_policy) = opts.use_default_policy {
5886            query = query.arg("useDefaultPolicy", use_default_policy);
5887        }
5888        if let Some(max_used_space) = opts.max_used_space {
5889            query = query.arg("maxUsedSpace", max_used_space);
5890        }
5891        if let Some(reserved_space) = opts.reserved_space {
5892            query = query.arg("reservedSpace", reserved_space);
5893        }
5894        if let Some(min_free_space) = opts.min_free_space {
5895            query = query.arg("minFreeSpace", min_free_space);
5896        }
5897        if let Some(target_space) = opts.target_space {
5898            query = query.arg("targetSpace", target_space);
5899        }
5900        query.execute(self.graphql_client.clone()).await
5901    }
5902    /// The minimum amount of disk space this policy is guaranteed to retain.
5903    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
5904        let query = self.selection.select("reservedSpace");
5905        query.execute(self.graphql_client.clone()).await
5906    }
5907    /// The target number of bytes to keep when pruning.
5908    pub async fn target_space(&self) -> Result<isize, DaggerError> {
5909        let query = self.selection.select("targetSpace");
5910        query.execute(self.graphql_client.clone()).await
5911    }
5912}
5913impl Node for EngineCache {
5914    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5915        let query = self.selection.select("id");
5916        let graphql_client = self.graphql_client.clone();
5917        async move { query.execute(graphql_client).await }
5918    }
5919}
5920#[derive(Clone)]
5921pub struct EngineCacheEntry {
5922    pub proc: Option<Arc<DaggerSessionProc>>,
5923    pub selection: Selection,
5924    pub graphql_client: DynGraphQLClient,
5925}
5926impl IntoID<Id> for EngineCacheEntry {
5927    fn into_id(
5928        self,
5929    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5930        Box::pin(async move { self.id().await })
5931    }
5932}
5933impl Loadable for EngineCacheEntry {
5934    fn graphql_type() -> &'static str {
5935        "EngineCacheEntry"
5936    }
5937    fn from_query(
5938        proc: Option<Arc<DaggerSessionProc>>,
5939        selection: Selection,
5940        graphql_client: DynGraphQLClient,
5941    ) -> Self {
5942        Self {
5943            proc,
5944            selection,
5945            graphql_client,
5946        }
5947    }
5948}
5949impl EngineCacheEntry {
5950    /// Whether the cache entry is actively being used.
5951    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
5952        let query = self.selection.select("activelyUsed");
5953        query.execute(self.graphql_client.clone()).await
5954    }
5955    /// The time the cache entry was created, in Unix nanoseconds.
5956    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
5957        let query = self.selection.select("createdTimeUnixNano");
5958        query.execute(self.graphql_client.clone()).await
5959    }
5960    /// The DagQL call that produced this cache entry.
5961    pub async fn dagql_call(&self) -> Result<String, DaggerError> {
5962        let query = self.selection.select("dagqlCall");
5963        query.execute(self.graphql_client.clone()).await
5964    }
5965    /// The description of the cache entry.
5966    pub async fn description(&self) -> Result<String, DaggerError> {
5967        let query = self.selection.select("description");
5968        query.execute(self.graphql_client.clone()).await
5969    }
5970    /// The disk space used by the cache entry.
5971    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5972        let query = self.selection.select("diskSpaceBytes");
5973        query.execute(self.graphql_client.clone()).await
5974    }
5975    /// A unique identifier for this EngineCacheEntry.
5976    pub async fn id(&self) -> Result<Id, DaggerError> {
5977        let query = self.selection.select("id");
5978        query.execute(self.graphql_client.clone()).await
5979    }
5980    /// The most recent time the cache entry was used, in Unix nanoseconds.
5981    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
5982        let query = self.selection.select("mostRecentUseTimeUnixNano");
5983        query.execute(self.graphql_client.clone()).await
5984    }
5985    /// The type of the cache record (e.g. regular, internal, frontend, source.local, source.git.checkout, exec.cachemount).
5986    pub async fn record_type(&self) -> Result<String, DaggerError> {
5987        let query = self.selection.select("recordType");
5988        query.execute(self.graphql_client.clone()).await
5989    }
5990    /// The storage record types represented by this cache entry.
5991    pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
5992        let query = self.selection.select("recordTypes");
5993        query.execute(self.graphql_client.clone()).await
5994    }
5995}
5996impl Node for EngineCacheEntry {
5997    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5998        let query = self.selection.select("id");
5999        let graphql_client = self.graphql_client.clone();
6000        async move { query.execute(graphql_client).await }
6001    }
6002}
6003#[derive(Clone)]
6004pub struct EngineCacheEntrySet {
6005    pub proc: Option<Arc<DaggerSessionProc>>,
6006    pub selection: Selection,
6007    pub graphql_client: DynGraphQLClient,
6008}
6009impl IntoID<Id> for EngineCacheEntrySet {
6010    fn into_id(
6011        self,
6012    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6013        Box::pin(async move { self.id().await })
6014    }
6015}
6016impl Loadable for EngineCacheEntrySet {
6017    fn graphql_type() -> &'static str {
6018        "EngineCacheEntrySet"
6019    }
6020    fn from_query(
6021        proc: Option<Arc<DaggerSessionProc>>,
6022        selection: Selection,
6023        graphql_client: DynGraphQLClient,
6024    ) -> Self {
6025        Self {
6026            proc,
6027            selection,
6028            graphql_client,
6029        }
6030    }
6031}
6032impl EngineCacheEntrySet {
6033    /// The total disk space used by the cache entries in this set.
6034    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6035        let query = self.selection.select("diskSpaceBytes");
6036        query.execute(self.graphql_client.clone()).await
6037    }
6038    /// The list of individual cache entries in the set
6039    pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
6040        let query = self.selection.select("entries");
6041        let query = query.select("id");
6042        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6043        Ok(ids
6044            .into_iter()
6045            .map(|id| EngineCacheEntry {
6046                proc: self.proc.clone(),
6047                selection: crate::querybuilder::query()
6048                    .select("node")
6049                    .arg("id", &id.0)
6050                    .inline_fragment("EngineCacheEntry"),
6051                graphql_client: self.graphql_client.clone(),
6052            })
6053            .collect())
6054    }
6055    /// The number of cache entries in this set.
6056    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6057        let query = self.selection.select("entryCount");
6058        query.execute(self.graphql_client.clone()).await
6059    }
6060    /// A unique identifier for this EngineCacheEntrySet.
6061    pub async fn id(&self) -> Result<Id, DaggerError> {
6062        let query = self.selection.select("id");
6063        query.execute(self.graphql_client.clone()).await
6064    }
6065}
6066impl Node for EngineCacheEntrySet {
6067    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6068        let query = self.selection.select("id");
6069        let graphql_client = self.graphql_client.clone();
6070        async move { query.execute(graphql_client).await }
6071    }
6072}
6073#[derive(Clone)]
6074pub struct EnumTypeDef {
6075    pub proc: Option<Arc<DaggerSessionProc>>,
6076    pub selection: Selection,
6077    pub graphql_client: DynGraphQLClient,
6078}
6079impl IntoID<Id> for EnumTypeDef {
6080    fn into_id(
6081        self,
6082    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6083        Box::pin(async move { self.id().await })
6084    }
6085}
6086impl Loadable for EnumTypeDef {
6087    fn graphql_type() -> &'static str {
6088        "EnumTypeDef"
6089    }
6090    fn from_query(
6091        proc: Option<Arc<DaggerSessionProc>>,
6092        selection: Selection,
6093        graphql_client: DynGraphQLClient,
6094    ) -> Self {
6095        Self {
6096            proc,
6097            selection,
6098            graphql_client,
6099        }
6100    }
6101}
6102impl EnumTypeDef {
6103    /// A doc string for the enum, if any.
6104    pub async fn description(&self) -> Result<String, DaggerError> {
6105        let query = self.selection.select("description");
6106        query.execute(self.graphql_client.clone()).await
6107    }
6108    /// A unique identifier for this EnumTypeDef.
6109    pub async fn id(&self) -> Result<Id, DaggerError> {
6110        let query = self.selection.select("id");
6111        query.execute(self.graphql_client.clone()).await
6112    }
6113    /// The members of the enum.
6114    pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6115        let query = self.selection.select("members");
6116        let query = query.select("id");
6117        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6118        Ok(ids
6119            .into_iter()
6120            .map(|id| EnumValueTypeDef {
6121                proc: self.proc.clone(),
6122                selection: crate::querybuilder::query()
6123                    .select("node")
6124                    .arg("id", &id.0)
6125                    .inline_fragment("EnumValueTypeDef"),
6126                graphql_client: self.graphql_client.clone(),
6127            })
6128            .collect())
6129    }
6130    /// The name of the enum.
6131    pub async fn name(&self) -> Result<String, DaggerError> {
6132        let query = self.selection.select("name");
6133        query.execute(self.graphql_client.clone()).await
6134    }
6135    /// The location of this enum declaration.
6136    pub fn source_map(&self) -> SourceMap {
6137        let query = self.selection.select("sourceMap");
6138        SourceMap {
6139            proc: self.proc.clone(),
6140            selection: query,
6141            graphql_client: self.graphql_client.clone(),
6142        }
6143    }
6144    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
6145    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6146        let query = self.selection.select("sourceModuleName");
6147        query.execute(self.graphql_client.clone()).await
6148    }
6149    /// The members of the enum.
6150    pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6151        let query = self.selection.select("values");
6152        let query = query.select("id");
6153        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6154        Ok(ids
6155            .into_iter()
6156            .map(|id| EnumValueTypeDef {
6157                proc: self.proc.clone(),
6158                selection: crate::querybuilder::query()
6159                    .select("node")
6160                    .arg("id", &id.0)
6161                    .inline_fragment("EnumValueTypeDef"),
6162                graphql_client: self.graphql_client.clone(),
6163            })
6164            .collect())
6165    }
6166}
6167impl Node for EnumTypeDef {
6168    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6169        let query = self.selection.select("id");
6170        let graphql_client = self.graphql_client.clone();
6171        async move { query.execute(graphql_client).await }
6172    }
6173}
6174#[derive(Clone)]
6175pub struct EnumValueTypeDef {
6176    pub proc: Option<Arc<DaggerSessionProc>>,
6177    pub selection: Selection,
6178    pub graphql_client: DynGraphQLClient,
6179}
6180impl IntoID<Id> for EnumValueTypeDef {
6181    fn into_id(
6182        self,
6183    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6184        Box::pin(async move { self.id().await })
6185    }
6186}
6187impl Loadable for EnumValueTypeDef {
6188    fn graphql_type() -> &'static str {
6189        "EnumValueTypeDef"
6190    }
6191    fn from_query(
6192        proc: Option<Arc<DaggerSessionProc>>,
6193        selection: Selection,
6194        graphql_client: DynGraphQLClient,
6195    ) -> Self {
6196        Self {
6197            proc,
6198            selection,
6199            graphql_client,
6200        }
6201    }
6202}
6203impl EnumValueTypeDef {
6204    /// The reason this enum member is deprecated, if any.
6205    pub async fn deprecated(&self) -> Result<String, DaggerError> {
6206        let query = self.selection.select("deprecated");
6207        query.execute(self.graphql_client.clone()).await
6208    }
6209    /// A doc string for the enum member, if any.
6210    pub async fn description(&self) -> Result<String, DaggerError> {
6211        let query = self.selection.select("description");
6212        query.execute(self.graphql_client.clone()).await
6213    }
6214    /// A unique identifier for this EnumValueTypeDef.
6215    pub async fn id(&self) -> Result<Id, DaggerError> {
6216        let query = self.selection.select("id");
6217        query.execute(self.graphql_client.clone()).await
6218    }
6219    /// The name of the enum member.
6220    pub async fn name(&self) -> Result<String, DaggerError> {
6221        let query = self.selection.select("name");
6222        query.execute(self.graphql_client.clone()).await
6223    }
6224    /// The location of this enum member declaration.
6225    pub fn source_map(&self) -> SourceMap {
6226        let query = self.selection.select("sourceMap");
6227        SourceMap {
6228            proc: self.proc.clone(),
6229            selection: query,
6230            graphql_client: self.graphql_client.clone(),
6231        }
6232    }
6233    /// The value of the enum member
6234    pub async fn value(&self) -> Result<String, DaggerError> {
6235        let query = self.selection.select("value");
6236        query.execute(self.graphql_client.clone()).await
6237    }
6238}
6239impl Node for EnumValueTypeDef {
6240    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6241        let query = self.selection.select("id");
6242        let graphql_client = self.graphql_client.clone();
6243        async move { query.execute(graphql_client).await }
6244    }
6245}
6246#[derive(Clone)]
6247pub struct Env {
6248    pub proc: Option<Arc<DaggerSessionProc>>,
6249    pub selection: Selection,
6250    pub graphql_client: DynGraphQLClient,
6251}
6252#[derive(Builder, Debug, PartialEq)]
6253pub struct EnvChecksOpts<'a> {
6254    /// Only include checks matching the specified patterns
6255    #[builder(setter(into, strip_option), default)]
6256    pub include: Option<Vec<&'a str>>,
6257    /// When true, only return annotated check functions; exclude generate-as-checks
6258    #[builder(setter(into, strip_option), default)]
6259    pub no_generate: Option<bool>,
6260}
6261#[derive(Builder, Debug, PartialEq)]
6262pub struct EnvServicesOpts<'a> {
6263    /// Only include services matching the specified patterns
6264    #[builder(setter(into, strip_option), default)]
6265    pub include: Option<Vec<&'a str>>,
6266}
6267impl IntoID<Id> for Env {
6268    fn into_id(
6269        self,
6270    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6271        Box::pin(async move { self.id().await })
6272    }
6273}
6274impl Loadable for Env {
6275    fn graphql_type() -> &'static str {
6276        "Env"
6277    }
6278    fn from_query(
6279        proc: Option<Arc<DaggerSessionProc>>,
6280        selection: Selection,
6281        graphql_client: DynGraphQLClient,
6282    ) -> Self {
6283        Self {
6284            proc,
6285            selection,
6286            graphql_client,
6287        }
6288    }
6289}
6290impl Env {
6291    /// Return the check with the given name from the installed modules. Must match exactly one check.
6292    ///
6293    /// # Arguments
6294    ///
6295    /// * `name` - The name of the check to retrieve
6296    pub fn check(&self, name: impl Into<String>) -> Check {
6297        let mut query = self.selection.select("check");
6298        query = query.arg("name", name.into());
6299        Check {
6300            proc: self.proc.clone(),
6301            selection: query,
6302            graphql_client: self.graphql_client.clone(),
6303        }
6304    }
6305    /// Return all checks defined by the installed modules
6306    ///
6307    /// # Arguments
6308    ///
6309    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6310    pub fn checks(&self) -> CheckGroup {
6311        let query = self.selection.select("checks");
6312        CheckGroup {
6313            proc: self.proc.clone(),
6314            selection: query,
6315            graphql_client: self.graphql_client.clone(),
6316        }
6317    }
6318    /// Return all checks defined by the installed modules
6319    ///
6320    /// # Arguments
6321    ///
6322    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6323    pub fn checks_opts<'a>(&self, opts: EnvChecksOpts<'a>) -> CheckGroup {
6324        let mut query = self.selection.select("checks");
6325        if let Some(include) = opts.include {
6326            query = query.arg("include", include);
6327        }
6328        if let Some(no_generate) = opts.no_generate {
6329            query = query.arg("noGenerate", no_generate);
6330        }
6331        CheckGroup {
6332            proc: self.proc.clone(),
6333            selection: query,
6334            graphql_client: self.graphql_client.clone(),
6335        }
6336    }
6337    /// A unique identifier for this Env.
6338    pub async fn id(&self) -> Result<Id, DaggerError> {
6339        let query = self.selection.select("id");
6340        query.execute(self.graphql_client.clone()).await
6341    }
6342    /// Retrieves an input binding by name
6343    pub fn input(&self, name: impl Into<String>) -> Binding {
6344        let mut query = self.selection.select("input");
6345        query = query.arg("name", name.into());
6346        Binding {
6347            proc: self.proc.clone(),
6348            selection: query,
6349            graphql_client: self.graphql_client.clone(),
6350        }
6351    }
6352    /// Returns all input bindings provided to the environment
6353    pub async fn inputs(&self) -> Result<Vec<Binding>, DaggerError> {
6354        let query = self.selection.select("inputs");
6355        let query = query.select("id");
6356        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6357        Ok(ids
6358            .into_iter()
6359            .map(|id| Binding {
6360                proc: self.proc.clone(),
6361                selection: crate::querybuilder::query()
6362                    .select("node")
6363                    .arg("id", &id.0)
6364                    .inline_fragment("Binding"),
6365                graphql_client: self.graphql_client.clone(),
6366            })
6367            .collect())
6368    }
6369    /// Retrieves an output binding by name
6370    pub fn output(&self, name: impl Into<String>) -> Binding {
6371        let mut query = self.selection.select("output");
6372        query = query.arg("name", name.into());
6373        Binding {
6374            proc: self.proc.clone(),
6375            selection: query,
6376            graphql_client: self.graphql_client.clone(),
6377        }
6378    }
6379    /// Returns all declared output bindings for the environment
6380    pub async fn outputs(&self) -> Result<Vec<Binding>, DaggerError> {
6381        let query = self.selection.select("outputs");
6382        let query = query.select("id");
6383        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6384        Ok(ids
6385            .into_iter()
6386            .map(|id| Binding {
6387                proc: self.proc.clone(),
6388                selection: crate::querybuilder::query()
6389                    .select("node")
6390                    .arg("id", &id.0)
6391                    .inline_fragment("Binding"),
6392                graphql_client: self.graphql_client.clone(),
6393            })
6394            .collect())
6395    }
6396    /// Return all services defined by the installed modules
6397    ///
6398    /// # Arguments
6399    ///
6400    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6401    pub fn services(&self) -> UpGroup {
6402        let query = self.selection.select("services");
6403        UpGroup {
6404            proc: self.proc.clone(),
6405            selection: query,
6406            graphql_client: self.graphql_client.clone(),
6407        }
6408    }
6409    /// Return all services defined by the installed modules
6410    ///
6411    /// # Arguments
6412    ///
6413    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6414    pub fn services_opts<'a>(&self, opts: EnvServicesOpts<'a>) -> UpGroup {
6415        let mut query = self.selection.select("services");
6416        if let Some(include) = opts.include {
6417            query = query.arg("include", include);
6418        }
6419        UpGroup {
6420            proc: self.proc.clone(),
6421            selection: query,
6422            graphql_client: self.graphql_client.clone(),
6423        }
6424    }
6425    /// Create or update a binding of type Address in the environment
6426    ///
6427    /// # Arguments
6428    ///
6429    /// * `name` - The name of the binding
6430    /// * `value` - The Address value to assign to the binding
6431    /// * `description` - The purpose of the input
6432    pub fn with_address_input(
6433        &self,
6434        name: impl Into<String>,
6435        value: impl IntoID<Id>,
6436        description: impl Into<String>,
6437    ) -> Env {
6438        let mut query = self.selection.select("withAddressInput");
6439        query = query.arg("name", name.into());
6440        query = query.arg_lazy(
6441            "value",
6442            Box::new(move || {
6443                let value = value.clone();
6444                Box::pin(async move { value.into_id().await.unwrap().quote() })
6445            }),
6446        );
6447        query = query.arg("description", description.into());
6448        Env {
6449            proc: self.proc.clone(),
6450            selection: query,
6451            graphql_client: self.graphql_client.clone(),
6452        }
6453    }
6454    /// Declare a desired Address output to be assigned in the environment
6455    ///
6456    /// # Arguments
6457    ///
6458    /// * `name` - The name of the binding
6459    /// * `description` - A description of the desired value of the binding
6460    pub fn with_address_output(
6461        &self,
6462        name: impl Into<String>,
6463        description: impl Into<String>,
6464    ) -> Env {
6465        let mut query = self.selection.select("withAddressOutput");
6466        query = query.arg("name", name.into());
6467        query = query.arg("description", description.into());
6468        Env {
6469            proc: self.proc.clone(),
6470            selection: query,
6471            graphql_client: self.graphql_client.clone(),
6472        }
6473    }
6474    /// Create or update a binding of type CacheVolume in the environment
6475    ///
6476    /// # Arguments
6477    ///
6478    /// * `name` - The name of the binding
6479    /// * `value` - The CacheVolume value to assign to the binding
6480    /// * `description` - The purpose of the input
6481    pub fn with_cache_volume_input(
6482        &self,
6483        name: impl Into<String>,
6484        value: impl IntoID<Id>,
6485        description: impl Into<String>,
6486    ) -> Env {
6487        let mut query = self.selection.select("withCacheVolumeInput");
6488        query = query.arg("name", name.into());
6489        query = query.arg_lazy(
6490            "value",
6491            Box::new(move || {
6492                let value = value.clone();
6493                Box::pin(async move { value.into_id().await.unwrap().quote() })
6494            }),
6495        );
6496        query = query.arg("description", description.into());
6497        Env {
6498            proc: self.proc.clone(),
6499            selection: query,
6500            graphql_client: self.graphql_client.clone(),
6501        }
6502    }
6503    /// Declare a desired CacheVolume output to be assigned in the environment
6504    ///
6505    /// # Arguments
6506    ///
6507    /// * `name` - The name of the binding
6508    /// * `description` - A description of the desired value of the binding
6509    pub fn with_cache_volume_output(
6510        &self,
6511        name: impl Into<String>,
6512        description: impl Into<String>,
6513    ) -> Env {
6514        let mut query = self.selection.select("withCacheVolumeOutput");
6515        query = query.arg("name", name.into());
6516        query = query.arg("description", description.into());
6517        Env {
6518            proc: self.proc.clone(),
6519            selection: query,
6520            graphql_client: self.graphql_client.clone(),
6521        }
6522    }
6523    /// Create or update a binding of type Changeset in the environment
6524    ///
6525    /// # Arguments
6526    ///
6527    /// * `name` - The name of the binding
6528    /// * `value` - The Changeset value to assign to the binding
6529    /// * `description` - The purpose of the input
6530    pub fn with_changeset_input(
6531        &self,
6532        name: impl Into<String>,
6533        value: impl IntoID<Id>,
6534        description: impl Into<String>,
6535    ) -> Env {
6536        let mut query = self.selection.select("withChangesetInput");
6537        query = query.arg("name", name.into());
6538        query = query.arg_lazy(
6539            "value",
6540            Box::new(move || {
6541                let value = value.clone();
6542                Box::pin(async move { value.into_id().await.unwrap().quote() })
6543            }),
6544        );
6545        query = query.arg("description", description.into());
6546        Env {
6547            proc: self.proc.clone(),
6548            selection: query,
6549            graphql_client: self.graphql_client.clone(),
6550        }
6551    }
6552    /// Declare a desired Changeset output to be assigned in the environment
6553    ///
6554    /// # Arguments
6555    ///
6556    /// * `name` - The name of the binding
6557    /// * `description` - A description of the desired value of the binding
6558    pub fn with_changeset_output(
6559        &self,
6560        name: impl Into<String>,
6561        description: impl Into<String>,
6562    ) -> Env {
6563        let mut query = self.selection.select("withChangesetOutput");
6564        query = query.arg("name", name.into());
6565        query = query.arg("description", description.into());
6566        Env {
6567            proc: self.proc.clone(),
6568            selection: query,
6569            graphql_client: self.graphql_client.clone(),
6570        }
6571    }
6572    /// Create or update a binding of type CheckGroup in the environment
6573    ///
6574    /// # Arguments
6575    ///
6576    /// * `name` - The name of the binding
6577    /// * `value` - The CheckGroup value to assign to the binding
6578    /// * `description` - The purpose of the input
6579    pub fn with_check_group_input(
6580        &self,
6581        name: impl Into<String>,
6582        value: impl IntoID<Id>,
6583        description: impl Into<String>,
6584    ) -> Env {
6585        let mut query = self.selection.select("withCheckGroupInput");
6586        query = query.arg("name", name.into());
6587        query = query.arg_lazy(
6588            "value",
6589            Box::new(move || {
6590                let value = value.clone();
6591                Box::pin(async move { value.into_id().await.unwrap().quote() })
6592            }),
6593        );
6594        query = query.arg("description", description.into());
6595        Env {
6596            proc: self.proc.clone(),
6597            selection: query,
6598            graphql_client: self.graphql_client.clone(),
6599        }
6600    }
6601    /// Declare a desired CheckGroup output to be assigned in the environment
6602    ///
6603    /// # Arguments
6604    ///
6605    /// * `name` - The name of the binding
6606    /// * `description` - A description of the desired value of the binding
6607    pub fn with_check_group_output(
6608        &self,
6609        name: impl Into<String>,
6610        description: impl Into<String>,
6611    ) -> Env {
6612        let mut query = self.selection.select("withCheckGroupOutput");
6613        query = query.arg("name", name.into());
6614        query = query.arg("description", description.into());
6615        Env {
6616            proc: self.proc.clone(),
6617            selection: query,
6618            graphql_client: self.graphql_client.clone(),
6619        }
6620    }
6621    /// Create or update a binding of type Check in the environment
6622    ///
6623    /// # Arguments
6624    ///
6625    /// * `name` - The name of the binding
6626    /// * `value` - The Check value to assign to the binding
6627    /// * `description` - The purpose of the input
6628    pub fn with_check_input(
6629        &self,
6630        name: impl Into<String>,
6631        value: impl IntoID<Id>,
6632        description: impl Into<String>,
6633    ) -> Env {
6634        let mut query = self.selection.select("withCheckInput");
6635        query = query.arg("name", name.into());
6636        query = query.arg_lazy(
6637            "value",
6638            Box::new(move || {
6639                let value = value.clone();
6640                Box::pin(async move { value.into_id().await.unwrap().quote() })
6641            }),
6642        );
6643        query = query.arg("description", description.into());
6644        Env {
6645            proc: self.proc.clone(),
6646            selection: query,
6647            graphql_client: self.graphql_client.clone(),
6648        }
6649    }
6650    /// Declare a desired Check output to be assigned in the environment
6651    ///
6652    /// # Arguments
6653    ///
6654    /// * `name` - The name of the binding
6655    /// * `description` - A description of the desired value of the binding
6656    pub fn with_check_output(
6657        &self,
6658        name: impl Into<String>,
6659        description: impl Into<String>,
6660    ) -> Env {
6661        let mut query = self.selection.select("withCheckOutput");
6662        query = query.arg("name", name.into());
6663        query = query.arg("description", description.into());
6664        Env {
6665            proc: self.proc.clone(),
6666            selection: query,
6667            graphql_client: self.graphql_client.clone(),
6668        }
6669    }
6670    /// Create or update a binding of type Cloud in the environment
6671    ///
6672    /// # Arguments
6673    ///
6674    /// * `name` - The name of the binding
6675    /// * `value` - The Cloud value to assign to the binding
6676    /// * `description` - The purpose of the input
6677    pub fn with_cloud_input(
6678        &self,
6679        name: impl Into<String>,
6680        value: impl IntoID<Id>,
6681        description: impl Into<String>,
6682    ) -> Env {
6683        let mut query = self.selection.select("withCloudInput");
6684        query = query.arg("name", name.into());
6685        query = query.arg_lazy(
6686            "value",
6687            Box::new(move || {
6688                let value = value.clone();
6689                Box::pin(async move { value.into_id().await.unwrap().quote() })
6690            }),
6691        );
6692        query = query.arg("description", description.into());
6693        Env {
6694            proc: self.proc.clone(),
6695            selection: query,
6696            graphql_client: self.graphql_client.clone(),
6697        }
6698    }
6699    /// Declare a desired Cloud output to be assigned in the environment
6700    ///
6701    /// # Arguments
6702    ///
6703    /// * `name` - The name of the binding
6704    /// * `description` - A description of the desired value of the binding
6705    pub fn with_cloud_output(
6706        &self,
6707        name: impl Into<String>,
6708        description: impl Into<String>,
6709    ) -> Env {
6710        let mut query = self.selection.select("withCloudOutput");
6711        query = query.arg("name", name.into());
6712        query = query.arg("description", description.into());
6713        Env {
6714            proc: self.proc.clone(),
6715            selection: query,
6716            graphql_client: self.graphql_client.clone(),
6717        }
6718    }
6719    /// Create or update a binding of type Container in the environment
6720    ///
6721    /// # Arguments
6722    ///
6723    /// * `name` - The name of the binding
6724    /// * `value` - The Container value to assign to the binding
6725    /// * `description` - The purpose of the input
6726    pub fn with_container_input(
6727        &self,
6728        name: impl Into<String>,
6729        value: impl IntoID<Id>,
6730        description: impl Into<String>,
6731    ) -> Env {
6732        let mut query = self.selection.select("withContainerInput");
6733        query = query.arg("name", name.into());
6734        query = query.arg_lazy(
6735            "value",
6736            Box::new(move || {
6737                let value = value.clone();
6738                Box::pin(async move { value.into_id().await.unwrap().quote() })
6739            }),
6740        );
6741        query = query.arg("description", description.into());
6742        Env {
6743            proc: self.proc.clone(),
6744            selection: query,
6745            graphql_client: self.graphql_client.clone(),
6746        }
6747    }
6748    /// Declare a desired Container output to be assigned in the environment
6749    ///
6750    /// # Arguments
6751    ///
6752    /// * `name` - The name of the binding
6753    /// * `description` - A description of the desired value of the binding
6754    pub fn with_container_output(
6755        &self,
6756        name: impl Into<String>,
6757        description: impl Into<String>,
6758    ) -> Env {
6759        let mut query = self.selection.select("withContainerOutput");
6760        query = query.arg("name", name.into());
6761        query = query.arg("description", description.into());
6762        Env {
6763            proc: self.proc.clone(),
6764            selection: query,
6765            graphql_client: self.graphql_client.clone(),
6766        }
6767    }
6768    /// Installs the current module into the environment, exposing its functions to the model
6769    /// Contextual path arguments will be populated using the environment's workspace.
6770    pub fn with_current_module(&self) -> Env {
6771        let query = self.selection.select("withCurrentModule");
6772        Env {
6773            proc: self.proc.clone(),
6774            selection: query,
6775            graphql_client: self.graphql_client.clone(),
6776        }
6777    }
6778    /// Create or update a binding of type DiffStat in the environment
6779    ///
6780    /// # Arguments
6781    ///
6782    /// * `name` - The name of the binding
6783    /// * `value` - The DiffStat value to assign to the binding
6784    /// * `description` - The purpose of the input
6785    pub fn with_diff_stat_input(
6786        &self,
6787        name: impl Into<String>,
6788        value: impl IntoID<Id>,
6789        description: impl Into<String>,
6790    ) -> Env {
6791        let mut query = self.selection.select("withDiffStatInput");
6792        query = query.arg("name", name.into());
6793        query = query.arg_lazy(
6794            "value",
6795            Box::new(move || {
6796                let value = value.clone();
6797                Box::pin(async move { value.into_id().await.unwrap().quote() })
6798            }),
6799        );
6800        query = query.arg("description", description.into());
6801        Env {
6802            proc: self.proc.clone(),
6803            selection: query,
6804            graphql_client: self.graphql_client.clone(),
6805        }
6806    }
6807    /// Declare a desired DiffStat output to be assigned in the environment
6808    ///
6809    /// # Arguments
6810    ///
6811    /// * `name` - The name of the binding
6812    /// * `description` - A description of the desired value of the binding
6813    pub fn with_diff_stat_output(
6814        &self,
6815        name: impl Into<String>,
6816        description: impl Into<String>,
6817    ) -> Env {
6818        let mut query = self.selection.select("withDiffStatOutput");
6819        query = query.arg("name", name.into());
6820        query = query.arg("description", description.into());
6821        Env {
6822            proc: self.proc.clone(),
6823            selection: query,
6824            graphql_client: self.graphql_client.clone(),
6825        }
6826    }
6827    /// Create or update a binding of type Directory in the environment
6828    ///
6829    /// # Arguments
6830    ///
6831    /// * `name` - The name of the binding
6832    /// * `value` - The Directory value to assign to the binding
6833    /// * `description` - The purpose of the input
6834    pub fn with_directory_input(
6835        &self,
6836        name: impl Into<String>,
6837        value: impl IntoID<Id>,
6838        description: impl Into<String>,
6839    ) -> Env {
6840        let mut query = self.selection.select("withDirectoryInput");
6841        query = query.arg("name", name.into());
6842        query = query.arg_lazy(
6843            "value",
6844            Box::new(move || {
6845                let value = value.clone();
6846                Box::pin(async move { value.into_id().await.unwrap().quote() })
6847            }),
6848        );
6849        query = query.arg("description", description.into());
6850        Env {
6851            proc: self.proc.clone(),
6852            selection: query,
6853            graphql_client: self.graphql_client.clone(),
6854        }
6855    }
6856    /// Declare a desired Directory output to be assigned in the environment
6857    ///
6858    /// # Arguments
6859    ///
6860    /// * `name` - The name of the binding
6861    /// * `description` - A description of the desired value of the binding
6862    pub fn with_directory_output(
6863        &self,
6864        name: impl Into<String>,
6865        description: impl Into<String>,
6866    ) -> Env {
6867        let mut query = self.selection.select("withDirectoryOutput");
6868        query = query.arg("name", name.into());
6869        query = query.arg("description", description.into());
6870        Env {
6871            proc: self.proc.clone(),
6872            selection: query,
6873            graphql_client: self.graphql_client.clone(),
6874        }
6875    }
6876    /// Create or update a binding of type EnvFile in the environment
6877    ///
6878    /// # Arguments
6879    ///
6880    /// * `name` - The name of the binding
6881    /// * `value` - The EnvFile value to assign to the binding
6882    /// * `description` - The purpose of the input
6883    pub fn with_env_file_input(
6884        &self,
6885        name: impl Into<String>,
6886        value: impl IntoID<Id>,
6887        description: impl Into<String>,
6888    ) -> Env {
6889        let mut query = self.selection.select("withEnvFileInput");
6890        query = query.arg("name", name.into());
6891        query = query.arg_lazy(
6892            "value",
6893            Box::new(move || {
6894                let value = value.clone();
6895                Box::pin(async move { value.into_id().await.unwrap().quote() })
6896            }),
6897        );
6898        query = query.arg("description", description.into());
6899        Env {
6900            proc: self.proc.clone(),
6901            selection: query,
6902            graphql_client: self.graphql_client.clone(),
6903        }
6904    }
6905    /// Declare a desired EnvFile output to be assigned in the environment
6906    ///
6907    /// # Arguments
6908    ///
6909    /// * `name` - The name of the binding
6910    /// * `description` - A description of the desired value of the binding
6911    pub fn with_env_file_output(
6912        &self,
6913        name: impl Into<String>,
6914        description: impl Into<String>,
6915    ) -> Env {
6916        let mut query = self.selection.select("withEnvFileOutput");
6917        query = query.arg("name", name.into());
6918        query = query.arg("description", description.into());
6919        Env {
6920            proc: self.proc.clone(),
6921            selection: query,
6922            graphql_client: self.graphql_client.clone(),
6923        }
6924    }
6925    /// Create or update a binding of type Env in the environment
6926    ///
6927    /// # Arguments
6928    ///
6929    /// * `name` - The name of the binding
6930    /// * `value` - The Env value to assign to the binding
6931    /// * `description` - The purpose of the input
6932    pub fn with_env_input(
6933        &self,
6934        name: impl Into<String>,
6935        value: impl IntoID<Id>,
6936        description: impl Into<String>,
6937    ) -> Env {
6938        let mut query = self.selection.select("withEnvInput");
6939        query = query.arg("name", name.into());
6940        query = query.arg_lazy(
6941            "value",
6942            Box::new(move || {
6943                let value = value.clone();
6944                Box::pin(async move { value.into_id().await.unwrap().quote() })
6945            }),
6946        );
6947        query = query.arg("description", description.into());
6948        Env {
6949            proc: self.proc.clone(),
6950            selection: query,
6951            graphql_client: self.graphql_client.clone(),
6952        }
6953    }
6954    /// Declare a desired Env output to be assigned in the environment
6955    ///
6956    /// # Arguments
6957    ///
6958    /// * `name` - The name of the binding
6959    /// * `description` - A description of the desired value of the binding
6960    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6961        let mut query = self.selection.select("withEnvOutput");
6962        query = query.arg("name", name.into());
6963        query = query.arg("description", description.into());
6964        Env {
6965            proc: self.proc.clone(),
6966            selection: query,
6967            graphql_client: self.graphql_client.clone(),
6968        }
6969    }
6970    /// Create or update a binding of type File in the environment
6971    ///
6972    /// # Arguments
6973    ///
6974    /// * `name` - The name of the binding
6975    /// * `value` - The File value to assign to the binding
6976    /// * `description` - The purpose of the input
6977    pub fn with_file_input(
6978        &self,
6979        name: impl Into<String>,
6980        value: impl IntoID<Id>,
6981        description: impl Into<String>,
6982    ) -> Env {
6983        let mut query = self.selection.select("withFileInput");
6984        query = query.arg("name", name.into());
6985        query = query.arg_lazy(
6986            "value",
6987            Box::new(move || {
6988                let value = value.clone();
6989                Box::pin(async move { value.into_id().await.unwrap().quote() })
6990            }),
6991        );
6992        query = query.arg("description", description.into());
6993        Env {
6994            proc: self.proc.clone(),
6995            selection: query,
6996            graphql_client: self.graphql_client.clone(),
6997        }
6998    }
6999    /// Declare a desired File output to be assigned in the environment
7000    ///
7001    /// # Arguments
7002    ///
7003    /// * `name` - The name of the binding
7004    /// * `description` - A description of the desired value of the binding
7005    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7006        let mut query = self.selection.select("withFileOutput");
7007        query = query.arg("name", name.into());
7008        query = query.arg("description", description.into());
7009        Env {
7010            proc: self.proc.clone(),
7011            selection: query,
7012            graphql_client: self.graphql_client.clone(),
7013        }
7014    }
7015    /// Create or update a binding of type GeneratorGroup in the environment
7016    ///
7017    /// # Arguments
7018    ///
7019    /// * `name` - The name of the binding
7020    /// * `value` - The GeneratorGroup value to assign to the binding
7021    /// * `description` - The purpose of the input
7022    pub fn with_generator_group_input(
7023        &self,
7024        name: impl Into<String>,
7025        value: impl IntoID<Id>,
7026        description: impl Into<String>,
7027    ) -> Env {
7028        let mut query = self.selection.select("withGeneratorGroupInput");
7029        query = query.arg("name", name.into());
7030        query = query.arg_lazy(
7031            "value",
7032            Box::new(move || {
7033                let value = value.clone();
7034                Box::pin(async move { value.into_id().await.unwrap().quote() })
7035            }),
7036        );
7037        query = query.arg("description", description.into());
7038        Env {
7039            proc: self.proc.clone(),
7040            selection: query,
7041            graphql_client: self.graphql_client.clone(),
7042        }
7043    }
7044    /// Declare a desired GeneratorGroup output to be assigned in the environment
7045    ///
7046    /// # Arguments
7047    ///
7048    /// * `name` - The name of the binding
7049    /// * `description` - A description of the desired value of the binding
7050    pub fn with_generator_group_output(
7051        &self,
7052        name: impl Into<String>,
7053        description: impl Into<String>,
7054    ) -> Env {
7055        let mut query = self.selection.select("withGeneratorGroupOutput");
7056        query = query.arg("name", name.into());
7057        query = query.arg("description", description.into());
7058        Env {
7059            proc: self.proc.clone(),
7060            selection: query,
7061            graphql_client: self.graphql_client.clone(),
7062        }
7063    }
7064    /// Create or update a binding of type Generator in the environment
7065    ///
7066    /// # Arguments
7067    ///
7068    /// * `name` - The name of the binding
7069    /// * `value` - The Generator value to assign to the binding
7070    /// * `description` - The purpose of the input
7071    pub fn with_generator_input(
7072        &self,
7073        name: impl Into<String>,
7074        value: impl IntoID<Id>,
7075        description: impl Into<String>,
7076    ) -> Env {
7077        let mut query = self.selection.select("withGeneratorInput");
7078        query = query.arg("name", name.into());
7079        query = query.arg_lazy(
7080            "value",
7081            Box::new(move || {
7082                let value = value.clone();
7083                Box::pin(async move { value.into_id().await.unwrap().quote() })
7084            }),
7085        );
7086        query = query.arg("description", description.into());
7087        Env {
7088            proc: self.proc.clone(),
7089            selection: query,
7090            graphql_client: self.graphql_client.clone(),
7091        }
7092    }
7093    /// Declare a desired Generator output to be assigned in the environment
7094    ///
7095    /// # Arguments
7096    ///
7097    /// * `name` - The name of the binding
7098    /// * `description` - A description of the desired value of the binding
7099    pub fn with_generator_output(
7100        &self,
7101        name: impl Into<String>,
7102        description: impl Into<String>,
7103    ) -> Env {
7104        let mut query = self.selection.select("withGeneratorOutput");
7105        query = query.arg("name", name.into());
7106        query = query.arg("description", description.into());
7107        Env {
7108            proc: self.proc.clone(),
7109            selection: query,
7110            graphql_client: self.graphql_client.clone(),
7111        }
7112    }
7113    /// Create or update a binding of type GitRef in the environment
7114    ///
7115    /// # Arguments
7116    ///
7117    /// * `name` - The name of the binding
7118    /// * `value` - The GitRef value to assign to the binding
7119    /// * `description` - The purpose of the input
7120    pub fn with_git_ref_input(
7121        &self,
7122        name: impl Into<String>,
7123        value: impl IntoID<Id>,
7124        description: impl Into<String>,
7125    ) -> Env {
7126        let mut query = self.selection.select("withGitRefInput");
7127        query = query.arg("name", name.into());
7128        query = query.arg_lazy(
7129            "value",
7130            Box::new(move || {
7131                let value = value.clone();
7132                Box::pin(async move { value.into_id().await.unwrap().quote() })
7133            }),
7134        );
7135        query = query.arg("description", description.into());
7136        Env {
7137            proc: self.proc.clone(),
7138            selection: query,
7139            graphql_client: self.graphql_client.clone(),
7140        }
7141    }
7142    /// Declare a desired GitRef output to be assigned in the environment
7143    ///
7144    /// # Arguments
7145    ///
7146    /// * `name` - The name of the binding
7147    /// * `description` - A description of the desired value of the binding
7148    pub fn with_git_ref_output(
7149        &self,
7150        name: impl Into<String>,
7151        description: impl Into<String>,
7152    ) -> Env {
7153        let mut query = self.selection.select("withGitRefOutput");
7154        query = query.arg("name", name.into());
7155        query = query.arg("description", description.into());
7156        Env {
7157            proc: self.proc.clone(),
7158            selection: query,
7159            graphql_client: self.graphql_client.clone(),
7160        }
7161    }
7162    /// Create or update a binding of type GitRepository in the environment
7163    ///
7164    /// # Arguments
7165    ///
7166    /// * `name` - The name of the binding
7167    /// * `value` - The GitRepository value to assign to the binding
7168    /// * `description` - The purpose of the input
7169    pub fn with_git_repository_input(
7170        &self,
7171        name: impl Into<String>,
7172        value: impl IntoID<Id>,
7173        description: impl Into<String>,
7174    ) -> Env {
7175        let mut query = self.selection.select("withGitRepositoryInput");
7176        query = query.arg("name", name.into());
7177        query = query.arg_lazy(
7178            "value",
7179            Box::new(move || {
7180                let value = value.clone();
7181                Box::pin(async move { value.into_id().await.unwrap().quote() })
7182            }),
7183        );
7184        query = query.arg("description", description.into());
7185        Env {
7186            proc: self.proc.clone(),
7187            selection: query,
7188            graphql_client: self.graphql_client.clone(),
7189        }
7190    }
7191    /// Declare a desired GitRepository output to be assigned in the environment
7192    ///
7193    /// # Arguments
7194    ///
7195    /// * `name` - The name of the binding
7196    /// * `description` - A description of the desired value of the binding
7197    pub fn with_git_repository_output(
7198        &self,
7199        name: impl Into<String>,
7200        description: impl Into<String>,
7201    ) -> Env {
7202        let mut query = self.selection.select("withGitRepositoryOutput");
7203        query = query.arg("name", name.into());
7204        query = query.arg("description", description.into());
7205        Env {
7206            proc: self.proc.clone(),
7207            selection: query,
7208            graphql_client: self.graphql_client.clone(),
7209        }
7210    }
7211    /// Create or update a binding of type HTTPState in the environment
7212    ///
7213    /// # Arguments
7214    ///
7215    /// * `name` - The name of the binding
7216    /// * `value` - The HTTPState value to assign to the binding
7217    /// * `description` - The purpose of the input
7218    pub fn with_http_state_input(
7219        &self,
7220        name: impl Into<String>,
7221        value: impl IntoID<Id>,
7222        description: impl Into<String>,
7223    ) -> Env {
7224        let mut query = self.selection.select("withHTTPStateInput");
7225        query = query.arg("name", name.into());
7226        query = query.arg_lazy(
7227            "value",
7228            Box::new(move || {
7229                let value = value.clone();
7230                Box::pin(async move { value.into_id().await.unwrap().quote() })
7231            }),
7232        );
7233        query = query.arg("description", description.into());
7234        Env {
7235            proc: self.proc.clone(),
7236            selection: query,
7237            graphql_client: self.graphql_client.clone(),
7238        }
7239    }
7240    /// Declare a desired HTTPState output to be assigned in the environment
7241    ///
7242    /// # Arguments
7243    ///
7244    /// * `name` - The name of the binding
7245    /// * `description` - A description of the desired value of the binding
7246    pub fn with_http_state_output(
7247        &self,
7248        name: impl Into<String>,
7249        description: impl Into<String>,
7250    ) -> Env {
7251        let mut query = self.selection.select("withHTTPStateOutput");
7252        query = query.arg("name", name.into());
7253        query = query.arg("description", description.into());
7254        Env {
7255            proc: self.proc.clone(),
7256            selection: query,
7257            graphql_client: self.graphql_client.clone(),
7258        }
7259    }
7260    /// Create or update a binding of type JSONValue in the environment
7261    ///
7262    /// # Arguments
7263    ///
7264    /// * `name` - The name of the binding
7265    /// * `value` - The JSONValue value to assign to the binding
7266    /// * `description` - The purpose of the input
7267    pub fn with_json_value_input(
7268        &self,
7269        name: impl Into<String>,
7270        value: impl IntoID<Id>,
7271        description: impl Into<String>,
7272    ) -> Env {
7273        let mut query = self.selection.select("withJSONValueInput");
7274        query = query.arg("name", name.into());
7275        query = query.arg_lazy(
7276            "value",
7277            Box::new(move || {
7278                let value = value.clone();
7279                Box::pin(async move { value.into_id().await.unwrap().quote() })
7280            }),
7281        );
7282        query = query.arg("description", description.into());
7283        Env {
7284            proc: self.proc.clone(),
7285            selection: query,
7286            graphql_client: self.graphql_client.clone(),
7287        }
7288    }
7289    /// Declare a desired JSONValue output to be assigned in the environment
7290    ///
7291    /// # Arguments
7292    ///
7293    /// * `name` - The name of the binding
7294    /// * `description` - A description of the desired value of the binding
7295    pub fn with_json_value_output(
7296        &self,
7297        name: impl Into<String>,
7298        description: impl Into<String>,
7299    ) -> Env {
7300        let mut query = self.selection.select("withJSONValueOutput");
7301        query = query.arg("name", name.into());
7302        query = query.arg("description", description.into());
7303        Env {
7304            proc: self.proc.clone(),
7305            selection: query,
7306            graphql_client: self.graphql_client.clone(),
7307        }
7308    }
7309    /// Sets the main module for this environment (the project being worked on)
7310    /// Contextual path arguments will be populated using the environment's workspace.
7311    pub fn with_main_module(&self, module: impl IntoID<Id>) -> Env {
7312        let mut query = self.selection.select("withMainModule");
7313        query = query.arg_lazy(
7314            "module",
7315            Box::new(move || {
7316                let module = module.clone();
7317                Box::pin(async move { module.into_id().await.unwrap().quote() })
7318            }),
7319        );
7320        Env {
7321            proc: self.proc.clone(),
7322            selection: query,
7323            graphql_client: self.graphql_client.clone(),
7324        }
7325    }
7326    /// Installs a module into the environment, exposing its functions to the model
7327    /// Contextual path arguments will be populated using the environment's workspace.
7328    pub fn with_module(&self, module: impl IntoID<Id>) -> Env {
7329        let mut query = self.selection.select("withModule");
7330        query = query.arg_lazy(
7331            "module",
7332            Box::new(move || {
7333                let module = module.clone();
7334                Box::pin(async move { module.into_id().await.unwrap().quote() })
7335            }),
7336        );
7337        Env {
7338            proc: self.proc.clone(),
7339            selection: query,
7340            graphql_client: self.graphql_client.clone(),
7341        }
7342    }
7343    /// Create or update a binding of type ModuleConfigClient in the environment
7344    ///
7345    /// # Arguments
7346    ///
7347    /// * `name` - The name of the binding
7348    /// * `value` - The ModuleConfigClient value to assign to the binding
7349    /// * `description` - The purpose of the input
7350    pub fn with_module_config_client_input(
7351        &self,
7352        name: impl Into<String>,
7353        value: impl IntoID<Id>,
7354        description: impl Into<String>,
7355    ) -> Env {
7356        let mut query = self.selection.select("withModuleConfigClientInput");
7357        query = query.arg("name", name.into());
7358        query = query.arg_lazy(
7359            "value",
7360            Box::new(move || {
7361                let value = value.clone();
7362                Box::pin(async move { value.into_id().await.unwrap().quote() })
7363            }),
7364        );
7365        query = query.arg("description", description.into());
7366        Env {
7367            proc: self.proc.clone(),
7368            selection: query,
7369            graphql_client: self.graphql_client.clone(),
7370        }
7371    }
7372    /// Declare a desired ModuleConfigClient output to be assigned in the environment
7373    ///
7374    /// # Arguments
7375    ///
7376    /// * `name` - The name of the binding
7377    /// * `description` - A description of the desired value of the binding
7378    pub fn with_module_config_client_output(
7379        &self,
7380        name: impl Into<String>,
7381        description: impl Into<String>,
7382    ) -> Env {
7383        let mut query = self.selection.select("withModuleConfigClientOutput");
7384        query = query.arg("name", name.into());
7385        query = query.arg("description", description.into());
7386        Env {
7387            proc: self.proc.clone(),
7388            selection: query,
7389            graphql_client: self.graphql_client.clone(),
7390        }
7391    }
7392    /// Create or update a binding of type Module in the environment
7393    ///
7394    /// # Arguments
7395    ///
7396    /// * `name` - The name of the binding
7397    /// * `value` - The Module value to assign to the binding
7398    /// * `description` - The purpose of the input
7399    pub fn with_module_input(
7400        &self,
7401        name: impl Into<String>,
7402        value: impl IntoID<Id>,
7403        description: impl Into<String>,
7404    ) -> Env {
7405        let mut query = self.selection.select("withModuleInput");
7406        query = query.arg("name", name.into());
7407        query = query.arg_lazy(
7408            "value",
7409            Box::new(move || {
7410                let value = value.clone();
7411                Box::pin(async move { value.into_id().await.unwrap().quote() })
7412            }),
7413        );
7414        query = query.arg("description", description.into());
7415        Env {
7416            proc: self.proc.clone(),
7417            selection: query,
7418            graphql_client: self.graphql_client.clone(),
7419        }
7420    }
7421    /// Declare a desired Module output to be assigned in the environment
7422    ///
7423    /// # Arguments
7424    ///
7425    /// * `name` - The name of the binding
7426    /// * `description` - A description of the desired value of the binding
7427    pub fn with_module_output(
7428        &self,
7429        name: impl Into<String>,
7430        description: impl Into<String>,
7431    ) -> Env {
7432        let mut query = self.selection.select("withModuleOutput");
7433        query = query.arg("name", name.into());
7434        query = query.arg("description", description.into());
7435        Env {
7436            proc: self.proc.clone(),
7437            selection: query,
7438            graphql_client: self.graphql_client.clone(),
7439        }
7440    }
7441    /// Create or update a binding of type ModuleSource in the environment
7442    ///
7443    /// # Arguments
7444    ///
7445    /// * `name` - The name of the binding
7446    /// * `value` - The ModuleSource value to assign to the binding
7447    /// * `description` - The purpose of the input
7448    pub fn with_module_source_input(
7449        &self,
7450        name: impl Into<String>,
7451        value: impl IntoID<Id>,
7452        description: impl Into<String>,
7453    ) -> Env {
7454        let mut query = self.selection.select("withModuleSourceInput");
7455        query = query.arg("name", name.into());
7456        query = query.arg_lazy(
7457            "value",
7458            Box::new(move || {
7459                let value = value.clone();
7460                Box::pin(async move { value.into_id().await.unwrap().quote() })
7461            }),
7462        );
7463        query = query.arg("description", description.into());
7464        Env {
7465            proc: self.proc.clone(),
7466            selection: query,
7467            graphql_client: self.graphql_client.clone(),
7468        }
7469    }
7470    /// Declare a desired ModuleSource output to be assigned in the environment
7471    ///
7472    /// # Arguments
7473    ///
7474    /// * `name` - The name of the binding
7475    /// * `description` - A description of the desired value of the binding
7476    pub fn with_module_source_output(
7477        &self,
7478        name: impl Into<String>,
7479        description: impl Into<String>,
7480    ) -> Env {
7481        let mut query = self.selection.select("withModuleSourceOutput");
7482        query = query.arg("name", name.into());
7483        query = query.arg("description", description.into());
7484        Env {
7485            proc: self.proc.clone(),
7486            selection: query,
7487            graphql_client: self.graphql_client.clone(),
7488        }
7489    }
7490    /// Create or update a binding of type SearchResult in the environment
7491    ///
7492    /// # Arguments
7493    ///
7494    /// * `name` - The name of the binding
7495    /// * `value` - The SearchResult value to assign to the binding
7496    /// * `description` - The purpose of the input
7497    pub fn with_search_result_input(
7498        &self,
7499        name: impl Into<String>,
7500        value: impl IntoID<Id>,
7501        description: impl Into<String>,
7502    ) -> Env {
7503        let mut query = self.selection.select("withSearchResultInput");
7504        query = query.arg("name", name.into());
7505        query = query.arg_lazy(
7506            "value",
7507            Box::new(move || {
7508                let value = value.clone();
7509                Box::pin(async move { value.into_id().await.unwrap().quote() })
7510            }),
7511        );
7512        query = query.arg("description", description.into());
7513        Env {
7514            proc: self.proc.clone(),
7515            selection: query,
7516            graphql_client: self.graphql_client.clone(),
7517        }
7518    }
7519    /// Declare a desired SearchResult output to be assigned in the environment
7520    ///
7521    /// # Arguments
7522    ///
7523    /// * `name` - The name of the binding
7524    /// * `description` - A description of the desired value of the binding
7525    pub fn with_search_result_output(
7526        &self,
7527        name: impl Into<String>,
7528        description: impl Into<String>,
7529    ) -> Env {
7530        let mut query = self.selection.select("withSearchResultOutput");
7531        query = query.arg("name", name.into());
7532        query = query.arg("description", description.into());
7533        Env {
7534            proc: self.proc.clone(),
7535            selection: query,
7536            graphql_client: self.graphql_client.clone(),
7537        }
7538    }
7539    /// Create or update a binding of type SearchSubmatch in the environment
7540    ///
7541    /// # Arguments
7542    ///
7543    /// * `name` - The name of the binding
7544    /// * `value` - The SearchSubmatch value to assign to the binding
7545    /// * `description` - The purpose of the input
7546    pub fn with_search_submatch_input(
7547        &self,
7548        name: impl Into<String>,
7549        value: impl IntoID<Id>,
7550        description: impl Into<String>,
7551    ) -> Env {
7552        let mut query = self.selection.select("withSearchSubmatchInput");
7553        query = query.arg("name", name.into());
7554        query = query.arg_lazy(
7555            "value",
7556            Box::new(move || {
7557                let value = value.clone();
7558                Box::pin(async move { value.into_id().await.unwrap().quote() })
7559            }),
7560        );
7561        query = query.arg("description", description.into());
7562        Env {
7563            proc: self.proc.clone(),
7564            selection: query,
7565            graphql_client: self.graphql_client.clone(),
7566        }
7567    }
7568    /// Declare a desired SearchSubmatch output to be assigned in the environment
7569    ///
7570    /// # Arguments
7571    ///
7572    /// * `name` - The name of the binding
7573    /// * `description` - A description of the desired value of the binding
7574    pub fn with_search_submatch_output(
7575        &self,
7576        name: impl Into<String>,
7577        description: impl Into<String>,
7578    ) -> Env {
7579        let mut query = self.selection.select("withSearchSubmatchOutput");
7580        query = query.arg("name", name.into());
7581        query = query.arg("description", description.into());
7582        Env {
7583            proc: self.proc.clone(),
7584            selection: query,
7585            graphql_client: self.graphql_client.clone(),
7586        }
7587    }
7588    /// Create or update a binding of type Secret in the environment
7589    ///
7590    /// # Arguments
7591    ///
7592    /// * `name` - The name of the binding
7593    /// * `value` - The Secret value to assign to the binding
7594    /// * `description` - The purpose of the input
7595    pub fn with_secret_input(
7596        &self,
7597        name: impl Into<String>,
7598        value: impl IntoID<Id>,
7599        description: impl Into<String>,
7600    ) -> Env {
7601        let mut query = self.selection.select("withSecretInput");
7602        query = query.arg("name", name.into());
7603        query = query.arg_lazy(
7604            "value",
7605            Box::new(move || {
7606                let value = value.clone();
7607                Box::pin(async move { value.into_id().await.unwrap().quote() })
7608            }),
7609        );
7610        query = query.arg("description", description.into());
7611        Env {
7612            proc: self.proc.clone(),
7613            selection: query,
7614            graphql_client: self.graphql_client.clone(),
7615        }
7616    }
7617    /// Declare a desired Secret output to be assigned in the environment
7618    ///
7619    /// # Arguments
7620    ///
7621    /// * `name` - The name of the binding
7622    /// * `description` - A description of the desired value of the binding
7623    pub fn with_secret_output(
7624        &self,
7625        name: impl Into<String>,
7626        description: impl Into<String>,
7627    ) -> Env {
7628        let mut query = self.selection.select("withSecretOutput");
7629        query = query.arg("name", name.into());
7630        query = query.arg("description", description.into());
7631        Env {
7632            proc: self.proc.clone(),
7633            selection: query,
7634            graphql_client: self.graphql_client.clone(),
7635        }
7636    }
7637    /// Create or update a binding of type Service in the environment
7638    ///
7639    /// # Arguments
7640    ///
7641    /// * `name` - The name of the binding
7642    /// * `value` - The Service value to assign to the binding
7643    /// * `description` - The purpose of the input
7644    pub fn with_service_input(
7645        &self,
7646        name: impl Into<String>,
7647        value: impl IntoID<Id>,
7648        description: impl Into<String>,
7649    ) -> Env {
7650        let mut query = self.selection.select("withServiceInput");
7651        query = query.arg("name", name.into());
7652        query = query.arg_lazy(
7653            "value",
7654            Box::new(move || {
7655                let value = value.clone();
7656                Box::pin(async move { value.into_id().await.unwrap().quote() })
7657            }),
7658        );
7659        query = query.arg("description", description.into());
7660        Env {
7661            proc: self.proc.clone(),
7662            selection: query,
7663            graphql_client: self.graphql_client.clone(),
7664        }
7665    }
7666    /// Declare a desired Service output to be assigned in the environment
7667    ///
7668    /// # Arguments
7669    ///
7670    /// * `name` - The name of the binding
7671    /// * `description` - A description of the desired value of the binding
7672    pub fn with_service_output(
7673        &self,
7674        name: impl Into<String>,
7675        description: impl Into<String>,
7676    ) -> Env {
7677        let mut query = self.selection.select("withServiceOutput");
7678        query = query.arg("name", name.into());
7679        query = query.arg("description", description.into());
7680        Env {
7681            proc: self.proc.clone(),
7682            selection: query,
7683            graphql_client: self.graphql_client.clone(),
7684        }
7685    }
7686    /// Create or update a binding of type Socket in the environment
7687    ///
7688    /// # Arguments
7689    ///
7690    /// * `name` - The name of the binding
7691    /// * `value` - The Socket value to assign to the binding
7692    /// * `description` - The purpose of the input
7693    pub fn with_socket_input(
7694        &self,
7695        name: impl Into<String>,
7696        value: impl IntoID<Id>,
7697        description: impl Into<String>,
7698    ) -> Env {
7699        let mut query = self.selection.select("withSocketInput");
7700        query = query.arg("name", name.into());
7701        query = query.arg_lazy(
7702            "value",
7703            Box::new(move || {
7704                let value = value.clone();
7705                Box::pin(async move { value.into_id().await.unwrap().quote() })
7706            }),
7707        );
7708        query = query.arg("description", description.into());
7709        Env {
7710            proc: self.proc.clone(),
7711            selection: query,
7712            graphql_client: self.graphql_client.clone(),
7713        }
7714    }
7715    /// Declare a desired Socket output to be assigned in the environment
7716    ///
7717    /// # Arguments
7718    ///
7719    /// * `name` - The name of the binding
7720    /// * `description` - A description of the desired value of the binding
7721    pub fn with_socket_output(
7722        &self,
7723        name: impl Into<String>,
7724        description: impl Into<String>,
7725    ) -> Env {
7726        let mut query = self.selection.select("withSocketOutput");
7727        query = query.arg("name", name.into());
7728        query = query.arg("description", description.into());
7729        Env {
7730            proc: self.proc.clone(),
7731            selection: query,
7732            graphql_client: self.graphql_client.clone(),
7733        }
7734    }
7735    /// Create or update a binding of type Stat in the environment
7736    ///
7737    /// # Arguments
7738    ///
7739    /// * `name` - The name of the binding
7740    /// * `value` - The Stat value to assign to the binding
7741    /// * `description` - The purpose of the input
7742    pub fn with_stat_input(
7743        &self,
7744        name: impl Into<String>,
7745        value: impl IntoID<Id>,
7746        description: impl Into<String>,
7747    ) -> Env {
7748        let mut query = self.selection.select("withStatInput");
7749        query = query.arg("name", name.into());
7750        query = query.arg_lazy(
7751            "value",
7752            Box::new(move || {
7753                let value = value.clone();
7754                Box::pin(async move { value.into_id().await.unwrap().quote() })
7755            }),
7756        );
7757        query = query.arg("description", description.into());
7758        Env {
7759            proc: self.proc.clone(),
7760            selection: query,
7761            graphql_client: self.graphql_client.clone(),
7762        }
7763    }
7764    /// Declare a desired Stat output to be assigned in the environment
7765    ///
7766    /// # Arguments
7767    ///
7768    /// * `name` - The name of the binding
7769    /// * `description` - A description of the desired value of the binding
7770    pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7771        let mut query = self.selection.select("withStatOutput");
7772        query = query.arg("name", name.into());
7773        query = query.arg("description", description.into());
7774        Env {
7775            proc: self.proc.clone(),
7776            selection: query,
7777            graphql_client: self.graphql_client.clone(),
7778        }
7779    }
7780    /// Provides a string input binding to the environment
7781    ///
7782    /// # Arguments
7783    ///
7784    /// * `name` - The name of the binding
7785    /// * `value` - The string value to assign to the binding
7786    /// * `description` - The description of the input
7787    pub fn with_string_input(
7788        &self,
7789        name: impl Into<String>,
7790        value: impl Into<String>,
7791        description: impl Into<String>,
7792    ) -> Env {
7793        let mut query = self.selection.select("withStringInput");
7794        query = query.arg("name", name.into());
7795        query = query.arg("value", value.into());
7796        query = query.arg("description", description.into());
7797        Env {
7798            proc: self.proc.clone(),
7799            selection: query,
7800            graphql_client: self.graphql_client.clone(),
7801        }
7802    }
7803    /// Declares a desired string output binding
7804    ///
7805    /// # Arguments
7806    ///
7807    /// * `name` - The name of the binding
7808    /// * `description` - The description of the output
7809    pub fn with_string_output(
7810        &self,
7811        name: impl Into<String>,
7812        description: impl Into<String>,
7813    ) -> Env {
7814        let mut query = self.selection.select("withStringOutput");
7815        query = query.arg("name", name.into());
7816        query = query.arg("description", description.into());
7817        Env {
7818            proc: self.proc.clone(),
7819            selection: query,
7820            graphql_client: self.graphql_client.clone(),
7821        }
7822    }
7823    /// Create or update a binding of type UpGroup in the environment
7824    ///
7825    /// # Arguments
7826    ///
7827    /// * `name` - The name of the binding
7828    /// * `value` - The UpGroup value to assign to the binding
7829    /// * `description` - The purpose of the input
7830    pub fn with_up_group_input(
7831        &self,
7832        name: impl Into<String>,
7833        value: impl IntoID<Id>,
7834        description: impl Into<String>,
7835    ) -> Env {
7836        let mut query = self.selection.select("withUpGroupInput");
7837        query = query.arg("name", name.into());
7838        query = query.arg_lazy(
7839            "value",
7840            Box::new(move || {
7841                let value = value.clone();
7842                Box::pin(async move { value.into_id().await.unwrap().quote() })
7843            }),
7844        );
7845        query = query.arg("description", description.into());
7846        Env {
7847            proc: self.proc.clone(),
7848            selection: query,
7849            graphql_client: self.graphql_client.clone(),
7850        }
7851    }
7852    /// Declare a desired UpGroup output to be assigned in the environment
7853    ///
7854    /// # Arguments
7855    ///
7856    /// * `name` - The name of the binding
7857    /// * `description` - A description of the desired value of the binding
7858    pub fn with_up_group_output(
7859        &self,
7860        name: impl Into<String>,
7861        description: impl Into<String>,
7862    ) -> Env {
7863        let mut query = self.selection.select("withUpGroupOutput");
7864        query = query.arg("name", name.into());
7865        query = query.arg("description", description.into());
7866        Env {
7867            proc: self.proc.clone(),
7868            selection: query,
7869            graphql_client: self.graphql_client.clone(),
7870        }
7871    }
7872    /// Create or update a binding of type Up in the environment
7873    ///
7874    /// # Arguments
7875    ///
7876    /// * `name` - The name of the binding
7877    /// * `value` - The Up value to assign to the binding
7878    /// * `description` - The purpose of the input
7879    pub fn with_up_input(
7880        &self,
7881        name: impl Into<String>,
7882        value: impl IntoID<Id>,
7883        description: impl Into<String>,
7884    ) -> Env {
7885        let mut query = self.selection.select("withUpInput");
7886        query = query.arg("name", name.into());
7887        query = query.arg_lazy(
7888            "value",
7889            Box::new(move || {
7890                let value = value.clone();
7891                Box::pin(async move { value.into_id().await.unwrap().quote() })
7892            }),
7893        );
7894        query = query.arg("description", description.into());
7895        Env {
7896            proc: self.proc.clone(),
7897            selection: query,
7898            graphql_client: self.graphql_client.clone(),
7899        }
7900    }
7901    /// Declare a desired Up output to be assigned in the environment
7902    ///
7903    /// # Arguments
7904    ///
7905    /// * `name` - The name of the binding
7906    /// * `description` - A description of the desired value of the binding
7907    pub fn with_up_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7908        let mut query = self.selection.select("withUpOutput");
7909        query = query.arg("name", name.into());
7910        query = query.arg("description", description.into());
7911        Env {
7912            proc: self.proc.clone(),
7913            selection: query,
7914            graphql_client: self.graphql_client.clone(),
7915        }
7916    }
7917    /// Returns a new environment with the provided workspace
7918    ///
7919    /// # Arguments
7920    ///
7921    /// * `workspace` - The directory to set as the host filesystem
7922    pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Env {
7923        let mut query = self.selection.select("withWorkspace");
7924        query = query.arg_lazy(
7925            "workspace",
7926            Box::new(move || {
7927                let workspace = workspace.clone();
7928                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
7929            }),
7930        );
7931        Env {
7932            proc: self.proc.clone(),
7933            selection: query,
7934            graphql_client: self.graphql_client.clone(),
7935        }
7936    }
7937    /// Create or update a binding of type Workspace in the environment
7938    ///
7939    /// # Arguments
7940    ///
7941    /// * `name` - The name of the binding
7942    /// * `value` - The Workspace value to assign to the binding
7943    /// * `description` - The purpose of the input
7944    pub fn with_workspace_input(
7945        &self,
7946        name: impl Into<String>,
7947        value: impl IntoID<Id>,
7948        description: impl Into<String>,
7949    ) -> Env {
7950        let mut query = self.selection.select("withWorkspaceInput");
7951        query = query.arg("name", name.into());
7952        query = query.arg_lazy(
7953            "value",
7954            Box::new(move || {
7955                let value = value.clone();
7956                Box::pin(async move { value.into_id().await.unwrap().quote() })
7957            }),
7958        );
7959        query = query.arg("description", description.into());
7960        Env {
7961            proc: self.proc.clone(),
7962            selection: query,
7963            graphql_client: self.graphql_client.clone(),
7964        }
7965    }
7966    /// Declare a desired Workspace output to be assigned in the environment
7967    ///
7968    /// # Arguments
7969    ///
7970    /// * `name` - The name of the binding
7971    /// * `description` - A description of the desired value of the binding
7972    pub fn with_workspace_output(
7973        &self,
7974        name: impl Into<String>,
7975        description: impl Into<String>,
7976    ) -> Env {
7977        let mut query = self.selection.select("withWorkspaceOutput");
7978        query = query.arg("name", name.into());
7979        query = query.arg("description", description.into());
7980        Env {
7981            proc: self.proc.clone(),
7982            selection: query,
7983            graphql_client: self.graphql_client.clone(),
7984        }
7985    }
7986    /// Returns a new environment without any outputs
7987    pub fn without_outputs(&self) -> Env {
7988        let query = self.selection.select("withoutOutputs");
7989        Env {
7990            proc: self.proc.clone(),
7991            selection: query,
7992            graphql_client: self.graphql_client.clone(),
7993        }
7994    }
7995    pub fn workspace(&self) -> Directory {
7996        let query = self.selection.select("workspace");
7997        Directory {
7998            proc: self.proc.clone(),
7999            selection: query,
8000            graphql_client: self.graphql_client.clone(),
8001        }
8002    }
8003}
8004impl Node for Env {
8005    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8006        let query = self.selection.select("id");
8007        let graphql_client = self.graphql_client.clone();
8008        async move { query.execute(graphql_client).await }
8009    }
8010}
8011#[derive(Clone)]
8012pub struct EnvFile {
8013    pub proc: Option<Arc<DaggerSessionProc>>,
8014    pub selection: Selection,
8015    pub graphql_client: DynGraphQLClient,
8016}
8017#[derive(Builder, Debug, PartialEq)]
8018pub struct EnvFileGetOpts {
8019    /// Return the value exactly as written to the file. No quote removal or variable expansion
8020    #[builder(setter(into, strip_option), default)]
8021    pub raw: Option<bool>,
8022}
8023#[derive(Builder, Debug, PartialEq)]
8024pub struct EnvFileVariablesOpts {
8025    /// Return values 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}
8029impl IntoID<Id> for EnvFile {
8030    fn into_id(
8031        self,
8032    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8033        Box::pin(async move { self.id().await })
8034    }
8035}
8036impl Loadable for EnvFile {
8037    fn graphql_type() -> &'static str {
8038        "EnvFile"
8039    }
8040    fn from_query(
8041        proc: Option<Arc<DaggerSessionProc>>,
8042        selection: Selection,
8043        graphql_client: DynGraphQLClient,
8044    ) -> Self {
8045        Self {
8046            proc,
8047            selection,
8048            graphql_client,
8049        }
8050    }
8051}
8052impl EnvFile {
8053    /// Return as a file
8054    pub fn as_file(&self) -> File {
8055        let query = self.selection.select("asFile");
8056        File {
8057            proc: self.proc.clone(),
8058            selection: query,
8059            graphql_client: self.graphql_client.clone(),
8060        }
8061    }
8062    /// Check if a variable exists
8063    ///
8064    /// # Arguments
8065    ///
8066    /// * `name` - Variable name
8067    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8068        let mut query = self.selection.select("exists");
8069        query = query.arg("name", name.into());
8070        query.execute(self.graphql_client.clone()).await
8071    }
8072    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8073    ///
8074    /// # Arguments
8075    ///
8076    /// * `name` - Variable name
8077    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8078    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8079        let mut query = self.selection.select("get");
8080        query = query.arg("name", name.into());
8081        query.execute(self.graphql_client.clone()).await
8082    }
8083    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8084    ///
8085    /// # Arguments
8086    ///
8087    /// * `name` - Variable name
8088    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8089    pub async fn get_opts(
8090        &self,
8091        name: impl Into<String>,
8092        opts: EnvFileGetOpts,
8093    ) -> Result<String, DaggerError> {
8094        let mut query = self.selection.select("get");
8095        query = query.arg("name", name.into());
8096        if let Some(raw) = opts.raw {
8097            query = query.arg("raw", raw);
8098        }
8099        query.execute(self.graphql_client.clone()).await
8100    }
8101    /// A unique identifier for this EnvFile.
8102    pub async fn id(&self) -> Result<Id, DaggerError> {
8103        let query = self.selection.select("id");
8104        query.execute(self.graphql_client.clone()).await
8105    }
8106    /// 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
8107    ///
8108    /// # Arguments
8109    ///
8110    /// * `prefix` - The prefix to filter by
8111    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8112        let mut query = self.selection.select("namespace");
8113        query = query.arg("prefix", prefix.into());
8114        EnvFile {
8115            proc: self.proc.clone(),
8116            selection: query,
8117            graphql_client: self.graphql_client.clone(),
8118        }
8119    }
8120    /// Return all variables
8121    ///
8122    /// # Arguments
8123    ///
8124    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8125    pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
8126        let query = self.selection.select("variables");
8127        let query = query.select("id");
8128        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8129        Ok(ids
8130            .into_iter()
8131            .map(|id| EnvVariable {
8132                proc: self.proc.clone(),
8133                selection: crate::querybuilder::query()
8134                    .select("node")
8135                    .arg("id", &id.0)
8136                    .inline_fragment("EnvVariable"),
8137                graphql_client: self.graphql_client.clone(),
8138            })
8139            .collect())
8140    }
8141    /// Return all variables
8142    ///
8143    /// # Arguments
8144    ///
8145    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8146    pub async fn variables_opts(
8147        &self,
8148        opts: EnvFileVariablesOpts,
8149    ) -> Result<Vec<EnvVariable>, DaggerError> {
8150        let mut query = self.selection.select("variables");
8151        if let Some(raw) = opts.raw {
8152            query = query.arg("raw", raw);
8153        }
8154        let query = query.select("id");
8155        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8156        Ok(ids
8157            .into_iter()
8158            .map(|id| EnvVariable {
8159                proc: self.proc.clone(),
8160                selection: crate::querybuilder::query()
8161                    .select("node")
8162                    .arg("id", &id.0)
8163                    .inline_fragment("EnvVariable"),
8164                graphql_client: self.graphql_client.clone(),
8165            })
8166            .collect())
8167    }
8168    /// Add a variable
8169    ///
8170    /// # Arguments
8171    ///
8172    /// * `name` - Variable name
8173    /// * `value` - Variable value
8174    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8175        let mut query = self.selection.select("withVariable");
8176        query = query.arg("name", name.into());
8177        query = query.arg("value", value.into());
8178        EnvFile {
8179            proc: self.proc.clone(),
8180            selection: query,
8181            graphql_client: self.graphql_client.clone(),
8182        }
8183    }
8184    /// Remove all occurrences of the named variable
8185    ///
8186    /// # Arguments
8187    ///
8188    /// * `name` - Variable name
8189    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8190        let mut query = self.selection.select("withoutVariable");
8191        query = query.arg("name", name.into());
8192        EnvFile {
8193            proc: self.proc.clone(),
8194            selection: query,
8195            graphql_client: self.graphql_client.clone(),
8196        }
8197    }
8198}
8199impl Node for EnvFile {
8200    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8201        let query = self.selection.select("id");
8202        let graphql_client = self.graphql_client.clone();
8203        async move { query.execute(graphql_client).await }
8204    }
8205}
8206#[derive(Clone)]
8207pub struct EnvVariable {
8208    pub proc: Option<Arc<DaggerSessionProc>>,
8209    pub selection: Selection,
8210    pub graphql_client: DynGraphQLClient,
8211}
8212impl IntoID<Id> for EnvVariable {
8213    fn into_id(
8214        self,
8215    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8216        Box::pin(async move { self.id().await })
8217    }
8218}
8219impl Loadable for EnvVariable {
8220    fn graphql_type() -> &'static str {
8221        "EnvVariable"
8222    }
8223    fn from_query(
8224        proc: Option<Arc<DaggerSessionProc>>,
8225        selection: Selection,
8226        graphql_client: DynGraphQLClient,
8227    ) -> Self {
8228        Self {
8229            proc,
8230            selection,
8231            graphql_client,
8232        }
8233    }
8234}
8235impl EnvVariable {
8236    /// A unique identifier for this EnvVariable.
8237    pub async fn id(&self) -> Result<Id, DaggerError> {
8238        let query = self.selection.select("id");
8239        query.execute(self.graphql_client.clone()).await
8240    }
8241    /// The environment variable name.
8242    pub async fn name(&self) -> Result<String, DaggerError> {
8243        let query = self.selection.select("name");
8244        query.execute(self.graphql_client.clone()).await
8245    }
8246    /// The environment variable value.
8247    pub async fn value(&self) -> Result<String, DaggerError> {
8248        let query = self.selection.select("value");
8249        query.execute(self.graphql_client.clone()).await
8250    }
8251}
8252impl Node for EnvVariable {
8253    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8254        let query = self.selection.select("id");
8255        let graphql_client = self.graphql_client.clone();
8256        async move { query.execute(graphql_client).await }
8257    }
8258}
8259#[derive(Clone)]
8260pub struct Error {
8261    pub proc: Option<Arc<DaggerSessionProc>>,
8262    pub selection: Selection,
8263    pub graphql_client: DynGraphQLClient,
8264}
8265impl IntoID<Id> for Error {
8266    fn into_id(
8267        self,
8268    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8269        Box::pin(async move { self.id().await })
8270    }
8271}
8272impl Loadable for Error {
8273    fn graphql_type() -> &'static str {
8274        "Error"
8275    }
8276    fn from_query(
8277        proc: Option<Arc<DaggerSessionProc>>,
8278        selection: Selection,
8279        graphql_client: DynGraphQLClient,
8280    ) -> Self {
8281        Self {
8282            proc,
8283            selection,
8284            graphql_client,
8285        }
8286    }
8287}
8288impl Error {
8289    /// A unique identifier for this Error.
8290    pub async fn id(&self) -> Result<Id, DaggerError> {
8291        let query = self.selection.select("id");
8292        query.execute(self.graphql_client.clone()).await
8293    }
8294    /// A description of the error.
8295    pub async fn message(&self) -> Result<String, DaggerError> {
8296        let query = self.selection.select("message");
8297        query.execute(self.graphql_client.clone()).await
8298    }
8299    /// The extensions of the error.
8300    pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
8301        let query = self.selection.select("values");
8302        let query = query.select("id");
8303        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8304        Ok(ids
8305            .into_iter()
8306            .map(|id| ErrorValue {
8307                proc: self.proc.clone(),
8308                selection: crate::querybuilder::query()
8309                    .select("node")
8310                    .arg("id", &id.0)
8311                    .inline_fragment("ErrorValue"),
8312                graphql_client: self.graphql_client.clone(),
8313            })
8314            .collect())
8315    }
8316    /// Add a value to the error.
8317    ///
8318    /// # Arguments
8319    ///
8320    /// * `name` - The name of the value.
8321    /// * `value` - The value to store on the error.
8322    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8323        let mut query = self.selection.select("withValue");
8324        query = query.arg("name", name.into());
8325        query = query.arg("value", value);
8326        Error {
8327            proc: self.proc.clone(),
8328            selection: query,
8329            graphql_client: self.graphql_client.clone(),
8330        }
8331    }
8332}
8333impl Node for Error {
8334    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8335        let query = self.selection.select("id");
8336        let graphql_client = self.graphql_client.clone();
8337        async move { query.execute(graphql_client).await }
8338    }
8339}
8340#[derive(Clone)]
8341pub struct ErrorValue {
8342    pub proc: Option<Arc<DaggerSessionProc>>,
8343    pub selection: Selection,
8344    pub graphql_client: DynGraphQLClient,
8345}
8346impl IntoID<Id> for ErrorValue {
8347    fn into_id(
8348        self,
8349    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8350        Box::pin(async move { self.id().await })
8351    }
8352}
8353impl Loadable for ErrorValue {
8354    fn graphql_type() -> &'static str {
8355        "ErrorValue"
8356    }
8357    fn from_query(
8358        proc: Option<Arc<DaggerSessionProc>>,
8359        selection: Selection,
8360        graphql_client: DynGraphQLClient,
8361    ) -> Self {
8362        Self {
8363            proc,
8364            selection,
8365            graphql_client,
8366        }
8367    }
8368}
8369impl ErrorValue {
8370    /// A unique identifier for this ErrorValue.
8371    pub async fn id(&self) -> Result<Id, DaggerError> {
8372        let query = self.selection.select("id");
8373        query.execute(self.graphql_client.clone()).await
8374    }
8375    /// The name of the value.
8376    pub async fn name(&self) -> Result<String, DaggerError> {
8377        let query = self.selection.select("name");
8378        query.execute(self.graphql_client.clone()).await
8379    }
8380    /// The value.
8381    pub async fn value(&self) -> Result<Json, DaggerError> {
8382        let query = self.selection.select("value");
8383        query.execute(self.graphql_client.clone()).await
8384    }
8385}
8386impl Node for ErrorValue {
8387    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8388        let query = self.selection.select("id");
8389        let graphql_client = self.graphql_client.clone();
8390        async move { query.execute(graphql_client).await }
8391    }
8392}
8393#[derive(Clone)]
8394pub struct FieldTypeDef {
8395    pub proc: Option<Arc<DaggerSessionProc>>,
8396    pub selection: Selection,
8397    pub graphql_client: DynGraphQLClient,
8398}
8399impl IntoID<Id> for FieldTypeDef {
8400    fn into_id(
8401        self,
8402    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8403        Box::pin(async move { self.id().await })
8404    }
8405}
8406impl Loadable for FieldTypeDef {
8407    fn graphql_type() -> &'static str {
8408        "FieldTypeDef"
8409    }
8410    fn from_query(
8411        proc: Option<Arc<DaggerSessionProc>>,
8412        selection: Selection,
8413        graphql_client: DynGraphQLClient,
8414    ) -> Self {
8415        Self {
8416            proc,
8417            selection,
8418            graphql_client,
8419        }
8420    }
8421}
8422impl FieldTypeDef {
8423    /// The reason this enum member is deprecated, if any.
8424    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8425        let query = self.selection.select("deprecated");
8426        query.execute(self.graphql_client.clone()).await
8427    }
8428    /// A doc string for the field, if any.
8429    pub async fn description(&self) -> Result<String, DaggerError> {
8430        let query = self.selection.select("description");
8431        query.execute(self.graphql_client.clone()).await
8432    }
8433    /// A unique identifier for this FieldTypeDef.
8434    pub async fn id(&self) -> Result<Id, DaggerError> {
8435        let query = self.selection.select("id");
8436        query.execute(self.graphql_client.clone()).await
8437    }
8438    /// The name of the field in lowerCamelCase format.
8439    pub async fn name(&self) -> Result<String, DaggerError> {
8440        let query = self.selection.select("name");
8441        query.execute(self.graphql_client.clone()).await
8442    }
8443    /// The location of this field declaration.
8444    pub fn source_map(&self) -> SourceMap {
8445        let query = self.selection.select("sourceMap");
8446        SourceMap {
8447            proc: self.proc.clone(),
8448            selection: query,
8449            graphql_client: self.graphql_client.clone(),
8450        }
8451    }
8452    /// The type of the field.
8453    pub fn type_def(&self) -> TypeDef {
8454        let query = self.selection.select("typeDef");
8455        TypeDef {
8456            proc: self.proc.clone(),
8457            selection: query,
8458            graphql_client: self.graphql_client.clone(),
8459        }
8460    }
8461}
8462impl Node for FieldTypeDef {
8463    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8464        let query = self.selection.select("id");
8465        let graphql_client = self.graphql_client.clone();
8466        async move { query.execute(graphql_client).await }
8467    }
8468}
8469#[derive(Clone)]
8470pub struct File {
8471    pub proc: Option<Arc<DaggerSessionProc>>,
8472    pub selection: Selection,
8473    pub graphql_client: DynGraphQLClient,
8474}
8475#[derive(Builder, Debug, PartialEq)]
8476pub struct FileAsEnvFileOpts {
8477    /// Replace "${VAR}" or "$VAR" with the value of other vars
8478    #[builder(setter(into, strip_option), default)]
8479    pub expand: Option<bool>,
8480}
8481#[derive(Builder, Debug, PartialEq)]
8482pub struct FileContentsOpts {
8483    /// Maximum number of lines to read
8484    #[builder(setter(into, strip_option), default)]
8485    pub limit_lines: Option<isize>,
8486    /// Start reading after this line
8487    #[builder(setter(into, strip_option), default)]
8488    pub offset_lines: Option<isize>,
8489}
8490#[derive(Builder, Debug, PartialEq)]
8491pub struct FileDigestOpts {
8492    /// If true, exclude metadata from the digest.
8493    #[builder(setter(into, strip_option), default)]
8494    pub exclude_metadata: Option<bool>,
8495}
8496#[derive(Builder, Debug, PartialEq)]
8497pub struct FileExportOpts {
8498    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
8499    #[builder(setter(into, strip_option), default)]
8500    pub allow_parent_dir_path: Option<bool>,
8501}
8502#[derive(Builder, Debug, PartialEq)]
8503pub struct FileSearchOpts<'a> {
8504    /// Allow the . pattern to match newlines in multiline mode.
8505    #[builder(setter(into, strip_option), default)]
8506    pub dotall: Option<bool>,
8507    /// Only return matching files, not lines and content
8508    #[builder(setter(into, strip_option), default)]
8509    pub files_only: Option<bool>,
8510    #[builder(setter(into, strip_option), default)]
8511    pub globs: Option<Vec<&'a str>>,
8512    /// Enable case-insensitive matching.
8513    #[builder(setter(into, strip_option), default)]
8514    pub insensitive: Option<bool>,
8515    /// Limit the number of results to return
8516    #[builder(setter(into, strip_option), default)]
8517    pub limit: Option<isize>,
8518    /// Interpret the pattern as a literal string instead of a regular expression.
8519    #[builder(setter(into, strip_option), default)]
8520    pub literal: Option<bool>,
8521    /// Enable searching across multiple lines.
8522    #[builder(setter(into, strip_option), default)]
8523    pub multiline: Option<bool>,
8524    #[builder(setter(into, strip_option), default)]
8525    pub paths: Option<Vec<&'a str>>,
8526    /// Skip hidden files (files starting with .).
8527    #[builder(setter(into, strip_option), default)]
8528    pub skip_hidden: Option<bool>,
8529    /// Honor .gitignore, .ignore, and .rgignore files.
8530    #[builder(setter(into, strip_option), default)]
8531    pub skip_ignored: Option<bool>,
8532}
8533#[derive(Builder, Debug, PartialEq)]
8534pub struct FileWithReplacedOpts {
8535    /// Replace all occurrences of the pattern.
8536    #[builder(setter(into, strip_option), default)]
8537    pub all: Option<bool>,
8538    /// Replace the first match starting from the specified line.
8539    #[builder(setter(into, strip_option), default)]
8540    pub first_from: Option<isize>,
8541}
8542impl IntoID<Id> for File {
8543    fn into_id(
8544        self,
8545    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8546        Box::pin(async move { self.id().await })
8547    }
8548}
8549impl Loadable for File {
8550    fn graphql_type() -> &'static str {
8551        "File"
8552    }
8553    fn from_query(
8554        proc: Option<Arc<DaggerSessionProc>>,
8555        selection: Selection,
8556        graphql_client: DynGraphQLClient,
8557    ) -> Self {
8558        Self {
8559            proc,
8560            selection,
8561            graphql_client,
8562        }
8563    }
8564}
8565impl File {
8566    /// Parse as an env file
8567    ///
8568    /// # Arguments
8569    ///
8570    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8571    pub fn as_env_file(&self) -> EnvFile {
8572        let query = self.selection.select("asEnvFile");
8573        EnvFile {
8574            proc: self.proc.clone(),
8575            selection: query,
8576            graphql_client: self.graphql_client.clone(),
8577        }
8578    }
8579    /// Parse as an env file
8580    ///
8581    /// # Arguments
8582    ///
8583    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8584    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
8585        let mut query = self.selection.select("asEnvFile");
8586        if let Some(expand) = opts.expand {
8587            query = query.arg("expand", expand);
8588        }
8589        EnvFile {
8590            proc: self.proc.clone(),
8591            selection: query,
8592            graphql_client: self.graphql_client.clone(),
8593        }
8594    }
8595    /// Parse the file contents as JSON.
8596    pub fn as_json(&self) -> JsonValue {
8597        let query = self.selection.select("asJSON");
8598        JsonValue {
8599            proc: self.proc.clone(),
8600            selection: query,
8601            graphql_client: self.graphql_client.clone(),
8602        }
8603    }
8604    /// Change the owner of the file recursively.
8605    ///
8606    /// # Arguments
8607    ///
8608    /// * `owner` - A user:group to set for the file.
8609    ///
8610    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
8611    ///
8612    /// If the group is omitted, it defaults to the same as the user.
8613    pub fn chown(&self, owner: impl Into<String>) -> File {
8614        let mut query = self.selection.select("chown");
8615        query = query.arg("owner", owner.into());
8616        File {
8617            proc: self.proc.clone(),
8618            selection: query,
8619            graphql_client: self.graphql_client.clone(),
8620        }
8621    }
8622    /// Retrieves the contents of the file.
8623    ///
8624    /// # Arguments
8625    ///
8626    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8627    pub async fn contents(&self) -> Result<String, DaggerError> {
8628        let query = self.selection.select("contents");
8629        query.execute(self.graphql_client.clone()).await
8630    }
8631    /// Retrieves the contents of the file.
8632    ///
8633    /// # Arguments
8634    ///
8635    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8636    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
8637        let mut query = self.selection.select("contents");
8638        if let Some(offset_lines) = opts.offset_lines {
8639            query = query.arg("offsetLines", offset_lines);
8640        }
8641        if let Some(limit_lines) = opts.limit_lines {
8642            query = query.arg("limitLines", limit_lines);
8643        }
8644        query.execute(self.graphql_client.clone()).await
8645    }
8646    /// 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.
8647    ///
8648    /// # Arguments
8649    ///
8650    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8651    pub async fn digest(&self) -> Result<String, DaggerError> {
8652        let query = self.selection.select("digest");
8653        query.execute(self.graphql_client.clone()).await
8654    }
8655    /// 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.
8656    ///
8657    /// # Arguments
8658    ///
8659    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8660    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
8661        let mut query = self.selection.select("digest");
8662        if let Some(exclude_metadata) = opts.exclude_metadata {
8663            query = query.arg("excludeMetadata", exclude_metadata);
8664        }
8665        query.execute(self.graphql_client.clone()).await
8666    }
8667    /// Writes the file to a file path on the host.
8668    ///
8669    /// # Arguments
8670    ///
8671    /// * `path` - Location of the written directory (e.g., "output.txt").
8672    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8673    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
8674        let mut query = self.selection.select("export");
8675        query = query.arg("path", path.into());
8676        query.execute(self.graphql_client.clone()).await
8677    }
8678    /// Writes the file to a file path on the host.
8679    ///
8680    /// # Arguments
8681    ///
8682    /// * `path` - Location of the written directory (e.g., "output.txt").
8683    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8684    pub async fn export_opts(
8685        &self,
8686        path: impl Into<String>,
8687        opts: FileExportOpts,
8688    ) -> Result<String, DaggerError> {
8689        let mut query = self.selection.select("export");
8690        query = query.arg("path", path.into());
8691        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
8692            query = query.arg("allowParentDirPath", allow_parent_dir_path);
8693        }
8694        query.execute(self.graphql_client.clone()).await
8695    }
8696    /// A unique identifier for this File.
8697    pub async fn id(&self) -> Result<Id, DaggerError> {
8698        let query = self.selection.select("id");
8699        query.execute(self.graphql_client.clone()).await
8700    }
8701    /// Retrieves the name of the file.
8702    pub async fn name(&self) -> Result<String, DaggerError> {
8703        let query = self.selection.select("name");
8704        query.execute(self.graphql_client.clone()).await
8705    }
8706    /// Searches for content matching the given regular expression or literal string.
8707    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
8708    ///
8709    /// # Arguments
8710    ///
8711    /// * `pattern` - The text to match.
8712    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8713    pub async fn search(
8714        &self,
8715        pattern: impl Into<String>,
8716    ) -> Result<Vec<SearchResult>, DaggerError> {
8717        let mut query = self.selection.select("search");
8718        query = query.arg("pattern", pattern.into());
8719        let query = query.select("id");
8720        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8721        Ok(ids
8722            .into_iter()
8723            .map(|id| SearchResult {
8724                proc: self.proc.clone(),
8725                selection: crate::querybuilder::query()
8726                    .select("node")
8727                    .arg("id", &id.0)
8728                    .inline_fragment("SearchResult"),
8729                graphql_client: self.graphql_client.clone(),
8730            })
8731            .collect())
8732    }
8733    /// Searches for content matching the given regular expression or literal string.
8734    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
8735    ///
8736    /// # Arguments
8737    ///
8738    /// * `pattern` - The text to match.
8739    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8740    pub async fn search_opts<'a>(
8741        &self,
8742        pattern: impl Into<String>,
8743        opts: FileSearchOpts<'a>,
8744    ) -> Result<Vec<SearchResult>, DaggerError> {
8745        let mut query = self.selection.select("search");
8746        query = query.arg("pattern", pattern.into());
8747        if let Some(literal) = opts.literal {
8748            query = query.arg("literal", literal);
8749        }
8750        if let Some(multiline) = opts.multiline {
8751            query = query.arg("multiline", multiline);
8752        }
8753        if let Some(dotall) = opts.dotall {
8754            query = query.arg("dotall", dotall);
8755        }
8756        if let Some(insensitive) = opts.insensitive {
8757            query = query.arg("insensitive", insensitive);
8758        }
8759        if let Some(skip_ignored) = opts.skip_ignored {
8760            query = query.arg("skipIgnored", skip_ignored);
8761        }
8762        if let Some(skip_hidden) = opts.skip_hidden {
8763            query = query.arg("skipHidden", skip_hidden);
8764        }
8765        if let Some(files_only) = opts.files_only {
8766            query = query.arg("filesOnly", files_only);
8767        }
8768        if let Some(limit) = opts.limit {
8769            query = query.arg("limit", limit);
8770        }
8771        if let Some(paths) = opts.paths {
8772            query = query.arg("paths", paths);
8773        }
8774        if let Some(globs) = opts.globs {
8775            query = query.arg("globs", globs);
8776        }
8777        let query = query.select("id");
8778        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8779        Ok(ids
8780            .into_iter()
8781            .map(|id| SearchResult {
8782                proc: self.proc.clone(),
8783                selection: crate::querybuilder::query()
8784                    .select("node")
8785                    .arg("id", &id.0)
8786                    .inline_fragment("SearchResult"),
8787                graphql_client: self.graphql_client.clone(),
8788            })
8789            .collect())
8790    }
8791    /// Retrieves the size of the file, in bytes.
8792    pub async fn size(&self) -> Result<isize, DaggerError> {
8793        let query = self.selection.select("size");
8794        query.execute(self.graphql_client.clone()).await
8795    }
8796    /// Return file status
8797    pub fn stat(&self) -> Stat {
8798        let query = self.selection.select("stat");
8799        Stat {
8800            proc: self.proc.clone(),
8801            selection: query,
8802            graphql_client: self.graphql_client.clone(),
8803        }
8804    }
8805    /// Force evaluation in the engine.
8806    pub async fn sync(&self) -> Result<File, DaggerError> {
8807        let query = self.selection.select("sync");
8808        let id: Id = query.execute(self.graphql_client.clone()).await?;
8809        Ok(File {
8810            proc: self.proc.clone(),
8811            selection: query
8812                .root()
8813                .select("node")
8814                .arg("id", &id.0)
8815                .inline_fragment("File"),
8816            graphql_client: self.graphql_client.clone(),
8817        })
8818    }
8819    /// Retrieves this file with its name set to the given name.
8820    ///
8821    /// # Arguments
8822    ///
8823    /// * `name` - Name to set file to.
8824    pub fn with_name(&self, name: impl Into<String>) -> File {
8825        let mut query = self.selection.select("withName");
8826        query = query.arg("name", name.into());
8827        File {
8828            proc: self.proc.clone(),
8829            selection: query,
8830            graphql_client: self.graphql_client.clone(),
8831        }
8832    }
8833    /// Retrieves the file with content replaced with the given text.
8834    /// If 'all' is true, all occurrences of the pattern will be replaced.
8835    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
8836    /// If neither are specified, and there are multiple matches for the pattern, this will error.
8837    /// If there are no matches for the pattern, this will error.
8838    ///
8839    /// # Arguments
8840    ///
8841    /// * `search` - The text to match.
8842    /// * `replacement` - The text to match.
8843    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8844    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
8845        let mut query = self.selection.select("withReplaced");
8846        query = query.arg("search", search.into());
8847        query = query.arg("replacement", replacement.into());
8848        File {
8849            proc: self.proc.clone(),
8850            selection: query,
8851            graphql_client: self.graphql_client.clone(),
8852        }
8853    }
8854    /// Retrieves the file with content replaced with the given text.
8855    /// If 'all' is true, all occurrences of the pattern will be replaced.
8856    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
8857    /// If neither are specified, and there are multiple matches for the pattern, this will error.
8858    /// If there are no matches for the pattern, this will error.
8859    ///
8860    /// # Arguments
8861    ///
8862    /// * `search` - The text to match.
8863    /// * `replacement` - The text to match.
8864    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8865    pub fn with_replaced_opts(
8866        &self,
8867        search: impl Into<String>,
8868        replacement: impl Into<String>,
8869        opts: FileWithReplacedOpts,
8870    ) -> File {
8871        let mut query = self.selection.select("withReplaced");
8872        query = query.arg("search", search.into());
8873        query = query.arg("replacement", replacement.into());
8874        if let Some(all) = opts.all {
8875            query = query.arg("all", all);
8876        }
8877        if let Some(first_from) = opts.first_from {
8878            query = query.arg("firstFrom", first_from);
8879        }
8880        File {
8881            proc: self.proc.clone(),
8882            selection: query,
8883            graphql_client: self.graphql_client.clone(),
8884        }
8885    }
8886    /// Retrieves this file with its created/modified timestamps set to the given time.
8887    ///
8888    /// # Arguments
8889    ///
8890    /// * `timestamp` - Timestamp to set dir/files in.
8891    ///
8892    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
8893    pub fn with_timestamps(&self, timestamp: isize) -> File {
8894        let mut query = self.selection.select("withTimestamps");
8895        query = query.arg("timestamp", timestamp);
8896        File {
8897            proc: self.proc.clone(),
8898            selection: query,
8899            graphql_client: self.graphql_client.clone(),
8900        }
8901    }
8902}
8903impl Exportable for File {
8904    fn export(
8905        &self,
8906        path: impl Into<String>,
8907    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
8908        let mut query = self.selection.select("export");
8909        query = query.arg("path", path.into());
8910        let graphql_client = self.graphql_client.clone();
8911        async move { query.execute(graphql_client).await }
8912    }
8913    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8914        let query = self.selection.select("id");
8915        let graphql_client = self.graphql_client.clone();
8916        async move { query.execute(graphql_client).await }
8917    }
8918}
8919impl Node for File {
8920    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8921        let query = self.selection.select("id");
8922        let graphql_client = self.graphql_client.clone();
8923        async move { query.execute(graphql_client).await }
8924    }
8925}
8926impl Syncer for File {
8927    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8928        let query = self.selection.select("id");
8929        let graphql_client = self.graphql_client.clone();
8930        async move { query.execute(graphql_client).await }
8931    }
8932    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8933        let query = self.selection.select("sync");
8934        let graphql_client = self.graphql_client.clone();
8935        async move { query.execute(graphql_client).await }
8936    }
8937}
8938#[derive(Clone)]
8939pub struct Function {
8940    pub proc: Option<Arc<DaggerSessionProc>>,
8941    pub selection: Selection,
8942    pub graphql_client: DynGraphQLClient,
8943}
8944#[derive(Builder, Debug, PartialEq)]
8945pub struct FunctionWithArgOpts<'a> {
8946    #[builder(setter(into, strip_option), default)]
8947    pub default_address: Option<&'a str>,
8948    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
8949    #[builder(setter(into, strip_option), default)]
8950    pub default_path: Option<&'a str>,
8951    /// A default value to use for this argument if not explicitly set by the caller, if any
8952    #[builder(setter(into, strip_option), default)]
8953    pub default_value: Option<Json>,
8954    /// If deprecated, the reason or migration path.
8955    #[builder(setter(into, strip_option), default)]
8956    pub deprecated: Option<&'a str>,
8957    /// A doc string for the argument, if any
8958    #[builder(setter(into, strip_option), default)]
8959    pub description: Option<&'a str>,
8960    /// Patterns to ignore when loading the contextual argument value.
8961    #[builder(setter(into, strip_option), default)]
8962    pub ignore: Option<Vec<&'a str>>,
8963    /// The source map for the argument definition.
8964    #[builder(setter(into, strip_option), default)]
8965    pub source_map: Option<Id>,
8966}
8967#[derive(Builder, Debug, PartialEq)]
8968pub struct FunctionWithCachePolicyOpts<'a> {
8969    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
8970    #[builder(setter(into, strip_option), default)]
8971    pub time_to_live: Option<&'a str>,
8972}
8973#[derive(Builder, Debug, PartialEq)]
8974pub struct FunctionWithDeprecatedOpts<'a> {
8975    /// Reason or migration path describing the deprecation.
8976    #[builder(setter(into, strip_option), default)]
8977    pub reason: Option<&'a str>,
8978}
8979impl IntoID<Id> for Function {
8980    fn into_id(
8981        self,
8982    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8983        Box::pin(async move { self.id().await })
8984    }
8985}
8986impl Loadable for Function {
8987    fn graphql_type() -> &'static str {
8988        "Function"
8989    }
8990    fn from_query(
8991        proc: Option<Arc<DaggerSessionProc>>,
8992        selection: Selection,
8993        graphql_client: DynGraphQLClient,
8994    ) -> Self {
8995        Self {
8996            proc,
8997            selection,
8998            graphql_client,
8999        }
9000    }
9001}
9002impl Function {
9003    /// Arguments accepted by the function, if any.
9004    pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
9005        let query = self.selection.select("args");
9006        let query = query.select("id");
9007        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9008        Ok(ids
9009            .into_iter()
9010            .map(|id| FunctionArg {
9011                proc: self.proc.clone(),
9012                selection: crate::querybuilder::query()
9013                    .select("node")
9014                    .arg("id", &id.0)
9015                    .inline_fragment("FunctionArg"),
9016                graphql_client: self.graphql_client.clone(),
9017            })
9018            .collect())
9019    }
9020    /// The reason this function is deprecated, if any.
9021    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9022        let query = self.selection.select("deprecated");
9023        query.execute(self.graphql_client.clone()).await
9024    }
9025    /// A doc string for the function, if any.
9026    pub async fn description(&self) -> Result<String, DaggerError> {
9027        let query = self.selection.select("description");
9028        query.execute(self.graphql_client.clone()).await
9029    }
9030    /// A unique identifier for this Function.
9031    pub async fn id(&self) -> Result<Id, DaggerError> {
9032        let query = self.selection.select("id");
9033        query.execute(self.graphql_client.clone()).await
9034    }
9035    /// The name of the function.
9036    pub async fn name(&self) -> Result<String, DaggerError> {
9037        let query = self.selection.select("name");
9038        query.execute(self.graphql_client.clone()).await
9039    }
9040    /// The type returned by the function.
9041    pub fn return_type(&self) -> TypeDef {
9042        let query = self.selection.select("returnType");
9043        TypeDef {
9044            proc: self.proc.clone(),
9045            selection: query,
9046            graphql_client: self.graphql_client.clone(),
9047        }
9048    }
9049    /// The location of this function declaration.
9050    pub fn source_map(&self) -> SourceMap {
9051        let query = self.selection.select("sourceMap");
9052        SourceMap {
9053            proc: self.proc.clone(),
9054            selection: query,
9055            graphql_client: self.graphql_client.clone(),
9056        }
9057    }
9058    /// If this function is provided by a module, the name of the module. Unset otherwise.
9059    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9060        let query = self.selection.select("sourceModuleName");
9061        query.execute(self.graphql_client.clone()).await
9062    }
9063    /// Returns the function with the provided argument
9064    ///
9065    /// # Arguments
9066    ///
9067    /// * `name` - The name of the argument
9068    /// * `type_def` - The type of the argument
9069    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9070    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
9071        let mut query = self.selection.select("withArg");
9072        query = query.arg("name", name.into());
9073        query = query.arg_lazy(
9074            "typeDef",
9075            Box::new(move || {
9076                let type_def = type_def.clone();
9077                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9078            }),
9079        );
9080        Function {
9081            proc: self.proc.clone(),
9082            selection: query,
9083            graphql_client: self.graphql_client.clone(),
9084        }
9085    }
9086    /// Returns the function with the provided argument
9087    ///
9088    /// # Arguments
9089    ///
9090    /// * `name` - The name of the argument
9091    /// * `type_def` - The type of the argument
9092    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9093    pub fn with_arg_opts<'a>(
9094        &self,
9095        name: impl Into<String>,
9096        type_def: impl IntoID<Id>,
9097        opts: FunctionWithArgOpts<'a>,
9098    ) -> Function {
9099        let mut query = self.selection.select("withArg");
9100        query = query.arg("name", name.into());
9101        query = query.arg_lazy(
9102            "typeDef",
9103            Box::new(move || {
9104                let type_def = type_def.clone();
9105                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9106            }),
9107        );
9108        if let Some(description) = opts.description {
9109            query = query.arg("description", description);
9110        }
9111        if let Some(default_value) = opts.default_value {
9112            query = query.arg("defaultValue", default_value);
9113        }
9114        if let Some(default_path) = opts.default_path {
9115            query = query.arg("defaultPath", default_path);
9116        }
9117        if let Some(ignore) = opts.ignore {
9118            query = query.arg("ignore", ignore);
9119        }
9120        if let Some(source_map) = opts.source_map {
9121            query = query.arg("sourceMap", source_map);
9122        }
9123        if let Some(deprecated) = opts.deprecated {
9124            query = query.arg("deprecated", deprecated);
9125        }
9126        if let Some(default_address) = opts.default_address {
9127            query = query.arg("defaultAddress", default_address);
9128        }
9129        Function {
9130            proc: self.proc.clone(),
9131            selection: query,
9132            graphql_client: self.graphql_client.clone(),
9133        }
9134    }
9135    /// Returns the function updated to use the provided cache policy.
9136    ///
9137    /// # Arguments
9138    ///
9139    /// * `policy` - The cache policy to use.
9140    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9141    pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9142        let mut query = self.selection.select("withCachePolicy");
9143        query = query.arg("policy", policy);
9144        Function {
9145            proc: self.proc.clone(),
9146            selection: query,
9147            graphql_client: self.graphql_client.clone(),
9148        }
9149    }
9150    /// Returns the function updated to use the provided cache policy.
9151    ///
9152    /// # Arguments
9153    ///
9154    /// * `policy` - The cache policy to use.
9155    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9156    pub fn with_cache_policy_opts<'a>(
9157        &self,
9158        policy: FunctionCachePolicy,
9159        opts: FunctionWithCachePolicyOpts<'a>,
9160    ) -> Function {
9161        let mut query = self.selection.select("withCachePolicy");
9162        query = query.arg("policy", policy);
9163        if let Some(time_to_live) = opts.time_to_live {
9164            query = query.arg("timeToLive", time_to_live);
9165        }
9166        Function {
9167            proc: self.proc.clone(),
9168            selection: query,
9169            graphql_client: self.graphql_client.clone(),
9170        }
9171    }
9172    /// Returns the function with a flag indicating it's a check.
9173    pub fn with_check(&self) -> Function {
9174        let query = self.selection.select("withCheck");
9175        Function {
9176            proc: self.proc.clone(),
9177            selection: query,
9178            graphql_client: self.graphql_client.clone(),
9179        }
9180    }
9181    /// Returns the function with the provided deprecation reason.
9182    ///
9183    /// # Arguments
9184    ///
9185    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9186    pub fn with_deprecated(&self) -> Function {
9187        let query = self.selection.select("withDeprecated");
9188        Function {
9189            proc: self.proc.clone(),
9190            selection: query,
9191            graphql_client: self.graphql_client.clone(),
9192        }
9193    }
9194    /// Returns the function with the provided deprecation reason.
9195    ///
9196    /// # Arguments
9197    ///
9198    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9199    pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9200        let mut query = self.selection.select("withDeprecated");
9201        if let Some(reason) = opts.reason {
9202            query = query.arg("reason", reason);
9203        }
9204        Function {
9205            proc: self.proc.clone(),
9206            selection: query,
9207            graphql_client: self.graphql_client.clone(),
9208        }
9209    }
9210    /// Returns the function with the given doc string.
9211    ///
9212    /// # Arguments
9213    ///
9214    /// * `description` - The doc string to set.
9215    pub fn with_description(&self, description: impl Into<String>) -> Function {
9216        let mut query = self.selection.select("withDescription");
9217        query = query.arg("description", description.into());
9218        Function {
9219            proc: self.proc.clone(),
9220            selection: query,
9221            graphql_client: self.graphql_client.clone(),
9222        }
9223    }
9224    /// Returns the function with a flag indicating it's a generator.
9225    pub fn with_generator(&self) -> Function {
9226        let query = self.selection.select("withGenerator");
9227        Function {
9228            proc: self.proc.clone(),
9229            selection: query,
9230            graphql_client: self.graphql_client.clone(),
9231        }
9232    }
9233    /// Returns the function with the given source map.
9234    ///
9235    /// # Arguments
9236    ///
9237    /// * `source_map` - The source map for the function definition.
9238    pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
9239        let mut query = self.selection.select("withSourceMap");
9240        query = query.arg_lazy(
9241            "sourceMap",
9242            Box::new(move || {
9243                let source_map = source_map.clone();
9244                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9245            }),
9246        );
9247        Function {
9248            proc: self.proc.clone(),
9249            selection: query,
9250            graphql_client: self.graphql_client.clone(),
9251        }
9252    }
9253    /// Returns the function with a flag indicating it returns a service for dagger up.
9254    pub fn with_up(&self) -> Function {
9255        let query = self.selection.select("withUp");
9256        Function {
9257            proc: self.proc.clone(),
9258            selection: query,
9259            graphql_client: self.graphql_client.clone(),
9260        }
9261    }
9262}
9263impl Node for Function {
9264    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9265        let query = self.selection.select("id");
9266        let graphql_client = self.graphql_client.clone();
9267        async move { query.execute(graphql_client).await }
9268    }
9269}
9270#[derive(Clone)]
9271pub struct FunctionArg {
9272    pub proc: Option<Arc<DaggerSessionProc>>,
9273    pub selection: Selection,
9274    pub graphql_client: DynGraphQLClient,
9275}
9276impl IntoID<Id> for FunctionArg {
9277    fn into_id(
9278        self,
9279    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9280        Box::pin(async move { self.id().await })
9281    }
9282}
9283impl Loadable for FunctionArg {
9284    fn graphql_type() -> &'static str {
9285        "FunctionArg"
9286    }
9287    fn from_query(
9288        proc: Option<Arc<DaggerSessionProc>>,
9289        selection: Selection,
9290        graphql_client: DynGraphQLClient,
9291    ) -> Self {
9292        Self {
9293            proc,
9294            selection,
9295            graphql_client,
9296        }
9297    }
9298}
9299impl FunctionArg {
9300    /// Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
9301    pub async fn default_address(&self) -> Result<String, DaggerError> {
9302        let query = self.selection.select("defaultAddress");
9303        query.execute(self.graphql_client.clone()).await
9304    }
9305    /// 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
9306    pub async fn default_path(&self) -> Result<String, DaggerError> {
9307        let query = self.selection.select("defaultPath");
9308        query.execute(self.graphql_client.clone()).await
9309    }
9310    /// A default value to use for this argument when not explicitly set by the caller, if any.
9311    pub async fn default_value(&self) -> Result<Json, DaggerError> {
9312        let query = self.selection.select("defaultValue");
9313        query.execute(self.graphql_client.clone()).await
9314    }
9315    /// The reason this function is deprecated, if any.
9316    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9317        let query = self.selection.select("deprecated");
9318        query.execute(self.graphql_client.clone()).await
9319    }
9320    /// A doc string for the argument, if any.
9321    pub async fn description(&self) -> Result<String, DaggerError> {
9322        let query = self.selection.select("description");
9323        query.execute(self.graphql_client.clone()).await
9324    }
9325    /// A unique identifier for this FunctionArg.
9326    pub async fn id(&self) -> Result<Id, DaggerError> {
9327        let query = self.selection.select("id");
9328        query.execute(self.graphql_client.clone()).await
9329    }
9330    /// 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.
9331    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9332        let query = self.selection.select("ignore");
9333        query.execute(self.graphql_client.clone()).await
9334    }
9335    /// The name of the argument in lowerCamelCase format.
9336    pub async fn name(&self) -> Result<String, DaggerError> {
9337        let query = self.selection.select("name");
9338        query.execute(self.graphql_client.clone()).await
9339    }
9340    /// The location of this arg declaration.
9341    pub fn source_map(&self) -> SourceMap {
9342        let query = self.selection.select("sourceMap");
9343        SourceMap {
9344            proc: self.proc.clone(),
9345            selection: query,
9346            graphql_client: self.graphql_client.clone(),
9347        }
9348    }
9349    /// The type of the argument.
9350    pub fn type_def(&self) -> TypeDef {
9351        let query = self.selection.select("typeDef");
9352        TypeDef {
9353            proc: self.proc.clone(),
9354            selection: query,
9355            graphql_client: self.graphql_client.clone(),
9356        }
9357    }
9358}
9359impl Node for FunctionArg {
9360    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9361        let query = self.selection.select("id");
9362        let graphql_client = self.graphql_client.clone();
9363        async move { query.execute(graphql_client).await }
9364    }
9365}
9366#[derive(Clone)]
9367pub struct FunctionCall {
9368    pub proc: Option<Arc<DaggerSessionProc>>,
9369    pub selection: Selection,
9370    pub graphql_client: DynGraphQLClient,
9371}
9372impl IntoID<Id> for FunctionCall {
9373    fn into_id(
9374        self,
9375    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9376        Box::pin(async move { self.id().await })
9377    }
9378}
9379impl Loadable for FunctionCall {
9380    fn graphql_type() -> &'static str {
9381        "FunctionCall"
9382    }
9383    fn from_query(
9384        proc: Option<Arc<DaggerSessionProc>>,
9385        selection: Selection,
9386        graphql_client: DynGraphQLClient,
9387    ) -> Self {
9388        Self {
9389            proc,
9390            selection,
9391            graphql_client,
9392        }
9393    }
9394}
9395impl FunctionCall {
9396    /// A unique identifier for this FunctionCall.
9397    pub async fn id(&self) -> Result<Id, DaggerError> {
9398        let query = self.selection.select("id");
9399        query.execute(self.graphql_client.clone()).await
9400    }
9401    /// The argument values the function is being invoked with.
9402    pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
9403        let query = self.selection.select("inputArgs");
9404        let query = query.select("id");
9405        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9406        Ok(ids
9407            .into_iter()
9408            .map(|id| FunctionCallArgValue {
9409                proc: self.proc.clone(),
9410                selection: crate::querybuilder::query()
9411                    .select("node")
9412                    .arg("id", &id.0)
9413                    .inline_fragment("FunctionCallArgValue"),
9414                graphql_client: self.graphql_client.clone(),
9415            })
9416            .collect())
9417    }
9418    /// The name of the function being called.
9419    pub async fn name(&self) -> Result<String, DaggerError> {
9420        let query = self.selection.select("name");
9421        query.execute(self.graphql_client.clone()).await
9422    }
9423    /// 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.
9424    pub async fn parent(&self) -> Result<Json, DaggerError> {
9425        let query = self.selection.select("parent");
9426        query.execute(self.graphql_client.clone()).await
9427    }
9428    /// 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.
9429    pub async fn parent_name(&self) -> Result<String, DaggerError> {
9430        let query = self.selection.select("parentName");
9431        query.execute(self.graphql_client.clone()).await
9432    }
9433    /// Return an error from the function.
9434    ///
9435    /// # Arguments
9436    ///
9437    /// * `error` - The error to return.
9438    pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
9439        let mut query = self.selection.select("returnError");
9440        query = query.arg_lazy(
9441            "error",
9442            Box::new(move || {
9443                let error = error.clone();
9444                Box::pin(async move { error.into_id().await.unwrap().quote() })
9445            }),
9446        );
9447        query.execute(self.graphql_client.clone()).await
9448    }
9449    /// Set the return value of the function call to the provided value.
9450    ///
9451    /// # Arguments
9452    ///
9453    /// * `value` - JSON serialization of the return value.
9454    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9455        let mut query = self.selection.select("returnValue");
9456        query = query.arg("value", value);
9457        query.execute(self.graphql_client.clone()).await
9458    }
9459}
9460impl Node for FunctionCall {
9461    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9462        let query = self.selection.select("id");
9463        let graphql_client = self.graphql_client.clone();
9464        async move { query.execute(graphql_client).await }
9465    }
9466}
9467#[derive(Clone)]
9468pub struct FunctionCallArgValue {
9469    pub proc: Option<Arc<DaggerSessionProc>>,
9470    pub selection: Selection,
9471    pub graphql_client: DynGraphQLClient,
9472}
9473impl IntoID<Id> for FunctionCallArgValue {
9474    fn into_id(
9475        self,
9476    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9477        Box::pin(async move { self.id().await })
9478    }
9479}
9480impl Loadable for FunctionCallArgValue {
9481    fn graphql_type() -> &'static str {
9482        "FunctionCallArgValue"
9483    }
9484    fn from_query(
9485        proc: Option<Arc<DaggerSessionProc>>,
9486        selection: Selection,
9487        graphql_client: DynGraphQLClient,
9488    ) -> Self {
9489        Self {
9490            proc,
9491            selection,
9492            graphql_client,
9493        }
9494    }
9495}
9496impl FunctionCallArgValue {
9497    /// A unique identifier for this FunctionCallArgValue.
9498    pub async fn id(&self) -> Result<Id, DaggerError> {
9499        let query = self.selection.select("id");
9500        query.execute(self.graphql_client.clone()).await
9501    }
9502    /// The name of the argument.
9503    pub async fn name(&self) -> Result<String, DaggerError> {
9504        let query = self.selection.select("name");
9505        query.execute(self.graphql_client.clone()).await
9506    }
9507    /// The value of the argument represented as a JSON serialized string.
9508    pub async fn value(&self) -> Result<Json, DaggerError> {
9509        let query = self.selection.select("value");
9510        query.execute(self.graphql_client.clone()).await
9511    }
9512}
9513impl Node for FunctionCallArgValue {
9514    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9515        let query = self.selection.select("id");
9516        let graphql_client = self.graphql_client.clone();
9517        async move { query.execute(graphql_client).await }
9518    }
9519}
9520#[derive(Clone)]
9521pub struct GeneratedCode {
9522    pub proc: Option<Arc<DaggerSessionProc>>,
9523    pub selection: Selection,
9524    pub graphql_client: DynGraphQLClient,
9525}
9526impl IntoID<Id> for GeneratedCode {
9527    fn into_id(
9528        self,
9529    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9530        Box::pin(async move { self.id().await })
9531    }
9532}
9533impl Loadable for GeneratedCode {
9534    fn graphql_type() -> &'static str {
9535        "GeneratedCode"
9536    }
9537    fn from_query(
9538        proc: Option<Arc<DaggerSessionProc>>,
9539        selection: Selection,
9540        graphql_client: DynGraphQLClient,
9541    ) -> Self {
9542        Self {
9543            proc,
9544            selection,
9545            graphql_client,
9546        }
9547    }
9548}
9549impl GeneratedCode {
9550    /// The directory containing the generated code.
9551    pub fn code(&self) -> Directory {
9552        let query = self.selection.select("code");
9553        Directory {
9554            proc: self.proc.clone(),
9555            selection: query,
9556            graphql_client: self.graphql_client.clone(),
9557        }
9558    }
9559    /// A unique identifier for this GeneratedCode.
9560    pub async fn id(&self) -> Result<Id, DaggerError> {
9561        let query = self.selection.select("id");
9562        query.execute(self.graphql_client.clone()).await
9563    }
9564    /// List of paths to mark generated in version control (i.e. .gitattributes).
9565    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
9566        let query = self.selection.select("vcsGeneratedPaths");
9567        query.execute(self.graphql_client.clone()).await
9568    }
9569    /// List of paths to ignore in version control (i.e. .gitignore).
9570    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
9571        let query = self.selection.select("vcsIgnoredPaths");
9572        query.execute(self.graphql_client.clone()).await
9573    }
9574    /// Set the list of paths to mark generated in version control.
9575    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9576        let mut query = self.selection.select("withVCSGeneratedPaths");
9577        query = query.arg(
9578            "paths",
9579            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9580        );
9581        GeneratedCode {
9582            proc: self.proc.clone(),
9583            selection: query,
9584            graphql_client: self.graphql_client.clone(),
9585        }
9586    }
9587    /// Set the list of paths to ignore in version control.
9588    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9589        let mut query = self.selection.select("withVCSIgnoredPaths");
9590        query = query.arg(
9591            "paths",
9592            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9593        );
9594        GeneratedCode {
9595            proc: self.proc.clone(),
9596            selection: query,
9597            graphql_client: self.graphql_client.clone(),
9598        }
9599    }
9600}
9601impl Node for GeneratedCode {
9602    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9603        let query = self.selection.select("id");
9604        let graphql_client = self.graphql_client.clone();
9605        async move { query.execute(graphql_client).await }
9606    }
9607}
9608#[derive(Clone)]
9609pub struct Generator {
9610    pub proc: Option<Arc<DaggerSessionProc>>,
9611    pub selection: Selection,
9612    pub graphql_client: DynGraphQLClient,
9613}
9614impl IntoID<Id> for Generator {
9615    fn into_id(
9616        self,
9617    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9618        Box::pin(async move { self.id().await })
9619    }
9620}
9621impl Loadable for Generator {
9622    fn graphql_type() -> &'static str {
9623        "Generator"
9624    }
9625    fn from_query(
9626        proc: Option<Arc<DaggerSessionProc>>,
9627        selection: Selection,
9628        graphql_client: DynGraphQLClient,
9629    ) -> Self {
9630        Self {
9631            proc,
9632            selection,
9633            graphql_client,
9634        }
9635    }
9636}
9637impl Generator {
9638    /// The generated changeset from the last run
9639    pub fn changes(&self) -> Changeset {
9640        let query = self.selection.select("changes");
9641        Changeset {
9642            proc: self.proc.clone(),
9643            selection: query,
9644            graphql_client: self.graphql_client.clone(),
9645        }
9646    }
9647    /// Whether the generator complete
9648    pub async fn completed(&self) -> Result<bool, DaggerError> {
9649        let query = self.selection.select("completed");
9650        query.execute(self.graphql_client.clone()).await
9651    }
9652    /// Return the description of the generator
9653    pub async fn description(&self) -> Result<String, DaggerError> {
9654        let query = self.selection.select("description");
9655        query.execute(self.graphql_client.clone()).await
9656    }
9657    /// A unique identifier for this Generator.
9658    pub async fn id(&self) -> Result<Id, DaggerError> {
9659        let query = self.selection.select("id");
9660        query.execute(self.graphql_client.clone()).await
9661    }
9662    /// Whether changeset from the last generator run is empty or not
9663    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9664        let query = self.selection.select("isEmpty");
9665        query.execute(self.graphql_client.clone()).await
9666    }
9667    /// Return the fully qualified name of the generator
9668    pub async fn name(&self) -> Result<String, DaggerError> {
9669        let query = self.selection.select("name");
9670        query.execute(self.graphql_client.clone()).await
9671    }
9672    /// The original module in which the generator has been defined
9673    pub fn original_module(&self) -> Module {
9674        let query = self.selection.select("originalModule");
9675        Module {
9676            proc: self.proc.clone(),
9677            selection: query,
9678            graphql_client: self.graphql_client.clone(),
9679        }
9680    }
9681    /// The path of the generator within its module
9682    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
9683        let query = self.selection.select("path");
9684        query.execute(self.graphql_client.clone()).await
9685    }
9686    /// Execute the generator
9687    pub fn run(&self) -> Generator {
9688        let query = self.selection.select("run");
9689        Generator {
9690            proc: self.proc.clone(),
9691            selection: query,
9692            graphql_client: self.graphql_client.clone(),
9693        }
9694    }
9695}
9696impl Node for Generator {
9697    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9698        let query = self.selection.select("id");
9699        let graphql_client = self.graphql_client.clone();
9700        async move { query.execute(graphql_client).await }
9701    }
9702}
9703#[derive(Clone)]
9704pub struct GeneratorGroup {
9705    pub proc: Option<Arc<DaggerSessionProc>>,
9706    pub selection: Selection,
9707    pub graphql_client: DynGraphQLClient,
9708}
9709#[derive(Builder, Debug, PartialEq)]
9710pub struct GeneratorGroupChangesOpts {
9711    /// Strategy to apply on conflicts between generators
9712    #[builder(setter(into, strip_option), default)]
9713    pub on_conflict: Option<ChangesetsMergeConflict>,
9714}
9715impl IntoID<Id> for GeneratorGroup {
9716    fn into_id(
9717        self,
9718    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9719        Box::pin(async move { self.id().await })
9720    }
9721}
9722impl Loadable for GeneratorGroup {
9723    fn graphql_type() -> &'static str {
9724        "GeneratorGroup"
9725    }
9726    fn from_query(
9727        proc: Option<Arc<DaggerSessionProc>>,
9728        selection: Selection,
9729        graphql_client: DynGraphQLClient,
9730    ) -> Self {
9731        Self {
9732            proc,
9733            selection,
9734            graphql_client,
9735        }
9736    }
9737}
9738impl GeneratorGroup {
9739    /// The combined changes from the last run of the generators
9740    /// 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.
9741    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
9742    ///
9743    /// # Arguments
9744    ///
9745    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9746    pub fn changes(&self) -> Changeset {
9747        let query = self.selection.select("changes");
9748        Changeset {
9749            proc: self.proc.clone(),
9750            selection: query,
9751            graphql_client: self.graphql_client.clone(),
9752        }
9753    }
9754    /// The combined changes from the last run of the generators
9755    /// 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.
9756    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
9757    ///
9758    /// # Arguments
9759    ///
9760    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9761    pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
9762        let mut query = self.selection.select("changes");
9763        if let Some(on_conflict) = opts.on_conflict {
9764            query = query.arg("onConflict", on_conflict);
9765        }
9766        Changeset {
9767            proc: self.proc.clone(),
9768            selection: query,
9769            graphql_client: self.graphql_client.clone(),
9770        }
9771    }
9772    /// A unique identifier for this GeneratorGroup.
9773    pub async fn id(&self) -> Result<Id, DaggerError> {
9774        let query = self.selection.select("id");
9775        query.execute(self.graphql_client.clone()).await
9776    }
9777    /// Whether the generated changeset from the last run is empty or not
9778    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9779        let query = self.selection.select("isEmpty");
9780        query.execute(self.graphql_client.clone()).await
9781    }
9782    /// Return a list of individual generators and their details
9783    pub async fn list(&self) -> Result<Vec<Generator>, DaggerError> {
9784        let query = self.selection.select("list");
9785        let query = query.select("id");
9786        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9787        Ok(ids
9788            .into_iter()
9789            .map(|id| Generator {
9790                proc: self.proc.clone(),
9791                selection: crate::querybuilder::query()
9792                    .select("node")
9793                    .arg("id", &id.0)
9794                    .inline_fragment("Generator"),
9795                graphql_client: self.graphql_client.clone(),
9796            })
9797            .collect())
9798    }
9799    /// Execute all selected generators
9800    pub fn run(&self) -> GeneratorGroup {
9801        let query = self.selection.select("run");
9802        GeneratorGroup {
9803            proc: self.proc.clone(),
9804            selection: query,
9805            graphql_client: self.graphql_client.clone(),
9806        }
9807    }
9808}
9809impl Node for GeneratorGroup {
9810    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9811        let query = self.selection.select("id");
9812        let graphql_client = self.graphql_client.clone();
9813        async move { query.execute(graphql_client).await }
9814    }
9815}
9816#[derive(Clone)]
9817pub struct GitRef {
9818    pub proc: Option<Arc<DaggerSessionProc>>,
9819    pub selection: Selection,
9820    pub graphql_client: DynGraphQLClient,
9821}
9822#[derive(Builder, Debug, PartialEq)]
9823pub struct GitRefTreeOpts {
9824    /// The depth of the tree to fetch.
9825    #[builder(setter(into, strip_option), default)]
9826    pub depth: Option<isize>,
9827    /// Set to true to discard .git directory.
9828    #[builder(setter(into, strip_option), default)]
9829    pub discard_git_dir: Option<bool>,
9830    /// Set to true to populate tag refs in the local checkout .git.
9831    #[builder(setter(into, strip_option), default)]
9832    pub include_tags: Option<bool>,
9833}
9834impl IntoID<Id> for GitRef {
9835    fn into_id(
9836        self,
9837    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9838        Box::pin(async move { self.id().await })
9839    }
9840}
9841impl Loadable for GitRef {
9842    fn graphql_type() -> &'static str {
9843        "GitRef"
9844    }
9845    fn from_query(
9846        proc: Option<Arc<DaggerSessionProc>>,
9847        selection: Selection,
9848        graphql_client: DynGraphQLClient,
9849    ) -> Self {
9850        Self {
9851            proc,
9852            selection,
9853            graphql_client,
9854        }
9855    }
9856}
9857impl GitRef {
9858    /// The resolved commit id at this ref.
9859    pub async fn commit(&self) -> Result<String, DaggerError> {
9860        let query = self.selection.select("commit");
9861        query.execute(self.graphql_client.clone()).await
9862    }
9863    /// Find the best common ancestor between this ref and another ref.
9864    ///
9865    /// # Arguments
9866    ///
9867    /// * `other` - The other ref to compare against.
9868    pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
9869        let mut query = self.selection.select("commonAncestor");
9870        query = query.arg_lazy(
9871            "other",
9872            Box::new(move || {
9873                let other = other.clone();
9874                Box::pin(async move { other.into_id().await.unwrap().quote() })
9875            }),
9876        );
9877        GitRef {
9878            proc: self.proc.clone(),
9879            selection: query,
9880            graphql_client: self.graphql_client.clone(),
9881        }
9882    }
9883    /// A unique identifier for this GitRef.
9884    pub async fn id(&self) -> Result<Id, DaggerError> {
9885        let query = self.selection.select("id");
9886        query.execute(self.graphql_client.clone()).await
9887    }
9888    /// The resolved ref name at this ref.
9889    pub async fn r#ref(&self) -> Result<String, DaggerError> {
9890        let query = self.selection.select("ref");
9891        query.execute(self.graphql_client.clone()).await
9892    }
9893    /// The filesystem tree at this ref.
9894    ///
9895    /// # Arguments
9896    ///
9897    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9898    pub fn tree(&self) -> Directory {
9899        let query = self.selection.select("tree");
9900        Directory {
9901            proc: self.proc.clone(),
9902            selection: query,
9903            graphql_client: self.graphql_client.clone(),
9904        }
9905    }
9906    /// The filesystem tree at this ref.
9907    ///
9908    /// # Arguments
9909    ///
9910    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9911    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
9912        let mut query = self.selection.select("tree");
9913        if let Some(discard_git_dir) = opts.discard_git_dir {
9914            query = query.arg("discardGitDir", discard_git_dir);
9915        }
9916        if let Some(depth) = opts.depth {
9917            query = query.arg("depth", depth);
9918        }
9919        if let Some(include_tags) = opts.include_tags {
9920            query = query.arg("includeTags", include_tags);
9921        }
9922        Directory {
9923            proc: self.proc.clone(),
9924            selection: query,
9925            graphql_client: self.graphql_client.clone(),
9926        }
9927    }
9928}
9929impl Node for GitRef {
9930    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9931        let query = self.selection.select("id");
9932        let graphql_client = self.graphql_client.clone();
9933        async move { query.execute(graphql_client).await }
9934    }
9935}
9936#[derive(Clone)]
9937pub struct GitRepository {
9938    pub proc: Option<Arc<DaggerSessionProc>>,
9939    pub selection: Selection,
9940    pub graphql_client: DynGraphQLClient,
9941}
9942#[derive(Builder, Debug, PartialEq)]
9943pub struct GitRepositoryBranchesOpts<'a> {
9944    /// Glob patterns (e.g., "refs/tags/v*").
9945    #[builder(setter(into, strip_option), default)]
9946    pub patterns: Option<Vec<&'a str>>,
9947}
9948#[derive(Builder, Debug, PartialEq)]
9949pub struct GitRepositoryTagsOpts<'a> {
9950    /// Glob patterns (e.g., "refs/tags/v*").
9951    #[builder(setter(into, strip_option), default)]
9952    pub patterns: Option<Vec<&'a str>>,
9953}
9954impl IntoID<Id> for GitRepository {
9955    fn into_id(
9956        self,
9957    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9958        Box::pin(async move { self.id().await })
9959    }
9960}
9961impl Loadable for GitRepository {
9962    fn graphql_type() -> &'static str {
9963        "GitRepository"
9964    }
9965    fn from_query(
9966        proc: Option<Arc<DaggerSessionProc>>,
9967        selection: Selection,
9968        graphql_client: DynGraphQLClient,
9969    ) -> Self {
9970        Self {
9971            proc,
9972            selection,
9973            graphql_client,
9974        }
9975    }
9976}
9977impl GitRepository {
9978    /// Returns details of a branch.
9979    ///
9980    /// # Arguments
9981    ///
9982    /// * `name` - Branch's name (e.g., "main").
9983    pub fn branch(&self, name: impl Into<String>) -> GitRef {
9984        let mut query = self.selection.select("branch");
9985        query = query.arg("name", name.into());
9986        GitRef {
9987            proc: self.proc.clone(),
9988            selection: query,
9989            graphql_client: self.graphql_client.clone(),
9990        }
9991    }
9992    /// branches that match any of the given glob patterns.
9993    ///
9994    /// # Arguments
9995    ///
9996    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9997    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
9998        let query = self.selection.select("branches");
9999        query.execute(self.graphql_client.clone()).await
10000    }
10001    /// branches that match any of the given glob patterns.
10002    ///
10003    /// # Arguments
10004    ///
10005    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10006    pub async fn branches_opts<'a>(
10007        &self,
10008        opts: GitRepositoryBranchesOpts<'a>,
10009    ) -> Result<Vec<String>, DaggerError> {
10010        let mut query = self.selection.select("branches");
10011        if let Some(patterns) = opts.patterns {
10012            query = query.arg("patterns", patterns);
10013        }
10014        query.execute(self.graphql_client.clone()).await
10015    }
10016    /// Returns details of a commit.
10017    ///
10018    /// # Arguments
10019    ///
10020    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
10021    pub fn commit(&self, id: impl Into<String>) -> GitRef {
10022        let mut query = self.selection.select("commit");
10023        query = query.arg("id", id.into());
10024        GitRef {
10025            proc: self.proc.clone(),
10026            selection: query,
10027            graphql_client: self.graphql_client.clone(),
10028        }
10029    }
10030    /// Returns details for HEAD.
10031    pub fn head(&self) -> GitRef {
10032        let query = self.selection.select("head");
10033        GitRef {
10034            proc: self.proc.clone(),
10035            selection: query,
10036            graphql_client: self.graphql_client.clone(),
10037        }
10038    }
10039    /// A unique identifier for this GitRepository.
10040    pub async fn id(&self) -> Result<Id, DaggerError> {
10041        let query = self.selection.select("id");
10042        query.execute(self.graphql_client.clone()).await
10043    }
10044    /// Returns details for the latest semver tag.
10045    pub fn latest_version(&self) -> GitRef {
10046        let query = self.selection.select("latestVersion");
10047        GitRef {
10048            proc: self.proc.clone(),
10049            selection: query,
10050            graphql_client: self.graphql_client.clone(),
10051        }
10052    }
10053    /// Returns details of a ref.
10054    ///
10055    /// # Arguments
10056    ///
10057    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
10058    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
10059        let mut query = self.selection.select("ref");
10060        query = query.arg("name", name.into());
10061        GitRef {
10062            proc: self.proc.clone(),
10063            selection: query,
10064            graphql_client: self.graphql_client.clone(),
10065        }
10066    }
10067    /// Returns details of a tag.
10068    ///
10069    /// # Arguments
10070    ///
10071    /// * `name` - Tag's name (e.g., "v0.3.9").
10072    pub fn tag(&self, name: impl Into<String>) -> GitRef {
10073        let mut query = self.selection.select("tag");
10074        query = query.arg("name", name.into());
10075        GitRef {
10076            proc: self.proc.clone(),
10077            selection: query,
10078            graphql_client: self.graphql_client.clone(),
10079        }
10080    }
10081    /// tags that match any of the given glob patterns.
10082    ///
10083    /// # Arguments
10084    ///
10085    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10086    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
10087        let query = self.selection.select("tags");
10088        query.execute(self.graphql_client.clone()).await
10089    }
10090    /// tags that match any of the given glob patterns.
10091    ///
10092    /// # Arguments
10093    ///
10094    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10095    pub async fn tags_opts<'a>(
10096        &self,
10097        opts: GitRepositoryTagsOpts<'a>,
10098    ) -> Result<Vec<String>, DaggerError> {
10099        let mut query = self.selection.select("tags");
10100        if let Some(patterns) = opts.patterns {
10101            query = query.arg("patterns", patterns);
10102        }
10103        query.execute(self.graphql_client.clone()).await
10104    }
10105    /// Returns the changeset of uncommitted changes in the git repository.
10106    pub fn uncommitted(&self) -> Changeset {
10107        let query = self.selection.select("uncommitted");
10108        Changeset {
10109            proc: self.proc.clone(),
10110            selection: query,
10111            graphql_client: self.graphql_client.clone(),
10112        }
10113    }
10114    /// The URL of the git repository.
10115    pub async fn url(&self) -> Result<String, DaggerError> {
10116        let query = self.selection.select("url");
10117        query.execute(self.graphql_client.clone()).await
10118    }
10119}
10120impl Node for GitRepository {
10121    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10122        let query = self.selection.select("id");
10123        let graphql_client = self.graphql_client.clone();
10124        async move { query.execute(graphql_client).await }
10125    }
10126}
10127#[derive(Clone)]
10128pub struct HttpState {
10129    pub proc: Option<Arc<DaggerSessionProc>>,
10130    pub selection: Selection,
10131    pub graphql_client: DynGraphQLClient,
10132}
10133impl IntoID<Id> for HttpState {
10134    fn into_id(
10135        self,
10136    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10137        Box::pin(async move { self.id().await })
10138    }
10139}
10140impl Loadable for HttpState {
10141    fn graphql_type() -> &'static str {
10142        "HTTPState"
10143    }
10144    fn from_query(
10145        proc: Option<Arc<DaggerSessionProc>>,
10146        selection: Selection,
10147        graphql_client: DynGraphQLClient,
10148    ) -> Self {
10149        Self {
10150            proc,
10151            selection,
10152            graphql_client,
10153        }
10154    }
10155}
10156impl HttpState {
10157    /// A unique identifier for this HTTPState.
10158    pub async fn id(&self) -> Result<Id, DaggerError> {
10159        let query = self.selection.select("id");
10160        query.execute(self.graphql_client.clone()).await
10161    }
10162}
10163impl Node for HttpState {
10164    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10165        let query = self.selection.select("id");
10166        let graphql_client = self.graphql_client.clone();
10167        async move { query.execute(graphql_client).await }
10168    }
10169}
10170#[derive(Clone)]
10171pub struct HealthcheckConfig {
10172    pub proc: Option<Arc<DaggerSessionProc>>,
10173    pub selection: Selection,
10174    pub graphql_client: DynGraphQLClient,
10175}
10176impl IntoID<Id> for HealthcheckConfig {
10177    fn into_id(
10178        self,
10179    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10180        Box::pin(async move { self.id().await })
10181    }
10182}
10183impl Loadable for HealthcheckConfig {
10184    fn graphql_type() -> &'static str {
10185        "HealthcheckConfig"
10186    }
10187    fn from_query(
10188        proc: Option<Arc<DaggerSessionProc>>,
10189        selection: Selection,
10190        graphql_client: DynGraphQLClient,
10191    ) -> Self {
10192        Self {
10193            proc,
10194            selection,
10195            graphql_client,
10196        }
10197    }
10198}
10199impl HealthcheckConfig {
10200    /// Healthcheck command arguments.
10201    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
10202        let query = self.selection.select("args");
10203        query.execute(self.graphql_client.clone()).await
10204    }
10205    /// A unique identifier for this HealthcheckConfig.
10206    pub async fn id(&self) -> Result<Id, DaggerError> {
10207        let query = self.selection.select("id");
10208        query.execute(self.graphql_client.clone()).await
10209    }
10210    /// Interval between running healthcheck. Example:30s
10211    pub async fn interval(&self) -> Result<String, DaggerError> {
10212        let query = self.selection.select("interval");
10213        query.execute(self.graphql_client.clone()).await
10214    }
10215    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example:3
10216    pub async fn retries(&self) -> Result<isize, DaggerError> {
10217        let query = self.selection.select("retries");
10218        query.execute(self.graphql_client.clone()).await
10219    }
10220    /// Healthcheck command is a shell command.
10221    pub async fn shell(&self) -> Result<bool, DaggerError> {
10222        let query = self.selection.select("shell");
10223        query.execute(self.graphql_client.clone()).await
10224    }
10225    /// StartInterval configures the duration between checks during the startup phase. Example:5s
10226    pub async fn start_interval(&self) -> Result<String, DaggerError> {
10227        let query = self.selection.select("startInterval");
10228        query.execute(self.graphql_client.clone()).await
10229    }
10230    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example:0s
10231    pub async fn start_period(&self) -> Result<String, DaggerError> {
10232        let query = self.selection.select("startPeriod");
10233        query.execute(self.graphql_client.clone()).await
10234    }
10235    /// Healthcheck timeout. Example:3s
10236    pub async fn timeout(&self) -> Result<String, DaggerError> {
10237        let query = self.selection.select("timeout");
10238        query.execute(self.graphql_client.clone()).await
10239    }
10240}
10241impl Node for HealthcheckConfig {
10242    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10243        let query = self.selection.select("id");
10244        let graphql_client = self.graphql_client.clone();
10245        async move { query.execute(graphql_client).await }
10246    }
10247}
10248#[derive(Clone)]
10249pub struct Host {
10250    pub proc: Option<Arc<DaggerSessionProc>>,
10251    pub selection: Selection,
10252    pub graphql_client: DynGraphQLClient,
10253}
10254#[derive(Builder, Debug, PartialEq)]
10255pub struct HostDirectoryOpts<'a> {
10256    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
10257    #[builder(setter(into, strip_option), default)]
10258    pub exclude: Option<Vec<&'a str>>,
10259    /// Apply .gitignore filter rules inside the directory
10260    #[builder(setter(into, strip_option), default)]
10261    pub gitignore: Option<bool>,
10262    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
10263    #[builder(setter(into, strip_option), default)]
10264    pub include: Option<Vec<&'a str>>,
10265    /// If true, the directory will always be reloaded from the host.
10266    #[builder(setter(into, strip_option), default)]
10267    pub no_cache: Option<bool>,
10268}
10269#[derive(Builder, Debug, PartialEq)]
10270pub struct HostFileOpts {
10271    /// If true, the file 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 HostFindUpOpts {
10277    #[builder(setter(into, strip_option), default)]
10278    pub no_cache: Option<bool>,
10279}
10280#[derive(Builder, Debug, PartialEq)]
10281pub struct HostServiceOpts<'a> {
10282    /// Upstream host to forward traffic to.
10283    #[builder(setter(into, strip_option), default)]
10284    pub host: Option<&'a str>,
10285}
10286#[derive(Builder, Debug, PartialEq)]
10287pub struct HostTunnelOpts {
10288    /// Map each service port to the same port on the host, as if the service were running natively.
10289    /// Note: enabling may result in port conflicts.
10290    #[builder(setter(into, strip_option), default)]
10291    pub native: Option<bool>,
10292    /// Configure explicit port forwarding rules for the tunnel.
10293    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
10294    /// 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.
10295    /// If ports are given and native is true, the ports are additive.
10296    #[builder(setter(into, strip_option), default)]
10297    pub ports: Option<Vec<PortForward>>,
10298}
10299impl IntoID<Id> for Host {
10300    fn into_id(
10301        self,
10302    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10303        Box::pin(async move { self.id().await })
10304    }
10305}
10306impl Loadable for Host {
10307    fn graphql_type() -> &'static str {
10308        "Host"
10309    }
10310    fn from_query(
10311        proc: Option<Arc<DaggerSessionProc>>,
10312        selection: Selection,
10313        graphql_client: DynGraphQLClient,
10314    ) -> Self {
10315        Self {
10316            proc,
10317            selection,
10318            graphql_client,
10319        }
10320    }
10321}
10322impl Host {
10323    /// Accesses a container image on the host.
10324    ///
10325    /// # Arguments
10326    ///
10327    /// * `name` - Name of the image to access.
10328    pub fn container_image(&self, name: impl Into<String>) -> Container {
10329        let mut query = self.selection.select("containerImage");
10330        query = query.arg("name", name.into());
10331        Container {
10332            proc: self.proc.clone(),
10333            selection: query,
10334            graphql_client: self.graphql_client.clone(),
10335        }
10336    }
10337    /// Accesses a directory on the host.
10338    ///
10339    /// # Arguments
10340    ///
10341    /// * `path` - Location of the directory to access (e.g., ".").
10342    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10343    pub fn directory(&self, path: impl Into<String>) -> Directory {
10344        let mut query = self.selection.select("directory");
10345        query = query.arg("path", path.into());
10346        Directory {
10347            proc: self.proc.clone(),
10348            selection: query,
10349            graphql_client: self.graphql_client.clone(),
10350        }
10351    }
10352    /// Accesses a directory on the host.
10353    ///
10354    /// # Arguments
10355    ///
10356    /// * `path` - Location of the directory to access (e.g., ".").
10357    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10358    pub fn directory_opts<'a>(
10359        &self,
10360        path: impl Into<String>,
10361        opts: HostDirectoryOpts<'a>,
10362    ) -> Directory {
10363        let mut query = self.selection.select("directory");
10364        query = query.arg("path", path.into());
10365        if let Some(exclude) = opts.exclude {
10366            query = query.arg("exclude", exclude);
10367        }
10368        if let Some(include) = opts.include {
10369            query = query.arg("include", include);
10370        }
10371        if let Some(no_cache) = opts.no_cache {
10372            query = query.arg("noCache", no_cache);
10373        }
10374        if let Some(gitignore) = opts.gitignore {
10375            query = query.arg("gitignore", gitignore);
10376        }
10377        Directory {
10378            proc: self.proc.clone(),
10379            selection: query,
10380            graphql_client: self.graphql_client.clone(),
10381        }
10382    }
10383    /// Accesses a file on the host.
10384    ///
10385    /// # Arguments
10386    ///
10387    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10388    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10389    pub fn file(&self, path: impl Into<String>) -> File {
10390        let mut query = self.selection.select("file");
10391        query = query.arg("path", path.into());
10392        File {
10393            proc: self.proc.clone(),
10394            selection: query,
10395            graphql_client: self.graphql_client.clone(),
10396        }
10397    }
10398    /// Accesses a file on the host.
10399    ///
10400    /// # Arguments
10401    ///
10402    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10403    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10404    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
10405        let mut query = self.selection.select("file");
10406        query = query.arg("path", path.into());
10407        if let Some(no_cache) = opts.no_cache {
10408            query = query.arg("noCache", no_cache);
10409        }
10410        File {
10411            proc: self.proc.clone(),
10412            selection: query,
10413            graphql_client: self.graphql_client.clone(),
10414        }
10415    }
10416    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10417    ///
10418    /// # Arguments
10419    ///
10420    /// * `name` - name of the file or directory to search for
10421    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10422    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
10423        let mut query = self.selection.select("findUp");
10424        query = query.arg("name", name.into());
10425        query.execute(self.graphql_client.clone()).await
10426    }
10427    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10428    ///
10429    /// # Arguments
10430    ///
10431    /// * `name` - name of the file or directory to search for
10432    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10433    pub async fn find_up_opts(
10434        &self,
10435        name: impl Into<String>,
10436        opts: HostFindUpOpts,
10437    ) -> Result<String, DaggerError> {
10438        let mut query = self.selection.select("findUp");
10439        query = query.arg("name", name.into());
10440        if let Some(no_cache) = opts.no_cache {
10441            query = query.arg("noCache", no_cache);
10442        }
10443        query.execute(self.graphql_client.clone()).await
10444    }
10445    /// A unique identifier for this Host.
10446    pub async fn id(&self) -> Result<Id, DaggerError> {
10447        let query = self.selection.select("id");
10448        query.execute(self.graphql_client.clone()).await
10449    }
10450    /// Creates a service that forwards traffic to a specified address via the host.
10451    ///
10452    /// # Arguments
10453    ///
10454    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10455    ///
10456    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10457    ///
10458    /// An empty set of ports is not valid; an error will be returned.
10459    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10460    pub fn service(&self, ports: Vec<PortForward>) -> Service {
10461        let mut query = self.selection.select("service");
10462        query = query.arg("ports", ports);
10463        Service {
10464            proc: self.proc.clone(),
10465            selection: query,
10466            graphql_client: self.graphql_client.clone(),
10467        }
10468    }
10469    /// Creates a service that forwards traffic to a specified address via the host.
10470    ///
10471    /// # Arguments
10472    ///
10473    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10474    ///
10475    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10476    ///
10477    /// An empty set of ports is not valid; an error will be returned.
10478    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10479    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
10480        let mut query = self.selection.select("service");
10481        query = query.arg("ports", ports);
10482        if let Some(host) = opts.host {
10483            query = query.arg("host", host);
10484        }
10485        Service {
10486            proc: self.proc.clone(),
10487            selection: query,
10488            graphql_client: self.graphql_client.clone(),
10489        }
10490    }
10491    /// Creates a tunnel that forwards traffic from the host to a service.
10492    ///
10493    /// # Arguments
10494    ///
10495    /// * `service` - Service to send traffic from the tunnel.
10496    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10497    pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
10498        let mut query = self.selection.select("tunnel");
10499        query = query.arg_lazy(
10500            "service",
10501            Box::new(move || {
10502                let service = service.clone();
10503                Box::pin(async move { service.into_id().await.unwrap().quote() })
10504            }),
10505        );
10506        Service {
10507            proc: self.proc.clone(),
10508            selection: query,
10509            graphql_client: self.graphql_client.clone(),
10510        }
10511    }
10512    /// Creates a tunnel that forwards traffic from the host to a service.
10513    ///
10514    /// # Arguments
10515    ///
10516    /// * `service` - Service to send traffic from the tunnel.
10517    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10518    pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
10519        let mut query = self.selection.select("tunnel");
10520        query = query.arg_lazy(
10521            "service",
10522            Box::new(move || {
10523                let service = service.clone();
10524                Box::pin(async move { service.into_id().await.unwrap().quote() })
10525            }),
10526        );
10527        if let Some(native) = opts.native {
10528            query = query.arg("native", native);
10529        }
10530        if let Some(ports) = opts.ports {
10531            query = query.arg("ports", ports);
10532        }
10533        Service {
10534            proc: self.proc.clone(),
10535            selection: query,
10536            graphql_client: self.graphql_client.clone(),
10537        }
10538    }
10539    /// Accesses a Unix socket on the host.
10540    ///
10541    /// # Arguments
10542    ///
10543    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
10544    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
10545        let mut query = self.selection.select("unixSocket");
10546        query = query.arg("path", path.into());
10547        Socket {
10548            proc: self.proc.clone(),
10549            selection: query,
10550            graphql_client: self.graphql_client.clone(),
10551        }
10552    }
10553}
10554impl Node for Host {
10555    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10556        let query = self.selection.select("id");
10557        let graphql_client = self.graphql_client.clone();
10558        async move { query.execute(graphql_client).await }
10559    }
10560}
10561#[derive(Clone)]
10562pub struct InputTypeDef {
10563    pub proc: Option<Arc<DaggerSessionProc>>,
10564    pub selection: Selection,
10565    pub graphql_client: DynGraphQLClient,
10566}
10567impl IntoID<Id> for InputTypeDef {
10568    fn into_id(
10569        self,
10570    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10571        Box::pin(async move { self.id().await })
10572    }
10573}
10574impl Loadable for InputTypeDef {
10575    fn graphql_type() -> &'static str {
10576        "InputTypeDef"
10577    }
10578    fn from_query(
10579        proc: Option<Arc<DaggerSessionProc>>,
10580        selection: Selection,
10581        graphql_client: DynGraphQLClient,
10582    ) -> Self {
10583        Self {
10584            proc,
10585            selection,
10586            graphql_client,
10587        }
10588    }
10589}
10590impl InputTypeDef {
10591    /// Static fields defined on this input object, if any.
10592    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
10593        let query = self.selection.select("fields");
10594        let query = query.select("id");
10595        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10596        Ok(ids
10597            .into_iter()
10598            .map(|id| FieldTypeDef {
10599                proc: self.proc.clone(),
10600                selection: crate::querybuilder::query()
10601                    .select("node")
10602                    .arg("id", &id.0)
10603                    .inline_fragment("FieldTypeDef"),
10604                graphql_client: self.graphql_client.clone(),
10605            })
10606            .collect())
10607    }
10608    /// A unique identifier for this InputTypeDef.
10609    pub async fn id(&self) -> Result<Id, DaggerError> {
10610        let query = self.selection.select("id");
10611        query.execute(self.graphql_client.clone()).await
10612    }
10613    /// The name of the input object.
10614    pub async fn name(&self) -> Result<String, DaggerError> {
10615        let query = self.selection.select("name");
10616        query.execute(self.graphql_client.clone()).await
10617    }
10618}
10619impl Node for InputTypeDef {
10620    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10621        let query = self.selection.select("id");
10622        let graphql_client = self.graphql_client.clone();
10623        async move { query.execute(graphql_client).await }
10624    }
10625}
10626#[derive(Clone)]
10627pub struct InterfaceTypeDef {
10628    pub proc: Option<Arc<DaggerSessionProc>>,
10629    pub selection: Selection,
10630    pub graphql_client: DynGraphQLClient,
10631}
10632impl IntoID<Id> for InterfaceTypeDef {
10633    fn into_id(
10634        self,
10635    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10636        Box::pin(async move { self.id().await })
10637    }
10638}
10639impl Loadable for InterfaceTypeDef {
10640    fn graphql_type() -> &'static str {
10641        "InterfaceTypeDef"
10642    }
10643    fn from_query(
10644        proc: Option<Arc<DaggerSessionProc>>,
10645        selection: Selection,
10646        graphql_client: DynGraphQLClient,
10647    ) -> Self {
10648        Self {
10649            proc,
10650            selection,
10651            graphql_client,
10652        }
10653    }
10654}
10655impl InterfaceTypeDef {
10656    /// The doc string for the interface, if any.
10657    pub async fn description(&self) -> Result<String, DaggerError> {
10658        let query = self.selection.select("description");
10659        query.execute(self.graphql_client.clone()).await
10660    }
10661    /// Functions defined on this interface, if any.
10662    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
10663        let query = self.selection.select("functions");
10664        let query = query.select("id");
10665        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10666        Ok(ids
10667            .into_iter()
10668            .map(|id| Function {
10669                proc: self.proc.clone(),
10670                selection: crate::querybuilder::query()
10671                    .select("node")
10672                    .arg("id", &id.0)
10673                    .inline_fragment("Function"),
10674                graphql_client: self.graphql_client.clone(),
10675            })
10676            .collect())
10677    }
10678    /// A unique identifier for this InterfaceTypeDef.
10679    pub async fn id(&self) -> Result<Id, DaggerError> {
10680        let query = self.selection.select("id");
10681        query.execute(self.graphql_client.clone()).await
10682    }
10683    /// The name of the interface.
10684    pub async fn name(&self) -> Result<String, DaggerError> {
10685        let query = self.selection.select("name");
10686        query.execute(self.graphql_client.clone()).await
10687    }
10688    /// The location of this interface declaration.
10689    pub fn source_map(&self) -> SourceMap {
10690        let query = self.selection.select("sourceMap");
10691        SourceMap {
10692            proc: self.proc.clone(),
10693            selection: query,
10694            graphql_client: self.graphql_client.clone(),
10695        }
10696    }
10697    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
10698    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10699        let query = self.selection.select("sourceModuleName");
10700        query.execute(self.graphql_client.clone()).await
10701    }
10702}
10703impl Node for InterfaceTypeDef {
10704    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10705        let query = self.selection.select("id");
10706        let graphql_client = self.graphql_client.clone();
10707        async move { query.execute(graphql_client).await }
10708    }
10709}
10710#[derive(Clone)]
10711pub struct JsonValue {
10712    pub proc: Option<Arc<DaggerSessionProc>>,
10713    pub selection: Selection,
10714    pub graphql_client: DynGraphQLClient,
10715}
10716#[derive(Builder, Debug, PartialEq)]
10717pub struct JsonValueContentsOpts<'a> {
10718    /// Optional line prefix
10719    #[builder(setter(into, strip_option), default)]
10720    pub indent: Option<&'a str>,
10721    /// Pretty-print
10722    #[builder(setter(into, strip_option), default)]
10723    pub pretty: Option<bool>,
10724}
10725impl IntoID<Id> for JsonValue {
10726    fn into_id(
10727        self,
10728    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10729        Box::pin(async move { self.id().await })
10730    }
10731}
10732impl Loadable for JsonValue {
10733    fn graphql_type() -> &'static str {
10734        "JSONValue"
10735    }
10736    fn from_query(
10737        proc: Option<Arc<DaggerSessionProc>>,
10738        selection: Selection,
10739        graphql_client: DynGraphQLClient,
10740    ) -> Self {
10741        Self {
10742            proc,
10743            selection,
10744            graphql_client,
10745        }
10746    }
10747}
10748impl JsonValue {
10749    /// Decode an array from json
10750    pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
10751        let query = self.selection.select("asArray");
10752        let query = query.select("id");
10753        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10754        Ok(ids
10755            .into_iter()
10756            .map(|id| JsonValue {
10757                proc: self.proc.clone(),
10758                selection: crate::querybuilder::query()
10759                    .select("node")
10760                    .arg("id", &id.0)
10761                    .inline_fragment("JSONValue"),
10762                graphql_client: self.graphql_client.clone(),
10763            })
10764            .collect())
10765    }
10766    /// Decode a boolean from json
10767    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10768        let query = self.selection.select("asBoolean");
10769        query.execute(self.graphql_client.clone()).await
10770    }
10771    /// Decode an integer from json
10772    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10773        let query = self.selection.select("asInteger");
10774        query.execute(self.graphql_client.clone()).await
10775    }
10776    /// Decode a string from json
10777    pub async fn as_string(&self) -> Result<String, DaggerError> {
10778        let query = self.selection.select("asString");
10779        query.execute(self.graphql_client.clone()).await
10780    }
10781    /// Return the value encoded as json
10782    ///
10783    /// # Arguments
10784    ///
10785    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10786    pub async fn contents(&self) -> Result<Json, DaggerError> {
10787        let query = self.selection.select("contents");
10788        query.execute(self.graphql_client.clone()).await
10789    }
10790    /// Return the value encoded as json
10791    ///
10792    /// # Arguments
10793    ///
10794    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10795    pub async fn contents_opts<'a>(
10796        &self,
10797        opts: JsonValueContentsOpts<'a>,
10798    ) -> Result<Json, DaggerError> {
10799        let mut query = self.selection.select("contents");
10800        if let Some(pretty) = opts.pretty {
10801            query = query.arg("pretty", pretty);
10802        }
10803        if let Some(indent) = opts.indent {
10804            query = query.arg("indent", indent);
10805        }
10806        query.execute(self.graphql_client.clone()).await
10807    }
10808    /// Lookup the field at the given path, and return its value.
10809    ///
10810    /// # Arguments
10811    ///
10812    /// * `path` - Path of the field to lookup, encoded as an array of field names
10813    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
10814        let mut query = self.selection.select("field");
10815        query = query.arg(
10816            "path",
10817            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10818        );
10819        JsonValue {
10820            proc: self.proc.clone(),
10821            selection: query,
10822            graphql_client: self.graphql_client.clone(),
10823        }
10824    }
10825    /// List fields of the encoded object
10826    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
10827        let query = self.selection.select("fields");
10828        query.execute(self.graphql_client.clone()).await
10829    }
10830    /// A unique identifier for this JSONValue.
10831    pub async fn id(&self) -> Result<Id, DaggerError> {
10832        let query = self.selection.select("id");
10833        query.execute(self.graphql_client.clone()).await
10834    }
10835    /// Encode a boolean to json
10836    ///
10837    /// # Arguments
10838    ///
10839    /// * `value` - New boolean value
10840    pub fn new_boolean(&self, value: bool) -> JsonValue {
10841        let mut query = self.selection.select("newBoolean");
10842        query = query.arg("value", value);
10843        JsonValue {
10844            proc: self.proc.clone(),
10845            selection: query,
10846            graphql_client: self.graphql_client.clone(),
10847        }
10848    }
10849    /// Encode an integer to json
10850    ///
10851    /// # Arguments
10852    ///
10853    /// * `value` - New integer value
10854    pub fn new_integer(&self, value: isize) -> JsonValue {
10855        let mut query = self.selection.select("newInteger");
10856        query = query.arg("value", value);
10857        JsonValue {
10858            proc: self.proc.clone(),
10859            selection: query,
10860            graphql_client: self.graphql_client.clone(),
10861        }
10862    }
10863    /// Encode a string to json
10864    ///
10865    /// # Arguments
10866    ///
10867    /// * `value` - New string value
10868    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
10869        let mut query = self.selection.select("newString");
10870        query = query.arg("value", value.into());
10871        JsonValue {
10872            proc: self.proc.clone(),
10873            selection: query,
10874            graphql_client: self.graphql_client.clone(),
10875        }
10876    }
10877    /// Return a new json value, decoded from the given content
10878    ///
10879    /// # Arguments
10880    ///
10881    /// * `contents` - New JSON-encoded contents
10882    pub fn with_contents(&self, contents: Json) -> JsonValue {
10883        let mut query = self.selection.select("withContents");
10884        query = query.arg("contents", contents);
10885        JsonValue {
10886            proc: self.proc.clone(),
10887            selection: query,
10888            graphql_client: self.graphql_client.clone(),
10889        }
10890    }
10891    /// Set a new field at the given path
10892    ///
10893    /// # Arguments
10894    ///
10895    /// * `path` - Path of the field to set, encoded as an array of field names
10896    /// * `value` - The new value of the field
10897    pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
10898        let mut query = self.selection.select("withField");
10899        query = query.arg(
10900            "path",
10901            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10902        );
10903        query = query.arg_lazy(
10904            "value",
10905            Box::new(move || {
10906                let value = value.clone();
10907                Box::pin(async move { value.into_id().await.unwrap().quote() })
10908            }),
10909        );
10910        JsonValue {
10911            proc: self.proc.clone(),
10912            selection: query,
10913            graphql_client: self.graphql_client.clone(),
10914        }
10915    }
10916}
10917impl Node for JsonValue {
10918    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10919        let query = self.selection.select("id");
10920        let graphql_client = self.graphql_client.clone();
10921        async move { query.execute(graphql_client).await }
10922    }
10923}
10924#[derive(Clone)]
10925pub struct Llm {
10926    pub proc: Option<Arc<DaggerSessionProc>>,
10927    pub selection: Selection,
10928    pub graphql_client: DynGraphQLClient,
10929}
10930impl IntoID<Id> for Llm {
10931    fn into_id(
10932        self,
10933    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10934        Box::pin(async move { self.id().await })
10935    }
10936}
10937impl Loadable for Llm {
10938    fn graphql_type() -> &'static str {
10939        "LLM"
10940    }
10941    fn from_query(
10942        proc: Option<Arc<DaggerSessionProc>>,
10943        selection: Selection,
10944        graphql_client: DynGraphQLClient,
10945    ) -> Self {
10946        Self {
10947            proc,
10948            selection,
10949            graphql_client,
10950        }
10951    }
10952}
10953impl Llm {
10954    /// create a branch in the LLM's history
10955    pub fn attempt(&self, number: isize) -> Llm {
10956        let mut query = self.selection.select("attempt");
10957        query = query.arg("number", number);
10958        Llm {
10959            proc: self.proc.clone(),
10960            selection: query,
10961            graphql_client: self.graphql_client.clone(),
10962        }
10963    }
10964    /// returns the type of the current state
10965    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
10966        let mut query = self.selection.select("bindResult");
10967        query = query.arg("name", name.into());
10968        Binding {
10969            proc: self.proc.clone(),
10970            selection: query,
10971            graphql_client: self.graphql_client.clone(),
10972        }
10973    }
10974    /// return the LLM's current environment
10975    pub fn env(&self) -> Env {
10976        let query = self.selection.select("env");
10977        Env {
10978            proc: self.proc.clone(),
10979            selection: query,
10980            graphql_client: self.graphql_client.clone(),
10981        }
10982    }
10983    /// Indicates whether there are any queued prompts or tool results to send to the model
10984    pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
10985        let query = self.selection.select("hasPrompt");
10986        query.execute(self.graphql_client.clone()).await
10987    }
10988    /// return the llm message history
10989    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
10990        let query = self.selection.select("history");
10991        query.execute(self.graphql_client.clone()).await
10992    }
10993    /// return the raw llm message history as json
10994    pub async fn history_json(&self) -> Result<Json, DaggerError> {
10995        let query = self.selection.select("historyJSON");
10996        query.execute(self.graphql_client.clone()).await
10997    }
10998    /// A unique identifier for this LLM.
10999    pub async fn id(&self) -> Result<Id, DaggerError> {
11000        let query = self.selection.select("id");
11001        query.execute(self.graphql_client.clone()).await
11002    }
11003    /// return the last llm reply from the history
11004    pub async fn last_reply(&self) -> Result<String, DaggerError> {
11005        let query = self.selection.select("lastReply");
11006        query.execute(self.graphql_client.clone()).await
11007    }
11008    /// Submit the queued prompt, evaluate any tool calls, queue their results, and keep going until the model ends its turn
11009    pub fn r#loop(&self) -> Llm {
11010        let query = self.selection.select("loop");
11011        Llm {
11012            proc: self.proc.clone(),
11013            selection: query,
11014            graphql_client: self.graphql_client.clone(),
11015        }
11016    }
11017    /// return the model used by the llm
11018    pub async fn model(&self) -> Result<String, DaggerError> {
11019        let query = self.selection.select("model");
11020        query.execute(self.graphql_client.clone()).await
11021    }
11022    /// return the provider used by the llm
11023    pub async fn provider(&self) -> Result<String, DaggerError> {
11024        let query = self.selection.select("provider");
11025        query.execute(self.graphql_client.clone()).await
11026    }
11027    /// Submit the queued prompt or tool call results, evaluate any tool calls, and queue their results
11028    pub async fn step(&self) -> Result<Llm, DaggerError> {
11029        let query = self.selection.select("step");
11030        let id: Id = query.execute(self.graphql_client.clone()).await?;
11031        Ok(Llm {
11032            proc: self.proc.clone(),
11033            selection: query
11034                .root()
11035                .select("node")
11036                .arg("id", &id.0)
11037                .inline_fragment("LLM"),
11038            graphql_client: self.graphql_client.clone(),
11039        })
11040    }
11041    /// synchronize LLM state
11042    pub async fn sync(&self) -> Result<Llm, DaggerError> {
11043        let query = self.selection.select("sync");
11044        let id: Id = query.execute(self.graphql_client.clone()).await?;
11045        Ok(Llm {
11046            proc: self.proc.clone(),
11047            selection: query
11048                .root()
11049                .select("node")
11050                .arg("id", &id.0)
11051                .inline_fragment("LLM"),
11052            graphql_client: self.graphql_client.clone(),
11053        })
11054    }
11055    /// returns the token usage of the current state
11056    pub fn token_usage(&self) -> LlmTokenUsage {
11057        let query = self.selection.select("tokenUsage");
11058        LlmTokenUsage {
11059            proc: self.proc.clone(),
11060            selection: query,
11061            graphql_client: self.graphql_client.clone(),
11062        }
11063    }
11064    /// print documentation for available tools
11065    pub async fn tools(&self) -> Result<String, DaggerError> {
11066        let query = self.selection.select("tools");
11067        query.execute(self.graphql_client.clone()).await
11068    }
11069    /// Return a new LLM with the specified function no longer exposed as a tool
11070    ///
11071    /// # Arguments
11072    ///
11073    /// * `type_name` - The type name whose function will be blocked
11074    /// * `function` - The function to block
11075    ///
11076    /// Will be converted to lowerCamelCase if necessary.
11077    pub fn with_blocked_function(
11078        &self,
11079        type_name: impl Into<String>,
11080        function: impl Into<String>,
11081    ) -> Llm {
11082        let mut query = self.selection.select("withBlockedFunction");
11083        query = query.arg("typeName", type_name.into());
11084        query = query.arg("function", function.into());
11085        Llm {
11086            proc: self.proc.clone(),
11087            selection: query,
11088            graphql_client: self.graphql_client.clone(),
11089        }
11090    }
11091    /// allow the LLM to interact with an environment via MCP
11092    pub fn with_env(&self, env: impl IntoID<Id>) -> Llm {
11093        let mut query = self.selection.select("withEnv");
11094        query = query.arg_lazy(
11095            "env",
11096            Box::new(move || {
11097                let env = env.clone();
11098                Box::pin(async move { env.into_id().await.unwrap().quote() })
11099            }),
11100        );
11101        Llm {
11102            proc: self.proc.clone(),
11103            selection: query,
11104            graphql_client: self.graphql_client.clone(),
11105        }
11106    }
11107    /// Add an external MCP server to the LLM
11108    ///
11109    /// # Arguments
11110    ///
11111    /// * `name` - The name of the MCP server
11112    /// * `service` - The MCP service to run and communicate with over stdio
11113    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
11114        let mut query = self.selection.select("withMCPServer");
11115        query = query.arg("name", name.into());
11116        query = query.arg_lazy(
11117            "service",
11118            Box::new(move || {
11119                let service = service.clone();
11120                Box::pin(async move { service.into_id().await.unwrap().quote() })
11121            }),
11122        );
11123        Llm {
11124            proc: self.proc.clone(),
11125            selection: query,
11126            graphql_client: self.graphql_client.clone(),
11127        }
11128    }
11129    /// swap out the llm model
11130    ///
11131    /// # Arguments
11132    ///
11133    /// * `model` - The model to use
11134    pub fn with_model(&self, model: impl Into<String>) -> Llm {
11135        let mut query = self.selection.select("withModel");
11136        query = query.arg("model", model.into());
11137        Llm {
11138            proc: self.proc.clone(),
11139            selection: query,
11140            graphql_client: self.graphql_client.clone(),
11141        }
11142    }
11143    /// append a prompt to the llm context
11144    ///
11145    /// # Arguments
11146    ///
11147    /// * `prompt` - The prompt to send
11148    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
11149        let mut query = self.selection.select("withPrompt");
11150        query = query.arg("prompt", prompt.into());
11151        Llm {
11152            proc: self.proc.clone(),
11153            selection: query,
11154            graphql_client: self.graphql_client.clone(),
11155        }
11156    }
11157    /// append the contents of a file to the llm context
11158    ///
11159    /// # Arguments
11160    ///
11161    /// * `file` - The file to read the prompt from
11162    pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
11163        let mut query = self.selection.select("withPromptFile");
11164        query = query.arg_lazy(
11165            "file",
11166            Box::new(move || {
11167                let file = file.clone();
11168                Box::pin(async move { file.into_id().await.unwrap().quote() })
11169            }),
11170        );
11171        Llm {
11172            proc: self.proc.clone(),
11173            selection: query,
11174            graphql_client: self.graphql_client.clone(),
11175        }
11176    }
11177    /// Use a static set of tools for method calls, e.g. for MCP clients that do not support dynamic tool registration
11178    pub fn with_static_tools(&self) -> Llm {
11179        let query = self.selection.select("withStaticTools");
11180        Llm {
11181            proc: self.proc.clone(),
11182            selection: query,
11183            graphql_client: self.graphql_client.clone(),
11184        }
11185    }
11186    /// Add a system prompt to the LLM's environment
11187    ///
11188    /// # Arguments
11189    ///
11190    /// * `prompt` - The system prompt to send
11191    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
11192        let mut query = self.selection.select("withSystemPrompt");
11193        query = query.arg("prompt", prompt.into());
11194        Llm {
11195            proc: self.proc.clone(),
11196            selection: query,
11197            graphql_client: self.graphql_client.clone(),
11198        }
11199    }
11200    /// Disable the default system prompt
11201    pub fn without_default_system_prompt(&self) -> Llm {
11202        let query = self.selection.select("withoutDefaultSystemPrompt");
11203        Llm {
11204            proc: self.proc.clone(),
11205            selection: query,
11206            graphql_client: self.graphql_client.clone(),
11207        }
11208    }
11209    /// Clear the message history, leaving only the system prompts
11210    pub fn without_message_history(&self) -> Llm {
11211        let query = self.selection.select("withoutMessageHistory");
11212        Llm {
11213            proc: self.proc.clone(),
11214            selection: query,
11215            graphql_client: self.graphql_client.clone(),
11216        }
11217    }
11218    /// Clear the system prompts, leaving only the default system prompt
11219    pub fn without_system_prompts(&self) -> Llm {
11220        let query = self.selection.select("withoutSystemPrompts");
11221        Llm {
11222            proc: self.proc.clone(),
11223            selection: query,
11224            graphql_client: self.graphql_client.clone(),
11225        }
11226    }
11227}
11228impl Node for Llm {
11229    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11230        let query = self.selection.select("id");
11231        let graphql_client = self.graphql_client.clone();
11232        async move { query.execute(graphql_client).await }
11233    }
11234}
11235impl Syncer for Llm {
11236    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11237        let query = self.selection.select("id");
11238        let graphql_client = self.graphql_client.clone();
11239        async move { query.execute(graphql_client).await }
11240    }
11241    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11242        let query = self.selection.select("sync");
11243        let graphql_client = self.graphql_client.clone();
11244        async move { query.execute(graphql_client).await }
11245    }
11246}
11247#[derive(Clone)]
11248pub struct LlmTokenUsage {
11249    pub proc: Option<Arc<DaggerSessionProc>>,
11250    pub selection: Selection,
11251    pub graphql_client: DynGraphQLClient,
11252}
11253impl IntoID<Id> for LlmTokenUsage {
11254    fn into_id(
11255        self,
11256    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11257        Box::pin(async move { self.id().await })
11258    }
11259}
11260impl Loadable for LlmTokenUsage {
11261    fn graphql_type() -> &'static str {
11262        "LLMTokenUsage"
11263    }
11264    fn from_query(
11265        proc: Option<Arc<DaggerSessionProc>>,
11266        selection: Selection,
11267        graphql_client: DynGraphQLClient,
11268    ) -> Self {
11269        Self {
11270            proc,
11271            selection,
11272            graphql_client,
11273        }
11274    }
11275}
11276impl LlmTokenUsage {
11277    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
11278        let query = self.selection.select("cachedTokenReads");
11279        query.execute(self.graphql_client.clone()).await
11280    }
11281    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
11282        let query = self.selection.select("cachedTokenWrites");
11283        query.execute(self.graphql_client.clone()).await
11284    }
11285    /// A unique identifier for this LLMTokenUsage.
11286    pub async fn id(&self) -> Result<Id, DaggerError> {
11287        let query = self.selection.select("id");
11288        query.execute(self.graphql_client.clone()).await
11289    }
11290    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
11291        let query = self.selection.select("inputTokens");
11292        query.execute(self.graphql_client.clone()).await
11293    }
11294    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
11295        let query = self.selection.select("outputTokens");
11296        query.execute(self.graphql_client.clone()).await
11297    }
11298    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
11299        let query = self.selection.select("totalTokens");
11300        query.execute(self.graphql_client.clone()).await
11301    }
11302}
11303impl Node for LlmTokenUsage {
11304    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11305        let query = self.selection.select("id");
11306        let graphql_client = self.graphql_client.clone();
11307        async move { query.execute(graphql_client).await }
11308    }
11309}
11310#[derive(Clone)]
11311pub struct Label {
11312    pub proc: Option<Arc<DaggerSessionProc>>,
11313    pub selection: Selection,
11314    pub graphql_client: DynGraphQLClient,
11315}
11316impl IntoID<Id> for Label {
11317    fn into_id(
11318        self,
11319    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11320        Box::pin(async move { self.id().await })
11321    }
11322}
11323impl Loadable for Label {
11324    fn graphql_type() -> &'static str {
11325        "Label"
11326    }
11327    fn from_query(
11328        proc: Option<Arc<DaggerSessionProc>>,
11329        selection: Selection,
11330        graphql_client: DynGraphQLClient,
11331    ) -> Self {
11332        Self {
11333            proc,
11334            selection,
11335            graphql_client,
11336        }
11337    }
11338}
11339impl Label {
11340    /// A unique identifier for this Label.
11341    pub async fn id(&self) -> Result<Id, DaggerError> {
11342        let query = self.selection.select("id");
11343        query.execute(self.graphql_client.clone()).await
11344    }
11345    /// The label name.
11346    pub async fn name(&self) -> Result<String, DaggerError> {
11347        let query = self.selection.select("name");
11348        query.execute(self.graphql_client.clone()).await
11349    }
11350    /// The label value.
11351    pub async fn value(&self) -> Result<String, DaggerError> {
11352        let query = self.selection.select("value");
11353        query.execute(self.graphql_client.clone()).await
11354    }
11355}
11356impl Node for Label {
11357    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11358        let query = self.selection.select("id");
11359        let graphql_client = self.graphql_client.clone();
11360        async move { query.execute(graphql_client).await }
11361    }
11362}
11363#[derive(Clone)]
11364pub struct ListTypeDef {
11365    pub proc: Option<Arc<DaggerSessionProc>>,
11366    pub selection: Selection,
11367    pub graphql_client: DynGraphQLClient,
11368}
11369impl IntoID<Id> for ListTypeDef {
11370    fn into_id(
11371        self,
11372    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11373        Box::pin(async move { self.id().await })
11374    }
11375}
11376impl Loadable for ListTypeDef {
11377    fn graphql_type() -> &'static str {
11378        "ListTypeDef"
11379    }
11380    fn from_query(
11381        proc: Option<Arc<DaggerSessionProc>>,
11382        selection: Selection,
11383        graphql_client: DynGraphQLClient,
11384    ) -> Self {
11385        Self {
11386            proc,
11387            selection,
11388            graphql_client,
11389        }
11390    }
11391}
11392impl ListTypeDef {
11393    /// The type of the elements in the list.
11394    pub fn element_type_def(&self) -> TypeDef {
11395        let query = self.selection.select("elementTypeDef");
11396        TypeDef {
11397            proc: self.proc.clone(),
11398            selection: query,
11399            graphql_client: self.graphql_client.clone(),
11400        }
11401    }
11402    /// A unique identifier for this ListTypeDef.
11403    pub async fn id(&self) -> Result<Id, DaggerError> {
11404        let query = self.selection.select("id");
11405        query.execute(self.graphql_client.clone()).await
11406    }
11407}
11408impl Node for ListTypeDef {
11409    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11410        let query = self.selection.select("id");
11411        let graphql_client = self.graphql_client.clone();
11412        async move { query.execute(graphql_client).await }
11413    }
11414}
11415#[derive(Clone)]
11416pub struct Module {
11417    pub proc: Option<Arc<DaggerSessionProc>>,
11418    pub selection: Selection,
11419    pub graphql_client: DynGraphQLClient,
11420}
11421#[derive(Builder, Debug, PartialEq)]
11422pub struct ModuleChecksOpts<'a> {
11423    /// Only include checks matching the specified patterns
11424    #[builder(setter(into, strip_option), default)]
11425    pub include: Option<Vec<&'a str>>,
11426    /// When true, only return annotated check functions; exclude generate-as-checks
11427    #[builder(setter(into, strip_option), default)]
11428    pub no_generate: Option<bool>,
11429}
11430#[derive(Builder, Debug, PartialEq)]
11431pub struct ModuleGeneratorsOpts<'a> {
11432    /// Only include generators matching the specified patterns
11433    #[builder(setter(into, strip_option), default)]
11434    pub include: Option<Vec<&'a str>>,
11435}
11436#[derive(Builder, Debug, PartialEq)]
11437pub struct ModuleServeOpts {
11438    /// Install the module as the entrypoint, promoting its main-object methods onto the Query root
11439    #[builder(setter(into, strip_option), default)]
11440    pub entrypoint: Option<bool>,
11441    /// Expose the dependencies of this module to the client
11442    #[builder(setter(into, strip_option), default)]
11443    pub include_dependencies: Option<bool>,
11444}
11445#[derive(Builder, Debug, PartialEq)]
11446pub struct ModuleServicesOpts<'a> {
11447    /// Only include services matching the specified patterns
11448    #[builder(setter(into, strip_option), default)]
11449    pub include: Option<Vec<&'a str>>,
11450}
11451impl IntoID<Id> for Module {
11452    fn into_id(
11453        self,
11454    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11455        Box::pin(async move { self.id().await })
11456    }
11457}
11458impl Loadable for Module {
11459    fn graphql_type() -> &'static str {
11460        "Module"
11461    }
11462    fn from_query(
11463        proc: Option<Arc<DaggerSessionProc>>,
11464        selection: Selection,
11465        graphql_client: DynGraphQLClient,
11466    ) -> Self {
11467        Self {
11468            proc,
11469            selection,
11470            graphql_client,
11471        }
11472    }
11473}
11474impl Module {
11475    /// Return the check defined by the module with the given name. Must match to exactly one check.
11476    ///
11477    /// # Arguments
11478    ///
11479    /// * `name` - The name of the check to retrieve
11480    pub fn check(&self, name: impl Into<String>) -> Check {
11481        let mut query = self.selection.select("check");
11482        query = query.arg("name", name.into());
11483        Check {
11484            proc: self.proc.clone(),
11485            selection: query,
11486            graphql_client: self.graphql_client.clone(),
11487        }
11488    }
11489    /// Return all checks defined by the module
11490    ///
11491    /// # Arguments
11492    ///
11493    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11494    pub fn checks(&self) -> CheckGroup {
11495        let query = self.selection.select("checks");
11496        CheckGroup {
11497            proc: self.proc.clone(),
11498            selection: query,
11499            graphql_client: self.graphql_client.clone(),
11500        }
11501    }
11502    /// Return all checks defined by the module
11503    ///
11504    /// # Arguments
11505    ///
11506    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11507    pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
11508        let mut query = self.selection.select("checks");
11509        if let Some(include) = opts.include {
11510            query = query.arg("include", include);
11511        }
11512        if let Some(no_generate) = opts.no_generate {
11513            query = query.arg("noGenerate", no_generate);
11514        }
11515        CheckGroup {
11516            proc: self.proc.clone(),
11517            selection: query,
11518            graphql_client: self.graphql_client.clone(),
11519        }
11520    }
11521    /// The dependencies of the module.
11522    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
11523        let query = self.selection.select("dependencies");
11524        let query = query.select("id");
11525        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11526        Ok(ids
11527            .into_iter()
11528            .map(|id| Module {
11529                proc: self.proc.clone(),
11530                selection: crate::querybuilder::query()
11531                    .select("node")
11532                    .arg("id", &id.0)
11533                    .inline_fragment("Module"),
11534                graphql_client: self.graphql_client.clone(),
11535            })
11536            .collect())
11537    }
11538    /// The doc string of the module, if any
11539    pub async fn description(&self) -> Result<String, DaggerError> {
11540        let query = self.selection.select("description");
11541        query.execute(self.graphql_client.clone()).await
11542    }
11543    /// Enumerations served by this module.
11544    pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
11545        let query = self.selection.select("enums");
11546        let query = query.select("id");
11547        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11548        Ok(ids
11549            .into_iter()
11550            .map(|id| TypeDef {
11551                proc: self.proc.clone(),
11552                selection: crate::querybuilder::query()
11553                    .select("node")
11554                    .arg("id", &id.0)
11555                    .inline_fragment("TypeDef"),
11556                graphql_client: self.graphql_client.clone(),
11557            })
11558            .collect())
11559    }
11560    /// The generated files and directories made on top of the module source's context directory.
11561    pub fn generated_context_directory(&self) -> Directory {
11562        let query = self.selection.select("generatedContextDirectory");
11563        Directory {
11564            proc: self.proc.clone(),
11565            selection: query,
11566            graphql_client: self.graphql_client.clone(),
11567        }
11568    }
11569    /// Return the generator defined by the module with the given name. Must match to exactly one generator.
11570    ///
11571    /// # Arguments
11572    ///
11573    /// * `name` - The name of the generator to retrieve
11574    pub fn generator(&self, name: impl Into<String>) -> Generator {
11575        let mut query = self.selection.select("generator");
11576        query = query.arg("name", name.into());
11577        Generator {
11578            proc: self.proc.clone(),
11579            selection: query,
11580            graphql_client: self.graphql_client.clone(),
11581        }
11582    }
11583    /// Return all generators defined by the module
11584    ///
11585    /// # Arguments
11586    ///
11587    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11588    pub fn generators(&self) -> GeneratorGroup {
11589        let query = self.selection.select("generators");
11590        GeneratorGroup {
11591            proc: self.proc.clone(),
11592            selection: query,
11593            graphql_client: self.graphql_client.clone(),
11594        }
11595    }
11596    /// Return all generators defined by the module
11597    ///
11598    /// # Arguments
11599    ///
11600    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11601    pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
11602        let mut query = self.selection.select("generators");
11603        if let Some(include) = opts.include {
11604            query = query.arg("include", include);
11605        }
11606        GeneratorGroup {
11607            proc: self.proc.clone(),
11608            selection: query,
11609            graphql_client: self.graphql_client.clone(),
11610        }
11611    }
11612    /// A unique identifier for this Module.
11613    pub async fn id(&self) -> Result<Id, DaggerError> {
11614        let query = self.selection.select("id");
11615        query.execute(self.graphql_client.clone()).await
11616    }
11617    /// Interfaces served by this module.
11618    pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
11619        let query = self.selection.select("interfaces");
11620        let query = query.select("id");
11621        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11622        Ok(ids
11623            .into_iter()
11624            .map(|id| TypeDef {
11625                proc: self.proc.clone(),
11626                selection: crate::querybuilder::query()
11627                    .select("node")
11628                    .arg("id", &id.0)
11629                    .inline_fragment("TypeDef"),
11630                graphql_client: self.graphql_client.clone(),
11631            })
11632            .collect())
11633    }
11634    /// The introspection schema JSON file for this module.
11635    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
11636    /// Note: this is in the context of a module, so some core types may be hidden.
11637    pub fn introspection_schema_json(&self) -> File {
11638        let query = self.selection.select("introspectionSchemaJSON");
11639        File {
11640            proc: self.proc.clone(),
11641            selection: query,
11642            graphql_client: self.graphql_client.clone(),
11643        }
11644    }
11645    /// The name of the module
11646    pub async fn name(&self) -> Result<String, DaggerError> {
11647        let query = self.selection.select("name");
11648        query.execute(self.graphql_client.clone()).await
11649    }
11650    /// Objects served by this module.
11651    pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
11652        let query = self.selection.select("objects");
11653        let query = query.select("id");
11654        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11655        Ok(ids
11656            .into_iter()
11657            .map(|id| TypeDef {
11658                proc: self.proc.clone(),
11659                selection: crate::querybuilder::query()
11660                    .select("node")
11661                    .arg("id", &id.0)
11662                    .inline_fragment("TypeDef"),
11663                graphql_client: self.graphql_client.clone(),
11664            })
11665            .collect())
11666    }
11667    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
11668    pub fn runtime(&self) -> Container {
11669        let query = self.selection.select("runtime");
11670        Container {
11671            proc: self.proc.clone(),
11672            selection: query,
11673            graphql_client: self.graphql_client.clone(),
11674        }
11675    }
11676    /// The SDK config used by this module.
11677    pub fn sdk(&self) -> SdkConfig {
11678        let query = self.selection.select("sdk");
11679        SdkConfig {
11680            proc: self.proc.clone(),
11681            selection: query,
11682            graphql_client: self.graphql_client.clone(),
11683        }
11684    }
11685    /// Serve a module's API in the current session.
11686    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11687    ///
11688    /// # Arguments
11689    ///
11690    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11691    pub async fn serve(&self) -> Result<Void, DaggerError> {
11692        let query = self.selection.select("serve");
11693        query.execute(self.graphql_client.clone()).await
11694    }
11695    /// Serve a module's API in the current session.
11696    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11697    ///
11698    /// # Arguments
11699    ///
11700    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11701    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
11702        let mut query = self.selection.select("serve");
11703        if let Some(include_dependencies) = opts.include_dependencies {
11704            query = query.arg("includeDependencies", include_dependencies);
11705        }
11706        if let Some(entrypoint) = opts.entrypoint {
11707            query = query.arg("entrypoint", entrypoint);
11708        }
11709        query.execute(self.graphql_client.clone()).await
11710    }
11711    /// Return all services defined by the module
11712    ///
11713    /// # Arguments
11714    ///
11715    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11716    pub fn services(&self) -> UpGroup {
11717        let query = self.selection.select("services");
11718        UpGroup {
11719            proc: self.proc.clone(),
11720            selection: query,
11721            graphql_client: self.graphql_client.clone(),
11722        }
11723    }
11724    /// Return all services defined by the module
11725    ///
11726    /// # Arguments
11727    ///
11728    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11729    pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
11730        let mut query = self.selection.select("services");
11731        if let Some(include) = opts.include {
11732            query = query.arg("include", include);
11733        }
11734        UpGroup {
11735            proc: self.proc.clone(),
11736            selection: query,
11737            graphql_client: self.graphql_client.clone(),
11738        }
11739    }
11740    /// The source for the module.
11741    pub fn source(&self) -> ModuleSource {
11742        let query = self.selection.select("source");
11743        ModuleSource {
11744            proc: self.proc.clone(),
11745            selection: query,
11746            graphql_client: self.graphql_client.clone(),
11747        }
11748    }
11749    /// Forces evaluation of the module, including any loading into the engine and associated validation.
11750    pub async fn sync(&self) -> Result<Module, DaggerError> {
11751        let query = self.selection.select("sync");
11752        let id: Id = query.execute(self.graphql_client.clone()).await?;
11753        Ok(Module {
11754            proc: self.proc.clone(),
11755            selection: query
11756                .root()
11757                .select("node")
11758                .arg("id", &id.0)
11759                .inline_fragment("Module"),
11760            graphql_client: self.graphql_client.clone(),
11761        })
11762    }
11763    /// User-defined default values, loaded from local .env files.
11764    pub fn user_defaults(&self) -> EnvFile {
11765        let query = self.selection.select("userDefaults");
11766        EnvFile {
11767            proc: self.proc.clone(),
11768            selection: query,
11769            graphql_client: self.graphql_client.clone(),
11770        }
11771    }
11772    /// Retrieves the module with the given description
11773    ///
11774    /// # Arguments
11775    ///
11776    /// * `description` - The description to set
11777    pub fn with_description(&self, description: impl Into<String>) -> Module {
11778        let mut query = self.selection.select("withDescription");
11779        query = query.arg("description", description.into());
11780        Module {
11781            proc: self.proc.clone(),
11782            selection: query,
11783            graphql_client: self.graphql_client.clone(),
11784        }
11785    }
11786    /// This module plus the given Enum type and associated values
11787    pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
11788        let mut query = self.selection.select("withEnum");
11789        query = query.arg_lazy(
11790            "enum",
11791            Box::new(move || {
11792                let r#enum = r#enum.clone();
11793                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
11794            }),
11795        );
11796        Module {
11797            proc: self.proc.clone(),
11798            selection: query,
11799            graphql_client: self.graphql_client.clone(),
11800        }
11801    }
11802    /// This module plus the given Interface type and associated functions
11803    pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
11804        let mut query = self.selection.select("withInterface");
11805        query = query.arg_lazy(
11806            "iface",
11807            Box::new(move || {
11808                let iface = iface.clone();
11809                Box::pin(async move { iface.into_id().await.unwrap().quote() })
11810            }),
11811        );
11812        Module {
11813            proc: self.proc.clone(),
11814            selection: query,
11815            graphql_client: self.graphql_client.clone(),
11816        }
11817    }
11818    /// This module plus the given Object type and associated functions.
11819    pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
11820        let mut query = self.selection.select("withObject");
11821        query = query.arg_lazy(
11822            "object",
11823            Box::new(move || {
11824                let object = object.clone();
11825                Box::pin(async move { object.into_id().await.unwrap().quote() })
11826            }),
11827        );
11828        Module {
11829            proc: self.proc.clone(),
11830            selection: query,
11831            graphql_client: self.graphql_client.clone(),
11832        }
11833    }
11834}
11835impl Node for Module {
11836    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11837        let query = self.selection.select("id");
11838        let graphql_client = self.graphql_client.clone();
11839        async move { query.execute(graphql_client).await }
11840    }
11841}
11842impl Syncer for Module {
11843    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11844        let query = self.selection.select("id");
11845        let graphql_client = self.graphql_client.clone();
11846        async move { query.execute(graphql_client).await }
11847    }
11848    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11849        let query = self.selection.select("sync");
11850        let graphql_client = self.graphql_client.clone();
11851        async move { query.execute(graphql_client).await }
11852    }
11853}
11854#[derive(Clone)]
11855pub struct ModuleConfigClient {
11856    pub proc: Option<Arc<DaggerSessionProc>>,
11857    pub selection: Selection,
11858    pub graphql_client: DynGraphQLClient,
11859}
11860impl IntoID<Id> for ModuleConfigClient {
11861    fn into_id(
11862        self,
11863    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11864        Box::pin(async move { self.id().await })
11865    }
11866}
11867impl Loadable for ModuleConfigClient {
11868    fn graphql_type() -> &'static str {
11869        "ModuleConfigClient"
11870    }
11871    fn from_query(
11872        proc: Option<Arc<DaggerSessionProc>>,
11873        selection: Selection,
11874        graphql_client: DynGraphQLClient,
11875    ) -> Self {
11876        Self {
11877            proc,
11878            selection,
11879            graphql_client,
11880        }
11881    }
11882}
11883impl ModuleConfigClient {
11884    /// The directory the client is generated in.
11885    pub async fn directory(&self) -> Result<String, DaggerError> {
11886        let query = self.selection.select("directory");
11887        query.execute(self.graphql_client.clone()).await
11888    }
11889    /// The generator to use
11890    pub async fn generator(&self) -> Result<String, DaggerError> {
11891        let query = self.selection.select("generator");
11892        query.execute(self.graphql_client.clone()).await
11893    }
11894    /// A unique identifier for this ModuleConfigClient.
11895    pub async fn id(&self) -> Result<Id, DaggerError> {
11896        let query = self.selection.select("id");
11897        query.execute(self.graphql_client.clone()).await
11898    }
11899}
11900impl Node for ModuleConfigClient {
11901    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11902        let query = self.selection.select("id");
11903        let graphql_client = self.graphql_client.clone();
11904        async move { query.execute(graphql_client).await }
11905    }
11906}
11907#[derive(Clone)]
11908pub struct ModuleSource {
11909    pub proc: Option<Arc<DaggerSessionProc>>,
11910    pub selection: Selection,
11911    pub graphql_client: DynGraphQLClient,
11912}
11913impl IntoID<Id> for ModuleSource {
11914    fn into_id(
11915        self,
11916    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11917        Box::pin(async move { self.id().await })
11918    }
11919}
11920impl Loadable for ModuleSource {
11921    fn graphql_type() -> &'static str {
11922        "ModuleSource"
11923    }
11924    fn from_query(
11925        proc: Option<Arc<DaggerSessionProc>>,
11926        selection: Selection,
11927        graphql_client: DynGraphQLClient,
11928    ) -> Self {
11929        Self {
11930            proc,
11931            selection,
11932            graphql_client,
11933        }
11934    }
11935}
11936impl ModuleSource {
11937    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
11938    pub fn as_module(&self) -> Module {
11939        let query = self.selection.select("asModule");
11940        Module {
11941            proc: self.proc.clone(),
11942            selection: query,
11943            graphql_client: self.graphql_client.clone(),
11944        }
11945    }
11946    /// A human readable ref string representation of this module source.
11947    pub async fn as_string(&self) -> Result<String, DaggerError> {
11948        let query = self.selection.select("asString");
11949        query.execute(self.graphql_client.clone()).await
11950    }
11951    /// The blueprint referenced by the module source.
11952    pub fn blueprint(&self) -> ModuleSource {
11953        let query = self.selection.select("blueprint");
11954        ModuleSource {
11955            proc: self.proc.clone(),
11956            selection: query,
11957            graphql_client: self.graphql_client.clone(),
11958        }
11959    }
11960    /// The ref to clone the root of the git repo from. Only valid for git sources.
11961    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
11962        let query = self.selection.select("cloneRef");
11963        query.execute(self.graphql_client.clone()).await
11964    }
11965    /// The resolved commit of the git repo this source points to.
11966    pub async fn commit(&self) -> Result<String, DaggerError> {
11967        let query = self.selection.select("commit");
11968        query.execute(self.graphql_client.clone()).await
11969    }
11970    /// The clients generated for the module.
11971    pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
11972        let query = self.selection.select("configClients");
11973        let query = query.select("id");
11974        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11975        Ok(ids
11976            .into_iter()
11977            .map(|id| ModuleConfigClient {
11978                proc: self.proc.clone(),
11979                selection: crate::querybuilder::query()
11980                    .select("node")
11981                    .arg("id", &id.0)
11982                    .inline_fragment("ModuleConfigClient"),
11983                graphql_client: self.graphql_client.clone(),
11984            })
11985            .collect())
11986    }
11987    /// Whether an existing dagger.json for the module was found.
11988    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
11989        let query = self.selection.select("configExists");
11990        query.execute(self.graphql_client.clone()).await
11991    }
11992    /// The full directory loaded for the module source, including the source code as a subdirectory.
11993    pub fn context_directory(&self) -> Directory {
11994        let query = self.selection.select("contextDirectory");
11995        Directory {
11996            proc: self.proc.clone(),
11997            selection: query,
11998            graphql_client: self.graphql_client.clone(),
11999        }
12000    }
12001    /// The dependencies of the module source.
12002    pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12003        let query = self.selection.select("dependencies");
12004        let query = query.select("id");
12005        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12006        Ok(ids
12007            .into_iter()
12008            .map(|id| ModuleSource {
12009                proc: self.proc.clone(),
12010                selection: crate::querybuilder::query()
12011                    .select("node")
12012                    .arg("id", &id.0)
12013                    .inline_fragment("ModuleSource"),
12014                graphql_client: self.graphql_client.clone(),
12015            })
12016            .collect())
12017    }
12018    /// 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.
12019    pub async fn digest(&self) -> Result<String, DaggerError> {
12020        let query = self.selection.select("digest");
12021        query.execute(self.graphql_client.clone()).await
12022    }
12023    /// The directory containing the module configuration and source code (source code may be in a subdir).
12024    ///
12025    /// # Arguments
12026    ///
12027    /// * `path` - A subpath from the source directory to select.
12028    pub fn directory(&self, path: impl Into<String>) -> Directory {
12029        let mut query = self.selection.select("directory");
12030        query = query.arg("path", path.into());
12031        Directory {
12032            proc: self.proc.clone(),
12033            selection: query,
12034            graphql_client: self.graphql_client.clone(),
12035        }
12036    }
12037    /// The engine version of the module.
12038    pub async fn engine_version(&self) -> Result<String, DaggerError> {
12039        let query = self.selection.select("engineVersion");
12040        query.execute(self.graphql_client.clone()).await
12041    }
12042    /// The generated files and directories made on top of the module source's context directory, returned as a Changeset.
12043    pub fn generated_context_changeset(&self) -> Changeset {
12044        let query = self.selection.select("generatedContextChangeset");
12045        Changeset {
12046            proc: self.proc.clone(),
12047            selection: query,
12048            graphql_client: self.graphql_client.clone(),
12049        }
12050    }
12051    /// The generated files and directories made on top of the module source's context directory.
12052    pub fn generated_context_directory(&self) -> Directory {
12053        let query = self.selection.select("generatedContextDirectory");
12054        Directory {
12055            proc: self.proc.clone(),
12056            selection: query,
12057            graphql_client: self.graphql_client.clone(),
12058        }
12059    }
12060    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
12061    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
12062        let query = self.selection.select("htmlRepoURL");
12063        query.execute(self.graphql_client.clone()).await
12064    }
12065    /// The URL to the source's git repo in a web browser. Only valid for git sources.
12066    pub async fn html_url(&self) -> Result<String, DaggerError> {
12067        let query = self.selection.select("htmlURL");
12068        query.execute(self.graphql_client.clone()).await
12069    }
12070    /// A unique identifier for this ModuleSource.
12071    pub async fn id(&self) -> Result<Id, DaggerError> {
12072        let query = self.selection.select("id");
12073        query.execute(self.graphql_client.clone()).await
12074    }
12075    /// The introspection schema JSON file for this module source.
12076    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
12077    /// Note: this is in the context of a module, so some core types may be hidden.
12078    pub fn introspection_schema_json(&self) -> File {
12079        let query = self.selection.select("introspectionSchemaJSON");
12080        File {
12081            proc: self.proc.clone(),
12082            selection: query,
12083            graphql_client: self.graphql_client.clone(),
12084        }
12085    }
12086    /// The kind of module source (currently local, git or dir).
12087    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
12088        let query = self.selection.select("kind");
12089        query.execute(self.graphql_client.clone()).await
12090    }
12091    /// 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.
12092    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
12093        let query = self.selection.select("localContextDirectoryPath");
12094        query.execute(self.graphql_client.clone()).await
12095    }
12096    /// The name of the module, including any setting via the withName API.
12097    pub async fn module_name(&self) -> Result<String, DaggerError> {
12098        let query = self.selection.select("moduleName");
12099        query.execute(self.graphql_client.clone()).await
12100    }
12101    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
12102    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
12103        let query = self.selection.select("moduleOriginalName");
12104        query.execute(self.graphql_client.clone()).await
12105    }
12106    /// The original subpath used when instantiating this module source, relative to the context directory.
12107    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
12108        let query = self.selection.select("originalSubpath");
12109        query.execute(self.graphql_client.clone()).await
12110    }
12111    /// The pinned version of this module source.
12112    pub async fn pin(&self) -> Result<String, DaggerError> {
12113        let query = self.selection.select("pin");
12114        query.execute(self.graphql_client.clone()).await
12115    }
12116    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
12117    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
12118        let query = self.selection.select("repoRootPath");
12119        query.execute(self.graphql_client.clone()).await
12120    }
12121    /// The SDK configuration of the module.
12122    pub fn sdk(&self) -> SdkConfig {
12123        let query = self.selection.select("sdk");
12124        SdkConfig {
12125            proc: self.proc.clone(),
12126            selection: query,
12127            graphql_client: self.graphql_client.clone(),
12128        }
12129    }
12130    /// The path, relative to the context directory, that contains the module's dagger.json.
12131    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
12132        let query = self.selection.select("sourceRootSubpath");
12133        query.execute(self.graphql_client.clone()).await
12134    }
12135    /// The path to the directory containing the module's source code, relative to the context directory.
12136    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
12137        let query = self.selection.select("sourceSubpath");
12138        query.execute(self.graphql_client.clone()).await
12139    }
12140    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
12141    pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
12142        let query = self.selection.select("sync");
12143        let id: Id = query.execute(self.graphql_client.clone()).await?;
12144        Ok(ModuleSource {
12145            proc: self.proc.clone(),
12146            selection: query
12147                .root()
12148                .select("node")
12149                .arg("id", &id.0)
12150                .inline_fragment("ModuleSource"),
12151            graphql_client: self.graphql_client.clone(),
12152        })
12153    }
12154    /// The toolchains referenced by the module source.
12155    pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12156        let query = self.selection.select("toolchains");
12157        let query = query.select("id");
12158        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12159        Ok(ids
12160            .into_iter()
12161            .map(|id| ModuleSource {
12162                proc: self.proc.clone(),
12163                selection: crate::querybuilder::query()
12164                    .select("node")
12165                    .arg("id", &id.0)
12166                    .inline_fragment("ModuleSource"),
12167                graphql_client: self.graphql_client.clone(),
12168            })
12169            .collect())
12170    }
12171    /// User-defined defaults read from local .env files
12172    pub fn user_defaults(&self) -> EnvFile {
12173        let query = self.selection.select("userDefaults");
12174        EnvFile {
12175            proc: self.proc.clone(),
12176            selection: query,
12177            graphql_client: self.graphql_client.clone(),
12178        }
12179    }
12180    /// The specified version of the git repo this source points to.
12181    pub async fn version(&self) -> Result<String, DaggerError> {
12182        let query = self.selection.select("version");
12183        query.execute(self.graphql_client.clone()).await
12184    }
12185    /// Set a blueprint for the module source.
12186    ///
12187    /// # Arguments
12188    ///
12189    /// * `blueprint` - The blueprint module to set.
12190    pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
12191        let mut query = self.selection.select("withBlueprint");
12192        query = query.arg_lazy(
12193            "blueprint",
12194            Box::new(move || {
12195                let blueprint = blueprint.clone();
12196                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
12197            }),
12198        );
12199        ModuleSource {
12200            proc: self.proc.clone(),
12201            selection: query,
12202            graphql_client: self.graphql_client.clone(),
12203        }
12204    }
12205    /// Update the module source with a new client to generate.
12206    ///
12207    /// # Arguments
12208    ///
12209    /// * `generator` - The generator to use
12210    /// * `output_dir` - The output directory for the generated client.
12211    pub fn with_client(
12212        &self,
12213        generator: impl Into<String>,
12214        output_dir: impl Into<String>,
12215    ) -> ModuleSource {
12216        let mut query = self.selection.select("withClient");
12217        query = query.arg("generator", generator.into());
12218        query = query.arg("outputDir", output_dir.into());
12219        ModuleSource {
12220            proc: self.proc.clone(),
12221            selection: query,
12222            graphql_client: self.graphql_client.clone(),
12223        }
12224    }
12225    /// Append the provided dependencies to the module source's dependency list.
12226    ///
12227    /// # Arguments
12228    ///
12229    /// * `dependencies` - The dependencies to append.
12230    pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
12231        let mut query = self.selection.select("withDependencies");
12232        query = query.arg("dependencies", dependencies);
12233        ModuleSource {
12234            proc: self.proc.clone(),
12235            selection: query,
12236            graphql_client: self.graphql_client.clone(),
12237        }
12238    }
12239    /// Upgrade the engine version of the module to the given value.
12240    ///
12241    /// # Arguments
12242    ///
12243    /// * `version` - The engine version to upgrade to.
12244    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
12245        let mut query = self.selection.select("withEngineVersion");
12246        query = query.arg("version", version.into());
12247        ModuleSource {
12248            proc: self.proc.clone(),
12249            selection: query,
12250            graphql_client: self.graphql_client.clone(),
12251        }
12252    }
12253    /// Enable the experimental features for the module source.
12254    ///
12255    /// # Arguments
12256    ///
12257    /// * `features` - The experimental features to enable.
12258    pub fn with_experimental_features(
12259        &self,
12260        features: Vec<ModuleSourceExperimentalFeature>,
12261    ) -> ModuleSource {
12262        let mut query = self.selection.select("withExperimentalFeatures");
12263        query = query.arg("features", features);
12264        ModuleSource {
12265            proc: self.proc.clone(),
12266            selection: query,
12267            graphql_client: self.graphql_client.clone(),
12268        }
12269    }
12270    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
12271    ///
12272    /// # Arguments
12273    ///
12274    /// * `patterns` - The new additional include patterns.
12275    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
12276        let mut query = self.selection.select("withIncludes");
12277        query = query.arg(
12278            "patterns",
12279            patterns
12280                .into_iter()
12281                .map(|i| i.into())
12282                .collect::<Vec<String>>(),
12283        );
12284        ModuleSource {
12285            proc: self.proc.clone(),
12286            selection: query,
12287            graphql_client: self.graphql_client.clone(),
12288        }
12289    }
12290    /// Update the module source with a new name.
12291    ///
12292    /// # Arguments
12293    ///
12294    /// * `name` - The name to set.
12295    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
12296        let mut query = self.selection.select("withName");
12297        query = query.arg("name", name.into());
12298        ModuleSource {
12299            proc: self.proc.clone(),
12300            selection: query,
12301            graphql_client: self.graphql_client.clone(),
12302        }
12303    }
12304    /// Update the module source with a new SDK.
12305    ///
12306    /// # Arguments
12307    ///
12308    /// * `source` - The SDK source to set.
12309    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
12310        let mut query = self.selection.select("withSDK");
12311        query = query.arg("source", source.into());
12312        ModuleSource {
12313            proc: self.proc.clone(),
12314            selection: query,
12315            graphql_client: self.graphql_client.clone(),
12316        }
12317    }
12318    /// Update the module source with a new source subpath.
12319    ///
12320    /// # Arguments
12321    ///
12322    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
12323    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
12324        let mut query = self.selection.select("withSourceSubpath");
12325        query = query.arg("path", path.into());
12326        ModuleSource {
12327            proc: self.proc.clone(),
12328            selection: query,
12329            graphql_client: self.graphql_client.clone(),
12330        }
12331    }
12332    /// Add toolchains to the module source.
12333    ///
12334    /// # Arguments
12335    ///
12336    /// * `toolchains` - The toolchain modules to add.
12337    pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
12338        let mut query = self.selection.select("withToolchains");
12339        query = query.arg("toolchains", toolchains);
12340        ModuleSource {
12341            proc: self.proc.clone(),
12342            selection: query,
12343            graphql_client: self.graphql_client.clone(),
12344        }
12345    }
12346    /// Update the blueprint module to the latest version.
12347    pub fn with_update_blueprint(&self) -> ModuleSource {
12348        let query = self.selection.select("withUpdateBlueprint");
12349        ModuleSource {
12350            proc: self.proc.clone(),
12351            selection: query,
12352            graphql_client: self.graphql_client.clone(),
12353        }
12354    }
12355    /// Update one or more module dependencies.
12356    ///
12357    /// # Arguments
12358    ///
12359    /// * `dependencies` - The dependencies to update.
12360    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12361        let mut query = self.selection.select("withUpdateDependencies");
12362        query = query.arg(
12363            "dependencies",
12364            dependencies
12365                .into_iter()
12366                .map(|i| i.into())
12367                .collect::<Vec<String>>(),
12368        );
12369        ModuleSource {
12370            proc: self.proc.clone(),
12371            selection: query,
12372            graphql_client: self.graphql_client.clone(),
12373        }
12374    }
12375    /// Update one or more toolchains.
12376    ///
12377    /// # Arguments
12378    ///
12379    /// * `toolchains` - The toolchains to update.
12380    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12381        let mut query = self.selection.select("withUpdateToolchains");
12382        query = query.arg(
12383            "toolchains",
12384            toolchains
12385                .into_iter()
12386                .map(|i| i.into())
12387                .collect::<Vec<String>>(),
12388        );
12389        ModuleSource {
12390            proc: self.proc.clone(),
12391            selection: query,
12392            graphql_client: self.graphql_client.clone(),
12393        }
12394    }
12395    /// Update one or more clients.
12396    ///
12397    /// # Arguments
12398    ///
12399    /// * `clients` - The clients to update
12400    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
12401        let mut query = self.selection.select("withUpdatedClients");
12402        query = query.arg(
12403            "clients",
12404            clients
12405                .into_iter()
12406                .map(|i| i.into())
12407                .collect::<Vec<String>>(),
12408        );
12409        ModuleSource {
12410            proc: self.proc.clone(),
12411            selection: query,
12412            graphql_client: self.graphql_client.clone(),
12413        }
12414    }
12415    /// Remove the current blueprint from the module source.
12416    pub fn without_blueprint(&self) -> ModuleSource {
12417        let query = self.selection.select("withoutBlueprint");
12418        ModuleSource {
12419            proc: self.proc.clone(),
12420            selection: query,
12421            graphql_client: self.graphql_client.clone(),
12422        }
12423    }
12424    /// Remove a client from the module source.
12425    ///
12426    /// # Arguments
12427    ///
12428    /// * `path` - The path of the client to remove.
12429    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
12430        let mut query = self.selection.select("withoutClient");
12431        query = query.arg("path", path.into());
12432        ModuleSource {
12433            proc: self.proc.clone(),
12434            selection: query,
12435            graphql_client: self.graphql_client.clone(),
12436        }
12437    }
12438    /// Remove the provided dependencies from the module source's dependency list.
12439    ///
12440    /// # Arguments
12441    ///
12442    /// * `dependencies` - The dependencies to remove.
12443    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12444        let mut query = self.selection.select("withoutDependencies");
12445        query = query.arg(
12446            "dependencies",
12447            dependencies
12448                .into_iter()
12449                .map(|i| i.into())
12450                .collect::<Vec<String>>(),
12451        );
12452        ModuleSource {
12453            proc: self.proc.clone(),
12454            selection: query,
12455            graphql_client: self.graphql_client.clone(),
12456        }
12457    }
12458    /// Disable experimental features for the module source.
12459    ///
12460    /// # Arguments
12461    ///
12462    /// * `features` - The experimental features to disable.
12463    pub fn without_experimental_features(
12464        &self,
12465        features: Vec<ModuleSourceExperimentalFeature>,
12466    ) -> ModuleSource {
12467        let mut query = self.selection.select("withoutExperimentalFeatures");
12468        query = query.arg("features", features);
12469        ModuleSource {
12470            proc: self.proc.clone(),
12471            selection: query,
12472            graphql_client: self.graphql_client.clone(),
12473        }
12474    }
12475    /// Remove the provided toolchains from the module source.
12476    ///
12477    /// # Arguments
12478    ///
12479    /// * `toolchains` - The toolchains to remove.
12480    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12481        let mut query = self.selection.select("withoutToolchains");
12482        query = query.arg(
12483            "toolchains",
12484            toolchains
12485                .into_iter()
12486                .map(|i| i.into())
12487                .collect::<Vec<String>>(),
12488        );
12489        ModuleSource {
12490            proc: self.proc.clone(),
12491            selection: query,
12492            graphql_client: self.graphql_client.clone(),
12493        }
12494    }
12495}
12496impl Node for ModuleSource {
12497    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12498        let query = self.selection.select("id");
12499        let graphql_client = self.graphql_client.clone();
12500        async move { query.execute(graphql_client).await }
12501    }
12502}
12503impl Syncer for ModuleSource {
12504    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12505        let query = self.selection.select("id");
12506        let graphql_client = self.graphql_client.clone();
12507        async move { query.execute(graphql_client).await }
12508    }
12509    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12510        let query = self.selection.select("sync");
12511        let graphql_client = self.graphql_client.clone();
12512        async move { query.execute(graphql_client).await }
12513    }
12514}
12515#[derive(Clone)]
12516pub struct ObjectTypeDef {
12517    pub proc: Option<Arc<DaggerSessionProc>>,
12518    pub selection: Selection,
12519    pub graphql_client: DynGraphQLClient,
12520}
12521impl IntoID<Id> for ObjectTypeDef {
12522    fn into_id(
12523        self,
12524    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12525        Box::pin(async move { self.id().await })
12526    }
12527}
12528impl Loadable for ObjectTypeDef {
12529    fn graphql_type() -> &'static str {
12530        "ObjectTypeDef"
12531    }
12532    fn from_query(
12533        proc: Option<Arc<DaggerSessionProc>>,
12534        selection: Selection,
12535        graphql_client: DynGraphQLClient,
12536    ) -> Self {
12537        Self {
12538            proc,
12539            selection,
12540            graphql_client,
12541        }
12542    }
12543}
12544impl ObjectTypeDef {
12545    /// The function used to construct new instances of this object, if any.
12546    pub fn constructor(&self) -> Function {
12547        let query = self.selection.select("constructor");
12548        Function {
12549            proc: self.proc.clone(),
12550            selection: query,
12551            graphql_client: self.graphql_client.clone(),
12552        }
12553    }
12554    /// The reason this enum member is deprecated, if any.
12555    pub async fn deprecated(&self) -> Result<String, DaggerError> {
12556        let query = self.selection.select("deprecated");
12557        query.execute(self.graphql_client.clone()).await
12558    }
12559    /// The doc string for the object, if any.
12560    pub async fn description(&self) -> Result<String, DaggerError> {
12561        let query = self.selection.select("description");
12562        query.execute(self.graphql_client.clone()).await
12563    }
12564    /// Static fields defined on this object, if any.
12565    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12566        let query = self.selection.select("fields");
12567        let query = query.select("id");
12568        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12569        Ok(ids
12570            .into_iter()
12571            .map(|id| FieldTypeDef {
12572                proc: self.proc.clone(),
12573                selection: crate::querybuilder::query()
12574                    .select("node")
12575                    .arg("id", &id.0)
12576                    .inline_fragment("FieldTypeDef"),
12577                graphql_client: self.graphql_client.clone(),
12578            })
12579            .collect())
12580    }
12581    /// Functions defined on this object, if any.
12582    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12583        let query = self.selection.select("functions");
12584        let query = query.select("id");
12585        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12586        Ok(ids
12587            .into_iter()
12588            .map(|id| Function {
12589                proc: self.proc.clone(),
12590                selection: crate::querybuilder::query()
12591                    .select("node")
12592                    .arg("id", &id.0)
12593                    .inline_fragment("Function"),
12594                graphql_client: self.graphql_client.clone(),
12595            })
12596            .collect())
12597    }
12598    /// A unique identifier for this ObjectTypeDef.
12599    pub async fn id(&self) -> Result<Id, DaggerError> {
12600        let query = self.selection.select("id");
12601        query.execute(self.graphql_client.clone()).await
12602    }
12603    /// The name of the object.
12604    pub async fn name(&self) -> Result<String, DaggerError> {
12605        let query = self.selection.select("name");
12606        query.execute(self.graphql_client.clone()).await
12607    }
12608    /// The location of this object declaration.
12609    pub fn source_map(&self) -> SourceMap {
12610        let query = self.selection.select("sourceMap");
12611        SourceMap {
12612            proc: self.proc.clone(),
12613            selection: query,
12614            graphql_client: self.graphql_client.clone(),
12615        }
12616    }
12617    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
12618    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12619        let query = self.selection.select("sourceModuleName");
12620        query.execute(self.graphql_client.clone()).await
12621    }
12622}
12623impl Node for ObjectTypeDef {
12624    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12625        let query = self.selection.select("id");
12626        let graphql_client = self.graphql_client.clone();
12627        async move { query.execute(graphql_client).await }
12628    }
12629}
12630#[derive(Clone)]
12631pub struct Port {
12632    pub proc: Option<Arc<DaggerSessionProc>>,
12633    pub selection: Selection,
12634    pub graphql_client: DynGraphQLClient,
12635}
12636impl IntoID<Id> for Port {
12637    fn into_id(
12638        self,
12639    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12640        Box::pin(async move { self.id().await })
12641    }
12642}
12643impl Loadable for Port {
12644    fn graphql_type() -> &'static str {
12645        "Port"
12646    }
12647    fn from_query(
12648        proc: Option<Arc<DaggerSessionProc>>,
12649        selection: Selection,
12650        graphql_client: DynGraphQLClient,
12651    ) -> Self {
12652        Self {
12653            proc,
12654            selection,
12655            graphql_client,
12656        }
12657    }
12658}
12659impl Port {
12660    /// The port description.
12661    pub async fn description(&self) -> Result<String, DaggerError> {
12662        let query = self.selection.select("description");
12663        query.execute(self.graphql_client.clone()).await
12664    }
12665    /// Skip the health check when run as a service.
12666    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
12667        let query = self.selection.select("experimentalSkipHealthcheck");
12668        query.execute(self.graphql_client.clone()).await
12669    }
12670    /// A unique identifier for this Port.
12671    pub async fn id(&self) -> Result<Id, DaggerError> {
12672        let query = self.selection.select("id");
12673        query.execute(self.graphql_client.clone()).await
12674    }
12675    /// The port number.
12676    pub async fn port(&self) -> Result<isize, DaggerError> {
12677        let query = self.selection.select("port");
12678        query.execute(self.graphql_client.clone()).await
12679    }
12680    /// The transport layer protocol.
12681    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
12682        let query = self.selection.select("protocol");
12683        query.execute(self.graphql_client.clone()).await
12684    }
12685}
12686impl Node for Port {
12687    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12688        let query = self.selection.select("id");
12689        let graphql_client = self.graphql_client.clone();
12690        async move { query.execute(graphql_client).await }
12691    }
12692}
12693#[derive(Clone)]
12694pub struct Query {
12695    pub proc: Option<Arc<DaggerSessionProc>>,
12696    pub selection: Selection,
12697    pub graphql_client: DynGraphQLClient,
12698}
12699#[derive(Builder, Debug, PartialEq)]
12700pub struct QueryCacheVolumeOpts<'a> {
12701    /// A user:group to set for the cache volume root.
12702    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
12703    /// If the group is omitted, it defaults to the same as the user.
12704    #[builder(setter(into, strip_option), default)]
12705    pub owner: Option<&'a str>,
12706    /// Sharing mode of the cache volume.
12707    #[builder(setter(into, strip_option), default)]
12708    pub sharing: Option<CacheSharingMode>,
12709    /// Identifier of the directory to use as the cache volume's root.
12710    #[builder(setter(into, strip_option), default)]
12711    pub source: Option<Id>,
12712}
12713#[derive(Builder, Debug, PartialEq)]
12714pub struct QueryContainerOpts {
12715    /// Platform to initialize the container with. Defaults to the native platform of the current engine
12716    #[builder(setter(into, strip_option), default)]
12717    pub platform: Option<Platform>,
12718}
12719#[derive(Builder, Debug, PartialEq)]
12720pub struct QueryCurrentTypeDefsOpts {
12721    /// Strip core API functions from the Query type, leaving only module-sourced functions (constructors, entrypoint proxies, etc.).
12722    /// Core types (Container, Directory, etc.) are kept so return types and method chaining still work.
12723    #[builder(setter(into, strip_option), default)]
12724    pub hide_core: Option<bool>,
12725    /// Return the full referenced typedef closure instead of only top-level served typedefs.
12726    #[builder(setter(into, strip_option), default)]
12727    pub return_all_types: Option<bool>,
12728}
12729#[derive(Builder, Debug, PartialEq)]
12730pub struct QueryEnvOpts {
12731    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
12732    #[builder(setter(into, strip_option), default)]
12733    pub privileged: Option<bool>,
12734    /// Allow new outputs to be declared and saved in the environment
12735    #[builder(setter(into, strip_option), default)]
12736    pub writable: Option<bool>,
12737}
12738#[derive(Builder, Debug, PartialEq)]
12739pub struct QueryEnvFileOpts {
12740    /// Replace "${VAR}" or "$VAR" with the value of other vars
12741    #[builder(setter(into, strip_option), default)]
12742    pub expand: Option<bool>,
12743}
12744#[derive(Builder, Debug, PartialEq)]
12745pub struct QueryFileOpts {
12746    /// Permissions of the new file. Example: 0600
12747    #[builder(setter(into, strip_option), default)]
12748    pub permissions: Option<isize>,
12749}
12750#[derive(Builder, Debug, PartialEq)]
12751pub struct QueryGitOpts<'a> {
12752    /// A service which must be started before the repo is fetched.
12753    #[builder(setter(into, strip_option), default)]
12754    pub experimental_service_host: Option<Id>,
12755    /// Secret used to populate the Authorization HTTP header
12756    #[builder(setter(into, strip_option), default)]
12757    pub http_auth_header: Option<Id>,
12758    /// Secret used to populate the password during basic HTTP Authorization
12759    #[builder(setter(into, strip_option), default)]
12760    pub http_auth_token: Option<Id>,
12761    /// Username used to populate the password during basic HTTP Authorization
12762    #[builder(setter(into, strip_option), default)]
12763    pub http_auth_username: Option<&'a str>,
12764    /// DEPRECATED: Set to true to keep .git directory.
12765    #[builder(setter(into, strip_option), default)]
12766    pub keep_git_dir: Option<bool>,
12767    /// Set SSH auth socket
12768    #[builder(setter(into, strip_option), default)]
12769    pub ssh_auth_socket: Option<Id>,
12770    /// Set SSH known hosts
12771    #[builder(setter(into, strip_option), default)]
12772    pub ssh_known_hosts: Option<&'a str>,
12773}
12774#[derive(Builder, Debug, PartialEq)]
12775pub struct QueryHttpOpts<'a> {
12776    /// Secret used to populate the Authorization HTTP header
12777    #[builder(setter(into, strip_option), default)]
12778    pub auth_header: Option<Id>,
12779    /// Expected digest of the downloaded content (e.g., "sha256:...").
12780    #[builder(setter(into, strip_option), default)]
12781    pub checksum: Option<&'a str>,
12782    /// A service which must be started before the URL is fetched.
12783    #[builder(setter(into, strip_option), default)]
12784    pub experimental_service_host: Option<Id>,
12785    /// File name to use for the file. Defaults to the last part of the URL.
12786    #[builder(setter(into, strip_option), default)]
12787    pub name: Option<&'a str>,
12788    /// Permissions to set on the file.
12789    #[builder(setter(into, strip_option), default)]
12790    pub permissions: Option<isize>,
12791}
12792#[derive(Builder, Debug, PartialEq)]
12793pub struct QueryLlmOpts<'a> {
12794    /// Cap the number of API calls for this LLM
12795    #[builder(setter(into, strip_option), default)]
12796    pub max_api_calls: Option<isize>,
12797    /// Model to use
12798    #[builder(setter(into, strip_option), default)]
12799    pub model: Option<&'a str>,
12800}
12801#[derive(Builder, Debug, PartialEq)]
12802pub struct QueryModuleSourceOpts<'a> {
12803    /// 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.
12804    #[builder(setter(into, strip_option), default)]
12805    pub allow_not_exists: Option<bool>,
12806    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
12807    #[builder(setter(into, strip_option), default)]
12808    pub disable_find_up: Option<bool>,
12809    /// The pinned version of the module source
12810    #[builder(setter(into, strip_option), default)]
12811    pub ref_pin: Option<&'a str>,
12812    /// If set, error out if the ref string is not of the provided requireKind.
12813    #[builder(setter(into, strip_option), default)]
12814    pub require_kind: Option<ModuleSourceKind>,
12815}
12816#[derive(Builder, Debug, PartialEq)]
12817pub struct QuerySecretOpts<'a> {
12818    /// 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.
12819    /// 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.
12820    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
12821    #[builder(setter(into, strip_option), default)]
12822    pub cache_key: Option<&'a str>,
12823}
12824impl IntoID<Id> for Query {
12825    fn into_id(
12826        self,
12827    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12828        Box::pin(async move { self.id().await })
12829    }
12830}
12831impl Loadable for Query {
12832    fn graphql_type() -> &'static str {
12833        "Query"
12834    }
12835    fn from_query(
12836        proc: Option<Arc<DaggerSessionProc>>,
12837        selection: Selection,
12838        graphql_client: DynGraphQLClient,
12839    ) -> Self {
12840        Self {
12841            proc,
12842            selection,
12843            graphql_client,
12844        }
12845    }
12846}
12847impl Query {
12848    /// initialize an address to load directories, containers, secrets or other object types.
12849    pub fn address(&self, value: impl Into<String>) -> Address {
12850        let mut query = self.selection.select("address");
12851        query = query.arg("value", value.into());
12852        Address {
12853            proc: self.proc.clone(),
12854            selection: query,
12855            graphql_client: self.graphql_client.clone(),
12856        }
12857    }
12858    /// Constructs a cache volume for a given cache key.
12859    ///
12860    /// # Arguments
12861    ///
12862    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
12863    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12864    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
12865        let mut query = self.selection.select("cacheVolume");
12866        query = query.arg("key", key.into());
12867        CacheVolume {
12868            proc: self.proc.clone(),
12869            selection: query,
12870            graphql_client: self.graphql_client.clone(),
12871        }
12872    }
12873    /// Constructs a cache volume for a given cache key.
12874    ///
12875    /// # Arguments
12876    ///
12877    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
12878    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12879    pub fn cache_volume_opts<'a>(
12880        &self,
12881        key: impl Into<String>,
12882        opts: QueryCacheVolumeOpts<'a>,
12883    ) -> CacheVolume {
12884        let mut query = self.selection.select("cacheVolume");
12885        query = query.arg("key", key.into());
12886        if let Some(source) = opts.source {
12887            query = query.arg("source", source);
12888        }
12889        if let Some(sharing) = opts.sharing {
12890            query = query.arg("sharing", sharing);
12891        }
12892        if let Some(owner) = opts.owner {
12893            query = query.arg("owner", owner);
12894        }
12895        CacheVolume {
12896            proc: self.proc.clone(),
12897            selection: query,
12898            graphql_client: self.graphql_client.clone(),
12899        }
12900    }
12901    /// Creates an empty changeset
12902    pub fn changeset(&self) -> Changeset {
12903        let query = self.selection.select("changeset");
12904        Changeset {
12905            proc: self.proc.clone(),
12906            selection: query,
12907            graphql_client: self.graphql_client.clone(),
12908        }
12909    }
12910    /// Dagger Cloud configuration and state
12911    pub fn cloud(&self) -> Cloud {
12912        let query = self.selection.select("cloud");
12913        Cloud {
12914            proc: self.proc.clone(),
12915            selection: query,
12916            graphql_client: self.graphql_client.clone(),
12917        }
12918    }
12919    /// Creates a scratch container, with no image or metadata.
12920    /// To pull an image, follow up with the "from" function.
12921    ///
12922    /// # Arguments
12923    ///
12924    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12925    pub fn container(&self) -> Container {
12926        let query = self.selection.select("container");
12927        Container {
12928            proc: self.proc.clone(),
12929            selection: query,
12930            graphql_client: self.graphql_client.clone(),
12931        }
12932    }
12933    /// Creates a scratch container, with no image or metadata.
12934    /// To pull an image, follow up with the "from" function.
12935    ///
12936    /// # Arguments
12937    ///
12938    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12939    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
12940        let mut query = self.selection.select("container");
12941        if let Some(platform) = opts.platform {
12942            query = query.arg("platform", platform);
12943        }
12944        Container {
12945            proc: self.proc.clone(),
12946            selection: query,
12947            graphql_client: self.graphql_client.clone(),
12948        }
12949    }
12950    /// Returns the current environment
12951    /// 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.
12952    /// 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.
12953    pub fn current_env(&self) -> Env {
12954        let query = self.selection.select("currentEnv");
12955        Env {
12956            proc: self.proc.clone(),
12957            selection: query,
12958            graphql_client: self.graphql_client.clone(),
12959        }
12960    }
12961    /// The FunctionCall context that the SDK caller is currently executing in.
12962    /// If the caller is not currently executing in a function, this will return an error.
12963    pub fn current_function_call(&self) -> FunctionCall {
12964        let query = self.selection.select("currentFunctionCall");
12965        FunctionCall {
12966            proc: self.proc.clone(),
12967            selection: query,
12968            graphql_client: self.graphql_client.clone(),
12969        }
12970    }
12971    /// The module currently being served in the session, if any.
12972    pub fn current_module(&self) -> CurrentModule {
12973        let query = self.selection.select("currentModule");
12974        CurrentModule {
12975            proc: self.proc.clone(),
12976            selection: query,
12977            graphql_client: self.graphql_client.clone(),
12978        }
12979    }
12980    /// The TypeDef representations of the objects currently being served in the session.
12981    ///
12982    /// # Arguments
12983    ///
12984    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12985    pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
12986        let query = self.selection.select("currentTypeDefs");
12987        let query = query.select("id");
12988        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12989        Ok(ids
12990            .into_iter()
12991            .map(|id| TypeDef {
12992                proc: self.proc.clone(),
12993                selection: crate::querybuilder::query()
12994                    .select("node")
12995                    .arg("id", &id.0)
12996                    .inline_fragment("TypeDef"),
12997                graphql_client: self.graphql_client.clone(),
12998            })
12999            .collect())
13000    }
13001    /// The TypeDef representations of the objects currently being served in the session.
13002    ///
13003    /// # Arguments
13004    ///
13005    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13006    pub async fn current_type_defs_opts(
13007        &self,
13008        opts: QueryCurrentTypeDefsOpts,
13009    ) -> Result<Vec<TypeDef>, DaggerError> {
13010        let mut query = self.selection.select("currentTypeDefs");
13011        if let Some(return_all_types) = opts.return_all_types {
13012            query = query.arg("returnAllTypes", return_all_types);
13013        }
13014        if let Some(hide_core) = opts.hide_core {
13015            query = query.arg("hideCore", hide_core);
13016        }
13017        let query = query.select("id");
13018        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13019        Ok(ids
13020            .into_iter()
13021            .map(|id| TypeDef {
13022                proc: self.proc.clone(),
13023                selection: crate::querybuilder::query()
13024                    .select("node")
13025                    .arg("id", &id.0)
13026                    .inline_fragment("TypeDef"),
13027                graphql_client: self.graphql_client.clone(),
13028            })
13029            .collect())
13030    }
13031    /// Detect and return the current workspace.
13032    pub fn current_workspace(&self) -> Workspace {
13033        let query = self.selection.select("currentWorkspace");
13034        Workspace {
13035            proc: self.proc.clone(),
13036            selection: query,
13037            graphql_client: self.graphql_client.clone(),
13038        }
13039    }
13040    /// The default platform of the engine.
13041    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
13042        let query = self.selection.select("defaultPlatform");
13043        query.execute(self.graphql_client.clone()).await
13044    }
13045    /// Creates an empty directory.
13046    pub fn directory(&self) -> Directory {
13047        let query = self.selection.select("directory");
13048        Directory {
13049            proc: self.proc.clone(),
13050            selection: query,
13051            graphql_client: self.graphql_client.clone(),
13052        }
13053    }
13054    /// The Dagger engine container configuration and state
13055    pub fn engine(&self) -> Engine {
13056        let query = self.selection.select("engine");
13057        Engine {
13058            proc: self.proc.clone(),
13059            selection: query,
13060            graphql_client: self.graphql_client.clone(),
13061        }
13062    }
13063    /// Initializes a new environment
13064    ///
13065    /// # Arguments
13066    ///
13067    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13068    pub fn env(&self) -> Env {
13069        let query = self.selection.select("env");
13070        Env {
13071            proc: self.proc.clone(),
13072            selection: query,
13073            graphql_client: self.graphql_client.clone(),
13074        }
13075    }
13076    /// Initializes a new environment
13077    ///
13078    /// # Arguments
13079    ///
13080    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13081    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
13082        let mut query = self.selection.select("env");
13083        if let Some(privileged) = opts.privileged {
13084            query = query.arg("privileged", privileged);
13085        }
13086        if let Some(writable) = opts.writable {
13087            query = query.arg("writable", writable);
13088        }
13089        Env {
13090            proc: self.proc.clone(),
13091            selection: query,
13092            graphql_client: self.graphql_client.clone(),
13093        }
13094    }
13095    /// Initialize an environment file
13096    ///
13097    /// # Arguments
13098    ///
13099    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13100    pub fn env_file(&self) -> EnvFile {
13101        let query = self.selection.select("envFile");
13102        EnvFile {
13103            proc: self.proc.clone(),
13104            selection: query,
13105            graphql_client: self.graphql_client.clone(),
13106        }
13107    }
13108    /// Initialize an environment file
13109    ///
13110    /// # Arguments
13111    ///
13112    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13113    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
13114        let mut query = self.selection.select("envFile");
13115        if let Some(expand) = opts.expand {
13116            query = query.arg("expand", expand);
13117        }
13118        EnvFile {
13119            proc: self.proc.clone(),
13120            selection: query,
13121            graphql_client: self.graphql_client.clone(),
13122        }
13123    }
13124    /// Create a new error.
13125    ///
13126    /// # Arguments
13127    ///
13128    /// * `message` - A brief description of the error.
13129    pub fn error(&self, message: impl Into<String>) -> Error {
13130        let mut query = self.selection.select("error");
13131        query = query.arg("message", message.into());
13132        Error {
13133            proc: self.proc.clone(),
13134            selection: query,
13135            graphql_client: self.graphql_client.clone(),
13136        }
13137    }
13138    /// Creates a file with the specified contents.
13139    ///
13140    /// # Arguments
13141    ///
13142    /// * `name` - Name of the new file. Example: "foo.txt"
13143    /// * `contents` - Contents of the new file. Example: "Hello world!"
13144    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13145    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
13146        let mut query = self.selection.select("file");
13147        query = query.arg("name", name.into());
13148        query = query.arg("contents", contents.into());
13149        File {
13150            proc: self.proc.clone(),
13151            selection: query,
13152            graphql_client: self.graphql_client.clone(),
13153        }
13154    }
13155    /// Creates a file with the specified contents.
13156    ///
13157    /// # Arguments
13158    ///
13159    /// * `name` - Name of the new file. Example: "foo.txt"
13160    /// * `contents` - Contents of the new file. Example: "Hello world!"
13161    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13162    pub fn file_opts(
13163        &self,
13164        name: impl Into<String>,
13165        contents: impl Into<String>,
13166        opts: QueryFileOpts,
13167    ) -> File {
13168        let mut query = self.selection.select("file");
13169        query = query.arg("name", name.into());
13170        query = query.arg("contents", contents.into());
13171        if let Some(permissions) = opts.permissions {
13172            query = query.arg("permissions", permissions);
13173        }
13174        File {
13175            proc: self.proc.clone(),
13176            selection: query,
13177            graphql_client: self.graphql_client.clone(),
13178        }
13179    }
13180    /// Creates a function.
13181    ///
13182    /// # Arguments
13183    ///
13184    /// * `name` - Name of the function, in its original format from the implementation language.
13185    /// * `return_type` - Return type of the function.
13186    pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
13187        let mut query = self.selection.select("function");
13188        query = query.arg("name", name.into());
13189        query = query.arg_lazy(
13190            "returnType",
13191            Box::new(move || {
13192                let return_type = return_type.clone();
13193                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
13194            }),
13195        );
13196        Function {
13197            proc: self.proc.clone(),
13198            selection: query,
13199            graphql_client: self.graphql_client.clone(),
13200        }
13201    }
13202    /// Create a code generation result, given a directory containing the generated code.
13203    pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
13204        let mut query = self.selection.select("generatedCode");
13205        query = query.arg_lazy(
13206            "code",
13207            Box::new(move || {
13208                let code = code.clone();
13209                Box::pin(async move { code.into_id().await.unwrap().quote() })
13210            }),
13211        );
13212        GeneratedCode {
13213            proc: self.proc.clone(),
13214            selection: query,
13215            graphql_client: self.graphql_client.clone(),
13216        }
13217    }
13218    /// Queries a Git repository.
13219    ///
13220    /// # Arguments
13221    ///
13222    /// * `url` - URL of the git repository.
13223    ///
13224    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
13225    ///
13226    /// Suffix ".git" is optional.
13227    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13228    pub fn git(&self, url: impl Into<String>) -> GitRepository {
13229        let mut query = self.selection.select("git");
13230        query = query.arg("url", url.into());
13231        GitRepository {
13232            proc: self.proc.clone(),
13233            selection: query,
13234            graphql_client: self.graphql_client.clone(),
13235        }
13236    }
13237    /// Queries a Git repository.
13238    ///
13239    /// # Arguments
13240    ///
13241    /// * `url` - URL of the git repository.
13242    ///
13243    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
13244    ///
13245    /// Suffix ".git" is optional.
13246    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13247    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
13248        let mut query = self.selection.select("git");
13249        query = query.arg("url", url.into());
13250        if let Some(keep_git_dir) = opts.keep_git_dir {
13251            query = query.arg("keepGitDir", keep_git_dir);
13252        }
13253        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
13254            query = query.arg("sshKnownHosts", ssh_known_hosts);
13255        }
13256        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
13257            query = query.arg("sshAuthSocket", ssh_auth_socket);
13258        }
13259        if let Some(http_auth_username) = opts.http_auth_username {
13260            query = query.arg("httpAuthUsername", http_auth_username);
13261        }
13262        if let Some(http_auth_token) = opts.http_auth_token {
13263            query = query.arg("httpAuthToken", http_auth_token);
13264        }
13265        if let Some(http_auth_header) = opts.http_auth_header {
13266            query = query.arg("httpAuthHeader", http_auth_header);
13267        }
13268        if let Some(experimental_service_host) = opts.experimental_service_host {
13269            query = query.arg("experimentalServiceHost", experimental_service_host);
13270        }
13271        GitRepository {
13272            proc: self.proc.clone(),
13273            selection: query,
13274            graphql_client: self.graphql_client.clone(),
13275        }
13276    }
13277    /// Queries the host environment.
13278    pub fn host(&self) -> Host {
13279        let query = self.selection.select("host");
13280        Host {
13281            proc: self.proc.clone(),
13282            selection: query,
13283            graphql_client: self.graphql_client.clone(),
13284        }
13285    }
13286    /// Returns a file containing an http remote url content.
13287    ///
13288    /// # Arguments
13289    ///
13290    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
13291    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13292    pub fn http(&self, url: impl Into<String>) -> File {
13293        let mut query = self.selection.select("http");
13294        query = query.arg("url", url.into());
13295        File {
13296            proc: self.proc.clone(),
13297            selection: query,
13298            graphql_client: self.graphql_client.clone(),
13299        }
13300    }
13301    /// Returns a file containing an http remote url content.
13302    ///
13303    /// # Arguments
13304    ///
13305    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
13306    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13307    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
13308        let mut query = self.selection.select("http");
13309        query = query.arg("url", url.into());
13310        if let Some(name) = opts.name {
13311            query = query.arg("name", name);
13312        }
13313        if let Some(permissions) = opts.permissions {
13314            query = query.arg("permissions", permissions);
13315        }
13316        if let Some(checksum) = opts.checksum {
13317            query = query.arg("checksum", checksum);
13318        }
13319        if let Some(auth_header) = opts.auth_header {
13320            query = query.arg("authHeader", auth_header);
13321        }
13322        if let Some(experimental_service_host) = opts.experimental_service_host {
13323            query = query.arg("experimentalServiceHost", experimental_service_host);
13324        }
13325        File {
13326            proc: self.proc.clone(),
13327            selection: query,
13328            graphql_client: self.graphql_client.clone(),
13329        }
13330    }
13331    /// A unique identifier for this Query.
13332    pub async fn id(&self) -> Result<Id, DaggerError> {
13333        let query = self.selection.select("id");
13334        query.execute(self.graphql_client.clone()).await
13335    }
13336    /// Initialize a JSON value
13337    pub fn json(&self) -> JsonValue {
13338        let query = self.selection.select("json");
13339        JsonValue {
13340            proc: self.proc.clone(),
13341            selection: query,
13342            graphql_client: self.graphql_client.clone(),
13343        }
13344    }
13345    /// Initialize a Large Language Model (LLM)
13346    ///
13347    /// # Arguments
13348    ///
13349    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13350    pub fn llm(&self) -> Llm {
13351        let query = self.selection.select("llm");
13352        Llm {
13353            proc: self.proc.clone(),
13354            selection: query,
13355            graphql_client: self.graphql_client.clone(),
13356        }
13357    }
13358    /// Initialize a Large Language Model (LLM)
13359    ///
13360    /// # Arguments
13361    ///
13362    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13363    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
13364        let mut query = self.selection.select("llm");
13365        if let Some(model) = opts.model {
13366            query = query.arg("model", model);
13367        }
13368        if let Some(max_api_calls) = opts.max_api_calls {
13369            query = query.arg("maxAPICalls", max_api_calls);
13370        }
13371        Llm {
13372            proc: self.proc.clone(),
13373            selection: query,
13374            graphql_client: self.graphql_client.clone(),
13375        }
13376    }
13377    /// Load a Address from its ID.
13378    pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
13379        let mut query = self.selection.select("loadAddressFromID");
13380        query = query.arg_lazy(
13381            "id",
13382            Box::new(move || {
13383                let id = id.clone();
13384                Box::pin(async move { id.into_id().await.unwrap().quote() })
13385            }),
13386        );
13387        Address {
13388            proc: self.proc.clone(),
13389            selection: query,
13390            graphql_client: self.graphql_client.clone(),
13391        }
13392    }
13393    /// Load a Binding from its ID.
13394    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
13395        let mut query = self.selection.select("loadBindingFromID");
13396        query = query.arg_lazy(
13397            "id",
13398            Box::new(move || {
13399                let id = id.clone();
13400                Box::pin(async move { id.into_id().await.unwrap().quote() })
13401            }),
13402        );
13403        Binding {
13404            proc: self.proc.clone(),
13405            selection: query,
13406            graphql_client: self.graphql_client.clone(),
13407        }
13408    }
13409    /// Load a CacheVolume from its ID.
13410    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
13411        let mut query = self.selection.select("loadCacheVolumeFromID");
13412        query = query.arg_lazy(
13413            "id",
13414            Box::new(move || {
13415                let id = id.clone();
13416                Box::pin(async move { id.into_id().await.unwrap().quote() })
13417            }),
13418        );
13419        CacheVolume {
13420            proc: self.proc.clone(),
13421            selection: query,
13422            graphql_client: self.graphql_client.clone(),
13423        }
13424    }
13425    /// Load a Changeset from its ID.
13426    pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
13427        let mut query = self.selection.select("loadChangesetFromID");
13428        query = query.arg_lazy(
13429            "id",
13430            Box::new(move || {
13431                let id = id.clone();
13432                Box::pin(async move { id.into_id().await.unwrap().quote() })
13433            }),
13434        );
13435        Changeset {
13436            proc: self.proc.clone(),
13437            selection: query,
13438            graphql_client: self.graphql_client.clone(),
13439        }
13440    }
13441    /// Load a Check from its ID.
13442    pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
13443        let mut query = self.selection.select("loadCheckFromID");
13444        query = query.arg_lazy(
13445            "id",
13446            Box::new(move || {
13447                let id = id.clone();
13448                Box::pin(async move { id.into_id().await.unwrap().quote() })
13449            }),
13450        );
13451        Check {
13452            proc: self.proc.clone(),
13453            selection: query,
13454            graphql_client: self.graphql_client.clone(),
13455        }
13456    }
13457    /// Load a CheckGroup from its ID.
13458    pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
13459        let mut query = self.selection.select("loadCheckGroupFromID");
13460        query = query.arg_lazy(
13461            "id",
13462            Box::new(move || {
13463                let id = id.clone();
13464                Box::pin(async move { id.into_id().await.unwrap().quote() })
13465            }),
13466        );
13467        CheckGroup {
13468            proc: self.proc.clone(),
13469            selection: query,
13470            graphql_client: self.graphql_client.clone(),
13471        }
13472    }
13473    /// Load a ClientFilesyncMirror from its ID.
13474    pub fn load_client_filesync_mirror_from_id(
13475        &self,
13476        id: impl IntoID<ClientFilesyncMirrorId>,
13477    ) -> ClientFilesyncMirror {
13478        let mut query = self.selection.select("loadClientFilesyncMirrorFromID");
13479        query = query.arg_lazy(
13480            "id",
13481            Box::new(move || {
13482                let id = id.clone();
13483                Box::pin(async move { id.into_id().await.unwrap().quote() })
13484            }),
13485        );
13486        ClientFilesyncMirror {
13487            proc: self.proc.clone(),
13488            selection: query,
13489            graphql_client: self.graphql_client.clone(),
13490        }
13491    }
13492    /// Load a Cloud from its ID.
13493    pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
13494        let mut query = self.selection.select("loadCloudFromID");
13495        query = query.arg_lazy(
13496            "id",
13497            Box::new(move || {
13498                let id = id.clone();
13499                Box::pin(async move { id.into_id().await.unwrap().quote() })
13500            }),
13501        );
13502        Cloud {
13503            proc: self.proc.clone(),
13504            selection: query,
13505            graphql_client: self.graphql_client.clone(),
13506        }
13507    }
13508    /// Load a Container from its ID.
13509    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
13510        let mut query = self.selection.select("loadContainerFromID");
13511        query = query.arg_lazy(
13512            "id",
13513            Box::new(move || {
13514                let id = id.clone();
13515                Box::pin(async move { id.into_id().await.unwrap().quote() })
13516            }),
13517        );
13518        Container {
13519            proc: self.proc.clone(),
13520            selection: query,
13521            graphql_client: self.graphql_client.clone(),
13522        }
13523    }
13524    /// Load a CurrentModule from its ID.
13525    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
13526        let mut query = self.selection.select("loadCurrentModuleFromID");
13527        query = query.arg_lazy(
13528            "id",
13529            Box::new(move || {
13530                let id = id.clone();
13531                Box::pin(async move { id.into_id().await.unwrap().quote() })
13532            }),
13533        );
13534        CurrentModule {
13535            proc: self.proc.clone(),
13536            selection: query,
13537            graphql_client: self.graphql_client.clone(),
13538        }
13539    }
13540    /// Load a DiffStat from its ID.
13541    pub fn load_diff_stat_from_id(&self, id: impl IntoID<DiffStatId>) -> DiffStat {
13542        let mut query = self.selection.select("loadDiffStatFromID");
13543        query = query.arg_lazy(
13544            "id",
13545            Box::new(move || {
13546                let id = id.clone();
13547                Box::pin(async move { id.into_id().await.unwrap().quote() })
13548            }),
13549        );
13550        DiffStat {
13551            proc: self.proc.clone(),
13552            selection: query,
13553            graphql_client: self.graphql_client.clone(),
13554        }
13555    }
13556    /// Load a Directory from its ID.
13557    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
13558        let mut query = self.selection.select("loadDirectoryFromID");
13559        query = query.arg_lazy(
13560            "id",
13561            Box::new(move || {
13562                let id = id.clone();
13563                Box::pin(async move { id.into_id().await.unwrap().quote() })
13564            }),
13565        );
13566        Directory {
13567            proc: self.proc.clone(),
13568            selection: query,
13569            graphql_client: self.graphql_client.clone(),
13570        }
13571    }
13572    /// Load a EngineCacheEntry from its ID.
13573    pub fn load_engine_cache_entry_from_id(
13574        &self,
13575        id: impl IntoID<EngineCacheEntryId>,
13576    ) -> EngineCacheEntry {
13577        let mut query = self.selection.select("loadEngineCacheEntryFromID");
13578        query = query.arg_lazy(
13579            "id",
13580            Box::new(move || {
13581                let id = id.clone();
13582                Box::pin(async move { id.into_id().await.unwrap().quote() })
13583            }),
13584        );
13585        EngineCacheEntry {
13586            proc: self.proc.clone(),
13587            selection: query,
13588            graphql_client: self.graphql_client.clone(),
13589        }
13590    }
13591    /// Load a EngineCacheEntrySet from its ID.
13592    pub fn load_engine_cache_entry_set_from_id(
13593        &self,
13594        id: impl IntoID<EngineCacheEntrySetId>,
13595    ) -> EngineCacheEntrySet {
13596        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
13597        query = query.arg_lazy(
13598            "id",
13599            Box::new(move || {
13600                let id = id.clone();
13601                Box::pin(async move { id.into_id().await.unwrap().quote() })
13602            }),
13603        );
13604        EngineCacheEntrySet {
13605            proc: self.proc.clone(),
13606            selection: query,
13607            graphql_client: self.graphql_client.clone(),
13608        }
13609    }
13610    /// Load a EngineCache from its ID.
13611    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
13612        let mut query = self.selection.select("loadEngineCacheFromID");
13613        query = query.arg_lazy(
13614            "id",
13615            Box::new(move || {
13616                let id = id.clone();
13617                Box::pin(async move { id.into_id().await.unwrap().quote() })
13618            }),
13619        );
13620        EngineCache {
13621            proc: self.proc.clone(),
13622            selection: query,
13623            graphql_client: self.graphql_client.clone(),
13624        }
13625    }
13626    /// Load a Engine from its ID.
13627    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
13628        let mut query = self.selection.select("loadEngineFromID");
13629        query = query.arg_lazy(
13630            "id",
13631            Box::new(move || {
13632                let id = id.clone();
13633                Box::pin(async move { id.into_id().await.unwrap().quote() })
13634            }),
13635        );
13636        Engine {
13637            proc: self.proc.clone(),
13638            selection: query,
13639            graphql_client: self.graphql_client.clone(),
13640        }
13641    }
13642    /// Load a EnumTypeDef from its ID.
13643    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
13644        let mut query = self.selection.select("loadEnumTypeDefFromID");
13645        query = query.arg_lazy(
13646            "id",
13647            Box::new(move || {
13648                let id = id.clone();
13649                Box::pin(async move { id.into_id().await.unwrap().quote() })
13650            }),
13651        );
13652        EnumTypeDef {
13653            proc: self.proc.clone(),
13654            selection: query,
13655            graphql_client: self.graphql_client.clone(),
13656        }
13657    }
13658    /// Load a EnumValueTypeDef from its ID.
13659    pub fn load_enum_value_type_def_from_id(
13660        &self,
13661        id: impl IntoID<EnumValueTypeDefId>,
13662    ) -> EnumValueTypeDef {
13663        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
13664        query = query.arg_lazy(
13665            "id",
13666            Box::new(move || {
13667                let id = id.clone();
13668                Box::pin(async move { id.into_id().await.unwrap().quote() })
13669            }),
13670        );
13671        EnumValueTypeDef {
13672            proc: self.proc.clone(),
13673            selection: query,
13674            graphql_client: self.graphql_client.clone(),
13675        }
13676    }
13677    /// Load a EnvFile from its ID.
13678    pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
13679        let mut query = self.selection.select("loadEnvFileFromID");
13680        query = query.arg_lazy(
13681            "id",
13682            Box::new(move || {
13683                let id = id.clone();
13684                Box::pin(async move { id.into_id().await.unwrap().quote() })
13685            }),
13686        );
13687        EnvFile {
13688            proc: self.proc.clone(),
13689            selection: query,
13690            graphql_client: self.graphql_client.clone(),
13691        }
13692    }
13693    /// Load a Env from its ID.
13694    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
13695        let mut query = self.selection.select("loadEnvFromID");
13696        query = query.arg_lazy(
13697            "id",
13698            Box::new(move || {
13699                let id = id.clone();
13700                Box::pin(async move { id.into_id().await.unwrap().quote() })
13701            }),
13702        );
13703        Env {
13704            proc: self.proc.clone(),
13705            selection: query,
13706            graphql_client: self.graphql_client.clone(),
13707        }
13708    }
13709    /// Load a EnvVariable from its ID.
13710    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
13711        let mut query = self.selection.select("loadEnvVariableFromID");
13712        query = query.arg_lazy(
13713            "id",
13714            Box::new(move || {
13715                let id = id.clone();
13716                Box::pin(async move { id.into_id().await.unwrap().quote() })
13717            }),
13718        );
13719        EnvVariable {
13720            proc: self.proc.clone(),
13721            selection: query,
13722            graphql_client: self.graphql_client.clone(),
13723        }
13724    }
13725    /// Load a Error from its ID.
13726    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
13727        let mut query = self.selection.select("loadErrorFromID");
13728        query = query.arg_lazy(
13729            "id",
13730            Box::new(move || {
13731                let id = id.clone();
13732                Box::pin(async move { id.into_id().await.unwrap().quote() })
13733            }),
13734        );
13735        Error {
13736            proc: self.proc.clone(),
13737            selection: query,
13738            graphql_client: self.graphql_client.clone(),
13739        }
13740    }
13741    /// Load a ErrorValue from its ID.
13742    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
13743        let mut query = self.selection.select("loadErrorValueFromID");
13744        query = query.arg_lazy(
13745            "id",
13746            Box::new(move || {
13747                let id = id.clone();
13748                Box::pin(async move { id.into_id().await.unwrap().quote() })
13749            }),
13750        );
13751        ErrorValue {
13752            proc: self.proc.clone(),
13753            selection: query,
13754            graphql_client: self.graphql_client.clone(),
13755        }
13756    }
13757    /// Load a Exportable from its ID.
13758    pub fn load_exportable_from_id(&self, id: impl IntoID<ExportableId>) -> ExportableClient {
13759        let mut query = self.selection.select("loadExportableFromID");
13760        query = query.arg_lazy(
13761            "id",
13762            Box::new(move || {
13763                let id = id.clone();
13764                Box::pin(async move { id.into_id().await.unwrap().quote() })
13765            }),
13766        );
13767        ExportableClient {
13768            proc: self.proc.clone(),
13769            selection: query,
13770            graphql_client: self.graphql_client.clone(),
13771        }
13772    }
13773    /// Load a FieldTypeDef from its ID.
13774    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
13775        let mut query = self.selection.select("loadFieldTypeDefFromID");
13776        query = query.arg_lazy(
13777            "id",
13778            Box::new(move || {
13779                let id = id.clone();
13780                Box::pin(async move { id.into_id().await.unwrap().quote() })
13781            }),
13782        );
13783        FieldTypeDef {
13784            proc: self.proc.clone(),
13785            selection: query,
13786            graphql_client: self.graphql_client.clone(),
13787        }
13788    }
13789    /// Load a File from its ID.
13790    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
13791        let mut query = self.selection.select("loadFileFromID");
13792        query = query.arg_lazy(
13793            "id",
13794            Box::new(move || {
13795                let id = id.clone();
13796                Box::pin(async move { id.into_id().await.unwrap().quote() })
13797            }),
13798        );
13799        File {
13800            proc: self.proc.clone(),
13801            selection: query,
13802            graphql_client: self.graphql_client.clone(),
13803        }
13804    }
13805    /// Load a FunctionArg from its ID.
13806    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
13807        let mut query = self.selection.select("loadFunctionArgFromID");
13808        query = query.arg_lazy(
13809            "id",
13810            Box::new(move || {
13811                let id = id.clone();
13812                Box::pin(async move { id.into_id().await.unwrap().quote() })
13813            }),
13814        );
13815        FunctionArg {
13816            proc: self.proc.clone(),
13817            selection: query,
13818            graphql_client: self.graphql_client.clone(),
13819        }
13820    }
13821    /// Load a FunctionCallArgValue from its ID.
13822    pub fn load_function_call_arg_value_from_id(
13823        &self,
13824        id: impl IntoID<FunctionCallArgValueId>,
13825    ) -> FunctionCallArgValue {
13826        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
13827        query = query.arg_lazy(
13828            "id",
13829            Box::new(move || {
13830                let id = id.clone();
13831                Box::pin(async move { id.into_id().await.unwrap().quote() })
13832            }),
13833        );
13834        FunctionCallArgValue {
13835            proc: self.proc.clone(),
13836            selection: query,
13837            graphql_client: self.graphql_client.clone(),
13838        }
13839    }
13840    /// Load a FunctionCall from its ID.
13841    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
13842        let mut query = self.selection.select("loadFunctionCallFromID");
13843        query = query.arg_lazy(
13844            "id",
13845            Box::new(move || {
13846                let id = id.clone();
13847                Box::pin(async move { id.into_id().await.unwrap().quote() })
13848            }),
13849        );
13850        FunctionCall {
13851            proc: self.proc.clone(),
13852            selection: query,
13853            graphql_client: self.graphql_client.clone(),
13854        }
13855    }
13856    /// Load a Function from its ID.
13857    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
13858        let mut query = self.selection.select("loadFunctionFromID");
13859        query = query.arg_lazy(
13860            "id",
13861            Box::new(move || {
13862                let id = id.clone();
13863                Box::pin(async move { id.into_id().await.unwrap().quote() })
13864            }),
13865        );
13866        Function {
13867            proc: self.proc.clone(),
13868            selection: query,
13869            graphql_client: self.graphql_client.clone(),
13870        }
13871    }
13872    /// Load a GeneratedCode from its ID.
13873    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
13874        let mut query = self.selection.select("loadGeneratedCodeFromID");
13875        query = query.arg_lazy(
13876            "id",
13877            Box::new(move || {
13878                let id = id.clone();
13879                Box::pin(async move { id.into_id().await.unwrap().quote() })
13880            }),
13881        );
13882        GeneratedCode {
13883            proc: self.proc.clone(),
13884            selection: query,
13885            graphql_client: self.graphql_client.clone(),
13886        }
13887    }
13888    /// Load a Generator from its ID.
13889    pub fn load_generator_from_id(&self, id: impl IntoID<GeneratorId>) -> Generator {
13890        let mut query = self.selection.select("loadGeneratorFromID");
13891        query = query.arg_lazy(
13892            "id",
13893            Box::new(move || {
13894                let id = id.clone();
13895                Box::pin(async move { id.into_id().await.unwrap().quote() })
13896            }),
13897        );
13898        Generator {
13899            proc: self.proc.clone(),
13900            selection: query,
13901            graphql_client: self.graphql_client.clone(),
13902        }
13903    }
13904    /// Load a GeneratorGroup from its ID.
13905    pub fn load_generator_group_from_id(
13906        &self,
13907        id: impl IntoID<GeneratorGroupId>,
13908    ) -> GeneratorGroup {
13909        let mut query = self.selection.select("loadGeneratorGroupFromID");
13910        query = query.arg_lazy(
13911            "id",
13912            Box::new(move || {
13913                let id = id.clone();
13914                Box::pin(async move { id.into_id().await.unwrap().quote() })
13915            }),
13916        );
13917        GeneratorGroup {
13918            proc: self.proc.clone(),
13919            selection: query,
13920            graphql_client: self.graphql_client.clone(),
13921        }
13922    }
13923    /// Load a GitRef from its ID.
13924    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
13925        let mut query = self.selection.select("loadGitRefFromID");
13926        query = query.arg_lazy(
13927            "id",
13928            Box::new(move || {
13929                let id = id.clone();
13930                Box::pin(async move { id.into_id().await.unwrap().quote() })
13931            }),
13932        );
13933        GitRef {
13934            proc: self.proc.clone(),
13935            selection: query,
13936            graphql_client: self.graphql_client.clone(),
13937        }
13938    }
13939    /// Load a GitRepository from its ID.
13940    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
13941        let mut query = self.selection.select("loadGitRepositoryFromID");
13942        query = query.arg_lazy(
13943            "id",
13944            Box::new(move || {
13945                let id = id.clone();
13946                Box::pin(async move { id.into_id().await.unwrap().quote() })
13947            }),
13948        );
13949        GitRepository {
13950            proc: self.proc.clone(),
13951            selection: query,
13952            graphql_client: self.graphql_client.clone(),
13953        }
13954    }
13955    /// Load a HTTPState from its ID.
13956    pub fn load_http_state_from_id(&self, id: impl IntoID<HttpStateId>) -> HttpState {
13957        let mut query = self.selection.select("loadHTTPStateFromID");
13958        query = query.arg_lazy(
13959            "id",
13960            Box::new(move || {
13961                let id = id.clone();
13962                Box::pin(async move { id.into_id().await.unwrap().quote() })
13963            }),
13964        );
13965        HttpState {
13966            proc: self.proc.clone(),
13967            selection: query,
13968            graphql_client: self.graphql_client.clone(),
13969        }
13970    }
13971    /// Load a HealthcheckConfig from its ID.
13972    pub fn load_healthcheck_config_from_id(
13973        &self,
13974        id: impl IntoID<HealthcheckConfigId>,
13975    ) -> HealthcheckConfig {
13976        let mut query = self.selection.select("loadHealthcheckConfigFromID");
13977        query = query.arg_lazy(
13978            "id",
13979            Box::new(move || {
13980                let id = id.clone();
13981                Box::pin(async move { id.into_id().await.unwrap().quote() })
13982            }),
13983        );
13984        HealthcheckConfig {
13985            proc: self.proc.clone(),
13986            selection: query,
13987            graphql_client: self.graphql_client.clone(),
13988        }
13989    }
13990    /// Load a Host from its ID.
13991    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
13992        let mut query = self.selection.select("loadHostFromID");
13993        query = query.arg_lazy(
13994            "id",
13995            Box::new(move || {
13996                let id = id.clone();
13997                Box::pin(async move { id.into_id().await.unwrap().quote() })
13998            }),
13999        );
14000        Host {
14001            proc: self.proc.clone(),
14002            selection: query,
14003            graphql_client: self.graphql_client.clone(),
14004        }
14005    }
14006    /// Load a InputTypeDef from its ID.
14007    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
14008        let mut query = self.selection.select("loadInputTypeDefFromID");
14009        query = query.arg_lazy(
14010            "id",
14011            Box::new(move || {
14012                let id = id.clone();
14013                Box::pin(async move { id.into_id().await.unwrap().quote() })
14014            }),
14015        );
14016        InputTypeDef {
14017            proc: self.proc.clone(),
14018            selection: query,
14019            graphql_client: self.graphql_client.clone(),
14020        }
14021    }
14022    /// Load a InterfaceTypeDef from its ID.
14023    pub fn load_interface_type_def_from_id(
14024        &self,
14025        id: impl IntoID<InterfaceTypeDefId>,
14026    ) -> InterfaceTypeDef {
14027        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
14028        query = query.arg_lazy(
14029            "id",
14030            Box::new(move || {
14031                let id = id.clone();
14032                Box::pin(async move { id.into_id().await.unwrap().quote() })
14033            }),
14034        );
14035        InterfaceTypeDef {
14036            proc: self.proc.clone(),
14037            selection: query,
14038            graphql_client: self.graphql_client.clone(),
14039        }
14040    }
14041    /// Load a JSONValue from its ID.
14042    pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
14043        let mut query = self.selection.select("loadJSONValueFromID");
14044        query = query.arg_lazy(
14045            "id",
14046            Box::new(move || {
14047                let id = id.clone();
14048                Box::pin(async move { id.into_id().await.unwrap().quote() })
14049            }),
14050        );
14051        JsonValue {
14052            proc: self.proc.clone(),
14053            selection: query,
14054            graphql_client: self.graphql_client.clone(),
14055        }
14056    }
14057    /// Load a LLM from its ID.
14058    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
14059        let mut query = self.selection.select("loadLLMFromID");
14060        query = query.arg_lazy(
14061            "id",
14062            Box::new(move || {
14063                let id = id.clone();
14064                Box::pin(async move { id.into_id().await.unwrap().quote() })
14065            }),
14066        );
14067        Llm {
14068            proc: self.proc.clone(),
14069            selection: query,
14070            graphql_client: self.graphql_client.clone(),
14071        }
14072    }
14073    /// Load a LLMTokenUsage from its ID.
14074    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
14075        let mut query = self.selection.select("loadLLMTokenUsageFromID");
14076        query = query.arg_lazy(
14077            "id",
14078            Box::new(move || {
14079                let id = id.clone();
14080                Box::pin(async move { id.into_id().await.unwrap().quote() })
14081            }),
14082        );
14083        LlmTokenUsage {
14084            proc: self.proc.clone(),
14085            selection: query,
14086            graphql_client: self.graphql_client.clone(),
14087        }
14088    }
14089    /// Load a Label from its ID.
14090    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
14091        let mut query = self.selection.select("loadLabelFromID");
14092        query = query.arg_lazy(
14093            "id",
14094            Box::new(move || {
14095                let id = id.clone();
14096                Box::pin(async move { id.into_id().await.unwrap().quote() })
14097            }),
14098        );
14099        Label {
14100            proc: self.proc.clone(),
14101            selection: query,
14102            graphql_client: self.graphql_client.clone(),
14103        }
14104    }
14105    /// Load a ListTypeDef from its ID.
14106    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
14107        let mut query = self.selection.select("loadListTypeDefFromID");
14108        query = query.arg_lazy(
14109            "id",
14110            Box::new(move || {
14111                let id = id.clone();
14112                Box::pin(async move { id.into_id().await.unwrap().quote() })
14113            }),
14114        );
14115        ListTypeDef {
14116            proc: self.proc.clone(),
14117            selection: query,
14118            graphql_client: self.graphql_client.clone(),
14119        }
14120    }
14121    /// Load a ModuleConfigClient from its ID.
14122    pub fn load_module_config_client_from_id(
14123        &self,
14124        id: impl IntoID<ModuleConfigClientId>,
14125    ) -> ModuleConfigClient {
14126        let mut query = self.selection.select("loadModuleConfigClientFromID");
14127        query = query.arg_lazy(
14128            "id",
14129            Box::new(move || {
14130                let id = id.clone();
14131                Box::pin(async move { id.into_id().await.unwrap().quote() })
14132            }),
14133        );
14134        ModuleConfigClient {
14135            proc: self.proc.clone(),
14136            selection: query,
14137            graphql_client: self.graphql_client.clone(),
14138        }
14139    }
14140    /// Load a Module from its ID.
14141    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
14142        let mut query = self.selection.select("loadModuleFromID");
14143        query = query.arg_lazy(
14144            "id",
14145            Box::new(move || {
14146                let id = id.clone();
14147                Box::pin(async move { id.into_id().await.unwrap().quote() })
14148            }),
14149        );
14150        Module {
14151            proc: self.proc.clone(),
14152            selection: query,
14153            graphql_client: self.graphql_client.clone(),
14154        }
14155    }
14156    /// Load a ModuleSource from its ID.
14157    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
14158        let mut query = self.selection.select("loadModuleSourceFromID");
14159        query = query.arg_lazy(
14160            "id",
14161            Box::new(move || {
14162                let id = id.clone();
14163                Box::pin(async move { id.into_id().await.unwrap().quote() })
14164            }),
14165        );
14166        ModuleSource {
14167            proc: self.proc.clone(),
14168            selection: query,
14169            graphql_client: self.graphql_client.clone(),
14170        }
14171    }
14172    /// Load a ObjectTypeDef from its ID.
14173    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
14174        let mut query = self.selection.select("loadObjectTypeDefFromID");
14175        query = query.arg_lazy(
14176            "id",
14177            Box::new(move || {
14178                let id = id.clone();
14179                Box::pin(async move { id.into_id().await.unwrap().quote() })
14180            }),
14181        );
14182        ObjectTypeDef {
14183            proc: self.proc.clone(),
14184            selection: query,
14185            graphql_client: self.graphql_client.clone(),
14186        }
14187    }
14188    /// Load a Port from its ID.
14189    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
14190        let mut query = self.selection.select("loadPortFromID");
14191        query = query.arg_lazy(
14192            "id",
14193            Box::new(move || {
14194                let id = id.clone();
14195                Box::pin(async move { id.into_id().await.unwrap().quote() })
14196            }),
14197        );
14198        Port {
14199            proc: self.proc.clone(),
14200            selection: query,
14201            graphql_client: self.graphql_client.clone(),
14202        }
14203    }
14204    /// Load a RemoteGitMirror from its ID.
14205    pub fn load_remote_git_mirror_from_id(
14206        &self,
14207        id: impl IntoID<RemoteGitMirrorId>,
14208    ) -> RemoteGitMirror {
14209        let mut query = self.selection.select("loadRemoteGitMirrorFromID");
14210        query = query.arg_lazy(
14211            "id",
14212            Box::new(move || {
14213                let id = id.clone();
14214                Box::pin(async move { id.into_id().await.unwrap().quote() })
14215            }),
14216        );
14217        RemoteGitMirror {
14218            proc: self.proc.clone(),
14219            selection: query,
14220            graphql_client: self.graphql_client.clone(),
14221        }
14222    }
14223    /// Load a SDKConfig from its ID.
14224    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
14225        let mut query = self.selection.select("loadSDKConfigFromID");
14226        query = query.arg_lazy(
14227            "id",
14228            Box::new(move || {
14229                let id = id.clone();
14230                Box::pin(async move { id.into_id().await.unwrap().quote() })
14231            }),
14232        );
14233        SdkConfig {
14234            proc: self.proc.clone(),
14235            selection: query,
14236            graphql_client: self.graphql_client.clone(),
14237        }
14238    }
14239    /// Load a ScalarTypeDef from its ID.
14240    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
14241        let mut query = self.selection.select("loadScalarTypeDefFromID");
14242        query = query.arg_lazy(
14243            "id",
14244            Box::new(move || {
14245                let id = id.clone();
14246                Box::pin(async move { id.into_id().await.unwrap().quote() })
14247            }),
14248        );
14249        ScalarTypeDef {
14250            proc: self.proc.clone(),
14251            selection: query,
14252            graphql_client: self.graphql_client.clone(),
14253        }
14254    }
14255    /// Load a SearchResult from its ID.
14256    pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
14257        let mut query = self.selection.select("loadSearchResultFromID");
14258        query = query.arg_lazy(
14259            "id",
14260            Box::new(move || {
14261                let id = id.clone();
14262                Box::pin(async move { id.into_id().await.unwrap().quote() })
14263            }),
14264        );
14265        SearchResult {
14266            proc: self.proc.clone(),
14267            selection: query,
14268            graphql_client: self.graphql_client.clone(),
14269        }
14270    }
14271    /// Load a SearchSubmatch from its ID.
14272    pub fn load_search_submatch_from_id(
14273        &self,
14274        id: impl IntoID<SearchSubmatchId>,
14275    ) -> SearchSubmatch {
14276        let mut query = self.selection.select("loadSearchSubmatchFromID");
14277        query = query.arg_lazy(
14278            "id",
14279            Box::new(move || {
14280                let id = id.clone();
14281                Box::pin(async move { id.into_id().await.unwrap().quote() })
14282            }),
14283        );
14284        SearchSubmatch {
14285            proc: self.proc.clone(),
14286            selection: query,
14287            graphql_client: self.graphql_client.clone(),
14288        }
14289    }
14290    /// Load a Secret from its ID.
14291    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
14292        let mut query = self.selection.select("loadSecretFromID");
14293        query = query.arg_lazy(
14294            "id",
14295            Box::new(move || {
14296                let id = id.clone();
14297                Box::pin(async move { id.into_id().await.unwrap().quote() })
14298            }),
14299        );
14300        Secret {
14301            proc: self.proc.clone(),
14302            selection: query,
14303            graphql_client: self.graphql_client.clone(),
14304        }
14305    }
14306    /// Load a Service from its ID.
14307    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
14308        let mut query = self.selection.select("loadServiceFromID");
14309        query = query.arg_lazy(
14310            "id",
14311            Box::new(move || {
14312                let id = id.clone();
14313                Box::pin(async move { id.into_id().await.unwrap().quote() })
14314            }),
14315        );
14316        Service {
14317            proc: self.proc.clone(),
14318            selection: query,
14319            graphql_client: self.graphql_client.clone(),
14320        }
14321    }
14322    /// Load a Socket from its ID.
14323    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
14324        let mut query = self.selection.select("loadSocketFromID");
14325        query = query.arg_lazy(
14326            "id",
14327            Box::new(move || {
14328                let id = id.clone();
14329                Box::pin(async move { id.into_id().await.unwrap().quote() })
14330            }),
14331        );
14332        Socket {
14333            proc: self.proc.clone(),
14334            selection: query,
14335            graphql_client: self.graphql_client.clone(),
14336        }
14337    }
14338    /// Load a SourceMap from its ID.
14339    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
14340        let mut query = self.selection.select("loadSourceMapFromID");
14341        query = query.arg_lazy(
14342            "id",
14343            Box::new(move || {
14344                let id = id.clone();
14345                Box::pin(async move { id.into_id().await.unwrap().quote() })
14346            }),
14347        );
14348        SourceMap {
14349            proc: self.proc.clone(),
14350            selection: query,
14351            graphql_client: self.graphql_client.clone(),
14352        }
14353    }
14354    /// Load a Stat from its ID.
14355    pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
14356        let mut query = self.selection.select("loadStatFromID");
14357        query = query.arg_lazy(
14358            "id",
14359            Box::new(move || {
14360                let id = id.clone();
14361                Box::pin(async move { id.into_id().await.unwrap().quote() })
14362            }),
14363        );
14364        Stat {
14365            proc: self.proc.clone(),
14366            selection: query,
14367            graphql_client: self.graphql_client.clone(),
14368        }
14369    }
14370    /// Load a Syncer from its ID.
14371    pub fn load_syncer_from_id(&self, id: impl IntoID<SyncerId>) -> SyncerClient {
14372        let mut query = self.selection.select("loadSyncerFromID");
14373        query = query.arg_lazy(
14374            "id",
14375            Box::new(move || {
14376                let id = id.clone();
14377                Box::pin(async move { id.into_id().await.unwrap().quote() })
14378            }),
14379        );
14380        SyncerClient {
14381            proc: self.proc.clone(),
14382            selection: query,
14383            graphql_client: self.graphql_client.clone(),
14384        }
14385    }
14386    /// Load a Terminal from its ID.
14387    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
14388        let mut query = self.selection.select("loadTerminalFromID");
14389        query = query.arg_lazy(
14390            "id",
14391            Box::new(move || {
14392                let id = id.clone();
14393                Box::pin(async move { id.into_id().await.unwrap().quote() })
14394            }),
14395        );
14396        Terminal {
14397            proc: self.proc.clone(),
14398            selection: query,
14399            graphql_client: self.graphql_client.clone(),
14400        }
14401    }
14402    /// Load a TypeDef from its ID.
14403    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
14404        let mut query = self.selection.select("loadTypeDefFromID");
14405        query = query.arg_lazy(
14406            "id",
14407            Box::new(move || {
14408                let id = id.clone();
14409                Box::pin(async move { id.into_id().await.unwrap().quote() })
14410            }),
14411        );
14412        TypeDef {
14413            proc: self.proc.clone(),
14414            selection: query,
14415            graphql_client: self.graphql_client.clone(),
14416        }
14417    }
14418    /// Load a Up from its ID.
14419    pub fn load_up_from_id(&self, id: impl IntoID<UpId>) -> Up {
14420        let mut query = self.selection.select("loadUpFromID");
14421        query = query.arg_lazy(
14422            "id",
14423            Box::new(move || {
14424                let id = id.clone();
14425                Box::pin(async move { id.into_id().await.unwrap().quote() })
14426            }),
14427        );
14428        Up {
14429            proc: self.proc.clone(),
14430            selection: query,
14431            graphql_client: self.graphql_client.clone(),
14432        }
14433    }
14434    /// Load a UpGroup from its ID.
14435    pub fn load_up_group_from_id(&self, id: impl IntoID<UpGroupId>) -> UpGroup {
14436        let mut query = self.selection.select("loadUpGroupFromID");
14437        query = query.arg_lazy(
14438            "id",
14439            Box::new(move || {
14440                let id = id.clone();
14441                Box::pin(async move { id.into_id().await.unwrap().quote() })
14442            }),
14443        );
14444        UpGroup {
14445            proc: self.proc.clone(),
14446            selection: query,
14447            graphql_client: self.graphql_client.clone(),
14448        }
14449    }
14450    /// Load a Workspace from its ID.
14451    pub fn load_workspace_from_id(&self, id: impl IntoID<WorkspaceId>) -> Workspace {
14452        let mut query = self.selection.select("loadWorkspaceFromID");
14453        query = query.arg_lazy(
14454            "id",
14455            Box::new(move || {
14456                let id = id.clone();
14457                Box::pin(async move { id.into_id().await.unwrap().quote() })
14458            }),
14459        );
14460        Workspace {
14461            proc: self.proc.clone(),
14462            selection: query,
14463            graphql_client: self.graphql_client.clone(),
14464        }
14465    }
14466    /// Create a new module.
14467    pub fn module(&self) -> Module {
14468        let query = self.selection.select("module");
14469        Module {
14470            proc: self.proc.clone(),
14471            selection: query,
14472            graphql_client: self.graphql_client.clone(),
14473        }
14474    }
14475    /// Create a new module source instance from a source ref string
14476    ///
14477    /// # Arguments
14478    ///
14479    /// * `ref_string` - The string ref representation of the module source
14480    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14481    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
14482        let mut query = self.selection.select("moduleSource");
14483        query = query.arg("refString", ref_string.into());
14484        ModuleSource {
14485            proc: self.proc.clone(),
14486            selection: query,
14487            graphql_client: self.graphql_client.clone(),
14488        }
14489    }
14490    /// Create a new module source instance from a source ref string
14491    ///
14492    /// # Arguments
14493    ///
14494    /// * `ref_string` - The string ref representation of the module source
14495    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14496    pub fn module_source_opts<'a>(
14497        &self,
14498        ref_string: impl Into<String>,
14499        opts: QueryModuleSourceOpts<'a>,
14500    ) -> ModuleSource {
14501        let mut query = self.selection.select("moduleSource");
14502        query = query.arg("refString", ref_string.into());
14503        if let Some(ref_pin) = opts.ref_pin {
14504            query = query.arg("refPin", ref_pin);
14505        }
14506        if let Some(disable_find_up) = opts.disable_find_up {
14507            query = query.arg("disableFindUp", disable_find_up);
14508        }
14509        if let Some(allow_not_exists) = opts.allow_not_exists {
14510            query = query.arg("allowNotExists", allow_not_exists);
14511        }
14512        if let Some(require_kind) = opts.require_kind {
14513            query = query.arg("requireKind", require_kind);
14514        }
14515        ModuleSource {
14516            proc: self.proc.clone(),
14517            selection: query,
14518            graphql_client: self.graphql_client.clone(),
14519        }
14520    }
14521    /// Load any object by its ID.
14522    pub fn node(&self, id: impl IntoID<Id>) -> NodeClient {
14523        let mut query = self.selection.select("node");
14524        query = query.arg_lazy(
14525            "id",
14526            Box::new(move || {
14527                let id = id.clone();
14528                Box::pin(async move { id.into_id().await.unwrap().quote() })
14529            }),
14530        );
14531        NodeClient {
14532            proc: self.proc.clone(),
14533            selection: query,
14534            graphql_client: self.graphql_client.clone(),
14535        }
14536    }
14537    /// Creates a new secret.
14538    ///
14539    /// # Arguments
14540    ///
14541    /// * `uri` - The URI of the secret store
14542    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14543    pub fn secret(&self, uri: impl Into<String>) -> Secret {
14544        let mut query = self.selection.select("secret");
14545        query = query.arg("uri", uri.into());
14546        Secret {
14547            proc: self.proc.clone(),
14548            selection: query,
14549            graphql_client: self.graphql_client.clone(),
14550        }
14551    }
14552    /// Creates a new secret.
14553    ///
14554    /// # Arguments
14555    ///
14556    /// * `uri` - The URI of the secret store
14557    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14558    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
14559        let mut query = self.selection.select("secret");
14560        query = query.arg("uri", uri.into());
14561        if let Some(cache_key) = opts.cache_key {
14562            query = query.arg("cacheKey", cache_key);
14563        }
14564        Secret {
14565            proc: self.proc.clone(),
14566            selection: query,
14567            graphql_client: self.graphql_client.clone(),
14568        }
14569    }
14570    /// Sets a secret given a user defined name to its plaintext and returns the secret.
14571    /// The plaintext value is limited to a size of 128000 bytes.
14572    ///
14573    /// # Arguments
14574    ///
14575    /// * `name` - The user defined name for this secret
14576    /// * `plaintext` - The plaintext of the secret
14577    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
14578        let mut query = self.selection.select("setSecret");
14579        query = query.arg("name", name.into());
14580        query = query.arg("plaintext", plaintext.into());
14581        Secret {
14582            proc: self.proc.clone(),
14583            selection: query,
14584            graphql_client: self.graphql_client.clone(),
14585        }
14586    }
14587    /// Creates source map metadata.
14588    ///
14589    /// # Arguments
14590    ///
14591    /// * `filename` - The filename from the module source.
14592    /// * `line` - The line number within the filename.
14593    /// * `column` - The column number within the line.
14594    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
14595        let mut query = self.selection.select("sourceMap");
14596        query = query.arg("filename", filename.into());
14597        query = query.arg("line", line);
14598        query = query.arg("column", column);
14599        SourceMap {
14600            proc: self.proc.clone(),
14601            selection: query,
14602            graphql_client: self.graphql_client.clone(),
14603        }
14604    }
14605    /// Create a new TypeDef.
14606    pub fn type_def(&self) -> TypeDef {
14607        let query = self.selection.select("typeDef");
14608        TypeDef {
14609            proc: self.proc.clone(),
14610            selection: query,
14611            graphql_client: self.graphql_client.clone(),
14612        }
14613    }
14614    /// Get the current Dagger Engine version.
14615    pub async fn version(&self) -> Result<String, DaggerError> {
14616        let query = self.selection.select("version");
14617        query.execute(self.graphql_client.clone()).await
14618    }
14619}
14620impl Node for Query {
14621    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14622        let query = self.selection.select("id");
14623        let graphql_client = self.graphql_client.clone();
14624        async move { query.execute(graphql_client).await }
14625    }
14626}
14627#[derive(Clone)]
14628pub struct RemoteGitMirror {
14629    pub proc: Option<Arc<DaggerSessionProc>>,
14630    pub selection: Selection,
14631    pub graphql_client: DynGraphQLClient,
14632}
14633impl IntoID<Id> for RemoteGitMirror {
14634    fn into_id(
14635        self,
14636    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14637        Box::pin(async move { self.id().await })
14638    }
14639}
14640impl Loadable for RemoteGitMirror {
14641    fn graphql_type() -> &'static str {
14642        "RemoteGitMirror"
14643    }
14644    fn from_query(
14645        proc: Option<Arc<DaggerSessionProc>>,
14646        selection: Selection,
14647        graphql_client: DynGraphQLClient,
14648    ) -> Self {
14649        Self {
14650            proc,
14651            selection,
14652            graphql_client,
14653        }
14654    }
14655}
14656impl RemoteGitMirror {
14657    /// A unique identifier for this RemoteGitMirror.
14658    pub async fn id(&self) -> Result<Id, DaggerError> {
14659        let query = self.selection.select("id");
14660        query.execute(self.graphql_client.clone()).await
14661    }
14662}
14663impl Node for RemoteGitMirror {
14664    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14665        let query = self.selection.select("id");
14666        let graphql_client = self.graphql_client.clone();
14667        async move { query.execute(graphql_client).await }
14668    }
14669}
14670#[derive(Clone)]
14671pub struct SdkConfig {
14672    pub proc: Option<Arc<DaggerSessionProc>>,
14673    pub selection: Selection,
14674    pub graphql_client: DynGraphQLClient,
14675}
14676impl IntoID<Id> for SdkConfig {
14677    fn into_id(
14678        self,
14679    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14680        Box::pin(async move { self.id().await })
14681    }
14682}
14683impl Loadable for SdkConfig {
14684    fn graphql_type() -> &'static str {
14685        "SDKConfig"
14686    }
14687    fn from_query(
14688        proc: Option<Arc<DaggerSessionProc>>,
14689        selection: Selection,
14690        graphql_client: DynGraphQLClient,
14691    ) -> Self {
14692        Self {
14693            proc,
14694            selection,
14695            graphql_client,
14696        }
14697    }
14698}
14699impl SdkConfig {
14700    /// Whether to start the SDK runtime in debug mode with an interactive terminal.
14701    pub async fn debug(&self) -> Result<bool, DaggerError> {
14702        let query = self.selection.select("debug");
14703        query.execute(self.graphql_client.clone()).await
14704    }
14705    /// A unique identifier for this SDKConfig.
14706    pub async fn id(&self) -> Result<Id, DaggerError> {
14707        let query = self.selection.select("id");
14708        query.execute(self.graphql_client.clone()).await
14709    }
14710    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
14711    pub async fn source(&self) -> Result<String, DaggerError> {
14712        let query = self.selection.select("source");
14713        query.execute(self.graphql_client.clone()).await
14714    }
14715}
14716impl Node for SdkConfig {
14717    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14718        let query = self.selection.select("id");
14719        let graphql_client = self.graphql_client.clone();
14720        async move { query.execute(graphql_client).await }
14721    }
14722}
14723#[derive(Clone)]
14724pub struct ScalarTypeDef {
14725    pub proc: Option<Arc<DaggerSessionProc>>,
14726    pub selection: Selection,
14727    pub graphql_client: DynGraphQLClient,
14728}
14729impl IntoID<Id> for ScalarTypeDef {
14730    fn into_id(
14731        self,
14732    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14733        Box::pin(async move { self.id().await })
14734    }
14735}
14736impl Loadable for ScalarTypeDef {
14737    fn graphql_type() -> &'static str {
14738        "ScalarTypeDef"
14739    }
14740    fn from_query(
14741        proc: Option<Arc<DaggerSessionProc>>,
14742        selection: Selection,
14743        graphql_client: DynGraphQLClient,
14744    ) -> Self {
14745        Self {
14746            proc,
14747            selection,
14748            graphql_client,
14749        }
14750    }
14751}
14752impl ScalarTypeDef {
14753    /// A doc string for the scalar, if any.
14754    pub async fn description(&self) -> Result<String, DaggerError> {
14755        let query = self.selection.select("description");
14756        query.execute(self.graphql_client.clone()).await
14757    }
14758    /// A unique identifier for this ScalarTypeDef.
14759    pub async fn id(&self) -> Result<Id, DaggerError> {
14760        let query = self.selection.select("id");
14761        query.execute(self.graphql_client.clone()).await
14762    }
14763    /// The name of the scalar.
14764    pub async fn name(&self) -> Result<String, DaggerError> {
14765        let query = self.selection.select("name");
14766        query.execute(self.graphql_client.clone()).await
14767    }
14768    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
14769    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
14770        let query = self.selection.select("sourceModuleName");
14771        query.execute(self.graphql_client.clone()).await
14772    }
14773}
14774impl Node for ScalarTypeDef {
14775    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14776        let query = self.selection.select("id");
14777        let graphql_client = self.graphql_client.clone();
14778        async move { query.execute(graphql_client).await }
14779    }
14780}
14781#[derive(Clone)]
14782pub struct SearchResult {
14783    pub proc: Option<Arc<DaggerSessionProc>>,
14784    pub selection: Selection,
14785    pub graphql_client: DynGraphQLClient,
14786}
14787impl IntoID<Id> for SearchResult {
14788    fn into_id(
14789        self,
14790    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14791        Box::pin(async move { self.id().await })
14792    }
14793}
14794impl Loadable for SearchResult {
14795    fn graphql_type() -> &'static str {
14796        "SearchResult"
14797    }
14798    fn from_query(
14799        proc: Option<Arc<DaggerSessionProc>>,
14800        selection: Selection,
14801        graphql_client: DynGraphQLClient,
14802    ) -> Self {
14803        Self {
14804            proc,
14805            selection,
14806            graphql_client,
14807        }
14808    }
14809}
14810impl SearchResult {
14811    /// The byte offset of this line within the file.
14812    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
14813        let query = self.selection.select("absoluteOffset");
14814        query.execute(self.graphql_client.clone()).await
14815    }
14816    /// The path to the file that matched.
14817    pub async fn file_path(&self) -> Result<String, DaggerError> {
14818        let query = self.selection.select("filePath");
14819        query.execute(self.graphql_client.clone()).await
14820    }
14821    /// A unique identifier for this SearchResult.
14822    pub async fn id(&self) -> Result<Id, DaggerError> {
14823        let query = self.selection.select("id");
14824        query.execute(self.graphql_client.clone()).await
14825    }
14826    /// The first line that matched.
14827    pub async fn line_number(&self) -> Result<isize, DaggerError> {
14828        let query = self.selection.select("lineNumber");
14829        query.execute(self.graphql_client.clone()).await
14830    }
14831    /// The line content that matched.
14832    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
14833        let query = self.selection.select("matchedLines");
14834        query.execute(self.graphql_client.clone()).await
14835    }
14836    /// Sub-match positions and content within the matched lines.
14837    pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
14838        let query = self.selection.select("submatches");
14839        let query = query.select("id");
14840        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14841        Ok(ids
14842            .into_iter()
14843            .map(|id| SearchSubmatch {
14844                proc: self.proc.clone(),
14845                selection: crate::querybuilder::query()
14846                    .select("node")
14847                    .arg("id", &id.0)
14848                    .inline_fragment("SearchSubmatch"),
14849                graphql_client: self.graphql_client.clone(),
14850            })
14851            .collect())
14852    }
14853}
14854impl Node for SearchResult {
14855    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14856        let query = self.selection.select("id");
14857        let graphql_client = self.graphql_client.clone();
14858        async move { query.execute(graphql_client).await }
14859    }
14860}
14861#[derive(Clone)]
14862pub struct SearchSubmatch {
14863    pub proc: Option<Arc<DaggerSessionProc>>,
14864    pub selection: Selection,
14865    pub graphql_client: DynGraphQLClient,
14866}
14867impl IntoID<Id> for SearchSubmatch {
14868    fn into_id(
14869        self,
14870    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14871        Box::pin(async move { self.id().await })
14872    }
14873}
14874impl Loadable for SearchSubmatch {
14875    fn graphql_type() -> &'static str {
14876        "SearchSubmatch"
14877    }
14878    fn from_query(
14879        proc: Option<Arc<DaggerSessionProc>>,
14880        selection: Selection,
14881        graphql_client: DynGraphQLClient,
14882    ) -> Self {
14883        Self {
14884            proc,
14885            selection,
14886            graphql_client,
14887        }
14888    }
14889}
14890impl SearchSubmatch {
14891    /// The match's end offset within the matched lines.
14892    pub async fn end(&self) -> Result<isize, DaggerError> {
14893        let query = self.selection.select("end");
14894        query.execute(self.graphql_client.clone()).await
14895    }
14896    /// A unique identifier for this SearchSubmatch.
14897    pub async fn id(&self) -> Result<Id, DaggerError> {
14898        let query = self.selection.select("id");
14899        query.execute(self.graphql_client.clone()).await
14900    }
14901    /// The match's start offset within the matched lines.
14902    pub async fn start(&self) -> Result<isize, DaggerError> {
14903        let query = self.selection.select("start");
14904        query.execute(self.graphql_client.clone()).await
14905    }
14906    /// The matched text.
14907    pub async fn text(&self) -> Result<String, DaggerError> {
14908        let query = self.selection.select("text");
14909        query.execute(self.graphql_client.clone()).await
14910    }
14911}
14912impl Node for SearchSubmatch {
14913    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14914        let query = self.selection.select("id");
14915        let graphql_client = self.graphql_client.clone();
14916        async move { query.execute(graphql_client).await }
14917    }
14918}
14919#[derive(Clone)]
14920pub struct Secret {
14921    pub proc: Option<Arc<DaggerSessionProc>>,
14922    pub selection: Selection,
14923    pub graphql_client: DynGraphQLClient,
14924}
14925impl IntoID<Id> for Secret {
14926    fn into_id(
14927        self,
14928    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14929        Box::pin(async move { self.id().await })
14930    }
14931}
14932impl Loadable for Secret {
14933    fn graphql_type() -> &'static str {
14934        "Secret"
14935    }
14936    fn from_query(
14937        proc: Option<Arc<DaggerSessionProc>>,
14938        selection: Selection,
14939        graphql_client: DynGraphQLClient,
14940    ) -> Self {
14941        Self {
14942            proc,
14943            selection,
14944            graphql_client,
14945        }
14946    }
14947}
14948impl Secret {
14949    /// A unique identifier for this Secret.
14950    pub async fn id(&self) -> Result<Id, DaggerError> {
14951        let query = self.selection.select("id");
14952        query.execute(self.graphql_client.clone()).await
14953    }
14954    /// The name of this secret.
14955    pub async fn name(&self) -> Result<String, DaggerError> {
14956        let query = self.selection.select("name");
14957        query.execute(self.graphql_client.clone()).await
14958    }
14959    /// The value of this secret.
14960    pub async fn plaintext(&self) -> Result<String, DaggerError> {
14961        let query = self.selection.select("plaintext");
14962        query.execute(self.graphql_client.clone()).await
14963    }
14964    /// The URI of this secret.
14965    pub async fn uri(&self) -> Result<String, DaggerError> {
14966        let query = self.selection.select("uri");
14967        query.execute(self.graphql_client.clone()).await
14968    }
14969}
14970impl Node for Secret {
14971    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14972        let query = self.selection.select("id");
14973        let graphql_client = self.graphql_client.clone();
14974        async move { query.execute(graphql_client).await }
14975    }
14976}
14977#[derive(Clone)]
14978pub struct Service {
14979    pub proc: Option<Arc<DaggerSessionProc>>,
14980    pub selection: Selection,
14981    pub graphql_client: DynGraphQLClient,
14982}
14983#[derive(Builder, Debug, PartialEq)]
14984pub struct ServiceEndpointOpts<'a> {
14985    /// The exposed port number for the endpoint
14986    #[builder(setter(into, strip_option), default)]
14987    pub port: Option<isize>,
14988    /// Return a URL with the given scheme, eg. http for http://
14989    #[builder(setter(into, strip_option), default)]
14990    pub scheme: Option<&'a str>,
14991}
14992#[derive(Builder, Debug, PartialEq)]
14993pub struct ServiceStopOpts {
14994    /// Immediately kill the service without waiting for a graceful exit
14995    #[builder(setter(into, strip_option), default)]
14996    pub kill: Option<bool>,
14997}
14998#[derive(Builder, Debug, PartialEq)]
14999pub struct ServiceTerminalOpts<'a> {
15000    #[builder(setter(into, strip_option), default)]
15001    pub cmd: Option<Vec<&'a str>>,
15002}
15003#[derive(Builder, Debug, PartialEq)]
15004pub struct ServiceUpOpts {
15005    /// List of frontend/backend port mappings to forward.
15006    /// Frontend is the port accepting traffic on the host, backend is the service port.
15007    #[builder(setter(into, strip_option), default)]
15008    pub ports: Option<Vec<PortForward>>,
15009    /// Bind each tunnel port to a random port on the host.
15010    #[builder(setter(into, strip_option), default)]
15011    pub random: Option<bool>,
15012}
15013impl IntoID<Id> for Service {
15014    fn into_id(
15015        self,
15016    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15017        Box::pin(async move { self.id().await })
15018    }
15019}
15020impl Loadable for Service {
15021    fn graphql_type() -> &'static str {
15022        "Service"
15023    }
15024    fn from_query(
15025        proc: Option<Arc<DaggerSessionProc>>,
15026        selection: Selection,
15027        graphql_client: DynGraphQLClient,
15028    ) -> Self {
15029        Self {
15030            proc,
15031            selection,
15032            graphql_client,
15033        }
15034    }
15035}
15036impl Service {
15037    /// Retrieves an endpoint that clients can use to reach this container.
15038    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
15039    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
15040    ///
15041    /// # Arguments
15042    ///
15043    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15044    pub async fn endpoint(&self) -> Result<String, DaggerError> {
15045        let query = self.selection.select("endpoint");
15046        query.execute(self.graphql_client.clone()).await
15047    }
15048    /// Retrieves an endpoint that clients can use to reach this container.
15049    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
15050    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
15051    ///
15052    /// # Arguments
15053    ///
15054    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15055    pub async fn endpoint_opts<'a>(
15056        &self,
15057        opts: ServiceEndpointOpts<'a>,
15058    ) -> Result<String, DaggerError> {
15059        let mut query = self.selection.select("endpoint");
15060        if let Some(port) = opts.port {
15061            query = query.arg("port", port);
15062        }
15063        if let Some(scheme) = opts.scheme {
15064            query = query.arg("scheme", scheme);
15065        }
15066        query.execute(self.graphql_client.clone()).await
15067    }
15068    /// Retrieves a hostname which can be used by clients to reach this container.
15069    pub async fn hostname(&self) -> Result<String, DaggerError> {
15070        let query = self.selection.select("hostname");
15071        query.execute(self.graphql_client.clone()).await
15072    }
15073    /// A unique identifier for this Service.
15074    pub async fn id(&self) -> Result<Id, DaggerError> {
15075        let query = self.selection.select("id");
15076        query.execute(self.graphql_client.clone()).await
15077    }
15078    /// Retrieves the list of ports provided by the service.
15079    pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
15080        let query = self.selection.select("ports");
15081        let query = query.select("id");
15082        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15083        Ok(ids
15084            .into_iter()
15085            .map(|id| Port {
15086                proc: self.proc.clone(),
15087                selection: crate::querybuilder::query()
15088                    .select("node")
15089                    .arg("id", &id.0)
15090                    .inline_fragment("Port"),
15091                graphql_client: self.graphql_client.clone(),
15092            })
15093            .collect())
15094    }
15095    /// Start the service and wait for its health checks to succeed.
15096    /// Services bound to a Container do not need to be manually started.
15097    pub async fn start(&self) -> Result<Service, DaggerError> {
15098        let query = self.selection.select("start");
15099        let id: Id = query.execute(self.graphql_client.clone()).await?;
15100        Ok(Service {
15101            proc: self.proc.clone(),
15102            selection: query
15103                .root()
15104                .select("node")
15105                .arg("id", &id.0)
15106                .inline_fragment("Service"),
15107            graphql_client: self.graphql_client.clone(),
15108        })
15109    }
15110    /// Stop the service.
15111    ///
15112    /// # Arguments
15113    ///
15114    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15115    pub async fn stop(&self) -> Result<Service, DaggerError> {
15116        let query = self.selection.select("stop");
15117        let id: Id = query.execute(self.graphql_client.clone()).await?;
15118        Ok(Service {
15119            proc: self.proc.clone(),
15120            selection: query
15121                .root()
15122                .select("node")
15123                .arg("id", &id.0)
15124                .inline_fragment("Service"),
15125            graphql_client: self.graphql_client.clone(),
15126        })
15127    }
15128    /// Stop the service.
15129    ///
15130    /// # Arguments
15131    ///
15132    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15133    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
15134        let mut query = self.selection.select("stop");
15135        if let Some(kill) = opts.kill {
15136            query = query.arg("kill", kill);
15137        }
15138        let id: Id = query.execute(self.graphql_client.clone()).await?;
15139        Ok(Service {
15140            proc: self.proc.clone(),
15141            selection: query
15142                .root()
15143                .select("node")
15144                .arg("id", &id.0)
15145                .inline_fragment("Service"),
15146            graphql_client: self.graphql_client.clone(),
15147        })
15148    }
15149    /// Forces evaluation of the pipeline in the engine.
15150    pub async fn sync(&self) -> Result<Service, DaggerError> {
15151        let query = self.selection.select("sync");
15152        let id: Id = query.execute(self.graphql_client.clone()).await?;
15153        Ok(Service {
15154            proc: self.proc.clone(),
15155            selection: query
15156                .root()
15157                .select("node")
15158                .arg("id", &id.0)
15159                .inline_fragment("Service"),
15160            graphql_client: self.graphql_client.clone(),
15161        })
15162    }
15163    ///
15164    /// # Arguments
15165    ///
15166    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15167    pub fn terminal(&self) -> Service {
15168        let query = self.selection.select("terminal");
15169        Service {
15170            proc: self.proc.clone(),
15171            selection: query,
15172            graphql_client: self.graphql_client.clone(),
15173        }
15174    }
15175    ///
15176    /// # Arguments
15177    ///
15178    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15179    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
15180        let mut query = self.selection.select("terminal");
15181        if let Some(cmd) = opts.cmd {
15182            query = query.arg("cmd", cmd);
15183        }
15184        Service {
15185            proc: self.proc.clone(),
15186            selection: query,
15187            graphql_client: self.graphql_client.clone(),
15188        }
15189    }
15190    /// Creates a tunnel that forwards traffic from the caller's network to this service.
15191    ///
15192    /// # Arguments
15193    ///
15194    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15195    pub async fn up(&self) -> Result<Void, DaggerError> {
15196        let query = self.selection.select("up");
15197        query.execute(self.graphql_client.clone()).await
15198    }
15199    /// Creates a tunnel that forwards traffic from the caller's network to this service.
15200    ///
15201    /// # Arguments
15202    ///
15203    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15204    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
15205        let mut query = self.selection.select("up");
15206        if let Some(ports) = opts.ports {
15207            query = query.arg("ports", ports);
15208        }
15209        if let Some(random) = opts.random {
15210            query = query.arg("random", random);
15211        }
15212        query.execute(self.graphql_client.clone()).await
15213    }
15214    /// Configures a hostname which can be used by clients within the session to reach this container.
15215    ///
15216    /// # Arguments
15217    ///
15218    /// * `hostname` - The hostname to use.
15219    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
15220        let mut query = self.selection.select("withHostname");
15221        query = query.arg("hostname", hostname.into());
15222        Service {
15223            proc: self.proc.clone(),
15224            selection: query,
15225            graphql_client: self.graphql_client.clone(),
15226        }
15227    }
15228}
15229impl Node for Service {
15230    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15231        let query = self.selection.select("id");
15232        let graphql_client = self.graphql_client.clone();
15233        async move { query.execute(graphql_client).await }
15234    }
15235}
15236impl Syncer for Service {
15237    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15238        let query = self.selection.select("id");
15239        let graphql_client = self.graphql_client.clone();
15240        async move { query.execute(graphql_client).await }
15241    }
15242    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15243        let query = self.selection.select("sync");
15244        let graphql_client = self.graphql_client.clone();
15245        async move { query.execute(graphql_client).await }
15246    }
15247}
15248#[derive(Clone)]
15249pub struct Socket {
15250    pub proc: Option<Arc<DaggerSessionProc>>,
15251    pub selection: Selection,
15252    pub graphql_client: DynGraphQLClient,
15253}
15254impl IntoID<Id> for Socket {
15255    fn into_id(
15256        self,
15257    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15258        Box::pin(async move { self.id().await })
15259    }
15260}
15261impl Loadable for Socket {
15262    fn graphql_type() -> &'static str {
15263        "Socket"
15264    }
15265    fn from_query(
15266        proc: Option<Arc<DaggerSessionProc>>,
15267        selection: Selection,
15268        graphql_client: DynGraphQLClient,
15269    ) -> Self {
15270        Self {
15271            proc,
15272            selection,
15273            graphql_client,
15274        }
15275    }
15276}
15277impl Socket {
15278    /// A unique identifier for this Socket.
15279    pub async fn id(&self) -> Result<Id, DaggerError> {
15280        let query = self.selection.select("id");
15281        query.execute(self.graphql_client.clone()).await
15282    }
15283}
15284impl Node for Socket {
15285    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15286        let query = self.selection.select("id");
15287        let graphql_client = self.graphql_client.clone();
15288        async move { query.execute(graphql_client).await }
15289    }
15290}
15291#[derive(Clone)]
15292pub struct SourceMap {
15293    pub proc: Option<Arc<DaggerSessionProc>>,
15294    pub selection: Selection,
15295    pub graphql_client: DynGraphQLClient,
15296}
15297impl IntoID<Id> for SourceMap {
15298    fn into_id(
15299        self,
15300    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15301        Box::pin(async move { self.id().await })
15302    }
15303}
15304impl Loadable for SourceMap {
15305    fn graphql_type() -> &'static str {
15306        "SourceMap"
15307    }
15308    fn from_query(
15309        proc: Option<Arc<DaggerSessionProc>>,
15310        selection: Selection,
15311        graphql_client: DynGraphQLClient,
15312    ) -> Self {
15313        Self {
15314            proc,
15315            selection,
15316            graphql_client,
15317        }
15318    }
15319}
15320impl SourceMap {
15321    /// The column number within the line.
15322    pub async fn column(&self) -> Result<isize, DaggerError> {
15323        let query = self.selection.select("column");
15324        query.execute(self.graphql_client.clone()).await
15325    }
15326    /// The filename from the module source.
15327    pub async fn filename(&self) -> Result<String, DaggerError> {
15328        let query = self.selection.select("filename");
15329        query.execute(self.graphql_client.clone()).await
15330    }
15331    /// A unique identifier for this SourceMap.
15332    pub async fn id(&self) -> Result<Id, DaggerError> {
15333        let query = self.selection.select("id");
15334        query.execute(self.graphql_client.clone()).await
15335    }
15336    /// The line number within the filename.
15337    pub async fn line(&self) -> Result<isize, DaggerError> {
15338        let query = self.selection.select("line");
15339        query.execute(self.graphql_client.clone()).await
15340    }
15341    /// The module dependency this was declared in.
15342    pub async fn module(&self) -> Result<String, DaggerError> {
15343        let query = self.selection.select("module");
15344        query.execute(self.graphql_client.clone()).await
15345    }
15346    /// The URL to the file, if any. This can be used to link to the source map in the browser.
15347    pub async fn url(&self) -> Result<String, DaggerError> {
15348        let query = self.selection.select("url");
15349        query.execute(self.graphql_client.clone()).await
15350    }
15351}
15352impl Node for SourceMap {
15353    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15354        let query = self.selection.select("id");
15355        let graphql_client = self.graphql_client.clone();
15356        async move { query.execute(graphql_client).await }
15357    }
15358}
15359#[derive(Clone)]
15360pub struct Stat {
15361    pub proc: Option<Arc<DaggerSessionProc>>,
15362    pub selection: Selection,
15363    pub graphql_client: DynGraphQLClient,
15364}
15365impl IntoID<Id> for Stat {
15366    fn into_id(
15367        self,
15368    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15369        Box::pin(async move { self.id().await })
15370    }
15371}
15372impl Loadable for Stat {
15373    fn graphql_type() -> &'static str {
15374        "Stat"
15375    }
15376    fn from_query(
15377        proc: Option<Arc<DaggerSessionProc>>,
15378        selection: Selection,
15379        graphql_client: DynGraphQLClient,
15380    ) -> Self {
15381        Self {
15382            proc,
15383            selection,
15384            graphql_client,
15385        }
15386    }
15387}
15388impl Stat {
15389    /// file type
15390    pub async fn file_type(&self) -> Result<FileType, DaggerError> {
15391        let query = self.selection.select("fileType");
15392        query.execute(self.graphql_client.clone()).await
15393    }
15394    /// A unique identifier for this Stat.
15395    pub async fn id(&self) -> Result<Id, DaggerError> {
15396        let query = self.selection.select("id");
15397        query.execute(self.graphql_client.clone()).await
15398    }
15399    /// file name
15400    pub async fn name(&self) -> Result<String, DaggerError> {
15401        let query = self.selection.select("name");
15402        query.execute(self.graphql_client.clone()).await
15403    }
15404    /// permission bits
15405    pub async fn permissions(&self) -> Result<isize, DaggerError> {
15406        let query = self.selection.select("permissions");
15407        query.execute(self.graphql_client.clone()).await
15408    }
15409    /// file size
15410    pub async fn size(&self) -> Result<isize, DaggerError> {
15411        let query = self.selection.select("size");
15412        query.execute(self.graphql_client.clone()).await
15413    }
15414}
15415impl Node for Stat {
15416    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15417        let query = self.selection.select("id");
15418        let graphql_client = self.graphql_client.clone();
15419        async move { query.execute(graphql_client).await }
15420    }
15421}
15422#[derive(Clone)]
15423pub struct Terminal {
15424    pub proc: Option<Arc<DaggerSessionProc>>,
15425    pub selection: Selection,
15426    pub graphql_client: DynGraphQLClient,
15427}
15428impl IntoID<Id> for Terminal {
15429    fn into_id(
15430        self,
15431    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15432        Box::pin(async move { self.id().await })
15433    }
15434}
15435impl Loadable for Terminal {
15436    fn graphql_type() -> &'static str {
15437        "Terminal"
15438    }
15439    fn from_query(
15440        proc: Option<Arc<DaggerSessionProc>>,
15441        selection: Selection,
15442        graphql_client: DynGraphQLClient,
15443    ) -> Self {
15444        Self {
15445            proc,
15446            selection,
15447            graphql_client,
15448        }
15449    }
15450}
15451impl Terminal {
15452    /// A unique identifier for this Terminal.
15453    pub async fn id(&self) -> Result<Id, DaggerError> {
15454        let query = self.selection.select("id");
15455        query.execute(self.graphql_client.clone()).await
15456    }
15457    /// Forces evaluation of the pipeline in the engine.
15458    /// It doesn't run the default command if no exec has been set.
15459    pub async fn sync(&self) -> Result<Terminal, DaggerError> {
15460        let query = self.selection.select("sync");
15461        let id: Id = query.execute(self.graphql_client.clone()).await?;
15462        Ok(Terminal {
15463            proc: self.proc.clone(),
15464            selection: query
15465                .root()
15466                .select("node")
15467                .arg("id", &id.0)
15468                .inline_fragment("Terminal"),
15469            graphql_client: self.graphql_client.clone(),
15470        })
15471    }
15472}
15473impl Node for Terminal {
15474    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15475        let query = self.selection.select("id");
15476        let graphql_client = self.graphql_client.clone();
15477        async move { query.execute(graphql_client).await }
15478    }
15479}
15480impl Syncer for Terminal {
15481    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15482        let query = self.selection.select("id");
15483        let graphql_client = self.graphql_client.clone();
15484        async move { query.execute(graphql_client).await }
15485    }
15486    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15487        let query = self.selection.select("sync");
15488        let graphql_client = self.graphql_client.clone();
15489        async move { query.execute(graphql_client).await }
15490    }
15491}
15492#[derive(Clone)]
15493pub struct TypeDef {
15494    pub proc: Option<Arc<DaggerSessionProc>>,
15495    pub selection: Selection,
15496    pub graphql_client: DynGraphQLClient,
15497}
15498#[derive(Builder, Debug, PartialEq)]
15499pub struct TypeDefWithEnumOpts<'a> {
15500    /// A doc string for the enum, if any
15501    #[builder(setter(into, strip_option), default)]
15502    pub description: Option<&'a str>,
15503    /// The source map for the enum definition.
15504    #[builder(setter(into, strip_option), default)]
15505    pub source_map: Option<Id>,
15506}
15507#[derive(Builder, Debug, PartialEq)]
15508pub struct TypeDefWithEnumMemberOpts<'a> {
15509    /// If deprecated, the reason or migration path.
15510    #[builder(setter(into, strip_option), default)]
15511    pub deprecated: Option<&'a str>,
15512    /// A doc string for the member, if any
15513    #[builder(setter(into, strip_option), default)]
15514    pub description: Option<&'a str>,
15515    /// The source map for the enum member definition.
15516    #[builder(setter(into, strip_option), default)]
15517    pub source_map: Option<Id>,
15518    /// The value of the member in the enum
15519    #[builder(setter(into, strip_option), default)]
15520    pub value: Option<&'a str>,
15521}
15522#[derive(Builder, Debug, PartialEq)]
15523pub struct TypeDefWithEnumValueOpts<'a> {
15524    /// If deprecated, the reason or migration path.
15525    #[builder(setter(into, strip_option), default)]
15526    pub deprecated: Option<&'a str>,
15527    /// A doc string for the value, if any
15528    #[builder(setter(into, strip_option), default)]
15529    pub description: Option<&'a str>,
15530    /// The source map for the enum value definition.
15531    #[builder(setter(into, strip_option), default)]
15532    pub source_map: Option<Id>,
15533}
15534#[derive(Builder, Debug, PartialEq)]
15535pub struct TypeDefWithFieldOpts<'a> {
15536    /// If deprecated, the reason or migration path.
15537    #[builder(setter(into, strip_option), default)]
15538    pub deprecated: Option<&'a str>,
15539    /// A doc string for the field, if any
15540    #[builder(setter(into, strip_option), default)]
15541    pub description: Option<&'a str>,
15542    /// The source map for the field definition.
15543    #[builder(setter(into, strip_option), default)]
15544    pub source_map: Option<Id>,
15545}
15546#[derive(Builder, Debug, PartialEq)]
15547pub struct TypeDefWithInterfaceOpts<'a> {
15548    #[builder(setter(into, strip_option), default)]
15549    pub description: Option<&'a str>,
15550    #[builder(setter(into, strip_option), default)]
15551    pub source_map: Option<Id>,
15552}
15553#[derive(Builder, Debug, PartialEq)]
15554pub struct TypeDefWithObjectOpts<'a> {
15555    #[builder(setter(into, strip_option), default)]
15556    pub deprecated: Option<&'a str>,
15557    #[builder(setter(into, strip_option), default)]
15558    pub description: Option<&'a str>,
15559    #[builder(setter(into, strip_option), default)]
15560    pub source_map: Option<Id>,
15561}
15562#[derive(Builder, Debug, PartialEq)]
15563pub struct TypeDefWithScalarOpts<'a> {
15564    #[builder(setter(into, strip_option), default)]
15565    pub description: Option<&'a str>,
15566}
15567impl IntoID<Id> for TypeDef {
15568    fn into_id(
15569        self,
15570    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15571        Box::pin(async move { self.id().await })
15572    }
15573}
15574impl Loadable for TypeDef {
15575    fn graphql_type() -> &'static str {
15576        "TypeDef"
15577    }
15578    fn from_query(
15579        proc: Option<Arc<DaggerSessionProc>>,
15580        selection: Selection,
15581        graphql_client: DynGraphQLClient,
15582    ) -> Self {
15583        Self {
15584            proc,
15585            selection,
15586            graphql_client,
15587        }
15588    }
15589}
15590impl TypeDef {
15591    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
15592    pub fn as_enum(&self) -> EnumTypeDef {
15593        let query = self.selection.select("asEnum");
15594        EnumTypeDef {
15595            proc: self.proc.clone(),
15596            selection: query,
15597            graphql_client: self.graphql_client.clone(),
15598        }
15599    }
15600    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
15601    pub fn as_input(&self) -> InputTypeDef {
15602        let query = self.selection.select("asInput");
15603        InputTypeDef {
15604            proc: self.proc.clone(),
15605            selection: query,
15606            graphql_client: self.graphql_client.clone(),
15607        }
15608    }
15609    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
15610    pub fn as_interface(&self) -> InterfaceTypeDef {
15611        let query = self.selection.select("asInterface");
15612        InterfaceTypeDef {
15613            proc: self.proc.clone(),
15614            selection: query,
15615            graphql_client: self.graphql_client.clone(),
15616        }
15617    }
15618    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
15619    pub fn as_list(&self) -> ListTypeDef {
15620        let query = self.selection.select("asList");
15621        ListTypeDef {
15622            proc: self.proc.clone(),
15623            selection: query,
15624            graphql_client: self.graphql_client.clone(),
15625        }
15626    }
15627    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
15628    pub fn as_object(&self) -> ObjectTypeDef {
15629        let query = self.selection.select("asObject");
15630        ObjectTypeDef {
15631            proc: self.proc.clone(),
15632            selection: query,
15633            graphql_client: self.graphql_client.clone(),
15634        }
15635    }
15636    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
15637    pub fn as_scalar(&self) -> ScalarTypeDef {
15638        let query = self.selection.select("asScalar");
15639        ScalarTypeDef {
15640            proc: self.proc.clone(),
15641            selection: query,
15642            graphql_client: self.graphql_client.clone(),
15643        }
15644    }
15645    /// A unique identifier for this TypeDef.
15646    pub async fn id(&self) -> Result<Id, DaggerError> {
15647        let query = self.selection.select("id");
15648        query.execute(self.graphql_client.clone()).await
15649    }
15650    /// The kind of type this is (e.g. primitive, list, object).
15651    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
15652        let query = self.selection.select("kind");
15653        query.execute(self.graphql_client.clone()).await
15654    }
15655    /// The canonical non-optional name of the type.
15656    pub async fn name(&self) -> Result<String, DaggerError> {
15657        let query = self.selection.select("name");
15658        query.execute(self.graphql_client.clone()).await
15659    }
15660    /// Whether this type can be set to null. Defaults to false.
15661    pub async fn optional(&self) -> Result<bool, DaggerError> {
15662        let query = self.selection.select("optional");
15663        query.execute(self.graphql_client.clone()).await
15664    }
15665    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
15666    pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
15667        let mut query = self.selection.select("withConstructor");
15668        query = query.arg_lazy(
15669            "function",
15670            Box::new(move || {
15671                let function = function.clone();
15672                Box::pin(async move { function.into_id().await.unwrap().quote() })
15673            }),
15674        );
15675        TypeDef {
15676            proc: self.proc.clone(),
15677            selection: query,
15678            graphql_client: self.graphql_client.clone(),
15679        }
15680    }
15681    /// Returns a TypeDef of kind Enum with the provided name.
15682    /// 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.
15683    ///
15684    /// # Arguments
15685    ///
15686    /// * `name` - The name of the enum
15687    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15688    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
15689        let mut query = self.selection.select("withEnum");
15690        query = query.arg("name", name.into());
15691        TypeDef {
15692            proc: self.proc.clone(),
15693            selection: query,
15694            graphql_client: self.graphql_client.clone(),
15695        }
15696    }
15697    /// Returns a TypeDef of kind Enum with the provided name.
15698    /// 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.
15699    ///
15700    /// # Arguments
15701    ///
15702    /// * `name` - The name of the enum
15703    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15704    pub fn with_enum_opts<'a>(
15705        &self,
15706        name: impl Into<String>,
15707        opts: TypeDefWithEnumOpts<'a>,
15708    ) -> TypeDef {
15709        let mut query = self.selection.select("withEnum");
15710        query = query.arg("name", name.into());
15711        if let Some(description) = opts.description {
15712            query = query.arg("description", description);
15713        }
15714        if let Some(source_map) = opts.source_map {
15715            query = query.arg("sourceMap", source_map);
15716        }
15717        TypeDef {
15718            proc: self.proc.clone(),
15719            selection: query,
15720            graphql_client: self.graphql_client.clone(),
15721        }
15722    }
15723    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15724    ///
15725    /// # Arguments
15726    ///
15727    /// * `name` - The name of the member in the enum
15728    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15729    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
15730        let mut query = self.selection.select("withEnumMember");
15731        query = query.arg("name", name.into());
15732        TypeDef {
15733            proc: self.proc.clone(),
15734            selection: query,
15735            graphql_client: self.graphql_client.clone(),
15736        }
15737    }
15738    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15739    ///
15740    /// # Arguments
15741    ///
15742    /// * `name` - The name of the member in the enum
15743    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15744    pub fn with_enum_member_opts<'a>(
15745        &self,
15746        name: impl Into<String>,
15747        opts: TypeDefWithEnumMemberOpts<'a>,
15748    ) -> TypeDef {
15749        let mut query = self.selection.select("withEnumMember");
15750        query = query.arg("name", name.into());
15751        if let Some(value) = opts.value {
15752            query = query.arg("value", value);
15753        }
15754        if let Some(description) = opts.description {
15755            query = query.arg("description", description);
15756        }
15757        if let Some(source_map) = opts.source_map {
15758            query = query.arg("sourceMap", source_map);
15759        }
15760        if let Some(deprecated) = opts.deprecated {
15761            query = query.arg("deprecated", deprecated);
15762        }
15763        TypeDef {
15764            proc: self.proc.clone(),
15765            selection: query,
15766            graphql_client: self.graphql_client.clone(),
15767        }
15768    }
15769    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15770    ///
15771    /// # Arguments
15772    ///
15773    /// * `value` - The name of the value in the enum
15774    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15775    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
15776        let mut query = self.selection.select("withEnumValue");
15777        query = query.arg("value", value.into());
15778        TypeDef {
15779            proc: self.proc.clone(),
15780            selection: query,
15781            graphql_client: self.graphql_client.clone(),
15782        }
15783    }
15784    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15785    ///
15786    /// # Arguments
15787    ///
15788    /// * `value` - The name of the value in the enum
15789    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15790    pub fn with_enum_value_opts<'a>(
15791        &self,
15792        value: impl Into<String>,
15793        opts: TypeDefWithEnumValueOpts<'a>,
15794    ) -> TypeDef {
15795        let mut query = self.selection.select("withEnumValue");
15796        query = query.arg("value", value.into());
15797        if let Some(description) = opts.description {
15798            query = query.arg("description", description);
15799        }
15800        if let Some(source_map) = opts.source_map {
15801            query = query.arg("sourceMap", source_map);
15802        }
15803        if let Some(deprecated) = opts.deprecated {
15804            query = query.arg("deprecated", deprecated);
15805        }
15806        TypeDef {
15807            proc: self.proc.clone(),
15808            selection: query,
15809            graphql_client: self.graphql_client.clone(),
15810        }
15811    }
15812    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
15813    ///
15814    /// # Arguments
15815    ///
15816    /// * `name` - The name of the field in the object
15817    /// * `type_def` - The type of the field
15818    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15819    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
15820        let mut query = self.selection.select("withField");
15821        query = query.arg("name", name.into());
15822        query = query.arg_lazy(
15823            "typeDef",
15824            Box::new(move || {
15825                let type_def = type_def.clone();
15826                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15827            }),
15828        );
15829        TypeDef {
15830            proc: self.proc.clone(),
15831            selection: query,
15832            graphql_client: self.graphql_client.clone(),
15833        }
15834    }
15835    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
15836    ///
15837    /// # Arguments
15838    ///
15839    /// * `name` - The name of the field in the object
15840    /// * `type_def` - The type of the field
15841    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15842    pub fn with_field_opts<'a>(
15843        &self,
15844        name: impl Into<String>,
15845        type_def: impl IntoID<Id>,
15846        opts: TypeDefWithFieldOpts<'a>,
15847    ) -> TypeDef {
15848        let mut query = self.selection.select("withField");
15849        query = query.arg("name", name.into());
15850        query = query.arg_lazy(
15851            "typeDef",
15852            Box::new(move || {
15853                let type_def = type_def.clone();
15854                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15855            }),
15856        );
15857        if let Some(description) = opts.description {
15858            query = query.arg("description", description);
15859        }
15860        if let Some(source_map) = opts.source_map {
15861            query = query.arg("sourceMap", source_map);
15862        }
15863        if let Some(deprecated) = opts.deprecated {
15864            query = query.arg("deprecated", deprecated);
15865        }
15866        TypeDef {
15867            proc: self.proc.clone(),
15868            selection: query,
15869            graphql_client: self.graphql_client.clone(),
15870        }
15871    }
15872    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
15873    pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
15874        let mut query = self.selection.select("withFunction");
15875        query = query.arg_lazy(
15876            "function",
15877            Box::new(move || {
15878                let function = function.clone();
15879                Box::pin(async move { function.into_id().await.unwrap().quote() })
15880            }),
15881        );
15882        TypeDef {
15883            proc: self.proc.clone(),
15884            selection: query,
15885            graphql_client: self.graphql_client.clone(),
15886        }
15887    }
15888    /// Returns a TypeDef of kind Interface with the provided name.
15889    ///
15890    /// # Arguments
15891    ///
15892    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15893    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
15894        let mut query = self.selection.select("withInterface");
15895        query = query.arg("name", name.into());
15896        TypeDef {
15897            proc: self.proc.clone(),
15898            selection: query,
15899            graphql_client: self.graphql_client.clone(),
15900        }
15901    }
15902    /// Returns a TypeDef of kind Interface with the provided name.
15903    ///
15904    /// # Arguments
15905    ///
15906    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15907    pub fn with_interface_opts<'a>(
15908        &self,
15909        name: impl Into<String>,
15910        opts: TypeDefWithInterfaceOpts<'a>,
15911    ) -> TypeDef {
15912        let mut query = self.selection.select("withInterface");
15913        query = query.arg("name", name.into());
15914        if let Some(description) = opts.description {
15915            query = query.arg("description", description);
15916        }
15917        if let Some(source_map) = opts.source_map {
15918            query = query.arg("sourceMap", source_map);
15919        }
15920        TypeDef {
15921            proc: self.proc.clone(),
15922            selection: query,
15923            graphql_client: self.graphql_client.clone(),
15924        }
15925    }
15926    /// Sets the kind of the type.
15927    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
15928        let mut query = self.selection.select("withKind");
15929        query = query.arg("kind", kind);
15930        TypeDef {
15931            proc: self.proc.clone(),
15932            selection: query,
15933            graphql_client: self.graphql_client.clone(),
15934        }
15935    }
15936    /// Returns a TypeDef of kind List with the provided type for its elements.
15937    pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
15938        let mut query = self.selection.select("withListOf");
15939        query = query.arg_lazy(
15940            "elementType",
15941            Box::new(move || {
15942                let element_type = element_type.clone();
15943                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
15944            }),
15945        );
15946        TypeDef {
15947            proc: self.proc.clone(),
15948            selection: query,
15949            graphql_client: self.graphql_client.clone(),
15950        }
15951    }
15952    /// Returns a TypeDef of kind Object with the provided name.
15953    /// 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.
15954    ///
15955    /// # Arguments
15956    ///
15957    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15958    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
15959        let mut query = self.selection.select("withObject");
15960        query = query.arg("name", name.into());
15961        TypeDef {
15962            proc: self.proc.clone(),
15963            selection: query,
15964            graphql_client: self.graphql_client.clone(),
15965        }
15966    }
15967    /// Returns a TypeDef of kind Object with the provided name.
15968    /// 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.
15969    ///
15970    /// # Arguments
15971    ///
15972    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15973    pub fn with_object_opts<'a>(
15974        &self,
15975        name: impl Into<String>,
15976        opts: TypeDefWithObjectOpts<'a>,
15977    ) -> TypeDef {
15978        let mut query = self.selection.select("withObject");
15979        query = query.arg("name", name.into());
15980        if let Some(description) = opts.description {
15981            query = query.arg("description", description);
15982        }
15983        if let Some(source_map) = opts.source_map {
15984            query = query.arg("sourceMap", source_map);
15985        }
15986        if let Some(deprecated) = opts.deprecated {
15987            query = query.arg("deprecated", deprecated);
15988        }
15989        TypeDef {
15990            proc: self.proc.clone(),
15991            selection: query,
15992            graphql_client: self.graphql_client.clone(),
15993        }
15994    }
15995    /// Sets whether this type can be set to null.
15996    pub fn with_optional(&self, optional: bool) -> TypeDef {
15997        let mut query = self.selection.select("withOptional");
15998        query = query.arg("optional", optional);
15999        TypeDef {
16000            proc: self.proc.clone(),
16001            selection: query,
16002            graphql_client: self.graphql_client.clone(),
16003        }
16004    }
16005    /// Returns a TypeDef of kind Scalar with the provided name.
16006    ///
16007    /// # Arguments
16008    ///
16009    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16010    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
16011        let mut query = self.selection.select("withScalar");
16012        query = query.arg("name", name.into());
16013        TypeDef {
16014            proc: self.proc.clone(),
16015            selection: query,
16016            graphql_client: self.graphql_client.clone(),
16017        }
16018    }
16019    /// Returns a TypeDef of kind Scalar with the provided name.
16020    ///
16021    /// # Arguments
16022    ///
16023    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16024    pub fn with_scalar_opts<'a>(
16025        &self,
16026        name: impl Into<String>,
16027        opts: TypeDefWithScalarOpts<'a>,
16028    ) -> TypeDef {
16029        let mut query = self.selection.select("withScalar");
16030        query = query.arg("name", name.into());
16031        if let Some(description) = opts.description {
16032            query = query.arg("description", description);
16033        }
16034        TypeDef {
16035            proc: self.proc.clone(),
16036            selection: query,
16037            graphql_client: self.graphql_client.clone(),
16038        }
16039    }
16040}
16041impl Node for TypeDef {
16042    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16043        let query = self.selection.select("id");
16044        let graphql_client = self.graphql_client.clone();
16045        async move { query.execute(graphql_client).await }
16046    }
16047}
16048#[derive(Clone)]
16049pub struct Up {
16050    pub proc: Option<Arc<DaggerSessionProc>>,
16051    pub selection: Selection,
16052    pub graphql_client: DynGraphQLClient,
16053}
16054impl IntoID<Id> for Up {
16055    fn into_id(
16056        self,
16057    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16058        Box::pin(async move { self.id().await })
16059    }
16060}
16061impl Loadable for Up {
16062    fn graphql_type() -> &'static str {
16063        "Up"
16064    }
16065    fn from_query(
16066        proc: Option<Arc<DaggerSessionProc>>,
16067        selection: Selection,
16068        graphql_client: DynGraphQLClient,
16069    ) -> Self {
16070        Self {
16071            proc,
16072            selection,
16073            graphql_client,
16074        }
16075    }
16076}
16077impl Up {
16078    /// The description of the service
16079    pub async fn description(&self) -> Result<String, DaggerError> {
16080        let query = self.selection.select("description");
16081        query.execute(self.graphql_client.clone()).await
16082    }
16083    /// A unique identifier for this Up.
16084    pub async fn id(&self) -> Result<Id, DaggerError> {
16085        let query = self.selection.select("id");
16086        query.execute(self.graphql_client.clone()).await
16087    }
16088    /// Return the fully qualified name of the service
16089    pub async fn name(&self) -> Result<String, DaggerError> {
16090        let query = self.selection.select("name");
16091        query.execute(self.graphql_client.clone()).await
16092    }
16093    /// The original module in which the service has been defined
16094    pub fn original_module(&self) -> Module {
16095        let query = self.selection.select("originalModule");
16096        Module {
16097            proc: self.proc.clone(),
16098            selection: query,
16099            graphql_client: self.graphql_client.clone(),
16100        }
16101    }
16102    /// The path of the service within its module
16103    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
16104        let query = self.selection.select("path");
16105        query.execute(self.graphql_client.clone()).await
16106    }
16107    /// Execute the service function
16108    pub fn run(&self) -> Up {
16109        let query = self.selection.select("run");
16110        Up {
16111            proc: self.proc.clone(),
16112            selection: query,
16113            graphql_client: self.graphql_client.clone(),
16114        }
16115    }
16116}
16117impl Node for Up {
16118    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16119        let query = self.selection.select("id");
16120        let graphql_client = self.graphql_client.clone();
16121        async move { query.execute(graphql_client).await }
16122    }
16123}
16124#[derive(Clone)]
16125pub struct UpGroup {
16126    pub proc: Option<Arc<DaggerSessionProc>>,
16127    pub selection: Selection,
16128    pub graphql_client: DynGraphQLClient,
16129}
16130impl IntoID<Id> for UpGroup {
16131    fn into_id(
16132        self,
16133    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16134        Box::pin(async move { self.id().await })
16135    }
16136}
16137impl Loadable for UpGroup {
16138    fn graphql_type() -> &'static str {
16139        "UpGroup"
16140    }
16141    fn from_query(
16142        proc: Option<Arc<DaggerSessionProc>>,
16143        selection: Selection,
16144        graphql_client: DynGraphQLClient,
16145    ) -> Self {
16146        Self {
16147            proc,
16148            selection,
16149            graphql_client,
16150        }
16151    }
16152}
16153impl UpGroup {
16154    /// A unique identifier for this UpGroup.
16155    pub async fn id(&self) -> Result<Id, DaggerError> {
16156        let query = self.selection.select("id");
16157        query.execute(self.graphql_client.clone()).await
16158    }
16159    /// Return a list of individual services and their details
16160    pub async fn list(&self) -> Result<Vec<Up>, DaggerError> {
16161        let query = self.selection.select("list");
16162        let query = query.select("id");
16163        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16164        Ok(ids
16165            .into_iter()
16166            .map(|id| Up {
16167                proc: self.proc.clone(),
16168                selection: crate::querybuilder::query()
16169                    .select("node")
16170                    .arg("id", &id.0)
16171                    .inline_fragment("Up"),
16172                graphql_client: self.graphql_client.clone(),
16173            })
16174            .collect())
16175    }
16176    /// Execute all selected service functions
16177    pub fn run(&self) -> UpGroup {
16178        let query = self.selection.select("run");
16179        UpGroup {
16180            proc: self.proc.clone(),
16181            selection: query,
16182            graphql_client: self.graphql_client.clone(),
16183        }
16184    }
16185}
16186impl Node for UpGroup {
16187    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16188        let query = self.selection.select("id");
16189        let graphql_client = self.graphql_client.clone();
16190        async move { query.execute(graphql_client).await }
16191    }
16192}
16193#[derive(Clone)]
16194pub struct Workspace {
16195    pub proc: Option<Arc<DaggerSessionProc>>,
16196    pub selection: Selection,
16197    pub graphql_client: DynGraphQLClient,
16198}
16199#[derive(Builder, Debug, PartialEq)]
16200pub struct WorkspaceChecksOpts<'a> {
16201    /// Only include checks matching the specified patterns
16202    #[builder(setter(into, strip_option), default)]
16203    pub include: Option<Vec<&'a str>>,
16204    /// When true, only return annotated check functions; exclude generate-as-checks
16205    #[builder(setter(into, strip_option), default)]
16206    pub no_generate: Option<bool>,
16207    /// When true, only return generate-as-checks; exclude annotated check functions
16208    #[builder(setter(into, strip_option), default)]
16209    pub only_generate: Option<bool>,
16210}
16211#[derive(Builder, Debug, PartialEq)]
16212pub struct WorkspaceDirectoryOpts<'a> {
16213    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
16214    #[builder(setter(into, strip_option), default)]
16215    pub exclude: Option<Vec<&'a str>>,
16216    /// Apply .gitignore filter rules inside the directory.
16217    #[builder(setter(into, strip_option), default)]
16218    pub gitignore: Option<bool>,
16219    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
16220    #[builder(setter(into, strip_option), default)]
16221    pub include: Option<Vec<&'a str>>,
16222}
16223#[derive(Builder, Debug, PartialEq)]
16224pub struct WorkspaceFindUpOpts<'a> {
16225    /// Path to start the search from. Relative paths resolve from the workspace directory; absolute paths resolve from the workspace boundary.
16226    #[builder(setter(into, strip_option), default)]
16227    pub from: Option<&'a str>,
16228}
16229#[derive(Builder, Debug, PartialEq)]
16230pub struct WorkspaceGeneratorsOpts<'a> {
16231    /// Only include generators matching the specified patterns
16232    #[builder(setter(into, strip_option), default)]
16233    pub include: Option<Vec<&'a str>>,
16234}
16235#[derive(Builder, Debug, PartialEq)]
16236pub struct WorkspaceServicesOpts<'a> {
16237    /// Only include services matching the specified patterns
16238    #[builder(setter(into, strip_option), default)]
16239    pub include: Option<Vec<&'a str>>,
16240}
16241impl IntoID<Id> for Workspace {
16242    fn into_id(
16243        self,
16244    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16245        Box::pin(async move { self.id().await })
16246    }
16247}
16248impl Loadable for Workspace {
16249    fn graphql_type() -> &'static str {
16250        "Workspace"
16251    }
16252    fn from_query(
16253        proc: Option<Arc<DaggerSessionProc>>,
16254        selection: Selection,
16255        graphql_client: DynGraphQLClient,
16256    ) -> Self {
16257        Self {
16258            proc,
16259            selection,
16260            graphql_client,
16261        }
16262    }
16263}
16264impl Workspace {
16265    /// Canonical Dagger address of the workspace directory.
16266    pub async fn address(&self) -> Result<String, DaggerError> {
16267        let query = self.selection.select("address");
16268        query.execute(self.graphql_client.clone()).await
16269    }
16270    /// Return all checks from modules loaded in the workspace.
16271    ///
16272    /// # Arguments
16273    ///
16274    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16275    pub fn checks(&self) -> CheckGroup {
16276        let query = self.selection.select("checks");
16277        CheckGroup {
16278            proc: self.proc.clone(),
16279            selection: query,
16280            graphql_client: self.graphql_client.clone(),
16281        }
16282    }
16283    /// Return all checks from modules loaded in the workspace.
16284    ///
16285    /// # Arguments
16286    ///
16287    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16288    pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
16289        let mut query = self.selection.select("checks");
16290        if let Some(include) = opts.include {
16291            query = query.arg("include", include);
16292        }
16293        if let Some(no_generate) = opts.no_generate {
16294            query = query.arg("noGenerate", no_generate);
16295        }
16296        if let Some(only_generate) = opts.only_generate {
16297            query = query.arg("onlyGenerate", only_generate);
16298        }
16299        CheckGroup {
16300            proc: self.proc.clone(),
16301            selection: query,
16302            graphql_client: self.graphql_client.clone(),
16303        }
16304    }
16305    /// The client ID that owns this workspace's host filesystem.
16306    pub async fn client_id(&self) -> Result<String, DaggerError> {
16307        let query = self.selection.select("clientId");
16308        query.execute(self.graphql_client.clone()).await
16309    }
16310    /// Path to config.toml relative to the workspace boundary (empty if not initialized).
16311    pub async fn config_path(&self) -> Result<String, DaggerError> {
16312        let query = self.selection.select("configPath");
16313        query.execute(self.graphql_client.clone()).await
16314    }
16315    /// Returns a Directory from the workspace.
16316    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
16317    ///
16318    /// # Arguments
16319    ///
16320    /// * `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.
16321    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16322    pub fn directory(&self, path: impl Into<String>) -> Directory {
16323        let mut query = self.selection.select("directory");
16324        query = query.arg("path", path.into());
16325        Directory {
16326            proc: self.proc.clone(),
16327            selection: query,
16328            graphql_client: self.graphql_client.clone(),
16329        }
16330    }
16331    /// Returns a Directory from the workspace.
16332    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
16333    ///
16334    /// # Arguments
16335    ///
16336    /// * `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.
16337    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16338    pub fn directory_opts<'a>(
16339        &self,
16340        path: impl Into<String>,
16341        opts: WorkspaceDirectoryOpts<'a>,
16342    ) -> Directory {
16343        let mut query = self.selection.select("directory");
16344        query = query.arg("path", path.into());
16345        if let Some(exclude) = opts.exclude {
16346            query = query.arg("exclude", exclude);
16347        }
16348        if let Some(include) = opts.include {
16349            query = query.arg("include", include);
16350        }
16351        if let Some(gitignore) = opts.gitignore {
16352            query = query.arg("gitignore", gitignore);
16353        }
16354        Directory {
16355            proc: self.proc.clone(),
16356            selection: query,
16357            graphql_client: self.graphql_client.clone(),
16358        }
16359    }
16360    /// Returns a File from the workspace.
16361    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
16362    ///
16363    /// # Arguments
16364    ///
16365    /// * `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.
16366    pub fn file(&self, path: impl Into<String>) -> File {
16367        let mut query = self.selection.select("file");
16368        query = query.arg("path", path.into());
16369        File {
16370            proc: self.proc.clone(),
16371            selection: query,
16372            graphql_client: self.graphql_client.clone(),
16373        }
16374    }
16375    /// Search for a file or directory by walking up from the start path within the workspace.
16376    /// Returns the absolute workspace path if found, or null if not found.
16377    /// Relative start paths resolve from the workspace directory.
16378    /// The search stops at the workspace boundary and will not traverse above it.
16379    ///
16380    /// # Arguments
16381    ///
16382    /// * `name` - The name of the file or directory to search for.
16383    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16384    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
16385        let mut query = self.selection.select("findUp");
16386        query = query.arg("name", name.into());
16387        query.execute(self.graphql_client.clone()).await
16388    }
16389    /// Search for a file or directory by walking up from the start path within the workspace.
16390    /// Returns the absolute workspace path if found, or null if not found.
16391    /// Relative start paths resolve from the workspace directory.
16392    /// The search stops at the workspace boundary and will not traverse above it.
16393    ///
16394    /// # Arguments
16395    ///
16396    /// * `name` - The name of the file or directory to search for.
16397    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16398    pub async fn find_up_opts<'a>(
16399        &self,
16400        name: impl Into<String>,
16401        opts: WorkspaceFindUpOpts<'a>,
16402    ) -> Result<String, DaggerError> {
16403        let mut query = self.selection.select("findUp");
16404        query = query.arg("name", name.into());
16405        if let Some(from) = opts.from {
16406            query = query.arg("from", from);
16407        }
16408        query.execute(self.graphql_client.clone()).await
16409    }
16410    /// Return all generators from modules loaded in the workspace.
16411    ///
16412    /// # Arguments
16413    ///
16414    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16415    pub fn generators(&self) -> GeneratorGroup {
16416        let query = self.selection.select("generators");
16417        GeneratorGroup {
16418            proc: self.proc.clone(),
16419            selection: query,
16420            graphql_client: self.graphql_client.clone(),
16421        }
16422    }
16423    /// Return all generators from modules loaded in the workspace.
16424    ///
16425    /// # Arguments
16426    ///
16427    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16428    pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
16429        let mut query = self.selection.select("generators");
16430        if let Some(include) = opts.include {
16431            query = query.arg("include", include);
16432        }
16433        GeneratorGroup {
16434            proc: self.proc.clone(),
16435            selection: query,
16436            graphql_client: self.graphql_client.clone(),
16437        }
16438    }
16439    /// Whether a config.toml file exists in the workspace.
16440    pub async fn has_config(&self) -> Result<bool, DaggerError> {
16441        let query = self.selection.select("hasConfig");
16442        query.execute(self.graphql_client.clone()).await
16443    }
16444    /// A unique identifier for this Workspace.
16445    pub async fn id(&self) -> Result<Id, DaggerError> {
16446        let query = self.selection.select("id");
16447        query.execute(self.graphql_client.clone()).await
16448    }
16449    /// Whether .dagger/config.toml exists.
16450    pub async fn initialized(&self) -> Result<bool, DaggerError> {
16451        let query = self.selection.select("initialized");
16452        query.execute(self.graphql_client.clone()).await
16453    }
16454    /// Workspace directory path relative to the workspace boundary.
16455    pub async fn path(&self) -> Result<String, DaggerError> {
16456        let query = self.selection.select("path");
16457        query.execute(self.graphql_client.clone()).await
16458    }
16459    /// Return all services from modules loaded in the workspace.
16460    ///
16461    /// # Arguments
16462    ///
16463    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16464    pub fn services(&self) -> UpGroup {
16465        let query = self.selection.select("services");
16466        UpGroup {
16467            proc: self.proc.clone(),
16468            selection: query,
16469            graphql_client: self.graphql_client.clone(),
16470        }
16471    }
16472    /// Return all services from modules loaded in the workspace.
16473    ///
16474    /// # Arguments
16475    ///
16476    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16477    pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
16478        let mut query = self.selection.select("services");
16479        if let Some(include) = opts.include {
16480            query = query.arg("include", include);
16481        }
16482        UpGroup {
16483            proc: self.proc.clone(),
16484            selection: query,
16485            graphql_client: self.graphql_client.clone(),
16486        }
16487    }
16488    /// Refresh workspace-managed state and return the resulting changeset.
16489    /// Currently this refreshes existing lockfile entries only.
16490    pub fn update(&self) -> Changeset {
16491        let query = self.selection.select("update");
16492        Changeset {
16493            proc: self.proc.clone(),
16494            selection: query,
16495            graphql_client: self.graphql_client.clone(),
16496        }
16497    }
16498}
16499impl Node for Workspace {
16500    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16501        let query = self.selection.select("id");
16502        let graphql_client = self.graphql_client.clone();
16503        async move { query.execute(graphql_client).await }
16504    }
16505}
16506#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16507pub enum CacheSharingMode {
16508    #[serde(rename = "LOCKED")]
16509    Locked,
16510    #[serde(rename = "PRIVATE")]
16511    Private,
16512    #[serde(rename = "SHARED")]
16513    Shared,
16514}
16515#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16516pub enum ChangesetMergeConflict {
16517    #[serde(rename = "FAIL")]
16518    Fail,
16519    #[serde(rename = "FAIL_EARLY")]
16520    FailEarly,
16521    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
16522    LeaveConflictMarkers,
16523    #[serde(rename = "PREFER_OURS")]
16524    PreferOurs,
16525    #[serde(rename = "PREFER_THEIRS")]
16526    PreferTheirs,
16527}
16528#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16529pub enum ChangesetsMergeConflict {
16530    #[serde(rename = "FAIL")]
16531    Fail,
16532    #[serde(rename = "FAIL_EARLY")]
16533    FailEarly,
16534}
16535#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16536pub enum DiffStatKind {
16537    #[serde(rename = "ADDED")]
16538    Added,
16539    #[serde(rename = "MODIFIED")]
16540    Modified,
16541    #[serde(rename = "REMOVED")]
16542    Removed,
16543    #[serde(rename = "RENAMED")]
16544    Renamed,
16545}
16546#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16547pub enum ExistsType {
16548    #[serde(rename = "DIRECTORY_TYPE")]
16549    DirectoryType,
16550    #[serde(rename = "REGULAR_TYPE")]
16551    RegularType,
16552    #[serde(rename = "SYMLINK_TYPE")]
16553    SymlinkType,
16554}
16555#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16556pub enum FileType {
16557    #[serde(rename = "DIRECTORY")]
16558    Directory,
16559    #[serde(rename = "DIRECTORY_TYPE")]
16560    DirectoryType,
16561    #[serde(rename = "REGULAR")]
16562    Regular,
16563    #[serde(rename = "REGULAR_TYPE")]
16564    RegularType,
16565    #[serde(rename = "SYMLINK")]
16566    Symlink,
16567    #[serde(rename = "SYMLINK_TYPE")]
16568    SymlinkType,
16569    #[serde(rename = "UNKNOWN")]
16570    Unknown,
16571}
16572#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16573pub enum FunctionCachePolicy {
16574    #[serde(rename = "Default")]
16575    Default,
16576    #[serde(rename = "Never")]
16577    Never,
16578    #[serde(rename = "PerSession")]
16579    PerSession,
16580}
16581#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16582pub enum ImageLayerCompression {
16583    #[serde(rename = "EStarGZ")]
16584    EStarGz,
16585    #[serde(rename = "ESTARGZ")]
16586    Estargz,
16587    #[serde(rename = "Gzip")]
16588    Gzip,
16589    #[serde(rename = "Uncompressed")]
16590    Uncompressed,
16591    #[serde(rename = "Zstd")]
16592    Zstd,
16593}
16594#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16595pub enum ImageMediaTypes {
16596    #[serde(rename = "DOCKER")]
16597    Docker,
16598    #[serde(rename = "DockerMediaTypes")]
16599    DockerMediaTypes,
16600    #[serde(rename = "OCI")]
16601    Oci,
16602    #[serde(rename = "OCIMediaTypes")]
16603    OciMediaTypes,
16604}
16605#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16606pub enum ModuleSourceExperimentalFeature {
16607    #[serde(rename = "SELF_CALLS")]
16608    SelfCalls,
16609}
16610#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16611pub enum ModuleSourceKind {
16612    #[serde(rename = "DIR")]
16613    Dir,
16614    #[serde(rename = "DIR_SOURCE")]
16615    DirSource,
16616    #[serde(rename = "GIT")]
16617    Git,
16618    #[serde(rename = "GIT_SOURCE")]
16619    GitSource,
16620    #[serde(rename = "LOCAL")]
16621    Local,
16622    #[serde(rename = "LOCAL_SOURCE")]
16623    LocalSource,
16624}
16625#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16626pub enum NetworkProtocol {
16627    #[serde(rename = "TCP")]
16628    Tcp,
16629    #[serde(rename = "UDP")]
16630    Udp,
16631}
16632#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16633pub enum ReturnType {
16634    #[serde(rename = "ANY")]
16635    Any,
16636    #[serde(rename = "FAILURE")]
16637    Failure,
16638    #[serde(rename = "SUCCESS")]
16639    Success,
16640}
16641#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16642pub enum TypeDefKind {
16643    #[serde(rename = "BOOLEAN")]
16644    Boolean,
16645    #[serde(rename = "BOOLEAN_KIND")]
16646    BooleanKind,
16647    #[serde(rename = "ENUM")]
16648    Enum,
16649    #[serde(rename = "ENUM_KIND")]
16650    EnumKind,
16651    #[serde(rename = "FLOAT")]
16652    Float,
16653    #[serde(rename = "FLOAT_KIND")]
16654    FloatKind,
16655    #[serde(rename = "INPUT")]
16656    Input,
16657    #[serde(rename = "INPUT_KIND")]
16658    InputKind,
16659    #[serde(rename = "INTEGER")]
16660    Integer,
16661    #[serde(rename = "INTEGER_KIND")]
16662    IntegerKind,
16663    #[serde(rename = "INTERFACE")]
16664    Interface,
16665    #[serde(rename = "INTERFACE_KIND")]
16666    InterfaceKind,
16667    #[serde(rename = "LIST")]
16668    List,
16669    #[serde(rename = "LIST_KIND")]
16670    ListKind,
16671    #[serde(rename = "OBJECT")]
16672    Object,
16673    #[serde(rename = "OBJECT_KIND")]
16674    ObjectKind,
16675    #[serde(rename = "SCALAR")]
16676    Scalar,
16677    #[serde(rename = "SCALAR_KIND")]
16678    ScalarKind,
16679    #[serde(rename = "STRING")]
16680    String,
16681    #[serde(rename = "STRING_KIND")]
16682    StringKind,
16683    #[serde(rename = "VOID")]
16684    Void,
16685    #[serde(rename = "VOID_KIND")]
16686    VoidKind,
16687}