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 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 environment variables passed to commands.
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    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3799    ///
3800    /// # Arguments
3801    ///
3802    /// * `path` - The path to set as the working directory (e.g., "/app").
3803    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3804    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3805        let mut query = self.selection.select("withWorkdir");
3806        query = query.arg("path", path.into());
3807        Container {
3808            proc: self.proc.clone(),
3809            selection: query,
3810            graphql_client: self.graphql_client.clone(),
3811        }
3812    }
3813    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3814    ///
3815    /// # Arguments
3816    ///
3817    /// * `path` - The path to set as the working directory (e.g., "/app").
3818    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3819    pub fn with_workdir_opts(
3820        &self,
3821        path: impl Into<String>,
3822        opts: ContainerWithWorkdirOpts,
3823    ) -> Container {
3824        let mut query = self.selection.select("withWorkdir");
3825        query = query.arg("path", path.into());
3826        if let Some(expand) = opts.expand {
3827            query = query.arg("expand", expand);
3828        }
3829        Container {
3830            proc: self.proc.clone(),
3831            selection: query,
3832            graphql_client: self.graphql_client.clone(),
3833        }
3834    }
3835    /// Retrieves this container minus the given OCI annotation.
3836    ///
3837    /// # Arguments
3838    ///
3839    /// * `name` - The name of the annotation.
3840    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3841        let mut query = self.selection.select("withoutAnnotation");
3842        query = query.arg("name", name.into());
3843        Container {
3844            proc: self.proc.clone(),
3845            selection: query,
3846            graphql_client: self.graphql_client.clone(),
3847        }
3848    }
3849    /// Remove the container's default arguments.
3850    pub fn without_default_args(&self) -> Container {
3851        let query = self.selection.select("withoutDefaultArgs");
3852        Container {
3853            proc: self.proc.clone(),
3854            selection: query,
3855            graphql_client: self.graphql_client.clone(),
3856        }
3857    }
3858    /// Return a new container snapshot, with a directory removed from its filesystem
3859    ///
3860    /// # Arguments
3861    ///
3862    /// * `path` - Location of the directory to remove (e.g., ".github/").
3863    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3864    pub fn without_directory(&self, path: impl Into<String>) -> Container {
3865        let mut query = self.selection.select("withoutDirectory");
3866        query = query.arg("path", path.into());
3867        Container {
3868            proc: self.proc.clone(),
3869            selection: query,
3870            graphql_client: self.graphql_client.clone(),
3871        }
3872    }
3873    /// Return a new container snapshot, with a directory removed from its filesystem
3874    ///
3875    /// # Arguments
3876    ///
3877    /// * `path` - Location of the directory to remove (e.g., ".github/").
3878    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3879    pub fn without_directory_opts(
3880        &self,
3881        path: impl Into<String>,
3882        opts: ContainerWithoutDirectoryOpts,
3883    ) -> Container {
3884        let mut query = self.selection.select("withoutDirectory");
3885        query = query.arg("path", path.into());
3886        if let Some(expand) = opts.expand {
3887            query = query.arg("expand", expand);
3888        }
3889        Container {
3890            proc: self.proc.clone(),
3891            selection: query,
3892            graphql_client: self.graphql_client.clone(),
3893        }
3894    }
3895    /// Retrieves this container without a configured docker healtcheck command.
3896    pub fn without_docker_healthcheck(&self) -> Container {
3897        let query = self.selection.select("withoutDockerHealthcheck");
3898        Container {
3899            proc: self.proc.clone(),
3900            selection: query,
3901            graphql_client: self.graphql_client.clone(),
3902        }
3903    }
3904    /// Reset the container's OCI entrypoint.
3905    ///
3906    /// # Arguments
3907    ///
3908    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3909    pub fn without_entrypoint(&self) -> Container {
3910        let query = self.selection.select("withoutEntrypoint");
3911        Container {
3912            proc: self.proc.clone(),
3913            selection: query,
3914            graphql_client: self.graphql_client.clone(),
3915        }
3916    }
3917    /// Reset the container's OCI entrypoint.
3918    ///
3919    /// # Arguments
3920    ///
3921    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3922    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
3923        let mut query = self.selection.select("withoutEntrypoint");
3924        if let Some(keep_default_args) = opts.keep_default_args {
3925            query = query.arg("keepDefaultArgs", keep_default_args);
3926        }
3927        Container {
3928            proc: self.proc.clone(),
3929            selection: query,
3930            graphql_client: self.graphql_client.clone(),
3931        }
3932    }
3933    /// Retrieves this container minus the given environment variable.
3934    ///
3935    /// # Arguments
3936    ///
3937    /// * `name` - The name of the environment variable (e.g., "HOST").
3938    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
3939        let mut query = self.selection.select("withoutEnvVariable");
3940        query = query.arg("name", name.into());
3941        Container {
3942            proc: self.proc.clone(),
3943            selection: query,
3944            graphql_client: self.graphql_client.clone(),
3945        }
3946    }
3947    /// Unexpose a previously exposed port.
3948    ///
3949    /// # Arguments
3950    ///
3951    /// * `port` - Port number to unexpose
3952    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3953    pub fn without_exposed_port(&self, port: isize) -> Container {
3954        let mut query = self.selection.select("withoutExposedPort");
3955        query = query.arg("port", port);
3956        Container {
3957            proc: self.proc.clone(),
3958            selection: query,
3959            graphql_client: self.graphql_client.clone(),
3960        }
3961    }
3962    /// Unexpose a previously exposed port.
3963    ///
3964    /// # Arguments
3965    ///
3966    /// * `port` - Port number to unexpose
3967    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3968    pub fn without_exposed_port_opts(
3969        &self,
3970        port: isize,
3971        opts: ContainerWithoutExposedPortOpts,
3972    ) -> Container {
3973        let mut query = self.selection.select("withoutExposedPort");
3974        query = query.arg("port", port);
3975        if let Some(protocol) = opts.protocol {
3976            query = query.arg("protocol", protocol);
3977        }
3978        Container {
3979            proc: self.proc.clone(),
3980            selection: query,
3981            graphql_client: self.graphql_client.clone(),
3982        }
3983    }
3984    /// Retrieves this container with the file at the given path removed.
3985    ///
3986    /// # Arguments
3987    ///
3988    /// * `path` - Location of the file to remove (e.g., "/file.txt").
3989    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3990    pub fn without_file(&self, path: impl Into<String>) -> Container {
3991        let mut query = self.selection.select("withoutFile");
3992        query = query.arg("path", path.into());
3993        Container {
3994            proc: self.proc.clone(),
3995            selection: query,
3996            graphql_client: self.graphql_client.clone(),
3997        }
3998    }
3999    /// Retrieves this container with the file at the given path removed.
4000    ///
4001    /// # Arguments
4002    ///
4003    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4004    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4005    pub fn without_file_opts(
4006        &self,
4007        path: impl Into<String>,
4008        opts: ContainerWithoutFileOpts,
4009    ) -> Container {
4010        let mut query = self.selection.select("withoutFile");
4011        query = query.arg("path", path.into());
4012        if let Some(expand) = opts.expand {
4013            query = query.arg("expand", expand);
4014        }
4015        Container {
4016            proc: self.proc.clone(),
4017            selection: query,
4018            graphql_client: self.graphql_client.clone(),
4019        }
4020    }
4021    /// Return a new container spanshot with specified files removed
4022    ///
4023    /// # Arguments
4024    ///
4025    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4026    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4027    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4028        let mut query = self.selection.select("withoutFiles");
4029        query = query.arg(
4030            "paths",
4031            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4032        );
4033        Container {
4034            proc: self.proc.clone(),
4035            selection: query,
4036            graphql_client: self.graphql_client.clone(),
4037        }
4038    }
4039    /// Return a new container spanshot with specified files removed
4040    ///
4041    /// # Arguments
4042    ///
4043    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4044    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4045    pub fn without_files_opts(
4046        &self,
4047        paths: Vec<impl Into<String>>,
4048        opts: ContainerWithoutFilesOpts,
4049    ) -> Container {
4050        let mut query = self.selection.select("withoutFiles");
4051        query = query.arg(
4052            "paths",
4053            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4054        );
4055        if let Some(expand) = opts.expand {
4056            query = query.arg("expand", expand);
4057        }
4058        Container {
4059            proc: self.proc.clone(),
4060            selection: query,
4061            graphql_client: self.graphql_client.clone(),
4062        }
4063    }
4064    /// Retrieves this container minus the given environment label.
4065    ///
4066    /// # Arguments
4067    ///
4068    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4069    pub fn without_label(&self, name: impl Into<String>) -> Container {
4070        let mut query = self.selection.select("withoutLabel");
4071        query = query.arg("name", name.into());
4072        Container {
4073            proc: self.proc.clone(),
4074            selection: query,
4075            graphql_client: self.graphql_client.clone(),
4076        }
4077    }
4078    /// Retrieves this container after unmounting everything at the given path.
4079    ///
4080    /// # Arguments
4081    ///
4082    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4083    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4084    pub fn without_mount(&self, path: impl Into<String>) -> Container {
4085        let mut query = self.selection.select("withoutMount");
4086        query = query.arg("path", path.into());
4087        Container {
4088            proc: self.proc.clone(),
4089            selection: query,
4090            graphql_client: self.graphql_client.clone(),
4091        }
4092    }
4093    /// Retrieves this container after unmounting everything at the given path.
4094    ///
4095    /// # Arguments
4096    ///
4097    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4098    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4099    pub fn without_mount_opts(
4100        &self,
4101        path: impl Into<String>,
4102        opts: ContainerWithoutMountOpts,
4103    ) -> Container {
4104        let mut query = self.selection.select("withoutMount");
4105        query = query.arg("path", path.into());
4106        if let Some(expand) = opts.expand {
4107            query = query.arg("expand", expand);
4108        }
4109        Container {
4110            proc: self.proc.clone(),
4111            selection: query,
4112            graphql_client: self.graphql_client.clone(),
4113        }
4114    }
4115    /// Retrieves this container without the registry authentication of a given address.
4116    ///
4117    /// # Arguments
4118    ///
4119    /// * `address` - Registry's address to remove the authentication from.
4120    ///
4121    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
4122    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4123        let mut query = self.selection.select("withoutRegistryAuth");
4124        query = query.arg("address", address.into());
4125        Container {
4126            proc: self.proc.clone(),
4127            selection: query,
4128            graphql_client: self.graphql_client.clone(),
4129        }
4130    }
4131    /// Retrieves this container minus the given environment variable containing the secret.
4132    ///
4133    /// # Arguments
4134    ///
4135    /// * `name` - The name of the environment variable (e.g., "HOST").
4136    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4137        let mut query = self.selection.select("withoutSecretVariable");
4138        query = query.arg("name", name.into());
4139        Container {
4140            proc: self.proc.clone(),
4141            selection: query,
4142            graphql_client: self.graphql_client.clone(),
4143        }
4144    }
4145    /// Retrieves this container with a previously added Unix socket removed.
4146    ///
4147    /// # Arguments
4148    ///
4149    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4150    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4151    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4152        let mut query = self.selection.select("withoutUnixSocket");
4153        query = query.arg("path", path.into());
4154        Container {
4155            proc: self.proc.clone(),
4156            selection: query,
4157            graphql_client: self.graphql_client.clone(),
4158        }
4159    }
4160    /// Retrieves this container with a previously added Unix socket removed.
4161    ///
4162    /// # Arguments
4163    ///
4164    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4165    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4166    pub fn without_unix_socket_opts(
4167        &self,
4168        path: impl Into<String>,
4169        opts: ContainerWithoutUnixSocketOpts,
4170    ) -> Container {
4171        let mut query = self.selection.select("withoutUnixSocket");
4172        query = query.arg("path", path.into());
4173        if let Some(expand) = opts.expand {
4174            query = query.arg("expand", expand);
4175        }
4176        Container {
4177            proc: self.proc.clone(),
4178            selection: query,
4179            graphql_client: self.graphql_client.clone(),
4180        }
4181    }
4182    /// Retrieves this container with an unset command user.
4183    /// Should default to root.
4184    pub fn without_user(&self) -> Container {
4185        let query = self.selection.select("withoutUser");
4186        Container {
4187            proc: self.proc.clone(),
4188            selection: query,
4189            graphql_client: self.graphql_client.clone(),
4190        }
4191    }
4192    /// Unset the container's working directory.
4193    /// Should default to "/".
4194    pub fn without_workdir(&self) -> Container {
4195        let query = self.selection.select("withoutWorkdir");
4196        Container {
4197            proc: self.proc.clone(),
4198            selection: query,
4199            graphql_client: self.graphql_client.clone(),
4200        }
4201    }
4202    /// Retrieves the working directory for all commands.
4203    pub async fn workdir(&self) -> Result<String, DaggerError> {
4204        let query = self.selection.select("workdir");
4205        query.execute(self.graphql_client.clone()).await
4206    }
4207}
4208impl Exportable for Container {
4209    fn export(
4210        &self,
4211        path: impl Into<String>,
4212    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
4213        let mut query = self.selection.select("export");
4214        query = query.arg("path", path.into());
4215        let graphql_client = self.graphql_client.clone();
4216        async move { query.execute(graphql_client).await }
4217    }
4218    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4219        let query = self.selection.select("id");
4220        let graphql_client = self.graphql_client.clone();
4221        async move { query.execute(graphql_client).await }
4222    }
4223}
4224impl Node for Container {
4225    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4226        let query = self.selection.select("id");
4227        let graphql_client = self.graphql_client.clone();
4228        async move { query.execute(graphql_client).await }
4229    }
4230}
4231impl Syncer for Container {
4232    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4233        let query = self.selection.select("id");
4234        let graphql_client = self.graphql_client.clone();
4235        async move { query.execute(graphql_client).await }
4236    }
4237    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4238        let query = self.selection.select("sync");
4239        let graphql_client = self.graphql_client.clone();
4240        async move { query.execute(graphql_client).await }
4241    }
4242}
4243#[derive(Clone)]
4244pub struct CurrentModule {
4245    pub proc: Option<Arc<DaggerSessionProc>>,
4246    pub selection: Selection,
4247    pub graphql_client: DynGraphQLClient,
4248}
4249#[derive(Builder, Debug, PartialEq)]
4250pub struct CurrentModuleGeneratorsOpts<'a> {
4251    /// Only include generators matching the specified patterns
4252    #[builder(setter(into, strip_option), default)]
4253    pub include: Option<Vec<&'a str>>,
4254}
4255#[derive(Builder, Debug, PartialEq)]
4256pub struct CurrentModuleWorkdirOpts<'a> {
4257    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4258    #[builder(setter(into, strip_option), default)]
4259    pub exclude: Option<Vec<&'a str>>,
4260    /// Apply .gitignore filter rules inside the directory
4261    #[builder(setter(into, strip_option), default)]
4262    pub gitignore: Option<bool>,
4263    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4264    #[builder(setter(into, strip_option), default)]
4265    pub include: Option<Vec<&'a str>>,
4266}
4267impl IntoID<Id> for CurrentModule {
4268    fn into_id(
4269        self,
4270    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4271        Box::pin(async move { self.id().await })
4272    }
4273}
4274impl Loadable for CurrentModule {
4275    fn graphql_type() -> &'static str {
4276        "CurrentModule"
4277    }
4278    fn from_query(
4279        proc: Option<Arc<DaggerSessionProc>>,
4280        selection: Selection,
4281        graphql_client: DynGraphQLClient,
4282    ) -> Self {
4283        Self {
4284            proc,
4285            selection,
4286            graphql_client,
4287        }
4288    }
4289}
4290impl CurrentModule {
4291    /// The dependencies of the module.
4292    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
4293        let query = self.selection.select("dependencies");
4294        let query = query.select("id");
4295        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4296        Ok(ids
4297            .into_iter()
4298            .map(|id| Module {
4299                proc: self.proc.clone(),
4300                selection: crate::querybuilder::query()
4301                    .select("node")
4302                    .arg("id", &id.0)
4303                    .inline_fragment("Module"),
4304                graphql_client: self.graphql_client.clone(),
4305            })
4306            .collect())
4307    }
4308    /// The generated files and directories made on top of the module source's context directory.
4309    pub fn generated_context_directory(&self) -> Directory {
4310        let query = self.selection.select("generatedContextDirectory");
4311        Directory {
4312            proc: self.proc.clone(),
4313            selection: query,
4314            graphql_client: self.graphql_client.clone(),
4315        }
4316    }
4317    /// Return all generators defined by the module
4318    ///
4319    /// # Arguments
4320    ///
4321    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4322    pub fn generators(&self) -> GeneratorGroup {
4323        let query = self.selection.select("generators");
4324        GeneratorGroup {
4325            proc: self.proc.clone(),
4326            selection: query,
4327            graphql_client: self.graphql_client.clone(),
4328        }
4329    }
4330    /// Return all generators defined by the module
4331    ///
4332    /// # Arguments
4333    ///
4334    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4335    pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
4336        let mut query = self.selection.select("generators");
4337        if let Some(include) = opts.include {
4338            query = query.arg("include", include);
4339        }
4340        GeneratorGroup {
4341            proc: self.proc.clone(),
4342            selection: query,
4343            graphql_client: self.graphql_client.clone(),
4344        }
4345    }
4346    /// A unique identifier for this CurrentModule.
4347    pub async fn id(&self) -> Result<Id, DaggerError> {
4348        let query = self.selection.select("id");
4349        query.execute(self.graphql_client.clone()).await
4350    }
4351    /// The name of the module being executed in
4352    pub async fn name(&self) -> Result<String, DaggerError> {
4353        let query = self.selection.select("name");
4354        query.execute(self.graphql_client.clone()).await
4355    }
4356    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
4357    pub fn source(&self) -> Directory {
4358        let query = self.selection.select("source");
4359        Directory {
4360            proc: self.proc.clone(),
4361            selection: query,
4362            graphql_client: self.graphql_client.clone(),
4363        }
4364    }
4365    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4366    ///
4367    /// # Arguments
4368    ///
4369    /// * `path` - Location of the directory to access (e.g., ".").
4370    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4371    pub fn workdir(&self, path: impl Into<String>) -> Directory {
4372        let mut query = self.selection.select("workdir");
4373        query = query.arg("path", path.into());
4374        Directory {
4375            proc: self.proc.clone(),
4376            selection: query,
4377            graphql_client: self.graphql_client.clone(),
4378        }
4379    }
4380    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4381    ///
4382    /// # Arguments
4383    ///
4384    /// * `path` - Location of the directory to access (e.g., ".").
4385    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4386    pub fn workdir_opts<'a>(
4387        &self,
4388        path: impl Into<String>,
4389        opts: CurrentModuleWorkdirOpts<'a>,
4390    ) -> Directory {
4391        let mut query = self.selection.select("workdir");
4392        query = query.arg("path", path.into());
4393        if let Some(exclude) = opts.exclude {
4394            query = query.arg("exclude", exclude);
4395        }
4396        if let Some(include) = opts.include {
4397            query = query.arg("include", include);
4398        }
4399        if let Some(gitignore) = opts.gitignore {
4400            query = query.arg("gitignore", gitignore);
4401        }
4402        Directory {
4403            proc: self.proc.clone(),
4404            selection: query,
4405            graphql_client: self.graphql_client.clone(),
4406        }
4407    }
4408    /// 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.
4409    ///
4410    /// # Arguments
4411    ///
4412    /// * `path` - Location of the file to retrieve (e.g., "README.md").
4413    pub fn workdir_file(&self, path: impl Into<String>) -> File {
4414        let mut query = self.selection.select("workdirFile");
4415        query = query.arg("path", path.into());
4416        File {
4417            proc: self.proc.clone(),
4418            selection: query,
4419            graphql_client: self.graphql_client.clone(),
4420        }
4421    }
4422}
4423impl Node for CurrentModule {
4424    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4425        let query = self.selection.select("id");
4426        let graphql_client = self.graphql_client.clone();
4427        async move { query.execute(graphql_client).await }
4428    }
4429}
4430#[derive(Clone)]
4431pub struct DiffStat {
4432    pub proc: Option<Arc<DaggerSessionProc>>,
4433    pub selection: Selection,
4434    pub graphql_client: DynGraphQLClient,
4435}
4436impl IntoID<Id> for DiffStat {
4437    fn into_id(
4438        self,
4439    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4440        Box::pin(async move { self.id().await })
4441    }
4442}
4443impl Loadable for DiffStat {
4444    fn graphql_type() -> &'static str {
4445        "DiffStat"
4446    }
4447    fn from_query(
4448        proc: Option<Arc<DaggerSessionProc>>,
4449        selection: Selection,
4450        graphql_client: DynGraphQLClient,
4451    ) -> Self {
4452        Self {
4453            proc,
4454            selection,
4455            graphql_client,
4456        }
4457    }
4458}
4459impl DiffStat {
4460    /// Number of added lines for this path.
4461    pub async fn added_lines(&self) -> Result<isize, DaggerError> {
4462        let query = self.selection.select("addedLines");
4463        query.execute(self.graphql_client.clone()).await
4464    }
4465    /// A unique identifier for this DiffStat.
4466    pub async fn id(&self) -> Result<Id, DaggerError> {
4467        let query = self.selection.select("id");
4468        query.execute(self.graphql_client.clone()).await
4469    }
4470    /// Type of change.
4471    pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
4472        let query = self.selection.select("kind");
4473        query.execute(self.graphql_client.clone()).await
4474    }
4475    /// Previous path of the file, set only for renames.
4476    pub async fn old_path(&self) -> Result<String, DaggerError> {
4477        let query = self.selection.select("oldPath");
4478        query.execute(self.graphql_client.clone()).await
4479    }
4480    /// Path of the changed file or directory.
4481    pub async fn path(&self) -> Result<String, DaggerError> {
4482        let query = self.selection.select("path");
4483        query.execute(self.graphql_client.clone()).await
4484    }
4485    /// Number of removed lines for this path.
4486    pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
4487        let query = self.selection.select("removedLines");
4488        query.execute(self.graphql_client.clone()).await
4489    }
4490}
4491impl Node for DiffStat {
4492    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4493        let query = self.selection.select("id");
4494        let graphql_client = self.graphql_client.clone();
4495        async move { query.execute(graphql_client).await }
4496    }
4497}
4498#[derive(Clone)]
4499pub struct Directory {
4500    pub proc: Option<Arc<DaggerSessionProc>>,
4501    pub selection: Selection,
4502    pub graphql_client: DynGraphQLClient,
4503}
4504#[derive(Builder, Debug, PartialEq)]
4505pub struct DirectoryAsModuleOpts<'a> {
4506    /// An optional subpath of the directory which contains the module's configuration file.
4507    /// If not set, the module source code is loaded from the root of the directory.
4508    #[builder(setter(into, strip_option), default)]
4509    pub source_root_path: Option<&'a str>,
4510}
4511#[derive(Builder, Debug, PartialEq)]
4512pub struct DirectoryAsModuleSourceOpts<'a> {
4513    /// An optional subpath of the directory which contains the module's configuration file.
4514    /// If not set, the module source code is loaded from the root of the directory.
4515    #[builder(setter(into, strip_option), default)]
4516    pub source_root_path: Option<&'a str>,
4517}
4518#[derive(Builder, Debug, PartialEq)]
4519pub struct DirectoryDockerBuildOpts<'a> {
4520    /// Build arguments to use in the build.
4521    #[builder(setter(into, strip_option), default)]
4522    pub build_args: Option<Vec<BuildArg>>,
4523    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
4524    #[builder(setter(into, strip_option), default)]
4525    pub dockerfile: Option<&'a str>,
4526    /// If set, skip the automatic init process injected into containers created by RUN statements.
4527    /// 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.
4528    #[builder(setter(into, strip_option), default)]
4529    pub no_init: Option<bool>,
4530    /// The platform to build.
4531    #[builder(setter(into, strip_option), default)]
4532    pub platform: Option<Platform>,
4533    /// Secrets to pass to the build.
4534    /// They will be mounted at /run/secrets/[secret-name].
4535    #[builder(setter(into, strip_option), default)]
4536    pub secrets: Option<Vec<Id>>,
4537    /// A socket to use for SSH authentication during the build
4538    /// (e.g., for Dockerfile RUN --mount=type=ssh instructions).
4539    /// Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
4540    #[builder(setter(into, strip_option), default)]
4541    pub ssh: Option<Id>,
4542    /// Target build stage to build.
4543    #[builder(setter(into, strip_option), default)]
4544    pub target: Option<&'a str>,
4545}
4546#[derive(Builder, Debug, PartialEq)]
4547pub struct DirectoryEntriesOpts<'a> {
4548    /// Location of the directory to look at (e.g., "/src").
4549    #[builder(setter(into, strip_option), default)]
4550    pub path: Option<&'a str>,
4551}
4552#[derive(Builder, Debug, PartialEq)]
4553pub struct DirectoryExistsOpts {
4554    /// If specified, do not follow symlinks.
4555    #[builder(setter(into, strip_option), default)]
4556    pub do_not_follow_symlinks: Option<bool>,
4557    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
4558    #[builder(setter(into, strip_option), default)]
4559    pub expected_type: Option<ExistsType>,
4560}
4561#[derive(Builder, Debug, PartialEq)]
4562pub struct DirectoryExportOpts {
4563    /// 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.
4564    #[builder(setter(into, strip_option), default)]
4565    pub wipe: Option<bool>,
4566}
4567#[derive(Builder, Debug, PartialEq)]
4568pub struct DirectoryFilterOpts<'a> {
4569    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
4570    #[builder(setter(into, strip_option), default)]
4571    pub exclude: Option<Vec<&'a str>>,
4572    /// If set, apply .gitignore rules when filtering the directory.
4573    #[builder(setter(into, strip_option), default)]
4574    pub gitignore: Option<bool>,
4575    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
4576    #[builder(setter(into, strip_option), default)]
4577    pub include: Option<Vec<&'a str>>,
4578}
4579#[derive(Builder, Debug, PartialEq)]
4580pub struct DirectorySearchOpts<'a> {
4581    /// Allow the . pattern to match newlines in multiline mode.
4582    #[builder(setter(into, strip_option), default)]
4583    pub dotall: Option<bool>,
4584    /// Only return matching files, not lines and content
4585    #[builder(setter(into, strip_option), default)]
4586    pub files_only: Option<bool>,
4587    /// Glob patterns to match (e.g., "*.md")
4588    #[builder(setter(into, strip_option), default)]
4589    pub globs: Option<Vec<&'a str>>,
4590    /// Enable case-insensitive matching.
4591    #[builder(setter(into, strip_option), default)]
4592    pub insensitive: Option<bool>,
4593    /// Limit the number of results to return
4594    #[builder(setter(into, strip_option), default)]
4595    pub limit: Option<isize>,
4596    /// Interpret the pattern as a literal string instead of a regular expression.
4597    #[builder(setter(into, strip_option), default)]
4598    pub literal: Option<bool>,
4599    /// Enable searching across multiple lines.
4600    #[builder(setter(into, strip_option), default)]
4601    pub multiline: Option<bool>,
4602    /// Directory or file paths to search
4603    #[builder(setter(into, strip_option), default)]
4604    pub paths: Option<Vec<&'a str>>,
4605    /// Skip hidden files (files starting with .).
4606    #[builder(setter(into, strip_option), default)]
4607    pub skip_hidden: Option<bool>,
4608    /// Honor .gitignore, .ignore, and .rgignore files.
4609    #[builder(setter(into, strip_option), default)]
4610    pub skip_ignored: Option<bool>,
4611}
4612#[derive(Builder, Debug, PartialEq)]
4613pub struct DirectoryStatOpts {
4614    /// If specified, do not follow symlinks.
4615    #[builder(setter(into, strip_option), default)]
4616    pub do_not_follow_symlinks: Option<bool>,
4617}
4618#[derive(Builder, Debug, PartialEq)]
4619pub struct DirectoryTerminalOpts<'a> {
4620    /// If set, override the container's default terminal command and invoke these command arguments instead.
4621    #[builder(setter(into, strip_option), default)]
4622    pub cmd: Option<Vec<&'a str>>,
4623    /// If set, override the default container used for the terminal.
4624    #[builder(setter(into, strip_option), default)]
4625    pub container: Option<Id>,
4626    /// Provides Dagger access to the executed command.
4627    #[builder(setter(into, strip_option), default)]
4628    pub experimental_privileged_nesting: Option<bool>,
4629    /// 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.
4630    #[builder(setter(into, strip_option), default)]
4631    pub insecure_root_capabilities: Option<bool>,
4632}
4633#[derive(Builder, Debug, PartialEq)]
4634pub struct DirectoryWithDirectoryOpts<'a> {
4635    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4636    #[builder(setter(into, strip_option), default)]
4637    pub exclude: Option<Vec<&'a str>>,
4638    /// Apply .gitignore filter rules inside the directory
4639    #[builder(setter(into, strip_option), default)]
4640    pub gitignore: Option<bool>,
4641    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4642    #[builder(setter(into, strip_option), default)]
4643    pub include: Option<Vec<&'a str>>,
4644    /// A user:group to set for the copied directory and its contents.
4645    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
4646    /// If the group is omitted, it defaults to the same as the user.
4647    #[builder(setter(into, strip_option), default)]
4648    pub owner: Option<&'a str>,
4649    /// Permission given to the copied directory and contents (e.g., 0755).
4650    #[builder(setter(into, strip_option), default)]
4651    pub permissions: Option<isize>,
4652}
4653#[derive(Builder, Debug, PartialEq)]
4654pub struct DirectoryWithFileOpts<'a> {
4655    /// A user:group to set for the copied directory and its contents.
4656    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
4657    /// If the group is omitted, it defaults to the same as the user.
4658    #[builder(setter(into, strip_option), default)]
4659    pub owner: Option<&'a str>,
4660    /// Permission given to the copied file (e.g., 0600).
4661    #[builder(setter(into, strip_option), default)]
4662    pub permissions: Option<isize>,
4663}
4664#[derive(Builder, Debug, PartialEq)]
4665pub struct DirectoryWithFilesOpts {
4666    /// Permission given to the copied files (e.g., 0600).
4667    #[builder(setter(into, strip_option), default)]
4668    pub permissions: Option<isize>,
4669}
4670#[derive(Builder, Debug, PartialEq)]
4671pub struct DirectoryWithNewDirectoryOpts {
4672    /// Permission granted to the created directory (e.g., 0777).
4673    #[builder(setter(into, strip_option), default)]
4674    pub permissions: Option<isize>,
4675}
4676#[derive(Builder, Debug, PartialEq)]
4677pub struct DirectoryWithNewFileOpts {
4678    /// Permissions of the new file. Example: 0600
4679    #[builder(setter(into, strip_option), default)]
4680    pub permissions: Option<isize>,
4681}
4682impl IntoID<Id> for Directory {
4683    fn into_id(
4684        self,
4685    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4686        Box::pin(async move { self.id().await })
4687    }
4688}
4689impl Loadable for Directory {
4690    fn graphql_type() -> &'static str {
4691        "Directory"
4692    }
4693    fn from_query(
4694        proc: Option<Arc<DaggerSessionProc>>,
4695        selection: Selection,
4696        graphql_client: DynGraphQLClient,
4697    ) -> Self {
4698        Self {
4699            proc,
4700            selection,
4701            graphql_client,
4702        }
4703    }
4704}
4705impl Directory {
4706    /// Converts this directory to a local git repository
4707    pub fn as_git(&self) -> GitRepository {
4708        let query = self.selection.select("asGit");
4709        GitRepository {
4710            proc: self.proc.clone(),
4711            selection: query,
4712            graphql_client: self.graphql_client.clone(),
4713        }
4714    }
4715    /// Load the directory as a Dagger module source
4716    ///
4717    /// # Arguments
4718    ///
4719    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4720    pub fn as_module(&self) -> Module {
4721        let query = self.selection.select("asModule");
4722        Module {
4723            proc: self.proc.clone(),
4724            selection: query,
4725            graphql_client: self.graphql_client.clone(),
4726        }
4727    }
4728    /// Load the directory as a Dagger module source
4729    ///
4730    /// # Arguments
4731    ///
4732    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4733    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4734        let mut query = self.selection.select("asModule");
4735        if let Some(source_root_path) = opts.source_root_path {
4736            query = query.arg("sourceRootPath", source_root_path);
4737        }
4738        Module {
4739            proc: self.proc.clone(),
4740            selection: query,
4741            graphql_client: self.graphql_client.clone(),
4742        }
4743    }
4744    /// Load the directory as a Dagger module source
4745    ///
4746    /// # Arguments
4747    ///
4748    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4749    pub fn as_module_source(&self) -> ModuleSource {
4750        let query = self.selection.select("asModuleSource");
4751        ModuleSource {
4752            proc: self.proc.clone(),
4753            selection: query,
4754            graphql_client: self.graphql_client.clone(),
4755        }
4756    }
4757    /// Load the directory as a Dagger module source
4758    ///
4759    /// # Arguments
4760    ///
4761    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4762    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4763        let mut query = self.selection.select("asModuleSource");
4764        if let Some(source_root_path) = opts.source_root_path {
4765            query = query.arg("sourceRootPath", source_root_path);
4766        }
4767        ModuleSource {
4768            proc: self.proc.clone(),
4769            selection: query,
4770            graphql_client: self.graphql_client.clone(),
4771        }
4772    }
4773    /// Return the difference between this directory and another directory, typically an older snapshot.
4774    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
4775    ///
4776    /// # Arguments
4777    ///
4778    /// * `from` - The base directory snapshot to compare against
4779    pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
4780        let mut query = self.selection.select("changes");
4781        query = query.arg_lazy(
4782            "from",
4783            Box::new(move || {
4784                let from = from.clone();
4785                Box::pin(async move { from.into_id().await.unwrap().quote() })
4786            }),
4787        );
4788        Changeset {
4789            proc: self.proc.clone(),
4790            selection: query,
4791            graphql_client: self.graphql_client.clone(),
4792        }
4793    }
4794    /// Change the owner of the directory contents recursively.
4795    ///
4796    /// # Arguments
4797    ///
4798    /// * `path` - Path of the directory to change ownership of (e.g., "/").
4799    /// * `owner` - A user:group to set for the mounted directory and its contents.
4800    ///
4801    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
4802    ///
4803    /// If the group is omitted, it defaults to the same as the user.
4804    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
4805        let mut query = self.selection.select("chown");
4806        query = query.arg("path", path.into());
4807        query = query.arg("owner", owner.into());
4808        Directory {
4809            proc: self.proc.clone(),
4810            selection: query,
4811            graphql_client: self.graphql_client.clone(),
4812        }
4813    }
4814    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
4815    ///
4816    /// # Arguments
4817    ///
4818    /// * `other` - The directory to compare against
4819    pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
4820        let mut query = self.selection.select("diff");
4821        query = query.arg_lazy(
4822            "other",
4823            Box::new(move || {
4824                let other = other.clone();
4825                Box::pin(async move { other.into_id().await.unwrap().quote() })
4826            }),
4827        );
4828        Directory {
4829            proc: self.proc.clone(),
4830            selection: query,
4831            graphql_client: self.graphql_client.clone(),
4832        }
4833    }
4834    /// 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.
4835    pub async fn digest(&self) -> Result<String, DaggerError> {
4836        let query = self.selection.select("digest");
4837        query.execute(self.graphql_client.clone()).await
4838    }
4839    /// Retrieves a directory at the given path.
4840    ///
4841    /// # Arguments
4842    ///
4843    /// * `path` - Location of the directory to retrieve. Example: "/src"
4844    pub fn directory(&self, path: impl Into<String>) -> Directory {
4845        let mut query = self.selection.select("directory");
4846        query = query.arg("path", path.into());
4847        Directory {
4848            proc: self.proc.clone(),
4849            selection: query,
4850            graphql_client: self.graphql_client.clone(),
4851        }
4852    }
4853    /// 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.
4854    ///
4855    /// # Arguments
4856    ///
4857    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4858    pub fn docker_build(&self) -> Container {
4859        let query = self.selection.select("dockerBuild");
4860        Container {
4861            proc: self.proc.clone(),
4862            selection: query,
4863            graphql_client: self.graphql_client.clone(),
4864        }
4865    }
4866    /// 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.
4867    ///
4868    /// # Arguments
4869    ///
4870    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4871    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
4872        let mut query = self.selection.select("dockerBuild");
4873        if let Some(dockerfile) = opts.dockerfile {
4874            query = query.arg("dockerfile", dockerfile);
4875        }
4876        if let Some(platform) = opts.platform {
4877            query = query.arg("platform", platform);
4878        }
4879        if let Some(build_args) = opts.build_args {
4880            query = query.arg("buildArgs", build_args);
4881        }
4882        if let Some(target) = opts.target {
4883            query = query.arg("target", target);
4884        }
4885        if let Some(secrets) = opts.secrets {
4886            query = query.arg("secrets", secrets);
4887        }
4888        if let Some(no_init) = opts.no_init {
4889            query = query.arg("noInit", no_init);
4890        }
4891        if let Some(ssh) = opts.ssh {
4892            query = query.arg("ssh", ssh);
4893        }
4894        Container {
4895            proc: self.proc.clone(),
4896            selection: query,
4897            graphql_client: self.graphql_client.clone(),
4898        }
4899    }
4900    /// Returns a list of files and directories at the given path.
4901    ///
4902    /// # Arguments
4903    ///
4904    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4905    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
4906        let query = self.selection.select("entries");
4907        query.execute(self.graphql_client.clone()).await
4908    }
4909    /// Returns a list of files and directories at the given path.
4910    ///
4911    /// # Arguments
4912    ///
4913    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4914    pub async fn entries_opts<'a>(
4915        &self,
4916        opts: DirectoryEntriesOpts<'a>,
4917    ) -> Result<Vec<String>, DaggerError> {
4918        let mut query = self.selection.select("entries");
4919        if let Some(path) = opts.path {
4920            query = query.arg("path", path);
4921        }
4922        query.execute(self.graphql_client.clone()).await
4923    }
4924    /// check if a file or directory exists
4925    ///
4926    /// # Arguments
4927    ///
4928    /// * `path` - Path to check (e.g., "/file.txt").
4929    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4930    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
4931        let mut query = self.selection.select("exists");
4932        query = query.arg("path", path.into());
4933        query.execute(self.graphql_client.clone()).await
4934    }
4935    /// check if a file or directory exists
4936    ///
4937    /// # Arguments
4938    ///
4939    /// * `path` - Path to check (e.g., "/file.txt").
4940    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4941    pub async fn exists_opts(
4942        &self,
4943        path: impl Into<String>,
4944        opts: DirectoryExistsOpts,
4945    ) -> Result<bool, DaggerError> {
4946        let mut query = self.selection.select("exists");
4947        query = query.arg("path", path.into());
4948        if let Some(expected_type) = opts.expected_type {
4949            query = query.arg("expectedType", expected_type);
4950        }
4951        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
4952            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
4953        }
4954        query.execute(self.graphql_client.clone()).await
4955    }
4956    /// Writes the contents of the directory to a path on the host.
4957    ///
4958    /// # Arguments
4959    ///
4960    /// * `path` - Location of the copied directory (e.g., "logs/").
4961    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4962    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4963        let mut query = self.selection.select("export");
4964        query = query.arg("path", path.into());
4965        query.execute(self.graphql_client.clone()).await
4966    }
4967    /// Writes the contents of the directory to a path on the host.
4968    ///
4969    /// # Arguments
4970    ///
4971    /// * `path` - Location of the copied directory (e.g., "logs/").
4972    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4973    pub async fn export_opts(
4974        &self,
4975        path: impl Into<String>,
4976        opts: DirectoryExportOpts,
4977    ) -> Result<String, DaggerError> {
4978        let mut query = self.selection.select("export");
4979        query = query.arg("path", path.into());
4980        if let Some(wipe) = opts.wipe {
4981            query = query.arg("wipe", wipe);
4982        }
4983        query.execute(self.graphql_client.clone()).await
4984    }
4985    /// Retrieve a file at the given path.
4986    ///
4987    /// # Arguments
4988    ///
4989    /// * `path` - Location of the file to retrieve (e.g., "README.md").
4990    pub fn file(&self, path: impl Into<String>) -> File {
4991        let mut query = self.selection.select("file");
4992        query = query.arg("path", path.into());
4993        File {
4994            proc: self.proc.clone(),
4995            selection: query,
4996            graphql_client: self.graphql_client.clone(),
4997        }
4998    }
4999    /// Return a snapshot with some paths included or excluded
5000    ///
5001    /// # Arguments
5002    ///
5003    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5004    pub fn filter(&self) -> Directory {
5005        let query = self.selection.select("filter");
5006        Directory {
5007            proc: self.proc.clone(),
5008            selection: query,
5009            graphql_client: self.graphql_client.clone(),
5010        }
5011    }
5012    /// Return a snapshot with some paths included or excluded
5013    ///
5014    /// # Arguments
5015    ///
5016    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5017    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5018        let mut query = self.selection.select("filter");
5019        if let Some(exclude) = opts.exclude {
5020            query = query.arg("exclude", exclude);
5021        }
5022        if let Some(include) = opts.include {
5023            query = query.arg("include", include);
5024        }
5025        if let Some(gitignore) = opts.gitignore {
5026            query = query.arg("gitignore", gitignore);
5027        }
5028        Directory {
5029            proc: self.proc.clone(),
5030            selection: query,
5031            graphql_client: self.graphql_client.clone(),
5032        }
5033    }
5034    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
5035    ///
5036    /// # Arguments
5037    ///
5038    /// * `name` - The name of the file or directory to search for
5039    /// * `start` - The path to start the search from
5040    pub async fn find_up(
5041        &self,
5042        name: impl Into<String>,
5043        start: impl Into<String>,
5044    ) -> Result<String, DaggerError> {
5045        let mut query = self.selection.select("findUp");
5046        query = query.arg("name", name.into());
5047        query = query.arg("start", start.into());
5048        query.execute(self.graphql_client.clone()).await
5049    }
5050    /// Returns a list of files and directories that matche the given pattern.
5051    ///
5052    /// # Arguments
5053    ///
5054    /// * `pattern` - Pattern to match (e.g., "*.md").
5055    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5056        let mut query = self.selection.select("glob");
5057        query = query.arg("pattern", pattern.into());
5058        query.execute(self.graphql_client.clone()).await
5059    }
5060    /// A unique identifier for this Directory.
5061    pub async fn id(&self) -> Result<Id, DaggerError> {
5062        let query = self.selection.select("id");
5063        query.execute(self.graphql_client.clone()).await
5064    }
5065    /// Returns the name of the directory.
5066    pub async fn name(&self) -> Result<String, DaggerError> {
5067        let query = self.selection.select("name");
5068        query.execute(self.graphql_client.clone()).await
5069    }
5070    /// Searches for content matching the given regular expression or literal string.
5071    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5072    ///
5073    /// # Arguments
5074    ///
5075    /// * `pattern` - The text to match.
5076    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5077    pub async fn search(
5078        &self,
5079        pattern: impl Into<String>,
5080    ) -> Result<Vec<SearchResult>, DaggerError> {
5081        let mut query = self.selection.select("search");
5082        query = query.arg("pattern", pattern.into());
5083        let query = query.select("id");
5084        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5085        Ok(ids
5086            .into_iter()
5087            .map(|id| SearchResult {
5088                proc: self.proc.clone(),
5089                selection: crate::querybuilder::query()
5090                    .select("node")
5091                    .arg("id", &id.0)
5092                    .inline_fragment("SearchResult"),
5093                graphql_client: self.graphql_client.clone(),
5094            })
5095            .collect())
5096    }
5097    /// Searches for content matching the given regular expression or literal string.
5098    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5099    ///
5100    /// # Arguments
5101    ///
5102    /// * `pattern` - The text to match.
5103    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5104    pub async fn search_opts<'a>(
5105        &self,
5106        pattern: impl Into<String>,
5107        opts: DirectorySearchOpts<'a>,
5108    ) -> Result<Vec<SearchResult>, DaggerError> {
5109        let mut query = self.selection.select("search");
5110        query = query.arg("pattern", pattern.into());
5111        if let Some(paths) = opts.paths {
5112            query = query.arg("paths", paths);
5113        }
5114        if let Some(globs) = opts.globs {
5115            query = query.arg("globs", globs);
5116        }
5117        if let Some(literal) = opts.literal {
5118            query = query.arg("literal", literal);
5119        }
5120        if let Some(multiline) = opts.multiline {
5121            query = query.arg("multiline", multiline);
5122        }
5123        if let Some(dotall) = opts.dotall {
5124            query = query.arg("dotall", dotall);
5125        }
5126        if let Some(insensitive) = opts.insensitive {
5127            query = query.arg("insensitive", insensitive);
5128        }
5129        if let Some(skip_ignored) = opts.skip_ignored {
5130            query = query.arg("skipIgnored", skip_ignored);
5131        }
5132        if let Some(skip_hidden) = opts.skip_hidden {
5133            query = query.arg("skipHidden", skip_hidden);
5134        }
5135        if let Some(files_only) = opts.files_only {
5136            query = query.arg("filesOnly", files_only);
5137        }
5138        if let Some(limit) = opts.limit {
5139            query = query.arg("limit", limit);
5140        }
5141        let query = query.select("id");
5142        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5143        Ok(ids
5144            .into_iter()
5145            .map(|id| SearchResult {
5146                proc: self.proc.clone(),
5147                selection: crate::querybuilder::query()
5148                    .select("node")
5149                    .arg("id", &id.0)
5150                    .inline_fragment("SearchResult"),
5151                graphql_client: self.graphql_client.clone(),
5152            })
5153            .collect())
5154    }
5155    /// Return file status
5156    ///
5157    /// # Arguments
5158    ///
5159    /// * `path` - Path to stat (e.g., "/file.txt").
5160    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5161    pub fn stat(&self, path: impl Into<String>) -> Stat {
5162        let mut query = self.selection.select("stat");
5163        query = query.arg("path", path.into());
5164        Stat {
5165            proc: self.proc.clone(),
5166            selection: query,
5167            graphql_client: self.graphql_client.clone(),
5168        }
5169    }
5170    /// Return file status
5171    ///
5172    /// # Arguments
5173    ///
5174    /// * `path` - Path to stat (e.g., "/file.txt").
5175    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5176    pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
5177        let mut query = self.selection.select("stat");
5178        query = query.arg("path", path.into());
5179        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5180            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5181        }
5182        Stat {
5183            proc: self.proc.clone(),
5184            selection: query,
5185            graphql_client: self.graphql_client.clone(),
5186        }
5187    }
5188    /// Force evaluation in the engine.
5189    pub async fn sync(&self) -> Result<Directory, DaggerError> {
5190        let query = self.selection.select("sync");
5191        let id: Id = query.execute(self.graphql_client.clone()).await?;
5192        Ok(Directory {
5193            proc: self.proc.clone(),
5194            selection: query
5195                .root()
5196                .select("node")
5197                .arg("id", &id.0)
5198                .inline_fragment("Directory"),
5199            graphql_client: self.graphql_client.clone(),
5200        })
5201    }
5202    /// Opens an interactive terminal in new container with this directory mounted inside.
5203    ///
5204    /// # Arguments
5205    ///
5206    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5207    pub fn terminal(&self) -> Directory {
5208        let query = self.selection.select("terminal");
5209        Directory {
5210            proc: self.proc.clone(),
5211            selection: query,
5212            graphql_client: self.graphql_client.clone(),
5213        }
5214    }
5215    /// Opens an interactive terminal in new container with this directory mounted inside.
5216    ///
5217    /// # Arguments
5218    ///
5219    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5220    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5221        let mut query = self.selection.select("terminal");
5222        if let Some(container) = opts.container {
5223            query = query.arg("container", container);
5224        }
5225        if let Some(cmd) = opts.cmd {
5226            query = query.arg("cmd", cmd);
5227        }
5228        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5229            query = query.arg(
5230                "experimentalPrivilegedNesting",
5231                experimental_privileged_nesting,
5232            );
5233        }
5234        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5235            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5236        }
5237        Directory {
5238            proc: self.proc.clone(),
5239            selection: query,
5240            graphql_client: self.graphql_client.clone(),
5241        }
5242    }
5243    /// Return a directory with changes from another directory applied to it.
5244    ///
5245    /// # Arguments
5246    ///
5247    /// * `changes` - Changes to apply to the directory
5248    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
5249        let mut query = self.selection.select("withChanges");
5250        query = query.arg_lazy(
5251            "changes",
5252            Box::new(move || {
5253                let changes = changes.clone();
5254                Box::pin(async move { changes.into_id().await.unwrap().quote() })
5255            }),
5256        );
5257        Directory {
5258            proc: self.proc.clone(),
5259            selection: query,
5260            graphql_client: self.graphql_client.clone(),
5261        }
5262    }
5263    /// Return a snapshot with a directory added
5264    ///
5265    /// # Arguments
5266    ///
5267    /// * `path` - Location of the written directory (e.g., "/src/").
5268    /// * `source` - Identifier of the directory to copy.
5269    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5270    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5271        let mut query = self.selection.select("withDirectory");
5272        query = query.arg("path", path.into());
5273        query = query.arg_lazy(
5274            "source",
5275            Box::new(move || {
5276                let source = source.clone();
5277                Box::pin(async move { source.into_id().await.unwrap().quote() })
5278            }),
5279        );
5280        Directory {
5281            proc: self.proc.clone(),
5282            selection: query,
5283            graphql_client: self.graphql_client.clone(),
5284        }
5285    }
5286    /// Return a snapshot with a directory added
5287    ///
5288    /// # Arguments
5289    ///
5290    /// * `path` - Location of the written directory (e.g., "/src/").
5291    /// * `source` - Identifier of the directory to copy.
5292    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5293    pub fn with_directory_opts<'a>(
5294        &self,
5295        path: impl Into<String>,
5296        source: impl IntoID<Id>,
5297        opts: DirectoryWithDirectoryOpts<'a>,
5298    ) -> Directory {
5299        let mut query = self.selection.select("withDirectory");
5300        query = query.arg("path", path.into());
5301        query = query.arg_lazy(
5302            "source",
5303            Box::new(move || {
5304                let source = source.clone();
5305                Box::pin(async move { source.into_id().await.unwrap().quote() })
5306            }),
5307        );
5308        if let Some(exclude) = opts.exclude {
5309            query = query.arg("exclude", exclude);
5310        }
5311        if let Some(include) = opts.include {
5312            query = query.arg("include", include);
5313        }
5314        if let Some(gitignore) = opts.gitignore {
5315            query = query.arg("gitignore", gitignore);
5316        }
5317        if let Some(owner) = opts.owner {
5318            query = query.arg("owner", owner);
5319        }
5320        if let Some(permissions) = opts.permissions {
5321            query = query.arg("permissions", permissions);
5322        }
5323        Directory {
5324            proc: self.proc.clone(),
5325            selection: query,
5326            graphql_client: self.graphql_client.clone(),
5327        }
5328    }
5329    /// Raise an error.
5330    ///
5331    /// # Arguments
5332    ///
5333    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
5334    pub fn with_error(&self, err: impl Into<String>) -> Directory {
5335        let mut query = self.selection.select("withError");
5336        query = query.arg("err", err.into());
5337        Directory {
5338            proc: self.proc.clone(),
5339            selection: query,
5340            graphql_client: self.graphql_client.clone(),
5341        }
5342    }
5343    /// Retrieves this directory plus the contents of the given file copied to the given path.
5344    ///
5345    /// # Arguments
5346    ///
5347    /// * `path` - Location of the copied file (e.g., "/file.txt").
5348    /// * `source` - Identifier of the file to copy.
5349    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5350    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5351        let mut query = self.selection.select("withFile");
5352        query = query.arg("path", path.into());
5353        query = query.arg_lazy(
5354            "source",
5355            Box::new(move || {
5356                let source = source.clone();
5357                Box::pin(async move { source.into_id().await.unwrap().quote() })
5358            }),
5359        );
5360        Directory {
5361            proc: self.proc.clone(),
5362            selection: query,
5363            graphql_client: self.graphql_client.clone(),
5364        }
5365    }
5366    /// Retrieves this directory plus the contents of the given file copied to the given path.
5367    ///
5368    /// # Arguments
5369    ///
5370    /// * `path` - Location of the copied file (e.g., "/file.txt").
5371    /// * `source` - Identifier of the file to copy.
5372    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5373    pub fn with_file_opts<'a>(
5374        &self,
5375        path: impl Into<String>,
5376        source: impl IntoID<Id>,
5377        opts: DirectoryWithFileOpts<'a>,
5378    ) -> Directory {
5379        let mut query = self.selection.select("withFile");
5380        query = query.arg("path", path.into());
5381        query = query.arg_lazy(
5382            "source",
5383            Box::new(move || {
5384                let source = source.clone();
5385                Box::pin(async move { source.into_id().await.unwrap().quote() })
5386            }),
5387        );
5388        if let Some(permissions) = opts.permissions {
5389            query = query.arg("permissions", permissions);
5390        }
5391        if let Some(owner) = opts.owner {
5392            query = query.arg("owner", owner);
5393        }
5394        Directory {
5395            proc: self.proc.clone(),
5396            selection: query,
5397            graphql_client: self.graphql_client.clone(),
5398        }
5399    }
5400    /// Retrieves this directory plus the contents of the given files copied to the given path.
5401    ///
5402    /// # Arguments
5403    ///
5404    /// * `path` - Location where copied files should be placed (e.g., "/src").
5405    /// * `sources` - Identifiers of the files to copy.
5406    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5407    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
5408        let mut query = self.selection.select("withFiles");
5409        query = query.arg("path", path.into());
5410        query = query.arg("sources", sources);
5411        Directory {
5412            proc: self.proc.clone(),
5413            selection: query,
5414            graphql_client: self.graphql_client.clone(),
5415        }
5416    }
5417    /// Retrieves this directory plus the contents of the given files copied to the given path.
5418    ///
5419    /// # Arguments
5420    ///
5421    /// * `path` - Location where copied files should be placed (e.g., "/src").
5422    /// * `sources` - Identifiers of the files to copy.
5423    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5424    pub fn with_files_opts(
5425        &self,
5426        path: impl Into<String>,
5427        sources: Vec<Id>,
5428        opts: DirectoryWithFilesOpts,
5429    ) -> Directory {
5430        let mut query = self.selection.select("withFiles");
5431        query = query.arg("path", path.into());
5432        query = query.arg("sources", sources);
5433        if let Some(permissions) = opts.permissions {
5434            query = query.arg("permissions", permissions);
5435        }
5436        Directory {
5437            proc: self.proc.clone(),
5438            selection: query,
5439            graphql_client: self.graphql_client.clone(),
5440        }
5441    }
5442    /// Retrieves this directory plus a new directory created at the given path.
5443    ///
5444    /// # Arguments
5445    ///
5446    /// * `path` - Location of the directory created (e.g., "/logs").
5447    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5448    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5449        let mut query = self.selection.select("withNewDirectory");
5450        query = query.arg("path", path.into());
5451        Directory {
5452            proc: self.proc.clone(),
5453            selection: query,
5454            graphql_client: self.graphql_client.clone(),
5455        }
5456    }
5457    /// Retrieves this directory plus a new directory created at the given path.
5458    ///
5459    /// # Arguments
5460    ///
5461    /// * `path` - Location of the directory created (e.g., "/logs").
5462    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5463    pub fn with_new_directory_opts(
5464        &self,
5465        path: impl Into<String>,
5466        opts: DirectoryWithNewDirectoryOpts,
5467    ) -> Directory {
5468        let mut query = self.selection.select("withNewDirectory");
5469        query = query.arg("path", path.into());
5470        if let Some(permissions) = opts.permissions {
5471            query = query.arg("permissions", permissions);
5472        }
5473        Directory {
5474            proc: self.proc.clone(),
5475            selection: query,
5476            graphql_client: self.graphql_client.clone(),
5477        }
5478    }
5479    /// Return a snapshot with a new file added
5480    ///
5481    /// # Arguments
5482    ///
5483    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5484    /// * `contents` - Contents of the new file. Example: "Hello world!"
5485    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5486    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5487        let mut query = self.selection.select("withNewFile");
5488        query = query.arg("path", path.into());
5489        query = query.arg("contents", contents.into());
5490        Directory {
5491            proc: self.proc.clone(),
5492            selection: query,
5493            graphql_client: self.graphql_client.clone(),
5494        }
5495    }
5496    /// Return a snapshot with a new file added
5497    ///
5498    /// # Arguments
5499    ///
5500    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5501    /// * `contents` - Contents of the new file. Example: "Hello world!"
5502    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5503    pub fn with_new_file_opts(
5504        &self,
5505        path: impl Into<String>,
5506        contents: impl Into<String>,
5507        opts: DirectoryWithNewFileOpts,
5508    ) -> Directory {
5509        let mut query = self.selection.select("withNewFile");
5510        query = query.arg("path", path.into());
5511        query = query.arg("contents", contents.into());
5512        if let Some(permissions) = opts.permissions {
5513            query = query.arg("permissions", permissions);
5514        }
5515        Directory {
5516            proc: self.proc.clone(),
5517            selection: query,
5518            graphql_client: self.graphql_client.clone(),
5519        }
5520    }
5521    /// Retrieves this directory with the given Git-compatible patch applied.
5522    ///
5523    /// # Arguments
5524    ///
5525    /// * `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").
5526    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5527        let mut query = self.selection.select("withPatch");
5528        query = query.arg("patch", patch.into());
5529        Directory {
5530            proc: self.proc.clone(),
5531            selection: query,
5532            graphql_client: self.graphql_client.clone(),
5533        }
5534    }
5535    /// Retrieves this directory with the given Git-compatible patch file applied.
5536    ///
5537    /// # Arguments
5538    ///
5539    /// * `patch` - File containing the patch to apply
5540    pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
5541        let mut query = self.selection.select("withPatchFile");
5542        query = query.arg_lazy(
5543            "patch",
5544            Box::new(move || {
5545                let patch = patch.clone();
5546                Box::pin(async move { patch.into_id().await.unwrap().quote() })
5547            }),
5548        );
5549        Directory {
5550            proc: self.proc.clone(),
5551            selection: query,
5552            graphql_client: self.graphql_client.clone(),
5553        }
5554    }
5555    /// Return a snapshot with a symlink
5556    ///
5557    /// # Arguments
5558    ///
5559    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5560    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5561    pub fn with_symlink(
5562        &self,
5563        target: impl Into<String>,
5564        link_name: impl Into<String>,
5565    ) -> Directory {
5566        let mut query = self.selection.select("withSymlink");
5567        query = query.arg("target", target.into());
5568        query = query.arg("linkName", link_name.into());
5569        Directory {
5570            proc: self.proc.clone(),
5571            selection: query,
5572            graphql_client: self.graphql_client.clone(),
5573        }
5574    }
5575    /// Retrieves this directory with all file/dir timestamps set to the given time.
5576    ///
5577    /// # Arguments
5578    ///
5579    /// * `timestamp` - Timestamp to set dir/files in.
5580    ///
5581    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
5582    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5583        let mut query = self.selection.select("withTimestamps");
5584        query = query.arg("timestamp", timestamp);
5585        Directory {
5586            proc: self.proc.clone(),
5587            selection: query,
5588            graphql_client: self.graphql_client.clone(),
5589        }
5590    }
5591    /// Return a snapshot with a subdirectory removed
5592    ///
5593    /// # Arguments
5594    ///
5595    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
5596    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5597        let mut query = self.selection.select("withoutDirectory");
5598        query = query.arg("path", path.into());
5599        Directory {
5600            proc: self.proc.clone(),
5601            selection: query,
5602            graphql_client: self.graphql_client.clone(),
5603        }
5604    }
5605    /// Return a snapshot with a file removed
5606    ///
5607    /// # Arguments
5608    ///
5609    /// * `path` - Path of the file to remove (e.g., "/file.txt").
5610    pub fn without_file(&self, path: impl Into<String>) -> Directory {
5611        let mut query = self.selection.select("withoutFile");
5612        query = query.arg("path", path.into());
5613        Directory {
5614            proc: self.proc.clone(),
5615            selection: query,
5616            graphql_client: self.graphql_client.clone(),
5617        }
5618    }
5619    /// Return a snapshot with files removed
5620    ///
5621    /// # Arguments
5622    ///
5623    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
5624    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5625        let mut query = self.selection.select("withoutFiles");
5626        query = query.arg(
5627            "paths",
5628            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5629        );
5630        Directory {
5631            proc: self.proc.clone(),
5632            selection: query,
5633            graphql_client: self.graphql_client.clone(),
5634        }
5635    }
5636}
5637impl Exportable for Directory {
5638    fn export(
5639        &self,
5640        path: impl Into<String>,
5641    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
5642        let mut query = self.selection.select("export");
5643        query = query.arg("path", path.into());
5644        let graphql_client = self.graphql_client.clone();
5645        async move { query.execute(graphql_client).await }
5646    }
5647    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5648        let query = self.selection.select("id");
5649        let graphql_client = self.graphql_client.clone();
5650        async move { query.execute(graphql_client).await }
5651    }
5652}
5653impl Node for Directory {
5654    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5655        let query = self.selection.select("id");
5656        let graphql_client = self.graphql_client.clone();
5657        async move { query.execute(graphql_client).await }
5658    }
5659}
5660impl Syncer for Directory {
5661    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5662        let query = self.selection.select("id");
5663        let graphql_client = self.graphql_client.clone();
5664        async move { query.execute(graphql_client).await }
5665    }
5666    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5667        let query = self.selection.select("sync");
5668        let graphql_client = self.graphql_client.clone();
5669        async move { query.execute(graphql_client).await }
5670    }
5671}
5672#[derive(Clone)]
5673pub struct Engine {
5674    pub proc: Option<Arc<DaggerSessionProc>>,
5675    pub selection: Selection,
5676    pub graphql_client: DynGraphQLClient,
5677}
5678impl IntoID<Id> for Engine {
5679    fn into_id(
5680        self,
5681    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5682        Box::pin(async move { self.id().await })
5683    }
5684}
5685impl Loadable for Engine {
5686    fn graphql_type() -> &'static str {
5687        "Engine"
5688    }
5689    fn from_query(
5690        proc: Option<Arc<DaggerSessionProc>>,
5691        selection: Selection,
5692        graphql_client: DynGraphQLClient,
5693    ) -> Self {
5694        Self {
5695            proc,
5696            selection,
5697            graphql_client,
5698        }
5699    }
5700}
5701impl Engine {
5702    /// The list of connected client IDs
5703    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
5704        let query = self.selection.select("clients");
5705        query.execute(self.graphql_client.clone()).await
5706    }
5707    /// A unique identifier for this Engine.
5708    pub async fn id(&self) -> Result<Id, DaggerError> {
5709        let query = self.selection.select("id");
5710        query.execute(self.graphql_client.clone()).await
5711    }
5712    /// The local engine cache state tracked by dagql
5713    pub fn local_cache(&self) -> EngineCache {
5714        let query = self.selection.select("localCache");
5715        EngineCache {
5716            proc: self.proc.clone(),
5717            selection: query,
5718            graphql_client: self.graphql_client.clone(),
5719        }
5720    }
5721    /// The name of the engine instance.
5722    pub async fn name(&self) -> Result<String, DaggerError> {
5723        let query = self.selection.select("name");
5724        query.execute(self.graphql_client.clone()).await
5725    }
5726}
5727impl Node for Engine {
5728    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5729        let query = self.selection.select("id");
5730        let graphql_client = self.graphql_client.clone();
5731        async move { query.execute(graphql_client).await }
5732    }
5733}
5734#[derive(Clone)]
5735pub struct EngineCache {
5736    pub proc: Option<Arc<DaggerSessionProc>>,
5737    pub selection: Selection,
5738    pub graphql_client: DynGraphQLClient,
5739}
5740#[derive(Builder, Debug, PartialEq)]
5741pub struct EngineCacheEntrySetOpts<'a> {
5742    #[builder(setter(into, strip_option), default)]
5743    pub key: Option<&'a str>,
5744}
5745#[derive(Builder, Debug, PartialEq)]
5746pub struct EngineCachePruneOpts<'a> {
5747    /// Override the maximum disk space to keep before pruning (e.g. "200GB" or "80%").
5748    #[builder(setter(into, strip_option), default)]
5749    pub max_used_space: Option<&'a str>,
5750    /// Override the minimum free disk space target during pruning (e.g. "20GB" or "20%").
5751    #[builder(setter(into, strip_option), default)]
5752    pub min_free_space: Option<&'a str>,
5753    /// Override the minimum disk space to retain during pruning (e.g. "500GB" or "10%").
5754    #[builder(setter(into, strip_option), default)]
5755    pub reserved_space: Option<&'a str>,
5756    /// Override the target disk space to keep after pruning (e.g. "200GB" or "50%").
5757    #[builder(setter(into, strip_option), default)]
5758    pub target_space: Option<&'a str>,
5759    /// Use the engine-wide default pruning policy if true, otherwise prune the whole cache of any releasable entries.
5760    #[builder(setter(into, strip_option), default)]
5761    pub use_default_policy: Option<bool>,
5762}
5763impl IntoID<Id> for EngineCache {
5764    fn into_id(
5765        self,
5766    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5767        Box::pin(async move { self.id().await })
5768    }
5769}
5770impl Loadable for EngineCache {
5771    fn graphql_type() -> &'static str {
5772        "EngineCache"
5773    }
5774    fn from_query(
5775        proc: Option<Arc<DaggerSessionProc>>,
5776        selection: Selection,
5777        graphql_client: DynGraphQLClient,
5778    ) -> Self {
5779        Self {
5780            proc,
5781            selection,
5782            graphql_client,
5783        }
5784    }
5785}
5786impl EngineCache {
5787    /// The current set of entries in the cache
5788    ///
5789    /// # Arguments
5790    ///
5791    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5792    pub fn entry_set(&self) -> EngineCacheEntrySet {
5793        let query = self.selection.select("entrySet");
5794        EngineCacheEntrySet {
5795            proc: self.proc.clone(),
5796            selection: query,
5797            graphql_client: self.graphql_client.clone(),
5798        }
5799    }
5800    /// The current set of entries in the cache
5801    ///
5802    /// # Arguments
5803    ///
5804    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5805    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5806        let mut query = self.selection.select("entrySet");
5807        if let Some(key) = opts.key {
5808            query = query.arg("key", key);
5809        }
5810        EngineCacheEntrySet {
5811            proc: self.proc.clone(),
5812            selection: query,
5813            graphql_client: self.graphql_client.clone(),
5814        }
5815    }
5816    /// A unique identifier for this EngineCache.
5817    pub async fn id(&self) -> Result<Id, DaggerError> {
5818        let query = self.selection.select("id");
5819        query.execute(self.graphql_client.clone()).await
5820    }
5821    /// The maximum bytes to keep in the cache without pruning.
5822    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5823        let query = self.selection.select("maxUsedSpace");
5824        query.execute(self.graphql_client.clone()).await
5825    }
5826    /// The target amount of free disk space the garbage collector will attempt to leave.
5827    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5828        let query = self.selection.select("minFreeSpace");
5829        query.execute(self.graphql_client.clone()).await
5830    }
5831    /// Prune the cache of releaseable entries
5832    ///
5833    /// # Arguments
5834    ///
5835    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5836    pub async fn prune(&self) -> Result<Void, DaggerError> {
5837        let query = self.selection.select("prune");
5838        query.execute(self.graphql_client.clone()).await
5839    }
5840    /// Prune the cache of releaseable entries
5841    ///
5842    /// # Arguments
5843    ///
5844    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5845    pub async fn prune_opts<'a>(
5846        &self,
5847        opts: EngineCachePruneOpts<'a>,
5848    ) -> Result<Void, DaggerError> {
5849        let mut query = self.selection.select("prune");
5850        if let Some(use_default_policy) = opts.use_default_policy {
5851            query = query.arg("useDefaultPolicy", use_default_policy);
5852        }
5853        if let Some(max_used_space) = opts.max_used_space {
5854            query = query.arg("maxUsedSpace", max_used_space);
5855        }
5856        if let Some(reserved_space) = opts.reserved_space {
5857            query = query.arg("reservedSpace", reserved_space);
5858        }
5859        if let Some(min_free_space) = opts.min_free_space {
5860            query = query.arg("minFreeSpace", min_free_space);
5861        }
5862        if let Some(target_space) = opts.target_space {
5863            query = query.arg("targetSpace", target_space);
5864        }
5865        query.execute(self.graphql_client.clone()).await
5866    }
5867    /// The minimum amount of disk space this policy is guaranteed to retain.
5868    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
5869        let query = self.selection.select("reservedSpace");
5870        query.execute(self.graphql_client.clone()).await
5871    }
5872    /// The target number of bytes to keep when pruning.
5873    pub async fn target_space(&self) -> Result<isize, DaggerError> {
5874        let query = self.selection.select("targetSpace");
5875        query.execute(self.graphql_client.clone()).await
5876    }
5877}
5878impl Node for EngineCache {
5879    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5880        let query = self.selection.select("id");
5881        let graphql_client = self.graphql_client.clone();
5882        async move { query.execute(graphql_client).await }
5883    }
5884}
5885#[derive(Clone)]
5886pub struct EngineCacheEntry {
5887    pub proc: Option<Arc<DaggerSessionProc>>,
5888    pub selection: Selection,
5889    pub graphql_client: DynGraphQLClient,
5890}
5891impl IntoID<Id> for EngineCacheEntry {
5892    fn into_id(
5893        self,
5894    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5895        Box::pin(async move { self.id().await })
5896    }
5897}
5898impl Loadable for EngineCacheEntry {
5899    fn graphql_type() -> &'static str {
5900        "EngineCacheEntry"
5901    }
5902    fn from_query(
5903        proc: Option<Arc<DaggerSessionProc>>,
5904        selection: Selection,
5905        graphql_client: DynGraphQLClient,
5906    ) -> Self {
5907        Self {
5908            proc,
5909            selection,
5910            graphql_client,
5911        }
5912    }
5913}
5914impl EngineCacheEntry {
5915    /// Whether the cache entry is actively being used.
5916    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
5917        let query = self.selection.select("activelyUsed");
5918        query.execute(self.graphql_client.clone()).await
5919    }
5920    /// The time the cache entry was created, in Unix nanoseconds.
5921    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
5922        let query = self.selection.select("createdTimeUnixNano");
5923        query.execute(self.graphql_client.clone()).await
5924    }
5925    /// The DagQL call that produced this cache entry.
5926    pub async fn dagql_call(&self) -> Result<String, DaggerError> {
5927        let query = self.selection.select("dagqlCall");
5928        query.execute(self.graphql_client.clone()).await
5929    }
5930    /// The description of the cache entry.
5931    pub async fn description(&self) -> Result<String, DaggerError> {
5932        let query = self.selection.select("description");
5933        query.execute(self.graphql_client.clone()).await
5934    }
5935    /// The disk space used by the cache entry.
5936    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5937        let query = self.selection.select("diskSpaceBytes");
5938        query.execute(self.graphql_client.clone()).await
5939    }
5940    /// A unique identifier for this EngineCacheEntry.
5941    pub async fn id(&self) -> Result<Id, DaggerError> {
5942        let query = self.selection.select("id");
5943        query.execute(self.graphql_client.clone()).await
5944    }
5945    /// The most recent time the cache entry was used, in Unix nanoseconds.
5946    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
5947        let query = self.selection.select("mostRecentUseTimeUnixNano");
5948        query.execute(self.graphql_client.clone()).await
5949    }
5950    /// The type of the cache record (e.g. regular, internal, frontend, source.local, source.git.checkout, exec.cachemount).
5951    pub async fn record_type(&self) -> Result<String, DaggerError> {
5952        let query = self.selection.select("recordType");
5953        query.execute(self.graphql_client.clone()).await
5954    }
5955    /// The storage record types represented by this cache entry.
5956    pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
5957        let query = self.selection.select("recordTypes");
5958        query.execute(self.graphql_client.clone()).await
5959    }
5960}
5961impl Node for EngineCacheEntry {
5962    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5963        let query = self.selection.select("id");
5964        let graphql_client = self.graphql_client.clone();
5965        async move { query.execute(graphql_client).await }
5966    }
5967}
5968#[derive(Clone)]
5969pub struct EngineCacheEntrySet {
5970    pub proc: Option<Arc<DaggerSessionProc>>,
5971    pub selection: Selection,
5972    pub graphql_client: DynGraphQLClient,
5973}
5974impl IntoID<Id> for EngineCacheEntrySet {
5975    fn into_id(
5976        self,
5977    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5978        Box::pin(async move { self.id().await })
5979    }
5980}
5981impl Loadable for EngineCacheEntrySet {
5982    fn graphql_type() -> &'static str {
5983        "EngineCacheEntrySet"
5984    }
5985    fn from_query(
5986        proc: Option<Arc<DaggerSessionProc>>,
5987        selection: Selection,
5988        graphql_client: DynGraphQLClient,
5989    ) -> Self {
5990        Self {
5991            proc,
5992            selection,
5993            graphql_client,
5994        }
5995    }
5996}
5997impl EngineCacheEntrySet {
5998    /// The total disk space used by the cache entries in this set.
5999    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6000        let query = self.selection.select("diskSpaceBytes");
6001        query.execute(self.graphql_client.clone()).await
6002    }
6003    /// The list of individual cache entries in the set
6004    pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
6005        let query = self.selection.select("entries");
6006        let query = query.select("id");
6007        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6008        Ok(ids
6009            .into_iter()
6010            .map(|id| EngineCacheEntry {
6011                proc: self.proc.clone(),
6012                selection: crate::querybuilder::query()
6013                    .select("node")
6014                    .arg("id", &id.0)
6015                    .inline_fragment("EngineCacheEntry"),
6016                graphql_client: self.graphql_client.clone(),
6017            })
6018            .collect())
6019    }
6020    /// The number of cache entries in this set.
6021    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6022        let query = self.selection.select("entryCount");
6023        query.execute(self.graphql_client.clone()).await
6024    }
6025    /// A unique identifier for this EngineCacheEntrySet.
6026    pub async fn id(&self) -> Result<Id, DaggerError> {
6027        let query = self.selection.select("id");
6028        query.execute(self.graphql_client.clone()).await
6029    }
6030}
6031impl Node for EngineCacheEntrySet {
6032    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6033        let query = self.selection.select("id");
6034        let graphql_client = self.graphql_client.clone();
6035        async move { query.execute(graphql_client).await }
6036    }
6037}
6038#[derive(Clone)]
6039pub struct EnumTypeDef {
6040    pub proc: Option<Arc<DaggerSessionProc>>,
6041    pub selection: Selection,
6042    pub graphql_client: DynGraphQLClient,
6043}
6044impl IntoID<Id> for EnumTypeDef {
6045    fn into_id(
6046        self,
6047    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6048        Box::pin(async move { self.id().await })
6049    }
6050}
6051impl Loadable for EnumTypeDef {
6052    fn graphql_type() -> &'static str {
6053        "EnumTypeDef"
6054    }
6055    fn from_query(
6056        proc: Option<Arc<DaggerSessionProc>>,
6057        selection: Selection,
6058        graphql_client: DynGraphQLClient,
6059    ) -> Self {
6060        Self {
6061            proc,
6062            selection,
6063            graphql_client,
6064        }
6065    }
6066}
6067impl EnumTypeDef {
6068    /// A doc string for the enum, if any.
6069    pub async fn description(&self) -> Result<String, DaggerError> {
6070        let query = self.selection.select("description");
6071        query.execute(self.graphql_client.clone()).await
6072    }
6073    /// A unique identifier for this EnumTypeDef.
6074    pub async fn id(&self) -> Result<Id, DaggerError> {
6075        let query = self.selection.select("id");
6076        query.execute(self.graphql_client.clone()).await
6077    }
6078    /// The members of the enum.
6079    pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6080        let query = self.selection.select("members");
6081        let query = query.select("id");
6082        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6083        Ok(ids
6084            .into_iter()
6085            .map(|id| EnumValueTypeDef {
6086                proc: self.proc.clone(),
6087                selection: crate::querybuilder::query()
6088                    .select("node")
6089                    .arg("id", &id.0)
6090                    .inline_fragment("EnumValueTypeDef"),
6091                graphql_client: self.graphql_client.clone(),
6092            })
6093            .collect())
6094    }
6095    /// The name of the enum.
6096    pub async fn name(&self) -> Result<String, DaggerError> {
6097        let query = self.selection.select("name");
6098        query.execute(self.graphql_client.clone()).await
6099    }
6100    /// The location of this enum declaration.
6101    pub fn source_map(&self) -> SourceMap {
6102        let query = self.selection.select("sourceMap");
6103        SourceMap {
6104            proc: self.proc.clone(),
6105            selection: query,
6106            graphql_client: self.graphql_client.clone(),
6107        }
6108    }
6109    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
6110    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6111        let query = self.selection.select("sourceModuleName");
6112        query.execute(self.graphql_client.clone()).await
6113    }
6114    /// The members of the enum.
6115    pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6116        let query = self.selection.select("values");
6117        let query = query.select("id");
6118        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6119        Ok(ids
6120            .into_iter()
6121            .map(|id| EnumValueTypeDef {
6122                proc: self.proc.clone(),
6123                selection: crate::querybuilder::query()
6124                    .select("node")
6125                    .arg("id", &id.0)
6126                    .inline_fragment("EnumValueTypeDef"),
6127                graphql_client: self.graphql_client.clone(),
6128            })
6129            .collect())
6130    }
6131}
6132impl Node for EnumTypeDef {
6133    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6134        let query = self.selection.select("id");
6135        let graphql_client = self.graphql_client.clone();
6136        async move { query.execute(graphql_client).await }
6137    }
6138}
6139#[derive(Clone)]
6140pub struct EnumValueTypeDef {
6141    pub proc: Option<Arc<DaggerSessionProc>>,
6142    pub selection: Selection,
6143    pub graphql_client: DynGraphQLClient,
6144}
6145impl IntoID<Id> for EnumValueTypeDef {
6146    fn into_id(
6147        self,
6148    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6149        Box::pin(async move { self.id().await })
6150    }
6151}
6152impl Loadable for EnumValueTypeDef {
6153    fn graphql_type() -> &'static str {
6154        "EnumValueTypeDef"
6155    }
6156    fn from_query(
6157        proc: Option<Arc<DaggerSessionProc>>,
6158        selection: Selection,
6159        graphql_client: DynGraphQLClient,
6160    ) -> Self {
6161        Self {
6162            proc,
6163            selection,
6164            graphql_client,
6165        }
6166    }
6167}
6168impl EnumValueTypeDef {
6169    /// The reason this enum member is deprecated, if any.
6170    pub async fn deprecated(&self) -> Result<String, DaggerError> {
6171        let query = self.selection.select("deprecated");
6172        query.execute(self.graphql_client.clone()).await
6173    }
6174    /// A doc string for the enum member, if any.
6175    pub async fn description(&self) -> Result<String, DaggerError> {
6176        let query = self.selection.select("description");
6177        query.execute(self.graphql_client.clone()).await
6178    }
6179    /// A unique identifier for this EnumValueTypeDef.
6180    pub async fn id(&self) -> Result<Id, DaggerError> {
6181        let query = self.selection.select("id");
6182        query.execute(self.graphql_client.clone()).await
6183    }
6184    /// The name of the enum member.
6185    pub async fn name(&self) -> Result<String, DaggerError> {
6186        let query = self.selection.select("name");
6187        query.execute(self.graphql_client.clone()).await
6188    }
6189    /// The location of this enum member declaration.
6190    pub fn source_map(&self) -> SourceMap {
6191        let query = self.selection.select("sourceMap");
6192        SourceMap {
6193            proc: self.proc.clone(),
6194            selection: query,
6195            graphql_client: self.graphql_client.clone(),
6196        }
6197    }
6198    /// The value of the enum member
6199    pub async fn value(&self) -> Result<String, DaggerError> {
6200        let query = self.selection.select("value");
6201        query.execute(self.graphql_client.clone()).await
6202    }
6203}
6204impl Node for EnumValueTypeDef {
6205    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6206        let query = self.selection.select("id");
6207        let graphql_client = self.graphql_client.clone();
6208        async move { query.execute(graphql_client).await }
6209    }
6210}
6211#[derive(Clone)]
6212pub struct Env {
6213    pub proc: Option<Arc<DaggerSessionProc>>,
6214    pub selection: Selection,
6215    pub graphql_client: DynGraphQLClient,
6216}
6217#[derive(Builder, Debug, PartialEq)]
6218pub struct EnvChecksOpts<'a> {
6219    /// Only include checks matching the specified patterns
6220    #[builder(setter(into, strip_option), default)]
6221    pub include: Option<Vec<&'a str>>,
6222    /// When true, only return annotated check functions; exclude generate-as-checks
6223    #[builder(setter(into, strip_option), default)]
6224    pub no_generate: Option<bool>,
6225}
6226#[derive(Builder, Debug, PartialEq)]
6227pub struct EnvServicesOpts<'a> {
6228    /// Only include services matching the specified patterns
6229    #[builder(setter(into, strip_option), default)]
6230    pub include: Option<Vec<&'a str>>,
6231}
6232impl IntoID<Id> for Env {
6233    fn into_id(
6234        self,
6235    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6236        Box::pin(async move { self.id().await })
6237    }
6238}
6239impl Loadable for Env {
6240    fn graphql_type() -> &'static str {
6241        "Env"
6242    }
6243    fn from_query(
6244        proc: Option<Arc<DaggerSessionProc>>,
6245        selection: Selection,
6246        graphql_client: DynGraphQLClient,
6247    ) -> Self {
6248        Self {
6249            proc,
6250            selection,
6251            graphql_client,
6252        }
6253    }
6254}
6255impl Env {
6256    /// Return the check with the given name from the installed modules. Must match exactly one check.
6257    ///
6258    /// # Arguments
6259    ///
6260    /// * `name` - The name of the check to retrieve
6261    pub fn check(&self, name: impl Into<String>) -> Check {
6262        let mut query = self.selection.select("check");
6263        query = query.arg("name", name.into());
6264        Check {
6265            proc: self.proc.clone(),
6266            selection: query,
6267            graphql_client: self.graphql_client.clone(),
6268        }
6269    }
6270    /// Return all checks defined by the installed modules
6271    ///
6272    /// # Arguments
6273    ///
6274    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6275    pub fn checks(&self) -> CheckGroup {
6276        let query = self.selection.select("checks");
6277        CheckGroup {
6278            proc: self.proc.clone(),
6279            selection: query,
6280            graphql_client: self.graphql_client.clone(),
6281        }
6282    }
6283    /// Return all checks defined by the installed modules
6284    ///
6285    /// # Arguments
6286    ///
6287    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6288    pub fn checks_opts<'a>(&self, opts: EnvChecksOpts<'a>) -> CheckGroup {
6289        let mut query = self.selection.select("checks");
6290        if let Some(include) = opts.include {
6291            query = query.arg("include", include);
6292        }
6293        if let Some(no_generate) = opts.no_generate {
6294            query = query.arg("noGenerate", no_generate);
6295        }
6296        CheckGroup {
6297            proc: self.proc.clone(),
6298            selection: query,
6299            graphql_client: self.graphql_client.clone(),
6300        }
6301    }
6302    /// A unique identifier for this Env.
6303    pub async fn id(&self) -> Result<Id, DaggerError> {
6304        let query = self.selection.select("id");
6305        query.execute(self.graphql_client.clone()).await
6306    }
6307    /// Retrieves an input binding by name
6308    pub fn input(&self, name: impl Into<String>) -> Binding {
6309        let mut query = self.selection.select("input");
6310        query = query.arg("name", name.into());
6311        Binding {
6312            proc: self.proc.clone(),
6313            selection: query,
6314            graphql_client: self.graphql_client.clone(),
6315        }
6316    }
6317    /// Returns all input bindings provided to the environment
6318    pub async fn inputs(&self) -> Result<Vec<Binding>, DaggerError> {
6319        let query = self.selection.select("inputs");
6320        let query = query.select("id");
6321        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6322        Ok(ids
6323            .into_iter()
6324            .map(|id| Binding {
6325                proc: self.proc.clone(),
6326                selection: crate::querybuilder::query()
6327                    .select("node")
6328                    .arg("id", &id.0)
6329                    .inline_fragment("Binding"),
6330                graphql_client: self.graphql_client.clone(),
6331            })
6332            .collect())
6333    }
6334    /// Retrieves an output binding by name
6335    pub fn output(&self, name: impl Into<String>) -> Binding {
6336        let mut query = self.selection.select("output");
6337        query = query.arg("name", name.into());
6338        Binding {
6339            proc: self.proc.clone(),
6340            selection: query,
6341            graphql_client: self.graphql_client.clone(),
6342        }
6343    }
6344    /// Returns all declared output bindings for the environment
6345    pub async fn outputs(&self) -> Result<Vec<Binding>, DaggerError> {
6346        let query = self.selection.select("outputs");
6347        let query = query.select("id");
6348        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6349        Ok(ids
6350            .into_iter()
6351            .map(|id| Binding {
6352                proc: self.proc.clone(),
6353                selection: crate::querybuilder::query()
6354                    .select("node")
6355                    .arg("id", &id.0)
6356                    .inline_fragment("Binding"),
6357                graphql_client: self.graphql_client.clone(),
6358            })
6359            .collect())
6360    }
6361    /// Return all services defined by the installed modules
6362    ///
6363    /// # Arguments
6364    ///
6365    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6366    pub fn services(&self) -> UpGroup {
6367        let query = self.selection.select("services");
6368        UpGroup {
6369            proc: self.proc.clone(),
6370            selection: query,
6371            graphql_client: self.graphql_client.clone(),
6372        }
6373    }
6374    /// Return all services defined by the installed modules
6375    ///
6376    /// # Arguments
6377    ///
6378    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6379    pub fn services_opts<'a>(&self, opts: EnvServicesOpts<'a>) -> UpGroup {
6380        let mut query = self.selection.select("services");
6381        if let Some(include) = opts.include {
6382            query = query.arg("include", include);
6383        }
6384        UpGroup {
6385            proc: self.proc.clone(),
6386            selection: query,
6387            graphql_client: self.graphql_client.clone(),
6388        }
6389    }
6390    /// Create or update a binding of type Address in the environment
6391    ///
6392    /// # Arguments
6393    ///
6394    /// * `name` - The name of the binding
6395    /// * `value` - The Address value to assign to the binding
6396    /// * `description` - The purpose of the input
6397    pub fn with_address_input(
6398        &self,
6399        name: impl Into<String>,
6400        value: impl IntoID<Id>,
6401        description: impl Into<String>,
6402    ) -> Env {
6403        let mut query = self.selection.select("withAddressInput");
6404        query = query.arg("name", name.into());
6405        query = query.arg_lazy(
6406            "value",
6407            Box::new(move || {
6408                let value = value.clone();
6409                Box::pin(async move { value.into_id().await.unwrap().quote() })
6410            }),
6411        );
6412        query = query.arg("description", description.into());
6413        Env {
6414            proc: self.proc.clone(),
6415            selection: query,
6416            graphql_client: self.graphql_client.clone(),
6417        }
6418    }
6419    /// Declare a desired Address output to be assigned in the environment
6420    ///
6421    /// # Arguments
6422    ///
6423    /// * `name` - The name of the binding
6424    /// * `description` - A description of the desired value of the binding
6425    pub fn with_address_output(
6426        &self,
6427        name: impl Into<String>,
6428        description: impl Into<String>,
6429    ) -> Env {
6430        let mut query = self.selection.select("withAddressOutput");
6431        query = query.arg("name", name.into());
6432        query = query.arg("description", description.into());
6433        Env {
6434            proc: self.proc.clone(),
6435            selection: query,
6436            graphql_client: self.graphql_client.clone(),
6437        }
6438    }
6439    /// Create or update a binding of type CacheVolume in the environment
6440    ///
6441    /// # Arguments
6442    ///
6443    /// * `name` - The name of the binding
6444    /// * `value` - The CacheVolume value to assign to the binding
6445    /// * `description` - The purpose of the input
6446    pub fn with_cache_volume_input(
6447        &self,
6448        name: impl Into<String>,
6449        value: impl IntoID<Id>,
6450        description: impl Into<String>,
6451    ) -> Env {
6452        let mut query = self.selection.select("withCacheVolumeInput");
6453        query = query.arg("name", name.into());
6454        query = query.arg_lazy(
6455            "value",
6456            Box::new(move || {
6457                let value = value.clone();
6458                Box::pin(async move { value.into_id().await.unwrap().quote() })
6459            }),
6460        );
6461        query = query.arg("description", description.into());
6462        Env {
6463            proc: self.proc.clone(),
6464            selection: query,
6465            graphql_client: self.graphql_client.clone(),
6466        }
6467    }
6468    /// Declare a desired CacheVolume output to be assigned in the environment
6469    ///
6470    /// # Arguments
6471    ///
6472    /// * `name` - The name of the binding
6473    /// * `description` - A description of the desired value of the binding
6474    pub fn with_cache_volume_output(
6475        &self,
6476        name: impl Into<String>,
6477        description: impl Into<String>,
6478    ) -> Env {
6479        let mut query = self.selection.select("withCacheVolumeOutput");
6480        query = query.arg("name", name.into());
6481        query = query.arg("description", description.into());
6482        Env {
6483            proc: self.proc.clone(),
6484            selection: query,
6485            graphql_client: self.graphql_client.clone(),
6486        }
6487    }
6488    /// Create or update a binding of type Changeset in the environment
6489    ///
6490    /// # Arguments
6491    ///
6492    /// * `name` - The name of the binding
6493    /// * `value` - The Changeset value to assign to the binding
6494    /// * `description` - The purpose of the input
6495    pub fn with_changeset_input(
6496        &self,
6497        name: impl Into<String>,
6498        value: impl IntoID<Id>,
6499        description: impl Into<String>,
6500    ) -> Env {
6501        let mut query = self.selection.select("withChangesetInput");
6502        query = query.arg("name", name.into());
6503        query = query.arg_lazy(
6504            "value",
6505            Box::new(move || {
6506                let value = value.clone();
6507                Box::pin(async move { value.into_id().await.unwrap().quote() })
6508            }),
6509        );
6510        query = query.arg("description", description.into());
6511        Env {
6512            proc: self.proc.clone(),
6513            selection: query,
6514            graphql_client: self.graphql_client.clone(),
6515        }
6516    }
6517    /// Declare a desired Changeset output to be assigned in the environment
6518    ///
6519    /// # Arguments
6520    ///
6521    /// * `name` - The name of the binding
6522    /// * `description` - A description of the desired value of the binding
6523    pub fn with_changeset_output(
6524        &self,
6525        name: impl Into<String>,
6526        description: impl Into<String>,
6527    ) -> Env {
6528        let mut query = self.selection.select("withChangesetOutput");
6529        query = query.arg("name", name.into());
6530        query = query.arg("description", description.into());
6531        Env {
6532            proc: self.proc.clone(),
6533            selection: query,
6534            graphql_client: self.graphql_client.clone(),
6535        }
6536    }
6537    /// Create or update a binding of type CheckGroup in the environment
6538    ///
6539    /// # Arguments
6540    ///
6541    /// * `name` - The name of the binding
6542    /// * `value` - The CheckGroup value to assign to the binding
6543    /// * `description` - The purpose of the input
6544    pub fn with_check_group_input(
6545        &self,
6546        name: impl Into<String>,
6547        value: impl IntoID<Id>,
6548        description: impl Into<String>,
6549    ) -> Env {
6550        let mut query = self.selection.select("withCheckGroupInput");
6551        query = query.arg("name", name.into());
6552        query = query.arg_lazy(
6553            "value",
6554            Box::new(move || {
6555                let value = value.clone();
6556                Box::pin(async move { value.into_id().await.unwrap().quote() })
6557            }),
6558        );
6559        query = query.arg("description", description.into());
6560        Env {
6561            proc: self.proc.clone(),
6562            selection: query,
6563            graphql_client: self.graphql_client.clone(),
6564        }
6565    }
6566    /// Declare a desired CheckGroup output to be assigned in the environment
6567    ///
6568    /// # Arguments
6569    ///
6570    /// * `name` - The name of the binding
6571    /// * `description` - A description of the desired value of the binding
6572    pub fn with_check_group_output(
6573        &self,
6574        name: impl Into<String>,
6575        description: impl Into<String>,
6576    ) -> Env {
6577        let mut query = self.selection.select("withCheckGroupOutput");
6578        query = query.arg("name", name.into());
6579        query = query.arg("description", description.into());
6580        Env {
6581            proc: self.proc.clone(),
6582            selection: query,
6583            graphql_client: self.graphql_client.clone(),
6584        }
6585    }
6586    /// Create or update a binding of type Check in the environment
6587    ///
6588    /// # Arguments
6589    ///
6590    /// * `name` - The name of the binding
6591    /// * `value` - The Check value to assign to the binding
6592    /// * `description` - The purpose of the input
6593    pub fn with_check_input(
6594        &self,
6595        name: impl Into<String>,
6596        value: impl IntoID<Id>,
6597        description: impl Into<String>,
6598    ) -> Env {
6599        let mut query = self.selection.select("withCheckInput");
6600        query = query.arg("name", name.into());
6601        query = query.arg_lazy(
6602            "value",
6603            Box::new(move || {
6604                let value = value.clone();
6605                Box::pin(async move { value.into_id().await.unwrap().quote() })
6606            }),
6607        );
6608        query = query.arg("description", description.into());
6609        Env {
6610            proc: self.proc.clone(),
6611            selection: query,
6612            graphql_client: self.graphql_client.clone(),
6613        }
6614    }
6615    /// Declare a desired Check output to be assigned in the environment
6616    ///
6617    /// # Arguments
6618    ///
6619    /// * `name` - The name of the binding
6620    /// * `description` - A description of the desired value of the binding
6621    pub fn with_check_output(
6622        &self,
6623        name: impl Into<String>,
6624        description: impl Into<String>,
6625    ) -> Env {
6626        let mut query = self.selection.select("withCheckOutput");
6627        query = query.arg("name", name.into());
6628        query = query.arg("description", description.into());
6629        Env {
6630            proc: self.proc.clone(),
6631            selection: query,
6632            graphql_client: self.graphql_client.clone(),
6633        }
6634    }
6635    /// Create or update a binding of type Cloud in the environment
6636    ///
6637    /// # Arguments
6638    ///
6639    /// * `name` - The name of the binding
6640    /// * `value` - The Cloud value to assign to the binding
6641    /// * `description` - The purpose of the input
6642    pub fn with_cloud_input(
6643        &self,
6644        name: impl Into<String>,
6645        value: impl IntoID<Id>,
6646        description: impl Into<String>,
6647    ) -> Env {
6648        let mut query = self.selection.select("withCloudInput");
6649        query = query.arg("name", name.into());
6650        query = query.arg_lazy(
6651            "value",
6652            Box::new(move || {
6653                let value = value.clone();
6654                Box::pin(async move { value.into_id().await.unwrap().quote() })
6655            }),
6656        );
6657        query = query.arg("description", description.into());
6658        Env {
6659            proc: self.proc.clone(),
6660            selection: query,
6661            graphql_client: self.graphql_client.clone(),
6662        }
6663    }
6664    /// Declare a desired Cloud output to be assigned in the environment
6665    ///
6666    /// # Arguments
6667    ///
6668    /// * `name` - The name of the binding
6669    /// * `description` - A description of the desired value of the binding
6670    pub fn with_cloud_output(
6671        &self,
6672        name: impl Into<String>,
6673        description: impl Into<String>,
6674    ) -> Env {
6675        let mut query = self.selection.select("withCloudOutput");
6676        query = query.arg("name", name.into());
6677        query = query.arg("description", description.into());
6678        Env {
6679            proc: self.proc.clone(),
6680            selection: query,
6681            graphql_client: self.graphql_client.clone(),
6682        }
6683    }
6684    /// Create or update a binding of type Container in the environment
6685    ///
6686    /// # Arguments
6687    ///
6688    /// * `name` - The name of the binding
6689    /// * `value` - The Container value to assign to the binding
6690    /// * `description` - The purpose of the input
6691    pub fn with_container_input(
6692        &self,
6693        name: impl Into<String>,
6694        value: impl IntoID<Id>,
6695        description: impl Into<String>,
6696    ) -> Env {
6697        let mut query = self.selection.select("withContainerInput");
6698        query = query.arg("name", name.into());
6699        query = query.arg_lazy(
6700            "value",
6701            Box::new(move || {
6702                let value = value.clone();
6703                Box::pin(async move { value.into_id().await.unwrap().quote() })
6704            }),
6705        );
6706        query = query.arg("description", description.into());
6707        Env {
6708            proc: self.proc.clone(),
6709            selection: query,
6710            graphql_client: self.graphql_client.clone(),
6711        }
6712    }
6713    /// Declare a desired Container output to be assigned in the environment
6714    ///
6715    /// # Arguments
6716    ///
6717    /// * `name` - The name of the binding
6718    /// * `description` - A description of the desired value of the binding
6719    pub fn with_container_output(
6720        &self,
6721        name: impl Into<String>,
6722        description: impl Into<String>,
6723    ) -> Env {
6724        let mut query = self.selection.select("withContainerOutput");
6725        query = query.arg("name", name.into());
6726        query = query.arg("description", description.into());
6727        Env {
6728            proc: self.proc.clone(),
6729            selection: query,
6730            graphql_client: self.graphql_client.clone(),
6731        }
6732    }
6733    /// Installs the current module into the environment, exposing its functions to the model
6734    /// Contextual path arguments will be populated using the environment's workspace.
6735    pub fn with_current_module(&self) -> Env {
6736        let query = self.selection.select("withCurrentModule");
6737        Env {
6738            proc: self.proc.clone(),
6739            selection: query,
6740            graphql_client: self.graphql_client.clone(),
6741        }
6742    }
6743    /// Create or update a binding of type DiffStat in the environment
6744    ///
6745    /// # Arguments
6746    ///
6747    /// * `name` - The name of the binding
6748    /// * `value` - The DiffStat value to assign to the binding
6749    /// * `description` - The purpose of the input
6750    pub fn with_diff_stat_input(
6751        &self,
6752        name: impl Into<String>,
6753        value: impl IntoID<Id>,
6754        description: impl Into<String>,
6755    ) -> Env {
6756        let mut query = self.selection.select("withDiffStatInput");
6757        query = query.arg("name", name.into());
6758        query = query.arg_lazy(
6759            "value",
6760            Box::new(move || {
6761                let value = value.clone();
6762                Box::pin(async move { value.into_id().await.unwrap().quote() })
6763            }),
6764        );
6765        query = query.arg("description", description.into());
6766        Env {
6767            proc: self.proc.clone(),
6768            selection: query,
6769            graphql_client: self.graphql_client.clone(),
6770        }
6771    }
6772    /// Declare a desired DiffStat output to be assigned in the environment
6773    ///
6774    /// # Arguments
6775    ///
6776    /// * `name` - The name of the binding
6777    /// * `description` - A description of the desired value of the binding
6778    pub fn with_diff_stat_output(
6779        &self,
6780        name: impl Into<String>,
6781        description: impl Into<String>,
6782    ) -> Env {
6783        let mut query = self.selection.select("withDiffStatOutput");
6784        query = query.arg("name", name.into());
6785        query = query.arg("description", description.into());
6786        Env {
6787            proc: self.proc.clone(),
6788            selection: query,
6789            graphql_client: self.graphql_client.clone(),
6790        }
6791    }
6792    /// Create or update a binding of type Directory in the environment
6793    ///
6794    /// # Arguments
6795    ///
6796    /// * `name` - The name of the binding
6797    /// * `value` - The Directory value to assign to the binding
6798    /// * `description` - The purpose of the input
6799    pub fn with_directory_input(
6800        &self,
6801        name: impl Into<String>,
6802        value: impl IntoID<Id>,
6803        description: impl Into<String>,
6804    ) -> Env {
6805        let mut query = self.selection.select("withDirectoryInput");
6806        query = query.arg("name", name.into());
6807        query = query.arg_lazy(
6808            "value",
6809            Box::new(move || {
6810                let value = value.clone();
6811                Box::pin(async move { value.into_id().await.unwrap().quote() })
6812            }),
6813        );
6814        query = query.arg("description", description.into());
6815        Env {
6816            proc: self.proc.clone(),
6817            selection: query,
6818            graphql_client: self.graphql_client.clone(),
6819        }
6820    }
6821    /// Declare a desired Directory output to be assigned in the environment
6822    ///
6823    /// # Arguments
6824    ///
6825    /// * `name` - The name of the binding
6826    /// * `description` - A description of the desired value of the binding
6827    pub fn with_directory_output(
6828        &self,
6829        name: impl Into<String>,
6830        description: impl Into<String>,
6831    ) -> Env {
6832        let mut query = self.selection.select("withDirectoryOutput");
6833        query = query.arg("name", name.into());
6834        query = query.arg("description", description.into());
6835        Env {
6836            proc: self.proc.clone(),
6837            selection: query,
6838            graphql_client: self.graphql_client.clone(),
6839        }
6840    }
6841    /// Create or update a binding of type EnvFile in the environment
6842    ///
6843    /// # Arguments
6844    ///
6845    /// * `name` - The name of the binding
6846    /// * `value` - The EnvFile value to assign to the binding
6847    /// * `description` - The purpose of the input
6848    pub fn with_env_file_input(
6849        &self,
6850        name: impl Into<String>,
6851        value: impl IntoID<Id>,
6852        description: impl Into<String>,
6853    ) -> Env {
6854        let mut query = self.selection.select("withEnvFileInput");
6855        query = query.arg("name", name.into());
6856        query = query.arg_lazy(
6857            "value",
6858            Box::new(move || {
6859                let value = value.clone();
6860                Box::pin(async move { value.into_id().await.unwrap().quote() })
6861            }),
6862        );
6863        query = query.arg("description", description.into());
6864        Env {
6865            proc: self.proc.clone(),
6866            selection: query,
6867            graphql_client: self.graphql_client.clone(),
6868        }
6869    }
6870    /// Declare a desired EnvFile output to be assigned in the environment
6871    ///
6872    /// # Arguments
6873    ///
6874    /// * `name` - The name of the binding
6875    /// * `description` - A description of the desired value of the binding
6876    pub fn with_env_file_output(
6877        &self,
6878        name: impl Into<String>,
6879        description: impl Into<String>,
6880    ) -> Env {
6881        let mut query = self.selection.select("withEnvFileOutput");
6882        query = query.arg("name", name.into());
6883        query = query.arg("description", description.into());
6884        Env {
6885            proc: self.proc.clone(),
6886            selection: query,
6887            graphql_client: self.graphql_client.clone(),
6888        }
6889    }
6890    /// Create or update a binding of type Env in the environment
6891    ///
6892    /// # Arguments
6893    ///
6894    /// * `name` - The name of the binding
6895    /// * `value` - The Env value to assign to the binding
6896    /// * `description` - The purpose of the input
6897    pub fn with_env_input(
6898        &self,
6899        name: impl Into<String>,
6900        value: impl IntoID<Id>,
6901        description: impl Into<String>,
6902    ) -> Env {
6903        let mut query = self.selection.select("withEnvInput");
6904        query = query.arg("name", name.into());
6905        query = query.arg_lazy(
6906            "value",
6907            Box::new(move || {
6908                let value = value.clone();
6909                Box::pin(async move { value.into_id().await.unwrap().quote() })
6910            }),
6911        );
6912        query = query.arg("description", description.into());
6913        Env {
6914            proc: self.proc.clone(),
6915            selection: query,
6916            graphql_client: self.graphql_client.clone(),
6917        }
6918    }
6919    /// Declare a desired Env output to be assigned in the environment
6920    ///
6921    /// # Arguments
6922    ///
6923    /// * `name` - The name of the binding
6924    /// * `description` - A description of the desired value of the binding
6925    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6926        let mut query = self.selection.select("withEnvOutput");
6927        query = query.arg("name", name.into());
6928        query = query.arg("description", description.into());
6929        Env {
6930            proc: self.proc.clone(),
6931            selection: query,
6932            graphql_client: self.graphql_client.clone(),
6933        }
6934    }
6935    /// Create or update a binding of type File in the environment
6936    ///
6937    /// # Arguments
6938    ///
6939    /// * `name` - The name of the binding
6940    /// * `value` - The File value to assign to the binding
6941    /// * `description` - The purpose of the input
6942    pub fn with_file_input(
6943        &self,
6944        name: impl Into<String>,
6945        value: impl IntoID<Id>,
6946        description: impl Into<String>,
6947    ) -> Env {
6948        let mut query = self.selection.select("withFileInput");
6949        query = query.arg("name", name.into());
6950        query = query.arg_lazy(
6951            "value",
6952            Box::new(move || {
6953                let value = value.clone();
6954                Box::pin(async move { value.into_id().await.unwrap().quote() })
6955            }),
6956        );
6957        query = query.arg("description", description.into());
6958        Env {
6959            proc: self.proc.clone(),
6960            selection: query,
6961            graphql_client: self.graphql_client.clone(),
6962        }
6963    }
6964    /// Declare a desired File output to be assigned in the environment
6965    ///
6966    /// # Arguments
6967    ///
6968    /// * `name` - The name of the binding
6969    /// * `description` - A description of the desired value of the binding
6970    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6971        let mut query = self.selection.select("withFileOutput");
6972        query = query.arg("name", name.into());
6973        query = query.arg("description", description.into());
6974        Env {
6975            proc: self.proc.clone(),
6976            selection: query,
6977            graphql_client: self.graphql_client.clone(),
6978        }
6979    }
6980    /// Create or update a binding of type GeneratorGroup in the environment
6981    ///
6982    /// # Arguments
6983    ///
6984    /// * `name` - The name of the binding
6985    /// * `value` - The GeneratorGroup value to assign to the binding
6986    /// * `description` - The purpose of the input
6987    pub fn with_generator_group_input(
6988        &self,
6989        name: impl Into<String>,
6990        value: impl IntoID<Id>,
6991        description: impl Into<String>,
6992    ) -> Env {
6993        let mut query = self.selection.select("withGeneratorGroupInput");
6994        query = query.arg("name", name.into());
6995        query = query.arg_lazy(
6996            "value",
6997            Box::new(move || {
6998                let value = value.clone();
6999                Box::pin(async move { value.into_id().await.unwrap().quote() })
7000            }),
7001        );
7002        query = query.arg("description", description.into());
7003        Env {
7004            proc: self.proc.clone(),
7005            selection: query,
7006            graphql_client: self.graphql_client.clone(),
7007        }
7008    }
7009    /// Declare a desired GeneratorGroup output to be assigned in the environment
7010    ///
7011    /// # Arguments
7012    ///
7013    /// * `name` - The name of the binding
7014    /// * `description` - A description of the desired value of the binding
7015    pub fn with_generator_group_output(
7016        &self,
7017        name: impl Into<String>,
7018        description: impl Into<String>,
7019    ) -> Env {
7020        let mut query = self.selection.select("withGeneratorGroupOutput");
7021        query = query.arg("name", name.into());
7022        query = query.arg("description", description.into());
7023        Env {
7024            proc: self.proc.clone(),
7025            selection: query,
7026            graphql_client: self.graphql_client.clone(),
7027        }
7028    }
7029    /// Create or update a binding of type Generator in the environment
7030    ///
7031    /// # Arguments
7032    ///
7033    /// * `name` - The name of the binding
7034    /// * `value` - The Generator value to assign to the binding
7035    /// * `description` - The purpose of the input
7036    pub fn with_generator_input(
7037        &self,
7038        name: impl Into<String>,
7039        value: impl IntoID<Id>,
7040        description: impl Into<String>,
7041    ) -> Env {
7042        let mut query = self.selection.select("withGeneratorInput");
7043        query = query.arg("name", name.into());
7044        query = query.arg_lazy(
7045            "value",
7046            Box::new(move || {
7047                let value = value.clone();
7048                Box::pin(async move { value.into_id().await.unwrap().quote() })
7049            }),
7050        );
7051        query = query.arg("description", description.into());
7052        Env {
7053            proc: self.proc.clone(),
7054            selection: query,
7055            graphql_client: self.graphql_client.clone(),
7056        }
7057    }
7058    /// Declare a desired Generator output to be assigned in the environment
7059    ///
7060    /// # Arguments
7061    ///
7062    /// * `name` - The name of the binding
7063    /// * `description` - A description of the desired value of the binding
7064    pub fn with_generator_output(
7065        &self,
7066        name: impl Into<String>,
7067        description: impl Into<String>,
7068    ) -> Env {
7069        let mut query = self.selection.select("withGeneratorOutput");
7070        query = query.arg("name", name.into());
7071        query = query.arg("description", description.into());
7072        Env {
7073            proc: self.proc.clone(),
7074            selection: query,
7075            graphql_client: self.graphql_client.clone(),
7076        }
7077    }
7078    /// Create or update a binding of type GitRef in the environment
7079    ///
7080    /// # Arguments
7081    ///
7082    /// * `name` - The name of the binding
7083    /// * `value` - The GitRef value to assign to the binding
7084    /// * `description` - The purpose of the input
7085    pub fn with_git_ref_input(
7086        &self,
7087        name: impl Into<String>,
7088        value: impl IntoID<Id>,
7089        description: impl Into<String>,
7090    ) -> Env {
7091        let mut query = self.selection.select("withGitRefInput");
7092        query = query.arg("name", name.into());
7093        query = query.arg_lazy(
7094            "value",
7095            Box::new(move || {
7096                let value = value.clone();
7097                Box::pin(async move { value.into_id().await.unwrap().quote() })
7098            }),
7099        );
7100        query = query.arg("description", description.into());
7101        Env {
7102            proc: self.proc.clone(),
7103            selection: query,
7104            graphql_client: self.graphql_client.clone(),
7105        }
7106    }
7107    /// Declare a desired GitRef output to be assigned in the environment
7108    ///
7109    /// # Arguments
7110    ///
7111    /// * `name` - The name of the binding
7112    /// * `description` - A description of the desired value of the binding
7113    pub fn with_git_ref_output(
7114        &self,
7115        name: impl Into<String>,
7116        description: impl Into<String>,
7117    ) -> Env {
7118        let mut query = self.selection.select("withGitRefOutput");
7119        query = query.arg("name", name.into());
7120        query = query.arg("description", description.into());
7121        Env {
7122            proc: self.proc.clone(),
7123            selection: query,
7124            graphql_client: self.graphql_client.clone(),
7125        }
7126    }
7127    /// Create or update a binding of type GitRepository in the environment
7128    ///
7129    /// # Arguments
7130    ///
7131    /// * `name` - The name of the binding
7132    /// * `value` - The GitRepository value to assign to the binding
7133    /// * `description` - The purpose of the input
7134    pub fn with_git_repository_input(
7135        &self,
7136        name: impl Into<String>,
7137        value: impl IntoID<Id>,
7138        description: impl Into<String>,
7139    ) -> Env {
7140        let mut query = self.selection.select("withGitRepositoryInput");
7141        query = query.arg("name", name.into());
7142        query = query.arg_lazy(
7143            "value",
7144            Box::new(move || {
7145                let value = value.clone();
7146                Box::pin(async move { value.into_id().await.unwrap().quote() })
7147            }),
7148        );
7149        query = query.arg("description", description.into());
7150        Env {
7151            proc: self.proc.clone(),
7152            selection: query,
7153            graphql_client: self.graphql_client.clone(),
7154        }
7155    }
7156    /// Declare a desired GitRepository output to be assigned in the environment
7157    ///
7158    /// # Arguments
7159    ///
7160    /// * `name` - The name of the binding
7161    /// * `description` - A description of the desired value of the binding
7162    pub fn with_git_repository_output(
7163        &self,
7164        name: impl Into<String>,
7165        description: impl Into<String>,
7166    ) -> Env {
7167        let mut query = self.selection.select("withGitRepositoryOutput");
7168        query = query.arg("name", name.into());
7169        query = query.arg("description", description.into());
7170        Env {
7171            proc: self.proc.clone(),
7172            selection: query,
7173            graphql_client: self.graphql_client.clone(),
7174        }
7175    }
7176    /// Create or update a binding of type HTTPState in the environment
7177    ///
7178    /// # Arguments
7179    ///
7180    /// * `name` - The name of the binding
7181    /// * `value` - The HTTPState value to assign to the binding
7182    /// * `description` - The purpose of the input
7183    pub fn with_http_state_input(
7184        &self,
7185        name: impl Into<String>,
7186        value: impl IntoID<Id>,
7187        description: impl Into<String>,
7188    ) -> Env {
7189        let mut query = self.selection.select("withHTTPStateInput");
7190        query = query.arg("name", name.into());
7191        query = query.arg_lazy(
7192            "value",
7193            Box::new(move || {
7194                let value = value.clone();
7195                Box::pin(async move { value.into_id().await.unwrap().quote() })
7196            }),
7197        );
7198        query = query.arg("description", description.into());
7199        Env {
7200            proc: self.proc.clone(),
7201            selection: query,
7202            graphql_client: self.graphql_client.clone(),
7203        }
7204    }
7205    /// Declare a desired HTTPState output to be assigned in the environment
7206    ///
7207    /// # Arguments
7208    ///
7209    /// * `name` - The name of the binding
7210    /// * `description` - A description of the desired value of the binding
7211    pub fn with_http_state_output(
7212        &self,
7213        name: impl Into<String>,
7214        description: impl Into<String>,
7215    ) -> Env {
7216        let mut query = self.selection.select("withHTTPStateOutput");
7217        query = query.arg("name", name.into());
7218        query = query.arg("description", description.into());
7219        Env {
7220            proc: self.proc.clone(),
7221            selection: query,
7222            graphql_client: self.graphql_client.clone(),
7223        }
7224    }
7225    /// Create or update a binding of type JSONValue in the environment
7226    ///
7227    /// # Arguments
7228    ///
7229    /// * `name` - The name of the binding
7230    /// * `value` - The JSONValue value to assign to the binding
7231    /// * `description` - The purpose of the input
7232    pub fn with_json_value_input(
7233        &self,
7234        name: impl Into<String>,
7235        value: impl IntoID<Id>,
7236        description: impl Into<String>,
7237    ) -> Env {
7238        let mut query = self.selection.select("withJSONValueInput");
7239        query = query.arg("name", name.into());
7240        query = query.arg_lazy(
7241            "value",
7242            Box::new(move || {
7243                let value = value.clone();
7244                Box::pin(async move { value.into_id().await.unwrap().quote() })
7245            }),
7246        );
7247        query = query.arg("description", description.into());
7248        Env {
7249            proc: self.proc.clone(),
7250            selection: query,
7251            graphql_client: self.graphql_client.clone(),
7252        }
7253    }
7254    /// Declare a desired JSONValue output to be assigned in the environment
7255    ///
7256    /// # Arguments
7257    ///
7258    /// * `name` - The name of the binding
7259    /// * `description` - A description of the desired value of the binding
7260    pub fn with_json_value_output(
7261        &self,
7262        name: impl Into<String>,
7263        description: impl Into<String>,
7264    ) -> Env {
7265        let mut query = self.selection.select("withJSONValueOutput");
7266        query = query.arg("name", name.into());
7267        query = query.arg("description", description.into());
7268        Env {
7269            proc: self.proc.clone(),
7270            selection: query,
7271            graphql_client: self.graphql_client.clone(),
7272        }
7273    }
7274    /// Sets the main module for this environment (the project being worked on)
7275    /// Contextual path arguments will be populated using the environment's workspace.
7276    pub fn with_main_module(&self, module: impl IntoID<Id>) -> Env {
7277        let mut query = self.selection.select("withMainModule");
7278        query = query.arg_lazy(
7279            "module",
7280            Box::new(move || {
7281                let module = module.clone();
7282                Box::pin(async move { module.into_id().await.unwrap().quote() })
7283            }),
7284        );
7285        Env {
7286            proc: self.proc.clone(),
7287            selection: query,
7288            graphql_client: self.graphql_client.clone(),
7289        }
7290    }
7291    /// Installs a module into the environment, exposing its functions to the model
7292    /// Contextual path arguments will be populated using the environment's workspace.
7293    pub fn with_module(&self, module: impl IntoID<Id>) -> Env {
7294        let mut query = self.selection.select("withModule");
7295        query = query.arg_lazy(
7296            "module",
7297            Box::new(move || {
7298                let module = module.clone();
7299                Box::pin(async move { module.into_id().await.unwrap().quote() })
7300            }),
7301        );
7302        Env {
7303            proc: self.proc.clone(),
7304            selection: query,
7305            graphql_client: self.graphql_client.clone(),
7306        }
7307    }
7308    /// Create or update a binding of type ModuleConfigClient in the environment
7309    ///
7310    /// # Arguments
7311    ///
7312    /// * `name` - The name of the binding
7313    /// * `value` - The ModuleConfigClient value to assign to the binding
7314    /// * `description` - The purpose of the input
7315    pub fn with_module_config_client_input(
7316        &self,
7317        name: impl Into<String>,
7318        value: impl IntoID<Id>,
7319        description: impl Into<String>,
7320    ) -> Env {
7321        let mut query = self.selection.select("withModuleConfigClientInput");
7322        query = query.arg("name", name.into());
7323        query = query.arg_lazy(
7324            "value",
7325            Box::new(move || {
7326                let value = value.clone();
7327                Box::pin(async move { value.into_id().await.unwrap().quote() })
7328            }),
7329        );
7330        query = query.arg("description", description.into());
7331        Env {
7332            proc: self.proc.clone(),
7333            selection: query,
7334            graphql_client: self.graphql_client.clone(),
7335        }
7336    }
7337    /// Declare a desired ModuleConfigClient output to be assigned in the environment
7338    ///
7339    /// # Arguments
7340    ///
7341    /// * `name` - The name of the binding
7342    /// * `description` - A description of the desired value of the binding
7343    pub fn with_module_config_client_output(
7344        &self,
7345        name: impl Into<String>,
7346        description: impl Into<String>,
7347    ) -> Env {
7348        let mut query = self.selection.select("withModuleConfigClientOutput");
7349        query = query.arg("name", name.into());
7350        query = query.arg("description", description.into());
7351        Env {
7352            proc: self.proc.clone(),
7353            selection: query,
7354            graphql_client: self.graphql_client.clone(),
7355        }
7356    }
7357    /// Create or update a binding of type Module in the environment
7358    ///
7359    /// # Arguments
7360    ///
7361    /// * `name` - The name of the binding
7362    /// * `value` - The Module value to assign to the binding
7363    /// * `description` - The purpose of the input
7364    pub fn with_module_input(
7365        &self,
7366        name: impl Into<String>,
7367        value: impl IntoID<Id>,
7368        description: impl Into<String>,
7369    ) -> Env {
7370        let mut query = self.selection.select("withModuleInput");
7371        query = query.arg("name", name.into());
7372        query = query.arg_lazy(
7373            "value",
7374            Box::new(move || {
7375                let value = value.clone();
7376                Box::pin(async move { value.into_id().await.unwrap().quote() })
7377            }),
7378        );
7379        query = query.arg("description", description.into());
7380        Env {
7381            proc: self.proc.clone(),
7382            selection: query,
7383            graphql_client: self.graphql_client.clone(),
7384        }
7385    }
7386    /// Declare a desired Module output to be assigned in the environment
7387    ///
7388    /// # Arguments
7389    ///
7390    /// * `name` - The name of the binding
7391    /// * `description` - A description of the desired value of the binding
7392    pub fn with_module_output(
7393        &self,
7394        name: impl Into<String>,
7395        description: impl Into<String>,
7396    ) -> Env {
7397        let mut query = self.selection.select("withModuleOutput");
7398        query = query.arg("name", name.into());
7399        query = query.arg("description", description.into());
7400        Env {
7401            proc: self.proc.clone(),
7402            selection: query,
7403            graphql_client: self.graphql_client.clone(),
7404        }
7405    }
7406    /// Create or update a binding of type ModuleSource in the environment
7407    ///
7408    /// # Arguments
7409    ///
7410    /// * `name` - The name of the binding
7411    /// * `value` - The ModuleSource value to assign to the binding
7412    /// * `description` - The purpose of the input
7413    pub fn with_module_source_input(
7414        &self,
7415        name: impl Into<String>,
7416        value: impl IntoID<Id>,
7417        description: impl Into<String>,
7418    ) -> Env {
7419        let mut query = self.selection.select("withModuleSourceInput");
7420        query = query.arg("name", name.into());
7421        query = query.arg_lazy(
7422            "value",
7423            Box::new(move || {
7424                let value = value.clone();
7425                Box::pin(async move { value.into_id().await.unwrap().quote() })
7426            }),
7427        );
7428        query = query.arg("description", description.into());
7429        Env {
7430            proc: self.proc.clone(),
7431            selection: query,
7432            graphql_client: self.graphql_client.clone(),
7433        }
7434    }
7435    /// Declare a desired ModuleSource output to be assigned in the environment
7436    ///
7437    /// # Arguments
7438    ///
7439    /// * `name` - The name of the binding
7440    /// * `description` - A description of the desired value of the binding
7441    pub fn with_module_source_output(
7442        &self,
7443        name: impl Into<String>,
7444        description: impl Into<String>,
7445    ) -> Env {
7446        let mut query = self.selection.select("withModuleSourceOutput");
7447        query = query.arg("name", name.into());
7448        query = query.arg("description", description.into());
7449        Env {
7450            proc: self.proc.clone(),
7451            selection: query,
7452            graphql_client: self.graphql_client.clone(),
7453        }
7454    }
7455    /// Create or update a binding of type SearchResult in the environment
7456    ///
7457    /// # Arguments
7458    ///
7459    /// * `name` - The name of the binding
7460    /// * `value` - The SearchResult value to assign to the binding
7461    /// * `description` - The purpose of the input
7462    pub fn with_search_result_input(
7463        &self,
7464        name: impl Into<String>,
7465        value: impl IntoID<Id>,
7466        description: impl Into<String>,
7467    ) -> Env {
7468        let mut query = self.selection.select("withSearchResultInput");
7469        query = query.arg("name", name.into());
7470        query = query.arg_lazy(
7471            "value",
7472            Box::new(move || {
7473                let value = value.clone();
7474                Box::pin(async move { value.into_id().await.unwrap().quote() })
7475            }),
7476        );
7477        query = query.arg("description", description.into());
7478        Env {
7479            proc: self.proc.clone(),
7480            selection: query,
7481            graphql_client: self.graphql_client.clone(),
7482        }
7483    }
7484    /// Declare a desired SearchResult output to be assigned in the environment
7485    ///
7486    /// # Arguments
7487    ///
7488    /// * `name` - The name of the binding
7489    /// * `description` - A description of the desired value of the binding
7490    pub fn with_search_result_output(
7491        &self,
7492        name: impl Into<String>,
7493        description: impl Into<String>,
7494    ) -> Env {
7495        let mut query = self.selection.select("withSearchResultOutput");
7496        query = query.arg("name", name.into());
7497        query = query.arg("description", description.into());
7498        Env {
7499            proc: self.proc.clone(),
7500            selection: query,
7501            graphql_client: self.graphql_client.clone(),
7502        }
7503    }
7504    /// Create or update a binding of type SearchSubmatch in the environment
7505    ///
7506    /// # Arguments
7507    ///
7508    /// * `name` - The name of the binding
7509    /// * `value` - The SearchSubmatch value to assign to the binding
7510    /// * `description` - The purpose of the input
7511    pub fn with_search_submatch_input(
7512        &self,
7513        name: impl Into<String>,
7514        value: impl IntoID<Id>,
7515        description: impl Into<String>,
7516    ) -> Env {
7517        let mut query = self.selection.select("withSearchSubmatchInput");
7518        query = query.arg("name", name.into());
7519        query = query.arg_lazy(
7520            "value",
7521            Box::new(move || {
7522                let value = value.clone();
7523                Box::pin(async move { value.into_id().await.unwrap().quote() })
7524            }),
7525        );
7526        query = query.arg("description", description.into());
7527        Env {
7528            proc: self.proc.clone(),
7529            selection: query,
7530            graphql_client: self.graphql_client.clone(),
7531        }
7532    }
7533    /// Declare a desired SearchSubmatch output to be assigned in the environment
7534    ///
7535    /// # Arguments
7536    ///
7537    /// * `name` - The name of the binding
7538    /// * `description` - A description of the desired value of the binding
7539    pub fn with_search_submatch_output(
7540        &self,
7541        name: impl Into<String>,
7542        description: impl Into<String>,
7543    ) -> Env {
7544        let mut query = self.selection.select("withSearchSubmatchOutput");
7545        query = query.arg("name", name.into());
7546        query = query.arg("description", description.into());
7547        Env {
7548            proc: self.proc.clone(),
7549            selection: query,
7550            graphql_client: self.graphql_client.clone(),
7551        }
7552    }
7553    /// Create or update a binding of type Secret in the environment
7554    ///
7555    /// # Arguments
7556    ///
7557    /// * `name` - The name of the binding
7558    /// * `value` - The Secret value to assign to the binding
7559    /// * `description` - The purpose of the input
7560    pub fn with_secret_input(
7561        &self,
7562        name: impl Into<String>,
7563        value: impl IntoID<Id>,
7564        description: impl Into<String>,
7565    ) -> Env {
7566        let mut query = self.selection.select("withSecretInput");
7567        query = query.arg("name", name.into());
7568        query = query.arg_lazy(
7569            "value",
7570            Box::new(move || {
7571                let value = value.clone();
7572                Box::pin(async move { value.into_id().await.unwrap().quote() })
7573            }),
7574        );
7575        query = query.arg("description", description.into());
7576        Env {
7577            proc: self.proc.clone(),
7578            selection: query,
7579            graphql_client: self.graphql_client.clone(),
7580        }
7581    }
7582    /// Declare a desired Secret output to be assigned in the environment
7583    ///
7584    /// # Arguments
7585    ///
7586    /// * `name` - The name of the binding
7587    /// * `description` - A description of the desired value of the binding
7588    pub fn with_secret_output(
7589        &self,
7590        name: impl Into<String>,
7591        description: impl Into<String>,
7592    ) -> Env {
7593        let mut query = self.selection.select("withSecretOutput");
7594        query = query.arg("name", name.into());
7595        query = query.arg("description", description.into());
7596        Env {
7597            proc: self.proc.clone(),
7598            selection: query,
7599            graphql_client: self.graphql_client.clone(),
7600        }
7601    }
7602    /// Create or update a binding of type Service in the environment
7603    ///
7604    /// # Arguments
7605    ///
7606    /// * `name` - The name of the binding
7607    /// * `value` - The Service value to assign to the binding
7608    /// * `description` - The purpose of the input
7609    pub fn with_service_input(
7610        &self,
7611        name: impl Into<String>,
7612        value: impl IntoID<Id>,
7613        description: impl Into<String>,
7614    ) -> Env {
7615        let mut query = self.selection.select("withServiceInput");
7616        query = query.arg("name", name.into());
7617        query = query.arg_lazy(
7618            "value",
7619            Box::new(move || {
7620                let value = value.clone();
7621                Box::pin(async move { value.into_id().await.unwrap().quote() })
7622            }),
7623        );
7624        query = query.arg("description", description.into());
7625        Env {
7626            proc: self.proc.clone(),
7627            selection: query,
7628            graphql_client: self.graphql_client.clone(),
7629        }
7630    }
7631    /// Declare a desired Service output to be assigned in the environment
7632    ///
7633    /// # Arguments
7634    ///
7635    /// * `name` - The name of the binding
7636    /// * `description` - A description of the desired value of the binding
7637    pub fn with_service_output(
7638        &self,
7639        name: impl Into<String>,
7640        description: impl Into<String>,
7641    ) -> Env {
7642        let mut query = self.selection.select("withServiceOutput");
7643        query = query.arg("name", name.into());
7644        query = query.arg("description", description.into());
7645        Env {
7646            proc: self.proc.clone(),
7647            selection: query,
7648            graphql_client: self.graphql_client.clone(),
7649        }
7650    }
7651    /// Create or update a binding of type Socket in the environment
7652    ///
7653    /// # Arguments
7654    ///
7655    /// * `name` - The name of the binding
7656    /// * `value` - The Socket value to assign to the binding
7657    /// * `description` - The purpose of the input
7658    pub fn with_socket_input(
7659        &self,
7660        name: impl Into<String>,
7661        value: impl IntoID<Id>,
7662        description: impl Into<String>,
7663    ) -> Env {
7664        let mut query = self.selection.select("withSocketInput");
7665        query = query.arg("name", name.into());
7666        query = query.arg_lazy(
7667            "value",
7668            Box::new(move || {
7669                let value = value.clone();
7670                Box::pin(async move { value.into_id().await.unwrap().quote() })
7671            }),
7672        );
7673        query = query.arg("description", description.into());
7674        Env {
7675            proc: self.proc.clone(),
7676            selection: query,
7677            graphql_client: self.graphql_client.clone(),
7678        }
7679    }
7680    /// Declare a desired Socket output to be assigned in the environment
7681    ///
7682    /// # Arguments
7683    ///
7684    /// * `name` - The name of the binding
7685    /// * `description` - A description of the desired value of the binding
7686    pub fn with_socket_output(
7687        &self,
7688        name: impl Into<String>,
7689        description: impl Into<String>,
7690    ) -> Env {
7691        let mut query = self.selection.select("withSocketOutput");
7692        query = query.arg("name", name.into());
7693        query = query.arg("description", description.into());
7694        Env {
7695            proc: self.proc.clone(),
7696            selection: query,
7697            graphql_client: self.graphql_client.clone(),
7698        }
7699    }
7700    /// Create or update a binding of type Stat in the environment
7701    ///
7702    /// # Arguments
7703    ///
7704    /// * `name` - The name of the binding
7705    /// * `value` - The Stat value to assign to the binding
7706    /// * `description` - The purpose of the input
7707    pub fn with_stat_input(
7708        &self,
7709        name: impl Into<String>,
7710        value: impl IntoID<Id>,
7711        description: impl Into<String>,
7712    ) -> Env {
7713        let mut query = self.selection.select("withStatInput");
7714        query = query.arg("name", name.into());
7715        query = query.arg_lazy(
7716            "value",
7717            Box::new(move || {
7718                let value = value.clone();
7719                Box::pin(async move { value.into_id().await.unwrap().quote() })
7720            }),
7721        );
7722        query = query.arg("description", description.into());
7723        Env {
7724            proc: self.proc.clone(),
7725            selection: query,
7726            graphql_client: self.graphql_client.clone(),
7727        }
7728    }
7729    /// Declare a desired Stat output to be assigned in the environment
7730    ///
7731    /// # Arguments
7732    ///
7733    /// * `name` - The name of the binding
7734    /// * `description` - A description of the desired value of the binding
7735    pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7736        let mut query = self.selection.select("withStatOutput");
7737        query = query.arg("name", name.into());
7738        query = query.arg("description", description.into());
7739        Env {
7740            proc: self.proc.clone(),
7741            selection: query,
7742            graphql_client: self.graphql_client.clone(),
7743        }
7744    }
7745    /// Provides a string input binding to the environment
7746    ///
7747    /// # Arguments
7748    ///
7749    /// * `name` - The name of the binding
7750    /// * `value` - The string value to assign to the binding
7751    /// * `description` - The description of the input
7752    pub fn with_string_input(
7753        &self,
7754        name: impl Into<String>,
7755        value: impl Into<String>,
7756        description: impl Into<String>,
7757    ) -> Env {
7758        let mut query = self.selection.select("withStringInput");
7759        query = query.arg("name", name.into());
7760        query = query.arg("value", value.into());
7761        query = query.arg("description", description.into());
7762        Env {
7763            proc: self.proc.clone(),
7764            selection: query,
7765            graphql_client: self.graphql_client.clone(),
7766        }
7767    }
7768    /// Declares a desired string output binding
7769    ///
7770    /// # Arguments
7771    ///
7772    /// * `name` - The name of the binding
7773    /// * `description` - The description of the output
7774    pub fn with_string_output(
7775        &self,
7776        name: impl Into<String>,
7777        description: impl Into<String>,
7778    ) -> Env {
7779        let mut query = self.selection.select("withStringOutput");
7780        query = query.arg("name", name.into());
7781        query = query.arg("description", description.into());
7782        Env {
7783            proc: self.proc.clone(),
7784            selection: query,
7785            graphql_client: self.graphql_client.clone(),
7786        }
7787    }
7788    /// Create or update a binding of type UpGroup in the environment
7789    ///
7790    /// # Arguments
7791    ///
7792    /// * `name` - The name of the binding
7793    /// * `value` - The UpGroup value to assign to the binding
7794    /// * `description` - The purpose of the input
7795    pub fn with_up_group_input(
7796        &self,
7797        name: impl Into<String>,
7798        value: impl IntoID<Id>,
7799        description: impl Into<String>,
7800    ) -> Env {
7801        let mut query = self.selection.select("withUpGroupInput");
7802        query = query.arg("name", name.into());
7803        query = query.arg_lazy(
7804            "value",
7805            Box::new(move || {
7806                let value = value.clone();
7807                Box::pin(async move { value.into_id().await.unwrap().quote() })
7808            }),
7809        );
7810        query = query.arg("description", description.into());
7811        Env {
7812            proc: self.proc.clone(),
7813            selection: query,
7814            graphql_client: self.graphql_client.clone(),
7815        }
7816    }
7817    /// Declare a desired UpGroup output to be assigned in the environment
7818    ///
7819    /// # Arguments
7820    ///
7821    /// * `name` - The name of the binding
7822    /// * `description` - A description of the desired value of the binding
7823    pub fn with_up_group_output(
7824        &self,
7825        name: impl Into<String>,
7826        description: impl Into<String>,
7827    ) -> Env {
7828        let mut query = self.selection.select("withUpGroupOutput");
7829        query = query.arg("name", name.into());
7830        query = query.arg("description", description.into());
7831        Env {
7832            proc: self.proc.clone(),
7833            selection: query,
7834            graphql_client: self.graphql_client.clone(),
7835        }
7836    }
7837    /// Create or update a binding of type Up in the environment
7838    ///
7839    /// # Arguments
7840    ///
7841    /// * `name` - The name of the binding
7842    /// * `value` - The Up value to assign to the binding
7843    /// * `description` - The purpose of the input
7844    pub fn with_up_input(
7845        &self,
7846        name: impl Into<String>,
7847        value: impl IntoID<Id>,
7848        description: impl Into<String>,
7849    ) -> Env {
7850        let mut query = self.selection.select("withUpInput");
7851        query = query.arg("name", name.into());
7852        query = query.arg_lazy(
7853            "value",
7854            Box::new(move || {
7855                let value = value.clone();
7856                Box::pin(async move { value.into_id().await.unwrap().quote() })
7857            }),
7858        );
7859        query = query.arg("description", description.into());
7860        Env {
7861            proc: self.proc.clone(),
7862            selection: query,
7863            graphql_client: self.graphql_client.clone(),
7864        }
7865    }
7866    /// Declare a desired Up output to be assigned in the environment
7867    ///
7868    /// # Arguments
7869    ///
7870    /// * `name` - The name of the binding
7871    /// * `description` - A description of the desired value of the binding
7872    pub fn with_up_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7873        let mut query = self.selection.select("withUpOutput");
7874        query = query.arg("name", name.into());
7875        query = query.arg("description", description.into());
7876        Env {
7877            proc: self.proc.clone(),
7878            selection: query,
7879            graphql_client: self.graphql_client.clone(),
7880        }
7881    }
7882    /// Returns a new environment with the provided workspace
7883    ///
7884    /// # Arguments
7885    ///
7886    /// * `workspace` - The directory to set as the host filesystem
7887    pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Env {
7888        let mut query = self.selection.select("withWorkspace");
7889        query = query.arg_lazy(
7890            "workspace",
7891            Box::new(move || {
7892                let workspace = workspace.clone();
7893                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
7894            }),
7895        );
7896        Env {
7897            proc: self.proc.clone(),
7898            selection: query,
7899            graphql_client: self.graphql_client.clone(),
7900        }
7901    }
7902    /// Create or update a binding of type Workspace in the environment
7903    ///
7904    /// # Arguments
7905    ///
7906    /// * `name` - The name of the binding
7907    /// * `value` - The Workspace value to assign to the binding
7908    /// * `description` - The purpose of the input
7909    pub fn with_workspace_input(
7910        &self,
7911        name: impl Into<String>,
7912        value: impl IntoID<Id>,
7913        description: impl Into<String>,
7914    ) -> Env {
7915        let mut query = self.selection.select("withWorkspaceInput");
7916        query = query.arg("name", name.into());
7917        query = query.arg_lazy(
7918            "value",
7919            Box::new(move || {
7920                let value = value.clone();
7921                Box::pin(async move { value.into_id().await.unwrap().quote() })
7922            }),
7923        );
7924        query = query.arg("description", description.into());
7925        Env {
7926            proc: self.proc.clone(),
7927            selection: query,
7928            graphql_client: self.graphql_client.clone(),
7929        }
7930    }
7931    /// Declare a desired Workspace output to be assigned in the environment
7932    ///
7933    /// # Arguments
7934    ///
7935    /// * `name` - The name of the binding
7936    /// * `description` - A description of the desired value of the binding
7937    pub fn with_workspace_output(
7938        &self,
7939        name: impl Into<String>,
7940        description: impl Into<String>,
7941    ) -> Env {
7942        let mut query = self.selection.select("withWorkspaceOutput");
7943        query = query.arg("name", name.into());
7944        query = query.arg("description", description.into());
7945        Env {
7946            proc: self.proc.clone(),
7947            selection: query,
7948            graphql_client: self.graphql_client.clone(),
7949        }
7950    }
7951    /// Returns a new environment without any outputs
7952    pub fn without_outputs(&self) -> Env {
7953        let query = self.selection.select("withoutOutputs");
7954        Env {
7955            proc: self.proc.clone(),
7956            selection: query,
7957            graphql_client: self.graphql_client.clone(),
7958        }
7959    }
7960    pub fn workspace(&self) -> Directory {
7961        let query = self.selection.select("workspace");
7962        Directory {
7963            proc: self.proc.clone(),
7964            selection: query,
7965            graphql_client: self.graphql_client.clone(),
7966        }
7967    }
7968}
7969impl Node for Env {
7970    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
7971        let query = self.selection.select("id");
7972        let graphql_client = self.graphql_client.clone();
7973        async move { query.execute(graphql_client).await }
7974    }
7975}
7976#[derive(Clone)]
7977pub struct EnvFile {
7978    pub proc: Option<Arc<DaggerSessionProc>>,
7979    pub selection: Selection,
7980    pub graphql_client: DynGraphQLClient,
7981}
7982#[derive(Builder, Debug, PartialEq)]
7983pub struct EnvFileGetOpts {
7984    /// Return the value exactly as written to the file. No quote removal or variable expansion
7985    #[builder(setter(into, strip_option), default)]
7986    pub raw: Option<bool>,
7987}
7988#[derive(Builder, Debug, PartialEq)]
7989pub struct EnvFileVariablesOpts {
7990    /// Return values exactly as written to the file. No quote removal or variable expansion
7991    #[builder(setter(into, strip_option), default)]
7992    pub raw: Option<bool>,
7993}
7994impl IntoID<Id> for EnvFile {
7995    fn into_id(
7996        self,
7997    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
7998        Box::pin(async move { self.id().await })
7999    }
8000}
8001impl Loadable for EnvFile {
8002    fn graphql_type() -> &'static str {
8003        "EnvFile"
8004    }
8005    fn from_query(
8006        proc: Option<Arc<DaggerSessionProc>>,
8007        selection: Selection,
8008        graphql_client: DynGraphQLClient,
8009    ) -> Self {
8010        Self {
8011            proc,
8012            selection,
8013            graphql_client,
8014        }
8015    }
8016}
8017impl EnvFile {
8018    /// Return as a file
8019    pub fn as_file(&self) -> File {
8020        let query = self.selection.select("asFile");
8021        File {
8022            proc: self.proc.clone(),
8023            selection: query,
8024            graphql_client: self.graphql_client.clone(),
8025        }
8026    }
8027    /// Check if a variable exists
8028    ///
8029    /// # Arguments
8030    ///
8031    /// * `name` - Variable name
8032    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8033        let mut query = self.selection.select("exists");
8034        query = query.arg("name", name.into());
8035        query.execute(self.graphql_client.clone()).await
8036    }
8037    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8038    ///
8039    /// # Arguments
8040    ///
8041    /// * `name` - Variable name
8042    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8043    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8044        let mut query = self.selection.select("get");
8045        query = query.arg("name", name.into());
8046        query.execute(self.graphql_client.clone()).await
8047    }
8048    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8049    ///
8050    /// # Arguments
8051    ///
8052    /// * `name` - Variable name
8053    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8054    pub async fn get_opts(
8055        &self,
8056        name: impl Into<String>,
8057        opts: EnvFileGetOpts,
8058    ) -> Result<String, DaggerError> {
8059        let mut query = self.selection.select("get");
8060        query = query.arg("name", name.into());
8061        if let Some(raw) = opts.raw {
8062            query = query.arg("raw", raw);
8063        }
8064        query.execute(self.graphql_client.clone()).await
8065    }
8066    /// A unique identifier for this EnvFile.
8067    pub async fn id(&self) -> Result<Id, DaggerError> {
8068        let query = self.selection.select("id");
8069        query.execute(self.graphql_client.clone()).await
8070    }
8071    /// 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
8072    ///
8073    /// # Arguments
8074    ///
8075    /// * `prefix` - The prefix to filter by
8076    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8077        let mut query = self.selection.select("namespace");
8078        query = query.arg("prefix", prefix.into());
8079        EnvFile {
8080            proc: self.proc.clone(),
8081            selection: query,
8082            graphql_client: self.graphql_client.clone(),
8083        }
8084    }
8085    /// Return all variables
8086    ///
8087    /// # Arguments
8088    ///
8089    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8090    pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
8091        let query = self.selection.select("variables");
8092        let query = query.select("id");
8093        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8094        Ok(ids
8095            .into_iter()
8096            .map(|id| EnvVariable {
8097                proc: self.proc.clone(),
8098                selection: crate::querybuilder::query()
8099                    .select("node")
8100                    .arg("id", &id.0)
8101                    .inline_fragment("EnvVariable"),
8102                graphql_client: self.graphql_client.clone(),
8103            })
8104            .collect())
8105    }
8106    /// Return all variables
8107    ///
8108    /// # Arguments
8109    ///
8110    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8111    pub async fn variables_opts(
8112        &self,
8113        opts: EnvFileVariablesOpts,
8114    ) -> Result<Vec<EnvVariable>, DaggerError> {
8115        let mut query = self.selection.select("variables");
8116        if let Some(raw) = opts.raw {
8117            query = query.arg("raw", raw);
8118        }
8119        let query = query.select("id");
8120        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8121        Ok(ids
8122            .into_iter()
8123            .map(|id| EnvVariable {
8124                proc: self.proc.clone(),
8125                selection: crate::querybuilder::query()
8126                    .select("node")
8127                    .arg("id", &id.0)
8128                    .inline_fragment("EnvVariable"),
8129                graphql_client: self.graphql_client.clone(),
8130            })
8131            .collect())
8132    }
8133    /// Add a variable
8134    ///
8135    /// # Arguments
8136    ///
8137    /// * `name` - Variable name
8138    /// * `value` - Variable value
8139    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8140        let mut query = self.selection.select("withVariable");
8141        query = query.arg("name", name.into());
8142        query = query.arg("value", value.into());
8143        EnvFile {
8144            proc: self.proc.clone(),
8145            selection: query,
8146            graphql_client: self.graphql_client.clone(),
8147        }
8148    }
8149    /// Remove all occurrences of the named variable
8150    ///
8151    /// # Arguments
8152    ///
8153    /// * `name` - Variable name
8154    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8155        let mut query = self.selection.select("withoutVariable");
8156        query = query.arg("name", name.into());
8157        EnvFile {
8158            proc: self.proc.clone(),
8159            selection: query,
8160            graphql_client: self.graphql_client.clone(),
8161        }
8162    }
8163}
8164impl Node for EnvFile {
8165    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8166        let query = self.selection.select("id");
8167        let graphql_client = self.graphql_client.clone();
8168        async move { query.execute(graphql_client).await }
8169    }
8170}
8171#[derive(Clone)]
8172pub struct EnvVariable {
8173    pub proc: Option<Arc<DaggerSessionProc>>,
8174    pub selection: Selection,
8175    pub graphql_client: DynGraphQLClient,
8176}
8177impl IntoID<Id> for EnvVariable {
8178    fn into_id(
8179        self,
8180    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8181        Box::pin(async move { self.id().await })
8182    }
8183}
8184impl Loadable for EnvVariable {
8185    fn graphql_type() -> &'static str {
8186        "EnvVariable"
8187    }
8188    fn from_query(
8189        proc: Option<Arc<DaggerSessionProc>>,
8190        selection: Selection,
8191        graphql_client: DynGraphQLClient,
8192    ) -> Self {
8193        Self {
8194            proc,
8195            selection,
8196            graphql_client,
8197        }
8198    }
8199}
8200impl EnvVariable {
8201    /// A unique identifier for this EnvVariable.
8202    pub async fn id(&self) -> Result<Id, DaggerError> {
8203        let query = self.selection.select("id");
8204        query.execute(self.graphql_client.clone()).await
8205    }
8206    /// The environment variable name.
8207    pub async fn name(&self) -> Result<String, DaggerError> {
8208        let query = self.selection.select("name");
8209        query.execute(self.graphql_client.clone()).await
8210    }
8211    /// The environment variable value.
8212    pub async fn value(&self) -> Result<String, DaggerError> {
8213        let query = self.selection.select("value");
8214        query.execute(self.graphql_client.clone()).await
8215    }
8216}
8217impl Node for EnvVariable {
8218    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8219        let query = self.selection.select("id");
8220        let graphql_client = self.graphql_client.clone();
8221        async move { query.execute(graphql_client).await }
8222    }
8223}
8224#[derive(Clone)]
8225pub struct Error {
8226    pub proc: Option<Arc<DaggerSessionProc>>,
8227    pub selection: Selection,
8228    pub graphql_client: DynGraphQLClient,
8229}
8230impl IntoID<Id> for Error {
8231    fn into_id(
8232        self,
8233    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8234        Box::pin(async move { self.id().await })
8235    }
8236}
8237impl Loadable for Error {
8238    fn graphql_type() -> &'static str {
8239        "Error"
8240    }
8241    fn from_query(
8242        proc: Option<Arc<DaggerSessionProc>>,
8243        selection: Selection,
8244        graphql_client: DynGraphQLClient,
8245    ) -> Self {
8246        Self {
8247            proc,
8248            selection,
8249            graphql_client,
8250        }
8251    }
8252}
8253impl Error {
8254    /// A unique identifier for this Error.
8255    pub async fn id(&self) -> Result<Id, DaggerError> {
8256        let query = self.selection.select("id");
8257        query.execute(self.graphql_client.clone()).await
8258    }
8259    /// A description of the error.
8260    pub async fn message(&self) -> Result<String, DaggerError> {
8261        let query = self.selection.select("message");
8262        query.execute(self.graphql_client.clone()).await
8263    }
8264    /// The extensions of the error.
8265    pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
8266        let query = self.selection.select("values");
8267        let query = query.select("id");
8268        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8269        Ok(ids
8270            .into_iter()
8271            .map(|id| ErrorValue {
8272                proc: self.proc.clone(),
8273                selection: crate::querybuilder::query()
8274                    .select("node")
8275                    .arg("id", &id.0)
8276                    .inline_fragment("ErrorValue"),
8277                graphql_client: self.graphql_client.clone(),
8278            })
8279            .collect())
8280    }
8281    /// Add a value to the error.
8282    ///
8283    /// # Arguments
8284    ///
8285    /// * `name` - The name of the value.
8286    /// * `value` - The value to store on the error.
8287    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8288        let mut query = self.selection.select("withValue");
8289        query = query.arg("name", name.into());
8290        query = query.arg("value", value);
8291        Error {
8292            proc: self.proc.clone(),
8293            selection: query,
8294            graphql_client: self.graphql_client.clone(),
8295        }
8296    }
8297}
8298impl Node for Error {
8299    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8300        let query = self.selection.select("id");
8301        let graphql_client = self.graphql_client.clone();
8302        async move { query.execute(graphql_client).await }
8303    }
8304}
8305#[derive(Clone)]
8306pub struct ErrorValue {
8307    pub proc: Option<Arc<DaggerSessionProc>>,
8308    pub selection: Selection,
8309    pub graphql_client: DynGraphQLClient,
8310}
8311impl IntoID<Id> for ErrorValue {
8312    fn into_id(
8313        self,
8314    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8315        Box::pin(async move { self.id().await })
8316    }
8317}
8318impl Loadable for ErrorValue {
8319    fn graphql_type() -> &'static str {
8320        "ErrorValue"
8321    }
8322    fn from_query(
8323        proc: Option<Arc<DaggerSessionProc>>,
8324        selection: Selection,
8325        graphql_client: DynGraphQLClient,
8326    ) -> Self {
8327        Self {
8328            proc,
8329            selection,
8330            graphql_client,
8331        }
8332    }
8333}
8334impl ErrorValue {
8335    /// A unique identifier for this ErrorValue.
8336    pub async fn id(&self) -> Result<Id, DaggerError> {
8337        let query = self.selection.select("id");
8338        query.execute(self.graphql_client.clone()).await
8339    }
8340    /// The name of the value.
8341    pub async fn name(&self) -> Result<String, DaggerError> {
8342        let query = self.selection.select("name");
8343        query.execute(self.graphql_client.clone()).await
8344    }
8345    /// The value.
8346    pub async fn value(&self) -> Result<Json, DaggerError> {
8347        let query = self.selection.select("value");
8348        query.execute(self.graphql_client.clone()).await
8349    }
8350}
8351impl Node for ErrorValue {
8352    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8353        let query = self.selection.select("id");
8354        let graphql_client = self.graphql_client.clone();
8355        async move { query.execute(graphql_client).await }
8356    }
8357}
8358#[derive(Clone)]
8359pub struct FieldTypeDef {
8360    pub proc: Option<Arc<DaggerSessionProc>>,
8361    pub selection: Selection,
8362    pub graphql_client: DynGraphQLClient,
8363}
8364impl IntoID<Id> for FieldTypeDef {
8365    fn into_id(
8366        self,
8367    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8368        Box::pin(async move { self.id().await })
8369    }
8370}
8371impl Loadable for FieldTypeDef {
8372    fn graphql_type() -> &'static str {
8373        "FieldTypeDef"
8374    }
8375    fn from_query(
8376        proc: Option<Arc<DaggerSessionProc>>,
8377        selection: Selection,
8378        graphql_client: DynGraphQLClient,
8379    ) -> Self {
8380        Self {
8381            proc,
8382            selection,
8383            graphql_client,
8384        }
8385    }
8386}
8387impl FieldTypeDef {
8388    /// The reason this enum member is deprecated, if any.
8389    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8390        let query = self.selection.select("deprecated");
8391        query.execute(self.graphql_client.clone()).await
8392    }
8393    /// A doc string for the field, if any.
8394    pub async fn description(&self) -> Result<String, DaggerError> {
8395        let query = self.selection.select("description");
8396        query.execute(self.graphql_client.clone()).await
8397    }
8398    /// A unique identifier for this FieldTypeDef.
8399    pub async fn id(&self) -> Result<Id, DaggerError> {
8400        let query = self.selection.select("id");
8401        query.execute(self.graphql_client.clone()).await
8402    }
8403    /// The name of the field in lowerCamelCase format.
8404    pub async fn name(&self) -> Result<String, DaggerError> {
8405        let query = self.selection.select("name");
8406        query.execute(self.graphql_client.clone()).await
8407    }
8408    /// The location of this field declaration.
8409    pub fn source_map(&self) -> SourceMap {
8410        let query = self.selection.select("sourceMap");
8411        SourceMap {
8412            proc: self.proc.clone(),
8413            selection: query,
8414            graphql_client: self.graphql_client.clone(),
8415        }
8416    }
8417    /// The type of the field.
8418    pub fn type_def(&self) -> TypeDef {
8419        let query = self.selection.select("typeDef");
8420        TypeDef {
8421            proc: self.proc.clone(),
8422            selection: query,
8423            graphql_client: self.graphql_client.clone(),
8424        }
8425    }
8426}
8427impl Node for FieldTypeDef {
8428    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8429        let query = self.selection.select("id");
8430        let graphql_client = self.graphql_client.clone();
8431        async move { query.execute(graphql_client).await }
8432    }
8433}
8434#[derive(Clone)]
8435pub struct File {
8436    pub proc: Option<Arc<DaggerSessionProc>>,
8437    pub selection: Selection,
8438    pub graphql_client: DynGraphQLClient,
8439}
8440#[derive(Builder, Debug, PartialEq)]
8441pub struct FileAsEnvFileOpts {
8442    /// Replace "${VAR}" or "$VAR" with the value of other vars
8443    #[builder(setter(into, strip_option), default)]
8444    pub expand: Option<bool>,
8445}
8446#[derive(Builder, Debug, PartialEq)]
8447pub struct FileContentsOpts {
8448    /// Maximum number of lines to read
8449    #[builder(setter(into, strip_option), default)]
8450    pub limit_lines: Option<isize>,
8451    /// Start reading after this line
8452    #[builder(setter(into, strip_option), default)]
8453    pub offset_lines: Option<isize>,
8454}
8455#[derive(Builder, Debug, PartialEq)]
8456pub struct FileDigestOpts {
8457    /// If true, exclude metadata from the digest.
8458    #[builder(setter(into, strip_option), default)]
8459    pub exclude_metadata: Option<bool>,
8460}
8461#[derive(Builder, Debug, PartialEq)]
8462pub struct FileExportOpts {
8463    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
8464    #[builder(setter(into, strip_option), default)]
8465    pub allow_parent_dir_path: Option<bool>,
8466}
8467#[derive(Builder, Debug, PartialEq)]
8468pub struct FileSearchOpts<'a> {
8469    /// Allow the . pattern to match newlines in multiline mode.
8470    #[builder(setter(into, strip_option), default)]
8471    pub dotall: Option<bool>,
8472    /// Only return matching files, not lines and content
8473    #[builder(setter(into, strip_option), default)]
8474    pub files_only: Option<bool>,
8475    #[builder(setter(into, strip_option), default)]
8476    pub globs: Option<Vec<&'a str>>,
8477    /// Enable case-insensitive matching.
8478    #[builder(setter(into, strip_option), default)]
8479    pub insensitive: Option<bool>,
8480    /// Limit the number of results to return
8481    #[builder(setter(into, strip_option), default)]
8482    pub limit: Option<isize>,
8483    /// Interpret the pattern as a literal string instead of a regular expression.
8484    #[builder(setter(into, strip_option), default)]
8485    pub literal: Option<bool>,
8486    /// Enable searching across multiple lines.
8487    #[builder(setter(into, strip_option), default)]
8488    pub multiline: Option<bool>,
8489    #[builder(setter(into, strip_option), default)]
8490    pub paths: Option<Vec<&'a str>>,
8491    /// Skip hidden files (files starting with .).
8492    #[builder(setter(into, strip_option), default)]
8493    pub skip_hidden: Option<bool>,
8494    /// Honor .gitignore, .ignore, and .rgignore files.
8495    #[builder(setter(into, strip_option), default)]
8496    pub skip_ignored: Option<bool>,
8497}
8498#[derive(Builder, Debug, PartialEq)]
8499pub struct FileWithReplacedOpts {
8500    /// Replace all occurrences of the pattern.
8501    #[builder(setter(into, strip_option), default)]
8502    pub all: Option<bool>,
8503    /// Replace the first match starting from the specified line.
8504    #[builder(setter(into, strip_option), default)]
8505    pub first_from: Option<isize>,
8506}
8507impl IntoID<Id> for File {
8508    fn into_id(
8509        self,
8510    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8511        Box::pin(async move { self.id().await })
8512    }
8513}
8514impl Loadable for File {
8515    fn graphql_type() -> &'static str {
8516        "File"
8517    }
8518    fn from_query(
8519        proc: Option<Arc<DaggerSessionProc>>,
8520        selection: Selection,
8521        graphql_client: DynGraphQLClient,
8522    ) -> Self {
8523        Self {
8524            proc,
8525            selection,
8526            graphql_client,
8527        }
8528    }
8529}
8530impl File {
8531    /// Parse as an env file
8532    ///
8533    /// # Arguments
8534    ///
8535    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8536    pub fn as_env_file(&self) -> EnvFile {
8537        let query = self.selection.select("asEnvFile");
8538        EnvFile {
8539            proc: self.proc.clone(),
8540            selection: query,
8541            graphql_client: self.graphql_client.clone(),
8542        }
8543    }
8544    /// Parse as an env file
8545    ///
8546    /// # Arguments
8547    ///
8548    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8549    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
8550        let mut query = self.selection.select("asEnvFile");
8551        if let Some(expand) = opts.expand {
8552            query = query.arg("expand", expand);
8553        }
8554        EnvFile {
8555            proc: self.proc.clone(),
8556            selection: query,
8557            graphql_client: self.graphql_client.clone(),
8558        }
8559    }
8560    /// Parse the file contents as JSON.
8561    pub fn as_json(&self) -> JsonValue {
8562        let query = self.selection.select("asJSON");
8563        JsonValue {
8564            proc: self.proc.clone(),
8565            selection: query,
8566            graphql_client: self.graphql_client.clone(),
8567        }
8568    }
8569    /// Change the owner of the file recursively.
8570    ///
8571    /// # Arguments
8572    ///
8573    /// * `owner` - A user:group to set for the file.
8574    ///
8575    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
8576    ///
8577    /// If the group is omitted, it defaults to the same as the user.
8578    pub fn chown(&self, owner: impl Into<String>) -> File {
8579        let mut query = self.selection.select("chown");
8580        query = query.arg("owner", owner.into());
8581        File {
8582            proc: self.proc.clone(),
8583            selection: query,
8584            graphql_client: self.graphql_client.clone(),
8585        }
8586    }
8587    /// Retrieves the contents of the file.
8588    ///
8589    /// # Arguments
8590    ///
8591    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8592    pub async fn contents(&self) -> Result<String, DaggerError> {
8593        let query = self.selection.select("contents");
8594        query.execute(self.graphql_client.clone()).await
8595    }
8596    /// Retrieves the contents of the file.
8597    ///
8598    /// # Arguments
8599    ///
8600    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8601    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
8602        let mut query = self.selection.select("contents");
8603        if let Some(offset_lines) = opts.offset_lines {
8604            query = query.arg("offsetLines", offset_lines);
8605        }
8606        if let Some(limit_lines) = opts.limit_lines {
8607            query = query.arg("limitLines", limit_lines);
8608        }
8609        query.execute(self.graphql_client.clone()).await
8610    }
8611    /// 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.
8612    ///
8613    /// # Arguments
8614    ///
8615    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8616    pub async fn digest(&self) -> Result<String, DaggerError> {
8617        let query = self.selection.select("digest");
8618        query.execute(self.graphql_client.clone()).await
8619    }
8620    /// 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.
8621    ///
8622    /// # Arguments
8623    ///
8624    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8625    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
8626        let mut query = self.selection.select("digest");
8627        if let Some(exclude_metadata) = opts.exclude_metadata {
8628            query = query.arg("excludeMetadata", exclude_metadata);
8629        }
8630        query.execute(self.graphql_client.clone()).await
8631    }
8632    /// Writes the file to a file path on the host.
8633    ///
8634    /// # Arguments
8635    ///
8636    /// * `path` - Location of the written directory (e.g., "output.txt").
8637    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8638    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
8639        let mut query = self.selection.select("export");
8640        query = query.arg("path", path.into());
8641        query.execute(self.graphql_client.clone()).await
8642    }
8643    /// Writes the file to a file path on the host.
8644    ///
8645    /// # Arguments
8646    ///
8647    /// * `path` - Location of the written directory (e.g., "output.txt").
8648    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8649    pub async fn export_opts(
8650        &self,
8651        path: impl Into<String>,
8652        opts: FileExportOpts,
8653    ) -> Result<String, DaggerError> {
8654        let mut query = self.selection.select("export");
8655        query = query.arg("path", path.into());
8656        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
8657            query = query.arg("allowParentDirPath", allow_parent_dir_path);
8658        }
8659        query.execute(self.graphql_client.clone()).await
8660    }
8661    /// A unique identifier for this File.
8662    pub async fn id(&self) -> Result<Id, DaggerError> {
8663        let query = self.selection.select("id");
8664        query.execute(self.graphql_client.clone()).await
8665    }
8666    /// Retrieves the name of the file.
8667    pub async fn name(&self) -> Result<String, DaggerError> {
8668        let query = self.selection.select("name");
8669        query.execute(self.graphql_client.clone()).await
8670    }
8671    /// Searches for content matching the given regular expression or literal string.
8672    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
8673    ///
8674    /// # Arguments
8675    ///
8676    /// * `pattern` - The text to match.
8677    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8678    pub async fn search(
8679        &self,
8680        pattern: impl Into<String>,
8681    ) -> Result<Vec<SearchResult>, DaggerError> {
8682        let mut query = self.selection.select("search");
8683        query = query.arg("pattern", pattern.into());
8684        let query = query.select("id");
8685        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8686        Ok(ids
8687            .into_iter()
8688            .map(|id| SearchResult {
8689                proc: self.proc.clone(),
8690                selection: crate::querybuilder::query()
8691                    .select("node")
8692                    .arg("id", &id.0)
8693                    .inline_fragment("SearchResult"),
8694                graphql_client: self.graphql_client.clone(),
8695            })
8696            .collect())
8697    }
8698    /// Searches for content matching the given regular expression or literal string.
8699    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
8700    ///
8701    /// # Arguments
8702    ///
8703    /// * `pattern` - The text to match.
8704    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8705    pub async fn search_opts<'a>(
8706        &self,
8707        pattern: impl Into<String>,
8708        opts: FileSearchOpts<'a>,
8709    ) -> Result<Vec<SearchResult>, DaggerError> {
8710        let mut query = self.selection.select("search");
8711        query = query.arg("pattern", pattern.into());
8712        if let Some(literal) = opts.literal {
8713            query = query.arg("literal", literal);
8714        }
8715        if let Some(multiline) = opts.multiline {
8716            query = query.arg("multiline", multiline);
8717        }
8718        if let Some(dotall) = opts.dotall {
8719            query = query.arg("dotall", dotall);
8720        }
8721        if let Some(insensitive) = opts.insensitive {
8722            query = query.arg("insensitive", insensitive);
8723        }
8724        if let Some(skip_ignored) = opts.skip_ignored {
8725            query = query.arg("skipIgnored", skip_ignored);
8726        }
8727        if let Some(skip_hidden) = opts.skip_hidden {
8728            query = query.arg("skipHidden", skip_hidden);
8729        }
8730        if let Some(files_only) = opts.files_only {
8731            query = query.arg("filesOnly", files_only);
8732        }
8733        if let Some(limit) = opts.limit {
8734            query = query.arg("limit", limit);
8735        }
8736        if let Some(paths) = opts.paths {
8737            query = query.arg("paths", paths);
8738        }
8739        if let Some(globs) = opts.globs {
8740            query = query.arg("globs", globs);
8741        }
8742        let query = query.select("id");
8743        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8744        Ok(ids
8745            .into_iter()
8746            .map(|id| SearchResult {
8747                proc: self.proc.clone(),
8748                selection: crate::querybuilder::query()
8749                    .select("node")
8750                    .arg("id", &id.0)
8751                    .inline_fragment("SearchResult"),
8752                graphql_client: self.graphql_client.clone(),
8753            })
8754            .collect())
8755    }
8756    /// Retrieves the size of the file, in bytes.
8757    pub async fn size(&self) -> Result<isize, DaggerError> {
8758        let query = self.selection.select("size");
8759        query.execute(self.graphql_client.clone()).await
8760    }
8761    /// Return file status
8762    pub fn stat(&self) -> Stat {
8763        let query = self.selection.select("stat");
8764        Stat {
8765            proc: self.proc.clone(),
8766            selection: query,
8767            graphql_client: self.graphql_client.clone(),
8768        }
8769    }
8770    /// Force evaluation in the engine.
8771    pub async fn sync(&self) -> Result<File, DaggerError> {
8772        let query = self.selection.select("sync");
8773        let id: Id = query.execute(self.graphql_client.clone()).await?;
8774        Ok(File {
8775            proc: self.proc.clone(),
8776            selection: query
8777                .root()
8778                .select("node")
8779                .arg("id", &id.0)
8780                .inline_fragment("File"),
8781            graphql_client: self.graphql_client.clone(),
8782        })
8783    }
8784    /// Retrieves this file with its name set to the given name.
8785    ///
8786    /// # Arguments
8787    ///
8788    /// * `name` - Name to set file to.
8789    pub fn with_name(&self, name: impl Into<String>) -> File {
8790        let mut query = self.selection.select("withName");
8791        query = query.arg("name", name.into());
8792        File {
8793            proc: self.proc.clone(),
8794            selection: query,
8795            graphql_client: self.graphql_client.clone(),
8796        }
8797    }
8798    /// Retrieves the file with content replaced with the given text.
8799    /// If 'all' is true, all occurrences of the pattern will be replaced.
8800    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
8801    /// If neither are specified, and there are multiple matches for the pattern, this will error.
8802    /// If there are no matches for the pattern, this will error.
8803    ///
8804    /// # Arguments
8805    ///
8806    /// * `search` - The text to match.
8807    /// * `replacement` - The text to match.
8808    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8809    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
8810        let mut query = self.selection.select("withReplaced");
8811        query = query.arg("search", search.into());
8812        query = query.arg("replacement", replacement.into());
8813        File {
8814            proc: self.proc.clone(),
8815            selection: query,
8816            graphql_client: self.graphql_client.clone(),
8817        }
8818    }
8819    /// Retrieves the file with content replaced with the given text.
8820    /// If 'all' is true, all occurrences of the pattern will be replaced.
8821    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
8822    /// If neither are specified, and there are multiple matches for the pattern, this will error.
8823    /// If there are no matches for the pattern, this will error.
8824    ///
8825    /// # Arguments
8826    ///
8827    /// * `search` - The text to match.
8828    /// * `replacement` - The text to match.
8829    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8830    pub fn with_replaced_opts(
8831        &self,
8832        search: impl Into<String>,
8833        replacement: impl Into<String>,
8834        opts: FileWithReplacedOpts,
8835    ) -> File {
8836        let mut query = self.selection.select("withReplaced");
8837        query = query.arg("search", search.into());
8838        query = query.arg("replacement", replacement.into());
8839        if let Some(all) = opts.all {
8840            query = query.arg("all", all);
8841        }
8842        if let Some(first_from) = opts.first_from {
8843            query = query.arg("firstFrom", first_from);
8844        }
8845        File {
8846            proc: self.proc.clone(),
8847            selection: query,
8848            graphql_client: self.graphql_client.clone(),
8849        }
8850    }
8851    /// Retrieves this file with its created/modified timestamps set to the given time.
8852    ///
8853    /// # Arguments
8854    ///
8855    /// * `timestamp` - Timestamp to set dir/files in.
8856    ///
8857    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
8858    pub fn with_timestamps(&self, timestamp: isize) -> File {
8859        let mut query = self.selection.select("withTimestamps");
8860        query = query.arg("timestamp", timestamp);
8861        File {
8862            proc: self.proc.clone(),
8863            selection: query,
8864            graphql_client: self.graphql_client.clone(),
8865        }
8866    }
8867}
8868impl Exportable for File {
8869    fn export(
8870        &self,
8871        path: impl Into<String>,
8872    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
8873        let mut query = self.selection.select("export");
8874        query = query.arg("path", path.into());
8875        let graphql_client = self.graphql_client.clone();
8876        async move { query.execute(graphql_client).await }
8877    }
8878    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8879        let query = self.selection.select("id");
8880        let graphql_client = self.graphql_client.clone();
8881        async move { query.execute(graphql_client).await }
8882    }
8883}
8884impl Node for File {
8885    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8886        let query = self.selection.select("id");
8887        let graphql_client = self.graphql_client.clone();
8888        async move { query.execute(graphql_client).await }
8889    }
8890}
8891impl Syncer for File {
8892    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8893        let query = self.selection.select("id");
8894        let graphql_client = self.graphql_client.clone();
8895        async move { query.execute(graphql_client).await }
8896    }
8897    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8898        let query = self.selection.select("sync");
8899        let graphql_client = self.graphql_client.clone();
8900        async move { query.execute(graphql_client).await }
8901    }
8902}
8903#[derive(Clone)]
8904pub struct Function {
8905    pub proc: Option<Arc<DaggerSessionProc>>,
8906    pub selection: Selection,
8907    pub graphql_client: DynGraphQLClient,
8908}
8909#[derive(Builder, Debug, PartialEq)]
8910pub struct FunctionWithArgOpts<'a> {
8911    #[builder(setter(into, strip_option), default)]
8912    pub default_address: Option<&'a str>,
8913    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
8914    #[builder(setter(into, strip_option), default)]
8915    pub default_path: Option<&'a str>,
8916    /// A default value to use for this argument if not explicitly set by the caller, if any
8917    #[builder(setter(into, strip_option), default)]
8918    pub default_value: Option<Json>,
8919    /// If deprecated, the reason or migration path.
8920    #[builder(setter(into, strip_option), default)]
8921    pub deprecated: Option<&'a str>,
8922    /// A doc string for the argument, if any
8923    #[builder(setter(into, strip_option), default)]
8924    pub description: Option<&'a str>,
8925    /// Patterns to ignore when loading the contextual argument value.
8926    #[builder(setter(into, strip_option), default)]
8927    pub ignore: Option<Vec<&'a str>>,
8928    /// The source map for the argument definition.
8929    #[builder(setter(into, strip_option), default)]
8930    pub source_map: Option<Id>,
8931}
8932#[derive(Builder, Debug, PartialEq)]
8933pub struct FunctionWithCachePolicyOpts<'a> {
8934    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
8935    #[builder(setter(into, strip_option), default)]
8936    pub time_to_live: Option<&'a str>,
8937}
8938#[derive(Builder, Debug, PartialEq)]
8939pub struct FunctionWithDeprecatedOpts<'a> {
8940    /// Reason or migration path describing the deprecation.
8941    #[builder(setter(into, strip_option), default)]
8942    pub reason: Option<&'a str>,
8943}
8944impl IntoID<Id> for Function {
8945    fn into_id(
8946        self,
8947    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8948        Box::pin(async move { self.id().await })
8949    }
8950}
8951impl Loadable for Function {
8952    fn graphql_type() -> &'static str {
8953        "Function"
8954    }
8955    fn from_query(
8956        proc: Option<Arc<DaggerSessionProc>>,
8957        selection: Selection,
8958        graphql_client: DynGraphQLClient,
8959    ) -> Self {
8960        Self {
8961            proc,
8962            selection,
8963            graphql_client,
8964        }
8965    }
8966}
8967impl Function {
8968    /// Arguments accepted by the function, if any.
8969    pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
8970        let query = self.selection.select("args");
8971        let query = query.select("id");
8972        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8973        Ok(ids
8974            .into_iter()
8975            .map(|id| FunctionArg {
8976                proc: self.proc.clone(),
8977                selection: crate::querybuilder::query()
8978                    .select("node")
8979                    .arg("id", &id.0)
8980                    .inline_fragment("FunctionArg"),
8981                graphql_client: self.graphql_client.clone(),
8982            })
8983            .collect())
8984    }
8985    /// The reason this function is deprecated, if any.
8986    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8987        let query = self.selection.select("deprecated");
8988        query.execute(self.graphql_client.clone()).await
8989    }
8990    /// A doc string for the function, if any.
8991    pub async fn description(&self) -> Result<String, DaggerError> {
8992        let query = self.selection.select("description");
8993        query.execute(self.graphql_client.clone()).await
8994    }
8995    /// A unique identifier for this Function.
8996    pub async fn id(&self) -> Result<Id, DaggerError> {
8997        let query = self.selection.select("id");
8998        query.execute(self.graphql_client.clone()).await
8999    }
9000    /// The name of the function.
9001    pub async fn name(&self) -> Result<String, DaggerError> {
9002        let query = self.selection.select("name");
9003        query.execute(self.graphql_client.clone()).await
9004    }
9005    /// The type returned by the function.
9006    pub fn return_type(&self) -> TypeDef {
9007        let query = self.selection.select("returnType");
9008        TypeDef {
9009            proc: self.proc.clone(),
9010            selection: query,
9011            graphql_client: self.graphql_client.clone(),
9012        }
9013    }
9014    /// The location of this function declaration.
9015    pub fn source_map(&self) -> SourceMap {
9016        let query = self.selection.select("sourceMap");
9017        SourceMap {
9018            proc: self.proc.clone(),
9019            selection: query,
9020            graphql_client: self.graphql_client.clone(),
9021        }
9022    }
9023    /// If this function is provided by a module, the name of the module. Unset otherwise.
9024    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9025        let query = self.selection.select("sourceModuleName");
9026        query.execute(self.graphql_client.clone()).await
9027    }
9028    /// Returns the function with the provided argument
9029    ///
9030    /// # Arguments
9031    ///
9032    /// * `name` - The name of the argument
9033    /// * `type_def` - The type of the argument
9034    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9035    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
9036        let mut query = self.selection.select("withArg");
9037        query = query.arg("name", name.into());
9038        query = query.arg_lazy(
9039            "typeDef",
9040            Box::new(move || {
9041                let type_def = type_def.clone();
9042                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9043            }),
9044        );
9045        Function {
9046            proc: self.proc.clone(),
9047            selection: query,
9048            graphql_client: self.graphql_client.clone(),
9049        }
9050    }
9051    /// Returns the function with the provided argument
9052    ///
9053    /// # Arguments
9054    ///
9055    /// * `name` - The name of the argument
9056    /// * `type_def` - The type of the argument
9057    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9058    pub fn with_arg_opts<'a>(
9059        &self,
9060        name: impl Into<String>,
9061        type_def: impl IntoID<Id>,
9062        opts: FunctionWithArgOpts<'a>,
9063    ) -> Function {
9064        let mut query = self.selection.select("withArg");
9065        query = query.arg("name", name.into());
9066        query = query.arg_lazy(
9067            "typeDef",
9068            Box::new(move || {
9069                let type_def = type_def.clone();
9070                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9071            }),
9072        );
9073        if let Some(description) = opts.description {
9074            query = query.arg("description", description);
9075        }
9076        if let Some(default_value) = opts.default_value {
9077            query = query.arg("defaultValue", default_value);
9078        }
9079        if let Some(default_path) = opts.default_path {
9080            query = query.arg("defaultPath", default_path);
9081        }
9082        if let Some(ignore) = opts.ignore {
9083            query = query.arg("ignore", ignore);
9084        }
9085        if let Some(source_map) = opts.source_map {
9086            query = query.arg("sourceMap", source_map);
9087        }
9088        if let Some(deprecated) = opts.deprecated {
9089            query = query.arg("deprecated", deprecated);
9090        }
9091        if let Some(default_address) = opts.default_address {
9092            query = query.arg("defaultAddress", default_address);
9093        }
9094        Function {
9095            proc: self.proc.clone(),
9096            selection: query,
9097            graphql_client: self.graphql_client.clone(),
9098        }
9099    }
9100    /// Returns the function updated to use the provided cache policy.
9101    ///
9102    /// # Arguments
9103    ///
9104    /// * `policy` - The cache policy to use.
9105    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9106    pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9107        let mut query = self.selection.select("withCachePolicy");
9108        query = query.arg("policy", policy);
9109        Function {
9110            proc: self.proc.clone(),
9111            selection: query,
9112            graphql_client: self.graphql_client.clone(),
9113        }
9114    }
9115    /// Returns the function updated to use the provided cache policy.
9116    ///
9117    /// # Arguments
9118    ///
9119    /// * `policy` - The cache policy to use.
9120    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9121    pub fn with_cache_policy_opts<'a>(
9122        &self,
9123        policy: FunctionCachePolicy,
9124        opts: FunctionWithCachePolicyOpts<'a>,
9125    ) -> Function {
9126        let mut query = self.selection.select("withCachePolicy");
9127        query = query.arg("policy", policy);
9128        if let Some(time_to_live) = opts.time_to_live {
9129            query = query.arg("timeToLive", time_to_live);
9130        }
9131        Function {
9132            proc: self.proc.clone(),
9133            selection: query,
9134            graphql_client: self.graphql_client.clone(),
9135        }
9136    }
9137    /// Returns the function with a flag indicating it's a check.
9138    pub fn with_check(&self) -> Function {
9139        let query = self.selection.select("withCheck");
9140        Function {
9141            proc: self.proc.clone(),
9142            selection: query,
9143            graphql_client: self.graphql_client.clone(),
9144        }
9145    }
9146    /// Returns the function with the provided deprecation reason.
9147    ///
9148    /// # Arguments
9149    ///
9150    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9151    pub fn with_deprecated(&self) -> Function {
9152        let query = self.selection.select("withDeprecated");
9153        Function {
9154            proc: self.proc.clone(),
9155            selection: query,
9156            graphql_client: self.graphql_client.clone(),
9157        }
9158    }
9159    /// Returns the function with the provided deprecation reason.
9160    ///
9161    /// # Arguments
9162    ///
9163    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9164    pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9165        let mut query = self.selection.select("withDeprecated");
9166        if let Some(reason) = opts.reason {
9167            query = query.arg("reason", reason);
9168        }
9169        Function {
9170            proc: self.proc.clone(),
9171            selection: query,
9172            graphql_client: self.graphql_client.clone(),
9173        }
9174    }
9175    /// Returns the function with the given doc string.
9176    ///
9177    /// # Arguments
9178    ///
9179    /// * `description` - The doc string to set.
9180    pub fn with_description(&self, description: impl Into<String>) -> Function {
9181        let mut query = self.selection.select("withDescription");
9182        query = query.arg("description", description.into());
9183        Function {
9184            proc: self.proc.clone(),
9185            selection: query,
9186            graphql_client: self.graphql_client.clone(),
9187        }
9188    }
9189    /// Returns the function with a flag indicating it's a generator.
9190    pub fn with_generator(&self) -> Function {
9191        let query = self.selection.select("withGenerator");
9192        Function {
9193            proc: self.proc.clone(),
9194            selection: query,
9195            graphql_client: self.graphql_client.clone(),
9196        }
9197    }
9198    /// Returns the function with the given source map.
9199    ///
9200    /// # Arguments
9201    ///
9202    /// * `source_map` - The source map for the function definition.
9203    pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
9204        let mut query = self.selection.select("withSourceMap");
9205        query = query.arg_lazy(
9206            "sourceMap",
9207            Box::new(move || {
9208                let source_map = source_map.clone();
9209                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9210            }),
9211        );
9212        Function {
9213            proc: self.proc.clone(),
9214            selection: query,
9215            graphql_client: self.graphql_client.clone(),
9216        }
9217    }
9218    /// Returns the function with a flag indicating it returns a service for dagger up.
9219    pub fn with_up(&self) -> Function {
9220        let query = self.selection.select("withUp");
9221        Function {
9222            proc: self.proc.clone(),
9223            selection: query,
9224            graphql_client: self.graphql_client.clone(),
9225        }
9226    }
9227}
9228impl Node for Function {
9229    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9230        let query = self.selection.select("id");
9231        let graphql_client = self.graphql_client.clone();
9232        async move { query.execute(graphql_client).await }
9233    }
9234}
9235#[derive(Clone)]
9236pub struct FunctionArg {
9237    pub proc: Option<Arc<DaggerSessionProc>>,
9238    pub selection: Selection,
9239    pub graphql_client: DynGraphQLClient,
9240}
9241impl IntoID<Id> for FunctionArg {
9242    fn into_id(
9243        self,
9244    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9245        Box::pin(async move { self.id().await })
9246    }
9247}
9248impl Loadable for FunctionArg {
9249    fn graphql_type() -> &'static str {
9250        "FunctionArg"
9251    }
9252    fn from_query(
9253        proc: Option<Arc<DaggerSessionProc>>,
9254        selection: Selection,
9255        graphql_client: DynGraphQLClient,
9256    ) -> Self {
9257        Self {
9258            proc,
9259            selection,
9260            graphql_client,
9261        }
9262    }
9263}
9264impl FunctionArg {
9265    /// Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
9266    pub async fn default_address(&self) -> Result<String, DaggerError> {
9267        let query = self.selection.select("defaultAddress");
9268        query.execute(self.graphql_client.clone()).await
9269    }
9270    /// 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
9271    pub async fn default_path(&self) -> Result<String, DaggerError> {
9272        let query = self.selection.select("defaultPath");
9273        query.execute(self.graphql_client.clone()).await
9274    }
9275    /// A default value to use for this argument when not explicitly set by the caller, if any.
9276    pub async fn default_value(&self) -> Result<Json, DaggerError> {
9277        let query = self.selection.select("defaultValue");
9278        query.execute(self.graphql_client.clone()).await
9279    }
9280    /// The reason this function is deprecated, if any.
9281    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9282        let query = self.selection.select("deprecated");
9283        query.execute(self.graphql_client.clone()).await
9284    }
9285    /// A doc string for the argument, if any.
9286    pub async fn description(&self) -> Result<String, DaggerError> {
9287        let query = self.selection.select("description");
9288        query.execute(self.graphql_client.clone()).await
9289    }
9290    /// A unique identifier for this FunctionArg.
9291    pub async fn id(&self) -> Result<Id, DaggerError> {
9292        let query = self.selection.select("id");
9293        query.execute(self.graphql_client.clone()).await
9294    }
9295    /// 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.
9296    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9297        let query = self.selection.select("ignore");
9298        query.execute(self.graphql_client.clone()).await
9299    }
9300    /// The name of the argument in lowerCamelCase format.
9301    pub async fn name(&self) -> Result<String, DaggerError> {
9302        let query = self.selection.select("name");
9303        query.execute(self.graphql_client.clone()).await
9304    }
9305    /// The location of this arg declaration.
9306    pub fn source_map(&self) -> SourceMap {
9307        let query = self.selection.select("sourceMap");
9308        SourceMap {
9309            proc: self.proc.clone(),
9310            selection: query,
9311            graphql_client: self.graphql_client.clone(),
9312        }
9313    }
9314    /// The type of the argument.
9315    pub fn type_def(&self) -> TypeDef {
9316        let query = self.selection.select("typeDef");
9317        TypeDef {
9318            proc: self.proc.clone(),
9319            selection: query,
9320            graphql_client: self.graphql_client.clone(),
9321        }
9322    }
9323}
9324impl Node for FunctionArg {
9325    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9326        let query = self.selection.select("id");
9327        let graphql_client = self.graphql_client.clone();
9328        async move { query.execute(graphql_client).await }
9329    }
9330}
9331#[derive(Clone)]
9332pub struct FunctionCall {
9333    pub proc: Option<Arc<DaggerSessionProc>>,
9334    pub selection: Selection,
9335    pub graphql_client: DynGraphQLClient,
9336}
9337impl IntoID<Id> for FunctionCall {
9338    fn into_id(
9339        self,
9340    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9341        Box::pin(async move { self.id().await })
9342    }
9343}
9344impl Loadable for FunctionCall {
9345    fn graphql_type() -> &'static str {
9346        "FunctionCall"
9347    }
9348    fn from_query(
9349        proc: Option<Arc<DaggerSessionProc>>,
9350        selection: Selection,
9351        graphql_client: DynGraphQLClient,
9352    ) -> Self {
9353        Self {
9354            proc,
9355            selection,
9356            graphql_client,
9357        }
9358    }
9359}
9360impl FunctionCall {
9361    /// A unique identifier for this FunctionCall.
9362    pub async fn id(&self) -> Result<Id, DaggerError> {
9363        let query = self.selection.select("id");
9364        query.execute(self.graphql_client.clone()).await
9365    }
9366    /// The argument values the function is being invoked with.
9367    pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
9368        let query = self.selection.select("inputArgs");
9369        let query = query.select("id");
9370        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9371        Ok(ids
9372            .into_iter()
9373            .map(|id| FunctionCallArgValue {
9374                proc: self.proc.clone(),
9375                selection: crate::querybuilder::query()
9376                    .select("node")
9377                    .arg("id", &id.0)
9378                    .inline_fragment("FunctionCallArgValue"),
9379                graphql_client: self.graphql_client.clone(),
9380            })
9381            .collect())
9382    }
9383    /// The name of the function being called.
9384    pub async fn name(&self) -> Result<String, DaggerError> {
9385        let query = self.selection.select("name");
9386        query.execute(self.graphql_client.clone()).await
9387    }
9388    /// 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.
9389    pub async fn parent(&self) -> Result<Json, DaggerError> {
9390        let query = self.selection.select("parent");
9391        query.execute(self.graphql_client.clone()).await
9392    }
9393    /// 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.
9394    pub async fn parent_name(&self) -> Result<String, DaggerError> {
9395        let query = self.selection.select("parentName");
9396        query.execute(self.graphql_client.clone()).await
9397    }
9398    /// Return an error from the function.
9399    ///
9400    /// # Arguments
9401    ///
9402    /// * `error` - The error to return.
9403    pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
9404        let mut query = self.selection.select("returnError");
9405        query = query.arg_lazy(
9406            "error",
9407            Box::new(move || {
9408                let error = error.clone();
9409                Box::pin(async move { error.into_id().await.unwrap().quote() })
9410            }),
9411        );
9412        query.execute(self.graphql_client.clone()).await
9413    }
9414    /// Set the return value of the function call to the provided value.
9415    ///
9416    /// # Arguments
9417    ///
9418    /// * `value` - JSON serialization of the return value.
9419    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9420        let mut query = self.selection.select("returnValue");
9421        query = query.arg("value", value);
9422        query.execute(self.graphql_client.clone()).await
9423    }
9424}
9425impl Node for FunctionCall {
9426    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9427        let query = self.selection.select("id");
9428        let graphql_client = self.graphql_client.clone();
9429        async move { query.execute(graphql_client).await }
9430    }
9431}
9432#[derive(Clone)]
9433pub struct FunctionCallArgValue {
9434    pub proc: Option<Arc<DaggerSessionProc>>,
9435    pub selection: Selection,
9436    pub graphql_client: DynGraphQLClient,
9437}
9438impl IntoID<Id> for FunctionCallArgValue {
9439    fn into_id(
9440        self,
9441    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9442        Box::pin(async move { self.id().await })
9443    }
9444}
9445impl Loadable for FunctionCallArgValue {
9446    fn graphql_type() -> &'static str {
9447        "FunctionCallArgValue"
9448    }
9449    fn from_query(
9450        proc: Option<Arc<DaggerSessionProc>>,
9451        selection: Selection,
9452        graphql_client: DynGraphQLClient,
9453    ) -> Self {
9454        Self {
9455            proc,
9456            selection,
9457            graphql_client,
9458        }
9459    }
9460}
9461impl FunctionCallArgValue {
9462    /// A unique identifier for this FunctionCallArgValue.
9463    pub async fn id(&self) -> Result<Id, DaggerError> {
9464        let query = self.selection.select("id");
9465        query.execute(self.graphql_client.clone()).await
9466    }
9467    /// The name of the argument.
9468    pub async fn name(&self) -> Result<String, DaggerError> {
9469        let query = self.selection.select("name");
9470        query.execute(self.graphql_client.clone()).await
9471    }
9472    /// The value of the argument represented as a JSON serialized string.
9473    pub async fn value(&self) -> Result<Json, DaggerError> {
9474        let query = self.selection.select("value");
9475        query.execute(self.graphql_client.clone()).await
9476    }
9477}
9478impl Node for FunctionCallArgValue {
9479    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9480        let query = self.selection.select("id");
9481        let graphql_client = self.graphql_client.clone();
9482        async move { query.execute(graphql_client).await }
9483    }
9484}
9485#[derive(Clone)]
9486pub struct GeneratedCode {
9487    pub proc: Option<Arc<DaggerSessionProc>>,
9488    pub selection: Selection,
9489    pub graphql_client: DynGraphQLClient,
9490}
9491impl IntoID<Id> for GeneratedCode {
9492    fn into_id(
9493        self,
9494    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9495        Box::pin(async move { self.id().await })
9496    }
9497}
9498impl Loadable for GeneratedCode {
9499    fn graphql_type() -> &'static str {
9500        "GeneratedCode"
9501    }
9502    fn from_query(
9503        proc: Option<Arc<DaggerSessionProc>>,
9504        selection: Selection,
9505        graphql_client: DynGraphQLClient,
9506    ) -> Self {
9507        Self {
9508            proc,
9509            selection,
9510            graphql_client,
9511        }
9512    }
9513}
9514impl GeneratedCode {
9515    /// The directory containing the generated code.
9516    pub fn code(&self) -> Directory {
9517        let query = self.selection.select("code");
9518        Directory {
9519            proc: self.proc.clone(),
9520            selection: query,
9521            graphql_client: self.graphql_client.clone(),
9522        }
9523    }
9524    /// A unique identifier for this GeneratedCode.
9525    pub async fn id(&self) -> Result<Id, DaggerError> {
9526        let query = self.selection.select("id");
9527        query.execute(self.graphql_client.clone()).await
9528    }
9529    /// List of paths to mark generated in version control (i.e. .gitattributes).
9530    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
9531        let query = self.selection.select("vcsGeneratedPaths");
9532        query.execute(self.graphql_client.clone()).await
9533    }
9534    /// List of paths to ignore in version control (i.e. .gitignore).
9535    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
9536        let query = self.selection.select("vcsIgnoredPaths");
9537        query.execute(self.graphql_client.clone()).await
9538    }
9539    /// Set the list of paths to mark generated in version control.
9540    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9541        let mut query = self.selection.select("withVCSGeneratedPaths");
9542        query = query.arg(
9543            "paths",
9544            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9545        );
9546        GeneratedCode {
9547            proc: self.proc.clone(),
9548            selection: query,
9549            graphql_client: self.graphql_client.clone(),
9550        }
9551    }
9552    /// Set the list of paths to ignore in version control.
9553    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9554        let mut query = self.selection.select("withVCSIgnoredPaths");
9555        query = query.arg(
9556            "paths",
9557            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9558        );
9559        GeneratedCode {
9560            proc: self.proc.clone(),
9561            selection: query,
9562            graphql_client: self.graphql_client.clone(),
9563        }
9564    }
9565}
9566impl Node for GeneratedCode {
9567    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9568        let query = self.selection.select("id");
9569        let graphql_client = self.graphql_client.clone();
9570        async move { query.execute(graphql_client).await }
9571    }
9572}
9573#[derive(Clone)]
9574pub struct Generator {
9575    pub proc: Option<Arc<DaggerSessionProc>>,
9576    pub selection: Selection,
9577    pub graphql_client: DynGraphQLClient,
9578}
9579impl IntoID<Id> for Generator {
9580    fn into_id(
9581        self,
9582    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9583        Box::pin(async move { self.id().await })
9584    }
9585}
9586impl Loadable for Generator {
9587    fn graphql_type() -> &'static str {
9588        "Generator"
9589    }
9590    fn from_query(
9591        proc: Option<Arc<DaggerSessionProc>>,
9592        selection: Selection,
9593        graphql_client: DynGraphQLClient,
9594    ) -> Self {
9595        Self {
9596            proc,
9597            selection,
9598            graphql_client,
9599        }
9600    }
9601}
9602impl Generator {
9603    /// The generated changeset from the last run
9604    pub fn changes(&self) -> Changeset {
9605        let query = self.selection.select("changes");
9606        Changeset {
9607            proc: self.proc.clone(),
9608            selection: query,
9609            graphql_client: self.graphql_client.clone(),
9610        }
9611    }
9612    /// Whether the generator complete
9613    pub async fn completed(&self) -> Result<bool, DaggerError> {
9614        let query = self.selection.select("completed");
9615        query.execute(self.graphql_client.clone()).await
9616    }
9617    /// Return the description of the generator
9618    pub async fn description(&self) -> Result<String, DaggerError> {
9619        let query = self.selection.select("description");
9620        query.execute(self.graphql_client.clone()).await
9621    }
9622    /// A unique identifier for this Generator.
9623    pub async fn id(&self) -> Result<Id, DaggerError> {
9624        let query = self.selection.select("id");
9625        query.execute(self.graphql_client.clone()).await
9626    }
9627    /// Whether changeset from the last generator run is empty or not
9628    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9629        let query = self.selection.select("isEmpty");
9630        query.execute(self.graphql_client.clone()).await
9631    }
9632    /// Return the fully qualified name of the generator
9633    pub async fn name(&self) -> Result<String, DaggerError> {
9634        let query = self.selection.select("name");
9635        query.execute(self.graphql_client.clone()).await
9636    }
9637    /// The original module in which the generator has been defined
9638    pub fn original_module(&self) -> Module {
9639        let query = self.selection.select("originalModule");
9640        Module {
9641            proc: self.proc.clone(),
9642            selection: query,
9643            graphql_client: self.graphql_client.clone(),
9644        }
9645    }
9646    /// The path of the generator within its module
9647    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
9648        let query = self.selection.select("path");
9649        query.execute(self.graphql_client.clone()).await
9650    }
9651    /// Execute the generator
9652    pub fn run(&self) -> Generator {
9653        let query = self.selection.select("run");
9654        Generator {
9655            proc: self.proc.clone(),
9656            selection: query,
9657            graphql_client: self.graphql_client.clone(),
9658        }
9659    }
9660}
9661impl Node for Generator {
9662    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9663        let query = self.selection.select("id");
9664        let graphql_client = self.graphql_client.clone();
9665        async move { query.execute(graphql_client).await }
9666    }
9667}
9668#[derive(Clone)]
9669pub struct GeneratorGroup {
9670    pub proc: Option<Arc<DaggerSessionProc>>,
9671    pub selection: Selection,
9672    pub graphql_client: DynGraphQLClient,
9673}
9674#[derive(Builder, Debug, PartialEq)]
9675pub struct GeneratorGroupChangesOpts {
9676    /// Strategy to apply on conflicts between generators
9677    #[builder(setter(into, strip_option), default)]
9678    pub on_conflict: Option<ChangesetsMergeConflict>,
9679}
9680impl IntoID<Id> for GeneratorGroup {
9681    fn into_id(
9682        self,
9683    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9684        Box::pin(async move { self.id().await })
9685    }
9686}
9687impl Loadable for GeneratorGroup {
9688    fn graphql_type() -> &'static str {
9689        "GeneratorGroup"
9690    }
9691    fn from_query(
9692        proc: Option<Arc<DaggerSessionProc>>,
9693        selection: Selection,
9694        graphql_client: DynGraphQLClient,
9695    ) -> Self {
9696        Self {
9697            proc,
9698            selection,
9699            graphql_client,
9700        }
9701    }
9702}
9703impl GeneratorGroup {
9704    /// The combined changes from the last run of the generators
9705    /// 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.
9706    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
9707    ///
9708    /// # Arguments
9709    ///
9710    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9711    pub fn changes(&self) -> Changeset {
9712        let query = self.selection.select("changes");
9713        Changeset {
9714            proc: self.proc.clone(),
9715            selection: query,
9716            graphql_client: self.graphql_client.clone(),
9717        }
9718    }
9719    /// The combined changes from the last run of the generators
9720    /// 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.
9721    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
9722    ///
9723    /// # Arguments
9724    ///
9725    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9726    pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
9727        let mut query = self.selection.select("changes");
9728        if let Some(on_conflict) = opts.on_conflict {
9729            query = query.arg("onConflict", on_conflict);
9730        }
9731        Changeset {
9732            proc: self.proc.clone(),
9733            selection: query,
9734            graphql_client: self.graphql_client.clone(),
9735        }
9736    }
9737    /// A unique identifier for this GeneratorGroup.
9738    pub async fn id(&self) -> Result<Id, DaggerError> {
9739        let query = self.selection.select("id");
9740        query.execute(self.graphql_client.clone()).await
9741    }
9742    /// Whether the generated changeset from the last run is empty or not
9743    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9744        let query = self.selection.select("isEmpty");
9745        query.execute(self.graphql_client.clone()).await
9746    }
9747    /// Return a list of individual generators and their details
9748    pub async fn list(&self) -> Result<Vec<Generator>, DaggerError> {
9749        let query = self.selection.select("list");
9750        let query = query.select("id");
9751        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9752        Ok(ids
9753            .into_iter()
9754            .map(|id| Generator {
9755                proc: self.proc.clone(),
9756                selection: crate::querybuilder::query()
9757                    .select("node")
9758                    .arg("id", &id.0)
9759                    .inline_fragment("Generator"),
9760                graphql_client: self.graphql_client.clone(),
9761            })
9762            .collect())
9763    }
9764    /// Execute all selected generators
9765    pub fn run(&self) -> GeneratorGroup {
9766        let query = self.selection.select("run");
9767        GeneratorGroup {
9768            proc: self.proc.clone(),
9769            selection: query,
9770            graphql_client: self.graphql_client.clone(),
9771        }
9772    }
9773}
9774impl Node for GeneratorGroup {
9775    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9776        let query = self.selection.select("id");
9777        let graphql_client = self.graphql_client.clone();
9778        async move { query.execute(graphql_client).await }
9779    }
9780}
9781#[derive(Clone)]
9782pub struct GitRef {
9783    pub proc: Option<Arc<DaggerSessionProc>>,
9784    pub selection: Selection,
9785    pub graphql_client: DynGraphQLClient,
9786}
9787#[derive(Builder, Debug, PartialEq)]
9788pub struct GitRefTreeOpts {
9789    /// The depth of the tree to fetch.
9790    #[builder(setter(into, strip_option), default)]
9791    pub depth: Option<isize>,
9792    /// Set to true to discard .git directory.
9793    #[builder(setter(into, strip_option), default)]
9794    pub discard_git_dir: Option<bool>,
9795    /// Set to true to populate tag refs in the local checkout .git.
9796    #[builder(setter(into, strip_option), default)]
9797    pub include_tags: Option<bool>,
9798}
9799impl IntoID<Id> for GitRef {
9800    fn into_id(
9801        self,
9802    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9803        Box::pin(async move { self.id().await })
9804    }
9805}
9806impl Loadable for GitRef {
9807    fn graphql_type() -> &'static str {
9808        "GitRef"
9809    }
9810    fn from_query(
9811        proc: Option<Arc<DaggerSessionProc>>,
9812        selection: Selection,
9813        graphql_client: DynGraphQLClient,
9814    ) -> Self {
9815        Self {
9816            proc,
9817            selection,
9818            graphql_client,
9819        }
9820    }
9821}
9822impl GitRef {
9823    /// The resolved commit id at this ref.
9824    pub async fn commit(&self) -> Result<String, DaggerError> {
9825        let query = self.selection.select("commit");
9826        query.execute(self.graphql_client.clone()).await
9827    }
9828    /// Find the best common ancestor between this ref and another ref.
9829    ///
9830    /// # Arguments
9831    ///
9832    /// * `other` - The other ref to compare against.
9833    pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
9834        let mut query = self.selection.select("commonAncestor");
9835        query = query.arg_lazy(
9836            "other",
9837            Box::new(move || {
9838                let other = other.clone();
9839                Box::pin(async move { other.into_id().await.unwrap().quote() })
9840            }),
9841        );
9842        GitRef {
9843            proc: self.proc.clone(),
9844            selection: query,
9845            graphql_client: self.graphql_client.clone(),
9846        }
9847    }
9848    /// A unique identifier for this GitRef.
9849    pub async fn id(&self) -> Result<Id, DaggerError> {
9850        let query = self.selection.select("id");
9851        query.execute(self.graphql_client.clone()).await
9852    }
9853    /// The resolved ref name at this ref.
9854    pub async fn r#ref(&self) -> Result<String, DaggerError> {
9855        let query = self.selection.select("ref");
9856        query.execute(self.graphql_client.clone()).await
9857    }
9858    /// The filesystem tree at this ref.
9859    ///
9860    /// # Arguments
9861    ///
9862    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9863    pub fn tree(&self) -> Directory {
9864        let query = self.selection.select("tree");
9865        Directory {
9866            proc: self.proc.clone(),
9867            selection: query,
9868            graphql_client: self.graphql_client.clone(),
9869        }
9870    }
9871    /// The filesystem tree at this ref.
9872    ///
9873    /// # Arguments
9874    ///
9875    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9876    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
9877        let mut query = self.selection.select("tree");
9878        if let Some(discard_git_dir) = opts.discard_git_dir {
9879            query = query.arg("discardGitDir", discard_git_dir);
9880        }
9881        if let Some(depth) = opts.depth {
9882            query = query.arg("depth", depth);
9883        }
9884        if let Some(include_tags) = opts.include_tags {
9885            query = query.arg("includeTags", include_tags);
9886        }
9887        Directory {
9888            proc: self.proc.clone(),
9889            selection: query,
9890            graphql_client: self.graphql_client.clone(),
9891        }
9892    }
9893}
9894impl Node for GitRef {
9895    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9896        let query = self.selection.select("id");
9897        let graphql_client = self.graphql_client.clone();
9898        async move { query.execute(graphql_client).await }
9899    }
9900}
9901#[derive(Clone)]
9902pub struct GitRepository {
9903    pub proc: Option<Arc<DaggerSessionProc>>,
9904    pub selection: Selection,
9905    pub graphql_client: DynGraphQLClient,
9906}
9907#[derive(Builder, Debug, PartialEq)]
9908pub struct GitRepositoryBranchesOpts<'a> {
9909    /// Glob patterns (e.g., "refs/tags/v*").
9910    #[builder(setter(into, strip_option), default)]
9911    pub patterns: Option<Vec<&'a str>>,
9912}
9913#[derive(Builder, Debug, PartialEq)]
9914pub struct GitRepositoryTagsOpts<'a> {
9915    /// Glob patterns (e.g., "refs/tags/v*").
9916    #[builder(setter(into, strip_option), default)]
9917    pub patterns: Option<Vec<&'a str>>,
9918}
9919impl IntoID<Id> for GitRepository {
9920    fn into_id(
9921        self,
9922    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9923        Box::pin(async move { self.id().await })
9924    }
9925}
9926impl Loadable for GitRepository {
9927    fn graphql_type() -> &'static str {
9928        "GitRepository"
9929    }
9930    fn from_query(
9931        proc: Option<Arc<DaggerSessionProc>>,
9932        selection: Selection,
9933        graphql_client: DynGraphQLClient,
9934    ) -> Self {
9935        Self {
9936            proc,
9937            selection,
9938            graphql_client,
9939        }
9940    }
9941}
9942impl GitRepository {
9943    /// Returns details of a branch.
9944    ///
9945    /// # Arguments
9946    ///
9947    /// * `name` - Branch's name (e.g., "main").
9948    pub fn branch(&self, name: impl Into<String>) -> GitRef {
9949        let mut query = self.selection.select("branch");
9950        query = query.arg("name", name.into());
9951        GitRef {
9952            proc: self.proc.clone(),
9953            selection: query,
9954            graphql_client: self.graphql_client.clone(),
9955        }
9956    }
9957    /// branches that match any of the given glob patterns.
9958    ///
9959    /// # Arguments
9960    ///
9961    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9962    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
9963        let query = self.selection.select("branches");
9964        query.execute(self.graphql_client.clone()).await
9965    }
9966    /// branches that match any of the given glob patterns.
9967    ///
9968    /// # Arguments
9969    ///
9970    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9971    pub async fn branches_opts<'a>(
9972        &self,
9973        opts: GitRepositoryBranchesOpts<'a>,
9974    ) -> Result<Vec<String>, DaggerError> {
9975        let mut query = self.selection.select("branches");
9976        if let Some(patterns) = opts.patterns {
9977            query = query.arg("patterns", patterns);
9978        }
9979        query.execute(self.graphql_client.clone()).await
9980    }
9981    /// Returns details of a commit.
9982    ///
9983    /// # Arguments
9984    ///
9985    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
9986    pub fn commit(&self, id: impl Into<String>) -> GitRef {
9987        let mut query = self.selection.select("commit");
9988        query = query.arg("id", id.into());
9989        GitRef {
9990            proc: self.proc.clone(),
9991            selection: query,
9992            graphql_client: self.graphql_client.clone(),
9993        }
9994    }
9995    /// Returns details for HEAD.
9996    pub fn head(&self) -> GitRef {
9997        let query = self.selection.select("head");
9998        GitRef {
9999            proc: self.proc.clone(),
10000            selection: query,
10001            graphql_client: self.graphql_client.clone(),
10002        }
10003    }
10004    /// A unique identifier for this GitRepository.
10005    pub async fn id(&self) -> Result<Id, DaggerError> {
10006        let query = self.selection.select("id");
10007        query.execute(self.graphql_client.clone()).await
10008    }
10009    /// Returns details for the latest semver tag.
10010    pub fn latest_version(&self) -> GitRef {
10011        let query = self.selection.select("latestVersion");
10012        GitRef {
10013            proc: self.proc.clone(),
10014            selection: query,
10015            graphql_client: self.graphql_client.clone(),
10016        }
10017    }
10018    /// Returns details of a ref.
10019    ///
10020    /// # Arguments
10021    ///
10022    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
10023    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
10024        let mut query = self.selection.select("ref");
10025        query = query.arg("name", name.into());
10026        GitRef {
10027            proc: self.proc.clone(),
10028            selection: query,
10029            graphql_client: self.graphql_client.clone(),
10030        }
10031    }
10032    /// Returns details of a tag.
10033    ///
10034    /// # Arguments
10035    ///
10036    /// * `name` - Tag's name (e.g., "v0.3.9").
10037    pub fn tag(&self, name: impl Into<String>) -> GitRef {
10038        let mut query = self.selection.select("tag");
10039        query = query.arg("name", name.into());
10040        GitRef {
10041            proc: self.proc.clone(),
10042            selection: query,
10043            graphql_client: self.graphql_client.clone(),
10044        }
10045    }
10046    /// tags that match any of the given glob patterns.
10047    ///
10048    /// # Arguments
10049    ///
10050    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10051    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
10052        let query = self.selection.select("tags");
10053        query.execute(self.graphql_client.clone()).await
10054    }
10055    /// tags that match any of the given glob patterns.
10056    ///
10057    /// # Arguments
10058    ///
10059    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10060    pub async fn tags_opts<'a>(
10061        &self,
10062        opts: GitRepositoryTagsOpts<'a>,
10063    ) -> Result<Vec<String>, DaggerError> {
10064        let mut query = self.selection.select("tags");
10065        if let Some(patterns) = opts.patterns {
10066            query = query.arg("patterns", patterns);
10067        }
10068        query.execute(self.graphql_client.clone()).await
10069    }
10070    /// Returns the changeset of uncommitted changes in the git repository.
10071    pub fn uncommitted(&self) -> Changeset {
10072        let query = self.selection.select("uncommitted");
10073        Changeset {
10074            proc: self.proc.clone(),
10075            selection: query,
10076            graphql_client: self.graphql_client.clone(),
10077        }
10078    }
10079    /// The URL of the git repository.
10080    pub async fn url(&self) -> Result<String, DaggerError> {
10081        let query = self.selection.select("url");
10082        query.execute(self.graphql_client.clone()).await
10083    }
10084}
10085impl Node for GitRepository {
10086    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10087        let query = self.selection.select("id");
10088        let graphql_client = self.graphql_client.clone();
10089        async move { query.execute(graphql_client).await }
10090    }
10091}
10092#[derive(Clone)]
10093pub struct HttpState {
10094    pub proc: Option<Arc<DaggerSessionProc>>,
10095    pub selection: Selection,
10096    pub graphql_client: DynGraphQLClient,
10097}
10098impl IntoID<Id> for HttpState {
10099    fn into_id(
10100        self,
10101    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10102        Box::pin(async move { self.id().await })
10103    }
10104}
10105impl Loadable for HttpState {
10106    fn graphql_type() -> &'static str {
10107        "HTTPState"
10108    }
10109    fn from_query(
10110        proc: Option<Arc<DaggerSessionProc>>,
10111        selection: Selection,
10112        graphql_client: DynGraphQLClient,
10113    ) -> Self {
10114        Self {
10115            proc,
10116            selection,
10117            graphql_client,
10118        }
10119    }
10120}
10121impl HttpState {
10122    /// A unique identifier for this HTTPState.
10123    pub async fn id(&self) -> Result<Id, DaggerError> {
10124        let query = self.selection.select("id");
10125        query.execute(self.graphql_client.clone()).await
10126    }
10127}
10128impl Node for HttpState {
10129    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10130        let query = self.selection.select("id");
10131        let graphql_client = self.graphql_client.clone();
10132        async move { query.execute(graphql_client).await }
10133    }
10134}
10135#[derive(Clone)]
10136pub struct HealthcheckConfig {
10137    pub proc: Option<Arc<DaggerSessionProc>>,
10138    pub selection: Selection,
10139    pub graphql_client: DynGraphQLClient,
10140}
10141impl IntoID<Id> for HealthcheckConfig {
10142    fn into_id(
10143        self,
10144    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10145        Box::pin(async move { self.id().await })
10146    }
10147}
10148impl Loadable for HealthcheckConfig {
10149    fn graphql_type() -> &'static str {
10150        "HealthcheckConfig"
10151    }
10152    fn from_query(
10153        proc: Option<Arc<DaggerSessionProc>>,
10154        selection: Selection,
10155        graphql_client: DynGraphQLClient,
10156    ) -> Self {
10157        Self {
10158            proc,
10159            selection,
10160            graphql_client,
10161        }
10162    }
10163}
10164impl HealthcheckConfig {
10165    /// Healthcheck command arguments.
10166    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
10167        let query = self.selection.select("args");
10168        query.execute(self.graphql_client.clone()).await
10169    }
10170    /// A unique identifier for this HealthcheckConfig.
10171    pub async fn id(&self) -> Result<Id, DaggerError> {
10172        let query = self.selection.select("id");
10173        query.execute(self.graphql_client.clone()).await
10174    }
10175    /// Interval between running healthcheck. Example:30s
10176    pub async fn interval(&self) -> Result<String, DaggerError> {
10177        let query = self.selection.select("interval");
10178        query.execute(self.graphql_client.clone()).await
10179    }
10180    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example:3
10181    pub async fn retries(&self) -> Result<isize, DaggerError> {
10182        let query = self.selection.select("retries");
10183        query.execute(self.graphql_client.clone()).await
10184    }
10185    /// Healthcheck command is a shell command.
10186    pub async fn shell(&self) -> Result<bool, DaggerError> {
10187        let query = self.selection.select("shell");
10188        query.execute(self.graphql_client.clone()).await
10189    }
10190    /// StartInterval configures the duration between checks during the startup phase. Example:5s
10191    pub async fn start_interval(&self) -> Result<String, DaggerError> {
10192        let query = self.selection.select("startInterval");
10193        query.execute(self.graphql_client.clone()).await
10194    }
10195    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example:0s
10196    pub async fn start_period(&self) -> Result<String, DaggerError> {
10197        let query = self.selection.select("startPeriod");
10198        query.execute(self.graphql_client.clone()).await
10199    }
10200    /// Healthcheck timeout. Example:3s
10201    pub async fn timeout(&self) -> Result<String, DaggerError> {
10202        let query = self.selection.select("timeout");
10203        query.execute(self.graphql_client.clone()).await
10204    }
10205}
10206impl Node for HealthcheckConfig {
10207    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10208        let query = self.selection.select("id");
10209        let graphql_client = self.graphql_client.clone();
10210        async move { query.execute(graphql_client).await }
10211    }
10212}
10213#[derive(Clone)]
10214pub struct Host {
10215    pub proc: Option<Arc<DaggerSessionProc>>,
10216    pub selection: Selection,
10217    pub graphql_client: DynGraphQLClient,
10218}
10219#[derive(Builder, Debug, PartialEq)]
10220pub struct HostDirectoryOpts<'a> {
10221    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
10222    #[builder(setter(into, strip_option), default)]
10223    pub exclude: Option<Vec<&'a str>>,
10224    /// Apply .gitignore filter rules inside the directory
10225    #[builder(setter(into, strip_option), default)]
10226    pub gitignore: Option<bool>,
10227    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
10228    #[builder(setter(into, strip_option), default)]
10229    pub include: Option<Vec<&'a str>>,
10230    /// If true, the directory will always be reloaded from the host.
10231    #[builder(setter(into, strip_option), default)]
10232    pub no_cache: Option<bool>,
10233}
10234#[derive(Builder, Debug, PartialEq)]
10235pub struct HostFileOpts {
10236    /// If true, the file will always be reloaded from the host.
10237    #[builder(setter(into, strip_option), default)]
10238    pub no_cache: Option<bool>,
10239}
10240#[derive(Builder, Debug, PartialEq)]
10241pub struct HostFindUpOpts {
10242    #[builder(setter(into, strip_option), default)]
10243    pub no_cache: Option<bool>,
10244}
10245#[derive(Builder, Debug, PartialEq)]
10246pub struct HostServiceOpts<'a> {
10247    /// Upstream host to forward traffic to.
10248    #[builder(setter(into, strip_option), default)]
10249    pub host: Option<&'a str>,
10250}
10251#[derive(Builder, Debug, PartialEq)]
10252pub struct HostTunnelOpts {
10253    /// Map each service port to the same port on the host, as if the service were running natively.
10254    /// Note: enabling may result in port conflicts.
10255    #[builder(setter(into, strip_option), default)]
10256    pub native: Option<bool>,
10257    /// Configure explicit port forwarding rules for the tunnel.
10258    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
10259    /// 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.
10260    /// If ports are given and native is true, the ports are additive.
10261    #[builder(setter(into, strip_option), default)]
10262    pub ports: Option<Vec<PortForward>>,
10263}
10264impl IntoID<Id> for Host {
10265    fn into_id(
10266        self,
10267    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10268        Box::pin(async move { self.id().await })
10269    }
10270}
10271impl Loadable for Host {
10272    fn graphql_type() -> &'static str {
10273        "Host"
10274    }
10275    fn from_query(
10276        proc: Option<Arc<DaggerSessionProc>>,
10277        selection: Selection,
10278        graphql_client: DynGraphQLClient,
10279    ) -> Self {
10280        Self {
10281            proc,
10282            selection,
10283            graphql_client,
10284        }
10285    }
10286}
10287impl Host {
10288    /// Accesses a container image on the host.
10289    ///
10290    /// # Arguments
10291    ///
10292    /// * `name` - Name of the image to access.
10293    pub fn container_image(&self, name: impl Into<String>) -> Container {
10294        let mut query = self.selection.select("containerImage");
10295        query = query.arg("name", name.into());
10296        Container {
10297            proc: self.proc.clone(),
10298            selection: query,
10299            graphql_client: self.graphql_client.clone(),
10300        }
10301    }
10302    /// Accesses a directory on the host.
10303    ///
10304    /// # Arguments
10305    ///
10306    /// * `path` - Location of the directory to access (e.g., ".").
10307    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10308    pub fn directory(&self, path: impl Into<String>) -> Directory {
10309        let mut query = self.selection.select("directory");
10310        query = query.arg("path", path.into());
10311        Directory {
10312            proc: self.proc.clone(),
10313            selection: query,
10314            graphql_client: self.graphql_client.clone(),
10315        }
10316    }
10317    /// Accesses a directory on the host.
10318    ///
10319    /// # Arguments
10320    ///
10321    /// * `path` - Location of the directory to access (e.g., ".").
10322    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10323    pub fn directory_opts<'a>(
10324        &self,
10325        path: impl Into<String>,
10326        opts: HostDirectoryOpts<'a>,
10327    ) -> Directory {
10328        let mut query = self.selection.select("directory");
10329        query = query.arg("path", path.into());
10330        if let Some(exclude) = opts.exclude {
10331            query = query.arg("exclude", exclude);
10332        }
10333        if let Some(include) = opts.include {
10334            query = query.arg("include", include);
10335        }
10336        if let Some(no_cache) = opts.no_cache {
10337            query = query.arg("noCache", no_cache);
10338        }
10339        if let Some(gitignore) = opts.gitignore {
10340            query = query.arg("gitignore", gitignore);
10341        }
10342        Directory {
10343            proc: self.proc.clone(),
10344            selection: query,
10345            graphql_client: self.graphql_client.clone(),
10346        }
10347    }
10348    /// Accesses a file on the host.
10349    ///
10350    /// # Arguments
10351    ///
10352    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10353    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10354    pub fn file(&self, path: impl Into<String>) -> File {
10355        let mut query = self.selection.select("file");
10356        query = query.arg("path", path.into());
10357        File {
10358            proc: self.proc.clone(),
10359            selection: query,
10360            graphql_client: self.graphql_client.clone(),
10361        }
10362    }
10363    /// Accesses a file on the host.
10364    ///
10365    /// # Arguments
10366    ///
10367    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10368    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10369    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
10370        let mut query = self.selection.select("file");
10371        query = query.arg("path", path.into());
10372        if let Some(no_cache) = opts.no_cache {
10373            query = query.arg("noCache", no_cache);
10374        }
10375        File {
10376            proc: self.proc.clone(),
10377            selection: query,
10378            graphql_client: self.graphql_client.clone(),
10379        }
10380    }
10381    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10382    ///
10383    /// # Arguments
10384    ///
10385    /// * `name` - name of the file or directory to search for
10386    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10387    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
10388        let mut query = self.selection.select("findUp");
10389        query = query.arg("name", name.into());
10390        query.execute(self.graphql_client.clone()).await
10391    }
10392    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10393    ///
10394    /// # Arguments
10395    ///
10396    /// * `name` - name of the file or directory to search for
10397    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10398    pub async fn find_up_opts(
10399        &self,
10400        name: impl Into<String>,
10401        opts: HostFindUpOpts,
10402    ) -> Result<String, DaggerError> {
10403        let mut query = self.selection.select("findUp");
10404        query = query.arg("name", name.into());
10405        if let Some(no_cache) = opts.no_cache {
10406            query = query.arg("noCache", no_cache);
10407        }
10408        query.execute(self.graphql_client.clone()).await
10409    }
10410    /// A unique identifier for this Host.
10411    pub async fn id(&self) -> Result<Id, DaggerError> {
10412        let query = self.selection.select("id");
10413        query.execute(self.graphql_client.clone()).await
10414    }
10415    /// Creates a service that forwards traffic to a specified address via the host.
10416    ///
10417    /// # Arguments
10418    ///
10419    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10420    ///
10421    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10422    ///
10423    /// An empty set of ports is not valid; an error will be returned.
10424    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10425    pub fn service(&self, ports: Vec<PortForward>) -> Service {
10426        let mut query = self.selection.select("service");
10427        query = query.arg("ports", ports);
10428        Service {
10429            proc: self.proc.clone(),
10430            selection: query,
10431            graphql_client: self.graphql_client.clone(),
10432        }
10433    }
10434    /// Creates a service that forwards traffic to a specified address via the host.
10435    ///
10436    /// # Arguments
10437    ///
10438    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10439    ///
10440    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10441    ///
10442    /// An empty set of ports is not valid; an error will be returned.
10443    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10444    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
10445        let mut query = self.selection.select("service");
10446        query = query.arg("ports", ports);
10447        if let Some(host) = opts.host {
10448            query = query.arg("host", host);
10449        }
10450        Service {
10451            proc: self.proc.clone(),
10452            selection: query,
10453            graphql_client: self.graphql_client.clone(),
10454        }
10455    }
10456    /// Creates a tunnel that forwards traffic from the host to a service.
10457    ///
10458    /// # Arguments
10459    ///
10460    /// * `service` - Service to send traffic from the tunnel.
10461    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10462    pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
10463        let mut query = self.selection.select("tunnel");
10464        query = query.arg_lazy(
10465            "service",
10466            Box::new(move || {
10467                let service = service.clone();
10468                Box::pin(async move { service.into_id().await.unwrap().quote() })
10469            }),
10470        );
10471        Service {
10472            proc: self.proc.clone(),
10473            selection: query,
10474            graphql_client: self.graphql_client.clone(),
10475        }
10476    }
10477    /// Creates a tunnel that forwards traffic from the host to a service.
10478    ///
10479    /// # Arguments
10480    ///
10481    /// * `service` - Service to send traffic from the tunnel.
10482    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10483    pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
10484        let mut query = self.selection.select("tunnel");
10485        query = query.arg_lazy(
10486            "service",
10487            Box::new(move || {
10488                let service = service.clone();
10489                Box::pin(async move { service.into_id().await.unwrap().quote() })
10490            }),
10491        );
10492        if let Some(native) = opts.native {
10493            query = query.arg("native", native);
10494        }
10495        if let Some(ports) = opts.ports {
10496            query = query.arg("ports", ports);
10497        }
10498        Service {
10499            proc: self.proc.clone(),
10500            selection: query,
10501            graphql_client: self.graphql_client.clone(),
10502        }
10503    }
10504    /// Accesses a Unix socket on the host.
10505    ///
10506    /// # Arguments
10507    ///
10508    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
10509    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
10510        let mut query = self.selection.select("unixSocket");
10511        query = query.arg("path", path.into());
10512        Socket {
10513            proc: self.proc.clone(),
10514            selection: query,
10515            graphql_client: self.graphql_client.clone(),
10516        }
10517    }
10518}
10519impl Node for Host {
10520    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10521        let query = self.selection.select("id");
10522        let graphql_client = self.graphql_client.clone();
10523        async move { query.execute(graphql_client).await }
10524    }
10525}
10526#[derive(Clone)]
10527pub struct InputTypeDef {
10528    pub proc: Option<Arc<DaggerSessionProc>>,
10529    pub selection: Selection,
10530    pub graphql_client: DynGraphQLClient,
10531}
10532impl IntoID<Id> for InputTypeDef {
10533    fn into_id(
10534        self,
10535    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10536        Box::pin(async move { self.id().await })
10537    }
10538}
10539impl Loadable for InputTypeDef {
10540    fn graphql_type() -> &'static str {
10541        "InputTypeDef"
10542    }
10543    fn from_query(
10544        proc: Option<Arc<DaggerSessionProc>>,
10545        selection: Selection,
10546        graphql_client: DynGraphQLClient,
10547    ) -> Self {
10548        Self {
10549            proc,
10550            selection,
10551            graphql_client,
10552        }
10553    }
10554}
10555impl InputTypeDef {
10556    /// Static fields defined on this input object, if any.
10557    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
10558        let query = self.selection.select("fields");
10559        let query = query.select("id");
10560        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10561        Ok(ids
10562            .into_iter()
10563            .map(|id| FieldTypeDef {
10564                proc: self.proc.clone(),
10565                selection: crate::querybuilder::query()
10566                    .select("node")
10567                    .arg("id", &id.0)
10568                    .inline_fragment("FieldTypeDef"),
10569                graphql_client: self.graphql_client.clone(),
10570            })
10571            .collect())
10572    }
10573    /// A unique identifier for this InputTypeDef.
10574    pub async fn id(&self) -> Result<Id, DaggerError> {
10575        let query = self.selection.select("id");
10576        query.execute(self.graphql_client.clone()).await
10577    }
10578    /// The name of the input object.
10579    pub async fn name(&self) -> Result<String, DaggerError> {
10580        let query = self.selection.select("name");
10581        query.execute(self.graphql_client.clone()).await
10582    }
10583}
10584impl Node for InputTypeDef {
10585    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10586        let query = self.selection.select("id");
10587        let graphql_client = self.graphql_client.clone();
10588        async move { query.execute(graphql_client).await }
10589    }
10590}
10591#[derive(Clone)]
10592pub struct InterfaceTypeDef {
10593    pub proc: Option<Arc<DaggerSessionProc>>,
10594    pub selection: Selection,
10595    pub graphql_client: DynGraphQLClient,
10596}
10597impl IntoID<Id> for InterfaceTypeDef {
10598    fn into_id(
10599        self,
10600    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10601        Box::pin(async move { self.id().await })
10602    }
10603}
10604impl Loadable for InterfaceTypeDef {
10605    fn graphql_type() -> &'static str {
10606        "InterfaceTypeDef"
10607    }
10608    fn from_query(
10609        proc: Option<Arc<DaggerSessionProc>>,
10610        selection: Selection,
10611        graphql_client: DynGraphQLClient,
10612    ) -> Self {
10613        Self {
10614            proc,
10615            selection,
10616            graphql_client,
10617        }
10618    }
10619}
10620impl InterfaceTypeDef {
10621    /// The doc string for the interface, if any.
10622    pub async fn description(&self) -> Result<String, DaggerError> {
10623        let query = self.selection.select("description");
10624        query.execute(self.graphql_client.clone()).await
10625    }
10626    /// Functions defined on this interface, if any.
10627    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
10628        let query = self.selection.select("functions");
10629        let query = query.select("id");
10630        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10631        Ok(ids
10632            .into_iter()
10633            .map(|id| Function {
10634                proc: self.proc.clone(),
10635                selection: crate::querybuilder::query()
10636                    .select("node")
10637                    .arg("id", &id.0)
10638                    .inline_fragment("Function"),
10639                graphql_client: self.graphql_client.clone(),
10640            })
10641            .collect())
10642    }
10643    /// A unique identifier for this InterfaceTypeDef.
10644    pub async fn id(&self) -> Result<Id, DaggerError> {
10645        let query = self.selection.select("id");
10646        query.execute(self.graphql_client.clone()).await
10647    }
10648    /// The name of the interface.
10649    pub async fn name(&self) -> Result<String, DaggerError> {
10650        let query = self.selection.select("name");
10651        query.execute(self.graphql_client.clone()).await
10652    }
10653    /// The location of this interface declaration.
10654    pub fn source_map(&self) -> SourceMap {
10655        let query = self.selection.select("sourceMap");
10656        SourceMap {
10657            proc: self.proc.clone(),
10658            selection: query,
10659            graphql_client: self.graphql_client.clone(),
10660        }
10661    }
10662    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
10663    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10664        let query = self.selection.select("sourceModuleName");
10665        query.execute(self.graphql_client.clone()).await
10666    }
10667}
10668impl Node for InterfaceTypeDef {
10669    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10670        let query = self.selection.select("id");
10671        let graphql_client = self.graphql_client.clone();
10672        async move { query.execute(graphql_client).await }
10673    }
10674}
10675#[derive(Clone)]
10676pub struct JsonValue {
10677    pub proc: Option<Arc<DaggerSessionProc>>,
10678    pub selection: Selection,
10679    pub graphql_client: DynGraphQLClient,
10680}
10681#[derive(Builder, Debug, PartialEq)]
10682pub struct JsonValueContentsOpts<'a> {
10683    /// Optional line prefix
10684    #[builder(setter(into, strip_option), default)]
10685    pub indent: Option<&'a str>,
10686    /// Pretty-print
10687    #[builder(setter(into, strip_option), default)]
10688    pub pretty: Option<bool>,
10689}
10690impl IntoID<Id> for JsonValue {
10691    fn into_id(
10692        self,
10693    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10694        Box::pin(async move { self.id().await })
10695    }
10696}
10697impl Loadable for JsonValue {
10698    fn graphql_type() -> &'static str {
10699        "JSONValue"
10700    }
10701    fn from_query(
10702        proc: Option<Arc<DaggerSessionProc>>,
10703        selection: Selection,
10704        graphql_client: DynGraphQLClient,
10705    ) -> Self {
10706        Self {
10707            proc,
10708            selection,
10709            graphql_client,
10710        }
10711    }
10712}
10713impl JsonValue {
10714    /// Decode an array from json
10715    pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
10716        let query = self.selection.select("asArray");
10717        let query = query.select("id");
10718        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10719        Ok(ids
10720            .into_iter()
10721            .map(|id| JsonValue {
10722                proc: self.proc.clone(),
10723                selection: crate::querybuilder::query()
10724                    .select("node")
10725                    .arg("id", &id.0)
10726                    .inline_fragment("JSONValue"),
10727                graphql_client: self.graphql_client.clone(),
10728            })
10729            .collect())
10730    }
10731    /// Decode a boolean from json
10732    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10733        let query = self.selection.select("asBoolean");
10734        query.execute(self.graphql_client.clone()).await
10735    }
10736    /// Decode an integer from json
10737    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10738        let query = self.selection.select("asInteger");
10739        query.execute(self.graphql_client.clone()).await
10740    }
10741    /// Decode a string from json
10742    pub async fn as_string(&self) -> Result<String, DaggerError> {
10743        let query = self.selection.select("asString");
10744        query.execute(self.graphql_client.clone()).await
10745    }
10746    /// Return the value encoded as json
10747    ///
10748    /// # Arguments
10749    ///
10750    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10751    pub async fn contents(&self) -> Result<Json, DaggerError> {
10752        let query = self.selection.select("contents");
10753        query.execute(self.graphql_client.clone()).await
10754    }
10755    /// Return the value encoded as json
10756    ///
10757    /// # Arguments
10758    ///
10759    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10760    pub async fn contents_opts<'a>(
10761        &self,
10762        opts: JsonValueContentsOpts<'a>,
10763    ) -> Result<Json, DaggerError> {
10764        let mut query = self.selection.select("contents");
10765        if let Some(pretty) = opts.pretty {
10766            query = query.arg("pretty", pretty);
10767        }
10768        if let Some(indent) = opts.indent {
10769            query = query.arg("indent", indent);
10770        }
10771        query.execute(self.graphql_client.clone()).await
10772    }
10773    /// Lookup the field at the given path, and return its value.
10774    ///
10775    /// # Arguments
10776    ///
10777    /// * `path` - Path of the field to lookup, encoded as an array of field names
10778    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
10779        let mut query = self.selection.select("field");
10780        query = query.arg(
10781            "path",
10782            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10783        );
10784        JsonValue {
10785            proc: self.proc.clone(),
10786            selection: query,
10787            graphql_client: self.graphql_client.clone(),
10788        }
10789    }
10790    /// List fields of the encoded object
10791    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
10792        let query = self.selection.select("fields");
10793        query.execute(self.graphql_client.clone()).await
10794    }
10795    /// A unique identifier for this JSONValue.
10796    pub async fn id(&self) -> Result<Id, DaggerError> {
10797        let query = self.selection.select("id");
10798        query.execute(self.graphql_client.clone()).await
10799    }
10800    /// Encode a boolean to json
10801    ///
10802    /// # Arguments
10803    ///
10804    /// * `value` - New boolean value
10805    pub fn new_boolean(&self, value: bool) -> JsonValue {
10806        let mut query = self.selection.select("newBoolean");
10807        query = query.arg("value", value);
10808        JsonValue {
10809            proc: self.proc.clone(),
10810            selection: query,
10811            graphql_client: self.graphql_client.clone(),
10812        }
10813    }
10814    /// Encode an integer to json
10815    ///
10816    /// # Arguments
10817    ///
10818    /// * `value` - New integer value
10819    pub fn new_integer(&self, value: isize) -> JsonValue {
10820        let mut query = self.selection.select("newInteger");
10821        query = query.arg("value", value);
10822        JsonValue {
10823            proc: self.proc.clone(),
10824            selection: query,
10825            graphql_client: self.graphql_client.clone(),
10826        }
10827    }
10828    /// Encode a string to json
10829    ///
10830    /// # Arguments
10831    ///
10832    /// * `value` - New string value
10833    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
10834        let mut query = self.selection.select("newString");
10835        query = query.arg("value", value.into());
10836        JsonValue {
10837            proc: self.proc.clone(),
10838            selection: query,
10839            graphql_client: self.graphql_client.clone(),
10840        }
10841    }
10842    /// Return a new json value, decoded from the given content
10843    ///
10844    /// # Arguments
10845    ///
10846    /// * `contents` - New JSON-encoded contents
10847    pub fn with_contents(&self, contents: Json) -> JsonValue {
10848        let mut query = self.selection.select("withContents");
10849        query = query.arg("contents", contents);
10850        JsonValue {
10851            proc: self.proc.clone(),
10852            selection: query,
10853            graphql_client: self.graphql_client.clone(),
10854        }
10855    }
10856    /// Set a new field at the given path
10857    ///
10858    /// # Arguments
10859    ///
10860    /// * `path` - Path of the field to set, encoded as an array of field names
10861    /// * `value` - The new value of the field
10862    pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
10863        let mut query = self.selection.select("withField");
10864        query = query.arg(
10865            "path",
10866            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10867        );
10868        query = query.arg_lazy(
10869            "value",
10870            Box::new(move || {
10871                let value = value.clone();
10872                Box::pin(async move { value.into_id().await.unwrap().quote() })
10873            }),
10874        );
10875        JsonValue {
10876            proc: self.proc.clone(),
10877            selection: query,
10878            graphql_client: self.graphql_client.clone(),
10879        }
10880    }
10881}
10882impl Node for JsonValue {
10883    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10884        let query = self.selection.select("id");
10885        let graphql_client = self.graphql_client.clone();
10886        async move { query.execute(graphql_client).await }
10887    }
10888}
10889#[derive(Clone)]
10890pub struct Llm {
10891    pub proc: Option<Arc<DaggerSessionProc>>,
10892    pub selection: Selection,
10893    pub graphql_client: DynGraphQLClient,
10894}
10895impl IntoID<Id> for Llm {
10896    fn into_id(
10897        self,
10898    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10899        Box::pin(async move { self.id().await })
10900    }
10901}
10902impl Loadable for Llm {
10903    fn graphql_type() -> &'static str {
10904        "LLM"
10905    }
10906    fn from_query(
10907        proc: Option<Arc<DaggerSessionProc>>,
10908        selection: Selection,
10909        graphql_client: DynGraphQLClient,
10910    ) -> Self {
10911        Self {
10912            proc,
10913            selection,
10914            graphql_client,
10915        }
10916    }
10917}
10918impl Llm {
10919    /// create a branch in the LLM's history
10920    pub fn attempt(&self, number: isize) -> Llm {
10921        let mut query = self.selection.select("attempt");
10922        query = query.arg("number", number);
10923        Llm {
10924            proc: self.proc.clone(),
10925            selection: query,
10926            graphql_client: self.graphql_client.clone(),
10927        }
10928    }
10929    /// returns the type of the current state
10930    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
10931        let mut query = self.selection.select("bindResult");
10932        query = query.arg("name", name.into());
10933        Binding {
10934            proc: self.proc.clone(),
10935            selection: query,
10936            graphql_client: self.graphql_client.clone(),
10937        }
10938    }
10939    /// return the LLM's current environment
10940    pub fn env(&self) -> Env {
10941        let query = self.selection.select("env");
10942        Env {
10943            proc: self.proc.clone(),
10944            selection: query,
10945            graphql_client: self.graphql_client.clone(),
10946        }
10947    }
10948    /// Indicates whether there are any queued prompts or tool results to send to the model
10949    pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
10950        let query = self.selection.select("hasPrompt");
10951        query.execute(self.graphql_client.clone()).await
10952    }
10953    /// return the llm message history
10954    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
10955        let query = self.selection.select("history");
10956        query.execute(self.graphql_client.clone()).await
10957    }
10958    /// return the raw llm message history as json
10959    pub async fn history_json(&self) -> Result<Json, DaggerError> {
10960        let query = self.selection.select("historyJSON");
10961        query.execute(self.graphql_client.clone()).await
10962    }
10963    /// A unique identifier for this LLM.
10964    pub async fn id(&self) -> Result<Id, DaggerError> {
10965        let query = self.selection.select("id");
10966        query.execute(self.graphql_client.clone()).await
10967    }
10968    /// return the last llm reply from the history
10969    pub async fn last_reply(&self) -> Result<String, DaggerError> {
10970        let query = self.selection.select("lastReply");
10971        query.execute(self.graphql_client.clone()).await
10972    }
10973    /// Submit the queued prompt, evaluate any tool calls, queue their results, and keep going until the model ends its turn
10974    pub fn r#loop(&self) -> Llm {
10975        let query = self.selection.select("loop");
10976        Llm {
10977            proc: self.proc.clone(),
10978            selection: query,
10979            graphql_client: self.graphql_client.clone(),
10980        }
10981    }
10982    /// return the model used by the llm
10983    pub async fn model(&self) -> Result<String, DaggerError> {
10984        let query = self.selection.select("model");
10985        query.execute(self.graphql_client.clone()).await
10986    }
10987    /// return the provider used by the llm
10988    pub async fn provider(&self) -> Result<String, DaggerError> {
10989        let query = self.selection.select("provider");
10990        query.execute(self.graphql_client.clone()).await
10991    }
10992    /// Submit the queued prompt or tool call results, evaluate any tool calls, and queue their results
10993    pub async fn step(&self) -> Result<Llm, DaggerError> {
10994        let query = self.selection.select("step");
10995        let id: Id = query.execute(self.graphql_client.clone()).await?;
10996        Ok(Llm {
10997            proc: self.proc.clone(),
10998            selection: query
10999                .root()
11000                .select("node")
11001                .arg("id", &id.0)
11002                .inline_fragment("LLM"),
11003            graphql_client: self.graphql_client.clone(),
11004        })
11005    }
11006    /// synchronize LLM state
11007    pub async fn sync(&self) -> Result<Llm, DaggerError> {
11008        let query = self.selection.select("sync");
11009        let id: Id = query.execute(self.graphql_client.clone()).await?;
11010        Ok(Llm {
11011            proc: self.proc.clone(),
11012            selection: query
11013                .root()
11014                .select("node")
11015                .arg("id", &id.0)
11016                .inline_fragment("LLM"),
11017            graphql_client: self.graphql_client.clone(),
11018        })
11019    }
11020    /// returns the token usage of the current state
11021    pub fn token_usage(&self) -> LlmTokenUsage {
11022        let query = self.selection.select("tokenUsage");
11023        LlmTokenUsage {
11024            proc: self.proc.clone(),
11025            selection: query,
11026            graphql_client: self.graphql_client.clone(),
11027        }
11028    }
11029    /// print documentation for available tools
11030    pub async fn tools(&self) -> Result<String, DaggerError> {
11031        let query = self.selection.select("tools");
11032        query.execute(self.graphql_client.clone()).await
11033    }
11034    /// Return a new LLM with the specified function no longer exposed as a tool
11035    ///
11036    /// # Arguments
11037    ///
11038    /// * `type_name` - The type name whose function will be blocked
11039    /// * `function` - The function to block
11040    ///
11041    /// Will be converted to lowerCamelCase if necessary.
11042    pub fn with_blocked_function(
11043        &self,
11044        type_name: impl Into<String>,
11045        function: impl Into<String>,
11046    ) -> Llm {
11047        let mut query = self.selection.select("withBlockedFunction");
11048        query = query.arg("typeName", type_name.into());
11049        query = query.arg("function", function.into());
11050        Llm {
11051            proc: self.proc.clone(),
11052            selection: query,
11053            graphql_client: self.graphql_client.clone(),
11054        }
11055    }
11056    /// allow the LLM to interact with an environment via MCP
11057    pub fn with_env(&self, env: impl IntoID<Id>) -> Llm {
11058        let mut query = self.selection.select("withEnv");
11059        query = query.arg_lazy(
11060            "env",
11061            Box::new(move || {
11062                let env = env.clone();
11063                Box::pin(async move { env.into_id().await.unwrap().quote() })
11064            }),
11065        );
11066        Llm {
11067            proc: self.proc.clone(),
11068            selection: query,
11069            graphql_client: self.graphql_client.clone(),
11070        }
11071    }
11072    /// Add an external MCP server to the LLM
11073    ///
11074    /// # Arguments
11075    ///
11076    /// * `name` - The name of the MCP server
11077    /// * `service` - The MCP service to run and communicate with over stdio
11078    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
11079        let mut query = self.selection.select("withMCPServer");
11080        query = query.arg("name", name.into());
11081        query = query.arg_lazy(
11082            "service",
11083            Box::new(move || {
11084                let service = service.clone();
11085                Box::pin(async move { service.into_id().await.unwrap().quote() })
11086            }),
11087        );
11088        Llm {
11089            proc: self.proc.clone(),
11090            selection: query,
11091            graphql_client: self.graphql_client.clone(),
11092        }
11093    }
11094    /// swap out the llm model
11095    ///
11096    /// # Arguments
11097    ///
11098    /// * `model` - The model to use
11099    pub fn with_model(&self, model: impl Into<String>) -> Llm {
11100        let mut query = self.selection.select("withModel");
11101        query = query.arg("model", model.into());
11102        Llm {
11103            proc: self.proc.clone(),
11104            selection: query,
11105            graphql_client: self.graphql_client.clone(),
11106        }
11107    }
11108    /// append a prompt to the llm context
11109    ///
11110    /// # Arguments
11111    ///
11112    /// * `prompt` - The prompt to send
11113    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
11114        let mut query = self.selection.select("withPrompt");
11115        query = query.arg("prompt", prompt.into());
11116        Llm {
11117            proc: self.proc.clone(),
11118            selection: query,
11119            graphql_client: self.graphql_client.clone(),
11120        }
11121    }
11122    /// append the contents of a file to the llm context
11123    ///
11124    /// # Arguments
11125    ///
11126    /// * `file` - The file to read the prompt from
11127    pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
11128        let mut query = self.selection.select("withPromptFile");
11129        query = query.arg_lazy(
11130            "file",
11131            Box::new(move || {
11132                let file = file.clone();
11133                Box::pin(async move { file.into_id().await.unwrap().quote() })
11134            }),
11135        );
11136        Llm {
11137            proc: self.proc.clone(),
11138            selection: query,
11139            graphql_client: self.graphql_client.clone(),
11140        }
11141    }
11142    /// Use a static set of tools for method calls, e.g. for MCP clients that do not support dynamic tool registration
11143    pub fn with_static_tools(&self) -> Llm {
11144        let query = self.selection.select("withStaticTools");
11145        Llm {
11146            proc: self.proc.clone(),
11147            selection: query,
11148            graphql_client: self.graphql_client.clone(),
11149        }
11150    }
11151    /// Add a system prompt to the LLM's environment
11152    ///
11153    /// # Arguments
11154    ///
11155    /// * `prompt` - The system prompt to send
11156    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
11157        let mut query = self.selection.select("withSystemPrompt");
11158        query = query.arg("prompt", prompt.into());
11159        Llm {
11160            proc: self.proc.clone(),
11161            selection: query,
11162            graphql_client: self.graphql_client.clone(),
11163        }
11164    }
11165    /// Disable the default system prompt
11166    pub fn without_default_system_prompt(&self) -> Llm {
11167        let query = self.selection.select("withoutDefaultSystemPrompt");
11168        Llm {
11169            proc: self.proc.clone(),
11170            selection: query,
11171            graphql_client: self.graphql_client.clone(),
11172        }
11173    }
11174    /// Clear the message history, leaving only the system prompts
11175    pub fn without_message_history(&self) -> Llm {
11176        let query = self.selection.select("withoutMessageHistory");
11177        Llm {
11178            proc: self.proc.clone(),
11179            selection: query,
11180            graphql_client: self.graphql_client.clone(),
11181        }
11182    }
11183    /// Clear the system prompts, leaving only the default system prompt
11184    pub fn without_system_prompts(&self) -> Llm {
11185        let query = self.selection.select("withoutSystemPrompts");
11186        Llm {
11187            proc: self.proc.clone(),
11188            selection: query,
11189            graphql_client: self.graphql_client.clone(),
11190        }
11191    }
11192}
11193impl Node for Llm {
11194    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11195        let query = self.selection.select("id");
11196        let graphql_client = self.graphql_client.clone();
11197        async move { query.execute(graphql_client).await }
11198    }
11199}
11200impl Syncer for Llm {
11201    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11202        let query = self.selection.select("id");
11203        let graphql_client = self.graphql_client.clone();
11204        async move { query.execute(graphql_client).await }
11205    }
11206    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11207        let query = self.selection.select("sync");
11208        let graphql_client = self.graphql_client.clone();
11209        async move { query.execute(graphql_client).await }
11210    }
11211}
11212#[derive(Clone)]
11213pub struct LlmTokenUsage {
11214    pub proc: Option<Arc<DaggerSessionProc>>,
11215    pub selection: Selection,
11216    pub graphql_client: DynGraphQLClient,
11217}
11218impl IntoID<Id> for LlmTokenUsage {
11219    fn into_id(
11220        self,
11221    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11222        Box::pin(async move { self.id().await })
11223    }
11224}
11225impl Loadable for LlmTokenUsage {
11226    fn graphql_type() -> &'static str {
11227        "LLMTokenUsage"
11228    }
11229    fn from_query(
11230        proc: Option<Arc<DaggerSessionProc>>,
11231        selection: Selection,
11232        graphql_client: DynGraphQLClient,
11233    ) -> Self {
11234        Self {
11235            proc,
11236            selection,
11237            graphql_client,
11238        }
11239    }
11240}
11241impl LlmTokenUsage {
11242    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
11243        let query = self.selection.select("cachedTokenReads");
11244        query.execute(self.graphql_client.clone()).await
11245    }
11246    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
11247        let query = self.selection.select("cachedTokenWrites");
11248        query.execute(self.graphql_client.clone()).await
11249    }
11250    /// A unique identifier for this LLMTokenUsage.
11251    pub async fn id(&self) -> Result<Id, DaggerError> {
11252        let query = self.selection.select("id");
11253        query.execute(self.graphql_client.clone()).await
11254    }
11255    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
11256        let query = self.selection.select("inputTokens");
11257        query.execute(self.graphql_client.clone()).await
11258    }
11259    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
11260        let query = self.selection.select("outputTokens");
11261        query.execute(self.graphql_client.clone()).await
11262    }
11263    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
11264        let query = self.selection.select("totalTokens");
11265        query.execute(self.graphql_client.clone()).await
11266    }
11267}
11268impl Node for LlmTokenUsage {
11269    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11270        let query = self.selection.select("id");
11271        let graphql_client = self.graphql_client.clone();
11272        async move { query.execute(graphql_client).await }
11273    }
11274}
11275#[derive(Clone)]
11276pub struct Label {
11277    pub proc: Option<Arc<DaggerSessionProc>>,
11278    pub selection: Selection,
11279    pub graphql_client: DynGraphQLClient,
11280}
11281impl IntoID<Id> for Label {
11282    fn into_id(
11283        self,
11284    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11285        Box::pin(async move { self.id().await })
11286    }
11287}
11288impl Loadable for Label {
11289    fn graphql_type() -> &'static str {
11290        "Label"
11291    }
11292    fn from_query(
11293        proc: Option<Arc<DaggerSessionProc>>,
11294        selection: Selection,
11295        graphql_client: DynGraphQLClient,
11296    ) -> Self {
11297        Self {
11298            proc,
11299            selection,
11300            graphql_client,
11301        }
11302    }
11303}
11304impl Label {
11305    /// A unique identifier for this Label.
11306    pub async fn id(&self) -> Result<Id, DaggerError> {
11307        let query = self.selection.select("id");
11308        query.execute(self.graphql_client.clone()).await
11309    }
11310    /// The label name.
11311    pub async fn name(&self) -> Result<String, DaggerError> {
11312        let query = self.selection.select("name");
11313        query.execute(self.graphql_client.clone()).await
11314    }
11315    /// The label value.
11316    pub async fn value(&self) -> Result<String, DaggerError> {
11317        let query = self.selection.select("value");
11318        query.execute(self.graphql_client.clone()).await
11319    }
11320}
11321impl Node for Label {
11322    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11323        let query = self.selection.select("id");
11324        let graphql_client = self.graphql_client.clone();
11325        async move { query.execute(graphql_client).await }
11326    }
11327}
11328#[derive(Clone)]
11329pub struct ListTypeDef {
11330    pub proc: Option<Arc<DaggerSessionProc>>,
11331    pub selection: Selection,
11332    pub graphql_client: DynGraphQLClient,
11333}
11334impl IntoID<Id> for ListTypeDef {
11335    fn into_id(
11336        self,
11337    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11338        Box::pin(async move { self.id().await })
11339    }
11340}
11341impl Loadable for ListTypeDef {
11342    fn graphql_type() -> &'static str {
11343        "ListTypeDef"
11344    }
11345    fn from_query(
11346        proc: Option<Arc<DaggerSessionProc>>,
11347        selection: Selection,
11348        graphql_client: DynGraphQLClient,
11349    ) -> Self {
11350        Self {
11351            proc,
11352            selection,
11353            graphql_client,
11354        }
11355    }
11356}
11357impl ListTypeDef {
11358    /// The type of the elements in the list.
11359    pub fn element_type_def(&self) -> TypeDef {
11360        let query = self.selection.select("elementTypeDef");
11361        TypeDef {
11362            proc: self.proc.clone(),
11363            selection: query,
11364            graphql_client: self.graphql_client.clone(),
11365        }
11366    }
11367    /// A unique identifier for this ListTypeDef.
11368    pub async fn id(&self) -> Result<Id, DaggerError> {
11369        let query = self.selection.select("id");
11370        query.execute(self.graphql_client.clone()).await
11371    }
11372}
11373impl Node for ListTypeDef {
11374    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11375        let query = self.selection.select("id");
11376        let graphql_client = self.graphql_client.clone();
11377        async move { query.execute(graphql_client).await }
11378    }
11379}
11380#[derive(Clone)]
11381pub struct Module {
11382    pub proc: Option<Arc<DaggerSessionProc>>,
11383    pub selection: Selection,
11384    pub graphql_client: DynGraphQLClient,
11385}
11386#[derive(Builder, Debug, PartialEq)]
11387pub struct ModuleChecksOpts<'a> {
11388    /// Only include checks matching the specified patterns
11389    #[builder(setter(into, strip_option), default)]
11390    pub include: Option<Vec<&'a str>>,
11391    /// When true, only return annotated check functions; exclude generate-as-checks
11392    #[builder(setter(into, strip_option), default)]
11393    pub no_generate: Option<bool>,
11394}
11395#[derive(Builder, Debug, PartialEq)]
11396pub struct ModuleGeneratorsOpts<'a> {
11397    /// Only include generators matching the specified patterns
11398    #[builder(setter(into, strip_option), default)]
11399    pub include: Option<Vec<&'a str>>,
11400}
11401#[derive(Builder, Debug, PartialEq)]
11402pub struct ModuleServeOpts {
11403    /// Install the module as the entrypoint, promoting its main-object methods onto the Query root
11404    #[builder(setter(into, strip_option), default)]
11405    pub entrypoint: Option<bool>,
11406    /// Expose the dependencies of this module to the client
11407    #[builder(setter(into, strip_option), default)]
11408    pub include_dependencies: Option<bool>,
11409}
11410#[derive(Builder, Debug, PartialEq)]
11411pub struct ModuleServicesOpts<'a> {
11412    /// Only include services matching the specified patterns
11413    #[builder(setter(into, strip_option), default)]
11414    pub include: Option<Vec<&'a str>>,
11415}
11416impl IntoID<Id> for Module {
11417    fn into_id(
11418        self,
11419    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11420        Box::pin(async move { self.id().await })
11421    }
11422}
11423impl Loadable for Module {
11424    fn graphql_type() -> &'static str {
11425        "Module"
11426    }
11427    fn from_query(
11428        proc: Option<Arc<DaggerSessionProc>>,
11429        selection: Selection,
11430        graphql_client: DynGraphQLClient,
11431    ) -> Self {
11432        Self {
11433            proc,
11434            selection,
11435            graphql_client,
11436        }
11437    }
11438}
11439impl Module {
11440    /// Return the check defined by the module with the given name. Must match to exactly one check.
11441    ///
11442    /// # Arguments
11443    ///
11444    /// * `name` - The name of the check to retrieve
11445    pub fn check(&self, name: impl Into<String>) -> Check {
11446        let mut query = self.selection.select("check");
11447        query = query.arg("name", name.into());
11448        Check {
11449            proc: self.proc.clone(),
11450            selection: query,
11451            graphql_client: self.graphql_client.clone(),
11452        }
11453    }
11454    /// Return all checks defined by the module
11455    ///
11456    /// # Arguments
11457    ///
11458    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11459    pub fn checks(&self) -> CheckGroup {
11460        let query = self.selection.select("checks");
11461        CheckGroup {
11462            proc: self.proc.clone(),
11463            selection: query,
11464            graphql_client: self.graphql_client.clone(),
11465        }
11466    }
11467    /// Return all checks defined by the module
11468    ///
11469    /// # Arguments
11470    ///
11471    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11472    pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
11473        let mut query = self.selection.select("checks");
11474        if let Some(include) = opts.include {
11475            query = query.arg("include", include);
11476        }
11477        if let Some(no_generate) = opts.no_generate {
11478            query = query.arg("noGenerate", no_generate);
11479        }
11480        CheckGroup {
11481            proc: self.proc.clone(),
11482            selection: query,
11483            graphql_client: self.graphql_client.clone(),
11484        }
11485    }
11486    /// The dependencies of the module.
11487    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
11488        let query = self.selection.select("dependencies");
11489        let query = query.select("id");
11490        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11491        Ok(ids
11492            .into_iter()
11493            .map(|id| Module {
11494                proc: self.proc.clone(),
11495                selection: crate::querybuilder::query()
11496                    .select("node")
11497                    .arg("id", &id.0)
11498                    .inline_fragment("Module"),
11499                graphql_client: self.graphql_client.clone(),
11500            })
11501            .collect())
11502    }
11503    /// The doc string of the module, if any
11504    pub async fn description(&self) -> Result<String, DaggerError> {
11505        let query = self.selection.select("description");
11506        query.execute(self.graphql_client.clone()).await
11507    }
11508    /// Enumerations served by this module.
11509    pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
11510        let query = self.selection.select("enums");
11511        let query = query.select("id");
11512        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11513        Ok(ids
11514            .into_iter()
11515            .map(|id| TypeDef {
11516                proc: self.proc.clone(),
11517                selection: crate::querybuilder::query()
11518                    .select("node")
11519                    .arg("id", &id.0)
11520                    .inline_fragment("TypeDef"),
11521                graphql_client: self.graphql_client.clone(),
11522            })
11523            .collect())
11524    }
11525    /// The generated files and directories made on top of the module source's context directory.
11526    pub fn generated_context_directory(&self) -> Directory {
11527        let query = self.selection.select("generatedContextDirectory");
11528        Directory {
11529            proc: self.proc.clone(),
11530            selection: query,
11531            graphql_client: self.graphql_client.clone(),
11532        }
11533    }
11534    /// Return the generator defined by the module with the given name. Must match to exactly one generator.
11535    ///
11536    /// # Arguments
11537    ///
11538    /// * `name` - The name of the generator to retrieve
11539    pub fn generator(&self, name: impl Into<String>) -> Generator {
11540        let mut query = self.selection.select("generator");
11541        query = query.arg("name", name.into());
11542        Generator {
11543            proc: self.proc.clone(),
11544            selection: query,
11545            graphql_client: self.graphql_client.clone(),
11546        }
11547    }
11548    /// Return all generators defined by the module
11549    ///
11550    /// # Arguments
11551    ///
11552    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11553    pub fn generators(&self) -> GeneratorGroup {
11554        let query = self.selection.select("generators");
11555        GeneratorGroup {
11556            proc: self.proc.clone(),
11557            selection: query,
11558            graphql_client: self.graphql_client.clone(),
11559        }
11560    }
11561    /// Return all generators defined by the module
11562    ///
11563    /// # Arguments
11564    ///
11565    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11566    pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
11567        let mut query = self.selection.select("generators");
11568        if let Some(include) = opts.include {
11569            query = query.arg("include", include);
11570        }
11571        GeneratorGroup {
11572            proc: self.proc.clone(),
11573            selection: query,
11574            graphql_client: self.graphql_client.clone(),
11575        }
11576    }
11577    /// A unique identifier for this Module.
11578    pub async fn id(&self) -> Result<Id, DaggerError> {
11579        let query = self.selection.select("id");
11580        query.execute(self.graphql_client.clone()).await
11581    }
11582    /// Interfaces served by this module.
11583    pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
11584        let query = self.selection.select("interfaces");
11585        let query = query.select("id");
11586        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11587        Ok(ids
11588            .into_iter()
11589            .map(|id| TypeDef {
11590                proc: self.proc.clone(),
11591                selection: crate::querybuilder::query()
11592                    .select("node")
11593                    .arg("id", &id.0)
11594                    .inline_fragment("TypeDef"),
11595                graphql_client: self.graphql_client.clone(),
11596            })
11597            .collect())
11598    }
11599    /// The introspection schema JSON file for this module.
11600    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
11601    /// Note: this is in the context of a module, so some core types may be hidden.
11602    pub fn introspection_schema_json(&self) -> File {
11603        let query = self.selection.select("introspectionSchemaJSON");
11604        File {
11605            proc: self.proc.clone(),
11606            selection: query,
11607            graphql_client: self.graphql_client.clone(),
11608        }
11609    }
11610    /// The name of the module
11611    pub async fn name(&self) -> Result<String, DaggerError> {
11612        let query = self.selection.select("name");
11613        query.execute(self.graphql_client.clone()).await
11614    }
11615    /// Objects served by this module.
11616    pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
11617        let query = self.selection.select("objects");
11618        let query = query.select("id");
11619        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11620        Ok(ids
11621            .into_iter()
11622            .map(|id| TypeDef {
11623                proc: self.proc.clone(),
11624                selection: crate::querybuilder::query()
11625                    .select("node")
11626                    .arg("id", &id.0)
11627                    .inline_fragment("TypeDef"),
11628                graphql_client: self.graphql_client.clone(),
11629            })
11630            .collect())
11631    }
11632    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
11633    pub fn runtime(&self) -> Container {
11634        let query = self.selection.select("runtime");
11635        Container {
11636            proc: self.proc.clone(),
11637            selection: query,
11638            graphql_client: self.graphql_client.clone(),
11639        }
11640    }
11641    /// The SDK config used by this module.
11642    pub fn sdk(&self) -> SdkConfig {
11643        let query = self.selection.select("sdk");
11644        SdkConfig {
11645            proc: self.proc.clone(),
11646            selection: query,
11647            graphql_client: self.graphql_client.clone(),
11648        }
11649    }
11650    /// Serve a module's API in the current session.
11651    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11652    ///
11653    /// # Arguments
11654    ///
11655    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11656    pub async fn serve(&self) -> Result<Void, DaggerError> {
11657        let query = self.selection.select("serve");
11658        query.execute(self.graphql_client.clone()).await
11659    }
11660    /// Serve a module's API in the current session.
11661    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11662    ///
11663    /// # Arguments
11664    ///
11665    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11666    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
11667        let mut query = self.selection.select("serve");
11668        if let Some(include_dependencies) = opts.include_dependencies {
11669            query = query.arg("includeDependencies", include_dependencies);
11670        }
11671        if let Some(entrypoint) = opts.entrypoint {
11672            query = query.arg("entrypoint", entrypoint);
11673        }
11674        query.execute(self.graphql_client.clone()).await
11675    }
11676    /// Return all services defined by the module
11677    ///
11678    /// # Arguments
11679    ///
11680    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11681    pub fn services(&self) -> UpGroup {
11682        let query = self.selection.select("services");
11683        UpGroup {
11684            proc: self.proc.clone(),
11685            selection: query,
11686            graphql_client: self.graphql_client.clone(),
11687        }
11688    }
11689    /// Return all services defined by the module
11690    ///
11691    /// # Arguments
11692    ///
11693    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11694    pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
11695        let mut query = self.selection.select("services");
11696        if let Some(include) = opts.include {
11697            query = query.arg("include", include);
11698        }
11699        UpGroup {
11700            proc: self.proc.clone(),
11701            selection: query,
11702            graphql_client: self.graphql_client.clone(),
11703        }
11704    }
11705    /// The source for the module.
11706    pub fn source(&self) -> ModuleSource {
11707        let query = self.selection.select("source");
11708        ModuleSource {
11709            proc: self.proc.clone(),
11710            selection: query,
11711            graphql_client: self.graphql_client.clone(),
11712        }
11713    }
11714    /// Forces evaluation of the module, including any loading into the engine and associated validation.
11715    pub async fn sync(&self) -> Result<Module, DaggerError> {
11716        let query = self.selection.select("sync");
11717        let id: Id = query.execute(self.graphql_client.clone()).await?;
11718        Ok(Module {
11719            proc: self.proc.clone(),
11720            selection: query
11721                .root()
11722                .select("node")
11723                .arg("id", &id.0)
11724                .inline_fragment("Module"),
11725            graphql_client: self.graphql_client.clone(),
11726        })
11727    }
11728    /// User-defined default values, loaded from local .env files.
11729    pub fn user_defaults(&self) -> EnvFile {
11730        let query = self.selection.select("userDefaults");
11731        EnvFile {
11732            proc: self.proc.clone(),
11733            selection: query,
11734            graphql_client: self.graphql_client.clone(),
11735        }
11736    }
11737    /// Retrieves the module with the given description
11738    ///
11739    /// # Arguments
11740    ///
11741    /// * `description` - The description to set
11742    pub fn with_description(&self, description: impl Into<String>) -> Module {
11743        let mut query = self.selection.select("withDescription");
11744        query = query.arg("description", description.into());
11745        Module {
11746            proc: self.proc.clone(),
11747            selection: query,
11748            graphql_client: self.graphql_client.clone(),
11749        }
11750    }
11751    /// This module plus the given Enum type and associated values
11752    pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
11753        let mut query = self.selection.select("withEnum");
11754        query = query.arg_lazy(
11755            "enum",
11756            Box::new(move || {
11757                let r#enum = r#enum.clone();
11758                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
11759            }),
11760        );
11761        Module {
11762            proc: self.proc.clone(),
11763            selection: query,
11764            graphql_client: self.graphql_client.clone(),
11765        }
11766    }
11767    /// This module plus the given Interface type and associated functions
11768    pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
11769        let mut query = self.selection.select("withInterface");
11770        query = query.arg_lazy(
11771            "iface",
11772            Box::new(move || {
11773                let iface = iface.clone();
11774                Box::pin(async move { iface.into_id().await.unwrap().quote() })
11775            }),
11776        );
11777        Module {
11778            proc: self.proc.clone(),
11779            selection: query,
11780            graphql_client: self.graphql_client.clone(),
11781        }
11782    }
11783    /// This module plus the given Object type and associated functions.
11784    pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
11785        let mut query = self.selection.select("withObject");
11786        query = query.arg_lazy(
11787            "object",
11788            Box::new(move || {
11789                let object = object.clone();
11790                Box::pin(async move { object.into_id().await.unwrap().quote() })
11791            }),
11792        );
11793        Module {
11794            proc: self.proc.clone(),
11795            selection: query,
11796            graphql_client: self.graphql_client.clone(),
11797        }
11798    }
11799}
11800impl Node for Module {
11801    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11802        let query = self.selection.select("id");
11803        let graphql_client = self.graphql_client.clone();
11804        async move { query.execute(graphql_client).await }
11805    }
11806}
11807impl Syncer for Module {
11808    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11809        let query = self.selection.select("id");
11810        let graphql_client = self.graphql_client.clone();
11811        async move { query.execute(graphql_client).await }
11812    }
11813    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11814        let query = self.selection.select("sync");
11815        let graphql_client = self.graphql_client.clone();
11816        async move { query.execute(graphql_client).await }
11817    }
11818}
11819#[derive(Clone)]
11820pub struct ModuleConfigClient {
11821    pub proc: Option<Arc<DaggerSessionProc>>,
11822    pub selection: Selection,
11823    pub graphql_client: DynGraphQLClient,
11824}
11825impl IntoID<Id> for ModuleConfigClient {
11826    fn into_id(
11827        self,
11828    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11829        Box::pin(async move { self.id().await })
11830    }
11831}
11832impl Loadable for ModuleConfigClient {
11833    fn graphql_type() -> &'static str {
11834        "ModuleConfigClient"
11835    }
11836    fn from_query(
11837        proc: Option<Arc<DaggerSessionProc>>,
11838        selection: Selection,
11839        graphql_client: DynGraphQLClient,
11840    ) -> Self {
11841        Self {
11842            proc,
11843            selection,
11844            graphql_client,
11845        }
11846    }
11847}
11848impl ModuleConfigClient {
11849    /// The directory the client is generated in.
11850    pub async fn directory(&self) -> Result<String, DaggerError> {
11851        let query = self.selection.select("directory");
11852        query.execute(self.graphql_client.clone()).await
11853    }
11854    /// The generator to use
11855    pub async fn generator(&self) -> Result<String, DaggerError> {
11856        let query = self.selection.select("generator");
11857        query.execute(self.graphql_client.clone()).await
11858    }
11859    /// A unique identifier for this ModuleConfigClient.
11860    pub async fn id(&self) -> Result<Id, DaggerError> {
11861        let query = self.selection.select("id");
11862        query.execute(self.graphql_client.clone()).await
11863    }
11864}
11865impl Node for ModuleConfigClient {
11866    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11867        let query = self.selection.select("id");
11868        let graphql_client = self.graphql_client.clone();
11869        async move { query.execute(graphql_client).await }
11870    }
11871}
11872#[derive(Clone)]
11873pub struct ModuleSource {
11874    pub proc: Option<Arc<DaggerSessionProc>>,
11875    pub selection: Selection,
11876    pub graphql_client: DynGraphQLClient,
11877}
11878impl IntoID<Id> for ModuleSource {
11879    fn into_id(
11880        self,
11881    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11882        Box::pin(async move { self.id().await })
11883    }
11884}
11885impl Loadable for ModuleSource {
11886    fn graphql_type() -> &'static str {
11887        "ModuleSource"
11888    }
11889    fn from_query(
11890        proc: Option<Arc<DaggerSessionProc>>,
11891        selection: Selection,
11892        graphql_client: DynGraphQLClient,
11893    ) -> Self {
11894        Self {
11895            proc,
11896            selection,
11897            graphql_client,
11898        }
11899    }
11900}
11901impl ModuleSource {
11902    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
11903    pub fn as_module(&self) -> Module {
11904        let query = self.selection.select("asModule");
11905        Module {
11906            proc: self.proc.clone(),
11907            selection: query,
11908            graphql_client: self.graphql_client.clone(),
11909        }
11910    }
11911    /// A human readable ref string representation of this module source.
11912    pub async fn as_string(&self) -> Result<String, DaggerError> {
11913        let query = self.selection.select("asString");
11914        query.execute(self.graphql_client.clone()).await
11915    }
11916    /// The blueprint referenced by the module source.
11917    pub fn blueprint(&self) -> ModuleSource {
11918        let query = self.selection.select("blueprint");
11919        ModuleSource {
11920            proc: self.proc.clone(),
11921            selection: query,
11922            graphql_client: self.graphql_client.clone(),
11923        }
11924    }
11925    /// The ref to clone the root of the git repo from. Only valid for git sources.
11926    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
11927        let query = self.selection.select("cloneRef");
11928        query.execute(self.graphql_client.clone()).await
11929    }
11930    /// The resolved commit of the git repo this source points to.
11931    pub async fn commit(&self) -> Result<String, DaggerError> {
11932        let query = self.selection.select("commit");
11933        query.execute(self.graphql_client.clone()).await
11934    }
11935    /// The clients generated for the module.
11936    pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
11937        let query = self.selection.select("configClients");
11938        let query = query.select("id");
11939        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11940        Ok(ids
11941            .into_iter()
11942            .map(|id| ModuleConfigClient {
11943                proc: self.proc.clone(),
11944                selection: crate::querybuilder::query()
11945                    .select("node")
11946                    .arg("id", &id.0)
11947                    .inline_fragment("ModuleConfigClient"),
11948                graphql_client: self.graphql_client.clone(),
11949            })
11950            .collect())
11951    }
11952    /// Whether an existing dagger.json for the module was found.
11953    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
11954        let query = self.selection.select("configExists");
11955        query.execute(self.graphql_client.clone()).await
11956    }
11957    /// The full directory loaded for the module source, including the source code as a subdirectory.
11958    pub fn context_directory(&self) -> Directory {
11959        let query = self.selection.select("contextDirectory");
11960        Directory {
11961            proc: self.proc.clone(),
11962            selection: query,
11963            graphql_client: self.graphql_client.clone(),
11964        }
11965    }
11966    /// The dependencies of the module source.
11967    pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
11968        let query = self.selection.select("dependencies");
11969        let query = query.select("id");
11970        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11971        Ok(ids
11972            .into_iter()
11973            .map(|id| ModuleSource {
11974                proc: self.proc.clone(),
11975                selection: crate::querybuilder::query()
11976                    .select("node")
11977                    .arg("id", &id.0)
11978                    .inline_fragment("ModuleSource"),
11979                graphql_client: self.graphql_client.clone(),
11980            })
11981            .collect())
11982    }
11983    /// 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.
11984    pub async fn digest(&self) -> Result<String, DaggerError> {
11985        let query = self.selection.select("digest");
11986        query.execute(self.graphql_client.clone()).await
11987    }
11988    /// The directory containing the module configuration and source code (source code may be in a subdir).
11989    ///
11990    /// # Arguments
11991    ///
11992    /// * `path` - A subpath from the source directory to select.
11993    pub fn directory(&self, path: impl Into<String>) -> Directory {
11994        let mut query = self.selection.select("directory");
11995        query = query.arg("path", path.into());
11996        Directory {
11997            proc: self.proc.clone(),
11998            selection: query,
11999            graphql_client: self.graphql_client.clone(),
12000        }
12001    }
12002    /// The engine version of the module.
12003    pub async fn engine_version(&self) -> Result<String, DaggerError> {
12004        let query = self.selection.select("engineVersion");
12005        query.execute(self.graphql_client.clone()).await
12006    }
12007    /// The generated files and directories made on top of the module source's context directory, returned as a Changeset.
12008    pub fn generated_context_changeset(&self) -> Changeset {
12009        let query = self.selection.select("generatedContextChangeset");
12010        Changeset {
12011            proc: self.proc.clone(),
12012            selection: query,
12013            graphql_client: self.graphql_client.clone(),
12014        }
12015    }
12016    /// The generated files and directories made on top of the module source's context directory.
12017    pub fn generated_context_directory(&self) -> Directory {
12018        let query = self.selection.select("generatedContextDirectory");
12019        Directory {
12020            proc: self.proc.clone(),
12021            selection: query,
12022            graphql_client: self.graphql_client.clone(),
12023        }
12024    }
12025    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
12026    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
12027        let query = self.selection.select("htmlRepoURL");
12028        query.execute(self.graphql_client.clone()).await
12029    }
12030    /// The URL to the source's git repo in a web browser. Only valid for git sources.
12031    pub async fn html_url(&self) -> Result<String, DaggerError> {
12032        let query = self.selection.select("htmlURL");
12033        query.execute(self.graphql_client.clone()).await
12034    }
12035    /// A unique identifier for this ModuleSource.
12036    pub async fn id(&self) -> Result<Id, DaggerError> {
12037        let query = self.selection.select("id");
12038        query.execute(self.graphql_client.clone()).await
12039    }
12040    /// The introspection schema JSON file for this module source.
12041    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
12042    /// Note: this is in the context of a module, so some core types may be hidden.
12043    pub fn introspection_schema_json(&self) -> File {
12044        let query = self.selection.select("introspectionSchemaJSON");
12045        File {
12046            proc: self.proc.clone(),
12047            selection: query,
12048            graphql_client: self.graphql_client.clone(),
12049        }
12050    }
12051    /// The kind of module source (currently local, git or dir).
12052    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
12053        let query = self.selection.select("kind");
12054        query.execute(self.graphql_client.clone()).await
12055    }
12056    /// 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.
12057    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
12058        let query = self.selection.select("localContextDirectoryPath");
12059        query.execute(self.graphql_client.clone()).await
12060    }
12061    /// The name of the module, including any setting via the withName API.
12062    pub async fn module_name(&self) -> Result<String, DaggerError> {
12063        let query = self.selection.select("moduleName");
12064        query.execute(self.graphql_client.clone()).await
12065    }
12066    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
12067    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
12068        let query = self.selection.select("moduleOriginalName");
12069        query.execute(self.graphql_client.clone()).await
12070    }
12071    /// The original subpath used when instantiating this module source, relative to the context directory.
12072    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
12073        let query = self.selection.select("originalSubpath");
12074        query.execute(self.graphql_client.clone()).await
12075    }
12076    /// The pinned version of this module source.
12077    pub async fn pin(&self) -> Result<String, DaggerError> {
12078        let query = self.selection.select("pin");
12079        query.execute(self.graphql_client.clone()).await
12080    }
12081    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
12082    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
12083        let query = self.selection.select("repoRootPath");
12084        query.execute(self.graphql_client.clone()).await
12085    }
12086    /// The SDK configuration of the module.
12087    pub fn sdk(&self) -> SdkConfig {
12088        let query = self.selection.select("sdk");
12089        SdkConfig {
12090            proc: self.proc.clone(),
12091            selection: query,
12092            graphql_client: self.graphql_client.clone(),
12093        }
12094    }
12095    /// The path, relative to the context directory, that contains the module's dagger.json.
12096    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
12097        let query = self.selection.select("sourceRootSubpath");
12098        query.execute(self.graphql_client.clone()).await
12099    }
12100    /// The path to the directory containing the module's source code, relative to the context directory.
12101    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
12102        let query = self.selection.select("sourceSubpath");
12103        query.execute(self.graphql_client.clone()).await
12104    }
12105    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
12106    pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
12107        let query = self.selection.select("sync");
12108        let id: Id = query.execute(self.graphql_client.clone()).await?;
12109        Ok(ModuleSource {
12110            proc: self.proc.clone(),
12111            selection: query
12112                .root()
12113                .select("node")
12114                .arg("id", &id.0)
12115                .inline_fragment("ModuleSource"),
12116            graphql_client: self.graphql_client.clone(),
12117        })
12118    }
12119    /// The toolchains referenced by the module source.
12120    pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12121        let query = self.selection.select("toolchains");
12122        let query = query.select("id");
12123        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12124        Ok(ids
12125            .into_iter()
12126            .map(|id| ModuleSource {
12127                proc: self.proc.clone(),
12128                selection: crate::querybuilder::query()
12129                    .select("node")
12130                    .arg("id", &id.0)
12131                    .inline_fragment("ModuleSource"),
12132                graphql_client: self.graphql_client.clone(),
12133            })
12134            .collect())
12135    }
12136    /// User-defined defaults read from local .env files
12137    pub fn user_defaults(&self) -> EnvFile {
12138        let query = self.selection.select("userDefaults");
12139        EnvFile {
12140            proc: self.proc.clone(),
12141            selection: query,
12142            graphql_client: self.graphql_client.clone(),
12143        }
12144    }
12145    /// The specified version of the git repo this source points to.
12146    pub async fn version(&self) -> Result<String, DaggerError> {
12147        let query = self.selection.select("version");
12148        query.execute(self.graphql_client.clone()).await
12149    }
12150    /// Set a blueprint for the module source.
12151    ///
12152    /// # Arguments
12153    ///
12154    /// * `blueprint` - The blueprint module to set.
12155    pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
12156        let mut query = self.selection.select("withBlueprint");
12157        query = query.arg_lazy(
12158            "blueprint",
12159            Box::new(move || {
12160                let blueprint = blueprint.clone();
12161                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
12162            }),
12163        );
12164        ModuleSource {
12165            proc: self.proc.clone(),
12166            selection: query,
12167            graphql_client: self.graphql_client.clone(),
12168        }
12169    }
12170    /// Update the module source with a new client to generate.
12171    ///
12172    /// # Arguments
12173    ///
12174    /// * `generator` - The generator to use
12175    /// * `output_dir` - The output directory for the generated client.
12176    pub fn with_client(
12177        &self,
12178        generator: impl Into<String>,
12179        output_dir: impl Into<String>,
12180    ) -> ModuleSource {
12181        let mut query = self.selection.select("withClient");
12182        query = query.arg("generator", generator.into());
12183        query = query.arg("outputDir", output_dir.into());
12184        ModuleSource {
12185            proc: self.proc.clone(),
12186            selection: query,
12187            graphql_client: self.graphql_client.clone(),
12188        }
12189    }
12190    /// Append the provided dependencies to the module source's dependency list.
12191    ///
12192    /// # Arguments
12193    ///
12194    /// * `dependencies` - The dependencies to append.
12195    pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
12196        let mut query = self.selection.select("withDependencies");
12197        query = query.arg("dependencies", dependencies);
12198        ModuleSource {
12199            proc: self.proc.clone(),
12200            selection: query,
12201            graphql_client: self.graphql_client.clone(),
12202        }
12203    }
12204    /// Upgrade the engine version of the module to the given value.
12205    ///
12206    /// # Arguments
12207    ///
12208    /// * `version` - The engine version to upgrade to.
12209    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
12210        let mut query = self.selection.select("withEngineVersion");
12211        query = query.arg("version", version.into());
12212        ModuleSource {
12213            proc: self.proc.clone(),
12214            selection: query,
12215            graphql_client: self.graphql_client.clone(),
12216        }
12217    }
12218    /// Enable the experimental features for the module source.
12219    ///
12220    /// # Arguments
12221    ///
12222    /// * `features` - The experimental features to enable.
12223    pub fn with_experimental_features(
12224        &self,
12225        features: Vec<ModuleSourceExperimentalFeature>,
12226    ) -> ModuleSource {
12227        let mut query = self.selection.select("withExperimentalFeatures");
12228        query = query.arg("features", features);
12229        ModuleSource {
12230            proc: self.proc.clone(),
12231            selection: query,
12232            graphql_client: self.graphql_client.clone(),
12233        }
12234    }
12235    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
12236    ///
12237    /// # Arguments
12238    ///
12239    /// * `patterns` - The new additional include patterns.
12240    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
12241        let mut query = self.selection.select("withIncludes");
12242        query = query.arg(
12243            "patterns",
12244            patterns
12245                .into_iter()
12246                .map(|i| i.into())
12247                .collect::<Vec<String>>(),
12248        );
12249        ModuleSource {
12250            proc: self.proc.clone(),
12251            selection: query,
12252            graphql_client: self.graphql_client.clone(),
12253        }
12254    }
12255    /// Update the module source with a new name.
12256    ///
12257    /// # Arguments
12258    ///
12259    /// * `name` - The name to set.
12260    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
12261        let mut query = self.selection.select("withName");
12262        query = query.arg("name", name.into());
12263        ModuleSource {
12264            proc: self.proc.clone(),
12265            selection: query,
12266            graphql_client: self.graphql_client.clone(),
12267        }
12268    }
12269    /// Update the module source with a new SDK.
12270    ///
12271    /// # Arguments
12272    ///
12273    /// * `source` - The SDK source to set.
12274    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
12275        let mut query = self.selection.select("withSDK");
12276        query = query.arg("source", source.into());
12277        ModuleSource {
12278            proc: self.proc.clone(),
12279            selection: query,
12280            graphql_client: self.graphql_client.clone(),
12281        }
12282    }
12283    /// Update the module source with a new source subpath.
12284    ///
12285    /// # Arguments
12286    ///
12287    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
12288    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
12289        let mut query = self.selection.select("withSourceSubpath");
12290        query = query.arg("path", path.into());
12291        ModuleSource {
12292            proc: self.proc.clone(),
12293            selection: query,
12294            graphql_client: self.graphql_client.clone(),
12295        }
12296    }
12297    /// Add toolchains to the module source.
12298    ///
12299    /// # Arguments
12300    ///
12301    /// * `toolchains` - The toolchain modules to add.
12302    pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
12303        let mut query = self.selection.select("withToolchains");
12304        query = query.arg("toolchains", toolchains);
12305        ModuleSource {
12306            proc: self.proc.clone(),
12307            selection: query,
12308            graphql_client: self.graphql_client.clone(),
12309        }
12310    }
12311    /// Update the blueprint module to the latest version.
12312    pub fn with_update_blueprint(&self) -> ModuleSource {
12313        let query = self.selection.select("withUpdateBlueprint");
12314        ModuleSource {
12315            proc: self.proc.clone(),
12316            selection: query,
12317            graphql_client: self.graphql_client.clone(),
12318        }
12319    }
12320    /// Update one or more module dependencies.
12321    ///
12322    /// # Arguments
12323    ///
12324    /// * `dependencies` - The dependencies to update.
12325    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12326        let mut query = self.selection.select("withUpdateDependencies");
12327        query = query.arg(
12328            "dependencies",
12329            dependencies
12330                .into_iter()
12331                .map(|i| i.into())
12332                .collect::<Vec<String>>(),
12333        );
12334        ModuleSource {
12335            proc: self.proc.clone(),
12336            selection: query,
12337            graphql_client: self.graphql_client.clone(),
12338        }
12339    }
12340    /// Update one or more toolchains.
12341    ///
12342    /// # Arguments
12343    ///
12344    /// * `toolchains` - The toolchains to update.
12345    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12346        let mut query = self.selection.select("withUpdateToolchains");
12347        query = query.arg(
12348            "toolchains",
12349            toolchains
12350                .into_iter()
12351                .map(|i| i.into())
12352                .collect::<Vec<String>>(),
12353        );
12354        ModuleSource {
12355            proc: self.proc.clone(),
12356            selection: query,
12357            graphql_client: self.graphql_client.clone(),
12358        }
12359    }
12360    /// Update one or more clients.
12361    ///
12362    /// # Arguments
12363    ///
12364    /// * `clients` - The clients to update
12365    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
12366        let mut query = self.selection.select("withUpdatedClients");
12367        query = query.arg(
12368            "clients",
12369            clients
12370                .into_iter()
12371                .map(|i| i.into())
12372                .collect::<Vec<String>>(),
12373        );
12374        ModuleSource {
12375            proc: self.proc.clone(),
12376            selection: query,
12377            graphql_client: self.graphql_client.clone(),
12378        }
12379    }
12380    /// Remove the current blueprint from the module source.
12381    pub fn without_blueprint(&self) -> ModuleSource {
12382        let query = self.selection.select("withoutBlueprint");
12383        ModuleSource {
12384            proc: self.proc.clone(),
12385            selection: query,
12386            graphql_client: self.graphql_client.clone(),
12387        }
12388    }
12389    /// Remove a client from the module source.
12390    ///
12391    /// # Arguments
12392    ///
12393    /// * `path` - The path of the client to remove.
12394    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
12395        let mut query = self.selection.select("withoutClient");
12396        query = query.arg("path", path.into());
12397        ModuleSource {
12398            proc: self.proc.clone(),
12399            selection: query,
12400            graphql_client: self.graphql_client.clone(),
12401        }
12402    }
12403    /// Remove the provided dependencies from the module source's dependency list.
12404    ///
12405    /// # Arguments
12406    ///
12407    /// * `dependencies` - The dependencies to remove.
12408    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12409        let mut query = self.selection.select("withoutDependencies");
12410        query = query.arg(
12411            "dependencies",
12412            dependencies
12413                .into_iter()
12414                .map(|i| i.into())
12415                .collect::<Vec<String>>(),
12416        );
12417        ModuleSource {
12418            proc: self.proc.clone(),
12419            selection: query,
12420            graphql_client: self.graphql_client.clone(),
12421        }
12422    }
12423    /// Disable experimental features for the module source.
12424    ///
12425    /// # Arguments
12426    ///
12427    /// * `features` - The experimental features to disable.
12428    pub fn without_experimental_features(
12429        &self,
12430        features: Vec<ModuleSourceExperimentalFeature>,
12431    ) -> ModuleSource {
12432        let mut query = self.selection.select("withoutExperimentalFeatures");
12433        query = query.arg("features", features);
12434        ModuleSource {
12435            proc: self.proc.clone(),
12436            selection: query,
12437            graphql_client: self.graphql_client.clone(),
12438        }
12439    }
12440    /// Remove the provided toolchains from the module source.
12441    ///
12442    /// # Arguments
12443    ///
12444    /// * `toolchains` - The toolchains to remove.
12445    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12446        let mut query = self.selection.select("withoutToolchains");
12447        query = query.arg(
12448            "toolchains",
12449            toolchains
12450                .into_iter()
12451                .map(|i| i.into())
12452                .collect::<Vec<String>>(),
12453        );
12454        ModuleSource {
12455            proc: self.proc.clone(),
12456            selection: query,
12457            graphql_client: self.graphql_client.clone(),
12458        }
12459    }
12460}
12461impl Node for ModuleSource {
12462    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12463        let query = self.selection.select("id");
12464        let graphql_client = self.graphql_client.clone();
12465        async move { query.execute(graphql_client).await }
12466    }
12467}
12468impl Syncer for ModuleSource {
12469    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12470        let query = self.selection.select("id");
12471        let graphql_client = self.graphql_client.clone();
12472        async move { query.execute(graphql_client).await }
12473    }
12474    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12475        let query = self.selection.select("sync");
12476        let graphql_client = self.graphql_client.clone();
12477        async move { query.execute(graphql_client).await }
12478    }
12479}
12480#[derive(Clone)]
12481pub struct ObjectTypeDef {
12482    pub proc: Option<Arc<DaggerSessionProc>>,
12483    pub selection: Selection,
12484    pub graphql_client: DynGraphQLClient,
12485}
12486impl IntoID<Id> for ObjectTypeDef {
12487    fn into_id(
12488        self,
12489    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12490        Box::pin(async move { self.id().await })
12491    }
12492}
12493impl Loadable for ObjectTypeDef {
12494    fn graphql_type() -> &'static str {
12495        "ObjectTypeDef"
12496    }
12497    fn from_query(
12498        proc: Option<Arc<DaggerSessionProc>>,
12499        selection: Selection,
12500        graphql_client: DynGraphQLClient,
12501    ) -> Self {
12502        Self {
12503            proc,
12504            selection,
12505            graphql_client,
12506        }
12507    }
12508}
12509impl ObjectTypeDef {
12510    /// The function used to construct new instances of this object, if any.
12511    pub fn constructor(&self) -> Function {
12512        let query = self.selection.select("constructor");
12513        Function {
12514            proc: self.proc.clone(),
12515            selection: query,
12516            graphql_client: self.graphql_client.clone(),
12517        }
12518    }
12519    /// The reason this enum member is deprecated, if any.
12520    pub async fn deprecated(&self) -> Result<String, DaggerError> {
12521        let query = self.selection.select("deprecated");
12522        query.execute(self.graphql_client.clone()).await
12523    }
12524    /// The doc string for the object, if any.
12525    pub async fn description(&self) -> Result<String, DaggerError> {
12526        let query = self.selection.select("description");
12527        query.execute(self.graphql_client.clone()).await
12528    }
12529    /// Static fields defined on this object, if any.
12530    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12531        let query = self.selection.select("fields");
12532        let query = query.select("id");
12533        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12534        Ok(ids
12535            .into_iter()
12536            .map(|id| FieldTypeDef {
12537                proc: self.proc.clone(),
12538                selection: crate::querybuilder::query()
12539                    .select("node")
12540                    .arg("id", &id.0)
12541                    .inline_fragment("FieldTypeDef"),
12542                graphql_client: self.graphql_client.clone(),
12543            })
12544            .collect())
12545    }
12546    /// Functions defined on this object, if any.
12547    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12548        let query = self.selection.select("functions");
12549        let query = query.select("id");
12550        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12551        Ok(ids
12552            .into_iter()
12553            .map(|id| Function {
12554                proc: self.proc.clone(),
12555                selection: crate::querybuilder::query()
12556                    .select("node")
12557                    .arg("id", &id.0)
12558                    .inline_fragment("Function"),
12559                graphql_client: self.graphql_client.clone(),
12560            })
12561            .collect())
12562    }
12563    /// A unique identifier for this ObjectTypeDef.
12564    pub async fn id(&self) -> Result<Id, DaggerError> {
12565        let query = self.selection.select("id");
12566        query.execute(self.graphql_client.clone()).await
12567    }
12568    /// The name of the object.
12569    pub async fn name(&self) -> Result<String, DaggerError> {
12570        let query = self.selection.select("name");
12571        query.execute(self.graphql_client.clone()).await
12572    }
12573    /// The location of this object declaration.
12574    pub fn source_map(&self) -> SourceMap {
12575        let query = self.selection.select("sourceMap");
12576        SourceMap {
12577            proc: self.proc.clone(),
12578            selection: query,
12579            graphql_client: self.graphql_client.clone(),
12580        }
12581    }
12582    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
12583    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12584        let query = self.selection.select("sourceModuleName");
12585        query.execute(self.graphql_client.clone()).await
12586    }
12587}
12588impl Node for ObjectTypeDef {
12589    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12590        let query = self.selection.select("id");
12591        let graphql_client = self.graphql_client.clone();
12592        async move { query.execute(graphql_client).await }
12593    }
12594}
12595#[derive(Clone)]
12596pub struct Port {
12597    pub proc: Option<Arc<DaggerSessionProc>>,
12598    pub selection: Selection,
12599    pub graphql_client: DynGraphQLClient,
12600}
12601impl IntoID<Id> for Port {
12602    fn into_id(
12603        self,
12604    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12605        Box::pin(async move { self.id().await })
12606    }
12607}
12608impl Loadable for Port {
12609    fn graphql_type() -> &'static str {
12610        "Port"
12611    }
12612    fn from_query(
12613        proc: Option<Arc<DaggerSessionProc>>,
12614        selection: Selection,
12615        graphql_client: DynGraphQLClient,
12616    ) -> Self {
12617        Self {
12618            proc,
12619            selection,
12620            graphql_client,
12621        }
12622    }
12623}
12624impl Port {
12625    /// The port description.
12626    pub async fn description(&self) -> Result<String, DaggerError> {
12627        let query = self.selection.select("description");
12628        query.execute(self.graphql_client.clone()).await
12629    }
12630    /// Skip the health check when run as a service.
12631    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
12632        let query = self.selection.select("experimentalSkipHealthcheck");
12633        query.execute(self.graphql_client.clone()).await
12634    }
12635    /// A unique identifier for this Port.
12636    pub async fn id(&self) -> Result<Id, DaggerError> {
12637        let query = self.selection.select("id");
12638        query.execute(self.graphql_client.clone()).await
12639    }
12640    /// The port number.
12641    pub async fn port(&self) -> Result<isize, DaggerError> {
12642        let query = self.selection.select("port");
12643        query.execute(self.graphql_client.clone()).await
12644    }
12645    /// The transport layer protocol.
12646    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
12647        let query = self.selection.select("protocol");
12648        query.execute(self.graphql_client.clone()).await
12649    }
12650}
12651impl Node for Port {
12652    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12653        let query = self.selection.select("id");
12654        let graphql_client = self.graphql_client.clone();
12655        async move { query.execute(graphql_client).await }
12656    }
12657}
12658#[derive(Clone)]
12659pub struct Query {
12660    pub proc: Option<Arc<DaggerSessionProc>>,
12661    pub selection: Selection,
12662    pub graphql_client: DynGraphQLClient,
12663}
12664#[derive(Builder, Debug, PartialEq)]
12665pub struct QueryCacheVolumeOpts<'a> {
12666    /// A user:group to set for the cache volume root.
12667    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
12668    /// If the group is omitted, it defaults to the same as the user.
12669    #[builder(setter(into, strip_option), default)]
12670    pub owner: Option<&'a str>,
12671    /// Sharing mode of the cache volume.
12672    #[builder(setter(into, strip_option), default)]
12673    pub sharing: Option<CacheSharingMode>,
12674    /// Identifier of the directory to use as the cache volume's root.
12675    #[builder(setter(into, strip_option), default)]
12676    pub source: Option<Id>,
12677}
12678#[derive(Builder, Debug, PartialEq)]
12679pub struct QueryContainerOpts {
12680    /// Platform to initialize the container with. Defaults to the native platform of the current engine
12681    #[builder(setter(into, strip_option), default)]
12682    pub platform: Option<Platform>,
12683}
12684#[derive(Builder, Debug, PartialEq)]
12685pub struct QueryCurrentTypeDefsOpts {
12686    /// Strip core API functions from the Query type, leaving only module-sourced functions (constructors, entrypoint proxies, etc.).
12687    /// Core types (Container, Directory, etc.) are kept so return types and method chaining still work.
12688    #[builder(setter(into, strip_option), default)]
12689    pub hide_core: Option<bool>,
12690    /// Return the full referenced typedef closure instead of only top-level served typedefs.
12691    #[builder(setter(into, strip_option), default)]
12692    pub return_all_types: Option<bool>,
12693}
12694#[derive(Builder, Debug, PartialEq)]
12695pub struct QueryEnvOpts {
12696    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
12697    #[builder(setter(into, strip_option), default)]
12698    pub privileged: Option<bool>,
12699    /// Allow new outputs to be declared and saved in the environment
12700    #[builder(setter(into, strip_option), default)]
12701    pub writable: Option<bool>,
12702}
12703#[derive(Builder, Debug, PartialEq)]
12704pub struct QueryEnvFileOpts {
12705    /// Replace "${VAR}" or "$VAR" with the value of other vars
12706    #[builder(setter(into, strip_option), default)]
12707    pub expand: Option<bool>,
12708}
12709#[derive(Builder, Debug, PartialEq)]
12710pub struct QueryFileOpts {
12711    /// Permissions of the new file. Example: 0600
12712    #[builder(setter(into, strip_option), default)]
12713    pub permissions: Option<isize>,
12714}
12715#[derive(Builder, Debug, PartialEq)]
12716pub struct QueryGitOpts<'a> {
12717    /// A service which must be started before the repo is fetched.
12718    #[builder(setter(into, strip_option), default)]
12719    pub experimental_service_host: Option<Id>,
12720    /// Secret used to populate the Authorization HTTP header
12721    #[builder(setter(into, strip_option), default)]
12722    pub http_auth_header: Option<Id>,
12723    /// Secret used to populate the password during basic HTTP Authorization
12724    #[builder(setter(into, strip_option), default)]
12725    pub http_auth_token: Option<Id>,
12726    /// Username used to populate the password during basic HTTP Authorization
12727    #[builder(setter(into, strip_option), default)]
12728    pub http_auth_username: Option<&'a str>,
12729    /// DEPRECATED: Set to true to keep .git directory.
12730    #[builder(setter(into, strip_option), default)]
12731    pub keep_git_dir: Option<bool>,
12732    /// Set SSH auth socket
12733    #[builder(setter(into, strip_option), default)]
12734    pub ssh_auth_socket: Option<Id>,
12735    /// Set SSH known hosts
12736    #[builder(setter(into, strip_option), default)]
12737    pub ssh_known_hosts: Option<&'a str>,
12738}
12739#[derive(Builder, Debug, PartialEq)]
12740pub struct QueryHttpOpts<'a> {
12741    /// Secret used to populate the Authorization HTTP header
12742    #[builder(setter(into, strip_option), default)]
12743    pub auth_header: Option<Id>,
12744    /// Expected digest of the downloaded content (e.g., "sha256:...").
12745    #[builder(setter(into, strip_option), default)]
12746    pub checksum: Option<&'a str>,
12747    /// A service which must be started before the URL is fetched.
12748    #[builder(setter(into, strip_option), default)]
12749    pub experimental_service_host: Option<Id>,
12750    /// File name to use for the file. Defaults to the last part of the URL.
12751    #[builder(setter(into, strip_option), default)]
12752    pub name: Option<&'a str>,
12753    /// Permissions to set on the file.
12754    #[builder(setter(into, strip_option), default)]
12755    pub permissions: Option<isize>,
12756}
12757#[derive(Builder, Debug, PartialEq)]
12758pub struct QueryLlmOpts<'a> {
12759    /// Cap the number of API calls for this LLM
12760    #[builder(setter(into, strip_option), default)]
12761    pub max_api_calls: Option<isize>,
12762    /// Model to use
12763    #[builder(setter(into, strip_option), default)]
12764    pub model: Option<&'a str>,
12765}
12766#[derive(Builder, Debug, PartialEq)]
12767pub struct QueryModuleSourceOpts<'a> {
12768    /// 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.
12769    #[builder(setter(into, strip_option), default)]
12770    pub allow_not_exists: Option<bool>,
12771    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
12772    #[builder(setter(into, strip_option), default)]
12773    pub disable_find_up: Option<bool>,
12774    /// The pinned version of the module source
12775    #[builder(setter(into, strip_option), default)]
12776    pub ref_pin: Option<&'a str>,
12777    /// If set, error out if the ref string is not of the provided requireKind.
12778    #[builder(setter(into, strip_option), default)]
12779    pub require_kind: Option<ModuleSourceKind>,
12780}
12781#[derive(Builder, Debug, PartialEq)]
12782pub struct QuerySecretOpts<'a> {
12783    /// 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.
12784    /// 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.
12785    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
12786    #[builder(setter(into, strip_option), default)]
12787    pub cache_key: Option<&'a str>,
12788}
12789impl IntoID<Id> for Query {
12790    fn into_id(
12791        self,
12792    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12793        Box::pin(async move { self.id().await })
12794    }
12795}
12796impl Loadable for Query {
12797    fn graphql_type() -> &'static str {
12798        "Query"
12799    }
12800    fn from_query(
12801        proc: Option<Arc<DaggerSessionProc>>,
12802        selection: Selection,
12803        graphql_client: DynGraphQLClient,
12804    ) -> Self {
12805        Self {
12806            proc,
12807            selection,
12808            graphql_client,
12809        }
12810    }
12811}
12812impl Query {
12813    /// initialize an address to load directories, containers, secrets or other object types.
12814    pub fn address(&self, value: impl Into<String>) -> Address {
12815        let mut query = self.selection.select("address");
12816        query = query.arg("value", value.into());
12817        Address {
12818            proc: self.proc.clone(),
12819            selection: query,
12820            graphql_client: self.graphql_client.clone(),
12821        }
12822    }
12823    /// Constructs a cache volume for a given cache key.
12824    ///
12825    /// # Arguments
12826    ///
12827    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
12828    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12829    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
12830        let mut query = self.selection.select("cacheVolume");
12831        query = query.arg("key", key.into());
12832        CacheVolume {
12833            proc: self.proc.clone(),
12834            selection: query,
12835            graphql_client: self.graphql_client.clone(),
12836        }
12837    }
12838    /// Constructs a cache volume for a given cache key.
12839    ///
12840    /// # Arguments
12841    ///
12842    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
12843    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12844    pub fn cache_volume_opts<'a>(
12845        &self,
12846        key: impl Into<String>,
12847        opts: QueryCacheVolumeOpts<'a>,
12848    ) -> CacheVolume {
12849        let mut query = self.selection.select("cacheVolume");
12850        query = query.arg("key", key.into());
12851        if let Some(source) = opts.source {
12852            query = query.arg("source", source);
12853        }
12854        if let Some(sharing) = opts.sharing {
12855            query = query.arg("sharing", sharing);
12856        }
12857        if let Some(owner) = opts.owner {
12858            query = query.arg("owner", owner);
12859        }
12860        CacheVolume {
12861            proc: self.proc.clone(),
12862            selection: query,
12863            graphql_client: self.graphql_client.clone(),
12864        }
12865    }
12866    /// Creates an empty changeset
12867    pub fn changeset(&self) -> Changeset {
12868        let query = self.selection.select("changeset");
12869        Changeset {
12870            proc: self.proc.clone(),
12871            selection: query,
12872            graphql_client: self.graphql_client.clone(),
12873        }
12874    }
12875    /// Dagger Cloud configuration and state
12876    pub fn cloud(&self) -> Cloud {
12877        let query = self.selection.select("cloud");
12878        Cloud {
12879            proc: self.proc.clone(),
12880            selection: query,
12881            graphql_client: self.graphql_client.clone(),
12882        }
12883    }
12884    /// Creates a scratch container, with no image or metadata.
12885    /// To pull an image, follow up with the "from" function.
12886    ///
12887    /// # Arguments
12888    ///
12889    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12890    pub fn container(&self) -> Container {
12891        let query = self.selection.select("container");
12892        Container {
12893            proc: self.proc.clone(),
12894            selection: query,
12895            graphql_client: self.graphql_client.clone(),
12896        }
12897    }
12898    /// Creates a scratch container, with no image or metadata.
12899    /// To pull an image, follow up with the "from" function.
12900    ///
12901    /// # Arguments
12902    ///
12903    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12904    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
12905        let mut query = self.selection.select("container");
12906        if let Some(platform) = opts.platform {
12907            query = query.arg("platform", platform);
12908        }
12909        Container {
12910            proc: self.proc.clone(),
12911            selection: query,
12912            graphql_client: self.graphql_client.clone(),
12913        }
12914    }
12915    /// Returns the current environment
12916    /// 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.
12917    /// 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.
12918    pub fn current_env(&self) -> Env {
12919        let query = self.selection.select("currentEnv");
12920        Env {
12921            proc: self.proc.clone(),
12922            selection: query,
12923            graphql_client: self.graphql_client.clone(),
12924        }
12925    }
12926    /// The FunctionCall context that the SDK caller is currently executing in.
12927    /// If the caller is not currently executing in a function, this will return an error.
12928    pub fn current_function_call(&self) -> FunctionCall {
12929        let query = self.selection.select("currentFunctionCall");
12930        FunctionCall {
12931            proc: self.proc.clone(),
12932            selection: query,
12933            graphql_client: self.graphql_client.clone(),
12934        }
12935    }
12936    /// The module currently being served in the session, if any.
12937    pub fn current_module(&self) -> CurrentModule {
12938        let query = self.selection.select("currentModule");
12939        CurrentModule {
12940            proc: self.proc.clone(),
12941            selection: query,
12942            graphql_client: self.graphql_client.clone(),
12943        }
12944    }
12945    /// The TypeDef representations of the objects currently being served in the session.
12946    ///
12947    /// # Arguments
12948    ///
12949    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12950    pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
12951        let query = self.selection.select("currentTypeDefs");
12952        let query = query.select("id");
12953        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12954        Ok(ids
12955            .into_iter()
12956            .map(|id| TypeDef {
12957                proc: self.proc.clone(),
12958                selection: crate::querybuilder::query()
12959                    .select("node")
12960                    .arg("id", &id.0)
12961                    .inline_fragment("TypeDef"),
12962                graphql_client: self.graphql_client.clone(),
12963            })
12964            .collect())
12965    }
12966    /// The TypeDef representations of the objects currently being served in the session.
12967    ///
12968    /// # Arguments
12969    ///
12970    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12971    pub async fn current_type_defs_opts(
12972        &self,
12973        opts: QueryCurrentTypeDefsOpts,
12974    ) -> Result<Vec<TypeDef>, DaggerError> {
12975        let mut query = self.selection.select("currentTypeDefs");
12976        if let Some(return_all_types) = opts.return_all_types {
12977            query = query.arg("returnAllTypes", return_all_types);
12978        }
12979        if let Some(hide_core) = opts.hide_core {
12980            query = query.arg("hideCore", hide_core);
12981        }
12982        let query = query.select("id");
12983        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12984        Ok(ids
12985            .into_iter()
12986            .map(|id| TypeDef {
12987                proc: self.proc.clone(),
12988                selection: crate::querybuilder::query()
12989                    .select("node")
12990                    .arg("id", &id.0)
12991                    .inline_fragment("TypeDef"),
12992                graphql_client: self.graphql_client.clone(),
12993            })
12994            .collect())
12995    }
12996    /// Detect and return the current workspace.
12997    pub fn current_workspace(&self) -> Workspace {
12998        let query = self.selection.select("currentWorkspace");
12999        Workspace {
13000            proc: self.proc.clone(),
13001            selection: query,
13002            graphql_client: self.graphql_client.clone(),
13003        }
13004    }
13005    /// The default platform of the engine.
13006    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
13007        let query = self.selection.select("defaultPlatform");
13008        query.execute(self.graphql_client.clone()).await
13009    }
13010    /// Creates an empty directory.
13011    pub fn directory(&self) -> Directory {
13012        let query = self.selection.select("directory");
13013        Directory {
13014            proc: self.proc.clone(),
13015            selection: query,
13016            graphql_client: self.graphql_client.clone(),
13017        }
13018    }
13019    /// The Dagger engine container configuration and state
13020    pub fn engine(&self) -> Engine {
13021        let query = self.selection.select("engine");
13022        Engine {
13023            proc: self.proc.clone(),
13024            selection: query,
13025            graphql_client: self.graphql_client.clone(),
13026        }
13027    }
13028    /// Initializes a new environment
13029    ///
13030    /// # Arguments
13031    ///
13032    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13033    pub fn env(&self) -> Env {
13034        let query = self.selection.select("env");
13035        Env {
13036            proc: self.proc.clone(),
13037            selection: query,
13038            graphql_client: self.graphql_client.clone(),
13039        }
13040    }
13041    /// Initializes a new environment
13042    ///
13043    /// # Arguments
13044    ///
13045    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13046    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
13047        let mut query = self.selection.select("env");
13048        if let Some(privileged) = opts.privileged {
13049            query = query.arg("privileged", privileged);
13050        }
13051        if let Some(writable) = opts.writable {
13052            query = query.arg("writable", writable);
13053        }
13054        Env {
13055            proc: self.proc.clone(),
13056            selection: query,
13057            graphql_client: self.graphql_client.clone(),
13058        }
13059    }
13060    /// Initialize an environment file
13061    ///
13062    /// # Arguments
13063    ///
13064    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13065    pub fn env_file(&self) -> EnvFile {
13066        let query = self.selection.select("envFile");
13067        EnvFile {
13068            proc: self.proc.clone(),
13069            selection: query,
13070            graphql_client: self.graphql_client.clone(),
13071        }
13072    }
13073    /// Initialize an environment file
13074    ///
13075    /// # Arguments
13076    ///
13077    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13078    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
13079        let mut query = self.selection.select("envFile");
13080        if let Some(expand) = opts.expand {
13081            query = query.arg("expand", expand);
13082        }
13083        EnvFile {
13084            proc: self.proc.clone(),
13085            selection: query,
13086            graphql_client: self.graphql_client.clone(),
13087        }
13088    }
13089    /// Create a new error.
13090    ///
13091    /// # Arguments
13092    ///
13093    /// * `message` - A brief description of the error.
13094    pub fn error(&self, message: impl Into<String>) -> Error {
13095        let mut query = self.selection.select("error");
13096        query = query.arg("message", message.into());
13097        Error {
13098            proc: self.proc.clone(),
13099            selection: query,
13100            graphql_client: self.graphql_client.clone(),
13101        }
13102    }
13103    /// Creates a file with the specified contents.
13104    ///
13105    /// # Arguments
13106    ///
13107    /// * `name` - Name of the new file. Example: "foo.txt"
13108    /// * `contents` - Contents of the new file. Example: "Hello world!"
13109    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13110    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
13111        let mut query = self.selection.select("file");
13112        query = query.arg("name", name.into());
13113        query = query.arg("contents", contents.into());
13114        File {
13115            proc: self.proc.clone(),
13116            selection: query,
13117            graphql_client: self.graphql_client.clone(),
13118        }
13119    }
13120    /// Creates a file with the specified contents.
13121    ///
13122    /// # Arguments
13123    ///
13124    /// * `name` - Name of the new file. Example: "foo.txt"
13125    /// * `contents` - Contents of the new file. Example: "Hello world!"
13126    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13127    pub fn file_opts(
13128        &self,
13129        name: impl Into<String>,
13130        contents: impl Into<String>,
13131        opts: QueryFileOpts,
13132    ) -> File {
13133        let mut query = self.selection.select("file");
13134        query = query.arg("name", name.into());
13135        query = query.arg("contents", contents.into());
13136        if let Some(permissions) = opts.permissions {
13137            query = query.arg("permissions", permissions);
13138        }
13139        File {
13140            proc: self.proc.clone(),
13141            selection: query,
13142            graphql_client: self.graphql_client.clone(),
13143        }
13144    }
13145    /// Creates a function.
13146    ///
13147    /// # Arguments
13148    ///
13149    /// * `name` - Name of the function, in its original format from the implementation language.
13150    /// * `return_type` - Return type of the function.
13151    pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
13152        let mut query = self.selection.select("function");
13153        query = query.arg("name", name.into());
13154        query = query.arg_lazy(
13155            "returnType",
13156            Box::new(move || {
13157                let return_type = return_type.clone();
13158                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
13159            }),
13160        );
13161        Function {
13162            proc: self.proc.clone(),
13163            selection: query,
13164            graphql_client: self.graphql_client.clone(),
13165        }
13166    }
13167    /// Create a code generation result, given a directory containing the generated code.
13168    pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
13169        let mut query = self.selection.select("generatedCode");
13170        query = query.arg_lazy(
13171            "code",
13172            Box::new(move || {
13173                let code = code.clone();
13174                Box::pin(async move { code.into_id().await.unwrap().quote() })
13175            }),
13176        );
13177        GeneratedCode {
13178            proc: self.proc.clone(),
13179            selection: query,
13180            graphql_client: self.graphql_client.clone(),
13181        }
13182    }
13183    /// Queries a Git repository.
13184    ///
13185    /// # Arguments
13186    ///
13187    /// * `url` - URL of the git repository.
13188    ///
13189    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
13190    ///
13191    /// Suffix ".git" is optional.
13192    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13193    pub fn git(&self, url: impl Into<String>) -> GitRepository {
13194        let mut query = self.selection.select("git");
13195        query = query.arg("url", url.into());
13196        GitRepository {
13197            proc: self.proc.clone(),
13198            selection: query,
13199            graphql_client: self.graphql_client.clone(),
13200        }
13201    }
13202    /// Queries a Git repository.
13203    ///
13204    /// # Arguments
13205    ///
13206    /// * `url` - URL of the git repository.
13207    ///
13208    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
13209    ///
13210    /// Suffix ".git" is optional.
13211    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13212    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
13213        let mut query = self.selection.select("git");
13214        query = query.arg("url", url.into());
13215        if let Some(keep_git_dir) = opts.keep_git_dir {
13216            query = query.arg("keepGitDir", keep_git_dir);
13217        }
13218        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
13219            query = query.arg("sshKnownHosts", ssh_known_hosts);
13220        }
13221        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
13222            query = query.arg("sshAuthSocket", ssh_auth_socket);
13223        }
13224        if let Some(http_auth_username) = opts.http_auth_username {
13225            query = query.arg("httpAuthUsername", http_auth_username);
13226        }
13227        if let Some(http_auth_token) = opts.http_auth_token {
13228            query = query.arg("httpAuthToken", http_auth_token);
13229        }
13230        if let Some(http_auth_header) = opts.http_auth_header {
13231            query = query.arg("httpAuthHeader", http_auth_header);
13232        }
13233        if let Some(experimental_service_host) = opts.experimental_service_host {
13234            query = query.arg("experimentalServiceHost", experimental_service_host);
13235        }
13236        GitRepository {
13237            proc: self.proc.clone(),
13238            selection: query,
13239            graphql_client: self.graphql_client.clone(),
13240        }
13241    }
13242    /// Queries the host environment.
13243    pub fn host(&self) -> Host {
13244        let query = self.selection.select("host");
13245        Host {
13246            proc: self.proc.clone(),
13247            selection: query,
13248            graphql_client: self.graphql_client.clone(),
13249        }
13250    }
13251    /// Returns a file containing an http remote url content.
13252    ///
13253    /// # Arguments
13254    ///
13255    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
13256    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13257    pub fn http(&self, url: impl Into<String>) -> File {
13258        let mut query = self.selection.select("http");
13259        query = query.arg("url", url.into());
13260        File {
13261            proc: self.proc.clone(),
13262            selection: query,
13263            graphql_client: self.graphql_client.clone(),
13264        }
13265    }
13266    /// Returns a file containing an http remote url content.
13267    ///
13268    /// # Arguments
13269    ///
13270    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
13271    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13272    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
13273        let mut query = self.selection.select("http");
13274        query = query.arg("url", url.into());
13275        if let Some(name) = opts.name {
13276            query = query.arg("name", name);
13277        }
13278        if let Some(permissions) = opts.permissions {
13279            query = query.arg("permissions", permissions);
13280        }
13281        if let Some(checksum) = opts.checksum {
13282            query = query.arg("checksum", checksum);
13283        }
13284        if let Some(auth_header) = opts.auth_header {
13285            query = query.arg("authHeader", auth_header);
13286        }
13287        if let Some(experimental_service_host) = opts.experimental_service_host {
13288            query = query.arg("experimentalServiceHost", experimental_service_host);
13289        }
13290        File {
13291            proc: self.proc.clone(),
13292            selection: query,
13293            graphql_client: self.graphql_client.clone(),
13294        }
13295    }
13296    /// A unique identifier for this Query.
13297    pub async fn id(&self) -> Result<Id, DaggerError> {
13298        let query = self.selection.select("id");
13299        query.execute(self.graphql_client.clone()).await
13300    }
13301    /// Initialize a JSON value
13302    pub fn json(&self) -> JsonValue {
13303        let query = self.selection.select("json");
13304        JsonValue {
13305            proc: self.proc.clone(),
13306            selection: query,
13307            graphql_client: self.graphql_client.clone(),
13308        }
13309    }
13310    /// Initialize a Large Language Model (LLM)
13311    ///
13312    /// # Arguments
13313    ///
13314    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13315    pub fn llm(&self) -> Llm {
13316        let query = self.selection.select("llm");
13317        Llm {
13318            proc: self.proc.clone(),
13319            selection: query,
13320            graphql_client: self.graphql_client.clone(),
13321        }
13322    }
13323    /// Initialize a Large Language Model (LLM)
13324    ///
13325    /// # Arguments
13326    ///
13327    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13328    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
13329        let mut query = self.selection.select("llm");
13330        if let Some(model) = opts.model {
13331            query = query.arg("model", model);
13332        }
13333        if let Some(max_api_calls) = opts.max_api_calls {
13334            query = query.arg("maxAPICalls", max_api_calls);
13335        }
13336        Llm {
13337            proc: self.proc.clone(),
13338            selection: query,
13339            graphql_client: self.graphql_client.clone(),
13340        }
13341    }
13342    /// Load a Address from its ID.
13343    pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
13344        let mut query = self.selection.select("loadAddressFromID");
13345        query = query.arg_lazy(
13346            "id",
13347            Box::new(move || {
13348                let id = id.clone();
13349                Box::pin(async move { id.into_id().await.unwrap().quote() })
13350            }),
13351        );
13352        Address {
13353            proc: self.proc.clone(),
13354            selection: query,
13355            graphql_client: self.graphql_client.clone(),
13356        }
13357    }
13358    /// Load a Binding from its ID.
13359    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
13360        let mut query = self.selection.select("loadBindingFromID");
13361        query = query.arg_lazy(
13362            "id",
13363            Box::new(move || {
13364                let id = id.clone();
13365                Box::pin(async move { id.into_id().await.unwrap().quote() })
13366            }),
13367        );
13368        Binding {
13369            proc: self.proc.clone(),
13370            selection: query,
13371            graphql_client: self.graphql_client.clone(),
13372        }
13373    }
13374    /// Load a CacheVolume from its ID.
13375    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
13376        let mut query = self.selection.select("loadCacheVolumeFromID");
13377        query = query.arg_lazy(
13378            "id",
13379            Box::new(move || {
13380                let id = id.clone();
13381                Box::pin(async move { id.into_id().await.unwrap().quote() })
13382            }),
13383        );
13384        CacheVolume {
13385            proc: self.proc.clone(),
13386            selection: query,
13387            graphql_client: self.graphql_client.clone(),
13388        }
13389    }
13390    /// Load a Changeset from its ID.
13391    pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
13392        let mut query = self.selection.select("loadChangesetFromID");
13393        query = query.arg_lazy(
13394            "id",
13395            Box::new(move || {
13396                let id = id.clone();
13397                Box::pin(async move { id.into_id().await.unwrap().quote() })
13398            }),
13399        );
13400        Changeset {
13401            proc: self.proc.clone(),
13402            selection: query,
13403            graphql_client: self.graphql_client.clone(),
13404        }
13405    }
13406    /// Load a Check from its ID.
13407    pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
13408        let mut query = self.selection.select("loadCheckFromID");
13409        query = query.arg_lazy(
13410            "id",
13411            Box::new(move || {
13412                let id = id.clone();
13413                Box::pin(async move { id.into_id().await.unwrap().quote() })
13414            }),
13415        );
13416        Check {
13417            proc: self.proc.clone(),
13418            selection: query,
13419            graphql_client: self.graphql_client.clone(),
13420        }
13421    }
13422    /// Load a CheckGroup from its ID.
13423    pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
13424        let mut query = self.selection.select("loadCheckGroupFromID");
13425        query = query.arg_lazy(
13426            "id",
13427            Box::new(move || {
13428                let id = id.clone();
13429                Box::pin(async move { id.into_id().await.unwrap().quote() })
13430            }),
13431        );
13432        CheckGroup {
13433            proc: self.proc.clone(),
13434            selection: query,
13435            graphql_client: self.graphql_client.clone(),
13436        }
13437    }
13438    /// Load a ClientFilesyncMirror from its ID.
13439    pub fn load_client_filesync_mirror_from_id(
13440        &self,
13441        id: impl IntoID<ClientFilesyncMirrorId>,
13442    ) -> ClientFilesyncMirror {
13443        let mut query = self.selection.select("loadClientFilesyncMirrorFromID");
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        ClientFilesyncMirror {
13452            proc: self.proc.clone(),
13453            selection: query,
13454            graphql_client: self.graphql_client.clone(),
13455        }
13456    }
13457    /// Load a Cloud from its ID.
13458    pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
13459        let mut query = self.selection.select("loadCloudFromID");
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        Cloud {
13468            proc: self.proc.clone(),
13469            selection: query,
13470            graphql_client: self.graphql_client.clone(),
13471        }
13472    }
13473    /// Load a Container from its ID.
13474    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
13475        let mut query = self.selection.select("loadContainerFromID");
13476        query = query.arg_lazy(
13477            "id",
13478            Box::new(move || {
13479                let id = id.clone();
13480                Box::pin(async move { id.into_id().await.unwrap().quote() })
13481            }),
13482        );
13483        Container {
13484            proc: self.proc.clone(),
13485            selection: query,
13486            graphql_client: self.graphql_client.clone(),
13487        }
13488    }
13489    /// Load a CurrentModule from its ID.
13490    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
13491        let mut query = self.selection.select("loadCurrentModuleFromID");
13492        query = query.arg_lazy(
13493            "id",
13494            Box::new(move || {
13495                let id = id.clone();
13496                Box::pin(async move { id.into_id().await.unwrap().quote() })
13497            }),
13498        );
13499        CurrentModule {
13500            proc: self.proc.clone(),
13501            selection: query,
13502            graphql_client: self.graphql_client.clone(),
13503        }
13504    }
13505    /// Load a DiffStat from its ID.
13506    pub fn load_diff_stat_from_id(&self, id: impl IntoID<DiffStatId>) -> DiffStat {
13507        let mut query = self.selection.select("loadDiffStatFromID");
13508        query = query.arg_lazy(
13509            "id",
13510            Box::new(move || {
13511                let id = id.clone();
13512                Box::pin(async move { id.into_id().await.unwrap().quote() })
13513            }),
13514        );
13515        DiffStat {
13516            proc: self.proc.clone(),
13517            selection: query,
13518            graphql_client: self.graphql_client.clone(),
13519        }
13520    }
13521    /// Load a Directory from its ID.
13522    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
13523        let mut query = self.selection.select("loadDirectoryFromID");
13524        query = query.arg_lazy(
13525            "id",
13526            Box::new(move || {
13527                let id = id.clone();
13528                Box::pin(async move { id.into_id().await.unwrap().quote() })
13529            }),
13530        );
13531        Directory {
13532            proc: self.proc.clone(),
13533            selection: query,
13534            graphql_client: self.graphql_client.clone(),
13535        }
13536    }
13537    /// Load a EngineCacheEntry from its ID.
13538    pub fn load_engine_cache_entry_from_id(
13539        &self,
13540        id: impl IntoID<EngineCacheEntryId>,
13541    ) -> EngineCacheEntry {
13542        let mut query = self.selection.select("loadEngineCacheEntryFromID");
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        EngineCacheEntry {
13551            proc: self.proc.clone(),
13552            selection: query,
13553            graphql_client: self.graphql_client.clone(),
13554        }
13555    }
13556    /// Load a EngineCacheEntrySet from its ID.
13557    pub fn load_engine_cache_entry_set_from_id(
13558        &self,
13559        id: impl IntoID<EngineCacheEntrySetId>,
13560    ) -> EngineCacheEntrySet {
13561        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
13562        query = query.arg_lazy(
13563            "id",
13564            Box::new(move || {
13565                let id = id.clone();
13566                Box::pin(async move { id.into_id().await.unwrap().quote() })
13567            }),
13568        );
13569        EngineCacheEntrySet {
13570            proc: self.proc.clone(),
13571            selection: query,
13572            graphql_client: self.graphql_client.clone(),
13573        }
13574    }
13575    /// Load a EngineCache from its ID.
13576    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
13577        let mut query = self.selection.select("loadEngineCacheFromID");
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        EngineCache {
13586            proc: self.proc.clone(),
13587            selection: query,
13588            graphql_client: self.graphql_client.clone(),
13589        }
13590    }
13591    /// Load a Engine from its ID.
13592    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
13593        let mut query = self.selection.select("loadEngineFromID");
13594        query = query.arg_lazy(
13595            "id",
13596            Box::new(move || {
13597                let id = id.clone();
13598                Box::pin(async move { id.into_id().await.unwrap().quote() })
13599            }),
13600        );
13601        Engine {
13602            proc: self.proc.clone(),
13603            selection: query,
13604            graphql_client: self.graphql_client.clone(),
13605        }
13606    }
13607    /// Load a EnumTypeDef from its ID.
13608    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
13609        let mut query = self.selection.select("loadEnumTypeDefFromID");
13610        query = query.arg_lazy(
13611            "id",
13612            Box::new(move || {
13613                let id = id.clone();
13614                Box::pin(async move { id.into_id().await.unwrap().quote() })
13615            }),
13616        );
13617        EnumTypeDef {
13618            proc: self.proc.clone(),
13619            selection: query,
13620            graphql_client: self.graphql_client.clone(),
13621        }
13622    }
13623    /// Load a EnumValueTypeDef from its ID.
13624    pub fn load_enum_value_type_def_from_id(
13625        &self,
13626        id: impl IntoID<EnumValueTypeDefId>,
13627    ) -> EnumValueTypeDef {
13628        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
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        EnumValueTypeDef {
13637            proc: self.proc.clone(),
13638            selection: query,
13639            graphql_client: self.graphql_client.clone(),
13640        }
13641    }
13642    /// Load a EnvFile from its ID.
13643    pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
13644        let mut query = self.selection.select("loadEnvFileFromID");
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        EnvFile {
13653            proc: self.proc.clone(),
13654            selection: query,
13655            graphql_client: self.graphql_client.clone(),
13656        }
13657    }
13658    /// Load a Env from its ID.
13659    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
13660        let mut query = self.selection.select("loadEnvFromID");
13661        query = query.arg_lazy(
13662            "id",
13663            Box::new(move || {
13664                let id = id.clone();
13665                Box::pin(async move { id.into_id().await.unwrap().quote() })
13666            }),
13667        );
13668        Env {
13669            proc: self.proc.clone(),
13670            selection: query,
13671            graphql_client: self.graphql_client.clone(),
13672        }
13673    }
13674    /// Load a EnvVariable from its ID.
13675    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
13676        let mut query = self.selection.select("loadEnvVariableFromID");
13677        query = query.arg_lazy(
13678            "id",
13679            Box::new(move || {
13680                let id = id.clone();
13681                Box::pin(async move { id.into_id().await.unwrap().quote() })
13682            }),
13683        );
13684        EnvVariable {
13685            proc: self.proc.clone(),
13686            selection: query,
13687            graphql_client: self.graphql_client.clone(),
13688        }
13689    }
13690    /// Load a Error from its ID.
13691    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
13692        let mut query = self.selection.select("loadErrorFromID");
13693        query = query.arg_lazy(
13694            "id",
13695            Box::new(move || {
13696                let id = id.clone();
13697                Box::pin(async move { id.into_id().await.unwrap().quote() })
13698            }),
13699        );
13700        Error {
13701            proc: self.proc.clone(),
13702            selection: query,
13703            graphql_client: self.graphql_client.clone(),
13704        }
13705    }
13706    /// Load a ErrorValue from its ID.
13707    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
13708        let mut query = self.selection.select("loadErrorValueFromID");
13709        query = query.arg_lazy(
13710            "id",
13711            Box::new(move || {
13712                let id = id.clone();
13713                Box::pin(async move { id.into_id().await.unwrap().quote() })
13714            }),
13715        );
13716        ErrorValue {
13717            proc: self.proc.clone(),
13718            selection: query,
13719            graphql_client: self.graphql_client.clone(),
13720        }
13721    }
13722    /// Load a Exportable from its ID.
13723    pub fn load_exportable_from_id(&self, id: impl IntoID<ExportableId>) -> ExportableClient {
13724        let mut query = self.selection.select("loadExportableFromID");
13725        query = query.arg_lazy(
13726            "id",
13727            Box::new(move || {
13728                let id = id.clone();
13729                Box::pin(async move { id.into_id().await.unwrap().quote() })
13730            }),
13731        );
13732        ExportableClient {
13733            proc: self.proc.clone(),
13734            selection: query,
13735            graphql_client: self.graphql_client.clone(),
13736        }
13737    }
13738    /// Load a FieldTypeDef from its ID.
13739    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
13740        let mut query = self.selection.select("loadFieldTypeDefFromID");
13741        query = query.arg_lazy(
13742            "id",
13743            Box::new(move || {
13744                let id = id.clone();
13745                Box::pin(async move { id.into_id().await.unwrap().quote() })
13746            }),
13747        );
13748        FieldTypeDef {
13749            proc: self.proc.clone(),
13750            selection: query,
13751            graphql_client: self.graphql_client.clone(),
13752        }
13753    }
13754    /// Load a File from its ID.
13755    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
13756        let mut query = self.selection.select("loadFileFromID");
13757        query = query.arg_lazy(
13758            "id",
13759            Box::new(move || {
13760                let id = id.clone();
13761                Box::pin(async move { id.into_id().await.unwrap().quote() })
13762            }),
13763        );
13764        File {
13765            proc: self.proc.clone(),
13766            selection: query,
13767            graphql_client: self.graphql_client.clone(),
13768        }
13769    }
13770    /// Load a FunctionArg from its ID.
13771    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
13772        let mut query = self.selection.select("loadFunctionArgFromID");
13773        query = query.arg_lazy(
13774            "id",
13775            Box::new(move || {
13776                let id = id.clone();
13777                Box::pin(async move { id.into_id().await.unwrap().quote() })
13778            }),
13779        );
13780        FunctionArg {
13781            proc: self.proc.clone(),
13782            selection: query,
13783            graphql_client: self.graphql_client.clone(),
13784        }
13785    }
13786    /// Load a FunctionCallArgValue from its ID.
13787    pub fn load_function_call_arg_value_from_id(
13788        &self,
13789        id: impl IntoID<FunctionCallArgValueId>,
13790    ) -> FunctionCallArgValue {
13791        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
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        FunctionCallArgValue {
13800            proc: self.proc.clone(),
13801            selection: query,
13802            graphql_client: self.graphql_client.clone(),
13803        }
13804    }
13805    /// Load a FunctionCall from its ID.
13806    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
13807        let mut query = self.selection.select("loadFunctionCallFromID");
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        FunctionCall {
13816            proc: self.proc.clone(),
13817            selection: query,
13818            graphql_client: self.graphql_client.clone(),
13819        }
13820    }
13821    /// Load a Function from its ID.
13822    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
13823        let mut query = self.selection.select("loadFunctionFromID");
13824        query = query.arg_lazy(
13825            "id",
13826            Box::new(move || {
13827                let id = id.clone();
13828                Box::pin(async move { id.into_id().await.unwrap().quote() })
13829            }),
13830        );
13831        Function {
13832            proc: self.proc.clone(),
13833            selection: query,
13834            graphql_client: self.graphql_client.clone(),
13835        }
13836    }
13837    /// Load a GeneratedCode from its ID.
13838    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
13839        let mut query = self.selection.select("loadGeneratedCodeFromID");
13840        query = query.arg_lazy(
13841            "id",
13842            Box::new(move || {
13843                let id = id.clone();
13844                Box::pin(async move { id.into_id().await.unwrap().quote() })
13845            }),
13846        );
13847        GeneratedCode {
13848            proc: self.proc.clone(),
13849            selection: query,
13850            graphql_client: self.graphql_client.clone(),
13851        }
13852    }
13853    /// Load a Generator from its ID.
13854    pub fn load_generator_from_id(&self, id: impl IntoID<GeneratorId>) -> Generator {
13855        let mut query = self.selection.select("loadGeneratorFromID");
13856        query = query.arg_lazy(
13857            "id",
13858            Box::new(move || {
13859                let id = id.clone();
13860                Box::pin(async move { id.into_id().await.unwrap().quote() })
13861            }),
13862        );
13863        Generator {
13864            proc: self.proc.clone(),
13865            selection: query,
13866            graphql_client: self.graphql_client.clone(),
13867        }
13868    }
13869    /// Load a GeneratorGroup from its ID.
13870    pub fn load_generator_group_from_id(
13871        &self,
13872        id: impl IntoID<GeneratorGroupId>,
13873    ) -> GeneratorGroup {
13874        let mut query = self.selection.select("loadGeneratorGroupFromID");
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        GeneratorGroup {
13883            proc: self.proc.clone(),
13884            selection: query,
13885            graphql_client: self.graphql_client.clone(),
13886        }
13887    }
13888    /// Load a GitRef from its ID.
13889    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
13890        let mut query = self.selection.select("loadGitRefFromID");
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        GitRef {
13899            proc: self.proc.clone(),
13900            selection: query,
13901            graphql_client: self.graphql_client.clone(),
13902        }
13903    }
13904    /// Load a GitRepository from its ID.
13905    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
13906        let mut query = self.selection.select("loadGitRepositoryFromID");
13907        query = query.arg_lazy(
13908            "id",
13909            Box::new(move || {
13910                let id = id.clone();
13911                Box::pin(async move { id.into_id().await.unwrap().quote() })
13912            }),
13913        );
13914        GitRepository {
13915            proc: self.proc.clone(),
13916            selection: query,
13917            graphql_client: self.graphql_client.clone(),
13918        }
13919    }
13920    /// Load a HTTPState from its ID.
13921    pub fn load_http_state_from_id(&self, id: impl IntoID<HttpStateId>) -> HttpState {
13922        let mut query = self.selection.select("loadHTTPStateFromID");
13923        query = query.arg_lazy(
13924            "id",
13925            Box::new(move || {
13926                let id = id.clone();
13927                Box::pin(async move { id.into_id().await.unwrap().quote() })
13928            }),
13929        );
13930        HttpState {
13931            proc: self.proc.clone(),
13932            selection: query,
13933            graphql_client: self.graphql_client.clone(),
13934        }
13935    }
13936    /// Load a HealthcheckConfig from its ID.
13937    pub fn load_healthcheck_config_from_id(
13938        &self,
13939        id: impl IntoID<HealthcheckConfigId>,
13940    ) -> HealthcheckConfig {
13941        let mut query = self.selection.select("loadHealthcheckConfigFromID");
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        HealthcheckConfig {
13950            proc: self.proc.clone(),
13951            selection: query,
13952            graphql_client: self.graphql_client.clone(),
13953        }
13954    }
13955    /// Load a Host from its ID.
13956    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
13957        let mut query = self.selection.select("loadHostFromID");
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        Host {
13966            proc: self.proc.clone(),
13967            selection: query,
13968            graphql_client: self.graphql_client.clone(),
13969        }
13970    }
13971    /// Load a InputTypeDef from its ID.
13972    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
13973        let mut query = self.selection.select("loadInputTypeDefFromID");
13974        query = query.arg_lazy(
13975            "id",
13976            Box::new(move || {
13977                let id = id.clone();
13978                Box::pin(async move { id.into_id().await.unwrap().quote() })
13979            }),
13980        );
13981        InputTypeDef {
13982            proc: self.proc.clone(),
13983            selection: query,
13984            graphql_client: self.graphql_client.clone(),
13985        }
13986    }
13987    /// Load a InterfaceTypeDef from its ID.
13988    pub fn load_interface_type_def_from_id(
13989        &self,
13990        id: impl IntoID<InterfaceTypeDefId>,
13991    ) -> InterfaceTypeDef {
13992        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
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        InterfaceTypeDef {
14001            proc: self.proc.clone(),
14002            selection: query,
14003            graphql_client: self.graphql_client.clone(),
14004        }
14005    }
14006    /// Load a JSONValue from its ID.
14007    pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
14008        let mut query = self.selection.select("loadJSONValueFromID");
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        JsonValue {
14017            proc: self.proc.clone(),
14018            selection: query,
14019            graphql_client: self.graphql_client.clone(),
14020        }
14021    }
14022    /// Load a LLM from its ID.
14023    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
14024        let mut query = self.selection.select("loadLLMFromID");
14025        query = query.arg_lazy(
14026            "id",
14027            Box::new(move || {
14028                let id = id.clone();
14029                Box::pin(async move { id.into_id().await.unwrap().quote() })
14030            }),
14031        );
14032        Llm {
14033            proc: self.proc.clone(),
14034            selection: query,
14035            graphql_client: self.graphql_client.clone(),
14036        }
14037    }
14038    /// Load a LLMTokenUsage from its ID.
14039    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
14040        let mut query = self.selection.select("loadLLMTokenUsageFromID");
14041        query = query.arg_lazy(
14042            "id",
14043            Box::new(move || {
14044                let id = id.clone();
14045                Box::pin(async move { id.into_id().await.unwrap().quote() })
14046            }),
14047        );
14048        LlmTokenUsage {
14049            proc: self.proc.clone(),
14050            selection: query,
14051            graphql_client: self.graphql_client.clone(),
14052        }
14053    }
14054    /// Load a Label from its ID.
14055    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
14056        let mut query = self.selection.select("loadLabelFromID");
14057        query = query.arg_lazy(
14058            "id",
14059            Box::new(move || {
14060                let id = id.clone();
14061                Box::pin(async move { id.into_id().await.unwrap().quote() })
14062            }),
14063        );
14064        Label {
14065            proc: self.proc.clone(),
14066            selection: query,
14067            graphql_client: self.graphql_client.clone(),
14068        }
14069    }
14070    /// Load a ListTypeDef from its ID.
14071    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
14072        let mut query = self.selection.select("loadListTypeDefFromID");
14073        query = query.arg_lazy(
14074            "id",
14075            Box::new(move || {
14076                let id = id.clone();
14077                Box::pin(async move { id.into_id().await.unwrap().quote() })
14078            }),
14079        );
14080        ListTypeDef {
14081            proc: self.proc.clone(),
14082            selection: query,
14083            graphql_client: self.graphql_client.clone(),
14084        }
14085    }
14086    /// Load a ModuleConfigClient from its ID.
14087    pub fn load_module_config_client_from_id(
14088        &self,
14089        id: impl IntoID<ModuleConfigClientId>,
14090    ) -> ModuleConfigClient {
14091        let mut query = self.selection.select("loadModuleConfigClientFromID");
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        ModuleConfigClient {
14100            proc: self.proc.clone(),
14101            selection: query,
14102            graphql_client: self.graphql_client.clone(),
14103        }
14104    }
14105    /// Load a Module from its ID.
14106    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
14107        let mut query = self.selection.select("loadModuleFromID");
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        Module {
14116            proc: self.proc.clone(),
14117            selection: query,
14118            graphql_client: self.graphql_client.clone(),
14119        }
14120    }
14121    /// Load a ModuleSource from its ID.
14122    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
14123        let mut query = self.selection.select("loadModuleSourceFromID");
14124        query = query.arg_lazy(
14125            "id",
14126            Box::new(move || {
14127                let id = id.clone();
14128                Box::pin(async move { id.into_id().await.unwrap().quote() })
14129            }),
14130        );
14131        ModuleSource {
14132            proc: self.proc.clone(),
14133            selection: query,
14134            graphql_client: self.graphql_client.clone(),
14135        }
14136    }
14137    /// Load a ObjectTypeDef from its ID.
14138    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
14139        let mut query = self.selection.select("loadObjectTypeDefFromID");
14140        query = query.arg_lazy(
14141            "id",
14142            Box::new(move || {
14143                let id = id.clone();
14144                Box::pin(async move { id.into_id().await.unwrap().quote() })
14145            }),
14146        );
14147        ObjectTypeDef {
14148            proc: self.proc.clone(),
14149            selection: query,
14150            graphql_client: self.graphql_client.clone(),
14151        }
14152    }
14153    /// Load a Port from its ID.
14154    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
14155        let mut query = self.selection.select("loadPortFromID");
14156        query = query.arg_lazy(
14157            "id",
14158            Box::new(move || {
14159                let id = id.clone();
14160                Box::pin(async move { id.into_id().await.unwrap().quote() })
14161            }),
14162        );
14163        Port {
14164            proc: self.proc.clone(),
14165            selection: query,
14166            graphql_client: self.graphql_client.clone(),
14167        }
14168    }
14169    /// Load a RemoteGitMirror from its ID.
14170    pub fn load_remote_git_mirror_from_id(
14171        &self,
14172        id: impl IntoID<RemoteGitMirrorId>,
14173    ) -> RemoteGitMirror {
14174        let mut query = self.selection.select("loadRemoteGitMirrorFromID");
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        RemoteGitMirror {
14183            proc: self.proc.clone(),
14184            selection: query,
14185            graphql_client: self.graphql_client.clone(),
14186        }
14187    }
14188    /// Load a SDKConfig from its ID.
14189    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
14190        let mut query = self.selection.select("loadSDKConfigFromID");
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        SdkConfig {
14199            proc: self.proc.clone(),
14200            selection: query,
14201            graphql_client: self.graphql_client.clone(),
14202        }
14203    }
14204    /// Load a ScalarTypeDef from its ID.
14205    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
14206        let mut query = self.selection.select("loadScalarTypeDefFromID");
14207        query = query.arg_lazy(
14208            "id",
14209            Box::new(move || {
14210                let id = id.clone();
14211                Box::pin(async move { id.into_id().await.unwrap().quote() })
14212            }),
14213        );
14214        ScalarTypeDef {
14215            proc: self.proc.clone(),
14216            selection: query,
14217            graphql_client: self.graphql_client.clone(),
14218        }
14219    }
14220    /// Load a SearchResult from its ID.
14221    pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
14222        let mut query = self.selection.select("loadSearchResultFromID");
14223        query = query.arg_lazy(
14224            "id",
14225            Box::new(move || {
14226                let id = id.clone();
14227                Box::pin(async move { id.into_id().await.unwrap().quote() })
14228            }),
14229        );
14230        SearchResult {
14231            proc: self.proc.clone(),
14232            selection: query,
14233            graphql_client: self.graphql_client.clone(),
14234        }
14235    }
14236    /// Load a SearchSubmatch from its ID.
14237    pub fn load_search_submatch_from_id(
14238        &self,
14239        id: impl IntoID<SearchSubmatchId>,
14240    ) -> SearchSubmatch {
14241        let mut query = self.selection.select("loadSearchSubmatchFromID");
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        SearchSubmatch {
14250            proc: self.proc.clone(),
14251            selection: query,
14252            graphql_client: self.graphql_client.clone(),
14253        }
14254    }
14255    /// Load a Secret from its ID.
14256    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
14257        let mut query = self.selection.select("loadSecretFromID");
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        Secret {
14266            proc: self.proc.clone(),
14267            selection: query,
14268            graphql_client: self.graphql_client.clone(),
14269        }
14270    }
14271    /// Load a Service from its ID.
14272    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
14273        let mut query = self.selection.select("loadServiceFromID");
14274        query = query.arg_lazy(
14275            "id",
14276            Box::new(move || {
14277                let id = id.clone();
14278                Box::pin(async move { id.into_id().await.unwrap().quote() })
14279            }),
14280        );
14281        Service {
14282            proc: self.proc.clone(),
14283            selection: query,
14284            graphql_client: self.graphql_client.clone(),
14285        }
14286    }
14287    /// Load a Socket from its ID.
14288    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
14289        let mut query = self.selection.select("loadSocketFromID");
14290        query = query.arg_lazy(
14291            "id",
14292            Box::new(move || {
14293                let id = id.clone();
14294                Box::pin(async move { id.into_id().await.unwrap().quote() })
14295            }),
14296        );
14297        Socket {
14298            proc: self.proc.clone(),
14299            selection: query,
14300            graphql_client: self.graphql_client.clone(),
14301        }
14302    }
14303    /// Load a SourceMap from its ID.
14304    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
14305        let mut query = self.selection.select("loadSourceMapFromID");
14306        query = query.arg_lazy(
14307            "id",
14308            Box::new(move || {
14309                let id = id.clone();
14310                Box::pin(async move { id.into_id().await.unwrap().quote() })
14311            }),
14312        );
14313        SourceMap {
14314            proc: self.proc.clone(),
14315            selection: query,
14316            graphql_client: self.graphql_client.clone(),
14317        }
14318    }
14319    /// Load a Stat from its ID.
14320    pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
14321        let mut query = self.selection.select("loadStatFromID");
14322        query = query.arg_lazy(
14323            "id",
14324            Box::new(move || {
14325                let id = id.clone();
14326                Box::pin(async move { id.into_id().await.unwrap().quote() })
14327            }),
14328        );
14329        Stat {
14330            proc: self.proc.clone(),
14331            selection: query,
14332            graphql_client: self.graphql_client.clone(),
14333        }
14334    }
14335    /// Load a Syncer from its ID.
14336    pub fn load_syncer_from_id(&self, id: impl IntoID<SyncerId>) -> SyncerClient {
14337        let mut query = self.selection.select("loadSyncerFromID");
14338        query = query.arg_lazy(
14339            "id",
14340            Box::new(move || {
14341                let id = id.clone();
14342                Box::pin(async move { id.into_id().await.unwrap().quote() })
14343            }),
14344        );
14345        SyncerClient {
14346            proc: self.proc.clone(),
14347            selection: query,
14348            graphql_client: self.graphql_client.clone(),
14349        }
14350    }
14351    /// Load a Terminal from its ID.
14352    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
14353        let mut query = self.selection.select("loadTerminalFromID");
14354        query = query.arg_lazy(
14355            "id",
14356            Box::new(move || {
14357                let id = id.clone();
14358                Box::pin(async move { id.into_id().await.unwrap().quote() })
14359            }),
14360        );
14361        Terminal {
14362            proc: self.proc.clone(),
14363            selection: query,
14364            graphql_client: self.graphql_client.clone(),
14365        }
14366    }
14367    /// Load a TypeDef from its ID.
14368    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
14369        let mut query = self.selection.select("loadTypeDefFromID");
14370        query = query.arg_lazy(
14371            "id",
14372            Box::new(move || {
14373                let id = id.clone();
14374                Box::pin(async move { id.into_id().await.unwrap().quote() })
14375            }),
14376        );
14377        TypeDef {
14378            proc: self.proc.clone(),
14379            selection: query,
14380            graphql_client: self.graphql_client.clone(),
14381        }
14382    }
14383    /// Load a Up from its ID.
14384    pub fn load_up_from_id(&self, id: impl IntoID<UpId>) -> Up {
14385        let mut query = self.selection.select("loadUpFromID");
14386        query = query.arg_lazy(
14387            "id",
14388            Box::new(move || {
14389                let id = id.clone();
14390                Box::pin(async move { id.into_id().await.unwrap().quote() })
14391            }),
14392        );
14393        Up {
14394            proc: self.proc.clone(),
14395            selection: query,
14396            graphql_client: self.graphql_client.clone(),
14397        }
14398    }
14399    /// Load a UpGroup from its ID.
14400    pub fn load_up_group_from_id(&self, id: impl IntoID<UpGroupId>) -> UpGroup {
14401        let mut query = self.selection.select("loadUpGroupFromID");
14402        query = query.arg_lazy(
14403            "id",
14404            Box::new(move || {
14405                let id = id.clone();
14406                Box::pin(async move { id.into_id().await.unwrap().quote() })
14407            }),
14408        );
14409        UpGroup {
14410            proc: self.proc.clone(),
14411            selection: query,
14412            graphql_client: self.graphql_client.clone(),
14413        }
14414    }
14415    /// Load a Workspace from its ID.
14416    pub fn load_workspace_from_id(&self, id: impl IntoID<WorkspaceId>) -> Workspace {
14417        let mut query = self.selection.select("loadWorkspaceFromID");
14418        query = query.arg_lazy(
14419            "id",
14420            Box::new(move || {
14421                let id = id.clone();
14422                Box::pin(async move { id.into_id().await.unwrap().quote() })
14423            }),
14424        );
14425        Workspace {
14426            proc: self.proc.clone(),
14427            selection: query,
14428            graphql_client: self.graphql_client.clone(),
14429        }
14430    }
14431    /// Create a new module.
14432    pub fn module(&self) -> Module {
14433        let query = self.selection.select("module");
14434        Module {
14435            proc: self.proc.clone(),
14436            selection: query,
14437            graphql_client: self.graphql_client.clone(),
14438        }
14439    }
14440    /// Create a new module source instance from a source ref string
14441    ///
14442    /// # Arguments
14443    ///
14444    /// * `ref_string` - The string ref representation of the module source
14445    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14446    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
14447        let mut query = self.selection.select("moduleSource");
14448        query = query.arg("refString", ref_string.into());
14449        ModuleSource {
14450            proc: self.proc.clone(),
14451            selection: query,
14452            graphql_client: self.graphql_client.clone(),
14453        }
14454    }
14455    /// Create a new module source instance from a source ref string
14456    ///
14457    /// # Arguments
14458    ///
14459    /// * `ref_string` - The string ref representation of the module source
14460    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14461    pub fn module_source_opts<'a>(
14462        &self,
14463        ref_string: impl Into<String>,
14464        opts: QueryModuleSourceOpts<'a>,
14465    ) -> ModuleSource {
14466        let mut query = self.selection.select("moduleSource");
14467        query = query.arg("refString", ref_string.into());
14468        if let Some(ref_pin) = opts.ref_pin {
14469            query = query.arg("refPin", ref_pin);
14470        }
14471        if let Some(disable_find_up) = opts.disable_find_up {
14472            query = query.arg("disableFindUp", disable_find_up);
14473        }
14474        if let Some(allow_not_exists) = opts.allow_not_exists {
14475            query = query.arg("allowNotExists", allow_not_exists);
14476        }
14477        if let Some(require_kind) = opts.require_kind {
14478            query = query.arg("requireKind", require_kind);
14479        }
14480        ModuleSource {
14481            proc: self.proc.clone(),
14482            selection: query,
14483            graphql_client: self.graphql_client.clone(),
14484        }
14485    }
14486    /// Load any object by its ID.
14487    pub fn node(&self, id: impl IntoID<Id>) -> NodeClient {
14488        let mut query = self.selection.select("node");
14489        query = query.arg_lazy(
14490            "id",
14491            Box::new(move || {
14492                let id = id.clone();
14493                Box::pin(async move { id.into_id().await.unwrap().quote() })
14494            }),
14495        );
14496        NodeClient {
14497            proc: self.proc.clone(),
14498            selection: query,
14499            graphql_client: self.graphql_client.clone(),
14500        }
14501    }
14502    /// Creates a new secret.
14503    ///
14504    /// # Arguments
14505    ///
14506    /// * `uri` - The URI of the secret store
14507    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14508    pub fn secret(&self, uri: impl Into<String>) -> Secret {
14509        let mut query = self.selection.select("secret");
14510        query = query.arg("uri", uri.into());
14511        Secret {
14512            proc: self.proc.clone(),
14513            selection: query,
14514            graphql_client: self.graphql_client.clone(),
14515        }
14516    }
14517    /// Creates a new secret.
14518    ///
14519    /// # Arguments
14520    ///
14521    /// * `uri` - The URI of the secret store
14522    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14523    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
14524        let mut query = self.selection.select("secret");
14525        query = query.arg("uri", uri.into());
14526        if let Some(cache_key) = opts.cache_key {
14527            query = query.arg("cacheKey", cache_key);
14528        }
14529        Secret {
14530            proc: self.proc.clone(),
14531            selection: query,
14532            graphql_client: self.graphql_client.clone(),
14533        }
14534    }
14535    /// Sets a secret given a user defined name to its plaintext and returns the secret.
14536    /// The plaintext value is limited to a size of 128000 bytes.
14537    ///
14538    /// # Arguments
14539    ///
14540    /// * `name` - The user defined name for this secret
14541    /// * `plaintext` - The plaintext of the secret
14542    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
14543        let mut query = self.selection.select("setSecret");
14544        query = query.arg("name", name.into());
14545        query = query.arg("plaintext", plaintext.into());
14546        Secret {
14547            proc: self.proc.clone(),
14548            selection: query,
14549            graphql_client: self.graphql_client.clone(),
14550        }
14551    }
14552    /// Creates source map metadata.
14553    ///
14554    /// # Arguments
14555    ///
14556    /// * `filename` - The filename from the module source.
14557    /// * `line` - The line number within the filename.
14558    /// * `column` - The column number within the line.
14559    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
14560        let mut query = self.selection.select("sourceMap");
14561        query = query.arg("filename", filename.into());
14562        query = query.arg("line", line);
14563        query = query.arg("column", column);
14564        SourceMap {
14565            proc: self.proc.clone(),
14566            selection: query,
14567            graphql_client: self.graphql_client.clone(),
14568        }
14569    }
14570    /// Create a new TypeDef.
14571    pub fn type_def(&self) -> TypeDef {
14572        let query = self.selection.select("typeDef");
14573        TypeDef {
14574            proc: self.proc.clone(),
14575            selection: query,
14576            graphql_client: self.graphql_client.clone(),
14577        }
14578    }
14579    /// Get the current Dagger Engine version.
14580    pub async fn version(&self) -> Result<String, DaggerError> {
14581        let query = self.selection.select("version");
14582        query.execute(self.graphql_client.clone()).await
14583    }
14584}
14585impl Node for Query {
14586    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14587        let query = self.selection.select("id");
14588        let graphql_client = self.graphql_client.clone();
14589        async move { query.execute(graphql_client).await }
14590    }
14591}
14592#[derive(Clone)]
14593pub struct RemoteGitMirror {
14594    pub proc: Option<Arc<DaggerSessionProc>>,
14595    pub selection: Selection,
14596    pub graphql_client: DynGraphQLClient,
14597}
14598impl IntoID<Id> for RemoteGitMirror {
14599    fn into_id(
14600        self,
14601    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14602        Box::pin(async move { self.id().await })
14603    }
14604}
14605impl Loadable for RemoteGitMirror {
14606    fn graphql_type() -> &'static str {
14607        "RemoteGitMirror"
14608    }
14609    fn from_query(
14610        proc: Option<Arc<DaggerSessionProc>>,
14611        selection: Selection,
14612        graphql_client: DynGraphQLClient,
14613    ) -> Self {
14614        Self {
14615            proc,
14616            selection,
14617            graphql_client,
14618        }
14619    }
14620}
14621impl RemoteGitMirror {
14622    /// A unique identifier for this RemoteGitMirror.
14623    pub async fn id(&self) -> Result<Id, DaggerError> {
14624        let query = self.selection.select("id");
14625        query.execute(self.graphql_client.clone()).await
14626    }
14627}
14628impl Node for RemoteGitMirror {
14629    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14630        let query = self.selection.select("id");
14631        let graphql_client = self.graphql_client.clone();
14632        async move { query.execute(graphql_client).await }
14633    }
14634}
14635#[derive(Clone)]
14636pub struct SdkConfig {
14637    pub proc: Option<Arc<DaggerSessionProc>>,
14638    pub selection: Selection,
14639    pub graphql_client: DynGraphQLClient,
14640}
14641impl IntoID<Id> for SdkConfig {
14642    fn into_id(
14643        self,
14644    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14645        Box::pin(async move { self.id().await })
14646    }
14647}
14648impl Loadable for SdkConfig {
14649    fn graphql_type() -> &'static str {
14650        "SDKConfig"
14651    }
14652    fn from_query(
14653        proc: Option<Arc<DaggerSessionProc>>,
14654        selection: Selection,
14655        graphql_client: DynGraphQLClient,
14656    ) -> Self {
14657        Self {
14658            proc,
14659            selection,
14660            graphql_client,
14661        }
14662    }
14663}
14664impl SdkConfig {
14665    /// Whether to start the SDK runtime in debug mode with an interactive terminal.
14666    pub async fn debug(&self) -> Result<bool, DaggerError> {
14667        let query = self.selection.select("debug");
14668        query.execute(self.graphql_client.clone()).await
14669    }
14670    /// A unique identifier for this SDKConfig.
14671    pub async fn id(&self) -> Result<Id, DaggerError> {
14672        let query = self.selection.select("id");
14673        query.execute(self.graphql_client.clone()).await
14674    }
14675    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
14676    pub async fn source(&self) -> Result<String, DaggerError> {
14677        let query = self.selection.select("source");
14678        query.execute(self.graphql_client.clone()).await
14679    }
14680}
14681impl Node for SdkConfig {
14682    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14683        let query = self.selection.select("id");
14684        let graphql_client = self.graphql_client.clone();
14685        async move { query.execute(graphql_client).await }
14686    }
14687}
14688#[derive(Clone)]
14689pub struct ScalarTypeDef {
14690    pub proc: Option<Arc<DaggerSessionProc>>,
14691    pub selection: Selection,
14692    pub graphql_client: DynGraphQLClient,
14693}
14694impl IntoID<Id> for ScalarTypeDef {
14695    fn into_id(
14696        self,
14697    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14698        Box::pin(async move { self.id().await })
14699    }
14700}
14701impl Loadable for ScalarTypeDef {
14702    fn graphql_type() -> &'static str {
14703        "ScalarTypeDef"
14704    }
14705    fn from_query(
14706        proc: Option<Arc<DaggerSessionProc>>,
14707        selection: Selection,
14708        graphql_client: DynGraphQLClient,
14709    ) -> Self {
14710        Self {
14711            proc,
14712            selection,
14713            graphql_client,
14714        }
14715    }
14716}
14717impl ScalarTypeDef {
14718    /// A doc string for the scalar, if any.
14719    pub async fn description(&self) -> Result<String, DaggerError> {
14720        let query = self.selection.select("description");
14721        query.execute(self.graphql_client.clone()).await
14722    }
14723    /// A unique identifier for this ScalarTypeDef.
14724    pub async fn id(&self) -> Result<Id, DaggerError> {
14725        let query = self.selection.select("id");
14726        query.execute(self.graphql_client.clone()).await
14727    }
14728    /// The name of the scalar.
14729    pub async fn name(&self) -> Result<String, DaggerError> {
14730        let query = self.selection.select("name");
14731        query.execute(self.graphql_client.clone()).await
14732    }
14733    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
14734    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
14735        let query = self.selection.select("sourceModuleName");
14736        query.execute(self.graphql_client.clone()).await
14737    }
14738}
14739impl Node for ScalarTypeDef {
14740    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14741        let query = self.selection.select("id");
14742        let graphql_client = self.graphql_client.clone();
14743        async move { query.execute(graphql_client).await }
14744    }
14745}
14746#[derive(Clone)]
14747pub struct SearchResult {
14748    pub proc: Option<Arc<DaggerSessionProc>>,
14749    pub selection: Selection,
14750    pub graphql_client: DynGraphQLClient,
14751}
14752impl IntoID<Id> for SearchResult {
14753    fn into_id(
14754        self,
14755    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14756        Box::pin(async move { self.id().await })
14757    }
14758}
14759impl Loadable for SearchResult {
14760    fn graphql_type() -> &'static str {
14761        "SearchResult"
14762    }
14763    fn from_query(
14764        proc: Option<Arc<DaggerSessionProc>>,
14765        selection: Selection,
14766        graphql_client: DynGraphQLClient,
14767    ) -> Self {
14768        Self {
14769            proc,
14770            selection,
14771            graphql_client,
14772        }
14773    }
14774}
14775impl SearchResult {
14776    /// The byte offset of this line within the file.
14777    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
14778        let query = self.selection.select("absoluteOffset");
14779        query.execute(self.graphql_client.clone()).await
14780    }
14781    /// The path to the file that matched.
14782    pub async fn file_path(&self) -> Result<String, DaggerError> {
14783        let query = self.selection.select("filePath");
14784        query.execute(self.graphql_client.clone()).await
14785    }
14786    /// A unique identifier for this SearchResult.
14787    pub async fn id(&self) -> Result<Id, DaggerError> {
14788        let query = self.selection.select("id");
14789        query.execute(self.graphql_client.clone()).await
14790    }
14791    /// The first line that matched.
14792    pub async fn line_number(&self) -> Result<isize, DaggerError> {
14793        let query = self.selection.select("lineNumber");
14794        query.execute(self.graphql_client.clone()).await
14795    }
14796    /// The line content that matched.
14797    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
14798        let query = self.selection.select("matchedLines");
14799        query.execute(self.graphql_client.clone()).await
14800    }
14801    /// Sub-match positions and content within the matched lines.
14802    pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
14803        let query = self.selection.select("submatches");
14804        let query = query.select("id");
14805        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
14806        Ok(ids
14807            .into_iter()
14808            .map(|id| SearchSubmatch {
14809                proc: self.proc.clone(),
14810                selection: crate::querybuilder::query()
14811                    .select("node")
14812                    .arg("id", &id.0)
14813                    .inline_fragment("SearchSubmatch"),
14814                graphql_client: self.graphql_client.clone(),
14815            })
14816            .collect())
14817    }
14818}
14819impl Node for SearchResult {
14820    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14821        let query = self.selection.select("id");
14822        let graphql_client = self.graphql_client.clone();
14823        async move { query.execute(graphql_client).await }
14824    }
14825}
14826#[derive(Clone)]
14827pub struct SearchSubmatch {
14828    pub proc: Option<Arc<DaggerSessionProc>>,
14829    pub selection: Selection,
14830    pub graphql_client: DynGraphQLClient,
14831}
14832impl IntoID<Id> for SearchSubmatch {
14833    fn into_id(
14834        self,
14835    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14836        Box::pin(async move { self.id().await })
14837    }
14838}
14839impl Loadable for SearchSubmatch {
14840    fn graphql_type() -> &'static str {
14841        "SearchSubmatch"
14842    }
14843    fn from_query(
14844        proc: Option<Arc<DaggerSessionProc>>,
14845        selection: Selection,
14846        graphql_client: DynGraphQLClient,
14847    ) -> Self {
14848        Self {
14849            proc,
14850            selection,
14851            graphql_client,
14852        }
14853    }
14854}
14855impl SearchSubmatch {
14856    /// The match's end offset within the matched lines.
14857    pub async fn end(&self) -> Result<isize, DaggerError> {
14858        let query = self.selection.select("end");
14859        query.execute(self.graphql_client.clone()).await
14860    }
14861    /// A unique identifier for this SearchSubmatch.
14862    pub async fn id(&self) -> Result<Id, DaggerError> {
14863        let query = self.selection.select("id");
14864        query.execute(self.graphql_client.clone()).await
14865    }
14866    /// The match's start offset within the matched lines.
14867    pub async fn start(&self) -> Result<isize, DaggerError> {
14868        let query = self.selection.select("start");
14869        query.execute(self.graphql_client.clone()).await
14870    }
14871    /// The matched text.
14872    pub async fn text(&self) -> Result<String, DaggerError> {
14873        let query = self.selection.select("text");
14874        query.execute(self.graphql_client.clone()).await
14875    }
14876}
14877impl Node for SearchSubmatch {
14878    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14879        let query = self.selection.select("id");
14880        let graphql_client = self.graphql_client.clone();
14881        async move { query.execute(graphql_client).await }
14882    }
14883}
14884#[derive(Clone)]
14885pub struct Secret {
14886    pub proc: Option<Arc<DaggerSessionProc>>,
14887    pub selection: Selection,
14888    pub graphql_client: DynGraphQLClient,
14889}
14890impl IntoID<Id> for Secret {
14891    fn into_id(
14892        self,
14893    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14894        Box::pin(async move { self.id().await })
14895    }
14896}
14897impl Loadable for Secret {
14898    fn graphql_type() -> &'static str {
14899        "Secret"
14900    }
14901    fn from_query(
14902        proc: Option<Arc<DaggerSessionProc>>,
14903        selection: Selection,
14904        graphql_client: DynGraphQLClient,
14905    ) -> Self {
14906        Self {
14907            proc,
14908            selection,
14909            graphql_client,
14910        }
14911    }
14912}
14913impl Secret {
14914    /// A unique identifier for this Secret.
14915    pub async fn id(&self) -> Result<Id, DaggerError> {
14916        let query = self.selection.select("id");
14917        query.execute(self.graphql_client.clone()).await
14918    }
14919    /// The name of this secret.
14920    pub async fn name(&self) -> Result<String, DaggerError> {
14921        let query = self.selection.select("name");
14922        query.execute(self.graphql_client.clone()).await
14923    }
14924    /// The value of this secret.
14925    pub async fn plaintext(&self) -> Result<String, DaggerError> {
14926        let query = self.selection.select("plaintext");
14927        query.execute(self.graphql_client.clone()).await
14928    }
14929    /// The URI of this secret.
14930    pub async fn uri(&self) -> Result<String, DaggerError> {
14931        let query = self.selection.select("uri");
14932        query.execute(self.graphql_client.clone()).await
14933    }
14934}
14935impl Node for Secret {
14936    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14937        let query = self.selection.select("id");
14938        let graphql_client = self.graphql_client.clone();
14939        async move { query.execute(graphql_client).await }
14940    }
14941}
14942#[derive(Clone)]
14943pub struct Service {
14944    pub proc: Option<Arc<DaggerSessionProc>>,
14945    pub selection: Selection,
14946    pub graphql_client: DynGraphQLClient,
14947}
14948#[derive(Builder, Debug, PartialEq)]
14949pub struct ServiceEndpointOpts<'a> {
14950    /// The exposed port number for the endpoint
14951    #[builder(setter(into, strip_option), default)]
14952    pub port: Option<isize>,
14953    /// Return a URL with the given scheme, eg. http for http://
14954    #[builder(setter(into, strip_option), default)]
14955    pub scheme: Option<&'a str>,
14956}
14957#[derive(Builder, Debug, PartialEq)]
14958pub struct ServiceStopOpts {
14959    /// Immediately kill the service without waiting for a graceful exit
14960    #[builder(setter(into, strip_option), default)]
14961    pub kill: Option<bool>,
14962}
14963#[derive(Builder, Debug, PartialEq)]
14964pub struct ServiceTerminalOpts<'a> {
14965    #[builder(setter(into, strip_option), default)]
14966    pub cmd: Option<Vec<&'a str>>,
14967}
14968#[derive(Builder, Debug, PartialEq)]
14969pub struct ServiceUpOpts {
14970    /// List of frontend/backend port mappings to forward.
14971    /// Frontend is the port accepting traffic on the host, backend is the service port.
14972    #[builder(setter(into, strip_option), default)]
14973    pub ports: Option<Vec<PortForward>>,
14974    /// Bind each tunnel port to a random port on the host.
14975    #[builder(setter(into, strip_option), default)]
14976    pub random: Option<bool>,
14977}
14978impl IntoID<Id> for Service {
14979    fn into_id(
14980        self,
14981    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14982        Box::pin(async move { self.id().await })
14983    }
14984}
14985impl Loadable for Service {
14986    fn graphql_type() -> &'static str {
14987        "Service"
14988    }
14989    fn from_query(
14990        proc: Option<Arc<DaggerSessionProc>>,
14991        selection: Selection,
14992        graphql_client: DynGraphQLClient,
14993    ) -> Self {
14994        Self {
14995            proc,
14996            selection,
14997            graphql_client,
14998        }
14999    }
15000}
15001impl Service {
15002    /// Retrieves an endpoint that clients can use to reach this container.
15003    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
15004    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
15005    ///
15006    /// # Arguments
15007    ///
15008    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15009    pub async fn endpoint(&self) -> Result<String, DaggerError> {
15010        let query = self.selection.select("endpoint");
15011        query.execute(self.graphql_client.clone()).await
15012    }
15013    /// Retrieves an endpoint that clients can use to reach this container.
15014    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
15015    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
15016    ///
15017    /// # Arguments
15018    ///
15019    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15020    pub async fn endpoint_opts<'a>(
15021        &self,
15022        opts: ServiceEndpointOpts<'a>,
15023    ) -> Result<String, DaggerError> {
15024        let mut query = self.selection.select("endpoint");
15025        if let Some(port) = opts.port {
15026            query = query.arg("port", port);
15027        }
15028        if let Some(scheme) = opts.scheme {
15029            query = query.arg("scheme", scheme);
15030        }
15031        query.execute(self.graphql_client.clone()).await
15032    }
15033    /// Retrieves a hostname which can be used by clients to reach this container.
15034    pub async fn hostname(&self) -> Result<String, DaggerError> {
15035        let query = self.selection.select("hostname");
15036        query.execute(self.graphql_client.clone()).await
15037    }
15038    /// A unique identifier for this Service.
15039    pub async fn id(&self) -> Result<Id, DaggerError> {
15040        let query = self.selection.select("id");
15041        query.execute(self.graphql_client.clone()).await
15042    }
15043    /// Retrieves the list of ports provided by the service.
15044    pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
15045        let query = self.selection.select("ports");
15046        let query = query.select("id");
15047        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15048        Ok(ids
15049            .into_iter()
15050            .map(|id| Port {
15051                proc: self.proc.clone(),
15052                selection: crate::querybuilder::query()
15053                    .select("node")
15054                    .arg("id", &id.0)
15055                    .inline_fragment("Port"),
15056                graphql_client: self.graphql_client.clone(),
15057            })
15058            .collect())
15059    }
15060    /// Start the service and wait for its health checks to succeed.
15061    /// Services bound to a Container do not need to be manually started.
15062    pub async fn start(&self) -> Result<Service, DaggerError> {
15063        let query = self.selection.select("start");
15064        let id: Id = query.execute(self.graphql_client.clone()).await?;
15065        Ok(Service {
15066            proc: self.proc.clone(),
15067            selection: query
15068                .root()
15069                .select("node")
15070                .arg("id", &id.0)
15071                .inline_fragment("Service"),
15072            graphql_client: self.graphql_client.clone(),
15073        })
15074    }
15075    /// Stop the service.
15076    ///
15077    /// # Arguments
15078    ///
15079    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15080    pub async fn stop(&self) -> Result<Service, DaggerError> {
15081        let query = self.selection.select("stop");
15082        let id: Id = query.execute(self.graphql_client.clone()).await?;
15083        Ok(Service {
15084            proc: self.proc.clone(),
15085            selection: query
15086                .root()
15087                .select("node")
15088                .arg("id", &id.0)
15089                .inline_fragment("Service"),
15090            graphql_client: self.graphql_client.clone(),
15091        })
15092    }
15093    /// Stop the service.
15094    ///
15095    /// # Arguments
15096    ///
15097    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15098    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
15099        let mut query = self.selection.select("stop");
15100        if let Some(kill) = opts.kill {
15101            query = query.arg("kill", kill);
15102        }
15103        let id: Id = query.execute(self.graphql_client.clone()).await?;
15104        Ok(Service {
15105            proc: self.proc.clone(),
15106            selection: query
15107                .root()
15108                .select("node")
15109                .arg("id", &id.0)
15110                .inline_fragment("Service"),
15111            graphql_client: self.graphql_client.clone(),
15112        })
15113    }
15114    /// Forces evaluation of the pipeline in the engine.
15115    pub async fn sync(&self) -> Result<Service, DaggerError> {
15116        let query = self.selection.select("sync");
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    ///
15129    /// # Arguments
15130    ///
15131    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15132    pub fn terminal(&self) -> Service {
15133        let query = self.selection.select("terminal");
15134        Service {
15135            proc: self.proc.clone(),
15136            selection: query,
15137            graphql_client: self.graphql_client.clone(),
15138        }
15139    }
15140    ///
15141    /// # Arguments
15142    ///
15143    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15144    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
15145        let mut query = self.selection.select("terminal");
15146        if let Some(cmd) = opts.cmd {
15147            query = query.arg("cmd", cmd);
15148        }
15149        Service {
15150            proc: self.proc.clone(),
15151            selection: query,
15152            graphql_client: self.graphql_client.clone(),
15153        }
15154    }
15155    /// Creates a tunnel that forwards traffic from the caller's network to this service.
15156    ///
15157    /// # Arguments
15158    ///
15159    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15160    pub async fn up(&self) -> Result<Void, DaggerError> {
15161        let query = self.selection.select("up");
15162        query.execute(self.graphql_client.clone()).await
15163    }
15164    /// Creates a tunnel that forwards traffic from the caller's network to this service.
15165    ///
15166    /// # Arguments
15167    ///
15168    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15169    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
15170        let mut query = self.selection.select("up");
15171        if let Some(ports) = opts.ports {
15172            query = query.arg("ports", ports);
15173        }
15174        if let Some(random) = opts.random {
15175            query = query.arg("random", random);
15176        }
15177        query.execute(self.graphql_client.clone()).await
15178    }
15179    /// Configures a hostname which can be used by clients within the session to reach this container.
15180    ///
15181    /// # Arguments
15182    ///
15183    /// * `hostname` - The hostname to use.
15184    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
15185        let mut query = self.selection.select("withHostname");
15186        query = query.arg("hostname", hostname.into());
15187        Service {
15188            proc: self.proc.clone(),
15189            selection: query,
15190            graphql_client: self.graphql_client.clone(),
15191        }
15192    }
15193}
15194impl Node for Service {
15195    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15196        let query = self.selection.select("id");
15197        let graphql_client = self.graphql_client.clone();
15198        async move { query.execute(graphql_client).await }
15199    }
15200}
15201impl Syncer for Service {
15202    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15203        let query = self.selection.select("id");
15204        let graphql_client = self.graphql_client.clone();
15205        async move { query.execute(graphql_client).await }
15206    }
15207    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15208        let query = self.selection.select("sync");
15209        let graphql_client = self.graphql_client.clone();
15210        async move { query.execute(graphql_client).await }
15211    }
15212}
15213#[derive(Clone)]
15214pub struct Socket {
15215    pub proc: Option<Arc<DaggerSessionProc>>,
15216    pub selection: Selection,
15217    pub graphql_client: DynGraphQLClient,
15218}
15219impl IntoID<Id> for Socket {
15220    fn into_id(
15221        self,
15222    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15223        Box::pin(async move { self.id().await })
15224    }
15225}
15226impl Loadable for Socket {
15227    fn graphql_type() -> &'static str {
15228        "Socket"
15229    }
15230    fn from_query(
15231        proc: Option<Arc<DaggerSessionProc>>,
15232        selection: Selection,
15233        graphql_client: DynGraphQLClient,
15234    ) -> Self {
15235        Self {
15236            proc,
15237            selection,
15238            graphql_client,
15239        }
15240    }
15241}
15242impl Socket {
15243    /// A unique identifier for this Socket.
15244    pub async fn id(&self) -> Result<Id, DaggerError> {
15245        let query = self.selection.select("id");
15246        query.execute(self.graphql_client.clone()).await
15247    }
15248}
15249impl Node for Socket {
15250    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15251        let query = self.selection.select("id");
15252        let graphql_client = self.graphql_client.clone();
15253        async move { query.execute(graphql_client).await }
15254    }
15255}
15256#[derive(Clone)]
15257pub struct SourceMap {
15258    pub proc: Option<Arc<DaggerSessionProc>>,
15259    pub selection: Selection,
15260    pub graphql_client: DynGraphQLClient,
15261}
15262impl IntoID<Id> for SourceMap {
15263    fn into_id(
15264        self,
15265    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15266        Box::pin(async move { self.id().await })
15267    }
15268}
15269impl Loadable for SourceMap {
15270    fn graphql_type() -> &'static str {
15271        "SourceMap"
15272    }
15273    fn from_query(
15274        proc: Option<Arc<DaggerSessionProc>>,
15275        selection: Selection,
15276        graphql_client: DynGraphQLClient,
15277    ) -> Self {
15278        Self {
15279            proc,
15280            selection,
15281            graphql_client,
15282        }
15283    }
15284}
15285impl SourceMap {
15286    /// The column number within the line.
15287    pub async fn column(&self) -> Result<isize, DaggerError> {
15288        let query = self.selection.select("column");
15289        query.execute(self.graphql_client.clone()).await
15290    }
15291    /// The filename from the module source.
15292    pub async fn filename(&self) -> Result<String, DaggerError> {
15293        let query = self.selection.select("filename");
15294        query.execute(self.graphql_client.clone()).await
15295    }
15296    /// A unique identifier for this SourceMap.
15297    pub async fn id(&self) -> Result<Id, DaggerError> {
15298        let query = self.selection.select("id");
15299        query.execute(self.graphql_client.clone()).await
15300    }
15301    /// The line number within the filename.
15302    pub async fn line(&self) -> Result<isize, DaggerError> {
15303        let query = self.selection.select("line");
15304        query.execute(self.graphql_client.clone()).await
15305    }
15306    /// The module dependency this was declared in.
15307    pub async fn module(&self) -> Result<String, DaggerError> {
15308        let query = self.selection.select("module");
15309        query.execute(self.graphql_client.clone()).await
15310    }
15311    /// The URL to the file, if any. This can be used to link to the source map in the browser.
15312    pub async fn url(&self) -> Result<String, DaggerError> {
15313        let query = self.selection.select("url");
15314        query.execute(self.graphql_client.clone()).await
15315    }
15316}
15317impl Node for SourceMap {
15318    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15319        let query = self.selection.select("id");
15320        let graphql_client = self.graphql_client.clone();
15321        async move { query.execute(graphql_client).await }
15322    }
15323}
15324#[derive(Clone)]
15325pub struct Stat {
15326    pub proc: Option<Arc<DaggerSessionProc>>,
15327    pub selection: Selection,
15328    pub graphql_client: DynGraphQLClient,
15329}
15330impl IntoID<Id> for Stat {
15331    fn into_id(
15332        self,
15333    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15334        Box::pin(async move { self.id().await })
15335    }
15336}
15337impl Loadable for Stat {
15338    fn graphql_type() -> &'static str {
15339        "Stat"
15340    }
15341    fn from_query(
15342        proc: Option<Arc<DaggerSessionProc>>,
15343        selection: Selection,
15344        graphql_client: DynGraphQLClient,
15345    ) -> Self {
15346        Self {
15347            proc,
15348            selection,
15349            graphql_client,
15350        }
15351    }
15352}
15353impl Stat {
15354    /// file type
15355    pub async fn file_type(&self) -> Result<FileType, DaggerError> {
15356        let query = self.selection.select("fileType");
15357        query.execute(self.graphql_client.clone()).await
15358    }
15359    /// A unique identifier for this Stat.
15360    pub async fn id(&self) -> Result<Id, DaggerError> {
15361        let query = self.selection.select("id");
15362        query.execute(self.graphql_client.clone()).await
15363    }
15364    /// file name
15365    pub async fn name(&self) -> Result<String, DaggerError> {
15366        let query = self.selection.select("name");
15367        query.execute(self.graphql_client.clone()).await
15368    }
15369    /// permission bits
15370    pub async fn permissions(&self) -> Result<isize, DaggerError> {
15371        let query = self.selection.select("permissions");
15372        query.execute(self.graphql_client.clone()).await
15373    }
15374    /// file size
15375    pub async fn size(&self) -> Result<isize, DaggerError> {
15376        let query = self.selection.select("size");
15377        query.execute(self.graphql_client.clone()).await
15378    }
15379}
15380impl Node for Stat {
15381    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15382        let query = self.selection.select("id");
15383        let graphql_client = self.graphql_client.clone();
15384        async move { query.execute(graphql_client).await }
15385    }
15386}
15387#[derive(Clone)]
15388pub struct Terminal {
15389    pub proc: Option<Arc<DaggerSessionProc>>,
15390    pub selection: Selection,
15391    pub graphql_client: DynGraphQLClient,
15392}
15393impl IntoID<Id> for Terminal {
15394    fn into_id(
15395        self,
15396    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15397        Box::pin(async move { self.id().await })
15398    }
15399}
15400impl Loadable for Terminal {
15401    fn graphql_type() -> &'static str {
15402        "Terminal"
15403    }
15404    fn from_query(
15405        proc: Option<Arc<DaggerSessionProc>>,
15406        selection: Selection,
15407        graphql_client: DynGraphQLClient,
15408    ) -> Self {
15409        Self {
15410            proc,
15411            selection,
15412            graphql_client,
15413        }
15414    }
15415}
15416impl Terminal {
15417    /// A unique identifier for this Terminal.
15418    pub async fn id(&self) -> Result<Id, DaggerError> {
15419        let query = self.selection.select("id");
15420        query.execute(self.graphql_client.clone()).await
15421    }
15422    /// Forces evaluation of the pipeline in the engine.
15423    /// It doesn't run the default command if no exec has been set.
15424    pub async fn sync(&self) -> Result<Terminal, DaggerError> {
15425        let query = self.selection.select("sync");
15426        let id: Id = query.execute(self.graphql_client.clone()).await?;
15427        Ok(Terminal {
15428            proc: self.proc.clone(),
15429            selection: query
15430                .root()
15431                .select("node")
15432                .arg("id", &id.0)
15433                .inline_fragment("Terminal"),
15434            graphql_client: self.graphql_client.clone(),
15435        })
15436    }
15437}
15438impl Node for Terminal {
15439    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15440        let query = self.selection.select("id");
15441        let graphql_client = self.graphql_client.clone();
15442        async move { query.execute(graphql_client).await }
15443    }
15444}
15445impl Syncer for Terminal {
15446    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15447        let query = self.selection.select("id");
15448        let graphql_client = self.graphql_client.clone();
15449        async move { query.execute(graphql_client).await }
15450    }
15451    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15452        let query = self.selection.select("sync");
15453        let graphql_client = self.graphql_client.clone();
15454        async move { query.execute(graphql_client).await }
15455    }
15456}
15457#[derive(Clone)]
15458pub struct TypeDef {
15459    pub proc: Option<Arc<DaggerSessionProc>>,
15460    pub selection: Selection,
15461    pub graphql_client: DynGraphQLClient,
15462}
15463#[derive(Builder, Debug, PartialEq)]
15464pub struct TypeDefWithEnumOpts<'a> {
15465    /// A doc string for the enum, if any
15466    #[builder(setter(into, strip_option), default)]
15467    pub description: Option<&'a str>,
15468    /// The source map for the enum definition.
15469    #[builder(setter(into, strip_option), default)]
15470    pub source_map: Option<Id>,
15471}
15472#[derive(Builder, Debug, PartialEq)]
15473pub struct TypeDefWithEnumMemberOpts<'a> {
15474    /// If deprecated, the reason or migration path.
15475    #[builder(setter(into, strip_option), default)]
15476    pub deprecated: Option<&'a str>,
15477    /// A doc string for the member, if any
15478    #[builder(setter(into, strip_option), default)]
15479    pub description: Option<&'a str>,
15480    /// The source map for the enum member definition.
15481    #[builder(setter(into, strip_option), default)]
15482    pub source_map: Option<Id>,
15483    /// The value of the member in the enum
15484    #[builder(setter(into, strip_option), default)]
15485    pub value: Option<&'a str>,
15486}
15487#[derive(Builder, Debug, PartialEq)]
15488pub struct TypeDefWithEnumValueOpts<'a> {
15489    /// If deprecated, the reason or migration path.
15490    #[builder(setter(into, strip_option), default)]
15491    pub deprecated: Option<&'a str>,
15492    /// A doc string for the value, if any
15493    #[builder(setter(into, strip_option), default)]
15494    pub description: Option<&'a str>,
15495    /// The source map for the enum value definition.
15496    #[builder(setter(into, strip_option), default)]
15497    pub source_map: Option<Id>,
15498}
15499#[derive(Builder, Debug, PartialEq)]
15500pub struct TypeDefWithFieldOpts<'a> {
15501    /// If deprecated, the reason or migration path.
15502    #[builder(setter(into, strip_option), default)]
15503    pub deprecated: Option<&'a str>,
15504    /// A doc string for the field, if any
15505    #[builder(setter(into, strip_option), default)]
15506    pub description: Option<&'a str>,
15507    /// The source map for the field definition.
15508    #[builder(setter(into, strip_option), default)]
15509    pub source_map: Option<Id>,
15510}
15511#[derive(Builder, Debug, PartialEq)]
15512pub struct TypeDefWithInterfaceOpts<'a> {
15513    #[builder(setter(into, strip_option), default)]
15514    pub description: Option<&'a str>,
15515    #[builder(setter(into, strip_option), default)]
15516    pub source_map: Option<Id>,
15517}
15518#[derive(Builder, Debug, PartialEq)]
15519pub struct TypeDefWithObjectOpts<'a> {
15520    #[builder(setter(into, strip_option), default)]
15521    pub deprecated: Option<&'a str>,
15522    #[builder(setter(into, strip_option), default)]
15523    pub description: Option<&'a str>,
15524    #[builder(setter(into, strip_option), default)]
15525    pub source_map: Option<Id>,
15526}
15527#[derive(Builder, Debug, PartialEq)]
15528pub struct TypeDefWithScalarOpts<'a> {
15529    #[builder(setter(into, strip_option), default)]
15530    pub description: Option<&'a str>,
15531}
15532impl IntoID<Id> for TypeDef {
15533    fn into_id(
15534        self,
15535    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15536        Box::pin(async move { self.id().await })
15537    }
15538}
15539impl Loadable for TypeDef {
15540    fn graphql_type() -> &'static str {
15541        "TypeDef"
15542    }
15543    fn from_query(
15544        proc: Option<Arc<DaggerSessionProc>>,
15545        selection: Selection,
15546        graphql_client: DynGraphQLClient,
15547    ) -> Self {
15548        Self {
15549            proc,
15550            selection,
15551            graphql_client,
15552        }
15553    }
15554}
15555impl TypeDef {
15556    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
15557    pub fn as_enum(&self) -> EnumTypeDef {
15558        let query = self.selection.select("asEnum");
15559        EnumTypeDef {
15560            proc: self.proc.clone(),
15561            selection: query,
15562            graphql_client: self.graphql_client.clone(),
15563        }
15564    }
15565    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
15566    pub fn as_input(&self) -> InputTypeDef {
15567        let query = self.selection.select("asInput");
15568        InputTypeDef {
15569            proc: self.proc.clone(),
15570            selection: query,
15571            graphql_client: self.graphql_client.clone(),
15572        }
15573    }
15574    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
15575    pub fn as_interface(&self) -> InterfaceTypeDef {
15576        let query = self.selection.select("asInterface");
15577        InterfaceTypeDef {
15578            proc: self.proc.clone(),
15579            selection: query,
15580            graphql_client: self.graphql_client.clone(),
15581        }
15582    }
15583    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
15584    pub fn as_list(&self) -> ListTypeDef {
15585        let query = self.selection.select("asList");
15586        ListTypeDef {
15587            proc: self.proc.clone(),
15588            selection: query,
15589            graphql_client: self.graphql_client.clone(),
15590        }
15591    }
15592    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
15593    pub fn as_object(&self) -> ObjectTypeDef {
15594        let query = self.selection.select("asObject");
15595        ObjectTypeDef {
15596            proc: self.proc.clone(),
15597            selection: query,
15598            graphql_client: self.graphql_client.clone(),
15599        }
15600    }
15601    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
15602    pub fn as_scalar(&self) -> ScalarTypeDef {
15603        let query = self.selection.select("asScalar");
15604        ScalarTypeDef {
15605            proc: self.proc.clone(),
15606            selection: query,
15607            graphql_client: self.graphql_client.clone(),
15608        }
15609    }
15610    /// A unique identifier for this TypeDef.
15611    pub async fn id(&self) -> Result<Id, DaggerError> {
15612        let query = self.selection.select("id");
15613        query.execute(self.graphql_client.clone()).await
15614    }
15615    /// The kind of type this is (e.g. primitive, list, object).
15616    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
15617        let query = self.selection.select("kind");
15618        query.execute(self.graphql_client.clone()).await
15619    }
15620    /// The canonical non-optional name of the type.
15621    pub async fn name(&self) -> Result<String, DaggerError> {
15622        let query = self.selection.select("name");
15623        query.execute(self.graphql_client.clone()).await
15624    }
15625    /// Whether this type can be set to null. Defaults to false.
15626    pub async fn optional(&self) -> Result<bool, DaggerError> {
15627        let query = self.selection.select("optional");
15628        query.execute(self.graphql_client.clone()).await
15629    }
15630    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
15631    pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
15632        let mut query = self.selection.select("withConstructor");
15633        query = query.arg_lazy(
15634            "function",
15635            Box::new(move || {
15636                let function = function.clone();
15637                Box::pin(async move { function.into_id().await.unwrap().quote() })
15638            }),
15639        );
15640        TypeDef {
15641            proc: self.proc.clone(),
15642            selection: query,
15643            graphql_client: self.graphql_client.clone(),
15644        }
15645    }
15646    /// Returns a TypeDef of kind Enum with the provided name.
15647    /// 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.
15648    ///
15649    /// # Arguments
15650    ///
15651    /// * `name` - The name of the enum
15652    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15653    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
15654        let mut query = self.selection.select("withEnum");
15655        query = query.arg("name", name.into());
15656        TypeDef {
15657            proc: self.proc.clone(),
15658            selection: query,
15659            graphql_client: self.graphql_client.clone(),
15660        }
15661    }
15662    /// Returns a TypeDef of kind Enum with the provided name.
15663    /// 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.
15664    ///
15665    /// # Arguments
15666    ///
15667    /// * `name` - The name of the enum
15668    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15669    pub fn with_enum_opts<'a>(
15670        &self,
15671        name: impl Into<String>,
15672        opts: TypeDefWithEnumOpts<'a>,
15673    ) -> TypeDef {
15674        let mut query = self.selection.select("withEnum");
15675        query = query.arg("name", name.into());
15676        if let Some(description) = opts.description {
15677            query = query.arg("description", description);
15678        }
15679        if let Some(source_map) = opts.source_map {
15680            query = query.arg("sourceMap", source_map);
15681        }
15682        TypeDef {
15683            proc: self.proc.clone(),
15684            selection: query,
15685            graphql_client: self.graphql_client.clone(),
15686        }
15687    }
15688    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15689    ///
15690    /// # Arguments
15691    ///
15692    /// * `name` - The name of the member in the enum
15693    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15694    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
15695        let mut query = self.selection.select("withEnumMember");
15696        query = query.arg("name", name.into());
15697        TypeDef {
15698            proc: self.proc.clone(),
15699            selection: query,
15700            graphql_client: self.graphql_client.clone(),
15701        }
15702    }
15703    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15704    ///
15705    /// # Arguments
15706    ///
15707    /// * `name` - The name of the member in the enum
15708    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15709    pub fn with_enum_member_opts<'a>(
15710        &self,
15711        name: impl Into<String>,
15712        opts: TypeDefWithEnumMemberOpts<'a>,
15713    ) -> TypeDef {
15714        let mut query = self.selection.select("withEnumMember");
15715        query = query.arg("name", name.into());
15716        if let Some(value) = opts.value {
15717            query = query.arg("value", value);
15718        }
15719        if let Some(description) = opts.description {
15720            query = query.arg("description", description);
15721        }
15722        if let Some(source_map) = opts.source_map {
15723            query = query.arg("sourceMap", source_map);
15724        }
15725        if let Some(deprecated) = opts.deprecated {
15726            query = query.arg("deprecated", deprecated);
15727        }
15728        TypeDef {
15729            proc: self.proc.clone(),
15730            selection: query,
15731            graphql_client: self.graphql_client.clone(),
15732        }
15733    }
15734    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15735    ///
15736    /// # Arguments
15737    ///
15738    /// * `value` - The name of the value in the enum
15739    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15740    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
15741        let mut query = self.selection.select("withEnumValue");
15742        query = query.arg("value", value.into());
15743        TypeDef {
15744            proc: self.proc.clone(),
15745            selection: query,
15746            graphql_client: self.graphql_client.clone(),
15747        }
15748    }
15749    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15750    ///
15751    /// # Arguments
15752    ///
15753    /// * `value` - The name of the value in the enum
15754    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15755    pub fn with_enum_value_opts<'a>(
15756        &self,
15757        value: impl Into<String>,
15758        opts: TypeDefWithEnumValueOpts<'a>,
15759    ) -> TypeDef {
15760        let mut query = self.selection.select("withEnumValue");
15761        query = query.arg("value", value.into());
15762        if let Some(description) = opts.description {
15763            query = query.arg("description", description);
15764        }
15765        if let Some(source_map) = opts.source_map {
15766            query = query.arg("sourceMap", source_map);
15767        }
15768        if let Some(deprecated) = opts.deprecated {
15769            query = query.arg("deprecated", deprecated);
15770        }
15771        TypeDef {
15772            proc: self.proc.clone(),
15773            selection: query,
15774            graphql_client: self.graphql_client.clone(),
15775        }
15776    }
15777    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
15778    ///
15779    /// # Arguments
15780    ///
15781    /// * `name` - The name of the field in the object
15782    /// * `type_def` - The type of the field
15783    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15784    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
15785        let mut query = self.selection.select("withField");
15786        query = query.arg("name", name.into());
15787        query = query.arg_lazy(
15788            "typeDef",
15789            Box::new(move || {
15790                let type_def = type_def.clone();
15791                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15792            }),
15793        );
15794        TypeDef {
15795            proc: self.proc.clone(),
15796            selection: query,
15797            graphql_client: self.graphql_client.clone(),
15798        }
15799    }
15800    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
15801    ///
15802    /// # Arguments
15803    ///
15804    /// * `name` - The name of the field in the object
15805    /// * `type_def` - The type of the field
15806    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15807    pub fn with_field_opts<'a>(
15808        &self,
15809        name: impl Into<String>,
15810        type_def: impl IntoID<Id>,
15811        opts: TypeDefWithFieldOpts<'a>,
15812    ) -> TypeDef {
15813        let mut query = self.selection.select("withField");
15814        query = query.arg("name", name.into());
15815        query = query.arg_lazy(
15816            "typeDef",
15817            Box::new(move || {
15818                let type_def = type_def.clone();
15819                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15820            }),
15821        );
15822        if let Some(description) = opts.description {
15823            query = query.arg("description", description);
15824        }
15825        if let Some(source_map) = opts.source_map {
15826            query = query.arg("sourceMap", source_map);
15827        }
15828        if let Some(deprecated) = opts.deprecated {
15829            query = query.arg("deprecated", deprecated);
15830        }
15831        TypeDef {
15832            proc: self.proc.clone(),
15833            selection: query,
15834            graphql_client: self.graphql_client.clone(),
15835        }
15836    }
15837    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
15838    pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
15839        let mut query = self.selection.select("withFunction");
15840        query = query.arg_lazy(
15841            "function",
15842            Box::new(move || {
15843                let function = function.clone();
15844                Box::pin(async move { function.into_id().await.unwrap().quote() })
15845            }),
15846        );
15847        TypeDef {
15848            proc: self.proc.clone(),
15849            selection: query,
15850            graphql_client: self.graphql_client.clone(),
15851        }
15852    }
15853    /// Returns a TypeDef of kind Interface with the provided name.
15854    ///
15855    /// # Arguments
15856    ///
15857    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15858    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
15859        let mut query = self.selection.select("withInterface");
15860        query = query.arg("name", name.into());
15861        TypeDef {
15862            proc: self.proc.clone(),
15863            selection: query,
15864            graphql_client: self.graphql_client.clone(),
15865        }
15866    }
15867    /// Returns a TypeDef of kind Interface with the provided name.
15868    ///
15869    /// # Arguments
15870    ///
15871    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15872    pub fn with_interface_opts<'a>(
15873        &self,
15874        name: impl Into<String>,
15875        opts: TypeDefWithInterfaceOpts<'a>,
15876    ) -> TypeDef {
15877        let mut query = self.selection.select("withInterface");
15878        query = query.arg("name", name.into());
15879        if let Some(description) = opts.description {
15880            query = query.arg("description", description);
15881        }
15882        if let Some(source_map) = opts.source_map {
15883            query = query.arg("sourceMap", source_map);
15884        }
15885        TypeDef {
15886            proc: self.proc.clone(),
15887            selection: query,
15888            graphql_client: self.graphql_client.clone(),
15889        }
15890    }
15891    /// Sets the kind of the type.
15892    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
15893        let mut query = self.selection.select("withKind");
15894        query = query.arg("kind", kind);
15895        TypeDef {
15896            proc: self.proc.clone(),
15897            selection: query,
15898            graphql_client: self.graphql_client.clone(),
15899        }
15900    }
15901    /// Returns a TypeDef of kind List with the provided type for its elements.
15902    pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
15903        let mut query = self.selection.select("withListOf");
15904        query = query.arg_lazy(
15905            "elementType",
15906            Box::new(move || {
15907                let element_type = element_type.clone();
15908                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
15909            }),
15910        );
15911        TypeDef {
15912            proc: self.proc.clone(),
15913            selection: query,
15914            graphql_client: self.graphql_client.clone(),
15915        }
15916    }
15917    /// Returns a TypeDef of kind Object with the provided name.
15918    /// 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.
15919    ///
15920    /// # Arguments
15921    ///
15922    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15923    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
15924        let mut query = self.selection.select("withObject");
15925        query = query.arg("name", name.into());
15926        TypeDef {
15927            proc: self.proc.clone(),
15928            selection: query,
15929            graphql_client: self.graphql_client.clone(),
15930        }
15931    }
15932    /// Returns a TypeDef of kind Object with the provided name.
15933    /// 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.
15934    ///
15935    /// # Arguments
15936    ///
15937    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15938    pub fn with_object_opts<'a>(
15939        &self,
15940        name: impl Into<String>,
15941        opts: TypeDefWithObjectOpts<'a>,
15942    ) -> TypeDef {
15943        let mut query = self.selection.select("withObject");
15944        query = query.arg("name", name.into());
15945        if let Some(description) = opts.description {
15946            query = query.arg("description", description);
15947        }
15948        if let Some(source_map) = opts.source_map {
15949            query = query.arg("sourceMap", source_map);
15950        }
15951        if let Some(deprecated) = opts.deprecated {
15952            query = query.arg("deprecated", deprecated);
15953        }
15954        TypeDef {
15955            proc: self.proc.clone(),
15956            selection: query,
15957            graphql_client: self.graphql_client.clone(),
15958        }
15959    }
15960    /// Sets whether this type can be set to null.
15961    pub fn with_optional(&self, optional: bool) -> TypeDef {
15962        let mut query = self.selection.select("withOptional");
15963        query = query.arg("optional", optional);
15964        TypeDef {
15965            proc: self.proc.clone(),
15966            selection: query,
15967            graphql_client: self.graphql_client.clone(),
15968        }
15969    }
15970    /// Returns a TypeDef of kind Scalar with the provided name.
15971    ///
15972    /// # Arguments
15973    ///
15974    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15975    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
15976        let mut query = self.selection.select("withScalar");
15977        query = query.arg("name", name.into());
15978        TypeDef {
15979            proc: self.proc.clone(),
15980            selection: query,
15981            graphql_client: self.graphql_client.clone(),
15982        }
15983    }
15984    /// Returns a TypeDef of kind Scalar with the provided name.
15985    ///
15986    /// # Arguments
15987    ///
15988    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15989    pub fn with_scalar_opts<'a>(
15990        &self,
15991        name: impl Into<String>,
15992        opts: TypeDefWithScalarOpts<'a>,
15993    ) -> TypeDef {
15994        let mut query = self.selection.select("withScalar");
15995        query = query.arg("name", name.into());
15996        if let Some(description) = opts.description {
15997            query = query.arg("description", description);
15998        }
15999        TypeDef {
16000            proc: self.proc.clone(),
16001            selection: query,
16002            graphql_client: self.graphql_client.clone(),
16003        }
16004    }
16005}
16006impl Node for TypeDef {
16007    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16008        let query = self.selection.select("id");
16009        let graphql_client = self.graphql_client.clone();
16010        async move { query.execute(graphql_client).await }
16011    }
16012}
16013#[derive(Clone)]
16014pub struct Up {
16015    pub proc: Option<Arc<DaggerSessionProc>>,
16016    pub selection: Selection,
16017    pub graphql_client: DynGraphQLClient,
16018}
16019impl IntoID<Id> for Up {
16020    fn into_id(
16021        self,
16022    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16023        Box::pin(async move { self.id().await })
16024    }
16025}
16026impl Loadable for Up {
16027    fn graphql_type() -> &'static str {
16028        "Up"
16029    }
16030    fn from_query(
16031        proc: Option<Arc<DaggerSessionProc>>,
16032        selection: Selection,
16033        graphql_client: DynGraphQLClient,
16034    ) -> Self {
16035        Self {
16036            proc,
16037            selection,
16038            graphql_client,
16039        }
16040    }
16041}
16042impl Up {
16043    /// The description of the service
16044    pub async fn description(&self) -> Result<String, DaggerError> {
16045        let query = self.selection.select("description");
16046        query.execute(self.graphql_client.clone()).await
16047    }
16048    /// A unique identifier for this Up.
16049    pub async fn id(&self) -> Result<Id, DaggerError> {
16050        let query = self.selection.select("id");
16051        query.execute(self.graphql_client.clone()).await
16052    }
16053    /// Return the fully qualified name of the service
16054    pub async fn name(&self) -> Result<String, DaggerError> {
16055        let query = self.selection.select("name");
16056        query.execute(self.graphql_client.clone()).await
16057    }
16058    /// The original module in which the service has been defined
16059    pub fn original_module(&self) -> Module {
16060        let query = self.selection.select("originalModule");
16061        Module {
16062            proc: self.proc.clone(),
16063            selection: query,
16064            graphql_client: self.graphql_client.clone(),
16065        }
16066    }
16067    /// The path of the service within its module
16068    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
16069        let query = self.selection.select("path");
16070        query.execute(self.graphql_client.clone()).await
16071    }
16072    /// Execute the service function
16073    pub fn run(&self) -> Up {
16074        let query = self.selection.select("run");
16075        Up {
16076            proc: self.proc.clone(),
16077            selection: query,
16078            graphql_client: self.graphql_client.clone(),
16079        }
16080    }
16081}
16082impl Node for Up {
16083    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16084        let query = self.selection.select("id");
16085        let graphql_client = self.graphql_client.clone();
16086        async move { query.execute(graphql_client).await }
16087    }
16088}
16089#[derive(Clone)]
16090pub struct UpGroup {
16091    pub proc: Option<Arc<DaggerSessionProc>>,
16092    pub selection: Selection,
16093    pub graphql_client: DynGraphQLClient,
16094}
16095impl IntoID<Id> for UpGroup {
16096    fn into_id(
16097        self,
16098    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16099        Box::pin(async move { self.id().await })
16100    }
16101}
16102impl Loadable for UpGroup {
16103    fn graphql_type() -> &'static str {
16104        "UpGroup"
16105    }
16106    fn from_query(
16107        proc: Option<Arc<DaggerSessionProc>>,
16108        selection: Selection,
16109        graphql_client: DynGraphQLClient,
16110    ) -> Self {
16111        Self {
16112            proc,
16113            selection,
16114            graphql_client,
16115        }
16116    }
16117}
16118impl UpGroup {
16119    /// A unique identifier for this UpGroup.
16120    pub async fn id(&self) -> Result<Id, DaggerError> {
16121        let query = self.selection.select("id");
16122        query.execute(self.graphql_client.clone()).await
16123    }
16124    /// Return a list of individual services and their details
16125    pub async fn list(&self) -> Result<Vec<Up>, DaggerError> {
16126        let query = self.selection.select("list");
16127        let query = query.select("id");
16128        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16129        Ok(ids
16130            .into_iter()
16131            .map(|id| Up {
16132                proc: self.proc.clone(),
16133                selection: crate::querybuilder::query()
16134                    .select("node")
16135                    .arg("id", &id.0)
16136                    .inline_fragment("Up"),
16137                graphql_client: self.graphql_client.clone(),
16138            })
16139            .collect())
16140    }
16141    /// Execute all selected service functions
16142    pub fn run(&self) -> UpGroup {
16143        let query = self.selection.select("run");
16144        UpGroup {
16145            proc: self.proc.clone(),
16146            selection: query,
16147            graphql_client: self.graphql_client.clone(),
16148        }
16149    }
16150}
16151impl Node for UpGroup {
16152    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16153        let query = self.selection.select("id");
16154        let graphql_client = self.graphql_client.clone();
16155        async move { query.execute(graphql_client).await }
16156    }
16157}
16158#[derive(Clone)]
16159pub struct Workspace {
16160    pub proc: Option<Arc<DaggerSessionProc>>,
16161    pub selection: Selection,
16162    pub graphql_client: DynGraphQLClient,
16163}
16164#[derive(Builder, Debug, PartialEq)]
16165pub struct WorkspaceChecksOpts<'a> {
16166    /// Only include checks matching the specified patterns
16167    #[builder(setter(into, strip_option), default)]
16168    pub include: Option<Vec<&'a str>>,
16169    /// When true, only return annotated check functions; exclude generate-as-checks
16170    #[builder(setter(into, strip_option), default)]
16171    pub no_generate: Option<bool>,
16172}
16173#[derive(Builder, Debug, PartialEq)]
16174pub struct WorkspaceDirectoryOpts<'a> {
16175    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
16176    #[builder(setter(into, strip_option), default)]
16177    pub exclude: Option<Vec<&'a str>>,
16178    /// Apply .gitignore filter rules inside the directory.
16179    #[builder(setter(into, strip_option), default)]
16180    pub gitignore: Option<bool>,
16181    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
16182    #[builder(setter(into, strip_option), default)]
16183    pub include: Option<Vec<&'a str>>,
16184}
16185#[derive(Builder, Debug, PartialEq)]
16186pub struct WorkspaceFindUpOpts<'a> {
16187    /// Path to start the search from. Relative paths resolve from the workspace directory; absolute paths resolve from the workspace boundary.
16188    #[builder(setter(into, strip_option), default)]
16189    pub from: Option<&'a str>,
16190}
16191#[derive(Builder, Debug, PartialEq)]
16192pub struct WorkspaceGeneratorsOpts<'a> {
16193    /// Only include generators matching the specified patterns
16194    #[builder(setter(into, strip_option), default)]
16195    pub include: Option<Vec<&'a str>>,
16196}
16197#[derive(Builder, Debug, PartialEq)]
16198pub struct WorkspaceServicesOpts<'a> {
16199    /// Only include services matching the specified patterns
16200    #[builder(setter(into, strip_option), default)]
16201    pub include: Option<Vec<&'a str>>,
16202}
16203impl IntoID<Id> for Workspace {
16204    fn into_id(
16205        self,
16206    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16207        Box::pin(async move { self.id().await })
16208    }
16209}
16210impl Loadable for Workspace {
16211    fn graphql_type() -> &'static str {
16212        "Workspace"
16213    }
16214    fn from_query(
16215        proc: Option<Arc<DaggerSessionProc>>,
16216        selection: Selection,
16217        graphql_client: DynGraphQLClient,
16218    ) -> Self {
16219        Self {
16220            proc,
16221            selection,
16222            graphql_client,
16223        }
16224    }
16225}
16226impl Workspace {
16227    /// Canonical Dagger address of the workspace directory.
16228    pub async fn address(&self) -> Result<String, DaggerError> {
16229        let query = self.selection.select("address");
16230        query.execute(self.graphql_client.clone()).await
16231    }
16232    /// Return all checks from modules loaded in the workspace.
16233    ///
16234    /// # Arguments
16235    ///
16236    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16237    pub fn checks(&self) -> CheckGroup {
16238        let query = self.selection.select("checks");
16239        CheckGroup {
16240            proc: self.proc.clone(),
16241            selection: query,
16242            graphql_client: self.graphql_client.clone(),
16243        }
16244    }
16245    /// Return all checks from modules loaded in the workspace.
16246    ///
16247    /// # Arguments
16248    ///
16249    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16250    pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
16251        let mut query = self.selection.select("checks");
16252        if let Some(include) = opts.include {
16253            query = query.arg("include", include);
16254        }
16255        if let Some(no_generate) = opts.no_generate {
16256            query = query.arg("noGenerate", no_generate);
16257        }
16258        CheckGroup {
16259            proc: self.proc.clone(),
16260            selection: query,
16261            graphql_client: self.graphql_client.clone(),
16262        }
16263    }
16264    /// The client ID that owns this workspace's host filesystem.
16265    pub async fn client_id(&self) -> Result<String, DaggerError> {
16266        let query = self.selection.select("clientId");
16267        query.execute(self.graphql_client.clone()).await
16268    }
16269    /// Path to config.toml relative to the workspace boundary (empty if not initialized).
16270    pub async fn config_path(&self) -> Result<String, DaggerError> {
16271        let query = self.selection.select("configPath");
16272        query.execute(self.graphql_client.clone()).await
16273    }
16274    /// Returns a Directory from the workspace.
16275    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
16276    ///
16277    /// # Arguments
16278    ///
16279    /// * `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.
16280    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16281    pub fn directory(&self, path: impl Into<String>) -> Directory {
16282        let mut query = self.selection.select("directory");
16283        query = query.arg("path", path.into());
16284        Directory {
16285            proc: self.proc.clone(),
16286            selection: query,
16287            graphql_client: self.graphql_client.clone(),
16288        }
16289    }
16290    /// Returns a Directory from the workspace.
16291    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
16292    ///
16293    /// # Arguments
16294    ///
16295    /// * `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.
16296    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16297    pub fn directory_opts<'a>(
16298        &self,
16299        path: impl Into<String>,
16300        opts: WorkspaceDirectoryOpts<'a>,
16301    ) -> Directory {
16302        let mut query = self.selection.select("directory");
16303        query = query.arg("path", path.into());
16304        if let Some(exclude) = opts.exclude {
16305            query = query.arg("exclude", exclude);
16306        }
16307        if let Some(include) = opts.include {
16308            query = query.arg("include", include);
16309        }
16310        if let Some(gitignore) = opts.gitignore {
16311            query = query.arg("gitignore", gitignore);
16312        }
16313        Directory {
16314            proc: self.proc.clone(),
16315            selection: query,
16316            graphql_client: self.graphql_client.clone(),
16317        }
16318    }
16319    /// Returns a File from the workspace.
16320    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
16321    ///
16322    /// # Arguments
16323    ///
16324    /// * `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.
16325    pub fn file(&self, path: impl Into<String>) -> File {
16326        let mut query = self.selection.select("file");
16327        query = query.arg("path", path.into());
16328        File {
16329            proc: self.proc.clone(),
16330            selection: query,
16331            graphql_client: self.graphql_client.clone(),
16332        }
16333    }
16334    /// Search for a file or directory by walking up from the start path within the workspace.
16335    /// Returns the absolute workspace path if found, or null if not found.
16336    /// Relative start paths resolve from the workspace directory.
16337    /// The search stops at the workspace boundary and will not traverse above it.
16338    ///
16339    /// # Arguments
16340    ///
16341    /// * `name` - The name of the file or directory to search for.
16342    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16343    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
16344        let mut query = self.selection.select("findUp");
16345        query = query.arg("name", name.into());
16346        query.execute(self.graphql_client.clone()).await
16347    }
16348    /// Search for a file or directory by walking up from the start path within the workspace.
16349    /// Returns the absolute workspace path if found, or null if not found.
16350    /// Relative start paths resolve from the workspace directory.
16351    /// The search stops at the workspace boundary and will not traverse above it.
16352    ///
16353    /// # Arguments
16354    ///
16355    /// * `name` - The name of the file or directory to search for.
16356    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16357    pub async fn find_up_opts<'a>(
16358        &self,
16359        name: impl Into<String>,
16360        opts: WorkspaceFindUpOpts<'a>,
16361    ) -> Result<String, DaggerError> {
16362        let mut query = self.selection.select("findUp");
16363        query = query.arg("name", name.into());
16364        if let Some(from) = opts.from {
16365            query = query.arg("from", from);
16366        }
16367        query.execute(self.graphql_client.clone()).await
16368    }
16369    /// Return all generators from modules loaded in the workspace.
16370    ///
16371    /// # Arguments
16372    ///
16373    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16374    pub fn generators(&self) -> GeneratorGroup {
16375        let query = self.selection.select("generators");
16376        GeneratorGroup {
16377            proc: self.proc.clone(),
16378            selection: query,
16379            graphql_client: self.graphql_client.clone(),
16380        }
16381    }
16382    /// Return all generators from modules loaded in the workspace.
16383    ///
16384    /// # Arguments
16385    ///
16386    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16387    pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
16388        let mut query = self.selection.select("generators");
16389        if let Some(include) = opts.include {
16390            query = query.arg("include", include);
16391        }
16392        GeneratorGroup {
16393            proc: self.proc.clone(),
16394            selection: query,
16395            graphql_client: self.graphql_client.clone(),
16396        }
16397    }
16398    /// Whether a config.toml file exists in the workspace.
16399    pub async fn has_config(&self) -> Result<bool, DaggerError> {
16400        let query = self.selection.select("hasConfig");
16401        query.execute(self.graphql_client.clone()).await
16402    }
16403    /// A unique identifier for this Workspace.
16404    pub async fn id(&self) -> Result<Id, DaggerError> {
16405        let query = self.selection.select("id");
16406        query.execute(self.graphql_client.clone()).await
16407    }
16408    /// Whether .dagger/config.toml exists.
16409    pub async fn initialized(&self) -> Result<bool, DaggerError> {
16410        let query = self.selection.select("initialized");
16411        query.execute(self.graphql_client.clone()).await
16412    }
16413    /// Workspace directory path relative to the workspace boundary.
16414    pub async fn path(&self) -> Result<String, DaggerError> {
16415        let query = self.selection.select("path");
16416        query.execute(self.graphql_client.clone()).await
16417    }
16418    /// Return all services from modules loaded in the workspace.
16419    ///
16420    /// # Arguments
16421    ///
16422    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16423    pub fn services(&self) -> UpGroup {
16424        let query = self.selection.select("services");
16425        UpGroup {
16426            proc: self.proc.clone(),
16427            selection: query,
16428            graphql_client: self.graphql_client.clone(),
16429        }
16430    }
16431    /// Return all services from modules loaded in the workspace.
16432    ///
16433    /// # Arguments
16434    ///
16435    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16436    pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
16437        let mut query = self.selection.select("services");
16438        if let Some(include) = opts.include {
16439            query = query.arg("include", include);
16440        }
16441        UpGroup {
16442            proc: self.proc.clone(),
16443            selection: query,
16444            graphql_client: self.graphql_client.clone(),
16445        }
16446    }
16447    /// Refresh workspace-managed state and return the resulting changeset.
16448    /// Currently this refreshes existing lockfile entries only.
16449    pub fn update(&self) -> Changeset {
16450        let query = self.selection.select("update");
16451        Changeset {
16452            proc: self.proc.clone(),
16453            selection: query,
16454            graphql_client: self.graphql_client.clone(),
16455        }
16456    }
16457}
16458impl Node for Workspace {
16459    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16460        let query = self.selection.select("id");
16461        let graphql_client = self.graphql_client.clone();
16462        async move { query.execute(graphql_client).await }
16463    }
16464}
16465#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16466pub enum CacheSharingMode {
16467    #[serde(rename = "LOCKED")]
16468    Locked,
16469    #[serde(rename = "PRIVATE")]
16470    Private,
16471    #[serde(rename = "SHARED")]
16472    Shared,
16473}
16474#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16475pub enum ChangesetMergeConflict {
16476    #[serde(rename = "FAIL")]
16477    Fail,
16478    #[serde(rename = "FAIL_EARLY")]
16479    FailEarly,
16480    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
16481    LeaveConflictMarkers,
16482    #[serde(rename = "PREFER_OURS")]
16483    PreferOurs,
16484    #[serde(rename = "PREFER_THEIRS")]
16485    PreferTheirs,
16486}
16487#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16488pub enum ChangesetsMergeConflict {
16489    #[serde(rename = "FAIL")]
16490    Fail,
16491    #[serde(rename = "FAIL_EARLY")]
16492    FailEarly,
16493}
16494#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16495pub enum DiffStatKind {
16496    #[serde(rename = "ADDED")]
16497    Added,
16498    #[serde(rename = "MODIFIED")]
16499    Modified,
16500    #[serde(rename = "REMOVED")]
16501    Removed,
16502    #[serde(rename = "RENAMED")]
16503    Renamed,
16504}
16505#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16506pub enum ExistsType {
16507    #[serde(rename = "DIRECTORY_TYPE")]
16508    DirectoryType,
16509    #[serde(rename = "REGULAR_TYPE")]
16510    RegularType,
16511    #[serde(rename = "SYMLINK_TYPE")]
16512    SymlinkType,
16513}
16514#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16515pub enum FileType {
16516    #[serde(rename = "DIRECTORY")]
16517    Directory,
16518    #[serde(rename = "DIRECTORY_TYPE")]
16519    DirectoryType,
16520    #[serde(rename = "REGULAR")]
16521    Regular,
16522    #[serde(rename = "REGULAR_TYPE")]
16523    RegularType,
16524    #[serde(rename = "SYMLINK")]
16525    Symlink,
16526    #[serde(rename = "SYMLINK_TYPE")]
16527    SymlinkType,
16528    #[serde(rename = "UNKNOWN")]
16529    Unknown,
16530}
16531#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16532pub enum FunctionCachePolicy {
16533    #[serde(rename = "Default")]
16534    Default,
16535    #[serde(rename = "Never")]
16536    Never,
16537    #[serde(rename = "PerSession")]
16538    PerSession,
16539}
16540#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16541pub enum ImageLayerCompression {
16542    #[serde(rename = "EStarGZ")]
16543    EStarGz,
16544    #[serde(rename = "ESTARGZ")]
16545    Estargz,
16546    #[serde(rename = "Gzip")]
16547    Gzip,
16548    #[serde(rename = "Uncompressed")]
16549    Uncompressed,
16550    #[serde(rename = "Zstd")]
16551    Zstd,
16552}
16553#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16554pub enum ImageMediaTypes {
16555    #[serde(rename = "DOCKER")]
16556    Docker,
16557    #[serde(rename = "DockerMediaTypes")]
16558    DockerMediaTypes,
16559    #[serde(rename = "OCI")]
16560    Oci,
16561    #[serde(rename = "OCIMediaTypes")]
16562    OciMediaTypes,
16563}
16564#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16565pub enum ModuleSourceExperimentalFeature {
16566    #[serde(rename = "SELF_CALLS")]
16567    SelfCalls,
16568}
16569#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16570pub enum ModuleSourceKind {
16571    #[serde(rename = "DIR")]
16572    Dir,
16573    #[serde(rename = "DIR_SOURCE")]
16574    DirSource,
16575    #[serde(rename = "GIT")]
16576    Git,
16577    #[serde(rename = "GIT_SOURCE")]
16578    GitSource,
16579    #[serde(rename = "LOCAL")]
16580    Local,
16581    #[serde(rename = "LOCAL_SOURCE")]
16582    LocalSource,
16583}
16584#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16585pub enum NetworkProtocol {
16586    #[serde(rename = "TCP")]
16587    Tcp,
16588    #[serde(rename = "UDP")]
16589    Udp,
16590}
16591#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16592pub enum ReturnType {
16593    #[serde(rename = "ANY")]
16594    Any,
16595    #[serde(rename = "FAILURE")]
16596    Failure,
16597    #[serde(rename = "SUCCESS")]
16598    Success,
16599}
16600#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16601pub enum TypeDefKind {
16602    #[serde(rename = "BOOLEAN")]
16603    Boolean,
16604    #[serde(rename = "BOOLEAN_KIND")]
16605    BooleanKind,
16606    #[serde(rename = "ENUM")]
16607    Enum,
16608    #[serde(rename = "ENUM_KIND")]
16609    EnumKind,
16610    #[serde(rename = "FLOAT")]
16611    Float,
16612    #[serde(rename = "FLOAT_KIND")]
16613    FloatKind,
16614    #[serde(rename = "INPUT")]
16615    Input,
16616    #[serde(rename = "INPUT_KIND")]
16617    InputKind,
16618    #[serde(rename = "INTEGER")]
16619    Integer,
16620    #[serde(rename = "INTEGER_KIND")]
16621    IntegerKind,
16622    #[serde(rename = "INTERFACE")]
16623    Interface,
16624    #[serde(rename = "INTERFACE_KIND")]
16625    InterfaceKind,
16626    #[serde(rename = "LIST")]
16627    List,
16628    #[serde(rename = "LIST_KIND")]
16629    ListKind,
16630    #[serde(rename = "OBJECT")]
16631    Object,
16632    #[serde(rename = "OBJECT_KIND")]
16633    ObjectKind,
16634    #[serde(rename = "SCALAR")]
16635    Scalar,
16636    #[serde(rename = "SCALAR_KIND")]
16637    ScalarKind,
16638    #[serde(rename = "STRING")]
16639    String,
16640    #[serde(rename = "STRING_KIND")]
16641    StringKind,
16642    #[serde(rename = "VOID")]
16643    Void,
16644    #[serde(rename = "VOID_KIND")]
16645    VoidKind,
16646}