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