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    /// Force evaluation in the engine.
4222    pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
4223        let query = self.selection.select("sync");
4224        query.execute(self.graphql_client.clone()).await
4225    }
4226    /// Opens an interactive terminal in new container with this directory mounted inside.
4227    ///
4228    /// # Arguments
4229    ///
4230    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4231    pub fn terminal(&self) -> Directory {
4232        let query = self.selection.select("terminal");
4233        Directory {
4234            proc: self.proc.clone(),
4235            selection: query,
4236            graphql_client: self.graphql_client.clone(),
4237        }
4238    }
4239    /// Opens an interactive terminal in new container with this directory mounted inside.
4240    ///
4241    /// # Arguments
4242    ///
4243    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4244    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
4245        let mut query = self.selection.select("terminal");
4246        if let Some(cmd) = opts.cmd {
4247            query = query.arg("cmd", cmd);
4248        }
4249        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4250            query = query.arg(
4251                "experimentalPrivilegedNesting",
4252                experimental_privileged_nesting,
4253            );
4254        }
4255        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4256            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4257        }
4258        if let Some(container) = opts.container {
4259            query = query.arg("container", container);
4260        }
4261        Directory {
4262            proc: self.proc.clone(),
4263            selection: query,
4264            graphql_client: self.graphql_client.clone(),
4265        }
4266    }
4267    /// Retrieves this directory plus a directory written at the given path.
4268    ///
4269    /// # Arguments
4270    ///
4271    /// * `path` - Location of the written directory (e.g., "/src/").
4272    /// * `directory` - Identifier of the directory to copy.
4273    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4274    pub fn with_directory(
4275        &self,
4276        path: impl Into<String>,
4277        directory: impl IntoID<DirectoryId>,
4278    ) -> Directory {
4279        let mut query = self.selection.select("withDirectory");
4280        query = query.arg("path", path.into());
4281        query = query.arg_lazy(
4282            "directory",
4283            Box::new(move || {
4284                let directory = directory.clone();
4285                Box::pin(async move { directory.into_id().await.unwrap().quote() })
4286            }),
4287        );
4288        Directory {
4289            proc: self.proc.clone(),
4290            selection: query,
4291            graphql_client: self.graphql_client.clone(),
4292        }
4293    }
4294    /// Retrieves this directory plus a directory written at the given path.
4295    ///
4296    /// # Arguments
4297    ///
4298    /// * `path` - Location of the written directory (e.g., "/src/").
4299    /// * `directory` - Identifier of the directory to copy.
4300    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4301    pub fn with_directory_opts<'a>(
4302        &self,
4303        path: impl Into<String>,
4304        directory: impl IntoID<DirectoryId>,
4305        opts: DirectoryWithDirectoryOpts<'a>,
4306    ) -> Directory {
4307        let mut query = self.selection.select("withDirectory");
4308        query = query.arg("path", path.into());
4309        query = query.arg_lazy(
4310            "directory",
4311            Box::new(move || {
4312                let directory = directory.clone();
4313                Box::pin(async move { directory.into_id().await.unwrap().quote() })
4314            }),
4315        );
4316        if let Some(exclude) = opts.exclude {
4317            query = query.arg("exclude", exclude);
4318        }
4319        if let Some(include) = opts.include {
4320            query = query.arg("include", include);
4321        }
4322        Directory {
4323            proc: self.proc.clone(),
4324            selection: query,
4325            graphql_client: self.graphql_client.clone(),
4326        }
4327    }
4328    /// Retrieves this directory plus the contents of the given file copied to the given path.
4329    ///
4330    /// # Arguments
4331    ///
4332    /// * `path` - Location of the copied file (e.g., "/file.txt").
4333    /// * `source` - Identifier of the file to copy.
4334    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4335    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
4336        let mut query = self.selection.select("withFile");
4337        query = query.arg("path", path.into());
4338        query = query.arg_lazy(
4339            "source",
4340            Box::new(move || {
4341                let source = source.clone();
4342                Box::pin(async move { source.into_id().await.unwrap().quote() })
4343            }),
4344        );
4345        Directory {
4346            proc: self.proc.clone(),
4347            selection: query,
4348            graphql_client: self.graphql_client.clone(),
4349        }
4350    }
4351    /// Retrieves this directory plus the contents of the given file copied to the given path.
4352    ///
4353    /// # Arguments
4354    ///
4355    /// * `path` - Location of the copied file (e.g., "/file.txt").
4356    /// * `source` - Identifier of the file to copy.
4357    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4358    pub fn with_file_opts(
4359        &self,
4360        path: impl Into<String>,
4361        source: impl IntoID<FileId>,
4362        opts: DirectoryWithFileOpts,
4363    ) -> Directory {
4364        let mut query = self.selection.select("withFile");
4365        query = query.arg("path", path.into());
4366        query = query.arg_lazy(
4367            "source",
4368            Box::new(move || {
4369                let source = source.clone();
4370                Box::pin(async move { source.into_id().await.unwrap().quote() })
4371            }),
4372        );
4373        if let Some(permissions) = opts.permissions {
4374            query = query.arg("permissions", permissions);
4375        }
4376        Directory {
4377            proc: self.proc.clone(),
4378            selection: query,
4379            graphql_client: self.graphql_client.clone(),
4380        }
4381    }
4382    /// Retrieves this directory plus the contents of the given files copied to the given path.
4383    ///
4384    /// # Arguments
4385    ///
4386    /// * `path` - Location where copied files should be placed (e.g., "/src").
4387    /// * `sources` - Identifiers of the files to copy.
4388    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4389    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
4390        let mut query = self.selection.select("withFiles");
4391        query = query.arg("path", path.into());
4392        query = query.arg("sources", sources);
4393        Directory {
4394            proc: self.proc.clone(),
4395            selection: query,
4396            graphql_client: self.graphql_client.clone(),
4397        }
4398    }
4399    /// Retrieves this directory plus the contents of the given files copied to the given path.
4400    ///
4401    /// # Arguments
4402    ///
4403    /// * `path` - Location where copied files should be placed (e.g., "/src").
4404    /// * `sources` - Identifiers of the files to copy.
4405    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4406    pub fn with_files_opts(
4407        &self,
4408        path: impl Into<String>,
4409        sources: Vec<FileId>,
4410        opts: DirectoryWithFilesOpts,
4411    ) -> Directory {
4412        let mut query = self.selection.select("withFiles");
4413        query = query.arg("path", path.into());
4414        query = query.arg("sources", sources);
4415        if let Some(permissions) = opts.permissions {
4416            query = query.arg("permissions", permissions);
4417        }
4418        Directory {
4419            proc: self.proc.clone(),
4420            selection: query,
4421            graphql_client: self.graphql_client.clone(),
4422        }
4423    }
4424    /// Retrieves this directory plus a new directory created at the given path.
4425    ///
4426    /// # Arguments
4427    ///
4428    /// * `path` - Location of the directory created (e.g., "/logs").
4429    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4430    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
4431        let mut query = self.selection.select("withNewDirectory");
4432        query = query.arg("path", path.into());
4433        Directory {
4434            proc: self.proc.clone(),
4435            selection: query,
4436            graphql_client: self.graphql_client.clone(),
4437        }
4438    }
4439    /// Retrieves this directory plus a new directory created at the given path.
4440    ///
4441    /// # Arguments
4442    ///
4443    /// * `path` - Location of the directory created (e.g., "/logs").
4444    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4445    pub fn with_new_directory_opts(
4446        &self,
4447        path: impl Into<String>,
4448        opts: DirectoryWithNewDirectoryOpts,
4449    ) -> Directory {
4450        let mut query = self.selection.select("withNewDirectory");
4451        query = query.arg("path", path.into());
4452        if let Some(permissions) = opts.permissions {
4453            query = query.arg("permissions", permissions);
4454        }
4455        Directory {
4456            proc: self.proc.clone(),
4457            selection: query,
4458            graphql_client: self.graphql_client.clone(),
4459        }
4460    }
4461    /// Retrieves this directory plus a new file written at the given path.
4462    ///
4463    /// # Arguments
4464    ///
4465    /// * `path` - Location of the written file (e.g., "/file.txt").
4466    /// * `contents` - Content of the written file (e.g., "Hello world!").
4467    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4468    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
4469        let mut query = self.selection.select("withNewFile");
4470        query = query.arg("path", path.into());
4471        query = query.arg("contents", contents.into());
4472        Directory {
4473            proc: self.proc.clone(),
4474            selection: query,
4475            graphql_client: self.graphql_client.clone(),
4476        }
4477    }
4478    /// Retrieves this directory plus a new file written at the given path.
4479    ///
4480    /// # Arguments
4481    ///
4482    /// * `path` - Location of the written file (e.g., "/file.txt").
4483    /// * `contents` - Content of the written file (e.g., "Hello world!").
4484    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4485    pub fn with_new_file_opts(
4486        &self,
4487        path: impl Into<String>,
4488        contents: impl Into<String>,
4489        opts: DirectoryWithNewFileOpts,
4490    ) -> Directory {
4491        let mut query = self.selection.select("withNewFile");
4492        query = query.arg("path", path.into());
4493        query = query.arg("contents", contents.into());
4494        if let Some(permissions) = opts.permissions {
4495            query = query.arg("permissions", permissions);
4496        }
4497        Directory {
4498            proc: self.proc.clone(),
4499            selection: query,
4500            graphql_client: self.graphql_client.clone(),
4501        }
4502    }
4503    /// Retrieves this directory with all file/dir timestamps set to the given time.
4504    ///
4505    /// # Arguments
4506    ///
4507    /// * `timestamp` - Timestamp to set dir/files in.
4508    ///
4509    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
4510    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
4511        let mut query = self.selection.select("withTimestamps");
4512        query = query.arg("timestamp", timestamp);
4513        Directory {
4514            proc: self.proc.clone(),
4515            selection: query,
4516            graphql_client: self.graphql_client.clone(),
4517        }
4518    }
4519    /// Retrieves this directory with the directory at the given path removed.
4520    ///
4521    /// # Arguments
4522    ///
4523    /// * `path` - Location of the directory to remove (e.g., ".github/").
4524    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
4525        let mut query = self.selection.select("withoutDirectory");
4526        query = query.arg("path", path.into());
4527        Directory {
4528            proc: self.proc.clone(),
4529            selection: query,
4530            graphql_client: self.graphql_client.clone(),
4531        }
4532    }
4533    /// Retrieves this directory with the file at the given path removed.
4534    ///
4535    /// # Arguments
4536    ///
4537    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4538    pub fn without_file(&self, path: impl Into<String>) -> Directory {
4539        let mut query = self.selection.select("withoutFile");
4540        query = query.arg("path", path.into());
4541        Directory {
4542            proc: self.proc.clone(),
4543            selection: query,
4544            graphql_client: self.graphql_client.clone(),
4545        }
4546    }
4547    /// Retrieves this directory with the files at the given paths removed.
4548    ///
4549    /// # Arguments
4550    ///
4551    /// * `paths` - Location of the file to remove (e.g., ["/file.txt"]).
4552    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
4553        let mut query = self.selection.select("withoutFiles");
4554        query = query.arg(
4555            "paths",
4556            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4557        );
4558        Directory {
4559            proc: self.proc.clone(),
4560            selection: query,
4561            graphql_client: self.graphql_client.clone(),
4562        }
4563    }
4564}
4565#[derive(Clone)]
4566pub struct Engine {
4567    pub proc: Option<Arc<DaggerSessionProc>>,
4568    pub selection: Selection,
4569    pub graphql_client: DynGraphQLClient,
4570}
4571impl Engine {
4572    /// A unique identifier for this Engine.
4573    pub async fn id(&self) -> Result<EngineId, DaggerError> {
4574        let query = self.selection.select("id");
4575        query.execute(self.graphql_client.clone()).await
4576    }
4577    /// The local (on-disk) cache for the Dagger engine
4578    pub fn local_cache(&self) -> EngineCache {
4579        let query = self.selection.select("localCache");
4580        EngineCache {
4581            proc: self.proc.clone(),
4582            selection: query,
4583            graphql_client: self.graphql_client.clone(),
4584        }
4585    }
4586}
4587#[derive(Clone)]
4588pub struct EngineCache {
4589    pub proc: Option<Arc<DaggerSessionProc>>,
4590    pub selection: Selection,
4591    pub graphql_client: DynGraphQLClient,
4592}
4593#[derive(Builder, Debug, PartialEq)]
4594pub struct EngineCacheEntrySetOpts<'a> {
4595    #[builder(setter(into, strip_option), default)]
4596    pub key: Option<&'a str>,
4597}
4598impl EngineCache {
4599    /// The current set of entries in the cache
4600    ///
4601    /// # Arguments
4602    ///
4603    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4604    pub fn entry_set(&self) -> EngineCacheEntrySet {
4605        let query = self.selection.select("entrySet");
4606        EngineCacheEntrySet {
4607            proc: self.proc.clone(),
4608            selection: query,
4609            graphql_client: self.graphql_client.clone(),
4610        }
4611    }
4612    /// The current set of entries in the cache
4613    ///
4614    /// # Arguments
4615    ///
4616    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4617    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
4618        let mut query = self.selection.select("entrySet");
4619        if let Some(key) = opts.key {
4620            query = query.arg("key", key);
4621        }
4622        EngineCacheEntrySet {
4623            proc: self.proc.clone(),
4624            selection: query,
4625            graphql_client: self.graphql_client.clone(),
4626        }
4627    }
4628    /// A unique identifier for this EngineCache.
4629    pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
4630        let query = self.selection.select("id");
4631        query.execute(self.graphql_client.clone()).await
4632    }
4633    /// The maximum bytes to keep in the cache without pruning, after which automatic pruning may kick in.
4634    pub async fn keep_bytes(&self) -> Result<isize, DaggerError> {
4635        let query = self.selection.select("keepBytes");
4636        query.execute(self.graphql_client.clone()).await
4637    }
4638    /// The maximum bytes to keep in the cache without pruning.
4639    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
4640        let query = self.selection.select("maxUsedSpace");
4641        query.execute(self.graphql_client.clone()).await
4642    }
4643    /// The target amount of free disk space the garbage collector will attempt to leave.
4644    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
4645        let query = self.selection.select("minFreeSpace");
4646        query.execute(self.graphql_client.clone()).await
4647    }
4648    /// Prune the cache of releaseable entries
4649    pub async fn prune(&self) -> Result<Void, DaggerError> {
4650        let query = self.selection.select("prune");
4651        query.execute(self.graphql_client.clone()).await
4652    }
4653    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
4654        let query = self.selection.select("reservedSpace");
4655        query.execute(self.graphql_client.clone()).await
4656    }
4657}
4658#[derive(Clone)]
4659pub struct EngineCacheEntry {
4660    pub proc: Option<Arc<DaggerSessionProc>>,
4661    pub selection: Selection,
4662    pub graphql_client: DynGraphQLClient,
4663}
4664impl EngineCacheEntry {
4665    /// Whether the cache entry is actively being used.
4666    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
4667        let query = self.selection.select("activelyUsed");
4668        query.execute(self.graphql_client.clone()).await
4669    }
4670    /// The time the cache entry was created, in Unix nanoseconds.
4671    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
4672        let query = self.selection.select("createdTimeUnixNano");
4673        query.execute(self.graphql_client.clone()).await
4674    }
4675    /// The description of the cache entry.
4676    pub async fn description(&self) -> Result<String, DaggerError> {
4677        let query = self.selection.select("description");
4678        query.execute(self.graphql_client.clone()).await
4679    }
4680    /// The disk space used by the cache entry.
4681    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
4682        let query = self.selection.select("diskSpaceBytes");
4683        query.execute(self.graphql_client.clone()).await
4684    }
4685    /// A unique identifier for this EngineCacheEntry.
4686    pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
4687        let query = self.selection.select("id");
4688        query.execute(self.graphql_client.clone()).await
4689    }
4690    /// The most recent time the cache entry was used, in Unix nanoseconds.
4691    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
4692        let query = self.selection.select("mostRecentUseTimeUnixNano");
4693        query.execute(self.graphql_client.clone()).await
4694    }
4695}
4696#[derive(Clone)]
4697pub struct EngineCacheEntrySet {
4698    pub proc: Option<Arc<DaggerSessionProc>>,
4699    pub selection: Selection,
4700    pub graphql_client: DynGraphQLClient,
4701}
4702impl EngineCacheEntrySet {
4703    /// The total disk space used by the cache entries in this set.
4704    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
4705        let query = self.selection.select("diskSpaceBytes");
4706        query.execute(self.graphql_client.clone()).await
4707    }
4708    /// The list of individual cache entries in the set
4709    pub fn entries(&self) -> Vec<EngineCacheEntry> {
4710        let query = self.selection.select("entries");
4711        vec![EngineCacheEntry {
4712            proc: self.proc.clone(),
4713            selection: query,
4714            graphql_client: self.graphql_client.clone(),
4715        }]
4716    }
4717    /// The number of cache entries in this set.
4718    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
4719        let query = self.selection.select("entryCount");
4720        query.execute(self.graphql_client.clone()).await
4721    }
4722    /// A unique identifier for this EngineCacheEntrySet.
4723    pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
4724        let query = self.selection.select("id");
4725        query.execute(self.graphql_client.clone()).await
4726    }
4727}
4728#[derive(Clone)]
4729pub struct EnumTypeDef {
4730    pub proc: Option<Arc<DaggerSessionProc>>,
4731    pub selection: Selection,
4732    pub graphql_client: DynGraphQLClient,
4733}
4734impl EnumTypeDef {
4735    /// A doc string for the enum, if any.
4736    pub async fn description(&self) -> Result<String, DaggerError> {
4737        let query = self.selection.select("description");
4738        query.execute(self.graphql_client.clone()).await
4739    }
4740    /// A unique identifier for this EnumTypeDef.
4741    pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
4742        let query = self.selection.select("id");
4743        query.execute(self.graphql_client.clone()).await
4744    }
4745    /// The name of the enum.
4746    pub async fn name(&self) -> Result<String, DaggerError> {
4747        let query = self.selection.select("name");
4748        query.execute(self.graphql_client.clone()).await
4749    }
4750    /// The location of this enum declaration.
4751    pub fn source_map(&self) -> SourceMap {
4752        let query = self.selection.select("sourceMap");
4753        SourceMap {
4754            proc: self.proc.clone(),
4755            selection: query,
4756            graphql_client: self.graphql_client.clone(),
4757        }
4758    }
4759    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
4760    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
4761        let query = self.selection.select("sourceModuleName");
4762        query.execute(self.graphql_client.clone()).await
4763    }
4764    /// The values of the enum.
4765    pub fn values(&self) -> Vec<EnumValueTypeDef> {
4766        let query = self.selection.select("values");
4767        vec![EnumValueTypeDef {
4768            proc: self.proc.clone(),
4769            selection: query,
4770            graphql_client: self.graphql_client.clone(),
4771        }]
4772    }
4773}
4774#[derive(Clone)]
4775pub struct EnumValueTypeDef {
4776    pub proc: Option<Arc<DaggerSessionProc>>,
4777    pub selection: Selection,
4778    pub graphql_client: DynGraphQLClient,
4779}
4780impl EnumValueTypeDef {
4781    /// A doc string for the enum value, if any.
4782    pub async fn description(&self) -> Result<String, DaggerError> {
4783        let query = self.selection.select("description");
4784        query.execute(self.graphql_client.clone()).await
4785    }
4786    /// A unique identifier for this EnumValueTypeDef.
4787    pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
4788        let query = self.selection.select("id");
4789        query.execute(self.graphql_client.clone()).await
4790    }
4791    /// The name of the enum value.
4792    pub async fn name(&self) -> Result<String, DaggerError> {
4793        let query = self.selection.select("name");
4794        query.execute(self.graphql_client.clone()).await
4795    }
4796    /// The location of this enum value declaration.
4797    pub fn source_map(&self) -> SourceMap {
4798        let query = self.selection.select("sourceMap");
4799        SourceMap {
4800            proc: self.proc.clone(),
4801            selection: query,
4802            graphql_client: self.graphql_client.clone(),
4803        }
4804    }
4805}
4806#[derive(Clone)]
4807pub struct EnvVariable {
4808    pub proc: Option<Arc<DaggerSessionProc>>,
4809    pub selection: Selection,
4810    pub graphql_client: DynGraphQLClient,
4811}
4812impl EnvVariable {
4813    /// A unique identifier for this EnvVariable.
4814    pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
4815        let query = self.selection.select("id");
4816        query.execute(self.graphql_client.clone()).await
4817    }
4818    /// The environment variable name.
4819    pub async fn name(&self) -> Result<String, DaggerError> {
4820        let query = self.selection.select("name");
4821        query.execute(self.graphql_client.clone()).await
4822    }
4823    /// The environment variable value.
4824    pub async fn value(&self) -> Result<String, DaggerError> {
4825        let query = self.selection.select("value");
4826        query.execute(self.graphql_client.clone()).await
4827    }
4828}
4829#[derive(Clone)]
4830pub struct Error {
4831    pub proc: Option<Arc<DaggerSessionProc>>,
4832    pub selection: Selection,
4833    pub graphql_client: DynGraphQLClient,
4834}
4835impl Error {
4836    /// A unique identifier for this Error.
4837    pub async fn id(&self) -> Result<ErrorId, DaggerError> {
4838        let query = self.selection.select("id");
4839        query.execute(self.graphql_client.clone()).await
4840    }
4841    /// A description of the error.
4842    pub async fn message(&self) -> Result<String, DaggerError> {
4843        let query = self.selection.select("message");
4844        query.execute(self.graphql_client.clone()).await
4845    }
4846}
4847#[derive(Clone)]
4848pub struct FieldTypeDef {
4849    pub proc: Option<Arc<DaggerSessionProc>>,
4850    pub selection: Selection,
4851    pub graphql_client: DynGraphQLClient,
4852}
4853impl FieldTypeDef {
4854    /// A doc string for the field, if any.
4855    pub async fn description(&self) -> Result<String, DaggerError> {
4856        let query = self.selection.select("description");
4857        query.execute(self.graphql_client.clone()).await
4858    }
4859    /// A unique identifier for this FieldTypeDef.
4860    pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
4861        let query = self.selection.select("id");
4862        query.execute(self.graphql_client.clone()).await
4863    }
4864    /// The name of the field in lowerCamelCase format.
4865    pub async fn name(&self) -> Result<String, DaggerError> {
4866        let query = self.selection.select("name");
4867        query.execute(self.graphql_client.clone()).await
4868    }
4869    /// The location of this field declaration.
4870    pub fn source_map(&self) -> SourceMap {
4871        let query = self.selection.select("sourceMap");
4872        SourceMap {
4873            proc: self.proc.clone(),
4874            selection: query,
4875            graphql_client: self.graphql_client.clone(),
4876        }
4877    }
4878    /// The type of the field.
4879    pub fn type_def(&self) -> TypeDef {
4880        let query = self.selection.select("typeDef");
4881        TypeDef {
4882            proc: self.proc.clone(),
4883            selection: query,
4884            graphql_client: self.graphql_client.clone(),
4885        }
4886    }
4887}
4888#[derive(Clone)]
4889pub struct File {
4890    pub proc: Option<Arc<DaggerSessionProc>>,
4891    pub selection: Selection,
4892    pub graphql_client: DynGraphQLClient,
4893}
4894#[derive(Builder, Debug, PartialEq)]
4895pub struct FileDigestOpts {
4896    /// If true, exclude metadata from the digest.
4897    #[builder(setter(into, strip_option), default)]
4898    pub exclude_metadata: Option<bool>,
4899}
4900#[derive(Builder, Debug, PartialEq)]
4901pub struct FileExportOpts {
4902    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
4903    #[builder(setter(into, strip_option), default)]
4904    pub allow_parent_dir_path: Option<bool>,
4905}
4906impl File {
4907    /// Retrieves the contents of the file.
4908    pub async fn contents(&self) -> Result<String, DaggerError> {
4909        let query = self.selection.select("contents");
4910        query.execute(self.graphql_client.clone()).await
4911    }
4912    /// 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.
4913    ///
4914    /// # Arguments
4915    ///
4916    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4917    pub async fn digest(&self) -> Result<String, DaggerError> {
4918        let query = self.selection.select("digest");
4919        query.execute(self.graphql_client.clone()).await
4920    }
4921    /// 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.
4922    ///
4923    /// # Arguments
4924    ///
4925    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4926    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
4927        let mut query = self.selection.select("digest");
4928        if let Some(exclude_metadata) = opts.exclude_metadata {
4929            query = query.arg("excludeMetadata", exclude_metadata);
4930        }
4931        query.execute(self.graphql_client.clone()).await
4932    }
4933    /// Writes the file to a file path on the host.
4934    ///
4935    /// # Arguments
4936    ///
4937    /// * `path` - Location of the written directory (e.g., "output.txt").
4938    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4939    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4940        let mut query = self.selection.select("export");
4941        query = query.arg("path", path.into());
4942        query.execute(self.graphql_client.clone()).await
4943    }
4944    /// Writes the file to a file path on the host.
4945    ///
4946    /// # Arguments
4947    ///
4948    /// * `path` - Location of the written directory (e.g., "output.txt").
4949    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4950    pub async fn export_opts(
4951        &self,
4952        path: impl Into<String>,
4953        opts: FileExportOpts,
4954    ) -> Result<String, DaggerError> {
4955        let mut query = self.selection.select("export");
4956        query = query.arg("path", path.into());
4957        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
4958            query = query.arg("allowParentDirPath", allow_parent_dir_path);
4959        }
4960        query.execute(self.graphql_client.clone()).await
4961    }
4962    /// A unique identifier for this File.
4963    pub async fn id(&self) -> Result<FileId, DaggerError> {
4964        let query = self.selection.select("id");
4965        query.execute(self.graphql_client.clone()).await
4966    }
4967    /// Retrieves the name of the file.
4968    pub async fn name(&self) -> Result<String, DaggerError> {
4969        let query = self.selection.select("name");
4970        query.execute(self.graphql_client.clone()).await
4971    }
4972    /// Retrieves the size of the file, in bytes.
4973    pub async fn size(&self) -> Result<isize, DaggerError> {
4974        let query = self.selection.select("size");
4975        query.execute(self.graphql_client.clone()).await
4976    }
4977    /// Force evaluation in the engine.
4978    pub async fn sync(&self) -> Result<FileId, DaggerError> {
4979        let query = self.selection.select("sync");
4980        query.execute(self.graphql_client.clone()).await
4981    }
4982    /// Retrieves this file with its name set to the given name.
4983    ///
4984    /// # Arguments
4985    ///
4986    /// * `name` - Name to set file to.
4987    pub fn with_name(&self, name: impl Into<String>) -> File {
4988        let mut query = self.selection.select("withName");
4989        query = query.arg("name", name.into());
4990        File {
4991            proc: self.proc.clone(),
4992            selection: query,
4993            graphql_client: self.graphql_client.clone(),
4994        }
4995    }
4996    /// Retrieves this file with its created/modified timestamps set to the given time.
4997    ///
4998    /// # Arguments
4999    ///
5000    /// * `timestamp` - Timestamp to set dir/files in.
5001    ///
5002    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
5003    pub fn with_timestamps(&self, timestamp: isize) -> File {
5004        let mut query = self.selection.select("withTimestamps");
5005        query = query.arg("timestamp", timestamp);
5006        File {
5007            proc: self.proc.clone(),
5008            selection: query,
5009            graphql_client: self.graphql_client.clone(),
5010        }
5011    }
5012}
5013#[derive(Clone)]
5014pub struct Function {
5015    pub proc: Option<Arc<DaggerSessionProc>>,
5016    pub selection: Selection,
5017    pub graphql_client: DynGraphQLClient,
5018}
5019#[derive(Builder, Debug, PartialEq)]
5020pub struct FunctionWithArgOpts<'a> {
5021    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
5022    #[builder(setter(into, strip_option), default)]
5023    pub default_path: Option<&'a str>,
5024    /// A default value to use for this argument if not explicitly set by the caller, if any
5025    #[builder(setter(into, strip_option), default)]
5026    pub default_value: Option<Json>,
5027    /// A doc string for the argument, if any
5028    #[builder(setter(into, strip_option), default)]
5029    pub description: Option<&'a str>,
5030    /// Patterns to ignore when loading the contextual argument value.
5031    #[builder(setter(into, strip_option), default)]
5032    pub ignore: Option<Vec<&'a str>>,
5033    #[builder(setter(into, strip_option), default)]
5034    pub source_map: Option<SourceMapId>,
5035}
5036impl Function {
5037    /// Arguments accepted by the function, if any.
5038    pub fn args(&self) -> Vec<FunctionArg> {
5039        let query = self.selection.select("args");
5040        vec![FunctionArg {
5041            proc: self.proc.clone(),
5042            selection: query,
5043            graphql_client: self.graphql_client.clone(),
5044        }]
5045    }
5046    /// A doc string for the function, if any.
5047    pub async fn description(&self) -> Result<String, DaggerError> {
5048        let query = self.selection.select("description");
5049        query.execute(self.graphql_client.clone()).await
5050    }
5051    /// A unique identifier for this Function.
5052    pub async fn id(&self) -> Result<FunctionId, DaggerError> {
5053        let query = self.selection.select("id");
5054        query.execute(self.graphql_client.clone()).await
5055    }
5056    /// The name of the function.
5057    pub async fn name(&self) -> Result<String, DaggerError> {
5058        let query = self.selection.select("name");
5059        query.execute(self.graphql_client.clone()).await
5060    }
5061    /// The type returned by the function.
5062    pub fn return_type(&self) -> TypeDef {
5063        let query = self.selection.select("returnType");
5064        TypeDef {
5065            proc: self.proc.clone(),
5066            selection: query,
5067            graphql_client: self.graphql_client.clone(),
5068        }
5069    }
5070    /// The location of this function declaration.
5071    pub fn source_map(&self) -> SourceMap {
5072        let query = self.selection.select("sourceMap");
5073        SourceMap {
5074            proc: self.proc.clone(),
5075            selection: query,
5076            graphql_client: self.graphql_client.clone(),
5077        }
5078    }
5079    /// Returns the function with the provided argument
5080    ///
5081    /// # Arguments
5082    ///
5083    /// * `name` - The name of the argument
5084    /// * `type_def` - The type of the argument
5085    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5086    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
5087        let mut query = self.selection.select("withArg");
5088        query = query.arg("name", name.into());
5089        query = query.arg_lazy(
5090            "typeDef",
5091            Box::new(move || {
5092                let type_def = type_def.clone();
5093                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
5094            }),
5095        );
5096        Function {
5097            proc: self.proc.clone(),
5098            selection: query,
5099            graphql_client: self.graphql_client.clone(),
5100        }
5101    }
5102    /// Returns the function with the provided argument
5103    ///
5104    /// # Arguments
5105    ///
5106    /// * `name` - The name of the argument
5107    /// * `type_def` - The type of the argument
5108    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5109    pub fn with_arg_opts<'a>(
5110        &self,
5111        name: impl Into<String>,
5112        type_def: impl IntoID<TypeDefId>,
5113        opts: FunctionWithArgOpts<'a>,
5114    ) -> Function {
5115        let mut query = self.selection.select("withArg");
5116        query = query.arg("name", name.into());
5117        query = query.arg_lazy(
5118            "typeDef",
5119            Box::new(move || {
5120                let type_def = type_def.clone();
5121                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
5122            }),
5123        );
5124        if let Some(description) = opts.description {
5125            query = query.arg("description", description);
5126        }
5127        if let Some(default_value) = opts.default_value {
5128            query = query.arg("defaultValue", default_value);
5129        }
5130        if let Some(default_path) = opts.default_path {
5131            query = query.arg("defaultPath", default_path);
5132        }
5133        if let Some(ignore) = opts.ignore {
5134            query = query.arg("ignore", ignore);
5135        }
5136        if let Some(source_map) = opts.source_map {
5137            query = query.arg("sourceMap", source_map);
5138        }
5139        Function {
5140            proc: self.proc.clone(),
5141            selection: query,
5142            graphql_client: self.graphql_client.clone(),
5143        }
5144    }
5145    /// Returns the function with the given doc string.
5146    ///
5147    /// # Arguments
5148    ///
5149    /// * `description` - The doc string to set.
5150    pub fn with_description(&self, description: impl Into<String>) -> Function {
5151        let mut query = self.selection.select("withDescription");
5152        query = query.arg("description", description.into());
5153        Function {
5154            proc: self.proc.clone(),
5155            selection: query,
5156            graphql_client: self.graphql_client.clone(),
5157        }
5158    }
5159    /// Returns the function with the given source map.
5160    ///
5161    /// # Arguments
5162    ///
5163    /// * `source_map` - The source map for the function definition.
5164    pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
5165        let mut query = self.selection.select("withSourceMap");
5166        query = query.arg_lazy(
5167            "sourceMap",
5168            Box::new(move || {
5169                let source_map = source_map.clone();
5170                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
5171            }),
5172        );
5173        Function {
5174            proc: self.proc.clone(),
5175            selection: query,
5176            graphql_client: self.graphql_client.clone(),
5177        }
5178    }
5179}
5180#[derive(Clone)]
5181pub struct FunctionArg {
5182    pub proc: Option<Arc<DaggerSessionProc>>,
5183    pub selection: Selection,
5184    pub graphql_client: DynGraphQLClient,
5185}
5186impl FunctionArg {
5187    /// 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
5188    pub async fn default_path(&self) -> Result<String, DaggerError> {
5189        let query = self.selection.select("defaultPath");
5190        query.execute(self.graphql_client.clone()).await
5191    }
5192    /// A default value to use for this argument when not explicitly set by the caller, if any.
5193    pub async fn default_value(&self) -> Result<Json, DaggerError> {
5194        let query = self.selection.select("defaultValue");
5195        query.execute(self.graphql_client.clone()).await
5196    }
5197    /// A doc string for the argument, if any.
5198    pub async fn description(&self) -> Result<String, DaggerError> {
5199        let query = self.selection.select("description");
5200        query.execute(self.graphql_client.clone()).await
5201    }
5202    /// A unique identifier for this FunctionArg.
5203    pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
5204        let query = self.selection.select("id");
5205        query.execute(self.graphql_client.clone()).await
5206    }
5207    /// 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.
5208    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
5209        let query = self.selection.select("ignore");
5210        query.execute(self.graphql_client.clone()).await
5211    }
5212    /// The name of the argument in lowerCamelCase format.
5213    pub async fn name(&self) -> Result<String, DaggerError> {
5214        let query = self.selection.select("name");
5215        query.execute(self.graphql_client.clone()).await
5216    }
5217    /// The location of this arg declaration.
5218    pub fn source_map(&self) -> SourceMap {
5219        let query = self.selection.select("sourceMap");
5220        SourceMap {
5221            proc: self.proc.clone(),
5222            selection: query,
5223            graphql_client: self.graphql_client.clone(),
5224        }
5225    }
5226    /// The type of the argument.
5227    pub fn type_def(&self) -> TypeDef {
5228        let query = self.selection.select("typeDef");
5229        TypeDef {
5230            proc: self.proc.clone(),
5231            selection: query,
5232            graphql_client: self.graphql_client.clone(),
5233        }
5234    }
5235}
5236#[derive(Clone)]
5237pub struct FunctionCall {
5238    pub proc: Option<Arc<DaggerSessionProc>>,
5239    pub selection: Selection,
5240    pub graphql_client: DynGraphQLClient,
5241}
5242impl FunctionCall {
5243    /// A unique identifier for this FunctionCall.
5244    pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
5245        let query = self.selection.select("id");
5246        query.execute(self.graphql_client.clone()).await
5247    }
5248    /// The argument values the function is being invoked with.
5249    pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
5250        let query = self.selection.select("inputArgs");
5251        vec![FunctionCallArgValue {
5252            proc: self.proc.clone(),
5253            selection: query,
5254            graphql_client: self.graphql_client.clone(),
5255        }]
5256    }
5257    /// The name of the function being called.
5258    pub async fn name(&self) -> Result<String, DaggerError> {
5259        let query = self.selection.select("name");
5260        query.execute(self.graphql_client.clone()).await
5261    }
5262    /// 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.
5263    pub async fn parent(&self) -> Result<Json, DaggerError> {
5264        let query = self.selection.select("parent");
5265        query.execute(self.graphql_client.clone()).await
5266    }
5267    /// 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.
5268    pub async fn parent_name(&self) -> Result<String, DaggerError> {
5269        let query = self.selection.select("parentName");
5270        query.execute(self.graphql_client.clone()).await
5271    }
5272    /// Return an error from the function.
5273    ///
5274    /// # Arguments
5275    ///
5276    /// * `error` - The error to return.
5277    pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
5278        let mut query = self.selection.select("returnError");
5279        query = query.arg_lazy(
5280            "error",
5281            Box::new(move || {
5282                let error = error.clone();
5283                Box::pin(async move { error.into_id().await.unwrap().quote() })
5284            }),
5285        );
5286        query.execute(self.graphql_client.clone()).await
5287    }
5288    /// Set the return value of the function call to the provided value.
5289    ///
5290    /// # Arguments
5291    ///
5292    /// * `value` - JSON serialization of the return value.
5293    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
5294        let mut query = self.selection.select("returnValue");
5295        query = query.arg("value", value);
5296        query.execute(self.graphql_client.clone()).await
5297    }
5298}
5299#[derive(Clone)]
5300pub struct FunctionCallArgValue {
5301    pub proc: Option<Arc<DaggerSessionProc>>,
5302    pub selection: Selection,
5303    pub graphql_client: DynGraphQLClient,
5304}
5305impl FunctionCallArgValue {
5306    /// A unique identifier for this FunctionCallArgValue.
5307    pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
5308        let query = self.selection.select("id");
5309        query.execute(self.graphql_client.clone()).await
5310    }
5311    /// The name of the argument.
5312    pub async fn name(&self) -> Result<String, DaggerError> {
5313        let query = self.selection.select("name");
5314        query.execute(self.graphql_client.clone()).await
5315    }
5316    /// The value of the argument represented as a JSON serialized string.
5317    pub async fn value(&self) -> Result<Json, DaggerError> {
5318        let query = self.selection.select("value");
5319        query.execute(self.graphql_client.clone()).await
5320    }
5321}
5322#[derive(Clone)]
5323pub struct GeneratedCode {
5324    pub proc: Option<Arc<DaggerSessionProc>>,
5325    pub selection: Selection,
5326    pub graphql_client: DynGraphQLClient,
5327}
5328impl GeneratedCode {
5329    /// The directory containing the generated code.
5330    pub fn code(&self) -> Directory {
5331        let query = self.selection.select("code");
5332        Directory {
5333            proc: self.proc.clone(),
5334            selection: query,
5335            graphql_client: self.graphql_client.clone(),
5336        }
5337    }
5338    /// A unique identifier for this GeneratedCode.
5339    pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
5340        let query = self.selection.select("id");
5341        query.execute(self.graphql_client.clone()).await
5342    }
5343    /// List of paths to mark generated in version control (i.e. .gitattributes).
5344    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
5345        let query = self.selection.select("vcsGeneratedPaths");
5346        query.execute(self.graphql_client.clone()).await
5347    }
5348    /// List of paths to ignore in version control (i.e. .gitignore).
5349    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
5350        let query = self.selection.select("vcsIgnoredPaths");
5351        query.execute(self.graphql_client.clone()).await
5352    }
5353    /// Set the list of paths to mark generated in version control.
5354    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
5355        let mut query = self.selection.select("withVCSGeneratedPaths");
5356        query = query.arg(
5357            "paths",
5358            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5359        );
5360        GeneratedCode {
5361            proc: self.proc.clone(),
5362            selection: query,
5363            graphql_client: self.graphql_client.clone(),
5364        }
5365    }
5366    /// Set the list of paths to ignore in version control.
5367    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
5368        let mut query = self.selection.select("withVCSIgnoredPaths");
5369        query = query.arg(
5370            "paths",
5371            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5372        );
5373        GeneratedCode {
5374            proc: self.proc.clone(),
5375            selection: query,
5376            graphql_client: self.graphql_client.clone(),
5377        }
5378    }
5379}
5380#[derive(Clone)]
5381pub struct GitRef {
5382    pub proc: Option<Arc<DaggerSessionProc>>,
5383    pub selection: Selection,
5384    pub graphql_client: DynGraphQLClient,
5385}
5386#[derive(Builder, Debug, PartialEq)]
5387pub struct GitRefTreeOpts {
5388    /// Set to true to discard .git directory.
5389    #[builder(setter(into, strip_option), default)]
5390    pub discard_git_dir: Option<bool>,
5391}
5392impl GitRef {
5393    /// The resolved commit id at this ref.
5394    pub async fn commit(&self) -> Result<String, DaggerError> {
5395        let query = self.selection.select("commit");
5396        query.execute(self.graphql_client.clone()).await
5397    }
5398    /// A unique identifier for this GitRef.
5399    pub async fn id(&self) -> Result<GitRefId, DaggerError> {
5400        let query = self.selection.select("id");
5401        query.execute(self.graphql_client.clone()).await
5402    }
5403    /// The filesystem tree at this ref.
5404    ///
5405    /// # Arguments
5406    ///
5407    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5408    pub fn tree(&self) -> Directory {
5409        let query = self.selection.select("tree");
5410        Directory {
5411            proc: self.proc.clone(),
5412            selection: query,
5413            graphql_client: self.graphql_client.clone(),
5414        }
5415    }
5416    /// The filesystem tree at this ref.
5417    ///
5418    /// # Arguments
5419    ///
5420    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5421    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
5422        let mut query = self.selection.select("tree");
5423        if let Some(discard_git_dir) = opts.discard_git_dir {
5424            query = query.arg("discardGitDir", discard_git_dir);
5425        }
5426        Directory {
5427            proc: self.proc.clone(),
5428            selection: query,
5429            graphql_client: self.graphql_client.clone(),
5430        }
5431    }
5432}
5433#[derive(Clone)]
5434pub struct GitRepository {
5435    pub proc: Option<Arc<DaggerSessionProc>>,
5436    pub selection: Selection,
5437    pub graphql_client: DynGraphQLClient,
5438}
5439#[derive(Builder, Debug, PartialEq)]
5440pub struct GitRepositoryTagsOpts<'a> {
5441    /// Glob patterns (e.g., "refs/tags/v*").
5442    #[builder(setter(into, strip_option), default)]
5443    pub patterns: Option<Vec<&'a str>>,
5444}
5445impl GitRepository {
5446    /// Returns details of a branch.
5447    ///
5448    /// # Arguments
5449    ///
5450    /// * `name` - Branch's name (e.g., "main").
5451    pub fn branch(&self, name: impl Into<String>) -> GitRef {
5452        let mut query = self.selection.select("branch");
5453        query = query.arg("name", name.into());
5454        GitRef {
5455            proc: self.proc.clone(),
5456            selection: query,
5457            graphql_client: self.graphql_client.clone(),
5458        }
5459    }
5460    /// Returns details of a commit.
5461    ///
5462    /// # Arguments
5463    ///
5464    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
5465    pub fn commit(&self, id: impl Into<String>) -> GitRef {
5466        let mut query = self.selection.select("commit");
5467        query = query.arg("id", id.into());
5468        GitRef {
5469            proc: self.proc.clone(),
5470            selection: query,
5471            graphql_client: self.graphql_client.clone(),
5472        }
5473    }
5474    /// Returns details for HEAD.
5475    pub fn head(&self) -> GitRef {
5476        let query = self.selection.select("head");
5477        GitRef {
5478            proc: self.proc.clone(),
5479            selection: query,
5480            graphql_client: self.graphql_client.clone(),
5481        }
5482    }
5483    /// A unique identifier for this GitRepository.
5484    pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
5485        let query = self.selection.select("id");
5486        query.execute(self.graphql_client.clone()).await
5487    }
5488    /// Returns details of a ref.
5489    ///
5490    /// # Arguments
5491    ///
5492    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
5493    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
5494        let mut query = self.selection.select("ref");
5495        query = query.arg("name", name.into());
5496        GitRef {
5497            proc: self.proc.clone(),
5498            selection: query,
5499            graphql_client: self.graphql_client.clone(),
5500        }
5501    }
5502    /// Returns details of a tag.
5503    ///
5504    /// # Arguments
5505    ///
5506    /// * `name` - Tag's name (e.g., "v0.3.9").
5507    pub fn tag(&self, name: impl Into<String>) -> GitRef {
5508        let mut query = self.selection.select("tag");
5509        query = query.arg("name", name.into());
5510        GitRef {
5511            proc: self.proc.clone(),
5512            selection: query,
5513            graphql_client: self.graphql_client.clone(),
5514        }
5515    }
5516    /// tags that match any of the given glob patterns.
5517    ///
5518    /// # Arguments
5519    ///
5520    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5521    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
5522        let query = self.selection.select("tags");
5523        query.execute(self.graphql_client.clone()).await
5524    }
5525    /// tags that match any of the given glob patterns.
5526    ///
5527    /// # Arguments
5528    ///
5529    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5530    pub async fn tags_opts<'a>(
5531        &self,
5532        opts: GitRepositoryTagsOpts<'a>,
5533    ) -> Result<Vec<String>, DaggerError> {
5534        let mut query = self.selection.select("tags");
5535        if let Some(patterns) = opts.patterns {
5536            query = query.arg("patterns", patterns);
5537        }
5538        query.execute(self.graphql_client.clone()).await
5539    }
5540    /// Header to authenticate the remote with.
5541    ///
5542    /// # Arguments
5543    ///
5544    /// * `header` - Secret used to populate the Authorization HTTP header
5545    pub fn with_auth_header(&self, header: impl IntoID<SecretId>) -> GitRepository {
5546        let mut query = self.selection.select("withAuthHeader");
5547        query = query.arg_lazy(
5548            "header",
5549            Box::new(move || {
5550                let header = header.clone();
5551                Box::pin(async move { header.into_id().await.unwrap().quote() })
5552            }),
5553        );
5554        GitRepository {
5555            proc: self.proc.clone(),
5556            selection: query,
5557            graphql_client: self.graphql_client.clone(),
5558        }
5559    }
5560    /// Token to authenticate the remote with.
5561    ///
5562    /// # Arguments
5563    ///
5564    /// * `token` - Secret used to populate the password during basic HTTP Authorization
5565    pub fn with_auth_token(&self, token: impl IntoID<SecretId>) -> GitRepository {
5566        let mut query = self.selection.select("withAuthToken");
5567        query = query.arg_lazy(
5568            "token",
5569            Box::new(move || {
5570                let token = token.clone();
5571                Box::pin(async move { token.into_id().await.unwrap().quote() })
5572            }),
5573        );
5574        GitRepository {
5575            proc: self.proc.clone(),
5576            selection: query,
5577            graphql_client: self.graphql_client.clone(),
5578        }
5579    }
5580}
5581#[derive(Clone)]
5582pub struct Host {
5583    pub proc: Option<Arc<DaggerSessionProc>>,
5584    pub selection: Selection,
5585    pub graphql_client: DynGraphQLClient,
5586}
5587#[derive(Builder, Debug, PartialEq)]
5588pub struct HostDirectoryOpts<'a> {
5589    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
5590    #[builder(setter(into, strip_option), default)]
5591    pub exclude: Option<Vec<&'a str>>,
5592    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
5593    #[builder(setter(into, strip_option), default)]
5594    pub include: Option<Vec<&'a str>>,
5595}
5596#[derive(Builder, Debug, PartialEq)]
5597pub struct HostServiceOpts<'a> {
5598    /// Upstream host to forward traffic to.
5599    #[builder(setter(into, strip_option), default)]
5600    pub host: Option<&'a str>,
5601}
5602#[derive(Builder, Debug, PartialEq)]
5603pub struct HostTunnelOpts {
5604    /// Map each service port to the same port on the host, as if the service were running natively.
5605    /// Note: enabling may result in port conflicts.
5606    #[builder(setter(into, strip_option), default)]
5607    pub native: Option<bool>,
5608    /// Configure explicit port forwarding rules for the tunnel.
5609    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
5610    /// 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.
5611    /// If ports are given and native is true, the ports are additive.
5612    #[builder(setter(into, strip_option), default)]
5613    pub ports: Option<Vec<PortForward>>,
5614}
5615impl Host {
5616    /// Accesses a directory on the host.
5617    ///
5618    /// # Arguments
5619    ///
5620    /// * `path` - Location of the directory to access (e.g., ".").
5621    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5622    pub fn directory(&self, path: impl Into<String>) -> Directory {
5623        let mut query = self.selection.select("directory");
5624        query = query.arg("path", path.into());
5625        Directory {
5626            proc: self.proc.clone(),
5627            selection: query,
5628            graphql_client: self.graphql_client.clone(),
5629        }
5630    }
5631    /// Accesses a directory on the host.
5632    ///
5633    /// # Arguments
5634    ///
5635    /// * `path` - Location of the directory to access (e.g., ".").
5636    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5637    pub fn directory_opts<'a>(
5638        &self,
5639        path: impl Into<String>,
5640        opts: HostDirectoryOpts<'a>,
5641    ) -> Directory {
5642        let mut query = self.selection.select("directory");
5643        query = query.arg("path", path.into());
5644        if let Some(exclude) = opts.exclude {
5645            query = query.arg("exclude", exclude);
5646        }
5647        if let Some(include) = opts.include {
5648            query = query.arg("include", include);
5649        }
5650        Directory {
5651            proc: self.proc.clone(),
5652            selection: query,
5653            graphql_client: self.graphql_client.clone(),
5654        }
5655    }
5656    /// Accesses a file on the host.
5657    ///
5658    /// # Arguments
5659    ///
5660    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5661    pub fn file(&self, path: impl Into<String>) -> File {
5662        let mut query = self.selection.select("file");
5663        query = query.arg("path", path.into());
5664        File {
5665            proc: self.proc.clone(),
5666            selection: query,
5667            graphql_client: self.graphql_client.clone(),
5668        }
5669    }
5670    /// A unique identifier for this Host.
5671    pub async fn id(&self) -> Result<HostId, DaggerError> {
5672        let query = self.selection.select("id");
5673        query.execute(self.graphql_client.clone()).await
5674    }
5675    /// Creates a service that forwards traffic to a specified address via the host.
5676    ///
5677    /// # Arguments
5678    ///
5679    /// * `ports` - Ports to expose via the service, forwarding through the host network.
5680    ///
5681    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
5682    ///
5683    /// An empty set of ports is not valid; an error will be returned.
5684    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5685    pub fn service(&self, ports: Vec<PortForward>) -> Service {
5686        let mut query = self.selection.select("service");
5687        query = query.arg("ports", ports);
5688        Service {
5689            proc: self.proc.clone(),
5690            selection: query,
5691            graphql_client: self.graphql_client.clone(),
5692        }
5693    }
5694    /// Creates a service that forwards traffic to a specified address via the host.
5695    ///
5696    /// # Arguments
5697    ///
5698    /// * `ports` - Ports to expose via the service, forwarding through the host network.
5699    ///
5700    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
5701    ///
5702    /// An empty set of ports is not valid; an error will be returned.
5703    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5704    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
5705        let mut query = self.selection.select("service");
5706        query = query.arg("ports", ports);
5707        if let Some(host) = opts.host {
5708            query = query.arg("host", host);
5709        }
5710        Service {
5711            proc: self.proc.clone(),
5712            selection: query,
5713            graphql_client: self.graphql_client.clone(),
5714        }
5715    }
5716    /// Sets a secret given a user-defined name and the file path on the host, and returns the secret.
5717    /// The file is limited to a size of 512000 bytes.
5718    ///
5719    /// # Arguments
5720    ///
5721    /// * `name` - The user defined name for this secret.
5722    /// * `path` - Location of the file to set as a secret.
5723    pub fn set_secret_file(&self, name: impl Into<String>, path: impl Into<String>) -> Secret {
5724        let mut query = self.selection.select("setSecretFile");
5725        query = query.arg("name", name.into());
5726        query = query.arg("path", path.into());
5727        Secret {
5728            proc: self.proc.clone(),
5729            selection: query,
5730            graphql_client: self.graphql_client.clone(),
5731        }
5732    }
5733    /// Creates a tunnel that forwards traffic from the host to a service.
5734    ///
5735    /// # Arguments
5736    ///
5737    /// * `service` - Service to send traffic from the tunnel.
5738    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5739    pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
5740        let mut query = self.selection.select("tunnel");
5741        query = query.arg_lazy(
5742            "service",
5743            Box::new(move || {
5744                let service = service.clone();
5745                Box::pin(async move { service.into_id().await.unwrap().quote() })
5746            }),
5747        );
5748        Service {
5749            proc: self.proc.clone(),
5750            selection: query,
5751            graphql_client: self.graphql_client.clone(),
5752        }
5753    }
5754    /// Creates a tunnel that forwards traffic from the host to a service.
5755    ///
5756    /// # Arguments
5757    ///
5758    /// * `service` - Service to send traffic from the tunnel.
5759    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5760    pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
5761        let mut query = self.selection.select("tunnel");
5762        query = query.arg_lazy(
5763            "service",
5764            Box::new(move || {
5765                let service = service.clone();
5766                Box::pin(async move { service.into_id().await.unwrap().quote() })
5767            }),
5768        );
5769        if let Some(ports) = opts.ports {
5770            query = query.arg("ports", ports);
5771        }
5772        if let Some(native) = opts.native {
5773            query = query.arg("native", native);
5774        }
5775        Service {
5776            proc: self.proc.clone(),
5777            selection: query,
5778            graphql_client: self.graphql_client.clone(),
5779        }
5780    }
5781    /// Accesses a Unix socket on the host.
5782    ///
5783    /// # Arguments
5784    ///
5785    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
5786    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
5787        let mut query = self.selection.select("unixSocket");
5788        query = query.arg("path", path.into());
5789        Socket {
5790            proc: self.proc.clone(),
5791            selection: query,
5792            graphql_client: self.graphql_client.clone(),
5793        }
5794    }
5795}
5796#[derive(Clone)]
5797pub struct InputTypeDef {
5798    pub proc: Option<Arc<DaggerSessionProc>>,
5799    pub selection: Selection,
5800    pub graphql_client: DynGraphQLClient,
5801}
5802impl InputTypeDef {
5803    /// Static fields defined on this input object, if any.
5804    pub fn fields(&self) -> Vec<FieldTypeDef> {
5805        let query = self.selection.select("fields");
5806        vec![FieldTypeDef {
5807            proc: self.proc.clone(),
5808            selection: query,
5809            graphql_client: self.graphql_client.clone(),
5810        }]
5811    }
5812    /// A unique identifier for this InputTypeDef.
5813    pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
5814        let query = self.selection.select("id");
5815        query.execute(self.graphql_client.clone()).await
5816    }
5817    /// The name of the input object.
5818    pub async fn name(&self) -> Result<String, DaggerError> {
5819        let query = self.selection.select("name");
5820        query.execute(self.graphql_client.clone()).await
5821    }
5822}
5823#[derive(Clone)]
5824pub struct InterfaceTypeDef {
5825    pub proc: Option<Arc<DaggerSessionProc>>,
5826    pub selection: Selection,
5827    pub graphql_client: DynGraphQLClient,
5828}
5829impl InterfaceTypeDef {
5830    /// The doc string for the interface, if any.
5831    pub async fn description(&self) -> Result<String, DaggerError> {
5832        let query = self.selection.select("description");
5833        query.execute(self.graphql_client.clone()).await
5834    }
5835    /// Functions defined on this interface, if any.
5836    pub fn functions(&self) -> Vec<Function> {
5837        let query = self.selection.select("functions");
5838        vec![Function {
5839            proc: self.proc.clone(),
5840            selection: query,
5841            graphql_client: self.graphql_client.clone(),
5842        }]
5843    }
5844    /// A unique identifier for this InterfaceTypeDef.
5845    pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
5846        let query = self.selection.select("id");
5847        query.execute(self.graphql_client.clone()).await
5848    }
5849    /// The name of the interface.
5850    pub async fn name(&self) -> Result<String, DaggerError> {
5851        let query = self.selection.select("name");
5852        query.execute(self.graphql_client.clone()).await
5853    }
5854    /// The location of this interface declaration.
5855    pub fn source_map(&self) -> SourceMap {
5856        let query = self.selection.select("sourceMap");
5857        SourceMap {
5858            proc: self.proc.clone(),
5859            selection: query,
5860            graphql_client: self.graphql_client.clone(),
5861        }
5862    }
5863    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
5864    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
5865        let query = self.selection.select("sourceModuleName");
5866        query.execute(self.graphql_client.clone()).await
5867    }
5868}
5869#[derive(Clone)]
5870pub struct Label {
5871    pub proc: Option<Arc<DaggerSessionProc>>,
5872    pub selection: Selection,
5873    pub graphql_client: DynGraphQLClient,
5874}
5875impl Label {
5876    /// A unique identifier for this Label.
5877    pub async fn id(&self) -> Result<LabelId, DaggerError> {
5878        let query = self.selection.select("id");
5879        query.execute(self.graphql_client.clone()).await
5880    }
5881    /// The label name.
5882    pub async fn name(&self) -> Result<String, DaggerError> {
5883        let query = self.selection.select("name");
5884        query.execute(self.graphql_client.clone()).await
5885    }
5886    /// The label value.
5887    pub async fn value(&self) -> Result<String, DaggerError> {
5888        let query = self.selection.select("value");
5889        query.execute(self.graphql_client.clone()).await
5890    }
5891}
5892#[derive(Clone)]
5893pub struct ListTypeDef {
5894    pub proc: Option<Arc<DaggerSessionProc>>,
5895    pub selection: Selection,
5896    pub graphql_client: DynGraphQLClient,
5897}
5898impl ListTypeDef {
5899    /// The type of the elements in the list.
5900    pub fn element_type_def(&self) -> TypeDef {
5901        let query = self.selection.select("elementTypeDef");
5902        TypeDef {
5903            proc: self.proc.clone(),
5904            selection: query,
5905            graphql_client: self.graphql_client.clone(),
5906        }
5907    }
5908    /// A unique identifier for this ListTypeDef.
5909    pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
5910        let query = self.selection.select("id");
5911        query.execute(self.graphql_client.clone()).await
5912    }
5913}
5914#[derive(Clone)]
5915pub struct Module {
5916    pub proc: Option<Arc<DaggerSessionProc>>,
5917    pub selection: Selection,
5918    pub graphql_client: DynGraphQLClient,
5919}
5920impl Module {
5921    /// The dependencies of the module.
5922    pub fn dependencies(&self) -> Vec<Module> {
5923        let query = self.selection.select("dependencies");
5924        vec![Module {
5925            proc: self.proc.clone(),
5926            selection: query,
5927            graphql_client: self.graphql_client.clone(),
5928        }]
5929    }
5930    /// The doc string of the module, if any
5931    pub async fn description(&self) -> Result<String, DaggerError> {
5932        let query = self.selection.select("description");
5933        query.execute(self.graphql_client.clone()).await
5934    }
5935    /// Enumerations served by this module.
5936    pub fn enums(&self) -> Vec<TypeDef> {
5937        let query = self.selection.select("enums");
5938        vec![TypeDef {
5939            proc: self.proc.clone(),
5940            selection: query,
5941            graphql_client: self.graphql_client.clone(),
5942        }]
5943    }
5944    /// The generated files and directories made on top of the module source's context directory.
5945    pub fn generated_context_directory(&self) -> Directory {
5946        let query = self.selection.select("generatedContextDirectory");
5947        Directory {
5948            proc: self.proc.clone(),
5949            selection: query,
5950            graphql_client: self.graphql_client.clone(),
5951        }
5952    }
5953    /// A unique identifier for this Module.
5954    pub async fn id(&self) -> Result<ModuleId, DaggerError> {
5955        let query = self.selection.select("id");
5956        query.execute(self.graphql_client.clone()).await
5957    }
5958    /// Interfaces served by this module.
5959    pub fn interfaces(&self) -> Vec<TypeDef> {
5960        let query = self.selection.select("interfaces");
5961        vec![TypeDef {
5962            proc: self.proc.clone(),
5963            selection: query,
5964            graphql_client: self.graphql_client.clone(),
5965        }]
5966    }
5967    /// The name of the module
5968    pub async fn name(&self) -> Result<String, DaggerError> {
5969        let query = self.selection.select("name");
5970        query.execute(self.graphql_client.clone()).await
5971    }
5972    /// Objects served by this module.
5973    pub fn objects(&self) -> Vec<TypeDef> {
5974        let query = self.selection.select("objects");
5975        vec![TypeDef {
5976            proc: self.proc.clone(),
5977            selection: query,
5978            graphql_client: self.graphql_client.clone(),
5979        }]
5980    }
5981    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
5982    pub fn runtime(&self) -> Container {
5983        let query = self.selection.select("runtime");
5984        Container {
5985            proc: self.proc.clone(),
5986            selection: query,
5987            graphql_client: self.graphql_client.clone(),
5988        }
5989    }
5990    /// The SDK config used by this module.
5991    pub fn sdk(&self) -> SdkConfig {
5992        let query = self.selection.select("sdk");
5993        SdkConfig {
5994            proc: self.proc.clone(),
5995            selection: query,
5996            graphql_client: self.graphql_client.clone(),
5997        }
5998    }
5999    /// Serve a module's API in the current session.
6000    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
6001    pub async fn serve(&self) -> Result<Void, DaggerError> {
6002        let query = self.selection.select("serve");
6003        query.execute(self.graphql_client.clone()).await
6004    }
6005    /// The source for the module.
6006    pub fn source(&self) -> ModuleSource {
6007        let query = self.selection.select("source");
6008        ModuleSource {
6009            proc: self.proc.clone(),
6010            selection: query,
6011            graphql_client: self.graphql_client.clone(),
6012        }
6013    }
6014    /// Forces evaluation of the module, including any loading into the engine and associated validation.
6015    pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
6016        let query = self.selection.select("sync");
6017        query.execute(self.graphql_client.clone()).await
6018    }
6019    /// Retrieves the module with the given description
6020    ///
6021    /// # Arguments
6022    ///
6023    /// * `description` - The description to set
6024    pub fn with_description(&self, description: impl Into<String>) -> Module {
6025        let mut query = self.selection.select("withDescription");
6026        query = query.arg("description", description.into());
6027        Module {
6028            proc: self.proc.clone(),
6029            selection: query,
6030            graphql_client: self.graphql_client.clone(),
6031        }
6032    }
6033    /// This module plus the given Enum type and associated values
6034    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
6035        let mut query = self.selection.select("withEnum");
6036        query = query.arg_lazy(
6037            "enum",
6038            Box::new(move || {
6039                let r#enum = r#enum.clone();
6040                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
6041            }),
6042        );
6043        Module {
6044            proc: self.proc.clone(),
6045            selection: query,
6046            graphql_client: self.graphql_client.clone(),
6047        }
6048    }
6049    /// This module plus the given Interface type and associated functions
6050    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
6051        let mut query = self.selection.select("withInterface");
6052        query = query.arg_lazy(
6053            "iface",
6054            Box::new(move || {
6055                let iface = iface.clone();
6056                Box::pin(async move { iface.into_id().await.unwrap().quote() })
6057            }),
6058        );
6059        Module {
6060            proc: self.proc.clone(),
6061            selection: query,
6062            graphql_client: self.graphql_client.clone(),
6063        }
6064    }
6065    /// This module plus the given Object type and associated functions.
6066    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
6067        let mut query = self.selection.select("withObject");
6068        query = query.arg_lazy(
6069            "object",
6070            Box::new(move || {
6071                let object = object.clone();
6072                Box::pin(async move { object.into_id().await.unwrap().quote() })
6073            }),
6074        );
6075        Module {
6076            proc: self.proc.clone(),
6077            selection: query,
6078            graphql_client: self.graphql_client.clone(),
6079        }
6080    }
6081}
6082#[derive(Clone)]
6083pub struct ModuleSource {
6084    pub proc: Option<Arc<DaggerSessionProc>>,
6085    pub selection: Selection,
6086    pub graphql_client: DynGraphQLClient,
6087}
6088impl ModuleSource {
6089    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
6090    pub fn as_module(&self) -> Module {
6091        let query = self.selection.select("asModule");
6092        Module {
6093            proc: self.proc.clone(),
6094            selection: query,
6095            graphql_client: self.graphql_client.clone(),
6096        }
6097    }
6098    /// A human readable ref string representation of this module source.
6099    pub async fn as_string(&self) -> Result<String, DaggerError> {
6100        let query = self.selection.select("asString");
6101        query.execute(self.graphql_client.clone()).await
6102    }
6103    /// The ref to clone the root of the git repo from. Only valid for git sources.
6104    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
6105        let query = self.selection.select("cloneRef");
6106        query.execute(self.graphql_client.clone()).await
6107    }
6108    /// The resolved commit of the git repo this source points to. Only valid for git sources.
6109    pub async fn commit(&self) -> Result<String, DaggerError> {
6110        let query = self.selection.select("commit");
6111        query.execute(self.graphql_client.clone()).await
6112    }
6113    /// Whether an existing dagger.json for the module was found.
6114    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
6115        let query = self.selection.select("configExists");
6116        query.execute(self.graphql_client.clone()).await
6117    }
6118    /// The full directory loaded for the module source, including the source code as a subdirectory.
6119    pub fn context_directory(&self) -> Directory {
6120        let query = self.selection.select("contextDirectory");
6121        Directory {
6122            proc: self.proc.clone(),
6123            selection: query,
6124            graphql_client: self.graphql_client.clone(),
6125        }
6126    }
6127    /// The dependencies of the module source.
6128    pub fn dependencies(&self) -> Vec<ModuleSource> {
6129        let query = self.selection.select("dependencies");
6130        vec![ModuleSource {
6131            proc: self.proc.clone(),
6132            selection: query,
6133            graphql_client: self.graphql_client.clone(),
6134        }]
6135    }
6136    /// 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.
6137    pub async fn digest(&self) -> Result<String, DaggerError> {
6138        let query = self.selection.select("digest");
6139        query.execute(self.graphql_client.clone()).await
6140    }
6141    /// The directory containing the module configuration and source code (source code may be in a subdir).
6142    ///
6143    /// # Arguments
6144    ///
6145    /// * `path` - A subpath from the source directory to select.
6146    pub fn directory(&self, path: impl Into<String>) -> Directory {
6147        let mut query = self.selection.select("directory");
6148        query = query.arg("path", path.into());
6149        Directory {
6150            proc: self.proc.clone(),
6151            selection: query,
6152            graphql_client: self.graphql_client.clone(),
6153        }
6154    }
6155    /// The engine version of the module.
6156    pub async fn engine_version(&self) -> Result<String, DaggerError> {
6157        let query = self.selection.select("engineVersion");
6158        query.execute(self.graphql_client.clone()).await
6159    }
6160    /// The generated files and directories made on top of the module source's context directory.
6161    pub fn generated_context_directory(&self) -> Directory {
6162        let query = self.selection.select("generatedContextDirectory");
6163        Directory {
6164            proc: self.proc.clone(),
6165            selection: query,
6166            graphql_client: self.graphql_client.clone(),
6167        }
6168    }
6169    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket). Only valid for git sources.
6170    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
6171        let query = self.selection.select("htmlRepoURL");
6172        query.execute(self.graphql_client.clone()).await
6173    }
6174    /// The URL to the source's git repo in a web browser. Only valid for git sources.
6175    pub async fn html_url(&self) -> Result<String, DaggerError> {
6176        let query = self.selection.select("htmlURL");
6177        query.execute(self.graphql_client.clone()).await
6178    }
6179    /// A unique identifier for this ModuleSource.
6180    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
6181        let query = self.selection.select("id");
6182        query.execute(self.graphql_client.clone()).await
6183    }
6184    /// The kind of module source (currently local, git or dir).
6185    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
6186        let query = self.selection.select("kind");
6187        query.execute(self.graphql_client.clone()).await
6188    }
6189    /// 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.
6190    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
6191        let query = self.selection.select("localContextDirectoryPath");
6192        query.execute(self.graphql_client.clone()).await
6193    }
6194    /// The name of the module, including any setting via the withName API.
6195    pub async fn module_name(&self) -> Result<String, DaggerError> {
6196        let query = self.selection.select("moduleName");
6197        query.execute(self.graphql_client.clone()).await
6198    }
6199    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
6200    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
6201        let query = self.selection.select("moduleOriginalName");
6202        query.execute(self.graphql_client.clone()).await
6203    }
6204    /// The pinned version of this module source.
6205    pub async fn pin(&self) -> Result<String, DaggerError> {
6206        let query = self.selection.select("pin");
6207        query.execute(self.graphql_client.clone()).await
6208    }
6209    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
6210    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
6211        let query = self.selection.select("repoRootPath");
6212        query.execute(self.graphql_client.clone()).await
6213    }
6214    /// The SDK configuration of the module.
6215    pub fn sdk(&self) -> SdkConfig {
6216        let query = self.selection.select("sdk");
6217        SdkConfig {
6218            proc: self.proc.clone(),
6219            selection: query,
6220            graphql_client: self.graphql_client.clone(),
6221        }
6222    }
6223    /// The path, relative to the context directory, that contains the module's dagger.json.
6224    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
6225        let query = self.selection.select("sourceRootSubpath");
6226        query.execute(self.graphql_client.clone()).await
6227    }
6228    /// The path to the directory containing the module's source code, relative to the context directory.
6229    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
6230        let query = self.selection.select("sourceSubpath");
6231        query.execute(self.graphql_client.clone()).await
6232    }
6233    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
6234    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
6235        let query = self.selection.select("sync");
6236        query.execute(self.graphql_client.clone()).await
6237    }
6238    /// The specified version of the git repo this source points to. Only valid for git sources.
6239    pub async fn version(&self) -> Result<String, DaggerError> {
6240        let query = self.selection.select("version");
6241        query.execute(self.graphql_client.clone()).await
6242    }
6243    /// Append the provided dependencies to the module source's dependency list.
6244    ///
6245    /// # Arguments
6246    ///
6247    /// * `dependencies` - The dependencies to append.
6248    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
6249        let mut query = self.selection.select("withDependencies");
6250        query = query.arg("dependencies", dependencies);
6251        ModuleSource {
6252            proc: self.proc.clone(),
6253            selection: query,
6254            graphql_client: self.graphql_client.clone(),
6255        }
6256    }
6257    /// Upgrade the engine version of the module to the given value.
6258    ///
6259    /// # Arguments
6260    ///
6261    /// * `version` - The engine version to upgrade to.
6262    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
6263        let mut query = self.selection.select("withEngineVersion");
6264        query = query.arg("version", version.into());
6265        ModuleSource {
6266            proc: self.proc.clone(),
6267            selection: query,
6268            graphql_client: self.graphql_client.clone(),
6269        }
6270    }
6271    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
6272    ///
6273    /// # Arguments
6274    ///
6275    /// * `patterns` - The new additional include patterns.
6276    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
6277        let mut query = self.selection.select("withIncludes");
6278        query = query.arg(
6279            "patterns",
6280            patterns
6281                .into_iter()
6282                .map(|i| i.into())
6283                .collect::<Vec<String>>(),
6284        );
6285        ModuleSource {
6286            proc: self.proc.clone(),
6287            selection: query,
6288            graphql_client: self.graphql_client.clone(),
6289        }
6290    }
6291    /// Update the module source with a new name.
6292    ///
6293    /// # Arguments
6294    ///
6295    /// * `name` - The name to set.
6296    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
6297        let mut query = self.selection.select("withName");
6298        query = query.arg("name", name.into());
6299        ModuleSource {
6300            proc: self.proc.clone(),
6301            selection: query,
6302            graphql_client: self.graphql_client.clone(),
6303        }
6304    }
6305    /// Update the module source with a new SDK.
6306    ///
6307    /// # Arguments
6308    ///
6309    /// * `source` - The SDK source to set.
6310    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
6311        let mut query = self.selection.select("withSDK");
6312        query = query.arg("source", source.into());
6313        ModuleSource {
6314            proc: self.proc.clone(),
6315            selection: query,
6316            graphql_client: self.graphql_client.clone(),
6317        }
6318    }
6319    /// Update the module source with a new source subpath.
6320    ///
6321    /// # Arguments
6322    ///
6323    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
6324    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
6325        let mut query = self.selection.select("withSourceSubpath");
6326        query = query.arg("path", path.into());
6327        ModuleSource {
6328            proc: self.proc.clone(),
6329            selection: query,
6330            graphql_client: self.graphql_client.clone(),
6331        }
6332    }
6333    /// Update one or more module dependencies.
6334    ///
6335    /// # Arguments
6336    ///
6337    /// * `dependencies` - The dependencies to update.
6338    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
6339        let mut query = self.selection.select("withUpdateDependencies");
6340        query = query.arg(
6341            "dependencies",
6342            dependencies
6343                .into_iter()
6344                .map(|i| i.into())
6345                .collect::<Vec<String>>(),
6346        );
6347        ModuleSource {
6348            proc: self.proc.clone(),
6349            selection: query,
6350            graphql_client: self.graphql_client.clone(),
6351        }
6352    }
6353    /// Remove the provided dependencies from the module source's dependency list.
6354    ///
6355    /// # Arguments
6356    ///
6357    /// * `dependencies` - The dependencies to remove.
6358    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
6359        let mut query = self.selection.select("withoutDependencies");
6360        query = query.arg(
6361            "dependencies",
6362            dependencies
6363                .into_iter()
6364                .map(|i| i.into())
6365                .collect::<Vec<String>>(),
6366        );
6367        ModuleSource {
6368            proc: self.proc.clone(),
6369            selection: query,
6370            graphql_client: self.graphql_client.clone(),
6371        }
6372    }
6373}
6374#[derive(Clone)]
6375pub struct ObjectTypeDef {
6376    pub proc: Option<Arc<DaggerSessionProc>>,
6377    pub selection: Selection,
6378    pub graphql_client: DynGraphQLClient,
6379}
6380impl ObjectTypeDef {
6381    /// The function used to construct new instances of this object, if any
6382    pub fn constructor(&self) -> Function {
6383        let query = self.selection.select("constructor");
6384        Function {
6385            proc: self.proc.clone(),
6386            selection: query,
6387            graphql_client: self.graphql_client.clone(),
6388        }
6389    }
6390    /// The doc string for the object, if any.
6391    pub async fn description(&self) -> Result<String, DaggerError> {
6392        let query = self.selection.select("description");
6393        query.execute(self.graphql_client.clone()).await
6394    }
6395    /// Static fields defined on this object, if any.
6396    pub fn fields(&self) -> Vec<FieldTypeDef> {
6397        let query = self.selection.select("fields");
6398        vec![FieldTypeDef {
6399            proc: self.proc.clone(),
6400            selection: query,
6401            graphql_client: self.graphql_client.clone(),
6402        }]
6403    }
6404    /// Functions defined on this object, if any.
6405    pub fn functions(&self) -> Vec<Function> {
6406        let query = self.selection.select("functions");
6407        vec![Function {
6408            proc: self.proc.clone(),
6409            selection: query,
6410            graphql_client: self.graphql_client.clone(),
6411        }]
6412    }
6413    /// A unique identifier for this ObjectTypeDef.
6414    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
6415        let query = self.selection.select("id");
6416        query.execute(self.graphql_client.clone()).await
6417    }
6418    /// The name of the object.
6419    pub async fn name(&self) -> Result<String, DaggerError> {
6420        let query = self.selection.select("name");
6421        query.execute(self.graphql_client.clone()).await
6422    }
6423    /// The location of this object declaration.
6424    pub fn source_map(&self) -> SourceMap {
6425        let query = self.selection.select("sourceMap");
6426        SourceMap {
6427            proc: self.proc.clone(),
6428            selection: query,
6429            graphql_client: self.graphql_client.clone(),
6430        }
6431    }
6432    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
6433    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6434        let query = self.selection.select("sourceModuleName");
6435        query.execute(self.graphql_client.clone()).await
6436    }
6437}
6438#[derive(Clone)]
6439pub struct Port {
6440    pub proc: Option<Arc<DaggerSessionProc>>,
6441    pub selection: Selection,
6442    pub graphql_client: DynGraphQLClient,
6443}
6444impl Port {
6445    /// The port description.
6446    pub async fn description(&self) -> Result<String, DaggerError> {
6447        let query = self.selection.select("description");
6448        query.execute(self.graphql_client.clone()).await
6449    }
6450    /// Skip the health check when run as a service.
6451    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
6452        let query = self.selection.select("experimentalSkipHealthcheck");
6453        query.execute(self.graphql_client.clone()).await
6454    }
6455    /// A unique identifier for this Port.
6456    pub async fn id(&self) -> Result<PortId, DaggerError> {
6457        let query = self.selection.select("id");
6458        query.execute(self.graphql_client.clone()).await
6459    }
6460    /// The port number.
6461    pub async fn port(&self) -> Result<isize, DaggerError> {
6462        let query = self.selection.select("port");
6463        query.execute(self.graphql_client.clone()).await
6464    }
6465    /// The transport layer protocol.
6466    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
6467        let query = self.selection.select("protocol");
6468        query.execute(self.graphql_client.clone()).await
6469    }
6470}
6471#[derive(Clone)]
6472pub struct Query {
6473    pub proc: Option<Arc<DaggerSessionProc>>,
6474    pub selection: Selection,
6475    pub graphql_client: DynGraphQLClient,
6476}
6477#[derive(Builder, Debug, PartialEq)]
6478pub struct QueryCacheVolumeOpts<'a> {
6479    #[builder(setter(into, strip_option), default)]
6480    pub namespace: Option<&'a str>,
6481}
6482#[derive(Builder, Debug, PartialEq)]
6483pub struct QueryContainerOpts {
6484    /// Platform to initialize the container with.
6485    #[builder(setter(into, strip_option), default)]
6486    pub platform: Option<Platform>,
6487}
6488#[derive(Builder, Debug, PartialEq)]
6489pub struct QueryGitOpts<'a> {
6490    /// A service which must be started before the repo is fetched.
6491    #[builder(setter(into, strip_option), default)]
6492    pub experimental_service_host: Option<ServiceId>,
6493    /// DEPRECATED: Set to true to keep .git directory.
6494    #[builder(setter(into, strip_option), default)]
6495    pub keep_git_dir: Option<bool>,
6496    /// Set SSH auth socket
6497    #[builder(setter(into, strip_option), default)]
6498    pub ssh_auth_socket: Option<SocketId>,
6499    /// Set SSH known hosts
6500    #[builder(setter(into, strip_option), default)]
6501    pub ssh_known_hosts: Option<&'a str>,
6502}
6503#[derive(Builder, Debug, PartialEq)]
6504pub struct QueryHttpOpts {
6505    /// A service which must be started before the URL is fetched.
6506    #[builder(setter(into, strip_option), default)]
6507    pub experimental_service_host: Option<ServiceId>,
6508}
6509#[derive(Builder, Debug, PartialEq)]
6510pub struct QueryLoadSecretFromNameOpts<'a> {
6511    #[builder(setter(into, strip_option), default)]
6512    pub accessor: Option<&'a str>,
6513}
6514#[derive(Builder, Debug, PartialEq)]
6515pub struct QueryModuleSourceOpts<'a> {
6516    /// 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.
6517    #[builder(setter(into, strip_option), default)]
6518    pub allow_not_exists: Option<bool>,
6519    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
6520    #[builder(setter(into, strip_option), default)]
6521    pub disable_find_up: Option<bool>,
6522    /// The pinned version of the module source
6523    #[builder(setter(into, strip_option), default)]
6524    pub ref_pin: Option<&'a str>,
6525    /// If set, error out if the ref string is not of the provided requireKind.
6526    #[builder(setter(into, strip_option), default)]
6527    pub require_kind: Option<ModuleSourceKind>,
6528}
6529impl Query {
6530    /// Retrieves a container builtin to the engine.
6531    ///
6532    /// # Arguments
6533    ///
6534    /// * `digest` - Digest of the image manifest
6535    pub fn builtin_container(&self, digest: impl Into<String>) -> Container {
6536        let mut query = self.selection.select("builtinContainer");
6537        query = query.arg("digest", digest.into());
6538        Container {
6539            proc: self.proc.clone(),
6540            selection: query,
6541            graphql_client: self.graphql_client.clone(),
6542        }
6543    }
6544    /// Constructs a cache volume for a given cache key.
6545    ///
6546    /// # Arguments
6547    ///
6548    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
6549    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6550    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
6551        let mut query = self.selection.select("cacheVolume");
6552        query = query.arg("key", key.into());
6553        CacheVolume {
6554            proc: self.proc.clone(),
6555            selection: query,
6556            graphql_client: self.graphql_client.clone(),
6557        }
6558    }
6559    /// Constructs a cache volume for a given cache key.
6560    ///
6561    /// # Arguments
6562    ///
6563    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
6564    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6565    pub fn cache_volume_opts<'a>(
6566        &self,
6567        key: impl Into<String>,
6568        opts: QueryCacheVolumeOpts<'a>,
6569    ) -> CacheVolume {
6570        let mut query = self.selection.select("cacheVolume");
6571        query = query.arg("key", key.into());
6572        if let Some(namespace) = opts.namespace {
6573            query = query.arg("namespace", namespace);
6574        }
6575        CacheVolume {
6576            proc: self.proc.clone(),
6577            selection: query,
6578            graphql_client: self.graphql_client.clone(),
6579        }
6580    }
6581    /// Creates a scratch container.
6582    /// Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
6583    ///
6584    /// # Arguments
6585    ///
6586    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6587    pub fn container(&self) -> Container {
6588        let query = self.selection.select("container");
6589        Container {
6590            proc: self.proc.clone(),
6591            selection: query,
6592            graphql_client: self.graphql_client.clone(),
6593        }
6594    }
6595    /// Creates a scratch container.
6596    /// Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
6597    ///
6598    /// # Arguments
6599    ///
6600    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6601    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
6602        let mut query = self.selection.select("container");
6603        if let Some(platform) = opts.platform {
6604            query = query.arg("platform", platform);
6605        }
6606        Container {
6607            proc: self.proc.clone(),
6608            selection: query,
6609            graphql_client: self.graphql_client.clone(),
6610        }
6611    }
6612    /// The FunctionCall context that the SDK caller is currently executing in.
6613    /// If the caller is not currently executing in a function, this will return an error.
6614    pub fn current_function_call(&self) -> FunctionCall {
6615        let query = self.selection.select("currentFunctionCall");
6616        FunctionCall {
6617            proc: self.proc.clone(),
6618            selection: query,
6619            graphql_client: self.graphql_client.clone(),
6620        }
6621    }
6622    /// The module currently being served in the session, if any.
6623    pub fn current_module(&self) -> CurrentModule {
6624        let query = self.selection.select("currentModule");
6625        CurrentModule {
6626            proc: self.proc.clone(),
6627            selection: query,
6628            graphql_client: self.graphql_client.clone(),
6629        }
6630    }
6631    /// The TypeDef representations of the objects currently being served in the session.
6632    pub fn current_type_defs(&self) -> Vec<TypeDef> {
6633        let query = self.selection.select("currentTypeDefs");
6634        vec![TypeDef {
6635            proc: self.proc.clone(),
6636            selection: query,
6637            graphql_client: self.graphql_client.clone(),
6638        }]
6639    }
6640    /// The default platform of the engine.
6641    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
6642        let query = self.selection.select("defaultPlatform");
6643        query.execute(self.graphql_client.clone()).await
6644    }
6645    /// Creates an empty directory.
6646    pub fn directory(&self) -> Directory {
6647        let query = self.selection.select("directory");
6648        Directory {
6649            proc: self.proc.clone(),
6650            selection: query,
6651            graphql_client: self.graphql_client.clone(),
6652        }
6653    }
6654    /// The Dagger engine container configuration and state
6655    pub fn engine(&self) -> Engine {
6656        let query = self.selection.select("engine");
6657        Engine {
6658            proc: self.proc.clone(),
6659            selection: query,
6660            graphql_client: self.graphql_client.clone(),
6661        }
6662    }
6663    /// Create a new error.
6664    ///
6665    /// # Arguments
6666    ///
6667    /// * `message` - A brief description of the error.
6668    pub fn error(&self, message: impl Into<String>) -> Error {
6669        let mut query = self.selection.select("error");
6670        query = query.arg("message", message.into());
6671        Error {
6672            proc: self.proc.clone(),
6673            selection: query,
6674            graphql_client: self.graphql_client.clone(),
6675        }
6676    }
6677    /// Creates a function.
6678    ///
6679    /// # Arguments
6680    ///
6681    /// * `name` - Name of the function, in its original format from the implementation language.
6682    /// * `return_type` - Return type of the function.
6683    pub fn function(
6684        &self,
6685        name: impl Into<String>,
6686        return_type: impl IntoID<TypeDefId>,
6687    ) -> Function {
6688        let mut query = self.selection.select("function");
6689        query = query.arg("name", name.into());
6690        query = query.arg_lazy(
6691            "returnType",
6692            Box::new(move || {
6693                let return_type = return_type.clone();
6694                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
6695            }),
6696        );
6697        Function {
6698            proc: self.proc.clone(),
6699            selection: query,
6700            graphql_client: self.graphql_client.clone(),
6701        }
6702    }
6703    /// Create a code generation result, given a directory containing the generated code.
6704    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
6705        let mut query = self.selection.select("generatedCode");
6706        query = query.arg_lazy(
6707            "code",
6708            Box::new(move || {
6709                let code = code.clone();
6710                Box::pin(async move { code.into_id().await.unwrap().quote() })
6711            }),
6712        );
6713        GeneratedCode {
6714            proc: self.proc.clone(),
6715            selection: query,
6716            graphql_client: self.graphql_client.clone(),
6717        }
6718    }
6719    /// Queries a Git repository.
6720    ///
6721    /// # Arguments
6722    ///
6723    /// * `url` - URL of the git repository.
6724    ///
6725    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
6726    ///
6727    /// Suffix ".git" is optional.
6728    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6729    pub fn git(&self, url: impl Into<String>) -> GitRepository {
6730        let mut query = self.selection.select("git");
6731        query = query.arg("url", url.into());
6732        GitRepository {
6733            proc: self.proc.clone(),
6734            selection: query,
6735            graphql_client: self.graphql_client.clone(),
6736        }
6737    }
6738    /// Queries a Git repository.
6739    ///
6740    /// # Arguments
6741    ///
6742    /// * `url` - URL of the git repository.
6743    ///
6744    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
6745    ///
6746    /// Suffix ".git" is optional.
6747    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6748    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
6749        let mut query = self.selection.select("git");
6750        query = query.arg("url", url.into());
6751        if let Some(keep_git_dir) = opts.keep_git_dir {
6752            query = query.arg("keepGitDir", keep_git_dir);
6753        }
6754        if let Some(experimental_service_host) = opts.experimental_service_host {
6755            query = query.arg("experimentalServiceHost", experimental_service_host);
6756        }
6757        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
6758            query = query.arg("sshKnownHosts", ssh_known_hosts);
6759        }
6760        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
6761            query = query.arg("sshAuthSocket", ssh_auth_socket);
6762        }
6763        GitRepository {
6764            proc: self.proc.clone(),
6765            selection: query,
6766            graphql_client: self.graphql_client.clone(),
6767        }
6768    }
6769    /// Queries the host environment.
6770    pub fn host(&self) -> Host {
6771        let query = self.selection.select("host");
6772        Host {
6773            proc: self.proc.clone(),
6774            selection: query,
6775            graphql_client: self.graphql_client.clone(),
6776        }
6777    }
6778    /// Returns a file containing an http remote url content.
6779    ///
6780    /// # Arguments
6781    ///
6782    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
6783    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6784    pub fn http(&self, url: impl Into<String>) -> File {
6785        let mut query = self.selection.select("http");
6786        query = query.arg("url", url.into());
6787        File {
6788            proc: self.proc.clone(),
6789            selection: query,
6790            graphql_client: self.graphql_client.clone(),
6791        }
6792    }
6793    /// Returns a file containing an http remote url content.
6794    ///
6795    /// # Arguments
6796    ///
6797    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
6798    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6799    pub fn http_opts(&self, url: impl Into<String>, opts: QueryHttpOpts) -> File {
6800        let mut query = self.selection.select("http");
6801        query = query.arg("url", url.into());
6802        if let Some(experimental_service_host) = opts.experimental_service_host {
6803            query = query.arg("experimentalServiceHost", experimental_service_host);
6804        }
6805        File {
6806            proc: self.proc.clone(),
6807            selection: query,
6808            graphql_client: self.graphql_client.clone(),
6809        }
6810    }
6811    /// Load a CacheVolume from its ID.
6812    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
6813        let mut query = self.selection.select("loadCacheVolumeFromID");
6814        query = query.arg_lazy(
6815            "id",
6816            Box::new(move || {
6817                let id = id.clone();
6818                Box::pin(async move { id.into_id().await.unwrap().quote() })
6819            }),
6820        );
6821        CacheVolume {
6822            proc: self.proc.clone(),
6823            selection: query,
6824            graphql_client: self.graphql_client.clone(),
6825        }
6826    }
6827    /// Load a Container from its ID.
6828    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
6829        let mut query = self.selection.select("loadContainerFromID");
6830        query = query.arg_lazy(
6831            "id",
6832            Box::new(move || {
6833                let id = id.clone();
6834                Box::pin(async move { id.into_id().await.unwrap().quote() })
6835            }),
6836        );
6837        Container {
6838            proc: self.proc.clone(),
6839            selection: query,
6840            graphql_client: self.graphql_client.clone(),
6841        }
6842    }
6843    /// Load a CurrentModule from its ID.
6844    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
6845        let mut query = self.selection.select("loadCurrentModuleFromID");
6846        query = query.arg_lazy(
6847            "id",
6848            Box::new(move || {
6849                let id = id.clone();
6850                Box::pin(async move { id.into_id().await.unwrap().quote() })
6851            }),
6852        );
6853        CurrentModule {
6854            proc: self.proc.clone(),
6855            selection: query,
6856            graphql_client: self.graphql_client.clone(),
6857        }
6858    }
6859    /// Load a Directory from its ID.
6860    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
6861        let mut query = self.selection.select("loadDirectoryFromID");
6862        query = query.arg_lazy(
6863            "id",
6864            Box::new(move || {
6865                let id = id.clone();
6866                Box::pin(async move { id.into_id().await.unwrap().quote() })
6867            }),
6868        );
6869        Directory {
6870            proc: self.proc.clone(),
6871            selection: query,
6872            graphql_client: self.graphql_client.clone(),
6873        }
6874    }
6875    /// Load a EngineCacheEntry from its ID.
6876    pub fn load_engine_cache_entry_from_id(
6877        &self,
6878        id: impl IntoID<EngineCacheEntryId>,
6879    ) -> EngineCacheEntry {
6880        let mut query = self.selection.select("loadEngineCacheEntryFromID");
6881        query = query.arg_lazy(
6882            "id",
6883            Box::new(move || {
6884                let id = id.clone();
6885                Box::pin(async move { id.into_id().await.unwrap().quote() })
6886            }),
6887        );
6888        EngineCacheEntry {
6889            proc: self.proc.clone(),
6890            selection: query,
6891            graphql_client: self.graphql_client.clone(),
6892        }
6893    }
6894    /// Load a EngineCacheEntrySet from its ID.
6895    pub fn load_engine_cache_entry_set_from_id(
6896        &self,
6897        id: impl IntoID<EngineCacheEntrySetId>,
6898    ) -> EngineCacheEntrySet {
6899        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
6900        query = query.arg_lazy(
6901            "id",
6902            Box::new(move || {
6903                let id = id.clone();
6904                Box::pin(async move { id.into_id().await.unwrap().quote() })
6905            }),
6906        );
6907        EngineCacheEntrySet {
6908            proc: self.proc.clone(),
6909            selection: query,
6910            graphql_client: self.graphql_client.clone(),
6911        }
6912    }
6913    /// Load a EngineCache from its ID.
6914    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
6915        let mut query = self.selection.select("loadEngineCacheFromID");
6916        query = query.arg_lazy(
6917            "id",
6918            Box::new(move || {
6919                let id = id.clone();
6920                Box::pin(async move { id.into_id().await.unwrap().quote() })
6921            }),
6922        );
6923        EngineCache {
6924            proc: self.proc.clone(),
6925            selection: query,
6926            graphql_client: self.graphql_client.clone(),
6927        }
6928    }
6929    /// Load a Engine from its ID.
6930    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
6931        let mut query = self.selection.select("loadEngineFromID");
6932        query = query.arg_lazy(
6933            "id",
6934            Box::new(move || {
6935                let id = id.clone();
6936                Box::pin(async move { id.into_id().await.unwrap().quote() })
6937            }),
6938        );
6939        Engine {
6940            proc: self.proc.clone(),
6941            selection: query,
6942            graphql_client: self.graphql_client.clone(),
6943        }
6944    }
6945    /// Load a EnumTypeDef from its ID.
6946    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
6947        let mut query = self.selection.select("loadEnumTypeDefFromID");
6948        query = query.arg_lazy(
6949            "id",
6950            Box::new(move || {
6951                let id = id.clone();
6952                Box::pin(async move { id.into_id().await.unwrap().quote() })
6953            }),
6954        );
6955        EnumTypeDef {
6956            proc: self.proc.clone(),
6957            selection: query,
6958            graphql_client: self.graphql_client.clone(),
6959        }
6960    }
6961    /// Load a EnumValueTypeDef from its ID.
6962    pub fn load_enum_value_type_def_from_id(
6963        &self,
6964        id: impl IntoID<EnumValueTypeDefId>,
6965    ) -> EnumValueTypeDef {
6966        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
6967        query = query.arg_lazy(
6968            "id",
6969            Box::new(move || {
6970                let id = id.clone();
6971                Box::pin(async move { id.into_id().await.unwrap().quote() })
6972            }),
6973        );
6974        EnumValueTypeDef {
6975            proc: self.proc.clone(),
6976            selection: query,
6977            graphql_client: self.graphql_client.clone(),
6978        }
6979    }
6980    /// Load a EnvVariable from its ID.
6981    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
6982        let mut query = self.selection.select("loadEnvVariableFromID");
6983        query = query.arg_lazy(
6984            "id",
6985            Box::new(move || {
6986                let id = id.clone();
6987                Box::pin(async move { id.into_id().await.unwrap().quote() })
6988            }),
6989        );
6990        EnvVariable {
6991            proc: self.proc.clone(),
6992            selection: query,
6993            graphql_client: self.graphql_client.clone(),
6994        }
6995    }
6996    /// Load a Error from its ID.
6997    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
6998        let mut query = self.selection.select("loadErrorFromID");
6999        query = query.arg_lazy(
7000            "id",
7001            Box::new(move || {
7002                let id = id.clone();
7003                Box::pin(async move { id.into_id().await.unwrap().quote() })
7004            }),
7005        );
7006        Error {
7007            proc: self.proc.clone(),
7008            selection: query,
7009            graphql_client: self.graphql_client.clone(),
7010        }
7011    }
7012    /// Load a FieldTypeDef from its ID.
7013    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
7014        let mut query = self.selection.select("loadFieldTypeDefFromID");
7015        query = query.arg_lazy(
7016            "id",
7017            Box::new(move || {
7018                let id = id.clone();
7019                Box::pin(async move { id.into_id().await.unwrap().quote() })
7020            }),
7021        );
7022        FieldTypeDef {
7023            proc: self.proc.clone(),
7024            selection: query,
7025            graphql_client: self.graphql_client.clone(),
7026        }
7027    }
7028    /// Load a File from its ID.
7029    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
7030        let mut query = self.selection.select("loadFileFromID");
7031        query = query.arg_lazy(
7032            "id",
7033            Box::new(move || {
7034                let id = id.clone();
7035                Box::pin(async move { id.into_id().await.unwrap().quote() })
7036            }),
7037        );
7038        File {
7039            proc: self.proc.clone(),
7040            selection: query,
7041            graphql_client: self.graphql_client.clone(),
7042        }
7043    }
7044    /// Load a FunctionArg from its ID.
7045    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
7046        let mut query = self.selection.select("loadFunctionArgFromID");
7047        query = query.arg_lazy(
7048            "id",
7049            Box::new(move || {
7050                let id = id.clone();
7051                Box::pin(async move { id.into_id().await.unwrap().quote() })
7052            }),
7053        );
7054        FunctionArg {
7055            proc: self.proc.clone(),
7056            selection: query,
7057            graphql_client: self.graphql_client.clone(),
7058        }
7059    }
7060    /// Load a FunctionCallArgValue from its ID.
7061    pub fn load_function_call_arg_value_from_id(
7062        &self,
7063        id: impl IntoID<FunctionCallArgValueId>,
7064    ) -> FunctionCallArgValue {
7065        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
7066        query = query.arg_lazy(
7067            "id",
7068            Box::new(move || {
7069                let id = id.clone();
7070                Box::pin(async move { id.into_id().await.unwrap().quote() })
7071            }),
7072        );
7073        FunctionCallArgValue {
7074            proc: self.proc.clone(),
7075            selection: query,
7076            graphql_client: self.graphql_client.clone(),
7077        }
7078    }
7079    /// Load a FunctionCall from its ID.
7080    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
7081        let mut query = self.selection.select("loadFunctionCallFromID");
7082        query = query.arg_lazy(
7083            "id",
7084            Box::new(move || {
7085                let id = id.clone();
7086                Box::pin(async move { id.into_id().await.unwrap().quote() })
7087            }),
7088        );
7089        FunctionCall {
7090            proc: self.proc.clone(),
7091            selection: query,
7092            graphql_client: self.graphql_client.clone(),
7093        }
7094    }
7095    /// Load a Function from its ID.
7096    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
7097        let mut query = self.selection.select("loadFunctionFromID");
7098        query = query.arg_lazy(
7099            "id",
7100            Box::new(move || {
7101                let id = id.clone();
7102                Box::pin(async move { id.into_id().await.unwrap().quote() })
7103            }),
7104        );
7105        Function {
7106            proc: self.proc.clone(),
7107            selection: query,
7108            graphql_client: self.graphql_client.clone(),
7109        }
7110    }
7111    /// Load a GeneratedCode from its ID.
7112    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
7113        let mut query = self.selection.select("loadGeneratedCodeFromID");
7114        query = query.arg_lazy(
7115            "id",
7116            Box::new(move || {
7117                let id = id.clone();
7118                Box::pin(async move { id.into_id().await.unwrap().quote() })
7119            }),
7120        );
7121        GeneratedCode {
7122            proc: self.proc.clone(),
7123            selection: query,
7124            graphql_client: self.graphql_client.clone(),
7125        }
7126    }
7127    /// Load a GitRef from its ID.
7128    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
7129        let mut query = self.selection.select("loadGitRefFromID");
7130        query = query.arg_lazy(
7131            "id",
7132            Box::new(move || {
7133                let id = id.clone();
7134                Box::pin(async move { id.into_id().await.unwrap().quote() })
7135            }),
7136        );
7137        GitRef {
7138            proc: self.proc.clone(),
7139            selection: query,
7140            graphql_client: self.graphql_client.clone(),
7141        }
7142    }
7143    /// Load a GitRepository from its ID.
7144    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
7145        let mut query = self.selection.select("loadGitRepositoryFromID");
7146        query = query.arg_lazy(
7147            "id",
7148            Box::new(move || {
7149                let id = id.clone();
7150                Box::pin(async move { id.into_id().await.unwrap().quote() })
7151            }),
7152        );
7153        GitRepository {
7154            proc: self.proc.clone(),
7155            selection: query,
7156            graphql_client: self.graphql_client.clone(),
7157        }
7158    }
7159    /// Load a Host from its ID.
7160    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
7161        let mut query = self.selection.select("loadHostFromID");
7162        query = query.arg_lazy(
7163            "id",
7164            Box::new(move || {
7165                let id = id.clone();
7166                Box::pin(async move { id.into_id().await.unwrap().quote() })
7167            }),
7168        );
7169        Host {
7170            proc: self.proc.clone(),
7171            selection: query,
7172            graphql_client: self.graphql_client.clone(),
7173        }
7174    }
7175    /// Load a InputTypeDef from its ID.
7176    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
7177        let mut query = self.selection.select("loadInputTypeDefFromID");
7178        query = query.arg_lazy(
7179            "id",
7180            Box::new(move || {
7181                let id = id.clone();
7182                Box::pin(async move { id.into_id().await.unwrap().quote() })
7183            }),
7184        );
7185        InputTypeDef {
7186            proc: self.proc.clone(),
7187            selection: query,
7188            graphql_client: self.graphql_client.clone(),
7189        }
7190    }
7191    /// Load a InterfaceTypeDef from its ID.
7192    pub fn load_interface_type_def_from_id(
7193        &self,
7194        id: impl IntoID<InterfaceTypeDefId>,
7195    ) -> InterfaceTypeDef {
7196        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
7197        query = query.arg_lazy(
7198            "id",
7199            Box::new(move || {
7200                let id = id.clone();
7201                Box::pin(async move { id.into_id().await.unwrap().quote() })
7202            }),
7203        );
7204        InterfaceTypeDef {
7205            proc: self.proc.clone(),
7206            selection: query,
7207            graphql_client: self.graphql_client.clone(),
7208        }
7209    }
7210    /// Load a Label from its ID.
7211    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
7212        let mut query = self.selection.select("loadLabelFromID");
7213        query = query.arg_lazy(
7214            "id",
7215            Box::new(move || {
7216                let id = id.clone();
7217                Box::pin(async move { id.into_id().await.unwrap().quote() })
7218            }),
7219        );
7220        Label {
7221            proc: self.proc.clone(),
7222            selection: query,
7223            graphql_client: self.graphql_client.clone(),
7224        }
7225    }
7226    /// Load a ListTypeDef from its ID.
7227    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
7228        let mut query = self.selection.select("loadListTypeDefFromID");
7229        query = query.arg_lazy(
7230            "id",
7231            Box::new(move || {
7232                let id = id.clone();
7233                Box::pin(async move { id.into_id().await.unwrap().quote() })
7234            }),
7235        );
7236        ListTypeDef {
7237            proc: self.proc.clone(),
7238            selection: query,
7239            graphql_client: self.graphql_client.clone(),
7240        }
7241    }
7242    /// Load a Module from its ID.
7243    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
7244        let mut query = self.selection.select("loadModuleFromID");
7245        query = query.arg_lazy(
7246            "id",
7247            Box::new(move || {
7248                let id = id.clone();
7249                Box::pin(async move { id.into_id().await.unwrap().quote() })
7250            }),
7251        );
7252        Module {
7253            proc: self.proc.clone(),
7254            selection: query,
7255            graphql_client: self.graphql_client.clone(),
7256        }
7257    }
7258    /// Load a ModuleSource from its ID.
7259    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
7260        let mut query = self.selection.select("loadModuleSourceFromID");
7261        query = query.arg_lazy(
7262            "id",
7263            Box::new(move || {
7264                let id = id.clone();
7265                Box::pin(async move { id.into_id().await.unwrap().quote() })
7266            }),
7267        );
7268        ModuleSource {
7269            proc: self.proc.clone(),
7270            selection: query,
7271            graphql_client: self.graphql_client.clone(),
7272        }
7273    }
7274    /// Load a ObjectTypeDef from its ID.
7275    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
7276        let mut query = self.selection.select("loadObjectTypeDefFromID");
7277        query = query.arg_lazy(
7278            "id",
7279            Box::new(move || {
7280                let id = id.clone();
7281                Box::pin(async move { id.into_id().await.unwrap().quote() })
7282            }),
7283        );
7284        ObjectTypeDef {
7285            proc: self.proc.clone(),
7286            selection: query,
7287            graphql_client: self.graphql_client.clone(),
7288        }
7289    }
7290    /// Load a Port from its ID.
7291    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
7292        let mut query = self.selection.select("loadPortFromID");
7293        query = query.arg_lazy(
7294            "id",
7295            Box::new(move || {
7296                let id = id.clone();
7297                Box::pin(async move { id.into_id().await.unwrap().quote() })
7298            }),
7299        );
7300        Port {
7301            proc: self.proc.clone(),
7302            selection: query,
7303            graphql_client: self.graphql_client.clone(),
7304        }
7305    }
7306    /// Load a SDKConfig from its ID.
7307    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
7308        let mut query = self.selection.select("loadSDKConfigFromID");
7309        query = query.arg_lazy(
7310            "id",
7311            Box::new(move || {
7312                let id = id.clone();
7313                Box::pin(async move { id.into_id().await.unwrap().quote() })
7314            }),
7315        );
7316        SdkConfig {
7317            proc: self.proc.clone(),
7318            selection: query,
7319            graphql_client: self.graphql_client.clone(),
7320        }
7321    }
7322    /// Load a ScalarTypeDef from its ID.
7323    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
7324        let mut query = self.selection.select("loadScalarTypeDefFromID");
7325        query = query.arg_lazy(
7326            "id",
7327            Box::new(move || {
7328                let id = id.clone();
7329                Box::pin(async move { id.into_id().await.unwrap().quote() })
7330            }),
7331        );
7332        ScalarTypeDef {
7333            proc: self.proc.clone(),
7334            selection: query,
7335            graphql_client: self.graphql_client.clone(),
7336        }
7337    }
7338    /// Load a Secret from its ID.
7339    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
7340        let mut query = self.selection.select("loadSecretFromID");
7341        query = query.arg_lazy(
7342            "id",
7343            Box::new(move || {
7344                let id = id.clone();
7345                Box::pin(async move { id.into_id().await.unwrap().quote() })
7346            }),
7347        );
7348        Secret {
7349            proc: self.proc.clone(),
7350            selection: query,
7351            graphql_client: self.graphql_client.clone(),
7352        }
7353    }
7354    /// Load a Secret from its Name.
7355    ///
7356    /// # Arguments
7357    ///
7358    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7359    pub fn load_secret_from_name(&self, name: impl Into<String>) -> Secret {
7360        let mut query = self.selection.select("loadSecretFromName");
7361        query = query.arg("name", name.into());
7362        Secret {
7363            proc: self.proc.clone(),
7364            selection: query,
7365            graphql_client: self.graphql_client.clone(),
7366        }
7367    }
7368    /// Load a Secret from its Name.
7369    ///
7370    /// # Arguments
7371    ///
7372    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7373    pub fn load_secret_from_name_opts<'a>(
7374        &self,
7375        name: impl Into<String>,
7376        opts: QueryLoadSecretFromNameOpts<'a>,
7377    ) -> Secret {
7378        let mut query = self.selection.select("loadSecretFromName");
7379        query = query.arg("name", name.into());
7380        if let Some(accessor) = opts.accessor {
7381            query = query.arg("accessor", accessor);
7382        }
7383        Secret {
7384            proc: self.proc.clone(),
7385            selection: query,
7386            graphql_client: self.graphql_client.clone(),
7387        }
7388    }
7389    /// Load a Service from its ID.
7390    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
7391        let mut query = self.selection.select("loadServiceFromID");
7392        query = query.arg_lazy(
7393            "id",
7394            Box::new(move || {
7395                let id = id.clone();
7396                Box::pin(async move { id.into_id().await.unwrap().quote() })
7397            }),
7398        );
7399        Service {
7400            proc: self.proc.clone(),
7401            selection: query,
7402            graphql_client: self.graphql_client.clone(),
7403        }
7404    }
7405    /// Load a Socket from its ID.
7406    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
7407        let mut query = self.selection.select("loadSocketFromID");
7408        query = query.arg_lazy(
7409            "id",
7410            Box::new(move || {
7411                let id = id.clone();
7412                Box::pin(async move { id.into_id().await.unwrap().quote() })
7413            }),
7414        );
7415        Socket {
7416            proc: self.proc.clone(),
7417            selection: query,
7418            graphql_client: self.graphql_client.clone(),
7419        }
7420    }
7421    /// Load a SourceMap from its ID.
7422    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
7423        let mut query = self.selection.select("loadSourceMapFromID");
7424        query = query.arg_lazy(
7425            "id",
7426            Box::new(move || {
7427                let id = id.clone();
7428                Box::pin(async move { id.into_id().await.unwrap().quote() })
7429            }),
7430        );
7431        SourceMap {
7432            proc: self.proc.clone(),
7433            selection: query,
7434            graphql_client: self.graphql_client.clone(),
7435        }
7436    }
7437    /// Load a Terminal from its ID.
7438    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
7439        let mut query = self.selection.select("loadTerminalFromID");
7440        query = query.arg_lazy(
7441            "id",
7442            Box::new(move || {
7443                let id = id.clone();
7444                Box::pin(async move { id.into_id().await.unwrap().quote() })
7445            }),
7446        );
7447        Terminal {
7448            proc: self.proc.clone(),
7449            selection: query,
7450            graphql_client: self.graphql_client.clone(),
7451        }
7452    }
7453    /// Load a TypeDef from its ID.
7454    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
7455        let mut query = self.selection.select("loadTypeDefFromID");
7456        query = query.arg_lazy(
7457            "id",
7458            Box::new(move || {
7459                let id = id.clone();
7460                Box::pin(async move { id.into_id().await.unwrap().quote() })
7461            }),
7462        );
7463        TypeDef {
7464            proc: self.proc.clone(),
7465            selection: query,
7466            graphql_client: self.graphql_client.clone(),
7467        }
7468    }
7469    /// Create a new module.
7470    pub fn module(&self) -> Module {
7471        let query = self.selection.select("module");
7472        Module {
7473            proc: self.proc.clone(),
7474            selection: query,
7475            graphql_client: self.graphql_client.clone(),
7476        }
7477    }
7478    /// Create a new module source instance from a source ref string
7479    ///
7480    /// # Arguments
7481    ///
7482    /// * `ref_string` - The string ref representation of the module source
7483    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7484    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
7485        let mut query = self.selection.select("moduleSource");
7486        query = query.arg("refString", ref_string.into());
7487        ModuleSource {
7488            proc: self.proc.clone(),
7489            selection: query,
7490            graphql_client: self.graphql_client.clone(),
7491        }
7492    }
7493    /// Create a new module source instance from a source ref string
7494    ///
7495    /// # Arguments
7496    ///
7497    /// * `ref_string` - The string ref representation of the module source
7498    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7499    pub fn module_source_opts<'a>(
7500        &self,
7501        ref_string: impl Into<String>,
7502        opts: QueryModuleSourceOpts<'a>,
7503    ) -> ModuleSource {
7504        let mut query = self.selection.select("moduleSource");
7505        query = query.arg("refString", ref_string.into());
7506        if let Some(ref_pin) = opts.ref_pin {
7507            query = query.arg("refPin", ref_pin);
7508        }
7509        if let Some(disable_find_up) = opts.disable_find_up {
7510            query = query.arg("disableFindUp", disable_find_up);
7511        }
7512        if let Some(allow_not_exists) = opts.allow_not_exists {
7513            query = query.arg("allowNotExists", allow_not_exists);
7514        }
7515        if let Some(require_kind) = opts.require_kind {
7516            query = query.arg("requireKind", require_kind);
7517        }
7518        ModuleSource {
7519            proc: self.proc.clone(),
7520            selection: query,
7521            graphql_client: self.graphql_client.clone(),
7522        }
7523    }
7524    /// Creates a new secret.
7525    ///
7526    /// # Arguments
7527    ///
7528    /// * `uri` - The URI of the secret store
7529    pub fn secret(&self, uri: impl Into<String>) -> Secret {
7530        let mut query = self.selection.select("secret");
7531        query = query.arg("uri", uri.into());
7532        Secret {
7533            proc: self.proc.clone(),
7534            selection: query,
7535            graphql_client: self.graphql_client.clone(),
7536        }
7537    }
7538    /// Sets a secret given a user defined name to its plaintext and returns the secret.
7539    /// The plaintext value is limited to a size of 128000 bytes.
7540    ///
7541    /// # Arguments
7542    ///
7543    /// * `name` - The user defined name for this secret
7544    /// * `plaintext` - The plaintext of the secret
7545    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
7546        let mut query = self.selection.select("setSecret");
7547        query = query.arg("name", name.into());
7548        query = query.arg("plaintext", plaintext.into());
7549        Secret {
7550            proc: self.proc.clone(),
7551            selection: query,
7552            graphql_client: self.graphql_client.clone(),
7553        }
7554    }
7555    /// Creates source map metadata.
7556    ///
7557    /// # Arguments
7558    ///
7559    /// * `filename` - The filename from the module source.
7560    /// * `line` - The line number within the filename.
7561    /// * `column` - The column number within the line.
7562    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
7563        let mut query = self.selection.select("sourceMap");
7564        query = query.arg("filename", filename.into());
7565        query = query.arg("line", line);
7566        query = query.arg("column", column);
7567        SourceMap {
7568            proc: self.proc.clone(),
7569            selection: query,
7570            graphql_client: self.graphql_client.clone(),
7571        }
7572    }
7573    /// Create a new TypeDef.
7574    pub fn type_def(&self) -> TypeDef {
7575        let query = self.selection.select("typeDef");
7576        TypeDef {
7577            proc: self.proc.clone(),
7578            selection: query,
7579            graphql_client: self.graphql_client.clone(),
7580        }
7581    }
7582    /// Get the current Dagger Engine version.
7583    pub async fn version(&self) -> Result<String, DaggerError> {
7584        let query = self.selection.select("version");
7585        query.execute(self.graphql_client.clone()).await
7586    }
7587}
7588#[derive(Clone)]
7589pub struct SdkConfig {
7590    pub proc: Option<Arc<DaggerSessionProc>>,
7591    pub selection: Selection,
7592    pub graphql_client: DynGraphQLClient,
7593}
7594impl SdkConfig {
7595    /// A unique identifier for this SDKConfig.
7596    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
7597        let query = self.selection.select("id");
7598        query.execute(self.graphql_client.clone()).await
7599    }
7600    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
7601    pub async fn source(&self) -> Result<String, DaggerError> {
7602        let query = self.selection.select("source");
7603        query.execute(self.graphql_client.clone()).await
7604    }
7605}
7606#[derive(Clone)]
7607pub struct ScalarTypeDef {
7608    pub proc: Option<Arc<DaggerSessionProc>>,
7609    pub selection: Selection,
7610    pub graphql_client: DynGraphQLClient,
7611}
7612impl ScalarTypeDef {
7613    /// A doc string for the scalar, if any.
7614    pub async fn description(&self) -> Result<String, DaggerError> {
7615        let query = self.selection.select("description");
7616        query.execute(self.graphql_client.clone()).await
7617    }
7618    /// A unique identifier for this ScalarTypeDef.
7619    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
7620        let query = self.selection.select("id");
7621        query.execute(self.graphql_client.clone()).await
7622    }
7623    /// The name of the scalar.
7624    pub async fn name(&self) -> Result<String, DaggerError> {
7625        let query = self.selection.select("name");
7626        query.execute(self.graphql_client.clone()).await
7627    }
7628    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
7629    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
7630        let query = self.selection.select("sourceModuleName");
7631        query.execute(self.graphql_client.clone()).await
7632    }
7633}
7634#[derive(Clone)]
7635pub struct Secret {
7636    pub proc: Option<Arc<DaggerSessionProc>>,
7637    pub selection: Selection,
7638    pub graphql_client: DynGraphQLClient,
7639}
7640impl Secret {
7641    /// A unique identifier for this Secret.
7642    pub async fn id(&self) -> Result<SecretId, DaggerError> {
7643        let query = self.selection.select("id");
7644        query.execute(self.graphql_client.clone()).await
7645    }
7646    /// The name of this secret.
7647    pub async fn name(&self) -> Result<String, DaggerError> {
7648        let query = self.selection.select("name");
7649        query.execute(self.graphql_client.clone()).await
7650    }
7651    /// The value of this secret.
7652    pub async fn plaintext(&self) -> Result<String, DaggerError> {
7653        let query = self.selection.select("plaintext");
7654        query.execute(self.graphql_client.clone()).await
7655    }
7656    /// The URI of this secret.
7657    pub async fn uri(&self) -> Result<String, DaggerError> {
7658        let query = self.selection.select("uri");
7659        query.execute(self.graphql_client.clone()).await
7660    }
7661}
7662#[derive(Clone)]
7663pub struct Service {
7664    pub proc: Option<Arc<DaggerSessionProc>>,
7665    pub selection: Selection,
7666    pub graphql_client: DynGraphQLClient,
7667}
7668#[derive(Builder, Debug, PartialEq)]
7669pub struct ServiceEndpointOpts<'a> {
7670    /// The exposed port number for the endpoint
7671    #[builder(setter(into, strip_option), default)]
7672    pub port: Option<isize>,
7673    /// Return a URL with the given scheme, eg. http for http://
7674    #[builder(setter(into, strip_option), default)]
7675    pub scheme: Option<&'a str>,
7676}
7677#[derive(Builder, Debug, PartialEq)]
7678pub struct ServiceStopOpts {
7679    /// Immediately kill the service without waiting for a graceful exit
7680    #[builder(setter(into, strip_option), default)]
7681    pub kill: Option<bool>,
7682}
7683#[derive(Builder, Debug, PartialEq)]
7684pub struct ServiceUpOpts {
7685    /// List of frontend/backend port mappings to forward.
7686    /// Frontend is the port accepting traffic on the host, backend is the service port.
7687    #[builder(setter(into, strip_option), default)]
7688    pub ports: Option<Vec<PortForward>>,
7689    /// Bind each tunnel port to a random port on the host.
7690    #[builder(setter(into, strip_option), default)]
7691    pub random: Option<bool>,
7692}
7693impl Service {
7694    /// Retrieves an endpoint that clients can use to reach this container.
7695    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
7696    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
7697    ///
7698    /// # Arguments
7699    ///
7700    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7701    pub async fn endpoint(&self) -> Result<String, DaggerError> {
7702        let query = self.selection.select("endpoint");
7703        query.execute(self.graphql_client.clone()).await
7704    }
7705    /// Retrieves an endpoint that clients can use to reach this container.
7706    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
7707    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
7708    ///
7709    /// # Arguments
7710    ///
7711    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7712    pub async fn endpoint_opts<'a>(
7713        &self,
7714        opts: ServiceEndpointOpts<'a>,
7715    ) -> Result<String, DaggerError> {
7716        let mut query = self.selection.select("endpoint");
7717        if let Some(port) = opts.port {
7718            query = query.arg("port", port);
7719        }
7720        if let Some(scheme) = opts.scheme {
7721            query = query.arg("scheme", scheme);
7722        }
7723        query.execute(self.graphql_client.clone()).await
7724    }
7725    /// Retrieves a hostname which can be used by clients to reach this container.
7726    pub async fn hostname(&self) -> Result<String, DaggerError> {
7727        let query = self.selection.select("hostname");
7728        query.execute(self.graphql_client.clone()).await
7729    }
7730    /// A unique identifier for this Service.
7731    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
7732        let query = self.selection.select("id");
7733        query.execute(self.graphql_client.clone()).await
7734    }
7735    /// Retrieves the list of ports provided by the service.
7736    pub fn ports(&self) -> Vec<Port> {
7737        let query = self.selection.select("ports");
7738        vec![Port {
7739            proc: self.proc.clone(),
7740            selection: query,
7741            graphql_client: self.graphql_client.clone(),
7742        }]
7743    }
7744    /// Start the service and wait for its health checks to succeed.
7745    /// Services bound to a Container do not need to be manually started.
7746    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
7747        let query = self.selection.select("start");
7748        query.execute(self.graphql_client.clone()).await
7749    }
7750    /// Stop the service.
7751    ///
7752    /// # Arguments
7753    ///
7754    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7755    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
7756        let query = self.selection.select("stop");
7757        query.execute(self.graphql_client.clone()).await
7758    }
7759    /// Stop the service.
7760    ///
7761    /// # Arguments
7762    ///
7763    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7764    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
7765        let mut query = self.selection.select("stop");
7766        if let Some(kill) = opts.kill {
7767            query = query.arg("kill", kill);
7768        }
7769        query.execute(self.graphql_client.clone()).await
7770    }
7771    /// Creates a tunnel that forwards traffic from the caller's network to this service.
7772    ///
7773    /// # Arguments
7774    ///
7775    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7776    pub async fn up(&self) -> Result<Void, DaggerError> {
7777        let query = self.selection.select("up");
7778        query.execute(self.graphql_client.clone()).await
7779    }
7780    /// Creates a tunnel that forwards traffic from the caller's network to this service.
7781    ///
7782    /// # Arguments
7783    ///
7784    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7785    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
7786        let mut query = self.selection.select("up");
7787        if let Some(ports) = opts.ports {
7788            query = query.arg("ports", ports);
7789        }
7790        if let Some(random) = opts.random {
7791            query = query.arg("random", random);
7792        }
7793        query.execute(self.graphql_client.clone()).await
7794    }
7795    /// Configures a hostname which can be used by clients within the session to reach this container.
7796    ///
7797    /// # Arguments
7798    ///
7799    /// * `hostname` - The hostname to use.
7800    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
7801        let mut query = self.selection.select("withHostname");
7802        query = query.arg("hostname", hostname.into());
7803        Service {
7804            proc: self.proc.clone(),
7805            selection: query,
7806            graphql_client: self.graphql_client.clone(),
7807        }
7808    }
7809}
7810#[derive(Clone)]
7811pub struct Socket {
7812    pub proc: Option<Arc<DaggerSessionProc>>,
7813    pub selection: Selection,
7814    pub graphql_client: DynGraphQLClient,
7815}
7816impl Socket {
7817    /// A unique identifier for this Socket.
7818    pub async fn id(&self) -> Result<SocketId, DaggerError> {
7819        let query = self.selection.select("id");
7820        query.execute(self.graphql_client.clone()).await
7821    }
7822}
7823#[derive(Clone)]
7824pub struct SourceMap {
7825    pub proc: Option<Arc<DaggerSessionProc>>,
7826    pub selection: Selection,
7827    pub graphql_client: DynGraphQLClient,
7828}
7829impl SourceMap {
7830    /// The column number within the line.
7831    pub async fn column(&self) -> Result<isize, DaggerError> {
7832        let query = self.selection.select("column");
7833        query.execute(self.graphql_client.clone()).await
7834    }
7835    /// The filename from the module source.
7836    pub async fn filename(&self) -> Result<String, DaggerError> {
7837        let query = self.selection.select("filename");
7838        query.execute(self.graphql_client.clone()).await
7839    }
7840    /// A unique identifier for this SourceMap.
7841    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
7842        let query = self.selection.select("id");
7843        query.execute(self.graphql_client.clone()).await
7844    }
7845    /// The line number within the filename.
7846    pub async fn line(&self) -> Result<isize, DaggerError> {
7847        let query = self.selection.select("line");
7848        query.execute(self.graphql_client.clone()).await
7849    }
7850    /// The module dependency this was declared in.
7851    pub async fn module(&self) -> Result<String, DaggerError> {
7852        let query = self.selection.select("module");
7853        query.execute(self.graphql_client.clone()).await
7854    }
7855}
7856#[derive(Clone)]
7857pub struct Terminal {
7858    pub proc: Option<Arc<DaggerSessionProc>>,
7859    pub selection: Selection,
7860    pub graphql_client: DynGraphQLClient,
7861}
7862impl Terminal {
7863    /// A unique identifier for this Terminal.
7864    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
7865        let query = self.selection.select("id");
7866        query.execute(self.graphql_client.clone()).await
7867    }
7868    /// Forces evaluation of the pipeline in the engine.
7869    /// It doesn't run the default command if no exec has been set.
7870    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
7871        let query = self.selection.select("sync");
7872        query.execute(self.graphql_client.clone()).await
7873    }
7874}
7875#[derive(Clone)]
7876pub struct TypeDef {
7877    pub proc: Option<Arc<DaggerSessionProc>>,
7878    pub selection: Selection,
7879    pub graphql_client: DynGraphQLClient,
7880}
7881#[derive(Builder, Debug, PartialEq)]
7882pub struct TypeDefWithEnumOpts<'a> {
7883    /// A doc string for the enum, if any
7884    #[builder(setter(into, strip_option), default)]
7885    pub description: Option<&'a str>,
7886    /// The source map for the enum definition.
7887    #[builder(setter(into, strip_option), default)]
7888    pub source_map: Option<SourceMapId>,
7889}
7890#[derive(Builder, Debug, PartialEq)]
7891pub struct TypeDefWithEnumValueOpts<'a> {
7892    /// A doc string for the value, if any
7893    #[builder(setter(into, strip_option), default)]
7894    pub description: Option<&'a str>,
7895    /// The source map for the enum value definition.
7896    #[builder(setter(into, strip_option), default)]
7897    pub source_map: Option<SourceMapId>,
7898}
7899#[derive(Builder, Debug, PartialEq)]
7900pub struct TypeDefWithFieldOpts<'a> {
7901    /// A doc string for the field, if any
7902    #[builder(setter(into, strip_option), default)]
7903    pub description: Option<&'a str>,
7904    /// The source map for the field definition.
7905    #[builder(setter(into, strip_option), default)]
7906    pub source_map: Option<SourceMapId>,
7907}
7908#[derive(Builder, Debug, PartialEq)]
7909pub struct TypeDefWithInterfaceOpts<'a> {
7910    #[builder(setter(into, strip_option), default)]
7911    pub description: Option<&'a str>,
7912    #[builder(setter(into, strip_option), default)]
7913    pub source_map: Option<SourceMapId>,
7914}
7915#[derive(Builder, Debug, PartialEq)]
7916pub struct TypeDefWithObjectOpts<'a> {
7917    #[builder(setter(into, strip_option), default)]
7918    pub description: Option<&'a str>,
7919    #[builder(setter(into, strip_option), default)]
7920    pub source_map: Option<SourceMapId>,
7921}
7922#[derive(Builder, Debug, PartialEq)]
7923pub struct TypeDefWithScalarOpts<'a> {
7924    #[builder(setter(into, strip_option), default)]
7925    pub description: Option<&'a str>,
7926}
7927impl TypeDef {
7928    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
7929    pub fn as_enum(&self) -> EnumTypeDef {
7930        let query = self.selection.select("asEnum");
7931        EnumTypeDef {
7932            proc: self.proc.clone(),
7933            selection: query,
7934            graphql_client: self.graphql_client.clone(),
7935        }
7936    }
7937    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
7938    pub fn as_input(&self) -> InputTypeDef {
7939        let query = self.selection.select("asInput");
7940        InputTypeDef {
7941            proc: self.proc.clone(),
7942            selection: query,
7943            graphql_client: self.graphql_client.clone(),
7944        }
7945    }
7946    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
7947    pub fn as_interface(&self) -> InterfaceTypeDef {
7948        let query = self.selection.select("asInterface");
7949        InterfaceTypeDef {
7950            proc: self.proc.clone(),
7951            selection: query,
7952            graphql_client: self.graphql_client.clone(),
7953        }
7954    }
7955    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
7956    pub fn as_list(&self) -> ListTypeDef {
7957        let query = self.selection.select("asList");
7958        ListTypeDef {
7959            proc: self.proc.clone(),
7960            selection: query,
7961            graphql_client: self.graphql_client.clone(),
7962        }
7963    }
7964    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
7965    pub fn as_object(&self) -> ObjectTypeDef {
7966        let query = self.selection.select("asObject");
7967        ObjectTypeDef {
7968            proc: self.proc.clone(),
7969            selection: query,
7970            graphql_client: self.graphql_client.clone(),
7971        }
7972    }
7973    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
7974    pub fn as_scalar(&self) -> ScalarTypeDef {
7975        let query = self.selection.select("asScalar");
7976        ScalarTypeDef {
7977            proc: self.proc.clone(),
7978            selection: query,
7979            graphql_client: self.graphql_client.clone(),
7980        }
7981    }
7982    /// A unique identifier for this TypeDef.
7983    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
7984        let query = self.selection.select("id");
7985        query.execute(self.graphql_client.clone()).await
7986    }
7987    /// The kind of type this is (e.g. primitive, list, object).
7988    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
7989        let query = self.selection.select("kind");
7990        query.execute(self.graphql_client.clone()).await
7991    }
7992    /// Whether this type can be set to null. Defaults to false.
7993    pub async fn optional(&self) -> Result<bool, DaggerError> {
7994        let query = self.selection.select("optional");
7995        query.execute(self.graphql_client.clone()).await
7996    }
7997    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
7998    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
7999        let mut query = self.selection.select("withConstructor");
8000        query = query.arg_lazy(
8001            "function",
8002            Box::new(move || {
8003                let function = function.clone();
8004                Box::pin(async move { function.into_id().await.unwrap().quote() })
8005            }),
8006        );
8007        TypeDef {
8008            proc: self.proc.clone(),
8009            selection: query,
8010            graphql_client: self.graphql_client.clone(),
8011        }
8012    }
8013    /// Returns a TypeDef of kind Enum with the provided name.
8014    /// 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.
8015    ///
8016    /// # Arguments
8017    ///
8018    /// * `name` - The name of the enum
8019    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8020    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
8021        let mut query = self.selection.select("withEnum");
8022        query = query.arg("name", name.into());
8023        TypeDef {
8024            proc: self.proc.clone(),
8025            selection: query,
8026            graphql_client: self.graphql_client.clone(),
8027        }
8028    }
8029    /// Returns a TypeDef of kind Enum with the provided name.
8030    /// 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.
8031    ///
8032    /// # Arguments
8033    ///
8034    /// * `name` - The name of the enum
8035    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8036    pub fn with_enum_opts<'a>(
8037        &self,
8038        name: impl Into<String>,
8039        opts: TypeDefWithEnumOpts<'a>,
8040    ) -> TypeDef {
8041        let mut query = self.selection.select("withEnum");
8042        query = query.arg("name", name.into());
8043        if let Some(description) = opts.description {
8044            query = query.arg("description", description);
8045        }
8046        if let Some(source_map) = opts.source_map {
8047            query = query.arg("sourceMap", source_map);
8048        }
8049        TypeDef {
8050            proc: self.proc.clone(),
8051            selection: query,
8052            graphql_client: self.graphql_client.clone(),
8053        }
8054    }
8055    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
8056    ///
8057    /// # Arguments
8058    ///
8059    /// * `value` - The name of the value in the enum
8060    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8061    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
8062        let mut query = self.selection.select("withEnumValue");
8063        query = query.arg("value", value.into());
8064        TypeDef {
8065            proc: self.proc.clone(),
8066            selection: query,
8067            graphql_client: self.graphql_client.clone(),
8068        }
8069    }
8070    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
8071    ///
8072    /// # Arguments
8073    ///
8074    /// * `value` - The name of the value in the enum
8075    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8076    pub fn with_enum_value_opts<'a>(
8077        &self,
8078        value: impl Into<String>,
8079        opts: TypeDefWithEnumValueOpts<'a>,
8080    ) -> TypeDef {
8081        let mut query = self.selection.select("withEnumValue");
8082        query = query.arg("value", value.into());
8083        if let Some(description) = opts.description {
8084            query = query.arg("description", description);
8085        }
8086        if let Some(source_map) = opts.source_map {
8087            query = query.arg("sourceMap", source_map);
8088        }
8089        TypeDef {
8090            proc: self.proc.clone(),
8091            selection: query,
8092            graphql_client: self.graphql_client.clone(),
8093        }
8094    }
8095    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
8096    ///
8097    /// # Arguments
8098    ///
8099    /// * `name` - The name of the field in the object
8100    /// * `type_def` - The type of the field
8101    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8102    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
8103        let mut query = self.selection.select("withField");
8104        query = query.arg("name", name.into());
8105        query = query.arg_lazy(
8106            "typeDef",
8107            Box::new(move || {
8108                let type_def = type_def.clone();
8109                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8110            }),
8111        );
8112        TypeDef {
8113            proc: self.proc.clone(),
8114            selection: query,
8115            graphql_client: self.graphql_client.clone(),
8116        }
8117    }
8118    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
8119    ///
8120    /// # Arguments
8121    ///
8122    /// * `name` - The name of the field in the object
8123    /// * `type_def` - The type of the field
8124    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8125    pub fn with_field_opts<'a>(
8126        &self,
8127        name: impl Into<String>,
8128        type_def: impl IntoID<TypeDefId>,
8129        opts: TypeDefWithFieldOpts<'a>,
8130    ) -> TypeDef {
8131        let mut query = self.selection.select("withField");
8132        query = query.arg("name", name.into());
8133        query = query.arg_lazy(
8134            "typeDef",
8135            Box::new(move || {
8136                let type_def = type_def.clone();
8137                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8138            }),
8139        );
8140        if let Some(description) = opts.description {
8141            query = query.arg("description", description);
8142        }
8143        if let Some(source_map) = opts.source_map {
8144            query = query.arg("sourceMap", source_map);
8145        }
8146        TypeDef {
8147            proc: self.proc.clone(),
8148            selection: query,
8149            graphql_client: self.graphql_client.clone(),
8150        }
8151    }
8152    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
8153    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
8154        let mut query = self.selection.select("withFunction");
8155        query = query.arg_lazy(
8156            "function",
8157            Box::new(move || {
8158                let function = function.clone();
8159                Box::pin(async move { function.into_id().await.unwrap().quote() })
8160            }),
8161        );
8162        TypeDef {
8163            proc: self.proc.clone(),
8164            selection: query,
8165            graphql_client: self.graphql_client.clone(),
8166        }
8167    }
8168    /// Returns a TypeDef of kind Interface with the provided name.
8169    ///
8170    /// # Arguments
8171    ///
8172    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8173    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
8174        let mut query = self.selection.select("withInterface");
8175        query = query.arg("name", name.into());
8176        TypeDef {
8177            proc: self.proc.clone(),
8178            selection: query,
8179            graphql_client: self.graphql_client.clone(),
8180        }
8181    }
8182    /// Returns a TypeDef of kind Interface with the provided name.
8183    ///
8184    /// # Arguments
8185    ///
8186    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8187    pub fn with_interface_opts<'a>(
8188        &self,
8189        name: impl Into<String>,
8190        opts: TypeDefWithInterfaceOpts<'a>,
8191    ) -> TypeDef {
8192        let mut query = self.selection.select("withInterface");
8193        query = query.arg("name", name.into());
8194        if let Some(description) = opts.description {
8195            query = query.arg("description", description);
8196        }
8197        if let Some(source_map) = opts.source_map {
8198            query = query.arg("sourceMap", source_map);
8199        }
8200        TypeDef {
8201            proc: self.proc.clone(),
8202            selection: query,
8203            graphql_client: self.graphql_client.clone(),
8204        }
8205    }
8206    /// Sets the kind of the type.
8207    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
8208        let mut query = self.selection.select("withKind");
8209        query = query.arg("kind", kind);
8210        TypeDef {
8211            proc: self.proc.clone(),
8212            selection: query,
8213            graphql_client: self.graphql_client.clone(),
8214        }
8215    }
8216    /// Returns a TypeDef of kind List with the provided type for its elements.
8217    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
8218        let mut query = self.selection.select("withListOf");
8219        query = query.arg_lazy(
8220            "elementType",
8221            Box::new(move || {
8222                let element_type = element_type.clone();
8223                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
8224            }),
8225        );
8226        TypeDef {
8227            proc: self.proc.clone(),
8228            selection: query,
8229            graphql_client: self.graphql_client.clone(),
8230        }
8231    }
8232    /// Returns a TypeDef of kind Object with the provided name.
8233    /// 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.
8234    ///
8235    /// # Arguments
8236    ///
8237    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8238    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
8239        let mut query = self.selection.select("withObject");
8240        query = query.arg("name", name.into());
8241        TypeDef {
8242            proc: self.proc.clone(),
8243            selection: query,
8244            graphql_client: self.graphql_client.clone(),
8245        }
8246    }
8247    /// Returns a TypeDef of kind Object with the provided name.
8248    /// 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.
8249    ///
8250    /// # Arguments
8251    ///
8252    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8253    pub fn with_object_opts<'a>(
8254        &self,
8255        name: impl Into<String>,
8256        opts: TypeDefWithObjectOpts<'a>,
8257    ) -> TypeDef {
8258        let mut query = self.selection.select("withObject");
8259        query = query.arg("name", name.into());
8260        if let Some(description) = opts.description {
8261            query = query.arg("description", description);
8262        }
8263        if let Some(source_map) = opts.source_map {
8264            query = query.arg("sourceMap", source_map);
8265        }
8266        TypeDef {
8267            proc: self.proc.clone(),
8268            selection: query,
8269            graphql_client: self.graphql_client.clone(),
8270        }
8271    }
8272    /// Sets whether this type can be set to null.
8273    pub fn with_optional(&self, optional: bool) -> TypeDef {
8274        let mut query = self.selection.select("withOptional");
8275        query = query.arg("optional", optional);
8276        TypeDef {
8277            proc: self.proc.clone(),
8278            selection: query,
8279            graphql_client: self.graphql_client.clone(),
8280        }
8281    }
8282    /// Returns a TypeDef of kind Scalar with the provided name.
8283    ///
8284    /// # Arguments
8285    ///
8286    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8287    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
8288        let mut query = self.selection.select("withScalar");
8289        query = query.arg("name", name.into());
8290        TypeDef {
8291            proc: self.proc.clone(),
8292            selection: query,
8293            graphql_client: self.graphql_client.clone(),
8294        }
8295    }
8296    /// Returns a TypeDef of kind Scalar with the provided name.
8297    ///
8298    /// # Arguments
8299    ///
8300    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8301    pub fn with_scalar_opts<'a>(
8302        &self,
8303        name: impl Into<String>,
8304        opts: TypeDefWithScalarOpts<'a>,
8305    ) -> TypeDef {
8306        let mut query = self.selection.select("withScalar");
8307        query = query.arg("name", name.into());
8308        if let Some(description) = opts.description {
8309            query = query.arg("description", description);
8310        }
8311        TypeDef {
8312            proc: self.proc.clone(),
8313            selection: query,
8314            graphql_client: self.graphql_client.clone(),
8315        }
8316    }
8317}
8318#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8319pub enum CacheSharingMode {
8320    #[serde(rename = "LOCKED")]
8321    Locked,
8322    #[serde(rename = "PRIVATE")]
8323    Private,
8324    #[serde(rename = "SHARED")]
8325    Shared,
8326}
8327#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8328pub enum ImageLayerCompression {
8329    #[serde(rename = "EStarGZ")]
8330    EStarGz,
8331    #[serde(rename = "Gzip")]
8332    Gzip,
8333    #[serde(rename = "Uncompressed")]
8334    Uncompressed,
8335    #[serde(rename = "Zstd")]
8336    Zstd,
8337}
8338#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8339pub enum ImageMediaTypes {
8340    #[serde(rename = "DockerMediaTypes")]
8341    DockerMediaTypes,
8342    #[serde(rename = "OCIMediaTypes")]
8343    OciMediaTypes,
8344}
8345#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8346pub enum ModuleSourceKind {
8347    #[serde(rename = "DIR_SOURCE")]
8348    DirSource,
8349    #[serde(rename = "GIT_SOURCE")]
8350    GitSource,
8351    #[serde(rename = "LOCAL_SOURCE")]
8352    LocalSource,
8353}
8354#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8355pub enum NetworkProtocol {
8356    #[serde(rename = "TCP")]
8357    Tcp,
8358    #[serde(rename = "UDP")]
8359    Udp,
8360}
8361#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8362pub enum ReturnType {
8363    #[serde(rename = "ANY")]
8364    Any,
8365    #[serde(rename = "FAILURE")]
8366    Failure,
8367    #[serde(rename = "SUCCESS")]
8368    Success,
8369}
8370#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8371pub enum TypeDefKind {
8372    #[serde(rename = "BOOLEAN_KIND")]
8373    BooleanKind,
8374    #[serde(rename = "ENUM_KIND")]
8375    EnumKind,
8376    #[serde(rename = "FLOAT_KIND")]
8377    FloatKind,
8378    #[serde(rename = "INPUT_KIND")]
8379    InputKind,
8380    #[serde(rename = "INTEGER_KIND")]
8381    IntegerKind,
8382    #[serde(rename = "INTERFACE_KIND")]
8383    InterfaceKind,
8384    #[serde(rename = "LIST_KIND")]
8385    ListKind,
8386    #[serde(rename = "OBJECT_KIND")]
8387    ObjectKind,
8388    #[serde(rename = "SCALAR_KIND")]
8389    ScalarKind,
8390    #[serde(rename = "STRING_KIND")]
8391    StringKind,
8392    #[serde(rename = "VOID_KIND")]
8393    VoidKind,
8394}