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::querybuilder::Selection;
8use derive_builder::Builder;
9use serde::{Deserialize, Serialize};
10use std::sync::Arc;
11
12#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
13pub struct CacheVolumeId(pub String);
14impl From<&str> for CacheVolumeId {
15    fn from(value: &str) -> Self {
16        Self(value.to_string())
17    }
18}
19impl From<String> for CacheVolumeId {
20    fn from(value: String) -> Self {
21        Self(value)
22    }
23}
24impl IntoID<CacheVolumeId> for CacheVolume {
25    fn into_id(
26        self,
27    ) -> std::pin::Pin<
28        Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
29    > {
30        Box::pin(async move { self.id().await })
31    }
32}
33impl IntoID<CacheVolumeId> for CacheVolumeId {
34    fn into_id(
35        self,
36    ) -> std::pin::Pin<
37        Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
38    > {
39        Box::pin(async move { Ok::<CacheVolumeId, DaggerError>(self) })
40    }
41}
42impl CacheVolumeId {
43    fn quote(&self) -> String {
44        format!("\"{}\"", self.0.clone())
45    }
46}
47#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
48pub struct ContainerId(pub String);
49impl From<&str> for ContainerId {
50    fn from(value: &str) -> Self {
51        Self(value.to_string())
52    }
53}
54impl From<String> for ContainerId {
55    fn from(value: String) -> Self {
56        Self(value)
57    }
58}
59impl IntoID<ContainerId> for Container {
60    fn into_id(
61        self,
62    ) -> std::pin::Pin<
63        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
64    > {
65        Box::pin(async move { self.id().await })
66    }
67}
68impl IntoID<ContainerId> for ContainerId {
69    fn into_id(
70        self,
71    ) -> std::pin::Pin<
72        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
73    > {
74        Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
75    }
76}
77impl ContainerId {
78    fn quote(&self) -> String {
79        format!("\"{}\"", self.0.clone())
80    }
81}
82#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
83pub struct CurrentModuleId(pub String);
84impl From<&str> for CurrentModuleId {
85    fn from(value: &str) -> Self {
86        Self(value.to_string())
87    }
88}
89impl From<String> for CurrentModuleId {
90    fn from(value: String) -> Self {
91        Self(value)
92    }
93}
94impl IntoID<CurrentModuleId> for CurrentModule {
95    fn into_id(
96        self,
97    ) -> std::pin::Pin<
98        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
99    > {
100        Box::pin(async move { self.id().await })
101    }
102}
103impl IntoID<CurrentModuleId> for CurrentModuleId {
104    fn into_id(
105        self,
106    ) -> std::pin::Pin<
107        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
108    > {
109        Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
110    }
111}
112impl CurrentModuleId {
113    fn quote(&self) -> String {
114        format!("\"{}\"", self.0.clone())
115    }
116}
117#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
118pub struct DirectoryId(pub String);
119impl From<&str> for DirectoryId {
120    fn from(value: &str) -> Self {
121        Self(value.to_string())
122    }
123}
124impl From<String> for DirectoryId {
125    fn from(value: String) -> Self {
126        Self(value)
127    }
128}
129impl IntoID<DirectoryId> for Directory {
130    fn into_id(
131        self,
132    ) -> std::pin::Pin<
133        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
134    > {
135        Box::pin(async move { self.id().await })
136    }
137}
138impl IntoID<DirectoryId> for DirectoryId {
139    fn into_id(
140        self,
141    ) -> std::pin::Pin<
142        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
143    > {
144        Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
145    }
146}
147impl DirectoryId {
148    fn quote(&self) -> String {
149        format!("\"{}\"", self.0.clone())
150    }
151}
152#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
153pub struct EngineCacheEntryId(pub String);
154impl From<&str> for EngineCacheEntryId {
155    fn from(value: &str) -> Self {
156        Self(value.to_string())
157    }
158}
159impl From<String> for EngineCacheEntryId {
160    fn from(value: String) -> Self {
161        Self(value)
162    }
163}
164impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
165    fn into_id(
166        self,
167    ) -> std::pin::Pin<
168        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
169    > {
170        Box::pin(async move { self.id().await })
171    }
172}
173impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
174    fn into_id(
175        self,
176    ) -> std::pin::Pin<
177        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
178    > {
179        Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
180    }
181}
182impl EngineCacheEntryId {
183    fn quote(&self) -> String {
184        format!("\"{}\"", self.0.clone())
185    }
186}
187#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
188pub struct EngineCacheEntrySetId(pub String);
189impl From<&str> for EngineCacheEntrySetId {
190    fn from(value: &str) -> Self {
191        Self(value.to_string())
192    }
193}
194impl From<String> for EngineCacheEntrySetId {
195    fn from(value: String) -> Self {
196        Self(value)
197    }
198}
199impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
200    fn into_id(
201        self,
202    ) -> std::pin::Pin<
203        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
204    > {
205        Box::pin(async move { self.id().await })
206    }
207}
208impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
209    fn into_id(
210        self,
211    ) -> std::pin::Pin<
212        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
213    > {
214        Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
215    }
216}
217impl EngineCacheEntrySetId {
218    fn quote(&self) -> String {
219        format!("\"{}\"", self.0.clone())
220    }
221}
222#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
223pub struct EngineCacheId(pub String);
224impl From<&str> for EngineCacheId {
225    fn from(value: &str) -> Self {
226        Self(value.to_string())
227    }
228}
229impl From<String> for EngineCacheId {
230    fn from(value: String) -> Self {
231        Self(value)
232    }
233}
234impl IntoID<EngineCacheId> for EngineCache {
235    fn into_id(
236        self,
237    ) -> std::pin::Pin<
238        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
239    > {
240        Box::pin(async move { self.id().await })
241    }
242}
243impl IntoID<EngineCacheId> for EngineCacheId {
244    fn into_id(
245        self,
246    ) -> std::pin::Pin<
247        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
248    > {
249        Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
250    }
251}
252impl EngineCacheId {
253    fn quote(&self) -> String {
254        format!("\"{}\"", self.0.clone())
255    }
256}
257#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
258pub struct EngineId(pub String);
259impl From<&str> for EngineId {
260    fn from(value: &str) -> Self {
261        Self(value.to_string())
262    }
263}
264impl From<String> for EngineId {
265    fn from(value: String) -> Self {
266        Self(value)
267    }
268}
269impl IntoID<EngineId> for Engine {
270    fn into_id(
271        self,
272    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
273    {
274        Box::pin(async move { self.id().await })
275    }
276}
277impl IntoID<EngineId> for EngineId {
278    fn into_id(
279        self,
280    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
281    {
282        Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
283    }
284}
285impl EngineId {
286    fn quote(&self) -> String {
287        format!("\"{}\"", self.0.clone())
288    }
289}
290#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
291pub struct EnumTypeDefId(pub String);
292impl From<&str> for EnumTypeDefId {
293    fn from(value: &str) -> Self {
294        Self(value.to_string())
295    }
296}
297impl From<String> for EnumTypeDefId {
298    fn from(value: String) -> Self {
299        Self(value)
300    }
301}
302impl IntoID<EnumTypeDefId> for EnumTypeDef {
303    fn into_id(
304        self,
305    ) -> std::pin::Pin<
306        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
307    > {
308        Box::pin(async move { self.id().await })
309    }
310}
311impl IntoID<EnumTypeDefId> for EnumTypeDefId {
312    fn into_id(
313        self,
314    ) -> std::pin::Pin<
315        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
316    > {
317        Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
318    }
319}
320impl EnumTypeDefId {
321    fn quote(&self) -> String {
322        format!("\"{}\"", self.0.clone())
323    }
324}
325#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
326pub struct EnumValueTypeDefId(pub String);
327impl From<&str> for EnumValueTypeDefId {
328    fn from(value: &str) -> Self {
329        Self(value.to_string())
330    }
331}
332impl From<String> for EnumValueTypeDefId {
333    fn from(value: String) -> Self {
334        Self(value)
335    }
336}
337impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
338    fn into_id(
339        self,
340    ) -> std::pin::Pin<
341        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
342    > {
343        Box::pin(async move { self.id().await })
344    }
345}
346impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
347    fn into_id(
348        self,
349    ) -> std::pin::Pin<
350        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
351    > {
352        Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
353    }
354}
355impl EnumValueTypeDefId {
356    fn quote(&self) -> String {
357        format!("\"{}\"", self.0.clone())
358    }
359}
360#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
361pub struct EnvVariableId(pub String);
362impl From<&str> for EnvVariableId {
363    fn from(value: &str) -> Self {
364        Self(value.to_string())
365    }
366}
367impl From<String> for EnvVariableId {
368    fn from(value: String) -> Self {
369        Self(value)
370    }
371}
372impl IntoID<EnvVariableId> for EnvVariable {
373    fn into_id(
374        self,
375    ) -> std::pin::Pin<
376        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
377    > {
378        Box::pin(async move { self.id().await })
379    }
380}
381impl IntoID<EnvVariableId> for EnvVariableId {
382    fn into_id(
383        self,
384    ) -> std::pin::Pin<
385        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
386    > {
387        Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
388    }
389}
390impl EnvVariableId {
391    fn quote(&self) -> String {
392        format!("\"{}\"", self.0.clone())
393    }
394}
395#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
396pub struct ErrorId(pub String);
397impl From<&str> for ErrorId {
398    fn from(value: &str) -> Self {
399        Self(value.to_string())
400    }
401}
402impl From<String> for ErrorId {
403    fn from(value: String) -> Self {
404        Self(value)
405    }
406}
407impl IntoID<ErrorId> for Error {
408    fn into_id(
409        self,
410    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
411    {
412        Box::pin(async move { self.id().await })
413    }
414}
415impl IntoID<ErrorId> for ErrorId {
416    fn into_id(
417        self,
418    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
419    {
420        Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
421    }
422}
423impl ErrorId {
424    fn quote(&self) -> String {
425        format!("\"{}\"", self.0.clone())
426    }
427}
428#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
429pub struct FieldTypeDefId(pub String);
430impl From<&str> for FieldTypeDefId {
431    fn from(value: &str) -> Self {
432        Self(value.to_string())
433    }
434}
435impl From<String> for FieldTypeDefId {
436    fn from(value: String) -> Self {
437        Self(value)
438    }
439}
440impl IntoID<FieldTypeDefId> for FieldTypeDef {
441    fn into_id(
442        self,
443    ) -> std::pin::Pin<
444        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
445    > {
446        Box::pin(async move { self.id().await })
447    }
448}
449impl IntoID<FieldTypeDefId> for FieldTypeDefId {
450    fn into_id(
451        self,
452    ) -> std::pin::Pin<
453        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
454    > {
455        Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
456    }
457}
458impl FieldTypeDefId {
459    fn quote(&self) -> String {
460        format!("\"{}\"", self.0.clone())
461    }
462}
463#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
464pub struct FileId(pub String);
465impl From<&str> for FileId {
466    fn from(value: &str) -> Self {
467        Self(value.to_string())
468    }
469}
470impl From<String> for FileId {
471    fn from(value: String) -> Self {
472        Self(value)
473    }
474}
475impl IntoID<FileId> for File {
476    fn into_id(
477        self,
478    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
479    {
480        Box::pin(async move { self.id().await })
481    }
482}
483impl IntoID<FileId> for FileId {
484    fn into_id(
485        self,
486    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
487    {
488        Box::pin(async move { Ok::<FileId, DaggerError>(self) })
489    }
490}
491impl FileId {
492    fn quote(&self) -> String {
493        format!("\"{}\"", self.0.clone())
494    }
495}
496#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
497pub struct FunctionArgId(pub String);
498impl From<&str> for FunctionArgId {
499    fn from(value: &str) -> Self {
500        Self(value.to_string())
501    }
502}
503impl From<String> for FunctionArgId {
504    fn from(value: String) -> Self {
505        Self(value)
506    }
507}
508impl IntoID<FunctionArgId> for FunctionArg {
509    fn into_id(
510        self,
511    ) -> std::pin::Pin<
512        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
513    > {
514        Box::pin(async move { self.id().await })
515    }
516}
517impl IntoID<FunctionArgId> for FunctionArgId {
518    fn into_id(
519        self,
520    ) -> std::pin::Pin<
521        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
522    > {
523        Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
524    }
525}
526impl FunctionArgId {
527    fn quote(&self) -> String {
528        format!("\"{}\"", self.0.clone())
529    }
530}
531#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
532pub struct FunctionCallArgValueId(pub String);
533impl From<&str> for FunctionCallArgValueId {
534    fn from(value: &str) -> Self {
535        Self(value.to_string())
536    }
537}
538impl From<String> for FunctionCallArgValueId {
539    fn from(value: String) -> Self {
540        Self(value)
541    }
542}
543impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
544    fn into_id(
545        self,
546    ) -> std::pin::Pin<
547        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
548    > {
549        Box::pin(async move { self.id().await })
550    }
551}
552impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
553    fn into_id(
554        self,
555    ) -> std::pin::Pin<
556        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
557    > {
558        Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
559    }
560}
561impl FunctionCallArgValueId {
562    fn quote(&self) -> String {
563        format!("\"{}\"", self.0.clone())
564    }
565}
566#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
567pub struct FunctionCallId(pub String);
568impl From<&str> for FunctionCallId {
569    fn from(value: &str) -> Self {
570        Self(value.to_string())
571    }
572}
573impl From<String> for FunctionCallId {
574    fn from(value: String) -> Self {
575        Self(value)
576    }
577}
578impl IntoID<FunctionCallId> for FunctionCall {
579    fn into_id(
580        self,
581    ) -> std::pin::Pin<
582        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
583    > {
584        Box::pin(async move { self.id().await })
585    }
586}
587impl IntoID<FunctionCallId> for FunctionCallId {
588    fn into_id(
589        self,
590    ) -> std::pin::Pin<
591        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
592    > {
593        Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
594    }
595}
596impl FunctionCallId {
597    fn quote(&self) -> String {
598        format!("\"{}\"", self.0.clone())
599    }
600}
601#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
602pub struct FunctionId(pub String);
603impl From<&str> for FunctionId {
604    fn from(value: &str) -> Self {
605        Self(value.to_string())
606    }
607}
608impl From<String> for FunctionId {
609    fn from(value: String) -> Self {
610        Self(value)
611    }
612}
613impl IntoID<FunctionId> for Function {
614    fn into_id(
615        self,
616    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
617    {
618        Box::pin(async move { self.id().await })
619    }
620}
621impl IntoID<FunctionId> for FunctionId {
622    fn into_id(
623        self,
624    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
625    {
626        Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
627    }
628}
629impl FunctionId {
630    fn quote(&self) -> String {
631        format!("\"{}\"", self.0.clone())
632    }
633}
634#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
635pub struct GeneratedCodeId(pub String);
636impl From<&str> for GeneratedCodeId {
637    fn from(value: &str) -> Self {
638        Self(value.to_string())
639    }
640}
641impl From<String> for GeneratedCodeId {
642    fn from(value: String) -> Self {
643        Self(value)
644    }
645}
646impl IntoID<GeneratedCodeId> for GeneratedCode {
647    fn into_id(
648        self,
649    ) -> std::pin::Pin<
650        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
651    > {
652        Box::pin(async move { self.id().await })
653    }
654}
655impl IntoID<GeneratedCodeId> for GeneratedCodeId {
656    fn into_id(
657        self,
658    ) -> std::pin::Pin<
659        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
660    > {
661        Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
662    }
663}
664impl GeneratedCodeId {
665    fn quote(&self) -> String {
666        format!("\"{}\"", self.0.clone())
667    }
668}
669#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
670pub struct GitRefId(pub String);
671impl From<&str> for GitRefId {
672    fn from(value: &str) -> Self {
673        Self(value.to_string())
674    }
675}
676impl From<String> for GitRefId {
677    fn from(value: String) -> Self {
678        Self(value)
679    }
680}
681impl IntoID<GitRefId> for GitRef {
682    fn into_id(
683        self,
684    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
685    {
686        Box::pin(async move { self.id().await })
687    }
688}
689impl IntoID<GitRefId> for GitRefId {
690    fn into_id(
691        self,
692    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
693    {
694        Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
695    }
696}
697impl GitRefId {
698    fn quote(&self) -> String {
699        format!("\"{}\"", self.0.clone())
700    }
701}
702#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
703pub struct GitRepositoryId(pub String);
704impl From<&str> for GitRepositoryId {
705    fn from(value: &str) -> Self {
706        Self(value.to_string())
707    }
708}
709impl From<String> for GitRepositoryId {
710    fn from(value: String) -> Self {
711        Self(value)
712    }
713}
714impl IntoID<GitRepositoryId> for GitRepository {
715    fn into_id(
716        self,
717    ) -> std::pin::Pin<
718        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
719    > {
720        Box::pin(async move { self.id().await })
721    }
722}
723impl IntoID<GitRepositoryId> for GitRepositoryId {
724    fn into_id(
725        self,
726    ) -> std::pin::Pin<
727        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
728    > {
729        Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
730    }
731}
732impl GitRepositoryId {
733    fn quote(&self) -> String {
734        format!("\"{}\"", self.0.clone())
735    }
736}
737#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
738pub struct HostId(pub String);
739impl From<&str> for HostId {
740    fn from(value: &str) -> Self {
741        Self(value.to_string())
742    }
743}
744impl From<String> for HostId {
745    fn from(value: String) -> Self {
746        Self(value)
747    }
748}
749impl IntoID<HostId> for Host {
750    fn into_id(
751        self,
752    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
753    {
754        Box::pin(async move { self.id().await })
755    }
756}
757impl IntoID<HostId> for HostId {
758    fn into_id(
759        self,
760    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
761    {
762        Box::pin(async move { Ok::<HostId, DaggerError>(self) })
763    }
764}
765impl HostId {
766    fn quote(&self) -> String {
767        format!("\"{}\"", self.0.clone())
768    }
769}
770#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
771pub struct InputTypeDefId(pub String);
772impl From<&str> for InputTypeDefId {
773    fn from(value: &str) -> Self {
774        Self(value.to_string())
775    }
776}
777impl From<String> for InputTypeDefId {
778    fn from(value: String) -> Self {
779        Self(value)
780    }
781}
782impl IntoID<InputTypeDefId> for InputTypeDef {
783    fn into_id(
784        self,
785    ) -> std::pin::Pin<
786        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
787    > {
788        Box::pin(async move { self.id().await })
789    }
790}
791impl IntoID<InputTypeDefId> for InputTypeDefId {
792    fn into_id(
793        self,
794    ) -> std::pin::Pin<
795        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
796    > {
797        Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
798    }
799}
800impl InputTypeDefId {
801    fn quote(&self) -> String {
802        format!("\"{}\"", self.0.clone())
803    }
804}
805#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
806pub struct InterfaceTypeDefId(pub String);
807impl From<&str> for InterfaceTypeDefId {
808    fn from(value: &str) -> Self {
809        Self(value.to_string())
810    }
811}
812impl From<String> for InterfaceTypeDefId {
813    fn from(value: String) -> Self {
814        Self(value)
815    }
816}
817impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
818    fn into_id(
819        self,
820    ) -> std::pin::Pin<
821        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
822    > {
823        Box::pin(async move { self.id().await })
824    }
825}
826impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
827    fn into_id(
828        self,
829    ) -> std::pin::Pin<
830        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
831    > {
832        Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
833    }
834}
835impl InterfaceTypeDefId {
836    fn quote(&self) -> String {
837        format!("\"{}\"", self.0.clone())
838    }
839}
840#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
841pub struct Json(pub String);
842impl From<&str> for Json {
843    fn from(value: &str) -> Self {
844        Self(value.to_string())
845    }
846}
847impl From<String> for Json {
848    fn from(value: String) -> Self {
849        Self(value)
850    }
851}
852impl Json {
853    fn quote(&self) -> String {
854        format!("\"{}\"", self.0.clone())
855    }
856}
857#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
858pub struct LabelId(pub String);
859impl From<&str> for LabelId {
860    fn from(value: &str) -> Self {
861        Self(value.to_string())
862    }
863}
864impl From<String> for LabelId {
865    fn from(value: String) -> Self {
866        Self(value)
867    }
868}
869impl IntoID<LabelId> for Label {
870    fn into_id(
871        self,
872    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
873    {
874        Box::pin(async move { self.id().await })
875    }
876}
877impl IntoID<LabelId> for LabelId {
878    fn into_id(
879        self,
880    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
881    {
882        Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
883    }
884}
885impl LabelId {
886    fn quote(&self) -> String {
887        format!("\"{}\"", self.0.clone())
888    }
889}
890#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
891pub struct ListTypeDefId(pub String);
892impl From<&str> for ListTypeDefId {
893    fn from(value: &str) -> Self {
894        Self(value.to_string())
895    }
896}
897impl From<String> for ListTypeDefId {
898    fn from(value: String) -> Self {
899        Self(value)
900    }
901}
902impl IntoID<ListTypeDefId> for ListTypeDef {
903    fn into_id(
904        self,
905    ) -> std::pin::Pin<
906        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
907    > {
908        Box::pin(async move { self.id().await })
909    }
910}
911impl IntoID<ListTypeDefId> for ListTypeDefId {
912    fn into_id(
913        self,
914    ) -> std::pin::Pin<
915        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
916    > {
917        Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
918    }
919}
920impl ListTypeDefId {
921    fn quote(&self) -> String {
922        format!("\"{}\"", self.0.clone())
923    }
924}
925#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
926pub struct ModuleConfigClientId(pub String);
927impl From<&str> for ModuleConfigClientId {
928    fn from(value: &str) -> Self {
929        Self(value.to_string())
930    }
931}
932impl From<String> for ModuleConfigClientId {
933    fn from(value: String) -> Self {
934        Self(value)
935    }
936}
937impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
938    fn into_id(
939        self,
940    ) -> std::pin::Pin<
941        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
942    > {
943        Box::pin(async move { self.id().await })
944    }
945}
946impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
947    fn into_id(
948        self,
949    ) -> std::pin::Pin<
950        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
951    > {
952        Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
953    }
954}
955impl ModuleConfigClientId {
956    fn quote(&self) -> String {
957        format!("\"{}\"", self.0.clone())
958    }
959}
960#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
961pub struct ModuleId(pub String);
962impl From<&str> for ModuleId {
963    fn from(value: &str) -> Self {
964        Self(value.to_string())
965    }
966}
967impl From<String> for ModuleId {
968    fn from(value: String) -> Self {
969        Self(value)
970    }
971}
972impl IntoID<ModuleId> for Module {
973    fn into_id(
974        self,
975    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
976    {
977        Box::pin(async move { self.id().await })
978    }
979}
980impl IntoID<ModuleId> for ModuleId {
981    fn into_id(
982        self,
983    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
984    {
985        Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
986    }
987}
988impl ModuleId {
989    fn quote(&self) -> String {
990        format!("\"{}\"", self.0.clone())
991    }
992}
993#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
994pub struct ModuleSourceId(pub String);
995impl From<&str> for ModuleSourceId {
996    fn from(value: &str) -> Self {
997        Self(value.to_string())
998    }
999}
1000impl From<String> for ModuleSourceId {
1001    fn from(value: String) -> Self {
1002        Self(value)
1003    }
1004}
1005impl IntoID<ModuleSourceId> for ModuleSource {
1006    fn into_id(
1007        self,
1008    ) -> std::pin::Pin<
1009        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1010    > {
1011        Box::pin(async move { self.id().await })
1012    }
1013}
1014impl IntoID<ModuleSourceId> for ModuleSourceId {
1015    fn into_id(
1016        self,
1017    ) -> std::pin::Pin<
1018        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1019    > {
1020        Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1021    }
1022}
1023impl ModuleSourceId {
1024    fn quote(&self) -> String {
1025        format!("\"{}\"", self.0.clone())
1026    }
1027}
1028#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1029pub struct ObjectTypeDefId(pub String);
1030impl From<&str> for ObjectTypeDefId {
1031    fn from(value: &str) -> Self {
1032        Self(value.to_string())
1033    }
1034}
1035impl From<String> for ObjectTypeDefId {
1036    fn from(value: String) -> Self {
1037        Self(value)
1038    }
1039}
1040impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1041    fn into_id(
1042        self,
1043    ) -> std::pin::Pin<
1044        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1045    > {
1046        Box::pin(async move { self.id().await })
1047    }
1048}
1049impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1050    fn into_id(
1051        self,
1052    ) -> std::pin::Pin<
1053        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1054    > {
1055        Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1056    }
1057}
1058impl ObjectTypeDefId {
1059    fn quote(&self) -> String {
1060        format!("\"{}\"", self.0.clone())
1061    }
1062}
1063#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1064pub struct Platform(pub String);
1065impl From<&str> for Platform {
1066    fn from(value: &str) -> Self {
1067        Self(value.to_string())
1068    }
1069}
1070impl From<String> for Platform {
1071    fn from(value: String) -> Self {
1072        Self(value)
1073    }
1074}
1075impl Platform {
1076    fn quote(&self) -> String {
1077        format!("\"{}\"", self.0.clone())
1078    }
1079}
1080#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1081pub struct PortId(pub String);
1082impl From<&str> for PortId {
1083    fn from(value: &str) -> Self {
1084        Self(value.to_string())
1085    }
1086}
1087impl From<String> for PortId {
1088    fn from(value: String) -> Self {
1089        Self(value)
1090    }
1091}
1092impl IntoID<PortId> for Port {
1093    fn into_id(
1094        self,
1095    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1096    {
1097        Box::pin(async move { self.id().await })
1098    }
1099}
1100impl IntoID<PortId> for PortId {
1101    fn into_id(
1102        self,
1103    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1104    {
1105        Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1106    }
1107}
1108impl PortId {
1109    fn quote(&self) -> String {
1110        format!("\"{}\"", self.0.clone())
1111    }
1112}
1113#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1114pub struct SdkConfigId(pub String);
1115impl From<&str> for SdkConfigId {
1116    fn from(value: &str) -> Self {
1117        Self(value.to_string())
1118    }
1119}
1120impl From<String> for SdkConfigId {
1121    fn from(value: String) -> Self {
1122        Self(value)
1123    }
1124}
1125impl IntoID<SdkConfigId> for SdkConfig {
1126    fn into_id(
1127        self,
1128    ) -> std::pin::Pin<
1129        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1130    > {
1131        Box::pin(async move { self.id().await })
1132    }
1133}
1134impl IntoID<SdkConfigId> for SdkConfigId {
1135    fn into_id(
1136        self,
1137    ) -> std::pin::Pin<
1138        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1139    > {
1140        Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1141    }
1142}
1143impl SdkConfigId {
1144    fn quote(&self) -> String {
1145        format!("\"{}\"", self.0.clone())
1146    }
1147}
1148#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1149pub struct ScalarTypeDefId(pub String);
1150impl From<&str> for ScalarTypeDefId {
1151    fn from(value: &str) -> Self {
1152        Self(value.to_string())
1153    }
1154}
1155impl From<String> for ScalarTypeDefId {
1156    fn from(value: String) -> Self {
1157        Self(value)
1158    }
1159}
1160impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1161    fn into_id(
1162        self,
1163    ) -> std::pin::Pin<
1164        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1165    > {
1166        Box::pin(async move { self.id().await })
1167    }
1168}
1169impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1170    fn into_id(
1171        self,
1172    ) -> std::pin::Pin<
1173        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1174    > {
1175        Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1176    }
1177}
1178impl ScalarTypeDefId {
1179    fn quote(&self) -> String {
1180        format!("\"{}\"", self.0.clone())
1181    }
1182}
1183#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1184pub struct SecretId(pub String);
1185impl From<&str> for SecretId {
1186    fn from(value: &str) -> Self {
1187        Self(value.to_string())
1188    }
1189}
1190impl From<String> for SecretId {
1191    fn from(value: String) -> Self {
1192        Self(value)
1193    }
1194}
1195impl IntoID<SecretId> for Secret {
1196    fn into_id(
1197        self,
1198    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1199    {
1200        Box::pin(async move { self.id().await })
1201    }
1202}
1203impl IntoID<SecretId> for SecretId {
1204    fn into_id(
1205        self,
1206    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1207    {
1208        Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1209    }
1210}
1211impl SecretId {
1212    fn quote(&self) -> String {
1213        format!("\"{}\"", self.0.clone())
1214    }
1215}
1216#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1217pub struct ServiceId(pub String);
1218impl From<&str> for ServiceId {
1219    fn from(value: &str) -> Self {
1220        Self(value.to_string())
1221    }
1222}
1223impl From<String> for ServiceId {
1224    fn from(value: String) -> Self {
1225        Self(value)
1226    }
1227}
1228impl IntoID<ServiceId> for Service {
1229    fn into_id(
1230        self,
1231    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1232    {
1233        Box::pin(async move { self.id().await })
1234    }
1235}
1236impl IntoID<ServiceId> for ServiceId {
1237    fn into_id(
1238        self,
1239    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1240    {
1241        Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1242    }
1243}
1244impl ServiceId {
1245    fn quote(&self) -> String {
1246        format!("\"{}\"", self.0.clone())
1247    }
1248}
1249#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1250pub struct SocketId(pub String);
1251impl From<&str> for SocketId {
1252    fn from(value: &str) -> Self {
1253        Self(value.to_string())
1254    }
1255}
1256impl From<String> for SocketId {
1257    fn from(value: String) -> Self {
1258        Self(value)
1259    }
1260}
1261impl IntoID<SocketId> for Socket {
1262    fn into_id(
1263        self,
1264    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1265    {
1266        Box::pin(async move { self.id().await })
1267    }
1268}
1269impl IntoID<SocketId> for SocketId {
1270    fn into_id(
1271        self,
1272    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1273    {
1274        Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1275    }
1276}
1277impl SocketId {
1278    fn quote(&self) -> String {
1279        format!("\"{}\"", self.0.clone())
1280    }
1281}
1282#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1283pub struct SourceMapId(pub String);
1284impl From<&str> for SourceMapId {
1285    fn from(value: &str) -> Self {
1286        Self(value.to_string())
1287    }
1288}
1289impl From<String> for SourceMapId {
1290    fn from(value: String) -> Self {
1291        Self(value)
1292    }
1293}
1294impl IntoID<SourceMapId> for SourceMap {
1295    fn into_id(
1296        self,
1297    ) -> std::pin::Pin<
1298        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1299    > {
1300        Box::pin(async move { self.id().await })
1301    }
1302}
1303impl IntoID<SourceMapId> for SourceMapId {
1304    fn into_id(
1305        self,
1306    ) -> std::pin::Pin<
1307        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1308    > {
1309        Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1310    }
1311}
1312impl SourceMapId {
1313    fn quote(&self) -> String {
1314        format!("\"{}\"", self.0.clone())
1315    }
1316}
1317#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1318pub struct TerminalId(pub String);
1319impl From<&str> for TerminalId {
1320    fn from(value: &str) -> Self {
1321        Self(value.to_string())
1322    }
1323}
1324impl From<String> for TerminalId {
1325    fn from(value: String) -> Self {
1326        Self(value)
1327    }
1328}
1329impl IntoID<TerminalId> for Terminal {
1330    fn into_id(
1331        self,
1332    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1333    {
1334        Box::pin(async move { self.id().await })
1335    }
1336}
1337impl IntoID<TerminalId> for TerminalId {
1338    fn into_id(
1339        self,
1340    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1341    {
1342        Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
1343    }
1344}
1345impl TerminalId {
1346    fn quote(&self) -> String {
1347        format!("\"{}\"", self.0.clone())
1348    }
1349}
1350#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1351pub struct TypeDefId(pub String);
1352impl From<&str> for TypeDefId {
1353    fn from(value: &str) -> Self {
1354        Self(value.to_string())
1355    }
1356}
1357impl From<String> for TypeDefId {
1358    fn from(value: String) -> Self {
1359        Self(value)
1360    }
1361}
1362impl IntoID<TypeDefId> for TypeDef {
1363    fn into_id(
1364        self,
1365    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1366    {
1367        Box::pin(async move { self.id().await })
1368    }
1369}
1370impl IntoID<TypeDefId> for TypeDefId {
1371    fn into_id(
1372        self,
1373    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1374    {
1375        Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
1376    }
1377}
1378impl TypeDefId {
1379    fn quote(&self) -> String {
1380        format!("\"{}\"", self.0.clone())
1381    }
1382}
1383#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1384pub struct Void(pub String);
1385impl From<&str> for Void {
1386    fn from(value: &str) -> Self {
1387        Self(value.to_string())
1388    }
1389}
1390impl From<String> for Void {
1391    fn from(value: String) -> Self {
1392        Self(value)
1393    }
1394}
1395impl Void {
1396    fn quote(&self) -> String {
1397        format!("\"{}\"", self.0.clone())
1398    }
1399}
1400#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1401pub struct BuildArg {
1402    pub name: String,
1403    pub value: String,
1404}
1405#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1406pub struct PipelineLabel {
1407    pub name: String,
1408    pub value: String,
1409}
1410#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1411pub struct PortForward {
1412    pub backend: isize,
1413    pub frontend: isize,
1414    pub protocol: NetworkProtocol,
1415}
1416#[derive(Clone)]
1417pub struct CacheVolume {
1418    pub proc: Option<Arc<DaggerSessionProc>>,
1419    pub selection: Selection,
1420    pub graphql_client: DynGraphQLClient,
1421}
1422impl CacheVolume {
1423    /// A unique identifier for this CacheVolume.
1424    pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
1425        let query = self.selection.select("id");
1426        query.execute(self.graphql_client.clone()).await
1427    }
1428}
1429#[derive(Clone)]
1430pub struct Container {
1431    pub proc: Option<Arc<DaggerSessionProc>>,
1432    pub selection: Selection,
1433    pub graphql_client: DynGraphQLClient,
1434}
1435#[derive(Builder, Debug, PartialEq)]
1436pub struct ContainerAsServiceOpts<'a> {
1437    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1438    /// If empty, the container's default command is used.
1439    #[builder(setter(into, strip_option), default)]
1440    pub args: Option<Vec<&'a str>>,
1441    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1442    #[builder(setter(into, strip_option), default)]
1443    pub expand: Option<bool>,
1444    /// Provides Dagger access to the executed command.
1445    /// Do not use this option unless you trust the command being executed; the command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
1446    #[builder(setter(into, strip_option), default)]
1447    pub experimental_privileged_nesting: Option<bool>,
1448    /// 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.
1449    #[builder(setter(into, strip_option), default)]
1450    pub insecure_root_capabilities: Option<bool>,
1451    /// If set, skip the automatic init process injected into containers by default.
1452    /// 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.
1453    #[builder(setter(into, strip_option), default)]
1454    pub no_init: Option<bool>,
1455    /// If the container has an entrypoint, prepend it to the args.
1456    #[builder(setter(into, strip_option), default)]
1457    pub use_entrypoint: Option<bool>,
1458}
1459#[derive(Builder, Debug, PartialEq)]
1460pub struct ContainerAsTarballOpts {
1461    /// Force each layer of the image to use the specified compression algorithm.
1462    /// 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.
1463    #[builder(setter(into, strip_option), default)]
1464    pub forced_compression: Option<ImageLayerCompression>,
1465    /// Use the specified media types for the image's layers.
1466    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1467    #[builder(setter(into, strip_option), default)]
1468    pub media_types: Option<ImageMediaTypes>,
1469    /// Identifiers for other platform specific containers.
1470    /// Used for multi-platform images.
1471    #[builder(setter(into, strip_option), default)]
1472    pub platform_variants: Option<Vec<ContainerId>>,
1473}
1474#[derive(Builder, Debug, PartialEq)]
1475pub struct ContainerBuildOpts<'a> {
1476    /// Additional build arguments.
1477    #[builder(setter(into, strip_option), default)]
1478    pub build_args: Option<Vec<BuildArg>>,
1479    /// Path to the Dockerfile to use.
1480    #[builder(setter(into, strip_option), default)]
1481    pub dockerfile: Option<&'a str>,
1482    /// Secrets to pass to the build.
1483    /// They will be mounted at /run/secrets/[secret-name] in the build container
1484    /// They can be accessed in the Dockerfile using the "secret" mount type and mount path /run/secrets/[secret-name], e.g. RUN --mount=type=secret,id=my-secret curl [http://example.com?token=$(cat /run/secrets/my-secret)](http://example.com?token=$(cat /run/secrets/my-secret))
1485    #[builder(setter(into, strip_option), default)]
1486    pub secrets: Option<Vec<SecretId>>,
1487    /// Target build stage to build.
1488    #[builder(setter(into, strip_option), default)]
1489    pub target: Option<&'a str>,
1490}
1491#[derive(Builder, Debug, PartialEq)]
1492pub struct ContainerDirectoryOpts {
1493    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1494    #[builder(setter(into, strip_option), default)]
1495    pub expand: Option<bool>,
1496}
1497#[derive(Builder, Debug, PartialEq)]
1498pub struct ContainerExportOpts {
1499    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1500    #[builder(setter(into, strip_option), default)]
1501    pub expand: Option<bool>,
1502    /// Force each layer of the exported image to use the specified compression algorithm.
1503    /// 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.
1504    #[builder(setter(into, strip_option), default)]
1505    pub forced_compression: Option<ImageLayerCompression>,
1506    /// Use the specified media types for the exported image's layers.
1507    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1508    #[builder(setter(into, strip_option), default)]
1509    pub media_types: Option<ImageMediaTypes>,
1510    /// Identifiers for other platform specific containers.
1511    /// Used for multi-platform image.
1512    #[builder(setter(into, strip_option), default)]
1513    pub platform_variants: Option<Vec<ContainerId>>,
1514}
1515#[derive(Builder, Debug, PartialEq)]
1516pub struct ContainerFileOpts {
1517    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1518    #[builder(setter(into, strip_option), default)]
1519    pub expand: Option<bool>,
1520}
1521#[derive(Builder, Debug, PartialEq)]
1522pub struct ContainerImportOpts<'a> {
1523    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
1524    #[builder(setter(into, strip_option), default)]
1525    pub tag: Option<&'a str>,
1526}
1527#[derive(Builder, Debug, PartialEq)]
1528pub struct ContainerPublishOpts {
1529    /// Force each layer of the published image to use the specified compression algorithm.
1530    /// 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.
1531    #[builder(setter(into, strip_option), default)]
1532    pub forced_compression: Option<ImageLayerCompression>,
1533    /// Use the specified media types for the published image's layers.
1534    /// Defaults to OCI, which is largely compatible with most recent registries, but Docker may be needed for older registries without OCI support.
1535    #[builder(setter(into, strip_option), default)]
1536    pub media_types: Option<ImageMediaTypes>,
1537    /// Identifiers for other platform specific containers.
1538    /// Used for multi-platform image.
1539    #[builder(setter(into, strip_option), default)]
1540    pub platform_variants: Option<Vec<ContainerId>>,
1541}
1542#[derive(Builder, Debug, PartialEq)]
1543pub struct ContainerTerminalOpts<'a> {
1544    /// If set, override the container's default terminal command and invoke these command arguments instead.
1545    #[builder(setter(into, strip_option), default)]
1546    pub cmd: Option<Vec<&'a str>>,
1547    /// Provides Dagger access to the executed command.
1548    /// Do not use this option unless you trust the command being executed; the command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
1549    #[builder(setter(into, strip_option), default)]
1550    pub experimental_privileged_nesting: Option<bool>,
1551    /// 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.
1552    #[builder(setter(into, strip_option), default)]
1553    pub insecure_root_capabilities: Option<bool>,
1554}
1555#[derive(Builder, Debug, PartialEq)]
1556pub struct ContainerUpOpts<'a> {
1557    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1558    /// If empty, the container's default command is used.
1559    #[builder(setter(into, strip_option), default)]
1560    pub args: Option<Vec<&'a str>>,
1561    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1562    #[builder(setter(into, strip_option), default)]
1563    pub expand: Option<bool>,
1564    /// Provides Dagger access to the executed command.
1565    /// Do not use this option unless you trust the command being executed; the command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
1566    #[builder(setter(into, strip_option), default)]
1567    pub experimental_privileged_nesting: Option<bool>,
1568    /// 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.
1569    #[builder(setter(into, strip_option), default)]
1570    pub insecure_root_capabilities: Option<bool>,
1571    /// If set, skip the automatic init process injected into containers by default.
1572    /// 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.
1573    #[builder(setter(into, strip_option), default)]
1574    pub no_init: Option<bool>,
1575    /// List of frontend/backend port mappings to forward.
1576    /// Frontend is the port accepting traffic on the host, backend is the service port.
1577    #[builder(setter(into, strip_option), default)]
1578    pub ports: Option<Vec<PortForward>>,
1579    /// Bind each tunnel port to a random port on the host.
1580    #[builder(setter(into, strip_option), default)]
1581    pub random: Option<bool>,
1582    /// If the container has an entrypoint, prepend it to the args.
1583    #[builder(setter(into, strip_option), default)]
1584    pub use_entrypoint: Option<bool>,
1585}
1586#[derive(Builder, Debug, PartialEq)]
1587pub struct ContainerWithDefaultTerminalCmdOpts {
1588    /// Provides Dagger access to the executed command.
1589    /// Do not use this option unless you trust the command being executed; the command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
1590    #[builder(setter(into, strip_option), default)]
1591    pub experimental_privileged_nesting: Option<bool>,
1592    /// 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.
1593    #[builder(setter(into, strip_option), default)]
1594    pub insecure_root_capabilities: Option<bool>,
1595}
1596#[derive(Builder, Debug, PartialEq)]
1597pub struct ContainerWithDirectoryOpts<'a> {
1598    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
1599    #[builder(setter(into, strip_option), default)]
1600    pub exclude: Option<Vec<&'a str>>,
1601    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1602    #[builder(setter(into, strip_option), default)]
1603    pub expand: Option<bool>,
1604    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
1605    #[builder(setter(into, strip_option), default)]
1606    pub include: Option<Vec<&'a str>>,
1607    /// A user:group to set for the directory and its contents.
1608    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1609    /// If the group is omitted, it defaults to the same as the user.
1610    #[builder(setter(into, strip_option), default)]
1611    pub owner: Option<&'a str>,
1612}
1613#[derive(Builder, Debug, PartialEq)]
1614pub struct ContainerWithEntrypointOpts {
1615    /// Don't remove the default arguments when setting the entrypoint.
1616    #[builder(setter(into, strip_option), default)]
1617    pub keep_default_args: Option<bool>,
1618}
1619#[derive(Builder, Debug, PartialEq)]
1620pub struct ContainerWithEnvVariableOpts {
1621    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
1622    #[builder(setter(into, strip_option), default)]
1623    pub expand: Option<bool>,
1624}
1625#[derive(Builder, Debug, PartialEq)]
1626pub struct ContainerWithExecOpts<'a> {
1627    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1628    #[builder(setter(into, strip_option), default)]
1629    pub expand: Option<bool>,
1630    /// Exit codes this command is allowed to exit with without error
1631    #[builder(setter(into, strip_option), default)]
1632    pub expect: Option<ReturnType>,
1633    /// Provides Dagger access to the executed command.
1634    /// Do not use this option unless you trust the command being executed; the command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
1635    #[builder(setter(into, strip_option), default)]
1636    pub experimental_privileged_nesting: Option<bool>,
1637    /// 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.
1638    #[builder(setter(into, strip_option), default)]
1639    pub insecure_root_capabilities: Option<bool>,
1640    /// If set, skip the automatic init process injected into containers by default.
1641    /// 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.
1642    #[builder(setter(into, strip_option), default)]
1643    pub no_init: Option<bool>,
1644    /// Redirect the command's standard error to a file in the container (e.g., "/tmp/stderr").
1645    #[builder(setter(into, strip_option), default)]
1646    pub redirect_stderr: Option<&'a str>,
1647    /// Redirect the command's standard output to a file in the container (e.g., "/tmp/stdout").
1648    #[builder(setter(into, strip_option), default)]
1649    pub redirect_stdout: Option<&'a str>,
1650    /// Content to write to the command's standard input before closing (e.g., "Hello world").
1651    #[builder(setter(into, strip_option), default)]
1652    pub stdin: Option<&'a str>,
1653    /// If the container has an entrypoint, prepend it to the args.
1654    #[builder(setter(into, strip_option), default)]
1655    pub use_entrypoint: Option<bool>,
1656}
1657#[derive(Builder, Debug, PartialEq)]
1658pub struct ContainerWithExposedPortOpts<'a> {
1659    /// Optional port description
1660    #[builder(setter(into, strip_option), default)]
1661    pub description: Option<&'a str>,
1662    /// Skip the health check when run as a service.
1663    #[builder(setter(into, strip_option), default)]
1664    pub experimental_skip_healthcheck: Option<bool>,
1665    /// Transport layer network protocol
1666    #[builder(setter(into, strip_option), default)]
1667    pub protocol: Option<NetworkProtocol>,
1668}
1669#[derive(Builder, Debug, PartialEq)]
1670pub struct ContainerWithFileOpts<'a> {
1671    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1672    #[builder(setter(into, strip_option), default)]
1673    pub expand: Option<bool>,
1674    /// A user:group to set for the file.
1675    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1676    /// If the group is omitted, it defaults to the same as the user.
1677    #[builder(setter(into, strip_option), default)]
1678    pub owner: Option<&'a str>,
1679    /// Permission given to the copied file (e.g., 0600).
1680    #[builder(setter(into, strip_option), default)]
1681    pub permissions: Option<isize>,
1682}
1683#[derive(Builder, Debug, PartialEq)]
1684pub struct ContainerWithFilesOpts<'a> {
1685    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1686    #[builder(setter(into, strip_option), default)]
1687    pub expand: Option<bool>,
1688    /// A user:group to set for the files.
1689    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1690    /// If the group is omitted, it defaults to the same as the user.
1691    #[builder(setter(into, strip_option), default)]
1692    pub owner: Option<&'a str>,
1693    /// Permission given to the copied files (e.g., 0600).
1694    #[builder(setter(into, strip_option), default)]
1695    pub permissions: Option<isize>,
1696}
1697#[derive(Builder, Debug, PartialEq)]
1698pub struct ContainerWithMountedCacheOpts<'a> {
1699    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1700    #[builder(setter(into, strip_option), default)]
1701    pub expand: Option<bool>,
1702    /// A user:group to set for the mounted cache directory.
1703    /// 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.
1704    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1705    /// If the group is omitted, it defaults to the same as the user.
1706    #[builder(setter(into, strip_option), default)]
1707    pub owner: Option<&'a str>,
1708    /// Sharing mode of the cache volume.
1709    #[builder(setter(into, strip_option), default)]
1710    pub sharing: Option<CacheSharingMode>,
1711    /// Identifier of the directory to use as the cache volume's root.
1712    #[builder(setter(into, strip_option), default)]
1713    pub source: Option<DirectoryId>,
1714}
1715#[derive(Builder, Debug, PartialEq)]
1716pub struct ContainerWithMountedDirectoryOpts<'a> {
1717    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1718    #[builder(setter(into, strip_option), default)]
1719    pub expand: Option<bool>,
1720    /// A user:group to set for the mounted directory and its contents.
1721    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1722    /// If the group is omitted, it defaults to the same as the user.
1723    #[builder(setter(into, strip_option), default)]
1724    pub owner: Option<&'a str>,
1725}
1726#[derive(Builder, Debug, PartialEq)]
1727pub struct ContainerWithMountedFileOpts<'a> {
1728    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1729    #[builder(setter(into, strip_option), default)]
1730    pub expand: Option<bool>,
1731    /// A user or user:group to set for the mounted file.
1732    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1733    /// If the group is omitted, it defaults to the same as the user.
1734    #[builder(setter(into, strip_option), default)]
1735    pub owner: Option<&'a str>,
1736}
1737#[derive(Builder, Debug, PartialEq)]
1738pub struct ContainerWithMountedSecretOpts<'a> {
1739    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1740    #[builder(setter(into, strip_option), default)]
1741    pub expand: Option<bool>,
1742    /// Permission given to the mounted secret (e.g., 0600).
1743    /// This option requires an owner to be set to be active.
1744    #[builder(setter(into, strip_option), default)]
1745    pub mode: Option<isize>,
1746    /// A user:group to set for the mounted secret.
1747    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1748    /// If the group is omitted, it defaults to the same as the user.
1749    #[builder(setter(into, strip_option), default)]
1750    pub owner: Option<&'a str>,
1751}
1752#[derive(Builder, Debug, PartialEq)]
1753pub struct ContainerWithMountedTempOpts {
1754    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1755    #[builder(setter(into, strip_option), default)]
1756    pub expand: Option<bool>,
1757    /// Size of the temporary directory in bytes.
1758    #[builder(setter(into, strip_option), default)]
1759    pub size: Option<isize>,
1760}
1761#[derive(Builder, Debug, PartialEq)]
1762pub struct ContainerWithNewFileOpts<'a> {
1763    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1764    #[builder(setter(into, strip_option), default)]
1765    pub expand: Option<bool>,
1766    /// A user:group to set for the file.
1767    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1768    /// If the group is omitted, it defaults to the same as the user.
1769    #[builder(setter(into, strip_option), default)]
1770    pub owner: Option<&'a str>,
1771    /// Permission given to the written file (e.g., 0600).
1772    #[builder(setter(into, strip_option), default)]
1773    pub permissions: Option<isize>,
1774}
1775#[derive(Builder, Debug, PartialEq)]
1776pub struct ContainerWithUnixSocketOpts<'a> {
1777    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1778    #[builder(setter(into, strip_option), default)]
1779    pub expand: Option<bool>,
1780    /// A user:group to set for the mounted socket.
1781    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1782    /// If the group is omitted, it defaults to the same as the user.
1783    #[builder(setter(into, strip_option), default)]
1784    pub owner: Option<&'a str>,
1785}
1786#[derive(Builder, Debug, PartialEq)]
1787pub struct ContainerWithWorkdirOpts {
1788    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1789    #[builder(setter(into, strip_option), default)]
1790    pub expand: Option<bool>,
1791}
1792#[derive(Builder, Debug, PartialEq)]
1793pub struct ContainerWithoutDirectoryOpts {
1794    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1795    #[builder(setter(into, strip_option), default)]
1796    pub expand: Option<bool>,
1797}
1798#[derive(Builder, Debug, PartialEq)]
1799pub struct ContainerWithoutEntrypointOpts {
1800    /// Don't remove the default arguments when unsetting the entrypoint.
1801    #[builder(setter(into, strip_option), default)]
1802    pub keep_default_args: Option<bool>,
1803}
1804#[derive(Builder, Debug, PartialEq)]
1805pub struct ContainerWithoutExposedPortOpts {
1806    /// Port protocol to unexpose
1807    #[builder(setter(into, strip_option), default)]
1808    pub protocol: Option<NetworkProtocol>,
1809}
1810#[derive(Builder, Debug, PartialEq)]
1811pub struct ContainerWithoutFileOpts {
1812    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1813    #[builder(setter(into, strip_option), default)]
1814    pub expand: Option<bool>,
1815}
1816#[derive(Builder, Debug, PartialEq)]
1817pub struct ContainerWithoutFilesOpts {
1818    /// Replace "${VAR}" or "$VAR" in the value of paths 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}
1822#[derive(Builder, Debug, PartialEq)]
1823pub struct ContainerWithoutMountOpts {
1824    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1825    #[builder(setter(into, strip_option), default)]
1826    pub expand: Option<bool>,
1827}
1828#[derive(Builder, Debug, PartialEq)]
1829pub struct ContainerWithoutUnixSocketOpts {
1830    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1831    #[builder(setter(into, strip_option), default)]
1832    pub expand: Option<bool>,
1833}
1834impl Container {
1835    /// Turn the container into a Service.
1836    /// Be sure to set any exposed ports before this conversion.
1837    ///
1838    /// # Arguments
1839    ///
1840    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1841    pub fn as_service(&self) -> Service {
1842        let query = self.selection.select("asService");
1843        Service {
1844            proc: self.proc.clone(),
1845            selection: query,
1846            graphql_client: self.graphql_client.clone(),
1847        }
1848    }
1849    /// Turn the container into a Service.
1850    /// Be sure to set any exposed ports before this conversion.
1851    ///
1852    /// # Arguments
1853    ///
1854    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1855    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
1856        let mut query = self.selection.select("asService");
1857        if let Some(args) = opts.args {
1858            query = query.arg("args", args);
1859        }
1860        if let Some(use_entrypoint) = opts.use_entrypoint {
1861            query = query.arg("useEntrypoint", use_entrypoint);
1862        }
1863        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
1864            query = query.arg(
1865                "experimentalPrivilegedNesting",
1866                experimental_privileged_nesting,
1867            );
1868        }
1869        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
1870            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
1871        }
1872        if let Some(expand) = opts.expand {
1873            query = query.arg("expand", expand);
1874        }
1875        if let Some(no_init) = opts.no_init {
1876            query = query.arg("noInit", no_init);
1877        }
1878        Service {
1879            proc: self.proc.clone(),
1880            selection: query,
1881            graphql_client: self.graphql_client.clone(),
1882        }
1883    }
1884    /// Returns a File representing the container serialized to a tarball.
1885    ///
1886    /// # Arguments
1887    ///
1888    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1889    pub fn as_tarball(&self) -> File {
1890        let query = self.selection.select("asTarball");
1891        File {
1892            proc: self.proc.clone(),
1893            selection: query,
1894            graphql_client: self.graphql_client.clone(),
1895        }
1896    }
1897    /// Returns a File representing the container serialized to a tarball.
1898    ///
1899    /// # Arguments
1900    ///
1901    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1902    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
1903        let mut query = self.selection.select("asTarball");
1904        if let Some(platform_variants) = opts.platform_variants {
1905            query = query.arg("platformVariants", platform_variants);
1906        }
1907        if let Some(forced_compression) = opts.forced_compression {
1908            query = query.arg("forcedCompression", forced_compression);
1909        }
1910        if let Some(media_types) = opts.media_types {
1911            query = query.arg("mediaTypes", media_types);
1912        }
1913        File {
1914            proc: self.proc.clone(),
1915            selection: query,
1916            graphql_client: self.graphql_client.clone(),
1917        }
1918    }
1919    /// Initializes this container from a Dockerfile build.
1920    ///
1921    /// # Arguments
1922    ///
1923    /// * `context` - Directory context used by the Dockerfile.
1924    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1925    pub fn build(&self, context: impl IntoID<DirectoryId>) -> Container {
1926        let mut query = self.selection.select("build");
1927        query = query.arg_lazy(
1928            "context",
1929            Box::new(move || {
1930                let context = context.clone();
1931                Box::pin(async move { context.into_id().await.unwrap().quote() })
1932            }),
1933        );
1934        Container {
1935            proc: self.proc.clone(),
1936            selection: query,
1937            graphql_client: self.graphql_client.clone(),
1938        }
1939    }
1940    /// Initializes this container from a Dockerfile build.
1941    ///
1942    /// # Arguments
1943    ///
1944    /// * `context` - Directory context used by the Dockerfile.
1945    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1946    pub fn build_opts<'a>(
1947        &self,
1948        context: impl IntoID<DirectoryId>,
1949        opts: ContainerBuildOpts<'a>,
1950    ) -> Container {
1951        let mut query = self.selection.select("build");
1952        query = query.arg_lazy(
1953            "context",
1954            Box::new(move || {
1955                let context = context.clone();
1956                Box::pin(async move { context.into_id().await.unwrap().quote() })
1957            }),
1958        );
1959        if let Some(dockerfile) = opts.dockerfile {
1960            query = query.arg("dockerfile", dockerfile);
1961        }
1962        if let Some(target) = opts.target {
1963            query = query.arg("target", target);
1964        }
1965        if let Some(build_args) = opts.build_args {
1966            query = query.arg("buildArgs", build_args);
1967        }
1968        if let Some(secrets) = opts.secrets {
1969            query = query.arg("secrets", secrets);
1970        }
1971        Container {
1972            proc: self.proc.clone(),
1973            selection: query,
1974            graphql_client: self.graphql_client.clone(),
1975        }
1976    }
1977    /// Retrieves default arguments for future commands.
1978    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
1979        let query = self.selection.select("defaultArgs");
1980        query.execute(self.graphql_client.clone()).await
1981    }
1982    /// Retrieves a directory at the given path.
1983    /// Mounts are included.
1984    ///
1985    /// # Arguments
1986    ///
1987    /// * `path` - The path of the directory to retrieve (e.g., "./src").
1988    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1989    pub fn directory(&self, path: impl Into<String>) -> Directory {
1990        let mut query = self.selection.select("directory");
1991        query = query.arg("path", path.into());
1992        Directory {
1993            proc: self.proc.clone(),
1994            selection: query,
1995            graphql_client: self.graphql_client.clone(),
1996        }
1997    }
1998    /// Retrieves a directory at the given path.
1999    /// Mounts are included.
2000    ///
2001    /// # Arguments
2002    ///
2003    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2004    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2005    pub fn directory_opts(
2006        &self,
2007        path: impl Into<String>,
2008        opts: ContainerDirectoryOpts,
2009    ) -> Directory {
2010        let mut query = self.selection.select("directory");
2011        query = query.arg("path", path.into());
2012        if let Some(expand) = opts.expand {
2013            query = query.arg("expand", expand);
2014        }
2015        Directory {
2016            proc: self.proc.clone(),
2017            selection: query,
2018            graphql_client: self.graphql_client.clone(),
2019        }
2020    }
2021    /// Retrieves entrypoint to be prepended to the arguments of all commands.
2022    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2023        let query = self.selection.select("entrypoint");
2024        query.execute(self.graphql_client.clone()).await
2025    }
2026    /// Retrieves the value of the specified environment variable.
2027    ///
2028    /// # Arguments
2029    ///
2030    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
2031    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2032        let mut query = self.selection.select("envVariable");
2033        query = query.arg("name", name.into());
2034        query.execute(self.graphql_client.clone()).await
2035    }
2036    /// Retrieves the list of environment variables passed to commands.
2037    pub fn env_variables(&self) -> Vec<EnvVariable> {
2038        let query = self.selection.select("envVariables");
2039        vec![EnvVariable {
2040            proc: self.proc.clone(),
2041            selection: query,
2042            graphql_client: self.graphql_client.clone(),
2043        }]
2044    }
2045    /// The exit code of the last executed command.
2046    /// Returns an error if no command was set.
2047    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2048        let query = self.selection.select("exitCode");
2049        query.execute(self.graphql_client.clone()).await
2050    }
2051    /// EXPERIMENTAL API! Subject to change/removal at any time.
2052    /// Configures all available GPUs on the host to be accessible to this container.
2053    /// This currently works for Nvidia devices only.
2054    pub fn experimental_with_all_gp_us(&self) -> Container {
2055        let query = self.selection.select("experimentalWithAllGPUs");
2056        Container {
2057            proc: self.proc.clone(),
2058            selection: query,
2059            graphql_client: self.graphql_client.clone(),
2060        }
2061    }
2062    /// EXPERIMENTAL API! Subject to change/removal at any time.
2063    /// Configures the provided list of devices to be accessible to this container.
2064    /// This currently works for Nvidia devices only.
2065    ///
2066    /// # Arguments
2067    ///
2068    /// * `devices` - List of devices to be accessible to this container.
2069    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2070        let mut query = self.selection.select("experimentalWithGPU");
2071        query = query.arg(
2072            "devices",
2073            devices
2074                .into_iter()
2075                .map(|i| i.into())
2076                .collect::<Vec<String>>(),
2077        );
2078        Container {
2079            proc: self.proc.clone(),
2080            selection: query,
2081            graphql_client: self.graphql_client.clone(),
2082        }
2083    }
2084    /// Writes the container as an OCI tarball to the destination file path on the host.
2085    /// It can also export platform variants.
2086    ///
2087    /// # Arguments
2088    ///
2089    /// * `path` - Host's destination path (e.g., "./tarball").
2090    ///
2091    /// Path can be relative to the engine's workdir or absolute.
2092    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2093    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2094        let mut query = self.selection.select("export");
2095        query = query.arg("path", path.into());
2096        query.execute(self.graphql_client.clone()).await
2097    }
2098    /// Writes the container as an OCI tarball to the destination file path on the host.
2099    /// It can also export platform variants.
2100    ///
2101    /// # Arguments
2102    ///
2103    /// * `path` - Host's destination path (e.g., "./tarball").
2104    ///
2105    /// Path can be relative to the engine's workdir or absolute.
2106    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2107    pub async fn export_opts(
2108        &self,
2109        path: impl Into<String>,
2110        opts: ContainerExportOpts,
2111    ) -> Result<String, DaggerError> {
2112        let mut query = self.selection.select("export");
2113        query = query.arg("path", path.into());
2114        if let Some(platform_variants) = opts.platform_variants {
2115            query = query.arg("platformVariants", platform_variants);
2116        }
2117        if let Some(forced_compression) = opts.forced_compression {
2118            query = query.arg("forcedCompression", forced_compression);
2119        }
2120        if let Some(media_types) = opts.media_types {
2121            query = query.arg("mediaTypes", media_types);
2122        }
2123        if let Some(expand) = opts.expand {
2124            query = query.arg("expand", expand);
2125        }
2126        query.execute(self.graphql_client.clone()).await
2127    }
2128    /// Retrieves the list of exposed ports.
2129    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
2130    pub fn exposed_ports(&self) -> Vec<Port> {
2131        let query = self.selection.select("exposedPorts");
2132        vec![Port {
2133            proc: self.proc.clone(),
2134            selection: query,
2135            graphql_client: self.graphql_client.clone(),
2136        }]
2137    }
2138    /// Retrieves a file at the given path.
2139    /// Mounts are included.
2140    ///
2141    /// # Arguments
2142    ///
2143    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2144    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2145    pub fn file(&self, path: impl Into<String>) -> File {
2146        let mut query = self.selection.select("file");
2147        query = query.arg("path", path.into());
2148        File {
2149            proc: self.proc.clone(),
2150            selection: query,
2151            graphql_client: self.graphql_client.clone(),
2152        }
2153    }
2154    /// Retrieves a file at the given path.
2155    /// Mounts are included.
2156    ///
2157    /// # Arguments
2158    ///
2159    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2160    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2161    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2162        let mut query = self.selection.select("file");
2163        query = query.arg("path", path.into());
2164        if let Some(expand) = opts.expand {
2165            query = query.arg("expand", expand);
2166        }
2167        File {
2168            proc: self.proc.clone(),
2169            selection: query,
2170            graphql_client: self.graphql_client.clone(),
2171        }
2172    }
2173    /// Initializes this container from a pulled base image.
2174    ///
2175    /// # Arguments
2176    ///
2177    /// * `address` - Image's address from its registry.
2178    ///
2179    /// Formatted as [host]/[user]/[repo]:[tag] (e.g., "docker.io/dagger/dagger:main").
2180    pub fn from(&self, address: impl Into<String>) -> Container {
2181        let mut query = self.selection.select("from");
2182        query = query.arg("address", address.into());
2183        Container {
2184            proc: self.proc.clone(),
2185            selection: query,
2186            graphql_client: self.graphql_client.clone(),
2187        }
2188    }
2189    /// A unique identifier for this Container.
2190    pub async fn id(&self) -> Result<ContainerId, DaggerError> {
2191        let query = self.selection.select("id");
2192        query.execute(self.graphql_client.clone()).await
2193    }
2194    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
2195    pub async fn image_ref(&self) -> Result<String, DaggerError> {
2196        let query = self.selection.select("imageRef");
2197        query.execute(self.graphql_client.clone()).await
2198    }
2199    /// Reads the container from an OCI tarball.
2200    ///
2201    /// # Arguments
2202    ///
2203    /// * `source` - File to read the container from.
2204    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2205    pub fn import(&self, source: impl IntoID<FileId>) -> Container {
2206        let mut query = self.selection.select("import");
2207        query = query.arg_lazy(
2208            "source",
2209            Box::new(move || {
2210                let source = source.clone();
2211                Box::pin(async move { source.into_id().await.unwrap().quote() })
2212            }),
2213        );
2214        Container {
2215            proc: self.proc.clone(),
2216            selection: query,
2217            graphql_client: self.graphql_client.clone(),
2218        }
2219    }
2220    /// Reads the container from an OCI tarball.
2221    ///
2222    /// # Arguments
2223    ///
2224    /// * `source` - File to read the container from.
2225    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2226    pub fn import_opts<'a>(
2227        &self,
2228        source: impl IntoID<FileId>,
2229        opts: ContainerImportOpts<'a>,
2230    ) -> Container {
2231        let mut query = self.selection.select("import");
2232        query = query.arg_lazy(
2233            "source",
2234            Box::new(move || {
2235                let source = source.clone();
2236                Box::pin(async move { source.into_id().await.unwrap().quote() })
2237            }),
2238        );
2239        if let Some(tag) = opts.tag {
2240            query = query.arg("tag", tag);
2241        }
2242        Container {
2243            proc: self.proc.clone(),
2244            selection: query,
2245            graphql_client: self.graphql_client.clone(),
2246        }
2247    }
2248    /// Retrieves the value of the specified label.
2249    ///
2250    /// # Arguments
2251    ///
2252    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
2253    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2254        let mut query = self.selection.select("label");
2255        query = query.arg("name", name.into());
2256        query.execute(self.graphql_client.clone()).await
2257    }
2258    /// Retrieves the list of labels passed to container.
2259    pub fn labels(&self) -> Vec<Label> {
2260        let query = self.selection.select("labels");
2261        vec![Label {
2262            proc: self.proc.clone(),
2263            selection: query,
2264            graphql_client: self.graphql_client.clone(),
2265        }]
2266    }
2267    /// Retrieves the list of paths where a directory is mounted.
2268    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2269        let query = self.selection.select("mounts");
2270        query.execute(self.graphql_client.clone()).await
2271    }
2272    /// The platform this container executes and publishes as.
2273    pub async fn platform(&self) -> Result<Platform, DaggerError> {
2274        let query = self.selection.select("platform");
2275        query.execute(self.graphql_client.clone()).await
2276    }
2277    /// Publishes this container as a new image to the specified address.
2278    /// Publish returns a fully qualified ref.
2279    /// It can also publish platform variants.
2280    ///
2281    /// # Arguments
2282    ///
2283    /// * `address` - Registry's address to publish the image to.
2284    ///
2285    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. "docker.io/dagger/dagger:main").
2286    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2287    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2288        let mut query = self.selection.select("publish");
2289        query = query.arg("address", address.into());
2290        query.execute(self.graphql_client.clone()).await
2291    }
2292    /// Publishes this container as a new image to the specified address.
2293    /// Publish returns a fully qualified ref.
2294    /// It can also publish platform variants.
2295    ///
2296    /// # Arguments
2297    ///
2298    /// * `address` - Registry's address to publish the image to.
2299    ///
2300    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. "docker.io/dagger/dagger:main").
2301    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2302    pub async fn publish_opts(
2303        &self,
2304        address: impl Into<String>,
2305        opts: ContainerPublishOpts,
2306    ) -> Result<String, DaggerError> {
2307        let mut query = self.selection.select("publish");
2308        query = query.arg("address", address.into());
2309        if let Some(platform_variants) = opts.platform_variants {
2310            query = query.arg("platformVariants", platform_variants);
2311        }
2312        if let Some(forced_compression) = opts.forced_compression {
2313            query = query.arg("forcedCompression", forced_compression);
2314        }
2315        if let Some(media_types) = opts.media_types {
2316            query = query.arg("mediaTypes", media_types);
2317        }
2318        query.execute(self.graphql_client.clone()).await
2319    }
2320    /// Retrieves this container's root filesystem. Mounts are not included.
2321    pub fn rootfs(&self) -> Directory {
2322        let query = self.selection.select("rootfs");
2323        Directory {
2324            proc: self.proc.clone(),
2325            selection: query,
2326            graphql_client: self.graphql_client.clone(),
2327        }
2328    }
2329    /// The error stream of the last executed command.
2330    /// Returns an error if no command was set.
2331    pub async fn stderr(&self) -> Result<String, DaggerError> {
2332        let query = self.selection.select("stderr");
2333        query.execute(self.graphql_client.clone()).await
2334    }
2335    /// The output stream of the last executed command.
2336    /// Returns an error if no command was set.
2337    pub async fn stdout(&self) -> Result<String, DaggerError> {
2338        let query = self.selection.select("stdout");
2339        query.execute(self.graphql_client.clone()).await
2340    }
2341    /// Forces evaluation of the pipeline in the engine.
2342    /// It doesn't run the default command if no exec has been set.
2343    pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
2344        let query = self.selection.select("sync");
2345        query.execute(self.graphql_client.clone()).await
2346    }
2347    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2348    ///
2349    /// # Arguments
2350    ///
2351    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2352    pub fn terminal(&self) -> Container {
2353        let query = self.selection.select("terminal");
2354        Container {
2355            proc: self.proc.clone(),
2356            selection: query,
2357            graphql_client: self.graphql_client.clone(),
2358        }
2359    }
2360    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2361    ///
2362    /// # Arguments
2363    ///
2364    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2365    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2366        let mut query = self.selection.select("terminal");
2367        if let Some(cmd) = opts.cmd {
2368            query = query.arg("cmd", cmd);
2369        }
2370        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2371            query = query.arg(
2372                "experimentalPrivilegedNesting",
2373                experimental_privileged_nesting,
2374            );
2375        }
2376        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2377            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2378        }
2379        Container {
2380            proc: self.proc.clone(),
2381            selection: query,
2382            graphql_client: self.graphql_client.clone(),
2383        }
2384    }
2385    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
2386    /// Be sure to set any exposed ports before calling this api.
2387    ///
2388    /// # Arguments
2389    ///
2390    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2391    pub async fn up(&self) -> Result<Void, DaggerError> {
2392        let query = self.selection.select("up");
2393        query.execute(self.graphql_client.clone()).await
2394    }
2395    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
2396    /// Be sure to set any exposed ports before calling this api.
2397    ///
2398    /// # Arguments
2399    ///
2400    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2401    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
2402        let mut query = self.selection.select("up");
2403        if let Some(ports) = opts.ports {
2404            query = query.arg("ports", ports);
2405        }
2406        if let Some(random) = opts.random {
2407            query = query.arg("random", random);
2408        }
2409        if let Some(args) = opts.args {
2410            query = query.arg("args", args);
2411        }
2412        if let Some(use_entrypoint) = opts.use_entrypoint {
2413            query = query.arg("useEntrypoint", use_entrypoint);
2414        }
2415        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2416            query = query.arg(
2417                "experimentalPrivilegedNesting",
2418                experimental_privileged_nesting,
2419            );
2420        }
2421        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2422            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2423        }
2424        if let Some(expand) = opts.expand {
2425            query = query.arg("expand", expand);
2426        }
2427        if let Some(no_init) = opts.no_init {
2428            query = query.arg("noInit", no_init);
2429        }
2430        query.execute(self.graphql_client.clone()).await
2431    }
2432    /// Retrieves the user to be set for all commands.
2433    pub async fn user(&self) -> Result<String, DaggerError> {
2434        let query = self.selection.select("user");
2435        query.execute(self.graphql_client.clone()).await
2436    }
2437    /// Retrieves this container plus the given OCI anotation.
2438    ///
2439    /// # Arguments
2440    ///
2441    /// * `name` - The name of the annotation.
2442    /// * `value` - The value of the annotation.
2443    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2444        let mut query = self.selection.select("withAnnotation");
2445        query = query.arg("name", name.into());
2446        query = query.arg("value", value.into());
2447        Container {
2448            proc: self.proc.clone(),
2449            selection: query,
2450            graphql_client: self.graphql_client.clone(),
2451        }
2452    }
2453    /// Configures default arguments for future commands.
2454    ///
2455    /// # Arguments
2456    ///
2457    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
2458    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
2459        let mut query = self.selection.select("withDefaultArgs");
2460        query = query.arg(
2461            "args",
2462            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2463        );
2464        Container {
2465            proc: self.proc.clone(),
2466            selection: query,
2467            graphql_client: self.graphql_client.clone(),
2468        }
2469    }
2470    /// Set the default command to invoke for the container's terminal API.
2471    ///
2472    /// # Arguments
2473    ///
2474    /// * `args` - The args of the command.
2475    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2476    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
2477        let mut query = self.selection.select("withDefaultTerminalCmd");
2478        query = query.arg(
2479            "args",
2480            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2481        );
2482        Container {
2483            proc: self.proc.clone(),
2484            selection: query,
2485            graphql_client: self.graphql_client.clone(),
2486        }
2487    }
2488    /// Set the default command to invoke for the container's terminal API.
2489    ///
2490    /// # Arguments
2491    ///
2492    /// * `args` - The args of the command.
2493    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2494    pub fn with_default_terminal_cmd_opts(
2495        &self,
2496        args: Vec<impl Into<String>>,
2497        opts: ContainerWithDefaultTerminalCmdOpts,
2498    ) -> Container {
2499        let mut query = self.selection.select("withDefaultTerminalCmd");
2500        query = query.arg(
2501            "args",
2502            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2503        );
2504        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2505            query = query.arg(
2506                "experimentalPrivilegedNesting",
2507                experimental_privileged_nesting,
2508            );
2509        }
2510        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2511            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2512        }
2513        Container {
2514            proc: self.proc.clone(),
2515            selection: query,
2516            graphql_client: self.graphql_client.clone(),
2517        }
2518    }
2519    /// Retrieves this container plus a directory written at the given path.
2520    ///
2521    /// # Arguments
2522    ///
2523    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
2524    /// * `directory` - Identifier of the directory to write
2525    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2526    pub fn with_directory(
2527        &self,
2528        path: impl Into<String>,
2529        directory: impl IntoID<DirectoryId>,
2530    ) -> Container {
2531        let mut query = self.selection.select("withDirectory");
2532        query = query.arg("path", path.into());
2533        query = query.arg_lazy(
2534            "directory",
2535            Box::new(move || {
2536                let directory = directory.clone();
2537                Box::pin(async move { directory.into_id().await.unwrap().quote() })
2538            }),
2539        );
2540        Container {
2541            proc: self.proc.clone(),
2542            selection: query,
2543            graphql_client: self.graphql_client.clone(),
2544        }
2545    }
2546    /// Retrieves this container plus a directory written at the given path.
2547    ///
2548    /// # Arguments
2549    ///
2550    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
2551    /// * `directory` - Identifier of the directory to write
2552    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2553    pub fn with_directory_opts<'a>(
2554        &self,
2555        path: impl Into<String>,
2556        directory: impl IntoID<DirectoryId>,
2557        opts: ContainerWithDirectoryOpts<'a>,
2558    ) -> Container {
2559        let mut query = self.selection.select("withDirectory");
2560        query = query.arg("path", path.into());
2561        query = query.arg_lazy(
2562            "directory",
2563            Box::new(move || {
2564                let directory = directory.clone();
2565                Box::pin(async move { directory.into_id().await.unwrap().quote() })
2566            }),
2567        );
2568        if let Some(exclude) = opts.exclude {
2569            query = query.arg("exclude", exclude);
2570        }
2571        if let Some(include) = opts.include {
2572            query = query.arg("include", include);
2573        }
2574        if let Some(owner) = opts.owner {
2575            query = query.arg("owner", owner);
2576        }
2577        if let Some(expand) = opts.expand {
2578            query = query.arg("expand", expand);
2579        }
2580        Container {
2581            proc: self.proc.clone(),
2582            selection: query,
2583            graphql_client: self.graphql_client.clone(),
2584        }
2585    }
2586    /// Retrieves this container but with a different command entrypoint.
2587    ///
2588    /// # Arguments
2589    ///
2590    /// * `args` - Entrypoint to use for future executions (e.g., ["go", "run"]).
2591    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2592    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
2593        let mut query = self.selection.select("withEntrypoint");
2594        query = query.arg(
2595            "args",
2596            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2597        );
2598        Container {
2599            proc: self.proc.clone(),
2600            selection: query,
2601            graphql_client: self.graphql_client.clone(),
2602        }
2603    }
2604    /// Retrieves this container but with a different command entrypoint.
2605    ///
2606    /// # Arguments
2607    ///
2608    /// * `args` - Entrypoint to use for future executions (e.g., ["go", "run"]).
2609    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2610    pub fn with_entrypoint_opts(
2611        &self,
2612        args: Vec<impl Into<String>>,
2613        opts: ContainerWithEntrypointOpts,
2614    ) -> Container {
2615        let mut query = self.selection.select("withEntrypoint");
2616        query = query.arg(
2617            "args",
2618            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2619        );
2620        if let Some(keep_default_args) = opts.keep_default_args {
2621            query = query.arg("keepDefaultArgs", keep_default_args);
2622        }
2623        Container {
2624            proc: self.proc.clone(),
2625            selection: query,
2626            graphql_client: self.graphql_client.clone(),
2627        }
2628    }
2629    /// Retrieves this container plus the given environment variable.
2630    ///
2631    /// # Arguments
2632    ///
2633    /// * `name` - The name of the environment variable (e.g., "HOST").
2634    /// * `value` - The value of the environment variable. (e.g., "localhost").
2635    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2636    pub fn with_env_variable(
2637        &self,
2638        name: impl Into<String>,
2639        value: impl Into<String>,
2640    ) -> Container {
2641        let mut query = self.selection.select("withEnvVariable");
2642        query = query.arg("name", name.into());
2643        query = query.arg("value", value.into());
2644        Container {
2645            proc: self.proc.clone(),
2646            selection: query,
2647            graphql_client: self.graphql_client.clone(),
2648        }
2649    }
2650    /// Retrieves this container plus the given environment variable.
2651    ///
2652    /// # Arguments
2653    ///
2654    /// * `name` - The name of the environment variable (e.g., "HOST").
2655    /// * `value` - The value of the environment variable. (e.g., "localhost").
2656    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2657    pub fn with_env_variable_opts(
2658        &self,
2659        name: impl Into<String>,
2660        value: impl Into<String>,
2661        opts: ContainerWithEnvVariableOpts,
2662    ) -> Container {
2663        let mut query = self.selection.select("withEnvVariable");
2664        query = query.arg("name", name.into());
2665        query = query.arg("value", value.into());
2666        if let Some(expand) = opts.expand {
2667            query = query.arg("expand", expand);
2668        }
2669        Container {
2670            proc: self.proc.clone(),
2671            selection: query,
2672            graphql_client: self.graphql_client.clone(),
2673        }
2674    }
2675    /// Retrieves this container after executing the specified command inside it.
2676    ///
2677    /// # Arguments
2678    ///
2679    /// * `args` - Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2680    ///
2681    /// If empty, the container's default command is used.
2682    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2683    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
2684        let mut query = self.selection.select("withExec");
2685        query = query.arg(
2686            "args",
2687            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2688        );
2689        Container {
2690            proc: self.proc.clone(),
2691            selection: query,
2692            graphql_client: self.graphql_client.clone(),
2693        }
2694    }
2695    /// Retrieves this container after executing the specified command inside it.
2696    ///
2697    /// # Arguments
2698    ///
2699    /// * `args` - Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2700    ///
2701    /// If empty, the container's default command is used.
2702    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2703    pub fn with_exec_opts<'a>(
2704        &self,
2705        args: Vec<impl Into<String>>,
2706        opts: ContainerWithExecOpts<'a>,
2707    ) -> Container {
2708        let mut query = self.selection.select("withExec");
2709        query = query.arg(
2710            "args",
2711            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2712        );
2713        if let Some(use_entrypoint) = opts.use_entrypoint {
2714            query = query.arg("useEntrypoint", use_entrypoint);
2715        }
2716        if let Some(stdin) = opts.stdin {
2717            query = query.arg("stdin", stdin);
2718        }
2719        if let Some(redirect_stdout) = opts.redirect_stdout {
2720            query = query.arg("redirectStdout", redirect_stdout);
2721        }
2722        if let Some(redirect_stderr) = opts.redirect_stderr {
2723            query = query.arg("redirectStderr", redirect_stderr);
2724        }
2725        if let Some(expect) = opts.expect {
2726            query = query.arg("expect", expect);
2727        }
2728        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2729            query = query.arg(
2730                "experimentalPrivilegedNesting",
2731                experimental_privileged_nesting,
2732            );
2733        }
2734        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2735            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2736        }
2737        if let Some(expand) = opts.expand {
2738            query = query.arg("expand", expand);
2739        }
2740        if let Some(no_init) = opts.no_init {
2741            query = query.arg("noInit", no_init);
2742        }
2743        Container {
2744            proc: self.proc.clone(),
2745            selection: query,
2746            graphql_client: self.graphql_client.clone(),
2747        }
2748    }
2749    /// Expose a network port.
2750    /// Exposed ports serve two purposes:
2751    /// - For health checks and introspection, when running services
2752    /// - For setting the EXPOSE OCI field when publishing the container
2753    ///
2754    /// # Arguments
2755    ///
2756    /// * `port` - Port number to expose
2757    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2758    pub fn with_exposed_port(&self, port: isize) -> Container {
2759        let mut query = self.selection.select("withExposedPort");
2760        query = query.arg("port", port);
2761        Container {
2762            proc: self.proc.clone(),
2763            selection: query,
2764            graphql_client: self.graphql_client.clone(),
2765        }
2766    }
2767    /// Expose a network port.
2768    /// Exposed ports serve two purposes:
2769    /// - For health checks and introspection, when running services
2770    /// - For setting the EXPOSE OCI field when publishing the container
2771    ///
2772    /// # Arguments
2773    ///
2774    /// * `port` - Port number to expose
2775    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2776    pub fn with_exposed_port_opts<'a>(
2777        &self,
2778        port: isize,
2779        opts: ContainerWithExposedPortOpts<'a>,
2780    ) -> Container {
2781        let mut query = self.selection.select("withExposedPort");
2782        query = query.arg("port", port);
2783        if let Some(protocol) = opts.protocol {
2784            query = query.arg("protocol", protocol);
2785        }
2786        if let Some(description) = opts.description {
2787            query = query.arg("description", description);
2788        }
2789        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
2790            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
2791        }
2792        Container {
2793            proc: self.proc.clone(),
2794            selection: query,
2795            graphql_client: self.graphql_client.clone(),
2796        }
2797    }
2798    /// Retrieves this container plus the contents of the given file copied to the given path.
2799    ///
2800    /// # Arguments
2801    ///
2802    /// * `path` - Location of the copied file (e.g., "/tmp/file.txt").
2803    /// * `source` - Identifier of the file to copy.
2804    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2805    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
2806        let mut query = self.selection.select("withFile");
2807        query = query.arg("path", path.into());
2808        query = query.arg_lazy(
2809            "source",
2810            Box::new(move || {
2811                let source = source.clone();
2812                Box::pin(async move { source.into_id().await.unwrap().quote() })
2813            }),
2814        );
2815        Container {
2816            proc: self.proc.clone(),
2817            selection: query,
2818            graphql_client: self.graphql_client.clone(),
2819        }
2820    }
2821    /// Retrieves this container plus the contents of the given file copied to the given path.
2822    ///
2823    /// # Arguments
2824    ///
2825    /// * `path` - Location of the copied file (e.g., "/tmp/file.txt").
2826    /// * `source` - Identifier of the file to copy.
2827    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2828    pub fn with_file_opts<'a>(
2829        &self,
2830        path: impl Into<String>,
2831        source: impl IntoID<FileId>,
2832        opts: ContainerWithFileOpts<'a>,
2833    ) -> Container {
2834        let mut query = self.selection.select("withFile");
2835        query = query.arg("path", path.into());
2836        query = query.arg_lazy(
2837            "source",
2838            Box::new(move || {
2839                let source = source.clone();
2840                Box::pin(async move { source.into_id().await.unwrap().quote() })
2841            }),
2842        );
2843        if let Some(permissions) = opts.permissions {
2844            query = query.arg("permissions", permissions);
2845        }
2846        if let Some(owner) = opts.owner {
2847            query = query.arg("owner", owner);
2848        }
2849        if let Some(expand) = opts.expand {
2850            query = query.arg("expand", expand);
2851        }
2852        Container {
2853            proc: self.proc.clone(),
2854            selection: query,
2855            graphql_client: self.graphql_client.clone(),
2856        }
2857    }
2858    /// Retrieves this container plus the contents of the given files copied to the given path.
2859    ///
2860    /// # Arguments
2861    ///
2862    /// * `path` - Location where copied files should be placed (e.g., "/src").
2863    /// * `sources` - Identifiers of the files to copy.
2864    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2865    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
2866        let mut query = self.selection.select("withFiles");
2867        query = query.arg("path", path.into());
2868        query = query.arg("sources", sources);
2869        Container {
2870            proc: self.proc.clone(),
2871            selection: query,
2872            graphql_client: self.graphql_client.clone(),
2873        }
2874    }
2875    /// Retrieves this container plus the contents of the given files copied to the given path.
2876    ///
2877    /// # Arguments
2878    ///
2879    /// * `path` - Location where copied files should be placed (e.g., "/src").
2880    /// * `sources` - Identifiers of the files to copy.
2881    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2882    pub fn with_files_opts<'a>(
2883        &self,
2884        path: impl Into<String>,
2885        sources: Vec<FileId>,
2886        opts: ContainerWithFilesOpts<'a>,
2887    ) -> Container {
2888        let mut query = self.selection.select("withFiles");
2889        query = query.arg("path", path.into());
2890        query = query.arg("sources", sources);
2891        if let Some(permissions) = opts.permissions {
2892            query = query.arg("permissions", permissions);
2893        }
2894        if let Some(owner) = opts.owner {
2895            query = query.arg("owner", owner);
2896        }
2897        if let Some(expand) = opts.expand {
2898            query = query.arg("expand", expand);
2899        }
2900        Container {
2901            proc: self.proc.clone(),
2902            selection: query,
2903            graphql_client: self.graphql_client.clone(),
2904        }
2905    }
2906    /// Retrieves this container plus the given label.
2907    ///
2908    /// # Arguments
2909    ///
2910    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
2911    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
2912    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2913        let mut query = self.selection.select("withLabel");
2914        query = query.arg("name", name.into());
2915        query = query.arg("value", value.into());
2916        Container {
2917            proc: self.proc.clone(),
2918            selection: query,
2919            graphql_client: self.graphql_client.clone(),
2920        }
2921    }
2922    /// Retrieves this container plus a cache volume mounted at the given path.
2923    ///
2924    /// # Arguments
2925    ///
2926    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
2927    /// * `cache` - Identifier of the cache volume to mount.
2928    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2929    pub fn with_mounted_cache(
2930        &self,
2931        path: impl Into<String>,
2932        cache: impl IntoID<CacheVolumeId>,
2933    ) -> Container {
2934        let mut query = self.selection.select("withMountedCache");
2935        query = query.arg("path", path.into());
2936        query = query.arg_lazy(
2937            "cache",
2938            Box::new(move || {
2939                let cache = cache.clone();
2940                Box::pin(async move { cache.into_id().await.unwrap().quote() })
2941            }),
2942        );
2943        Container {
2944            proc: self.proc.clone(),
2945            selection: query,
2946            graphql_client: self.graphql_client.clone(),
2947        }
2948    }
2949    /// Retrieves this container plus a cache volume mounted at the given path.
2950    ///
2951    /// # Arguments
2952    ///
2953    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
2954    /// * `cache` - Identifier of the cache volume to mount.
2955    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2956    pub fn with_mounted_cache_opts<'a>(
2957        &self,
2958        path: impl Into<String>,
2959        cache: impl IntoID<CacheVolumeId>,
2960        opts: ContainerWithMountedCacheOpts<'a>,
2961    ) -> Container {
2962        let mut query = self.selection.select("withMountedCache");
2963        query = query.arg("path", path.into());
2964        query = query.arg_lazy(
2965            "cache",
2966            Box::new(move || {
2967                let cache = cache.clone();
2968                Box::pin(async move { cache.into_id().await.unwrap().quote() })
2969            }),
2970        );
2971        if let Some(source) = opts.source {
2972            query = query.arg("source", source);
2973        }
2974        if let Some(sharing) = opts.sharing {
2975            query = query.arg("sharing", sharing);
2976        }
2977        if let Some(owner) = opts.owner {
2978            query = query.arg("owner", owner);
2979        }
2980        if let Some(expand) = opts.expand {
2981            query = query.arg("expand", expand);
2982        }
2983        Container {
2984            proc: self.proc.clone(),
2985            selection: query,
2986            graphql_client: self.graphql_client.clone(),
2987        }
2988    }
2989    /// Retrieves this container plus a directory mounted at the given path.
2990    ///
2991    /// # Arguments
2992    ///
2993    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
2994    /// * `source` - Identifier of the mounted directory.
2995    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2996    pub fn with_mounted_directory(
2997        &self,
2998        path: impl Into<String>,
2999        source: impl IntoID<DirectoryId>,
3000    ) -> Container {
3001        let mut query = self.selection.select("withMountedDirectory");
3002        query = query.arg("path", path.into());
3003        query = query.arg_lazy(
3004            "source",
3005            Box::new(move || {
3006                let source = source.clone();
3007                Box::pin(async move { source.into_id().await.unwrap().quote() })
3008            }),
3009        );
3010        Container {
3011            proc: self.proc.clone(),
3012            selection: query,
3013            graphql_client: self.graphql_client.clone(),
3014        }
3015    }
3016    /// Retrieves this container plus a directory mounted at the given path.
3017    ///
3018    /// # Arguments
3019    ///
3020    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3021    /// * `source` - Identifier of the mounted directory.
3022    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3023    pub fn with_mounted_directory_opts<'a>(
3024        &self,
3025        path: impl Into<String>,
3026        source: impl IntoID<DirectoryId>,
3027        opts: ContainerWithMountedDirectoryOpts<'a>,
3028    ) -> Container {
3029        let mut query = self.selection.select("withMountedDirectory");
3030        query = query.arg("path", path.into());
3031        query = query.arg_lazy(
3032            "source",
3033            Box::new(move || {
3034                let source = source.clone();
3035                Box::pin(async move { source.into_id().await.unwrap().quote() })
3036            }),
3037        );
3038        if let Some(owner) = opts.owner {
3039            query = query.arg("owner", owner);
3040        }
3041        if let Some(expand) = opts.expand {
3042            query = query.arg("expand", expand);
3043        }
3044        Container {
3045            proc: self.proc.clone(),
3046            selection: query,
3047            graphql_client: self.graphql_client.clone(),
3048        }
3049    }
3050    /// Retrieves this container plus a file mounted at the given path.
3051    ///
3052    /// # Arguments
3053    ///
3054    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3055    /// * `source` - Identifier of the mounted file.
3056    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3057    pub fn with_mounted_file(
3058        &self,
3059        path: impl Into<String>,
3060        source: impl IntoID<FileId>,
3061    ) -> Container {
3062        let mut query = self.selection.select("withMountedFile");
3063        query = query.arg("path", path.into());
3064        query = query.arg_lazy(
3065            "source",
3066            Box::new(move || {
3067                let source = source.clone();
3068                Box::pin(async move { source.into_id().await.unwrap().quote() })
3069            }),
3070        );
3071        Container {
3072            proc: self.proc.clone(),
3073            selection: query,
3074            graphql_client: self.graphql_client.clone(),
3075        }
3076    }
3077    /// Retrieves this container plus a file mounted at the given path.
3078    ///
3079    /// # Arguments
3080    ///
3081    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3082    /// * `source` - Identifier of the mounted file.
3083    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3084    pub fn with_mounted_file_opts<'a>(
3085        &self,
3086        path: impl Into<String>,
3087        source: impl IntoID<FileId>,
3088        opts: ContainerWithMountedFileOpts<'a>,
3089    ) -> Container {
3090        let mut query = self.selection.select("withMountedFile");
3091        query = query.arg("path", path.into());
3092        query = query.arg_lazy(
3093            "source",
3094            Box::new(move || {
3095                let source = source.clone();
3096                Box::pin(async move { source.into_id().await.unwrap().quote() })
3097            }),
3098        );
3099        if let Some(owner) = opts.owner {
3100            query = query.arg("owner", owner);
3101        }
3102        if let Some(expand) = opts.expand {
3103            query = query.arg("expand", expand);
3104        }
3105        Container {
3106            proc: self.proc.clone(),
3107            selection: query,
3108            graphql_client: self.graphql_client.clone(),
3109        }
3110    }
3111    /// Retrieves this container plus a secret mounted into a file at the given path.
3112    ///
3113    /// # Arguments
3114    ///
3115    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3116    /// * `source` - Identifier of the secret to mount.
3117    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3118    pub fn with_mounted_secret(
3119        &self,
3120        path: impl Into<String>,
3121        source: impl IntoID<SecretId>,
3122    ) -> Container {
3123        let mut query = self.selection.select("withMountedSecret");
3124        query = query.arg("path", path.into());
3125        query = query.arg_lazy(
3126            "source",
3127            Box::new(move || {
3128                let source = source.clone();
3129                Box::pin(async move { source.into_id().await.unwrap().quote() })
3130            }),
3131        );
3132        Container {
3133            proc: self.proc.clone(),
3134            selection: query,
3135            graphql_client: self.graphql_client.clone(),
3136        }
3137    }
3138    /// Retrieves this container plus a secret mounted into a file at the given path.
3139    ///
3140    /// # Arguments
3141    ///
3142    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3143    /// * `source` - Identifier of the secret to mount.
3144    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3145    pub fn with_mounted_secret_opts<'a>(
3146        &self,
3147        path: impl Into<String>,
3148        source: impl IntoID<SecretId>,
3149        opts: ContainerWithMountedSecretOpts<'a>,
3150    ) -> Container {
3151        let mut query = self.selection.select("withMountedSecret");
3152        query = query.arg("path", path.into());
3153        query = query.arg_lazy(
3154            "source",
3155            Box::new(move || {
3156                let source = source.clone();
3157                Box::pin(async move { source.into_id().await.unwrap().quote() })
3158            }),
3159        );
3160        if let Some(owner) = opts.owner {
3161            query = query.arg("owner", owner);
3162        }
3163        if let Some(mode) = opts.mode {
3164            query = query.arg("mode", mode);
3165        }
3166        if let Some(expand) = opts.expand {
3167            query = query.arg("expand", expand);
3168        }
3169        Container {
3170            proc: self.proc.clone(),
3171            selection: query,
3172            graphql_client: self.graphql_client.clone(),
3173        }
3174    }
3175    /// 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.
3176    ///
3177    /// # Arguments
3178    ///
3179    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3180    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3181    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3182        let mut query = self.selection.select("withMountedTemp");
3183        query = query.arg("path", path.into());
3184        Container {
3185            proc: self.proc.clone(),
3186            selection: query,
3187            graphql_client: self.graphql_client.clone(),
3188        }
3189    }
3190    /// 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.
3191    ///
3192    /// # Arguments
3193    ///
3194    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3195    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3196    pub fn with_mounted_temp_opts(
3197        &self,
3198        path: impl Into<String>,
3199        opts: ContainerWithMountedTempOpts,
3200    ) -> Container {
3201        let mut query = self.selection.select("withMountedTemp");
3202        query = query.arg("path", path.into());
3203        if let Some(size) = opts.size {
3204            query = query.arg("size", size);
3205        }
3206        if let Some(expand) = opts.expand {
3207            query = query.arg("expand", expand);
3208        }
3209        Container {
3210            proc: self.proc.clone(),
3211            selection: query,
3212            graphql_client: self.graphql_client.clone(),
3213        }
3214    }
3215    /// Retrieves this container plus a new file written at the given path.
3216    ///
3217    /// # Arguments
3218    ///
3219    /// * `path` - Location of the written file (e.g., "/tmp/file.txt").
3220    /// * `contents` - Content of the file to write (e.g., "Hello world!").
3221    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3222    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3223        let mut query = self.selection.select("withNewFile");
3224        query = query.arg("path", path.into());
3225        query = query.arg("contents", contents.into());
3226        Container {
3227            proc: self.proc.clone(),
3228            selection: query,
3229            graphql_client: self.graphql_client.clone(),
3230        }
3231    }
3232    /// Retrieves this container plus a new file written at the given path.
3233    ///
3234    /// # Arguments
3235    ///
3236    /// * `path` - Location of the written file (e.g., "/tmp/file.txt").
3237    /// * `contents` - Content of the file to write (e.g., "Hello world!").
3238    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3239    pub fn with_new_file_opts<'a>(
3240        &self,
3241        path: impl Into<String>,
3242        contents: impl Into<String>,
3243        opts: ContainerWithNewFileOpts<'a>,
3244    ) -> Container {
3245        let mut query = self.selection.select("withNewFile");
3246        query = query.arg("path", path.into());
3247        query = query.arg("contents", contents.into());
3248        if let Some(permissions) = opts.permissions {
3249            query = query.arg("permissions", permissions);
3250        }
3251        if let Some(owner) = opts.owner {
3252            query = query.arg("owner", owner);
3253        }
3254        if let Some(expand) = opts.expand {
3255            query = query.arg("expand", expand);
3256        }
3257        Container {
3258            proc: self.proc.clone(),
3259            selection: query,
3260            graphql_client: self.graphql_client.clone(),
3261        }
3262    }
3263    /// Retrieves this container with a registry authentication for a given address.
3264    ///
3265    /// # Arguments
3266    ///
3267    /// * `address` - Registry's address to bind the authentication to.
3268    ///
3269    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
3270    /// * `username` - The username of the registry's account (e.g., "Dagger").
3271    /// * `secret` - The API key, password or token to authenticate to this registry.
3272    pub fn with_registry_auth(
3273        &self,
3274        address: impl Into<String>,
3275        username: impl Into<String>,
3276        secret: impl IntoID<SecretId>,
3277    ) -> Container {
3278        let mut query = self.selection.select("withRegistryAuth");
3279        query = query.arg("address", address.into());
3280        query = query.arg("username", username.into());
3281        query = query.arg_lazy(
3282            "secret",
3283            Box::new(move || {
3284                let secret = secret.clone();
3285                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3286            }),
3287        );
3288        Container {
3289            proc: self.proc.clone(),
3290            selection: query,
3291            graphql_client: self.graphql_client.clone(),
3292        }
3293    }
3294    /// Retrieves the container with the given directory mounted to /.
3295    ///
3296    /// # Arguments
3297    ///
3298    /// * `directory` - Directory to mount.
3299    pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
3300        let mut query = self.selection.select("withRootfs");
3301        query = query.arg_lazy(
3302            "directory",
3303            Box::new(move || {
3304                let directory = directory.clone();
3305                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3306            }),
3307        );
3308        Container {
3309            proc: self.proc.clone(),
3310            selection: query,
3311            graphql_client: self.graphql_client.clone(),
3312        }
3313    }
3314    /// Retrieves this container plus an env variable containing the given secret.
3315    ///
3316    /// # Arguments
3317    ///
3318    /// * `name` - The name of the secret variable (e.g., "API_SECRET").
3319    /// * `secret` - The identifier of the secret value.
3320    pub fn with_secret_variable(
3321        &self,
3322        name: impl Into<String>,
3323        secret: impl IntoID<SecretId>,
3324    ) -> Container {
3325        let mut query = self.selection.select("withSecretVariable");
3326        query = query.arg("name", name.into());
3327        query = query.arg_lazy(
3328            "secret",
3329            Box::new(move || {
3330                let secret = secret.clone();
3331                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3332            }),
3333        );
3334        Container {
3335            proc: self.proc.clone(),
3336            selection: query,
3337            graphql_client: self.graphql_client.clone(),
3338        }
3339    }
3340    /// Establish a runtime dependency on a service.
3341    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
3342    /// The service will be reachable from the container via the provided hostname alias.
3343    /// The service dependency will also convey to any files or directories produced by the container.
3344    ///
3345    /// # Arguments
3346    ///
3347    /// * `alias` - A name that can be used to reach the service from the container
3348    /// * `service` - Identifier of the service container
3349    pub fn with_service_binding(
3350        &self,
3351        alias: impl Into<String>,
3352        service: impl IntoID<ServiceId>,
3353    ) -> Container {
3354        let mut query = self.selection.select("withServiceBinding");
3355        query = query.arg("alias", alias.into());
3356        query = query.arg_lazy(
3357            "service",
3358            Box::new(move || {
3359                let service = service.clone();
3360                Box::pin(async move { service.into_id().await.unwrap().quote() })
3361            }),
3362        );
3363        Container {
3364            proc: self.proc.clone(),
3365            selection: query,
3366            graphql_client: self.graphql_client.clone(),
3367        }
3368    }
3369    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
3370    ///
3371    /// # Arguments
3372    ///
3373    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
3374    /// * `source` - Identifier of the socket to forward.
3375    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3376    pub fn with_unix_socket(
3377        &self,
3378        path: impl Into<String>,
3379        source: impl IntoID<SocketId>,
3380    ) -> Container {
3381        let mut query = self.selection.select("withUnixSocket");
3382        query = query.arg("path", path.into());
3383        query = query.arg_lazy(
3384            "source",
3385            Box::new(move || {
3386                let source = source.clone();
3387                Box::pin(async move { source.into_id().await.unwrap().quote() })
3388            }),
3389        );
3390        Container {
3391            proc: self.proc.clone(),
3392            selection: query,
3393            graphql_client: self.graphql_client.clone(),
3394        }
3395    }
3396    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
3397    ///
3398    /// # Arguments
3399    ///
3400    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
3401    /// * `source` - Identifier of the socket to forward.
3402    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3403    pub fn with_unix_socket_opts<'a>(
3404        &self,
3405        path: impl Into<String>,
3406        source: impl IntoID<SocketId>,
3407        opts: ContainerWithUnixSocketOpts<'a>,
3408    ) -> Container {
3409        let mut query = self.selection.select("withUnixSocket");
3410        query = query.arg("path", path.into());
3411        query = query.arg_lazy(
3412            "source",
3413            Box::new(move || {
3414                let source = source.clone();
3415                Box::pin(async move { source.into_id().await.unwrap().quote() })
3416            }),
3417        );
3418        if let Some(owner) = opts.owner {
3419            query = query.arg("owner", owner);
3420        }
3421        if let Some(expand) = opts.expand {
3422            query = query.arg("expand", expand);
3423        }
3424        Container {
3425            proc: self.proc.clone(),
3426            selection: query,
3427            graphql_client: self.graphql_client.clone(),
3428        }
3429    }
3430    /// Retrieves this container with a different command user.
3431    ///
3432    /// # Arguments
3433    ///
3434    /// * `name` - The user to set (e.g., "root").
3435    pub fn with_user(&self, name: impl Into<String>) -> Container {
3436        let mut query = self.selection.select("withUser");
3437        query = query.arg("name", name.into());
3438        Container {
3439            proc: self.proc.clone(),
3440            selection: query,
3441            graphql_client: self.graphql_client.clone(),
3442        }
3443    }
3444    /// Retrieves this container with a different working directory.
3445    ///
3446    /// # Arguments
3447    ///
3448    /// * `path` - The path to set as the working directory (e.g., "/app").
3449    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3450    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3451        let mut query = self.selection.select("withWorkdir");
3452        query = query.arg("path", path.into());
3453        Container {
3454            proc: self.proc.clone(),
3455            selection: query,
3456            graphql_client: self.graphql_client.clone(),
3457        }
3458    }
3459    /// Retrieves this container with a different working directory.
3460    ///
3461    /// # Arguments
3462    ///
3463    /// * `path` - The path to set as the working directory (e.g., "/app").
3464    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3465    pub fn with_workdir_opts(
3466        &self,
3467        path: impl Into<String>,
3468        opts: ContainerWithWorkdirOpts,
3469    ) -> Container {
3470        let mut query = self.selection.select("withWorkdir");
3471        query = query.arg("path", path.into());
3472        if let Some(expand) = opts.expand {
3473            query = query.arg("expand", expand);
3474        }
3475        Container {
3476            proc: self.proc.clone(),
3477            selection: query,
3478            graphql_client: self.graphql_client.clone(),
3479        }
3480    }
3481    /// Retrieves this container minus the given OCI annotation.
3482    ///
3483    /// # Arguments
3484    ///
3485    /// * `name` - The name of the annotation.
3486    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3487        let mut query = self.selection.select("withoutAnnotation");
3488        query = query.arg("name", name.into());
3489        Container {
3490            proc: self.proc.clone(),
3491            selection: query,
3492            graphql_client: self.graphql_client.clone(),
3493        }
3494    }
3495    /// Retrieves this container with unset default arguments for future commands.
3496    pub fn without_default_args(&self) -> Container {
3497        let query = self.selection.select("withoutDefaultArgs");
3498        Container {
3499            proc: self.proc.clone(),
3500            selection: query,
3501            graphql_client: self.graphql_client.clone(),
3502        }
3503    }
3504    /// Retrieves this container with the directory at the given path removed.
3505    ///
3506    /// # Arguments
3507    ///
3508    /// * `path` - Location of the directory to remove (e.g., ".github/").
3509    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3510    pub fn without_directory(&self, path: impl Into<String>) -> Container {
3511        let mut query = self.selection.select("withoutDirectory");
3512        query = query.arg("path", path.into());
3513        Container {
3514            proc: self.proc.clone(),
3515            selection: query,
3516            graphql_client: self.graphql_client.clone(),
3517        }
3518    }
3519    /// Retrieves this container with the directory at the given path removed.
3520    ///
3521    /// # Arguments
3522    ///
3523    /// * `path` - Location of the directory to remove (e.g., ".github/").
3524    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3525    pub fn without_directory_opts(
3526        &self,
3527        path: impl Into<String>,
3528        opts: ContainerWithoutDirectoryOpts,
3529    ) -> Container {
3530        let mut query = self.selection.select("withoutDirectory");
3531        query = query.arg("path", path.into());
3532        if let Some(expand) = opts.expand {
3533            query = query.arg("expand", expand);
3534        }
3535        Container {
3536            proc: self.proc.clone(),
3537            selection: query,
3538            graphql_client: self.graphql_client.clone(),
3539        }
3540    }
3541    /// Retrieves this container with an unset command entrypoint.
3542    ///
3543    /// # Arguments
3544    ///
3545    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3546    pub fn without_entrypoint(&self) -> Container {
3547        let query = self.selection.select("withoutEntrypoint");
3548        Container {
3549            proc: self.proc.clone(),
3550            selection: query,
3551            graphql_client: self.graphql_client.clone(),
3552        }
3553    }
3554    /// Retrieves this container with an unset command entrypoint.
3555    ///
3556    /// # Arguments
3557    ///
3558    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3559    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
3560        let mut query = self.selection.select("withoutEntrypoint");
3561        if let Some(keep_default_args) = opts.keep_default_args {
3562            query = query.arg("keepDefaultArgs", keep_default_args);
3563        }
3564        Container {
3565            proc: self.proc.clone(),
3566            selection: query,
3567            graphql_client: self.graphql_client.clone(),
3568        }
3569    }
3570    /// Retrieves this container minus the given environment variable.
3571    ///
3572    /// # Arguments
3573    ///
3574    /// * `name` - The name of the environment variable (e.g., "HOST").
3575    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
3576        let mut query = self.selection.select("withoutEnvVariable");
3577        query = query.arg("name", name.into());
3578        Container {
3579            proc: self.proc.clone(),
3580            selection: query,
3581            graphql_client: self.graphql_client.clone(),
3582        }
3583    }
3584    /// Unexpose a previously exposed port.
3585    ///
3586    /// # Arguments
3587    ///
3588    /// * `port` - Port number to unexpose
3589    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3590    pub fn without_exposed_port(&self, port: isize) -> Container {
3591        let mut query = self.selection.select("withoutExposedPort");
3592        query = query.arg("port", port);
3593        Container {
3594            proc: self.proc.clone(),
3595            selection: query,
3596            graphql_client: self.graphql_client.clone(),
3597        }
3598    }
3599    /// Unexpose a previously exposed port.
3600    ///
3601    /// # Arguments
3602    ///
3603    /// * `port` - Port number to unexpose
3604    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3605    pub fn without_exposed_port_opts(
3606        &self,
3607        port: isize,
3608        opts: ContainerWithoutExposedPortOpts,
3609    ) -> Container {
3610        let mut query = self.selection.select("withoutExposedPort");
3611        query = query.arg("port", port);
3612        if let Some(protocol) = opts.protocol {
3613            query = query.arg("protocol", protocol);
3614        }
3615        Container {
3616            proc: self.proc.clone(),
3617            selection: query,
3618            graphql_client: self.graphql_client.clone(),
3619        }
3620    }
3621    /// Retrieves this container with the file at the given path removed.
3622    ///
3623    /// # Arguments
3624    ///
3625    /// * `path` - Location of the file to remove (e.g., "/file.txt").
3626    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3627    pub fn without_file(&self, path: impl Into<String>) -> Container {
3628        let mut query = self.selection.select("withoutFile");
3629        query = query.arg("path", path.into());
3630        Container {
3631            proc: self.proc.clone(),
3632            selection: query,
3633            graphql_client: self.graphql_client.clone(),
3634        }
3635    }
3636    /// Retrieves this container with the file at the given path removed.
3637    ///
3638    /// # Arguments
3639    ///
3640    /// * `path` - Location of the file to remove (e.g., "/file.txt").
3641    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3642    pub fn without_file_opts(
3643        &self,
3644        path: impl Into<String>,
3645        opts: ContainerWithoutFileOpts,
3646    ) -> Container {
3647        let mut query = self.selection.select("withoutFile");
3648        query = query.arg("path", path.into());
3649        if let Some(expand) = opts.expand {
3650            query = query.arg("expand", expand);
3651        }
3652        Container {
3653            proc: self.proc.clone(),
3654            selection: query,
3655            graphql_client: self.graphql_client.clone(),
3656        }
3657    }
3658    /// Retrieves this container with the files at the given paths removed.
3659    ///
3660    /// # Arguments
3661    ///
3662    /// * `paths` - Location of the files to remove (e.g., ["/file.txt"]).
3663    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3664    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
3665        let mut query = self.selection.select("withoutFiles");
3666        query = query.arg(
3667            "paths",
3668            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3669        );
3670        Container {
3671            proc: self.proc.clone(),
3672            selection: query,
3673            graphql_client: self.graphql_client.clone(),
3674        }
3675    }
3676    /// Retrieves this container with the files at the given paths removed.
3677    ///
3678    /// # Arguments
3679    ///
3680    /// * `paths` - Location of the files to remove (e.g., ["/file.txt"]).
3681    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3682    pub fn without_files_opts(
3683        &self,
3684        paths: Vec<impl Into<String>>,
3685        opts: ContainerWithoutFilesOpts,
3686    ) -> Container {
3687        let mut query = self.selection.select("withoutFiles");
3688        query = query.arg(
3689            "paths",
3690            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3691        );
3692        if let Some(expand) = opts.expand {
3693            query = query.arg("expand", expand);
3694        }
3695        Container {
3696            proc: self.proc.clone(),
3697            selection: query,
3698            graphql_client: self.graphql_client.clone(),
3699        }
3700    }
3701    /// Retrieves this container minus the given environment label.
3702    ///
3703    /// # Arguments
3704    ///
3705    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
3706    pub fn without_label(&self, name: impl Into<String>) -> Container {
3707        let mut query = self.selection.select("withoutLabel");
3708        query = query.arg("name", name.into());
3709        Container {
3710            proc: self.proc.clone(),
3711            selection: query,
3712            graphql_client: self.graphql_client.clone(),
3713        }
3714    }
3715    /// Retrieves this container after unmounting everything at the given path.
3716    ///
3717    /// # Arguments
3718    ///
3719    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3720    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3721    pub fn without_mount(&self, path: impl Into<String>) -> Container {
3722        let mut query = self.selection.select("withoutMount");
3723        query = query.arg("path", path.into());
3724        Container {
3725            proc: self.proc.clone(),
3726            selection: query,
3727            graphql_client: self.graphql_client.clone(),
3728        }
3729    }
3730    /// Retrieves this container after unmounting everything at the given path.
3731    ///
3732    /// # Arguments
3733    ///
3734    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3735    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3736    pub fn without_mount_opts(
3737        &self,
3738        path: impl Into<String>,
3739        opts: ContainerWithoutMountOpts,
3740    ) -> Container {
3741        let mut query = self.selection.select("withoutMount");
3742        query = query.arg("path", path.into());
3743        if let Some(expand) = opts.expand {
3744            query = query.arg("expand", expand);
3745        }
3746        Container {
3747            proc: self.proc.clone(),
3748            selection: query,
3749            graphql_client: self.graphql_client.clone(),
3750        }
3751    }
3752    /// Retrieves this container without the registry authentication of a given address.
3753    ///
3754    /// # Arguments
3755    ///
3756    /// * `address` - Registry's address to remove the authentication from.
3757    ///
3758    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
3759    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
3760        let mut query = self.selection.select("withoutRegistryAuth");
3761        query = query.arg("address", address.into());
3762        Container {
3763            proc: self.proc.clone(),
3764            selection: query,
3765            graphql_client: self.graphql_client.clone(),
3766        }
3767    }
3768    /// Retrieves this container minus the given environment variable containing the secret.
3769    ///
3770    /// # Arguments
3771    ///
3772    /// * `name` - The name of the environment variable (e.g., "HOST").
3773    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
3774        let mut query = self.selection.select("withoutSecretVariable");
3775        query = query.arg("name", name.into());
3776        Container {
3777            proc: self.proc.clone(),
3778            selection: query,
3779            graphql_client: self.graphql_client.clone(),
3780        }
3781    }
3782    /// Retrieves this container with a previously added Unix socket removed.
3783    ///
3784    /// # Arguments
3785    ///
3786    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
3787    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3788    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
3789        let mut query = self.selection.select("withoutUnixSocket");
3790        query = query.arg("path", path.into());
3791        Container {
3792            proc: self.proc.clone(),
3793            selection: query,
3794            graphql_client: self.graphql_client.clone(),
3795        }
3796    }
3797    /// Retrieves this container with a previously added Unix socket removed.
3798    ///
3799    /// # Arguments
3800    ///
3801    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
3802    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3803    pub fn without_unix_socket_opts(
3804        &self,
3805        path: impl Into<String>,
3806        opts: ContainerWithoutUnixSocketOpts,
3807    ) -> Container {
3808        let mut query = self.selection.select("withoutUnixSocket");
3809        query = query.arg("path", path.into());
3810        if let Some(expand) = opts.expand {
3811            query = query.arg("expand", expand);
3812        }
3813        Container {
3814            proc: self.proc.clone(),
3815            selection: query,
3816            graphql_client: self.graphql_client.clone(),
3817        }
3818    }
3819    /// Retrieves this container with an unset command user.
3820    /// Should default to root.
3821    pub fn without_user(&self) -> Container {
3822        let query = self.selection.select("withoutUser");
3823        Container {
3824            proc: self.proc.clone(),
3825            selection: query,
3826            graphql_client: self.graphql_client.clone(),
3827        }
3828    }
3829    /// Retrieves this container with an unset working directory.
3830    /// Should default to "/".
3831    pub fn without_workdir(&self) -> Container {
3832        let query = self.selection.select("withoutWorkdir");
3833        Container {
3834            proc: self.proc.clone(),
3835            selection: query,
3836            graphql_client: self.graphql_client.clone(),
3837        }
3838    }
3839    /// Retrieves the working directory for all commands.
3840    pub async fn workdir(&self) -> Result<String, DaggerError> {
3841        let query = self.selection.select("workdir");
3842        query.execute(self.graphql_client.clone()).await
3843    }
3844}
3845#[derive(Clone)]
3846pub struct CurrentModule {
3847    pub proc: Option<Arc<DaggerSessionProc>>,
3848    pub selection: Selection,
3849    pub graphql_client: DynGraphQLClient,
3850}
3851#[derive(Builder, Debug, PartialEq)]
3852pub struct CurrentModuleWorkdirOpts<'a> {
3853    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
3854    #[builder(setter(into, strip_option), default)]
3855    pub exclude: Option<Vec<&'a str>>,
3856    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
3857    #[builder(setter(into, strip_option), default)]
3858    pub include: Option<Vec<&'a str>>,
3859}
3860impl CurrentModule {
3861    /// A unique identifier for this CurrentModule.
3862    pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
3863        let query = self.selection.select("id");
3864        query.execute(self.graphql_client.clone()).await
3865    }
3866    /// The name of the module being executed in
3867    pub async fn name(&self) -> Result<String, DaggerError> {
3868        let query = self.selection.select("name");
3869        query.execute(self.graphql_client.clone()).await
3870    }
3871    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
3872    pub fn source(&self) -> Directory {
3873        let query = self.selection.select("source");
3874        Directory {
3875            proc: self.proc.clone(),
3876            selection: query,
3877            graphql_client: self.graphql_client.clone(),
3878        }
3879    }
3880    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
3881    ///
3882    /// # Arguments
3883    ///
3884    /// * `path` - Location of the directory to access (e.g., ".").
3885    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3886    pub fn workdir(&self, path: impl Into<String>) -> Directory {
3887        let mut query = self.selection.select("workdir");
3888        query = query.arg("path", path.into());
3889        Directory {
3890            proc: self.proc.clone(),
3891            selection: query,
3892            graphql_client: self.graphql_client.clone(),
3893        }
3894    }
3895    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
3896    ///
3897    /// # Arguments
3898    ///
3899    /// * `path` - Location of the directory to access (e.g., ".").
3900    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3901    pub fn workdir_opts<'a>(
3902        &self,
3903        path: impl Into<String>,
3904        opts: CurrentModuleWorkdirOpts<'a>,
3905    ) -> Directory {
3906        let mut query = self.selection.select("workdir");
3907        query = query.arg("path", path.into());
3908        if let Some(exclude) = opts.exclude {
3909            query = query.arg("exclude", exclude);
3910        }
3911        if let Some(include) = opts.include {
3912            query = query.arg("include", include);
3913        }
3914        Directory {
3915            proc: self.proc.clone(),
3916            selection: query,
3917            graphql_client: self.graphql_client.clone(),
3918        }
3919    }
3920    /// 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.
3921    ///
3922    /// # Arguments
3923    ///
3924    /// * `path` - Location of the file to retrieve (e.g., "README.md").
3925    pub fn workdir_file(&self, path: impl Into<String>) -> File {
3926        let mut query = self.selection.select("workdirFile");
3927        query = query.arg("path", path.into());
3928        File {
3929            proc: self.proc.clone(),
3930            selection: query,
3931            graphql_client: self.graphql_client.clone(),
3932        }
3933    }
3934}
3935#[derive(Clone)]
3936pub struct Directory {
3937    pub proc: Option<Arc<DaggerSessionProc>>,
3938    pub selection: Selection,
3939    pub graphql_client: DynGraphQLClient,
3940}
3941#[derive(Builder, Debug, PartialEq)]
3942pub struct DirectoryAsModuleOpts<'a> {
3943    /// An optional subpath of the directory which contains the module's configuration file.
3944    /// If not set, the module source code is loaded from the root of the directory.
3945    #[builder(setter(into, strip_option), default)]
3946    pub source_root_path: Option<&'a str>,
3947}
3948#[derive(Builder, Debug, PartialEq)]
3949pub struct DirectoryAsModuleSourceOpts<'a> {
3950    /// An optional subpath of the directory which contains the module's configuration file.
3951    /// If not set, the module source code is loaded from the root of the directory.
3952    #[builder(setter(into, strip_option), default)]
3953    pub source_root_path: Option<&'a str>,
3954}
3955#[derive(Builder, Debug, PartialEq)]
3956pub struct DirectoryDockerBuildOpts<'a> {
3957    /// Build arguments to use in the build.
3958    #[builder(setter(into, strip_option), default)]
3959    pub build_args: Option<Vec<BuildArg>>,
3960    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
3961    #[builder(setter(into, strip_option), default)]
3962    pub dockerfile: Option<&'a str>,
3963    /// The platform to build.
3964    #[builder(setter(into, strip_option), default)]
3965    pub platform: Option<Platform>,
3966    /// Secrets to pass to the build.
3967    /// They will be mounted at /run/secrets/[secret-name].
3968    #[builder(setter(into, strip_option), default)]
3969    pub secrets: Option<Vec<SecretId>>,
3970    /// Target build stage to build.
3971    #[builder(setter(into, strip_option), default)]
3972    pub target: Option<&'a str>,
3973}
3974#[derive(Builder, Debug, PartialEq)]
3975pub struct DirectoryEntriesOpts<'a> {
3976    /// Location of the directory to look at (e.g., "/src").
3977    #[builder(setter(into, strip_option), default)]
3978    pub path: Option<&'a str>,
3979}
3980#[derive(Builder, Debug, PartialEq)]
3981pub struct DirectoryExportOpts {
3982    /// 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.
3983    #[builder(setter(into, strip_option), default)]
3984    pub wipe: Option<bool>,
3985}
3986#[derive(Builder, Debug, PartialEq)]
3987pub struct DirectoryTerminalOpts<'a> {
3988    /// If set, override the container's default terminal command and invoke these command arguments instead.
3989    #[builder(setter(into, strip_option), default)]
3990    pub cmd: Option<Vec<&'a str>>,
3991    /// If set, override the default container used for the terminal.
3992    #[builder(setter(into, strip_option), default)]
3993    pub container: Option<ContainerId>,
3994    /// Provides Dagger access to the executed command.
3995    /// Do not use this option unless you trust the command being executed; the command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
3996    #[builder(setter(into, strip_option), default)]
3997    pub experimental_privileged_nesting: Option<bool>,
3998    /// 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.
3999    #[builder(setter(into, strip_option), default)]
4000    pub insecure_root_capabilities: Option<bool>,
4001}
4002#[derive(Builder, Debug, PartialEq)]
4003pub struct DirectoryWithDirectoryOpts<'a> {
4004    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4005    #[builder(setter(into, strip_option), default)]
4006    pub exclude: Option<Vec<&'a str>>,
4007    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4008    #[builder(setter(into, strip_option), default)]
4009    pub include: Option<Vec<&'a str>>,
4010}
4011#[derive(Builder, Debug, PartialEq)]
4012pub struct DirectoryWithFileOpts {
4013    /// Permission given to the copied file (e.g., 0600).
4014    #[builder(setter(into, strip_option), default)]
4015    pub permissions: Option<isize>,
4016}
4017#[derive(Builder, Debug, PartialEq)]
4018pub struct DirectoryWithFilesOpts {
4019    /// Permission given to the copied files (e.g., 0600).
4020    #[builder(setter(into, strip_option), default)]
4021    pub permissions: Option<isize>,
4022}
4023#[derive(Builder, Debug, PartialEq)]
4024pub struct DirectoryWithNewDirectoryOpts {
4025    /// Permission granted to the created directory (e.g., 0777).
4026    #[builder(setter(into, strip_option), default)]
4027    pub permissions: Option<isize>,
4028}
4029#[derive(Builder, Debug, PartialEq)]
4030pub struct DirectoryWithNewFileOpts {
4031    /// Permission given to the copied file (e.g., 0600).
4032    #[builder(setter(into, strip_option), default)]
4033    pub permissions: Option<isize>,
4034}
4035impl Directory {
4036    /// Converts this directory into a git repository
4037    pub fn as_git(&self) -> GitRepository {
4038        let query = self.selection.select("asGit");
4039        GitRepository {
4040            proc: self.proc.clone(),
4041            selection: query,
4042            graphql_client: self.graphql_client.clone(),
4043        }
4044    }
4045    /// Load the directory as a Dagger module source
4046    ///
4047    /// # Arguments
4048    ///
4049    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4050    pub fn as_module(&self) -> Module {
4051        let query = self.selection.select("asModule");
4052        Module {
4053            proc: self.proc.clone(),
4054            selection: query,
4055            graphql_client: self.graphql_client.clone(),
4056        }
4057    }
4058    /// Load the directory as a Dagger module source
4059    ///
4060    /// # Arguments
4061    ///
4062    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4063    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4064        let mut query = self.selection.select("asModule");
4065        if let Some(source_root_path) = opts.source_root_path {
4066            query = query.arg("sourceRootPath", source_root_path);
4067        }
4068        Module {
4069            proc: self.proc.clone(),
4070            selection: query,
4071            graphql_client: self.graphql_client.clone(),
4072        }
4073    }
4074    /// Load the directory as a Dagger module source
4075    ///
4076    /// # Arguments
4077    ///
4078    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4079    pub fn as_module_source(&self) -> ModuleSource {
4080        let query = self.selection.select("asModuleSource");
4081        ModuleSource {
4082            proc: self.proc.clone(),
4083            selection: query,
4084            graphql_client: self.graphql_client.clone(),
4085        }
4086    }
4087    /// Load the directory as a Dagger module source
4088    ///
4089    /// # Arguments
4090    ///
4091    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4092    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4093        let mut query = self.selection.select("asModuleSource");
4094        if let Some(source_root_path) = opts.source_root_path {
4095            query = query.arg("sourceRootPath", source_root_path);
4096        }
4097        ModuleSource {
4098            proc: self.proc.clone(),
4099            selection: query,
4100            graphql_client: self.graphql_client.clone(),
4101        }
4102    }
4103    /// Gets the difference between this directory and an another directory.
4104    ///
4105    /// # Arguments
4106    ///
4107    /// * `other` - Identifier of the directory to compare.
4108    pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
4109        let mut query = self.selection.select("diff");
4110        query = query.arg_lazy(
4111            "other",
4112            Box::new(move || {
4113                let other = other.clone();
4114                Box::pin(async move { other.into_id().await.unwrap().quote() })
4115            }),
4116        );
4117        Directory {
4118            proc: self.proc.clone(),
4119            selection: query,
4120            graphql_client: self.graphql_client.clone(),
4121        }
4122    }
4123    /// 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.
4124    pub async fn digest(&self) -> Result<String, DaggerError> {
4125        let query = self.selection.select("digest");
4126        query.execute(self.graphql_client.clone()).await
4127    }
4128    /// Retrieves a directory at the given path.
4129    ///
4130    /// # Arguments
4131    ///
4132    /// * `path` - Location of the directory to retrieve (e.g., "/src").
4133    pub fn directory(&self, path: impl Into<String>) -> Directory {
4134        let mut query = self.selection.select("directory");
4135        query = query.arg("path", path.into());
4136        Directory {
4137            proc: self.proc.clone(),
4138            selection: query,
4139            graphql_client: self.graphql_client.clone(),
4140        }
4141    }
4142    /// Builds a new Docker container from this directory.
4143    ///
4144    /// # Arguments
4145    ///
4146    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4147    pub fn docker_build(&self) -> Container {
4148        let query = self.selection.select("dockerBuild");
4149        Container {
4150            proc: self.proc.clone(),
4151            selection: query,
4152            graphql_client: self.graphql_client.clone(),
4153        }
4154    }
4155    /// Builds a new Docker container from this directory.
4156    ///
4157    /// # Arguments
4158    ///
4159    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4160    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
4161        let mut query = self.selection.select("dockerBuild");
4162        if let Some(platform) = opts.platform {
4163            query = query.arg("platform", platform);
4164        }
4165        if let Some(dockerfile) = opts.dockerfile {
4166            query = query.arg("dockerfile", dockerfile);
4167        }
4168        if let Some(target) = opts.target {
4169            query = query.arg("target", target);
4170        }
4171        if let Some(build_args) = opts.build_args {
4172            query = query.arg("buildArgs", build_args);
4173        }
4174        if let Some(secrets) = opts.secrets {
4175            query = query.arg("secrets", secrets);
4176        }
4177        Container {
4178            proc: self.proc.clone(),
4179            selection: query,
4180            graphql_client: self.graphql_client.clone(),
4181        }
4182    }
4183    /// Returns a list of files and directories at the given path.
4184    ///
4185    /// # Arguments
4186    ///
4187    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4188    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
4189        let query = self.selection.select("entries");
4190        query.execute(self.graphql_client.clone()).await
4191    }
4192    /// Returns a list of files and directories at the given path.
4193    ///
4194    /// # Arguments
4195    ///
4196    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4197    pub async fn entries_opts<'a>(
4198        &self,
4199        opts: DirectoryEntriesOpts<'a>,
4200    ) -> Result<Vec<String>, DaggerError> {
4201        let mut query = self.selection.select("entries");
4202        if let Some(path) = opts.path {
4203            query = query.arg("path", path);
4204        }
4205        query.execute(self.graphql_client.clone()).await
4206    }
4207    /// Writes the contents of the directory to a path on the host.
4208    ///
4209    /// # Arguments
4210    ///
4211    /// * `path` - Location of the copied directory (e.g., "logs/").
4212    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4213    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4214        let mut query = self.selection.select("export");
4215        query = query.arg("path", path.into());
4216        query.execute(self.graphql_client.clone()).await
4217    }
4218    /// Writes the contents of the directory to a path on the host.
4219    ///
4220    /// # Arguments
4221    ///
4222    /// * `path` - Location of the copied directory (e.g., "logs/").
4223    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4224    pub async fn export_opts(
4225        &self,
4226        path: impl Into<String>,
4227        opts: DirectoryExportOpts,
4228    ) -> Result<String, DaggerError> {
4229        let mut query = self.selection.select("export");
4230        query = query.arg("path", path.into());
4231        if let Some(wipe) = opts.wipe {
4232            query = query.arg("wipe", wipe);
4233        }
4234        query.execute(self.graphql_client.clone()).await
4235    }
4236    /// Retrieves a file at the given path.
4237    ///
4238    /// # Arguments
4239    ///
4240    /// * `path` - Location of the file to retrieve (e.g., "README.md").
4241    pub fn file(&self, path: impl Into<String>) -> File {
4242        let mut query = self.selection.select("file");
4243        query = query.arg("path", path.into());
4244        File {
4245            proc: self.proc.clone(),
4246            selection: query,
4247            graphql_client: self.graphql_client.clone(),
4248        }
4249    }
4250    /// Returns a list of files and directories that matche the given pattern.
4251    ///
4252    /// # Arguments
4253    ///
4254    /// * `pattern` - Pattern to match (e.g., "*.md").
4255    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
4256        let mut query = self.selection.select("glob");
4257        query = query.arg("pattern", pattern.into());
4258        query.execute(self.graphql_client.clone()).await
4259    }
4260    /// A unique identifier for this Directory.
4261    pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
4262        let query = self.selection.select("id");
4263        query.execute(self.graphql_client.clone()).await
4264    }
4265    /// Returns the name of the directory.
4266    pub async fn name(&self) -> Result<String, DaggerError> {
4267        let query = self.selection.select("name");
4268        query.execute(self.graphql_client.clone()).await
4269    }
4270    /// Force evaluation in the engine.
4271    pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
4272        let query = self.selection.select("sync");
4273        query.execute(self.graphql_client.clone()).await
4274    }
4275    /// Opens an interactive terminal in new container with this directory mounted inside.
4276    ///
4277    /// # Arguments
4278    ///
4279    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4280    pub fn terminal(&self) -> Directory {
4281        let query = self.selection.select("terminal");
4282        Directory {
4283            proc: self.proc.clone(),
4284            selection: query,
4285            graphql_client: self.graphql_client.clone(),
4286        }
4287    }
4288    /// Opens an interactive terminal in new container with this directory mounted inside.
4289    ///
4290    /// # Arguments
4291    ///
4292    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4293    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
4294        let mut query = self.selection.select("terminal");
4295        if let Some(cmd) = opts.cmd {
4296            query = query.arg("cmd", cmd);
4297        }
4298        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4299            query = query.arg(
4300                "experimentalPrivilegedNesting",
4301                experimental_privileged_nesting,
4302            );
4303        }
4304        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4305            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4306        }
4307        if let Some(container) = opts.container {
4308            query = query.arg("container", container);
4309        }
4310        Directory {
4311            proc: self.proc.clone(),
4312            selection: query,
4313            graphql_client: self.graphql_client.clone(),
4314        }
4315    }
4316    /// Retrieves this directory plus a directory written at the given path.
4317    ///
4318    /// # Arguments
4319    ///
4320    /// * `path` - Location of the written directory (e.g., "/src/").
4321    /// * `directory` - Identifier of the directory to copy.
4322    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4323    pub fn with_directory(
4324        &self,
4325        path: impl Into<String>,
4326        directory: impl IntoID<DirectoryId>,
4327    ) -> Directory {
4328        let mut query = self.selection.select("withDirectory");
4329        query = query.arg("path", path.into());
4330        query = query.arg_lazy(
4331            "directory",
4332            Box::new(move || {
4333                let directory = directory.clone();
4334                Box::pin(async move { directory.into_id().await.unwrap().quote() })
4335            }),
4336        );
4337        Directory {
4338            proc: self.proc.clone(),
4339            selection: query,
4340            graphql_client: self.graphql_client.clone(),
4341        }
4342    }
4343    /// Retrieves this directory plus a directory written at the given path.
4344    ///
4345    /// # Arguments
4346    ///
4347    /// * `path` - Location of the written directory (e.g., "/src/").
4348    /// * `directory` - Identifier of the directory to copy.
4349    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4350    pub fn with_directory_opts<'a>(
4351        &self,
4352        path: impl Into<String>,
4353        directory: impl IntoID<DirectoryId>,
4354        opts: DirectoryWithDirectoryOpts<'a>,
4355    ) -> Directory {
4356        let mut query = self.selection.select("withDirectory");
4357        query = query.arg("path", path.into());
4358        query = query.arg_lazy(
4359            "directory",
4360            Box::new(move || {
4361                let directory = directory.clone();
4362                Box::pin(async move { directory.into_id().await.unwrap().quote() })
4363            }),
4364        );
4365        if let Some(exclude) = opts.exclude {
4366            query = query.arg("exclude", exclude);
4367        }
4368        if let Some(include) = opts.include {
4369            query = query.arg("include", include);
4370        }
4371        Directory {
4372            proc: self.proc.clone(),
4373            selection: query,
4374            graphql_client: self.graphql_client.clone(),
4375        }
4376    }
4377    /// Retrieves this directory plus the contents of the given file copied to the given path.
4378    ///
4379    /// # Arguments
4380    ///
4381    /// * `path` - Location of the copied file (e.g., "/file.txt").
4382    /// * `source` - Identifier of the file to copy.
4383    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4384    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
4385        let mut query = self.selection.select("withFile");
4386        query = query.arg("path", path.into());
4387        query = query.arg_lazy(
4388            "source",
4389            Box::new(move || {
4390                let source = source.clone();
4391                Box::pin(async move { source.into_id().await.unwrap().quote() })
4392            }),
4393        );
4394        Directory {
4395            proc: self.proc.clone(),
4396            selection: query,
4397            graphql_client: self.graphql_client.clone(),
4398        }
4399    }
4400    /// Retrieves this directory plus the contents of the given file copied to the given path.
4401    ///
4402    /// # Arguments
4403    ///
4404    /// * `path` - Location of the copied file (e.g., "/file.txt").
4405    /// * `source` - Identifier of the file to copy.
4406    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4407    pub fn with_file_opts(
4408        &self,
4409        path: impl Into<String>,
4410        source: impl IntoID<FileId>,
4411        opts: DirectoryWithFileOpts,
4412    ) -> Directory {
4413        let mut query = self.selection.select("withFile");
4414        query = query.arg("path", path.into());
4415        query = query.arg_lazy(
4416            "source",
4417            Box::new(move || {
4418                let source = source.clone();
4419                Box::pin(async move { source.into_id().await.unwrap().quote() })
4420            }),
4421        );
4422        if let Some(permissions) = opts.permissions {
4423            query = query.arg("permissions", permissions);
4424        }
4425        Directory {
4426            proc: self.proc.clone(),
4427            selection: query,
4428            graphql_client: self.graphql_client.clone(),
4429        }
4430    }
4431    /// Retrieves this directory plus the contents of the given files copied to the given path.
4432    ///
4433    /// # Arguments
4434    ///
4435    /// * `path` - Location where copied files should be placed (e.g., "/src").
4436    /// * `sources` - Identifiers of the files to copy.
4437    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4438    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
4439        let mut query = self.selection.select("withFiles");
4440        query = query.arg("path", path.into());
4441        query = query.arg("sources", sources);
4442        Directory {
4443            proc: self.proc.clone(),
4444            selection: query,
4445            graphql_client: self.graphql_client.clone(),
4446        }
4447    }
4448    /// Retrieves this directory plus the contents of the given files copied to the given path.
4449    ///
4450    /// # Arguments
4451    ///
4452    /// * `path` - Location where copied files should be placed (e.g., "/src").
4453    /// * `sources` - Identifiers of the files to copy.
4454    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4455    pub fn with_files_opts(
4456        &self,
4457        path: impl Into<String>,
4458        sources: Vec<FileId>,
4459        opts: DirectoryWithFilesOpts,
4460    ) -> Directory {
4461        let mut query = self.selection.select("withFiles");
4462        query = query.arg("path", path.into());
4463        query = query.arg("sources", sources);
4464        if let Some(permissions) = opts.permissions {
4465            query = query.arg("permissions", permissions);
4466        }
4467        Directory {
4468            proc: self.proc.clone(),
4469            selection: query,
4470            graphql_client: self.graphql_client.clone(),
4471        }
4472    }
4473    /// Retrieves this directory plus a new directory created at the given path.
4474    ///
4475    /// # Arguments
4476    ///
4477    /// * `path` - Location of the directory created (e.g., "/logs").
4478    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4479    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
4480        let mut query = self.selection.select("withNewDirectory");
4481        query = query.arg("path", path.into());
4482        Directory {
4483            proc: self.proc.clone(),
4484            selection: query,
4485            graphql_client: self.graphql_client.clone(),
4486        }
4487    }
4488    /// Retrieves this directory plus a new directory created at the given path.
4489    ///
4490    /// # Arguments
4491    ///
4492    /// * `path` - Location of the directory created (e.g., "/logs").
4493    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4494    pub fn with_new_directory_opts(
4495        &self,
4496        path: impl Into<String>,
4497        opts: DirectoryWithNewDirectoryOpts,
4498    ) -> Directory {
4499        let mut query = self.selection.select("withNewDirectory");
4500        query = query.arg("path", path.into());
4501        if let Some(permissions) = opts.permissions {
4502            query = query.arg("permissions", permissions);
4503        }
4504        Directory {
4505            proc: self.proc.clone(),
4506            selection: query,
4507            graphql_client: self.graphql_client.clone(),
4508        }
4509    }
4510    /// Retrieves this directory plus a new file written at the given path.
4511    ///
4512    /// # Arguments
4513    ///
4514    /// * `path` - Location of the written file (e.g., "/file.txt").
4515    /// * `contents` - Content of the written file (e.g., "Hello world!").
4516    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4517    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
4518        let mut query = self.selection.select("withNewFile");
4519        query = query.arg("path", path.into());
4520        query = query.arg("contents", contents.into());
4521        Directory {
4522            proc: self.proc.clone(),
4523            selection: query,
4524            graphql_client: self.graphql_client.clone(),
4525        }
4526    }
4527    /// Retrieves this directory plus a new file written at the given path.
4528    ///
4529    /// # Arguments
4530    ///
4531    /// * `path` - Location of the written file (e.g., "/file.txt").
4532    /// * `contents` - Content of the written file (e.g., "Hello world!").
4533    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4534    pub fn with_new_file_opts(
4535        &self,
4536        path: impl Into<String>,
4537        contents: impl Into<String>,
4538        opts: DirectoryWithNewFileOpts,
4539    ) -> Directory {
4540        let mut query = self.selection.select("withNewFile");
4541        query = query.arg("path", path.into());
4542        query = query.arg("contents", contents.into());
4543        if let Some(permissions) = opts.permissions {
4544            query = query.arg("permissions", permissions);
4545        }
4546        Directory {
4547            proc: self.proc.clone(),
4548            selection: query,
4549            graphql_client: self.graphql_client.clone(),
4550        }
4551    }
4552    /// Retrieves this directory with all file/dir timestamps set to the given time.
4553    ///
4554    /// # Arguments
4555    ///
4556    /// * `timestamp` - Timestamp to set dir/files in.
4557    ///
4558    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
4559    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
4560        let mut query = self.selection.select("withTimestamps");
4561        query = query.arg("timestamp", timestamp);
4562        Directory {
4563            proc: self.proc.clone(),
4564            selection: query,
4565            graphql_client: self.graphql_client.clone(),
4566        }
4567    }
4568    /// Retrieves this directory with the directory at the given path removed.
4569    ///
4570    /// # Arguments
4571    ///
4572    /// * `path` - Location of the directory to remove (e.g., ".github/").
4573    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
4574        let mut query = self.selection.select("withoutDirectory");
4575        query = query.arg("path", path.into());
4576        Directory {
4577            proc: self.proc.clone(),
4578            selection: query,
4579            graphql_client: self.graphql_client.clone(),
4580        }
4581    }
4582    /// Retrieves this directory with the file at the given path removed.
4583    ///
4584    /// # Arguments
4585    ///
4586    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4587    pub fn without_file(&self, path: impl Into<String>) -> Directory {
4588        let mut query = self.selection.select("withoutFile");
4589        query = query.arg("path", path.into());
4590        Directory {
4591            proc: self.proc.clone(),
4592            selection: query,
4593            graphql_client: self.graphql_client.clone(),
4594        }
4595    }
4596    /// Retrieves this directory with the files at the given paths removed.
4597    ///
4598    /// # Arguments
4599    ///
4600    /// * `paths` - Location of the file to remove (e.g., ["/file.txt"]).
4601    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
4602        let mut query = self.selection.select("withoutFiles");
4603        query = query.arg(
4604            "paths",
4605            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4606        );
4607        Directory {
4608            proc: self.proc.clone(),
4609            selection: query,
4610            graphql_client: self.graphql_client.clone(),
4611        }
4612    }
4613}
4614#[derive(Clone)]
4615pub struct Engine {
4616    pub proc: Option<Arc<DaggerSessionProc>>,
4617    pub selection: Selection,
4618    pub graphql_client: DynGraphQLClient,
4619}
4620impl Engine {
4621    /// A unique identifier for this Engine.
4622    pub async fn id(&self) -> Result<EngineId, DaggerError> {
4623        let query = self.selection.select("id");
4624        query.execute(self.graphql_client.clone()).await
4625    }
4626    /// The local (on-disk) cache for the Dagger engine
4627    pub fn local_cache(&self) -> EngineCache {
4628        let query = self.selection.select("localCache");
4629        EngineCache {
4630            proc: self.proc.clone(),
4631            selection: query,
4632            graphql_client: self.graphql_client.clone(),
4633        }
4634    }
4635}
4636#[derive(Clone)]
4637pub struct EngineCache {
4638    pub proc: Option<Arc<DaggerSessionProc>>,
4639    pub selection: Selection,
4640    pub graphql_client: DynGraphQLClient,
4641}
4642#[derive(Builder, Debug, PartialEq)]
4643pub struct EngineCacheEntrySetOpts<'a> {
4644    #[builder(setter(into, strip_option), default)]
4645    pub key: Option<&'a str>,
4646}
4647impl EngineCache {
4648    /// The current set of entries in the cache
4649    ///
4650    /// # Arguments
4651    ///
4652    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4653    pub fn entry_set(&self) -> EngineCacheEntrySet {
4654        let query = self.selection.select("entrySet");
4655        EngineCacheEntrySet {
4656            proc: self.proc.clone(),
4657            selection: query,
4658            graphql_client: self.graphql_client.clone(),
4659        }
4660    }
4661    /// The current set of entries in the cache
4662    ///
4663    /// # Arguments
4664    ///
4665    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4666    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
4667        let mut query = self.selection.select("entrySet");
4668        if let Some(key) = opts.key {
4669            query = query.arg("key", key);
4670        }
4671        EngineCacheEntrySet {
4672            proc: self.proc.clone(),
4673            selection: query,
4674            graphql_client: self.graphql_client.clone(),
4675        }
4676    }
4677    /// A unique identifier for this EngineCache.
4678    pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
4679        let query = self.selection.select("id");
4680        query.execute(self.graphql_client.clone()).await
4681    }
4682    /// The maximum bytes to keep in the cache without pruning, after which automatic pruning may kick in.
4683    pub async fn keep_bytes(&self) -> Result<isize, DaggerError> {
4684        let query = self.selection.select("keepBytes");
4685        query.execute(self.graphql_client.clone()).await
4686    }
4687    /// The maximum bytes to keep in the cache without pruning.
4688    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
4689        let query = self.selection.select("maxUsedSpace");
4690        query.execute(self.graphql_client.clone()).await
4691    }
4692    /// The target amount of free disk space the garbage collector will attempt to leave.
4693    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
4694        let query = self.selection.select("minFreeSpace");
4695        query.execute(self.graphql_client.clone()).await
4696    }
4697    /// Prune the cache of releaseable entries
4698    pub async fn prune(&self) -> Result<Void, DaggerError> {
4699        let query = self.selection.select("prune");
4700        query.execute(self.graphql_client.clone()).await
4701    }
4702    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
4703        let query = self.selection.select("reservedSpace");
4704        query.execute(self.graphql_client.clone()).await
4705    }
4706}
4707#[derive(Clone)]
4708pub struct EngineCacheEntry {
4709    pub proc: Option<Arc<DaggerSessionProc>>,
4710    pub selection: Selection,
4711    pub graphql_client: DynGraphQLClient,
4712}
4713impl EngineCacheEntry {
4714    /// Whether the cache entry is actively being used.
4715    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
4716        let query = self.selection.select("activelyUsed");
4717        query.execute(self.graphql_client.clone()).await
4718    }
4719    /// The time the cache entry was created, in Unix nanoseconds.
4720    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
4721        let query = self.selection.select("createdTimeUnixNano");
4722        query.execute(self.graphql_client.clone()).await
4723    }
4724    /// The description of the cache entry.
4725    pub async fn description(&self) -> Result<String, DaggerError> {
4726        let query = self.selection.select("description");
4727        query.execute(self.graphql_client.clone()).await
4728    }
4729    /// The disk space used by the cache entry.
4730    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
4731        let query = self.selection.select("diskSpaceBytes");
4732        query.execute(self.graphql_client.clone()).await
4733    }
4734    /// A unique identifier for this EngineCacheEntry.
4735    pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
4736        let query = self.selection.select("id");
4737        query.execute(self.graphql_client.clone()).await
4738    }
4739    /// The most recent time the cache entry was used, in Unix nanoseconds.
4740    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
4741        let query = self.selection.select("mostRecentUseTimeUnixNano");
4742        query.execute(self.graphql_client.clone()).await
4743    }
4744}
4745#[derive(Clone)]
4746pub struct EngineCacheEntrySet {
4747    pub proc: Option<Arc<DaggerSessionProc>>,
4748    pub selection: Selection,
4749    pub graphql_client: DynGraphQLClient,
4750}
4751impl EngineCacheEntrySet {
4752    /// The total disk space used by the cache entries in this set.
4753    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
4754        let query = self.selection.select("diskSpaceBytes");
4755        query.execute(self.graphql_client.clone()).await
4756    }
4757    /// The list of individual cache entries in the set
4758    pub fn entries(&self) -> Vec<EngineCacheEntry> {
4759        let query = self.selection.select("entries");
4760        vec![EngineCacheEntry {
4761            proc: self.proc.clone(),
4762            selection: query,
4763            graphql_client: self.graphql_client.clone(),
4764        }]
4765    }
4766    /// The number of cache entries in this set.
4767    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
4768        let query = self.selection.select("entryCount");
4769        query.execute(self.graphql_client.clone()).await
4770    }
4771    /// A unique identifier for this EngineCacheEntrySet.
4772    pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
4773        let query = self.selection.select("id");
4774        query.execute(self.graphql_client.clone()).await
4775    }
4776}
4777#[derive(Clone)]
4778pub struct EnumTypeDef {
4779    pub proc: Option<Arc<DaggerSessionProc>>,
4780    pub selection: Selection,
4781    pub graphql_client: DynGraphQLClient,
4782}
4783impl EnumTypeDef {
4784    /// A doc string for the enum, if any.
4785    pub async fn description(&self) -> Result<String, DaggerError> {
4786        let query = self.selection.select("description");
4787        query.execute(self.graphql_client.clone()).await
4788    }
4789    /// A unique identifier for this EnumTypeDef.
4790    pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
4791        let query = self.selection.select("id");
4792        query.execute(self.graphql_client.clone()).await
4793    }
4794    /// The name of the enum.
4795    pub async fn name(&self) -> Result<String, DaggerError> {
4796        let query = self.selection.select("name");
4797        query.execute(self.graphql_client.clone()).await
4798    }
4799    /// The location of this enum declaration.
4800    pub fn source_map(&self) -> SourceMap {
4801        let query = self.selection.select("sourceMap");
4802        SourceMap {
4803            proc: self.proc.clone(),
4804            selection: query,
4805            graphql_client: self.graphql_client.clone(),
4806        }
4807    }
4808    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
4809    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
4810        let query = self.selection.select("sourceModuleName");
4811        query.execute(self.graphql_client.clone()).await
4812    }
4813    /// The values of the enum.
4814    pub fn values(&self) -> Vec<EnumValueTypeDef> {
4815        let query = self.selection.select("values");
4816        vec![EnumValueTypeDef {
4817            proc: self.proc.clone(),
4818            selection: query,
4819            graphql_client: self.graphql_client.clone(),
4820        }]
4821    }
4822}
4823#[derive(Clone)]
4824pub struct EnumValueTypeDef {
4825    pub proc: Option<Arc<DaggerSessionProc>>,
4826    pub selection: Selection,
4827    pub graphql_client: DynGraphQLClient,
4828}
4829impl EnumValueTypeDef {
4830    /// A doc string for the enum value, if any.
4831    pub async fn description(&self) -> Result<String, DaggerError> {
4832        let query = self.selection.select("description");
4833        query.execute(self.graphql_client.clone()).await
4834    }
4835    /// A unique identifier for this EnumValueTypeDef.
4836    pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
4837        let query = self.selection.select("id");
4838        query.execute(self.graphql_client.clone()).await
4839    }
4840    /// The name of the enum value.
4841    pub async fn name(&self) -> Result<String, DaggerError> {
4842        let query = self.selection.select("name");
4843        query.execute(self.graphql_client.clone()).await
4844    }
4845    /// The location of this enum value declaration.
4846    pub fn source_map(&self) -> SourceMap {
4847        let query = self.selection.select("sourceMap");
4848        SourceMap {
4849            proc: self.proc.clone(),
4850            selection: query,
4851            graphql_client: self.graphql_client.clone(),
4852        }
4853    }
4854}
4855#[derive(Clone)]
4856pub struct EnvVariable {
4857    pub proc: Option<Arc<DaggerSessionProc>>,
4858    pub selection: Selection,
4859    pub graphql_client: DynGraphQLClient,
4860}
4861impl EnvVariable {
4862    /// A unique identifier for this EnvVariable.
4863    pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
4864        let query = self.selection.select("id");
4865        query.execute(self.graphql_client.clone()).await
4866    }
4867    /// The environment variable name.
4868    pub async fn name(&self) -> Result<String, DaggerError> {
4869        let query = self.selection.select("name");
4870        query.execute(self.graphql_client.clone()).await
4871    }
4872    /// The environment variable value.
4873    pub async fn value(&self) -> Result<String, DaggerError> {
4874        let query = self.selection.select("value");
4875        query.execute(self.graphql_client.clone()).await
4876    }
4877}
4878#[derive(Clone)]
4879pub struct Error {
4880    pub proc: Option<Arc<DaggerSessionProc>>,
4881    pub selection: Selection,
4882    pub graphql_client: DynGraphQLClient,
4883}
4884impl Error {
4885    /// A unique identifier for this Error.
4886    pub async fn id(&self) -> Result<ErrorId, DaggerError> {
4887        let query = self.selection.select("id");
4888        query.execute(self.graphql_client.clone()).await
4889    }
4890    /// A description of the error.
4891    pub async fn message(&self) -> Result<String, DaggerError> {
4892        let query = self.selection.select("message");
4893        query.execute(self.graphql_client.clone()).await
4894    }
4895}
4896#[derive(Clone)]
4897pub struct FieldTypeDef {
4898    pub proc: Option<Arc<DaggerSessionProc>>,
4899    pub selection: Selection,
4900    pub graphql_client: DynGraphQLClient,
4901}
4902impl FieldTypeDef {
4903    /// A doc string for the field, if any.
4904    pub async fn description(&self) -> Result<String, DaggerError> {
4905        let query = self.selection.select("description");
4906        query.execute(self.graphql_client.clone()).await
4907    }
4908    /// A unique identifier for this FieldTypeDef.
4909    pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
4910        let query = self.selection.select("id");
4911        query.execute(self.graphql_client.clone()).await
4912    }
4913    /// The name of the field in lowerCamelCase format.
4914    pub async fn name(&self) -> Result<String, DaggerError> {
4915        let query = self.selection.select("name");
4916        query.execute(self.graphql_client.clone()).await
4917    }
4918    /// The location of this field declaration.
4919    pub fn source_map(&self) -> SourceMap {
4920        let query = self.selection.select("sourceMap");
4921        SourceMap {
4922            proc: self.proc.clone(),
4923            selection: query,
4924            graphql_client: self.graphql_client.clone(),
4925        }
4926    }
4927    /// The type of the field.
4928    pub fn type_def(&self) -> TypeDef {
4929        let query = self.selection.select("typeDef");
4930        TypeDef {
4931            proc: self.proc.clone(),
4932            selection: query,
4933            graphql_client: self.graphql_client.clone(),
4934        }
4935    }
4936}
4937#[derive(Clone)]
4938pub struct File {
4939    pub proc: Option<Arc<DaggerSessionProc>>,
4940    pub selection: Selection,
4941    pub graphql_client: DynGraphQLClient,
4942}
4943#[derive(Builder, Debug, PartialEq)]
4944pub struct FileDigestOpts {
4945    /// If true, exclude metadata from the digest.
4946    #[builder(setter(into, strip_option), default)]
4947    pub exclude_metadata: Option<bool>,
4948}
4949#[derive(Builder, Debug, PartialEq)]
4950pub struct FileExportOpts {
4951    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
4952    #[builder(setter(into, strip_option), default)]
4953    pub allow_parent_dir_path: Option<bool>,
4954}
4955impl File {
4956    /// Retrieves the contents of the file.
4957    pub async fn contents(&self) -> Result<String, DaggerError> {
4958        let query = self.selection.select("contents");
4959        query.execute(self.graphql_client.clone()).await
4960    }
4961    /// 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.
4962    ///
4963    /// # Arguments
4964    ///
4965    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4966    pub async fn digest(&self) -> Result<String, DaggerError> {
4967        let query = self.selection.select("digest");
4968        query.execute(self.graphql_client.clone()).await
4969    }
4970    /// 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.
4971    ///
4972    /// # Arguments
4973    ///
4974    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4975    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
4976        let mut query = self.selection.select("digest");
4977        if let Some(exclude_metadata) = opts.exclude_metadata {
4978            query = query.arg("excludeMetadata", exclude_metadata);
4979        }
4980        query.execute(self.graphql_client.clone()).await
4981    }
4982    /// Writes the file to a file path on the host.
4983    ///
4984    /// # Arguments
4985    ///
4986    /// * `path` - Location of the written directory (e.g., "output.txt").
4987    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4988    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4989        let mut query = self.selection.select("export");
4990        query = query.arg("path", path.into());
4991        query.execute(self.graphql_client.clone()).await
4992    }
4993    /// Writes the file to a file path on the host.
4994    ///
4995    /// # Arguments
4996    ///
4997    /// * `path` - Location of the written directory (e.g., "output.txt").
4998    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4999    pub async fn export_opts(
5000        &self,
5001        path: impl Into<String>,
5002        opts: FileExportOpts,
5003    ) -> Result<String, DaggerError> {
5004        let mut query = self.selection.select("export");
5005        query = query.arg("path", path.into());
5006        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
5007            query = query.arg("allowParentDirPath", allow_parent_dir_path);
5008        }
5009        query.execute(self.graphql_client.clone()).await
5010    }
5011    /// A unique identifier for this File.
5012    pub async fn id(&self) -> Result<FileId, DaggerError> {
5013        let query = self.selection.select("id");
5014        query.execute(self.graphql_client.clone()).await
5015    }
5016    /// Retrieves the name of the file.
5017    pub async fn name(&self) -> Result<String, DaggerError> {
5018        let query = self.selection.select("name");
5019        query.execute(self.graphql_client.clone()).await
5020    }
5021    /// Retrieves the size of the file, in bytes.
5022    pub async fn size(&self) -> Result<isize, DaggerError> {
5023        let query = self.selection.select("size");
5024        query.execute(self.graphql_client.clone()).await
5025    }
5026    /// Force evaluation in the engine.
5027    pub async fn sync(&self) -> Result<FileId, DaggerError> {
5028        let query = self.selection.select("sync");
5029        query.execute(self.graphql_client.clone()).await
5030    }
5031    /// Retrieves this file with its name set to the given name.
5032    ///
5033    /// # Arguments
5034    ///
5035    /// * `name` - Name to set file to.
5036    pub fn with_name(&self, name: impl Into<String>) -> File {
5037        let mut query = self.selection.select("withName");
5038        query = query.arg("name", name.into());
5039        File {
5040            proc: self.proc.clone(),
5041            selection: query,
5042            graphql_client: self.graphql_client.clone(),
5043        }
5044    }
5045    /// Retrieves this file with its created/modified timestamps set to the given time.
5046    ///
5047    /// # Arguments
5048    ///
5049    /// * `timestamp` - Timestamp to set dir/files in.
5050    ///
5051    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
5052    pub fn with_timestamps(&self, timestamp: isize) -> File {
5053        let mut query = self.selection.select("withTimestamps");
5054        query = query.arg("timestamp", timestamp);
5055        File {
5056            proc: self.proc.clone(),
5057            selection: query,
5058            graphql_client: self.graphql_client.clone(),
5059        }
5060    }
5061}
5062#[derive(Clone)]
5063pub struct Function {
5064    pub proc: Option<Arc<DaggerSessionProc>>,
5065    pub selection: Selection,
5066    pub graphql_client: DynGraphQLClient,
5067}
5068#[derive(Builder, Debug, PartialEq)]
5069pub struct FunctionWithArgOpts<'a> {
5070    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
5071    #[builder(setter(into, strip_option), default)]
5072    pub default_path: Option<&'a str>,
5073    /// A default value to use for this argument if not explicitly set by the caller, if any
5074    #[builder(setter(into, strip_option), default)]
5075    pub default_value: Option<Json>,
5076    /// A doc string for the argument, if any
5077    #[builder(setter(into, strip_option), default)]
5078    pub description: Option<&'a str>,
5079    /// Patterns to ignore when loading the contextual argument value.
5080    #[builder(setter(into, strip_option), default)]
5081    pub ignore: Option<Vec<&'a str>>,
5082    #[builder(setter(into, strip_option), default)]
5083    pub source_map: Option<SourceMapId>,
5084}
5085impl Function {
5086    /// Arguments accepted by the function, if any.
5087    pub fn args(&self) -> Vec<FunctionArg> {
5088        let query = self.selection.select("args");
5089        vec![FunctionArg {
5090            proc: self.proc.clone(),
5091            selection: query,
5092            graphql_client: self.graphql_client.clone(),
5093        }]
5094    }
5095    /// A doc string for the function, if any.
5096    pub async fn description(&self) -> Result<String, DaggerError> {
5097        let query = self.selection.select("description");
5098        query.execute(self.graphql_client.clone()).await
5099    }
5100    /// A unique identifier for this Function.
5101    pub async fn id(&self) -> Result<FunctionId, DaggerError> {
5102        let query = self.selection.select("id");
5103        query.execute(self.graphql_client.clone()).await
5104    }
5105    /// The name of the function.
5106    pub async fn name(&self) -> Result<String, DaggerError> {
5107        let query = self.selection.select("name");
5108        query.execute(self.graphql_client.clone()).await
5109    }
5110    /// The type returned by the function.
5111    pub fn return_type(&self) -> TypeDef {
5112        let query = self.selection.select("returnType");
5113        TypeDef {
5114            proc: self.proc.clone(),
5115            selection: query,
5116            graphql_client: self.graphql_client.clone(),
5117        }
5118    }
5119    /// The location of this function declaration.
5120    pub fn source_map(&self) -> SourceMap {
5121        let query = self.selection.select("sourceMap");
5122        SourceMap {
5123            proc: self.proc.clone(),
5124            selection: query,
5125            graphql_client: self.graphql_client.clone(),
5126        }
5127    }
5128    /// Returns the function with the provided argument
5129    ///
5130    /// # Arguments
5131    ///
5132    /// * `name` - The name of the argument
5133    /// * `type_def` - The type of the argument
5134    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5135    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
5136        let mut query = self.selection.select("withArg");
5137        query = query.arg("name", name.into());
5138        query = query.arg_lazy(
5139            "typeDef",
5140            Box::new(move || {
5141                let type_def = type_def.clone();
5142                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
5143            }),
5144        );
5145        Function {
5146            proc: self.proc.clone(),
5147            selection: query,
5148            graphql_client: self.graphql_client.clone(),
5149        }
5150    }
5151    /// Returns the function with the provided argument
5152    ///
5153    /// # Arguments
5154    ///
5155    /// * `name` - The name of the argument
5156    /// * `type_def` - The type of the argument
5157    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5158    pub fn with_arg_opts<'a>(
5159        &self,
5160        name: impl Into<String>,
5161        type_def: impl IntoID<TypeDefId>,
5162        opts: FunctionWithArgOpts<'a>,
5163    ) -> Function {
5164        let mut query = self.selection.select("withArg");
5165        query = query.arg("name", name.into());
5166        query = query.arg_lazy(
5167            "typeDef",
5168            Box::new(move || {
5169                let type_def = type_def.clone();
5170                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
5171            }),
5172        );
5173        if let Some(description) = opts.description {
5174            query = query.arg("description", description);
5175        }
5176        if let Some(default_value) = opts.default_value {
5177            query = query.arg("defaultValue", default_value);
5178        }
5179        if let Some(default_path) = opts.default_path {
5180            query = query.arg("defaultPath", default_path);
5181        }
5182        if let Some(ignore) = opts.ignore {
5183            query = query.arg("ignore", ignore);
5184        }
5185        if let Some(source_map) = opts.source_map {
5186            query = query.arg("sourceMap", source_map);
5187        }
5188        Function {
5189            proc: self.proc.clone(),
5190            selection: query,
5191            graphql_client: self.graphql_client.clone(),
5192        }
5193    }
5194    /// Returns the function with the given doc string.
5195    ///
5196    /// # Arguments
5197    ///
5198    /// * `description` - The doc string to set.
5199    pub fn with_description(&self, description: impl Into<String>) -> Function {
5200        let mut query = self.selection.select("withDescription");
5201        query = query.arg("description", description.into());
5202        Function {
5203            proc: self.proc.clone(),
5204            selection: query,
5205            graphql_client: self.graphql_client.clone(),
5206        }
5207    }
5208    /// Returns the function with the given source map.
5209    ///
5210    /// # Arguments
5211    ///
5212    /// * `source_map` - The source map for the function definition.
5213    pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
5214        let mut query = self.selection.select("withSourceMap");
5215        query = query.arg_lazy(
5216            "sourceMap",
5217            Box::new(move || {
5218                let source_map = source_map.clone();
5219                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
5220            }),
5221        );
5222        Function {
5223            proc: self.proc.clone(),
5224            selection: query,
5225            graphql_client: self.graphql_client.clone(),
5226        }
5227    }
5228}
5229#[derive(Clone)]
5230pub struct FunctionArg {
5231    pub proc: Option<Arc<DaggerSessionProc>>,
5232    pub selection: Selection,
5233    pub graphql_client: DynGraphQLClient,
5234}
5235impl FunctionArg {
5236    /// 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
5237    pub async fn default_path(&self) -> Result<String, DaggerError> {
5238        let query = self.selection.select("defaultPath");
5239        query.execute(self.graphql_client.clone()).await
5240    }
5241    /// A default value to use for this argument when not explicitly set by the caller, if any.
5242    pub async fn default_value(&self) -> Result<Json, DaggerError> {
5243        let query = self.selection.select("defaultValue");
5244        query.execute(self.graphql_client.clone()).await
5245    }
5246    /// A doc string for the argument, if any.
5247    pub async fn description(&self) -> Result<String, DaggerError> {
5248        let query = self.selection.select("description");
5249        query.execute(self.graphql_client.clone()).await
5250    }
5251    /// A unique identifier for this FunctionArg.
5252    pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
5253        let query = self.selection.select("id");
5254        query.execute(self.graphql_client.clone()).await
5255    }
5256    /// 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.
5257    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
5258        let query = self.selection.select("ignore");
5259        query.execute(self.graphql_client.clone()).await
5260    }
5261    /// The name of the argument in lowerCamelCase format.
5262    pub async fn name(&self) -> Result<String, DaggerError> {
5263        let query = self.selection.select("name");
5264        query.execute(self.graphql_client.clone()).await
5265    }
5266    /// The location of this arg declaration.
5267    pub fn source_map(&self) -> SourceMap {
5268        let query = self.selection.select("sourceMap");
5269        SourceMap {
5270            proc: self.proc.clone(),
5271            selection: query,
5272            graphql_client: self.graphql_client.clone(),
5273        }
5274    }
5275    /// The type of the argument.
5276    pub fn type_def(&self) -> TypeDef {
5277        let query = self.selection.select("typeDef");
5278        TypeDef {
5279            proc: self.proc.clone(),
5280            selection: query,
5281            graphql_client: self.graphql_client.clone(),
5282        }
5283    }
5284}
5285#[derive(Clone)]
5286pub struct FunctionCall {
5287    pub proc: Option<Arc<DaggerSessionProc>>,
5288    pub selection: Selection,
5289    pub graphql_client: DynGraphQLClient,
5290}
5291impl FunctionCall {
5292    /// A unique identifier for this FunctionCall.
5293    pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
5294        let query = self.selection.select("id");
5295        query.execute(self.graphql_client.clone()).await
5296    }
5297    /// The argument values the function is being invoked with.
5298    pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
5299        let query = self.selection.select("inputArgs");
5300        vec![FunctionCallArgValue {
5301            proc: self.proc.clone(),
5302            selection: query,
5303            graphql_client: self.graphql_client.clone(),
5304        }]
5305    }
5306    /// The name of the function being called.
5307    pub async fn name(&self) -> Result<String, DaggerError> {
5308        let query = self.selection.select("name");
5309        query.execute(self.graphql_client.clone()).await
5310    }
5311    /// 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.
5312    pub async fn parent(&self) -> Result<Json, DaggerError> {
5313        let query = self.selection.select("parent");
5314        query.execute(self.graphql_client.clone()).await
5315    }
5316    /// 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.
5317    pub async fn parent_name(&self) -> Result<String, DaggerError> {
5318        let query = self.selection.select("parentName");
5319        query.execute(self.graphql_client.clone()).await
5320    }
5321    /// Return an error from the function.
5322    ///
5323    /// # Arguments
5324    ///
5325    /// * `error` - The error to return.
5326    pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
5327        let mut query = self.selection.select("returnError");
5328        query = query.arg_lazy(
5329            "error",
5330            Box::new(move || {
5331                let error = error.clone();
5332                Box::pin(async move { error.into_id().await.unwrap().quote() })
5333            }),
5334        );
5335        query.execute(self.graphql_client.clone()).await
5336    }
5337    /// Set the return value of the function call to the provided value.
5338    ///
5339    /// # Arguments
5340    ///
5341    /// * `value` - JSON serialization of the return value.
5342    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
5343        let mut query = self.selection.select("returnValue");
5344        query = query.arg("value", value);
5345        query.execute(self.graphql_client.clone()).await
5346    }
5347}
5348#[derive(Clone)]
5349pub struct FunctionCallArgValue {
5350    pub proc: Option<Arc<DaggerSessionProc>>,
5351    pub selection: Selection,
5352    pub graphql_client: DynGraphQLClient,
5353}
5354impl FunctionCallArgValue {
5355    /// A unique identifier for this FunctionCallArgValue.
5356    pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
5357        let query = self.selection.select("id");
5358        query.execute(self.graphql_client.clone()).await
5359    }
5360    /// The name of the argument.
5361    pub async fn name(&self) -> Result<String, DaggerError> {
5362        let query = self.selection.select("name");
5363        query.execute(self.graphql_client.clone()).await
5364    }
5365    /// The value of the argument represented as a JSON serialized string.
5366    pub async fn value(&self) -> Result<Json, DaggerError> {
5367        let query = self.selection.select("value");
5368        query.execute(self.graphql_client.clone()).await
5369    }
5370}
5371#[derive(Clone)]
5372pub struct GeneratedCode {
5373    pub proc: Option<Arc<DaggerSessionProc>>,
5374    pub selection: Selection,
5375    pub graphql_client: DynGraphQLClient,
5376}
5377impl GeneratedCode {
5378    /// The directory containing the generated code.
5379    pub fn code(&self) -> Directory {
5380        let query = self.selection.select("code");
5381        Directory {
5382            proc: self.proc.clone(),
5383            selection: query,
5384            graphql_client: self.graphql_client.clone(),
5385        }
5386    }
5387    /// A unique identifier for this GeneratedCode.
5388    pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
5389        let query = self.selection.select("id");
5390        query.execute(self.graphql_client.clone()).await
5391    }
5392    /// List of paths to mark generated in version control (i.e. .gitattributes).
5393    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
5394        let query = self.selection.select("vcsGeneratedPaths");
5395        query.execute(self.graphql_client.clone()).await
5396    }
5397    /// List of paths to ignore in version control (i.e. .gitignore).
5398    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
5399        let query = self.selection.select("vcsIgnoredPaths");
5400        query.execute(self.graphql_client.clone()).await
5401    }
5402    /// Set the list of paths to mark generated in version control.
5403    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
5404        let mut query = self.selection.select("withVCSGeneratedPaths");
5405        query = query.arg(
5406            "paths",
5407            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5408        );
5409        GeneratedCode {
5410            proc: self.proc.clone(),
5411            selection: query,
5412            graphql_client: self.graphql_client.clone(),
5413        }
5414    }
5415    /// Set the list of paths to ignore in version control.
5416    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
5417        let mut query = self.selection.select("withVCSIgnoredPaths");
5418        query = query.arg(
5419            "paths",
5420            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5421        );
5422        GeneratedCode {
5423            proc: self.proc.clone(),
5424            selection: query,
5425            graphql_client: self.graphql_client.clone(),
5426        }
5427    }
5428}
5429#[derive(Clone)]
5430pub struct GitRef {
5431    pub proc: Option<Arc<DaggerSessionProc>>,
5432    pub selection: Selection,
5433    pub graphql_client: DynGraphQLClient,
5434}
5435#[derive(Builder, Debug, PartialEq)]
5436pub struct GitRefTreeOpts {
5437    /// Set to true to discard .git directory.
5438    #[builder(setter(into, strip_option), default)]
5439    pub discard_git_dir: Option<bool>,
5440}
5441impl GitRef {
5442    /// The resolved commit id at this ref.
5443    pub async fn commit(&self) -> Result<String, DaggerError> {
5444        let query = self.selection.select("commit");
5445        query.execute(self.graphql_client.clone()).await
5446    }
5447    /// A unique identifier for this GitRef.
5448    pub async fn id(&self) -> Result<GitRefId, DaggerError> {
5449        let query = self.selection.select("id");
5450        query.execute(self.graphql_client.clone()).await
5451    }
5452    /// The filesystem tree at this ref.
5453    ///
5454    /// # Arguments
5455    ///
5456    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5457    pub fn tree(&self) -> Directory {
5458        let query = self.selection.select("tree");
5459        Directory {
5460            proc: self.proc.clone(),
5461            selection: query,
5462            graphql_client: self.graphql_client.clone(),
5463        }
5464    }
5465    /// The filesystem tree at this ref.
5466    ///
5467    /// # Arguments
5468    ///
5469    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5470    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
5471        let mut query = self.selection.select("tree");
5472        if let Some(discard_git_dir) = opts.discard_git_dir {
5473            query = query.arg("discardGitDir", discard_git_dir);
5474        }
5475        Directory {
5476            proc: self.proc.clone(),
5477            selection: query,
5478            graphql_client: self.graphql_client.clone(),
5479        }
5480    }
5481}
5482#[derive(Clone)]
5483pub struct GitRepository {
5484    pub proc: Option<Arc<DaggerSessionProc>>,
5485    pub selection: Selection,
5486    pub graphql_client: DynGraphQLClient,
5487}
5488#[derive(Builder, Debug, PartialEq)]
5489pub struct GitRepositoryTagsOpts<'a> {
5490    /// Glob patterns (e.g., "refs/tags/v*").
5491    #[builder(setter(into, strip_option), default)]
5492    pub patterns: Option<Vec<&'a str>>,
5493}
5494impl GitRepository {
5495    /// Returns details of a branch.
5496    ///
5497    /// # Arguments
5498    ///
5499    /// * `name` - Branch's name (e.g., "main").
5500    pub fn branch(&self, name: impl Into<String>) -> GitRef {
5501        let mut query = self.selection.select("branch");
5502        query = query.arg("name", name.into());
5503        GitRef {
5504            proc: self.proc.clone(),
5505            selection: query,
5506            graphql_client: self.graphql_client.clone(),
5507        }
5508    }
5509    /// Returns details of a commit.
5510    ///
5511    /// # Arguments
5512    ///
5513    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
5514    pub fn commit(&self, id: impl Into<String>) -> GitRef {
5515        let mut query = self.selection.select("commit");
5516        query = query.arg("id", id.into());
5517        GitRef {
5518            proc: self.proc.clone(),
5519            selection: query,
5520            graphql_client: self.graphql_client.clone(),
5521        }
5522    }
5523    /// Returns details for HEAD.
5524    pub fn head(&self) -> GitRef {
5525        let query = self.selection.select("head");
5526        GitRef {
5527            proc: self.proc.clone(),
5528            selection: query,
5529            graphql_client: self.graphql_client.clone(),
5530        }
5531    }
5532    /// A unique identifier for this GitRepository.
5533    pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
5534        let query = self.selection.select("id");
5535        query.execute(self.graphql_client.clone()).await
5536    }
5537    /// Returns details of a ref.
5538    ///
5539    /// # Arguments
5540    ///
5541    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
5542    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
5543        let mut query = self.selection.select("ref");
5544        query = query.arg("name", name.into());
5545        GitRef {
5546            proc: self.proc.clone(),
5547            selection: query,
5548            graphql_client: self.graphql_client.clone(),
5549        }
5550    }
5551    /// Returns details of a tag.
5552    ///
5553    /// # Arguments
5554    ///
5555    /// * `name` - Tag's name (e.g., "v0.3.9").
5556    pub fn tag(&self, name: impl Into<String>) -> GitRef {
5557        let mut query = self.selection.select("tag");
5558        query = query.arg("name", name.into());
5559        GitRef {
5560            proc: self.proc.clone(),
5561            selection: query,
5562            graphql_client: self.graphql_client.clone(),
5563        }
5564    }
5565    /// tags that match any of the given glob patterns.
5566    ///
5567    /// # Arguments
5568    ///
5569    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5570    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
5571        let query = self.selection.select("tags");
5572        query.execute(self.graphql_client.clone()).await
5573    }
5574    /// tags that match any of the given glob patterns.
5575    ///
5576    /// # Arguments
5577    ///
5578    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5579    pub async fn tags_opts<'a>(
5580        &self,
5581        opts: GitRepositoryTagsOpts<'a>,
5582    ) -> Result<Vec<String>, DaggerError> {
5583        let mut query = self.selection.select("tags");
5584        if let Some(patterns) = opts.patterns {
5585            query = query.arg("patterns", patterns);
5586        }
5587        query.execute(self.graphql_client.clone()).await
5588    }
5589    /// Header to authenticate the remote with.
5590    ///
5591    /// # Arguments
5592    ///
5593    /// * `header` - Secret used to populate the Authorization HTTP header
5594    pub fn with_auth_header(&self, header: impl IntoID<SecretId>) -> GitRepository {
5595        let mut query = self.selection.select("withAuthHeader");
5596        query = query.arg_lazy(
5597            "header",
5598            Box::new(move || {
5599                let header = header.clone();
5600                Box::pin(async move { header.into_id().await.unwrap().quote() })
5601            }),
5602        );
5603        GitRepository {
5604            proc: self.proc.clone(),
5605            selection: query,
5606            graphql_client: self.graphql_client.clone(),
5607        }
5608    }
5609    /// Token to authenticate the remote with.
5610    ///
5611    /// # Arguments
5612    ///
5613    /// * `token` - Secret used to populate the password during basic HTTP Authorization
5614    pub fn with_auth_token(&self, token: impl IntoID<SecretId>) -> GitRepository {
5615        let mut query = self.selection.select("withAuthToken");
5616        query = query.arg_lazy(
5617            "token",
5618            Box::new(move || {
5619                let token = token.clone();
5620                Box::pin(async move { token.into_id().await.unwrap().quote() })
5621            }),
5622        );
5623        GitRepository {
5624            proc: self.proc.clone(),
5625            selection: query,
5626            graphql_client: self.graphql_client.clone(),
5627        }
5628    }
5629}
5630#[derive(Clone)]
5631pub struct Host {
5632    pub proc: Option<Arc<DaggerSessionProc>>,
5633    pub selection: Selection,
5634    pub graphql_client: DynGraphQLClient,
5635}
5636#[derive(Builder, Debug, PartialEq)]
5637pub struct HostDirectoryOpts<'a> {
5638    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
5639    #[builder(setter(into, strip_option), default)]
5640    pub exclude: Option<Vec<&'a str>>,
5641    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
5642    #[builder(setter(into, strip_option), default)]
5643    pub include: Option<Vec<&'a str>>,
5644}
5645#[derive(Builder, Debug, PartialEq)]
5646pub struct HostServiceOpts<'a> {
5647    /// Upstream host to forward traffic to.
5648    #[builder(setter(into, strip_option), default)]
5649    pub host: Option<&'a str>,
5650}
5651#[derive(Builder, Debug, PartialEq)]
5652pub struct HostTunnelOpts {
5653    /// Map each service port to the same port on the host, as if the service were running natively.
5654    /// Note: enabling may result in port conflicts.
5655    #[builder(setter(into, strip_option), default)]
5656    pub native: Option<bool>,
5657    /// Configure explicit port forwarding rules for the tunnel.
5658    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
5659    /// 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.
5660    /// If ports are given and native is true, the ports are additive.
5661    #[builder(setter(into, strip_option), default)]
5662    pub ports: Option<Vec<PortForward>>,
5663}
5664impl Host {
5665    /// Accesses a directory on the host.
5666    ///
5667    /// # Arguments
5668    ///
5669    /// * `path` - Location of the directory to access (e.g., ".").
5670    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5671    pub fn directory(&self, path: impl Into<String>) -> Directory {
5672        let mut query = self.selection.select("directory");
5673        query = query.arg("path", path.into());
5674        Directory {
5675            proc: self.proc.clone(),
5676            selection: query,
5677            graphql_client: self.graphql_client.clone(),
5678        }
5679    }
5680    /// Accesses a directory on the host.
5681    ///
5682    /// # Arguments
5683    ///
5684    /// * `path` - Location of the directory to access (e.g., ".").
5685    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5686    pub fn directory_opts<'a>(
5687        &self,
5688        path: impl Into<String>,
5689        opts: HostDirectoryOpts<'a>,
5690    ) -> Directory {
5691        let mut query = self.selection.select("directory");
5692        query = query.arg("path", path.into());
5693        if let Some(exclude) = opts.exclude {
5694            query = query.arg("exclude", exclude);
5695        }
5696        if let Some(include) = opts.include {
5697            query = query.arg("include", include);
5698        }
5699        Directory {
5700            proc: self.proc.clone(),
5701            selection: query,
5702            graphql_client: self.graphql_client.clone(),
5703        }
5704    }
5705    /// Accesses a file on the host.
5706    ///
5707    /// # Arguments
5708    ///
5709    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5710    pub fn file(&self, path: impl Into<String>) -> File {
5711        let mut query = self.selection.select("file");
5712        query = query.arg("path", path.into());
5713        File {
5714            proc: self.proc.clone(),
5715            selection: query,
5716            graphql_client: self.graphql_client.clone(),
5717        }
5718    }
5719    /// A unique identifier for this Host.
5720    pub async fn id(&self) -> Result<HostId, DaggerError> {
5721        let query = self.selection.select("id");
5722        query.execute(self.graphql_client.clone()).await
5723    }
5724    /// Creates a service that forwards traffic to a specified address via the host.
5725    ///
5726    /// # Arguments
5727    ///
5728    /// * `ports` - Ports to expose via the service, forwarding through the host network.
5729    ///
5730    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
5731    ///
5732    /// An empty set of ports is not valid; an error will be returned.
5733    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5734    pub fn service(&self, ports: Vec<PortForward>) -> Service {
5735        let mut query = self.selection.select("service");
5736        query = query.arg("ports", ports);
5737        Service {
5738            proc: self.proc.clone(),
5739            selection: query,
5740            graphql_client: self.graphql_client.clone(),
5741        }
5742    }
5743    /// Creates a service that forwards traffic to a specified address via the host.
5744    ///
5745    /// # Arguments
5746    ///
5747    /// * `ports` - Ports to expose via the service, forwarding through the host network.
5748    ///
5749    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
5750    ///
5751    /// An empty set of ports is not valid; an error will be returned.
5752    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5753    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
5754        let mut query = self.selection.select("service");
5755        query = query.arg("ports", ports);
5756        if let Some(host) = opts.host {
5757            query = query.arg("host", host);
5758        }
5759        Service {
5760            proc: self.proc.clone(),
5761            selection: query,
5762            graphql_client: self.graphql_client.clone(),
5763        }
5764    }
5765    /// Sets a secret given a user-defined name and the file path on the host, and returns the secret.
5766    /// The file is limited to a size of 512000 bytes.
5767    ///
5768    /// # Arguments
5769    ///
5770    /// * `name` - The user defined name for this secret.
5771    /// * `path` - Location of the file to set as a secret.
5772    pub fn set_secret_file(&self, name: impl Into<String>, path: impl Into<String>) -> Secret {
5773        let mut query = self.selection.select("setSecretFile");
5774        query = query.arg("name", name.into());
5775        query = query.arg("path", path.into());
5776        Secret {
5777            proc: self.proc.clone(),
5778            selection: query,
5779            graphql_client: self.graphql_client.clone(),
5780        }
5781    }
5782    /// Creates a tunnel that forwards traffic from the host to a service.
5783    ///
5784    /// # Arguments
5785    ///
5786    /// * `service` - Service to send traffic from the tunnel.
5787    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5788    pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
5789        let mut query = self.selection.select("tunnel");
5790        query = query.arg_lazy(
5791            "service",
5792            Box::new(move || {
5793                let service = service.clone();
5794                Box::pin(async move { service.into_id().await.unwrap().quote() })
5795            }),
5796        );
5797        Service {
5798            proc: self.proc.clone(),
5799            selection: query,
5800            graphql_client: self.graphql_client.clone(),
5801        }
5802    }
5803    /// Creates a tunnel that forwards traffic from the host to a service.
5804    ///
5805    /// # Arguments
5806    ///
5807    /// * `service` - Service to send traffic from the tunnel.
5808    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5809    pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
5810        let mut query = self.selection.select("tunnel");
5811        query = query.arg_lazy(
5812            "service",
5813            Box::new(move || {
5814                let service = service.clone();
5815                Box::pin(async move { service.into_id().await.unwrap().quote() })
5816            }),
5817        );
5818        if let Some(ports) = opts.ports {
5819            query = query.arg("ports", ports);
5820        }
5821        if let Some(native) = opts.native {
5822            query = query.arg("native", native);
5823        }
5824        Service {
5825            proc: self.proc.clone(),
5826            selection: query,
5827            graphql_client: self.graphql_client.clone(),
5828        }
5829    }
5830    /// Accesses a Unix socket on the host.
5831    ///
5832    /// # Arguments
5833    ///
5834    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
5835    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
5836        let mut query = self.selection.select("unixSocket");
5837        query = query.arg("path", path.into());
5838        Socket {
5839            proc: self.proc.clone(),
5840            selection: query,
5841            graphql_client: self.graphql_client.clone(),
5842        }
5843    }
5844}
5845#[derive(Clone)]
5846pub struct InputTypeDef {
5847    pub proc: Option<Arc<DaggerSessionProc>>,
5848    pub selection: Selection,
5849    pub graphql_client: DynGraphQLClient,
5850}
5851impl InputTypeDef {
5852    /// Static fields defined on this input object, if any.
5853    pub fn fields(&self) -> Vec<FieldTypeDef> {
5854        let query = self.selection.select("fields");
5855        vec![FieldTypeDef {
5856            proc: self.proc.clone(),
5857            selection: query,
5858            graphql_client: self.graphql_client.clone(),
5859        }]
5860    }
5861    /// A unique identifier for this InputTypeDef.
5862    pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
5863        let query = self.selection.select("id");
5864        query.execute(self.graphql_client.clone()).await
5865    }
5866    /// The name of the input object.
5867    pub async fn name(&self) -> Result<String, DaggerError> {
5868        let query = self.selection.select("name");
5869        query.execute(self.graphql_client.clone()).await
5870    }
5871}
5872#[derive(Clone)]
5873pub struct InterfaceTypeDef {
5874    pub proc: Option<Arc<DaggerSessionProc>>,
5875    pub selection: Selection,
5876    pub graphql_client: DynGraphQLClient,
5877}
5878impl InterfaceTypeDef {
5879    /// The doc string for the interface, if any.
5880    pub async fn description(&self) -> Result<String, DaggerError> {
5881        let query = self.selection.select("description");
5882        query.execute(self.graphql_client.clone()).await
5883    }
5884    /// Functions defined on this interface, if any.
5885    pub fn functions(&self) -> Vec<Function> {
5886        let query = self.selection.select("functions");
5887        vec![Function {
5888            proc: self.proc.clone(),
5889            selection: query,
5890            graphql_client: self.graphql_client.clone(),
5891        }]
5892    }
5893    /// A unique identifier for this InterfaceTypeDef.
5894    pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
5895        let query = self.selection.select("id");
5896        query.execute(self.graphql_client.clone()).await
5897    }
5898    /// The name of the interface.
5899    pub async fn name(&self) -> Result<String, DaggerError> {
5900        let query = self.selection.select("name");
5901        query.execute(self.graphql_client.clone()).await
5902    }
5903    /// The location of this interface declaration.
5904    pub fn source_map(&self) -> SourceMap {
5905        let query = self.selection.select("sourceMap");
5906        SourceMap {
5907            proc: self.proc.clone(),
5908            selection: query,
5909            graphql_client: self.graphql_client.clone(),
5910        }
5911    }
5912    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
5913    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
5914        let query = self.selection.select("sourceModuleName");
5915        query.execute(self.graphql_client.clone()).await
5916    }
5917}
5918#[derive(Clone)]
5919pub struct Label {
5920    pub proc: Option<Arc<DaggerSessionProc>>,
5921    pub selection: Selection,
5922    pub graphql_client: DynGraphQLClient,
5923}
5924impl Label {
5925    /// A unique identifier for this Label.
5926    pub async fn id(&self) -> Result<LabelId, DaggerError> {
5927        let query = self.selection.select("id");
5928        query.execute(self.graphql_client.clone()).await
5929    }
5930    /// The label name.
5931    pub async fn name(&self) -> Result<String, DaggerError> {
5932        let query = self.selection.select("name");
5933        query.execute(self.graphql_client.clone()).await
5934    }
5935    /// The label value.
5936    pub async fn value(&self) -> Result<String, DaggerError> {
5937        let query = self.selection.select("value");
5938        query.execute(self.graphql_client.clone()).await
5939    }
5940}
5941#[derive(Clone)]
5942pub struct ListTypeDef {
5943    pub proc: Option<Arc<DaggerSessionProc>>,
5944    pub selection: Selection,
5945    pub graphql_client: DynGraphQLClient,
5946}
5947impl ListTypeDef {
5948    /// The type of the elements in the list.
5949    pub fn element_type_def(&self) -> TypeDef {
5950        let query = self.selection.select("elementTypeDef");
5951        TypeDef {
5952            proc: self.proc.clone(),
5953            selection: query,
5954            graphql_client: self.graphql_client.clone(),
5955        }
5956    }
5957    /// A unique identifier for this ListTypeDef.
5958    pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
5959        let query = self.selection.select("id");
5960        query.execute(self.graphql_client.clone()).await
5961    }
5962}
5963#[derive(Clone)]
5964pub struct Module {
5965    pub proc: Option<Arc<DaggerSessionProc>>,
5966    pub selection: Selection,
5967    pub graphql_client: DynGraphQLClient,
5968}
5969impl Module {
5970    /// The dependencies of the module.
5971    pub fn dependencies(&self) -> Vec<Module> {
5972        let query = self.selection.select("dependencies");
5973        vec![Module {
5974            proc: self.proc.clone(),
5975            selection: query,
5976            graphql_client: self.graphql_client.clone(),
5977        }]
5978    }
5979    /// The doc string of the module, if any
5980    pub async fn description(&self) -> Result<String, DaggerError> {
5981        let query = self.selection.select("description");
5982        query.execute(self.graphql_client.clone()).await
5983    }
5984    /// Enumerations served by this module.
5985    pub fn enums(&self) -> Vec<TypeDef> {
5986        let query = self.selection.select("enums");
5987        vec![TypeDef {
5988            proc: self.proc.clone(),
5989            selection: query,
5990            graphql_client: self.graphql_client.clone(),
5991        }]
5992    }
5993    /// The generated files and directories made on top of the module source's context directory.
5994    pub fn generated_context_directory(&self) -> Directory {
5995        let query = self.selection.select("generatedContextDirectory");
5996        Directory {
5997            proc: self.proc.clone(),
5998            selection: query,
5999            graphql_client: self.graphql_client.clone(),
6000        }
6001    }
6002    /// A unique identifier for this Module.
6003    pub async fn id(&self) -> Result<ModuleId, DaggerError> {
6004        let query = self.selection.select("id");
6005        query.execute(self.graphql_client.clone()).await
6006    }
6007    /// Interfaces served by this module.
6008    pub fn interfaces(&self) -> Vec<TypeDef> {
6009        let query = self.selection.select("interfaces");
6010        vec![TypeDef {
6011            proc: self.proc.clone(),
6012            selection: query,
6013            graphql_client: self.graphql_client.clone(),
6014        }]
6015    }
6016    /// The name of the module
6017    pub async fn name(&self) -> Result<String, DaggerError> {
6018        let query = self.selection.select("name");
6019        query.execute(self.graphql_client.clone()).await
6020    }
6021    /// Objects served by this module.
6022    pub fn objects(&self) -> Vec<TypeDef> {
6023        let query = self.selection.select("objects");
6024        vec![TypeDef {
6025            proc: self.proc.clone(),
6026            selection: query,
6027            graphql_client: self.graphql_client.clone(),
6028        }]
6029    }
6030    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
6031    pub fn runtime(&self) -> Container {
6032        let query = self.selection.select("runtime");
6033        Container {
6034            proc: self.proc.clone(),
6035            selection: query,
6036            graphql_client: self.graphql_client.clone(),
6037        }
6038    }
6039    /// The SDK config used by this module.
6040    pub fn sdk(&self) -> SdkConfig {
6041        let query = self.selection.select("sdk");
6042        SdkConfig {
6043            proc: self.proc.clone(),
6044            selection: query,
6045            graphql_client: self.graphql_client.clone(),
6046        }
6047    }
6048    /// Serve a module's API in the current session.
6049    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
6050    pub async fn serve(&self) -> Result<Void, DaggerError> {
6051        let query = self.selection.select("serve");
6052        query.execute(self.graphql_client.clone()).await
6053    }
6054    /// The source for the module.
6055    pub fn source(&self) -> ModuleSource {
6056        let query = self.selection.select("source");
6057        ModuleSource {
6058            proc: self.proc.clone(),
6059            selection: query,
6060            graphql_client: self.graphql_client.clone(),
6061        }
6062    }
6063    /// Forces evaluation of the module, including any loading into the engine and associated validation.
6064    pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
6065        let query = self.selection.select("sync");
6066        query.execute(self.graphql_client.clone()).await
6067    }
6068    /// Retrieves the module with the given description
6069    ///
6070    /// # Arguments
6071    ///
6072    /// * `description` - The description to set
6073    pub fn with_description(&self, description: impl Into<String>) -> Module {
6074        let mut query = self.selection.select("withDescription");
6075        query = query.arg("description", description.into());
6076        Module {
6077            proc: self.proc.clone(),
6078            selection: query,
6079            graphql_client: self.graphql_client.clone(),
6080        }
6081    }
6082    /// This module plus the given Enum type and associated values
6083    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
6084        let mut query = self.selection.select("withEnum");
6085        query = query.arg_lazy(
6086            "enum",
6087            Box::new(move || {
6088                let r#enum = r#enum.clone();
6089                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
6090            }),
6091        );
6092        Module {
6093            proc: self.proc.clone(),
6094            selection: query,
6095            graphql_client: self.graphql_client.clone(),
6096        }
6097    }
6098    /// This module plus the given Interface type and associated functions
6099    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
6100        let mut query = self.selection.select("withInterface");
6101        query = query.arg_lazy(
6102            "iface",
6103            Box::new(move || {
6104                let iface = iface.clone();
6105                Box::pin(async move { iface.into_id().await.unwrap().quote() })
6106            }),
6107        );
6108        Module {
6109            proc: self.proc.clone(),
6110            selection: query,
6111            graphql_client: self.graphql_client.clone(),
6112        }
6113    }
6114    /// This module plus the given Object type and associated functions.
6115    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
6116        let mut query = self.selection.select("withObject");
6117        query = query.arg_lazy(
6118            "object",
6119            Box::new(move || {
6120                let object = object.clone();
6121                Box::pin(async move { object.into_id().await.unwrap().quote() })
6122            }),
6123        );
6124        Module {
6125            proc: self.proc.clone(),
6126            selection: query,
6127            graphql_client: self.graphql_client.clone(),
6128        }
6129    }
6130}
6131#[derive(Clone)]
6132pub struct ModuleConfigClient {
6133    pub proc: Option<Arc<DaggerSessionProc>>,
6134    pub selection: Selection,
6135    pub graphql_client: DynGraphQLClient,
6136}
6137impl ModuleConfigClient {
6138    /// If true, generate the client in developer mode.
6139    pub async fn dev(&self) -> Result<bool, DaggerError> {
6140        let query = self.selection.select("dev");
6141        query.execute(self.graphql_client.clone()).await
6142    }
6143    /// The directory the client is generated in.
6144    pub async fn directory(&self) -> Result<String, DaggerError> {
6145        let query = self.selection.select("directory");
6146        query.execute(self.graphql_client.clone()).await
6147    }
6148    /// The generator to use
6149    pub async fn generator(&self) -> Result<String, DaggerError> {
6150        let query = self.selection.select("generator");
6151        query.execute(self.graphql_client.clone()).await
6152    }
6153    /// A unique identifier for this ModuleConfigClient.
6154    pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
6155        let query = self.selection.select("id");
6156        query.execute(self.graphql_client.clone()).await
6157    }
6158}
6159#[derive(Clone)]
6160pub struct ModuleSource {
6161    pub proc: Option<Arc<DaggerSessionProc>>,
6162    pub selection: Selection,
6163    pub graphql_client: DynGraphQLClient,
6164}
6165#[derive(Builder, Debug, PartialEq)]
6166pub struct ModuleSourceWithClientOpts {
6167    /// Generate in developer mode
6168    #[builder(setter(into, strip_option), default)]
6169    pub dev: Option<bool>,
6170}
6171impl ModuleSource {
6172    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
6173    pub fn as_module(&self) -> Module {
6174        let query = self.selection.select("asModule");
6175        Module {
6176            proc: self.proc.clone(),
6177            selection: query,
6178            graphql_client: self.graphql_client.clone(),
6179        }
6180    }
6181    /// A human readable ref string representation of this module source.
6182    pub async fn as_string(&self) -> Result<String, DaggerError> {
6183        let query = self.selection.select("asString");
6184        query.execute(self.graphql_client.clone()).await
6185    }
6186    /// The ref to clone the root of the git repo from. Only valid for git sources.
6187    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
6188        let query = self.selection.select("cloneRef");
6189        query.execute(self.graphql_client.clone()).await
6190    }
6191    /// The resolved commit of the git repo this source points to. Only valid for git sources.
6192    pub async fn commit(&self) -> Result<String, DaggerError> {
6193        let query = self.selection.select("commit");
6194        query.execute(self.graphql_client.clone()).await
6195    }
6196    /// The clients generated for the module.
6197    pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
6198        let query = self.selection.select("configClients");
6199        vec![ModuleConfigClient {
6200            proc: self.proc.clone(),
6201            selection: query,
6202            graphql_client: self.graphql_client.clone(),
6203        }]
6204    }
6205    /// Whether an existing dagger.json for the module was found.
6206    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
6207        let query = self.selection.select("configExists");
6208        query.execute(self.graphql_client.clone()).await
6209    }
6210    /// The full directory loaded for the module source, including the source code as a subdirectory.
6211    pub fn context_directory(&self) -> Directory {
6212        let query = self.selection.select("contextDirectory");
6213        Directory {
6214            proc: self.proc.clone(),
6215            selection: query,
6216            graphql_client: self.graphql_client.clone(),
6217        }
6218    }
6219    /// The dependencies of the module source.
6220    pub fn dependencies(&self) -> Vec<ModuleSource> {
6221        let query = self.selection.select("dependencies");
6222        vec![ModuleSource {
6223            proc: self.proc.clone(),
6224            selection: query,
6225            graphql_client: self.graphql_client.clone(),
6226        }]
6227    }
6228    /// 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.
6229    pub async fn digest(&self) -> Result<String, DaggerError> {
6230        let query = self.selection.select("digest");
6231        query.execute(self.graphql_client.clone()).await
6232    }
6233    /// The directory containing the module configuration and source code (source code may be in a subdir).
6234    ///
6235    /// # Arguments
6236    ///
6237    /// * `path` - A subpath from the source directory to select.
6238    pub fn directory(&self, path: impl Into<String>) -> Directory {
6239        let mut query = self.selection.select("directory");
6240        query = query.arg("path", path.into());
6241        Directory {
6242            proc: self.proc.clone(),
6243            selection: query,
6244            graphql_client: self.graphql_client.clone(),
6245        }
6246    }
6247    /// The engine version of the module.
6248    pub async fn engine_version(&self) -> Result<String, DaggerError> {
6249        let query = self.selection.select("engineVersion");
6250        query.execute(self.graphql_client.clone()).await
6251    }
6252    /// The generated files and directories made on top of the module source's context directory.
6253    pub fn generated_context_directory(&self) -> Directory {
6254        let query = self.selection.select("generatedContextDirectory");
6255        Directory {
6256            proc: self.proc.clone(),
6257            selection: query,
6258            graphql_client: self.graphql_client.clone(),
6259        }
6260    }
6261    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket). Only valid for git sources.
6262    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
6263        let query = self.selection.select("htmlRepoURL");
6264        query.execute(self.graphql_client.clone()).await
6265    }
6266    /// The URL to the source's git repo in a web browser. Only valid for git sources.
6267    pub async fn html_url(&self) -> Result<String, DaggerError> {
6268        let query = self.selection.select("htmlURL");
6269        query.execute(self.graphql_client.clone()).await
6270    }
6271    /// A unique identifier for this ModuleSource.
6272    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
6273        let query = self.selection.select("id");
6274        query.execute(self.graphql_client.clone()).await
6275    }
6276    /// The kind of module source (currently local, git or dir).
6277    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
6278        let query = self.selection.select("kind");
6279        query.execute(self.graphql_client.clone()).await
6280    }
6281    /// 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.
6282    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
6283        let query = self.selection.select("localContextDirectoryPath");
6284        query.execute(self.graphql_client.clone()).await
6285    }
6286    /// The name of the module, including any setting via the withName API.
6287    pub async fn module_name(&self) -> Result<String, DaggerError> {
6288        let query = self.selection.select("moduleName");
6289        query.execute(self.graphql_client.clone()).await
6290    }
6291    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
6292    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
6293        let query = self.selection.select("moduleOriginalName");
6294        query.execute(self.graphql_client.clone()).await
6295    }
6296    /// The original subpath used when instantiating this module source, relative to the context directory.
6297    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
6298        let query = self.selection.select("originalSubpath");
6299        query.execute(self.graphql_client.clone()).await
6300    }
6301    /// The pinned version of this module source.
6302    pub async fn pin(&self) -> Result<String, DaggerError> {
6303        let query = self.selection.select("pin");
6304        query.execute(self.graphql_client.clone()).await
6305    }
6306    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
6307    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
6308        let query = self.selection.select("repoRootPath");
6309        query.execute(self.graphql_client.clone()).await
6310    }
6311    /// The SDK configuration of the module.
6312    pub fn sdk(&self) -> SdkConfig {
6313        let query = self.selection.select("sdk");
6314        SdkConfig {
6315            proc: self.proc.clone(),
6316            selection: query,
6317            graphql_client: self.graphql_client.clone(),
6318        }
6319    }
6320    /// The path, relative to the context directory, that contains the module's dagger.json.
6321    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
6322        let query = self.selection.select("sourceRootSubpath");
6323        query.execute(self.graphql_client.clone()).await
6324    }
6325    /// The path to the directory containing the module's source code, relative to the context directory.
6326    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
6327        let query = self.selection.select("sourceSubpath");
6328        query.execute(self.graphql_client.clone()).await
6329    }
6330    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
6331    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
6332        let query = self.selection.select("sync");
6333        query.execute(self.graphql_client.clone()).await
6334    }
6335    /// The specified version of the git repo this source points to. Only valid for git sources.
6336    pub async fn version(&self) -> Result<String, DaggerError> {
6337        let query = self.selection.select("version");
6338        query.execute(self.graphql_client.clone()).await
6339    }
6340    /// Update the module source with a new client to generate.
6341    ///
6342    /// # Arguments
6343    ///
6344    /// * `generator` - The generator to use
6345    /// * `output_dir` - The output directory for the generated client.
6346    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6347    pub fn with_client(
6348        &self,
6349        generator: impl Into<String>,
6350        output_dir: impl Into<String>,
6351    ) -> ModuleSource {
6352        let mut query = self.selection.select("withClient");
6353        query = query.arg("generator", generator.into());
6354        query = query.arg("outputDir", output_dir.into());
6355        ModuleSource {
6356            proc: self.proc.clone(),
6357            selection: query,
6358            graphql_client: self.graphql_client.clone(),
6359        }
6360    }
6361    /// Update the module source with a new client to generate.
6362    ///
6363    /// # Arguments
6364    ///
6365    /// * `generator` - The generator to use
6366    /// * `output_dir` - The output directory for the generated client.
6367    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6368    pub fn with_client_opts(
6369        &self,
6370        generator: impl Into<String>,
6371        output_dir: impl Into<String>,
6372        opts: ModuleSourceWithClientOpts,
6373    ) -> ModuleSource {
6374        let mut query = self.selection.select("withClient");
6375        query = query.arg("generator", generator.into());
6376        query = query.arg("outputDir", output_dir.into());
6377        if let Some(dev) = opts.dev {
6378            query = query.arg("dev", dev);
6379        }
6380        ModuleSource {
6381            proc: self.proc.clone(),
6382            selection: query,
6383            graphql_client: self.graphql_client.clone(),
6384        }
6385    }
6386    /// Append the provided dependencies to the module source's dependency list.
6387    ///
6388    /// # Arguments
6389    ///
6390    /// * `dependencies` - The dependencies to append.
6391    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
6392        let mut query = self.selection.select("withDependencies");
6393        query = query.arg("dependencies", dependencies);
6394        ModuleSource {
6395            proc: self.proc.clone(),
6396            selection: query,
6397            graphql_client: self.graphql_client.clone(),
6398        }
6399    }
6400    /// Upgrade the engine version of the module to the given value.
6401    ///
6402    /// # Arguments
6403    ///
6404    /// * `version` - The engine version to upgrade to.
6405    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
6406        let mut query = self.selection.select("withEngineVersion");
6407        query = query.arg("version", version.into());
6408        ModuleSource {
6409            proc: self.proc.clone(),
6410            selection: query,
6411            graphql_client: self.graphql_client.clone(),
6412        }
6413    }
6414    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
6415    ///
6416    /// # Arguments
6417    ///
6418    /// * `patterns` - The new additional include patterns.
6419    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
6420        let mut query = self.selection.select("withIncludes");
6421        query = query.arg(
6422            "patterns",
6423            patterns
6424                .into_iter()
6425                .map(|i| i.into())
6426                .collect::<Vec<String>>(),
6427        );
6428        ModuleSource {
6429            proc: self.proc.clone(),
6430            selection: query,
6431            graphql_client: self.graphql_client.clone(),
6432        }
6433    }
6434    /// Update the module source with a new name.
6435    ///
6436    /// # Arguments
6437    ///
6438    /// * `name` - The name to set.
6439    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
6440        let mut query = self.selection.select("withName");
6441        query = query.arg("name", name.into());
6442        ModuleSource {
6443            proc: self.proc.clone(),
6444            selection: query,
6445            graphql_client: self.graphql_client.clone(),
6446        }
6447    }
6448    /// Update the module source with a new SDK.
6449    ///
6450    /// # Arguments
6451    ///
6452    /// * `source` - The SDK source to set.
6453    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
6454        let mut query = self.selection.select("withSDK");
6455        query = query.arg("source", source.into());
6456        ModuleSource {
6457            proc: self.proc.clone(),
6458            selection: query,
6459            graphql_client: self.graphql_client.clone(),
6460        }
6461    }
6462    /// Update the module source with a new source subpath.
6463    ///
6464    /// # Arguments
6465    ///
6466    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
6467    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
6468        let mut query = self.selection.select("withSourceSubpath");
6469        query = query.arg("path", path.into());
6470        ModuleSource {
6471            proc: self.proc.clone(),
6472            selection: query,
6473            graphql_client: self.graphql_client.clone(),
6474        }
6475    }
6476    /// Update one or more module dependencies.
6477    ///
6478    /// # Arguments
6479    ///
6480    /// * `dependencies` - The dependencies to update.
6481    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
6482        let mut query = self.selection.select("withUpdateDependencies");
6483        query = query.arg(
6484            "dependencies",
6485            dependencies
6486                .into_iter()
6487                .map(|i| i.into())
6488                .collect::<Vec<String>>(),
6489        );
6490        ModuleSource {
6491            proc: self.proc.clone(),
6492            selection: query,
6493            graphql_client: self.graphql_client.clone(),
6494        }
6495    }
6496    /// Remove the provided dependencies from the module source's dependency list.
6497    ///
6498    /// # Arguments
6499    ///
6500    /// * `dependencies` - The dependencies to remove.
6501    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
6502        let mut query = self.selection.select("withoutDependencies");
6503        query = query.arg(
6504            "dependencies",
6505            dependencies
6506                .into_iter()
6507                .map(|i| i.into())
6508                .collect::<Vec<String>>(),
6509        );
6510        ModuleSource {
6511            proc: self.proc.clone(),
6512            selection: query,
6513            graphql_client: self.graphql_client.clone(),
6514        }
6515    }
6516}
6517#[derive(Clone)]
6518pub struct ObjectTypeDef {
6519    pub proc: Option<Arc<DaggerSessionProc>>,
6520    pub selection: Selection,
6521    pub graphql_client: DynGraphQLClient,
6522}
6523impl ObjectTypeDef {
6524    /// The function used to construct new instances of this object, if any
6525    pub fn constructor(&self) -> Function {
6526        let query = self.selection.select("constructor");
6527        Function {
6528            proc: self.proc.clone(),
6529            selection: query,
6530            graphql_client: self.graphql_client.clone(),
6531        }
6532    }
6533    /// The doc string for the object, if any.
6534    pub async fn description(&self) -> Result<String, DaggerError> {
6535        let query = self.selection.select("description");
6536        query.execute(self.graphql_client.clone()).await
6537    }
6538    /// Static fields defined on this object, if any.
6539    pub fn fields(&self) -> Vec<FieldTypeDef> {
6540        let query = self.selection.select("fields");
6541        vec![FieldTypeDef {
6542            proc: self.proc.clone(),
6543            selection: query,
6544            graphql_client: self.graphql_client.clone(),
6545        }]
6546    }
6547    /// Functions defined on this object, if any.
6548    pub fn functions(&self) -> Vec<Function> {
6549        let query = self.selection.select("functions");
6550        vec![Function {
6551            proc: self.proc.clone(),
6552            selection: query,
6553            graphql_client: self.graphql_client.clone(),
6554        }]
6555    }
6556    /// A unique identifier for this ObjectTypeDef.
6557    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
6558        let query = self.selection.select("id");
6559        query.execute(self.graphql_client.clone()).await
6560    }
6561    /// The name of the object.
6562    pub async fn name(&self) -> Result<String, DaggerError> {
6563        let query = self.selection.select("name");
6564        query.execute(self.graphql_client.clone()).await
6565    }
6566    /// The location of this object declaration.
6567    pub fn source_map(&self) -> SourceMap {
6568        let query = self.selection.select("sourceMap");
6569        SourceMap {
6570            proc: self.proc.clone(),
6571            selection: query,
6572            graphql_client: self.graphql_client.clone(),
6573        }
6574    }
6575    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
6576    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6577        let query = self.selection.select("sourceModuleName");
6578        query.execute(self.graphql_client.clone()).await
6579    }
6580}
6581#[derive(Clone)]
6582pub struct Port {
6583    pub proc: Option<Arc<DaggerSessionProc>>,
6584    pub selection: Selection,
6585    pub graphql_client: DynGraphQLClient,
6586}
6587impl Port {
6588    /// The port description.
6589    pub async fn description(&self) -> Result<String, DaggerError> {
6590        let query = self.selection.select("description");
6591        query.execute(self.graphql_client.clone()).await
6592    }
6593    /// Skip the health check when run as a service.
6594    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
6595        let query = self.selection.select("experimentalSkipHealthcheck");
6596        query.execute(self.graphql_client.clone()).await
6597    }
6598    /// A unique identifier for this Port.
6599    pub async fn id(&self) -> Result<PortId, DaggerError> {
6600        let query = self.selection.select("id");
6601        query.execute(self.graphql_client.clone()).await
6602    }
6603    /// The port number.
6604    pub async fn port(&self) -> Result<isize, DaggerError> {
6605        let query = self.selection.select("port");
6606        query.execute(self.graphql_client.clone()).await
6607    }
6608    /// The transport layer protocol.
6609    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
6610        let query = self.selection.select("protocol");
6611        query.execute(self.graphql_client.clone()).await
6612    }
6613}
6614#[derive(Clone)]
6615pub struct Query {
6616    pub proc: Option<Arc<DaggerSessionProc>>,
6617    pub selection: Selection,
6618    pub graphql_client: DynGraphQLClient,
6619}
6620#[derive(Builder, Debug, PartialEq)]
6621pub struct QueryCacheVolumeOpts<'a> {
6622    #[builder(setter(into, strip_option), default)]
6623    pub namespace: Option<&'a str>,
6624}
6625#[derive(Builder, Debug, PartialEq)]
6626pub struct QueryContainerOpts {
6627    /// Platform to initialize the container with.
6628    #[builder(setter(into, strip_option), default)]
6629    pub platform: Option<Platform>,
6630}
6631#[derive(Builder, Debug, PartialEq)]
6632pub struct QueryGitOpts<'a> {
6633    /// A service which must be started before the repo is fetched.
6634    #[builder(setter(into, strip_option), default)]
6635    pub experimental_service_host: Option<ServiceId>,
6636    /// DEPRECATED: Set to true to keep .git directory.
6637    #[builder(setter(into, strip_option), default)]
6638    pub keep_git_dir: Option<bool>,
6639    /// Set SSH auth socket
6640    #[builder(setter(into, strip_option), default)]
6641    pub ssh_auth_socket: Option<SocketId>,
6642    /// Set SSH known hosts
6643    #[builder(setter(into, strip_option), default)]
6644    pub ssh_known_hosts: Option<&'a str>,
6645}
6646#[derive(Builder, Debug, PartialEq)]
6647pub struct QueryHttpOpts {
6648    /// A service which must be started before the URL is fetched.
6649    #[builder(setter(into, strip_option), default)]
6650    pub experimental_service_host: Option<ServiceId>,
6651}
6652#[derive(Builder, Debug, PartialEq)]
6653pub struct QueryLoadSecretFromNameOpts<'a> {
6654    #[builder(setter(into, strip_option), default)]
6655    pub accessor: Option<&'a str>,
6656}
6657#[derive(Builder, Debug, PartialEq)]
6658pub struct QueryModuleSourceOpts<'a> {
6659    /// 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.
6660    #[builder(setter(into, strip_option), default)]
6661    pub allow_not_exists: Option<bool>,
6662    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
6663    #[builder(setter(into, strip_option), default)]
6664    pub disable_find_up: Option<bool>,
6665    /// The pinned version of the module source
6666    #[builder(setter(into, strip_option), default)]
6667    pub ref_pin: Option<&'a str>,
6668    /// If set, error out if the ref string is not of the provided requireKind.
6669    #[builder(setter(into, strip_option), default)]
6670    pub require_kind: Option<ModuleSourceKind>,
6671}
6672impl Query {
6673    /// Retrieves a container builtin to the engine.
6674    ///
6675    /// # Arguments
6676    ///
6677    /// * `digest` - Digest of the image manifest
6678    pub fn builtin_container(&self, digest: impl Into<String>) -> Container {
6679        let mut query = self.selection.select("builtinContainer");
6680        query = query.arg("digest", digest.into());
6681        Container {
6682            proc: self.proc.clone(),
6683            selection: query,
6684            graphql_client: self.graphql_client.clone(),
6685        }
6686    }
6687    /// Constructs a cache volume for a given cache key.
6688    ///
6689    /// # Arguments
6690    ///
6691    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
6692    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6693    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
6694        let mut query = self.selection.select("cacheVolume");
6695        query = query.arg("key", key.into());
6696        CacheVolume {
6697            proc: self.proc.clone(),
6698            selection: query,
6699            graphql_client: self.graphql_client.clone(),
6700        }
6701    }
6702    /// Constructs a cache volume for a given cache key.
6703    ///
6704    /// # Arguments
6705    ///
6706    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
6707    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6708    pub fn cache_volume_opts<'a>(
6709        &self,
6710        key: impl Into<String>,
6711        opts: QueryCacheVolumeOpts<'a>,
6712    ) -> CacheVolume {
6713        let mut query = self.selection.select("cacheVolume");
6714        query = query.arg("key", key.into());
6715        if let Some(namespace) = opts.namespace {
6716            query = query.arg("namespace", namespace);
6717        }
6718        CacheVolume {
6719            proc: self.proc.clone(),
6720            selection: query,
6721            graphql_client: self.graphql_client.clone(),
6722        }
6723    }
6724    /// Creates a scratch container.
6725    /// Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
6726    ///
6727    /// # Arguments
6728    ///
6729    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6730    pub fn container(&self) -> Container {
6731        let query = self.selection.select("container");
6732        Container {
6733            proc: self.proc.clone(),
6734            selection: query,
6735            graphql_client: self.graphql_client.clone(),
6736        }
6737    }
6738    /// Creates a scratch container.
6739    /// Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
6740    ///
6741    /// # Arguments
6742    ///
6743    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6744    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
6745        let mut query = self.selection.select("container");
6746        if let Some(platform) = opts.platform {
6747            query = query.arg("platform", platform);
6748        }
6749        Container {
6750            proc: self.proc.clone(),
6751            selection: query,
6752            graphql_client: self.graphql_client.clone(),
6753        }
6754    }
6755    /// The FunctionCall context that the SDK caller is currently executing in.
6756    /// If the caller is not currently executing in a function, this will return an error.
6757    pub fn current_function_call(&self) -> FunctionCall {
6758        let query = self.selection.select("currentFunctionCall");
6759        FunctionCall {
6760            proc: self.proc.clone(),
6761            selection: query,
6762            graphql_client: self.graphql_client.clone(),
6763        }
6764    }
6765    /// The module currently being served in the session, if any.
6766    pub fn current_module(&self) -> CurrentModule {
6767        let query = self.selection.select("currentModule");
6768        CurrentModule {
6769            proc: self.proc.clone(),
6770            selection: query,
6771            graphql_client: self.graphql_client.clone(),
6772        }
6773    }
6774    /// The TypeDef representations of the objects currently being served in the session.
6775    pub fn current_type_defs(&self) -> Vec<TypeDef> {
6776        let query = self.selection.select("currentTypeDefs");
6777        vec![TypeDef {
6778            proc: self.proc.clone(),
6779            selection: query,
6780            graphql_client: self.graphql_client.clone(),
6781        }]
6782    }
6783    /// The default platform of the engine.
6784    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
6785        let query = self.selection.select("defaultPlatform");
6786        query.execute(self.graphql_client.clone()).await
6787    }
6788    /// Creates an empty directory.
6789    pub fn directory(&self) -> Directory {
6790        let query = self.selection.select("directory");
6791        Directory {
6792            proc: self.proc.clone(),
6793            selection: query,
6794            graphql_client: self.graphql_client.clone(),
6795        }
6796    }
6797    /// The Dagger engine container configuration and state
6798    pub fn engine(&self) -> Engine {
6799        let query = self.selection.select("engine");
6800        Engine {
6801            proc: self.proc.clone(),
6802            selection: query,
6803            graphql_client: self.graphql_client.clone(),
6804        }
6805    }
6806    /// Create a new error.
6807    ///
6808    /// # Arguments
6809    ///
6810    /// * `message` - A brief description of the error.
6811    pub fn error(&self, message: impl Into<String>) -> Error {
6812        let mut query = self.selection.select("error");
6813        query = query.arg("message", message.into());
6814        Error {
6815            proc: self.proc.clone(),
6816            selection: query,
6817            graphql_client: self.graphql_client.clone(),
6818        }
6819    }
6820    /// Creates a function.
6821    ///
6822    /// # Arguments
6823    ///
6824    /// * `name` - Name of the function, in its original format from the implementation language.
6825    /// * `return_type` - Return type of the function.
6826    pub fn function(
6827        &self,
6828        name: impl Into<String>,
6829        return_type: impl IntoID<TypeDefId>,
6830    ) -> Function {
6831        let mut query = self.selection.select("function");
6832        query = query.arg("name", name.into());
6833        query = query.arg_lazy(
6834            "returnType",
6835            Box::new(move || {
6836                let return_type = return_type.clone();
6837                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
6838            }),
6839        );
6840        Function {
6841            proc: self.proc.clone(),
6842            selection: query,
6843            graphql_client: self.graphql_client.clone(),
6844        }
6845    }
6846    /// Create a code generation result, given a directory containing the generated code.
6847    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
6848        let mut query = self.selection.select("generatedCode");
6849        query = query.arg_lazy(
6850            "code",
6851            Box::new(move || {
6852                let code = code.clone();
6853                Box::pin(async move { code.into_id().await.unwrap().quote() })
6854            }),
6855        );
6856        GeneratedCode {
6857            proc: self.proc.clone(),
6858            selection: query,
6859            graphql_client: self.graphql_client.clone(),
6860        }
6861    }
6862    /// Queries a Git repository.
6863    ///
6864    /// # Arguments
6865    ///
6866    /// * `url` - URL of the git repository.
6867    ///
6868    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
6869    ///
6870    /// Suffix ".git" is optional.
6871    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6872    pub fn git(&self, url: impl Into<String>) -> GitRepository {
6873        let mut query = self.selection.select("git");
6874        query = query.arg("url", url.into());
6875        GitRepository {
6876            proc: self.proc.clone(),
6877            selection: query,
6878            graphql_client: self.graphql_client.clone(),
6879        }
6880    }
6881    /// Queries a Git repository.
6882    ///
6883    /// # Arguments
6884    ///
6885    /// * `url` - URL of the git repository.
6886    ///
6887    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
6888    ///
6889    /// Suffix ".git" is optional.
6890    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6891    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
6892        let mut query = self.selection.select("git");
6893        query = query.arg("url", url.into());
6894        if let Some(keep_git_dir) = opts.keep_git_dir {
6895            query = query.arg("keepGitDir", keep_git_dir);
6896        }
6897        if let Some(experimental_service_host) = opts.experimental_service_host {
6898            query = query.arg("experimentalServiceHost", experimental_service_host);
6899        }
6900        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
6901            query = query.arg("sshKnownHosts", ssh_known_hosts);
6902        }
6903        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
6904            query = query.arg("sshAuthSocket", ssh_auth_socket);
6905        }
6906        GitRepository {
6907            proc: self.proc.clone(),
6908            selection: query,
6909            graphql_client: self.graphql_client.clone(),
6910        }
6911    }
6912    /// Queries the host environment.
6913    pub fn host(&self) -> Host {
6914        let query = self.selection.select("host");
6915        Host {
6916            proc: self.proc.clone(),
6917            selection: query,
6918            graphql_client: self.graphql_client.clone(),
6919        }
6920    }
6921    /// Returns a file containing an http remote url content.
6922    ///
6923    /// # Arguments
6924    ///
6925    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
6926    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6927    pub fn http(&self, url: impl Into<String>) -> File {
6928        let mut query = self.selection.select("http");
6929        query = query.arg("url", url.into());
6930        File {
6931            proc: self.proc.clone(),
6932            selection: query,
6933            graphql_client: self.graphql_client.clone(),
6934        }
6935    }
6936    /// Returns a file containing an http remote url content.
6937    ///
6938    /// # Arguments
6939    ///
6940    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
6941    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6942    pub fn http_opts(&self, url: impl Into<String>, opts: QueryHttpOpts) -> File {
6943        let mut query = self.selection.select("http");
6944        query = query.arg("url", url.into());
6945        if let Some(experimental_service_host) = opts.experimental_service_host {
6946            query = query.arg("experimentalServiceHost", experimental_service_host);
6947        }
6948        File {
6949            proc: self.proc.clone(),
6950            selection: query,
6951            graphql_client: self.graphql_client.clone(),
6952        }
6953    }
6954    /// Load a CacheVolume from its ID.
6955    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
6956        let mut query = self.selection.select("loadCacheVolumeFromID");
6957        query = query.arg_lazy(
6958            "id",
6959            Box::new(move || {
6960                let id = id.clone();
6961                Box::pin(async move { id.into_id().await.unwrap().quote() })
6962            }),
6963        );
6964        CacheVolume {
6965            proc: self.proc.clone(),
6966            selection: query,
6967            graphql_client: self.graphql_client.clone(),
6968        }
6969    }
6970    /// Load a Container from its ID.
6971    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
6972        let mut query = self.selection.select("loadContainerFromID");
6973        query = query.arg_lazy(
6974            "id",
6975            Box::new(move || {
6976                let id = id.clone();
6977                Box::pin(async move { id.into_id().await.unwrap().quote() })
6978            }),
6979        );
6980        Container {
6981            proc: self.proc.clone(),
6982            selection: query,
6983            graphql_client: self.graphql_client.clone(),
6984        }
6985    }
6986    /// Load a CurrentModule from its ID.
6987    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
6988        let mut query = self.selection.select("loadCurrentModuleFromID");
6989        query = query.arg_lazy(
6990            "id",
6991            Box::new(move || {
6992                let id = id.clone();
6993                Box::pin(async move { id.into_id().await.unwrap().quote() })
6994            }),
6995        );
6996        CurrentModule {
6997            proc: self.proc.clone(),
6998            selection: query,
6999            graphql_client: self.graphql_client.clone(),
7000        }
7001    }
7002    /// Load a Directory from its ID.
7003    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
7004        let mut query = self.selection.select("loadDirectoryFromID");
7005        query = query.arg_lazy(
7006            "id",
7007            Box::new(move || {
7008                let id = id.clone();
7009                Box::pin(async move { id.into_id().await.unwrap().quote() })
7010            }),
7011        );
7012        Directory {
7013            proc: self.proc.clone(),
7014            selection: query,
7015            graphql_client: self.graphql_client.clone(),
7016        }
7017    }
7018    /// Load a EngineCacheEntry from its ID.
7019    pub fn load_engine_cache_entry_from_id(
7020        &self,
7021        id: impl IntoID<EngineCacheEntryId>,
7022    ) -> EngineCacheEntry {
7023        let mut query = self.selection.select("loadEngineCacheEntryFromID");
7024        query = query.arg_lazy(
7025            "id",
7026            Box::new(move || {
7027                let id = id.clone();
7028                Box::pin(async move { id.into_id().await.unwrap().quote() })
7029            }),
7030        );
7031        EngineCacheEntry {
7032            proc: self.proc.clone(),
7033            selection: query,
7034            graphql_client: self.graphql_client.clone(),
7035        }
7036    }
7037    /// Load a EngineCacheEntrySet from its ID.
7038    pub fn load_engine_cache_entry_set_from_id(
7039        &self,
7040        id: impl IntoID<EngineCacheEntrySetId>,
7041    ) -> EngineCacheEntrySet {
7042        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
7043        query = query.arg_lazy(
7044            "id",
7045            Box::new(move || {
7046                let id = id.clone();
7047                Box::pin(async move { id.into_id().await.unwrap().quote() })
7048            }),
7049        );
7050        EngineCacheEntrySet {
7051            proc: self.proc.clone(),
7052            selection: query,
7053            graphql_client: self.graphql_client.clone(),
7054        }
7055    }
7056    /// Load a EngineCache from its ID.
7057    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
7058        let mut query = self.selection.select("loadEngineCacheFromID");
7059        query = query.arg_lazy(
7060            "id",
7061            Box::new(move || {
7062                let id = id.clone();
7063                Box::pin(async move { id.into_id().await.unwrap().quote() })
7064            }),
7065        );
7066        EngineCache {
7067            proc: self.proc.clone(),
7068            selection: query,
7069            graphql_client: self.graphql_client.clone(),
7070        }
7071    }
7072    /// Load a Engine from its ID.
7073    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
7074        let mut query = self.selection.select("loadEngineFromID");
7075        query = query.arg_lazy(
7076            "id",
7077            Box::new(move || {
7078                let id = id.clone();
7079                Box::pin(async move { id.into_id().await.unwrap().quote() })
7080            }),
7081        );
7082        Engine {
7083            proc: self.proc.clone(),
7084            selection: query,
7085            graphql_client: self.graphql_client.clone(),
7086        }
7087    }
7088    /// Load a EnumTypeDef from its ID.
7089    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
7090        let mut query = self.selection.select("loadEnumTypeDefFromID");
7091        query = query.arg_lazy(
7092            "id",
7093            Box::new(move || {
7094                let id = id.clone();
7095                Box::pin(async move { id.into_id().await.unwrap().quote() })
7096            }),
7097        );
7098        EnumTypeDef {
7099            proc: self.proc.clone(),
7100            selection: query,
7101            graphql_client: self.graphql_client.clone(),
7102        }
7103    }
7104    /// Load a EnumValueTypeDef from its ID.
7105    pub fn load_enum_value_type_def_from_id(
7106        &self,
7107        id: impl IntoID<EnumValueTypeDefId>,
7108    ) -> EnumValueTypeDef {
7109        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
7110        query = query.arg_lazy(
7111            "id",
7112            Box::new(move || {
7113                let id = id.clone();
7114                Box::pin(async move { id.into_id().await.unwrap().quote() })
7115            }),
7116        );
7117        EnumValueTypeDef {
7118            proc: self.proc.clone(),
7119            selection: query,
7120            graphql_client: self.graphql_client.clone(),
7121        }
7122    }
7123    /// Load a EnvVariable from its ID.
7124    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
7125        let mut query = self.selection.select("loadEnvVariableFromID");
7126        query = query.arg_lazy(
7127            "id",
7128            Box::new(move || {
7129                let id = id.clone();
7130                Box::pin(async move { id.into_id().await.unwrap().quote() })
7131            }),
7132        );
7133        EnvVariable {
7134            proc: self.proc.clone(),
7135            selection: query,
7136            graphql_client: self.graphql_client.clone(),
7137        }
7138    }
7139    /// Load a Error from its ID.
7140    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
7141        let mut query = self.selection.select("loadErrorFromID");
7142        query = query.arg_lazy(
7143            "id",
7144            Box::new(move || {
7145                let id = id.clone();
7146                Box::pin(async move { id.into_id().await.unwrap().quote() })
7147            }),
7148        );
7149        Error {
7150            proc: self.proc.clone(),
7151            selection: query,
7152            graphql_client: self.graphql_client.clone(),
7153        }
7154    }
7155    /// Load a FieldTypeDef from its ID.
7156    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
7157        let mut query = self.selection.select("loadFieldTypeDefFromID");
7158        query = query.arg_lazy(
7159            "id",
7160            Box::new(move || {
7161                let id = id.clone();
7162                Box::pin(async move { id.into_id().await.unwrap().quote() })
7163            }),
7164        );
7165        FieldTypeDef {
7166            proc: self.proc.clone(),
7167            selection: query,
7168            graphql_client: self.graphql_client.clone(),
7169        }
7170    }
7171    /// Load a File from its ID.
7172    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
7173        let mut query = self.selection.select("loadFileFromID");
7174        query = query.arg_lazy(
7175            "id",
7176            Box::new(move || {
7177                let id = id.clone();
7178                Box::pin(async move { id.into_id().await.unwrap().quote() })
7179            }),
7180        );
7181        File {
7182            proc: self.proc.clone(),
7183            selection: query,
7184            graphql_client: self.graphql_client.clone(),
7185        }
7186    }
7187    /// Load a FunctionArg from its ID.
7188    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
7189        let mut query = self.selection.select("loadFunctionArgFromID");
7190        query = query.arg_lazy(
7191            "id",
7192            Box::new(move || {
7193                let id = id.clone();
7194                Box::pin(async move { id.into_id().await.unwrap().quote() })
7195            }),
7196        );
7197        FunctionArg {
7198            proc: self.proc.clone(),
7199            selection: query,
7200            graphql_client: self.graphql_client.clone(),
7201        }
7202    }
7203    /// Load a FunctionCallArgValue from its ID.
7204    pub fn load_function_call_arg_value_from_id(
7205        &self,
7206        id: impl IntoID<FunctionCallArgValueId>,
7207    ) -> FunctionCallArgValue {
7208        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
7209        query = query.arg_lazy(
7210            "id",
7211            Box::new(move || {
7212                let id = id.clone();
7213                Box::pin(async move { id.into_id().await.unwrap().quote() })
7214            }),
7215        );
7216        FunctionCallArgValue {
7217            proc: self.proc.clone(),
7218            selection: query,
7219            graphql_client: self.graphql_client.clone(),
7220        }
7221    }
7222    /// Load a FunctionCall from its ID.
7223    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
7224        let mut query = self.selection.select("loadFunctionCallFromID");
7225        query = query.arg_lazy(
7226            "id",
7227            Box::new(move || {
7228                let id = id.clone();
7229                Box::pin(async move { id.into_id().await.unwrap().quote() })
7230            }),
7231        );
7232        FunctionCall {
7233            proc: self.proc.clone(),
7234            selection: query,
7235            graphql_client: self.graphql_client.clone(),
7236        }
7237    }
7238    /// Load a Function from its ID.
7239    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
7240        let mut query = self.selection.select("loadFunctionFromID");
7241        query = query.arg_lazy(
7242            "id",
7243            Box::new(move || {
7244                let id = id.clone();
7245                Box::pin(async move { id.into_id().await.unwrap().quote() })
7246            }),
7247        );
7248        Function {
7249            proc: self.proc.clone(),
7250            selection: query,
7251            graphql_client: self.graphql_client.clone(),
7252        }
7253    }
7254    /// Load a GeneratedCode from its ID.
7255    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
7256        let mut query = self.selection.select("loadGeneratedCodeFromID");
7257        query = query.arg_lazy(
7258            "id",
7259            Box::new(move || {
7260                let id = id.clone();
7261                Box::pin(async move { id.into_id().await.unwrap().quote() })
7262            }),
7263        );
7264        GeneratedCode {
7265            proc: self.proc.clone(),
7266            selection: query,
7267            graphql_client: self.graphql_client.clone(),
7268        }
7269    }
7270    /// Load a GitRef from its ID.
7271    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
7272        let mut query = self.selection.select("loadGitRefFromID");
7273        query = query.arg_lazy(
7274            "id",
7275            Box::new(move || {
7276                let id = id.clone();
7277                Box::pin(async move { id.into_id().await.unwrap().quote() })
7278            }),
7279        );
7280        GitRef {
7281            proc: self.proc.clone(),
7282            selection: query,
7283            graphql_client: self.graphql_client.clone(),
7284        }
7285    }
7286    /// Load a GitRepository from its ID.
7287    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
7288        let mut query = self.selection.select("loadGitRepositoryFromID");
7289        query = query.arg_lazy(
7290            "id",
7291            Box::new(move || {
7292                let id = id.clone();
7293                Box::pin(async move { id.into_id().await.unwrap().quote() })
7294            }),
7295        );
7296        GitRepository {
7297            proc: self.proc.clone(),
7298            selection: query,
7299            graphql_client: self.graphql_client.clone(),
7300        }
7301    }
7302    /// Load a Host from its ID.
7303    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
7304        let mut query = self.selection.select("loadHostFromID");
7305        query = query.arg_lazy(
7306            "id",
7307            Box::new(move || {
7308                let id = id.clone();
7309                Box::pin(async move { id.into_id().await.unwrap().quote() })
7310            }),
7311        );
7312        Host {
7313            proc: self.proc.clone(),
7314            selection: query,
7315            graphql_client: self.graphql_client.clone(),
7316        }
7317    }
7318    /// Load a InputTypeDef from its ID.
7319    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
7320        let mut query = self.selection.select("loadInputTypeDefFromID");
7321        query = query.arg_lazy(
7322            "id",
7323            Box::new(move || {
7324                let id = id.clone();
7325                Box::pin(async move { id.into_id().await.unwrap().quote() })
7326            }),
7327        );
7328        InputTypeDef {
7329            proc: self.proc.clone(),
7330            selection: query,
7331            graphql_client: self.graphql_client.clone(),
7332        }
7333    }
7334    /// Load a InterfaceTypeDef from its ID.
7335    pub fn load_interface_type_def_from_id(
7336        &self,
7337        id: impl IntoID<InterfaceTypeDefId>,
7338    ) -> InterfaceTypeDef {
7339        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
7340        query = query.arg_lazy(
7341            "id",
7342            Box::new(move || {
7343                let id = id.clone();
7344                Box::pin(async move { id.into_id().await.unwrap().quote() })
7345            }),
7346        );
7347        InterfaceTypeDef {
7348            proc: self.proc.clone(),
7349            selection: query,
7350            graphql_client: self.graphql_client.clone(),
7351        }
7352    }
7353    /// Load a Label from its ID.
7354    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
7355        let mut query = self.selection.select("loadLabelFromID");
7356        query = query.arg_lazy(
7357            "id",
7358            Box::new(move || {
7359                let id = id.clone();
7360                Box::pin(async move { id.into_id().await.unwrap().quote() })
7361            }),
7362        );
7363        Label {
7364            proc: self.proc.clone(),
7365            selection: query,
7366            graphql_client: self.graphql_client.clone(),
7367        }
7368    }
7369    /// Load a ListTypeDef from its ID.
7370    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
7371        let mut query = self.selection.select("loadListTypeDefFromID");
7372        query = query.arg_lazy(
7373            "id",
7374            Box::new(move || {
7375                let id = id.clone();
7376                Box::pin(async move { id.into_id().await.unwrap().quote() })
7377            }),
7378        );
7379        ListTypeDef {
7380            proc: self.proc.clone(),
7381            selection: query,
7382            graphql_client: self.graphql_client.clone(),
7383        }
7384    }
7385    /// Load a ModuleConfigClient from its ID.
7386    pub fn load_module_config_client_from_id(
7387        &self,
7388        id: impl IntoID<ModuleConfigClientId>,
7389    ) -> ModuleConfigClient {
7390        let mut query = self.selection.select("loadModuleConfigClientFromID");
7391        query = query.arg_lazy(
7392            "id",
7393            Box::new(move || {
7394                let id = id.clone();
7395                Box::pin(async move { id.into_id().await.unwrap().quote() })
7396            }),
7397        );
7398        ModuleConfigClient {
7399            proc: self.proc.clone(),
7400            selection: query,
7401            graphql_client: self.graphql_client.clone(),
7402        }
7403    }
7404    /// Load a Module from its ID.
7405    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
7406        let mut query = self.selection.select("loadModuleFromID");
7407        query = query.arg_lazy(
7408            "id",
7409            Box::new(move || {
7410                let id = id.clone();
7411                Box::pin(async move { id.into_id().await.unwrap().quote() })
7412            }),
7413        );
7414        Module {
7415            proc: self.proc.clone(),
7416            selection: query,
7417            graphql_client: self.graphql_client.clone(),
7418        }
7419    }
7420    /// Load a ModuleSource from its ID.
7421    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
7422        let mut query = self.selection.select("loadModuleSourceFromID");
7423        query = query.arg_lazy(
7424            "id",
7425            Box::new(move || {
7426                let id = id.clone();
7427                Box::pin(async move { id.into_id().await.unwrap().quote() })
7428            }),
7429        );
7430        ModuleSource {
7431            proc: self.proc.clone(),
7432            selection: query,
7433            graphql_client: self.graphql_client.clone(),
7434        }
7435    }
7436    /// Load a ObjectTypeDef from its ID.
7437    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
7438        let mut query = self.selection.select("loadObjectTypeDefFromID");
7439        query = query.arg_lazy(
7440            "id",
7441            Box::new(move || {
7442                let id = id.clone();
7443                Box::pin(async move { id.into_id().await.unwrap().quote() })
7444            }),
7445        );
7446        ObjectTypeDef {
7447            proc: self.proc.clone(),
7448            selection: query,
7449            graphql_client: self.graphql_client.clone(),
7450        }
7451    }
7452    /// Load a Port from its ID.
7453    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
7454        let mut query = self.selection.select("loadPortFromID");
7455        query = query.arg_lazy(
7456            "id",
7457            Box::new(move || {
7458                let id = id.clone();
7459                Box::pin(async move { id.into_id().await.unwrap().quote() })
7460            }),
7461        );
7462        Port {
7463            proc: self.proc.clone(),
7464            selection: query,
7465            graphql_client: self.graphql_client.clone(),
7466        }
7467    }
7468    /// Load a SDKConfig from its ID.
7469    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
7470        let mut query = self.selection.select("loadSDKConfigFromID");
7471        query = query.arg_lazy(
7472            "id",
7473            Box::new(move || {
7474                let id = id.clone();
7475                Box::pin(async move { id.into_id().await.unwrap().quote() })
7476            }),
7477        );
7478        SdkConfig {
7479            proc: self.proc.clone(),
7480            selection: query,
7481            graphql_client: self.graphql_client.clone(),
7482        }
7483    }
7484    /// Load a ScalarTypeDef from its ID.
7485    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
7486        let mut query = self.selection.select("loadScalarTypeDefFromID");
7487        query = query.arg_lazy(
7488            "id",
7489            Box::new(move || {
7490                let id = id.clone();
7491                Box::pin(async move { id.into_id().await.unwrap().quote() })
7492            }),
7493        );
7494        ScalarTypeDef {
7495            proc: self.proc.clone(),
7496            selection: query,
7497            graphql_client: self.graphql_client.clone(),
7498        }
7499    }
7500    /// Load a Secret from its ID.
7501    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
7502        let mut query = self.selection.select("loadSecretFromID");
7503        query = query.arg_lazy(
7504            "id",
7505            Box::new(move || {
7506                let id = id.clone();
7507                Box::pin(async move { id.into_id().await.unwrap().quote() })
7508            }),
7509        );
7510        Secret {
7511            proc: self.proc.clone(),
7512            selection: query,
7513            graphql_client: self.graphql_client.clone(),
7514        }
7515    }
7516    /// Load a Secret from its Name.
7517    ///
7518    /// # Arguments
7519    ///
7520    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7521    pub fn load_secret_from_name(&self, name: impl Into<String>) -> Secret {
7522        let mut query = self.selection.select("loadSecretFromName");
7523        query = query.arg("name", name.into());
7524        Secret {
7525            proc: self.proc.clone(),
7526            selection: query,
7527            graphql_client: self.graphql_client.clone(),
7528        }
7529    }
7530    /// Load a Secret from its Name.
7531    ///
7532    /// # Arguments
7533    ///
7534    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7535    pub fn load_secret_from_name_opts<'a>(
7536        &self,
7537        name: impl Into<String>,
7538        opts: QueryLoadSecretFromNameOpts<'a>,
7539    ) -> Secret {
7540        let mut query = self.selection.select("loadSecretFromName");
7541        query = query.arg("name", name.into());
7542        if let Some(accessor) = opts.accessor {
7543            query = query.arg("accessor", accessor);
7544        }
7545        Secret {
7546            proc: self.proc.clone(),
7547            selection: query,
7548            graphql_client: self.graphql_client.clone(),
7549        }
7550    }
7551    /// Load a Service from its ID.
7552    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
7553        let mut query = self.selection.select("loadServiceFromID");
7554        query = query.arg_lazy(
7555            "id",
7556            Box::new(move || {
7557                let id = id.clone();
7558                Box::pin(async move { id.into_id().await.unwrap().quote() })
7559            }),
7560        );
7561        Service {
7562            proc: self.proc.clone(),
7563            selection: query,
7564            graphql_client: self.graphql_client.clone(),
7565        }
7566    }
7567    /// Load a Socket from its ID.
7568    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
7569        let mut query = self.selection.select("loadSocketFromID");
7570        query = query.arg_lazy(
7571            "id",
7572            Box::new(move || {
7573                let id = id.clone();
7574                Box::pin(async move { id.into_id().await.unwrap().quote() })
7575            }),
7576        );
7577        Socket {
7578            proc: self.proc.clone(),
7579            selection: query,
7580            graphql_client: self.graphql_client.clone(),
7581        }
7582    }
7583    /// Load a SourceMap from its ID.
7584    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
7585        let mut query = self.selection.select("loadSourceMapFromID");
7586        query = query.arg_lazy(
7587            "id",
7588            Box::new(move || {
7589                let id = id.clone();
7590                Box::pin(async move { id.into_id().await.unwrap().quote() })
7591            }),
7592        );
7593        SourceMap {
7594            proc: self.proc.clone(),
7595            selection: query,
7596            graphql_client: self.graphql_client.clone(),
7597        }
7598    }
7599    /// Load a Terminal from its ID.
7600    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
7601        let mut query = self.selection.select("loadTerminalFromID");
7602        query = query.arg_lazy(
7603            "id",
7604            Box::new(move || {
7605                let id = id.clone();
7606                Box::pin(async move { id.into_id().await.unwrap().quote() })
7607            }),
7608        );
7609        Terminal {
7610            proc: self.proc.clone(),
7611            selection: query,
7612            graphql_client: self.graphql_client.clone(),
7613        }
7614    }
7615    /// Load a TypeDef from its ID.
7616    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
7617        let mut query = self.selection.select("loadTypeDefFromID");
7618        query = query.arg_lazy(
7619            "id",
7620            Box::new(move || {
7621                let id = id.clone();
7622                Box::pin(async move { id.into_id().await.unwrap().quote() })
7623            }),
7624        );
7625        TypeDef {
7626            proc: self.proc.clone(),
7627            selection: query,
7628            graphql_client: self.graphql_client.clone(),
7629        }
7630    }
7631    /// Create a new module.
7632    pub fn module(&self) -> Module {
7633        let query = self.selection.select("module");
7634        Module {
7635            proc: self.proc.clone(),
7636            selection: query,
7637            graphql_client: self.graphql_client.clone(),
7638        }
7639    }
7640    /// Create a new module source instance from a source ref string
7641    ///
7642    /// # Arguments
7643    ///
7644    /// * `ref_string` - The string ref representation of the module source
7645    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7646    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
7647        let mut query = self.selection.select("moduleSource");
7648        query = query.arg("refString", ref_string.into());
7649        ModuleSource {
7650            proc: self.proc.clone(),
7651            selection: query,
7652            graphql_client: self.graphql_client.clone(),
7653        }
7654    }
7655    /// Create a new module source instance from a source ref string
7656    ///
7657    /// # Arguments
7658    ///
7659    /// * `ref_string` - The string ref representation of the module source
7660    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7661    pub fn module_source_opts<'a>(
7662        &self,
7663        ref_string: impl Into<String>,
7664        opts: QueryModuleSourceOpts<'a>,
7665    ) -> ModuleSource {
7666        let mut query = self.selection.select("moduleSource");
7667        query = query.arg("refString", ref_string.into());
7668        if let Some(ref_pin) = opts.ref_pin {
7669            query = query.arg("refPin", ref_pin);
7670        }
7671        if let Some(disable_find_up) = opts.disable_find_up {
7672            query = query.arg("disableFindUp", disable_find_up);
7673        }
7674        if let Some(allow_not_exists) = opts.allow_not_exists {
7675            query = query.arg("allowNotExists", allow_not_exists);
7676        }
7677        if let Some(require_kind) = opts.require_kind {
7678            query = query.arg("requireKind", require_kind);
7679        }
7680        ModuleSource {
7681            proc: self.proc.clone(),
7682            selection: query,
7683            graphql_client: self.graphql_client.clone(),
7684        }
7685    }
7686    /// Creates a new secret.
7687    ///
7688    /// # Arguments
7689    ///
7690    /// * `uri` - The URI of the secret store
7691    pub fn secret(&self, uri: impl Into<String>) -> Secret {
7692        let mut query = self.selection.select("secret");
7693        query = query.arg("uri", uri.into());
7694        Secret {
7695            proc: self.proc.clone(),
7696            selection: query,
7697            graphql_client: self.graphql_client.clone(),
7698        }
7699    }
7700    /// Sets a secret given a user defined name to its plaintext and returns the secret.
7701    /// The plaintext value is limited to a size of 128000 bytes.
7702    ///
7703    /// # Arguments
7704    ///
7705    /// * `name` - The user defined name for this secret
7706    /// * `plaintext` - The plaintext of the secret
7707    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
7708        let mut query = self.selection.select("setSecret");
7709        query = query.arg("name", name.into());
7710        query = query.arg("plaintext", plaintext.into());
7711        Secret {
7712            proc: self.proc.clone(),
7713            selection: query,
7714            graphql_client: self.graphql_client.clone(),
7715        }
7716    }
7717    /// Creates source map metadata.
7718    ///
7719    /// # Arguments
7720    ///
7721    /// * `filename` - The filename from the module source.
7722    /// * `line` - The line number within the filename.
7723    /// * `column` - The column number within the line.
7724    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
7725        let mut query = self.selection.select("sourceMap");
7726        query = query.arg("filename", filename.into());
7727        query = query.arg("line", line);
7728        query = query.arg("column", column);
7729        SourceMap {
7730            proc: self.proc.clone(),
7731            selection: query,
7732            graphql_client: self.graphql_client.clone(),
7733        }
7734    }
7735    /// Create a new TypeDef.
7736    pub fn type_def(&self) -> TypeDef {
7737        let query = self.selection.select("typeDef");
7738        TypeDef {
7739            proc: self.proc.clone(),
7740            selection: query,
7741            graphql_client: self.graphql_client.clone(),
7742        }
7743    }
7744    /// Get the current Dagger Engine version.
7745    pub async fn version(&self) -> Result<String, DaggerError> {
7746        let query = self.selection.select("version");
7747        query.execute(self.graphql_client.clone()).await
7748    }
7749}
7750#[derive(Clone)]
7751pub struct SdkConfig {
7752    pub proc: Option<Arc<DaggerSessionProc>>,
7753    pub selection: Selection,
7754    pub graphql_client: DynGraphQLClient,
7755}
7756impl SdkConfig {
7757    /// A unique identifier for this SDKConfig.
7758    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
7759        let query = self.selection.select("id");
7760        query.execute(self.graphql_client.clone()).await
7761    }
7762    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
7763    pub async fn source(&self) -> Result<String, DaggerError> {
7764        let query = self.selection.select("source");
7765        query.execute(self.graphql_client.clone()).await
7766    }
7767}
7768#[derive(Clone)]
7769pub struct ScalarTypeDef {
7770    pub proc: Option<Arc<DaggerSessionProc>>,
7771    pub selection: Selection,
7772    pub graphql_client: DynGraphQLClient,
7773}
7774impl ScalarTypeDef {
7775    /// A doc string for the scalar, if any.
7776    pub async fn description(&self) -> Result<String, DaggerError> {
7777        let query = self.selection.select("description");
7778        query.execute(self.graphql_client.clone()).await
7779    }
7780    /// A unique identifier for this ScalarTypeDef.
7781    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
7782        let query = self.selection.select("id");
7783        query.execute(self.graphql_client.clone()).await
7784    }
7785    /// The name of the scalar.
7786    pub async fn name(&self) -> Result<String, DaggerError> {
7787        let query = self.selection.select("name");
7788        query.execute(self.graphql_client.clone()).await
7789    }
7790    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
7791    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
7792        let query = self.selection.select("sourceModuleName");
7793        query.execute(self.graphql_client.clone()).await
7794    }
7795}
7796#[derive(Clone)]
7797pub struct Secret {
7798    pub proc: Option<Arc<DaggerSessionProc>>,
7799    pub selection: Selection,
7800    pub graphql_client: DynGraphQLClient,
7801}
7802impl Secret {
7803    /// A unique identifier for this Secret.
7804    pub async fn id(&self) -> Result<SecretId, DaggerError> {
7805        let query = self.selection.select("id");
7806        query.execute(self.graphql_client.clone()).await
7807    }
7808    /// The name of this secret.
7809    pub async fn name(&self) -> Result<String, DaggerError> {
7810        let query = self.selection.select("name");
7811        query.execute(self.graphql_client.clone()).await
7812    }
7813    /// The value of this secret.
7814    pub async fn plaintext(&self) -> Result<String, DaggerError> {
7815        let query = self.selection.select("plaintext");
7816        query.execute(self.graphql_client.clone()).await
7817    }
7818    /// The URI of this secret.
7819    pub async fn uri(&self) -> Result<String, DaggerError> {
7820        let query = self.selection.select("uri");
7821        query.execute(self.graphql_client.clone()).await
7822    }
7823}
7824#[derive(Clone)]
7825pub struct Service {
7826    pub proc: Option<Arc<DaggerSessionProc>>,
7827    pub selection: Selection,
7828    pub graphql_client: DynGraphQLClient,
7829}
7830#[derive(Builder, Debug, PartialEq)]
7831pub struct ServiceEndpointOpts<'a> {
7832    /// The exposed port number for the endpoint
7833    #[builder(setter(into, strip_option), default)]
7834    pub port: Option<isize>,
7835    /// Return a URL with the given scheme, eg. http for http://
7836    #[builder(setter(into, strip_option), default)]
7837    pub scheme: Option<&'a str>,
7838}
7839#[derive(Builder, Debug, PartialEq)]
7840pub struct ServiceStopOpts {
7841    /// Immediately kill the service without waiting for a graceful exit
7842    #[builder(setter(into, strip_option), default)]
7843    pub kill: Option<bool>,
7844}
7845#[derive(Builder, Debug, PartialEq)]
7846pub struct ServiceUpOpts {
7847    /// List of frontend/backend port mappings to forward.
7848    /// Frontend is the port accepting traffic on the host, backend is the service port.
7849    #[builder(setter(into, strip_option), default)]
7850    pub ports: Option<Vec<PortForward>>,
7851    /// Bind each tunnel port to a random port on the host.
7852    #[builder(setter(into, strip_option), default)]
7853    pub random: Option<bool>,
7854}
7855impl Service {
7856    /// Retrieves an endpoint that clients can use to reach this container.
7857    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
7858    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
7859    ///
7860    /// # Arguments
7861    ///
7862    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7863    pub async fn endpoint(&self) -> Result<String, DaggerError> {
7864        let query = self.selection.select("endpoint");
7865        query.execute(self.graphql_client.clone()).await
7866    }
7867    /// Retrieves an endpoint that clients can use to reach this container.
7868    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
7869    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
7870    ///
7871    /// # Arguments
7872    ///
7873    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7874    pub async fn endpoint_opts<'a>(
7875        &self,
7876        opts: ServiceEndpointOpts<'a>,
7877    ) -> Result<String, DaggerError> {
7878        let mut query = self.selection.select("endpoint");
7879        if let Some(port) = opts.port {
7880            query = query.arg("port", port);
7881        }
7882        if let Some(scheme) = opts.scheme {
7883            query = query.arg("scheme", scheme);
7884        }
7885        query.execute(self.graphql_client.clone()).await
7886    }
7887    /// Retrieves a hostname which can be used by clients to reach this container.
7888    pub async fn hostname(&self) -> Result<String, DaggerError> {
7889        let query = self.selection.select("hostname");
7890        query.execute(self.graphql_client.clone()).await
7891    }
7892    /// A unique identifier for this Service.
7893    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
7894        let query = self.selection.select("id");
7895        query.execute(self.graphql_client.clone()).await
7896    }
7897    /// Retrieves the list of ports provided by the service.
7898    pub fn ports(&self) -> Vec<Port> {
7899        let query = self.selection.select("ports");
7900        vec![Port {
7901            proc: self.proc.clone(),
7902            selection: query,
7903            graphql_client: self.graphql_client.clone(),
7904        }]
7905    }
7906    /// Start the service and wait for its health checks to succeed.
7907    /// Services bound to a Container do not need to be manually started.
7908    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
7909        let query = self.selection.select("start");
7910        query.execute(self.graphql_client.clone()).await
7911    }
7912    /// Stop the service.
7913    ///
7914    /// # Arguments
7915    ///
7916    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7917    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
7918        let query = self.selection.select("stop");
7919        query.execute(self.graphql_client.clone()).await
7920    }
7921    /// Stop the service.
7922    ///
7923    /// # Arguments
7924    ///
7925    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7926    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
7927        let mut query = self.selection.select("stop");
7928        if let Some(kill) = opts.kill {
7929            query = query.arg("kill", kill);
7930        }
7931        query.execute(self.graphql_client.clone()).await
7932    }
7933    /// Creates a tunnel that forwards traffic from the caller's network to this service.
7934    ///
7935    /// # Arguments
7936    ///
7937    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7938    pub async fn up(&self) -> Result<Void, DaggerError> {
7939        let query = self.selection.select("up");
7940        query.execute(self.graphql_client.clone()).await
7941    }
7942    /// Creates a tunnel that forwards traffic from the caller's network to this service.
7943    ///
7944    /// # Arguments
7945    ///
7946    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7947    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
7948        let mut query = self.selection.select("up");
7949        if let Some(ports) = opts.ports {
7950            query = query.arg("ports", ports);
7951        }
7952        if let Some(random) = opts.random {
7953            query = query.arg("random", random);
7954        }
7955        query.execute(self.graphql_client.clone()).await
7956    }
7957    /// Configures a hostname which can be used by clients within the session to reach this container.
7958    ///
7959    /// # Arguments
7960    ///
7961    /// * `hostname` - The hostname to use.
7962    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
7963        let mut query = self.selection.select("withHostname");
7964        query = query.arg("hostname", hostname.into());
7965        Service {
7966            proc: self.proc.clone(),
7967            selection: query,
7968            graphql_client: self.graphql_client.clone(),
7969        }
7970    }
7971}
7972#[derive(Clone)]
7973pub struct Socket {
7974    pub proc: Option<Arc<DaggerSessionProc>>,
7975    pub selection: Selection,
7976    pub graphql_client: DynGraphQLClient,
7977}
7978impl Socket {
7979    /// A unique identifier for this Socket.
7980    pub async fn id(&self) -> Result<SocketId, DaggerError> {
7981        let query = self.selection.select("id");
7982        query.execute(self.graphql_client.clone()).await
7983    }
7984}
7985#[derive(Clone)]
7986pub struct SourceMap {
7987    pub proc: Option<Arc<DaggerSessionProc>>,
7988    pub selection: Selection,
7989    pub graphql_client: DynGraphQLClient,
7990}
7991impl SourceMap {
7992    /// The column number within the line.
7993    pub async fn column(&self) -> Result<isize, DaggerError> {
7994        let query = self.selection.select("column");
7995        query.execute(self.graphql_client.clone()).await
7996    }
7997    /// The filename from the module source.
7998    pub async fn filename(&self) -> Result<String, DaggerError> {
7999        let query = self.selection.select("filename");
8000        query.execute(self.graphql_client.clone()).await
8001    }
8002    /// A unique identifier for this SourceMap.
8003    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
8004        let query = self.selection.select("id");
8005        query.execute(self.graphql_client.clone()).await
8006    }
8007    /// The line number within the filename.
8008    pub async fn line(&self) -> Result<isize, DaggerError> {
8009        let query = self.selection.select("line");
8010        query.execute(self.graphql_client.clone()).await
8011    }
8012    /// The module dependency this was declared in.
8013    pub async fn module(&self) -> Result<String, DaggerError> {
8014        let query = self.selection.select("module");
8015        query.execute(self.graphql_client.clone()).await
8016    }
8017}
8018#[derive(Clone)]
8019pub struct Terminal {
8020    pub proc: Option<Arc<DaggerSessionProc>>,
8021    pub selection: Selection,
8022    pub graphql_client: DynGraphQLClient,
8023}
8024impl Terminal {
8025    /// A unique identifier for this Terminal.
8026    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
8027        let query = self.selection.select("id");
8028        query.execute(self.graphql_client.clone()).await
8029    }
8030    /// Forces evaluation of the pipeline in the engine.
8031    /// It doesn't run the default command if no exec has been set.
8032    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
8033        let query = self.selection.select("sync");
8034        query.execute(self.graphql_client.clone()).await
8035    }
8036}
8037#[derive(Clone)]
8038pub struct TypeDef {
8039    pub proc: Option<Arc<DaggerSessionProc>>,
8040    pub selection: Selection,
8041    pub graphql_client: DynGraphQLClient,
8042}
8043#[derive(Builder, Debug, PartialEq)]
8044pub struct TypeDefWithEnumOpts<'a> {
8045    /// A doc string for the enum, if any
8046    #[builder(setter(into, strip_option), default)]
8047    pub description: Option<&'a str>,
8048    /// The source map for the enum definition.
8049    #[builder(setter(into, strip_option), default)]
8050    pub source_map: Option<SourceMapId>,
8051}
8052#[derive(Builder, Debug, PartialEq)]
8053pub struct TypeDefWithEnumValueOpts<'a> {
8054    /// A doc string for the value, if any
8055    #[builder(setter(into, strip_option), default)]
8056    pub description: Option<&'a str>,
8057    /// The source map for the enum value definition.
8058    #[builder(setter(into, strip_option), default)]
8059    pub source_map: Option<SourceMapId>,
8060}
8061#[derive(Builder, Debug, PartialEq)]
8062pub struct TypeDefWithFieldOpts<'a> {
8063    /// A doc string for the field, if any
8064    #[builder(setter(into, strip_option), default)]
8065    pub description: Option<&'a str>,
8066    /// The source map for the field definition.
8067    #[builder(setter(into, strip_option), default)]
8068    pub source_map: Option<SourceMapId>,
8069}
8070#[derive(Builder, Debug, PartialEq)]
8071pub struct TypeDefWithInterfaceOpts<'a> {
8072    #[builder(setter(into, strip_option), default)]
8073    pub description: Option<&'a str>,
8074    #[builder(setter(into, strip_option), default)]
8075    pub source_map: Option<SourceMapId>,
8076}
8077#[derive(Builder, Debug, PartialEq)]
8078pub struct TypeDefWithObjectOpts<'a> {
8079    #[builder(setter(into, strip_option), default)]
8080    pub description: Option<&'a str>,
8081    #[builder(setter(into, strip_option), default)]
8082    pub source_map: Option<SourceMapId>,
8083}
8084#[derive(Builder, Debug, PartialEq)]
8085pub struct TypeDefWithScalarOpts<'a> {
8086    #[builder(setter(into, strip_option), default)]
8087    pub description: Option<&'a str>,
8088}
8089impl TypeDef {
8090    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
8091    pub fn as_enum(&self) -> EnumTypeDef {
8092        let query = self.selection.select("asEnum");
8093        EnumTypeDef {
8094            proc: self.proc.clone(),
8095            selection: query,
8096            graphql_client: self.graphql_client.clone(),
8097        }
8098    }
8099    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
8100    pub fn as_input(&self) -> InputTypeDef {
8101        let query = self.selection.select("asInput");
8102        InputTypeDef {
8103            proc: self.proc.clone(),
8104            selection: query,
8105            graphql_client: self.graphql_client.clone(),
8106        }
8107    }
8108    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
8109    pub fn as_interface(&self) -> InterfaceTypeDef {
8110        let query = self.selection.select("asInterface");
8111        InterfaceTypeDef {
8112            proc: self.proc.clone(),
8113            selection: query,
8114            graphql_client: self.graphql_client.clone(),
8115        }
8116    }
8117    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
8118    pub fn as_list(&self) -> ListTypeDef {
8119        let query = self.selection.select("asList");
8120        ListTypeDef {
8121            proc: self.proc.clone(),
8122            selection: query,
8123            graphql_client: self.graphql_client.clone(),
8124        }
8125    }
8126    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
8127    pub fn as_object(&self) -> ObjectTypeDef {
8128        let query = self.selection.select("asObject");
8129        ObjectTypeDef {
8130            proc: self.proc.clone(),
8131            selection: query,
8132            graphql_client: self.graphql_client.clone(),
8133        }
8134    }
8135    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
8136    pub fn as_scalar(&self) -> ScalarTypeDef {
8137        let query = self.selection.select("asScalar");
8138        ScalarTypeDef {
8139            proc: self.proc.clone(),
8140            selection: query,
8141            graphql_client: self.graphql_client.clone(),
8142        }
8143    }
8144    /// A unique identifier for this TypeDef.
8145    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
8146        let query = self.selection.select("id");
8147        query.execute(self.graphql_client.clone()).await
8148    }
8149    /// The kind of type this is (e.g. primitive, list, object).
8150    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
8151        let query = self.selection.select("kind");
8152        query.execute(self.graphql_client.clone()).await
8153    }
8154    /// Whether this type can be set to null. Defaults to false.
8155    pub async fn optional(&self) -> Result<bool, DaggerError> {
8156        let query = self.selection.select("optional");
8157        query.execute(self.graphql_client.clone()).await
8158    }
8159    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
8160    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
8161        let mut query = self.selection.select("withConstructor");
8162        query = query.arg_lazy(
8163            "function",
8164            Box::new(move || {
8165                let function = function.clone();
8166                Box::pin(async move { function.into_id().await.unwrap().quote() })
8167            }),
8168        );
8169        TypeDef {
8170            proc: self.proc.clone(),
8171            selection: query,
8172            graphql_client: self.graphql_client.clone(),
8173        }
8174    }
8175    /// Returns a TypeDef of kind Enum with the provided name.
8176    /// 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.
8177    ///
8178    /// # Arguments
8179    ///
8180    /// * `name` - The name of the enum
8181    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8182    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
8183        let mut query = self.selection.select("withEnum");
8184        query = query.arg("name", name.into());
8185        TypeDef {
8186            proc: self.proc.clone(),
8187            selection: query,
8188            graphql_client: self.graphql_client.clone(),
8189        }
8190    }
8191    /// Returns a TypeDef of kind Enum with the provided name.
8192    /// 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.
8193    ///
8194    /// # Arguments
8195    ///
8196    /// * `name` - The name of the enum
8197    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8198    pub fn with_enum_opts<'a>(
8199        &self,
8200        name: impl Into<String>,
8201        opts: TypeDefWithEnumOpts<'a>,
8202    ) -> TypeDef {
8203        let mut query = self.selection.select("withEnum");
8204        query = query.arg("name", name.into());
8205        if let Some(description) = opts.description {
8206            query = query.arg("description", description);
8207        }
8208        if let Some(source_map) = opts.source_map {
8209            query = query.arg("sourceMap", source_map);
8210        }
8211        TypeDef {
8212            proc: self.proc.clone(),
8213            selection: query,
8214            graphql_client: self.graphql_client.clone(),
8215        }
8216    }
8217    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
8218    ///
8219    /// # Arguments
8220    ///
8221    /// * `value` - The name of the value in the enum
8222    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8223    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
8224        let mut query = self.selection.select("withEnumValue");
8225        query = query.arg("value", value.into());
8226        TypeDef {
8227            proc: self.proc.clone(),
8228            selection: query,
8229            graphql_client: self.graphql_client.clone(),
8230        }
8231    }
8232    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
8233    ///
8234    /// # Arguments
8235    ///
8236    /// * `value` - The name of the value in the enum
8237    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8238    pub fn with_enum_value_opts<'a>(
8239        &self,
8240        value: impl Into<String>,
8241        opts: TypeDefWithEnumValueOpts<'a>,
8242    ) -> TypeDef {
8243        let mut query = self.selection.select("withEnumValue");
8244        query = query.arg("value", value.into());
8245        if let Some(description) = opts.description {
8246            query = query.arg("description", description);
8247        }
8248        if let Some(source_map) = opts.source_map {
8249            query = query.arg("sourceMap", source_map);
8250        }
8251        TypeDef {
8252            proc: self.proc.clone(),
8253            selection: query,
8254            graphql_client: self.graphql_client.clone(),
8255        }
8256    }
8257    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
8258    ///
8259    /// # Arguments
8260    ///
8261    /// * `name` - The name of the field in the object
8262    /// * `type_def` - The type of the field
8263    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8264    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
8265        let mut query = self.selection.select("withField");
8266        query = query.arg("name", name.into());
8267        query = query.arg_lazy(
8268            "typeDef",
8269            Box::new(move || {
8270                let type_def = type_def.clone();
8271                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8272            }),
8273        );
8274        TypeDef {
8275            proc: self.proc.clone(),
8276            selection: query,
8277            graphql_client: self.graphql_client.clone(),
8278        }
8279    }
8280    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
8281    ///
8282    /// # Arguments
8283    ///
8284    /// * `name` - The name of the field in the object
8285    /// * `type_def` - The type of the field
8286    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8287    pub fn with_field_opts<'a>(
8288        &self,
8289        name: impl Into<String>,
8290        type_def: impl IntoID<TypeDefId>,
8291        opts: TypeDefWithFieldOpts<'a>,
8292    ) -> TypeDef {
8293        let mut query = self.selection.select("withField");
8294        query = query.arg("name", name.into());
8295        query = query.arg_lazy(
8296            "typeDef",
8297            Box::new(move || {
8298                let type_def = type_def.clone();
8299                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8300            }),
8301        );
8302        if let Some(description) = opts.description {
8303            query = query.arg("description", description);
8304        }
8305        if let Some(source_map) = opts.source_map {
8306            query = query.arg("sourceMap", source_map);
8307        }
8308        TypeDef {
8309            proc: self.proc.clone(),
8310            selection: query,
8311            graphql_client: self.graphql_client.clone(),
8312        }
8313    }
8314    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
8315    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
8316        let mut query = self.selection.select("withFunction");
8317        query = query.arg_lazy(
8318            "function",
8319            Box::new(move || {
8320                let function = function.clone();
8321                Box::pin(async move { function.into_id().await.unwrap().quote() })
8322            }),
8323        );
8324        TypeDef {
8325            proc: self.proc.clone(),
8326            selection: query,
8327            graphql_client: self.graphql_client.clone(),
8328        }
8329    }
8330    /// Returns a TypeDef of kind Interface with the provided name.
8331    ///
8332    /// # Arguments
8333    ///
8334    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8335    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
8336        let mut query = self.selection.select("withInterface");
8337        query = query.arg("name", name.into());
8338        TypeDef {
8339            proc: self.proc.clone(),
8340            selection: query,
8341            graphql_client: self.graphql_client.clone(),
8342        }
8343    }
8344    /// Returns a TypeDef of kind Interface with the provided name.
8345    ///
8346    /// # Arguments
8347    ///
8348    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8349    pub fn with_interface_opts<'a>(
8350        &self,
8351        name: impl Into<String>,
8352        opts: TypeDefWithInterfaceOpts<'a>,
8353    ) -> TypeDef {
8354        let mut query = self.selection.select("withInterface");
8355        query = query.arg("name", name.into());
8356        if let Some(description) = opts.description {
8357            query = query.arg("description", description);
8358        }
8359        if let Some(source_map) = opts.source_map {
8360            query = query.arg("sourceMap", source_map);
8361        }
8362        TypeDef {
8363            proc: self.proc.clone(),
8364            selection: query,
8365            graphql_client: self.graphql_client.clone(),
8366        }
8367    }
8368    /// Sets the kind of the type.
8369    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
8370        let mut query = self.selection.select("withKind");
8371        query = query.arg("kind", kind);
8372        TypeDef {
8373            proc: self.proc.clone(),
8374            selection: query,
8375            graphql_client: self.graphql_client.clone(),
8376        }
8377    }
8378    /// Returns a TypeDef of kind List with the provided type for its elements.
8379    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
8380        let mut query = self.selection.select("withListOf");
8381        query = query.arg_lazy(
8382            "elementType",
8383            Box::new(move || {
8384                let element_type = element_type.clone();
8385                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
8386            }),
8387        );
8388        TypeDef {
8389            proc: self.proc.clone(),
8390            selection: query,
8391            graphql_client: self.graphql_client.clone(),
8392        }
8393    }
8394    /// Returns a TypeDef of kind Object with the provided name.
8395    /// 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.
8396    ///
8397    /// # Arguments
8398    ///
8399    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8400    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
8401        let mut query = self.selection.select("withObject");
8402        query = query.arg("name", name.into());
8403        TypeDef {
8404            proc: self.proc.clone(),
8405            selection: query,
8406            graphql_client: self.graphql_client.clone(),
8407        }
8408    }
8409    /// Returns a TypeDef of kind Object with the provided name.
8410    /// 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.
8411    ///
8412    /// # Arguments
8413    ///
8414    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8415    pub fn with_object_opts<'a>(
8416        &self,
8417        name: impl Into<String>,
8418        opts: TypeDefWithObjectOpts<'a>,
8419    ) -> TypeDef {
8420        let mut query = self.selection.select("withObject");
8421        query = query.arg("name", name.into());
8422        if let Some(description) = opts.description {
8423            query = query.arg("description", description);
8424        }
8425        if let Some(source_map) = opts.source_map {
8426            query = query.arg("sourceMap", source_map);
8427        }
8428        TypeDef {
8429            proc: self.proc.clone(),
8430            selection: query,
8431            graphql_client: self.graphql_client.clone(),
8432        }
8433    }
8434    /// Sets whether this type can be set to null.
8435    pub fn with_optional(&self, optional: bool) -> TypeDef {
8436        let mut query = self.selection.select("withOptional");
8437        query = query.arg("optional", optional);
8438        TypeDef {
8439            proc: self.proc.clone(),
8440            selection: query,
8441            graphql_client: self.graphql_client.clone(),
8442        }
8443    }
8444    /// Returns a TypeDef of kind Scalar with the provided name.
8445    ///
8446    /// # Arguments
8447    ///
8448    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8449    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
8450        let mut query = self.selection.select("withScalar");
8451        query = query.arg("name", name.into());
8452        TypeDef {
8453            proc: self.proc.clone(),
8454            selection: query,
8455            graphql_client: self.graphql_client.clone(),
8456        }
8457    }
8458    /// Returns a TypeDef of kind Scalar with the provided name.
8459    ///
8460    /// # Arguments
8461    ///
8462    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8463    pub fn with_scalar_opts<'a>(
8464        &self,
8465        name: impl Into<String>,
8466        opts: TypeDefWithScalarOpts<'a>,
8467    ) -> TypeDef {
8468        let mut query = self.selection.select("withScalar");
8469        query = query.arg("name", name.into());
8470        if let Some(description) = opts.description {
8471            query = query.arg("description", description);
8472        }
8473        TypeDef {
8474            proc: self.proc.clone(),
8475            selection: query,
8476            graphql_client: self.graphql_client.clone(),
8477        }
8478    }
8479}
8480#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8481pub enum CacheSharingMode {
8482    #[serde(rename = "LOCKED")]
8483    Locked,
8484    #[serde(rename = "PRIVATE")]
8485    Private,
8486    #[serde(rename = "SHARED")]
8487    Shared,
8488}
8489#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8490pub enum ImageLayerCompression {
8491    #[serde(rename = "EStarGZ")]
8492    EStarGz,
8493    #[serde(rename = "Gzip")]
8494    Gzip,
8495    #[serde(rename = "Uncompressed")]
8496    Uncompressed,
8497    #[serde(rename = "Zstd")]
8498    Zstd,
8499}
8500#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8501pub enum ImageMediaTypes {
8502    #[serde(rename = "DockerMediaTypes")]
8503    DockerMediaTypes,
8504    #[serde(rename = "OCIMediaTypes")]
8505    OciMediaTypes,
8506}
8507#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8508pub enum ModuleSourceKind {
8509    #[serde(rename = "DIR_SOURCE")]
8510    DirSource,
8511    #[serde(rename = "GIT_SOURCE")]
8512    GitSource,
8513    #[serde(rename = "LOCAL_SOURCE")]
8514    LocalSource,
8515}
8516#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8517pub enum NetworkProtocol {
8518    #[serde(rename = "TCP")]
8519    Tcp,
8520    #[serde(rename = "UDP")]
8521    Udp,
8522}
8523#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8524pub enum ReturnType {
8525    #[serde(rename = "ANY")]
8526    Any,
8527    #[serde(rename = "FAILURE")]
8528    Failure,
8529    #[serde(rename = "SUCCESS")]
8530    Success,
8531}
8532#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8533pub enum TypeDefKind {
8534    #[serde(rename = "BOOLEAN_KIND")]
8535    BooleanKind,
8536    #[serde(rename = "ENUM_KIND")]
8537    EnumKind,
8538    #[serde(rename = "FLOAT_KIND")]
8539    FloatKind,
8540    #[serde(rename = "INPUT_KIND")]
8541    InputKind,
8542    #[serde(rename = "INTEGER_KIND")]
8543    IntegerKind,
8544    #[serde(rename = "INTERFACE_KIND")]
8545    InterfaceKind,
8546    #[serde(rename = "LIST_KIND")]
8547    ListKind,
8548    #[serde(rename = "OBJECT_KIND")]
8549    ObjectKind,
8550    #[serde(rename = "SCALAR_KIND")]
8551    ScalarKind,
8552    #[serde(rename = "STRING_KIND")]
8553    StringKind,
8554    #[serde(rename = "VOID_KIND")]
8555    VoidKind,
8556}