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