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