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 VolumeId = Id;
154pub type WorkspaceId = Id;
155#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
156pub struct BuildArg {
157    pub name: String,
158    pub value: String,
159}
160#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
161pub struct PipelineLabel {
162    pub name: String,
163    pub value: String,
164}
165#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
166pub struct PortForward {
167    pub backend: isize,
168    pub frontend: isize,
169    pub protocol: NetworkProtocol,
170}
171/// An object that can be exported to the host.
172/// Calling export writes the object to a path on the host filesystem and returns the path that was written.
173pub trait Exportable {
174    fn export(
175        &self,
176        path: impl Into<String>,
177    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send;
178    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
179}
180#[derive(Clone)]
181pub struct ExportableClient {
182    pub proc: Option<Arc<DaggerSessionProc>>,
183    pub selection: Selection,
184    pub graphql_client: DynGraphQLClient,
185}
186impl IntoID<Id> for ExportableClient {
187    fn into_id(
188        self,
189    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
190        Box::pin(async move { self.id().await })
191    }
192}
193impl ExportableClient {
194    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
195        let mut query = self.selection.select("export");
196        query = query.arg("path", path.into());
197        query.execute(self.graphql_client.clone()).await
198    }
199    pub async fn id(&self) -> Result<Id, DaggerError> {
200        let query = self.selection.select("id");
201        query.execute(self.graphql_client.clone()).await
202    }
203}
204impl Loadable for ExportableClient {
205    fn graphql_type() -> &'static str {
206        "Exportable"
207    }
208    fn from_query(
209        proc: Option<Arc<DaggerSessionProc>>,
210        selection: Selection,
211        graphql_client: DynGraphQLClient,
212    ) -> Self {
213        Self {
214            proc,
215            selection,
216            graphql_client,
217        }
218    }
219}
220impl Exportable for ExportableClient {
221    fn export(
222        &self,
223        path: impl Into<String>,
224    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
225        let mut query = self.selection.select("export");
226        query = query.arg("path", path.into());
227        let graphql_client = self.graphql_client.clone();
228        async move { query.execute(graphql_client).await }
229    }
230    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
231        let query = self.selection.select("id");
232        let graphql_client = self.graphql_client.clone();
233        async move { query.execute(graphql_client).await }
234    }
235}
236/// An object with a globally unique ID.
237pub trait Node {
238    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
239}
240#[derive(Clone)]
241pub struct NodeClient {
242    pub proc: Option<Arc<DaggerSessionProc>>,
243    pub selection: Selection,
244    pub graphql_client: DynGraphQLClient,
245}
246impl IntoID<Id> for NodeClient {
247    fn into_id(
248        self,
249    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
250        Box::pin(async move { self.id().await })
251    }
252}
253impl NodeClient {
254    pub async fn id(&self) -> Result<Id, DaggerError> {
255        let query = self.selection.select("id");
256        query.execute(self.graphql_client.clone()).await
257    }
258}
259impl Loadable for NodeClient {
260    fn graphql_type() -> &'static str {
261        "Node"
262    }
263    fn from_query(
264        proc: Option<Arc<DaggerSessionProc>>,
265        selection: Selection,
266        graphql_client: DynGraphQLClient,
267    ) -> Self {
268        Self {
269            proc,
270            selection,
271            graphql_client,
272        }
273    }
274}
275impl Node for NodeClient {
276    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
277        let query = self.selection.select("id");
278        let graphql_client = self.graphql_client.clone();
279        async move { query.execute(graphql_client).await }
280    }
281}
282/// An object that can be force-evaluated.
283/// Calling sync ensures that the object's entire dependency DAG has been evaluated, returning the object's ID once complete.
284pub trait Syncer {
285    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
286    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
287}
288#[derive(Clone)]
289pub struct SyncerClient {
290    pub proc: Option<Arc<DaggerSessionProc>>,
291    pub selection: Selection,
292    pub graphql_client: DynGraphQLClient,
293}
294impl IntoID<Id> for SyncerClient {
295    fn into_id(
296        self,
297    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
298        Box::pin(async move { self.id().await })
299    }
300}
301impl SyncerClient {
302    pub async fn id(&self) -> Result<Id, DaggerError> {
303        let query = self.selection.select("id");
304        query.execute(self.graphql_client.clone()).await
305    }
306    pub async fn sync(&self) -> Result<Id, DaggerError> {
307        let query = self.selection.select("sync");
308        query.execute(self.graphql_client.clone()).await
309    }
310}
311impl Loadable for SyncerClient {
312    fn graphql_type() -> &'static str {
313        "Syncer"
314    }
315    fn from_query(
316        proc: Option<Arc<DaggerSessionProc>>,
317        selection: Selection,
318        graphql_client: DynGraphQLClient,
319    ) -> Self {
320        Self {
321            proc,
322            selection,
323            graphql_client,
324        }
325    }
326}
327impl Syncer for SyncerClient {
328    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
329        let query = self.selection.select("id");
330        let graphql_client = self.graphql_client.clone();
331        async move { query.execute(graphql_client).await }
332    }
333    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
334        let query = self.selection.select("sync");
335        let graphql_client = self.graphql_client.clone();
336        async move { query.execute(graphql_client).await }
337    }
338}
339#[derive(Clone)]
340pub struct Address {
341    pub proc: Option<Arc<DaggerSessionProc>>,
342    pub selection: Selection,
343    pub graphql_client: DynGraphQLClient,
344}
345#[derive(Builder, Debug, PartialEq)]
346pub struct AddressDirectoryOpts<'a> {
347    #[builder(setter(into, strip_option), default)]
348    pub exclude: Option<Vec<&'a str>>,
349    #[builder(setter(into, strip_option), default)]
350    pub gitignore: Option<bool>,
351    #[builder(setter(into, strip_option), default)]
352    pub include: Option<Vec<&'a str>>,
353    #[builder(setter(into, strip_option), default)]
354    pub no_cache: Option<bool>,
355}
356#[derive(Builder, Debug, PartialEq)]
357pub struct AddressFileOpts<'a> {
358    #[builder(setter(into, strip_option), default)]
359    pub exclude: Option<Vec<&'a str>>,
360    #[builder(setter(into, strip_option), default)]
361    pub gitignore: Option<bool>,
362    #[builder(setter(into, strip_option), default)]
363    pub include: Option<Vec<&'a str>>,
364    #[builder(setter(into, strip_option), default)]
365    pub no_cache: Option<bool>,
366}
367impl IntoID<Id> for Address {
368    fn into_id(
369        self,
370    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
371        Box::pin(async move { self.id().await })
372    }
373}
374impl Loadable for Address {
375    fn graphql_type() -> &'static str {
376        "Address"
377    }
378    fn from_query(
379        proc: Option<Arc<DaggerSessionProc>>,
380        selection: Selection,
381        graphql_client: DynGraphQLClient,
382    ) -> Self {
383        Self {
384            proc,
385            selection,
386            graphql_client,
387        }
388    }
389}
390impl Address {
391    /// Load a container from the address.
392    pub fn container(&self) -> Container {
393        let query = self.selection.select("container");
394        Container {
395            proc: self.proc.clone(),
396            selection: query,
397            graphql_client: self.graphql_client.clone(),
398        }
399    }
400    /// Load a directory from the address.
401    ///
402    /// # Arguments
403    ///
404    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
405    pub fn directory(&self) -> Directory {
406        let query = self.selection.select("directory");
407        Directory {
408            proc: self.proc.clone(),
409            selection: query,
410            graphql_client: self.graphql_client.clone(),
411        }
412    }
413    /// Load a directory from the address.
414    ///
415    /// # Arguments
416    ///
417    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
418    pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
419        let mut query = self.selection.select("directory");
420        if let Some(exclude) = opts.exclude {
421            query = query.arg("exclude", exclude);
422        }
423        if let Some(include) = opts.include {
424            query = query.arg("include", include);
425        }
426        if let Some(gitignore) = opts.gitignore {
427            query = query.arg("gitignore", gitignore);
428        }
429        if let Some(no_cache) = opts.no_cache {
430            query = query.arg("noCache", no_cache);
431        }
432        Directory {
433            proc: self.proc.clone(),
434            selection: query,
435            graphql_client: self.graphql_client.clone(),
436        }
437    }
438    /// Load a file from the address.
439    ///
440    /// # Arguments
441    ///
442    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
443    pub fn file(&self) -> File {
444        let query = self.selection.select("file");
445        File {
446            proc: self.proc.clone(),
447            selection: query,
448            graphql_client: self.graphql_client.clone(),
449        }
450    }
451    /// Load a file from the address.
452    ///
453    /// # Arguments
454    ///
455    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
456    pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
457        let mut query = self.selection.select("file");
458        if let Some(exclude) = opts.exclude {
459            query = query.arg("exclude", exclude);
460        }
461        if let Some(include) = opts.include {
462            query = query.arg("include", include);
463        }
464        if let Some(gitignore) = opts.gitignore {
465            query = query.arg("gitignore", gitignore);
466        }
467        if let Some(no_cache) = opts.no_cache {
468            query = query.arg("noCache", no_cache);
469        }
470        File {
471            proc: self.proc.clone(),
472            selection: query,
473            graphql_client: self.graphql_client.clone(),
474        }
475    }
476    /// Load a git ref (branch, tag or commit) from the address.
477    pub fn git_ref(&self) -> GitRef {
478        let query = self.selection.select("gitRef");
479        GitRef {
480            proc: self.proc.clone(),
481            selection: query,
482            graphql_client: self.graphql_client.clone(),
483        }
484    }
485    /// Load a git repository from the address.
486    pub fn git_repository(&self) -> GitRepository {
487        let query = self.selection.select("gitRepository");
488        GitRepository {
489            proc: self.proc.clone(),
490            selection: query,
491            graphql_client: self.graphql_client.clone(),
492        }
493    }
494    /// A unique identifier for this Address.
495    pub async fn id(&self) -> Result<Id, DaggerError> {
496        let query = self.selection.select("id");
497        query.execute(self.graphql_client.clone()).await
498    }
499    /// Load a secret from the address.
500    pub fn secret(&self) -> Secret {
501        let query = self.selection.select("secret");
502        Secret {
503            proc: self.proc.clone(),
504            selection: query,
505            graphql_client: self.graphql_client.clone(),
506        }
507    }
508    /// Load a service from the address.
509    pub fn service(&self) -> Service {
510        let query = self.selection.select("service");
511        Service {
512            proc: self.proc.clone(),
513            selection: query,
514            graphql_client: self.graphql_client.clone(),
515        }
516    }
517    /// Load a local socket from the address.
518    pub fn socket(&self) -> Socket {
519        let query = self.selection.select("socket");
520        Socket {
521            proc: self.proc.clone(),
522            selection: query,
523            graphql_client: self.graphql_client.clone(),
524        }
525    }
526    /// The address value
527    pub async fn value(&self) -> Result<String, DaggerError> {
528        let query = self.selection.select("value");
529        query.execute(self.graphql_client.clone()).await
530    }
531    /// Load a volume from the address.
532    pub fn volume(&self) -> Volume {
533        let query = self.selection.select("volume");
534        Volume {
535            proc: self.proc.clone(),
536            selection: query,
537            graphql_client: self.graphql_client.clone(),
538        }
539    }
540}
541impl Node for Address {
542    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
543        let query = self.selection.select("id");
544        let graphql_client = self.graphql_client.clone();
545        async move { query.execute(graphql_client).await }
546    }
547}
548#[derive(Clone)]
549pub struct Binding {
550    pub proc: Option<Arc<DaggerSessionProc>>,
551    pub selection: Selection,
552    pub graphql_client: DynGraphQLClient,
553}
554impl IntoID<Id> for Binding {
555    fn into_id(
556        self,
557    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
558        Box::pin(async move { self.id().await })
559    }
560}
561impl Loadable for Binding {
562    fn graphql_type() -> &'static str {
563        "Binding"
564    }
565    fn from_query(
566        proc: Option<Arc<DaggerSessionProc>>,
567        selection: Selection,
568        graphql_client: DynGraphQLClient,
569    ) -> Self {
570        Self {
571            proc,
572            selection,
573            graphql_client,
574        }
575    }
576}
577impl Binding {
578    /// Retrieve the binding value, as type Address
579    pub fn as_address(&self) -> Address {
580        let query = self.selection.select("asAddress");
581        Address {
582            proc: self.proc.clone(),
583            selection: query,
584            graphql_client: self.graphql_client.clone(),
585        }
586    }
587    /// Retrieve the binding value, as type CacheVolume
588    pub fn as_cache_volume(&self) -> CacheVolume {
589        let query = self.selection.select("asCacheVolume");
590        CacheVolume {
591            proc: self.proc.clone(),
592            selection: query,
593            graphql_client: self.graphql_client.clone(),
594        }
595    }
596    /// Retrieve the binding value, as type Changeset
597    pub fn as_changeset(&self) -> Changeset {
598        let query = self.selection.select("asChangeset");
599        Changeset {
600            proc: self.proc.clone(),
601            selection: query,
602            graphql_client: self.graphql_client.clone(),
603        }
604    }
605    /// Retrieve the binding value, as type Check
606    pub fn as_check(&self) -> Check {
607        let query = self.selection.select("asCheck");
608        Check {
609            proc: self.proc.clone(),
610            selection: query,
611            graphql_client: self.graphql_client.clone(),
612        }
613    }
614    /// Retrieve the binding value, as type CheckGroup
615    pub fn as_check_group(&self) -> CheckGroup {
616        let query = self.selection.select("asCheckGroup");
617        CheckGroup {
618            proc: self.proc.clone(),
619            selection: query,
620            graphql_client: self.graphql_client.clone(),
621        }
622    }
623    /// Retrieve the binding value, as type Cloud
624    pub fn as_cloud(&self) -> Cloud {
625        let query = self.selection.select("asCloud");
626        Cloud {
627            proc: self.proc.clone(),
628            selection: query,
629            graphql_client: self.graphql_client.clone(),
630        }
631    }
632    /// Retrieve the binding value, as type Container
633    pub fn as_container(&self) -> Container {
634        let query = self.selection.select("asContainer");
635        Container {
636            proc: self.proc.clone(),
637            selection: query,
638            graphql_client: self.graphql_client.clone(),
639        }
640    }
641    /// Retrieve the binding value, as type DiffStat
642    pub fn as_diff_stat(&self) -> DiffStat {
643        let query = self.selection.select("asDiffStat");
644        DiffStat {
645            proc: self.proc.clone(),
646            selection: query,
647            graphql_client: self.graphql_client.clone(),
648        }
649    }
650    /// Retrieve the binding value, as type Directory
651    pub fn as_directory(&self) -> Directory {
652        let query = self.selection.select("asDirectory");
653        Directory {
654            proc: self.proc.clone(),
655            selection: query,
656            graphql_client: self.graphql_client.clone(),
657        }
658    }
659    /// Retrieve the binding value, as type Env
660    pub fn as_env(&self) -> Env {
661        let query = self.selection.select("asEnv");
662        Env {
663            proc: self.proc.clone(),
664            selection: query,
665            graphql_client: self.graphql_client.clone(),
666        }
667    }
668    /// Retrieve the binding value, as type EnvFile
669    pub fn as_env_file(&self) -> EnvFile {
670        let query = self.selection.select("asEnvFile");
671        EnvFile {
672            proc: self.proc.clone(),
673            selection: query,
674            graphql_client: self.graphql_client.clone(),
675        }
676    }
677    /// Retrieve the binding value, as type File
678    pub fn as_file(&self) -> File {
679        let query = self.selection.select("asFile");
680        File {
681            proc: self.proc.clone(),
682            selection: query,
683            graphql_client: self.graphql_client.clone(),
684        }
685    }
686    /// Retrieve the binding value, as type Generator
687    pub fn as_generator(&self) -> Generator {
688        let query = self.selection.select("asGenerator");
689        Generator {
690            proc: self.proc.clone(),
691            selection: query,
692            graphql_client: self.graphql_client.clone(),
693        }
694    }
695    /// Retrieve the binding value, as type GeneratorGroup
696    pub fn as_generator_group(&self) -> GeneratorGroup {
697        let query = self.selection.select("asGeneratorGroup");
698        GeneratorGroup {
699            proc: self.proc.clone(),
700            selection: query,
701            graphql_client: self.graphql_client.clone(),
702        }
703    }
704    /// Retrieve the binding value, as type GitRef
705    pub fn as_git_ref(&self) -> GitRef {
706        let query = self.selection.select("asGitRef");
707        GitRef {
708            proc: self.proc.clone(),
709            selection: query,
710            graphql_client: self.graphql_client.clone(),
711        }
712    }
713    /// Retrieve the binding value, as type GitRepository
714    pub fn as_git_repository(&self) -> GitRepository {
715        let query = self.selection.select("asGitRepository");
716        GitRepository {
717            proc: self.proc.clone(),
718            selection: query,
719            graphql_client: self.graphql_client.clone(),
720        }
721    }
722    /// Retrieve the binding value, as type HTTPState
723    pub fn as_http_state(&self) -> HttpState {
724        let query = self.selection.select("asHTTPState");
725        HttpState {
726            proc: self.proc.clone(),
727            selection: query,
728            graphql_client: self.graphql_client.clone(),
729        }
730    }
731    /// Retrieve the binding value, as type JSONValue
732    pub fn as_json_value(&self) -> JsonValue {
733        let query = self.selection.select("asJSONValue");
734        JsonValue {
735            proc: self.proc.clone(),
736            selection: query,
737            graphql_client: self.graphql_client.clone(),
738        }
739    }
740    /// Retrieve the binding value, as type Module
741    pub fn as_module(&self) -> Module {
742        let query = self.selection.select("asModule");
743        Module {
744            proc: self.proc.clone(),
745            selection: query,
746            graphql_client: self.graphql_client.clone(),
747        }
748    }
749    /// Retrieve the binding value, as type ModuleConfigClient
750    pub fn as_module_config_client(&self) -> ModuleConfigClient {
751        let query = self.selection.select("asModuleConfigClient");
752        ModuleConfigClient {
753            proc: self.proc.clone(),
754            selection: query,
755            graphql_client: self.graphql_client.clone(),
756        }
757    }
758    /// Retrieve the binding value, as type ModuleSource
759    pub fn as_module_source(&self) -> ModuleSource {
760        let query = self.selection.select("asModuleSource");
761        ModuleSource {
762            proc: self.proc.clone(),
763            selection: query,
764            graphql_client: self.graphql_client.clone(),
765        }
766    }
767    /// Retrieve the binding value, as type SearchResult
768    pub fn as_search_result(&self) -> SearchResult {
769        let query = self.selection.select("asSearchResult");
770        SearchResult {
771            proc: self.proc.clone(),
772            selection: query,
773            graphql_client: self.graphql_client.clone(),
774        }
775    }
776    /// Retrieve the binding value, as type SearchSubmatch
777    pub fn as_search_submatch(&self) -> SearchSubmatch {
778        let query = self.selection.select("asSearchSubmatch");
779        SearchSubmatch {
780            proc: self.proc.clone(),
781            selection: query,
782            graphql_client: self.graphql_client.clone(),
783        }
784    }
785    /// Retrieve the binding value, as type Secret
786    pub fn as_secret(&self) -> Secret {
787        let query = self.selection.select("asSecret");
788        Secret {
789            proc: self.proc.clone(),
790            selection: query,
791            graphql_client: self.graphql_client.clone(),
792        }
793    }
794    /// Retrieve the binding value, as type Service
795    pub fn as_service(&self) -> Service {
796        let query = self.selection.select("asService");
797        Service {
798            proc: self.proc.clone(),
799            selection: query,
800            graphql_client: self.graphql_client.clone(),
801        }
802    }
803    /// Retrieve the binding value, as type Socket
804    pub fn as_socket(&self) -> Socket {
805        let query = self.selection.select("asSocket");
806        Socket {
807            proc: self.proc.clone(),
808            selection: query,
809            graphql_client: self.graphql_client.clone(),
810        }
811    }
812    /// Retrieve the binding value, as type Stat
813    pub fn as_stat(&self) -> Stat {
814        let query = self.selection.select("asStat");
815        Stat {
816            proc: self.proc.clone(),
817            selection: query,
818            graphql_client: self.graphql_client.clone(),
819        }
820    }
821    /// Returns the binding's string value
822    pub async fn as_string(&self) -> Result<String, DaggerError> {
823        let query = self.selection.select("asString");
824        query.execute(self.graphql_client.clone()).await
825    }
826    /// Retrieve the binding value, as type Up
827    pub fn as_up(&self) -> Up {
828        let query = self.selection.select("asUp");
829        Up {
830            proc: self.proc.clone(),
831            selection: query,
832            graphql_client: self.graphql_client.clone(),
833        }
834    }
835    /// Retrieve the binding value, as type UpGroup
836    pub fn as_up_group(&self) -> UpGroup {
837        let query = self.selection.select("asUpGroup");
838        UpGroup {
839            proc: self.proc.clone(),
840            selection: query,
841            graphql_client: self.graphql_client.clone(),
842        }
843    }
844    /// Retrieve the binding value, as type Volume
845    pub fn as_volume(&self) -> Volume {
846        let query = self.selection.select("asVolume");
847        Volume {
848            proc: self.proc.clone(),
849            selection: query,
850            graphql_client: self.graphql_client.clone(),
851        }
852    }
853    /// Retrieve the binding value, as type Workspace
854    pub fn as_workspace(&self) -> Workspace {
855        let query = self.selection.select("asWorkspace");
856        Workspace {
857            proc: self.proc.clone(),
858            selection: query,
859            graphql_client: self.graphql_client.clone(),
860        }
861    }
862    /// Returns the digest of the binding value
863    pub async fn digest(&self) -> Result<String, DaggerError> {
864        let query = self.selection.select("digest");
865        query.execute(self.graphql_client.clone()).await
866    }
867    /// A unique identifier for this Binding.
868    pub async fn id(&self) -> Result<Id, DaggerError> {
869        let query = self.selection.select("id");
870        query.execute(self.graphql_client.clone()).await
871    }
872    /// Returns true if the binding is null
873    pub async fn is_null(&self) -> Result<bool, DaggerError> {
874        let query = self.selection.select("isNull");
875        query.execute(self.graphql_client.clone()).await
876    }
877    /// Returns the binding name
878    pub async fn name(&self) -> Result<String, DaggerError> {
879        let query = self.selection.select("name");
880        query.execute(self.graphql_client.clone()).await
881    }
882    /// Returns the binding type
883    pub async fn type_name(&self) -> Result<String, DaggerError> {
884        let query = self.selection.select("typeName");
885        query.execute(self.graphql_client.clone()).await
886    }
887}
888impl Node for Binding {
889    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
890        let query = self.selection.select("id");
891        let graphql_client = self.graphql_client.clone();
892        async move { query.execute(graphql_client).await }
893    }
894}
895#[derive(Clone)]
896pub struct CacheVolume {
897    pub proc: Option<Arc<DaggerSessionProc>>,
898    pub selection: Selection,
899    pub graphql_client: DynGraphQLClient,
900}
901impl IntoID<Id> for CacheVolume {
902    fn into_id(
903        self,
904    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
905        Box::pin(async move { self.id().await })
906    }
907}
908impl Loadable for CacheVolume {
909    fn graphql_type() -> &'static str {
910        "CacheVolume"
911    }
912    fn from_query(
913        proc: Option<Arc<DaggerSessionProc>>,
914        selection: Selection,
915        graphql_client: DynGraphQLClient,
916    ) -> Self {
917        Self {
918            proc,
919            selection,
920            graphql_client,
921        }
922    }
923}
924impl CacheVolume {
925    /// A unique identifier for this CacheVolume.
926    pub async fn id(&self) -> Result<Id, DaggerError> {
927        let query = self.selection.select("id");
928        query.execute(self.graphql_client.clone()).await
929    }
930}
931impl Node for CacheVolume {
932    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
933        let query = self.selection.select("id");
934        let graphql_client = self.graphql_client.clone();
935        async move { query.execute(graphql_client).await }
936    }
937}
938#[derive(Clone)]
939pub struct Changeset {
940    pub proc: Option<Arc<DaggerSessionProc>>,
941    pub selection: Selection,
942    pub graphql_client: DynGraphQLClient,
943}
944#[derive(Builder, Debug, PartialEq)]
945pub struct ChangesetWithChangesetOpts {
946    /// What to do on a merge conflict
947    #[builder(setter(into, strip_option), default)]
948    pub on_conflict: Option<ChangesetMergeConflict>,
949}
950#[derive(Builder, Debug, PartialEq)]
951pub struct ChangesetWithChangesetsOpts {
952    /// What to do on a merge conflict
953    #[builder(setter(into, strip_option), default)]
954    pub on_conflict: Option<ChangesetsMergeConflict>,
955}
956impl IntoID<Id> for Changeset {
957    fn into_id(
958        self,
959    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
960        Box::pin(async move { self.id().await })
961    }
962}
963impl Loadable for Changeset {
964    fn graphql_type() -> &'static str {
965        "Changeset"
966    }
967    fn from_query(
968        proc: Option<Arc<DaggerSessionProc>>,
969        selection: Selection,
970        graphql_client: DynGraphQLClient,
971    ) -> Self {
972        Self {
973            proc,
974            selection,
975            graphql_client,
976        }
977    }
978}
979impl Changeset {
980    /// Files and directories that were added in the newer directory.
981    pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
982        let query = self.selection.select("addedPaths");
983        query.execute(self.graphql_client.clone()).await
984    }
985    /// The newer/upper snapshot.
986    pub fn after(&self) -> Directory {
987        let query = self.selection.select("after");
988        Directory {
989            proc: self.proc.clone(),
990            selection: query,
991            graphql_client: self.graphql_client.clone(),
992        }
993    }
994    /// Return a Git-compatible patch of the changes
995    pub fn as_patch(&self) -> File {
996        let query = self.selection.select("asPatch");
997        File {
998            proc: self.proc.clone(),
999            selection: query,
1000            graphql_client: self.graphql_client.clone(),
1001        }
1002    }
1003    /// The older/lower snapshot to compare against.
1004    pub fn before(&self) -> Directory {
1005        let query = self.selection.select("before");
1006        Directory {
1007            proc: self.proc.clone(),
1008            selection: query,
1009            graphql_client: self.graphql_client.clone(),
1010        }
1011    }
1012    /// Structured per-path diff statistics (kind and line counts) for this changeset.
1013    pub async fn diff_stats(&self) -> Result<Vec<DiffStat>, DaggerError> {
1014        let query = self.selection.select("diffStats");
1015        let query = query.select("id");
1016        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1017        Ok(ids
1018            .into_iter()
1019            .map(|id| DiffStat {
1020                proc: self.proc.clone(),
1021                selection: crate::querybuilder::query()
1022                    .select("node")
1023                    .arg("id", &id.0)
1024                    .inline_fragment("DiffStat"),
1025                graphql_client: self.graphql_client.clone(),
1026            })
1027            .collect())
1028    }
1029    /// Applies the diff represented by this changeset to a path on the host.
1030    ///
1031    /// # Arguments
1032    ///
1033    /// * `path` - Location of the copied directory (e.g., "logs/").
1034    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
1035        let mut query = self.selection.select("export");
1036        query = query.arg("path", path.into());
1037        query.execute(self.graphql_client.clone()).await
1038    }
1039    /// A unique identifier for this Changeset.
1040    pub async fn id(&self) -> Result<Id, DaggerError> {
1041        let query = self.selection.select("id");
1042        query.execute(self.graphql_client.clone()).await
1043    }
1044    /// Returns true if the changeset is empty (i.e. there are no changes).
1045    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
1046        let query = self.selection.select("isEmpty");
1047        query.execute(self.graphql_client.clone()).await
1048    }
1049    /// Return a snapshot containing only the created and modified files
1050    pub fn layer(&self) -> Directory {
1051        let query = self.selection.select("layer");
1052        Directory {
1053            proc: self.proc.clone(),
1054            selection: query,
1055            graphql_client: self.graphql_client.clone(),
1056        }
1057    }
1058    /// Files and directories that existed before and were updated in the newer directory.
1059    pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
1060        let query = self.selection.select("modifiedPaths");
1061        query.execute(self.graphql_client.clone()).await
1062    }
1063    /// Files and directories that were removed. Directories are indicated by a trailing slash, and their child paths are not included.
1064    pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
1065        let query = self.selection.select("removedPaths");
1066        query.execute(self.graphql_client.clone()).await
1067    }
1068    /// Force evaluation in the engine.
1069    pub async fn sync(&self) -> Result<Changeset, DaggerError> {
1070        let query = self.selection.select("sync");
1071        let id: Id = query.execute(self.graphql_client.clone()).await?;
1072        Ok(Changeset {
1073            proc: self.proc.clone(),
1074            selection: query
1075                .root()
1076                .select("node")
1077                .arg("id", &id.0)
1078                .inline_fragment("Changeset"),
1079            graphql_client: self.graphql_client.clone(),
1080        })
1081    }
1082    /// Add changes to an existing changeset
1083    /// 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
1084    ///
1085    /// # Arguments
1086    ///
1087    /// * `changes` - Changes to merge into the actual changeset
1088    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1089    pub fn with_changeset(&self, changes: impl IntoID<Id>) -> Changeset {
1090        let mut query = self.selection.select("withChangeset");
1091        query = query.arg_lazy(
1092            "changes",
1093            Box::new(move || {
1094                let changes = changes.clone();
1095                Box::pin(async move { changes.into_id().await.unwrap().quote() })
1096            }),
1097        );
1098        Changeset {
1099            proc: self.proc.clone(),
1100            selection: query,
1101            graphql_client: self.graphql_client.clone(),
1102        }
1103    }
1104    /// Add changes to an existing changeset
1105    /// 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
1106    ///
1107    /// # Arguments
1108    ///
1109    /// * `changes` - Changes to merge into the actual changeset
1110    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1111    pub fn with_changeset_opts(
1112        &self,
1113        changes: impl IntoID<Id>,
1114        opts: ChangesetWithChangesetOpts,
1115    ) -> Changeset {
1116        let mut query = self.selection.select("withChangeset");
1117        query = query.arg_lazy(
1118            "changes",
1119            Box::new(move || {
1120                let changes = changes.clone();
1121                Box::pin(async move { changes.into_id().await.unwrap().quote() })
1122            }),
1123        );
1124        if let Some(on_conflict) = opts.on_conflict {
1125            query = query.arg("onConflict", on_conflict);
1126        }
1127        Changeset {
1128            proc: self.proc.clone(),
1129            selection: query,
1130            graphql_client: self.graphql_client.clone(),
1131        }
1132    }
1133    /// Add changes from multiple changesets using git octopus merge strategy
1134    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
1135    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
1136    ///
1137    /// # Arguments
1138    ///
1139    /// * `changes` - List of changesets to merge into the actual changeset
1140    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1141    pub fn with_changesets(&self, changes: Vec<Id>) -> Changeset {
1142        let mut query = self.selection.select("withChangesets");
1143        query = query.arg("changes", changes);
1144        Changeset {
1145            proc: self.proc.clone(),
1146            selection: query,
1147            graphql_client: self.graphql_client.clone(),
1148        }
1149    }
1150    /// Add changes from multiple changesets using git octopus merge strategy
1151    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
1152    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
1153    ///
1154    /// # Arguments
1155    ///
1156    /// * `changes` - List of changesets to merge into the actual changeset
1157    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1158    pub fn with_changesets_opts(
1159        &self,
1160        changes: Vec<Id>,
1161        opts: ChangesetWithChangesetsOpts,
1162    ) -> Changeset {
1163        let mut query = self.selection.select("withChangesets");
1164        query = query.arg("changes", changes);
1165        if let Some(on_conflict) = opts.on_conflict {
1166            query = query.arg("onConflict", on_conflict);
1167        }
1168        Changeset {
1169            proc: self.proc.clone(),
1170            selection: query,
1171            graphql_client: self.graphql_client.clone(),
1172        }
1173    }
1174}
1175impl Exportable for Changeset {
1176    fn export(
1177        &self,
1178        path: impl Into<String>,
1179    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
1180        let mut query = self.selection.select("export");
1181        query = query.arg("path", path.into());
1182        let graphql_client = self.graphql_client.clone();
1183        async move { query.execute(graphql_client).await }
1184    }
1185    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1186        let query = self.selection.select("id");
1187        let graphql_client = self.graphql_client.clone();
1188        async move { query.execute(graphql_client).await }
1189    }
1190}
1191impl Node for Changeset {
1192    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1193        let query = self.selection.select("id");
1194        let graphql_client = self.graphql_client.clone();
1195        async move { query.execute(graphql_client).await }
1196    }
1197}
1198impl Syncer for Changeset {
1199    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1200        let query = self.selection.select("id");
1201        let graphql_client = self.graphql_client.clone();
1202        async move { query.execute(graphql_client).await }
1203    }
1204    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1205        let query = self.selection.select("sync");
1206        let graphql_client = self.graphql_client.clone();
1207        async move { query.execute(graphql_client).await }
1208    }
1209}
1210#[derive(Clone)]
1211pub struct Check {
1212    pub proc: Option<Arc<DaggerSessionProc>>,
1213    pub selection: Selection,
1214    pub graphql_client: DynGraphQLClient,
1215}
1216impl IntoID<Id> for Check {
1217    fn into_id(
1218        self,
1219    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1220        Box::pin(async move { self.id().await })
1221    }
1222}
1223impl Loadable for Check {
1224    fn graphql_type() -> &'static str {
1225        "Check"
1226    }
1227    fn from_query(
1228        proc: Option<Arc<DaggerSessionProc>>,
1229        selection: Selection,
1230        graphql_client: DynGraphQLClient,
1231    ) -> Self {
1232        Self {
1233            proc,
1234            selection,
1235            graphql_client,
1236        }
1237    }
1238}
1239impl Check {
1240    /// The type of check: 'check' for annotated checks, 'generate' for generate-as-checks
1241    pub async fn check_type(&self) -> Result<String, DaggerError> {
1242        let query = self.selection.select("checkType");
1243        query.execute(self.graphql_client.clone()).await
1244    }
1245    /// Whether the check completed
1246    pub async fn completed(&self) -> Result<bool, DaggerError> {
1247        let query = self.selection.select("completed");
1248        query.execute(self.graphql_client.clone()).await
1249    }
1250    /// The description of the check
1251    pub async fn description(&self) -> Result<String, DaggerError> {
1252        let query = self.selection.select("description");
1253        query.execute(self.graphql_client.clone()).await
1254    }
1255    /// If the check failed, this is the error
1256    pub fn error(&self) -> Error {
1257        let query = self.selection.select("error");
1258        Error {
1259            proc: self.proc.clone(),
1260            selection: query,
1261            graphql_client: self.graphql_client.clone(),
1262        }
1263    }
1264    /// A unique identifier for this Check.
1265    pub async fn id(&self) -> Result<Id, DaggerError> {
1266        let query = self.selection.select("id");
1267        query.execute(self.graphql_client.clone()).await
1268    }
1269    /// Return the fully qualified name of the check
1270    pub async fn name(&self) -> Result<String, DaggerError> {
1271        let query = self.selection.select("name");
1272        query.execute(self.graphql_client.clone()).await
1273    }
1274    /// The original module in which the check has been defined
1275    pub fn original_module(&self) -> Module {
1276        let query = self.selection.select("originalModule");
1277        Module {
1278            proc: self.proc.clone(),
1279            selection: query,
1280            graphql_client: self.graphql_client.clone(),
1281        }
1282    }
1283    /// Whether the check passed
1284    pub async fn passed(&self) -> Result<bool, DaggerError> {
1285        let query = self.selection.select("passed");
1286        query.execute(self.graphql_client.clone()).await
1287    }
1288    /// The path of the check within its module
1289    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
1290        let query = self.selection.select("path");
1291        query.execute(self.graphql_client.clone()).await
1292    }
1293    /// An emoji representing the result of the check
1294    pub async fn result_emoji(&self) -> Result<String, DaggerError> {
1295        let query = self.selection.select("resultEmoji");
1296        query.execute(self.graphql_client.clone()).await
1297    }
1298    /// Execute the check
1299    pub fn run(&self) -> Check {
1300        let query = self.selection.select("run");
1301        Check {
1302            proc: self.proc.clone(),
1303            selection: query,
1304            graphql_client: self.graphql_client.clone(),
1305        }
1306    }
1307}
1308impl Node for Check {
1309    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1310        let query = self.selection.select("id");
1311        let graphql_client = self.graphql_client.clone();
1312        async move { query.execute(graphql_client).await }
1313    }
1314}
1315#[derive(Clone)]
1316pub struct CheckGroup {
1317    pub proc: Option<Arc<DaggerSessionProc>>,
1318    pub selection: Selection,
1319    pub graphql_client: DynGraphQLClient,
1320}
1321#[derive(Builder, Debug, PartialEq)]
1322pub struct CheckGroupRunOpts {
1323    /// If true, stop running checks as soon as any check fails.
1324    #[builder(setter(into, strip_option), default)]
1325    pub fail_fast: Option<bool>,
1326}
1327impl IntoID<Id> for CheckGroup {
1328    fn into_id(
1329        self,
1330    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1331        Box::pin(async move { self.id().await })
1332    }
1333}
1334impl Loadable for CheckGroup {
1335    fn graphql_type() -> &'static str {
1336        "CheckGroup"
1337    }
1338    fn from_query(
1339        proc: Option<Arc<DaggerSessionProc>>,
1340        selection: Selection,
1341        graphql_client: DynGraphQLClient,
1342    ) -> Self {
1343        Self {
1344            proc,
1345            selection,
1346            graphql_client,
1347        }
1348    }
1349}
1350impl CheckGroup {
1351    /// A unique identifier for this CheckGroup.
1352    pub async fn id(&self) -> Result<Id, DaggerError> {
1353        let query = self.selection.select("id");
1354        query.execute(self.graphql_client.clone()).await
1355    }
1356    /// Return a list of individual checks and their details
1357    pub async fn list(&self) -> Result<Vec<Check>, DaggerError> {
1358        let query = self.selection.select("list");
1359        let query = query.select("id");
1360        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1361        Ok(ids
1362            .into_iter()
1363            .map(|id| Check {
1364                proc: self.proc.clone(),
1365                selection: crate::querybuilder::query()
1366                    .select("node")
1367                    .arg("id", &id.0)
1368                    .inline_fragment("Check"),
1369                graphql_client: self.graphql_client.clone(),
1370            })
1371            .collect())
1372    }
1373    /// Generate a markdown report
1374    pub fn report(&self) -> File {
1375        let query = self.selection.select("report");
1376        File {
1377            proc: self.proc.clone(),
1378            selection: query,
1379            graphql_client: self.graphql_client.clone(),
1380        }
1381    }
1382    /// Execute all selected checks
1383    ///
1384    /// # Arguments
1385    ///
1386    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1387    pub fn run(&self) -> CheckGroup {
1388        let query = self.selection.select("run");
1389        CheckGroup {
1390            proc: self.proc.clone(),
1391            selection: query,
1392            graphql_client: self.graphql_client.clone(),
1393        }
1394    }
1395    /// Execute all selected checks
1396    ///
1397    /// # Arguments
1398    ///
1399    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1400    pub fn run_opts(&self, opts: CheckGroupRunOpts) -> CheckGroup {
1401        let mut query = self.selection.select("run");
1402        if let Some(fail_fast) = opts.fail_fast {
1403            query = query.arg("failFast", fail_fast);
1404        }
1405        CheckGroup {
1406            proc: self.proc.clone(),
1407            selection: query,
1408            graphql_client: self.graphql_client.clone(),
1409        }
1410    }
1411}
1412impl Node for CheckGroup {
1413    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1414        let query = self.selection.select("id");
1415        let graphql_client = self.graphql_client.clone();
1416        async move { query.execute(graphql_client).await }
1417    }
1418}
1419#[derive(Clone)]
1420pub struct ClientFilesyncMirror {
1421    pub proc: Option<Arc<DaggerSessionProc>>,
1422    pub selection: Selection,
1423    pub graphql_client: DynGraphQLClient,
1424}
1425impl IntoID<Id> for ClientFilesyncMirror {
1426    fn into_id(
1427        self,
1428    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1429        Box::pin(async move { self.id().await })
1430    }
1431}
1432impl Loadable for ClientFilesyncMirror {
1433    fn graphql_type() -> &'static str {
1434        "ClientFilesyncMirror"
1435    }
1436    fn from_query(
1437        proc: Option<Arc<DaggerSessionProc>>,
1438        selection: Selection,
1439        graphql_client: DynGraphQLClient,
1440    ) -> Self {
1441        Self {
1442            proc,
1443            selection,
1444            graphql_client,
1445        }
1446    }
1447}
1448impl ClientFilesyncMirror {
1449    /// A unique identifier for this ClientFilesyncMirror.
1450    pub async fn id(&self) -> Result<Id, DaggerError> {
1451        let query = self.selection.select("id");
1452        query.execute(self.graphql_client.clone()).await
1453    }
1454}
1455impl Node for ClientFilesyncMirror {
1456    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1457        let query = self.selection.select("id");
1458        let graphql_client = self.graphql_client.clone();
1459        async move { query.execute(graphql_client).await }
1460    }
1461}
1462#[derive(Clone)]
1463pub struct Cloud {
1464    pub proc: Option<Arc<DaggerSessionProc>>,
1465    pub selection: Selection,
1466    pub graphql_client: DynGraphQLClient,
1467}
1468impl IntoID<Id> for Cloud {
1469    fn into_id(
1470        self,
1471    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1472        Box::pin(async move { self.id().await })
1473    }
1474}
1475impl Loadable for Cloud {
1476    fn graphql_type() -> &'static str {
1477        "Cloud"
1478    }
1479    fn from_query(
1480        proc: Option<Arc<DaggerSessionProc>>,
1481        selection: Selection,
1482        graphql_client: DynGraphQLClient,
1483    ) -> Self {
1484        Self {
1485            proc,
1486            selection,
1487            graphql_client,
1488        }
1489    }
1490}
1491impl Cloud {
1492    /// A unique identifier for this Cloud.
1493    pub async fn id(&self) -> Result<Id, DaggerError> {
1494        let query = self.selection.select("id");
1495        query.execute(self.graphql_client.clone()).await
1496    }
1497    /// The trace URL for the current session
1498    pub async fn trace_url(&self) -> Result<String, DaggerError> {
1499        let query = self.selection.select("traceURL");
1500        query.execute(self.graphql_client.clone()).await
1501    }
1502}
1503impl Node for Cloud {
1504    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1505        let query = self.selection.select("id");
1506        let graphql_client = self.graphql_client.clone();
1507        async move { query.execute(graphql_client).await }
1508    }
1509}
1510#[derive(Clone)]
1511pub struct Container {
1512    pub proc: Option<Arc<DaggerSessionProc>>,
1513    pub selection: Selection,
1514    pub graphql_client: DynGraphQLClient,
1515}
1516#[derive(Builder, Debug, PartialEq)]
1517pub struct ContainerAsServiceOpts<'a> {
1518    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1519    /// If empty, the container's default command is used.
1520    #[builder(setter(into, strip_option), default)]
1521    pub args: Option<Vec<&'a str>>,
1522    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1523    #[builder(setter(into, strip_option), default)]
1524    pub expand: Option<bool>,
1525    /// Provides Dagger access to the executed command.
1526    #[builder(setter(into, strip_option), default)]
1527    pub experimental_privileged_nesting: Option<bool>,
1528    /// 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.
1529    #[builder(setter(into, strip_option), default)]
1530    pub insecure_root_capabilities: Option<bool>,
1531    /// If set, skip the automatic init process injected into containers by default.
1532    /// 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.
1533    #[builder(setter(into, strip_option), default)]
1534    pub no_init: Option<bool>,
1535    /// If the container has an entrypoint, prepend it to the args.
1536    #[builder(setter(into, strip_option), default)]
1537    pub use_entrypoint: Option<bool>,
1538}
1539#[derive(Builder, Debug, PartialEq)]
1540pub struct ContainerAsTarballOpts {
1541    /// Force each layer of the image to use the specified compression algorithm.
1542    /// 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.
1543    #[builder(setter(into, strip_option), default)]
1544    pub forced_compression: Option<ImageLayerCompression>,
1545    /// Use the specified media types for the image's layers.
1546    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1547    #[builder(setter(into, strip_option), default)]
1548    pub media_types: Option<ImageMediaTypes>,
1549    /// Identifiers for other platform specific containers.
1550    /// Used for multi-platform images.
1551    #[builder(setter(into, strip_option), default)]
1552    pub platform_variants: Option<Vec<Id>>,
1553}
1554#[derive(Builder, Debug, PartialEq)]
1555pub struct ContainerDirectoryOpts {
1556    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1557    #[builder(setter(into, strip_option), default)]
1558    pub expand: Option<bool>,
1559}
1560#[derive(Builder, Debug, PartialEq)]
1561pub struct ContainerExistsOpts {
1562    /// If specified, do not follow symlinks.
1563    #[builder(setter(into, strip_option), default)]
1564    pub do_not_follow_symlinks: Option<bool>,
1565    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1566    #[builder(setter(into, strip_option), default)]
1567    pub expand: Option<bool>,
1568    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
1569    #[builder(setter(into, strip_option), default)]
1570    pub expected_type: Option<ExistsType>,
1571}
1572#[derive(Builder, Debug, PartialEq)]
1573pub struct ContainerExportOpts {
1574    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1575    #[builder(setter(into, strip_option), default)]
1576    pub expand: Option<bool>,
1577    /// Force each layer of the exported image to use the specified compression algorithm.
1578    /// 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.
1579    #[builder(setter(into, strip_option), default)]
1580    pub forced_compression: Option<ImageLayerCompression>,
1581    /// Use the specified media types for the exported image's layers.
1582    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1583    #[builder(setter(into, strip_option), default)]
1584    pub media_types: Option<ImageMediaTypes>,
1585    /// Identifiers for other platform specific containers.
1586    /// Used for multi-platform image.
1587    #[builder(setter(into, strip_option), default)]
1588    pub platform_variants: Option<Vec<Id>>,
1589}
1590#[derive(Builder, Debug, PartialEq)]
1591pub struct ContainerExportImageOpts {
1592    /// Force each layer of the exported image to use the specified compression algorithm.
1593    /// 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.
1594    #[builder(setter(into, strip_option), default)]
1595    pub forced_compression: Option<ImageLayerCompression>,
1596    /// Use the specified media types for the exported image's layers.
1597    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1598    #[builder(setter(into, strip_option), default)]
1599    pub media_types: Option<ImageMediaTypes>,
1600    /// Identifiers for other platform specific containers.
1601    /// Used for multi-platform image.
1602    #[builder(setter(into, strip_option), default)]
1603    pub platform_variants: Option<Vec<Id>>,
1604}
1605#[derive(Builder, Debug, PartialEq)]
1606pub struct ContainerFileOpts {
1607    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1608    #[builder(setter(into, strip_option), default)]
1609    pub expand: Option<bool>,
1610}
1611#[derive(Builder, Debug, PartialEq)]
1612pub struct ContainerFromOpts {
1613    /// Service to use as the registry endpoint for the image address.
1614    /// The service will be started only for this pull.
1615    #[builder(setter(into, strip_option), default)]
1616    pub registry_service: Option<Id>,
1617}
1618#[derive(Builder, Debug, PartialEq)]
1619pub struct ContainerImportOpts<'a> {
1620    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
1621    #[builder(setter(into, strip_option), default)]
1622    pub tag: Option<&'a str>,
1623}
1624#[derive(Builder, Debug, PartialEq)]
1625pub struct ContainerPublishOpts {
1626    /// Force each layer of the published image to use the specified compression algorithm.
1627    /// 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.
1628    #[builder(setter(into, strip_option), default)]
1629    pub forced_compression: Option<ImageLayerCompression>,
1630    /// Use the specified media types for the published image's layers.
1631    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
1632    #[builder(setter(into, strip_option), default)]
1633    pub media_types: Option<ImageMediaTypes>,
1634    /// Identifiers for other platform specific containers.
1635    /// Used for multi-platform image.
1636    #[builder(setter(into, strip_option), default)]
1637    pub platform_variants: Option<Vec<Id>>,
1638    /// Service to use as the registry endpoint for the image address.
1639    /// The service will be started only for this push.
1640    #[builder(setter(into, strip_option), default)]
1641    pub registry_service: Option<Id>,
1642}
1643#[derive(Builder, Debug, PartialEq)]
1644pub struct ContainerStatOpts {
1645    /// If specified, do not follow symlinks.
1646    #[builder(setter(into, strip_option), default)]
1647    pub do_not_follow_symlinks: Option<bool>,
1648}
1649#[derive(Builder, Debug, PartialEq)]
1650pub struct ContainerTerminalOpts<'a> {
1651    /// If set, override the container's default terminal command and invoke these command arguments instead.
1652    #[builder(setter(into, strip_option), default)]
1653    pub cmd: Option<Vec<&'a str>>,
1654    /// Provides Dagger access to the executed command.
1655    #[builder(setter(into, strip_option), default)]
1656    pub experimental_privileged_nesting: Option<bool>,
1657    /// 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.
1658    #[builder(setter(into, strip_option), default)]
1659    pub insecure_root_capabilities: Option<bool>,
1660}
1661#[derive(Builder, Debug, PartialEq)]
1662pub struct ContainerUpOpts<'a> {
1663    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1664    /// If empty, the container's default command is used.
1665    #[builder(setter(into, strip_option), default)]
1666    pub args: Option<Vec<&'a str>>,
1667    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1668    #[builder(setter(into, strip_option), default)]
1669    pub expand: Option<bool>,
1670    /// Provides Dagger access to the executed command.
1671    #[builder(setter(into, strip_option), default)]
1672    pub experimental_privileged_nesting: Option<bool>,
1673    /// 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.
1674    #[builder(setter(into, strip_option), default)]
1675    pub insecure_root_capabilities: Option<bool>,
1676    /// If set, skip the automatic init process injected into containers by default.
1677    /// 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.
1678    #[builder(setter(into, strip_option), default)]
1679    pub no_init: Option<bool>,
1680    /// List of frontend/backend port mappings to forward.
1681    /// Frontend is the port accepting traffic on the host, backend is the service port.
1682    #[builder(setter(into, strip_option), default)]
1683    pub ports: Option<Vec<PortForward>>,
1684    /// Bind each tunnel port to a random port on the host.
1685    #[builder(setter(into, strip_option), default)]
1686    pub random: Option<bool>,
1687    /// If the container has an entrypoint, prepend it to the args.
1688    #[builder(setter(into, strip_option), default)]
1689    pub use_entrypoint: Option<bool>,
1690}
1691#[derive(Builder, Debug, PartialEq)]
1692pub struct ContainerWithDefaultTerminalCmdOpts {
1693    /// Provides Dagger access to the executed command.
1694    #[builder(setter(into, strip_option), default)]
1695    pub experimental_privileged_nesting: Option<bool>,
1696    /// 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.
1697    #[builder(setter(into, strip_option), default)]
1698    pub insecure_root_capabilities: Option<bool>,
1699}
1700#[derive(Builder, Debug, PartialEq)]
1701pub struct ContainerWithDirectoryOpts<'a> {
1702    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
1703    #[builder(setter(into, strip_option), default)]
1704    pub exclude: Option<Vec<&'a str>>,
1705    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1706    #[builder(setter(into, strip_option), default)]
1707    pub expand: Option<bool>,
1708    /// Apply .gitignore rules when writing the directory.
1709    #[builder(setter(into, strip_option), default)]
1710    pub gitignore: Option<bool>,
1711    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
1712    #[builder(setter(into, strip_option), default)]
1713    pub include: Option<Vec<&'a str>>,
1714    /// A user:group to set for the directory and its contents.
1715    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1716    /// If the group is omitted, it defaults to the same as the user.
1717    #[builder(setter(into, strip_option), default)]
1718    pub owner: Option<&'a str>,
1719    #[builder(setter(into, strip_option), default)]
1720    pub permissions: Option<isize>,
1721}
1722#[derive(Builder, Debug, PartialEq)]
1723pub struct ContainerWithDockerHealthcheckOpts<'a> {
1724    /// Interval between running healthcheck. Example: "30s"
1725    #[builder(setter(into, strip_option), default)]
1726    pub interval: Option<&'a str>,
1727    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example: "3"
1728    #[builder(setter(into, strip_option), default)]
1729    pub retries: Option<isize>,
1730    /// When true, command must be a single element, which is run using the container's shell
1731    #[builder(setter(into, strip_option), default)]
1732    pub shell: Option<bool>,
1733    /// StartInterval configures the duration between checks during the startup phase. Example: "5s"
1734    #[builder(setter(into, strip_option), default)]
1735    pub start_interval: Option<&'a str>,
1736    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example: "0s"
1737    #[builder(setter(into, strip_option), default)]
1738    pub start_period: Option<&'a str>,
1739    /// Healthcheck timeout. Example: "3s"
1740    #[builder(setter(into, strip_option), default)]
1741    pub timeout: Option<&'a str>,
1742}
1743#[derive(Builder, Debug, PartialEq)]
1744pub struct ContainerWithEntrypointOpts {
1745    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
1746    #[builder(setter(into, strip_option), default)]
1747    pub keep_default_args: Option<bool>,
1748}
1749#[derive(Builder, Debug, PartialEq)]
1750pub struct ContainerWithEnvVariableOpts {
1751    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
1752    #[builder(setter(into, strip_option), default)]
1753    pub expand: Option<bool>,
1754}
1755#[derive(Builder, Debug, PartialEq)]
1756pub struct ContainerWithExecOpts<'a> {
1757    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1758    #[builder(setter(into, strip_option), default)]
1759    pub expand: Option<bool>,
1760    /// Exit codes this command is allowed to exit with without error
1761    #[builder(setter(into, strip_option), default)]
1762    pub expect: Option<ReturnType>,
1763    /// Provides Dagger access to the executed command.
1764    #[builder(setter(into, strip_option), default)]
1765    pub experimental_privileged_nesting: Option<bool>,
1766    /// Execute the command with all root capabilities. Like --privileged in Docker
1767    /// 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.
1768    #[builder(setter(into, strip_option), default)]
1769    pub insecure_root_capabilities: Option<bool>,
1770    /// Skip the automatic init process injected into containers by default.
1771    /// 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.
1772    #[builder(setter(into, strip_option), default)]
1773    pub no_init: Option<bool>,
1774    /// Redirect the command's standard error to a file in the container. Example: "./stderr.txt"
1775    #[builder(setter(into, strip_option), default)]
1776    pub redirect_stderr: Option<&'a str>,
1777    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
1778    #[builder(setter(into, strip_option), default)]
1779    pub redirect_stdin: Option<&'a str>,
1780    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
1781    #[builder(setter(into, strip_option), default)]
1782    pub redirect_stdout: Option<&'a str>,
1783    /// Content to write to the command's standard input. Example: "Hello world")
1784    #[builder(setter(into, strip_option), default)]
1785    pub stdin: Option<&'a str>,
1786    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
1787    #[builder(setter(into, strip_option), default)]
1788    pub use_entrypoint: Option<bool>,
1789}
1790#[derive(Builder, Debug, PartialEq)]
1791pub struct ContainerWithExposedPortOpts<'a> {
1792    /// Port description. Example: "payment API endpoint"
1793    #[builder(setter(into, strip_option), default)]
1794    pub description: Option<&'a str>,
1795    /// Skip the health check when run as a service.
1796    #[builder(setter(into, strip_option), default)]
1797    pub experimental_skip_healthcheck: Option<bool>,
1798    /// Network protocol. Example: "tcp"
1799    #[builder(setter(into, strip_option), default)]
1800    pub protocol: Option<NetworkProtocol>,
1801}
1802#[derive(Builder, Debug, PartialEq)]
1803pub struct ContainerWithFileOpts<'a> {
1804    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1805    #[builder(setter(into, strip_option), default)]
1806    pub expand: Option<bool>,
1807    /// A user:group to set for the file.
1808    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1809    /// If the group is omitted, it defaults to the same as the user.
1810    #[builder(setter(into, strip_option), default)]
1811    pub owner: Option<&'a str>,
1812    /// Permissions of the new file. Example: 0600
1813    #[builder(setter(into, strip_option), default)]
1814    pub permissions: Option<isize>,
1815}
1816#[derive(Builder, Debug, PartialEq)]
1817pub struct ContainerWithFilesOpts<'a> {
1818    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1819    #[builder(setter(into, strip_option), default)]
1820    pub expand: Option<bool>,
1821    /// A user:group to set for the files.
1822    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1823    /// If the group is omitted, it defaults to the same as the user.
1824    #[builder(setter(into, strip_option), default)]
1825    pub owner: Option<&'a str>,
1826    /// Permission given to the copied files (e.g., 0600).
1827    #[builder(setter(into, strip_option), default)]
1828    pub permissions: Option<isize>,
1829}
1830#[derive(Builder, Debug, PartialEq)]
1831pub struct ContainerWithMountedCacheOpts<'a> {
1832    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1833    #[builder(setter(into, strip_option), default)]
1834    pub expand: Option<bool>,
1835    /// A user:group to set for the mounted cache directory.
1836    /// 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.
1837    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1838    /// If the group is omitted, it defaults to the same as the user.
1839    #[builder(setter(into, strip_option), default)]
1840    pub owner: Option<&'a str>,
1841    /// Sharing mode of the cache volume.
1842    #[builder(setter(into, strip_option), default)]
1843    pub sharing: Option<CacheSharingMode>,
1844    /// Identifier of the directory to use as the cache volume's root.
1845    #[builder(setter(into, strip_option), default)]
1846    pub source: Option<Id>,
1847}
1848#[derive(Builder, Debug, PartialEq)]
1849pub struct ContainerWithMountedDirectoryOpts<'a> {
1850    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1851    #[builder(setter(into, strip_option), default)]
1852    pub expand: Option<bool>,
1853    /// A user:group to set for the mounted directory and its contents.
1854    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1855    /// If the group is omitted, it defaults to the same as the user.
1856    #[builder(setter(into, strip_option), default)]
1857    pub owner: Option<&'a str>,
1858    /// Mount the directory read-only.
1859    #[builder(setter(into, strip_option), default)]
1860    pub read_only: Option<bool>,
1861}
1862#[derive(Builder, Debug, PartialEq)]
1863pub struct ContainerWithMountedFileOpts<'a> {
1864    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1865    #[builder(setter(into, strip_option), default)]
1866    pub expand: Option<bool>,
1867    /// A user or user:group to set for the mounted file.
1868    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1869    /// If the group is omitted, it defaults to the same as the user.
1870    #[builder(setter(into, strip_option), default)]
1871    pub owner: Option<&'a str>,
1872}
1873#[derive(Builder, Debug, PartialEq)]
1874pub struct ContainerWithMountedSecretOpts<'a> {
1875    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1876    #[builder(setter(into, strip_option), default)]
1877    pub expand: Option<bool>,
1878    /// Permission given to the mounted secret (e.g., 0600).
1879    /// This option requires an owner to be set to be active.
1880    #[builder(setter(into, strip_option), default)]
1881    pub mode: Option<isize>,
1882    /// A user:group to set for the mounted secret.
1883    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1884    /// If the group is omitted, it defaults to the same as the user.
1885    #[builder(setter(into, strip_option), default)]
1886    pub owner: Option<&'a str>,
1887}
1888#[derive(Builder, Debug, PartialEq)]
1889pub struct ContainerWithMountedTempOpts {
1890    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1891    #[builder(setter(into, strip_option), default)]
1892    pub expand: Option<bool>,
1893    /// Size of the temporary directory in bytes.
1894    #[builder(setter(into, strip_option), default)]
1895    pub size: Option<isize>,
1896}
1897#[derive(Builder, Debug, PartialEq)]
1898pub struct ContainerWithMountedVolumeOpts {
1899    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1900    #[builder(setter(into, strip_option), default)]
1901    pub expand: Option<bool>,
1902    /// Mount the volume read-only.
1903    #[builder(setter(into, strip_option), default)]
1904    pub read_only: Option<bool>,
1905}
1906#[derive(Builder, Debug, PartialEq)]
1907pub struct ContainerWithNewFileOpts<'a> {
1908    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1909    #[builder(setter(into, strip_option), default)]
1910    pub expand: Option<bool>,
1911    /// A user:group to set for the file.
1912    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1913    /// If the group is omitted, it defaults to the same as the user.
1914    #[builder(setter(into, strip_option), default)]
1915    pub owner: Option<&'a str>,
1916    /// Permissions of the new file. Example: 0600
1917    #[builder(setter(into, strip_option), default)]
1918    pub permissions: Option<isize>,
1919}
1920#[derive(Builder, Debug, PartialEq)]
1921pub struct ContainerWithSymlinkOpts {
1922    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1923    #[builder(setter(into, strip_option), default)]
1924    pub expand: Option<bool>,
1925}
1926#[derive(Builder, Debug, PartialEq)]
1927pub struct ContainerWithUnixSocketOpts<'a> {
1928    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1929    #[builder(setter(into, strip_option), default)]
1930    pub expand: Option<bool>,
1931    /// A user:group to set for the mounted socket.
1932    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1933    /// If the group is omitted, it defaults to the same as the user.
1934    #[builder(setter(into, strip_option), default)]
1935    pub owner: Option<&'a str>,
1936}
1937#[derive(Builder, Debug, PartialEq)]
1938pub struct ContainerWithWorkdirOpts {
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}
1943#[derive(Builder, Debug, PartialEq)]
1944pub struct ContainerWithoutDirectoryOpts {
1945    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1946    #[builder(setter(into, strip_option), default)]
1947    pub expand: Option<bool>,
1948}
1949#[derive(Builder, Debug, PartialEq)]
1950pub struct ContainerWithoutEntrypointOpts {
1951    /// Don't remove the default arguments when unsetting the entrypoint.
1952    #[builder(setter(into, strip_option), default)]
1953    pub keep_default_args: Option<bool>,
1954}
1955#[derive(Builder, Debug, PartialEq)]
1956pub struct ContainerWithoutExposedPortOpts {
1957    /// Port protocol to unexpose
1958    #[builder(setter(into, strip_option), default)]
1959    pub protocol: Option<NetworkProtocol>,
1960}
1961#[derive(Builder, Debug, PartialEq)]
1962pub struct ContainerWithoutFileOpts {
1963    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1964    #[builder(setter(into, strip_option), default)]
1965    pub expand: Option<bool>,
1966}
1967#[derive(Builder, Debug, PartialEq)]
1968pub struct ContainerWithoutFilesOpts {
1969    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1970    #[builder(setter(into, strip_option), default)]
1971    pub expand: Option<bool>,
1972}
1973#[derive(Builder, Debug, PartialEq)]
1974pub struct ContainerWithoutMountOpts {
1975    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1976    #[builder(setter(into, strip_option), default)]
1977    pub expand: Option<bool>,
1978}
1979#[derive(Builder, Debug, PartialEq)]
1980pub struct ContainerWithoutUnixSocketOpts {
1981    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1982    #[builder(setter(into, strip_option), default)]
1983    pub expand: Option<bool>,
1984}
1985impl IntoID<Id> for Container {
1986    fn into_id(
1987        self,
1988    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1989        Box::pin(async move { self.id().await })
1990    }
1991}
1992impl Loadable for Container {
1993    fn graphql_type() -> &'static str {
1994        "Container"
1995    }
1996    fn from_query(
1997        proc: Option<Arc<DaggerSessionProc>>,
1998        selection: Selection,
1999        graphql_client: DynGraphQLClient,
2000    ) -> Self {
2001        Self {
2002            proc,
2003            selection,
2004            graphql_client,
2005        }
2006    }
2007}
2008impl Container {
2009    /// Turn the container into a Service.
2010    /// Be sure to set any exposed ports before this conversion.
2011    ///
2012    /// # Arguments
2013    ///
2014    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2015    pub fn as_service(&self) -> Service {
2016        let query = self.selection.select("asService");
2017        Service {
2018            proc: self.proc.clone(),
2019            selection: query,
2020            graphql_client: self.graphql_client.clone(),
2021        }
2022    }
2023    /// Turn the container into a Service.
2024    /// Be sure to set any exposed ports before this conversion.
2025    ///
2026    /// # Arguments
2027    ///
2028    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2029    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2030        let mut query = self.selection.select("asService");
2031        if let Some(args) = opts.args {
2032            query = query.arg("args", args);
2033        }
2034        if let Some(use_entrypoint) = opts.use_entrypoint {
2035            query = query.arg("useEntrypoint", use_entrypoint);
2036        }
2037        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2038            query = query.arg(
2039                "experimentalPrivilegedNesting",
2040                experimental_privileged_nesting,
2041            );
2042        }
2043        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2044            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2045        }
2046        if let Some(expand) = opts.expand {
2047            query = query.arg("expand", expand);
2048        }
2049        if let Some(no_init) = opts.no_init {
2050            query = query.arg("noInit", no_init);
2051        }
2052        Service {
2053            proc: self.proc.clone(),
2054            selection: query,
2055            graphql_client: self.graphql_client.clone(),
2056        }
2057    }
2058    /// Package the container state as an OCI image, and return it as a tar archive
2059    ///
2060    /// # Arguments
2061    ///
2062    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2063    pub fn as_tarball(&self) -> File {
2064        let query = self.selection.select("asTarball");
2065        File {
2066            proc: self.proc.clone(),
2067            selection: query,
2068            graphql_client: self.graphql_client.clone(),
2069        }
2070    }
2071    /// Package the container state as an OCI image, and return it as a tar archive
2072    ///
2073    /// # Arguments
2074    ///
2075    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2076    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2077        let mut query = self.selection.select("asTarball");
2078        if let Some(platform_variants) = opts.platform_variants {
2079            query = query.arg("platformVariants", platform_variants);
2080        }
2081        if let Some(forced_compression) = opts.forced_compression {
2082            query = query.arg("forcedCompression", forced_compression);
2083        }
2084        if let Some(media_types) = opts.media_types {
2085            query = query.arg("mediaTypes", media_types);
2086        }
2087        File {
2088            proc: self.proc.clone(),
2089            selection: query,
2090            graphql_client: self.graphql_client.clone(),
2091        }
2092    }
2093    /// The combined buffered standard output and standard error stream of the last executed command
2094    /// Returns an error if no command was executed
2095    pub async fn combined_output(&self) -> Result<String, DaggerError> {
2096        let query = self.selection.select("combinedOutput");
2097        query.execute(self.graphql_client.clone()).await
2098    }
2099    /// Return the container's default arguments.
2100    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2101        let query = self.selection.select("defaultArgs");
2102        query.execute(self.graphql_client.clone()).await
2103    }
2104    /// Retrieve a directory from the container's root filesystem
2105    /// Mounts are included.
2106    ///
2107    /// # Arguments
2108    ///
2109    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2110    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2111    pub fn directory(&self, path: impl Into<String>) -> Directory {
2112        let mut query = self.selection.select("directory");
2113        query = query.arg("path", path.into());
2114        Directory {
2115            proc: self.proc.clone(),
2116            selection: query,
2117            graphql_client: self.graphql_client.clone(),
2118        }
2119    }
2120    /// Retrieve a directory from the container's root filesystem
2121    /// Mounts are included.
2122    ///
2123    /// # Arguments
2124    ///
2125    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2126    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2127    pub fn directory_opts(
2128        &self,
2129        path: impl Into<String>,
2130        opts: ContainerDirectoryOpts,
2131    ) -> Directory {
2132        let mut query = self.selection.select("directory");
2133        query = query.arg("path", path.into());
2134        if let Some(expand) = opts.expand {
2135            query = query.arg("expand", expand);
2136        }
2137        Directory {
2138            proc: self.proc.clone(),
2139            selection: query,
2140            graphql_client: self.graphql_client.clone(),
2141        }
2142    }
2143    /// Retrieves this container's configured docker healthcheck.
2144    pub fn docker_healthcheck(&self) -> HealthcheckConfig {
2145        let query = self.selection.select("dockerHealthcheck");
2146        HealthcheckConfig {
2147            proc: self.proc.clone(),
2148            selection: query,
2149            graphql_client: self.graphql_client.clone(),
2150        }
2151    }
2152    /// Return the container's OCI entrypoint.
2153    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2154        let query = self.selection.select("entrypoint");
2155        query.execute(self.graphql_client.clone()).await
2156    }
2157    /// Retrieves the value of the specified persistent environment variable.
2158    ///
2159    /// # Arguments
2160    ///
2161    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
2162    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2163        let mut query = self.selection.select("envVariable");
2164        query = query.arg("name", name.into());
2165        query.execute(self.graphql_client.clone()).await
2166    }
2167    /// Retrieves the list of persistent environment variables configured on the container.
2168    pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2169        let query = self.selection.select("envVariables");
2170        let query = query.select("id");
2171        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2172        Ok(ids
2173            .into_iter()
2174            .map(|id| EnvVariable {
2175                proc: self.proc.clone(),
2176                selection: crate::querybuilder::query()
2177                    .select("node")
2178                    .arg("id", &id.0)
2179                    .inline_fragment("EnvVariable"),
2180                graphql_client: self.graphql_client.clone(),
2181            })
2182            .collect())
2183    }
2184    /// check if a file or directory exists
2185    ///
2186    /// # Arguments
2187    ///
2188    /// * `path` - Path to check (e.g., "/file.txt").
2189    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2190    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2191        let mut query = self.selection.select("exists");
2192        query = query.arg("path", path.into());
2193        query.execute(self.graphql_client.clone()).await
2194    }
2195    /// check if a file or directory exists
2196    ///
2197    /// # Arguments
2198    ///
2199    /// * `path` - Path to check (e.g., "/file.txt").
2200    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2201    pub async fn exists_opts(
2202        &self,
2203        path: impl Into<String>,
2204        opts: ContainerExistsOpts,
2205    ) -> Result<bool, DaggerError> {
2206        let mut query = self.selection.select("exists");
2207        query = query.arg("path", path.into());
2208        if let Some(expected_type) = opts.expected_type {
2209            query = query.arg("expectedType", expected_type);
2210        }
2211        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2212            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2213        }
2214        if let Some(expand) = opts.expand {
2215            query = query.arg("expand", expand);
2216        }
2217        query.execute(self.graphql_client.clone()).await
2218    }
2219    /// The exit code of the last executed command
2220    /// Returns an error if no command was executed
2221    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2222        let query = self.selection.select("exitCode");
2223        query.execute(self.graphql_client.clone()).await
2224    }
2225    /// EXPERIMENTAL API! Subject to change/removal at any time.
2226    /// Configures all available GPUs on the host to be accessible to this container.
2227    /// This currently works for Nvidia devices only.
2228    pub fn experimental_with_all_gp_us(&self) -> Container {
2229        let query = self.selection.select("experimentalWithAllGPUs");
2230        Container {
2231            proc: self.proc.clone(),
2232            selection: query,
2233            graphql_client: self.graphql_client.clone(),
2234        }
2235    }
2236    /// EXPERIMENTAL API! Subject to change/removal at any time.
2237    /// Configures the provided list of devices to be accessible to this container.
2238    /// This currently works for Nvidia devices only.
2239    ///
2240    /// # Arguments
2241    ///
2242    /// * `devices` - List of devices to be accessible to this container.
2243    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2244        let mut query = self.selection.select("experimentalWithGPU");
2245        query = query.arg(
2246            "devices",
2247            devices
2248                .into_iter()
2249                .map(|i| i.into())
2250                .collect::<Vec<String>>(),
2251        );
2252        Container {
2253            proc: self.proc.clone(),
2254            selection: query,
2255            graphql_client: self.graphql_client.clone(),
2256        }
2257    }
2258    /// Writes the container as an OCI tarball to the destination file path on the host.
2259    /// It can also export platform variants.
2260    ///
2261    /// # Arguments
2262    ///
2263    /// * `path` - Host's destination path (e.g., "./tarball").
2264    ///
2265    /// Path can be relative to the engine's workdir or absolute.
2266    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2267    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2268        let mut query = self.selection.select("export");
2269        query = query.arg("path", path.into());
2270        query.execute(self.graphql_client.clone()).await
2271    }
2272    /// Writes the container as an OCI tarball to the destination file path on the host.
2273    /// It can also export platform variants.
2274    ///
2275    /// # Arguments
2276    ///
2277    /// * `path` - Host's destination path (e.g., "./tarball").
2278    ///
2279    /// Path can be relative to the engine's workdir or absolute.
2280    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2281    pub async fn export_opts(
2282        &self,
2283        path: impl Into<String>,
2284        opts: ContainerExportOpts,
2285    ) -> Result<String, DaggerError> {
2286        let mut query = self.selection.select("export");
2287        query = query.arg("path", path.into());
2288        if let Some(platform_variants) = opts.platform_variants {
2289            query = query.arg("platformVariants", platform_variants);
2290        }
2291        if let Some(forced_compression) = opts.forced_compression {
2292            query = query.arg("forcedCompression", forced_compression);
2293        }
2294        if let Some(media_types) = opts.media_types {
2295            query = query.arg("mediaTypes", media_types);
2296        }
2297        if let Some(expand) = opts.expand {
2298            query = query.arg("expand", expand);
2299        }
2300        query.execute(self.graphql_client.clone()).await
2301    }
2302    /// Exports the container as an image to the host's container image store.
2303    ///
2304    /// # Arguments
2305    ///
2306    /// * `name` - Name of image to export to in the host's store
2307    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2308    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2309        let mut query = self.selection.select("exportImage");
2310        query = query.arg("name", name.into());
2311        query.execute(self.graphql_client.clone()).await
2312    }
2313    /// Exports the container as an image to the host's container image store.
2314    ///
2315    /// # Arguments
2316    ///
2317    /// * `name` - Name of image to export to in the host's store
2318    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2319    pub async fn export_image_opts(
2320        &self,
2321        name: impl Into<String>,
2322        opts: ContainerExportImageOpts,
2323    ) -> Result<Void, DaggerError> {
2324        let mut query = self.selection.select("exportImage");
2325        query = query.arg("name", name.into());
2326        if let Some(platform_variants) = opts.platform_variants {
2327            query = query.arg("platformVariants", platform_variants);
2328        }
2329        if let Some(forced_compression) = opts.forced_compression {
2330            query = query.arg("forcedCompression", forced_compression);
2331        }
2332        if let Some(media_types) = opts.media_types {
2333            query = query.arg("mediaTypes", media_types);
2334        }
2335        query.execute(self.graphql_client.clone()).await
2336    }
2337    /// Retrieves the list of exposed ports.
2338    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
2339    pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
2340        let query = self.selection.select("exposedPorts");
2341        let query = query.select("id");
2342        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2343        Ok(ids
2344            .into_iter()
2345            .map(|id| Port {
2346                proc: self.proc.clone(),
2347                selection: crate::querybuilder::query()
2348                    .select("node")
2349                    .arg("id", &id.0)
2350                    .inline_fragment("Port"),
2351                graphql_client: self.graphql_client.clone(),
2352            })
2353            .collect())
2354    }
2355    /// Retrieves a file at the given path.
2356    /// Mounts are included.
2357    ///
2358    /// # Arguments
2359    ///
2360    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2361    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2362    pub fn file(&self, path: impl Into<String>) -> File {
2363        let mut query = self.selection.select("file");
2364        query = query.arg("path", path.into());
2365        File {
2366            proc: self.proc.clone(),
2367            selection: query,
2368            graphql_client: self.graphql_client.clone(),
2369        }
2370    }
2371    /// Retrieves a file at the given path.
2372    /// Mounts are included.
2373    ///
2374    /// # Arguments
2375    ///
2376    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2377    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2378    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2379        let mut query = self.selection.select("file");
2380        query = query.arg("path", path.into());
2381        if let Some(expand) = opts.expand {
2382            query = query.arg("expand", expand);
2383        }
2384        File {
2385            proc: self.proc.clone(),
2386            selection: query,
2387            graphql_client: self.graphql_client.clone(),
2388        }
2389    }
2390    /// Download a container image, and apply it to the container state. All previous state will be lost.
2391    ///
2392    /// # Arguments
2393    ///
2394    /// * `address` - Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
2395    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2396    pub fn from(&self, address: impl Into<String>) -> Container {
2397        let mut query = self.selection.select("from");
2398        query = query.arg("address", address.into());
2399        Container {
2400            proc: self.proc.clone(),
2401            selection: query,
2402            graphql_client: self.graphql_client.clone(),
2403        }
2404    }
2405    /// Download a container image, and apply it to the container state. All previous state will be lost.
2406    ///
2407    /// # Arguments
2408    ///
2409    /// * `address` - Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
2410    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2411    pub fn from_opts(&self, address: impl Into<String>, opts: ContainerFromOpts) -> Container {
2412        let mut query = self.selection.select("from");
2413        query = query.arg("address", address.into());
2414        if let Some(registry_service) = opts.registry_service {
2415            query = query.arg("registryService", registry_service);
2416        }
2417        Container {
2418            proc: self.proc.clone(),
2419            selection: query,
2420            graphql_client: self.graphql_client.clone(),
2421        }
2422    }
2423    /// A unique identifier for this Container.
2424    pub async fn id(&self) -> Result<Id, DaggerError> {
2425        let query = self.selection.select("id");
2426        query.execute(self.graphql_client.clone()).await
2427    }
2428    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
2429    pub async fn image_ref(&self) -> Result<String, DaggerError> {
2430        let query = self.selection.select("imageRef");
2431        query.execute(self.graphql_client.clone()).await
2432    }
2433    /// Reads the container from an OCI tarball.
2434    ///
2435    /// # Arguments
2436    ///
2437    /// * `source` - File to read the container from.
2438    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2439    pub fn import(&self, source: impl IntoID<Id>) -> Container {
2440        let mut query = self.selection.select("import");
2441        query = query.arg_lazy(
2442            "source",
2443            Box::new(move || {
2444                let source = source.clone();
2445                Box::pin(async move { source.into_id().await.unwrap().quote() })
2446            }),
2447        );
2448        Container {
2449            proc: self.proc.clone(),
2450            selection: query,
2451            graphql_client: self.graphql_client.clone(),
2452        }
2453    }
2454    /// Reads the container from an OCI tarball.
2455    ///
2456    /// # Arguments
2457    ///
2458    /// * `source` - File to read the container from.
2459    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2460    pub fn import_opts<'a>(
2461        &self,
2462        source: impl IntoID<Id>,
2463        opts: ContainerImportOpts<'a>,
2464    ) -> Container {
2465        let mut query = self.selection.select("import");
2466        query = query.arg_lazy(
2467            "source",
2468            Box::new(move || {
2469                let source = source.clone();
2470                Box::pin(async move { source.into_id().await.unwrap().quote() })
2471            }),
2472        );
2473        if let Some(tag) = opts.tag {
2474            query = query.arg("tag", tag);
2475        }
2476        Container {
2477            proc: self.proc.clone(),
2478            selection: query,
2479            graphql_client: self.graphql_client.clone(),
2480        }
2481    }
2482    /// Retrieves the value of the specified label.
2483    ///
2484    /// # Arguments
2485    ///
2486    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
2487    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2488        let mut query = self.selection.select("label");
2489        query = query.arg("name", name.into());
2490        query.execute(self.graphql_client.clone()).await
2491    }
2492    /// Retrieves the list of labels passed to container.
2493    pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
2494        let query = self.selection.select("labels");
2495        let query = query.select("id");
2496        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2497        Ok(ids
2498            .into_iter()
2499            .map(|id| Label {
2500                proc: self.proc.clone(),
2501                selection: crate::querybuilder::query()
2502                    .select("node")
2503                    .arg("id", &id.0)
2504                    .inline_fragment("Label"),
2505                graphql_client: self.graphql_client.clone(),
2506            })
2507            .collect())
2508    }
2509    /// Retrieves the list of paths where a directory is mounted.
2510    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2511        let query = self.selection.select("mounts");
2512        query.execute(self.graphql_client.clone()).await
2513    }
2514    /// The platform this container executes and publishes as.
2515    pub async fn platform(&self) -> Result<Platform, DaggerError> {
2516        let query = self.selection.select("platform");
2517        query.execute(self.graphql_client.clone()).await
2518    }
2519    /// Package the container state as an OCI image, and publish it to a registry
2520    /// Returns the fully qualified address of the published image, with digest
2521    ///
2522    /// # Arguments
2523    ///
2524    /// * `address` - The OCI address to publish to
2525    ///
2526    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
2527    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2528    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2529        let mut query = self.selection.select("publish");
2530        query = query.arg("address", address.into());
2531        query.execute(self.graphql_client.clone()).await
2532    }
2533    /// Package the container state as an OCI image, and publish it to a registry
2534    /// Returns the fully qualified address of the published image, with digest
2535    ///
2536    /// # Arguments
2537    ///
2538    /// * `address` - The OCI address to publish to
2539    ///
2540    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
2541    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2542    pub async fn publish_opts(
2543        &self,
2544        address: impl Into<String>,
2545        opts: ContainerPublishOpts,
2546    ) -> Result<String, DaggerError> {
2547        let mut query = self.selection.select("publish");
2548        query = query.arg("address", address.into());
2549        if let Some(platform_variants) = opts.platform_variants {
2550            query = query.arg("platformVariants", platform_variants);
2551        }
2552        if let Some(forced_compression) = opts.forced_compression {
2553            query = query.arg("forcedCompression", forced_compression);
2554        }
2555        if let Some(media_types) = opts.media_types {
2556            query = query.arg("mediaTypes", media_types);
2557        }
2558        if let Some(registry_service) = opts.registry_service {
2559            query = query.arg("registryService", registry_service);
2560        }
2561        query.execute(self.graphql_client.clone()).await
2562    }
2563    /// 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.
2564    pub fn rootfs(&self) -> Directory {
2565        let query = self.selection.select("rootfs");
2566        Directory {
2567            proc: self.proc.clone(),
2568            selection: query,
2569            graphql_client: self.graphql_client.clone(),
2570        }
2571    }
2572    /// Return file status
2573    ///
2574    /// # Arguments
2575    ///
2576    /// * `path` - Path to check (e.g., "/file.txt").
2577    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2578    pub fn stat(&self, path: impl Into<String>) -> Stat {
2579        let mut query = self.selection.select("stat");
2580        query = query.arg("path", path.into());
2581        Stat {
2582            proc: self.proc.clone(),
2583            selection: query,
2584            graphql_client: self.graphql_client.clone(),
2585        }
2586    }
2587    /// Return file status
2588    ///
2589    /// # Arguments
2590    ///
2591    /// * `path` - Path to check (e.g., "/file.txt").
2592    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2593    pub fn stat_opts(&self, path: impl Into<String>, opts: ContainerStatOpts) -> Stat {
2594        let mut query = self.selection.select("stat");
2595        query = query.arg("path", path.into());
2596        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2597            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2598        }
2599        Stat {
2600            proc: self.proc.clone(),
2601            selection: query,
2602            graphql_client: self.graphql_client.clone(),
2603        }
2604    }
2605    /// The buffered standard error stream of the last executed command
2606    /// Returns an error if no command was executed
2607    pub async fn stderr(&self) -> Result<String, DaggerError> {
2608        let query = self.selection.select("stderr");
2609        query.execute(self.graphql_client.clone()).await
2610    }
2611    /// The buffered standard output stream of the last executed command
2612    /// Returns an error if no command was executed
2613    pub async fn stdout(&self) -> Result<String, DaggerError> {
2614        let query = self.selection.select("stdout");
2615        query.execute(self.graphql_client.clone()).await
2616    }
2617    /// Forces evaluation of the pipeline in the engine.
2618    /// It doesn't run the default command if no exec has been set.
2619    pub async fn sync(&self) -> Result<Container, DaggerError> {
2620        let query = self.selection.select("sync");
2621        let id: Id = query.execute(self.graphql_client.clone()).await?;
2622        Ok(Container {
2623            proc: self.proc.clone(),
2624            selection: query
2625                .root()
2626                .select("node")
2627                .arg("id", &id.0)
2628                .inline_fragment("Container"),
2629            graphql_client: self.graphql_client.clone(),
2630        })
2631    }
2632    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2633    ///
2634    /// # Arguments
2635    ///
2636    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2637    pub fn terminal(&self) -> Container {
2638        let query = self.selection.select("terminal");
2639        Container {
2640            proc: self.proc.clone(),
2641            selection: query,
2642            graphql_client: self.graphql_client.clone(),
2643        }
2644    }
2645    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2646    ///
2647    /// # Arguments
2648    ///
2649    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2650    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2651        let mut query = self.selection.select("terminal");
2652        if let Some(cmd) = opts.cmd {
2653            query = query.arg("cmd", cmd);
2654        }
2655        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2656            query = query.arg(
2657                "experimentalPrivilegedNesting",
2658                experimental_privileged_nesting,
2659            );
2660        }
2661        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2662            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2663        }
2664        Container {
2665            proc: self.proc.clone(),
2666            selection: query,
2667            graphql_client: self.graphql_client.clone(),
2668        }
2669    }
2670    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
2671    /// Be sure to set any exposed ports before calling this api.
2672    ///
2673    /// # Arguments
2674    ///
2675    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2676    pub async fn up(&self) -> Result<Void, DaggerError> {
2677        let query = self.selection.select("up");
2678        query.execute(self.graphql_client.clone()).await
2679    }
2680    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
2681    /// Be sure to set any exposed ports before calling this api.
2682    ///
2683    /// # Arguments
2684    ///
2685    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2686    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
2687        let mut query = self.selection.select("up");
2688        if let Some(random) = opts.random {
2689            query = query.arg("random", random);
2690        }
2691        if let Some(ports) = opts.ports {
2692            query = query.arg("ports", ports);
2693        }
2694        if let Some(args) = opts.args {
2695            query = query.arg("args", args);
2696        }
2697        if let Some(use_entrypoint) = opts.use_entrypoint {
2698            query = query.arg("useEntrypoint", use_entrypoint);
2699        }
2700        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2701            query = query.arg(
2702                "experimentalPrivilegedNesting",
2703                experimental_privileged_nesting,
2704            );
2705        }
2706        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2707            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2708        }
2709        if let Some(expand) = opts.expand {
2710            query = query.arg("expand", expand);
2711        }
2712        if let Some(no_init) = opts.no_init {
2713            query = query.arg("noInit", no_init);
2714        }
2715        query.execute(self.graphql_client.clone()).await
2716    }
2717    /// Retrieves the user to be set for all commands.
2718    pub async fn user(&self) -> Result<String, DaggerError> {
2719        let query = self.selection.select("user");
2720        query.execute(self.graphql_client.clone()).await
2721    }
2722    /// Retrieves this container plus the given OCI annotation.
2723    ///
2724    /// # Arguments
2725    ///
2726    /// * `name` - The name of the annotation.
2727    /// * `value` - The value of the annotation.
2728    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2729        let mut query = self.selection.select("withAnnotation");
2730        query = query.arg("name", name.into());
2731        query = query.arg("value", value.into());
2732        Container {
2733            proc: self.proc.clone(),
2734            selection: query,
2735            graphql_client: self.graphql_client.clone(),
2736        }
2737    }
2738    /// Configures default arguments for future commands. Like CMD in Dockerfile.
2739    ///
2740    /// # Arguments
2741    ///
2742    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
2743    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
2744        let mut query = self.selection.select("withDefaultArgs");
2745        query = query.arg(
2746            "args",
2747            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2748        );
2749        Container {
2750            proc: self.proc.clone(),
2751            selection: query,
2752            graphql_client: self.graphql_client.clone(),
2753        }
2754    }
2755    /// Set the default command to invoke for the container's terminal API.
2756    ///
2757    /// # Arguments
2758    ///
2759    /// * `args` - The args of the command.
2760    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2761    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
2762        let mut query = self.selection.select("withDefaultTerminalCmd");
2763        query = query.arg(
2764            "args",
2765            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2766        );
2767        Container {
2768            proc: self.proc.clone(),
2769            selection: query,
2770            graphql_client: self.graphql_client.clone(),
2771        }
2772    }
2773    /// Set the default command to invoke for the container's terminal API.
2774    ///
2775    /// # Arguments
2776    ///
2777    /// * `args` - The args of the command.
2778    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2779    pub fn with_default_terminal_cmd_opts(
2780        &self,
2781        args: Vec<impl Into<String>>,
2782        opts: ContainerWithDefaultTerminalCmdOpts,
2783    ) -> Container {
2784        let mut query = self.selection.select("withDefaultTerminalCmd");
2785        query = query.arg(
2786            "args",
2787            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2788        );
2789        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2790            query = query.arg(
2791                "experimentalPrivilegedNesting",
2792                experimental_privileged_nesting,
2793            );
2794        }
2795        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2796            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2797        }
2798        Container {
2799            proc: self.proc.clone(),
2800            selection: query,
2801            graphql_client: self.graphql_client.clone(),
2802        }
2803    }
2804    /// Return a new container snapshot, with a directory added to its filesystem
2805    ///
2806    /// # Arguments
2807    ///
2808    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
2809    /// * `source` - Identifier of the directory to write
2810    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2811    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
2812        let mut query = self.selection.select("withDirectory");
2813        query = query.arg("path", path.into());
2814        query = query.arg_lazy(
2815            "source",
2816            Box::new(move || {
2817                let source = source.clone();
2818                Box::pin(async move { source.into_id().await.unwrap().quote() })
2819            }),
2820        );
2821        Container {
2822            proc: self.proc.clone(),
2823            selection: query,
2824            graphql_client: self.graphql_client.clone(),
2825        }
2826    }
2827    /// Return a new container snapshot, with a directory added to its filesystem
2828    ///
2829    /// # Arguments
2830    ///
2831    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
2832    /// * `source` - Identifier of the directory to write
2833    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2834    pub fn with_directory_opts<'a>(
2835        &self,
2836        path: impl Into<String>,
2837        source: impl IntoID<Id>,
2838        opts: ContainerWithDirectoryOpts<'a>,
2839    ) -> Container {
2840        let mut query = self.selection.select("withDirectory");
2841        query = query.arg("path", path.into());
2842        query = query.arg_lazy(
2843            "source",
2844            Box::new(move || {
2845                let source = source.clone();
2846                Box::pin(async move { source.into_id().await.unwrap().quote() })
2847            }),
2848        );
2849        if let Some(exclude) = opts.exclude {
2850            query = query.arg("exclude", exclude);
2851        }
2852        if let Some(include) = opts.include {
2853            query = query.arg("include", include);
2854        }
2855        if let Some(gitignore) = opts.gitignore {
2856            query = query.arg("gitignore", gitignore);
2857        }
2858        if let Some(owner) = opts.owner {
2859            query = query.arg("owner", owner);
2860        }
2861        if let Some(expand) = opts.expand {
2862            query = query.arg("expand", expand);
2863        }
2864        if let Some(permissions) = opts.permissions {
2865            query = query.arg("permissions", permissions);
2866        }
2867        Container {
2868            proc: self.proc.clone(),
2869            selection: query,
2870            graphql_client: self.graphql_client.clone(),
2871        }
2872    }
2873    /// Retrieves this container with the specificed docker healtcheck command set.
2874    ///
2875    /// # Arguments
2876    ///
2877    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
2878    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2879    pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
2880        let mut query = self.selection.select("withDockerHealthcheck");
2881        query = query.arg(
2882            "args",
2883            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2884        );
2885        Container {
2886            proc: self.proc.clone(),
2887            selection: query,
2888            graphql_client: self.graphql_client.clone(),
2889        }
2890    }
2891    /// Retrieves this container with the specificed docker healtcheck command set.
2892    ///
2893    /// # Arguments
2894    ///
2895    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
2896    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2897    pub fn with_docker_healthcheck_opts<'a>(
2898        &self,
2899        args: Vec<impl Into<String>>,
2900        opts: ContainerWithDockerHealthcheckOpts<'a>,
2901    ) -> Container {
2902        let mut query = self.selection.select("withDockerHealthcheck");
2903        query = query.arg(
2904            "args",
2905            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2906        );
2907        if let Some(shell) = opts.shell {
2908            query = query.arg("shell", shell);
2909        }
2910        if let Some(interval) = opts.interval {
2911            query = query.arg("interval", interval);
2912        }
2913        if let Some(timeout) = opts.timeout {
2914            query = query.arg("timeout", timeout);
2915        }
2916        if let Some(start_period) = opts.start_period {
2917            query = query.arg("startPeriod", start_period);
2918        }
2919        if let Some(start_interval) = opts.start_interval {
2920            query = query.arg("startInterval", start_interval);
2921        }
2922        if let Some(retries) = opts.retries {
2923            query = query.arg("retries", retries);
2924        }
2925        Container {
2926            proc: self.proc.clone(),
2927            selection: query,
2928            graphql_client: self.graphql_client.clone(),
2929        }
2930    }
2931    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
2932    ///
2933    /// # Arguments
2934    ///
2935    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
2936    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2937    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
2938        let mut query = self.selection.select("withEntrypoint");
2939        query = query.arg(
2940            "args",
2941            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2942        );
2943        Container {
2944            proc: self.proc.clone(),
2945            selection: query,
2946            graphql_client: self.graphql_client.clone(),
2947        }
2948    }
2949    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
2950    ///
2951    /// # Arguments
2952    ///
2953    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
2954    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2955    pub fn with_entrypoint_opts(
2956        &self,
2957        args: Vec<impl Into<String>>,
2958        opts: ContainerWithEntrypointOpts,
2959    ) -> Container {
2960        let mut query = self.selection.select("withEntrypoint");
2961        query = query.arg(
2962            "args",
2963            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2964        );
2965        if let Some(keep_default_args) = opts.keep_default_args {
2966            query = query.arg("keepDefaultArgs", keep_default_args);
2967        }
2968        Container {
2969            proc: self.proc.clone(),
2970            selection: query,
2971            graphql_client: self.graphql_client.clone(),
2972        }
2973    }
2974    /// Export environment variables from an env-file to the container.
2975    ///
2976    /// # Arguments
2977    ///
2978    /// * `source` - Identifier of the envfile
2979    pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
2980        let mut query = self.selection.select("withEnvFileVariables");
2981        query = query.arg_lazy(
2982            "source",
2983            Box::new(move || {
2984                let source = source.clone();
2985                Box::pin(async move { source.into_id().await.unwrap().quote() })
2986            }),
2987        );
2988        Container {
2989            proc: self.proc.clone(),
2990            selection: query,
2991            graphql_client: self.graphql_client.clone(),
2992        }
2993    }
2994    /// Set a new environment variable in the container.
2995    ///
2996    /// # Arguments
2997    ///
2998    /// * `name` - Name of the environment variable (e.g., "HOST").
2999    /// * `value` - Value of the environment variable. (e.g., "localhost").
3000    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3001    pub fn with_env_variable(
3002        &self,
3003        name: impl Into<String>,
3004        value: impl Into<String>,
3005    ) -> Container {
3006        let mut query = self.selection.select("withEnvVariable");
3007        query = query.arg("name", name.into());
3008        query = query.arg("value", value.into());
3009        Container {
3010            proc: self.proc.clone(),
3011            selection: query,
3012            graphql_client: self.graphql_client.clone(),
3013        }
3014    }
3015    /// Set a new environment variable in the container.
3016    ///
3017    /// # Arguments
3018    ///
3019    /// * `name` - Name of the environment variable (e.g., "HOST").
3020    /// * `value` - Value of the environment variable. (e.g., "localhost").
3021    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3022    pub fn with_env_variable_opts(
3023        &self,
3024        name: impl Into<String>,
3025        value: impl Into<String>,
3026        opts: ContainerWithEnvVariableOpts,
3027    ) -> Container {
3028        let mut query = self.selection.select("withEnvVariable");
3029        query = query.arg("name", name.into());
3030        query = query.arg("value", value.into());
3031        if let Some(expand) = opts.expand {
3032            query = query.arg("expand", expand);
3033        }
3034        Container {
3035            proc: self.proc.clone(),
3036            selection: query,
3037            graphql_client: self.graphql_client.clone(),
3038        }
3039    }
3040    /// Raise an error.
3041    ///
3042    /// # Arguments
3043    ///
3044    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
3045    pub fn with_error(&self, err: impl Into<String>) -> Container {
3046        let mut query = self.selection.select("withError");
3047        query = query.arg("err", err.into());
3048        Container {
3049            proc: self.proc.clone(),
3050            selection: query,
3051            graphql_client: self.graphql_client.clone(),
3052        }
3053    }
3054    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3055    ///
3056    /// # Arguments
3057    ///
3058    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3059    ///
3060    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3061    ///
3062    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3063    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3064    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3065        let mut query = self.selection.select("withExec");
3066        query = query.arg(
3067            "args",
3068            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3069        );
3070        Container {
3071            proc: self.proc.clone(),
3072            selection: query,
3073            graphql_client: self.graphql_client.clone(),
3074        }
3075    }
3076    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3077    ///
3078    /// # Arguments
3079    ///
3080    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3081    ///
3082    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3083    ///
3084    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3085    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3086    pub fn with_exec_opts<'a>(
3087        &self,
3088        args: Vec<impl Into<String>>,
3089        opts: ContainerWithExecOpts<'a>,
3090    ) -> Container {
3091        let mut query = self.selection.select("withExec");
3092        query = query.arg(
3093            "args",
3094            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3095        );
3096        if let Some(use_entrypoint) = opts.use_entrypoint {
3097            query = query.arg("useEntrypoint", use_entrypoint);
3098        }
3099        if let Some(stdin) = opts.stdin {
3100            query = query.arg("stdin", stdin);
3101        }
3102        if let Some(redirect_stdin) = opts.redirect_stdin {
3103            query = query.arg("redirectStdin", redirect_stdin);
3104        }
3105        if let Some(redirect_stdout) = opts.redirect_stdout {
3106            query = query.arg("redirectStdout", redirect_stdout);
3107        }
3108        if let Some(redirect_stderr) = opts.redirect_stderr {
3109            query = query.arg("redirectStderr", redirect_stderr);
3110        }
3111        if let Some(expect) = opts.expect {
3112            query = query.arg("expect", expect);
3113        }
3114        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3115            query = query.arg(
3116                "experimentalPrivilegedNesting",
3117                experimental_privileged_nesting,
3118            );
3119        }
3120        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3121            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3122        }
3123        if let Some(expand) = opts.expand {
3124            query = query.arg("expand", expand);
3125        }
3126        if let Some(no_init) = opts.no_init {
3127            query = query.arg("noInit", no_init);
3128        }
3129        Container {
3130            proc: self.proc.clone(),
3131            selection: query,
3132            graphql_client: self.graphql_client.clone(),
3133        }
3134    }
3135    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3136    /// Exposed ports serve two purposes:
3137    /// - For health checks and introspection, when running services
3138    /// - For setting the EXPOSE OCI field when publishing the container
3139    ///
3140    /// # Arguments
3141    ///
3142    /// * `port` - Port number to expose. Example: 8080
3143    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3144    pub fn with_exposed_port(&self, port: isize) -> Container {
3145        let mut query = self.selection.select("withExposedPort");
3146        query = query.arg("port", port);
3147        Container {
3148            proc: self.proc.clone(),
3149            selection: query,
3150            graphql_client: self.graphql_client.clone(),
3151        }
3152    }
3153    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3154    /// Exposed ports serve two purposes:
3155    /// - For health checks and introspection, when running services
3156    /// - For setting the EXPOSE OCI field when publishing the container
3157    ///
3158    /// # Arguments
3159    ///
3160    /// * `port` - Port number to expose. Example: 8080
3161    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3162    pub fn with_exposed_port_opts<'a>(
3163        &self,
3164        port: isize,
3165        opts: ContainerWithExposedPortOpts<'a>,
3166    ) -> Container {
3167        let mut query = self.selection.select("withExposedPort");
3168        query = query.arg("port", port);
3169        if let Some(protocol) = opts.protocol {
3170            query = query.arg("protocol", protocol);
3171        }
3172        if let Some(description) = opts.description {
3173            query = query.arg("description", description);
3174        }
3175        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3176            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3177        }
3178        Container {
3179            proc: self.proc.clone(),
3180            selection: query,
3181            graphql_client: self.graphql_client.clone(),
3182        }
3183    }
3184    /// Return a container snapshot with a file added
3185    ///
3186    /// # Arguments
3187    ///
3188    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3189    /// * `source` - File to add
3190    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3191    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3192        let mut query = self.selection.select("withFile");
3193        query = query.arg("path", path.into());
3194        query = query.arg_lazy(
3195            "source",
3196            Box::new(move || {
3197                let source = source.clone();
3198                Box::pin(async move { source.into_id().await.unwrap().quote() })
3199            }),
3200        );
3201        Container {
3202            proc: self.proc.clone(),
3203            selection: query,
3204            graphql_client: self.graphql_client.clone(),
3205        }
3206    }
3207    /// Return a container snapshot with a file added
3208    ///
3209    /// # Arguments
3210    ///
3211    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3212    /// * `source` - File to add
3213    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3214    pub fn with_file_opts<'a>(
3215        &self,
3216        path: impl Into<String>,
3217        source: impl IntoID<Id>,
3218        opts: ContainerWithFileOpts<'a>,
3219    ) -> Container {
3220        let mut query = self.selection.select("withFile");
3221        query = query.arg("path", path.into());
3222        query = query.arg_lazy(
3223            "source",
3224            Box::new(move || {
3225                let source = source.clone();
3226                Box::pin(async move { source.into_id().await.unwrap().quote() })
3227            }),
3228        );
3229        if let Some(permissions) = opts.permissions {
3230            query = query.arg("permissions", permissions);
3231        }
3232        if let Some(owner) = opts.owner {
3233            query = query.arg("owner", owner);
3234        }
3235        if let Some(expand) = opts.expand {
3236            query = query.arg("expand", expand);
3237        }
3238        Container {
3239            proc: self.proc.clone(),
3240            selection: query,
3241            graphql_client: self.graphql_client.clone(),
3242        }
3243    }
3244    /// Retrieves this container plus the contents of the given files copied to the given path.
3245    ///
3246    /// # Arguments
3247    ///
3248    /// * `path` - Location where copied files should be placed (e.g., "/src").
3249    /// * `sources` - Identifiers of the files to copy.
3250    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3251    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
3252        let mut query = self.selection.select("withFiles");
3253        query = query.arg("path", path.into());
3254        query = query.arg("sources", sources);
3255        Container {
3256            proc: self.proc.clone(),
3257            selection: query,
3258            graphql_client: self.graphql_client.clone(),
3259        }
3260    }
3261    /// Retrieves this container plus the contents of the given files copied to the given path.
3262    ///
3263    /// # Arguments
3264    ///
3265    /// * `path` - Location where copied files should be placed (e.g., "/src").
3266    /// * `sources` - Identifiers of the files to copy.
3267    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3268    pub fn with_files_opts<'a>(
3269        &self,
3270        path: impl Into<String>,
3271        sources: Vec<Id>,
3272        opts: ContainerWithFilesOpts<'a>,
3273    ) -> Container {
3274        let mut query = self.selection.select("withFiles");
3275        query = query.arg("path", path.into());
3276        query = query.arg("sources", sources);
3277        if let Some(permissions) = opts.permissions {
3278            query = query.arg("permissions", permissions);
3279        }
3280        if let Some(owner) = opts.owner {
3281            query = query.arg("owner", owner);
3282        }
3283        if let Some(expand) = opts.expand {
3284            query = query.arg("expand", expand);
3285        }
3286        Container {
3287            proc: self.proc.clone(),
3288            selection: query,
3289            graphql_client: self.graphql_client.clone(),
3290        }
3291    }
3292    /// Retrieves this container plus the given label.
3293    ///
3294    /// # Arguments
3295    ///
3296    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3297    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
3298    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3299        let mut query = self.selection.select("withLabel");
3300        query = query.arg("name", name.into());
3301        query = query.arg("value", value.into());
3302        Container {
3303            proc: self.proc.clone(),
3304            selection: query,
3305            graphql_client: self.graphql_client.clone(),
3306        }
3307    }
3308    /// Retrieves this container plus a cache volume mounted at the given path.
3309    ///
3310    /// # Arguments
3311    ///
3312    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3313    /// * `cache` - Identifier of the cache volume to mount.
3314    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3315    pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
3316        let mut query = self.selection.select("withMountedCache");
3317        query = query.arg("path", path.into());
3318        query = query.arg_lazy(
3319            "cache",
3320            Box::new(move || {
3321                let cache = cache.clone();
3322                Box::pin(async move { cache.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 cache volume mounted at the given path.
3332    ///
3333    /// # Arguments
3334    ///
3335    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3336    /// * `cache` - Identifier of the cache volume to mount.
3337    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3338    pub fn with_mounted_cache_opts<'a>(
3339        &self,
3340        path: impl Into<String>,
3341        cache: impl IntoID<Id>,
3342        opts: ContainerWithMountedCacheOpts<'a>,
3343    ) -> Container {
3344        let mut query = self.selection.select("withMountedCache");
3345        query = query.arg("path", path.into());
3346        query = query.arg_lazy(
3347            "cache",
3348            Box::new(move || {
3349                let cache = cache.clone();
3350                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3351            }),
3352        );
3353        if let Some(source) = opts.source {
3354            query = query.arg("source", source);
3355        }
3356        if let Some(sharing) = opts.sharing {
3357            query = query.arg("sharing", sharing);
3358        }
3359        if let Some(owner) = opts.owner {
3360            query = query.arg("owner", owner);
3361        }
3362        if let Some(expand) = opts.expand {
3363            query = query.arg("expand", expand);
3364        }
3365        Container {
3366            proc: self.proc.clone(),
3367            selection: query,
3368            graphql_client: self.graphql_client.clone(),
3369        }
3370    }
3371    /// Retrieves this container plus a directory mounted at the given path.
3372    ///
3373    /// # Arguments
3374    ///
3375    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3376    /// * `source` - Identifier of the mounted directory.
3377    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3378    pub fn with_mounted_directory(
3379        &self,
3380        path: impl Into<String>,
3381        source: impl IntoID<Id>,
3382    ) -> Container {
3383        let mut query = self.selection.select("withMountedDirectory");
3384        query = query.arg("path", path.into());
3385        query = query.arg_lazy(
3386            "source",
3387            Box::new(move || {
3388                let source = source.clone();
3389                Box::pin(async move { source.into_id().await.unwrap().quote() })
3390            }),
3391        );
3392        Container {
3393            proc: self.proc.clone(),
3394            selection: query,
3395            graphql_client: self.graphql_client.clone(),
3396        }
3397    }
3398    /// Retrieves this container plus a directory mounted at the given path.
3399    ///
3400    /// # Arguments
3401    ///
3402    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3403    /// * `source` - Identifier of the mounted directory.
3404    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3405    pub fn with_mounted_directory_opts<'a>(
3406        &self,
3407        path: impl Into<String>,
3408        source: impl IntoID<Id>,
3409        opts: ContainerWithMountedDirectoryOpts<'a>,
3410    ) -> Container {
3411        let mut query = self.selection.select("withMountedDirectory");
3412        query = query.arg("path", path.into());
3413        query = query.arg_lazy(
3414            "source",
3415            Box::new(move || {
3416                let source = source.clone();
3417                Box::pin(async move { source.into_id().await.unwrap().quote() })
3418            }),
3419        );
3420        if let Some(owner) = opts.owner {
3421            query = query.arg("owner", owner);
3422        }
3423        if let Some(read_only) = opts.read_only {
3424            query = query.arg("readOnly", read_only);
3425        }
3426        if let Some(expand) = opts.expand {
3427            query = query.arg("expand", expand);
3428        }
3429        Container {
3430            proc: self.proc.clone(),
3431            selection: query,
3432            graphql_client: self.graphql_client.clone(),
3433        }
3434    }
3435    /// Retrieves this container plus a file mounted at the given path.
3436    ///
3437    /// # Arguments
3438    ///
3439    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3440    /// * `source` - Identifier of the mounted file.
3441    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3442    pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3443        let mut query = self.selection.select("withMountedFile");
3444        query = query.arg("path", path.into());
3445        query = query.arg_lazy(
3446            "source",
3447            Box::new(move || {
3448                let source = source.clone();
3449                Box::pin(async move { source.into_id().await.unwrap().quote() })
3450            }),
3451        );
3452        Container {
3453            proc: self.proc.clone(),
3454            selection: query,
3455            graphql_client: self.graphql_client.clone(),
3456        }
3457    }
3458    /// Retrieves this container plus a file mounted at the given path.
3459    ///
3460    /// # Arguments
3461    ///
3462    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3463    /// * `source` - Identifier of the mounted file.
3464    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3465    pub fn with_mounted_file_opts<'a>(
3466        &self,
3467        path: impl Into<String>,
3468        source: impl IntoID<Id>,
3469        opts: ContainerWithMountedFileOpts<'a>,
3470    ) -> Container {
3471        let mut query = self.selection.select("withMountedFile");
3472        query = query.arg("path", path.into());
3473        query = query.arg_lazy(
3474            "source",
3475            Box::new(move || {
3476                let source = source.clone();
3477                Box::pin(async move { source.into_id().await.unwrap().quote() })
3478            }),
3479        );
3480        if let Some(owner) = opts.owner {
3481            query = query.arg("owner", owner);
3482        }
3483        if let Some(expand) = opts.expand {
3484            query = query.arg("expand", expand);
3485        }
3486        Container {
3487            proc: self.proc.clone(),
3488            selection: query,
3489            graphql_client: self.graphql_client.clone(),
3490        }
3491    }
3492    /// Retrieves this container plus a secret mounted into a file at the given path.
3493    ///
3494    /// # Arguments
3495    ///
3496    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3497    /// * `source` - Identifier of the secret to mount.
3498    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3499    pub fn with_mounted_secret(
3500        &self,
3501        path: impl Into<String>,
3502        source: impl IntoID<Id>,
3503    ) -> Container {
3504        let mut query = self.selection.select("withMountedSecret");
3505        query = query.arg("path", path.into());
3506        query = query.arg_lazy(
3507            "source",
3508            Box::new(move || {
3509                let source = source.clone();
3510                Box::pin(async move { source.into_id().await.unwrap().quote() })
3511            }),
3512        );
3513        Container {
3514            proc: self.proc.clone(),
3515            selection: query,
3516            graphql_client: self.graphql_client.clone(),
3517        }
3518    }
3519    /// Retrieves this container plus a secret mounted into a file at the given path.
3520    ///
3521    /// # Arguments
3522    ///
3523    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3524    /// * `source` - Identifier of the secret to mount.
3525    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3526    pub fn with_mounted_secret_opts<'a>(
3527        &self,
3528        path: impl Into<String>,
3529        source: impl IntoID<Id>,
3530        opts: ContainerWithMountedSecretOpts<'a>,
3531    ) -> Container {
3532        let mut query = self.selection.select("withMountedSecret");
3533        query = query.arg("path", path.into());
3534        query = query.arg_lazy(
3535            "source",
3536            Box::new(move || {
3537                let source = source.clone();
3538                Box::pin(async move { source.into_id().await.unwrap().quote() })
3539            }),
3540        );
3541        if let Some(owner) = opts.owner {
3542            query = query.arg("owner", owner);
3543        }
3544        if let Some(mode) = opts.mode {
3545            query = query.arg("mode", mode);
3546        }
3547        if let Some(expand) = opts.expand {
3548            query = query.arg("expand", expand);
3549        }
3550        Container {
3551            proc: self.proc.clone(),
3552            selection: query,
3553            graphql_client: self.graphql_client.clone(),
3554        }
3555    }
3556    /// 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.
3557    ///
3558    /// # Arguments
3559    ///
3560    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3561    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3562    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3563        let mut query = self.selection.select("withMountedTemp");
3564        query = query.arg("path", path.into());
3565        Container {
3566            proc: self.proc.clone(),
3567            selection: query,
3568            graphql_client: self.graphql_client.clone(),
3569        }
3570    }
3571    /// 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.
3572    ///
3573    /// # Arguments
3574    ///
3575    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3576    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3577    pub fn with_mounted_temp_opts(
3578        &self,
3579        path: impl Into<String>,
3580        opts: ContainerWithMountedTempOpts,
3581    ) -> Container {
3582        let mut query = self.selection.select("withMountedTemp");
3583        query = query.arg("path", path.into());
3584        if let Some(size) = opts.size {
3585            query = query.arg("size", size);
3586        }
3587        if let Some(expand) = opts.expand {
3588            query = query.arg("expand", expand);
3589        }
3590        Container {
3591            proc: self.proc.clone(),
3592            selection: query,
3593            graphql_client: self.graphql_client.clone(),
3594        }
3595    }
3596    /// Retrieves this container plus a volume mounted at the given path.
3597    ///
3598    /// # Arguments
3599    ///
3600    /// * `path` - Location of the volume mount (e.g., "/mnt/volume").
3601    /// * `volume` - Identifier of the volume to mount.
3602    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3603    pub fn with_mounted_volume(
3604        &self,
3605        path: impl Into<String>,
3606        volume: impl IntoID<Id>,
3607    ) -> Container {
3608        let mut query = self.selection.select("withMountedVolume");
3609        query = query.arg("path", path.into());
3610        query = query.arg_lazy(
3611            "volume",
3612            Box::new(move || {
3613                let volume = volume.clone();
3614                Box::pin(async move { volume.into_id().await.unwrap().quote() })
3615            }),
3616        );
3617        Container {
3618            proc: self.proc.clone(),
3619            selection: query,
3620            graphql_client: self.graphql_client.clone(),
3621        }
3622    }
3623    /// Retrieves this container plus a volume mounted at the given path.
3624    ///
3625    /// # Arguments
3626    ///
3627    /// * `path` - Location of the volume mount (e.g., "/mnt/volume").
3628    /// * `volume` - Identifier of the volume to mount.
3629    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3630    pub fn with_mounted_volume_opts(
3631        &self,
3632        path: impl Into<String>,
3633        volume: impl IntoID<Id>,
3634        opts: ContainerWithMountedVolumeOpts,
3635    ) -> Container {
3636        let mut query = self.selection.select("withMountedVolume");
3637        query = query.arg("path", path.into());
3638        query = query.arg_lazy(
3639            "volume",
3640            Box::new(move || {
3641                let volume = volume.clone();
3642                Box::pin(async move { volume.into_id().await.unwrap().quote() })
3643            }),
3644        );
3645        if let Some(read_only) = opts.read_only {
3646            query = query.arg("readOnly", read_only);
3647        }
3648        if let Some(expand) = opts.expand {
3649            query = query.arg("expand", expand);
3650        }
3651        Container {
3652            proc: self.proc.clone(),
3653            selection: query,
3654            graphql_client: self.graphql_client.clone(),
3655        }
3656    }
3657    /// Return a new container snapshot, with a file added to its filesystem with text content
3658    ///
3659    /// # Arguments
3660    ///
3661    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
3662    /// * `contents` - Contents of the new file. Example: "Hello world!"
3663    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3664    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3665        let mut query = self.selection.select("withNewFile");
3666        query = query.arg("path", path.into());
3667        query = query.arg("contents", contents.into());
3668        Container {
3669            proc: self.proc.clone(),
3670            selection: query,
3671            graphql_client: self.graphql_client.clone(),
3672        }
3673    }
3674    /// Return a new container snapshot, with a file added to its filesystem with text content
3675    ///
3676    /// # Arguments
3677    ///
3678    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
3679    /// * `contents` - Contents of the new file. Example: "Hello world!"
3680    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3681    pub fn with_new_file_opts<'a>(
3682        &self,
3683        path: impl Into<String>,
3684        contents: impl Into<String>,
3685        opts: ContainerWithNewFileOpts<'a>,
3686    ) -> Container {
3687        let mut query = self.selection.select("withNewFile");
3688        query = query.arg("path", path.into());
3689        query = query.arg("contents", contents.into());
3690        if let Some(permissions) = opts.permissions {
3691            query = query.arg("permissions", permissions);
3692        }
3693        if let Some(owner) = opts.owner {
3694            query = query.arg("owner", owner);
3695        }
3696        if let Some(expand) = opts.expand {
3697            query = query.arg("expand", expand);
3698        }
3699        Container {
3700            proc: self.proc.clone(),
3701            selection: query,
3702            graphql_client: self.graphql_client.clone(),
3703        }
3704    }
3705    /// Attach credentials for future publishing to a registry. Use in combination with publish
3706    ///
3707    /// # Arguments
3708    ///
3709    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
3710    /// * `username` - The username to authenticate with. Example: "alice"
3711    /// * `secret` - The API key, password or token to authenticate to this registry
3712    pub fn with_registry_auth(
3713        &self,
3714        address: impl Into<String>,
3715        username: impl Into<String>,
3716        secret: impl IntoID<Id>,
3717    ) -> Container {
3718        let mut query = self.selection.select("withRegistryAuth");
3719        query = query.arg("address", address.into());
3720        query = query.arg("username", username.into());
3721        query = query.arg_lazy(
3722            "secret",
3723            Box::new(move || {
3724                let secret = secret.clone();
3725                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3726            }),
3727        );
3728        Container {
3729            proc: self.proc.clone(),
3730            selection: query,
3731            graphql_client: self.graphql_client.clone(),
3732        }
3733    }
3734    /// Change the container's root filesystem. The previous root filesystem will be lost.
3735    ///
3736    /// # Arguments
3737    ///
3738    /// * `directory` - The new root filesystem.
3739    pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
3740        let mut query = self.selection.select("withRootfs");
3741        query = query.arg_lazy(
3742            "directory",
3743            Box::new(move || {
3744                let directory = directory.clone();
3745                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3746            }),
3747        );
3748        Container {
3749            proc: self.proc.clone(),
3750            selection: query,
3751            graphql_client: self.graphql_client.clone(),
3752        }
3753    }
3754    /// Set a new environment variable, using a secret value
3755    ///
3756    /// # Arguments
3757    ///
3758    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
3759    /// * `secret` - Identifier of the secret value.
3760    pub fn with_secret_variable(
3761        &self,
3762        name: impl Into<String>,
3763        secret: impl IntoID<Id>,
3764    ) -> Container {
3765        let mut query = self.selection.select("withSecretVariable");
3766        query = query.arg("name", name.into());
3767        query = query.arg_lazy(
3768            "secret",
3769            Box::new(move || {
3770                let secret = secret.clone();
3771                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3772            }),
3773        );
3774        Container {
3775            proc: self.proc.clone(),
3776            selection: query,
3777            graphql_client: self.graphql_client.clone(),
3778        }
3779    }
3780    /// Establish a runtime dependency from a container to a network service.
3781    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
3782    /// The service will be reachable from the container via the provided hostname alias.
3783    /// The service dependency will also convey to any files or directories produced by the container.
3784    ///
3785    /// # Arguments
3786    ///
3787    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
3788    /// * `service` - The target service
3789    pub fn with_service_binding(
3790        &self,
3791        alias: impl Into<String>,
3792        service: impl IntoID<Id>,
3793    ) -> Container {
3794        let mut query = self.selection.select("withServiceBinding");
3795        query = query.arg("alias", alias.into());
3796        query = query.arg_lazy(
3797            "service",
3798            Box::new(move || {
3799                let service = service.clone();
3800                Box::pin(async move { service.into_id().await.unwrap().quote() })
3801            }),
3802        );
3803        Container {
3804            proc: self.proc.clone(),
3805            selection: query,
3806            graphql_client: self.graphql_client.clone(),
3807        }
3808    }
3809    /// Return a snapshot with a symlink
3810    ///
3811    /// # Arguments
3812    ///
3813    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
3814    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
3815    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3816    pub fn with_symlink(
3817        &self,
3818        target: impl Into<String>,
3819        link_name: impl Into<String>,
3820    ) -> Container {
3821        let mut query = self.selection.select("withSymlink");
3822        query = query.arg("target", target.into());
3823        query = query.arg("linkName", link_name.into());
3824        Container {
3825            proc: self.proc.clone(),
3826            selection: query,
3827            graphql_client: self.graphql_client.clone(),
3828        }
3829    }
3830    /// Return a snapshot with a symlink
3831    ///
3832    /// # Arguments
3833    ///
3834    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
3835    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
3836    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3837    pub fn with_symlink_opts(
3838        &self,
3839        target: impl Into<String>,
3840        link_name: impl Into<String>,
3841        opts: ContainerWithSymlinkOpts,
3842    ) -> Container {
3843        let mut query = self.selection.select("withSymlink");
3844        query = query.arg("target", target.into());
3845        query = query.arg("linkName", link_name.into());
3846        if let Some(expand) = opts.expand {
3847            query = query.arg("expand", expand);
3848        }
3849        Container {
3850            proc: self.proc.clone(),
3851            selection: query,
3852            graphql_client: self.graphql_client.clone(),
3853        }
3854    }
3855    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
3856    ///
3857    /// # Arguments
3858    ///
3859    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
3860    /// * `source` - Identifier of the socket to forward.
3861    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3862    pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3863        let mut query = self.selection.select("withUnixSocket");
3864        query = query.arg("path", path.into());
3865        query = query.arg_lazy(
3866            "source",
3867            Box::new(move || {
3868                let source = source.clone();
3869                Box::pin(async move { source.into_id().await.unwrap().quote() })
3870            }),
3871        );
3872        Container {
3873            proc: self.proc.clone(),
3874            selection: query,
3875            graphql_client: self.graphql_client.clone(),
3876        }
3877    }
3878    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
3879    ///
3880    /// # Arguments
3881    ///
3882    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
3883    /// * `source` - Identifier of the socket to forward.
3884    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3885    pub fn with_unix_socket_opts<'a>(
3886        &self,
3887        path: impl Into<String>,
3888        source: impl IntoID<Id>,
3889        opts: ContainerWithUnixSocketOpts<'a>,
3890    ) -> Container {
3891        let mut query = self.selection.select("withUnixSocket");
3892        query = query.arg("path", path.into());
3893        query = query.arg_lazy(
3894            "source",
3895            Box::new(move || {
3896                let source = source.clone();
3897                Box::pin(async move { source.into_id().await.unwrap().quote() })
3898            }),
3899        );
3900        if let Some(owner) = opts.owner {
3901            query = query.arg("owner", owner);
3902        }
3903        if let Some(expand) = opts.expand {
3904            query = query.arg("expand", expand);
3905        }
3906        Container {
3907            proc: self.proc.clone(),
3908            selection: query,
3909            graphql_client: self.graphql_client.clone(),
3910        }
3911    }
3912    /// Retrieves this container with a different command user.
3913    ///
3914    /// # Arguments
3915    ///
3916    /// * `name` - The user to set (e.g., "root").
3917    pub fn with_user(&self, name: impl Into<String>) -> Container {
3918        let mut query = self.selection.select("withUser");
3919        query = query.arg("name", name.into());
3920        Container {
3921            proc: self.proc.clone(),
3922            selection: query,
3923            graphql_client: self.graphql_client.clone(),
3924        }
3925    }
3926    /// Set a new non-secret environment variable for future execs without invalidating exec cache when only its value changes.
3927    /// This is an expert-only escape hatch. If a volatile value affects observable exec results, stale cached results may be reused.
3928    ///
3929    /// # Arguments
3930    ///
3931    /// * `name` - Name of the volatile variable (e.g., "CI_RUN_ID").
3932    /// * `value` - Value of the volatile variable.
3933    pub fn with_volatile_variable(
3934        &self,
3935        name: impl Into<String>,
3936        value: impl Into<String>,
3937    ) -> Container {
3938        let mut query = self.selection.select("withVolatileVariable");
3939        query = query.arg("name", name.into());
3940        query = query.arg("value", value.into());
3941        Container {
3942            proc: self.proc.clone(),
3943            selection: query,
3944            graphql_client: self.graphql_client.clone(),
3945        }
3946    }
3947    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3948    ///
3949    /// # Arguments
3950    ///
3951    /// * `path` - The path to set as the working directory (e.g., "/app").
3952    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3953    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3954        let mut query = self.selection.select("withWorkdir");
3955        query = query.arg("path", path.into());
3956        Container {
3957            proc: self.proc.clone(),
3958            selection: query,
3959            graphql_client: self.graphql_client.clone(),
3960        }
3961    }
3962    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3963    ///
3964    /// # Arguments
3965    ///
3966    /// * `path` - The path to set as the working directory (e.g., "/app").
3967    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3968    pub fn with_workdir_opts(
3969        &self,
3970        path: impl Into<String>,
3971        opts: ContainerWithWorkdirOpts,
3972    ) -> Container {
3973        let mut query = self.selection.select("withWorkdir");
3974        query = query.arg("path", path.into());
3975        if let Some(expand) = opts.expand {
3976            query = query.arg("expand", expand);
3977        }
3978        Container {
3979            proc: self.proc.clone(),
3980            selection: query,
3981            graphql_client: self.graphql_client.clone(),
3982        }
3983    }
3984    /// Retrieves this container minus the given OCI annotation.
3985    ///
3986    /// # Arguments
3987    ///
3988    /// * `name` - The name of the annotation.
3989    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3990        let mut query = self.selection.select("withoutAnnotation");
3991        query = query.arg("name", name.into());
3992        Container {
3993            proc: self.proc.clone(),
3994            selection: query,
3995            graphql_client: self.graphql_client.clone(),
3996        }
3997    }
3998    /// Remove the container's default arguments.
3999    pub fn without_default_args(&self) -> Container {
4000        let query = self.selection.select("withoutDefaultArgs");
4001        Container {
4002            proc: self.proc.clone(),
4003            selection: query,
4004            graphql_client: self.graphql_client.clone(),
4005        }
4006    }
4007    /// Return a new container snapshot, with a directory removed from its filesystem
4008    ///
4009    /// # Arguments
4010    ///
4011    /// * `path` - Location of the directory to remove (e.g., ".github/").
4012    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4013    pub fn without_directory(&self, path: impl Into<String>) -> Container {
4014        let mut query = self.selection.select("withoutDirectory");
4015        query = query.arg("path", path.into());
4016        Container {
4017            proc: self.proc.clone(),
4018            selection: query,
4019            graphql_client: self.graphql_client.clone(),
4020        }
4021    }
4022    /// Return a new container snapshot, with a directory removed from its filesystem
4023    ///
4024    /// # Arguments
4025    ///
4026    /// * `path` - Location of the directory to remove (e.g., ".github/").
4027    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4028    pub fn without_directory_opts(
4029        &self,
4030        path: impl Into<String>,
4031        opts: ContainerWithoutDirectoryOpts,
4032    ) -> Container {
4033        let mut query = self.selection.select("withoutDirectory");
4034        query = query.arg("path", path.into());
4035        if let Some(expand) = opts.expand {
4036            query = query.arg("expand", expand);
4037        }
4038        Container {
4039            proc: self.proc.clone(),
4040            selection: query,
4041            graphql_client: self.graphql_client.clone(),
4042        }
4043    }
4044    /// Retrieves this container without a configured docker healtcheck command.
4045    pub fn without_docker_healthcheck(&self) -> Container {
4046        let query = self.selection.select("withoutDockerHealthcheck");
4047        Container {
4048            proc: self.proc.clone(),
4049            selection: query,
4050            graphql_client: self.graphql_client.clone(),
4051        }
4052    }
4053    /// Reset the container's OCI entrypoint.
4054    ///
4055    /// # Arguments
4056    ///
4057    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4058    pub fn without_entrypoint(&self) -> Container {
4059        let query = self.selection.select("withoutEntrypoint");
4060        Container {
4061            proc: self.proc.clone(),
4062            selection: query,
4063            graphql_client: self.graphql_client.clone(),
4064        }
4065    }
4066    /// Reset the container's OCI entrypoint.
4067    ///
4068    /// # Arguments
4069    ///
4070    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4071    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4072        let mut query = self.selection.select("withoutEntrypoint");
4073        if let Some(keep_default_args) = opts.keep_default_args {
4074            query = query.arg("keepDefaultArgs", keep_default_args);
4075        }
4076        Container {
4077            proc: self.proc.clone(),
4078            selection: query,
4079            graphql_client: self.graphql_client.clone(),
4080        }
4081    }
4082    /// Retrieves this container minus the given environment variable.
4083    ///
4084    /// # Arguments
4085    ///
4086    /// * `name` - The name of the environment variable (e.g., "HOST").
4087    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4088        let mut query = self.selection.select("withoutEnvVariable");
4089        query = query.arg("name", name.into());
4090        Container {
4091            proc: self.proc.clone(),
4092            selection: query,
4093            graphql_client: self.graphql_client.clone(),
4094        }
4095    }
4096    /// Unexpose a previously exposed port.
4097    ///
4098    /// # Arguments
4099    ///
4100    /// * `port` - Port number to unexpose
4101    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4102    pub fn without_exposed_port(&self, port: isize) -> Container {
4103        let mut query = self.selection.select("withoutExposedPort");
4104        query = query.arg("port", port);
4105        Container {
4106            proc: self.proc.clone(),
4107            selection: query,
4108            graphql_client: self.graphql_client.clone(),
4109        }
4110    }
4111    /// Unexpose a previously exposed port.
4112    ///
4113    /// # Arguments
4114    ///
4115    /// * `port` - Port number to unexpose
4116    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4117    pub fn without_exposed_port_opts(
4118        &self,
4119        port: isize,
4120        opts: ContainerWithoutExposedPortOpts,
4121    ) -> Container {
4122        let mut query = self.selection.select("withoutExposedPort");
4123        query = query.arg("port", port);
4124        if let Some(protocol) = opts.protocol {
4125            query = query.arg("protocol", protocol);
4126        }
4127        Container {
4128            proc: self.proc.clone(),
4129            selection: query,
4130            graphql_client: self.graphql_client.clone(),
4131        }
4132    }
4133    /// Retrieves this container with the file at the given path removed.
4134    ///
4135    /// # Arguments
4136    ///
4137    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4138    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4139    pub fn without_file(&self, path: impl Into<String>) -> Container {
4140        let mut query = self.selection.select("withoutFile");
4141        query = query.arg("path", path.into());
4142        Container {
4143            proc: self.proc.clone(),
4144            selection: query,
4145            graphql_client: self.graphql_client.clone(),
4146        }
4147    }
4148    /// Retrieves this container with the file at the given path removed.
4149    ///
4150    /// # Arguments
4151    ///
4152    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4153    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4154    pub fn without_file_opts(
4155        &self,
4156        path: impl Into<String>,
4157        opts: ContainerWithoutFileOpts,
4158    ) -> Container {
4159        let mut query = self.selection.select("withoutFile");
4160        query = query.arg("path", path.into());
4161        if let Some(expand) = opts.expand {
4162            query = query.arg("expand", expand);
4163        }
4164        Container {
4165            proc: self.proc.clone(),
4166            selection: query,
4167            graphql_client: self.graphql_client.clone(),
4168        }
4169    }
4170    /// Return a new container spanshot with specified files removed
4171    ///
4172    /// # Arguments
4173    ///
4174    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4175    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4176    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4177        let mut query = self.selection.select("withoutFiles");
4178        query = query.arg(
4179            "paths",
4180            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4181        );
4182        Container {
4183            proc: self.proc.clone(),
4184            selection: query,
4185            graphql_client: self.graphql_client.clone(),
4186        }
4187    }
4188    /// Return a new container spanshot with specified files removed
4189    ///
4190    /// # Arguments
4191    ///
4192    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4193    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4194    pub fn without_files_opts(
4195        &self,
4196        paths: Vec<impl Into<String>>,
4197        opts: ContainerWithoutFilesOpts,
4198    ) -> Container {
4199        let mut query = self.selection.select("withoutFiles");
4200        query = query.arg(
4201            "paths",
4202            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4203        );
4204        if let Some(expand) = opts.expand {
4205            query = query.arg("expand", expand);
4206        }
4207        Container {
4208            proc: self.proc.clone(),
4209            selection: query,
4210            graphql_client: self.graphql_client.clone(),
4211        }
4212    }
4213    /// Retrieves this container minus the given environment label.
4214    ///
4215    /// # Arguments
4216    ///
4217    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4218    pub fn without_label(&self, name: impl Into<String>) -> Container {
4219        let mut query = self.selection.select("withoutLabel");
4220        query = query.arg("name", name.into());
4221        Container {
4222            proc: self.proc.clone(),
4223            selection: query,
4224            graphql_client: self.graphql_client.clone(),
4225        }
4226    }
4227    /// Retrieves this container after unmounting everything at the given path.
4228    ///
4229    /// # Arguments
4230    ///
4231    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4232    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4233    pub fn without_mount(&self, path: impl Into<String>) -> Container {
4234        let mut query = self.selection.select("withoutMount");
4235        query = query.arg("path", path.into());
4236        Container {
4237            proc: self.proc.clone(),
4238            selection: query,
4239            graphql_client: self.graphql_client.clone(),
4240        }
4241    }
4242    /// Retrieves this container after unmounting everything at the given path.
4243    ///
4244    /// # Arguments
4245    ///
4246    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4247    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4248    pub fn without_mount_opts(
4249        &self,
4250        path: impl Into<String>,
4251        opts: ContainerWithoutMountOpts,
4252    ) -> Container {
4253        let mut query = self.selection.select("withoutMount");
4254        query = query.arg("path", path.into());
4255        if let Some(expand) = opts.expand {
4256            query = query.arg("expand", expand);
4257        }
4258        Container {
4259            proc: self.proc.clone(),
4260            selection: query,
4261            graphql_client: self.graphql_client.clone(),
4262        }
4263    }
4264    /// Retrieves this container without the registry authentication of a given address.
4265    ///
4266    /// # Arguments
4267    ///
4268    /// * `address` - Registry's address to remove the authentication from.
4269    ///
4270    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
4271    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4272        let mut query = self.selection.select("withoutRegistryAuth");
4273        query = query.arg("address", address.into());
4274        Container {
4275            proc: self.proc.clone(),
4276            selection: query,
4277            graphql_client: self.graphql_client.clone(),
4278        }
4279    }
4280    /// Retrieves this container minus the given environment variable containing the secret.
4281    ///
4282    /// # Arguments
4283    ///
4284    /// * `name` - The name of the environment variable (e.g., "HOST").
4285    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4286        let mut query = self.selection.select("withoutSecretVariable");
4287        query = query.arg("name", name.into());
4288        Container {
4289            proc: self.proc.clone(),
4290            selection: query,
4291            graphql_client: self.graphql_client.clone(),
4292        }
4293    }
4294    /// Retrieves this container with a previously added Unix socket removed.
4295    ///
4296    /// # Arguments
4297    ///
4298    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4299    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4300    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4301        let mut query = self.selection.select("withoutUnixSocket");
4302        query = query.arg("path", path.into());
4303        Container {
4304            proc: self.proc.clone(),
4305            selection: query,
4306            graphql_client: self.graphql_client.clone(),
4307        }
4308    }
4309    /// Retrieves this container with a previously added Unix socket removed.
4310    ///
4311    /// # Arguments
4312    ///
4313    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4314    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4315    pub fn without_unix_socket_opts(
4316        &self,
4317        path: impl Into<String>,
4318        opts: ContainerWithoutUnixSocketOpts,
4319    ) -> Container {
4320        let mut query = self.selection.select("withoutUnixSocket");
4321        query = query.arg("path", path.into());
4322        if let Some(expand) = opts.expand {
4323            query = query.arg("expand", expand);
4324        }
4325        Container {
4326            proc: self.proc.clone(),
4327            selection: query,
4328            graphql_client: self.graphql_client.clone(),
4329        }
4330    }
4331    /// Retrieves this container with an unset command user.
4332    /// Should default to root.
4333    pub fn without_user(&self) -> Container {
4334        let query = self.selection.select("withoutUser");
4335        Container {
4336            proc: self.proc.clone(),
4337            selection: query,
4338            graphql_client: self.graphql_client.clone(),
4339        }
4340    }
4341    /// Retrieves this container minus the given volatile environment variable.
4342    ///
4343    /// # Arguments
4344    ///
4345    /// * `name` - The name of the volatile environment variable (e.g., "CI_RUN_ID").
4346    pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4347        let mut query = self.selection.select("withoutVolatileVariable");
4348        query = query.arg("name", name.into());
4349        Container {
4350            proc: self.proc.clone(),
4351            selection: query,
4352            graphql_client: self.graphql_client.clone(),
4353        }
4354    }
4355    /// Unset the container's working directory.
4356    /// Should default to "/".
4357    pub fn without_workdir(&self) -> Container {
4358        let query = self.selection.select("withoutWorkdir");
4359        Container {
4360            proc: self.proc.clone(),
4361            selection: query,
4362            graphql_client: self.graphql_client.clone(),
4363        }
4364    }
4365    /// Retrieves the working directory for all commands.
4366    pub async fn workdir(&self) -> Result<String, DaggerError> {
4367        let query = self.selection.select("workdir");
4368        query.execute(self.graphql_client.clone()).await
4369    }
4370}
4371impl Exportable for Container {
4372    fn export(
4373        &self,
4374        path: impl Into<String>,
4375    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
4376        let mut query = self.selection.select("export");
4377        query = query.arg("path", path.into());
4378        let graphql_client = self.graphql_client.clone();
4379        async move { query.execute(graphql_client).await }
4380    }
4381    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4382        let query = self.selection.select("id");
4383        let graphql_client = self.graphql_client.clone();
4384        async move { query.execute(graphql_client).await }
4385    }
4386}
4387impl Node for Container {
4388    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4389        let query = self.selection.select("id");
4390        let graphql_client = self.graphql_client.clone();
4391        async move { query.execute(graphql_client).await }
4392    }
4393}
4394impl Syncer for Container {
4395    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4396        let query = self.selection.select("id");
4397        let graphql_client = self.graphql_client.clone();
4398        async move { query.execute(graphql_client).await }
4399    }
4400    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4401        let query = self.selection.select("sync");
4402        let graphql_client = self.graphql_client.clone();
4403        async move { query.execute(graphql_client).await }
4404    }
4405}
4406#[derive(Clone)]
4407pub struct CurrentModule {
4408    pub proc: Option<Arc<DaggerSessionProc>>,
4409    pub selection: Selection,
4410    pub graphql_client: DynGraphQLClient,
4411}
4412#[derive(Builder, Debug, PartialEq)]
4413pub struct CurrentModuleGeneratorsOpts<'a> {
4414    /// Only include generators matching the specified patterns
4415    #[builder(setter(into, strip_option), default)]
4416    pub include: Option<Vec<&'a str>>,
4417}
4418#[derive(Builder, Debug, PartialEq)]
4419pub struct CurrentModuleWorkdirOpts<'a> {
4420    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4421    #[builder(setter(into, strip_option), default)]
4422    pub exclude: Option<Vec<&'a str>>,
4423    /// Apply .gitignore filter rules inside the directory
4424    #[builder(setter(into, strip_option), default)]
4425    pub gitignore: Option<bool>,
4426    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4427    #[builder(setter(into, strip_option), default)]
4428    pub include: Option<Vec<&'a str>>,
4429}
4430impl IntoID<Id> for CurrentModule {
4431    fn into_id(
4432        self,
4433    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4434        Box::pin(async move { self.id().await })
4435    }
4436}
4437impl Loadable for CurrentModule {
4438    fn graphql_type() -> &'static str {
4439        "CurrentModule"
4440    }
4441    fn from_query(
4442        proc: Option<Arc<DaggerSessionProc>>,
4443        selection: Selection,
4444        graphql_client: DynGraphQLClient,
4445    ) -> Self {
4446        Self {
4447            proc,
4448            selection,
4449            graphql_client,
4450        }
4451    }
4452}
4453impl CurrentModule {
4454    /// The dependencies of the module.
4455    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
4456        let query = self.selection.select("dependencies");
4457        let query = query.select("id");
4458        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4459        Ok(ids
4460            .into_iter()
4461            .map(|id| Module {
4462                proc: self.proc.clone(),
4463                selection: crate::querybuilder::query()
4464                    .select("node")
4465                    .arg("id", &id.0)
4466                    .inline_fragment("Module"),
4467                graphql_client: self.graphql_client.clone(),
4468            })
4469            .collect())
4470    }
4471    /// The generated files and directories made on top of the module source's context directory.
4472    pub fn generated_context_directory(&self) -> Directory {
4473        let query = self.selection.select("generatedContextDirectory");
4474        Directory {
4475            proc: self.proc.clone(),
4476            selection: query,
4477            graphql_client: self.graphql_client.clone(),
4478        }
4479    }
4480    /// Return all generators defined by the module
4481    ///
4482    /// # Arguments
4483    ///
4484    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4485    pub fn generators(&self) -> GeneratorGroup {
4486        let query = self.selection.select("generators");
4487        GeneratorGroup {
4488            proc: self.proc.clone(),
4489            selection: query,
4490            graphql_client: self.graphql_client.clone(),
4491        }
4492    }
4493    /// Return all generators defined by the module
4494    ///
4495    /// # Arguments
4496    ///
4497    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4498    pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
4499        let mut query = self.selection.select("generators");
4500        if let Some(include) = opts.include {
4501            query = query.arg("include", include);
4502        }
4503        GeneratorGroup {
4504            proc: self.proc.clone(),
4505            selection: query,
4506            graphql_client: self.graphql_client.clone(),
4507        }
4508    }
4509    /// A unique identifier for this CurrentModule.
4510    pub async fn id(&self) -> Result<Id, DaggerError> {
4511        let query = self.selection.select("id");
4512        query.execute(self.graphql_client.clone()).await
4513    }
4514    /// The name of the module being executed in
4515    pub async fn name(&self) -> Result<String, DaggerError> {
4516        let query = self.selection.select("name");
4517        query.execute(self.graphql_client.clone()).await
4518    }
4519    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
4520    pub fn source(&self) -> Directory {
4521        let query = self.selection.select("source");
4522        Directory {
4523            proc: self.proc.clone(),
4524            selection: query,
4525            graphql_client: self.graphql_client.clone(),
4526        }
4527    }
4528    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4529    ///
4530    /// # Arguments
4531    ///
4532    /// * `path` - Location of the directory to access (e.g., ".").
4533    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4534    pub fn workdir(&self, path: impl Into<String>) -> Directory {
4535        let mut query = self.selection.select("workdir");
4536        query = query.arg("path", path.into());
4537        Directory {
4538            proc: self.proc.clone(),
4539            selection: query,
4540            graphql_client: self.graphql_client.clone(),
4541        }
4542    }
4543    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4544    ///
4545    /// # Arguments
4546    ///
4547    /// * `path` - Location of the directory to access (e.g., ".").
4548    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4549    pub fn workdir_opts<'a>(
4550        &self,
4551        path: impl Into<String>,
4552        opts: CurrentModuleWorkdirOpts<'a>,
4553    ) -> Directory {
4554        let mut query = self.selection.select("workdir");
4555        query = query.arg("path", path.into());
4556        if let Some(exclude) = opts.exclude {
4557            query = query.arg("exclude", exclude);
4558        }
4559        if let Some(include) = opts.include {
4560            query = query.arg("include", include);
4561        }
4562        if let Some(gitignore) = opts.gitignore {
4563            query = query.arg("gitignore", gitignore);
4564        }
4565        Directory {
4566            proc: self.proc.clone(),
4567            selection: query,
4568            graphql_client: self.graphql_client.clone(),
4569        }
4570    }
4571    /// 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.
4572    ///
4573    /// # Arguments
4574    ///
4575    /// * `path` - Location of the file to retrieve (e.g., "README.md").
4576    pub fn workdir_file(&self, path: impl Into<String>) -> File {
4577        let mut query = self.selection.select("workdirFile");
4578        query = query.arg("path", path.into());
4579        File {
4580            proc: self.proc.clone(),
4581            selection: query,
4582            graphql_client: self.graphql_client.clone(),
4583        }
4584    }
4585}
4586impl Node for CurrentModule {
4587    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4588        let query = self.selection.select("id");
4589        let graphql_client = self.graphql_client.clone();
4590        async move { query.execute(graphql_client).await }
4591    }
4592}
4593#[derive(Clone)]
4594pub struct DiffStat {
4595    pub proc: Option<Arc<DaggerSessionProc>>,
4596    pub selection: Selection,
4597    pub graphql_client: DynGraphQLClient,
4598}
4599impl IntoID<Id> for DiffStat {
4600    fn into_id(
4601        self,
4602    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4603        Box::pin(async move { self.id().await })
4604    }
4605}
4606impl Loadable for DiffStat {
4607    fn graphql_type() -> &'static str {
4608        "DiffStat"
4609    }
4610    fn from_query(
4611        proc: Option<Arc<DaggerSessionProc>>,
4612        selection: Selection,
4613        graphql_client: DynGraphQLClient,
4614    ) -> Self {
4615        Self {
4616            proc,
4617            selection,
4618            graphql_client,
4619        }
4620    }
4621}
4622impl DiffStat {
4623    /// Number of added lines for this path.
4624    pub async fn added_lines(&self) -> Result<isize, DaggerError> {
4625        let query = self.selection.select("addedLines");
4626        query.execute(self.graphql_client.clone()).await
4627    }
4628    /// A unique identifier for this DiffStat.
4629    pub async fn id(&self) -> Result<Id, DaggerError> {
4630        let query = self.selection.select("id");
4631        query.execute(self.graphql_client.clone()).await
4632    }
4633    /// Type of change.
4634    pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
4635        let query = self.selection.select("kind");
4636        query.execute(self.graphql_client.clone()).await
4637    }
4638    /// Previous path of the file, set only for renames.
4639    pub async fn old_path(&self) -> Result<String, DaggerError> {
4640        let query = self.selection.select("oldPath");
4641        query.execute(self.graphql_client.clone()).await
4642    }
4643    /// Path of the changed file or directory.
4644    pub async fn path(&self) -> Result<String, DaggerError> {
4645        let query = self.selection.select("path");
4646        query.execute(self.graphql_client.clone()).await
4647    }
4648    /// Number of removed lines for this path.
4649    pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
4650        let query = self.selection.select("removedLines");
4651        query.execute(self.graphql_client.clone()).await
4652    }
4653}
4654impl Node for DiffStat {
4655    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4656        let query = self.selection.select("id");
4657        let graphql_client = self.graphql_client.clone();
4658        async move { query.execute(graphql_client).await }
4659    }
4660}
4661#[derive(Clone)]
4662pub struct Directory {
4663    pub proc: Option<Arc<DaggerSessionProc>>,
4664    pub selection: Selection,
4665    pub graphql_client: DynGraphQLClient,
4666}
4667#[derive(Builder, Debug, PartialEq)]
4668pub struct DirectoryAsModuleOpts<'a> {
4669    /// An optional subpath of the directory which contains the module's configuration file.
4670    /// If not set, the module source code is loaded from the root of the directory.
4671    #[builder(setter(into, strip_option), default)]
4672    pub source_root_path: Option<&'a str>,
4673}
4674#[derive(Builder, Debug, PartialEq)]
4675pub struct DirectoryAsModuleSourceOpts<'a> {
4676    /// An optional subpath of the directory which contains the module's configuration file.
4677    /// If not set, the module source code is loaded from the root of the directory.
4678    #[builder(setter(into, strip_option), default)]
4679    pub source_root_path: Option<&'a str>,
4680}
4681#[derive(Builder, Debug, PartialEq)]
4682pub struct DirectoryDockerBuildOpts<'a> {
4683    /// Build arguments to use in the build.
4684    #[builder(setter(into, strip_option), default)]
4685    pub build_args: Option<Vec<BuildArg>>,
4686    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
4687    #[builder(setter(into, strip_option), default)]
4688    pub dockerfile: Option<&'a str>,
4689    /// If set, skip the automatic init process injected into containers created by RUN statements.
4690    /// This should only be used if the user requires that their exec processes be the pid 1 process in the container. Otherwise it may result in unexpected behavior.
4691    #[builder(setter(into, strip_option), default)]
4692    pub no_init: Option<bool>,
4693    /// The platform to build.
4694    #[builder(setter(into, strip_option), default)]
4695    pub platform: Option<Platform>,
4696    /// Secrets to pass to the build.
4697    /// They will be mounted at /run/secrets/[secret-name].
4698    #[builder(setter(into, strip_option), default)]
4699    pub secrets: Option<Vec<Id>>,
4700    /// A socket to use for SSH authentication during the build
4701    /// (e.g., for Dockerfile RUN --mount=type=ssh instructions).
4702    /// Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
4703    #[builder(setter(into, strip_option), default)]
4704    pub ssh: Option<Id>,
4705    /// Target build stage to build.
4706    #[builder(setter(into, strip_option), default)]
4707    pub target: Option<&'a str>,
4708}
4709#[derive(Builder, Debug, PartialEq)]
4710pub struct DirectoryEntriesOpts<'a> {
4711    /// Location of the directory to look at (e.g., "/src").
4712    #[builder(setter(into, strip_option), default)]
4713    pub path: Option<&'a str>,
4714}
4715#[derive(Builder, Debug, PartialEq)]
4716pub struct DirectoryExistsOpts {
4717    /// If specified, do not follow symlinks.
4718    #[builder(setter(into, strip_option), default)]
4719    pub do_not_follow_symlinks: Option<bool>,
4720    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
4721    #[builder(setter(into, strip_option), default)]
4722    pub expected_type: Option<ExistsType>,
4723}
4724#[derive(Builder, Debug, PartialEq)]
4725pub struct DirectoryExportOpts {
4726    /// If true, then the host directory will be wiped clean before exporting so that it exactly matches the directory being exported; this means it will delete any files on the host that aren't in the exported dir. If false (the default), the contents of the directory will be merged with any existing contents of the host directory, leaving any existing files on the host that aren't in the exported directory alone.
4727    #[builder(setter(into, strip_option), default)]
4728    pub wipe: Option<bool>,
4729}
4730#[derive(Builder, Debug, PartialEq)]
4731pub struct DirectoryFilterOpts<'a> {
4732    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
4733    #[builder(setter(into, strip_option), default)]
4734    pub exclude: Option<Vec<&'a str>>,
4735    /// If set, apply .gitignore rules when filtering the directory.
4736    #[builder(setter(into, strip_option), default)]
4737    pub gitignore: Option<bool>,
4738    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
4739    #[builder(setter(into, strip_option), default)]
4740    pub include: Option<Vec<&'a str>>,
4741}
4742#[derive(Builder, Debug, PartialEq)]
4743pub struct DirectorySearchOpts<'a> {
4744    /// Allow the . pattern to match newlines in multiline mode.
4745    #[builder(setter(into, strip_option), default)]
4746    pub dotall: Option<bool>,
4747    /// Only return matching files, not lines and content
4748    #[builder(setter(into, strip_option), default)]
4749    pub files_only: Option<bool>,
4750    /// Glob patterns to match (e.g., "*.md")
4751    #[builder(setter(into, strip_option), default)]
4752    pub globs: Option<Vec<&'a str>>,
4753    /// Enable case-insensitive matching.
4754    #[builder(setter(into, strip_option), default)]
4755    pub insensitive: Option<bool>,
4756    /// Limit the number of results to return
4757    #[builder(setter(into, strip_option), default)]
4758    pub limit: Option<isize>,
4759    /// Interpret the pattern as a literal string instead of a regular expression.
4760    #[builder(setter(into, strip_option), default)]
4761    pub literal: Option<bool>,
4762    /// Enable searching across multiple lines.
4763    #[builder(setter(into, strip_option), default)]
4764    pub multiline: Option<bool>,
4765    /// Directory or file paths to search
4766    #[builder(setter(into, strip_option), default)]
4767    pub paths: Option<Vec<&'a str>>,
4768    /// Skip hidden files (files starting with .).
4769    #[builder(setter(into, strip_option), default)]
4770    pub skip_hidden: Option<bool>,
4771    /// Honor .gitignore, .ignore, and .rgignore files.
4772    #[builder(setter(into, strip_option), default)]
4773    pub skip_ignored: Option<bool>,
4774}
4775#[derive(Builder, Debug, PartialEq)]
4776pub struct DirectoryStatOpts {
4777    /// If specified, do not follow symlinks.
4778    #[builder(setter(into, strip_option), default)]
4779    pub do_not_follow_symlinks: Option<bool>,
4780}
4781#[derive(Builder, Debug, PartialEq)]
4782pub struct DirectoryTerminalOpts<'a> {
4783    /// If set, override the container's default terminal command and invoke these command arguments instead.
4784    #[builder(setter(into, strip_option), default)]
4785    pub cmd: Option<Vec<&'a str>>,
4786    /// If set, override the default container used for the terminal.
4787    #[builder(setter(into, strip_option), default)]
4788    pub container: Option<Id>,
4789    /// Provides Dagger access to the executed command.
4790    #[builder(setter(into, strip_option), default)]
4791    pub experimental_privileged_nesting: Option<bool>,
4792    /// Execute the command with all root capabilities. This is similar to running a command with "sudo" or executing "docker run" with the "--privileged" flag. Containerization does not provide any security guarantees when using this option. It should only be used when absolutely necessary and only with trusted commands.
4793    #[builder(setter(into, strip_option), default)]
4794    pub insecure_root_capabilities: Option<bool>,
4795}
4796#[derive(Builder, Debug, PartialEq)]
4797pub struct DirectoryWithDirectoryOpts<'a> {
4798    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4799    #[builder(setter(into, strip_option), default)]
4800    pub exclude: Option<Vec<&'a str>>,
4801    /// Apply .gitignore filter rules inside the directory
4802    #[builder(setter(into, strip_option), default)]
4803    pub gitignore: Option<bool>,
4804    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4805    #[builder(setter(into, strip_option), default)]
4806    pub include: Option<Vec<&'a str>>,
4807    /// A user:group to set for the copied directory and its contents.
4808    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
4809    /// If the group is omitted, it defaults to the same as the user.
4810    #[builder(setter(into, strip_option), default)]
4811    pub owner: Option<&'a str>,
4812    /// Permission given to the copied directory and contents (e.g., 0755).
4813    #[builder(setter(into, strip_option), default)]
4814    pub permissions: Option<isize>,
4815}
4816#[derive(Builder, Debug, PartialEq)]
4817pub struct DirectoryWithFileOpts<'a> {
4818    /// A user:group to set for the copied directory and its contents.
4819    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
4820    /// If the group is omitted, it defaults to the same as the user.
4821    #[builder(setter(into, strip_option), default)]
4822    pub owner: Option<&'a str>,
4823    /// Permission given to the copied file (e.g., 0600).
4824    #[builder(setter(into, strip_option), default)]
4825    pub permissions: Option<isize>,
4826}
4827#[derive(Builder, Debug, PartialEq)]
4828pub struct DirectoryWithFilesOpts {
4829    /// Permission given to the copied files (e.g., 0600).
4830    #[builder(setter(into, strip_option), default)]
4831    pub permissions: Option<isize>,
4832}
4833#[derive(Builder, Debug, PartialEq)]
4834pub struct DirectoryWithNewDirectoryOpts {
4835    /// Permission granted to the created directory (e.g., 0777).
4836    #[builder(setter(into, strip_option), default)]
4837    pub permissions: Option<isize>,
4838}
4839#[derive(Builder, Debug, PartialEq)]
4840pub struct DirectoryWithNewFileOpts {
4841    /// Permissions of the new file. Example: 0600
4842    #[builder(setter(into, strip_option), default)]
4843    pub permissions: Option<isize>,
4844}
4845impl IntoID<Id> for Directory {
4846    fn into_id(
4847        self,
4848    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4849        Box::pin(async move { self.id().await })
4850    }
4851}
4852impl Loadable for Directory {
4853    fn graphql_type() -> &'static str {
4854        "Directory"
4855    }
4856    fn from_query(
4857        proc: Option<Arc<DaggerSessionProc>>,
4858        selection: Selection,
4859        graphql_client: DynGraphQLClient,
4860    ) -> Self {
4861        Self {
4862            proc,
4863            selection,
4864            graphql_client,
4865        }
4866    }
4867}
4868impl Directory {
4869    /// Converts this directory to a local git repository
4870    pub fn as_git(&self) -> GitRepository {
4871        let query = self.selection.select("asGit");
4872        GitRepository {
4873            proc: self.proc.clone(),
4874            selection: query,
4875            graphql_client: self.graphql_client.clone(),
4876        }
4877    }
4878    /// Load the directory as a Dagger module source
4879    ///
4880    /// # Arguments
4881    ///
4882    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4883    pub fn as_module(&self) -> Module {
4884        let query = self.selection.select("asModule");
4885        Module {
4886            proc: self.proc.clone(),
4887            selection: query,
4888            graphql_client: self.graphql_client.clone(),
4889        }
4890    }
4891    /// Load the directory as a Dagger module source
4892    ///
4893    /// # Arguments
4894    ///
4895    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4896    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4897        let mut query = self.selection.select("asModule");
4898        if let Some(source_root_path) = opts.source_root_path {
4899            query = query.arg("sourceRootPath", source_root_path);
4900        }
4901        Module {
4902            proc: self.proc.clone(),
4903            selection: query,
4904            graphql_client: self.graphql_client.clone(),
4905        }
4906    }
4907    /// Load the directory as a Dagger module source
4908    ///
4909    /// # Arguments
4910    ///
4911    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4912    pub fn as_module_source(&self) -> ModuleSource {
4913        let query = self.selection.select("asModuleSource");
4914        ModuleSource {
4915            proc: self.proc.clone(),
4916            selection: query,
4917            graphql_client: self.graphql_client.clone(),
4918        }
4919    }
4920    /// Load the directory as a Dagger module source
4921    ///
4922    /// # Arguments
4923    ///
4924    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4925    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4926        let mut query = self.selection.select("asModuleSource");
4927        if let Some(source_root_path) = opts.source_root_path {
4928            query = query.arg("sourceRootPath", source_root_path);
4929        }
4930        ModuleSource {
4931            proc: self.proc.clone(),
4932            selection: query,
4933            graphql_client: self.graphql_client.clone(),
4934        }
4935    }
4936    /// Return the difference between this directory and another directory, typically an older snapshot.
4937    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
4938    ///
4939    /// # Arguments
4940    ///
4941    /// * `from` - The base directory snapshot to compare against
4942    pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
4943        let mut query = self.selection.select("changes");
4944        query = query.arg_lazy(
4945            "from",
4946            Box::new(move || {
4947                let from = from.clone();
4948                Box::pin(async move { from.into_id().await.unwrap().quote() })
4949            }),
4950        );
4951        Changeset {
4952            proc: self.proc.clone(),
4953            selection: query,
4954            graphql_client: self.graphql_client.clone(),
4955        }
4956    }
4957    /// Change the owner of the directory contents recursively.
4958    ///
4959    /// # Arguments
4960    ///
4961    /// * `path` - Path of the directory to change ownership of (e.g., "/").
4962    /// * `owner` - A user:group to set for the mounted directory and its contents.
4963    ///
4964    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
4965    ///
4966    /// If the group is omitted, it defaults to the same as the user.
4967    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
4968        let mut query = self.selection.select("chown");
4969        query = query.arg("path", path.into());
4970        query = query.arg("owner", owner.into());
4971        Directory {
4972            proc: self.proc.clone(),
4973            selection: query,
4974            graphql_client: self.graphql_client.clone(),
4975        }
4976    }
4977    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
4978    ///
4979    /// # Arguments
4980    ///
4981    /// * `other` - The directory to compare against
4982    pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
4983        let mut query = self.selection.select("diff");
4984        query = query.arg_lazy(
4985            "other",
4986            Box::new(move || {
4987                let other = other.clone();
4988                Box::pin(async move { other.into_id().await.unwrap().quote() })
4989            }),
4990        );
4991        Directory {
4992            proc: self.proc.clone(),
4993            selection: query,
4994            graphql_client: self.graphql_client.clone(),
4995        }
4996    }
4997    /// 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.
4998    pub async fn digest(&self) -> Result<String, DaggerError> {
4999        let query = self.selection.select("digest");
5000        query.execute(self.graphql_client.clone()).await
5001    }
5002    /// Retrieves a directory at the given path.
5003    ///
5004    /// # Arguments
5005    ///
5006    /// * `path` - Location of the directory to retrieve. Example: "/src"
5007    pub fn directory(&self, path: impl Into<String>) -> Directory {
5008        let mut query = self.selection.select("directory");
5009        query = query.arg("path", path.into());
5010        Directory {
5011            proc: self.proc.clone(),
5012            selection: query,
5013            graphql_client: self.graphql_client.clone(),
5014        }
5015    }
5016    /// 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.
5017    ///
5018    /// # Arguments
5019    ///
5020    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5021    pub fn docker_build(&self) -> Container {
5022        let query = self.selection.select("dockerBuild");
5023        Container {
5024            proc: self.proc.clone(),
5025            selection: query,
5026            graphql_client: self.graphql_client.clone(),
5027        }
5028    }
5029    /// 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.
5030    ///
5031    /// # Arguments
5032    ///
5033    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5034    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5035        let mut query = self.selection.select("dockerBuild");
5036        if let Some(dockerfile) = opts.dockerfile {
5037            query = query.arg("dockerfile", dockerfile);
5038        }
5039        if let Some(platform) = opts.platform {
5040            query = query.arg("platform", platform);
5041        }
5042        if let Some(build_args) = opts.build_args {
5043            query = query.arg("buildArgs", build_args);
5044        }
5045        if let Some(target) = opts.target {
5046            query = query.arg("target", target);
5047        }
5048        if let Some(secrets) = opts.secrets {
5049            query = query.arg("secrets", secrets);
5050        }
5051        if let Some(no_init) = opts.no_init {
5052            query = query.arg("noInit", no_init);
5053        }
5054        if let Some(ssh) = opts.ssh {
5055            query = query.arg("ssh", ssh);
5056        }
5057        Container {
5058            proc: self.proc.clone(),
5059            selection: query,
5060            graphql_client: self.graphql_client.clone(),
5061        }
5062    }
5063    /// Returns a list of files and directories at the given path.
5064    ///
5065    /// # Arguments
5066    ///
5067    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5068    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
5069        let query = self.selection.select("entries");
5070        query.execute(self.graphql_client.clone()).await
5071    }
5072    /// Returns a list of files and directories at the given path.
5073    ///
5074    /// # Arguments
5075    ///
5076    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5077    pub async fn entries_opts<'a>(
5078        &self,
5079        opts: DirectoryEntriesOpts<'a>,
5080    ) -> Result<Vec<String>, DaggerError> {
5081        let mut query = self.selection.select("entries");
5082        if let Some(path) = opts.path {
5083            query = query.arg("path", path);
5084        }
5085        query.execute(self.graphql_client.clone()).await
5086    }
5087    /// check if a file or directory exists
5088    ///
5089    /// # Arguments
5090    ///
5091    /// * `path` - Path to check (e.g., "/file.txt").
5092    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5093    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5094        let mut query = self.selection.select("exists");
5095        query = query.arg("path", path.into());
5096        query.execute(self.graphql_client.clone()).await
5097    }
5098    /// check if a file or directory exists
5099    ///
5100    /// # Arguments
5101    ///
5102    /// * `path` - Path to check (e.g., "/file.txt").
5103    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5104    pub async fn exists_opts(
5105        &self,
5106        path: impl Into<String>,
5107        opts: DirectoryExistsOpts,
5108    ) -> Result<bool, DaggerError> {
5109        let mut query = self.selection.select("exists");
5110        query = query.arg("path", path.into());
5111        if let Some(expected_type) = opts.expected_type {
5112            query = query.arg("expectedType", expected_type);
5113        }
5114        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5115            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5116        }
5117        query.execute(self.graphql_client.clone()).await
5118    }
5119    /// Writes the contents of the directory to a path on the host.
5120    ///
5121    /// # Arguments
5122    ///
5123    /// * `path` - Location of the copied directory (e.g., "logs/").
5124    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5125    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5126        let mut query = self.selection.select("export");
5127        query = query.arg("path", path.into());
5128        query.execute(self.graphql_client.clone()).await
5129    }
5130    /// Writes the contents of the directory to a path on the host.
5131    ///
5132    /// # Arguments
5133    ///
5134    /// * `path` - Location of the copied directory (e.g., "logs/").
5135    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5136    pub async fn export_opts(
5137        &self,
5138        path: impl Into<String>,
5139        opts: DirectoryExportOpts,
5140    ) -> Result<String, DaggerError> {
5141        let mut query = self.selection.select("export");
5142        query = query.arg("path", path.into());
5143        if let Some(wipe) = opts.wipe {
5144            query = query.arg("wipe", wipe);
5145        }
5146        query.execute(self.graphql_client.clone()).await
5147    }
5148    /// Retrieve a file at the given path.
5149    ///
5150    /// # Arguments
5151    ///
5152    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5153    pub fn file(&self, path: impl Into<String>) -> File {
5154        let mut query = self.selection.select("file");
5155        query = query.arg("path", path.into());
5156        File {
5157            proc: self.proc.clone(),
5158            selection: query,
5159            graphql_client: self.graphql_client.clone(),
5160        }
5161    }
5162    /// Return a snapshot with some paths included or excluded
5163    ///
5164    /// # Arguments
5165    ///
5166    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5167    pub fn filter(&self) -> Directory {
5168        let query = self.selection.select("filter");
5169        Directory {
5170            proc: self.proc.clone(),
5171            selection: query,
5172            graphql_client: self.graphql_client.clone(),
5173        }
5174    }
5175    /// Return a snapshot with some paths included or excluded
5176    ///
5177    /// # Arguments
5178    ///
5179    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5180    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5181        let mut query = self.selection.select("filter");
5182        if let Some(exclude) = opts.exclude {
5183            query = query.arg("exclude", exclude);
5184        }
5185        if let Some(include) = opts.include {
5186            query = query.arg("include", include);
5187        }
5188        if let Some(gitignore) = opts.gitignore {
5189            query = query.arg("gitignore", gitignore);
5190        }
5191        Directory {
5192            proc: self.proc.clone(),
5193            selection: query,
5194            graphql_client: self.graphql_client.clone(),
5195        }
5196    }
5197    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
5198    ///
5199    /// # Arguments
5200    ///
5201    /// * `name` - The name of the file or directory to search for
5202    /// * `start` - The path to start the search from
5203    pub async fn find_up(
5204        &self,
5205        name: impl Into<String>,
5206        start: impl Into<String>,
5207    ) -> Result<String, DaggerError> {
5208        let mut query = self.selection.select("findUp");
5209        query = query.arg("name", name.into());
5210        query = query.arg("start", start.into());
5211        query.execute(self.graphql_client.clone()).await
5212    }
5213    /// Returns a list of files and directories that matche the given pattern.
5214    ///
5215    /// # Arguments
5216    ///
5217    /// * `pattern` - Pattern to match (e.g., "*.md").
5218    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5219        let mut query = self.selection.select("glob");
5220        query = query.arg("pattern", pattern.into());
5221        query.execute(self.graphql_client.clone()).await
5222    }
5223    /// A unique identifier for this Directory.
5224    pub async fn id(&self) -> Result<Id, DaggerError> {
5225        let query = self.selection.select("id");
5226        query.execute(self.graphql_client.clone()).await
5227    }
5228    /// Returns the name of the directory.
5229    pub async fn name(&self) -> Result<String, DaggerError> {
5230        let query = self.selection.select("name");
5231        query.execute(self.graphql_client.clone()).await
5232    }
5233    /// Searches for content matching the given regular expression or literal string.
5234    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5235    ///
5236    /// # Arguments
5237    ///
5238    /// * `pattern` - The text to match.
5239    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5240    pub async fn search(
5241        &self,
5242        pattern: impl Into<String>,
5243    ) -> Result<Vec<SearchResult>, DaggerError> {
5244        let mut query = self.selection.select("search");
5245        query = query.arg("pattern", pattern.into());
5246        let query = query.select("id");
5247        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5248        Ok(ids
5249            .into_iter()
5250            .map(|id| SearchResult {
5251                proc: self.proc.clone(),
5252                selection: crate::querybuilder::query()
5253                    .select("node")
5254                    .arg("id", &id.0)
5255                    .inline_fragment("SearchResult"),
5256                graphql_client: self.graphql_client.clone(),
5257            })
5258            .collect())
5259    }
5260    /// Searches for content matching the given regular expression or literal string.
5261    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5262    ///
5263    /// # Arguments
5264    ///
5265    /// * `pattern` - The text to match.
5266    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5267    pub async fn search_opts<'a>(
5268        &self,
5269        pattern: impl Into<String>,
5270        opts: DirectorySearchOpts<'a>,
5271    ) -> Result<Vec<SearchResult>, DaggerError> {
5272        let mut query = self.selection.select("search");
5273        query = query.arg("pattern", pattern.into());
5274        if let Some(paths) = opts.paths {
5275            query = query.arg("paths", paths);
5276        }
5277        if let Some(globs) = opts.globs {
5278            query = query.arg("globs", globs);
5279        }
5280        if let Some(literal) = opts.literal {
5281            query = query.arg("literal", literal);
5282        }
5283        if let Some(multiline) = opts.multiline {
5284            query = query.arg("multiline", multiline);
5285        }
5286        if let Some(dotall) = opts.dotall {
5287            query = query.arg("dotall", dotall);
5288        }
5289        if let Some(insensitive) = opts.insensitive {
5290            query = query.arg("insensitive", insensitive);
5291        }
5292        if let Some(skip_ignored) = opts.skip_ignored {
5293            query = query.arg("skipIgnored", skip_ignored);
5294        }
5295        if let Some(skip_hidden) = opts.skip_hidden {
5296            query = query.arg("skipHidden", skip_hidden);
5297        }
5298        if let Some(files_only) = opts.files_only {
5299            query = query.arg("filesOnly", files_only);
5300        }
5301        if let Some(limit) = opts.limit {
5302            query = query.arg("limit", limit);
5303        }
5304        let query = query.select("id");
5305        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5306        Ok(ids
5307            .into_iter()
5308            .map(|id| SearchResult {
5309                proc: self.proc.clone(),
5310                selection: crate::querybuilder::query()
5311                    .select("node")
5312                    .arg("id", &id.0)
5313                    .inline_fragment("SearchResult"),
5314                graphql_client: self.graphql_client.clone(),
5315            })
5316            .collect())
5317    }
5318    /// Return file status
5319    ///
5320    /// # Arguments
5321    ///
5322    /// * `path` - Path to stat (e.g., "/file.txt").
5323    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5324    pub fn stat(&self, path: impl Into<String>) -> Stat {
5325        let mut query = self.selection.select("stat");
5326        query = query.arg("path", path.into());
5327        Stat {
5328            proc: self.proc.clone(),
5329            selection: query,
5330            graphql_client: self.graphql_client.clone(),
5331        }
5332    }
5333    /// Return file status
5334    ///
5335    /// # Arguments
5336    ///
5337    /// * `path` - Path to stat (e.g., "/file.txt").
5338    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5339    pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
5340        let mut query = self.selection.select("stat");
5341        query = query.arg("path", path.into());
5342        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5343            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5344        }
5345        Stat {
5346            proc: self.proc.clone(),
5347            selection: query,
5348            graphql_client: self.graphql_client.clone(),
5349        }
5350    }
5351    /// Force evaluation in the engine.
5352    pub async fn sync(&self) -> Result<Directory, DaggerError> {
5353        let query = self.selection.select("sync");
5354        let id: Id = query.execute(self.graphql_client.clone()).await?;
5355        Ok(Directory {
5356            proc: self.proc.clone(),
5357            selection: query
5358                .root()
5359                .select("node")
5360                .arg("id", &id.0)
5361                .inline_fragment("Directory"),
5362            graphql_client: self.graphql_client.clone(),
5363        })
5364    }
5365    /// Opens an interactive terminal in new container with this directory mounted inside.
5366    ///
5367    /// # Arguments
5368    ///
5369    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5370    pub fn terminal(&self) -> Directory {
5371        let query = self.selection.select("terminal");
5372        Directory {
5373            proc: self.proc.clone(),
5374            selection: query,
5375            graphql_client: self.graphql_client.clone(),
5376        }
5377    }
5378    /// Opens an interactive terminal in new container with this directory mounted inside.
5379    ///
5380    /// # Arguments
5381    ///
5382    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5383    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5384        let mut query = self.selection.select("terminal");
5385        if let Some(container) = opts.container {
5386            query = query.arg("container", container);
5387        }
5388        if let Some(cmd) = opts.cmd {
5389            query = query.arg("cmd", cmd);
5390        }
5391        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5392            query = query.arg(
5393                "experimentalPrivilegedNesting",
5394                experimental_privileged_nesting,
5395            );
5396        }
5397        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5398            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5399        }
5400        Directory {
5401            proc: self.proc.clone(),
5402            selection: query,
5403            graphql_client: self.graphql_client.clone(),
5404        }
5405    }
5406    /// Return a directory with changes from another directory applied to it.
5407    ///
5408    /// # Arguments
5409    ///
5410    /// * `changes` - Changes to apply to the directory
5411    pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
5412        let mut query = self.selection.select("withChanges");
5413        query = query.arg_lazy(
5414            "changes",
5415            Box::new(move || {
5416                let changes = changes.clone();
5417                Box::pin(async move { changes.into_id().await.unwrap().quote() })
5418            }),
5419        );
5420        Directory {
5421            proc: self.proc.clone(),
5422            selection: query,
5423            graphql_client: self.graphql_client.clone(),
5424        }
5425    }
5426    /// Return a snapshot with a directory added
5427    ///
5428    /// # Arguments
5429    ///
5430    /// * `path` - Location of the written directory (e.g., "/src/").
5431    /// * `source` - Identifier of the directory to copy.
5432    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5433    pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5434        let mut query = self.selection.select("withDirectory");
5435        query = query.arg("path", path.into());
5436        query = query.arg_lazy(
5437            "source",
5438            Box::new(move || {
5439                let source = source.clone();
5440                Box::pin(async move { source.into_id().await.unwrap().quote() })
5441            }),
5442        );
5443        Directory {
5444            proc: self.proc.clone(),
5445            selection: query,
5446            graphql_client: self.graphql_client.clone(),
5447        }
5448    }
5449    /// Return a snapshot with a directory added
5450    ///
5451    /// # Arguments
5452    ///
5453    /// * `path` - Location of the written directory (e.g., "/src/").
5454    /// * `source` - Identifier of the directory to copy.
5455    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5456    pub fn with_directory_opts<'a>(
5457        &self,
5458        path: impl Into<String>,
5459        source: impl IntoID<Id>,
5460        opts: DirectoryWithDirectoryOpts<'a>,
5461    ) -> Directory {
5462        let mut query = self.selection.select("withDirectory");
5463        query = query.arg("path", path.into());
5464        query = query.arg_lazy(
5465            "source",
5466            Box::new(move || {
5467                let source = source.clone();
5468                Box::pin(async move { source.into_id().await.unwrap().quote() })
5469            }),
5470        );
5471        if let Some(exclude) = opts.exclude {
5472            query = query.arg("exclude", exclude);
5473        }
5474        if let Some(include) = opts.include {
5475            query = query.arg("include", include);
5476        }
5477        if let Some(gitignore) = opts.gitignore {
5478            query = query.arg("gitignore", gitignore);
5479        }
5480        if let Some(owner) = opts.owner {
5481            query = query.arg("owner", owner);
5482        }
5483        if let Some(permissions) = opts.permissions {
5484            query = query.arg("permissions", permissions);
5485        }
5486        Directory {
5487            proc: self.proc.clone(),
5488            selection: query,
5489            graphql_client: self.graphql_client.clone(),
5490        }
5491    }
5492    /// Raise an error.
5493    ///
5494    /// # Arguments
5495    ///
5496    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
5497    pub fn with_error(&self, err: impl Into<String>) -> Directory {
5498        let mut query = self.selection.select("withError");
5499        query = query.arg("err", err.into());
5500        Directory {
5501            proc: self.proc.clone(),
5502            selection: query,
5503            graphql_client: self.graphql_client.clone(),
5504        }
5505    }
5506    /// Retrieves this directory plus the contents of the given file copied to the given path.
5507    ///
5508    /// # Arguments
5509    ///
5510    /// * `path` - Location of the copied file (e.g., "/file.txt").
5511    /// * `source` - Identifier of the file to copy.
5512    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5513    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5514        let mut query = self.selection.select("withFile");
5515        query = query.arg("path", path.into());
5516        query = query.arg_lazy(
5517            "source",
5518            Box::new(move || {
5519                let source = source.clone();
5520                Box::pin(async move { source.into_id().await.unwrap().quote() })
5521            }),
5522        );
5523        Directory {
5524            proc: self.proc.clone(),
5525            selection: query,
5526            graphql_client: self.graphql_client.clone(),
5527        }
5528    }
5529    /// Retrieves this directory plus the contents of the given file copied to the given path.
5530    ///
5531    /// # Arguments
5532    ///
5533    /// * `path` - Location of the copied file (e.g., "/file.txt").
5534    /// * `source` - Identifier of the file to copy.
5535    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5536    pub fn with_file_opts<'a>(
5537        &self,
5538        path: impl Into<String>,
5539        source: impl IntoID<Id>,
5540        opts: DirectoryWithFileOpts<'a>,
5541    ) -> Directory {
5542        let mut query = self.selection.select("withFile");
5543        query = query.arg("path", path.into());
5544        query = query.arg_lazy(
5545            "source",
5546            Box::new(move || {
5547                let source = source.clone();
5548                Box::pin(async move { source.into_id().await.unwrap().quote() })
5549            }),
5550        );
5551        if let Some(permissions) = opts.permissions {
5552            query = query.arg("permissions", permissions);
5553        }
5554        if let Some(owner) = opts.owner {
5555            query = query.arg("owner", owner);
5556        }
5557        Directory {
5558            proc: self.proc.clone(),
5559            selection: query,
5560            graphql_client: self.graphql_client.clone(),
5561        }
5562    }
5563    /// Retrieves this directory plus the contents of the given files copied to the given path.
5564    ///
5565    /// # Arguments
5566    ///
5567    /// * `path` - Location where copied files should be placed (e.g., "/src").
5568    /// * `sources` - Identifiers of the files to copy.
5569    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5570    pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
5571        let mut query = self.selection.select("withFiles");
5572        query = query.arg("path", path.into());
5573        query = query.arg("sources", sources);
5574        Directory {
5575            proc: self.proc.clone(),
5576            selection: query,
5577            graphql_client: self.graphql_client.clone(),
5578        }
5579    }
5580    /// Retrieves this directory plus the contents of the given files copied to the given path.
5581    ///
5582    /// # Arguments
5583    ///
5584    /// * `path` - Location where copied files should be placed (e.g., "/src").
5585    /// * `sources` - Identifiers of the files to copy.
5586    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5587    pub fn with_files_opts(
5588        &self,
5589        path: impl Into<String>,
5590        sources: Vec<Id>,
5591        opts: DirectoryWithFilesOpts,
5592    ) -> Directory {
5593        let mut query = self.selection.select("withFiles");
5594        query = query.arg("path", path.into());
5595        query = query.arg("sources", sources);
5596        if let Some(permissions) = opts.permissions {
5597            query = query.arg("permissions", permissions);
5598        }
5599        Directory {
5600            proc: self.proc.clone(),
5601            selection: query,
5602            graphql_client: self.graphql_client.clone(),
5603        }
5604    }
5605    /// Retrieves this directory plus a new directory created at the given path.
5606    ///
5607    /// # Arguments
5608    ///
5609    /// * `path` - Location of the directory created (e.g., "/logs").
5610    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5611    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5612        let mut query = self.selection.select("withNewDirectory");
5613        query = query.arg("path", path.into());
5614        Directory {
5615            proc: self.proc.clone(),
5616            selection: query,
5617            graphql_client: self.graphql_client.clone(),
5618        }
5619    }
5620    /// Retrieves this directory plus a new directory created at the given path.
5621    ///
5622    /// # Arguments
5623    ///
5624    /// * `path` - Location of the directory created (e.g., "/logs").
5625    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5626    pub fn with_new_directory_opts(
5627        &self,
5628        path: impl Into<String>,
5629        opts: DirectoryWithNewDirectoryOpts,
5630    ) -> Directory {
5631        let mut query = self.selection.select("withNewDirectory");
5632        query = query.arg("path", path.into());
5633        if let Some(permissions) = opts.permissions {
5634            query = query.arg("permissions", permissions);
5635        }
5636        Directory {
5637            proc: self.proc.clone(),
5638            selection: query,
5639            graphql_client: self.graphql_client.clone(),
5640        }
5641    }
5642    /// Return a snapshot with a new file added
5643    ///
5644    /// # Arguments
5645    ///
5646    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5647    /// * `contents` - Contents of the new file. Example: "Hello world!"
5648    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5649    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5650        let mut query = self.selection.select("withNewFile");
5651        query = query.arg("path", path.into());
5652        query = query.arg("contents", contents.into());
5653        Directory {
5654            proc: self.proc.clone(),
5655            selection: query,
5656            graphql_client: self.graphql_client.clone(),
5657        }
5658    }
5659    /// Return a snapshot with a new file added
5660    ///
5661    /// # Arguments
5662    ///
5663    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5664    /// * `contents` - Contents of the new file. Example: "Hello world!"
5665    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5666    pub fn with_new_file_opts(
5667        &self,
5668        path: impl Into<String>,
5669        contents: impl Into<String>,
5670        opts: DirectoryWithNewFileOpts,
5671    ) -> Directory {
5672        let mut query = self.selection.select("withNewFile");
5673        query = query.arg("path", path.into());
5674        query = query.arg("contents", contents.into());
5675        if let Some(permissions) = opts.permissions {
5676            query = query.arg("permissions", permissions);
5677        }
5678        Directory {
5679            proc: self.proc.clone(),
5680            selection: query,
5681            graphql_client: self.graphql_client.clone(),
5682        }
5683    }
5684    /// Retrieves this directory with the given Git-compatible patch applied.
5685    ///
5686    /// # Arguments
5687    ///
5688    /// * `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").
5689    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5690        let mut query = self.selection.select("withPatch");
5691        query = query.arg("patch", patch.into());
5692        Directory {
5693            proc: self.proc.clone(),
5694            selection: query,
5695            graphql_client: self.graphql_client.clone(),
5696        }
5697    }
5698    /// Retrieves this directory with the given Git-compatible patch file applied.
5699    ///
5700    /// # Arguments
5701    ///
5702    /// * `patch` - File containing the patch to apply
5703    pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
5704        let mut query = self.selection.select("withPatchFile");
5705        query = query.arg_lazy(
5706            "patch",
5707            Box::new(move || {
5708                let patch = patch.clone();
5709                Box::pin(async move { patch.into_id().await.unwrap().quote() })
5710            }),
5711        );
5712        Directory {
5713            proc: self.proc.clone(),
5714            selection: query,
5715            graphql_client: self.graphql_client.clone(),
5716        }
5717    }
5718    /// Return a snapshot with a symlink
5719    ///
5720    /// # Arguments
5721    ///
5722    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5723    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5724    pub fn with_symlink(
5725        &self,
5726        target: impl Into<String>,
5727        link_name: impl Into<String>,
5728    ) -> Directory {
5729        let mut query = self.selection.select("withSymlink");
5730        query = query.arg("target", target.into());
5731        query = query.arg("linkName", link_name.into());
5732        Directory {
5733            proc: self.proc.clone(),
5734            selection: query,
5735            graphql_client: self.graphql_client.clone(),
5736        }
5737    }
5738    /// Retrieves this directory with all file/dir timestamps set to the given time.
5739    ///
5740    /// # Arguments
5741    ///
5742    /// * `timestamp` - Timestamp to set dir/files in.
5743    ///
5744    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
5745    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5746        let mut query = self.selection.select("withTimestamps");
5747        query = query.arg("timestamp", timestamp);
5748        Directory {
5749            proc: self.proc.clone(),
5750            selection: query,
5751            graphql_client: self.graphql_client.clone(),
5752        }
5753    }
5754    /// Return a snapshot with a subdirectory removed
5755    ///
5756    /// # Arguments
5757    ///
5758    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
5759    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5760        let mut query = self.selection.select("withoutDirectory");
5761        query = query.arg("path", path.into());
5762        Directory {
5763            proc: self.proc.clone(),
5764            selection: query,
5765            graphql_client: self.graphql_client.clone(),
5766        }
5767    }
5768    /// Return a snapshot with a file removed
5769    ///
5770    /// # Arguments
5771    ///
5772    /// * `path` - Path of the file to remove (e.g., "/file.txt").
5773    pub fn without_file(&self, path: impl Into<String>) -> Directory {
5774        let mut query = self.selection.select("withoutFile");
5775        query = query.arg("path", path.into());
5776        Directory {
5777            proc: self.proc.clone(),
5778            selection: query,
5779            graphql_client: self.graphql_client.clone(),
5780        }
5781    }
5782    /// Return a snapshot with files removed
5783    ///
5784    /// # Arguments
5785    ///
5786    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
5787    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5788        let mut query = self.selection.select("withoutFiles");
5789        query = query.arg(
5790            "paths",
5791            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5792        );
5793        Directory {
5794            proc: self.proc.clone(),
5795            selection: query,
5796            graphql_client: self.graphql_client.clone(),
5797        }
5798    }
5799}
5800impl Exportable for Directory {
5801    fn export(
5802        &self,
5803        path: impl Into<String>,
5804    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
5805        let mut query = self.selection.select("export");
5806        query = query.arg("path", path.into());
5807        let graphql_client = self.graphql_client.clone();
5808        async move { query.execute(graphql_client).await }
5809    }
5810    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5811        let query = self.selection.select("id");
5812        let graphql_client = self.graphql_client.clone();
5813        async move { query.execute(graphql_client).await }
5814    }
5815}
5816impl Node for Directory {
5817    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5818        let query = self.selection.select("id");
5819        let graphql_client = self.graphql_client.clone();
5820        async move { query.execute(graphql_client).await }
5821    }
5822}
5823impl Syncer for Directory {
5824    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5825        let query = self.selection.select("id");
5826        let graphql_client = self.graphql_client.clone();
5827        async move { query.execute(graphql_client).await }
5828    }
5829    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5830        let query = self.selection.select("sync");
5831        let graphql_client = self.graphql_client.clone();
5832        async move { query.execute(graphql_client).await }
5833    }
5834}
5835#[derive(Clone)]
5836pub struct Engine {
5837    pub proc: Option<Arc<DaggerSessionProc>>,
5838    pub selection: Selection,
5839    pub graphql_client: DynGraphQLClient,
5840}
5841impl IntoID<Id> for Engine {
5842    fn into_id(
5843        self,
5844    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5845        Box::pin(async move { self.id().await })
5846    }
5847}
5848impl Loadable for Engine {
5849    fn graphql_type() -> &'static str {
5850        "Engine"
5851    }
5852    fn from_query(
5853        proc: Option<Arc<DaggerSessionProc>>,
5854        selection: Selection,
5855        graphql_client: DynGraphQLClient,
5856    ) -> Self {
5857        Self {
5858            proc,
5859            selection,
5860            graphql_client,
5861        }
5862    }
5863}
5864impl Engine {
5865    /// The list of connected client IDs
5866    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
5867        let query = self.selection.select("clients");
5868        query.execute(self.graphql_client.clone()).await
5869    }
5870    /// A unique identifier for this Engine.
5871    pub async fn id(&self) -> Result<Id, DaggerError> {
5872        let query = self.selection.select("id");
5873        query.execute(self.graphql_client.clone()).await
5874    }
5875    /// The local engine cache state tracked by dagql
5876    pub fn local_cache(&self) -> EngineCache {
5877        let query = self.selection.select("localCache");
5878        EngineCache {
5879            proc: self.proc.clone(),
5880            selection: query,
5881            graphql_client: self.graphql_client.clone(),
5882        }
5883    }
5884    /// The name of the engine instance.
5885    pub async fn name(&self) -> Result<String, DaggerError> {
5886        let query = self.selection.select("name");
5887        query.execute(self.graphql_client.clone()).await
5888    }
5889}
5890impl Node for Engine {
5891    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5892        let query = self.selection.select("id");
5893        let graphql_client = self.graphql_client.clone();
5894        async move { query.execute(graphql_client).await }
5895    }
5896}
5897#[derive(Clone)]
5898pub struct EngineCache {
5899    pub proc: Option<Arc<DaggerSessionProc>>,
5900    pub selection: Selection,
5901    pub graphql_client: DynGraphQLClient,
5902}
5903#[derive(Builder, Debug, PartialEq)]
5904pub struct EngineCacheEntrySetOpts<'a> {
5905    #[builder(setter(into, strip_option), default)]
5906    pub key: Option<&'a str>,
5907}
5908#[derive(Builder, Debug, PartialEq)]
5909pub struct EngineCachePruneOpts<'a> {
5910    /// Override the maximum disk space to keep before pruning (e.g. "200GB" or "80%").
5911    #[builder(setter(into, strip_option), default)]
5912    pub max_used_space: Option<&'a str>,
5913    /// Override the minimum free disk space target during pruning (e.g. "20GB" or "20%").
5914    #[builder(setter(into, strip_option), default)]
5915    pub min_free_space: Option<&'a str>,
5916    /// Override the minimum disk space to retain during pruning (e.g. "500GB" or "10%").
5917    #[builder(setter(into, strip_option), default)]
5918    pub reserved_space: Option<&'a str>,
5919    /// Override the target disk space to keep after pruning (e.g. "200GB" or "50%").
5920    #[builder(setter(into, strip_option), default)]
5921    pub target_space: Option<&'a str>,
5922    /// Use the engine-wide default pruning policy if true, otherwise prune the whole cache of any releasable entries.
5923    #[builder(setter(into, strip_option), default)]
5924    pub use_default_policy: Option<bool>,
5925}
5926impl IntoID<Id> for EngineCache {
5927    fn into_id(
5928        self,
5929    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5930        Box::pin(async move { self.id().await })
5931    }
5932}
5933impl Loadable for EngineCache {
5934    fn graphql_type() -> &'static str {
5935        "EngineCache"
5936    }
5937    fn from_query(
5938        proc: Option<Arc<DaggerSessionProc>>,
5939        selection: Selection,
5940        graphql_client: DynGraphQLClient,
5941    ) -> Self {
5942        Self {
5943            proc,
5944            selection,
5945            graphql_client,
5946        }
5947    }
5948}
5949impl EngineCache {
5950    /// The current set of entries in the cache
5951    ///
5952    /// # Arguments
5953    ///
5954    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5955    pub fn entry_set(&self) -> EngineCacheEntrySet {
5956        let query = self.selection.select("entrySet");
5957        EngineCacheEntrySet {
5958            proc: self.proc.clone(),
5959            selection: query,
5960            graphql_client: self.graphql_client.clone(),
5961        }
5962    }
5963    /// The current set of entries in the cache
5964    ///
5965    /// # Arguments
5966    ///
5967    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5968    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5969        let mut query = self.selection.select("entrySet");
5970        if let Some(key) = opts.key {
5971            query = query.arg("key", key);
5972        }
5973        EngineCacheEntrySet {
5974            proc: self.proc.clone(),
5975            selection: query,
5976            graphql_client: self.graphql_client.clone(),
5977        }
5978    }
5979    /// A unique identifier for this EngineCache.
5980    pub async fn id(&self) -> Result<Id, DaggerError> {
5981        let query = self.selection.select("id");
5982        query.execute(self.graphql_client.clone()).await
5983    }
5984    /// The maximum bytes to keep in the cache without pruning.
5985    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5986        let query = self.selection.select("maxUsedSpace");
5987        query.execute(self.graphql_client.clone()).await
5988    }
5989    /// The target amount of free disk space the garbage collector will attempt to leave.
5990    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5991        let query = self.selection.select("minFreeSpace");
5992        query.execute(self.graphql_client.clone()).await
5993    }
5994    /// Prune the cache of releaseable entries
5995    ///
5996    /// # Arguments
5997    ///
5998    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5999    pub async fn prune(&self) -> Result<Void, DaggerError> {
6000        let query = self.selection.select("prune");
6001        query.execute(self.graphql_client.clone()).await
6002    }
6003    /// Prune the cache of releaseable entries
6004    ///
6005    /// # Arguments
6006    ///
6007    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6008    pub async fn prune_opts<'a>(
6009        &self,
6010        opts: EngineCachePruneOpts<'a>,
6011    ) -> Result<Void, DaggerError> {
6012        let mut query = self.selection.select("prune");
6013        if let Some(use_default_policy) = opts.use_default_policy {
6014            query = query.arg("useDefaultPolicy", use_default_policy);
6015        }
6016        if let Some(max_used_space) = opts.max_used_space {
6017            query = query.arg("maxUsedSpace", max_used_space);
6018        }
6019        if let Some(reserved_space) = opts.reserved_space {
6020            query = query.arg("reservedSpace", reserved_space);
6021        }
6022        if let Some(min_free_space) = opts.min_free_space {
6023            query = query.arg("minFreeSpace", min_free_space);
6024        }
6025        if let Some(target_space) = opts.target_space {
6026            query = query.arg("targetSpace", target_space);
6027        }
6028        query.execute(self.graphql_client.clone()).await
6029    }
6030    /// The minimum amount of disk space this policy is guaranteed to retain.
6031    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
6032        let query = self.selection.select("reservedSpace");
6033        query.execute(self.graphql_client.clone()).await
6034    }
6035    /// The target number of bytes to keep when pruning.
6036    pub async fn target_space(&self) -> Result<isize, DaggerError> {
6037        let query = self.selection.select("targetSpace");
6038        query.execute(self.graphql_client.clone()).await
6039    }
6040}
6041impl Node for EngineCache {
6042    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6043        let query = self.selection.select("id");
6044        let graphql_client = self.graphql_client.clone();
6045        async move { query.execute(graphql_client).await }
6046    }
6047}
6048#[derive(Clone)]
6049pub struct EngineCacheEntry {
6050    pub proc: Option<Arc<DaggerSessionProc>>,
6051    pub selection: Selection,
6052    pub graphql_client: DynGraphQLClient,
6053}
6054impl IntoID<Id> for EngineCacheEntry {
6055    fn into_id(
6056        self,
6057    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6058        Box::pin(async move { self.id().await })
6059    }
6060}
6061impl Loadable for EngineCacheEntry {
6062    fn graphql_type() -> &'static str {
6063        "EngineCacheEntry"
6064    }
6065    fn from_query(
6066        proc: Option<Arc<DaggerSessionProc>>,
6067        selection: Selection,
6068        graphql_client: DynGraphQLClient,
6069    ) -> Self {
6070        Self {
6071            proc,
6072            selection,
6073            graphql_client,
6074        }
6075    }
6076}
6077impl EngineCacheEntry {
6078    /// Whether the cache entry is actively being used.
6079    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
6080        let query = self.selection.select("activelyUsed");
6081        query.execute(self.graphql_client.clone()).await
6082    }
6083    /// The time the cache entry was created, in Unix nanoseconds.
6084    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
6085        let query = self.selection.select("createdTimeUnixNano");
6086        query.execute(self.graphql_client.clone()).await
6087    }
6088    /// The DagQL call that produced this cache entry.
6089    pub async fn dagql_call(&self) -> Result<String, DaggerError> {
6090        let query = self.selection.select("dagqlCall");
6091        query.execute(self.graphql_client.clone()).await
6092    }
6093    /// The description of the cache entry.
6094    pub async fn description(&self) -> Result<String, DaggerError> {
6095        let query = self.selection.select("description");
6096        query.execute(self.graphql_client.clone()).await
6097    }
6098    /// The disk space used by the cache entry.
6099    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6100        let query = self.selection.select("diskSpaceBytes");
6101        query.execute(self.graphql_client.clone()).await
6102    }
6103    /// A unique identifier for this EngineCacheEntry.
6104    pub async fn id(&self) -> Result<Id, DaggerError> {
6105        let query = self.selection.select("id");
6106        query.execute(self.graphql_client.clone()).await
6107    }
6108    /// The most recent time the cache entry was used, in Unix nanoseconds.
6109    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
6110        let query = self.selection.select("mostRecentUseTimeUnixNano");
6111        query.execute(self.graphql_client.clone()).await
6112    }
6113    /// The type of the cache record (e.g. regular, internal, frontend, source.local, source.git.checkout, exec.cachemount).
6114    pub async fn record_type(&self) -> Result<String, DaggerError> {
6115        let query = self.selection.select("recordType");
6116        query.execute(self.graphql_client.clone()).await
6117    }
6118    /// The storage record types represented by this cache entry.
6119    pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
6120        let query = self.selection.select("recordTypes");
6121        query.execute(self.graphql_client.clone()).await
6122    }
6123}
6124impl Node for EngineCacheEntry {
6125    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6126        let query = self.selection.select("id");
6127        let graphql_client = self.graphql_client.clone();
6128        async move { query.execute(graphql_client).await }
6129    }
6130}
6131#[derive(Clone)]
6132pub struct EngineCacheEntrySet {
6133    pub proc: Option<Arc<DaggerSessionProc>>,
6134    pub selection: Selection,
6135    pub graphql_client: DynGraphQLClient,
6136}
6137impl IntoID<Id> for EngineCacheEntrySet {
6138    fn into_id(
6139        self,
6140    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6141        Box::pin(async move { self.id().await })
6142    }
6143}
6144impl Loadable for EngineCacheEntrySet {
6145    fn graphql_type() -> &'static str {
6146        "EngineCacheEntrySet"
6147    }
6148    fn from_query(
6149        proc: Option<Arc<DaggerSessionProc>>,
6150        selection: Selection,
6151        graphql_client: DynGraphQLClient,
6152    ) -> Self {
6153        Self {
6154            proc,
6155            selection,
6156            graphql_client,
6157        }
6158    }
6159}
6160impl EngineCacheEntrySet {
6161    /// The total disk space used by the cache entries in this set.
6162    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6163        let query = self.selection.select("diskSpaceBytes");
6164        query.execute(self.graphql_client.clone()).await
6165    }
6166    /// The list of individual cache entries in the set
6167    pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
6168        let query = self.selection.select("entries");
6169        let query = query.select("id");
6170        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6171        Ok(ids
6172            .into_iter()
6173            .map(|id| EngineCacheEntry {
6174                proc: self.proc.clone(),
6175                selection: crate::querybuilder::query()
6176                    .select("node")
6177                    .arg("id", &id.0)
6178                    .inline_fragment("EngineCacheEntry"),
6179                graphql_client: self.graphql_client.clone(),
6180            })
6181            .collect())
6182    }
6183    /// The number of cache entries in this set.
6184    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6185        let query = self.selection.select("entryCount");
6186        query.execute(self.graphql_client.clone()).await
6187    }
6188    /// A unique identifier for this EngineCacheEntrySet.
6189    pub async fn id(&self) -> Result<Id, DaggerError> {
6190        let query = self.selection.select("id");
6191        query.execute(self.graphql_client.clone()).await
6192    }
6193}
6194impl Node for EngineCacheEntrySet {
6195    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6196        let query = self.selection.select("id");
6197        let graphql_client = self.graphql_client.clone();
6198        async move { query.execute(graphql_client).await }
6199    }
6200}
6201#[derive(Clone)]
6202pub struct EnumTypeDef {
6203    pub proc: Option<Arc<DaggerSessionProc>>,
6204    pub selection: Selection,
6205    pub graphql_client: DynGraphQLClient,
6206}
6207impl IntoID<Id> for EnumTypeDef {
6208    fn into_id(
6209        self,
6210    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6211        Box::pin(async move { self.id().await })
6212    }
6213}
6214impl Loadable for EnumTypeDef {
6215    fn graphql_type() -> &'static str {
6216        "EnumTypeDef"
6217    }
6218    fn from_query(
6219        proc: Option<Arc<DaggerSessionProc>>,
6220        selection: Selection,
6221        graphql_client: DynGraphQLClient,
6222    ) -> Self {
6223        Self {
6224            proc,
6225            selection,
6226            graphql_client,
6227        }
6228    }
6229}
6230impl EnumTypeDef {
6231    /// A doc string for the enum, if any.
6232    pub async fn description(&self) -> Result<String, DaggerError> {
6233        let query = self.selection.select("description");
6234        query.execute(self.graphql_client.clone()).await
6235    }
6236    /// A unique identifier for this EnumTypeDef.
6237    pub async fn id(&self) -> Result<Id, DaggerError> {
6238        let query = self.selection.select("id");
6239        query.execute(self.graphql_client.clone()).await
6240    }
6241    /// The members of the enum.
6242    pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6243        let query = self.selection.select("members");
6244        let query = query.select("id");
6245        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6246        Ok(ids
6247            .into_iter()
6248            .map(|id| EnumValueTypeDef {
6249                proc: self.proc.clone(),
6250                selection: crate::querybuilder::query()
6251                    .select("node")
6252                    .arg("id", &id.0)
6253                    .inline_fragment("EnumValueTypeDef"),
6254                graphql_client: self.graphql_client.clone(),
6255            })
6256            .collect())
6257    }
6258    /// The name of the enum.
6259    pub async fn name(&self) -> Result<String, DaggerError> {
6260        let query = self.selection.select("name");
6261        query.execute(self.graphql_client.clone()).await
6262    }
6263    /// The location of this enum declaration.
6264    pub fn source_map(&self) -> SourceMap {
6265        let query = self.selection.select("sourceMap");
6266        SourceMap {
6267            proc: self.proc.clone(),
6268            selection: query,
6269            graphql_client: self.graphql_client.clone(),
6270        }
6271    }
6272    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
6273    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6274        let query = self.selection.select("sourceModuleName");
6275        query.execute(self.graphql_client.clone()).await
6276    }
6277    /// The members of the enum.
6278    pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6279        let query = self.selection.select("values");
6280        let query = query.select("id");
6281        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6282        Ok(ids
6283            .into_iter()
6284            .map(|id| EnumValueTypeDef {
6285                proc: self.proc.clone(),
6286                selection: crate::querybuilder::query()
6287                    .select("node")
6288                    .arg("id", &id.0)
6289                    .inline_fragment("EnumValueTypeDef"),
6290                graphql_client: self.graphql_client.clone(),
6291            })
6292            .collect())
6293    }
6294}
6295impl Node for EnumTypeDef {
6296    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6297        let query = self.selection.select("id");
6298        let graphql_client = self.graphql_client.clone();
6299        async move { query.execute(graphql_client).await }
6300    }
6301}
6302#[derive(Clone)]
6303pub struct EnumValueTypeDef {
6304    pub proc: Option<Arc<DaggerSessionProc>>,
6305    pub selection: Selection,
6306    pub graphql_client: DynGraphQLClient,
6307}
6308impl IntoID<Id> for EnumValueTypeDef {
6309    fn into_id(
6310        self,
6311    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6312        Box::pin(async move { self.id().await })
6313    }
6314}
6315impl Loadable for EnumValueTypeDef {
6316    fn graphql_type() -> &'static str {
6317        "EnumValueTypeDef"
6318    }
6319    fn from_query(
6320        proc: Option<Arc<DaggerSessionProc>>,
6321        selection: Selection,
6322        graphql_client: DynGraphQLClient,
6323    ) -> Self {
6324        Self {
6325            proc,
6326            selection,
6327            graphql_client,
6328        }
6329    }
6330}
6331impl EnumValueTypeDef {
6332    /// The reason this enum member is deprecated, if any.
6333    pub async fn deprecated(&self) -> Result<String, DaggerError> {
6334        let query = self.selection.select("deprecated");
6335        query.execute(self.graphql_client.clone()).await
6336    }
6337    /// A doc string for the enum member, if any.
6338    pub async fn description(&self) -> Result<String, DaggerError> {
6339        let query = self.selection.select("description");
6340        query.execute(self.graphql_client.clone()).await
6341    }
6342    /// A unique identifier for this EnumValueTypeDef.
6343    pub async fn id(&self) -> Result<Id, DaggerError> {
6344        let query = self.selection.select("id");
6345        query.execute(self.graphql_client.clone()).await
6346    }
6347    /// The name of the enum member.
6348    pub async fn name(&self) -> Result<String, DaggerError> {
6349        let query = self.selection.select("name");
6350        query.execute(self.graphql_client.clone()).await
6351    }
6352    /// The location of this enum member declaration.
6353    pub fn source_map(&self) -> SourceMap {
6354        let query = self.selection.select("sourceMap");
6355        SourceMap {
6356            proc: self.proc.clone(),
6357            selection: query,
6358            graphql_client: self.graphql_client.clone(),
6359        }
6360    }
6361    /// The value of the enum member
6362    pub async fn value(&self) -> Result<String, DaggerError> {
6363        let query = self.selection.select("value");
6364        query.execute(self.graphql_client.clone()).await
6365    }
6366}
6367impl Node for EnumValueTypeDef {
6368    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6369        let query = self.selection.select("id");
6370        let graphql_client = self.graphql_client.clone();
6371        async move { query.execute(graphql_client).await }
6372    }
6373}
6374#[derive(Clone)]
6375pub struct Env {
6376    pub proc: Option<Arc<DaggerSessionProc>>,
6377    pub selection: Selection,
6378    pub graphql_client: DynGraphQLClient,
6379}
6380#[derive(Builder, Debug, PartialEq)]
6381pub struct EnvChecksOpts<'a> {
6382    /// Only include checks matching the specified patterns
6383    #[builder(setter(into, strip_option), default)]
6384    pub include: Option<Vec<&'a str>>,
6385    /// When true, only return annotated check functions; exclude generate-as-checks
6386    #[builder(setter(into, strip_option), default)]
6387    pub no_generate: Option<bool>,
6388}
6389#[derive(Builder, Debug, PartialEq)]
6390pub struct EnvServicesOpts<'a> {
6391    /// Only include services matching the specified patterns
6392    #[builder(setter(into, strip_option), default)]
6393    pub include: Option<Vec<&'a str>>,
6394}
6395impl IntoID<Id> for Env {
6396    fn into_id(
6397        self,
6398    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6399        Box::pin(async move { self.id().await })
6400    }
6401}
6402impl Loadable for Env {
6403    fn graphql_type() -> &'static str {
6404        "Env"
6405    }
6406    fn from_query(
6407        proc: Option<Arc<DaggerSessionProc>>,
6408        selection: Selection,
6409        graphql_client: DynGraphQLClient,
6410    ) -> Self {
6411        Self {
6412            proc,
6413            selection,
6414            graphql_client,
6415        }
6416    }
6417}
6418impl Env {
6419    /// Return the check with the given name from the installed modules. Must match exactly one check.
6420    ///
6421    /// # Arguments
6422    ///
6423    /// * `name` - The name of the check to retrieve
6424    pub fn check(&self, name: impl Into<String>) -> Check {
6425        let mut query = self.selection.select("check");
6426        query = query.arg("name", name.into());
6427        Check {
6428            proc: self.proc.clone(),
6429            selection: query,
6430            graphql_client: self.graphql_client.clone(),
6431        }
6432    }
6433    /// Return all checks defined by the installed modules
6434    ///
6435    /// # Arguments
6436    ///
6437    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6438    pub fn checks(&self) -> CheckGroup {
6439        let query = self.selection.select("checks");
6440        CheckGroup {
6441            proc: self.proc.clone(),
6442            selection: query,
6443            graphql_client: self.graphql_client.clone(),
6444        }
6445    }
6446    /// Return all checks defined by the installed modules
6447    ///
6448    /// # Arguments
6449    ///
6450    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6451    pub fn checks_opts<'a>(&self, opts: EnvChecksOpts<'a>) -> CheckGroup {
6452        let mut query = self.selection.select("checks");
6453        if let Some(include) = opts.include {
6454            query = query.arg("include", include);
6455        }
6456        if let Some(no_generate) = opts.no_generate {
6457            query = query.arg("noGenerate", no_generate);
6458        }
6459        CheckGroup {
6460            proc: self.proc.clone(),
6461            selection: query,
6462            graphql_client: self.graphql_client.clone(),
6463        }
6464    }
6465    /// A unique identifier for this Env.
6466    pub async fn id(&self) -> Result<Id, DaggerError> {
6467        let query = self.selection.select("id");
6468        query.execute(self.graphql_client.clone()).await
6469    }
6470    /// Retrieves an input binding by name
6471    pub fn input(&self, name: impl Into<String>) -> Binding {
6472        let mut query = self.selection.select("input");
6473        query = query.arg("name", name.into());
6474        Binding {
6475            proc: self.proc.clone(),
6476            selection: query,
6477            graphql_client: self.graphql_client.clone(),
6478        }
6479    }
6480    /// Returns all input bindings provided to the environment
6481    pub async fn inputs(&self) -> Result<Vec<Binding>, DaggerError> {
6482        let query = self.selection.select("inputs");
6483        let query = query.select("id");
6484        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6485        Ok(ids
6486            .into_iter()
6487            .map(|id| Binding {
6488                proc: self.proc.clone(),
6489                selection: crate::querybuilder::query()
6490                    .select("node")
6491                    .arg("id", &id.0)
6492                    .inline_fragment("Binding"),
6493                graphql_client: self.graphql_client.clone(),
6494            })
6495            .collect())
6496    }
6497    /// Retrieves an output binding by name
6498    pub fn output(&self, name: impl Into<String>) -> Binding {
6499        let mut query = self.selection.select("output");
6500        query = query.arg("name", name.into());
6501        Binding {
6502            proc: self.proc.clone(),
6503            selection: query,
6504            graphql_client: self.graphql_client.clone(),
6505        }
6506    }
6507    /// Returns all declared output bindings for the environment
6508    pub async fn outputs(&self) -> Result<Vec<Binding>, DaggerError> {
6509        let query = self.selection.select("outputs");
6510        let query = query.select("id");
6511        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6512        Ok(ids
6513            .into_iter()
6514            .map(|id| Binding {
6515                proc: self.proc.clone(),
6516                selection: crate::querybuilder::query()
6517                    .select("node")
6518                    .arg("id", &id.0)
6519                    .inline_fragment("Binding"),
6520                graphql_client: self.graphql_client.clone(),
6521            })
6522            .collect())
6523    }
6524    /// Return all services defined by the installed modules
6525    ///
6526    /// # Arguments
6527    ///
6528    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6529    pub fn services(&self) -> UpGroup {
6530        let query = self.selection.select("services");
6531        UpGroup {
6532            proc: self.proc.clone(),
6533            selection: query,
6534            graphql_client: self.graphql_client.clone(),
6535        }
6536    }
6537    /// Return all services defined by the installed modules
6538    ///
6539    /// # Arguments
6540    ///
6541    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6542    pub fn services_opts<'a>(&self, opts: EnvServicesOpts<'a>) -> UpGroup {
6543        let mut query = self.selection.select("services");
6544        if let Some(include) = opts.include {
6545            query = query.arg("include", include);
6546        }
6547        UpGroup {
6548            proc: self.proc.clone(),
6549            selection: query,
6550            graphql_client: self.graphql_client.clone(),
6551        }
6552    }
6553    /// Create or update a binding of type Address in the environment
6554    ///
6555    /// # Arguments
6556    ///
6557    /// * `name` - The name of the binding
6558    /// * `value` - The Address value to assign to the binding
6559    /// * `description` - The purpose of the input
6560    pub fn with_address_input(
6561        &self,
6562        name: impl Into<String>,
6563        value: impl IntoID<Id>,
6564        description: impl Into<String>,
6565    ) -> Env {
6566        let mut query = self.selection.select("withAddressInput");
6567        query = query.arg("name", name.into());
6568        query = query.arg_lazy(
6569            "value",
6570            Box::new(move || {
6571                let value = value.clone();
6572                Box::pin(async move { value.into_id().await.unwrap().quote() })
6573            }),
6574        );
6575        query = query.arg("description", description.into());
6576        Env {
6577            proc: self.proc.clone(),
6578            selection: query,
6579            graphql_client: self.graphql_client.clone(),
6580        }
6581    }
6582    /// Declare a desired Address output to be assigned in the environment
6583    ///
6584    /// # Arguments
6585    ///
6586    /// * `name` - The name of the binding
6587    /// * `description` - A description of the desired value of the binding
6588    pub fn with_address_output(
6589        &self,
6590        name: impl Into<String>,
6591        description: impl Into<String>,
6592    ) -> Env {
6593        let mut query = self.selection.select("withAddressOutput");
6594        query = query.arg("name", name.into());
6595        query = query.arg("description", description.into());
6596        Env {
6597            proc: self.proc.clone(),
6598            selection: query,
6599            graphql_client: self.graphql_client.clone(),
6600        }
6601    }
6602    /// Create or update a binding of type CacheVolume in the environment
6603    ///
6604    /// # Arguments
6605    ///
6606    /// * `name` - The name of the binding
6607    /// * `value` - The CacheVolume value to assign to the binding
6608    /// * `description` - The purpose of the input
6609    pub fn with_cache_volume_input(
6610        &self,
6611        name: impl Into<String>,
6612        value: impl IntoID<Id>,
6613        description: impl Into<String>,
6614    ) -> Env {
6615        let mut query = self.selection.select("withCacheVolumeInput");
6616        query = query.arg("name", name.into());
6617        query = query.arg_lazy(
6618            "value",
6619            Box::new(move || {
6620                let value = value.clone();
6621                Box::pin(async move { value.into_id().await.unwrap().quote() })
6622            }),
6623        );
6624        query = query.arg("description", description.into());
6625        Env {
6626            proc: self.proc.clone(),
6627            selection: query,
6628            graphql_client: self.graphql_client.clone(),
6629        }
6630    }
6631    /// Declare a desired CacheVolume output to be assigned in the environment
6632    ///
6633    /// # Arguments
6634    ///
6635    /// * `name` - The name of the binding
6636    /// * `description` - A description of the desired value of the binding
6637    pub fn with_cache_volume_output(
6638        &self,
6639        name: impl Into<String>,
6640        description: impl Into<String>,
6641    ) -> Env {
6642        let mut query = self.selection.select("withCacheVolumeOutput");
6643        query = query.arg("name", name.into());
6644        query = query.arg("description", description.into());
6645        Env {
6646            proc: self.proc.clone(),
6647            selection: query,
6648            graphql_client: self.graphql_client.clone(),
6649        }
6650    }
6651    /// Create or update a binding of type Changeset in the environment
6652    ///
6653    /// # Arguments
6654    ///
6655    /// * `name` - The name of the binding
6656    /// * `value` - The Changeset value to assign to the binding
6657    /// * `description` - The purpose of the input
6658    pub fn with_changeset_input(
6659        &self,
6660        name: impl Into<String>,
6661        value: impl IntoID<Id>,
6662        description: impl Into<String>,
6663    ) -> Env {
6664        let mut query = self.selection.select("withChangesetInput");
6665        query = query.arg("name", name.into());
6666        query = query.arg_lazy(
6667            "value",
6668            Box::new(move || {
6669                let value = value.clone();
6670                Box::pin(async move { value.into_id().await.unwrap().quote() })
6671            }),
6672        );
6673        query = query.arg("description", description.into());
6674        Env {
6675            proc: self.proc.clone(),
6676            selection: query,
6677            graphql_client: self.graphql_client.clone(),
6678        }
6679    }
6680    /// Declare a desired Changeset output to be assigned in the environment
6681    ///
6682    /// # Arguments
6683    ///
6684    /// * `name` - The name of the binding
6685    /// * `description` - A description of the desired value of the binding
6686    pub fn with_changeset_output(
6687        &self,
6688        name: impl Into<String>,
6689        description: impl Into<String>,
6690    ) -> Env {
6691        let mut query = self.selection.select("withChangesetOutput");
6692        query = query.arg("name", name.into());
6693        query = query.arg("description", description.into());
6694        Env {
6695            proc: self.proc.clone(),
6696            selection: query,
6697            graphql_client: self.graphql_client.clone(),
6698        }
6699    }
6700    /// Create or update a binding of type CheckGroup in the environment
6701    ///
6702    /// # Arguments
6703    ///
6704    /// * `name` - The name of the binding
6705    /// * `value` - The CheckGroup value to assign to the binding
6706    /// * `description` - The purpose of the input
6707    pub fn with_check_group_input(
6708        &self,
6709        name: impl Into<String>,
6710        value: impl IntoID<Id>,
6711        description: impl Into<String>,
6712    ) -> Env {
6713        let mut query = self.selection.select("withCheckGroupInput");
6714        query = query.arg("name", name.into());
6715        query = query.arg_lazy(
6716            "value",
6717            Box::new(move || {
6718                let value = value.clone();
6719                Box::pin(async move { value.into_id().await.unwrap().quote() })
6720            }),
6721        );
6722        query = query.arg("description", description.into());
6723        Env {
6724            proc: self.proc.clone(),
6725            selection: query,
6726            graphql_client: self.graphql_client.clone(),
6727        }
6728    }
6729    /// Declare a desired CheckGroup output to be assigned in the environment
6730    ///
6731    /// # Arguments
6732    ///
6733    /// * `name` - The name of the binding
6734    /// * `description` - A description of the desired value of the binding
6735    pub fn with_check_group_output(
6736        &self,
6737        name: impl Into<String>,
6738        description: impl Into<String>,
6739    ) -> Env {
6740        let mut query = self.selection.select("withCheckGroupOutput");
6741        query = query.arg("name", name.into());
6742        query = query.arg("description", description.into());
6743        Env {
6744            proc: self.proc.clone(),
6745            selection: query,
6746            graphql_client: self.graphql_client.clone(),
6747        }
6748    }
6749    /// Create or update a binding of type Check in the environment
6750    ///
6751    /// # Arguments
6752    ///
6753    /// * `name` - The name of the binding
6754    /// * `value` - The Check value to assign to the binding
6755    /// * `description` - The purpose of the input
6756    pub fn with_check_input(
6757        &self,
6758        name: impl Into<String>,
6759        value: impl IntoID<Id>,
6760        description: impl Into<String>,
6761    ) -> Env {
6762        let mut query = self.selection.select("withCheckInput");
6763        query = query.arg("name", name.into());
6764        query = query.arg_lazy(
6765            "value",
6766            Box::new(move || {
6767                let value = value.clone();
6768                Box::pin(async move { value.into_id().await.unwrap().quote() })
6769            }),
6770        );
6771        query = query.arg("description", description.into());
6772        Env {
6773            proc: self.proc.clone(),
6774            selection: query,
6775            graphql_client: self.graphql_client.clone(),
6776        }
6777    }
6778    /// Declare a desired Check output to be assigned in the environment
6779    ///
6780    /// # Arguments
6781    ///
6782    /// * `name` - The name of the binding
6783    /// * `description` - A description of the desired value of the binding
6784    pub fn with_check_output(
6785        &self,
6786        name: impl Into<String>,
6787        description: impl Into<String>,
6788    ) -> Env {
6789        let mut query = self.selection.select("withCheckOutput");
6790        query = query.arg("name", name.into());
6791        query = query.arg("description", description.into());
6792        Env {
6793            proc: self.proc.clone(),
6794            selection: query,
6795            graphql_client: self.graphql_client.clone(),
6796        }
6797    }
6798    /// Create or update a binding of type Cloud in the environment
6799    ///
6800    /// # Arguments
6801    ///
6802    /// * `name` - The name of the binding
6803    /// * `value` - The Cloud value to assign to the binding
6804    /// * `description` - The purpose of the input
6805    pub fn with_cloud_input(
6806        &self,
6807        name: impl Into<String>,
6808        value: impl IntoID<Id>,
6809        description: impl Into<String>,
6810    ) -> Env {
6811        let mut query = self.selection.select("withCloudInput");
6812        query = query.arg("name", name.into());
6813        query = query.arg_lazy(
6814            "value",
6815            Box::new(move || {
6816                let value = value.clone();
6817                Box::pin(async move { value.into_id().await.unwrap().quote() })
6818            }),
6819        );
6820        query = query.arg("description", description.into());
6821        Env {
6822            proc: self.proc.clone(),
6823            selection: query,
6824            graphql_client: self.graphql_client.clone(),
6825        }
6826    }
6827    /// Declare a desired Cloud output to be assigned in the environment
6828    ///
6829    /// # Arguments
6830    ///
6831    /// * `name` - The name of the binding
6832    /// * `description` - A description of the desired value of the binding
6833    pub fn with_cloud_output(
6834        &self,
6835        name: impl Into<String>,
6836        description: impl Into<String>,
6837    ) -> Env {
6838        let mut query = self.selection.select("withCloudOutput");
6839        query = query.arg("name", name.into());
6840        query = query.arg("description", description.into());
6841        Env {
6842            proc: self.proc.clone(),
6843            selection: query,
6844            graphql_client: self.graphql_client.clone(),
6845        }
6846    }
6847    /// Create or update a binding of type Container in the environment
6848    ///
6849    /// # Arguments
6850    ///
6851    /// * `name` - The name of the binding
6852    /// * `value` - The Container value to assign to the binding
6853    /// * `description` - The purpose of the input
6854    pub fn with_container_input(
6855        &self,
6856        name: impl Into<String>,
6857        value: impl IntoID<Id>,
6858        description: impl Into<String>,
6859    ) -> Env {
6860        let mut query = self.selection.select("withContainerInput");
6861        query = query.arg("name", name.into());
6862        query = query.arg_lazy(
6863            "value",
6864            Box::new(move || {
6865                let value = value.clone();
6866                Box::pin(async move { value.into_id().await.unwrap().quote() })
6867            }),
6868        );
6869        query = query.arg("description", description.into());
6870        Env {
6871            proc: self.proc.clone(),
6872            selection: query,
6873            graphql_client: self.graphql_client.clone(),
6874        }
6875    }
6876    /// Declare a desired Container output to be assigned in the environment
6877    ///
6878    /// # Arguments
6879    ///
6880    /// * `name` - The name of the binding
6881    /// * `description` - A description of the desired value of the binding
6882    pub fn with_container_output(
6883        &self,
6884        name: impl Into<String>,
6885        description: impl Into<String>,
6886    ) -> Env {
6887        let mut query = self.selection.select("withContainerOutput");
6888        query = query.arg("name", name.into());
6889        query = query.arg("description", description.into());
6890        Env {
6891            proc: self.proc.clone(),
6892            selection: query,
6893            graphql_client: self.graphql_client.clone(),
6894        }
6895    }
6896    /// Installs the current module into the environment, exposing its functions to the model
6897    /// Contextual path arguments will be populated using the environment's workspace.
6898    pub fn with_current_module(&self) -> Env {
6899        let query = self.selection.select("withCurrentModule");
6900        Env {
6901            proc: self.proc.clone(),
6902            selection: query,
6903            graphql_client: self.graphql_client.clone(),
6904        }
6905    }
6906    /// Create or update a binding of type DiffStat in the environment
6907    ///
6908    /// # Arguments
6909    ///
6910    /// * `name` - The name of the binding
6911    /// * `value` - The DiffStat value to assign to the binding
6912    /// * `description` - The purpose of the input
6913    pub fn with_diff_stat_input(
6914        &self,
6915        name: impl Into<String>,
6916        value: impl IntoID<Id>,
6917        description: impl Into<String>,
6918    ) -> Env {
6919        let mut query = self.selection.select("withDiffStatInput");
6920        query = query.arg("name", name.into());
6921        query = query.arg_lazy(
6922            "value",
6923            Box::new(move || {
6924                let value = value.clone();
6925                Box::pin(async move { value.into_id().await.unwrap().quote() })
6926            }),
6927        );
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    /// Declare a desired DiffStat output to be assigned in the environment
6936    ///
6937    /// # Arguments
6938    ///
6939    /// * `name` - The name of the binding
6940    /// * `description` - A description of the desired value of the binding
6941    pub fn with_diff_stat_output(
6942        &self,
6943        name: impl Into<String>,
6944        description: impl Into<String>,
6945    ) -> Env {
6946        let mut query = self.selection.select("withDiffStatOutput");
6947        query = query.arg("name", name.into());
6948        query = query.arg("description", description.into());
6949        Env {
6950            proc: self.proc.clone(),
6951            selection: query,
6952            graphql_client: self.graphql_client.clone(),
6953        }
6954    }
6955    /// Create or update a binding of type Directory in the environment
6956    ///
6957    /// # Arguments
6958    ///
6959    /// * `name` - The name of the binding
6960    /// * `value` - The Directory value to assign to the binding
6961    /// * `description` - The purpose of the input
6962    pub fn with_directory_input(
6963        &self,
6964        name: impl Into<String>,
6965        value: impl IntoID<Id>,
6966        description: impl Into<String>,
6967    ) -> Env {
6968        let mut query = self.selection.select("withDirectoryInput");
6969        query = query.arg("name", name.into());
6970        query = query.arg_lazy(
6971            "value",
6972            Box::new(move || {
6973                let value = value.clone();
6974                Box::pin(async move { value.into_id().await.unwrap().quote() })
6975            }),
6976        );
6977        query = query.arg("description", description.into());
6978        Env {
6979            proc: self.proc.clone(),
6980            selection: query,
6981            graphql_client: self.graphql_client.clone(),
6982        }
6983    }
6984    /// Declare a desired Directory output to be assigned in the environment
6985    ///
6986    /// # Arguments
6987    ///
6988    /// * `name` - The name of the binding
6989    /// * `description` - A description of the desired value of the binding
6990    pub fn with_directory_output(
6991        &self,
6992        name: impl Into<String>,
6993        description: impl Into<String>,
6994    ) -> Env {
6995        let mut query = self.selection.select("withDirectoryOutput");
6996        query = query.arg("name", name.into());
6997        query = query.arg("description", description.into());
6998        Env {
6999            proc: self.proc.clone(),
7000            selection: query,
7001            graphql_client: self.graphql_client.clone(),
7002        }
7003    }
7004    /// Create or update a binding of type EnvFile in the environment
7005    ///
7006    /// # Arguments
7007    ///
7008    /// * `name` - The name of the binding
7009    /// * `value` - The EnvFile value to assign to the binding
7010    /// * `description` - The purpose of the input
7011    pub fn with_env_file_input(
7012        &self,
7013        name: impl Into<String>,
7014        value: impl IntoID<Id>,
7015        description: impl Into<String>,
7016    ) -> Env {
7017        let mut query = self.selection.select("withEnvFileInput");
7018        query = query.arg("name", name.into());
7019        query = query.arg_lazy(
7020            "value",
7021            Box::new(move || {
7022                let value = value.clone();
7023                Box::pin(async move { value.into_id().await.unwrap().quote() })
7024            }),
7025        );
7026        query = query.arg("description", description.into());
7027        Env {
7028            proc: self.proc.clone(),
7029            selection: query,
7030            graphql_client: self.graphql_client.clone(),
7031        }
7032    }
7033    /// Declare a desired EnvFile output to be assigned in the environment
7034    ///
7035    /// # Arguments
7036    ///
7037    /// * `name` - The name of the binding
7038    /// * `description` - A description of the desired value of the binding
7039    pub fn with_env_file_output(
7040        &self,
7041        name: impl Into<String>,
7042        description: impl Into<String>,
7043    ) -> Env {
7044        let mut query = self.selection.select("withEnvFileOutput");
7045        query = query.arg("name", name.into());
7046        query = query.arg("description", description.into());
7047        Env {
7048            proc: self.proc.clone(),
7049            selection: query,
7050            graphql_client: self.graphql_client.clone(),
7051        }
7052    }
7053    /// Create or update a binding of type Env in the environment
7054    ///
7055    /// # Arguments
7056    ///
7057    /// * `name` - The name of the binding
7058    /// * `value` - The Env value to assign to the binding
7059    /// * `description` - The purpose of the input
7060    pub fn with_env_input(
7061        &self,
7062        name: impl Into<String>,
7063        value: impl IntoID<Id>,
7064        description: impl Into<String>,
7065    ) -> Env {
7066        let mut query = self.selection.select("withEnvInput");
7067        query = query.arg("name", name.into());
7068        query = query.arg_lazy(
7069            "value",
7070            Box::new(move || {
7071                let value = value.clone();
7072                Box::pin(async move { value.into_id().await.unwrap().quote() })
7073            }),
7074        );
7075        query = query.arg("description", description.into());
7076        Env {
7077            proc: self.proc.clone(),
7078            selection: query,
7079            graphql_client: self.graphql_client.clone(),
7080        }
7081    }
7082    /// Declare a desired Env output to be assigned in the environment
7083    ///
7084    /// # Arguments
7085    ///
7086    /// * `name` - The name of the binding
7087    /// * `description` - A description of the desired value of the binding
7088    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7089        let mut query = self.selection.select("withEnvOutput");
7090        query = query.arg("name", name.into());
7091        query = query.arg("description", description.into());
7092        Env {
7093            proc: self.proc.clone(),
7094            selection: query,
7095            graphql_client: self.graphql_client.clone(),
7096        }
7097    }
7098    /// Create or update a binding of type File in the environment
7099    ///
7100    /// # Arguments
7101    ///
7102    /// * `name` - The name of the binding
7103    /// * `value` - The File value to assign to the binding
7104    /// * `description` - The purpose of the input
7105    pub fn with_file_input(
7106        &self,
7107        name: impl Into<String>,
7108        value: impl IntoID<Id>,
7109        description: impl Into<String>,
7110    ) -> Env {
7111        let mut query = self.selection.select("withFileInput");
7112        query = query.arg("name", name.into());
7113        query = query.arg_lazy(
7114            "value",
7115            Box::new(move || {
7116                let value = value.clone();
7117                Box::pin(async move { value.into_id().await.unwrap().quote() })
7118            }),
7119        );
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    /// Declare a desired File output to be assigned in the environment
7128    ///
7129    /// # Arguments
7130    ///
7131    /// * `name` - The name of the binding
7132    /// * `description` - A description of the desired value of the binding
7133    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7134        let mut query = self.selection.select("withFileOutput");
7135        query = query.arg("name", name.into());
7136        query = query.arg("description", description.into());
7137        Env {
7138            proc: self.proc.clone(),
7139            selection: query,
7140            graphql_client: self.graphql_client.clone(),
7141        }
7142    }
7143    /// Create or update a binding of type GeneratorGroup in the environment
7144    ///
7145    /// # Arguments
7146    ///
7147    /// * `name` - The name of the binding
7148    /// * `value` - The GeneratorGroup value to assign to the binding
7149    /// * `description` - The purpose of the input
7150    pub fn with_generator_group_input(
7151        &self,
7152        name: impl Into<String>,
7153        value: impl IntoID<Id>,
7154        description: impl Into<String>,
7155    ) -> Env {
7156        let mut query = self.selection.select("withGeneratorGroupInput");
7157        query = query.arg("name", name.into());
7158        query = query.arg_lazy(
7159            "value",
7160            Box::new(move || {
7161                let value = value.clone();
7162                Box::pin(async move { value.into_id().await.unwrap().quote() })
7163            }),
7164        );
7165        query = query.arg("description", description.into());
7166        Env {
7167            proc: self.proc.clone(),
7168            selection: query,
7169            graphql_client: self.graphql_client.clone(),
7170        }
7171    }
7172    /// Declare a desired GeneratorGroup output to be assigned in the environment
7173    ///
7174    /// # Arguments
7175    ///
7176    /// * `name` - The name of the binding
7177    /// * `description` - A description of the desired value of the binding
7178    pub fn with_generator_group_output(
7179        &self,
7180        name: impl Into<String>,
7181        description: impl Into<String>,
7182    ) -> Env {
7183        let mut query = self.selection.select("withGeneratorGroupOutput");
7184        query = query.arg("name", name.into());
7185        query = query.arg("description", description.into());
7186        Env {
7187            proc: self.proc.clone(),
7188            selection: query,
7189            graphql_client: self.graphql_client.clone(),
7190        }
7191    }
7192    /// Create or update a binding of type Generator in the environment
7193    ///
7194    /// # Arguments
7195    ///
7196    /// * `name` - The name of the binding
7197    /// * `value` - The Generator value to assign to the binding
7198    /// * `description` - The purpose of the input
7199    pub fn with_generator_input(
7200        &self,
7201        name: impl Into<String>,
7202        value: impl IntoID<Id>,
7203        description: impl Into<String>,
7204    ) -> Env {
7205        let mut query = self.selection.select("withGeneratorInput");
7206        query = query.arg("name", name.into());
7207        query = query.arg_lazy(
7208            "value",
7209            Box::new(move || {
7210                let value = value.clone();
7211                Box::pin(async move { value.into_id().await.unwrap().quote() })
7212            }),
7213        );
7214        query = query.arg("description", description.into());
7215        Env {
7216            proc: self.proc.clone(),
7217            selection: query,
7218            graphql_client: self.graphql_client.clone(),
7219        }
7220    }
7221    /// Declare a desired Generator output to be assigned in the environment
7222    ///
7223    /// # Arguments
7224    ///
7225    /// * `name` - The name of the binding
7226    /// * `description` - A description of the desired value of the binding
7227    pub fn with_generator_output(
7228        &self,
7229        name: impl Into<String>,
7230        description: impl Into<String>,
7231    ) -> Env {
7232        let mut query = self.selection.select("withGeneratorOutput");
7233        query = query.arg("name", name.into());
7234        query = query.arg("description", description.into());
7235        Env {
7236            proc: self.proc.clone(),
7237            selection: query,
7238            graphql_client: self.graphql_client.clone(),
7239        }
7240    }
7241    /// Create or update a binding of type GitRef in the environment
7242    ///
7243    /// # Arguments
7244    ///
7245    /// * `name` - The name of the binding
7246    /// * `value` - The GitRef value to assign to the binding
7247    /// * `description` - The purpose of the input
7248    pub fn with_git_ref_input(
7249        &self,
7250        name: impl Into<String>,
7251        value: impl IntoID<Id>,
7252        description: impl Into<String>,
7253    ) -> Env {
7254        let mut query = self.selection.select("withGitRefInput");
7255        query = query.arg("name", name.into());
7256        query = query.arg_lazy(
7257            "value",
7258            Box::new(move || {
7259                let value = value.clone();
7260                Box::pin(async move { value.into_id().await.unwrap().quote() })
7261            }),
7262        );
7263        query = query.arg("description", description.into());
7264        Env {
7265            proc: self.proc.clone(),
7266            selection: query,
7267            graphql_client: self.graphql_client.clone(),
7268        }
7269    }
7270    /// Declare a desired GitRef output to be assigned in the environment
7271    ///
7272    /// # Arguments
7273    ///
7274    /// * `name` - The name of the binding
7275    /// * `description` - A description of the desired value of the binding
7276    pub fn with_git_ref_output(
7277        &self,
7278        name: impl Into<String>,
7279        description: impl Into<String>,
7280    ) -> Env {
7281        let mut query = self.selection.select("withGitRefOutput");
7282        query = query.arg("name", name.into());
7283        query = query.arg("description", description.into());
7284        Env {
7285            proc: self.proc.clone(),
7286            selection: query,
7287            graphql_client: self.graphql_client.clone(),
7288        }
7289    }
7290    /// Create or update a binding of type GitRepository in the environment
7291    ///
7292    /// # Arguments
7293    ///
7294    /// * `name` - The name of the binding
7295    /// * `value` - The GitRepository value to assign to the binding
7296    /// * `description` - The purpose of the input
7297    pub fn with_git_repository_input(
7298        &self,
7299        name: impl Into<String>,
7300        value: impl IntoID<Id>,
7301        description: impl Into<String>,
7302    ) -> Env {
7303        let mut query = self.selection.select("withGitRepositoryInput");
7304        query = query.arg("name", name.into());
7305        query = query.arg_lazy(
7306            "value",
7307            Box::new(move || {
7308                let value = value.clone();
7309                Box::pin(async move { value.into_id().await.unwrap().quote() })
7310            }),
7311        );
7312        query = query.arg("description", description.into());
7313        Env {
7314            proc: self.proc.clone(),
7315            selection: query,
7316            graphql_client: self.graphql_client.clone(),
7317        }
7318    }
7319    /// Declare a desired GitRepository output to be assigned in the environment
7320    ///
7321    /// # Arguments
7322    ///
7323    /// * `name` - The name of the binding
7324    /// * `description` - A description of the desired value of the binding
7325    pub fn with_git_repository_output(
7326        &self,
7327        name: impl Into<String>,
7328        description: impl Into<String>,
7329    ) -> Env {
7330        let mut query = self.selection.select("withGitRepositoryOutput");
7331        query = query.arg("name", name.into());
7332        query = query.arg("description", description.into());
7333        Env {
7334            proc: self.proc.clone(),
7335            selection: query,
7336            graphql_client: self.graphql_client.clone(),
7337        }
7338    }
7339    /// Create or update a binding of type HTTPState in the environment
7340    ///
7341    /// # Arguments
7342    ///
7343    /// * `name` - The name of the binding
7344    /// * `value` - The HTTPState value to assign to the binding
7345    /// * `description` - The purpose of the input
7346    pub fn with_http_state_input(
7347        &self,
7348        name: impl Into<String>,
7349        value: impl IntoID<Id>,
7350        description: impl Into<String>,
7351    ) -> Env {
7352        let mut query = self.selection.select("withHTTPStateInput");
7353        query = query.arg("name", name.into());
7354        query = query.arg_lazy(
7355            "value",
7356            Box::new(move || {
7357                let value = value.clone();
7358                Box::pin(async move { value.into_id().await.unwrap().quote() })
7359            }),
7360        );
7361        query = query.arg("description", description.into());
7362        Env {
7363            proc: self.proc.clone(),
7364            selection: query,
7365            graphql_client: self.graphql_client.clone(),
7366        }
7367    }
7368    /// Declare a desired HTTPState output to be assigned in the environment
7369    ///
7370    /// # Arguments
7371    ///
7372    /// * `name` - The name of the binding
7373    /// * `description` - A description of the desired value of the binding
7374    pub fn with_http_state_output(
7375        &self,
7376        name: impl Into<String>,
7377        description: impl Into<String>,
7378    ) -> Env {
7379        let mut query = self.selection.select("withHTTPStateOutput");
7380        query = query.arg("name", name.into());
7381        query = query.arg("description", description.into());
7382        Env {
7383            proc: self.proc.clone(),
7384            selection: query,
7385            graphql_client: self.graphql_client.clone(),
7386        }
7387    }
7388    /// Create or update a binding of type JSONValue in the environment
7389    ///
7390    /// # Arguments
7391    ///
7392    /// * `name` - The name of the binding
7393    /// * `value` - The JSONValue value to assign to the binding
7394    /// * `description` - The purpose of the input
7395    pub fn with_json_value_input(
7396        &self,
7397        name: impl Into<String>,
7398        value: impl IntoID<Id>,
7399        description: impl Into<String>,
7400    ) -> Env {
7401        let mut query = self.selection.select("withJSONValueInput");
7402        query = query.arg("name", name.into());
7403        query = query.arg_lazy(
7404            "value",
7405            Box::new(move || {
7406                let value = value.clone();
7407                Box::pin(async move { value.into_id().await.unwrap().quote() })
7408            }),
7409        );
7410        query = query.arg("description", description.into());
7411        Env {
7412            proc: self.proc.clone(),
7413            selection: query,
7414            graphql_client: self.graphql_client.clone(),
7415        }
7416    }
7417    /// Declare a desired JSONValue output to be assigned in the environment
7418    ///
7419    /// # Arguments
7420    ///
7421    /// * `name` - The name of the binding
7422    /// * `description` - A description of the desired value of the binding
7423    pub fn with_json_value_output(
7424        &self,
7425        name: impl Into<String>,
7426        description: impl Into<String>,
7427    ) -> Env {
7428        let mut query = self.selection.select("withJSONValueOutput");
7429        query = query.arg("name", name.into());
7430        query = query.arg("description", description.into());
7431        Env {
7432            proc: self.proc.clone(),
7433            selection: query,
7434            graphql_client: self.graphql_client.clone(),
7435        }
7436    }
7437    /// Sets the main module for this environment (the project being worked on)
7438    /// Contextual path arguments will be populated using the environment's workspace.
7439    pub fn with_main_module(&self, module: impl IntoID<Id>) -> Env {
7440        let mut query = self.selection.select("withMainModule");
7441        query = query.arg_lazy(
7442            "module",
7443            Box::new(move || {
7444                let module = module.clone();
7445                Box::pin(async move { module.into_id().await.unwrap().quote() })
7446            }),
7447        );
7448        Env {
7449            proc: self.proc.clone(),
7450            selection: query,
7451            graphql_client: self.graphql_client.clone(),
7452        }
7453    }
7454    /// Installs a module into the environment, exposing its functions to the model
7455    /// Contextual path arguments will be populated using the environment's workspace.
7456    pub fn with_module(&self, module: impl IntoID<Id>) -> Env {
7457        let mut query = self.selection.select("withModule");
7458        query = query.arg_lazy(
7459            "module",
7460            Box::new(move || {
7461                let module = module.clone();
7462                Box::pin(async move { module.into_id().await.unwrap().quote() })
7463            }),
7464        );
7465        Env {
7466            proc: self.proc.clone(),
7467            selection: query,
7468            graphql_client: self.graphql_client.clone(),
7469        }
7470    }
7471    /// Create or update a binding of type ModuleConfigClient in the environment
7472    ///
7473    /// # Arguments
7474    ///
7475    /// * `name` - The name of the binding
7476    /// * `value` - The ModuleConfigClient value to assign to the binding
7477    /// * `description` - The purpose of the input
7478    pub fn with_module_config_client_input(
7479        &self,
7480        name: impl Into<String>,
7481        value: impl IntoID<Id>,
7482        description: impl Into<String>,
7483    ) -> Env {
7484        let mut query = self.selection.select("withModuleConfigClientInput");
7485        query = query.arg("name", name.into());
7486        query = query.arg_lazy(
7487            "value",
7488            Box::new(move || {
7489                let value = value.clone();
7490                Box::pin(async move { value.into_id().await.unwrap().quote() })
7491            }),
7492        );
7493        query = query.arg("description", description.into());
7494        Env {
7495            proc: self.proc.clone(),
7496            selection: query,
7497            graphql_client: self.graphql_client.clone(),
7498        }
7499    }
7500    /// Declare a desired ModuleConfigClient output to be assigned in the environment
7501    ///
7502    /// # Arguments
7503    ///
7504    /// * `name` - The name of the binding
7505    /// * `description` - A description of the desired value of the binding
7506    pub fn with_module_config_client_output(
7507        &self,
7508        name: impl Into<String>,
7509        description: impl Into<String>,
7510    ) -> Env {
7511        let mut query = self.selection.select("withModuleConfigClientOutput");
7512        query = query.arg("name", name.into());
7513        query = query.arg("description", description.into());
7514        Env {
7515            proc: self.proc.clone(),
7516            selection: query,
7517            graphql_client: self.graphql_client.clone(),
7518        }
7519    }
7520    /// Create or update a binding of type Module in the environment
7521    ///
7522    /// # Arguments
7523    ///
7524    /// * `name` - The name of the binding
7525    /// * `value` - The Module value to assign to the binding
7526    /// * `description` - The purpose of the input
7527    pub fn with_module_input(
7528        &self,
7529        name: impl Into<String>,
7530        value: impl IntoID<Id>,
7531        description: impl Into<String>,
7532    ) -> Env {
7533        let mut query = self.selection.select("withModuleInput");
7534        query = query.arg("name", name.into());
7535        query = query.arg_lazy(
7536            "value",
7537            Box::new(move || {
7538                let value = value.clone();
7539                Box::pin(async move { value.into_id().await.unwrap().quote() })
7540            }),
7541        );
7542        query = query.arg("description", description.into());
7543        Env {
7544            proc: self.proc.clone(),
7545            selection: query,
7546            graphql_client: self.graphql_client.clone(),
7547        }
7548    }
7549    /// Declare a desired Module output to be assigned in the environment
7550    ///
7551    /// # Arguments
7552    ///
7553    /// * `name` - The name of the binding
7554    /// * `description` - A description of the desired value of the binding
7555    pub fn with_module_output(
7556        &self,
7557        name: impl Into<String>,
7558        description: impl Into<String>,
7559    ) -> Env {
7560        let mut query = self.selection.select("withModuleOutput");
7561        query = query.arg("name", name.into());
7562        query = query.arg("description", description.into());
7563        Env {
7564            proc: self.proc.clone(),
7565            selection: query,
7566            graphql_client: self.graphql_client.clone(),
7567        }
7568    }
7569    /// Create or update a binding of type ModuleSource in the environment
7570    ///
7571    /// # Arguments
7572    ///
7573    /// * `name` - The name of the binding
7574    /// * `value` - The ModuleSource value to assign to the binding
7575    /// * `description` - The purpose of the input
7576    pub fn with_module_source_input(
7577        &self,
7578        name: impl Into<String>,
7579        value: impl IntoID<Id>,
7580        description: impl Into<String>,
7581    ) -> Env {
7582        let mut query = self.selection.select("withModuleSourceInput");
7583        query = query.arg("name", name.into());
7584        query = query.arg_lazy(
7585            "value",
7586            Box::new(move || {
7587                let value = value.clone();
7588                Box::pin(async move { value.into_id().await.unwrap().quote() })
7589            }),
7590        );
7591        query = query.arg("description", description.into());
7592        Env {
7593            proc: self.proc.clone(),
7594            selection: query,
7595            graphql_client: self.graphql_client.clone(),
7596        }
7597    }
7598    /// Declare a desired ModuleSource output to be assigned in the environment
7599    ///
7600    /// # Arguments
7601    ///
7602    /// * `name` - The name of the binding
7603    /// * `description` - A description of the desired value of the binding
7604    pub fn with_module_source_output(
7605        &self,
7606        name: impl Into<String>,
7607        description: impl Into<String>,
7608    ) -> Env {
7609        let mut query = self.selection.select("withModuleSourceOutput");
7610        query = query.arg("name", name.into());
7611        query = query.arg("description", description.into());
7612        Env {
7613            proc: self.proc.clone(),
7614            selection: query,
7615            graphql_client: self.graphql_client.clone(),
7616        }
7617    }
7618    /// Create or update a binding of type SearchResult in the environment
7619    ///
7620    /// # Arguments
7621    ///
7622    /// * `name` - The name of the binding
7623    /// * `value` - The SearchResult value to assign to the binding
7624    /// * `description` - The purpose of the input
7625    pub fn with_search_result_input(
7626        &self,
7627        name: impl Into<String>,
7628        value: impl IntoID<Id>,
7629        description: impl Into<String>,
7630    ) -> Env {
7631        let mut query = self.selection.select("withSearchResultInput");
7632        query = query.arg("name", name.into());
7633        query = query.arg_lazy(
7634            "value",
7635            Box::new(move || {
7636                let value = value.clone();
7637                Box::pin(async move { value.into_id().await.unwrap().quote() })
7638            }),
7639        );
7640        query = query.arg("description", description.into());
7641        Env {
7642            proc: self.proc.clone(),
7643            selection: query,
7644            graphql_client: self.graphql_client.clone(),
7645        }
7646    }
7647    /// Declare a desired SearchResult output to be assigned in the environment
7648    ///
7649    /// # Arguments
7650    ///
7651    /// * `name` - The name of the binding
7652    /// * `description` - A description of the desired value of the binding
7653    pub fn with_search_result_output(
7654        &self,
7655        name: impl Into<String>,
7656        description: impl Into<String>,
7657    ) -> Env {
7658        let mut query = self.selection.select("withSearchResultOutput");
7659        query = query.arg("name", name.into());
7660        query = query.arg("description", description.into());
7661        Env {
7662            proc: self.proc.clone(),
7663            selection: query,
7664            graphql_client: self.graphql_client.clone(),
7665        }
7666    }
7667    /// Create or update a binding of type SearchSubmatch in the environment
7668    ///
7669    /// # Arguments
7670    ///
7671    /// * `name` - The name of the binding
7672    /// * `value` - The SearchSubmatch value to assign to the binding
7673    /// * `description` - The purpose of the input
7674    pub fn with_search_submatch_input(
7675        &self,
7676        name: impl Into<String>,
7677        value: impl IntoID<Id>,
7678        description: impl Into<String>,
7679    ) -> Env {
7680        let mut query = self.selection.select("withSearchSubmatchInput");
7681        query = query.arg("name", name.into());
7682        query = query.arg_lazy(
7683            "value",
7684            Box::new(move || {
7685                let value = value.clone();
7686                Box::pin(async move { value.into_id().await.unwrap().quote() })
7687            }),
7688        );
7689        query = query.arg("description", description.into());
7690        Env {
7691            proc: self.proc.clone(),
7692            selection: query,
7693            graphql_client: self.graphql_client.clone(),
7694        }
7695    }
7696    /// Declare a desired SearchSubmatch output to be assigned in the environment
7697    ///
7698    /// # Arguments
7699    ///
7700    /// * `name` - The name of the binding
7701    /// * `description` - A description of the desired value of the binding
7702    pub fn with_search_submatch_output(
7703        &self,
7704        name: impl Into<String>,
7705        description: impl Into<String>,
7706    ) -> Env {
7707        let mut query = self.selection.select("withSearchSubmatchOutput");
7708        query = query.arg("name", name.into());
7709        query = query.arg("description", description.into());
7710        Env {
7711            proc: self.proc.clone(),
7712            selection: query,
7713            graphql_client: self.graphql_client.clone(),
7714        }
7715    }
7716    /// Create or update a binding of type Secret in the environment
7717    ///
7718    /// # Arguments
7719    ///
7720    /// * `name` - The name of the binding
7721    /// * `value` - The Secret value to assign to the binding
7722    /// * `description` - The purpose of the input
7723    pub fn with_secret_input(
7724        &self,
7725        name: impl Into<String>,
7726        value: impl IntoID<Id>,
7727        description: impl Into<String>,
7728    ) -> Env {
7729        let mut query = self.selection.select("withSecretInput");
7730        query = query.arg("name", name.into());
7731        query = query.arg_lazy(
7732            "value",
7733            Box::new(move || {
7734                let value = value.clone();
7735                Box::pin(async move { value.into_id().await.unwrap().quote() })
7736            }),
7737        );
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    /// Declare a desired Secret output to be assigned in the environment
7746    ///
7747    /// # Arguments
7748    ///
7749    /// * `name` - The name of the binding
7750    /// * `description` - A description of the desired value of the binding
7751    pub fn with_secret_output(
7752        &self,
7753        name: impl Into<String>,
7754        description: impl Into<String>,
7755    ) -> Env {
7756        let mut query = self.selection.select("withSecretOutput");
7757        query = query.arg("name", name.into());
7758        query = query.arg("description", description.into());
7759        Env {
7760            proc: self.proc.clone(),
7761            selection: query,
7762            graphql_client: self.graphql_client.clone(),
7763        }
7764    }
7765    /// Create or update a binding of type Service in the environment
7766    ///
7767    /// # Arguments
7768    ///
7769    /// * `name` - The name of the binding
7770    /// * `value` - The Service value to assign to the binding
7771    /// * `description` - The purpose of the input
7772    pub fn with_service_input(
7773        &self,
7774        name: impl Into<String>,
7775        value: impl IntoID<Id>,
7776        description: impl Into<String>,
7777    ) -> Env {
7778        let mut query = self.selection.select("withServiceInput");
7779        query = query.arg("name", name.into());
7780        query = query.arg_lazy(
7781            "value",
7782            Box::new(move || {
7783                let value = value.clone();
7784                Box::pin(async move { value.into_id().await.unwrap().quote() })
7785            }),
7786        );
7787        query = query.arg("description", description.into());
7788        Env {
7789            proc: self.proc.clone(),
7790            selection: query,
7791            graphql_client: self.graphql_client.clone(),
7792        }
7793    }
7794    /// Declare a desired Service output to be assigned in the environment
7795    ///
7796    /// # Arguments
7797    ///
7798    /// * `name` - The name of the binding
7799    /// * `description` - A description of the desired value of the binding
7800    pub fn with_service_output(
7801        &self,
7802        name: impl Into<String>,
7803        description: impl Into<String>,
7804    ) -> Env {
7805        let mut query = self.selection.select("withServiceOutput");
7806        query = query.arg("name", name.into());
7807        query = query.arg("description", description.into());
7808        Env {
7809            proc: self.proc.clone(),
7810            selection: query,
7811            graphql_client: self.graphql_client.clone(),
7812        }
7813    }
7814    /// Create or update a binding of type Socket in the environment
7815    ///
7816    /// # Arguments
7817    ///
7818    /// * `name` - The name of the binding
7819    /// * `value` - The Socket value to assign to the binding
7820    /// * `description` - The purpose of the input
7821    pub fn with_socket_input(
7822        &self,
7823        name: impl Into<String>,
7824        value: impl IntoID<Id>,
7825        description: impl Into<String>,
7826    ) -> Env {
7827        let mut query = self.selection.select("withSocketInput");
7828        query = query.arg("name", name.into());
7829        query = query.arg_lazy(
7830            "value",
7831            Box::new(move || {
7832                let value = value.clone();
7833                Box::pin(async move { value.into_id().await.unwrap().quote() })
7834            }),
7835        );
7836        query = query.arg("description", description.into());
7837        Env {
7838            proc: self.proc.clone(),
7839            selection: query,
7840            graphql_client: self.graphql_client.clone(),
7841        }
7842    }
7843    /// Declare a desired Socket output to be assigned in the environment
7844    ///
7845    /// # Arguments
7846    ///
7847    /// * `name` - The name of the binding
7848    /// * `description` - A description of the desired value of the binding
7849    pub fn with_socket_output(
7850        &self,
7851        name: impl Into<String>,
7852        description: impl Into<String>,
7853    ) -> Env {
7854        let mut query = self.selection.select("withSocketOutput");
7855        query = query.arg("name", name.into());
7856        query = query.arg("description", description.into());
7857        Env {
7858            proc: self.proc.clone(),
7859            selection: query,
7860            graphql_client: self.graphql_client.clone(),
7861        }
7862    }
7863    /// Create or update a binding of type Stat in the environment
7864    ///
7865    /// # Arguments
7866    ///
7867    /// * `name` - The name of the binding
7868    /// * `value` - The Stat value to assign to the binding
7869    /// * `description` - The purpose of the input
7870    pub fn with_stat_input(
7871        &self,
7872        name: impl Into<String>,
7873        value: impl IntoID<Id>,
7874        description: impl Into<String>,
7875    ) -> Env {
7876        let mut query = self.selection.select("withStatInput");
7877        query = query.arg("name", name.into());
7878        query = query.arg_lazy(
7879            "value",
7880            Box::new(move || {
7881                let value = value.clone();
7882                Box::pin(async move { value.into_id().await.unwrap().quote() })
7883            }),
7884        );
7885        query = query.arg("description", description.into());
7886        Env {
7887            proc: self.proc.clone(),
7888            selection: query,
7889            graphql_client: self.graphql_client.clone(),
7890        }
7891    }
7892    /// Declare a desired Stat output to be assigned in the environment
7893    ///
7894    /// # Arguments
7895    ///
7896    /// * `name` - The name of the binding
7897    /// * `description` - A description of the desired value of the binding
7898    pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7899        let mut query = self.selection.select("withStatOutput");
7900        query = query.arg("name", name.into());
7901        query = query.arg("description", description.into());
7902        Env {
7903            proc: self.proc.clone(),
7904            selection: query,
7905            graphql_client: self.graphql_client.clone(),
7906        }
7907    }
7908    /// Provides a string input binding to the environment
7909    ///
7910    /// # Arguments
7911    ///
7912    /// * `name` - The name of the binding
7913    /// * `value` - The string value to assign to the binding
7914    /// * `description` - The description of the input
7915    pub fn with_string_input(
7916        &self,
7917        name: impl Into<String>,
7918        value: impl Into<String>,
7919        description: impl Into<String>,
7920    ) -> Env {
7921        let mut query = self.selection.select("withStringInput");
7922        query = query.arg("name", name.into());
7923        query = query.arg("value", value.into());
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    /// Declares a desired string output binding
7932    ///
7933    /// # Arguments
7934    ///
7935    /// * `name` - The name of the binding
7936    /// * `description` - The description of the output
7937    pub fn with_string_output(
7938        &self,
7939        name: impl Into<String>,
7940        description: impl Into<String>,
7941    ) -> Env {
7942        let mut query = self.selection.select("withStringOutput");
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    /// Create or update a binding of type UpGroup in the environment
7952    ///
7953    /// # Arguments
7954    ///
7955    /// * `name` - The name of the binding
7956    /// * `value` - The UpGroup value to assign to the binding
7957    /// * `description` - The purpose of the input
7958    pub fn with_up_group_input(
7959        &self,
7960        name: impl Into<String>,
7961        value: impl IntoID<Id>,
7962        description: impl Into<String>,
7963    ) -> Env {
7964        let mut query = self.selection.select("withUpGroupInput");
7965        query = query.arg("name", name.into());
7966        query = query.arg_lazy(
7967            "value",
7968            Box::new(move || {
7969                let value = value.clone();
7970                Box::pin(async move { value.into_id().await.unwrap().quote() })
7971            }),
7972        );
7973        query = query.arg("description", description.into());
7974        Env {
7975            proc: self.proc.clone(),
7976            selection: query,
7977            graphql_client: self.graphql_client.clone(),
7978        }
7979    }
7980    /// Declare a desired UpGroup output to be assigned in the environment
7981    ///
7982    /// # Arguments
7983    ///
7984    /// * `name` - The name of the binding
7985    /// * `description` - A description of the desired value of the binding
7986    pub fn with_up_group_output(
7987        &self,
7988        name: impl Into<String>,
7989        description: impl Into<String>,
7990    ) -> Env {
7991        let mut query = self.selection.select("withUpGroupOutput");
7992        query = query.arg("name", name.into());
7993        query = query.arg("description", description.into());
7994        Env {
7995            proc: self.proc.clone(),
7996            selection: query,
7997            graphql_client: self.graphql_client.clone(),
7998        }
7999    }
8000    /// Create or update a binding of type Up in the environment
8001    ///
8002    /// # Arguments
8003    ///
8004    /// * `name` - The name of the binding
8005    /// * `value` - The Up value to assign to the binding
8006    /// * `description` - The purpose of the input
8007    pub fn with_up_input(
8008        &self,
8009        name: impl Into<String>,
8010        value: impl IntoID<Id>,
8011        description: impl Into<String>,
8012    ) -> Env {
8013        let mut query = self.selection.select("withUpInput");
8014        query = query.arg("name", name.into());
8015        query = query.arg_lazy(
8016            "value",
8017            Box::new(move || {
8018                let value = value.clone();
8019                Box::pin(async move { value.into_id().await.unwrap().quote() })
8020            }),
8021        );
8022        query = query.arg("description", description.into());
8023        Env {
8024            proc: self.proc.clone(),
8025            selection: query,
8026            graphql_client: self.graphql_client.clone(),
8027        }
8028    }
8029    /// Declare a desired Up output to be assigned in the environment
8030    ///
8031    /// # Arguments
8032    ///
8033    /// * `name` - The name of the binding
8034    /// * `description` - A description of the desired value of the binding
8035    pub fn with_up_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
8036        let mut query = self.selection.select("withUpOutput");
8037        query = query.arg("name", name.into());
8038        query = query.arg("description", description.into());
8039        Env {
8040            proc: self.proc.clone(),
8041            selection: query,
8042            graphql_client: self.graphql_client.clone(),
8043        }
8044    }
8045    /// Create or update a binding of type Volume in the environment
8046    ///
8047    /// # Arguments
8048    ///
8049    /// * `name` - The name of the binding
8050    /// * `value` - The Volume value to assign to the binding
8051    /// * `description` - The purpose of the input
8052    pub fn with_volume_input(
8053        &self,
8054        name: impl Into<String>,
8055        value: impl IntoID<Id>,
8056        description: impl Into<String>,
8057    ) -> Env {
8058        let mut query = self.selection.select("withVolumeInput");
8059        query = query.arg("name", name.into());
8060        query = query.arg_lazy(
8061            "value",
8062            Box::new(move || {
8063                let value = value.clone();
8064                Box::pin(async move { value.into_id().await.unwrap().quote() })
8065            }),
8066        );
8067        query = query.arg("description", description.into());
8068        Env {
8069            proc: self.proc.clone(),
8070            selection: query,
8071            graphql_client: self.graphql_client.clone(),
8072        }
8073    }
8074    /// Declare a desired Volume output to be assigned in the environment
8075    ///
8076    /// # Arguments
8077    ///
8078    /// * `name` - The name of the binding
8079    /// * `description` - A description of the desired value of the binding
8080    pub fn with_volume_output(
8081        &self,
8082        name: impl Into<String>,
8083        description: impl Into<String>,
8084    ) -> Env {
8085        let mut query = self.selection.select("withVolumeOutput");
8086        query = query.arg("name", name.into());
8087        query = query.arg("description", description.into());
8088        Env {
8089            proc: self.proc.clone(),
8090            selection: query,
8091            graphql_client: self.graphql_client.clone(),
8092        }
8093    }
8094    /// Returns a new environment with the provided workspace
8095    ///
8096    /// # Arguments
8097    ///
8098    /// * `workspace` - The directory to set as the host filesystem
8099    pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Env {
8100        let mut query = self.selection.select("withWorkspace");
8101        query = query.arg_lazy(
8102            "workspace",
8103            Box::new(move || {
8104                let workspace = workspace.clone();
8105                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
8106            }),
8107        );
8108        Env {
8109            proc: self.proc.clone(),
8110            selection: query,
8111            graphql_client: self.graphql_client.clone(),
8112        }
8113    }
8114    /// Create or update a binding of type Workspace in the environment
8115    ///
8116    /// # Arguments
8117    ///
8118    /// * `name` - The name of the binding
8119    /// * `value` - The Workspace value to assign to the binding
8120    /// * `description` - The purpose of the input
8121    pub fn with_workspace_input(
8122        &self,
8123        name: impl Into<String>,
8124        value: impl IntoID<Id>,
8125        description: impl Into<String>,
8126    ) -> Env {
8127        let mut query = self.selection.select("withWorkspaceInput");
8128        query = query.arg("name", name.into());
8129        query = query.arg_lazy(
8130            "value",
8131            Box::new(move || {
8132                let value = value.clone();
8133                Box::pin(async move { value.into_id().await.unwrap().quote() })
8134            }),
8135        );
8136        query = query.arg("description", description.into());
8137        Env {
8138            proc: self.proc.clone(),
8139            selection: query,
8140            graphql_client: self.graphql_client.clone(),
8141        }
8142    }
8143    /// Declare a desired Workspace output to be assigned in the environment
8144    ///
8145    /// # Arguments
8146    ///
8147    /// * `name` - The name of the binding
8148    /// * `description` - A description of the desired value of the binding
8149    pub fn with_workspace_output(
8150        &self,
8151        name: impl Into<String>,
8152        description: impl Into<String>,
8153    ) -> Env {
8154        let mut query = self.selection.select("withWorkspaceOutput");
8155        query = query.arg("name", name.into());
8156        query = query.arg("description", description.into());
8157        Env {
8158            proc: self.proc.clone(),
8159            selection: query,
8160            graphql_client: self.graphql_client.clone(),
8161        }
8162    }
8163    /// Returns a new environment without any outputs
8164    pub fn without_outputs(&self) -> Env {
8165        let query = self.selection.select("withoutOutputs");
8166        Env {
8167            proc: self.proc.clone(),
8168            selection: query,
8169            graphql_client: self.graphql_client.clone(),
8170        }
8171    }
8172    pub fn workspace(&self) -> Directory {
8173        let query = self.selection.select("workspace");
8174        Directory {
8175            proc: self.proc.clone(),
8176            selection: query,
8177            graphql_client: self.graphql_client.clone(),
8178        }
8179    }
8180}
8181impl Node for Env {
8182    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8183        let query = self.selection.select("id");
8184        let graphql_client = self.graphql_client.clone();
8185        async move { query.execute(graphql_client).await }
8186    }
8187}
8188#[derive(Clone)]
8189pub struct EnvFile {
8190    pub proc: Option<Arc<DaggerSessionProc>>,
8191    pub selection: Selection,
8192    pub graphql_client: DynGraphQLClient,
8193}
8194#[derive(Builder, Debug, PartialEq)]
8195pub struct EnvFileGetOpts {
8196    /// Return the value exactly as written to the file. No quote removal or variable expansion
8197    #[builder(setter(into, strip_option), default)]
8198    pub raw: Option<bool>,
8199}
8200#[derive(Builder, Debug, PartialEq)]
8201pub struct EnvFileVariablesOpts {
8202    /// Return values exactly as written to the file. No quote removal or variable expansion
8203    #[builder(setter(into, strip_option), default)]
8204    pub raw: Option<bool>,
8205}
8206impl IntoID<Id> for EnvFile {
8207    fn into_id(
8208        self,
8209    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8210        Box::pin(async move { self.id().await })
8211    }
8212}
8213impl Loadable for EnvFile {
8214    fn graphql_type() -> &'static str {
8215        "EnvFile"
8216    }
8217    fn from_query(
8218        proc: Option<Arc<DaggerSessionProc>>,
8219        selection: Selection,
8220        graphql_client: DynGraphQLClient,
8221    ) -> Self {
8222        Self {
8223            proc,
8224            selection,
8225            graphql_client,
8226        }
8227    }
8228}
8229impl EnvFile {
8230    /// Return as a file
8231    pub fn as_file(&self) -> File {
8232        let query = self.selection.select("asFile");
8233        File {
8234            proc: self.proc.clone(),
8235            selection: query,
8236            graphql_client: self.graphql_client.clone(),
8237        }
8238    }
8239    /// Check if a variable exists
8240    ///
8241    /// # Arguments
8242    ///
8243    /// * `name` - Variable name
8244    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8245        let mut query = self.selection.select("exists");
8246        query = query.arg("name", name.into());
8247        query.execute(self.graphql_client.clone()).await
8248    }
8249    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8250    ///
8251    /// # Arguments
8252    ///
8253    /// * `name` - Variable name
8254    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8255    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8256        let mut query = self.selection.select("get");
8257        query = query.arg("name", name.into());
8258        query.execute(self.graphql_client.clone()).await
8259    }
8260    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8261    ///
8262    /// # Arguments
8263    ///
8264    /// * `name` - Variable name
8265    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8266    pub async fn get_opts(
8267        &self,
8268        name: impl Into<String>,
8269        opts: EnvFileGetOpts,
8270    ) -> Result<String, DaggerError> {
8271        let mut query = self.selection.select("get");
8272        query = query.arg("name", name.into());
8273        if let Some(raw) = opts.raw {
8274            query = query.arg("raw", raw);
8275        }
8276        query.execute(self.graphql_client.clone()).await
8277    }
8278    /// A unique identifier for this EnvFile.
8279    pub async fn id(&self) -> Result<Id, DaggerError> {
8280        let query = self.selection.select("id");
8281        query.execute(self.graphql_client.clone()).await
8282    }
8283    /// 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
8284    ///
8285    /// # Arguments
8286    ///
8287    /// * `prefix` - The prefix to filter by
8288    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8289        let mut query = self.selection.select("namespace");
8290        query = query.arg("prefix", prefix.into());
8291        EnvFile {
8292            proc: self.proc.clone(),
8293            selection: query,
8294            graphql_client: self.graphql_client.clone(),
8295        }
8296    }
8297    /// Return all variables
8298    ///
8299    /// # Arguments
8300    ///
8301    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8302    pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
8303        let query = self.selection.select("variables");
8304        let query = query.select("id");
8305        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8306        Ok(ids
8307            .into_iter()
8308            .map(|id| EnvVariable {
8309                proc: self.proc.clone(),
8310                selection: crate::querybuilder::query()
8311                    .select("node")
8312                    .arg("id", &id.0)
8313                    .inline_fragment("EnvVariable"),
8314                graphql_client: self.graphql_client.clone(),
8315            })
8316            .collect())
8317    }
8318    /// Return all variables
8319    ///
8320    /// # Arguments
8321    ///
8322    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8323    pub async fn variables_opts(
8324        &self,
8325        opts: EnvFileVariablesOpts,
8326    ) -> Result<Vec<EnvVariable>, DaggerError> {
8327        let mut query = self.selection.select("variables");
8328        if let Some(raw) = opts.raw {
8329            query = query.arg("raw", raw);
8330        }
8331        let query = query.select("id");
8332        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8333        Ok(ids
8334            .into_iter()
8335            .map(|id| EnvVariable {
8336                proc: self.proc.clone(),
8337                selection: crate::querybuilder::query()
8338                    .select("node")
8339                    .arg("id", &id.0)
8340                    .inline_fragment("EnvVariable"),
8341                graphql_client: self.graphql_client.clone(),
8342            })
8343            .collect())
8344    }
8345    /// Add a variable
8346    ///
8347    /// # Arguments
8348    ///
8349    /// * `name` - Variable name
8350    /// * `value` - Variable value
8351    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8352        let mut query = self.selection.select("withVariable");
8353        query = query.arg("name", name.into());
8354        query = query.arg("value", value.into());
8355        EnvFile {
8356            proc: self.proc.clone(),
8357            selection: query,
8358            graphql_client: self.graphql_client.clone(),
8359        }
8360    }
8361    /// Remove all occurrences of the named variable
8362    ///
8363    /// # Arguments
8364    ///
8365    /// * `name` - Variable name
8366    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8367        let mut query = self.selection.select("withoutVariable");
8368        query = query.arg("name", name.into());
8369        EnvFile {
8370            proc: self.proc.clone(),
8371            selection: query,
8372            graphql_client: self.graphql_client.clone(),
8373        }
8374    }
8375}
8376impl Node for EnvFile {
8377    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8378        let query = self.selection.select("id");
8379        let graphql_client = self.graphql_client.clone();
8380        async move { query.execute(graphql_client).await }
8381    }
8382}
8383#[derive(Clone)]
8384pub struct EnvVariable {
8385    pub proc: Option<Arc<DaggerSessionProc>>,
8386    pub selection: Selection,
8387    pub graphql_client: DynGraphQLClient,
8388}
8389impl IntoID<Id> for EnvVariable {
8390    fn into_id(
8391        self,
8392    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8393        Box::pin(async move { self.id().await })
8394    }
8395}
8396impl Loadable for EnvVariable {
8397    fn graphql_type() -> &'static str {
8398        "EnvVariable"
8399    }
8400    fn from_query(
8401        proc: Option<Arc<DaggerSessionProc>>,
8402        selection: Selection,
8403        graphql_client: DynGraphQLClient,
8404    ) -> Self {
8405        Self {
8406            proc,
8407            selection,
8408            graphql_client,
8409        }
8410    }
8411}
8412impl EnvVariable {
8413    /// A unique identifier for this EnvVariable.
8414    pub async fn id(&self) -> Result<Id, DaggerError> {
8415        let query = self.selection.select("id");
8416        query.execute(self.graphql_client.clone()).await
8417    }
8418    /// The environment variable name.
8419    pub async fn name(&self) -> Result<String, DaggerError> {
8420        let query = self.selection.select("name");
8421        query.execute(self.graphql_client.clone()).await
8422    }
8423    /// The environment variable value.
8424    pub async fn value(&self) -> Result<String, DaggerError> {
8425        let query = self.selection.select("value");
8426        query.execute(self.graphql_client.clone()).await
8427    }
8428}
8429impl Node for EnvVariable {
8430    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8431        let query = self.selection.select("id");
8432        let graphql_client = self.graphql_client.clone();
8433        async move { query.execute(graphql_client).await }
8434    }
8435}
8436#[derive(Clone)]
8437pub struct Error {
8438    pub proc: Option<Arc<DaggerSessionProc>>,
8439    pub selection: Selection,
8440    pub graphql_client: DynGraphQLClient,
8441}
8442impl IntoID<Id> for Error {
8443    fn into_id(
8444        self,
8445    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8446        Box::pin(async move { self.id().await })
8447    }
8448}
8449impl Loadable for Error {
8450    fn graphql_type() -> &'static str {
8451        "Error"
8452    }
8453    fn from_query(
8454        proc: Option<Arc<DaggerSessionProc>>,
8455        selection: Selection,
8456        graphql_client: DynGraphQLClient,
8457    ) -> Self {
8458        Self {
8459            proc,
8460            selection,
8461            graphql_client,
8462        }
8463    }
8464}
8465impl Error {
8466    /// A unique identifier for this Error.
8467    pub async fn id(&self) -> Result<Id, DaggerError> {
8468        let query = self.selection.select("id");
8469        query.execute(self.graphql_client.clone()).await
8470    }
8471    /// A description of the error.
8472    pub async fn message(&self) -> Result<String, DaggerError> {
8473        let query = self.selection.select("message");
8474        query.execute(self.graphql_client.clone()).await
8475    }
8476    /// The extensions of the error.
8477    pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
8478        let query = self.selection.select("values");
8479        let query = query.select("id");
8480        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8481        Ok(ids
8482            .into_iter()
8483            .map(|id| ErrorValue {
8484                proc: self.proc.clone(),
8485                selection: crate::querybuilder::query()
8486                    .select("node")
8487                    .arg("id", &id.0)
8488                    .inline_fragment("ErrorValue"),
8489                graphql_client: self.graphql_client.clone(),
8490            })
8491            .collect())
8492    }
8493    /// Add a value to the error.
8494    ///
8495    /// # Arguments
8496    ///
8497    /// * `name` - The name of the value.
8498    /// * `value` - The value to store on the error.
8499    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8500        let mut query = self.selection.select("withValue");
8501        query = query.arg("name", name.into());
8502        query = query.arg("value", value);
8503        Error {
8504            proc: self.proc.clone(),
8505            selection: query,
8506            graphql_client: self.graphql_client.clone(),
8507        }
8508    }
8509}
8510impl Node for Error {
8511    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8512        let query = self.selection.select("id");
8513        let graphql_client = self.graphql_client.clone();
8514        async move { query.execute(graphql_client).await }
8515    }
8516}
8517#[derive(Clone)]
8518pub struct ErrorValue {
8519    pub proc: Option<Arc<DaggerSessionProc>>,
8520    pub selection: Selection,
8521    pub graphql_client: DynGraphQLClient,
8522}
8523impl IntoID<Id> for ErrorValue {
8524    fn into_id(
8525        self,
8526    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8527        Box::pin(async move { self.id().await })
8528    }
8529}
8530impl Loadable for ErrorValue {
8531    fn graphql_type() -> &'static str {
8532        "ErrorValue"
8533    }
8534    fn from_query(
8535        proc: Option<Arc<DaggerSessionProc>>,
8536        selection: Selection,
8537        graphql_client: DynGraphQLClient,
8538    ) -> Self {
8539        Self {
8540            proc,
8541            selection,
8542            graphql_client,
8543        }
8544    }
8545}
8546impl ErrorValue {
8547    /// A unique identifier for this ErrorValue.
8548    pub async fn id(&self) -> Result<Id, DaggerError> {
8549        let query = self.selection.select("id");
8550        query.execute(self.graphql_client.clone()).await
8551    }
8552    /// The name of the value.
8553    pub async fn name(&self) -> Result<String, DaggerError> {
8554        let query = self.selection.select("name");
8555        query.execute(self.graphql_client.clone()).await
8556    }
8557    /// The value.
8558    pub async fn value(&self) -> Result<Json, DaggerError> {
8559        let query = self.selection.select("value");
8560        query.execute(self.graphql_client.clone()).await
8561    }
8562}
8563impl Node for ErrorValue {
8564    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8565        let query = self.selection.select("id");
8566        let graphql_client = self.graphql_client.clone();
8567        async move { query.execute(graphql_client).await }
8568    }
8569}
8570#[derive(Clone)]
8571pub struct FieldTypeDef {
8572    pub proc: Option<Arc<DaggerSessionProc>>,
8573    pub selection: Selection,
8574    pub graphql_client: DynGraphQLClient,
8575}
8576impl IntoID<Id> for FieldTypeDef {
8577    fn into_id(
8578        self,
8579    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8580        Box::pin(async move { self.id().await })
8581    }
8582}
8583impl Loadable for FieldTypeDef {
8584    fn graphql_type() -> &'static str {
8585        "FieldTypeDef"
8586    }
8587    fn from_query(
8588        proc: Option<Arc<DaggerSessionProc>>,
8589        selection: Selection,
8590        graphql_client: DynGraphQLClient,
8591    ) -> Self {
8592        Self {
8593            proc,
8594            selection,
8595            graphql_client,
8596        }
8597    }
8598}
8599impl FieldTypeDef {
8600    /// The reason this enum member is deprecated, if any.
8601    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8602        let query = self.selection.select("deprecated");
8603        query.execute(self.graphql_client.clone()).await
8604    }
8605    /// A doc string for the field, if any.
8606    pub async fn description(&self) -> Result<String, DaggerError> {
8607        let query = self.selection.select("description");
8608        query.execute(self.graphql_client.clone()).await
8609    }
8610    /// A unique identifier for this FieldTypeDef.
8611    pub async fn id(&self) -> Result<Id, DaggerError> {
8612        let query = self.selection.select("id");
8613        query.execute(self.graphql_client.clone()).await
8614    }
8615    /// The name of the field in lowerCamelCase format.
8616    pub async fn name(&self) -> Result<String, DaggerError> {
8617        let query = self.selection.select("name");
8618        query.execute(self.graphql_client.clone()).await
8619    }
8620    /// The location of this field declaration.
8621    pub fn source_map(&self) -> SourceMap {
8622        let query = self.selection.select("sourceMap");
8623        SourceMap {
8624            proc: self.proc.clone(),
8625            selection: query,
8626            graphql_client: self.graphql_client.clone(),
8627        }
8628    }
8629    /// The type of the field.
8630    pub fn type_def(&self) -> TypeDef {
8631        let query = self.selection.select("typeDef");
8632        TypeDef {
8633            proc: self.proc.clone(),
8634            selection: query,
8635            graphql_client: self.graphql_client.clone(),
8636        }
8637    }
8638}
8639impl Node for FieldTypeDef {
8640    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8641        let query = self.selection.select("id");
8642        let graphql_client = self.graphql_client.clone();
8643        async move { query.execute(graphql_client).await }
8644    }
8645}
8646#[derive(Clone)]
8647pub struct File {
8648    pub proc: Option<Arc<DaggerSessionProc>>,
8649    pub selection: Selection,
8650    pub graphql_client: DynGraphQLClient,
8651}
8652#[derive(Builder, Debug, PartialEq)]
8653pub struct FileAsEnvFileOpts {
8654    /// Replace "${VAR}" or "$VAR" with the value of other vars
8655    #[builder(setter(into, strip_option), default)]
8656    pub expand: Option<bool>,
8657}
8658#[derive(Builder, Debug, PartialEq)]
8659pub struct FileContentsOpts {
8660    /// Maximum number of lines to read
8661    #[builder(setter(into, strip_option), default)]
8662    pub limit_lines: Option<isize>,
8663    /// Start reading after this line
8664    #[builder(setter(into, strip_option), default)]
8665    pub offset_lines: Option<isize>,
8666}
8667#[derive(Builder, Debug, PartialEq)]
8668pub struct FileDigestOpts {
8669    /// If true, exclude metadata from the digest.
8670    #[builder(setter(into, strip_option), default)]
8671    pub exclude_metadata: Option<bool>,
8672}
8673#[derive(Builder, Debug, PartialEq)]
8674pub struct FileExportOpts {
8675    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
8676    #[builder(setter(into, strip_option), default)]
8677    pub allow_parent_dir_path: Option<bool>,
8678}
8679#[derive(Builder, Debug, PartialEq)]
8680pub struct FileSearchOpts<'a> {
8681    /// Allow the . pattern to match newlines in multiline mode.
8682    #[builder(setter(into, strip_option), default)]
8683    pub dotall: Option<bool>,
8684    /// Only return matching files, not lines and content
8685    #[builder(setter(into, strip_option), default)]
8686    pub files_only: Option<bool>,
8687    #[builder(setter(into, strip_option), default)]
8688    pub globs: Option<Vec<&'a str>>,
8689    /// Enable case-insensitive matching.
8690    #[builder(setter(into, strip_option), default)]
8691    pub insensitive: Option<bool>,
8692    /// Limit the number of results to return
8693    #[builder(setter(into, strip_option), default)]
8694    pub limit: Option<isize>,
8695    /// Interpret the pattern as a literal string instead of a regular expression.
8696    #[builder(setter(into, strip_option), default)]
8697    pub literal: Option<bool>,
8698    /// Enable searching across multiple lines.
8699    #[builder(setter(into, strip_option), default)]
8700    pub multiline: Option<bool>,
8701    #[builder(setter(into, strip_option), default)]
8702    pub paths: Option<Vec<&'a str>>,
8703    /// Skip hidden files (files starting with .).
8704    #[builder(setter(into, strip_option), default)]
8705    pub skip_hidden: Option<bool>,
8706    /// Honor .gitignore, .ignore, and .rgignore files.
8707    #[builder(setter(into, strip_option), default)]
8708    pub skip_ignored: Option<bool>,
8709}
8710#[derive(Builder, Debug, PartialEq)]
8711pub struct FileWithReplacedOpts {
8712    /// Replace all occurrences of the pattern.
8713    #[builder(setter(into, strip_option), default)]
8714    pub all: Option<bool>,
8715    /// Replace the first match starting from the specified line.
8716    #[builder(setter(into, strip_option), default)]
8717    pub first_from: Option<isize>,
8718}
8719impl IntoID<Id> for File {
8720    fn into_id(
8721        self,
8722    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8723        Box::pin(async move { self.id().await })
8724    }
8725}
8726impl Loadable for File {
8727    fn graphql_type() -> &'static str {
8728        "File"
8729    }
8730    fn from_query(
8731        proc: Option<Arc<DaggerSessionProc>>,
8732        selection: Selection,
8733        graphql_client: DynGraphQLClient,
8734    ) -> Self {
8735        Self {
8736            proc,
8737            selection,
8738            graphql_client,
8739        }
8740    }
8741}
8742impl File {
8743    /// Parse as an env file
8744    ///
8745    /// # Arguments
8746    ///
8747    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8748    pub fn as_env_file(&self) -> EnvFile {
8749        let query = self.selection.select("asEnvFile");
8750        EnvFile {
8751            proc: self.proc.clone(),
8752            selection: query,
8753            graphql_client: self.graphql_client.clone(),
8754        }
8755    }
8756    /// Parse as an env file
8757    ///
8758    /// # Arguments
8759    ///
8760    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8761    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
8762        let mut query = self.selection.select("asEnvFile");
8763        if let Some(expand) = opts.expand {
8764            query = query.arg("expand", expand);
8765        }
8766        EnvFile {
8767            proc: self.proc.clone(),
8768            selection: query,
8769            graphql_client: self.graphql_client.clone(),
8770        }
8771    }
8772    /// Parse the file contents as JSON.
8773    pub fn as_json(&self) -> JsonValue {
8774        let query = self.selection.select("asJSON");
8775        JsonValue {
8776            proc: self.proc.clone(),
8777            selection: query,
8778            graphql_client: self.graphql_client.clone(),
8779        }
8780    }
8781    /// Change the owner of the file recursively.
8782    ///
8783    /// # Arguments
8784    ///
8785    /// * `owner` - A user:group to set for the file.
8786    ///
8787    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
8788    ///
8789    /// If the group is omitted, it defaults to the same as the user.
8790    pub fn chown(&self, owner: impl Into<String>) -> File {
8791        let mut query = self.selection.select("chown");
8792        query = query.arg("owner", owner.into());
8793        File {
8794            proc: self.proc.clone(),
8795            selection: query,
8796            graphql_client: self.graphql_client.clone(),
8797        }
8798    }
8799    /// Retrieves the contents of the file.
8800    ///
8801    /// # Arguments
8802    ///
8803    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8804    pub async fn contents(&self) -> Result<String, DaggerError> {
8805        let query = self.selection.select("contents");
8806        query.execute(self.graphql_client.clone()).await
8807    }
8808    /// Retrieves the contents of the file.
8809    ///
8810    /// # Arguments
8811    ///
8812    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8813    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
8814        let mut query = self.selection.select("contents");
8815        if let Some(offset_lines) = opts.offset_lines {
8816            query = query.arg("offsetLines", offset_lines);
8817        }
8818        if let Some(limit_lines) = opts.limit_lines {
8819            query = query.arg("limitLines", limit_lines);
8820        }
8821        query.execute(self.graphql_client.clone()).await
8822    }
8823    /// 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.
8824    ///
8825    /// # Arguments
8826    ///
8827    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8828    pub async fn digest(&self) -> Result<String, DaggerError> {
8829        let query = self.selection.select("digest");
8830        query.execute(self.graphql_client.clone()).await
8831    }
8832    /// 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.
8833    ///
8834    /// # Arguments
8835    ///
8836    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8837    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
8838        let mut query = self.selection.select("digest");
8839        if let Some(exclude_metadata) = opts.exclude_metadata {
8840            query = query.arg("excludeMetadata", exclude_metadata);
8841        }
8842        query.execute(self.graphql_client.clone()).await
8843    }
8844    /// Writes the file to a file path on the host.
8845    ///
8846    /// # Arguments
8847    ///
8848    /// * `path` - Location of the written directory (e.g., "output.txt").
8849    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8850    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
8851        let mut query = self.selection.select("export");
8852        query = query.arg("path", path.into());
8853        query.execute(self.graphql_client.clone()).await
8854    }
8855    /// Writes the file to a file path on the host.
8856    ///
8857    /// # Arguments
8858    ///
8859    /// * `path` - Location of the written directory (e.g., "output.txt").
8860    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8861    pub async fn export_opts(
8862        &self,
8863        path: impl Into<String>,
8864        opts: FileExportOpts,
8865    ) -> Result<String, DaggerError> {
8866        let mut query = self.selection.select("export");
8867        query = query.arg("path", path.into());
8868        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
8869            query = query.arg("allowParentDirPath", allow_parent_dir_path);
8870        }
8871        query.execute(self.graphql_client.clone()).await
8872    }
8873    /// A unique identifier for this File.
8874    pub async fn id(&self) -> Result<Id, DaggerError> {
8875        let query = self.selection.select("id");
8876        query.execute(self.graphql_client.clone()).await
8877    }
8878    /// Retrieves the name of the file.
8879    pub async fn name(&self) -> Result<String, DaggerError> {
8880        let query = self.selection.select("name");
8881        query.execute(self.graphql_client.clone()).await
8882    }
8883    /// Searches for content matching the given regular expression or literal string.
8884    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
8885    ///
8886    /// # Arguments
8887    ///
8888    /// * `pattern` - The text to match.
8889    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8890    pub async fn search(
8891        &self,
8892        pattern: impl Into<String>,
8893    ) -> Result<Vec<SearchResult>, DaggerError> {
8894        let mut query = self.selection.select("search");
8895        query = query.arg("pattern", pattern.into());
8896        let query = query.select("id");
8897        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8898        Ok(ids
8899            .into_iter()
8900            .map(|id| SearchResult {
8901                proc: self.proc.clone(),
8902                selection: crate::querybuilder::query()
8903                    .select("node")
8904                    .arg("id", &id.0)
8905                    .inline_fragment("SearchResult"),
8906                graphql_client: self.graphql_client.clone(),
8907            })
8908            .collect())
8909    }
8910    /// Searches for content matching the given regular expression or literal string.
8911    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
8912    ///
8913    /// # Arguments
8914    ///
8915    /// * `pattern` - The text to match.
8916    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8917    pub async fn search_opts<'a>(
8918        &self,
8919        pattern: impl Into<String>,
8920        opts: FileSearchOpts<'a>,
8921    ) -> Result<Vec<SearchResult>, DaggerError> {
8922        let mut query = self.selection.select("search");
8923        query = query.arg("pattern", pattern.into());
8924        if let Some(literal) = opts.literal {
8925            query = query.arg("literal", literal);
8926        }
8927        if let Some(multiline) = opts.multiline {
8928            query = query.arg("multiline", multiline);
8929        }
8930        if let Some(dotall) = opts.dotall {
8931            query = query.arg("dotall", dotall);
8932        }
8933        if let Some(insensitive) = opts.insensitive {
8934            query = query.arg("insensitive", insensitive);
8935        }
8936        if let Some(skip_ignored) = opts.skip_ignored {
8937            query = query.arg("skipIgnored", skip_ignored);
8938        }
8939        if let Some(skip_hidden) = opts.skip_hidden {
8940            query = query.arg("skipHidden", skip_hidden);
8941        }
8942        if let Some(files_only) = opts.files_only {
8943            query = query.arg("filesOnly", files_only);
8944        }
8945        if let Some(limit) = opts.limit {
8946            query = query.arg("limit", limit);
8947        }
8948        if let Some(paths) = opts.paths {
8949            query = query.arg("paths", paths);
8950        }
8951        if let Some(globs) = opts.globs {
8952            query = query.arg("globs", globs);
8953        }
8954        let query = query.select("id");
8955        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8956        Ok(ids
8957            .into_iter()
8958            .map(|id| SearchResult {
8959                proc: self.proc.clone(),
8960                selection: crate::querybuilder::query()
8961                    .select("node")
8962                    .arg("id", &id.0)
8963                    .inline_fragment("SearchResult"),
8964                graphql_client: self.graphql_client.clone(),
8965            })
8966            .collect())
8967    }
8968    /// Retrieves the size of the file, in bytes.
8969    pub async fn size(&self) -> Result<isize, DaggerError> {
8970        let query = self.selection.select("size");
8971        query.execute(self.graphql_client.clone()).await
8972    }
8973    /// Return file status
8974    pub fn stat(&self) -> Stat {
8975        let query = self.selection.select("stat");
8976        Stat {
8977            proc: self.proc.clone(),
8978            selection: query,
8979            graphql_client: self.graphql_client.clone(),
8980        }
8981    }
8982    /// Force evaluation in the engine.
8983    pub async fn sync(&self) -> Result<File, DaggerError> {
8984        let query = self.selection.select("sync");
8985        let id: Id = query.execute(self.graphql_client.clone()).await?;
8986        Ok(File {
8987            proc: self.proc.clone(),
8988            selection: query
8989                .root()
8990                .select("node")
8991                .arg("id", &id.0)
8992                .inline_fragment("File"),
8993            graphql_client: self.graphql_client.clone(),
8994        })
8995    }
8996    /// Retrieves this file with its name set to the given name.
8997    ///
8998    /// # Arguments
8999    ///
9000    /// * `name` - Name to set file to.
9001    pub fn with_name(&self, name: impl Into<String>) -> File {
9002        let mut query = self.selection.select("withName");
9003        query = query.arg("name", name.into());
9004        File {
9005            proc: self.proc.clone(),
9006            selection: query,
9007            graphql_client: self.graphql_client.clone(),
9008        }
9009    }
9010    /// Retrieves the file with content replaced with the given text.
9011    /// If 'all' is true, all occurrences of the pattern will be replaced.
9012    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9013    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9014    /// If there are no matches for the pattern, this will error.
9015    ///
9016    /// # Arguments
9017    ///
9018    /// * `search` - The text to match.
9019    /// * `replacement` - The text to match.
9020    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9021    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
9022        let mut query = self.selection.select("withReplaced");
9023        query = query.arg("search", search.into());
9024        query = query.arg("replacement", replacement.into());
9025        File {
9026            proc: self.proc.clone(),
9027            selection: query,
9028            graphql_client: self.graphql_client.clone(),
9029        }
9030    }
9031    /// Retrieves the file with content replaced with the given text.
9032    /// If 'all' is true, all occurrences of the pattern will be replaced.
9033    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9034    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9035    /// If there are no matches for the pattern, this will error.
9036    ///
9037    /// # Arguments
9038    ///
9039    /// * `search` - The text to match.
9040    /// * `replacement` - The text to match.
9041    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9042    pub fn with_replaced_opts(
9043        &self,
9044        search: impl Into<String>,
9045        replacement: impl Into<String>,
9046        opts: FileWithReplacedOpts,
9047    ) -> File {
9048        let mut query = self.selection.select("withReplaced");
9049        query = query.arg("search", search.into());
9050        query = query.arg("replacement", replacement.into());
9051        if let Some(all) = opts.all {
9052            query = query.arg("all", all);
9053        }
9054        if let Some(first_from) = opts.first_from {
9055            query = query.arg("firstFrom", first_from);
9056        }
9057        File {
9058            proc: self.proc.clone(),
9059            selection: query,
9060            graphql_client: self.graphql_client.clone(),
9061        }
9062    }
9063    /// Retrieves this file with its created/modified timestamps set to the given time.
9064    ///
9065    /// # Arguments
9066    ///
9067    /// * `timestamp` - Timestamp to set dir/files in.
9068    ///
9069    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
9070    pub fn with_timestamps(&self, timestamp: isize) -> File {
9071        let mut query = self.selection.select("withTimestamps");
9072        query = query.arg("timestamp", timestamp);
9073        File {
9074            proc: self.proc.clone(),
9075            selection: query,
9076            graphql_client: self.graphql_client.clone(),
9077        }
9078    }
9079}
9080impl Exportable for File {
9081    fn export(
9082        &self,
9083        path: impl Into<String>,
9084    ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
9085        let mut query = self.selection.select("export");
9086        query = query.arg("path", path.into());
9087        let graphql_client = self.graphql_client.clone();
9088        async move { query.execute(graphql_client).await }
9089    }
9090    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9091        let query = self.selection.select("id");
9092        let graphql_client = self.graphql_client.clone();
9093        async move { query.execute(graphql_client).await }
9094    }
9095}
9096impl Node for File {
9097    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9098        let query = self.selection.select("id");
9099        let graphql_client = self.graphql_client.clone();
9100        async move { query.execute(graphql_client).await }
9101    }
9102}
9103impl Syncer for File {
9104    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9105        let query = self.selection.select("id");
9106        let graphql_client = self.graphql_client.clone();
9107        async move { query.execute(graphql_client).await }
9108    }
9109    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9110        let query = self.selection.select("sync");
9111        let graphql_client = self.graphql_client.clone();
9112        async move { query.execute(graphql_client).await }
9113    }
9114}
9115#[derive(Clone)]
9116pub struct Function {
9117    pub proc: Option<Arc<DaggerSessionProc>>,
9118    pub selection: Selection,
9119    pub graphql_client: DynGraphQLClient,
9120}
9121#[derive(Builder, Debug, PartialEq)]
9122pub struct FunctionWithArgOpts<'a> {
9123    #[builder(setter(into, strip_option), default)]
9124    pub default_address: Option<&'a str>,
9125    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
9126    #[builder(setter(into, strip_option), default)]
9127    pub default_path: Option<&'a str>,
9128    /// A default value to use for this argument if not explicitly set by the caller, if any
9129    #[builder(setter(into, strip_option), default)]
9130    pub default_value: Option<Json>,
9131    /// If deprecated, the reason or migration path.
9132    #[builder(setter(into, strip_option), default)]
9133    pub deprecated: Option<&'a str>,
9134    /// A doc string for the argument, if any
9135    #[builder(setter(into, strip_option), default)]
9136    pub description: Option<&'a str>,
9137    /// Patterns to ignore when loading the contextual argument value.
9138    #[builder(setter(into, strip_option), default)]
9139    pub ignore: Option<Vec<&'a str>>,
9140    /// The source map for the argument definition.
9141    #[builder(setter(into, strip_option), default)]
9142    pub source_map: Option<Id>,
9143}
9144#[derive(Builder, Debug, PartialEq)]
9145pub struct FunctionWithCachePolicyOpts<'a> {
9146    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
9147    #[builder(setter(into, strip_option), default)]
9148    pub time_to_live: Option<&'a str>,
9149}
9150#[derive(Builder, Debug, PartialEq)]
9151pub struct FunctionWithDeprecatedOpts<'a> {
9152    /// Reason or migration path describing the deprecation.
9153    #[builder(setter(into, strip_option), default)]
9154    pub reason: Option<&'a str>,
9155}
9156impl IntoID<Id> for Function {
9157    fn into_id(
9158        self,
9159    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9160        Box::pin(async move { self.id().await })
9161    }
9162}
9163impl Loadable for Function {
9164    fn graphql_type() -> &'static str {
9165        "Function"
9166    }
9167    fn from_query(
9168        proc: Option<Arc<DaggerSessionProc>>,
9169        selection: Selection,
9170        graphql_client: DynGraphQLClient,
9171    ) -> Self {
9172        Self {
9173            proc,
9174            selection,
9175            graphql_client,
9176        }
9177    }
9178}
9179impl Function {
9180    /// Arguments accepted by the function, if any.
9181    pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
9182        let query = self.selection.select("args");
9183        let query = query.select("id");
9184        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9185        Ok(ids
9186            .into_iter()
9187            .map(|id| FunctionArg {
9188                proc: self.proc.clone(),
9189                selection: crate::querybuilder::query()
9190                    .select("node")
9191                    .arg("id", &id.0)
9192                    .inline_fragment("FunctionArg"),
9193                graphql_client: self.graphql_client.clone(),
9194            })
9195            .collect())
9196    }
9197    /// The reason this function is deprecated, if any.
9198    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9199        let query = self.selection.select("deprecated");
9200        query.execute(self.graphql_client.clone()).await
9201    }
9202    /// A doc string for the function, if any.
9203    pub async fn description(&self) -> Result<String, DaggerError> {
9204        let query = self.selection.select("description");
9205        query.execute(self.graphql_client.clone()).await
9206    }
9207    /// A unique identifier for this Function.
9208    pub async fn id(&self) -> Result<Id, DaggerError> {
9209        let query = self.selection.select("id");
9210        query.execute(self.graphql_client.clone()).await
9211    }
9212    /// The name of the function.
9213    pub async fn name(&self) -> Result<String, DaggerError> {
9214        let query = self.selection.select("name");
9215        query.execute(self.graphql_client.clone()).await
9216    }
9217    /// The type returned by the function.
9218    pub fn return_type(&self) -> TypeDef {
9219        let query = self.selection.select("returnType");
9220        TypeDef {
9221            proc: self.proc.clone(),
9222            selection: query,
9223            graphql_client: self.graphql_client.clone(),
9224        }
9225    }
9226    /// The location of this function declaration.
9227    pub fn source_map(&self) -> SourceMap {
9228        let query = self.selection.select("sourceMap");
9229        SourceMap {
9230            proc: self.proc.clone(),
9231            selection: query,
9232            graphql_client: self.graphql_client.clone(),
9233        }
9234    }
9235    /// If this function is provided by a module, the name of the module. Unset otherwise.
9236    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9237        let query = self.selection.select("sourceModuleName");
9238        query.execute(self.graphql_client.clone()).await
9239    }
9240    /// Returns the function with the provided argument
9241    ///
9242    /// # Arguments
9243    ///
9244    /// * `name` - The name of the argument
9245    /// * `type_def` - The type of the argument
9246    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9247    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
9248        let mut query = self.selection.select("withArg");
9249        query = query.arg("name", name.into());
9250        query = query.arg_lazy(
9251            "typeDef",
9252            Box::new(move || {
9253                let type_def = type_def.clone();
9254                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9255            }),
9256        );
9257        Function {
9258            proc: self.proc.clone(),
9259            selection: query,
9260            graphql_client: self.graphql_client.clone(),
9261        }
9262    }
9263    /// Returns the function with the provided argument
9264    ///
9265    /// # Arguments
9266    ///
9267    /// * `name` - The name of the argument
9268    /// * `type_def` - The type of the argument
9269    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9270    pub fn with_arg_opts<'a>(
9271        &self,
9272        name: impl Into<String>,
9273        type_def: impl IntoID<Id>,
9274        opts: FunctionWithArgOpts<'a>,
9275    ) -> Function {
9276        let mut query = self.selection.select("withArg");
9277        query = query.arg("name", name.into());
9278        query = query.arg_lazy(
9279            "typeDef",
9280            Box::new(move || {
9281                let type_def = type_def.clone();
9282                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9283            }),
9284        );
9285        if let Some(description) = opts.description {
9286            query = query.arg("description", description);
9287        }
9288        if let Some(default_value) = opts.default_value {
9289            query = query.arg("defaultValue", default_value);
9290        }
9291        if let Some(default_path) = opts.default_path {
9292            query = query.arg("defaultPath", default_path);
9293        }
9294        if let Some(ignore) = opts.ignore {
9295            query = query.arg("ignore", ignore);
9296        }
9297        if let Some(source_map) = opts.source_map {
9298            query = query.arg("sourceMap", source_map);
9299        }
9300        if let Some(deprecated) = opts.deprecated {
9301            query = query.arg("deprecated", deprecated);
9302        }
9303        if let Some(default_address) = opts.default_address {
9304            query = query.arg("defaultAddress", default_address);
9305        }
9306        Function {
9307            proc: self.proc.clone(),
9308            selection: query,
9309            graphql_client: self.graphql_client.clone(),
9310        }
9311    }
9312    /// Returns the function updated to use the provided cache policy.
9313    ///
9314    /// # Arguments
9315    ///
9316    /// * `policy` - The cache policy to use.
9317    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9318    pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9319        let mut query = self.selection.select("withCachePolicy");
9320        query = query.arg("policy", policy);
9321        Function {
9322            proc: self.proc.clone(),
9323            selection: query,
9324            graphql_client: self.graphql_client.clone(),
9325        }
9326    }
9327    /// Returns the function updated to use the provided cache policy.
9328    ///
9329    /// # Arguments
9330    ///
9331    /// * `policy` - The cache policy to use.
9332    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9333    pub fn with_cache_policy_opts<'a>(
9334        &self,
9335        policy: FunctionCachePolicy,
9336        opts: FunctionWithCachePolicyOpts<'a>,
9337    ) -> Function {
9338        let mut query = self.selection.select("withCachePolicy");
9339        query = query.arg("policy", policy);
9340        if let Some(time_to_live) = opts.time_to_live {
9341            query = query.arg("timeToLive", time_to_live);
9342        }
9343        Function {
9344            proc: self.proc.clone(),
9345            selection: query,
9346            graphql_client: self.graphql_client.clone(),
9347        }
9348    }
9349    /// Returns the function with a flag indicating it's a check.
9350    pub fn with_check(&self) -> Function {
9351        let query = self.selection.select("withCheck");
9352        Function {
9353            proc: self.proc.clone(),
9354            selection: query,
9355            graphql_client: self.graphql_client.clone(),
9356        }
9357    }
9358    /// Returns the function with the provided deprecation reason.
9359    ///
9360    /// # Arguments
9361    ///
9362    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9363    pub fn with_deprecated(&self) -> Function {
9364        let query = self.selection.select("withDeprecated");
9365        Function {
9366            proc: self.proc.clone(),
9367            selection: query,
9368            graphql_client: self.graphql_client.clone(),
9369        }
9370    }
9371    /// Returns the function with the provided deprecation reason.
9372    ///
9373    /// # Arguments
9374    ///
9375    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9376    pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9377        let mut query = self.selection.select("withDeprecated");
9378        if let Some(reason) = opts.reason {
9379            query = query.arg("reason", reason);
9380        }
9381        Function {
9382            proc: self.proc.clone(),
9383            selection: query,
9384            graphql_client: self.graphql_client.clone(),
9385        }
9386    }
9387    /// Returns the function with the given doc string.
9388    ///
9389    /// # Arguments
9390    ///
9391    /// * `description` - The doc string to set.
9392    pub fn with_description(&self, description: impl Into<String>) -> Function {
9393        let mut query = self.selection.select("withDescription");
9394        query = query.arg("description", description.into());
9395        Function {
9396            proc: self.proc.clone(),
9397            selection: query,
9398            graphql_client: self.graphql_client.clone(),
9399        }
9400    }
9401    /// Returns the function with a flag indicating it's a generator.
9402    pub fn with_generator(&self) -> Function {
9403        let query = self.selection.select("withGenerator");
9404        Function {
9405            proc: self.proc.clone(),
9406            selection: query,
9407            graphql_client: self.graphql_client.clone(),
9408        }
9409    }
9410    /// Returns the function with the given source map.
9411    ///
9412    /// # Arguments
9413    ///
9414    /// * `source_map` - The source map for the function definition.
9415    pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
9416        let mut query = self.selection.select("withSourceMap");
9417        query = query.arg_lazy(
9418            "sourceMap",
9419            Box::new(move || {
9420                let source_map = source_map.clone();
9421                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9422            }),
9423        );
9424        Function {
9425            proc: self.proc.clone(),
9426            selection: query,
9427            graphql_client: self.graphql_client.clone(),
9428        }
9429    }
9430    /// Returns the function with a flag indicating it returns a service for dagger up.
9431    pub fn with_up(&self) -> Function {
9432        let query = self.selection.select("withUp");
9433        Function {
9434            proc: self.proc.clone(),
9435            selection: query,
9436            graphql_client: self.graphql_client.clone(),
9437        }
9438    }
9439}
9440impl Node for Function {
9441    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9442        let query = self.selection.select("id");
9443        let graphql_client = self.graphql_client.clone();
9444        async move { query.execute(graphql_client).await }
9445    }
9446}
9447#[derive(Clone)]
9448pub struct FunctionArg {
9449    pub proc: Option<Arc<DaggerSessionProc>>,
9450    pub selection: Selection,
9451    pub graphql_client: DynGraphQLClient,
9452}
9453impl IntoID<Id> for FunctionArg {
9454    fn into_id(
9455        self,
9456    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9457        Box::pin(async move { self.id().await })
9458    }
9459}
9460impl Loadable for FunctionArg {
9461    fn graphql_type() -> &'static str {
9462        "FunctionArg"
9463    }
9464    fn from_query(
9465        proc: Option<Arc<DaggerSessionProc>>,
9466        selection: Selection,
9467        graphql_client: DynGraphQLClient,
9468    ) -> Self {
9469        Self {
9470            proc,
9471            selection,
9472            graphql_client,
9473        }
9474    }
9475}
9476impl FunctionArg {
9477    /// Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
9478    pub async fn default_address(&self) -> Result<String, DaggerError> {
9479        let query = self.selection.select("defaultAddress");
9480        query.execute(self.graphql_client.clone()).await
9481    }
9482    /// 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
9483    pub async fn default_path(&self) -> Result<String, DaggerError> {
9484        let query = self.selection.select("defaultPath");
9485        query.execute(self.graphql_client.clone()).await
9486    }
9487    /// A default value to use for this argument when not explicitly set by the caller, if any.
9488    pub async fn default_value(&self) -> Result<Json, DaggerError> {
9489        let query = self.selection.select("defaultValue");
9490        query.execute(self.graphql_client.clone()).await
9491    }
9492    /// The reason this function is deprecated, if any.
9493    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9494        let query = self.selection.select("deprecated");
9495        query.execute(self.graphql_client.clone()).await
9496    }
9497    /// A doc string for the argument, if any.
9498    pub async fn description(&self) -> Result<String, DaggerError> {
9499        let query = self.selection.select("description");
9500        query.execute(self.graphql_client.clone()).await
9501    }
9502    /// A unique identifier for this FunctionArg.
9503    pub async fn id(&self) -> Result<Id, DaggerError> {
9504        let query = self.selection.select("id");
9505        query.execute(self.graphql_client.clone()).await
9506    }
9507    /// 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.
9508    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9509        let query = self.selection.select("ignore");
9510        query.execute(self.graphql_client.clone()).await
9511    }
9512    /// The name of the argument in lowerCamelCase format.
9513    pub async fn name(&self) -> Result<String, DaggerError> {
9514        let query = self.selection.select("name");
9515        query.execute(self.graphql_client.clone()).await
9516    }
9517    /// The location of this arg declaration.
9518    pub fn source_map(&self) -> SourceMap {
9519        let query = self.selection.select("sourceMap");
9520        SourceMap {
9521            proc: self.proc.clone(),
9522            selection: query,
9523            graphql_client: self.graphql_client.clone(),
9524        }
9525    }
9526    /// The type of the argument.
9527    pub fn type_def(&self) -> TypeDef {
9528        let query = self.selection.select("typeDef");
9529        TypeDef {
9530            proc: self.proc.clone(),
9531            selection: query,
9532            graphql_client: self.graphql_client.clone(),
9533        }
9534    }
9535}
9536impl Node for FunctionArg {
9537    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9538        let query = self.selection.select("id");
9539        let graphql_client = self.graphql_client.clone();
9540        async move { query.execute(graphql_client).await }
9541    }
9542}
9543#[derive(Clone)]
9544pub struct FunctionCall {
9545    pub proc: Option<Arc<DaggerSessionProc>>,
9546    pub selection: Selection,
9547    pub graphql_client: DynGraphQLClient,
9548}
9549impl IntoID<Id> for FunctionCall {
9550    fn into_id(
9551        self,
9552    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9553        Box::pin(async move { self.id().await })
9554    }
9555}
9556impl Loadable for FunctionCall {
9557    fn graphql_type() -> &'static str {
9558        "FunctionCall"
9559    }
9560    fn from_query(
9561        proc: Option<Arc<DaggerSessionProc>>,
9562        selection: Selection,
9563        graphql_client: DynGraphQLClient,
9564    ) -> Self {
9565        Self {
9566            proc,
9567            selection,
9568            graphql_client,
9569        }
9570    }
9571}
9572impl FunctionCall {
9573    /// A unique identifier for this FunctionCall.
9574    pub async fn id(&self) -> Result<Id, DaggerError> {
9575        let query = self.selection.select("id");
9576        query.execute(self.graphql_client.clone()).await
9577    }
9578    /// The argument values the function is being invoked with.
9579    pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
9580        let query = self.selection.select("inputArgs");
9581        let query = query.select("id");
9582        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9583        Ok(ids
9584            .into_iter()
9585            .map(|id| FunctionCallArgValue {
9586                proc: self.proc.clone(),
9587                selection: crate::querybuilder::query()
9588                    .select("node")
9589                    .arg("id", &id.0)
9590                    .inline_fragment("FunctionCallArgValue"),
9591                graphql_client: self.graphql_client.clone(),
9592            })
9593            .collect())
9594    }
9595    /// The name of the function being called.
9596    pub async fn name(&self) -> Result<String, DaggerError> {
9597        let query = self.selection.select("name");
9598        query.execute(self.graphql_client.clone()).await
9599    }
9600    /// 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.
9601    pub async fn parent(&self) -> Result<Json, DaggerError> {
9602        let query = self.selection.select("parent");
9603        query.execute(self.graphql_client.clone()).await
9604    }
9605    /// 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.
9606    pub async fn parent_name(&self) -> Result<String, DaggerError> {
9607        let query = self.selection.select("parentName");
9608        query.execute(self.graphql_client.clone()).await
9609    }
9610    /// Return an error from the function.
9611    ///
9612    /// # Arguments
9613    ///
9614    /// * `error` - The error to return.
9615    pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
9616        let mut query = self.selection.select("returnError");
9617        query = query.arg_lazy(
9618            "error",
9619            Box::new(move || {
9620                let error = error.clone();
9621                Box::pin(async move { error.into_id().await.unwrap().quote() })
9622            }),
9623        );
9624        query.execute(self.graphql_client.clone()).await
9625    }
9626    /// Set the return value of the function call to the provided value.
9627    ///
9628    /// # Arguments
9629    ///
9630    /// * `value` - JSON serialization of the return value.
9631    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9632        let mut query = self.selection.select("returnValue");
9633        query = query.arg("value", value);
9634        query.execute(self.graphql_client.clone()).await
9635    }
9636}
9637impl Node for FunctionCall {
9638    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9639        let query = self.selection.select("id");
9640        let graphql_client = self.graphql_client.clone();
9641        async move { query.execute(graphql_client).await }
9642    }
9643}
9644#[derive(Clone)]
9645pub struct FunctionCallArgValue {
9646    pub proc: Option<Arc<DaggerSessionProc>>,
9647    pub selection: Selection,
9648    pub graphql_client: DynGraphQLClient,
9649}
9650impl IntoID<Id> for FunctionCallArgValue {
9651    fn into_id(
9652        self,
9653    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9654        Box::pin(async move { self.id().await })
9655    }
9656}
9657impl Loadable for FunctionCallArgValue {
9658    fn graphql_type() -> &'static str {
9659        "FunctionCallArgValue"
9660    }
9661    fn from_query(
9662        proc: Option<Arc<DaggerSessionProc>>,
9663        selection: Selection,
9664        graphql_client: DynGraphQLClient,
9665    ) -> Self {
9666        Self {
9667            proc,
9668            selection,
9669            graphql_client,
9670        }
9671    }
9672}
9673impl FunctionCallArgValue {
9674    /// A unique identifier for this FunctionCallArgValue.
9675    pub async fn id(&self) -> Result<Id, DaggerError> {
9676        let query = self.selection.select("id");
9677        query.execute(self.graphql_client.clone()).await
9678    }
9679    /// The name of the argument.
9680    pub async fn name(&self) -> Result<String, DaggerError> {
9681        let query = self.selection.select("name");
9682        query.execute(self.graphql_client.clone()).await
9683    }
9684    /// The value of the argument represented as a JSON serialized string.
9685    pub async fn value(&self) -> Result<Json, DaggerError> {
9686        let query = self.selection.select("value");
9687        query.execute(self.graphql_client.clone()).await
9688    }
9689}
9690impl Node for FunctionCallArgValue {
9691    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9692        let query = self.selection.select("id");
9693        let graphql_client = self.graphql_client.clone();
9694        async move { query.execute(graphql_client).await }
9695    }
9696}
9697#[derive(Clone)]
9698pub struct GeneratedCode {
9699    pub proc: Option<Arc<DaggerSessionProc>>,
9700    pub selection: Selection,
9701    pub graphql_client: DynGraphQLClient,
9702}
9703impl IntoID<Id> for GeneratedCode {
9704    fn into_id(
9705        self,
9706    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9707        Box::pin(async move { self.id().await })
9708    }
9709}
9710impl Loadable for GeneratedCode {
9711    fn graphql_type() -> &'static str {
9712        "GeneratedCode"
9713    }
9714    fn from_query(
9715        proc: Option<Arc<DaggerSessionProc>>,
9716        selection: Selection,
9717        graphql_client: DynGraphQLClient,
9718    ) -> Self {
9719        Self {
9720            proc,
9721            selection,
9722            graphql_client,
9723        }
9724    }
9725}
9726impl GeneratedCode {
9727    /// The directory containing the generated code.
9728    pub fn code(&self) -> Directory {
9729        let query = self.selection.select("code");
9730        Directory {
9731            proc: self.proc.clone(),
9732            selection: query,
9733            graphql_client: self.graphql_client.clone(),
9734        }
9735    }
9736    /// A unique identifier for this GeneratedCode.
9737    pub async fn id(&self) -> Result<Id, DaggerError> {
9738        let query = self.selection.select("id");
9739        query.execute(self.graphql_client.clone()).await
9740    }
9741    /// List of paths to mark generated in version control (i.e. .gitattributes).
9742    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
9743        let query = self.selection.select("vcsGeneratedPaths");
9744        query.execute(self.graphql_client.clone()).await
9745    }
9746    /// List of paths to ignore in version control (i.e. .gitignore).
9747    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
9748        let query = self.selection.select("vcsIgnoredPaths");
9749        query.execute(self.graphql_client.clone()).await
9750    }
9751    /// Set the list of paths to mark generated in version control.
9752    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9753        let mut query = self.selection.select("withVCSGeneratedPaths");
9754        query = query.arg(
9755            "paths",
9756            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9757        );
9758        GeneratedCode {
9759            proc: self.proc.clone(),
9760            selection: query,
9761            graphql_client: self.graphql_client.clone(),
9762        }
9763    }
9764    /// Set the list of paths to ignore in version control.
9765    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9766        let mut query = self.selection.select("withVCSIgnoredPaths");
9767        query = query.arg(
9768            "paths",
9769            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9770        );
9771        GeneratedCode {
9772            proc: self.proc.clone(),
9773            selection: query,
9774            graphql_client: self.graphql_client.clone(),
9775        }
9776    }
9777}
9778impl Node for GeneratedCode {
9779    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9780        let query = self.selection.select("id");
9781        let graphql_client = self.graphql_client.clone();
9782        async move { query.execute(graphql_client).await }
9783    }
9784}
9785#[derive(Clone)]
9786pub struct Generator {
9787    pub proc: Option<Arc<DaggerSessionProc>>,
9788    pub selection: Selection,
9789    pub graphql_client: DynGraphQLClient,
9790}
9791impl IntoID<Id> for Generator {
9792    fn into_id(
9793        self,
9794    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9795        Box::pin(async move { self.id().await })
9796    }
9797}
9798impl Loadable for Generator {
9799    fn graphql_type() -> &'static str {
9800        "Generator"
9801    }
9802    fn from_query(
9803        proc: Option<Arc<DaggerSessionProc>>,
9804        selection: Selection,
9805        graphql_client: DynGraphQLClient,
9806    ) -> Self {
9807        Self {
9808            proc,
9809            selection,
9810            graphql_client,
9811        }
9812    }
9813}
9814impl Generator {
9815    /// The generated changeset from the last run
9816    pub fn changes(&self) -> Changeset {
9817        let query = self.selection.select("changes");
9818        Changeset {
9819            proc: self.proc.clone(),
9820            selection: query,
9821            graphql_client: self.graphql_client.clone(),
9822        }
9823    }
9824    /// Whether the generator complete
9825    pub async fn completed(&self) -> Result<bool, DaggerError> {
9826        let query = self.selection.select("completed");
9827        query.execute(self.graphql_client.clone()).await
9828    }
9829    /// Return the description of the generator
9830    pub async fn description(&self) -> Result<String, DaggerError> {
9831        let query = self.selection.select("description");
9832        query.execute(self.graphql_client.clone()).await
9833    }
9834    /// A unique identifier for this Generator.
9835    pub async fn id(&self) -> Result<Id, DaggerError> {
9836        let query = self.selection.select("id");
9837        query.execute(self.graphql_client.clone()).await
9838    }
9839    /// Whether changeset from the last generator run is empty or not
9840    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9841        let query = self.selection.select("isEmpty");
9842        query.execute(self.graphql_client.clone()).await
9843    }
9844    /// Return the fully qualified name of the generator
9845    pub async fn name(&self) -> Result<String, DaggerError> {
9846        let query = self.selection.select("name");
9847        query.execute(self.graphql_client.clone()).await
9848    }
9849    /// The original module in which the generator has been defined
9850    pub fn original_module(&self) -> Module {
9851        let query = self.selection.select("originalModule");
9852        Module {
9853            proc: self.proc.clone(),
9854            selection: query,
9855            graphql_client: self.graphql_client.clone(),
9856        }
9857    }
9858    /// The path of the generator within its module
9859    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
9860        let query = self.selection.select("path");
9861        query.execute(self.graphql_client.clone()).await
9862    }
9863    /// Execute the generator
9864    pub fn run(&self) -> Generator {
9865        let query = self.selection.select("run");
9866        Generator {
9867            proc: self.proc.clone(),
9868            selection: query,
9869            graphql_client: self.graphql_client.clone(),
9870        }
9871    }
9872}
9873impl Node for Generator {
9874    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9875        let query = self.selection.select("id");
9876        let graphql_client = self.graphql_client.clone();
9877        async move { query.execute(graphql_client).await }
9878    }
9879}
9880#[derive(Clone)]
9881pub struct GeneratorGroup {
9882    pub proc: Option<Arc<DaggerSessionProc>>,
9883    pub selection: Selection,
9884    pub graphql_client: DynGraphQLClient,
9885}
9886#[derive(Builder, Debug, PartialEq)]
9887pub struct GeneratorGroupChangesOpts {
9888    /// Strategy to apply on conflicts between generators
9889    #[builder(setter(into, strip_option), default)]
9890    pub on_conflict: Option<ChangesetsMergeConflict>,
9891}
9892impl IntoID<Id> for GeneratorGroup {
9893    fn into_id(
9894        self,
9895    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9896        Box::pin(async move { self.id().await })
9897    }
9898}
9899impl Loadable for GeneratorGroup {
9900    fn graphql_type() -> &'static str {
9901        "GeneratorGroup"
9902    }
9903    fn from_query(
9904        proc: Option<Arc<DaggerSessionProc>>,
9905        selection: Selection,
9906        graphql_client: DynGraphQLClient,
9907    ) -> Self {
9908        Self {
9909            proc,
9910            selection,
9911            graphql_client,
9912        }
9913    }
9914}
9915impl GeneratorGroup {
9916    /// The combined changes from the last run of the generators
9917    /// 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.
9918    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
9919    ///
9920    /// # Arguments
9921    ///
9922    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9923    pub fn changes(&self) -> Changeset {
9924        let query = self.selection.select("changes");
9925        Changeset {
9926            proc: self.proc.clone(),
9927            selection: query,
9928            graphql_client: self.graphql_client.clone(),
9929        }
9930    }
9931    /// The combined changes from the last run of the generators
9932    /// 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.
9933    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
9934    ///
9935    /// # Arguments
9936    ///
9937    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9938    pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
9939        let mut query = self.selection.select("changes");
9940        if let Some(on_conflict) = opts.on_conflict {
9941            query = query.arg("onConflict", on_conflict);
9942        }
9943        Changeset {
9944            proc: self.proc.clone(),
9945            selection: query,
9946            graphql_client: self.graphql_client.clone(),
9947        }
9948    }
9949    /// A unique identifier for this GeneratorGroup.
9950    pub async fn id(&self) -> Result<Id, DaggerError> {
9951        let query = self.selection.select("id");
9952        query.execute(self.graphql_client.clone()).await
9953    }
9954    /// Whether the generated changeset from the last run is empty or not
9955    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9956        let query = self.selection.select("isEmpty");
9957        query.execute(self.graphql_client.clone()).await
9958    }
9959    /// Return a list of individual generators and their details
9960    pub async fn list(&self) -> Result<Vec<Generator>, DaggerError> {
9961        let query = self.selection.select("list");
9962        let query = query.select("id");
9963        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9964        Ok(ids
9965            .into_iter()
9966            .map(|id| Generator {
9967                proc: self.proc.clone(),
9968                selection: crate::querybuilder::query()
9969                    .select("node")
9970                    .arg("id", &id.0)
9971                    .inline_fragment("Generator"),
9972                graphql_client: self.graphql_client.clone(),
9973            })
9974            .collect())
9975    }
9976    /// Execute all selected generators
9977    pub fn run(&self) -> GeneratorGroup {
9978        let query = self.selection.select("run");
9979        GeneratorGroup {
9980            proc: self.proc.clone(),
9981            selection: query,
9982            graphql_client: self.graphql_client.clone(),
9983        }
9984    }
9985}
9986impl Node for GeneratorGroup {
9987    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9988        let query = self.selection.select("id");
9989        let graphql_client = self.graphql_client.clone();
9990        async move { query.execute(graphql_client).await }
9991    }
9992}
9993#[derive(Clone)]
9994pub struct GitRef {
9995    pub proc: Option<Arc<DaggerSessionProc>>,
9996    pub selection: Selection,
9997    pub graphql_client: DynGraphQLClient,
9998}
9999#[derive(Builder, Debug, PartialEq)]
10000pub struct GitRefTreeOpts {
10001    /// The depth of the tree to fetch.
10002    #[builder(setter(into, strip_option), default)]
10003    pub depth: Option<isize>,
10004    /// Set to true to discard .git directory.
10005    #[builder(setter(into, strip_option), default)]
10006    pub discard_git_dir: Option<bool>,
10007    /// Set to true to populate tag refs in the local checkout .git.
10008    #[builder(setter(into, strip_option), default)]
10009    pub include_tags: Option<bool>,
10010}
10011impl IntoID<Id> for GitRef {
10012    fn into_id(
10013        self,
10014    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10015        Box::pin(async move { self.id().await })
10016    }
10017}
10018impl Loadable for GitRef {
10019    fn graphql_type() -> &'static str {
10020        "GitRef"
10021    }
10022    fn from_query(
10023        proc: Option<Arc<DaggerSessionProc>>,
10024        selection: Selection,
10025        graphql_client: DynGraphQLClient,
10026    ) -> Self {
10027        Self {
10028            proc,
10029            selection,
10030            graphql_client,
10031        }
10032    }
10033}
10034impl GitRef {
10035    /// The resolved commit id at this ref.
10036    pub async fn commit(&self) -> Result<String, DaggerError> {
10037        let query = self.selection.select("commit");
10038        query.execute(self.graphql_client.clone()).await
10039    }
10040    /// Find the best common ancestor between this ref and another ref.
10041    ///
10042    /// # Arguments
10043    ///
10044    /// * `other` - The other ref to compare against.
10045    pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
10046        let mut query = self.selection.select("commonAncestor");
10047        query = query.arg_lazy(
10048            "other",
10049            Box::new(move || {
10050                let other = other.clone();
10051                Box::pin(async move { other.into_id().await.unwrap().quote() })
10052            }),
10053        );
10054        GitRef {
10055            proc: self.proc.clone(),
10056            selection: query,
10057            graphql_client: self.graphql_client.clone(),
10058        }
10059    }
10060    /// A unique identifier for this GitRef.
10061    pub async fn id(&self) -> Result<Id, DaggerError> {
10062        let query = self.selection.select("id");
10063        query.execute(self.graphql_client.clone()).await
10064    }
10065    /// The resolved ref name at this ref.
10066    pub async fn r#ref(&self) -> Result<String, DaggerError> {
10067        let query = self.selection.select("ref");
10068        query.execute(self.graphql_client.clone()).await
10069    }
10070    /// The filesystem tree at this ref.
10071    ///
10072    /// # Arguments
10073    ///
10074    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10075    pub fn tree(&self) -> Directory {
10076        let query = self.selection.select("tree");
10077        Directory {
10078            proc: self.proc.clone(),
10079            selection: query,
10080            graphql_client: self.graphql_client.clone(),
10081        }
10082    }
10083    /// The filesystem tree at this ref.
10084    ///
10085    /// # Arguments
10086    ///
10087    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10088    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
10089        let mut query = self.selection.select("tree");
10090        if let Some(discard_git_dir) = opts.discard_git_dir {
10091            query = query.arg("discardGitDir", discard_git_dir);
10092        }
10093        if let Some(depth) = opts.depth {
10094            query = query.arg("depth", depth);
10095        }
10096        if let Some(include_tags) = opts.include_tags {
10097            query = query.arg("includeTags", include_tags);
10098        }
10099        Directory {
10100            proc: self.proc.clone(),
10101            selection: query,
10102            graphql_client: self.graphql_client.clone(),
10103        }
10104    }
10105}
10106impl Node for GitRef {
10107    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10108        let query = self.selection.select("id");
10109        let graphql_client = self.graphql_client.clone();
10110        async move { query.execute(graphql_client).await }
10111    }
10112}
10113#[derive(Clone)]
10114pub struct GitRepository {
10115    pub proc: Option<Arc<DaggerSessionProc>>,
10116    pub selection: Selection,
10117    pub graphql_client: DynGraphQLClient,
10118}
10119#[derive(Builder, Debug, PartialEq)]
10120pub struct GitRepositoryBranchesOpts<'a> {
10121    /// Glob patterns (e.g., "refs/tags/v*").
10122    #[builder(setter(into, strip_option), default)]
10123    pub patterns: Option<Vec<&'a str>>,
10124}
10125#[derive(Builder, Debug, PartialEq)]
10126pub struct GitRepositoryTagsOpts<'a> {
10127    /// Glob patterns (e.g., "refs/tags/v*").
10128    #[builder(setter(into, strip_option), default)]
10129    pub patterns: Option<Vec<&'a str>>,
10130}
10131impl IntoID<Id> for GitRepository {
10132    fn into_id(
10133        self,
10134    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10135        Box::pin(async move { self.id().await })
10136    }
10137}
10138impl Loadable for GitRepository {
10139    fn graphql_type() -> &'static str {
10140        "GitRepository"
10141    }
10142    fn from_query(
10143        proc: Option<Arc<DaggerSessionProc>>,
10144        selection: Selection,
10145        graphql_client: DynGraphQLClient,
10146    ) -> Self {
10147        Self {
10148            proc,
10149            selection,
10150            graphql_client,
10151        }
10152    }
10153}
10154impl GitRepository {
10155    /// Returns details of a branch.
10156    ///
10157    /// # Arguments
10158    ///
10159    /// * `name` - Branch's name (e.g., "main").
10160    pub fn branch(&self, name: impl Into<String>) -> GitRef {
10161        let mut query = self.selection.select("branch");
10162        query = query.arg("name", name.into());
10163        GitRef {
10164            proc: self.proc.clone(),
10165            selection: query,
10166            graphql_client: self.graphql_client.clone(),
10167        }
10168    }
10169    /// branches that match any of the given glob patterns.
10170    ///
10171    /// # Arguments
10172    ///
10173    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10174    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
10175        let query = self.selection.select("branches");
10176        query.execute(self.graphql_client.clone()).await
10177    }
10178    /// branches that match any of the given glob patterns.
10179    ///
10180    /// # Arguments
10181    ///
10182    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10183    pub async fn branches_opts<'a>(
10184        &self,
10185        opts: GitRepositoryBranchesOpts<'a>,
10186    ) -> Result<Vec<String>, DaggerError> {
10187        let mut query = self.selection.select("branches");
10188        if let Some(patterns) = opts.patterns {
10189            query = query.arg("patterns", patterns);
10190        }
10191        query.execute(self.graphql_client.clone()).await
10192    }
10193    /// Returns details of a commit.
10194    ///
10195    /// # Arguments
10196    ///
10197    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
10198    pub fn commit(&self, id: impl Into<String>) -> GitRef {
10199        let mut query = self.selection.select("commit");
10200        query = query.arg("id", id.into());
10201        GitRef {
10202            proc: self.proc.clone(),
10203            selection: query,
10204            graphql_client: self.graphql_client.clone(),
10205        }
10206    }
10207    /// Returns details for HEAD.
10208    pub fn head(&self) -> GitRef {
10209        let query = self.selection.select("head");
10210        GitRef {
10211            proc: self.proc.clone(),
10212            selection: query,
10213            graphql_client: self.graphql_client.clone(),
10214        }
10215    }
10216    /// A unique identifier for this GitRepository.
10217    pub async fn id(&self) -> Result<Id, DaggerError> {
10218        let query = self.selection.select("id");
10219        query.execute(self.graphql_client.clone()).await
10220    }
10221    /// Returns details for the latest semver tag.
10222    pub fn latest_version(&self) -> GitRef {
10223        let query = self.selection.select("latestVersion");
10224        GitRef {
10225            proc: self.proc.clone(),
10226            selection: query,
10227            graphql_client: self.graphql_client.clone(),
10228        }
10229    }
10230    /// Returns details of a ref.
10231    ///
10232    /// # Arguments
10233    ///
10234    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
10235    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
10236        let mut query = self.selection.select("ref");
10237        query = query.arg("name", name.into());
10238        GitRef {
10239            proc: self.proc.clone(),
10240            selection: query,
10241            graphql_client: self.graphql_client.clone(),
10242        }
10243    }
10244    /// Returns details of a tag.
10245    ///
10246    /// # Arguments
10247    ///
10248    /// * `name` - Tag's name (e.g., "v0.3.9").
10249    pub fn tag(&self, name: impl Into<String>) -> GitRef {
10250        let mut query = self.selection.select("tag");
10251        query = query.arg("name", name.into());
10252        GitRef {
10253            proc: self.proc.clone(),
10254            selection: query,
10255            graphql_client: self.graphql_client.clone(),
10256        }
10257    }
10258    /// tags that match any of the given glob patterns.
10259    ///
10260    /// # Arguments
10261    ///
10262    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10263    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
10264        let query = self.selection.select("tags");
10265        query.execute(self.graphql_client.clone()).await
10266    }
10267    /// tags that match any of the given glob patterns.
10268    ///
10269    /// # Arguments
10270    ///
10271    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10272    pub async fn tags_opts<'a>(
10273        &self,
10274        opts: GitRepositoryTagsOpts<'a>,
10275    ) -> Result<Vec<String>, DaggerError> {
10276        let mut query = self.selection.select("tags");
10277        if let Some(patterns) = opts.patterns {
10278            query = query.arg("patterns", patterns);
10279        }
10280        query.execute(self.graphql_client.clone()).await
10281    }
10282    /// Returns the changeset of uncommitted changes in the git repository.
10283    pub fn uncommitted(&self) -> Changeset {
10284        let query = self.selection.select("uncommitted");
10285        Changeset {
10286            proc: self.proc.clone(),
10287            selection: query,
10288            graphql_client: self.graphql_client.clone(),
10289        }
10290    }
10291    /// The URL of the git repository.
10292    pub async fn url(&self) -> Result<String, DaggerError> {
10293        let query = self.selection.select("url");
10294        query.execute(self.graphql_client.clone()).await
10295    }
10296}
10297impl Node for GitRepository {
10298    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10299        let query = self.selection.select("id");
10300        let graphql_client = self.graphql_client.clone();
10301        async move { query.execute(graphql_client).await }
10302    }
10303}
10304#[derive(Clone)]
10305pub struct HttpState {
10306    pub proc: Option<Arc<DaggerSessionProc>>,
10307    pub selection: Selection,
10308    pub graphql_client: DynGraphQLClient,
10309}
10310impl IntoID<Id> for HttpState {
10311    fn into_id(
10312        self,
10313    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10314        Box::pin(async move { self.id().await })
10315    }
10316}
10317impl Loadable for HttpState {
10318    fn graphql_type() -> &'static str {
10319        "HTTPState"
10320    }
10321    fn from_query(
10322        proc: Option<Arc<DaggerSessionProc>>,
10323        selection: Selection,
10324        graphql_client: DynGraphQLClient,
10325    ) -> Self {
10326        Self {
10327            proc,
10328            selection,
10329            graphql_client,
10330        }
10331    }
10332}
10333impl HttpState {
10334    /// A unique identifier for this HTTPState.
10335    pub async fn id(&self) -> Result<Id, DaggerError> {
10336        let query = self.selection.select("id");
10337        query.execute(self.graphql_client.clone()).await
10338    }
10339}
10340impl Node for HttpState {
10341    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10342        let query = self.selection.select("id");
10343        let graphql_client = self.graphql_client.clone();
10344        async move { query.execute(graphql_client).await }
10345    }
10346}
10347#[derive(Clone)]
10348pub struct HealthcheckConfig {
10349    pub proc: Option<Arc<DaggerSessionProc>>,
10350    pub selection: Selection,
10351    pub graphql_client: DynGraphQLClient,
10352}
10353impl IntoID<Id> for HealthcheckConfig {
10354    fn into_id(
10355        self,
10356    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10357        Box::pin(async move { self.id().await })
10358    }
10359}
10360impl Loadable for HealthcheckConfig {
10361    fn graphql_type() -> &'static str {
10362        "HealthcheckConfig"
10363    }
10364    fn from_query(
10365        proc: Option<Arc<DaggerSessionProc>>,
10366        selection: Selection,
10367        graphql_client: DynGraphQLClient,
10368    ) -> Self {
10369        Self {
10370            proc,
10371            selection,
10372            graphql_client,
10373        }
10374    }
10375}
10376impl HealthcheckConfig {
10377    /// Healthcheck command arguments.
10378    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
10379        let query = self.selection.select("args");
10380        query.execute(self.graphql_client.clone()).await
10381    }
10382    /// A unique identifier for this HealthcheckConfig.
10383    pub async fn id(&self) -> Result<Id, DaggerError> {
10384        let query = self.selection.select("id");
10385        query.execute(self.graphql_client.clone()).await
10386    }
10387    /// Interval between running healthcheck. Example:30s
10388    pub async fn interval(&self) -> Result<String, DaggerError> {
10389        let query = self.selection.select("interval");
10390        query.execute(self.graphql_client.clone()).await
10391    }
10392    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example:3
10393    pub async fn retries(&self) -> Result<isize, DaggerError> {
10394        let query = self.selection.select("retries");
10395        query.execute(self.graphql_client.clone()).await
10396    }
10397    /// Healthcheck command is a shell command.
10398    pub async fn shell(&self) -> Result<bool, DaggerError> {
10399        let query = self.selection.select("shell");
10400        query.execute(self.graphql_client.clone()).await
10401    }
10402    /// StartInterval configures the duration between checks during the startup phase. Example:5s
10403    pub async fn start_interval(&self) -> Result<String, DaggerError> {
10404        let query = self.selection.select("startInterval");
10405        query.execute(self.graphql_client.clone()).await
10406    }
10407    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example:0s
10408    pub async fn start_period(&self) -> Result<String, DaggerError> {
10409        let query = self.selection.select("startPeriod");
10410        query.execute(self.graphql_client.clone()).await
10411    }
10412    /// Healthcheck timeout. Example:3s
10413    pub async fn timeout(&self) -> Result<String, DaggerError> {
10414        let query = self.selection.select("timeout");
10415        query.execute(self.graphql_client.clone()).await
10416    }
10417}
10418impl Node for HealthcheckConfig {
10419    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10420        let query = self.selection.select("id");
10421        let graphql_client = self.graphql_client.clone();
10422        async move { query.execute(graphql_client).await }
10423    }
10424}
10425#[derive(Clone)]
10426pub struct Host {
10427    pub proc: Option<Arc<DaggerSessionProc>>,
10428    pub selection: Selection,
10429    pub graphql_client: DynGraphQLClient,
10430}
10431#[derive(Builder, Debug, PartialEq)]
10432pub struct HostDirectoryOpts<'a> {
10433    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
10434    #[builder(setter(into, strip_option), default)]
10435    pub exclude: Option<Vec<&'a str>>,
10436    /// Apply .gitignore filter rules inside the directory
10437    #[builder(setter(into, strip_option), default)]
10438    pub gitignore: Option<bool>,
10439    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
10440    #[builder(setter(into, strip_option), default)]
10441    pub include: Option<Vec<&'a str>>,
10442    /// If true, the directory will always be reloaded from the host.
10443    #[builder(setter(into, strip_option), default)]
10444    pub no_cache: Option<bool>,
10445}
10446#[derive(Builder, Debug, PartialEq)]
10447pub struct HostFileOpts {
10448    /// If true, the file will always be reloaded from the host.
10449    #[builder(setter(into, strip_option), default)]
10450    pub no_cache: Option<bool>,
10451}
10452#[derive(Builder, Debug, PartialEq)]
10453pub struct HostFindUpOpts {
10454    #[builder(setter(into, strip_option), default)]
10455    pub no_cache: Option<bool>,
10456}
10457#[derive(Builder, Debug, PartialEq)]
10458pub struct HostServiceOpts<'a> {
10459    /// Upstream host to forward traffic to.
10460    #[builder(setter(into, strip_option), default)]
10461    pub host: Option<&'a str>,
10462}
10463#[derive(Builder, Debug, PartialEq)]
10464pub struct HostTunnelOpts {
10465    /// Map each service port to the same port on the host, as if the service were running natively.
10466    /// Note: enabling may result in port conflicts.
10467    #[builder(setter(into, strip_option), default)]
10468    pub native: Option<bool>,
10469    /// Configure explicit port forwarding rules for the tunnel.
10470    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
10471    /// 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.
10472    /// If ports are given and native is true, the ports are additive.
10473    #[builder(setter(into, strip_option), default)]
10474    pub ports: Option<Vec<PortForward>>,
10475}
10476impl IntoID<Id> for Host {
10477    fn into_id(
10478        self,
10479    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10480        Box::pin(async move { self.id().await })
10481    }
10482}
10483impl Loadable for Host {
10484    fn graphql_type() -> &'static str {
10485        "Host"
10486    }
10487    fn from_query(
10488        proc: Option<Arc<DaggerSessionProc>>,
10489        selection: Selection,
10490        graphql_client: DynGraphQLClient,
10491    ) -> Self {
10492        Self {
10493            proc,
10494            selection,
10495            graphql_client,
10496        }
10497    }
10498}
10499impl Host {
10500    /// Accesses a container image on the host.
10501    ///
10502    /// # Arguments
10503    ///
10504    /// * `name` - Name of the image to access.
10505    pub fn container_image(&self, name: impl Into<String>) -> Container {
10506        let mut query = self.selection.select("containerImage");
10507        query = query.arg("name", name.into());
10508        Container {
10509            proc: self.proc.clone(),
10510            selection: query,
10511            graphql_client: self.graphql_client.clone(),
10512        }
10513    }
10514    /// Accesses a directory on the host.
10515    ///
10516    /// # Arguments
10517    ///
10518    /// * `path` - Location of the directory to access (e.g., ".").
10519    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10520    pub fn directory(&self, path: impl Into<String>) -> Directory {
10521        let mut query = self.selection.select("directory");
10522        query = query.arg("path", path.into());
10523        Directory {
10524            proc: self.proc.clone(),
10525            selection: query,
10526            graphql_client: self.graphql_client.clone(),
10527        }
10528    }
10529    /// Accesses a directory on the host.
10530    ///
10531    /// # Arguments
10532    ///
10533    /// * `path` - Location of the directory to access (e.g., ".").
10534    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10535    pub fn directory_opts<'a>(
10536        &self,
10537        path: impl Into<String>,
10538        opts: HostDirectoryOpts<'a>,
10539    ) -> Directory {
10540        let mut query = self.selection.select("directory");
10541        query = query.arg("path", path.into());
10542        if let Some(exclude) = opts.exclude {
10543            query = query.arg("exclude", exclude);
10544        }
10545        if let Some(include) = opts.include {
10546            query = query.arg("include", include);
10547        }
10548        if let Some(no_cache) = opts.no_cache {
10549            query = query.arg("noCache", no_cache);
10550        }
10551        if let Some(gitignore) = opts.gitignore {
10552            query = query.arg("gitignore", gitignore);
10553        }
10554        Directory {
10555            proc: self.proc.clone(),
10556            selection: query,
10557            graphql_client: self.graphql_client.clone(),
10558        }
10559    }
10560    /// Accesses a file on the host.
10561    ///
10562    /// # Arguments
10563    ///
10564    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10565    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10566    pub fn file(&self, path: impl Into<String>) -> File {
10567        let mut query = self.selection.select("file");
10568        query = query.arg("path", path.into());
10569        File {
10570            proc: self.proc.clone(),
10571            selection: query,
10572            graphql_client: self.graphql_client.clone(),
10573        }
10574    }
10575    /// Accesses a file on the host.
10576    ///
10577    /// # Arguments
10578    ///
10579    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10580    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10581    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
10582        let mut query = self.selection.select("file");
10583        query = query.arg("path", path.into());
10584        if let Some(no_cache) = opts.no_cache {
10585            query = query.arg("noCache", no_cache);
10586        }
10587        File {
10588            proc: self.proc.clone(),
10589            selection: query,
10590            graphql_client: self.graphql_client.clone(),
10591        }
10592    }
10593    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10594    ///
10595    /// # Arguments
10596    ///
10597    /// * `name` - name of the file or directory to search for
10598    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10599    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
10600        let mut query = self.selection.select("findUp");
10601        query = query.arg("name", name.into());
10602        query.execute(self.graphql_client.clone()).await
10603    }
10604    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10605    ///
10606    /// # Arguments
10607    ///
10608    /// * `name` - name of the file or directory to search for
10609    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10610    pub async fn find_up_opts(
10611        &self,
10612        name: impl Into<String>,
10613        opts: HostFindUpOpts,
10614    ) -> Result<String, DaggerError> {
10615        let mut query = self.selection.select("findUp");
10616        query = query.arg("name", name.into());
10617        if let Some(no_cache) = opts.no_cache {
10618            query = query.arg("noCache", no_cache);
10619        }
10620        query.execute(self.graphql_client.clone()).await
10621    }
10622    /// A unique identifier for this Host.
10623    pub async fn id(&self) -> Result<Id, DaggerError> {
10624        let query = self.selection.select("id");
10625        query.execute(self.graphql_client.clone()).await
10626    }
10627    /// Creates a service that forwards traffic to a specified address via the host.
10628    ///
10629    /// # Arguments
10630    ///
10631    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10632    ///
10633    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10634    ///
10635    /// An empty set of ports is not valid; an error will be returned.
10636    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10637    pub fn service(&self, ports: Vec<PortForward>) -> Service {
10638        let mut query = self.selection.select("service");
10639        query = query.arg("ports", ports);
10640        Service {
10641            proc: self.proc.clone(),
10642            selection: query,
10643            graphql_client: self.graphql_client.clone(),
10644        }
10645    }
10646    /// Creates a service that forwards traffic to a specified address via the host.
10647    ///
10648    /// # Arguments
10649    ///
10650    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10651    ///
10652    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10653    ///
10654    /// An empty set of ports is not valid; an error will be returned.
10655    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10656    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
10657        let mut query = self.selection.select("service");
10658        query = query.arg("ports", ports);
10659        if let Some(host) = opts.host {
10660            query = query.arg("host", host);
10661        }
10662        Service {
10663            proc: self.proc.clone(),
10664            selection: query,
10665            graphql_client: self.graphql_client.clone(),
10666        }
10667    }
10668    /// Creates a tunnel that forwards traffic from the host to a service.
10669    ///
10670    /// # Arguments
10671    ///
10672    /// * `service` - Service to send traffic from the tunnel.
10673    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10674    pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
10675        let mut query = self.selection.select("tunnel");
10676        query = query.arg_lazy(
10677            "service",
10678            Box::new(move || {
10679                let service = service.clone();
10680                Box::pin(async move { service.into_id().await.unwrap().quote() })
10681            }),
10682        );
10683        Service {
10684            proc: self.proc.clone(),
10685            selection: query,
10686            graphql_client: self.graphql_client.clone(),
10687        }
10688    }
10689    /// Creates a tunnel that forwards traffic from the host to a service.
10690    ///
10691    /// # Arguments
10692    ///
10693    /// * `service` - Service to send traffic from the tunnel.
10694    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10695    pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
10696        let mut query = self.selection.select("tunnel");
10697        query = query.arg_lazy(
10698            "service",
10699            Box::new(move || {
10700                let service = service.clone();
10701                Box::pin(async move { service.into_id().await.unwrap().quote() })
10702            }),
10703        );
10704        if let Some(native) = opts.native {
10705            query = query.arg("native", native);
10706        }
10707        if let Some(ports) = opts.ports {
10708            query = query.arg("ports", ports);
10709        }
10710        Service {
10711            proc: self.proc.clone(),
10712            selection: query,
10713            graphql_client: self.graphql_client.clone(),
10714        }
10715    }
10716    /// Accesses a Unix socket on the host.
10717    ///
10718    /// # Arguments
10719    ///
10720    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
10721    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
10722        let mut query = self.selection.select("unixSocket");
10723        query = query.arg("path", path.into());
10724        Socket {
10725            proc: self.proc.clone(),
10726            selection: query,
10727            graphql_client: self.graphql_client.clone(),
10728        }
10729    }
10730}
10731impl Node for Host {
10732    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10733        let query = self.selection.select("id");
10734        let graphql_client = self.graphql_client.clone();
10735        async move { query.execute(graphql_client).await }
10736    }
10737}
10738#[derive(Clone)]
10739pub struct InputTypeDef {
10740    pub proc: Option<Arc<DaggerSessionProc>>,
10741    pub selection: Selection,
10742    pub graphql_client: DynGraphQLClient,
10743}
10744impl IntoID<Id> for InputTypeDef {
10745    fn into_id(
10746        self,
10747    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10748        Box::pin(async move { self.id().await })
10749    }
10750}
10751impl Loadable for InputTypeDef {
10752    fn graphql_type() -> &'static str {
10753        "InputTypeDef"
10754    }
10755    fn from_query(
10756        proc: Option<Arc<DaggerSessionProc>>,
10757        selection: Selection,
10758        graphql_client: DynGraphQLClient,
10759    ) -> Self {
10760        Self {
10761            proc,
10762            selection,
10763            graphql_client,
10764        }
10765    }
10766}
10767impl InputTypeDef {
10768    /// Static fields defined on this input object, if any.
10769    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
10770        let query = self.selection.select("fields");
10771        let query = query.select("id");
10772        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10773        Ok(ids
10774            .into_iter()
10775            .map(|id| FieldTypeDef {
10776                proc: self.proc.clone(),
10777                selection: crate::querybuilder::query()
10778                    .select("node")
10779                    .arg("id", &id.0)
10780                    .inline_fragment("FieldTypeDef"),
10781                graphql_client: self.graphql_client.clone(),
10782            })
10783            .collect())
10784    }
10785    /// A unique identifier for this InputTypeDef.
10786    pub async fn id(&self) -> Result<Id, DaggerError> {
10787        let query = self.selection.select("id");
10788        query.execute(self.graphql_client.clone()).await
10789    }
10790    /// The name of the input object.
10791    pub async fn name(&self) -> Result<String, DaggerError> {
10792        let query = self.selection.select("name");
10793        query.execute(self.graphql_client.clone()).await
10794    }
10795}
10796impl Node for InputTypeDef {
10797    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10798        let query = self.selection.select("id");
10799        let graphql_client = self.graphql_client.clone();
10800        async move { query.execute(graphql_client).await }
10801    }
10802}
10803#[derive(Clone)]
10804pub struct InterfaceTypeDef {
10805    pub proc: Option<Arc<DaggerSessionProc>>,
10806    pub selection: Selection,
10807    pub graphql_client: DynGraphQLClient,
10808}
10809impl IntoID<Id> for InterfaceTypeDef {
10810    fn into_id(
10811        self,
10812    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10813        Box::pin(async move { self.id().await })
10814    }
10815}
10816impl Loadable for InterfaceTypeDef {
10817    fn graphql_type() -> &'static str {
10818        "InterfaceTypeDef"
10819    }
10820    fn from_query(
10821        proc: Option<Arc<DaggerSessionProc>>,
10822        selection: Selection,
10823        graphql_client: DynGraphQLClient,
10824    ) -> Self {
10825        Self {
10826            proc,
10827            selection,
10828            graphql_client,
10829        }
10830    }
10831}
10832impl InterfaceTypeDef {
10833    /// The doc string for the interface, if any.
10834    pub async fn description(&self) -> Result<String, DaggerError> {
10835        let query = self.selection.select("description");
10836        query.execute(self.graphql_client.clone()).await
10837    }
10838    /// Functions defined on this interface, if any.
10839    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
10840        let query = self.selection.select("functions");
10841        let query = query.select("id");
10842        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10843        Ok(ids
10844            .into_iter()
10845            .map(|id| Function {
10846                proc: self.proc.clone(),
10847                selection: crate::querybuilder::query()
10848                    .select("node")
10849                    .arg("id", &id.0)
10850                    .inline_fragment("Function"),
10851                graphql_client: self.graphql_client.clone(),
10852            })
10853            .collect())
10854    }
10855    /// A unique identifier for this InterfaceTypeDef.
10856    pub async fn id(&self) -> Result<Id, DaggerError> {
10857        let query = self.selection.select("id");
10858        query.execute(self.graphql_client.clone()).await
10859    }
10860    /// The name of the interface.
10861    pub async fn name(&self) -> Result<String, DaggerError> {
10862        let query = self.selection.select("name");
10863        query.execute(self.graphql_client.clone()).await
10864    }
10865    /// The location of this interface declaration.
10866    pub fn source_map(&self) -> SourceMap {
10867        let query = self.selection.select("sourceMap");
10868        SourceMap {
10869            proc: self.proc.clone(),
10870            selection: query,
10871            graphql_client: self.graphql_client.clone(),
10872        }
10873    }
10874    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
10875    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10876        let query = self.selection.select("sourceModuleName");
10877        query.execute(self.graphql_client.clone()).await
10878    }
10879}
10880impl Node for InterfaceTypeDef {
10881    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10882        let query = self.selection.select("id");
10883        let graphql_client = self.graphql_client.clone();
10884        async move { query.execute(graphql_client).await }
10885    }
10886}
10887#[derive(Clone)]
10888pub struct JsonValue {
10889    pub proc: Option<Arc<DaggerSessionProc>>,
10890    pub selection: Selection,
10891    pub graphql_client: DynGraphQLClient,
10892}
10893#[derive(Builder, Debug, PartialEq)]
10894pub struct JsonValueContentsOpts<'a> {
10895    /// Optional line prefix
10896    #[builder(setter(into, strip_option), default)]
10897    pub indent: Option<&'a str>,
10898    /// Pretty-print
10899    #[builder(setter(into, strip_option), default)]
10900    pub pretty: Option<bool>,
10901}
10902impl IntoID<Id> for JsonValue {
10903    fn into_id(
10904        self,
10905    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10906        Box::pin(async move { self.id().await })
10907    }
10908}
10909impl Loadable for JsonValue {
10910    fn graphql_type() -> &'static str {
10911        "JSONValue"
10912    }
10913    fn from_query(
10914        proc: Option<Arc<DaggerSessionProc>>,
10915        selection: Selection,
10916        graphql_client: DynGraphQLClient,
10917    ) -> Self {
10918        Self {
10919            proc,
10920            selection,
10921            graphql_client,
10922        }
10923    }
10924}
10925impl JsonValue {
10926    /// Decode an array from json
10927    pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
10928        let query = self.selection.select("asArray");
10929        let query = query.select("id");
10930        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10931        Ok(ids
10932            .into_iter()
10933            .map(|id| JsonValue {
10934                proc: self.proc.clone(),
10935                selection: crate::querybuilder::query()
10936                    .select("node")
10937                    .arg("id", &id.0)
10938                    .inline_fragment("JSONValue"),
10939                graphql_client: self.graphql_client.clone(),
10940            })
10941            .collect())
10942    }
10943    /// Decode a boolean from json
10944    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10945        let query = self.selection.select("asBoolean");
10946        query.execute(self.graphql_client.clone()).await
10947    }
10948    /// Decode an integer from json
10949    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10950        let query = self.selection.select("asInteger");
10951        query.execute(self.graphql_client.clone()).await
10952    }
10953    /// Decode a string from json
10954    pub async fn as_string(&self) -> Result<String, DaggerError> {
10955        let query = self.selection.select("asString");
10956        query.execute(self.graphql_client.clone()).await
10957    }
10958    /// Return the value encoded as json
10959    ///
10960    /// # Arguments
10961    ///
10962    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10963    pub async fn contents(&self) -> Result<Json, DaggerError> {
10964        let query = self.selection.select("contents");
10965        query.execute(self.graphql_client.clone()).await
10966    }
10967    /// Return the value encoded as json
10968    ///
10969    /// # Arguments
10970    ///
10971    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10972    pub async fn contents_opts<'a>(
10973        &self,
10974        opts: JsonValueContentsOpts<'a>,
10975    ) -> Result<Json, DaggerError> {
10976        let mut query = self.selection.select("contents");
10977        if let Some(pretty) = opts.pretty {
10978            query = query.arg("pretty", pretty);
10979        }
10980        if let Some(indent) = opts.indent {
10981            query = query.arg("indent", indent);
10982        }
10983        query.execute(self.graphql_client.clone()).await
10984    }
10985    /// Lookup the field at the given path, and return its value.
10986    ///
10987    /// # Arguments
10988    ///
10989    /// * `path` - Path of the field to lookup, encoded as an array of field names
10990    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
10991        let mut query = self.selection.select("field");
10992        query = query.arg(
10993            "path",
10994            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10995        );
10996        JsonValue {
10997            proc: self.proc.clone(),
10998            selection: query,
10999            graphql_client: self.graphql_client.clone(),
11000        }
11001    }
11002    /// List fields of the encoded object
11003    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
11004        let query = self.selection.select("fields");
11005        query.execute(self.graphql_client.clone()).await
11006    }
11007    /// A unique identifier for this JSONValue.
11008    pub async fn id(&self) -> Result<Id, DaggerError> {
11009        let query = self.selection.select("id");
11010        query.execute(self.graphql_client.clone()).await
11011    }
11012    /// Encode a boolean to json
11013    ///
11014    /// # Arguments
11015    ///
11016    /// * `value` - New boolean value
11017    pub fn new_boolean(&self, value: bool) -> JsonValue {
11018        let mut query = self.selection.select("newBoolean");
11019        query = query.arg("value", value);
11020        JsonValue {
11021            proc: self.proc.clone(),
11022            selection: query,
11023            graphql_client: self.graphql_client.clone(),
11024        }
11025    }
11026    /// Encode an integer to json
11027    ///
11028    /// # Arguments
11029    ///
11030    /// * `value` - New integer value
11031    pub fn new_integer(&self, value: isize) -> JsonValue {
11032        let mut query = self.selection.select("newInteger");
11033        query = query.arg("value", value);
11034        JsonValue {
11035            proc: self.proc.clone(),
11036            selection: query,
11037            graphql_client: self.graphql_client.clone(),
11038        }
11039    }
11040    /// Encode a string to json
11041    ///
11042    /// # Arguments
11043    ///
11044    /// * `value` - New string value
11045    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
11046        let mut query = self.selection.select("newString");
11047        query = query.arg("value", value.into());
11048        JsonValue {
11049            proc: self.proc.clone(),
11050            selection: query,
11051            graphql_client: self.graphql_client.clone(),
11052        }
11053    }
11054    /// Return a new json value, decoded from the given content
11055    ///
11056    /// # Arguments
11057    ///
11058    /// * `contents` - New JSON-encoded contents
11059    pub fn with_contents(&self, contents: Json) -> JsonValue {
11060        let mut query = self.selection.select("withContents");
11061        query = query.arg("contents", contents);
11062        JsonValue {
11063            proc: self.proc.clone(),
11064            selection: query,
11065            graphql_client: self.graphql_client.clone(),
11066        }
11067    }
11068    /// Set a new field at the given path
11069    ///
11070    /// # Arguments
11071    ///
11072    /// * `path` - Path of the field to set, encoded as an array of field names
11073    /// * `value` - The new value of the field
11074    pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
11075        let mut query = self.selection.select("withField");
11076        query = query.arg(
11077            "path",
11078            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11079        );
11080        query = query.arg_lazy(
11081            "value",
11082            Box::new(move || {
11083                let value = value.clone();
11084                Box::pin(async move { value.into_id().await.unwrap().quote() })
11085            }),
11086        );
11087        JsonValue {
11088            proc: self.proc.clone(),
11089            selection: query,
11090            graphql_client: self.graphql_client.clone(),
11091        }
11092    }
11093}
11094impl Node for JsonValue {
11095    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11096        let query = self.selection.select("id");
11097        let graphql_client = self.graphql_client.clone();
11098        async move { query.execute(graphql_client).await }
11099    }
11100}
11101#[derive(Clone)]
11102pub struct Llm {
11103    pub proc: Option<Arc<DaggerSessionProc>>,
11104    pub selection: Selection,
11105    pub graphql_client: DynGraphQLClient,
11106}
11107impl IntoID<Id> for Llm {
11108    fn into_id(
11109        self,
11110    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11111        Box::pin(async move { self.id().await })
11112    }
11113}
11114impl Loadable for Llm {
11115    fn graphql_type() -> &'static str {
11116        "LLM"
11117    }
11118    fn from_query(
11119        proc: Option<Arc<DaggerSessionProc>>,
11120        selection: Selection,
11121        graphql_client: DynGraphQLClient,
11122    ) -> Self {
11123        Self {
11124            proc,
11125            selection,
11126            graphql_client,
11127        }
11128    }
11129}
11130impl Llm {
11131    /// create a branch in the LLM's history
11132    pub fn attempt(&self, number: isize) -> Llm {
11133        let mut query = self.selection.select("attempt");
11134        query = query.arg("number", number);
11135        Llm {
11136            proc: self.proc.clone(),
11137            selection: query,
11138            graphql_client: self.graphql_client.clone(),
11139        }
11140    }
11141    /// returns the type of the current state
11142    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
11143        let mut query = self.selection.select("bindResult");
11144        query = query.arg("name", name.into());
11145        Binding {
11146            proc: self.proc.clone(),
11147            selection: query,
11148            graphql_client: self.graphql_client.clone(),
11149        }
11150    }
11151    /// return the LLM's current environment
11152    pub fn env(&self) -> Env {
11153        let query = self.selection.select("env");
11154        Env {
11155            proc: self.proc.clone(),
11156            selection: query,
11157            graphql_client: self.graphql_client.clone(),
11158        }
11159    }
11160    /// Indicates whether there are any queued prompts or tool results to send to the model
11161    pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
11162        let query = self.selection.select("hasPrompt");
11163        query.execute(self.graphql_client.clone()).await
11164    }
11165    /// return the llm message history
11166    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
11167        let query = self.selection.select("history");
11168        query.execute(self.graphql_client.clone()).await
11169    }
11170    /// return the raw llm message history as json
11171    pub async fn history_json(&self) -> Result<Json, DaggerError> {
11172        let query = self.selection.select("historyJSON");
11173        query.execute(self.graphql_client.clone()).await
11174    }
11175    /// A unique identifier for this LLM.
11176    pub async fn id(&self) -> Result<Id, DaggerError> {
11177        let query = self.selection.select("id");
11178        query.execute(self.graphql_client.clone()).await
11179    }
11180    /// return the last llm reply from the history
11181    pub async fn last_reply(&self) -> Result<String, DaggerError> {
11182        let query = self.selection.select("lastReply");
11183        query.execute(self.graphql_client.clone()).await
11184    }
11185    /// Submit the queued prompt, evaluate any tool calls, queue their results, and keep going until the model ends its turn
11186    pub fn r#loop(&self) -> Llm {
11187        let query = self.selection.select("loop");
11188        Llm {
11189            proc: self.proc.clone(),
11190            selection: query,
11191            graphql_client: self.graphql_client.clone(),
11192        }
11193    }
11194    /// return the model used by the llm
11195    pub async fn model(&self) -> Result<String, DaggerError> {
11196        let query = self.selection.select("model");
11197        query.execute(self.graphql_client.clone()).await
11198    }
11199    /// return the provider used by the llm
11200    pub async fn provider(&self) -> Result<String, DaggerError> {
11201        let query = self.selection.select("provider");
11202        query.execute(self.graphql_client.clone()).await
11203    }
11204    /// Submit the queued prompt or tool call results, evaluate any tool calls, and queue their results
11205    pub async fn step(&self) -> Result<Llm, DaggerError> {
11206        let query = self.selection.select("step");
11207        let id: Id = query.execute(self.graphql_client.clone()).await?;
11208        Ok(Llm {
11209            proc: self.proc.clone(),
11210            selection: query
11211                .root()
11212                .select("node")
11213                .arg("id", &id.0)
11214                .inline_fragment("LLM"),
11215            graphql_client: self.graphql_client.clone(),
11216        })
11217    }
11218    /// synchronize LLM state
11219    pub async fn sync(&self) -> Result<Llm, DaggerError> {
11220        let query = self.selection.select("sync");
11221        let id: Id = query.execute(self.graphql_client.clone()).await?;
11222        Ok(Llm {
11223            proc: self.proc.clone(),
11224            selection: query
11225                .root()
11226                .select("node")
11227                .arg("id", &id.0)
11228                .inline_fragment("LLM"),
11229            graphql_client: self.graphql_client.clone(),
11230        })
11231    }
11232    /// returns the token usage of the current state
11233    pub fn token_usage(&self) -> LlmTokenUsage {
11234        let query = self.selection.select("tokenUsage");
11235        LlmTokenUsage {
11236            proc: self.proc.clone(),
11237            selection: query,
11238            graphql_client: self.graphql_client.clone(),
11239        }
11240    }
11241    /// print documentation for available tools
11242    pub async fn tools(&self) -> Result<String, DaggerError> {
11243        let query = self.selection.select("tools");
11244        query.execute(self.graphql_client.clone()).await
11245    }
11246    /// Return a new LLM with the specified function no longer exposed as a tool
11247    ///
11248    /// # Arguments
11249    ///
11250    /// * `type_name` - The type name whose function will be blocked
11251    /// * `function` - The function to block
11252    ///
11253    /// Will be converted to lowerCamelCase if necessary.
11254    pub fn with_blocked_function(
11255        &self,
11256        type_name: impl Into<String>,
11257        function: impl Into<String>,
11258    ) -> Llm {
11259        let mut query = self.selection.select("withBlockedFunction");
11260        query = query.arg("typeName", type_name.into());
11261        query = query.arg("function", function.into());
11262        Llm {
11263            proc: self.proc.clone(),
11264            selection: query,
11265            graphql_client: self.graphql_client.clone(),
11266        }
11267    }
11268    /// allow the LLM to interact with an environment via MCP
11269    pub fn with_env(&self, env: impl IntoID<Id>) -> Llm {
11270        let mut query = self.selection.select("withEnv");
11271        query = query.arg_lazy(
11272            "env",
11273            Box::new(move || {
11274                let env = env.clone();
11275                Box::pin(async move { env.into_id().await.unwrap().quote() })
11276            }),
11277        );
11278        Llm {
11279            proc: self.proc.clone(),
11280            selection: query,
11281            graphql_client: self.graphql_client.clone(),
11282        }
11283    }
11284    /// Add an external MCP server to the LLM
11285    ///
11286    /// # Arguments
11287    ///
11288    /// * `name` - The name of the MCP server
11289    /// * `service` - The MCP service to run and communicate with over stdio
11290    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
11291        let mut query = self.selection.select("withMCPServer");
11292        query = query.arg("name", name.into());
11293        query = query.arg_lazy(
11294            "service",
11295            Box::new(move || {
11296                let service = service.clone();
11297                Box::pin(async move { service.into_id().await.unwrap().quote() })
11298            }),
11299        );
11300        Llm {
11301            proc: self.proc.clone(),
11302            selection: query,
11303            graphql_client: self.graphql_client.clone(),
11304        }
11305    }
11306    /// swap out the llm model
11307    ///
11308    /// # Arguments
11309    ///
11310    /// * `model` - The model to use
11311    pub fn with_model(&self, model: impl Into<String>) -> Llm {
11312        let mut query = self.selection.select("withModel");
11313        query = query.arg("model", model.into());
11314        Llm {
11315            proc: self.proc.clone(),
11316            selection: query,
11317            graphql_client: self.graphql_client.clone(),
11318        }
11319    }
11320    /// append a prompt to the llm context
11321    ///
11322    /// # Arguments
11323    ///
11324    /// * `prompt` - The prompt to send
11325    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
11326        let mut query = self.selection.select("withPrompt");
11327        query = query.arg("prompt", prompt.into());
11328        Llm {
11329            proc: self.proc.clone(),
11330            selection: query,
11331            graphql_client: self.graphql_client.clone(),
11332        }
11333    }
11334    /// append the contents of a file to the llm context
11335    ///
11336    /// # Arguments
11337    ///
11338    /// * `file` - The file to read the prompt from
11339    pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
11340        let mut query = self.selection.select("withPromptFile");
11341        query = query.arg_lazy(
11342            "file",
11343            Box::new(move || {
11344                let file = file.clone();
11345                Box::pin(async move { file.into_id().await.unwrap().quote() })
11346            }),
11347        );
11348        Llm {
11349            proc: self.proc.clone(),
11350            selection: query,
11351            graphql_client: self.graphql_client.clone(),
11352        }
11353    }
11354    /// Use a static set of tools for method calls, e.g. for MCP clients that do not support dynamic tool registration
11355    pub fn with_static_tools(&self) -> Llm {
11356        let query = self.selection.select("withStaticTools");
11357        Llm {
11358            proc: self.proc.clone(),
11359            selection: query,
11360            graphql_client: self.graphql_client.clone(),
11361        }
11362    }
11363    /// Add a system prompt to the LLM's environment
11364    ///
11365    /// # Arguments
11366    ///
11367    /// * `prompt` - The system prompt to send
11368    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
11369        let mut query = self.selection.select("withSystemPrompt");
11370        query = query.arg("prompt", prompt.into());
11371        Llm {
11372            proc: self.proc.clone(),
11373            selection: query,
11374            graphql_client: self.graphql_client.clone(),
11375        }
11376    }
11377    /// Disable the default system prompt
11378    pub fn without_default_system_prompt(&self) -> Llm {
11379        let query = self.selection.select("withoutDefaultSystemPrompt");
11380        Llm {
11381            proc: self.proc.clone(),
11382            selection: query,
11383            graphql_client: self.graphql_client.clone(),
11384        }
11385    }
11386    /// Clear the message history, leaving only the system prompts
11387    pub fn without_message_history(&self) -> Llm {
11388        let query = self.selection.select("withoutMessageHistory");
11389        Llm {
11390            proc: self.proc.clone(),
11391            selection: query,
11392            graphql_client: self.graphql_client.clone(),
11393        }
11394    }
11395    /// Clear the system prompts, leaving only the default system prompt
11396    pub fn without_system_prompts(&self) -> Llm {
11397        let query = self.selection.select("withoutSystemPrompts");
11398        Llm {
11399            proc: self.proc.clone(),
11400            selection: query,
11401            graphql_client: self.graphql_client.clone(),
11402        }
11403    }
11404}
11405impl Node for Llm {
11406    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11407        let query = self.selection.select("id");
11408        let graphql_client = self.graphql_client.clone();
11409        async move { query.execute(graphql_client).await }
11410    }
11411}
11412impl Syncer for Llm {
11413    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11414        let query = self.selection.select("id");
11415        let graphql_client = self.graphql_client.clone();
11416        async move { query.execute(graphql_client).await }
11417    }
11418    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11419        let query = self.selection.select("sync");
11420        let graphql_client = self.graphql_client.clone();
11421        async move { query.execute(graphql_client).await }
11422    }
11423}
11424#[derive(Clone)]
11425pub struct LlmTokenUsage {
11426    pub proc: Option<Arc<DaggerSessionProc>>,
11427    pub selection: Selection,
11428    pub graphql_client: DynGraphQLClient,
11429}
11430impl IntoID<Id> for LlmTokenUsage {
11431    fn into_id(
11432        self,
11433    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11434        Box::pin(async move { self.id().await })
11435    }
11436}
11437impl Loadable for LlmTokenUsage {
11438    fn graphql_type() -> &'static str {
11439        "LLMTokenUsage"
11440    }
11441    fn from_query(
11442        proc: Option<Arc<DaggerSessionProc>>,
11443        selection: Selection,
11444        graphql_client: DynGraphQLClient,
11445    ) -> Self {
11446        Self {
11447            proc,
11448            selection,
11449            graphql_client,
11450        }
11451    }
11452}
11453impl LlmTokenUsage {
11454    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
11455        let query = self.selection.select("cachedTokenReads");
11456        query.execute(self.graphql_client.clone()).await
11457    }
11458    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
11459        let query = self.selection.select("cachedTokenWrites");
11460        query.execute(self.graphql_client.clone()).await
11461    }
11462    /// A unique identifier for this LLMTokenUsage.
11463    pub async fn id(&self) -> Result<Id, DaggerError> {
11464        let query = self.selection.select("id");
11465        query.execute(self.graphql_client.clone()).await
11466    }
11467    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
11468        let query = self.selection.select("inputTokens");
11469        query.execute(self.graphql_client.clone()).await
11470    }
11471    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
11472        let query = self.selection.select("outputTokens");
11473        query.execute(self.graphql_client.clone()).await
11474    }
11475    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
11476        let query = self.selection.select("totalTokens");
11477        query.execute(self.graphql_client.clone()).await
11478    }
11479}
11480impl Node for LlmTokenUsage {
11481    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11482        let query = self.selection.select("id");
11483        let graphql_client = self.graphql_client.clone();
11484        async move { query.execute(graphql_client).await }
11485    }
11486}
11487#[derive(Clone)]
11488pub struct Label {
11489    pub proc: Option<Arc<DaggerSessionProc>>,
11490    pub selection: Selection,
11491    pub graphql_client: DynGraphQLClient,
11492}
11493impl IntoID<Id> for Label {
11494    fn into_id(
11495        self,
11496    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11497        Box::pin(async move { self.id().await })
11498    }
11499}
11500impl Loadable for Label {
11501    fn graphql_type() -> &'static str {
11502        "Label"
11503    }
11504    fn from_query(
11505        proc: Option<Arc<DaggerSessionProc>>,
11506        selection: Selection,
11507        graphql_client: DynGraphQLClient,
11508    ) -> Self {
11509        Self {
11510            proc,
11511            selection,
11512            graphql_client,
11513        }
11514    }
11515}
11516impl Label {
11517    /// A unique identifier for this Label.
11518    pub async fn id(&self) -> Result<Id, DaggerError> {
11519        let query = self.selection.select("id");
11520        query.execute(self.graphql_client.clone()).await
11521    }
11522    /// The label name.
11523    pub async fn name(&self) -> Result<String, DaggerError> {
11524        let query = self.selection.select("name");
11525        query.execute(self.graphql_client.clone()).await
11526    }
11527    /// The label value.
11528    pub async fn value(&self) -> Result<String, DaggerError> {
11529        let query = self.selection.select("value");
11530        query.execute(self.graphql_client.clone()).await
11531    }
11532}
11533impl Node for Label {
11534    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11535        let query = self.selection.select("id");
11536        let graphql_client = self.graphql_client.clone();
11537        async move { query.execute(graphql_client).await }
11538    }
11539}
11540#[derive(Clone)]
11541pub struct ListTypeDef {
11542    pub proc: Option<Arc<DaggerSessionProc>>,
11543    pub selection: Selection,
11544    pub graphql_client: DynGraphQLClient,
11545}
11546impl IntoID<Id> for ListTypeDef {
11547    fn into_id(
11548        self,
11549    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11550        Box::pin(async move { self.id().await })
11551    }
11552}
11553impl Loadable for ListTypeDef {
11554    fn graphql_type() -> &'static str {
11555        "ListTypeDef"
11556    }
11557    fn from_query(
11558        proc: Option<Arc<DaggerSessionProc>>,
11559        selection: Selection,
11560        graphql_client: DynGraphQLClient,
11561    ) -> Self {
11562        Self {
11563            proc,
11564            selection,
11565            graphql_client,
11566        }
11567    }
11568}
11569impl ListTypeDef {
11570    /// The type of the elements in the list.
11571    pub fn element_type_def(&self) -> TypeDef {
11572        let query = self.selection.select("elementTypeDef");
11573        TypeDef {
11574            proc: self.proc.clone(),
11575            selection: query,
11576            graphql_client: self.graphql_client.clone(),
11577        }
11578    }
11579    /// A unique identifier for this ListTypeDef.
11580    pub async fn id(&self) -> Result<Id, DaggerError> {
11581        let query = self.selection.select("id");
11582        query.execute(self.graphql_client.clone()).await
11583    }
11584}
11585impl Node for ListTypeDef {
11586    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11587        let query = self.selection.select("id");
11588        let graphql_client = self.graphql_client.clone();
11589        async move { query.execute(graphql_client).await }
11590    }
11591}
11592#[derive(Clone)]
11593pub struct Module {
11594    pub proc: Option<Arc<DaggerSessionProc>>,
11595    pub selection: Selection,
11596    pub graphql_client: DynGraphQLClient,
11597}
11598#[derive(Builder, Debug, PartialEq)]
11599pub struct ModuleChecksOpts<'a> {
11600    /// Only include checks matching the specified patterns
11601    #[builder(setter(into, strip_option), default)]
11602    pub include: Option<Vec<&'a str>>,
11603    /// When true, only return annotated check functions; exclude generate-as-checks
11604    #[builder(setter(into, strip_option), default)]
11605    pub no_generate: Option<bool>,
11606}
11607#[derive(Builder, Debug, PartialEq)]
11608pub struct ModuleGeneratorsOpts<'a> {
11609    /// Only include generators matching the specified patterns
11610    #[builder(setter(into, strip_option), default)]
11611    pub include: Option<Vec<&'a str>>,
11612}
11613#[derive(Builder, Debug, PartialEq)]
11614pub struct ModuleServeOpts {
11615    /// Install the module as the entrypoint, promoting its main-object methods onto the Query root
11616    #[builder(setter(into, strip_option), default)]
11617    pub entrypoint: Option<bool>,
11618    /// Expose the dependencies of this module to the client
11619    #[builder(setter(into, strip_option), default)]
11620    pub include_dependencies: Option<bool>,
11621}
11622#[derive(Builder, Debug, PartialEq)]
11623pub struct ModuleServicesOpts<'a> {
11624    /// Only include services matching the specified patterns
11625    #[builder(setter(into, strip_option), default)]
11626    pub include: Option<Vec<&'a str>>,
11627}
11628impl IntoID<Id> for Module {
11629    fn into_id(
11630        self,
11631    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11632        Box::pin(async move { self.id().await })
11633    }
11634}
11635impl Loadable for Module {
11636    fn graphql_type() -> &'static str {
11637        "Module"
11638    }
11639    fn from_query(
11640        proc: Option<Arc<DaggerSessionProc>>,
11641        selection: Selection,
11642        graphql_client: DynGraphQLClient,
11643    ) -> Self {
11644        Self {
11645            proc,
11646            selection,
11647            graphql_client,
11648        }
11649    }
11650}
11651impl Module {
11652    /// Return the check defined by the module with the given name. Must match to exactly one check.
11653    ///
11654    /// # Arguments
11655    ///
11656    /// * `name` - The name of the check to retrieve
11657    pub fn check(&self, name: impl Into<String>) -> Check {
11658        let mut query = self.selection.select("check");
11659        query = query.arg("name", name.into());
11660        Check {
11661            proc: self.proc.clone(),
11662            selection: query,
11663            graphql_client: self.graphql_client.clone(),
11664        }
11665    }
11666    /// Return all checks defined by the module
11667    ///
11668    /// # Arguments
11669    ///
11670    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11671    pub fn checks(&self) -> CheckGroup {
11672        let query = self.selection.select("checks");
11673        CheckGroup {
11674            proc: self.proc.clone(),
11675            selection: query,
11676            graphql_client: self.graphql_client.clone(),
11677        }
11678    }
11679    /// Return all checks defined by the module
11680    ///
11681    /// # Arguments
11682    ///
11683    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11684    pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
11685        let mut query = self.selection.select("checks");
11686        if let Some(include) = opts.include {
11687            query = query.arg("include", include);
11688        }
11689        if let Some(no_generate) = opts.no_generate {
11690            query = query.arg("noGenerate", no_generate);
11691        }
11692        CheckGroup {
11693            proc: self.proc.clone(),
11694            selection: query,
11695            graphql_client: self.graphql_client.clone(),
11696        }
11697    }
11698    /// The dependencies of the module.
11699    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
11700        let query = self.selection.select("dependencies");
11701        let query = query.select("id");
11702        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11703        Ok(ids
11704            .into_iter()
11705            .map(|id| Module {
11706                proc: self.proc.clone(),
11707                selection: crate::querybuilder::query()
11708                    .select("node")
11709                    .arg("id", &id.0)
11710                    .inline_fragment("Module"),
11711                graphql_client: self.graphql_client.clone(),
11712            })
11713            .collect())
11714    }
11715    /// The doc string of the module, if any
11716    pub async fn description(&self) -> Result<String, DaggerError> {
11717        let query = self.selection.select("description");
11718        query.execute(self.graphql_client.clone()).await
11719    }
11720    /// Enumerations served by this module.
11721    pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
11722        let query = self.selection.select("enums");
11723        let query = query.select("id");
11724        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11725        Ok(ids
11726            .into_iter()
11727            .map(|id| TypeDef {
11728                proc: self.proc.clone(),
11729                selection: crate::querybuilder::query()
11730                    .select("node")
11731                    .arg("id", &id.0)
11732                    .inline_fragment("TypeDef"),
11733                graphql_client: self.graphql_client.clone(),
11734            })
11735            .collect())
11736    }
11737    /// The generated files and directories made on top of the module source's context directory.
11738    pub fn generated_context_directory(&self) -> Directory {
11739        let query = self.selection.select("generatedContextDirectory");
11740        Directory {
11741            proc: self.proc.clone(),
11742            selection: query,
11743            graphql_client: self.graphql_client.clone(),
11744        }
11745    }
11746    /// Return the generator defined by the module with the given name. Must match to exactly one generator.
11747    ///
11748    /// # Arguments
11749    ///
11750    /// * `name` - The name of the generator to retrieve
11751    pub fn generator(&self, name: impl Into<String>) -> Generator {
11752        let mut query = self.selection.select("generator");
11753        query = query.arg("name", name.into());
11754        Generator {
11755            proc: self.proc.clone(),
11756            selection: query,
11757            graphql_client: self.graphql_client.clone(),
11758        }
11759    }
11760    /// Return all generators defined by the module
11761    ///
11762    /// # Arguments
11763    ///
11764    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11765    pub fn generators(&self) -> GeneratorGroup {
11766        let query = self.selection.select("generators");
11767        GeneratorGroup {
11768            proc: self.proc.clone(),
11769            selection: query,
11770            graphql_client: self.graphql_client.clone(),
11771        }
11772    }
11773    /// Return all generators defined by the module
11774    ///
11775    /// # Arguments
11776    ///
11777    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11778    pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
11779        let mut query = self.selection.select("generators");
11780        if let Some(include) = opts.include {
11781            query = query.arg("include", include);
11782        }
11783        GeneratorGroup {
11784            proc: self.proc.clone(),
11785            selection: query,
11786            graphql_client: self.graphql_client.clone(),
11787        }
11788    }
11789    /// A unique identifier for this Module.
11790    pub async fn id(&self) -> Result<Id, DaggerError> {
11791        let query = self.selection.select("id");
11792        query.execute(self.graphql_client.clone()).await
11793    }
11794    /// Interfaces served by this module.
11795    pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
11796        let query = self.selection.select("interfaces");
11797        let query = query.select("id");
11798        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11799        Ok(ids
11800            .into_iter()
11801            .map(|id| TypeDef {
11802                proc: self.proc.clone(),
11803                selection: crate::querybuilder::query()
11804                    .select("node")
11805                    .arg("id", &id.0)
11806                    .inline_fragment("TypeDef"),
11807                graphql_client: self.graphql_client.clone(),
11808            })
11809            .collect())
11810    }
11811    /// The introspection schema JSON file for this module.
11812    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
11813    /// Note: this is in the context of a module, so some core types may be hidden.
11814    pub fn introspection_schema_json(&self) -> File {
11815        let query = self.selection.select("introspectionSchemaJSON");
11816        File {
11817            proc: self.proc.clone(),
11818            selection: query,
11819            graphql_client: self.graphql_client.clone(),
11820        }
11821    }
11822    /// The name of the module
11823    pub async fn name(&self) -> Result<String, DaggerError> {
11824        let query = self.selection.select("name");
11825        query.execute(self.graphql_client.clone()).await
11826    }
11827    /// Objects served by this module.
11828    pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
11829        let query = self.selection.select("objects");
11830        let query = query.select("id");
11831        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11832        Ok(ids
11833            .into_iter()
11834            .map(|id| TypeDef {
11835                proc: self.proc.clone(),
11836                selection: crate::querybuilder::query()
11837                    .select("node")
11838                    .arg("id", &id.0)
11839                    .inline_fragment("TypeDef"),
11840                graphql_client: self.graphql_client.clone(),
11841            })
11842            .collect())
11843    }
11844    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
11845    pub fn runtime(&self) -> Container {
11846        let query = self.selection.select("runtime");
11847        Container {
11848            proc: self.proc.clone(),
11849            selection: query,
11850            graphql_client: self.graphql_client.clone(),
11851        }
11852    }
11853    /// The SDK config used by this module.
11854    pub fn sdk(&self) -> SdkConfig {
11855        let query = self.selection.select("sdk");
11856        SdkConfig {
11857            proc: self.proc.clone(),
11858            selection: query,
11859            graphql_client: self.graphql_client.clone(),
11860        }
11861    }
11862    /// Serve a module's API in the current session.
11863    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11864    ///
11865    /// # Arguments
11866    ///
11867    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11868    pub async fn serve(&self) -> Result<Void, DaggerError> {
11869        let query = self.selection.select("serve");
11870        query.execute(self.graphql_client.clone()).await
11871    }
11872    /// Serve a module's API in the current session.
11873    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11874    ///
11875    /// # Arguments
11876    ///
11877    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11878    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
11879        let mut query = self.selection.select("serve");
11880        if let Some(include_dependencies) = opts.include_dependencies {
11881            query = query.arg("includeDependencies", include_dependencies);
11882        }
11883        if let Some(entrypoint) = opts.entrypoint {
11884            query = query.arg("entrypoint", entrypoint);
11885        }
11886        query.execute(self.graphql_client.clone()).await
11887    }
11888    /// Return all services defined by the module
11889    ///
11890    /// # Arguments
11891    ///
11892    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11893    pub fn services(&self) -> UpGroup {
11894        let query = self.selection.select("services");
11895        UpGroup {
11896            proc: self.proc.clone(),
11897            selection: query,
11898            graphql_client: self.graphql_client.clone(),
11899        }
11900    }
11901    /// Return all services defined by the module
11902    ///
11903    /// # Arguments
11904    ///
11905    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11906    pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
11907        let mut query = self.selection.select("services");
11908        if let Some(include) = opts.include {
11909            query = query.arg("include", include);
11910        }
11911        UpGroup {
11912            proc: self.proc.clone(),
11913            selection: query,
11914            graphql_client: self.graphql_client.clone(),
11915        }
11916    }
11917    /// The source for the module.
11918    pub fn source(&self) -> ModuleSource {
11919        let query = self.selection.select("source");
11920        ModuleSource {
11921            proc: self.proc.clone(),
11922            selection: query,
11923            graphql_client: self.graphql_client.clone(),
11924        }
11925    }
11926    /// Forces evaluation of the module, including any loading into the engine and associated validation.
11927    pub async fn sync(&self) -> Result<Module, DaggerError> {
11928        let query = self.selection.select("sync");
11929        let id: Id = query.execute(self.graphql_client.clone()).await?;
11930        Ok(Module {
11931            proc: self.proc.clone(),
11932            selection: query
11933                .root()
11934                .select("node")
11935                .arg("id", &id.0)
11936                .inline_fragment("Module"),
11937            graphql_client: self.graphql_client.clone(),
11938        })
11939    }
11940    /// User-defined default values, loaded from local .env files.
11941    pub fn user_defaults(&self) -> EnvFile {
11942        let query = self.selection.select("userDefaults");
11943        EnvFile {
11944            proc: self.proc.clone(),
11945            selection: query,
11946            graphql_client: self.graphql_client.clone(),
11947        }
11948    }
11949    /// Retrieves the module with the given description
11950    ///
11951    /// # Arguments
11952    ///
11953    /// * `description` - The description to set
11954    pub fn with_description(&self, description: impl Into<String>) -> Module {
11955        let mut query = self.selection.select("withDescription");
11956        query = query.arg("description", description.into());
11957        Module {
11958            proc: self.proc.clone(),
11959            selection: query,
11960            graphql_client: self.graphql_client.clone(),
11961        }
11962    }
11963    /// This module plus the given Enum type and associated values
11964    pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
11965        let mut query = self.selection.select("withEnum");
11966        query = query.arg_lazy(
11967            "enum",
11968            Box::new(move || {
11969                let r#enum = r#enum.clone();
11970                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
11971            }),
11972        );
11973        Module {
11974            proc: self.proc.clone(),
11975            selection: query,
11976            graphql_client: self.graphql_client.clone(),
11977        }
11978    }
11979    /// This module plus the given Interface type and associated functions
11980    pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
11981        let mut query = self.selection.select("withInterface");
11982        query = query.arg_lazy(
11983            "iface",
11984            Box::new(move || {
11985                let iface = iface.clone();
11986                Box::pin(async move { iface.into_id().await.unwrap().quote() })
11987            }),
11988        );
11989        Module {
11990            proc: self.proc.clone(),
11991            selection: query,
11992            graphql_client: self.graphql_client.clone(),
11993        }
11994    }
11995    /// This module plus the given Object type and associated functions.
11996    pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
11997        let mut query = self.selection.select("withObject");
11998        query = query.arg_lazy(
11999            "object",
12000            Box::new(move || {
12001                let object = object.clone();
12002                Box::pin(async move { object.into_id().await.unwrap().quote() })
12003            }),
12004        );
12005        Module {
12006            proc: self.proc.clone(),
12007            selection: query,
12008            graphql_client: self.graphql_client.clone(),
12009        }
12010    }
12011}
12012impl Node for Module {
12013    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12014        let query = self.selection.select("id");
12015        let graphql_client = self.graphql_client.clone();
12016        async move { query.execute(graphql_client).await }
12017    }
12018}
12019impl Syncer for Module {
12020    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12021        let query = self.selection.select("id");
12022        let graphql_client = self.graphql_client.clone();
12023        async move { query.execute(graphql_client).await }
12024    }
12025    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12026        let query = self.selection.select("sync");
12027        let graphql_client = self.graphql_client.clone();
12028        async move { query.execute(graphql_client).await }
12029    }
12030}
12031#[derive(Clone)]
12032pub struct ModuleConfigClient {
12033    pub proc: Option<Arc<DaggerSessionProc>>,
12034    pub selection: Selection,
12035    pub graphql_client: DynGraphQLClient,
12036}
12037impl IntoID<Id> for ModuleConfigClient {
12038    fn into_id(
12039        self,
12040    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12041        Box::pin(async move { self.id().await })
12042    }
12043}
12044impl Loadable for ModuleConfigClient {
12045    fn graphql_type() -> &'static str {
12046        "ModuleConfigClient"
12047    }
12048    fn from_query(
12049        proc: Option<Arc<DaggerSessionProc>>,
12050        selection: Selection,
12051        graphql_client: DynGraphQLClient,
12052    ) -> Self {
12053        Self {
12054            proc,
12055            selection,
12056            graphql_client,
12057        }
12058    }
12059}
12060impl ModuleConfigClient {
12061    /// The directory the client is generated in.
12062    pub async fn directory(&self) -> Result<String, DaggerError> {
12063        let query = self.selection.select("directory");
12064        query.execute(self.graphql_client.clone()).await
12065    }
12066    /// The generator to use
12067    pub async fn generator(&self) -> Result<String, DaggerError> {
12068        let query = self.selection.select("generator");
12069        query.execute(self.graphql_client.clone()).await
12070    }
12071    /// A unique identifier for this ModuleConfigClient.
12072    pub async fn id(&self) -> Result<Id, DaggerError> {
12073        let query = self.selection.select("id");
12074        query.execute(self.graphql_client.clone()).await
12075    }
12076}
12077impl Node for ModuleConfigClient {
12078    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12079        let query = self.selection.select("id");
12080        let graphql_client = self.graphql_client.clone();
12081        async move { query.execute(graphql_client).await }
12082    }
12083}
12084#[derive(Clone)]
12085pub struct ModuleSource {
12086    pub proc: Option<Arc<DaggerSessionProc>>,
12087    pub selection: Selection,
12088    pub graphql_client: DynGraphQLClient,
12089}
12090impl IntoID<Id> for ModuleSource {
12091    fn into_id(
12092        self,
12093    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12094        Box::pin(async move { self.id().await })
12095    }
12096}
12097impl Loadable for ModuleSource {
12098    fn graphql_type() -> &'static str {
12099        "ModuleSource"
12100    }
12101    fn from_query(
12102        proc: Option<Arc<DaggerSessionProc>>,
12103        selection: Selection,
12104        graphql_client: DynGraphQLClient,
12105    ) -> Self {
12106        Self {
12107            proc,
12108            selection,
12109            graphql_client,
12110        }
12111    }
12112}
12113impl ModuleSource {
12114    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
12115    pub fn as_module(&self) -> Module {
12116        let query = self.selection.select("asModule");
12117        Module {
12118            proc: self.proc.clone(),
12119            selection: query,
12120            graphql_client: self.graphql_client.clone(),
12121        }
12122    }
12123    /// A human readable ref string representation of this module source.
12124    pub async fn as_string(&self) -> Result<String, DaggerError> {
12125        let query = self.selection.select("asString");
12126        query.execute(self.graphql_client.clone()).await
12127    }
12128    /// The blueprint referenced by the module source.
12129    pub fn blueprint(&self) -> ModuleSource {
12130        let query = self.selection.select("blueprint");
12131        ModuleSource {
12132            proc: self.proc.clone(),
12133            selection: query,
12134            graphql_client: self.graphql_client.clone(),
12135        }
12136    }
12137    /// The ref to clone the root of the git repo from. Only valid for git sources.
12138    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
12139        let query = self.selection.select("cloneRef");
12140        query.execute(self.graphql_client.clone()).await
12141    }
12142    /// The resolved commit of the git repo this source points to.
12143    pub async fn commit(&self) -> Result<String, DaggerError> {
12144        let query = self.selection.select("commit");
12145        query.execute(self.graphql_client.clone()).await
12146    }
12147    /// The clients generated for the module.
12148    pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
12149        let query = self.selection.select("configClients");
12150        let query = query.select("id");
12151        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12152        Ok(ids
12153            .into_iter()
12154            .map(|id| ModuleConfigClient {
12155                proc: self.proc.clone(),
12156                selection: crate::querybuilder::query()
12157                    .select("node")
12158                    .arg("id", &id.0)
12159                    .inline_fragment("ModuleConfigClient"),
12160                graphql_client: self.graphql_client.clone(),
12161            })
12162            .collect())
12163    }
12164    /// Whether an existing dagger.json for the module was found.
12165    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
12166        let query = self.selection.select("configExists");
12167        query.execute(self.graphql_client.clone()).await
12168    }
12169    /// The full directory loaded for the module source, including the source code as a subdirectory.
12170    pub fn context_directory(&self) -> Directory {
12171        let query = self.selection.select("contextDirectory");
12172        Directory {
12173            proc: self.proc.clone(),
12174            selection: query,
12175            graphql_client: self.graphql_client.clone(),
12176        }
12177    }
12178    /// The dependencies of the module source.
12179    pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12180        let query = self.selection.select("dependencies");
12181        let query = query.select("id");
12182        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12183        Ok(ids
12184            .into_iter()
12185            .map(|id| ModuleSource {
12186                proc: self.proc.clone(),
12187                selection: crate::querybuilder::query()
12188                    .select("node")
12189                    .arg("id", &id.0)
12190                    .inline_fragment("ModuleSource"),
12191                graphql_client: self.graphql_client.clone(),
12192            })
12193            .collect())
12194    }
12195    /// 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.
12196    pub async fn digest(&self) -> Result<String, DaggerError> {
12197        let query = self.selection.select("digest");
12198        query.execute(self.graphql_client.clone()).await
12199    }
12200    /// The directory containing the module configuration and source code (source code may be in a subdir).
12201    ///
12202    /// # Arguments
12203    ///
12204    /// * `path` - A subpath from the source directory to select.
12205    pub fn directory(&self, path: impl Into<String>) -> Directory {
12206        let mut query = self.selection.select("directory");
12207        query = query.arg("path", path.into());
12208        Directory {
12209            proc: self.proc.clone(),
12210            selection: query,
12211            graphql_client: self.graphql_client.clone(),
12212        }
12213    }
12214    /// The engine version of the module.
12215    pub async fn engine_version(&self) -> Result<String, DaggerError> {
12216        let query = self.selection.select("engineVersion");
12217        query.execute(self.graphql_client.clone()).await
12218    }
12219    /// The generated files and directories made on top of the module source's context directory, returned as a Changeset.
12220    pub fn generated_context_changeset(&self) -> Changeset {
12221        let query = self.selection.select("generatedContextChangeset");
12222        Changeset {
12223            proc: self.proc.clone(),
12224            selection: query,
12225            graphql_client: self.graphql_client.clone(),
12226        }
12227    }
12228    /// The generated files and directories made on top of the module source's context directory.
12229    pub fn generated_context_directory(&self) -> Directory {
12230        let query = self.selection.select("generatedContextDirectory");
12231        Directory {
12232            proc: self.proc.clone(),
12233            selection: query,
12234            graphql_client: self.graphql_client.clone(),
12235        }
12236    }
12237    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
12238    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
12239        let query = self.selection.select("htmlRepoURL");
12240        query.execute(self.graphql_client.clone()).await
12241    }
12242    /// The URL to the source's git repo in a web browser. Only valid for git sources.
12243    pub async fn html_url(&self) -> Result<String, DaggerError> {
12244        let query = self.selection.select("htmlURL");
12245        query.execute(self.graphql_client.clone()).await
12246    }
12247    /// A unique identifier for this ModuleSource.
12248    pub async fn id(&self) -> Result<Id, DaggerError> {
12249        let query = self.selection.select("id");
12250        query.execute(self.graphql_client.clone()).await
12251    }
12252    /// The introspection schema JSON file for this module source.
12253    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
12254    /// Note: this is in the context of a module, so some core types may be hidden.
12255    pub fn introspection_schema_json(&self) -> File {
12256        let query = self.selection.select("introspectionSchemaJSON");
12257        File {
12258            proc: self.proc.clone(),
12259            selection: query,
12260            graphql_client: self.graphql_client.clone(),
12261        }
12262    }
12263    /// The kind of module source (currently local, git or dir).
12264    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
12265        let query = self.selection.select("kind");
12266        query.execute(self.graphql_client.clone()).await
12267    }
12268    /// 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.
12269    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
12270        let query = self.selection.select("localContextDirectoryPath");
12271        query.execute(self.graphql_client.clone()).await
12272    }
12273    /// The name of the module, including any setting via the withName API.
12274    pub async fn module_name(&self) -> Result<String, DaggerError> {
12275        let query = self.selection.select("moduleName");
12276        query.execute(self.graphql_client.clone()).await
12277    }
12278    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
12279    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
12280        let query = self.selection.select("moduleOriginalName");
12281        query.execute(self.graphql_client.clone()).await
12282    }
12283    /// The original subpath used when instantiating this module source, relative to the context directory.
12284    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
12285        let query = self.selection.select("originalSubpath");
12286        query.execute(self.graphql_client.clone()).await
12287    }
12288    /// The pinned version of this module source.
12289    pub async fn pin(&self) -> Result<String, DaggerError> {
12290        let query = self.selection.select("pin");
12291        query.execute(self.graphql_client.clone()).await
12292    }
12293    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
12294    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
12295        let query = self.selection.select("repoRootPath");
12296        query.execute(self.graphql_client.clone()).await
12297    }
12298    /// The SDK configuration of the module.
12299    pub fn sdk(&self) -> SdkConfig {
12300        let query = self.selection.select("sdk");
12301        SdkConfig {
12302            proc: self.proc.clone(),
12303            selection: query,
12304            graphql_client: self.graphql_client.clone(),
12305        }
12306    }
12307    /// The path, relative to the context directory, that contains the module's dagger.json.
12308    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
12309        let query = self.selection.select("sourceRootSubpath");
12310        query.execute(self.graphql_client.clone()).await
12311    }
12312    /// The path to the directory containing the module's source code, relative to the context directory.
12313    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
12314        let query = self.selection.select("sourceSubpath");
12315        query.execute(self.graphql_client.clone()).await
12316    }
12317    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
12318    pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
12319        let query = self.selection.select("sync");
12320        let id: Id = query.execute(self.graphql_client.clone()).await?;
12321        Ok(ModuleSource {
12322            proc: self.proc.clone(),
12323            selection: query
12324                .root()
12325                .select("node")
12326                .arg("id", &id.0)
12327                .inline_fragment("ModuleSource"),
12328            graphql_client: self.graphql_client.clone(),
12329        })
12330    }
12331    /// The toolchains referenced by the module source.
12332    pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12333        let query = self.selection.select("toolchains");
12334        let query = query.select("id");
12335        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12336        Ok(ids
12337            .into_iter()
12338            .map(|id| ModuleSource {
12339                proc: self.proc.clone(),
12340                selection: crate::querybuilder::query()
12341                    .select("node")
12342                    .arg("id", &id.0)
12343                    .inline_fragment("ModuleSource"),
12344                graphql_client: self.graphql_client.clone(),
12345            })
12346            .collect())
12347    }
12348    /// User-defined defaults read from local .env files
12349    pub fn user_defaults(&self) -> EnvFile {
12350        let query = self.selection.select("userDefaults");
12351        EnvFile {
12352            proc: self.proc.clone(),
12353            selection: query,
12354            graphql_client: self.graphql_client.clone(),
12355        }
12356    }
12357    /// The specified version of the git repo this source points to.
12358    pub async fn version(&self) -> Result<String, DaggerError> {
12359        let query = self.selection.select("version");
12360        query.execute(self.graphql_client.clone()).await
12361    }
12362    /// Set a blueprint for the module source.
12363    ///
12364    /// # Arguments
12365    ///
12366    /// * `blueprint` - The blueprint module to set.
12367    pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
12368        let mut query = self.selection.select("withBlueprint");
12369        query = query.arg_lazy(
12370            "blueprint",
12371            Box::new(move || {
12372                let blueprint = blueprint.clone();
12373                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
12374            }),
12375        );
12376        ModuleSource {
12377            proc: self.proc.clone(),
12378            selection: query,
12379            graphql_client: self.graphql_client.clone(),
12380        }
12381    }
12382    /// Update the module source with a new client to generate.
12383    ///
12384    /// # Arguments
12385    ///
12386    /// * `generator` - The generator to use
12387    /// * `output_dir` - The output directory for the generated client.
12388    pub fn with_client(
12389        &self,
12390        generator: impl Into<String>,
12391        output_dir: impl Into<String>,
12392    ) -> ModuleSource {
12393        let mut query = self.selection.select("withClient");
12394        query = query.arg("generator", generator.into());
12395        query = query.arg("outputDir", output_dir.into());
12396        ModuleSource {
12397            proc: self.proc.clone(),
12398            selection: query,
12399            graphql_client: self.graphql_client.clone(),
12400        }
12401    }
12402    /// Append the provided dependencies to the module source's dependency list.
12403    ///
12404    /// # Arguments
12405    ///
12406    /// * `dependencies` - The dependencies to append.
12407    pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
12408        let mut query = self.selection.select("withDependencies");
12409        query = query.arg("dependencies", dependencies);
12410        ModuleSource {
12411            proc: self.proc.clone(),
12412            selection: query,
12413            graphql_client: self.graphql_client.clone(),
12414        }
12415    }
12416    /// Upgrade the engine version of the module to the given value.
12417    ///
12418    /// # Arguments
12419    ///
12420    /// * `version` - The engine version to upgrade to.
12421    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
12422        let mut query = self.selection.select("withEngineVersion");
12423        query = query.arg("version", version.into());
12424        ModuleSource {
12425            proc: self.proc.clone(),
12426            selection: query,
12427            graphql_client: self.graphql_client.clone(),
12428        }
12429    }
12430    /// Enable the experimental features for the module source.
12431    ///
12432    /// # Arguments
12433    ///
12434    /// * `features` - The experimental features to enable.
12435    pub fn with_experimental_features(
12436        &self,
12437        features: Vec<ModuleSourceExperimentalFeature>,
12438    ) -> ModuleSource {
12439        let mut query = self.selection.select("withExperimentalFeatures");
12440        query = query.arg("features", features);
12441        ModuleSource {
12442            proc: self.proc.clone(),
12443            selection: query,
12444            graphql_client: self.graphql_client.clone(),
12445        }
12446    }
12447    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
12448    ///
12449    /// # Arguments
12450    ///
12451    /// * `patterns` - The new additional include patterns.
12452    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
12453        let mut query = self.selection.select("withIncludes");
12454        query = query.arg(
12455            "patterns",
12456            patterns
12457                .into_iter()
12458                .map(|i| i.into())
12459                .collect::<Vec<String>>(),
12460        );
12461        ModuleSource {
12462            proc: self.proc.clone(),
12463            selection: query,
12464            graphql_client: self.graphql_client.clone(),
12465        }
12466    }
12467    /// Update the module source with a new name.
12468    ///
12469    /// # Arguments
12470    ///
12471    /// * `name` - The name to set.
12472    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
12473        let mut query = self.selection.select("withName");
12474        query = query.arg("name", name.into());
12475        ModuleSource {
12476            proc: self.proc.clone(),
12477            selection: query,
12478            graphql_client: self.graphql_client.clone(),
12479        }
12480    }
12481    /// Update the module source with a new SDK.
12482    ///
12483    /// # Arguments
12484    ///
12485    /// * `source` - The SDK source to set.
12486    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
12487        let mut query = self.selection.select("withSDK");
12488        query = query.arg("source", source.into());
12489        ModuleSource {
12490            proc: self.proc.clone(),
12491            selection: query,
12492            graphql_client: self.graphql_client.clone(),
12493        }
12494    }
12495    /// Update the module source with a new source subpath.
12496    ///
12497    /// # Arguments
12498    ///
12499    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
12500    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
12501        let mut query = self.selection.select("withSourceSubpath");
12502        query = query.arg("path", path.into());
12503        ModuleSource {
12504            proc: self.proc.clone(),
12505            selection: query,
12506            graphql_client: self.graphql_client.clone(),
12507        }
12508    }
12509    /// Add toolchains to the module source.
12510    ///
12511    /// # Arguments
12512    ///
12513    /// * `toolchains` - The toolchain modules to add.
12514    pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
12515        let mut query = self.selection.select("withToolchains");
12516        query = query.arg("toolchains", toolchains);
12517        ModuleSource {
12518            proc: self.proc.clone(),
12519            selection: query,
12520            graphql_client: self.graphql_client.clone(),
12521        }
12522    }
12523    /// Update the blueprint module to the latest version.
12524    pub fn with_update_blueprint(&self) -> ModuleSource {
12525        let query = self.selection.select("withUpdateBlueprint");
12526        ModuleSource {
12527            proc: self.proc.clone(),
12528            selection: query,
12529            graphql_client: self.graphql_client.clone(),
12530        }
12531    }
12532    /// Update one or more module dependencies.
12533    ///
12534    /// # Arguments
12535    ///
12536    /// * `dependencies` - The dependencies to update.
12537    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12538        let mut query = self.selection.select("withUpdateDependencies");
12539        query = query.arg(
12540            "dependencies",
12541            dependencies
12542                .into_iter()
12543                .map(|i| i.into())
12544                .collect::<Vec<String>>(),
12545        );
12546        ModuleSource {
12547            proc: self.proc.clone(),
12548            selection: query,
12549            graphql_client: self.graphql_client.clone(),
12550        }
12551    }
12552    /// Update one or more toolchains.
12553    ///
12554    /// # Arguments
12555    ///
12556    /// * `toolchains` - The toolchains to update.
12557    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12558        let mut query = self.selection.select("withUpdateToolchains");
12559        query = query.arg(
12560            "toolchains",
12561            toolchains
12562                .into_iter()
12563                .map(|i| i.into())
12564                .collect::<Vec<String>>(),
12565        );
12566        ModuleSource {
12567            proc: self.proc.clone(),
12568            selection: query,
12569            graphql_client: self.graphql_client.clone(),
12570        }
12571    }
12572    /// Update one or more clients.
12573    ///
12574    /// # Arguments
12575    ///
12576    /// * `clients` - The clients to update
12577    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
12578        let mut query = self.selection.select("withUpdatedClients");
12579        query = query.arg(
12580            "clients",
12581            clients
12582                .into_iter()
12583                .map(|i| i.into())
12584                .collect::<Vec<String>>(),
12585        );
12586        ModuleSource {
12587            proc: self.proc.clone(),
12588            selection: query,
12589            graphql_client: self.graphql_client.clone(),
12590        }
12591    }
12592    /// Remove the current blueprint from the module source.
12593    pub fn without_blueprint(&self) -> ModuleSource {
12594        let query = self.selection.select("withoutBlueprint");
12595        ModuleSource {
12596            proc: self.proc.clone(),
12597            selection: query,
12598            graphql_client: self.graphql_client.clone(),
12599        }
12600    }
12601    /// Remove a client from the module source.
12602    ///
12603    /// # Arguments
12604    ///
12605    /// * `path` - The path of the client to remove.
12606    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
12607        let mut query = self.selection.select("withoutClient");
12608        query = query.arg("path", path.into());
12609        ModuleSource {
12610            proc: self.proc.clone(),
12611            selection: query,
12612            graphql_client: self.graphql_client.clone(),
12613        }
12614    }
12615    /// Remove the provided dependencies from the module source's dependency list.
12616    ///
12617    /// # Arguments
12618    ///
12619    /// * `dependencies` - The dependencies to remove.
12620    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12621        let mut query = self.selection.select("withoutDependencies");
12622        query = query.arg(
12623            "dependencies",
12624            dependencies
12625                .into_iter()
12626                .map(|i| i.into())
12627                .collect::<Vec<String>>(),
12628        );
12629        ModuleSource {
12630            proc: self.proc.clone(),
12631            selection: query,
12632            graphql_client: self.graphql_client.clone(),
12633        }
12634    }
12635    /// Disable experimental features for the module source.
12636    ///
12637    /// # Arguments
12638    ///
12639    /// * `features` - The experimental features to disable.
12640    pub fn without_experimental_features(
12641        &self,
12642        features: Vec<ModuleSourceExperimentalFeature>,
12643    ) -> ModuleSource {
12644        let mut query = self.selection.select("withoutExperimentalFeatures");
12645        query = query.arg("features", features);
12646        ModuleSource {
12647            proc: self.proc.clone(),
12648            selection: query,
12649            graphql_client: self.graphql_client.clone(),
12650        }
12651    }
12652    /// Remove the provided toolchains from the module source.
12653    ///
12654    /// # Arguments
12655    ///
12656    /// * `toolchains` - The toolchains to remove.
12657    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12658        let mut query = self.selection.select("withoutToolchains");
12659        query = query.arg(
12660            "toolchains",
12661            toolchains
12662                .into_iter()
12663                .map(|i| i.into())
12664                .collect::<Vec<String>>(),
12665        );
12666        ModuleSource {
12667            proc: self.proc.clone(),
12668            selection: query,
12669            graphql_client: self.graphql_client.clone(),
12670        }
12671    }
12672}
12673impl Node for ModuleSource {
12674    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12675        let query = self.selection.select("id");
12676        let graphql_client = self.graphql_client.clone();
12677        async move { query.execute(graphql_client).await }
12678    }
12679}
12680impl Syncer for ModuleSource {
12681    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12682        let query = self.selection.select("id");
12683        let graphql_client = self.graphql_client.clone();
12684        async move { query.execute(graphql_client).await }
12685    }
12686    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12687        let query = self.selection.select("sync");
12688        let graphql_client = self.graphql_client.clone();
12689        async move { query.execute(graphql_client).await }
12690    }
12691}
12692#[derive(Clone)]
12693pub struct ObjectTypeDef {
12694    pub proc: Option<Arc<DaggerSessionProc>>,
12695    pub selection: Selection,
12696    pub graphql_client: DynGraphQLClient,
12697}
12698impl IntoID<Id> for ObjectTypeDef {
12699    fn into_id(
12700        self,
12701    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12702        Box::pin(async move { self.id().await })
12703    }
12704}
12705impl Loadable for ObjectTypeDef {
12706    fn graphql_type() -> &'static str {
12707        "ObjectTypeDef"
12708    }
12709    fn from_query(
12710        proc: Option<Arc<DaggerSessionProc>>,
12711        selection: Selection,
12712        graphql_client: DynGraphQLClient,
12713    ) -> Self {
12714        Self {
12715            proc,
12716            selection,
12717            graphql_client,
12718        }
12719    }
12720}
12721impl ObjectTypeDef {
12722    /// The function used to construct new instances of this object, if any.
12723    pub fn constructor(&self) -> Function {
12724        let query = self.selection.select("constructor");
12725        Function {
12726            proc: self.proc.clone(),
12727            selection: query,
12728            graphql_client: self.graphql_client.clone(),
12729        }
12730    }
12731    /// The reason this enum member is deprecated, if any.
12732    pub async fn deprecated(&self) -> Result<String, DaggerError> {
12733        let query = self.selection.select("deprecated");
12734        query.execute(self.graphql_client.clone()).await
12735    }
12736    /// The doc string for the object, if any.
12737    pub async fn description(&self) -> Result<String, DaggerError> {
12738        let query = self.selection.select("description");
12739        query.execute(self.graphql_client.clone()).await
12740    }
12741    /// Static fields defined on this object, if any.
12742    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12743        let query = self.selection.select("fields");
12744        let query = query.select("id");
12745        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12746        Ok(ids
12747            .into_iter()
12748            .map(|id| FieldTypeDef {
12749                proc: self.proc.clone(),
12750                selection: crate::querybuilder::query()
12751                    .select("node")
12752                    .arg("id", &id.0)
12753                    .inline_fragment("FieldTypeDef"),
12754                graphql_client: self.graphql_client.clone(),
12755            })
12756            .collect())
12757    }
12758    /// Functions defined on this object, if any.
12759    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12760        let query = self.selection.select("functions");
12761        let query = query.select("id");
12762        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12763        Ok(ids
12764            .into_iter()
12765            .map(|id| Function {
12766                proc: self.proc.clone(),
12767                selection: crate::querybuilder::query()
12768                    .select("node")
12769                    .arg("id", &id.0)
12770                    .inline_fragment("Function"),
12771                graphql_client: self.graphql_client.clone(),
12772            })
12773            .collect())
12774    }
12775    /// A unique identifier for this ObjectTypeDef.
12776    pub async fn id(&self) -> Result<Id, DaggerError> {
12777        let query = self.selection.select("id");
12778        query.execute(self.graphql_client.clone()).await
12779    }
12780    /// The name of the object.
12781    pub async fn name(&self) -> Result<String, DaggerError> {
12782        let query = self.selection.select("name");
12783        query.execute(self.graphql_client.clone()).await
12784    }
12785    /// The location of this object declaration.
12786    pub fn source_map(&self) -> SourceMap {
12787        let query = self.selection.select("sourceMap");
12788        SourceMap {
12789            proc: self.proc.clone(),
12790            selection: query,
12791            graphql_client: self.graphql_client.clone(),
12792        }
12793    }
12794    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
12795    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12796        let query = self.selection.select("sourceModuleName");
12797        query.execute(self.graphql_client.clone()).await
12798    }
12799}
12800impl Node for ObjectTypeDef {
12801    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12802        let query = self.selection.select("id");
12803        let graphql_client = self.graphql_client.clone();
12804        async move { query.execute(graphql_client).await }
12805    }
12806}
12807#[derive(Clone)]
12808pub struct Port {
12809    pub proc: Option<Arc<DaggerSessionProc>>,
12810    pub selection: Selection,
12811    pub graphql_client: DynGraphQLClient,
12812}
12813impl IntoID<Id> for Port {
12814    fn into_id(
12815        self,
12816    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12817        Box::pin(async move { self.id().await })
12818    }
12819}
12820impl Loadable for Port {
12821    fn graphql_type() -> &'static str {
12822        "Port"
12823    }
12824    fn from_query(
12825        proc: Option<Arc<DaggerSessionProc>>,
12826        selection: Selection,
12827        graphql_client: DynGraphQLClient,
12828    ) -> Self {
12829        Self {
12830            proc,
12831            selection,
12832            graphql_client,
12833        }
12834    }
12835}
12836impl Port {
12837    /// The port description.
12838    pub async fn description(&self) -> Result<String, DaggerError> {
12839        let query = self.selection.select("description");
12840        query.execute(self.graphql_client.clone()).await
12841    }
12842    /// Skip the health check when run as a service.
12843    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
12844        let query = self.selection.select("experimentalSkipHealthcheck");
12845        query.execute(self.graphql_client.clone()).await
12846    }
12847    /// A unique identifier for this Port.
12848    pub async fn id(&self) -> Result<Id, DaggerError> {
12849        let query = self.selection.select("id");
12850        query.execute(self.graphql_client.clone()).await
12851    }
12852    /// The port number.
12853    pub async fn port(&self) -> Result<isize, DaggerError> {
12854        let query = self.selection.select("port");
12855        query.execute(self.graphql_client.clone()).await
12856    }
12857    /// The transport layer protocol.
12858    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
12859        let query = self.selection.select("protocol");
12860        query.execute(self.graphql_client.clone()).await
12861    }
12862}
12863impl Node for Port {
12864    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12865        let query = self.selection.select("id");
12866        let graphql_client = self.graphql_client.clone();
12867        async move { query.execute(graphql_client).await }
12868    }
12869}
12870#[derive(Clone)]
12871pub struct Query {
12872    pub proc: Option<Arc<DaggerSessionProc>>,
12873    pub selection: Selection,
12874    pub graphql_client: DynGraphQLClient,
12875}
12876#[derive(Builder, Debug, PartialEq)]
12877pub struct QueryCacheVolumeOpts<'a> {
12878    /// A user:group to set for the cache volume root.
12879    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
12880    /// If the group is omitted, it defaults to the same as the user.
12881    #[builder(setter(into, strip_option), default)]
12882    pub owner: Option<&'a str>,
12883    /// Sharing mode of the cache volume.
12884    #[builder(setter(into, strip_option), default)]
12885    pub sharing: Option<CacheSharingMode>,
12886    /// Identifier of the directory to use as the cache volume's root.
12887    #[builder(setter(into, strip_option), default)]
12888    pub source: Option<Id>,
12889}
12890#[derive(Builder, Debug, PartialEq)]
12891pub struct QueryContainerOpts {
12892    /// Platform to initialize the container with. Defaults to the native platform of the current engine
12893    #[builder(setter(into, strip_option), default)]
12894    pub platform: Option<Platform>,
12895}
12896#[derive(Builder, Debug, PartialEq)]
12897pub struct QueryCurrentTypeDefsOpts {
12898    /// Strip core API functions from the Query type, leaving only module-sourced functions (constructors, entrypoint proxies, etc.).
12899    /// Core types (Container, Directory, etc.) are kept so return types and method chaining still work.
12900    #[builder(setter(into, strip_option), default)]
12901    pub hide_core: Option<bool>,
12902    /// Return the full referenced typedef closure instead of only top-level served typedefs.
12903    #[builder(setter(into, strip_option), default)]
12904    pub return_all_types: Option<bool>,
12905}
12906#[derive(Builder, Debug, PartialEq)]
12907pub struct QueryEnvOpts {
12908    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
12909    #[builder(setter(into, strip_option), default)]
12910    pub privileged: Option<bool>,
12911    /// Allow new outputs to be declared and saved in the environment
12912    #[builder(setter(into, strip_option), default)]
12913    pub writable: Option<bool>,
12914}
12915#[derive(Builder, Debug, PartialEq)]
12916pub struct QueryEnvFileOpts {
12917    /// Replace "${VAR}" or "$VAR" with the value of other vars
12918    #[builder(setter(into, strip_option), default)]
12919    pub expand: Option<bool>,
12920}
12921#[derive(Builder, Debug, PartialEq)]
12922pub struct QueryFileOpts {
12923    /// Permissions of the new file. Example: 0600
12924    #[builder(setter(into, strip_option), default)]
12925    pub permissions: Option<isize>,
12926}
12927#[derive(Builder, Debug, PartialEq)]
12928pub struct QueryGitOpts<'a> {
12929    /// A service which must be started before the repo is fetched.
12930    #[builder(setter(into, strip_option), default)]
12931    pub experimental_service_host: Option<Id>,
12932    /// Secret used to populate the Authorization HTTP header
12933    #[builder(setter(into, strip_option), default)]
12934    pub http_auth_header: Option<Id>,
12935    /// Secret used to populate the password during basic HTTP Authorization
12936    #[builder(setter(into, strip_option), default)]
12937    pub http_auth_token: Option<Id>,
12938    /// Username used to populate the password during basic HTTP Authorization
12939    #[builder(setter(into, strip_option), default)]
12940    pub http_auth_username: Option<&'a str>,
12941    /// DEPRECATED: Set to true to keep .git directory.
12942    #[builder(setter(into, strip_option), default)]
12943    pub keep_git_dir: Option<bool>,
12944    /// Set SSH auth socket
12945    #[builder(setter(into, strip_option), default)]
12946    pub ssh_auth_socket: Option<Id>,
12947    /// Set SSH known hosts
12948    #[builder(setter(into, strip_option), default)]
12949    pub ssh_known_hosts: Option<&'a str>,
12950}
12951#[derive(Builder, Debug, PartialEq)]
12952pub struct QueryHttpOpts<'a> {
12953    /// Secret used to populate the Authorization HTTP header
12954    #[builder(setter(into, strip_option), default)]
12955    pub auth_header: Option<Id>,
12956    /// Expected digest of the downloaded content (e.g., "sha256:...").
12957    #[builder(setter(into, strip_option), default)]
12958    pub checksum: Option<&'a str>,
12959    /// A service which must be started before the URL is fetched.
12960    #[builder(setter(into, strip_option), default)]
12961    pub experimental_service_host: Option<Id>,
12962    /// File name to use for the file. Defaults to the last part of the URL.
12963    #[builder(setter(into, strip_option), default)]
12964    pub name: Option<&'a str>,
12965    /// Permissions to set on the file.
12966    #[builder(setter(into, strip_option), default)]
12967    pub permissions: Option<isize>,
12968}
12969#[derive(Builder, Debug, PartialEq)]
12970pub struct QueryLlmOpts<'a> {
12971    /// Cap the number of API calls for this LLM
12972    #[builder(setter(into, strip_option), default)]
12973    pub max_api_calls: Option<isize>,
12974    /// Model to use
12975    #[builder(setter(into, strip_option), default)]
12976    pub model: Option<&'a str>,
12977}
12978#[derive(Builder, Debug, PartialEq)]
12979pub struct QueryModuleSourceOpts<'a> {
12980    /// 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.
12981    #[builder(setter(into, strip_option), default)]
12982    pub allow_not_exists: Option<bool>,
12983    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
12984    #[builder(setter(into, strip_option), default)]
12985    pub disable_find_up: Option<bool>,
12986    /// The pinned version of the module source
12987    #[builder(setter(into, strip_option), default)]
12988    pub ref_pin: Option<&'a str>,
12989    /// If set, error out if the ref string is not of the provided requireKind.
12990    #[builder(setter(into, strip_option), default)]
12991    pub require_kind: Option<ModuleSourceKind>,
12992}
12993#[derive(Builder, Debug, PartialEq)]
12994pub struct QuerySecretOpts<'a> {
12995    /// 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.
12996    /// 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.
12997    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
12998    #[builder(setter(into, strip_option), default)]
12999    pub cache_key: Option<&'a str>,
13000}
13001#[derive(Builder, Debug, PartialEq)]
13002pub struct QuerySshfsVolumeOpts<'a> {
13003    /// Optional cache equivalence key. If set, volumes with the same cacheKey may be considered equivalent for cache lookups, still subject to their resource dependencies.
13004    #[builder(setter(into, strip_option), default)]
13005    pub cache_key: Option<&'a str>,
13006    /// Service to use as the SSHFS network endpoint while verifying the original host key.
13007    #[builder(setter(into, strip_option), default)]
13008    pub experimental_service_host: Option<Id>,
13009    /// Disable SSH host key verification. This is insecure and must be explicitly opted into.
13010    #[builder(setter(into, strip_option), default)]
13011    pub insecure_skip_host_key_check: Option<bool>,
13012    /// known_hosts material used to verify the remote host key. Required unless insecureSkipHostKeyCheck is true.
13013    #[builder(setter(into, strip_option), default)]
13014    pub known_hosts: Option<Id>,
13015}
13016impl IntoID<Id> for Query {
13017    fn into_id(
13018        self,
13019    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13020        Box::pin(async move { self.id().await })
13021    }
13022}
13023impl Loadable for Query {
13024    fn graphql_type() -> &'static str {
13025        "Query"
13026    }
13027    fn from_query(
13028        proc: Option<Arc<DaggerSessionProc>>,
13029        selection: Selection,
13030        graphql_client: DynGraphQLClient,
13031    ) -> Self {
13032        Self {
13033            proc,
13034            selection,
13035            graphql_client,
13036        }
13037    }
13038}
13039impl Query {
13040    /// initialize an address to load directories, containers, secrets or other object types.
13041    pub fn address(&self, value: impl Into<String>) -> Address {
13042        let mut query = self.selection.select("address");
13043        query = query.arg("value", value.into());
13044        Address {
13045            proc: self.proc.clone(),
13046            selection: query,
13047            graphql_client: self.graphql_client.clone(),
13048        }
13049    }
13050    /// Constructs a cache volume for a given cache key.
13051    ///
13052    /// # Arguments
13053    ///
13054    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
13055    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13056    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
13057        let mut query = self.selection.select("cacheVolume");
13058        query = query.arg("key", key.into());
13059        CacheVolume {
13060            proc: self.proc.clone(),
13061            selection: query,
13062            graphql_client: self.graphql_client.clone(),
13063        }
13064    }
13065    /// Constructs a cache volume for a given cache key.
13066    ///
13067    /// # Arguments
13068    ///
13069    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
13070    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13071    pub fn cache_volume_opts<'a>(
13072        &self,
13073        key: impl Into<String>,
13074        opts: QueryCacheVolumeOpts<'a>,
13075    ) -> CacheVolume {
13076        let mut query = self.selection.select("cacheVolume");
13077        query = query.arg("key", key.into());
13078        if let Some(source) = opts.source {
13079            query = query.arg("source", source);
13080        }
13081        if let Some(sharing) = opts.sharing {
13082            query = query.arg("sharing", sharing);
13083        }
13084        if let Some(owner) = opts.owner {
13085            query = query.arg("owner", owner);
13086        }
13087        CacheVolume {
13088            proc: self.proc.clone(),
13089            selection: query,
13090            graphql_client: self.graphql_client.clone(),
13091        }
13092    }
13093    /// Creates an empty changeset
13094    pub fn changeset(&self) -> Changeset {
13095        let query = self.selection.select("changeset");
13096        Changeset {
13097            proc: self.proc.clone(),
13098            selection: query,
13099            graphql_client: self.graphql_client.clone(),
13100        }
13101    }
13102    /// Dagger Cloud configuration and state
13103    pub fn cloud(&self) -> Cloud {
13104        let query = self.selection.select("cloud");
13105        Cloud {
13106            proc: self.proc.clone(),
13107            selection: query,
13108            graphql_client: self.graphql_client.clone(),
13109        }
13110    }
13111    /// Creates a scratch container, with no image or metadata.
13112    /// To pull an image, follow up with the "from" function.
13113    ///
13114    /// # Arguments
13115    ///
13116    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13117    pub fn container(&self) -> Container {
13118        let query = self.selection.select("container");
13119        Container {
13120            proc: self.proc.clone(),
13121            selection: query,
13122            graphql_client: self.graphql_client.clone(),
13123        }
13124    }
13125    /// Creates a scratch container, with no image or metadata.
13126    /// To pull an image, follow up with the "from" function.
13127    ///
13128    /// # Arguments
13129    ///
13130    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13131    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
13132        let mut query = self.selection.select("container");
13133        if let Some(platform) = opts.platform {
13134            query = query.arg("platform", platform);
13135        }
13136        Container {
13137            proc: self.proc.clone(),
13138            selection: query,
13139            graphql_client: self.graphql_client.clone(),
13140        }
13141    }
13142    /// Returns the current environment
13143    /// 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.
13144    /// 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.
13145    pub fn current_env(&self) -> Env {
13146        let query = self.selection.select("currentEnv");
13147        Env {
13148            proc: self.proc.clone(),
13149            selection: query,
13150            graphql_client: self.graphql_client.clone(),
13151        }
13152    }
13153    /// The FunctionCall context that the SDK caller is currently executing in.
13154    /// If the caller is not currently executing in a function, this will return an error.
13155    pub fn current_function_call(&self) -> FunctionCall {
13156        let query = self.selection.select("currentFunctionCall");
13157        FunctionCall {
13158            proc: self.proc.clone(),
13159            selection: query,
13160            graphql_client: self.graphql_client.clone(),
13161        }
13162    }
13163    /// The module currently being served in the session, if any.
13164    pub fn current_module(&self) -> CurrentModule {
13165        let query = self.selection.select("currentModule");
13166        CurrentModule {
13167            proc: self.proc.clone(),
13168            selection: query,
13169            graphql_client: self.graphql_client.clone(),
13170        }
13171    }
13172    /// The TypeDef representations of the objects currently being served in the session.
13173    ///
13174    /// # Arguments
13175    ///
13176    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13177    pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
13178        let query = self.selection.select("currentTypeDefs");
13179        let query = query.select("id");
13180        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13181        Ok(ids
13182            .into_iter()
13183            .map(|id| TypeDef {
13184                proc: self.proc.clone(),
13185                selection: crate::querybuilder::query()
13186                    .select("node")
13187                    .arg("id", &id.0)
13188                    .inline_fragment("TypeDef"),
13189                graphql_client: self.graphql_client.clone(),
13190            })
13191            .collect())
13192    }
13193    /// The TypeDef representations of the objects currently being served in the session.
13194    ///
13195    /// # Arguments
13196    ///
13197    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13198    pub async fn current_type_defs_opts(
13199        &self,
13200        opts: QueryCurrentTypeDefsOpts,
13201    ) -> Result<Vec<TypeDef>, DaggerError> {
13202        let mut query = self.selection.select("currentTypeDefs");
13203        if let Some(return_all_types) = opts.return_all_types {
13204            query = query.arg("returnAllTypes", return_all_types);
13205        }
13206        if let Some(hide_core) = opts.hide_core {
13207            query = query.arg("hideCore", hide_core);
13208        }
13209        let query = query.select("id");
13210        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13211        Ok(ids
13212            .into_iter()
13213            .map(|id| TypeDef {
13214                proc: self.proc.clone(),
13215                selection: crate::querybuilder::query()
13216                    .select("node")
13217                    .arg("id", &id.0)
13218                    .inline_fragment("TypeDef"),
13219                graphql_client: self.graphql_client.clone(),
13220            })
13221            .collect())
13222    }
13223    /// Detect and return the current workspace.
13224    pub fn current_workspace(&self) -> Workspace {
13225        let query = self.selection.select("currentWorkspace");
13226        Workspace {
13227            proc: self.proc.clone(),
13228            selection: query,
13229            graphql_client: self.graphql_client.clone(),
13230        }
13231    }
13232    /// The default platform of the engine.
13233    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
13234        let query = self.selection.select("defaultPlatform");
13235        query.execute(self.graphql_client.clone()).await
13236    }
13237    /// Creates an empty directory.
13238    pub fn directory(&self) -> Directory {
13239        let query = self.selection.select("directory");
13240        Directory {
13241            proc: self.proc.clone(),
13242            selection: query,
13243            graphql_client: self.graphql_client.clone(),
13244        }
13245    }
13246    /// The Dagger engine container configuration and state
13247    pub fn engine(&self) -> Engine {
13248        let query = self.selection.select("engine");
13249        Engine {
13250            proc: self.proc.clone(),
13251            selection: query,
13252            graphql_client: self.graphql_client.clone(),
13253        }
13254    }
13255    /// Initializes a new environment
13256    ///
13257    /// # Arguments
13258    ///
13259    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13260    pub fn env(&self) -> Env {
13261        let query = self.selection.select("env");
13262        Env {
13263            proc: self.proc.clone(),
13264            selection: query,
13265            graphql_client: self.graphql_client.clone(),
13266        }
13267    }
13268    /// Initializes a new environment
13269    ///
13270    /// # Arguments
13271    ///
13272    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13273    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
13274        let mut query = self.selection.select("env");
13275        if let Some(privileged) = opts.privileged {
13276            query = query.arg("privileged", privileged);
13277        }
13278        if let Some(writable) = opts.writable {
13279            query = query.arg("writable", writable);
13280        }
13281        Env {
13282            proc: self.proc.clone(),
13283            selection: query,
13284            graphql_client: self.graphql_client.clone(),
13285        }
13286    }
13287    /// Initialize an environment file
13288    ///
13289    /// # Arguments
13290    ///
13291    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13292    pub fn env_file(&self) -> EnvFile {
13293        let query = self.selection.select("envFile");
13294        EnvFile {
13295            proc: self.proc.clone(),
13296            selection: query,
13297            graphql_client: self.graphql_client.clone(),
13298        }
13299    }
13300    /// Initialize an environment file
13301    ///
13302    /// # Arguments
13303    ///
13304    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13305    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
13306        let mut query = self.selection.select("envFile");
13307        if let Some(expand) = opts.expand {
13308            query = query.arg("expand", expand);
13309        }
13310        EnvFile {
13311            proc: self.proc.clone(),
13312            selection: query,
13313            graphql_client: self.graphql_client.clone(),
13314        }
13315    }
13316    /// Create a new error.
13317    ///
13318    /// # Arguments
13319    ///
13320    /// * `message` - A brief description of the error.
13321    pub fn error(&self, message: impl Into<String>) -> Error {
13322        let mut query = self.selection.select("error");
13323        query = query.arg("message", message.into());
13324        Error {
13325            proc: self.proc.clone(),
13326            selection: query,
13327            graphql_client: self.graphql_client.clone(),
13328        }
13329    }
13330    /// Creates a file with the specified contents.
13331    ///
13332    /// # Arguments
13333    ///
13334    /// * `name` - Name of the new file. Example: "foo.txt"
13335    /// * `contents` - Contents of the new file. Example: "Hello world!"
13336    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13337    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
13338        let mut query = self.selection.select("file");
13339        query = query.arg("name", name.into());
13340        query = query.arg("contents", contents.into());
13341        File {
13342            proc: self.proc.clone(),
13343            selection: query,
13344            graphql_client: self.graphql_client.clone(),
13345        }
13346    }
13347    /// Creates a file with the specified contents.
13348    ///
13349    /// # Arguments
13350    ///
13351    /// * `name` - Name of the new file. Example: "foo.txt"
13352    /// * `contents` - Contents of the new file. Example: "Hello world!"
13353    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13354    pub fn file_opts(
13355        &self,
13356        name: impl Into<String>,
13357        contents: impl Into<String>,
13358        opts: QueryFileOpts,
13359    ) -> File {
13360        let mut query = self.selection.select("file");
13361        query = query.arg("name", name.into());
13362        query = query.arg("contents", contents.into());
13363        if let Some(permissions) = opts.permissions {
13364            query = query.arg("permissions", permissions);
13365        }
13366        File {
13367            proc: self.proc.clone(),
13368            selection: query,
13369            graphql_client: self.graphql_client.clone(),
13370        }
13371    }
13372    /// Creates a function.
13373    ///
13374    /// # Arguments
13375    ///
13376    /// * `name` - Name of the function, in its original format from the implementation language.
13377    /// * `return_type` - Return type of the function.
13378    pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
13379        let mut query = self.selection.select("function");
13380        query = query.arg("name", name.into());
13381        query = query.arg_lazy(
13382            "returnType",
13383            Box::new(move || {
13384                let return_type = return_type.clone();
13385                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
13386            }),
13387        );
13388        Function {
13389            proc: self.proc.clone(),
13390            selection: query,
13391            graphql_client: self.graphql_client.clone(),
13392        }
13393    }
13394    /// Create a code generation result, given a directory containing the generated code.
13395    pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
13396        let mut query = self.selection.select("generatedCode");
13397        query = query.arg_lazy(
13398            "code",
13399            Box::new(move || {
13400                let code = code.clone();
13401                Box::pin(async move { code.into_id().await.unwrap().quote() })
13402            }),
13403        );
13404        GeneratedCode {
13405            proc: self.proc.clone(),
13406            selection: query,
13407            graphql_client: self.graphql_client.clone(),
13408        }
13409    }
13410    /// Queries a Git repository.
13411    ///
13412    /// # Arguments
13413    ///
13414    /// * `url` - URL of the git repository.
13415    ///
13416    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
13417    ///
13418    /// Suffix ".git" is optional.
13419    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13420    pub fn git(&self, url: impl Into<String>) -> GitRepository {
13421        let mut query = self.selection.select("git");
13422        query = query.arg("url", url.into());
13423        GitRepository {
13424            proc: self.proc.clone(),
13425            selection: query,
13426            graphql_client: self.graphql_client.clone(),
13427        }
13428    }
13429    /// Queries a Git repository.
13430    ///
13431    /// # Arguments
13432    ///
13433    /// * `url` - URL of the git repository.
13434    ///
13435    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
13436    ///
13437    /// Suffix ".git" is optional.
13438    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13439    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
13440        let mut query = self.selection.select("git");
13441        query = query.arg("url", url.into());
13442        if let Some(keep_git_dir) = opts.keep_git_dir {
13443            query = query.arg("keepGitDir", keep_git_dir);
13444        }
13445        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
13446            query = query.arg("sshKnownHosts", ssh_known_hosts);
13447        }
13448        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
13449            query = query.arg("sshAuthSocket", ssh_auth_socket);
13450        }
13451        if let Some(http_auth_username) = opts.http_auth_username {
13452            query = query.arg("httpAuthUsername", http_auth_username);
13453        }
13454        if let Some(http_auth_token) = opts.http_auth_token {
13455            query = query.arg("httpAuthToken", http_auth_token);
13456        }
13457        if let Some(http_auth_header) = opts.http_auth_header {
13458            query = query.arg("httpAuthHeader", http_auth_header);
13459        }
13460        if let Some(experimental_service_host) = opts.experimental_service_host {
13461            query = query.arg("experimentalServiceHost", experimental_service_host);
13462        }
13463        GitRepository {
13464            proc: self.proc.clone(),
13465            selection: query,
13466            graphql_client: self.graphql_client.clone(),
13467        }
13468    }
13469    /// Queries the host environment.
13470    pub fn host(&self) -> Host {
13471        let query = self.selection.select("host");
13472        Host {
13473            proc: self.proc.clone(),
13474            selection: query,
13475            graphql_client: self.graphql_client.clone(),
13476        }
13477    }
13478    /// Returns a file containing an http remote url content.
13479    ///
13480    /// # Arguments
13481    ///
13482    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
13483    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13484    pub fn http(&self, url: impl Into<String>) -> File {
13485        let mut query = self.selection.select("http");
13486        query = query.arg("url", url.into());
13487        File {
13488            proc: self.proc.clone(),
13489            selection: query,
13490            graphql_client: self.graphql_client.clone(),
13491        }
13492    }
13493    /// Returns a file containing an http remote url content.
13494    ///
13495    /// # Arguments
13496    ///
13497    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
13498    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13499    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
13500        let mut query = self.selection.select("http");
13501        query = query.arg("url", url.into());
13502        if let Some(name) = opts.name {
13503            query = query.arg("name", name);
13504        }
13505        if let Some(permissions) = opts.permissions {
13506            query = query.arg("permissions", permissions);
13507        }
13508        if let Some(checksum) = opts.checksum {
13509            query = query.arg("checksum", checksum);
13510        }
13511        if let Some(auth_header) = opts.auth_header {
13512            query = query.arg("authHeader", auth_header);
13513        }
13514        if let Some(experimental_service_host) = opts.experimental_service_host {
13515            query = query.arg("experimentalServiceHost", experimental_service_host);
13516        }
13517        File {
13518            proc: self.proc.clone(),
13519            selection: query,
13520            graphql_client: self.graphql_client.clone(),
13521        }
13522    }
13523    /// A unique identifier for this Query.
13524    pub async fn id(&self) -> Result<Id, DaggerError> {
13525        let query = self.selection.select("id");
13526        query.execute(self.graphql_client.clone()).await
13527    }
13528    /// Initialize a JSON value
13529    pub fn json(&self) -> JsonValue {
13530        let query = self.selection.select("json");
13531        JsonValue {
13532            proc: self.proc.clone(),
13533            selection: query,
13534            graphql_client: self.graphql_client.clone(),
13535        }
13536    }
13537    /// Initialize a Large Language Model (LLM)
13538    ///
13539    /// # Arguments
13540    ///
13541    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13542    pub fn llm(&self) -> Llm {
13543        let query = self.selection.select("llm");
13544        Llm {
13545            proc: self.proc.clone(),
13546            selection: query,
13547            graphql_client: self.graphql_client.clone(),
13548        }
13549    }
13550    /// Initialize a Large Language Model (LLM)
13551    ///
13552    /// # Arguments
13553    ///
13554    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13555    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
13556        let mut query = self.selection.select("llm");
13557        if let Some(model) = opts.model {
13558            query = query.arg("model", model);
13559        }
13560        if let Some(max_api_calls) = opts.max_api_calls {
13561            query = query.arg("maxAPICalls", max_api_calls);
13562        }
13563        Llm {
13564            proc: self.proc.clone(),
13565            selection: query,
13566            graphql_client: self.graphql_client.clone(),
13567        }
13568    }
13569    /// Load a Address from its ID.
13570    pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
13571        let mut query = self.selection.select("loadAddressFromID");
13572        query = query.arg_lazy(
13573            "id",
13574            Box::new(move || {
13575                let id = id.clone();
13576                Box::pin(async move { id.into_id().await.unwrap().quote() })
13577            }),
13578        );
13579        Address {
13580            proc: self.proc.clone(),
13581            selection: query,
13582            graphql_client: self.graphql_client.clone(),
13583        }
13584    }
13585    /// Load a Binding from its ID.
13586    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
13587        let mut query = self.selection.select("loadBindingFromID");
13588        query = query.arg_lazy(
13589            "id",
13590            Box::new(move || {
13591                let id = id.clone();
13592                Box::pin(async move { id.into_id().await.unwrap().quote() })
13593            }),
13594        );
13595        Binding {
13596            proc: self.proc.clone(),
13597            selection: query,
13598            graphql_client: self.graphql_client.clone(),
13599        }
13600    }
13601    /// Load a CacheVolume from its ID.
13602    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
13603        let mut query = self.selection.select("loadCacheVolumeFromID");
13604        query = query.arg_lazy(
13605            "id",
13606            Box::new(move || {
13607                let id = id.clone();
13608                Box::pin(async move { id.into_id().await.unwrap().quote() })
13609            }),
13610        );
13611        CacheVolume {
13612            proc: self.proc.clone(),
13613            selection: query,
13614            graphql_client: self.graphql_client.clone(),
13615        }
13616    }
13617    /// Load a Changeset from its ID.
13618    pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
13619        let mut query = self.selection.select("loadChangesetFromID");
13620        query = query.arg_lazy(
13621            "id",
13622            Box::new(move || {
13623                let id = id.clone();
13624                Box::pin(async move { id.into_id().await.unwrap().quote() })
13625            }),
13626        );
13627        Changeset {
13628            proc: self.proc.clone(),
13629            selection: query,
13630            graphql_client: self.graphql_client.clone(),
13631        }
13632    }
13633    /// Load a Check from its ID.
13634    pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
13635        let mut query = self.selection.select("loadCheckFromID");
13636        query = query.arg_lazy(
13637            "id",
13638            Box::new(move || {
13639                let id = id.clone();
13640                Box::pin(async move { id.into_id().await.unwrap().quote() })
13641            }),
13642        );
13643        Check {
13644            proc: self.proc.clone(),
13645            selection: query,
13646            graphql_client: self.graphql_client.clone(),
13647        }
13648    }
13649    /// Load a CheckGroup from its ID.
13650    pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
13651        let mut query = self.selection.select("loadCheckGroupFromID");
13652        query = query.arg_lazy(
13653            "id",
13654            Box::new(move || {
13655                let id = id.clone();
13656                Box::pin(async move { id.into_id().await.unwrap().quote() })
13657            }),
13658        );
13659        CheckGroup {
13660            proc: self.proc.clone(),
13661            selection: query,
13662            graphql_client: self.graphql_client.clone(),
13663        }
13664    }
13665    /// Load a ClientFilesyncMirror from its ID.
13666    pub fn load_client_filesync_mirror_from_id(
13667        &self,
13668        id: impl IntoID<ClientFilesyncMirrorId>,
13669    ) -> ClientFilesyncMirror {
13670        let mut query = self.selection.select("loadClientFilesyncMirrorFromID");
13671        query = query.arg_lazy(
13672            "id",
13673            Box::new(move || {
13674                let id = id.clone();
13675                Box::pin(async move { id.into_id().await.unwrap().quote() })
13676            }),
13677        );
13678        ClientFilesyncMirror {
13679            proc: self.proc.clone(),
13680            selection: query,
13681            graphql_client: self.graphql_client.clone(),
13682        }
13683    }
13684    /// Load a Cloud from its ID.
13685    pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
13686        let mut query = self.selection.select("loadCloudFromID");
13687        query = query.arg_lazy(
13688            "id",
13689            Box::new(move || {
13690                let id = id.clone();
13691                Box::pin(async move { id.into_id().await.unwrap().quote() })
13692            }),
13693        );
13694        Cloud {
13695            proc: self.proc.clone(),
13696            selection: query,
13697            graphql_client: self.graphql_client.clone(),
13698        }
13699    }
13700    /// Load a Container from its ID.
13701    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
13702        let mut query = self.selection.select("loadContainerFromID");
13703        query = query.arg_lazy(
13704            "id",
13705            Box::new(move || {
13706                let id = id.clone();
13707                Box::pin(async move { id.into_id().await.unwrap().quote() })
13708            }),
13709        );
13710        Container {
13711            proc: self.proc.clone(),
13712            selection: query,
13713            graphql_client: self.graphql_client.clone(),
13714        }
13715    }
13716    /// Load a CurrentModule from its ID.
13717    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
13718        let mut query = self.selection.select("loadCurrentModuleFromID");
13719        query = query.arg_lazy(
13720            "id",
13721            Box::new(move || {
13722                let id = id.clone();
13723                Box::pin(async move { id.into_id().await.unwrap().quote() })
13724            }),
13725        );
13726        CurrentModule {
13727            proc: self.proc.clone(),
13728            selection: query,
13729            graphql_client: self.graphql_client.clone(),
13730        }
13731    }
13732    /// Load a DiffStat from its ID.
13733    pub fn load_diff_stat_from_id(&self, id: impl IntoID<DiffStatId>) -> DiffStat {
13734        let mut query = self.selection.select("loadDiffStatFromID");
13735        query = query.arg_lazy(
13736            "id",
13737            Box::new(move || {
13738                let id = id.clone();
13739                Box::pin(async move { id.into_id().await.unwrap().quote() })
13740            }),
13741        );
13742        DiffStat {
13743            proc: self.proc.clone(),
13744            selection: query,
13745            graphql_client: self.graphql_client.clone(),
13746        }
13747    }
13748    /// Load a Directory from its ID.
13749    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
13750        let mut query = self.selection.select("loadDirectoryFromID");
13751        query = query.arg_lazy(
13752            "id",
13753            Box::new(move || {
13754                let id = id.clone();
13755                Box::pin(async move { id.into_id().await.unwrap().quote() })
13756            }),
13757        );
13758        Directory {
13759            proc: self.proc.clone(),
13760            selection: query,
13761            graphql_client: self.graphql_client.clone(),
13762        }
13763    }
13764    /// Load a EngineCacheEntry from its ID.
13765    pub fn load_engine_cache_entry_from_id(
13766        &self,
13767        id: impl IntoID<EngineCacheEntryId>,
13768    ) -> EngineCacheEntry {
13769        let mut query = self.selection.select("loadEngineCacheEntryFromID");
13770        query = query.arg_lazy(
13771            "id",
13772            Box::new(move || {
13773                let id = id.clone();
13774                Box::pin(async move { id.into_id().await.unwrap().quote() })
13775            }),
13776        );
13777        EngineCacheEntry {
13778            proc: self.proc.clone(),
13779            selection: query,
13780            graphql_client: self.graphql_client.clone(),
13781        }
13782    }
13783    /// Load a EngineCacheEntrySet from its ID.
13784    pub fn load_engine_cache_entry_set_from_id(
13785        &self,
13786        id: impl IntoID<EngineCacheEntrySetId>,
13787    ) -> EngineCacheEntrySet {
13788        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
13789        query = query.arg_lazy(
13790            "id",
13791            Box::new(move || {
13792                let id = id.clone();
13793                Box::pin(async move { id.into_id().await.unwrap().quote() })
13794            }),
13795        );
13796        EngineCacheEntrySet {
13797            proc: self.proc.clone(),
13798            selection: query,
13799            graphql_client: self.graphql_client.clone(),
13800        }
13801    }
13802    /// Load a EngineCache from its ID.
13803    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
13804        let mut query = self.selection.select("loadEngineCacheFromID");
13805        query = query.arg_lazy(
13806            "id",
13807            Box::new(move || {
13808                let id = id.clone();
13809                Box::pin(async move { id.into_id().await.unwrap().quote() })
13810            }),
13811        );
13812        EngineCache {
13813            proc: self.proc.clone(),
13814            selection: query,
13815            graphql_client: self.graphql_client.clone(),
13816        }
13817    }
13818    /// Load a Engine from its ID.
13819    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
13820        let mut query = self.selection.select("loadEngineFromID");
13821        query = query.arg_lazy(
13822            "id",
13823            Box::new(move || {
13824                let id = id.clone();
13825                Box::pin(async move { id.into_id().await.unwrap().quote() })
13826            }),
13827        );
13828        Engine {
13829            proc: self.proc.clone(),
13830            selection: query,
13831            graphql_client: self.graphql_client.clone(),
13832        }
13833    }
13834    /// Load a EnumTypeDef from its ID.
13835    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
13836        let mut query = self.selection.select("loadEnumTypeDefFromID");
13837        query = query.arg_lazy(
13838            "id",
13839            Box::new(move || {
13840                let id = id.clone();
13841                Box::pin(async move { id.into_id().await.unwrap().quote() })
13842            }),
13843        );
13844        EnumTypeDef {
13845            proc: self.proc.clone(),
13846            selection: query,
13847            graphql_client: self.graphql_client.clone(),
13848        }
13849    }
13850    /// Load a EnumValueTypeDef from its ID.
13851    pub fn load_enum_value_type_def_from_id(
13852        &self,
13853        id: impl IntoID<EnumValueTypeDefId>,
13854    ) -> EnumValueTypeDef {
13855        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
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        EnumValueTypeDef {
13864            proc: self.proc.clone(),
13865            selection: query,
13866            graphql_client: self.graphql_client.clone(),
13867        }
13868    }
13869    /// Load a EnvFile from its ID.
13870    pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
13871        let mut query = self.selection.select("loadEnvFileFromID");
13872        query = query.arg_lazy(
13873            "id",
13874            Box::new(move || {
13875                let id = id.clone();
13876                Box::pin(async move { id.into_id().await.unwrap().quote() })
13877            }),
13878        );
13879        EnvFile {
13880            proc: self.proc.clone(),
13881            selection: query,
13882            graphql_client: self.graphql_client.clone(),
13883        }
13884    }
13885    /// Load a Env from its ID.
13886    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
13887        let mut query = self.selection.select("loadEnvFromID");
13888        query = query.arg_lazy(
13889            "id",
13890            Box::new(move || {
13891                let id = id.clone();
13892                Box::pin(async move { id.into_id().await.unwrap().quote() })
13893            }),
13894        );
13895        Env {
13896            proc: self.proc.clone(),
13897            selection: query,
13898            graphql_client: self.graphql_client.clone(),
13899        }
13900    }
13901    /// Load a EnvVariable from its ID.
13902    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
13903        let mut query = self.selection.select("loadEnvVariableFromID");
13904        query = query.arg_lazy(
13905            "id",
13906            Box::new(move || {
13907                let id = id.clone();
13908                Box::pin(async move { id.into_id().await.unwrap().quote() })
13909            }),
13910        );
13911        EnvVariable {
13912            proc: self.proc.clone(),
13913            selection: query,
13914            graphql_client: self.graphql_client.clone(),
13915        }
13916    }
13917    /// Load a Error from its ID.
13918    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
13919        let mut query = self.selection.select("loadErrorFromID");
13920        query = query.arg_lazy(
13921            "id",
13922            Box::new(move || {
13923                let id = id.clone();
13924                Box::pin(async move { id.into_id().await.unwrap().quote() })
13925            }),
13926        );
13927        Error {
13928            proc: self.proc.clone(),
13929            selection: query,
13930            graphql_client: self.graphql_client.clone(),
13931        }
13932    }
13933    /// Load a ErrorValue from its ID.
13934    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
13935        let mut query = self.selection.select("loadErrorValueFromID");
13936        query = query.arg_lazy(
13937            "id",
13938            Box::new(move || {
13939                let id = id.clone();
13940                Box::pin(async move { id.into_id().await.unwrap().quote() })
13941            }),
13942        );
13943        ErrorValue {
13944            proc: self.proc.clone(),
13945            selection: query,
13946            graphql_client: self.graphql_client.clone(),
13947        }
13948    }
13949    /// Load a Exportable from its ID.
13950    pub fn load_exportable_from_id(&self, id: impl IntoID<ExportableId>) -> ExportableClient {
13951        let mut query = self.selection.select("loadExportableFromID");
13952        query = query.arg_lazy(
13953            "id",
13954            Box::new(move || {
13955                let id = id.clone();
13956                Box::pin(async move { id.into_id().await.unwrap().quote() })
13957            }),
13958        );
13959        ExportableClient {
13960            proc: self.proc.clone(),
13961            selection: query,
13962            graphql_client: self.graphql_client.clone(),
13963        }
13964    }
13965    /// Load a FieldTypeDef from its ID.
13966    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
13967        let mut query = self.selection.select("loadFieldTypeDefFromID");
13968        query = query.arg_lazy(
13969            "id",
13970            Box::new(move || {
13971                let id = id.clone();
13972                Box::pin(async move { id.into_id().await.unwrap().quote() })
13973            }),
13974        );
13975        FieldTypeDef {
13976            proc: self.proc.clone(),
13977            selection: query,
13978            graphql_client: self.graphql_client.clone(),
13979        }
13980    }
13981    /// Load a File from its ID.
13982    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
13983        let mut query = self.selection.select("loadFileFromID");
13984        query = query.arg_lazy(
13985            "id",
13986            Box::new(move || {
13987                let id = id.clone();
13988                Box::pin(async move { id.into_id().await.unwrap().quote() })
13989            }),
13990        );
13991        File {
13992            proc: self.proc.clone(),
13993            selection: query,
13994            graphql_client: self.graphql_client.clone(),
13995        }
13996    }
13997    /// Load a FunctionArg from its ID.
13998    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
13999        let mut query = self.selection.select("loadFunctionArgFromID");
14000        query = query.arg_lazy(
14001            "id",
14002            Box::new(move || {
14003                let id = id.clone();
14004                Box::pin(async move { id.into_id().await.unwrap().quote() })
14005            }),
14006        );
14007        FunctionArg {
14008            proc: self.proc.clone(),
14009            selection: query,
14010            graphql_client: self.graphql_client.clone(),
14011        }
14012    }
14013    /// Load a FunctionCallArgValue from its ID.
14014    pub fn load_function_call_arg_value_from_id(
14015        &self,
14016        id: impl IntoID<FunctionCallArgValueId>,
14017    ) -> FunctionCallArgValue {
14018        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
14019        query = query.arg_lazy(
14020            "id",
14021            Box::new(move || {
14022                let id = id.clone();
14023                Box::pin(async move { id.into_id().await.unwrap().quote() })
14024            }),
14025        );
14026        FunctionCallArgValue {
14027            proc: self.proc.clone(),
14028            selection: query,
14029            graphql_client: self.graphql_client.clone(),
14030        }
14031    }
14032    /// Load a FunctionCall from its ID.
14033    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
14034        let mut query = self.selection.select("loadFunctionCallFromID");
14035        query = query.arg_lazy(
14036            "id",
14037            Box::new(move || {
14038                let id = id.clone();
14039                Box::pin(async move { id.into_id().await.unwrap().quote() })
14040            }),
14041        );
14042        FunctionCall {
14043            proc: self.proc.clone(),
14044            selection: query,
14045            graphql_client: self.graphql_client.clone(),
14046        }
14047    }
14048    /// Load a Function from its ID.
14049    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
14050        let mut query = self.selection.select("loadFunctionFromID");
14051        query = query.arg_lazy(
14052            "id",
14053            Box::new(move || {
14054                let id = id.clone();
14055                Box::pin(async move { id.into_id().await.unwrap().quote() })
14056            }),
14057        );
14058        Function {
14059            proc: self.proc.clone(),
14060            selection: query,
14061            graphql_client: self.graphql_client.clone(),
14062        }
14063    }
14064    /// Load a GeneratedCode from its ID.
14065    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
14066        let mut query = self.selection.select("loadGeneratedCodeFromID");
14067        query = query.arg_lazy(
14068            "id",
14069            Box::new(move || {
14070                let id = id.clone();
14071                Box::pin(async move { id.into_id().await.unwrap().quote() })
14072            }),
14073        );
14074        GeneratedCode {
14075            proc: self.proc.clone(),
14076            selection: query,
14077            graphql_client: self.graphql_client.clone(),
14078        }
14079    }
14080    /// Load a Generator from its ID.
14081    pub fn load_generator_from_id(&self, id: impl IntoID<GeneratorId>) -> Generator {
14082        let mut query = self.selection.select("loadGeneratorFromID");
14083        query = query.arg_lazy(
14084            "id",
14085            Box::new(move || {
14086                let id = id.clone();
14087                Box::pin(async move { id.into_id().await.unwrap().quote() })
14088            }),
14089        );
14090        Generator {
14091            proc: self.proc.clone(),
14092            selection: query,
14093            graphql_client: self.graphql_client.clone(),
14094        }
14095    }
14096    /// Load a GeneratorGroup from its ID.
14097    pub fn load_generator_group_from_id(
14098        &self,
14099        id: impl IntoID<GeneratorGroupId>,
14100    ) -> GeneratorGroup {
14101        let mut query = self.selection.select("loadGeneratorGroupFromID");
14102        query = query.arg_lazy(
14103            "id",
14104            Box::new(move || {
14105                let id = id.clone();
14106                Box::pin(async move { id.into_id().await.unwrap().quote() })
14107            }),
14108        );
14109        GeneratorGroup {
14110            proc: self.proc.clone(),
14111            selection: query,
14112            graphql_client: self.graphql_client.clone(),
14113        }
14114    }
14115    /// Load a GitRef from its ID.
14116    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
14117        let mut query = self.selection.select("loadGitRefFromID");
14118        query = query.arg_lazy(
14119            "id",
14120            Box::new(move || {
14121                let id = id.clone();
14122                Box::pin(async move { id.into_id().await.unwrap().quote() })
14123            }),
14124        );
14125        GitRef {
14126            proc: self.proc.clone(),
14127            selection: query,
14128            graphql_client: self.graphql_client.clone(),
14129        }
14130    }
14131    /// Load a GitRepository from its ID.
14132    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
14133        let mut query = self.selection.select("loadGitRepositoryFromID");
14134        query = query.arg_lazy(
14135            "id",
14136            Box::new(move || {
14137                let id = id.clone();
14138                Box::pin(async move { id.into_id().await.unwrap().quote() })
14139            }),
14140        );
14141        GitRepository {
14142            proc: self.proc.clone(),
14143            selection: query,
14144            graphql_client: self.graphql_client.clone(),
14145        }
14146    }
14147    /// Load a HTTPState from its ID.
14148    pub fn load_http_state_from_id(&self, id: impl IntoID<HttpStateId>) -> HttpState {
14149        let mut query = self.selection.select("loadHTTPStateFromID");
14150        query = query.arg_lazy(
14151            "id",
14152            Box::new(move || {
14153                let id = id.clone();
14154                Box::pin(async move { id.into_id().await.unwrap().quote() })
14155            }),
14156        );
14157        HttpState {
14158            proc: self.proc.clone(),
14159            selection: query,
14160            graphql_client: self.graphql_client.clone(),
14161        }
14162    }
14163    /// Load a HealthcheckConfig from its ID.
14164    pub fn load_healthcheck_config_from_id(
14165        &self,
14166        id: impl IntoID<HealthcheckConfigId>,
14167    ) -> HealthcheckConfig {
14168        let mut query = self.selection.select("loadHealthcheckConfigFromID");
14169        query = query.arg_lazy(
14170            "id",
14171            Box::new(move || {
14172                let id = id.clone();
14173                Box::pin(async move { id.into_id().await.unwrap().quote() })
14174            }),
14175        );
14176        HealthcheckConfig {
14177            proc: self.proc.clone(),
14178            selection: query,
14179            graphql_client: self.graphql_client.clone(),
14180        }
14181    }
14182    /// Load a Host from its ID.
14183    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
14184        let mut query = self.selection.select("loadHostFromID");
14185        query = query.arg_lazy(
14186            "id",
14187            Box::new(move || {
14188                let id = id.clone();
14189                Box::pin(async move { id.into_id().await.unwrap().quote() })
14190            }),
14191        );
14192        Host {
14193            proc: self.proc.clone(),
14194            selection: query,
14195            graphql_client: self.graphql_client.clone(),
14196        }
14197    }
14198    /// Load a InputTypeDef from its ID.
14199    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
14200        let mut query = self.selection.select("loadInputTypeDefFromID");
14201        query = query.arg_lazy(
14202            "id",
14203            Box::new(move || {
14204                let id = id.clone();
14205                Box::pin(async move { id.into_id().await.unwrap().quote() })
14206            }),
14207        );
14208        InputTypeDef {
14209            proc: self.proc.clone(),
14210            selection: query,
14211            graphql_client: self.graphql_client.clone(),
14212        }
14213    }
14214    /// Load a InterfaceTypeDef from its ID.
14215    pub fn load_interface_type_def_from_id(
14216        &self,
14217        id: impl IntoID<InterfaceTypeDefId>,
14218    ) -> InterfaceTypeDef {
14219        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
14220        query = query.arg_lazy(
14221            "id",
14222            Box::new(move || {
14223                let id = id.clone();
14224                Box::pin(async move { id.into_id().await.unwrap().quote() })
14225            }),
14226        );
14227        InterfaceTypeDef {
14228            proc: self.proc.clone(),
14229            selection: query,
14230            graphql_client: self.graphql_client.clone(),
14231        }
14232    }
14233    /// Load a JSONValue from its ID.
14234    pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
14235        let mut query = self.selection.select("loadJSONValueFromID");
14236        query = query.arg_lazy(
14237            "id",
14238            Box::new(move || {
14239                let id = id.clone();
14240                Box::pin(async move { id.into_id().await.unwrap().quote() })
14241            }),
14242        );
14243        JsonValue {
14244            proc: self.proc.clone(),
14245            selection: query,
14246            graphql_client: self.graphql_client.clone(),
14247        }
14248    }
14249    /// Load a LLM from its ID.
14250    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
14251        let mut query = self.selection.select("loadLLMFromID");
14252        query = query.arg_lazy(
14253            "id",
14254            Box::new(move || {
14255                let id = id.clone();
14256                Box::pin(async move { id.into_id().await.unwrap().quote() })
14257            }),
14258        );
14259        Llm {
14260            proc: self.proc.clone(),
14261            selection: query,
14262            graphql_client: self.graphql_client.clone(),
14263        }
14264    }
14265    /// Load a LLMTokenUsage from its ID.
14266    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
14267        let mut query = self.selection.select("loadLLMTokenUsageFromID");
14268        query = query.arg_lazy(
14269            "id",
14270            Box::new(move || {
14271                let id = id.clone();
14272                Box::pin(async move { id.into_id().await.unwrap().quote() })
14273            }),
14274        );
14275        LlmTokenUsage {
14276            proc: self.proc.clone(),
14277            selection: query,
14278            graphql_client: self.graphql_client.clone(),
14279        }
14280    }
14281    /// Load a Label from its ID.
14282    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
14283        let mut query = self.selection.select("loadLabelFromID");
14284        query = query.arg_lazy(
14285            "id",
14286            Box::new(move || {
14287                let id = id.clone();
14288                Box::pin(async move { id.into_id().await.unwrap().quote() })
14289            }),
14290        );
14291        Label {
14292            proc: self.proc.clone(),
14293            selection: query,
14294            graphql_client: self.graphql_client.clone(),
14295        }
14296    }
14297    /// Load a ListTypeDef from its ID.
14298    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
14299        let mut query = self.selection.select("loadListTypeDefFromID");
14300        query = query.arg_lazy(
14301            "id",
14302            Box::new(move || {
14303                let id = id.clone();
14304                Box::pin(async move { id.into_id().await.unwrap().quote() })
14305            }),
14306        );
14307        ListTypeDef {
14308            proc: self.proc.clone(),
14309            selection: query,
14310            graphql_client: self.graphql_client.clone(),
14311        }
14312    }
14313    /// Load a ModuleConfigClient from its ID.
14314    pub fn load_module_config_client_from_id(
14315        &self,
14316        id: impl IntoID<ModuleConfigClientId>,
14317    ) -> ModuleConfigClient {
14318        let mut query = self.selection.select("loadModuleConfigClientFromID");
14319        query = query.arg_lazy(
14320            "id",
14321            Box::new(move || {
14322                let id = id.clone();
14323                Box::pin(async move { id.into_id().await.unwrap().quote() })
14324            }),
14325        );
14326        ModuleConfigClient {
14327            proc: self.proc.clone(),
14328            selection: query,
14329            graphql_client: self.graphql_client.clone(),
14330        }
14331    }
14332    /// Load a Module from its ID.
14333    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
14334        let mut query = self.selection.select("loadModuleFromID");
14335        query = query.arg_lazy(
14336            "id",
14337            Box::new(move || {
14338                let id = id.clone();
14339                Box::pin(async move { id.into_id().await.unwrap().quote() })
14340            }),
14341        );
14342        Module {
14343            proc: self.proc.clone(),
14344            selection: query,
14345            graphql_client: self.graphql_client.clone(),
14346        }
14347    }
14348    /// Load a ModuleSource from its ID.
14349    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
14350        let mut query = self.selection.select("loadModuleSourceFromID");
14351        query = query.arg_lazy(
14352            "id",
14353            Box::new(move || {
14354                let id = id.clone();
14355                Box::pin(async move { id.into_id().await.unwrap().quote() })
14356            }),
14357        );
14358        ModuleSource {
14359            proc: self.proc.clone(),
14360            selection: query,
14361            graphql_client: self.graphql_client.clone(),
14362        }
14363    }
14364    /// Load a ObjectTypeDef from its ID.
14365    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
14366        let mut query = self.selection.select("loadObjectTypeDefFromID");
14367        query = query.arg_lazy(
14368            "id",
14369            Box::new(move || {
14370                let id = id.clone();
14371                Box::pin(async move { id.into_id().await.unwrap().quote() })
14372            }),
14373        );
14374        ObjectTypeDef {
14375            proc: self.proc.clone(),
14376            selection: query,
14377            graphql_client: self.graphql_client.clone(),
14378        }
14379    }
14380    /// Load a Port from its ID.
14381    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
14382        let mut query = self.selection.select("loadPortFromID");
14383        query = query.arg_lazy(
14384            "id",
14385            Box::new(move || {
14386                let id = id.clone();
14387                Box::pin(async move { id.into_id().await.unwrap().quote() })
14388            }),
14389        );
14390        Port {
14391            proc: self.proc.clone(),
14392            selection: query,
14393            graphql_client: self.graphql_client.clone(),
14394        }
14395    }
14396    /// Load a RemoteGitMirror from its ID.
14397    pub fn load_remote_git_mirror_from_id(
14398        &self,
14399        id: impl IntoID<RemoteGitMirrorId>,
14400    ) -> RemoteGitMirror {
14401        let mut query = self.selection.select("loadRemoteGitMirrorFromID");
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        RemoteGitMirror {
14410            proc: self.proc.clone(),
14411            selection: query,
14412            graphql_client: self.graphql_client.clone(),
14413        }
14414    }
14415    /// Load a SDKConfig from its ID.
14416    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
14417        let mut query = self.selection.select("loadSDKConfigFromID");
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        SdkConfig {
14426            proc: self.proc.clone(),
14427            selection: query,
14428            graphql_client: self.graphql_client.clone(),
14429        }
14430    }
14431    /// Load a ScalarTypeDef from its ID.
14432    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
14433        let mut query = self.selection.select("loadScalarTypeDefFromID");
14434        query = query.arg_lazy(
14435            "id",
14436            Box::new(move || {
14437                let id = id.clone();
14438                Box::pin(async move { id.into_id().await.unwrap().quote() })
14439            }),
14440        );
14441        ScalarTypeDef {
14442            proc: self.proc.clone(),
14443            selection: query,
14444            graphql_client: self.graphql_client.clone(),
14445        }
14446    }
14447    /// Load a SearchResult from its ID.
14448    pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
14449        let mut query = self.selection.select("loadSearchResultFromID");
14450        query = query.arg_lazy(
14451            "id",
14452            Box::new(move || {
14453                let id = id.clone();
14454                Box::pin(async move { id.into_id().await.unwrap().quote() })
14455            }),
14456        );
14457        SearchResult {
14458            proc: self.proc.clone(),
14459            selection: query,
14460            graphql_client: self.graphql_client.clone(),
14461        }
14462    }
14463    /// Load a SearchSubmatch from its ID.
14464    pub fn load_search_submatch_from_id(
14465        &self,
14466        id: impl IntoID<SearchSubmatchId>,
14467    ) -> SearchSubmatch {
14468        let mut query = self.selection.select("loadSearchSubmatchFromID");
14469        query = query.arg_lazy(
14470            "id",
14471            Box::new(move || {
14472                let id = id.clone();
14473                Box::pin(async move { id.into_id().await.unwrap().quote() })
14474            }),
14475        );
14476        SearchSubmatch {
14477            proc: self.proc.clone(),
14478            selection: query,
14479            graphql_client: self.graphql_client.clone(),
14480        }
14481    }
14482    /// Load a Secret from its ID.
14483    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
14484        let mut query = self.selection.select("loadSecretFromID");
14485        query = query.arg_lazy(
14486            "id",
14487            Box::new(move || {
14488                let id = id.clone();
14489                Box::pin(async move { id.into_id().await.unwrap().quote() })
14490            }),
14491        );
14492        Secret {
14493            proc: self.proc.clone(),
14494            selection: query,
14495            graphql_client: self.graphql_client.clone(),
14496        }
14497    }
14498    /// Load a Service from its ID.
14499    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
14500        let mut query = self.selection.select("loadServiceFromID");
14501        query = query.arg_lazy(
14502            "id",
14503            Box::new(move || {
14504                let id = id.clone();
14505                Box::pin(async move { id.into_id().await.unwrap().quote() })
14506            }),
14507        );
14508        Service {
14509            proc: self.proc.clone(),
14510            selection: query,
14511            graphql_client: self.graphql_client.clone(),
14512        }
14513    }
14514    /// Load a Socket from its ID.
14515    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
14516        let mut query = self.selection.select("loadSocketFromID");
14517        query = query.arg_lazy(
14518            "id",
14519            Box::new(move || {
14520                let id = id.clone();
14521                Box::pin(async move { id.into_id().await.unwrap().quote() })
14522            }),
14523        );
14524        Socket {
14525            proc: self.proc.clone(),
14526            selection: query,
14527            graphql_client: self.graphql_client.clone(),
14528        }
14529    }
14530    /// Load a SourceMap from its ID.
14531    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
14532        let mut query = self.selection.select("loadSourceMapFromID");
14533        query = query.arg_lazy(
14534            "id",
14535            Box::new(move || {
14536                let id = id.clone();
14537                Box::pin(async move { id.into_id().await.unwrap().quote() })
14538            }),
14539        );
14540        SourceMap {
14541            proc: self.proc.clone(),
14542            selection: query,
14543            graphql_client: self.graphql_client.clone(),
14544        }
14545    }
14546    /// Load a Stat from its ID.
14547    pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
14548        let mut query = self.selection.select("loadStatFromID");
14549        query = query.arg_lazy(
14550            "id",
14551            Box::new(move || {
14552                let id = id.clone();
14553                Box::pin(async move { id.into_id().await.unwrap().quote() })
14554            }),
14555        );
14556        Stat {
14557            proc: self.proc.clone(),
14558            selection: query,
14559            graphql_client: self.graphql_client.clone(),
14560        }
14561    }
14562    /// Load a Syncer from its ID.
14563    pub fn load_syncer_from_id(&self, id: impl IntoID<SyncerId>) -> SyncerClient {
14564        let mut query = self.selection.select("loadSyncerFromID");
14565        query = query.arg_lazy(
14566            "id",
14567            Box::new(move || {
14568                let id = id.clone();
14569                Box::pin(async move { id.into_id().await.unwrap().quote() })
14570            }),
14571        );
14572        SyncerClient {
14573            proc: self.proc.clone(),
14574            selection: query,
14575            graphql_client: self.graphql_client.clone(),
14576        }
14577    }
14578    /// Load a Terminal from its ID.
14579    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
14580        let mut query = self.selection.select("loadTerminalFromID");
14581        query = query.arg_lazy(
14582            "id",
14583            Box::new(move || {
14584                let id = id.clone();
14585                Box::pin(async move { id.into_id().await.unwrap().quote() })
14586            }),
14587        );
14588        Terminal {
14589            proc: self.proc.clone(),
14590            selection: query,
14591            graphql_client: self.graphql_client.clone(),
14592        }
14593    }
14594    /// Load a TypeDef from its ID.
14595    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
14596        let mut query = self.selection.select("loadTypeDefFromID");
14597        query = query.arg_lazy(
14598            "id",
14599            Box::new(move || {
14600                let id = id.clone();
14601                Box::pin(async move { id.into_id().await.unwrap().quote() })
14602            }),
14603        );
14604        TypeDef {
14605            proc: self.proc.clone(),
14606            selection: query,
14607            graphql_client: self.graphql_client.clone(),
14608        }
14609    }
14610    /// Load a Up from its ID.
14611    pub fn load_up_from_id(&self, id: impl IntoID<UpId>) -> Up {
14612        let mut query = self.selection.select("loadUpFromID");
14613        query = query.arg_lazy(
14614            "id",
14615            Box::new(move || {
14616                let id = id.clone();
14617                Box::pin(async move { id.into_id().await.unwrap().quote() })
14618            }),
14619        );
14620        Up {
14621            proc: self.proc.clone(),
14622            selection: query,
14623            graphql_client: self.graphql_client.clone(),
14624        }
14625    }
14626    /// Load a UpGroup from its ID.
14627    pub fn load_up_group_from_id(&self, id: impl IntoID<UpGroupId>) -> UpGroup {
14628        let mut query = self.selection.select("loadUpGroupFromID");
14629        query = query.arg_lazy(
14630            "id",
14631            Box::new(move || {
14632                let id = id.clone();
14633                Box::pin(async move { id.into_id().await.unwrap().quote() })
14634            }),
14635        );
14636        UpGroup {
14637            proc: self.proc.clone(),
14638            selection: query,
14639            graphql_client: self.graphql_client.clone(),
14640        }
14641    }
14642    /// Load a Volume from its ID.
14643    pub fn load_volume_from_id(&self, id: impl IntoID<VolumeId>) -> Volume {
14644        let mut query = self.selection.select("loadVolumeFromID");
14645        query = query.arg_lazy(
14646            "id",
14647            Box::new(move || {
14648                let id = id.clone();
14649                Box::pin(async move { id.into_id().await.unwrap().quote() })
14650            }),
14651        );
14652        Volume {
14653            proc: self.proc.clone(),
14654            selection: query,
14655            graphql_client: self.graphql_client.clone(),
14656        }
14657    }
14658    /// Load a Workspace from its ID.
14659    pub fn load_workspace_from_id(&self, id: impl IntoID<WorkspaceId>) -> Workspace {
14660        let mut query = self.selection.select("loadWorkspaceFromID");
14661        query = query.arg_lazy(
14662            "id",
14663            Box::new(move || {
14664                let id = id.clone();
14665                Box::pin(async move { id.into_id().await.unwrap().quote() })
14666            }),
14667        );
14668        Workspace {
14669            proc: self.proc.clone(),
14670            selection: query,
14671            graphql_client: self.graphql_client.clone(),
14672        }
14673    }
14674    /// Create a new module.
14675    pub fn module(&self) -> Module {
14676        let query = self.selection.select("module");
14677        Module {
14678            proc: self.proc.clone(),
14679            selection: query,
14680            graphql_client: self.graphql_client.clone(),
14681        }
14682    }
14683    /// Create a new module source instance from a source ref string
14684    ///
14685    /// # Arguments
14686    ///
14687    /// * `ref_string` - The string ref representation of the module source
14688    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14689    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
14690        let mut query = self.selection.select("moduleSource");
14691        query = query.arg("refString", ref_string.into());
14692        ModuleSource {
14693            proc: self.proc.clone(),
14694            selection: query,
14695            graphql_client: self.graphql_client.clone(),
14696        }
14697    }
14698    /// Create a new module source instance from a source ref string
14699    ///
14700    /// # Arguments
14701    ///
14702    /// * `ref_string` - The string ref representation of the module source
14703    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14704    pub fn module_source_opts<'a>(
14705        &self,
14706        ref_string: impl Into<String>,
14707        opts: QueryModuleSourceOpts<'a>,
14708    ) -> ModuleSource {
14709        let mut query = self.selection.select("moduleSource");
14710        query = query.arg("refString", ref_string.into());
14711        if let Some(ref_pin) = opts.ref_pin {
14712            query = query.arg("refPin", ref_pin);
14713        }
14714        if let Some(disable_find_up) = opts.disable_find_up {
14715            query = query.arg("disableFindUp", disable_find_up);
14716        }
14717        if let Some(allow_not_exists) = opts.allow_not_exists {
14718            query = query.arg("allowNotExists", allow_not_exists);
14719        }
14720        if let Some(require_kind) = opts.require_kind {
14721            query = query.arg("requireKind", require_kind);
14722        }
14723        ModuleSource {
14724            proc: self.proc.clone(),
14725            selection: query,
14726            graphql_client: self.graphql_client.clone(),
14727        }
14728    }
14729    /// Load any object by its ID.
14730    pub fn node(&self, id: impl IntoID<Id>) -> NodeClient {
14731        let mut query = self.selection.select("node");
14732        query = query.arg_lazy(
14733            "id",
14734            Box::new(move || {
14735                let id = id.clone();
14736                Box::pin(async move { id.into_id().await.unwrap().quote() })
14737            }),
14738        );
14739        NodeClient {
14740            proc: self.proc.clone(),
14741            selection: query,
14742            graphql_client: self.graphql_client.clone(),
14743        }
14744    }
14745    /// Creates a new secret.
14746    ///
14747    /// # Arguments
14748    ///
14749    /// * `uri` - The URI of the secret store
14750    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14751    pub fn secret(&self, uri: impl Into<String>) -> Secret {
14752        let mut query = self.selection.select("secret");
14753        query = query.arg("uri", uri.into());
14754        Secret {
14755            proc: self.proc.clone(),
14756            selection: query,
14757            graphql_client: self.graphql_client.clone(),
14758        }
14759    }
14760    /// Creates a new secret.
14761    ///
14762    /// # Arguments
14763    ///
14764    /// * `uri` - The URI of the secret store
14765    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14766    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
14767        let mut query = self.selection.select("secret");
14768        query = query.arg("uri", uri.into());
14769        if let Some(cache_key) = opts.cache_key {
14770            query = query.arg("cacheKey", cache_key);
14771        }
14772        Secret {
14773            proc: self.proc.clone(),
14774            selection: query,
14775            graphql_client: self.graphql_client.clone(),
14776        }
14777    }
14778    /// Sets a secret given a user defined name to its plaintext and returns the secret.
14779    /// The plaintext value is limited to a size of 128000 bytes.
14780    ///
14781    /// # Arguments
14782    ///
14783    /// * `name` - The user defined name for this secret
14784    /// * `plaintext` - The plaintext of the secret
14785    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
14786        let mut query = self.selection.select("setSecret");
14787        query = query.arg("name", name.into());
14788        query = query.arg("plaintext", plaintext.into());
14789        Secret {
14790            proc: self.proc.clone(),
14791            selection: query,
14792            graphql_client: self.graphql_client.clone(),
14793        }
14794    }
14795    /// Creates source map metadata.
14796    ///
14797    /// # Arguments
14798    ///
14799    /// * `filename` - The filename from the module source.
14800    /// * `line` - The line number within the filename.
14801    /// * `column` - The column number within the line.
14802    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
14803        let mut query = self.selection.select("sourceMap");
14804        query = query.arg("filename", filename.into());
14805        query = query.arg("line", line);
14806        query = query.arg("column", column);
14807        SourceMap {
14808            proc: self.proc.clone(),
14809            selection: query,
14810            graphql_client: self.graphql_client.clone(),
14811        }
14812    }
14813    /// Constructs an SSHFS volume.
14814    ///
14815    /// # Arguments
14816    ///
14817    /// * `endpoint` - SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.
14818    /// * `private_key` - Private key secret used to authenticate to the remote host.
14819    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14820    pub fn sshfs_volume(
14821        &self,
14822        endpoint: impl Into<String>,
14823        private_key: impl IntoID<Id>,
14824    ) -> Volume {
14825        let mut query = self.selection.select("sshfsVolume");
14826        query = query.arg("endpoint", endpoint.into());
14827        query = query.arg_lazy(
14828            "privateKey",
14829            Box::new(move || {
14830                let private_key = private_key.clone();
14831                Box::pin(async move { private_key.into_id().await.unwrap().quote() })
14832            }),
14833        );
14834        Volume {
14835            proc: self.proc.clone(),
14836            selection: query,
14837            graphql_client: self.graphql_client.clone(),
14838        }
14839    }
14840    /// Constructs an SSHFS volume.
14841    ///
14842    /// # Arguments
14843    ///
14844    /// * `endpoint` - SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.
14845    /// * `private_key` - Private key secret used to authenticate to the remote host.
14846    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14847    pub fn sshfs_volume_opts<'a>(
14848        &self,
14849        endpoint: impl Into<String>,
14850        private_key: impl IntoID<Id>,
14851        opts: QuerySshfsVolumeOpts<'a>,
14852    ) -> Volume {
14853        let mut query = self.selection.select("sshfsVolume");
14854        query = query.arg("endpoint", endpoint.into());
14855        query = query.arg_lazy(
14856            "privateKey",
14857            Box::new(move || {
14858                let private_key = private_key.clone();
14859                Box::pin(async move { private_key.into_id().await.unwrap().quote() })
14860            }),
14861        );
14862        if let Some(known_hosts) = opts.known_hosts {
14863            query = query.arg("knownHosts", known_hosts);
14864        }
14865        if let Some(cache_key) = opts.cache_key {
14866            query = query.arg("cacheKey", cache_key);
14867        }
14868        if let Some(insecure_skip_host_key_check) = opts.insecure_skip_host_key_check {
14869            query = query.arg("insecureSkipHostKeyCheck", insecure_skip_host_key_check);
14870        }
14871        if let Some(experimental_service_host) = opts.experimental_service_host {
14872            query = query.arg("experimentalServiceHost", experimental_service_host);
14873        }
14874        Volume {
14875            proc: self.proc.clone(),
14876            selection: query,
14877            graphql_client: self.graphql_client.clone(),
14878        }
14879    }
14880    /// Create a new TypeDef.
14881    pub fn type_def(&self) -> TypeDef {
14882        let query = self.selection.select("typeDef");
14883        TypeDef {
14884            proc: self.proc.clone(),
14885            selection: query,
14886            graphql_client: self.graphql_client.clone(),
14887        }
14888    }
14889    /// Get the current Dagger Engine version.
14890    pub async fn version(&self) -> Result<String, DaggerError> {
14891        let query = self.selection.select("version");
14892        query.execute(self.graphql_client.clone()).await
14893    }
14894}
14895impl Node for Query {
14896    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14897        let query = self.selection.select("id");
14898        let graphql_client = self.graphql_client.clone();
14899        async move { query.execute(graphql_client).await }
14900    }
14901}
14902#[derive(Clone)]
14903pub struct RemoteGitMirror {
14904    pub proc: Option<Arc<DaggerSessionProc>>,
14905    pub selection: Selection,
14906    pub graphql_client: DynGraphQLClient,
14907}
14908impl IntoID<Id> for RemoteGitMirror {
14909    fn into_id(
14910        self,
14911    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14912        Box::pin(async move { self.id().await })
14913    }
14914}
14915impl Loadable for RemoteGitMirror {
14916    fn graphql_type() -> &'static str {
14917        "RemoteGitMirror"
14918    }
14919    fn from_query(
14920        proc: Option<Arc<DaggerSessionProc>>,
14921        selection: Selection,
14922        graphql_client: DynGraphQLClient,
14923    ) -> Self {
14924        Self {
14925            proc,
14926            selection,
14927            graphql_client,
14928        }
14929    }
14930}
14931impl RemoteGitMirror {
14932    /// A unique identifier for this RemoteGitMirror.
14933    pub async fn id(&self) -> Result<Id, DaggerError> {
14934        let query = self.selection.select("id");
14935        query.execute(self.graphql_client.clone()).await
14936    }
14937}
14938impl Node for RemoteGitMirror {
14939    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14940        let query = self.selection.select("id");
14941        let graphql_client = self.graphql_client.clone();
14942        async move { query.execute(graphql_client).await }
14943    }
14944}
14945#[derive(Clone)]
14946pub struct SdkConfig {
14947    pub proc: Option<Arc<DaggerSessionProc>>,
14948    pub selection: Selection,
14949    pub graphql_client: DynGraphQLClient,
14950}
14951impl IntoID<Id> for SdkConfig {
14952    fn into_id(
14953        self,
14954    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14955        Box::pin(async move { self.id().await })
14956    }
14957}
14958impl Loadable for SdkConfig {
14959    fn graphql_type() -> &'static str {
14960        "SDKConfig"
14961    }
14962    fn from_query(
14963        proc: Option<Arc<DaggerSessionProc>>,
14964        selection: Selection,
14965        graphql_client: DynGraphQLClient,
14966    ) -> Self {
14967        Self {
14968            proc,
14969            selection,
14970            graphql_client,
14971        }
14972    }
14973}
14974impl SdkConfig {
14975    /// Whether to start the SDK runtime in debug mode with an interactive terminal.
14976    pub async fn debug(&self) -> Result<bool, DaggerError> {
14977        let query = self.selection.select("debug");
14978        query.execute(self.graphql_client.clone()).await
14979    }
14980    /// A unique identifier for this SDKConfig.
14981    pub async fn id(&self) -> Result<Id, DaggerError> {
14982        let query = self.selection.select("id");
14983        query.execute(self.graphql_client.clone()).await
14984    }
14985    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
14986    pub async fn source(&self) -> Result<String, DaggerError> {
14987        let query = self.selection.select("source");
14988        query.execute(self.graphql_client.clone()).await
14989    }
14990}
14991impl Node for SdkConfig {
14992    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14993        let query = self.selection.select("id");
14994        let graphql_client = self.graphql_client.clone();
14995        async move { query.execute(graphql_client).await }
14996    }
14997}
14998#[derive(Clone)]
14999pub struct ScalarTypeDef {
15000    pub proc: Option<Arc<DaggerSessionProc>>,
15001    pub selection: Selection,
15002    pub graphql_client: DynGraphQLClient,
15003}
15004impl IntoID<Id> for ScalarTypeDef {
15005    fn into_id(
15006        self,
15007    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15008        Box::pin(async move { self.id().await })
15009    }
15010}
15011impl Loadable for ScalarTypeDef {
15012    fn graphql_type() -> &'static str {
15013        "ScalarTypeDef"
15014    }
15015    fn from_query(
15016        proc: Option<Arc<DaggerSessionProc>>,
15017        selection: Selection,
15018        graphql_client: DynGraphQLClient,
15019    ) -> Self {
15020        Self {
15021            proc,
15022            selection,
15023            graphql_client,
15024        }
15025    }
15026}
15027impl ScalarTypeDef {
15028    /// A doc string for the scalar, if any.
15029    pub async fn description(&self) -> Result<String, DaggerError> {
15030        let query = self.selection.select("description");
15031        query.execute(self.graphql_client.clone()).await
15032    }
15033    /// A unique identifier for this ScalarTypeDef.
15034    pub async fn id(&self) -> Result<Id, DaggerError> {
15035        let query = self.selection.select("id");
15036        query.execute(self.graphql_client.clone()).await
15037    }
15038    /// The name of the scalar.
15039    pub async fn name(&self) -> Result<String, DaggerError> {
15040        let query = self.selection.select("name");
15041        query.execute(self.graphql_client.clone()).await
15042    }
15043    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
15044    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
15045        let query = self.selection.select("sourceModuleName");
15046        query.execute(self.graphql_client.clone()).await
15047    }
15048}
15049impl Node for ScalarTypeDef {
15050    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15051        let query = self.selection.select("id");
15052        let graphql_client = self.graphql_client.clone();
15053        async move { query.execute(graphql_client).await }
15054    }
15055}
15056#[derive(Clone)]
15057pub struct SearchResult {
15058    pub proc: Option<Arc<DaggerSessionProc>>,
15059    pub selection: Selection,
15060    pub graphql_client: DynGraphQLClient,
15061}
15062impl IntoID<Id> for SearchResult {
15063    fn into_id(
15064        self,
15065    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15066        Box::pin(async move { self.id().await })
15067    }
15068}
15069impl Loadable for SearchResult {
15070    fn graphql_type() -> &'static str {
15071        "SearchResult"
15072    }
15073    fn from_query(
15074        proc: Option<Arc<DaggerSessionProc>>,
15075        selection: Selection,
15076        graphql_client: DynGraphQLClient,
15077    ) -> Self {
15078        Self {
15079            proc,
15080            selection,
15081            graphql_client,
15082        }
15083    }
15084}
15085impl SearchResult {
15086    /// The byte offset of this line within the file.
15087    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
15088        let query = self.selection.select("absoluteOffset");
15089        query.execute(self.graphql_client.clone()).await
15090    }
15091    /// The path to the file that matched.
15092    pub async fn file_path(&self) -> Result<String, DaggerError> {
15093        let query = self.selection.select("filePath");
15094        query.execute(self.graphql_client.clone()).await
15095    }
15096    /// A unique identifier for this SearchResult.
15097    pub async fn id(&self) -> Result<Id, DaggerError> {
15098        let query = self.selection.select("id");
15099        query.execute(self.graphql_client.clone()).await
15100    }
15101    /// The first line that matched.
15102    pub async fn line_number(&self) -> Result<isize, DaggerError> {
15103        let query = self.selection.select("lineNumber");
15104        query.execute(self.graphql_client.clone()).await
15105    }
15106    /// The line content that matched.
15107    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
15108        let query = self.selection.select("matchedLines");
15109        query.execute(self.graphql_client.clone()).await
15110    }
15111    /// Sub-match positions and content within the matched lines.
15112    pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
15113        let query = self.selection.select("submatches");
15114        let query = query.select("id");
15115        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15116        Ok(ids
15117            .into_iter()
15118            .map(|id| SearchSubmatch {
15119                proc: self.proc.clone(),
15120                selection: crate::querybuilder::query()
15121                    .select("node")
15122                    .arg("id", &id.0)
15123                    .inline_fragment("SearchSubmatch"),
15124                graphql_client: self.graphql_client.clone(),
15125            })
15126            .collect())
15127    }
15128}
15129impl Node for SearchResult {
15130    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15131        let query = self.selection.select("id");
15132        let graphql_client = self.graphql_client.clone();
15133        async move { query.execute(graphql_client).await }
15134    }
15135}
15136#[derive(Clone)]
15137pub struct SearchSubmatch {
15138    pub proc: Option<Arc<DaggerSessionProc>>,
15139    pub selection: Selection,
15140    pub graphql_client: DynGraphQLClient,
15141}
15142impl IntoID<Id> for SearchSubmatch {
15143    fn into_id(
15144        self,
15145    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15146        Box::pin(async move { self.id().await })
15147    }
15148}
15149impl Loadable for SearchSubmatch {
15150    fn graphql_type() -> &'static str {
15151        "SearchSubmatch"
15152    }
15153    fn from_query(
15154        proc: Option<Arc<DaggerSessionProc>>,
15155        selection: Selection,
15156        graphql_client: DynGraphQLClient,
15157    ) -> Self {
15158        Self {
15159            proc,
15160            selection,
15161            graphql_client,
15162        }
15163    }
15164}
15165impl SearchSubmatch {
15166    /// The match's end offset within the matched lines.
15167    pub async fn end(&self) -> Result<isize, DaggerError> {
15168        let query = self.selection.select("end");
15169        query.execute(self.graphql_client.clone()).await
15170    }
15171    /// A unique identifier for this SearchSubmatch.
15172    pub async fn id(&self) -> Result<Id, DaggerError> {
15173        let query = self.selection.select("id");
15174        query.execute(self.graphql_client.clone()).await
15175    }
15176    /// The match's start offset within the matched lines.
15177    pub async fn start(&self) -> Result<isize, DaggerError> {
15178        let query = self.selection.select("start");
15179        query.execute(self.graphql_client.clone()).await
15180    }
15181    /// The matched text.
15182    pub async fn text(&self) -> Result<String, DaggerError> {
15183        let query = self.selection.select("text");
15184        query.execute(self.graphql_client.clone()).await
15185    }
15186}
15187impl Node for SearchSubmatch {
15188    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15189        let query = self.selection.select("id");
15190        let graphql_client = self.graphql_client.clone();
15191        async move { query.execute(graphql_client).await }
15192    }
15193}
15194#[derive(Clone)]
15195pub struct Secret {
15196    pub proc: Option<Arc<DaggerSessionProc>>,
15197    pub selection: Selection,
15198    pub graphql_client: DynGraphQLClient,
15199}
15200impl IntoID<Id> for Secret {
15201    fn into_id(
15202        self,
15203    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15204        Box::pin(async move { self.id().await })
15205    }
15206}
15207impl Loadable for Secret {
15208    fn graphql_type() -> &'static str {
15209        "Secret"
15210    }
15211    fn from_query(
15212        proc: Option<Arc<DaggerSessionProc>>,
15213        selection: Selection,
15214        graphql_client: DynGraphQLClient,
15215    ) -> Self {
15216        Self {
15217            proc,
15218            selection,
15219            graphql_client,
15220        }
15221    }
15222}
15223impl Secret {
15224    /// A unique identifier for this Secret.
15225    pub async fn id(&self) -> Result<Id, DaggerError> {
15226        let query = self.selection.select("id");
15227        query.execute(self.graphql_client.clone()).await
15228    }
15229    /// The name of this secret.
15230    pub async fn name(&self) -> Result<String, DaggerError> {
15231        let query = self.selection.select("name");
15232        query.execute(self.graphql_client.clone()).await
15233    }
15234    /// The value of this secret.
15235    pub async fn plaintext(&self) -> Result<String, DaggerError> {
15236        let query = self.selection.select("plaintext");
15237        query.execute(self.graphql_client.clone()).await
15238    }
15239    /// The URI of this secret.
15240    pub async fn uri(&self) -> Result<String, DaggerError> {
15241        let query = self.selection.select("uri");
15242        query.execute(self.graphql_client.clone()).await
15243    }
15244}
15245impl Node for Secret {
15246    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15247        let query = self.selection.select("id");
15248        let graphql_client = self.graphql_client.clone();
15249        async move { query.execute(graphql_client).await }
15250    }
15251}
15252#[derive(Clone)]
15253pub struct Service {
15254    pub proc: Option<Arc<DaggerSessionProc>>,
15255    pub selection: Selection,
15256    pub graphql_client: DynGraphQLClient,
15257}
15258#[derive(Builder, Debug, PartialEq)]
15259pub struct ServiceEndpointOpts<'a> {
15260    /// The exposed port number for the endpoint
15261    #[builder(setter(into, strip_option), default)]
15262    pub port: Option<isize>,
15263    /// Return a URL with the given scheme, eg. http for http://
15264    #[builder(setter(into, strip_option), default)]
15265    pub scheme: Option<&'a str>,
15266}
15267#[derive(Builder, Debug, PartialEq)]
15268pub struct ServiceStopOpts {
15269    /// Immediately kill the service without waiting for a graceful exit
15270    #[builder(setter(into, strip_option), default)]
15271    pub kill: Option<bool>,
15272}
15273#[derive(Builder, Debug, PartialEq)]
15274pub struct ServiceTerminalOpts<'a> {
15275    #[builder(setter(into, strip_option), default)]
15276    pub cmd: Option<Vec<&'a str>>,
15277}
15278#[derive(Builder, Debug, PartialEq)]
15279pub struct ServiceUpOpts {
15280    /// List of frontend/backend port mappings to forward.
15281    /// Frontend is the port accepting traffic on the host, backend is the service port.
15282    #[builder(setter(into, strip_option), default)]
15283    pub ports: Option<Vec<PortForward>>,
15284    /// Bind each tunnel port to a random port on the host.
15285    #[builder(setter(into, strip_option), default)]
15286    pub random: Option<bool>,
15287}
15288impl IntoID<Id> for Service {
15289    fn into_id(
15290        self,
15291    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15292        Box::pin(async move { self.id().await })
15293    }
15294}
15295impl Loadable for Service {
15296    fn graphql_type() -> &'static str {
15297        "Service"
15298    }
15299    fn from_query(
15300        proc: Option<Arc<DaggerSessionProc>>,
15301        selection: Selection,
15302        graphql_client: DynGraphQLClient,
15303    ) -> Self {
15304        Self {
15305            proc,
15306            selection,
15307            graphql_client,
15308        }
15309    }
15310}
15311impl Service {
15312    /// Retrieves an endpoint that clients can use to reach this container.
15313    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
15314    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
15315    ///
15316    /// # Arguments
15317    ///
15318    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15319    pub async fn endpoint(&self) -> Result<String, DaggerError> {
15320        let query = self.selection.select("endpoint");
15321        query.execute(self.graphql_client.clone()).await
15322    }
15323    /// Retrieves an endpoint that clients can use to reach this container.
15324    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
15325    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
15326    ///
15327    /// # Arguments
15328    ///
15329    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15330    pub async fn endpoint_opts<'a>(
15331        &self,
15332        opts: ServiceEndpointOpts<'a>,
15333    ) -> Result<String, DaggerError> {
15334        let mut query = self.selection.select("endpoint");
15335        if let Some(port) = opts.port {
15336            query = query.arg("port", port);
15337        }
15338        if let Some(scheme) = opts.scheme {
15339            query = query.arg("scheme", scheme);
15340        }
15341        query.execute(self.graphql_client.clone()).await
15342    }
15343    /// Retrieves a hostname which can be used by clients to reach this container.
15344    pub async fn hostname(&self) -> Result<String, DaggerError> {
15345        let query = self.selection.select("hostname");
15346        query.execute(self.graphql_client.clone()).await
15347    }
15348    /// A unique identifier for this Service.
15349    pub async fn id(&self) -> Result<Id, DaggerError> {
15350        let query = self.selection.select("id");
15351        query.execute(self.graphql_client.clone()).await
15352    }
15353    /// Retrieves the list of ports provided by the service.
15354    pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
15355        let query = self.selection.select("ports");
15356        let query = query.select("id");
15357        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15358        Ok(ids
15359            .into_iter()
15360            .map(|id| Port {
15361                proc: self.proc.clone(),
15362                selection: crate::querybuilder::query()
15363                    .select("node")
15364                    .arg("id", &id.0)
15365                    .inline_fragment("Port"),
15366                graphql_client: self.graphql_client.clone(),
15367            })
15368            .collect())
15369    }
15370    /// Start the service and wait for its health checks to succeed.
15371    /// Services bound to a Container do not need to be manually started.
15372    pub async fn start(&self) -> Result<Service, DaggerError> {
15373        let query = self.selection.select("start");
15374        let id: Id = query.execute(self.graphql_client.clone()).await?;
15375        Ok(Service {
15376            proc: self.proc.clone(),
15377            selection: query
15378                .root()
15379                .select("node")
15380                .arg("id", &id.0)
15381                .inline_fragment("Service"),
15382            graphql_client: self.graphql_client.clone(),
15383        })
15384    }
15385    /// Stop the service.
15386    ///
15387    /// # Arguments
15388    ///
15389    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15390    pub async fn stop(&self) -> Result<Service, DaggerError> {
15391        let query = self.selection.select("stop");
15392        let id: Id = query.execute(self.graphql_client.clone()).await?;
15393        Ok(Service {
15394            proc: self.proc.clone(),
15395            selection: query
15396                .root()
15397                .select("node")
15398                .arg("id", &id.0)
15399                .inline_fragment("Service"),
15400            graphql_client: self.graphql_client.clone(),
15401        })
15402    }
15403    /// Stop the service.
15404    ///
15405    /// # Arguments
15406    ///
15407    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15408    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
15409        let mut query = self.selection.select("stop");
15410        if let Some(kill) = opts.kill {
15411            query = query.arg("kill", kill);
15412        }
15413        let id: Id = query.execute(self.graphql_client.clone()).await?;
15414        Ok(Service {
15415            proc: self.proc.clone(),
15416            selection: query
15417                .root()
15418                .select("node")
15419                .arg("id", &id.0)
15420                .inline_fragment("Service"),
15421            graphql_client: self.graphql_client.clone(),
15422        })
15423    }
15424    /// Forces evaluation of the pipeline in the engine.
15425    pub async fn sync(&self) -> Result<Service, DaggerError> {
15426        let query = self.selection.select("sync");
15427        let id: Id = query.execute(self.graphql_client.clone()).await?;
15428        Ok(Service {
15429            proc: self.proc.clone(),
15430            selection: query
15431                .root()
15432                .select("node")
15433                .arg("id", &id.0)
15434                .inline_fragment("Service"),
15435            graphql_client: self.graphql_client.clone(),
15436        })
15437    }
15438    ///
15439    /// # Arguments
15440    ///
15441    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15442    pub fn terminal(&self) -> Service {
15443        let query = self.selection.select("terminal");
15444        Service {
15445            proc: self.proc.clone(),
15446            selection: query,
15447            graphql_client: self.graphql_client.clone(),
15448        }
15449    }
15450    ///
15451    /// # Arguments
15452    ///
15453    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15454    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
15455        let mut query = self.selection.select("terminal");
15456        if let Some(cmd) = opts.cmd {
15457            query = query.arg("cmd", cmd);
15458        }
15459        Service {
15460            proc: self.proc.clone(),
15461            selection: query,
15462            graphql_client: self.graphql_client.clone(),
15463        }
15464    }
15465    /// Creates a tunnel that forwards traffic from the caller's network to this service.
15466    ///
15467    /// # Arguments
15468    ///
15469    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15470    pub async fn up(&self) -> Result<Void, DaggerError> {
15471        let query = self.selection.select("up");
15472        query.execute(self.graphql_client.clone()).await
15473    }
15474    /// Creates a tunnel that forwards traffic from the caller's network to this service.
15475    ///
15476    /// # Arguments
15477    ///
15478    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15479    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
15480        let mut query = self.selection.select("up");
15481        if let Some(ports) = opts.ports {
15482            query = query.arg("ports", ports);
15483        }
15484        if let Some(random) = opts.random {
15485            query = query.arg("random", random);
15486        }
15487        query.execute(self.graphql_client.clone()).await
15488    }
15489    /// Configures a hostname which can be used by clients within the session to reach this container.
15490    ///
15491    /// # Arguments
15492    ///
15493    /// * `hostname` - The hostname to use.
15494    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
15495        let mut query = self.selection.select("withHostname");
15496        query = query.arg("hostname", hostname.into());
15497        Service {
15498            proc: self.proc.clone(),
15499            selection: query,
15500            graphql_client: self.graphql_client.clone(),
15501        }
15502    }
15503}
15504impl Node for Service {
15505    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15506        let query = self.selection.select("id");
15507        let graphql_client = self.graphql_client.clone();
15508        async move { query.execute(graphql_client).await }
15509    }
15510}
15511impl Syncer for Service {
15512    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15513        let query = self.selection.select("id");
15514        let graphql_client = self.graphql_client.clone();
15515        async move { query.execute(graphql_client).await }
15516    }
15517    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15518        let query = self.selection.select("sync");
15519        let graphql_client = self.graphql_client.clone();
15520        async move { query.execute(graphql_client).await }
15521    }
15522}
15523#[derive(Clone)]
15524pub struct Socket {
15525    pub proc: Option<Arc<DaggerSessionProc>>,
15526    pub selection: Selection,
15527    pub graphql_client: DynGraphQLClient,
15528}
15529impl IntoID<Id> for Socket {
15530    fn into_id(
15531        self,
15532    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15533        Box::pin(async move { self.id().await })
15534    }
15535}
15536impl Loadable for Socket {
15537    fn graphql_type() -> &'static str {
15538        "Socket"
15539    }
15540    fn from_query(
15541        proc: Option<Arc<DaggerSessionProc>>,
15542        selection: Selection,
15543        graphql_client: DynGraphQLClient,
15544    ) -> Self {
15545        Self {
15546            proc,
15547            selection,
15548            graphql_client,
15549        }
15550    }
15551}
15552impl Socket {
15553    /// A unique identifier for this Socket.
15554    pub async fn id(&self) -> Result<Id, DaggerError> {
15555        let query = self.selection.select("id");
15556        query.execute(self.graphql_client.clone()).await
15557    }
15558}
15559impl Node for Socket {
15560    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15561        let query = self.selection.select("id");
15562        let graphql_client = self.graphql_client.clone();
15563        async move { query.execute(graphql_client).await }
15564    }
15565}
15566#[derive(Clone)]
15567pub struct SourceMap {
15568    pub proc: Option<Arc<DaggerSessionProc>>,
15569    pub selection: Selection,
15570    pub graphql_client: DynGraphQLClient,
15571}
15572impl IntoID<Id> for SourceMap {
15573    fn into_id(
15574        self,
15575    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15576        Box::pin(async move { self.id().await })
15577    }
15578}
15579impl Loadable for SourceMap {
15580    fn graphql_type() -> &'static str {
15581        "SourceMap"
15582    }
15583    fn from_query(
15584        proc: Option<Arc<DaggerSessionProc>>,
15585        selection: Selection,
15586        graphql_client: DynGraphQLClient,
15587    ) -> Self {
15588        Self {
15589            proc,
15590            selection,
15591            graphql_client,
15592        }
15593    }
15594}
15595impl SourceMap {
15596    /// The column number within the line.
15597    pub async fn column(&self) -> Result<isize, DaggerError> {
15598        let query = self.selection.select("column");
15599        query.execute(self.graphql_client.clone()).await
15600    }
15601    /// The filename from the module source.
15602    pub async fn filename(&self) -> Result<String, DaggerError> {
15603        let query = self.selection.select("filename");
15604        query.execute(self.graphql_client.clone()).await
15605    }
15606    /// A unique identifier for this SourceMap.
15607    pub async fn id(&self) -> Result<Id, DaggerError> {
15608        let query = self.selection.select("id");
15609        query.execute(self.graphql_client.clone()).await
15610    }
15611    /// The line number within the filename.
15612    pub async fn line(&self) -> Result<isize, DaggerError> {
15613        let query = self.selection.select("line");
15614        query.execute(self.graphql_client.clone()).await
15615    }
15616    /// The module dependency this was declared in.
15617    pub async fn module(&self) -> Result<String, DaggerError> {
15618        let query = self.selection.select("module");
15619        query.execute(self.graphql_client.clone()).await
15620    }
15621    /// The URL to the file, if any. This can be used to link to the source map in the browser.
15622    pub async fn url(&self) -> Result<String, DaggerError> {
15623        let query = self.selection.select("url");
15624        query.execute(self.graphql_client.clone()).await
15625    }
15626}
15627impl Node for SourceMap {
15628    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15629        let query = self.selection.select("id");
15630        let graphql_client = self.graphql_client.clone();
15631        async move { query.execute(graphql_client).await }
15632    }
15633}
15634#[derive(Clone)]
15635pub struct Stat {
15636    pub proc: Option<Arc<DaggerSessionProc>>,
15637    pub selection: Selection,
15638    pub graphql_client: DynGraphQLClient,
15639}
15640impl IntoID<Id> for Stat {
15641    fn into_id(
15642        self,
15643    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15644        Box::pin(async move { self.id().await })
15645    }
15646}
15647impl Loadable for Stat {
15648    fn graphql_type() -> &'static str {
15649        "Stat"
15650    }
15651    fn from_query(
15652        proc: Option<Arc<DaggerSessionProc>>,
15653        selection: Selection,
15654        graphql_client: DynGraphQLClient,
15655    ) -> Self {
15656        Self {
15657            proc,
15658            selection,
15659            graphql_client,
15660        }
15661    }
15662}
15663impl Stat {
15664    /// file type
15665    pub async fn file_type(&self) -> Result<FileType, DaggerError> {
15666        let query = self.selection.select("fileType");
15667        query.execute(self.graphql_client.clone()).await
15668    }
15669    /// A unique identifier for this Stat.
15670    pub async fn id(&self) -> Result<Id, DaggerError> {
15671        let query = self.selection.select("id");
15672        query.execute(self.graphql_client.clone()).await
15673    }
15674    /// file name
15675    pub async fn name(&self) -> Result<String, DaggerError> {
15676        let query = self.selection.select("name");
15677        query.execute(self.graphql_client.clone()).await
15678    }
15679    /// permission bits
15680    pub async fn permissions(&self) -> Result<isize, DaggerError> {
15681        let query = self.selection.select("permissions");
15682        query.execute(self.graphql_client.clone()).await
15683    }
15684    /// file size
15685    pub async fn size(&self) -> Result<isize, DaggerError> {
15686        let query = self.selection.select("size");
15687        query.execute(self.graphql_client.clone()).await
15688    }
15689}
15690impl Node for Stat {
15691    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15692        let query = self.selection.select("id");
15693        let graphql_client = self.graphql_client.clone();
15694        async move { query.execute(graphql_client).await }
15695    }
15696}
15697#[derive(Clone)]
15698pub struct Terminal {
15699    pub proc: Option<Arc<DaggerSessionProc>>,
15700    pub selection: Selection,
15701    pub graphql_client: DynGraphQLClient,
15702}
15703impl IntoID<Id> for Terminal {
15704    fn into_id(
15705        self,
15706    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15707        Box::pin(async move { self.id().await })
15708    }
15709}
15710impl Loadable for Terminal {
15711    fn graphql_type() -> &'static str {
15712        "Terminal"
15713    }
15714    fn from_query(
15715        proc: Option<Arc<DaggerSessionProc>>,
15716        selection: Selection,
15717        graphql_client: DynGraphQLClient,
15718    ) -> Self {
15719        Self {
15720            proc,
15721            selection,
15722            graphql_client,
15723        }
15724    }
15725}
15726impl Terminal {
15727    /// A unique identifier for this Terminal.
15728    pub async fn id(&self) -> Result<Id, DaggerError> {
15729        let query = self.selection.select("id");
15730        query.execute(self.graphql_client.clone()).await
15731    }
15732    /// Forces evaluation of the pipeline in the engine.
15733    /// It doesn't run the default command if no exec has been set.
15734    pub async fn sync(&self) -> Result<Terminal, DaggerError> {
15735        let query = self.selection.select("sync");
15736        let id: Id = query.execute(self.graphql_client.clone()).await?;
15737        Ok(Terminal {
15738            proc: self.proc.clone(),
15739            selection: query
15740                .root()
15741                .select("node")
15742                .arg("id", &id.0)
15743                .inline_fragment("Terminal"),
15744            graphql_client: self.graphql_client.clone(),
15745        })
15746    }
15747}
15748impl Node for Terminal {
15749    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15750        let query = self.selection.select("id");
15751        let graphql_client = self.graphql_client.clone();
15752        async move { query.execute(graphql_client).await }
15753    }
15754}
15755impl Syncer for Terminal {
15756    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15757        let query = self.selection.select("id");
15758        let graphql_client = self.graphql_client.clone();
15759        async move { query.execute(graphql_client).await }
15760    }
15761    fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15762        let query = self.selection.select("sync");
15763        let graphql_client = self.graphql_client.clone();
15764        async move { query.execute(graphql_client).await }
15765    }
15766}
15767#[derive(Clone)]
15768pub struct TypeDef {
15769    pub proc: Option<Arc<DaggerSessionProc>>,
15770    pub selection: Selection,
15771    pub graphql_client: DynGraphQLClient,
15772}
15773#[derive(Builder, Debug, PartialEq)]
15774pub struct TypeDefWithEnumOpts<'a> {
15775    /// A doc string for the enum, if any
15776    #[builder(setter(into, strip_option), default)]
15777    pub description: Option<&'a str>,
15778    /// The source map for the enum definition.
15779    #[builder(setter(into, strip_option), default)]
15780    pub source_map: Option<Id>,
15781}
15782#[derive(Builder, Debug, PartialEq)]
15783pub struct TypeDefWithEnumMemberOpts<'a> {
15784    /// If deprecated, the reason or migration path.
15785    #[builder(setter(into, strip_option), default)]
15786    pub deprecated: Option<&'a str>,
15787    /// A doc string for the member, if any
15788    #[builder(setter(into, strip_option), default)]
15789    pub description: Option<&'a str>,
15790    /// The source map for the enum member definition.
15791    #[builder(setter(into, strip_option), default)]
15792    pub source_map: Option<Id>,
15793    /// The value of the member in the enum
15794    #[builder(setter(into, strip_option), default)]
15795    pub value: Option<&'a str>,
15796}
15797#[derive(Builder, Debug, PartialEq)]
15798pub struct TypeDefWithEnumValueOpts<'a> {
15799    /// If deprecated, the reason or migration path.
15800    #[builder(setter(into, strip_option), default)]
15801    pub deprecated: Option<&'a str>,
15802    /// A doc string for the value, if any
15803    #[builder(setter(into, strip_option), default)]
15804    pub description: Option<&'a str>,
15805    /// The source map for the enum value definition.
15806    #[builder(setter(into, strip_option), default)]
15807    pub source_map: Option<Id>,
15808}
15809#[derive(Builder, Debug, PartialEq)]
15810pub struct TypeDefWithFieldOpts<'a> {
15811    /// If deprecated, the reason or migration path.
15812    #[builder(setter(into, strip_option), default)]
15813    pub deprecated: Option<&'a str>,
15814    /// A doc string for the field, if any
15815    #[builder(setter(into, strip_option), default)]
15816    pub description: Option<&'a str>,
15817    /// The source map for the field definition.
15818    #[builder(setter(into, strip_option), default)]
15819    pub source_map: Option<Id>,
15820}
15821#[derive(Builder, Debug, PartialEq)]
15822pub struct TypeDefWithInterfaceOpts<'a> {
15823    #[builder(setter(into, strip_option), default)]
15824    pub description: Option<&'a str>,
15825    #[builder(setter(into, strip_option), default)]
15826    pub source_map: Option<Id>,
15827}
15828#[derive(Builder, Debug, PartialEq)]
15829pub struct TypeDefWithObjectOpts<'a> {
15830    #[builder(setter(into, strip_option), default)]
15831    pub deprecated: Option<&'a str>,
15832    #[builder(setter(into, strip_option), default)]
15833    pub description: Option<&'a str>,
15834    #[builder(setter(into, strip_option), default)]
15835    pub source_map: Option<Id>,
15836}
15837#[derive(Builder, Debug, PartialEq)]
15838pub struct TypeDefWithScalarOpts<'a> {
15839    #[builder(setter(into, strip_option), default)]
15840    pub description: Option<&'a str>,
15841}
15842impl IntoID<Id> for TypeDef {
15843    fn into_id(
15844        self,
15845    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15846        Box::pin(async move { self.id().await })
15847    }
15848}
15849impl Loadable for TypeDef {
15850    fn graphql_type() -> &'static str {
15851        "TypeDef"
15852    }
15853    fn from_query(
15854        proc: Option<Arc<DaggerSessionProc>>,
15855        selection: Selection,
15856        graphql_client: DynGraphQLClient,
15857    ) -> Self {
15858        Self {
15859            proc,
15860            selection,
15861            graphql_client,
15862        }
15863    }
15864}
15865impl TypeDef {
15866    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
15867    pub fn as_enum(&self) -> EnumTypeDef {
15868        let query = self.selection.select("asEnum");
15869        EnumTypeDef {
15870            proc: self.proc.clone(),
15871            selection: query,
15872            graphql_client: self.graphql_client.clone(),
15873        }
15874    }
15875    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
15876    pub fn as_input(&self) -> InputTypeDef {
15877        let query = self.selection.select("asInput");
15878        InputTypeDef {
15879            proc: self.proc.clone(),
15880            selection: query,
15881            graphql_client: self.graphql_client.clone(),
15882        }
15883    }
15884    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
15885    pub fn as_interface(&self) -> InterfaceTypeDef {
15886        let query = self.selection.select("asInterface");
15887        InterfaceTypeDef {
15888            proc: self.proc.clone(),
15889            selection: query,
15890            graphql_client: self.graphql_client.clone(),
15891        }
15892    }
15893    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
15894    pub fn as_list(&self) -> ListTypeDef {
15895        let query = self.selection.select("asList");
15896        ListTypeDef {
15897            proc: self.proc.clone(),
15898            selection: query,
15899            graphql_client: self.graphql_client.clone(),
15900        }
15901    }
15902    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
15903    pub fn as_object(&self) -> ObjectTypeDef {
15904        let query = self.selection.select("asObject");
15905        ObjectTypeDef {
15906            proc: self.proc.clone(),
15907            selection: query,
15908            graphql_client: self.graphql_client.clone(),
15909        }
15910    }
15911    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
15912    pub fn as_scalar(&self) -> ScalarTypeDef {
15913        let query = self.selection.select("asScalar");
15914        ScalarTypeDef {
15915            proc: self.proc.clone(),
15916            selection: query,
15917            graphql_client: self.graphql_client.clone(),
15918        }
15919    }
15920    /// A unique identifier for this TypeDef.
15921    pub async fn id(&self) -> Result<Id, DaggerError> {
15922        let query = self.selection.select("id");
15923        query.execute(self.graphql_client.clone()).await
15924    }
15925    /// The kind of type this is (e.g. primitive, list, object).
15926    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
15927        let query = self.selection.select("kind");
15928        query.execute(self.graphql_client.clone()).await
15929    }
15930    /// The canonical non-optional name of the type.
15931    pub async fn name(&self) -> Result<String, DaggerError> {
15932        let query = self.selection.select("name");
15933        query.execute(self.graphql_client.clone()).await
15934    }
15935    /// Whether this type can be set to null. Defaults to false.
15936    pub async fn optional(&self) -> Result<bool, DaggerError> {
15937        let query = self.selection.select("optional");
15938        query.execute(self.graphql_client.clone()).await
15939    }
15940    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
15941    pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
15942        let mut query = self.selection.select("withConstructor");
15943        query = query.arg_lazy(
15944            "function",
15945            Box::new(move || {
15946                let function = function.clone();
15947                Box::pin(async move { function.into_id().await.unwrap().quote() })
15948            }),
15949        );
15950        TypeDef {
15951            proc: self.proc.clone(),
15952            selection: query,
15953            graphql_client: self.graphql_client.clone(),
15954        }
15955    }
15956    /// Returns a TypeDef of kind Enum with the provided name.
15957    /// 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.
15958    ///
15959    /// # Arguments
15960    ///
15961    /// * `name` - The name of the enum
15962    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15963    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
15964        let mut query = self.selection.select("withEnum");
15965        query = query.arg("name", name.into());
15966        TypeDef {
15967            proc: self.proc.clone(),
15968            selection: query,
15969            graphql_client: self.graphql_client.clone(),
15970        }
15971    }
15972    /// Returns a TypeDef of kind Enum with the provided name.
15973    /// 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.
15974    ///
15975    /// # Arguments
15976    ///
15977    /// * `name` - The name of the enum
15978    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15979    pub fn with_enum_opts<'a>(
15980        &self,
15981        name: impl Into<String>,
15982        opts: TypeDefWithEnumOpts<'a>,
15983    ) -> TypeDef {
15984        let mut query = self.selection.select("withEnum");
15985        query = query.arg("name", name.into());
15986        if let Some(description) = opts.description {
15987            query = query.arg("description", description);
15988        }
15989        if let Some(source_map) = opts.source_map {
15990            query = query.arg("sourceMap", source_map);
15991        }
15992        TypeDef {
15993            proc: self.proc.clone(),
15994            selection: query,
15995            graphql_client: self.graphql_client.clone(),
15996        }
15997    }
15998    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15999    ///
16000    /// # Arguments
16001    ///
16002    /// * `name` - The name of the member in the enum
16003    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16004    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
16005        let mut query = self.selection.select("withEnumMember");
16006        query = query.arg("name", name.into());
16007        TypeDef {
16008            proc: self.proc.clone(),
16009            selection: query,
16010            graphql_client: self.graphql_client.clone(),
16011        }
16012    }
16013    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
16014    ///
16015    /// # Arguments
16016    ///
16017    /// * `name` - The name of the member in the enum
16018    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16019    pub fn with_enum_member_opts<'a>(
16020        &self,
16021        name: impl Into<String>,
16022        opts: TypeDefWithEnumMemberOpts<'a>,
16023    ) -> TypeDef {
16024        let mut query = self.selection.select("withEnumMember");
16025        query = query.arg("name", name.into());
16026        if let Some(value) = opts.value {
16027            query = query.arg("value", value);
16028        }
16029        if let Some(description) = opts.description {
16030            query = query.arg("description", description);
16031        }
16032        if let Some(source_map) = opts.source_map {
16033            query = query.arg("sourceMap", source_map);
16034        }
16035        if let Some(deprecated) = opts.deprecated {
16036            query = query.arg("deprecated", deprecated);
16037        }
16038        TypeDef {
16039            proc: self.proc.clone(),
16040            selection: query,
16041            graphql_client: self.graphql_client.clone(),
16042        }
16043    }
16044    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
16045    ///
16046    /// # Arguments
16047    ///
16048    /// * `value` - The name of the value in the enum
16049    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16050    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
16051        let mut query = self.selection.select("withEnumValue");
16052        query = query.arg("value", value.into());
16053        TypeDef {
16054            proc: self.proc.clone(),
16055            selection: query,
16056            graphql_client: self.graphql_client.clone(),
16057        }
16058    }
16059    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
16060    ///
16061    /// # Arguments
16062    ///
16063    /// * `value` - The name of the value in the enum
16064    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16065    pub fn with_enum_value_opts<'a>(
16066        &self,
16067        value: impl Into<String>,
16068        opts: TypeDefWithEnumValueOpts<'a>,
16069    ) -> TypeDef {
16070        let mut query = self.selection.select("withEnumValue");
16071        query = query.arg("value", value.into());
16072        if let Some(description) = opts.description {
16073            query = query.arg("description", description);
16074        }
16075        if let Some(source_map) = opts.source_map {
16076            query = query.arg("sourceMap", source_map);
16077        }
16078        if let Some(deprecated) = opts.deprecated {
16079            query = query.arg("deprecated", deprecated);
16080        }
16081        TypeDef {
16082            proc: self.proc.clone(),
16083            selection: query,
16084            graphql_client: self.graphql_client.clone(),
16085        }
16086    }
16087    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
16088    ///
16089    /// # Arguments
16090    ///
16091    /// * `name` - The name of the field in the object
16092    /// * `type_def` - The type of the field
16093    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16094    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
16095        let mut query = self.selection.select("withField");
16096        query = query.arg("name", name.into());
16097        query = query.arg_lazy(
16098            "typeDef",
16099            Box::new(move || {
16100                let type_def = type_def.clone();
16101                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
16102            }),
16103        );
16104        TypeDef {
16105            proc: self.proc.clone(),
16106            selection: query,
16107            graphql_client: self.graphql_client.clone(),
16108        }
16109    }
16110    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
16111    ///
16112    /// # Arguments
16113    ///
16114    /// * `name` - The name of the field in the object
16115    /// * `type_def` - The type of the field
16116    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16117    pub fn with_field_opts<'a>(
16118        &self,
16119        name: impl Into<String>,
16120        type_def: impl IntoID<Id>,
16121        opts: TypeDefWithFieldOpts<'a>,
16122    ) -> TypeDef {
16123        let mut query = self.selection.select("withField");
16124        query = query.arg("name", name.into());
16125        query = query.arg_lazy(
16126            "typeDef",
16127            Box::new(move || {
16128                let type_def = type_def.clone();
16129                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
16130            }),
16131        );
16132        if let Some(description) = opts.description {
16133            query = query.arg("description", description);
16134        }
16135        if let Some(source_map) = opts.source_map {
16136            query = query.arg("sourceMap", source_map);
16137        }
16138        if let Some(deprecated) = opts.deprecated {
16139            query = query.arg("deprecated", deprecated);
16140        }
16141        TypeDef {
16142            proc: self.proc.clone(),
16143            selection: query,
16144            graphql_client: self.graphql_client.clone(),
16145        }
16146    }
16147    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
16148    pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
16149        let mut query = self.selection.select("withFunction");
16150        query = query.arg_lazy(
16151            "function",
16152            Box::new(move || {
16153                let function = function.clone();
16154                Box::pin(async move { function.into_id().await.unwrap().quote() })
16155            }),
16156        );
16157        TypeDef {
16158            proc: self.proc.clone(),
16159            selection: query,
16160            graphql_client: self.graphql_client.clone(),
16161        }
16162    }
16163    /// Returns a TypeDef of kind Interface with the provided name.
16164    ///
16165    /// # Arguments
16166    ///
16167    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16168    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
16169        let mut query = self.selection.select("withInterface");
16170        query = query.arg("name", name.into());
16171        TypeDef {
16172            proc: self.proc.clone(),
16173            selection: query,
16174            graphql_client: self.graphql_client.clone(),
16175        }
16176    }
16177    /// Returns a TypeDef of kind Interface with the provided name.
16178    ///
16179    /// # Arguments
16180    ///
16181    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16182    pub fn with_interface_opts<'a>(
16183        &self,
16184        name: impl Into<String>,
16185        opts: TypeDefWithInterfaceOpts<'a>,
16186    ) -> TypeDef {
16187        let mut query = self.selection.select("withInterface");
16188        query = query.arg("name", name.into());
16189        if let Some(description) = opts.description {
16190            query = query.arg("description", description);
16191        }
16192        if let Some(source_map) = opts.source_map {
16193            query = query.arg("sourceMap", source_map);
16194        }
16195        TypeDef {
16196            proc: self.proc.clone(),
16197            selection: query,
16198            graphql_client: self.graphql_client.clone(),
16199        }
16200    }
16201    /// Sets the kind of the type.
16202    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
16203        let mut query = self.selection.select("withKind");
16204        query = query.arg("kind", kind);
16205        TypeDef {
16206            proc: self.proc.clone(),
16207            selection: query,
16208            graphql_client: self.graphql_client.clone(),
16209        }
16210    }
16211    /// Returns a TypeDef of kind List with the provided type for its elements.
16212    pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
16213        let mut query = self.selection.select("withListOf");
16214        query = query.arg_lazy(
16215            "elementType",
16216            Box::new(move || {
16217                let element_type = element_type.clone();
16218                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
16219            }),
16220        );
16221        TypeDef {
16222            proc: self.proc.clone(),
16223            selection: query,
16224            graphql_client: self.graphql_client.clone(),
16225        }
16226    }
16227    /// Returns a TypeDef of kind Object with the provided name.
16228    /// 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.
16229    ///
16230    /// # Arguments
16231    ///
16232    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16233    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
16234        let mut query = self.selection.select("withObject");
16235        query = query.arg("name", name.into());
16236        TypeDef {
16237            proc: self.proc.clone(),
16238            selection: query,
16239            graphql_client: self.graphql_client.clone(),
16240        }
16241    }
16242    /// Returns a TypeDef of kind Object with the provided name.
16243    /// 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.
16244    ///
16245    /// # Arguments
16246    ///
16247    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16248    pub fn with_object_opts<'a>(
16249        &self,
16250        name: impl Into<String>,
16251        opts: TypeDefWithObjectOpts<'a>,
16252    ) -> TypeDef {
16253        let mut query = self.selection.select("withObject");
16254        query = query.arg("name", name.into());
16255        if let Some(description) = opts.description {
16256            query = query.arg("description", description);
16257        }
16258        if let Some(source_map) = opts.source_map {
16259            query = query.arg("sourceMap", source_map);
16260        }
16261        if let Some(deprecated) = opts.deprecated {
16262            query = query.arg("deprecated", deprecated);
16263        }
16264        TypeDef {
16265            proc: self.proc.clone(),
16266            selection: query,
16267            graphql_client: self.graphql_client.clone(),
16268        }
16269    }
16270    /// Sets whether this type can be set to null.
16271    pub fn with_optional(&self, optional: bool) -> TypeDef {
16272        let mut query = self.selection.select("withOptional");
16273        query = query.arg("optional", optional);
16274        TypeDef {
16275            proc: self.proc.clone(),
16276            selection: query,
16277            graphql_client: self.graphql_client.clone(),
16278        }
16279    }
16280    /// Returns a TypeDef of kind Scalar with the provided name.
16281    ///
16282    /// # Arguments
16283    ///
16284    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16285    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
16286        let mut query = self.selection.select("withScalar");
16287        query = query.arg("name", name.into());
16288        TypeDef {
16289            proc: self.proc.clone(),
16290            selection: query,
16291            graphql_client: self.graphql_client.clone(),
16292        }
16293    }
16294    /// Returns a TypeDef of kind Scalar with the provided name.
16295    ///
16296    /// # Arguments
16297    ///
16298    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16299    pub fn with_scalar_opts<'a>(
16300        &self,
16301        name: impl Into<String>,
16302        opts: TypeDefWithScalarOpts<'a>,
16303    ) -> TypeDef {
16304        let mut query = self.selection.select("withScalar");
16305        query = query.arg("name", name.into());
16306        if let Some(description) = opts.description {
16307            query = query.arg("description", description);
16308        }
16309        TypeDef {
16310            proc: self.proc.clone(),
16311            selection: query,
16312            graphql_client: self.graphql_client.clone(),
16313        }
16314    }
16315}
16316impl Node for TypeDef {
16317    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16318        let query = self.selection.select("id");
16319        let graphql_client = self.graphql_client.clone();
16320        async move { query.execute(graphql_client).await }
16321    }
16322}
16323#[derive(Clone)]
16324pub struct Up {
16325    pub proc: Option<Arc<DaggerSessionProc>>,
16326    pub selection: Selection,
16327    pub graphql_client: DynGraphQLClient,
16328}
16329impl IntoID<Id> for Up {
16330    fn into_id(
16331        self,
16332    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16333        Box::pin(async move { self.id().await })
16334    }
16335}
16336impl Loadable for Up {
16337    fn graphql_type() -> &'static str {
16338        "Up"
16339    }
16340    fn from_query(
16341        proc: Option<Arc<DaggerSessionProc>>,
16342        selection: Selection,
16343        graphql_client: DynGraphQLClient,
16344    ) -> Self {
16345        Self {
16346            proc,
16347            selection,
16348            graphql_client,
16349        }
16350    }
16351}
16352impl Up {
16353    /// The description of the service
16354    pub async fn description(&self) -> Result<String, DaggerError> {
16355        let query = self.selection.select("description");
16356        query.execute(self.graphql_client.clone()).await
16357    }
16358    /// A unique identifier for this Up.
16359    pub async fn id(&self) -> Result<Id, DaggerError> {
16360        let query = self.selection.select("id");
16361        query.execute(self.graphql_client.clone()).await
16362    }
16363    /// Return the fully qualified name of the service
16364    pub async fn name(&self) -> Result<String, DaggerError> {
16365        let query = self.selection.select("name");
16366        query.execute(self.graphql_client.clone()).await
16367    }
16368    /// The original module in which the service has been defined
16369    pub fn original_module(&self) -> Module {
16370        let query = self.selection.select("originalModule");
16371        Module {
16372            proc: self.proc.clone(),
16373            selection: query,
16374            graphql_client: self.graphql_client.clone(),
16375        }
16376    }
16377    /// The path of the service within its module
16378    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
16379        let query = self.selection.select("path");
16380        query.execute(self.graphql_client.clone()).await
16381    }
16382    /// Execute the service function
16383    pub fn run(&self) -> Up {
16384        let query = self.selection.select("run");
16385        Up {
16386            proc: self.proc.clone(),
16387            selection: query,
16388            graphql_client: self.graphql_client.clone(),
16389        }
16390    }
16391}
16392impl Node for Up {
16393    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16394        let query = self.selection.select("id");
16395        let graphql_client = self.graphql_client.clone();
16396        async move { query.execute(graphql_client).await }
16397    }
16398}
16399#[derive(Clone)]
16400pub struct UpGroup {
16401    pub proc: Option<Arc<DaggerSessionProc>>,
16402    pub selection: Selection,
16403    pub graphql_client: DynGraphQLClient,
16404}
16405impl IntoID<Id> for UpGroup {
16406    fn into_id(
16407        self,
16408    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16409        Box::pin(async move { self.id().await })
16410    }
16411}
16412impl Loadable for UpGroup {
16413    fn graphql_type() -> &'static str {
16414        "UpGroup"
16415    }
16416    fn from_query(
16417        proc: Option<Arc<DaggerSessionProc>>,
16418        selection: Selection,
16419        graphql_client: DynGraphQLClient,
16420    ) -> Self {
16421        Self {
16422            proc,
16423            selection,
16424            graphql_client,
16425        }
16426    }
16427}
16428impl UpGroup {
16429    /// A unique identifier for this UpGroup.
16430    pub async fn id(&self) -> Result<Id, DaggerError> {
16431        let query = self.selection.select("id");
16432        query.execute(self.graphql_client.clone()).await
16433    }
16434    /// Return a list of individual services and their details
16435    pub async fn list(&self) -> Result<Vec<Up>, DaggerError> {
16436        let query = self.selection.select("list");
16437        let query = query.select("id");
16438        let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16439        Ok(ids
16440            .into_iter()
16441            .map(|id| Up {
16442                proc: self.proc.clone(),
16443                selection: crate::querybuilder::query()
16444                    .select("node")
16445                    .arg("id", &id.0)
16446                    .inline_fragment("Up"),
16447                graphql_client: self.graphql_client.clone(),
16448            })
16449            .collect())
16450    }
16451    /// Execute all selected service functions
16452    pub fn run(&self) -> UpGroup {
16453        let query = self.selection.select("run");
16454        UpGroup {
16455            proc: self.proc.clone(),
16456            selection: query,
16457            graphql_client: self.graphql_client.clone(),
16458        }
16459    }
16460}
16461impl Node for UpGroup {
16462    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16463        let query = self.selection.select("id");
16464        let graphql_client = self.graphql_client.clone();
16465        async move { query.execute(graphql_client).await }
16466    }
16467}
16468#[derive(Clone)]
16469pub struct Volume {
16470    pub proc: Option<Arc<DaggerSessionProc>>,
16471    pub selection: Selection,
16472    pub graphql_client: DynGraphQLClient,
16473}
16474impl IntoID<Id> for Volume {
16475    fn into_id(
16476        self,
16477    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16478        Box::pin(async move { self.id().await })
16479    }
16480}
16481impl Loadable for Volume {
16482    fn graphql_type() -> &'static str {
16483        "Volume"
16484    }
16485    fn from_query(
16486        proc: Option<Arc<DaggerSessionProc>>,
16487        selection: Selection,
16488        graphql_client: DynGraphQLClient,
16489    ) -> Self {
16490        Self {
16491            proc,
16492            selection,
16493            graphql_client,
16494        }
16495    }
16496}
16497impl Volume {
16498    /// A unique identifier for this Volume.
16499    pub async fn id(&self) -> Result<Id, DaggerError> {
16500        let query = self.selection.select("id");
16501        query.execute(self.graphql_client.clone()).await
16502    }
16503}
16504impl Node for Volume {
16505    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16506        let query = self.selection.select("id");
16507        let graphql_client = self.graphql_client.clone();
16508        async move { query.execute(graphql_client).await }
16509    }
16510}
16511#[derive(Clone)]
16512pub struct Workspace {
16513    pub proc: Option<Arc<DaggerSessionProc>>,
16514    pub selection: Selection,
16515    pub graphql_client: DynGraphQLClient,
16516}
16517#[derive(Builder, Debug, PartialEq)]
16518pub struct WorkspaceChecksOpts<'a> {
16519    /// Only include checks matching the specified patterns
16520    #[builder(setter(into, strip_option), default)]
16521    pub include: Option<Vec<&'a str>>,
16522    /// When true, only return annotated check functions; exclude generate-as-checks
16523    #[builder(setter(into, strip_option), default)]
16524    pub no_generate: Option<bool>,
16525    /// When true, only return generate-as-checks; exclude annotated check functions
16526    #[builder(setter(into, strip_option), default)]
16527    pub only_generate: Option<bool>,
16528}
16529#[derive(Builder, Debug, PartialEq)]
16530pub struct WorkspaceDirectoryOpts<'a> {
16531    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
16532    #[builder(setter(into, strip_option), default)]
16533    pub exclude: Option<Vec<&'a str>>,
16534    /// Apply .gitignore filter rules inside the directory.
16535    #[builder(setter(into, strip_option), default)]
16536    pub gitignore: Option<bool>,
16537    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
16538    #[builder(setter(into, strip_option), default)]
16539    pub include: Option<Vec<&'a str>>,
16540}
16541#[derive(Builder, Debug, PartialEq)]
16542pub struct WorkspaceFindUpOpts<'a> {
16543    /// Path to start the search from. Relative paths resolve from the workspace directory; absolute paths resolve from the workspace boundary.
16544    #[builder(setter(into, strip_option), default)]
16545    pub from: Option<&'a str>,
16546}
16547#[derive(Builder, Debug, PartialEq)]
16548pub struct WorkspaceGeneratorsOpts<'a> {
16549    /// Only include generators matching the specified patterns
16550    #[builder(setter(into, strip_option), default)]
16551    pub include: Option<Vec<&'a str>>,
16552}
16553#[derive(Builder, Debug, PartialEq)]
16554pub struct WorkspaceServicesOpts<'a> {
16555    /// Only include services matching the specified patterns
16556    #[builder(setter(into, strip_option), default)]
16557    pub include: Option<Vec<&'a str>>,
16558}
16559impl IntoID<Id> for Workspace {
16560    fn into_id(
16561        self,
16562    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16563        Box::pin(async move { self.id().await })
16564    }
16565}
16566impl Loadable for Workspace {
16567    fn graphql_type() -> &'static str {
16568        "Workspace"
16569    }
16570    fn from_query(
16571        proc: Option<Arc<DaggerSessionProc>>,
16572        selection: Selection,
16573        graphql_client: DynGraphQLClient,
16574    ) -> Self {
16575        Self {
16576            proc,
16577            selection,
16578            graphql_client,
16579        }
16580    }
16581}
16582impl Workspace {
16583    /// Canonical Dagger address of the workspace directory.
16584    pub async fn address(&self) -> Result<String, DaggerError> {
16585        let query = self.selection.select("address");
16586        query.execute(self.graphql_client.clone()).await
16587    }
16588    /// Return all checks from modules loaded in the workspace.
16589    ///
16590    /// # Arguments
16591    ///
16592    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16593    pub fn checks(&self) -> CheckGroup {
16594        let query = self.selection.select("checks");
16595        CheckGroup {
16596            proc: self.proc.clone(),
16597            selection: query,
16598            graphql_client: self.graphql_client.clone(),
16599        }
16600    }
16601    /// Return all checks from modules loaded in the workspace.
16602    ///
16603    /// # Arguments
16604    ///
16605    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16606    pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
16607        let mut query = self.selection.select("checks");
16608        if let Some(include) = opts.include {
16609            query = query.arg("include", include);
16610        }
16611        if let Some(no_generate) = opts.no_generate {
16612            query = query.arg("noGenerate", no_generate);
16613        }
16614        if let Some(only_generate) = opts.only_generate {
16615            query = query.arg("onlyGenerate", only_generate);
16616        }
16617        CheckGroup {
16618            proc: self.proc.clone(),
16619            selection: query,
16620            graphql_client: self.graphql_client.clone(),
16621        }
16622    }
16623    /// The client ID that owns this workspace's host filesystem.
16624    pub async fn client_id(&self) -> Result<String, DaggerError> {
16625        let query = self.selection.select("clientId");
16626        query.execute(self.graphql_client.clone()).await
16627    }
16628    /// Path to config.toml relative to the workspace boundary (empty if not initialized).
16629    pub async fn config_path(&self) -> Result<String, DaggerError> {
16630        let query = self.selection.select("configPath");
16631        query.execute(self.graphql_client.clone()).await
16632    }
16633    /// Returns a Directory from the workspace.
16634    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
16635    ///
16636    /// # Arguments
16637    ///
16638    /// * `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.
16639    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16640    pub fn directory(&self, path: impl Into<String>) -> Directory {
16641        let mut query = self.selection.select("directory");
16642        query = query.arg("path", path.into());
16643        Directory {
16644            proc: self.proc.clone(),
16645            selection: query,
16646            graphql_client: self.graphql_client.clone(),
16647        }
16648    }
16649    /// Returns a Directory from the workspace.
16650    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
16651    ///
16652    /// # Arguments
16653    ///
16654    /// * `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.
16655    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16656    pub fn directory_opts<'a>(
16657        &self,
16658        path: impl Into<String>,
16659        opts: WorkspaceDirectoryOpts<'a>,
16660    ) -> Directory {
16661        let mut query = self.selection.select("directory");
16662        query = query.arg("path", path.into());
16663        if let Some(exclude) = opts.exclude {
16664            query = query.arg("exclude", exclude);
16665        }
16666        if let Some(include) = opts.include {
16667            query = query.arg("include", include);
16668        }
16669        if let Some(gitignore) = opts.gitignore {
16670            query = query.arg("gitignore", gitignore);
16671        }
16672        Directory {
16673            proc: self.proc.clone(),
16674            selection: query,
16675            graphql_client: self.graphql_client.clone(),
16676        }
16677    }
16678    /// Returns a File from the workspace.
16679    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
16680    ///
16681    /// # Arguments
16682    ///
16683    /// * `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.
16684    pub fn file(&self, path: impl Into<String>) -> File {
16685        let mut query = self.selection.select("file");
16686        query = query.arg("path", path.into());
16687        File {
16688            proc: self.proc.clone(),
16689            selection: query,
16690            graphql_client: self.graphql_client.clone(),
16691        }
16692    }
16693    /// Search for a file or directory by walking up from the start path within the workspace.
16694    /// Returns the absolute workspace path if found, or null if not found.
16695    /// Relative start paths resolve from the workspace directory.
16696    /// The search stops at the workspace boundary and will not traverse above it.
16697    ///
16698    /// # Arguments
16699    ///
16700    /// * `name` - The name of the file or directory to search for.
16701    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16702    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
16703        let mut query = self.selection.select("findUp");
16704        query = query.arg("name", name.into());
16705        query.execute(self.graphql_client.clone()).await
16706    }
16707    /// Search for a file or directory by walking up from the start path within the workspace.
16708    /// Returns the absolute workspace path if found, or null if not found.
16709    /// Relative start paths resolve from the workspace directory.
16710    /// The search stops at the workspace boundary and will not traverse above it.
16711    ///
16712    /// # Arguments
16713    ///
16714    /// * `name` - The name of the file or directory to search for.
16715    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16716    pub async fn find_up_opts<'a>(
16717        &self,
16718        name: impl Into<String>,
16719        opts: WorkspaceFindUpOpts<'a>,
16720    ) -> Result<String, DaggerError> {
16721        let mut query = self.selection.select("findUp");
16722        query = query.arg("name", name.into());
16723        if let Some(from) = opts.from {
16724            query = query.arg("from", from);
16725        }
16726        query.execute(self.graphql_client.clone()).await
16727    }
16728    /// Return all generators from modules loaded in the workspace.
16729    ///
16730    /// # Arguments
16731    ///
16732    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16733    pub fn generators(&self) -> GeneratorGroup {
16734        let query = self.selection.select("generators");
16735        GeneratorGroup {
16736            proc: self.proc.clone(),
16737            selection: query,
16738            graphql_client: self.graphql_client.clone(),
16739        }
16740    }
16741    /// Return all generators from modules loaded in the workspace.
16742    ///
16743    /// # Arguments
16744    ///
16745    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16746    pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
16747        let mut query = self.selection.select("generators");
16748        if let Some(include) = opts.include {
16749            query = query.arg("include", include);
16750        }
16751        GeneratorGroup {
16752            proc: self.proc.clone(),
16753            selection: query,
16754            graphql_client: self.graphql_client.clone(),
16755        }
16756    }
16757    /// Whether a config.toml file exists in the workspace.
16758    pub async fn has_config(&self) -> Result<bool, DaggerError> {
16759        let query = self.selection.select("hasConfig");
16760        query.execute(self.graphql_client.clone()).await
16761    }
16762    /// A unique identifier for this Workspace.
16763    pub async fn id(&self) -> Result<Id, DaggerError> {
16764        let query = self.selection.select("id");
16765        query.execute(self.graphql_client.clone()).await
16766    }
16767    /// Whether .dagger/config.toml exists.
16768    pub async fn initialized(&self) -> Result<bool, DaggerError> {
16769        let query = self.selection.select("initialized");
16770        query.execute(self.graphql_client.clone()).await
16771    }
16772    /// Workspace directory path relative to the workspace boundary.
16773    pub async fn path(&self) -> Result<String, DaggerError> {
16774        let query = self.selection.select("path");
16775        query.execute(self.graphql_client.clone()).await
16776    }
16777    /// Return all services from modules loaded in the workspace.
16778    ///
16779    /// # Arguments
16780    ///
16781    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16782    pub fn services(&self) -> UpGroup {
16783        let query = self.selection.select("services");
16784        UpGroup {
16785            proc: self.proc.clone(),
16786            selection: query,
16787            graphql_client: self.graphql_client.clone(),
16788        }
16789    }
16790    /// Return all services from modules loaded in the workspace.
16791    ///
16792    /// # Arguments
16793    ///
16794    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16795    pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
16796        let mut query = self.selection.select("services");
16797        if let Some(include) = opts.include {
16798            query = query.arg("include", include);
16799        }
16800        UpGroup {
16801            proc: self.proc.clone(),
16802            selection: query,
16803            graphql_client: self.graphql_client.clone(),
16804        }
16805    }
16806    /// Refresh workspace-managed state and return the resulting changeset.
16807    /// Currently this refreshes existing lockfile entries only.
16808    pub fn update(&self) -> Changeset {
16809        let query = self.selection.select("update");
16810        Changeset {
16811            proc: self.proc.clone(),
16812            selection: query,
16813            graphql_client: self.graphql_client.clone(),
16814        }
16815    }
16816}
16817impl Node for Workspace {
16818    fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16819        let query = self.selection.select("id");
16820        let graphql_client = self.graphql_client.clone();
16821        async move { query.execute(graphql_client).await }
16822    }
16823}
16824#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16825pub enum CacheSharingMode {
16826    #[serde(rename = "LOCKED")]
16827    Locked,
16828    #[serde(rename = "PRIVATE")]
16829    Private,
16830    #[serde(rename = "SHARED")]
16831    Shared,
16832}
16833#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16834pub enum ChangesetMergeConflict {
16835    #[serde(rename = "FAIL")]
16836    Fail,
16837    #[serde(rename = "FAIL_EARLY")]
16838    FailEarly,
16839    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
16840    LeaveConflictMarkers,
16841    #[serde(rename = "PREFER_OURS")]
16842    PreferOurs,
16843    #[serde(rename = "PREFER_THEIRS")]
16844    PreferTheirs,
16845}
16846#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16847pub enum ChangesetsMergeConflict {
16848    #[serde(rename = "FAIL")]
16849    Fail,
16850    #[serde(rename = "FAIL_EARLY")]
16851    FailEarly,
16852}
16853#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16854pub enum DiffStatKind {
16855    #[serde(rename = "ADDED")]
16856    Added,
16857    #[serde(rename = "MODIFIED")]
16858    Modified,
16859    #[serde(rename = "REMOVED")]
16860    Removed,
16861    #[serde(rename = "RENAMED")]
16862    Renamed,
16863}
16864#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16865pub enum ExistsType {
16866    #[serde(rename = "DIRECTORY_TYPE")]
16867    DirectoryType,
16868    #[serde(rename = "REGULAR_TYPE")]
16869    RegularType,
16870    #[serde(rename = "SYMLINK_TYPE")]
16871    SymlinkType,
16872}
16873#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16874pub enum FileType {
16875    #[serde(rename = "DIRECTORY")]
16876    Directory,
16877    #[serde(rename = "DIRECTORY_TYPE")]
16878    DirectoryType,
16879    #[serde(rename = "REGULAR")]
16880    Regular,
16881    #[serde(rename = "REGULAR_TYPE")]
16882    RegularType,
16883    #[serde(rename = "SYMLINK")]
16884    Symlink,
16885    #[serde(rename = "SYMLINK_TYPE")]
16886    SymlinkType,
16887    #[serde(rename = "UNKNOWN")]
16888    Unknown,
16889}
16890#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16891pub enum FunctionCachePolicy {
16892    #[serde(rename = "Default")]
16893    Default,
16894    #[serde(rename = "Never")]
16895    Never,
16896    #[serde(rename = "PerSession")]
16897    PerSession,
16898}
16899#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16900pub enum ImageLayerCompression {
16901    #[serde(rename = "EStarGZ")]
16902    EStarGz,
16903    #[serde(rename = "ESTARGZ")]
16904    Estargz,
16905    #[serde(rename = "Gzip")]
16906    Gzip,
16907    #[serde(rename = "Uncompressed")]
16908    Uncompressed,
16909    #[serde(rename = "Zstd")]
16910    Zstd,
16911}
16912#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16913pub enum ImageMediaTypes {
16914    #[serde(rename = "DOCKER")]
16915    Docker,
16916    #[serde(rename = "DockerMediaTypes")]
16917    DockerMediaTypes,
16918    #[serde(rename = "OCI")]
16919    Oci,
16920    #[serde(rename = "OCIMediaTypes")]
16921    OciMediaTypes,
16922}
16923#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16924pub enum ModuleSourceExperimentalFeature {
16925    #[serde(rename = "SELF_CALLS")]
16926    SelfCalls,
16927}
16928#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16929pub enum ModuleSourceKind {
16930    #[serde(rename = "DIR")]
16931    Dir,
16932    #[serde(rename = "DIR_SOURCE")]
16933    DirSource,
16934    #[serde(rename = "GIT")]
16935    Git,
16936    #[serde(rename = "GIT_SOURCE")]
16937    GitSource,
16938    #[serde(rename = "LOCAL")]
16939    Local,
16940    #[serde(rename = "LOCAL_SOURCE")]
16941    LocalSource,
16942}
16943#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16944pub enum NetworkProtocol {
16945    #[serde(rename = "TCP")]
16946    Tcp,
16947    #[serde(rename = "UDP")]
16948    Udp,
16949}
16950#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16951pub enum ReturnType {
16952    #[serde(rename = "ANY")]
16953    Any,
16954    #[serde(rename = "FAILURE")]
16955    Failure,
16956    #[serde(rename = "SUCCESS")]
16957    Success,
16958}
16959#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16960pub enum TypeDefKind {
16961    #[serde(rename = "BOOLEAN")]
16962    Boolean,
16963    #[serde(rename = "BOOLEAN_KIND")]
16964    BooleanKind,
16965    #[serde(rename = "ENUM")]
16966    Enum,
16967    #[serde(rename = "ENUM_KIND")]
16968    EnumKind,
16969    #[serde(rename = "FLOAT")]
16970    Float,
16971    #[serde(rename = "FLOAT_KIND")]
16972    FloatKind,
16973    #[serde(rename = "INPUT")]
16974    Input,
16975    #[serde(rename = "INPUT_KIND")]
16976    InputKind,
16977    #[serde(rename = "INTEGER")]
16978    Integer,
16979    #[serde(rename = "INTEGER_KIND")]
16980    IntegerKind,
16981    #[serde(rename = "INTERFACE")]
16982    Interface,
16983    #[serde(rename = "INTERFACE_KIND")]
16984    InterfaceKind,
16985    #[serde(rename = "LIST")]
16986    List,
16987    #[serde(rename = "LIST_KIND")]
16988    ListKind,
16989    #[serde(rename = "OBJECT")]
16990    Object,
16991    #[serde(rename = "OBJECT_KIND")]
16992    ObjectKind,
16993    #[serde(rename = "SCALAR")]
16994    Scalar,
16995    #[serde(rename = "SCALAR_KIND")]
16996    ScalarKind,
16997    #[serde(rename = "STRING")]
16998    String,
16999    #[serde(rename = "STRING_KIND")]
17000    StringKind,
17001    #[serde(rename = "VOID")]
17002    Void,
17003    #[serde(rename = "VOID_KIND")]
17004    VoidKind,
17005}