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    /// Provide the entire Query object to the LLM
7236    pub fn with_query(&self) -> Llm {
7237        let query = self.selection.select("withQuery");
7238        Llm {
7239            proc: self.proc.clone(),
7240            selection: query,
7241            graphql_client: self.graphql_client.clone(),
7242        }
7243    }
7244    /// Add a system prompt to the LLM's environment
7245    ///
7246    /// # Arguments
7247    ///
7248    /// * `prompt` - The system prompt to send
7249    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
7250        let mut query = self.selection.select("withSystemPrompt");
7251        query = query.arg("prompt", prompt.into());
7252        Llm {
7253            proc: self.proc.clone(),
7254            selection: query,
7255            graphql_client: self.graphql_client.clone(),
7256        }
7257    }
7258}
7259#[derive(Clone)]
7260pub struct LlmTokenUsage {
7261    pub proc: Option<Arc<DaggerSessionProc>>,
7262    pub selection: Selection,
7263    pub graphql_client: DynGraphQLClient,
7264}
7265impl LlmTokenUsage {
7266    /// A unique identifier for this LLMTokenUsage.
7267    pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
7268        let query = self.selection.select("id");
7269        query.execute(self.graphql_client.clone()).await
7270    }
7271    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
7272        let query = self.selection.select("inputTokens");
7273        query.execute(self.graphql_client.clone()).await
7274    }
7275    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
7276        let query = self.selection.select("outputTokens");
7277        query.execute(self.graphql_client.clone()).await
7278    }
7279    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
7280        let query = self.selection.select("totalTokens");
7281        query.execute(self.graphql_client.clone()).await
7282    }
7283}
7284#[derive(Clone)]
7285pub struct Label {
7286    pub proc: Option<Arc<DaggerSessionProc>>,
7287    pub selection: Selection,
7288    pub graphql_client: DynGraphQLClient,
7289}
7290impl Label {
7291    /// A unique identifier for this Label.
7292    pub async fn id(&self) -> Result<LabelId, DaggerError> {
7293        let query = self.selection.select("id");
7294        query.execute(self.graphql_client.clone()).await
7295    }
7296    /// The label name.
7297    pub async fn name(&self) -> Result<String, DaggerError> {
7298        let query = self.selection.select("name");
7299        query.execute(self.graphql_client.clone()).await
7300    }
7301    /// The label value.
7302    pub async fn value(&self) -> Result<String, DaggerError> {
7303        let query = self.selection.select("value");
7304        query.execute(self.graphql_client.clone()).await
7305    }
7306}
7307#[derive(Clone)]
7308pub struct ListTypeDef {
7309    pub proc: Option<Arc<DaggerSessionProc>>,
7310    pub selection: Selection,
7311    pub graphql_client: DynGraphQLClient,
7312}
7313impl ListTypeDef {
7314    /// The type of the elements in the list.
7315    pub fn element_type_def(&self) -> TypeDef {
7316        let query = self.selection.select("elementTypeDef");
7317        TypeDef {
7318            proc: self.proc.clone(),
7319            selection: query,
7320            graphql_client: self.graphql_client.clone(),
7321        }
7322    }
7323    /// A unique identifier for this ListTypeDef.
7324    pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
7325        let query = self.selection.select("id");
7326        query.execute(self.graphql_client.clone()).await
7327    }
7328}
7329#[derive(Clone)]
7330pub struct Module {
7331    pub proc: Option<Arc<DaggerSessionProc>>,
7332    pub selection: Selection,
7333    pub graphql_client: DynGraphQLClient,
7334}
7335impl Module {
7336    /// The dependencies of the module.
7337    pub fn dependencies(&self) -> Vec<Module> {
7338        let query = self.selection.select("dependencies");
7339        vec![Module {
7340            proc: self.proc.clone(),
7341            selection: query,
7342            graphql_client: self.graphql_client.clone(),
7343        }]
7344    }
7345    /// The doc string of the module, if any
7346    pub async fn description(&self) -> Result<String, DaggerError> {
7347        let query = self.selection.select("description");
7348        query.execute(self.graphql_client.clone()).await
7349    }
7350    /// Enumerations served by this module.
7351    pub fn enums(&self) -> Vec<TypeDef> {
7352        let query = self.selection.select("enums");
7353        vec![TypeDef {
7354            proc: self.proc.clone(),
7355            selection: query,
7356            graphql_client: self.graphql_client.clone(),
7357        }]
7358    }
7359    /// The generated files and directories made on top of the module source's context directory.
7360    pub fn generated_context_directory(&self) -> Directory {
7361        let query = self.selection.select("generatedContextDirectory");
7362        Directory {
7363            proc: self.proc.clone(),
7364            selection: query,
7365            graphql_client: self.graphql_client.clone(),
7366        }
7367    }
7368    /// A unique identifier for this Module.
7369    pub async fn id(&self) -> Result<ModuleId, DaggerError> {
7370        let query = self.selection.select("id");
7371        query.execute(self.graphql_client.clone()).await
7372    }
7373    /// Interfaces served by this module.
7374    pub fn interfaces(&self) -> Vec<TypeDef> {
7375        let query = self.selection.select("interfaces");
7376        vec![TypeDef {
7377            proc: self.proc.clone(),
7378            selection: query,
7379            graphql_client: self.graphql_client.clone(),
7380        }]
7381    }
7382    /// The name of the module
7383    pub async fn name(&self) -> Result<String, DaggerError> {
7384        let query = self.selection.select("name");
7385        query.execute(self.graphql_client.clone()).await
7386    }
7387    /// Objects served by this module.
7388    pub fn objects(&self) -> Vec<TypeDef> {
7389        let query = self.selection.select("objects");
7390        vec![TypeDef {
7391            proc: self.proc.clone(),
7392            selection: query,
7393            graphql_client: self.graphql_client.clone(),
7394        }]
7395    }
7396    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
7397    pub fn runtime(&self) -> Container {
7398        let query = self.selection.select("runtime");
7399        Container {
7400            proc: self.proc.clone(),
7401            selection: query,
7402            graphql_client: self.graphql_client.clone(),
7403        }
7404    }
7405    /// The SDK config used by this module.
7406    pub fn sdk(&self) -> SdkConfig {
7407        let query = self.selection.select("sdk");
7408        SdkConfig {
7409            proc: self.proc.clone(),
7410            selection: query,
7411            graphql_client: self.graphql_client.clone(),
7412        }
7413    }
7414    /// Serve a module's API in the current session.
7415    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
7416    pub async fn serve(&self) -> Result<Void, DaggerError> {
7417        let query = self.selection.select("serve");
7418        query.execute(self.graphql_client.clone()).await
7419    }
7420    /// The source for the module.
7421    pub fn source(&self) -> ModuleSource {
7422        let query = self.selection.select("source");
7423        ModuleSource {
7424            proc: self.proc.clone(),
7425            selection: query,
7426            graphql_client: self.graphql_client.clone(),
7427        }
7428    }
7429    /// Forces evaluation of the module, including any loading into the engine and associated validation.
7430    pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
7431        let query = self.selection.select("sync");
7432        query.execute(self.graphql_client.clone()).await
7433    }
7434    /// Retrieves the module with the given description
7435    ///
7436    /// # Arguments
7437    ///
7438    /// * `description` - The description to set
7439    pub fn with_description(&self, description: impl Into<String>) -> Module {
7440        let mut query = self.selection.select("withDescription");
7441        query = query.arg("description", description.into());
7442        Module {
7443            proc: self.proc.clone(),
7444            selection: query,
7445            graphql_client: self.graphql_client.clone(),
7446        }
7447    }
7448    /// This module plus the given Enum type and associated values
7449    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
7450        let mut query = self.selection.select("withEnum");
7451        query = query.arg_lazy(
7452            "enum",
7453            Box::new(move || {
7454                let r#enum = r#enum.clone();
7455                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
7456            }),
7457        );
7458        Module {
7459            proc: self.proc.clone(),
7460            selection: query,
7461            graphql_client: self.graphql_client.clone(),
7462        }
7463    }
7464    /// This module plus the given Interface type and associated functions
7465    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
7466        let mut query = self.selection.select("withInterface");
7467        query = query.arg_lazy(
7468            "iface",
7469            Box::new(move || {
7470                let iface = iface.clone();
7471                Box::pin(async move { iface.into_id().await.unwrap().quote() })
7472            }),
7473        );
7474        Module {
7475            proc: self.proc.clone(),
7476            selection: query,
7477            graphql_client: self.graphql_client.clone(),
7478        }
7479    }
7480    /// This module plus the given Object type and associated functions.
7481    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
7482        let mut query = self.selection.select("withObject");
7483        query = query.arg_lazy(
7484            "object",
7485            Box::new(move || {
7486                let object = object.clone();
7487                Box::pin(async move { object.into_id().await.unwrap().quote() })
7488            }),
7489        );
7490        Module {
7491            proc: self.proc.clone(),
7492            selection: query,
7493            graphql_client: self.graphql_client.clone(),
7494        }
7495    }
7496}
7497#[derive(Clone)]
7498pub struct ModuleConfigClient {
7499    pub proc: Option<Arc<DaggerSessionProc>>,
7500    pub selection: Selection,
7501    pub graphql_client: DynGraphQLClient,
7502}
7503impl ModuleConfigClient {
7504    /// If true, generate the client in developer mode.
7505    pub async fn dev(&self) -> Result<bool, DaggerError> {
7506        let query = self.selection.select("dev");
7507        query.execute(self.graphql_client.clone()).await
7508    }
7509    /// The directory the client is generated in.
7510    pub async fn directory(&self) -> Result<String, DaggerError> {
7511        let query = self.selection.select("directory");
7512        query.execute(self.graphql_client.clone()).await
7513    }
7514    /// The generator to use
7515    pub async fn generator(&self) -> Result<String, DaggerError> {
7516        let query = self.selection.select("generator");
7517        query.execute(self.graphql_client.clone()).await
7518    }
7519    /// A unique identifier for this ModuleConfigClient.
7520    pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
7521        let query = self.selection.select("id");
7522        query.execute(self.graphql_client.clone()).await
7523    }
7524}
7525#[derive(Clone)]
7526pub struct ModuleSource {
7527    pub proc: Option<Arc<DaggerSessionProc>>,
7528    pub selection: Selection,
7529    pub graphql_client: DynGraphQLClient,
7530}
7531#[derive(Builder, Debug, PartialEq)]
7532pub struct ModuleSourceWithClientOpts {
7533    /// Generate in developer mode
7534    #[builder(setter(into, strip_option), default)]
7535    pub dev: Option<bool>,
7536}
7537impl ModuleSource {
7538    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
7539    pub fn as_module(&self) -> Module {
7540        let query = self.selection.select("asModule");
7541        Module {
7542            proc: self.proc.clone(),
7543            selection: query,
7544            graphql_client: self.graphql_client.clone(),
7545        }
7546    }
7547    /// A human readable ref string representation of this module source.
7548    pub async fn as_string(&self) -> Result<String, DaggerError> {
7549        let query = self.selection.select("asString");
7550        query.execute(self.graphql_client.clone()).await
7551    }
7552    /// The ref to clone the root of the git repo from. Only valid for git sources.
7553    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
7554        let query = self.selection.select("cloneRef");
7555        query.execute(self.graphql_client.clone()).await
7556    }
7557    /// The resolved commit of the git repo this source points to.
7558    pub async fn commit(&self) -> Result<String, DaggerError> {
7559        let query = self.selection.select("commit");
7560        query.execute(self.graphql_client.clone()).await
7561    }
7562    /// The clients generated for the module.
7563    pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
7564        let query = self.selection.select("configClients");
7565        vec![ModuleConfigClient {
7566            proc: self.proc.clone(),
7567            selection: query,
7568            graphql_client: self.graphql_client.clone(),
7569        }]
7570    }
7571    /// Whether an existing dagger.json for the module was found.
7572    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
7573        let query = self.selection.select("configExists");
7574        query.execute(self.graphql_client.clone()).await
7575    }
7576    /// The full directory loaded for the module source, including the source code as a subdirectory.
7577    pub fn context_directory(&self) -> Directory {
7578        let query = self.selection.select("contextDirectory");
7579        Directory {
7580            proc: self.proc.clone(),
7581            selection: query,
7582            graphql_client: self.graphql_client.clone(),
7583        }
7584    }
7585    /// The dependencies of the module source.
7586    pub fn dependencies(&self) -> Vec<ModuleSource> {
7587        let query = self.selection.select("dependencies");
7588        vec![ModuleSource {
7589            proc: self.proc.clone(),
7590            selection: query,
7591            graphql_client: self.graphql_client.clone(),
7592        }]
7593    }
7594    /// 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.
7595    pub async fn digest(&self) -> Result<String, DaggerError> {
7596        let query = self.selection.select("digest");
7597        query.execute(self.graphql_client.clone()).await
7598    }
7599    /// The directory containing the module configuration and source code (source code may be in a subdir).
7600    ///
7601    /// # Arguments
7602    ///
7603    /// * `path` - A subpath from the source directory to select.
7604    pub fn directory(&self, path: impl Into<String>) -> Directory {
7605        let mut query = self.selection.select("directory");
7606        query = query.arg("path", path.into());
7607        Directory {
7608            proc: self.proc.clone(),
7609            selection: query,
7610            graphql_client: self.graphql_client.clone(),
7611        }
7612    }
7613    /// The engine version of the module.
7614    pub async fn engine_version(&self) -> Result<String, DaggerError> {
7615        let query = self.selection.select("engineVersion");
7616        query.execute(self.graphql_client.clone()).await
7617    }
7618    /// The generated files and directories made on top of the module source's context directory.
7619    pub fn generated_context_directory(&self) -> Directory {
7620        let query = self.selection.select("generatedContextDirectory");
7621        Directory {
7622            proc: self.proc.clone(),
7623            selection: query,
7624            graphql_client: self.graphql_client.clone(),
7625        }
7626    }
7627    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
7628    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
7629        let query = self.selection.select("htmlRepoURL");
7630        query.execute(self.graphql_client.clone()).await
7631    }
7632    /// The URL to the source's git repo in a web browser. Only valid for git sources.
7633    pub async fn html_url(&self) -> Result<String, DaggerError> {
7634        let query = self.selection.select("htmlURL");
7635        query.execute(self.graphql_client.clone()).await
7636    }
7637    /// A unique identifier for this ModuleSource.
7638    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
7639        let query = self.selection.select("id");
7640        query.execute(self.graphql_client.clone()).await
7641    }
7642    /// The kind of module source (currently local, git or dir).
7643    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
7644        let query = self.selection.select("kind");
7645        query.execute(self.graphql_client.clone()).await
7646    }
7647    /// 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.
7648    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
7649        let query = self.selection.select("localContextDirectoryPath");
7650        query.execute(self.graphql_client.clone()).await
7651    }
7652    /// The name of the module, including any setting via the withName API.
7653    pub async fn module_name(&self) -> Result<String, DaggerError> {
7654        let query = self.selection.select("moduleName");
7655        query.execute(self.graphql_client.clone()).await
7656    }
7657    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
7658    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
7659        let query = self.selection.select("moduleOriginalName");
7660        query.execute(self.graphql_client.clone()).await
7661    }
7662    /// The original subpath used when instantiating this module source, relative to the context directory.
7663    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
7664        let query = self.selection.select("originalSubpath");
7665        query.execute(self.graphql_client.clone()).await
7666    }
7667    /// The pinned version of this module source.
7668    pub async fn pin(&self) -> Result<String, DaggerError> {
7669        let query = self.selection.select("pin");
7670        query.execute(self.graphql_client.clone()).await
7671    }
7672    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
7673    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
7674        let query = self.selection.select("repoRootPath");
7675        query.execute(self.graphql_client.clone()).await
7676    }
7677    /// The SDK configuration of the module.
7678    pub fn sdk(&self) -> SdkConfig {
7679        let query = self.selection.select("sdk");
7680        SdkConfig {
7681            proc: self.proc.clone(),
7682            selection: query,
7683            graphql_client: self.graphql_client.clone(),
7684        }
7685    }
7686    /// The path, relative to the context directory, that contains the module's dagger.json.
7687    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
7688        let query = self.selection.select("sourceRootSubpath");
7689        query.execute(self.graphql_client.clone()).await
7690    }
7691    /// The path to the directory containing the module's source code, relative to the context directory.
7692    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
7693        let query = self.selection.select("sourceSubpath");
7694        query.execute(self.graphql_client.clone()).await
7695    }
7696    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
7697    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
7698        let query = self.selection.select("sync");
7699        query.execute(self.graphql_client.clone()).await
7700    }
7701    /// The specified version of the git repo this source points to.
7702    pub async fn version(&self) -> Result<String, DaggerError> {
7703        let query = self.selection.select("version");
7704        query.execute(self.graphql_client.clone()).await
7705    }
7706    /// Update the module source with a new client to generate.
7707    ///
7708    /// # Arguments
7709    ///
7710    /// * `generator` - The generator to use
7711    /// * `output_dir` - The output directory for the generated client.
7712    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7713    pub fn with_client(
7714        &self,
7715        generator: impl Into<String>,
7716        output_dir: impl Into<String>,
7717    ) -> ModuleSource {
7718        let mut query = self.selection.select("withClient");
7719        query = query.arg("generator", generator.into());
7720        query = query.arg("outputDir", output_dir.into());
7721        ModuleSource {
7722            proc: self.proc.clone(),
7723            selection: query,
7724            graphql_client: self.graphql_client.clone(),
7725        }
7726    }
7727    /// Update the module source with a new client to generate.
7728    ///
7729    /// # Arguments
7730    ///
7731    /// * `generator` - The generator to use
7732    /// * `output_dir` - The output directory for the generated client.
7733    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7734    pub fn with_client_opts(
7735        &self,
7736        generator: impl Into<String>,
7737        output_dir: impl Into<String>,
7738        opts: ModuleSourceWithClientOpts,
7739    ) -> ModuleSource {
7740        let mut query = self.selection.select("withClient");
7741        query = query.arg("generator", generator.into());
7742        query = query.arg("outputDir", output_dir.into());
7743        if let Some(dev) = opts.dev {
7744            query = query.arg("dev", dev);
7745        }
7746        ModuleSource {
7747            proc: self.proc.clone(),
7748            selection: query,
7749            graphql_client: self.graphql_client.clone(),
7750        }
7751    }
7752    /// Append the provided dependencies to the module source's dependency list.
7753    ///
7754    /// # Arguments
7755    ///
7756    /// * `dependencies` - The dependencies to append.
7757    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
7758        let mut query = self.selection.select("withDependencies");
7759        query = query.arg("dependencies", dependencies);
7760        ModuleSource {
7761            proc: self.proc.clone(),
7762            selection: query,
7763            graphql_client: self.graphql_client.clone(),
7764        }
7765    }
7766    /// Upgrade the engine version of the module to the given value.
7767    ///
7768    /// # Arguments
7769    ///
7770    /// * `version` - The engine version to upgrade to.
7771    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
7772        let mut query = self.selection.select("withEngineVersion");
7773        query = query.arg("version", version.into());
7774        ModuleSource {
7775            proc: self.proc.clone(),
7776            selection: query,
7777            graphql_client: self.graphql_client.clone(),
7778        }
7779    }
7780    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
7781    ///
7782    /// # Arguments
7783    ///
7784    /// * `patterns` - The new additional include patterns.
7785    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
7786        let mut query = self.selection.select("withIncludes");
7787        query = query.arg(
7788            "patterns",
7789            patterns
7790                .into_iter()
7791                .map(|i| i.into())
7792                .collect::<Vec<String>>(),
7793        );
7794        ModuleSource {
7795            proc: self.proc.clone(),
7796            selection: query,
7797            graphql_client: self.graphql_client.clone(),
7798        }
7799    }
7800    /// Update the module source with a new name.
7801    ///
7802    /// # Arguments
7803    ///
7804    /// * `name` - The name to set.
7805    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
7806        let mut query = self.selection.select("withName");
7807        query = query.arg("name", name.into());
7808        ModuleSource {
7809            proc: self.proc.clone(),
7810            selection: query,
7811            graphql_client: self.graphql_client.clone(),
7812        }
7813    }
7814    /// Update the module source with a new SDK.
7815    ///
7816    /// # Arguments
7817    ///
7818    /// * `source` - The SDK source to set.
7819    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
7820        let mut query = self.selection.select("withSDK");
7821        query = query.arg("source", source.into());
7822        ModuleSource {
7823            proc: self.proc.clone(),
7824            selection: query,
7825            graphql_client: self.graphql_client.clone(),
7826        }
7827    }
7828    /// Update the module source with a new source subpath.
7829    ///
7830    /// # Arguments
7831    ///
7832    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
7833    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
7834        let mut query = self.selection.select("withSourceSubpath");
7835        query = query.arg("path", path.into());
7836        ModuleSource {
7837            proc: self.proc.clone(),
7838            selection: query,
7839            graphql_client: self.graphql_client.clone(),
7840        }
7841    }
7842    /// Update one or more module dependencies.
7843    ///
7844    /// # Arguments
7845    ///
7846    /// * `dependencies` - The dependencies to update.
7847    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
7848        let mut query = self.selection.select("withUpdateDependencies");
7849        query = query.arg(
7850            "dependencies",
7851            dependencies
7852                .into_iter()
7853                .map(|i| i.into())
7854                .collect::<Vec<String>>(),
7855        );
7856        ModuleSource {
7857            proc: self.proc.clone(),
7858            selection: query,
7859            graphql_client: self.graphql_client.clone(),
7860        }
7861    }
7862    /// Remove the provided dependencies from the module source's dependency list.
7863    ///
7864    /// # Arguments
7865    ///
7866    /// * `dependencies` - The dependencies to remove.
7867    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
7868        let mut query = self.selection.select("withoutDependencies");
7869        query = query.arg(
7870            "dependencies",
7871            dependencies
7872                .into_iter()
7873                .map(|i| i.into())
7874                .collect::<Vec<String>>(),
7875        );
7876        ModuleSource {
7877            proc: self.proc.clone(),
7878            selection: query,
7879            graphql_client: self.graphql_client.clone(),
7880        }
7881    }
7882}
7883#[derive(Clone)]
7884pub struct ObjectTypeDef {
7885    pub proc: Option<Arc<DaggerSessionProc>>,
7886    pub selection: Selection,
7887    pub graphql_client: DynGraphQLClient,
7888}
7889impl ObjectTypeDef {
7890    /// The function used to construct new instances of this object, if any
7891    pub fn constructor(&self) -> Function {
7892        let query = self.selection.select("constructor");
7893        Function {
7894            proc: self.proc.clone(),
7895            selection: query,
7896            graphql_client: self.graphql_client.clone(),
7897        }
7898    }
7899    /// The doc string for the object, if any.
7900    pub async fn description(&self) -> Result<String, DaggerError> {
7901        let query = self.selection.select("description");
7902        query.execute(self.graphql_client.clone()).await
7903    }
7904    /// Static fields defined on this object, if any.
7905    pub fn fields(&self) -> Vec<FieldTypeDef> {
7906        let query = self.selection.select("fields");
7907        vec![FieldTypeDef {
7908            proc: self.proc.clone(),
7909            selection: query,
7910            graphql_client: self.graphql_client.clone(),
7911        }]
7912    }
7913    /// Functions defined on this object, if any.
7914    pub fn functions(&self) -> Vec<Function> {
7915        let query = self.selection.select("functions");
7916        vec![Function {
7917            proc: self.proc.clone(),
7918            selection: query,
7919            graphql_client: self.graphql_client.clone(),
7920        }]
7921    }
7922    /// A unique identifier for this ObjectTypeDef.
7923    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
7924        let query = self.selection.select("id");
7925        query.execute(self.graphql_client.clone()).await
7926    }
7927    /// The name of the object.
7928    pub async fn name(&self) -> Result<String, DaggerError> {
7929        let query = self.selection.select("name");
7930        query.execute(self.graphql_client.clone()).await
7931    }
7932    /// The location of this object declaration.
7933    pub fn source_map(&self) -> SourceMap {
7934        let query = self.selection.select("sourceMap");
7935        SourceMap {
7936            proc: self.proc.clone(),
7937            selection: query,
7938            graphql_client: self.graphql_client.clone(),
7939        }
7940    }
7941    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
7942    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
7943        let query = self.selection.select("sourceModuleName");
7944        query.execute(self.graphql_client.clone()).await
7945    }
7946}
7947#[derive(Clone)]
7948pub struct Port {
7949    pub proc: Option<Arc<DaggerSessionProc>>,
7950    pub selection: Selection,
7951    pub graphql_client: DynGraphQLClient,
7952}
7953impl Port {
7954    /// The port description.
7955    pub async fn description(&self) -> Result<String, DaggerError> {
7956        let query = self.selection.select("description");
7957        query.execute(self.graphql_client.clone()).await
7958    }
7959    /// Skip the health check when run as a service.
7960    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
7961        let query = self.selection.select("experimentalSkipHealthcheck");
7962        query.execute(self.graphql_client.clone()).await
7963    }
7964    /// A unique identifier for this Port.
7965    pub async fn id(&self) -> Result<PortId, DaggerError> {
7966        let query = self.selection.select("id");
7967        query.execute(self.graphql_client.clone()).await
7968    }
7969    /// The port number.
7970    pub async fn port(&self) -> Result<isize, DaggerError> {
7971        let query = self.selection.select("port");
7972        query.execute(self.graphql_client.clone()).await
7973    }
7974    /// The transport layer protocol.
7975    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
7976        let query = self.selection.select("protocol");
7977        query.execute(self.graphql_client.clone()).await
7978    }
7979}
7980#[derive(Clone)]
7981pub struct Query {
7982    pub proc: Option<Arc<DaggerSessionProc>>,
7983    pub selection: Selection,
7984    pub graphql_client: DynGraphQLClient,
7985}
7986#[derive(Builder, Debug, PartialEq)]
7987pub struct QueryCacheVolumeOpts<'a> {
7988    #[builder(setter(into, strip_option), default)]
7989    pub namespace: Option<&'a str>,
7990}
7991#[derive(Builder, Debug, PartialEq)]
7992pub struct QueryContainerOpts {
7993    /// Platform to initialize the container with.
7994    #[builder(setter(into, strip_option), default)]
7995    pub platform: Option<Platform>,
7996}
7997#[derive(Builder, Debug, PartialEq)]
7998pub struct QueryGitOpts<'a> {
7999    /// A service which must be started before the repo is fetched.
8000    #[builder(setter(into, strip_option), default)]
8001    pub experimental_service_host: Option<ServiceId>,
8002    /// DEPRECATED: Set to true to keep .git directory.
8003    #[builder(setter(into, strip_option), default)]
8004    pub keep_git_dir: Option<bool>,
8005    /// Set SSH auth socket
8006    #[builder(setter(into, strip_option), default)]
8007    pub ssh_auth_socket: Option<SocketId>,
8008    /// Set SSH known hosts
8009    #[builder(setter(into, strip_option), default)]
8010    pub ssh_known_hosts: Option<&'a str>,
8011}
8012#[derive(Builder, Debug, PartialEq)]
8013pub struct QueryHttpOpts {
8014    /// A service which must be started before the URL is fetched.
8015    #[builder(setter(into, strip_option), default)]
8016    pub experimental_service_host: Option<ServiceId>,
8017}
8018#[derive(Builder, Debug, PartialEq)]
8019pub struct QueryLlmOpts<'a> {
8020    /// Cap the number of API calls for this LLM
8021    #[builder(setter(into, strip_option), default)]
8022    pub max_api_calls: Option<isize>,
8023    /// Model to use
8024    #[builder(setter(into, strip_option), default)]
8025    pub model: Option<&'a str>,
8026}
8027#[derive(Builder, Debug, PartialEq)]
8028pub struct QueryLoadSecretFromNameOpts<'a> {
8029    #[builder(setter(into, strip_option), default)]
8030    pub accessor: Option<&'a str>,
8031}
8032#[derive(Builder, Debug, PartialEq)]
8033pub struct QueryModuleSourceOpts<'a> {
8034    /// 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.
8035    #[builder(setter(into, strip_option), default)]
8036    pub allow_not_exists: Option<bool>,
8037    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
8038    #[builder(setter(into, strip_option), default)]
8039    pub disable_find_up: Option<bool>,
8040    /// The pinned version of the module source
8041    #[builder(setter(into, strip_option), default)]
8042    pub ref_pin: Option<&'a str>,
8043    /// If set, error out if the ref string is not of the provided requireKind.
8044    #[builder(setter(into, strip_option), default)]
8045    pub require_kind: Option<ModuleSourceKind>,
8046}
8047impl Query {
8048    /// Constructs a cache volume for a given cache key.
8049    ///
8050    /// # Arguments
8051    ///
8052    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
8053    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8054    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
8055        let mut query = self.selection.select("cacheVolume");
8056        query = query.arg("key", key.into());
8057        CacheVolume {
8058            proc: self.proc.clone(),
8059            selection: query,
8060            graphql_client: self.graphql_client.clone(),
8061        }
8062    }
8063    /// Constructs a cache volume for a given cache key.
8064    ///
8065    /// # Arguments
8066    ///
8067    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
8068    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8069    pub fn cache_volume_opts<'a>(
8070        &self,
8071        key: impl Into<String>,
8072        opts: QueryCacheVolumeOpts<'a>,
8073    ) -> CacheVolume {
8074        let mut query = self.selection.select("cacheVolume");
8075        query = query.arg("key", key.into());
8076        if let Some(namespace) = opts.namespace {
8077            query = query.arg("namespace", namespace);
8078        }
8079        CacheVolume {
8080            proc: self.proc.clone(),
8081            selection: query,
8082            graphql_client: self.graphql_client.clone(),
8083        }
8084    }
8085    /// Creates a scratch container.
8086    /// Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
8087    ///
8088    /// # Arguments
8089    ///
8090    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8091    pub fn container(&self) -> Container {
8092        let query = self.selection.select("container");
8093        Container {
8094            proc: self.proc.clone(),
8095            selection: query,
8096            graphql_client: self.graphql_client.clone(),
8097        }
8098    }
8099    /// Creates a scratch container.
8100    /// Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
8101    ///
8102    /// # Arguments
8103    ///
8104    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8105    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
8106        let mut query = self.selection.select("container");
8107        if let Some(platform) = opts.platform {
8108            query = query.arg("platform", platform);
8109        }
8110        Container {
8111            proc: self.proc.clone(),
8112            selection: query,
8113            graphql_client: self.graphql_client.clone(),
8114        }
8115    }
8116    /// The FunctionCall context that the SDK caller is currently executing in.
8117    /// If the caller is not currently executing in a function, this will return an error.
8118    pub fn current_function_call(&self) -> FunctionCall {
8119        let query = self.selection.select("currentFunctionCall");
8120        FunctionCall {
8121            proc: self.proc.clone(),
8122            selection: query,
8123            graphql_client: self.graphql_client.clone(),
8124        }
8125    }
8126    /// The module currently being served in the session, if any.
8127    pub fn current_module(&self) -> CurrentModule {
8128        let query = self.selection.select("currentModule");
8129        CurrentModule {
8130            proc: self.proc.clone(),
8131            selection: query,
8132            graphql_client: self.graphql_client.clone(),
8133        }
8134    }
8135    /// The TypeDef representations of the objects currently being served in the session.
8136    pub fn current_type_defs(&self) -> Vec<TypeDef> {
8137        let query = self.selection.select("currentTypeDefs");
8138        vec![TypeDef {
8139            proc: self.proc.clone(),
8140            selection: query,
8141            graphql_client: self.graphql_client.clone(),
8142        }]
8143    }
8144    /// The default platform of the engine.
8145    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
8146        let query = self.selection.select("defaultPlatform");
8147        query.execute(self.graphql_client.clone()).await
8148    }
8149    /// Creates an empty directory.
8150    pub fn directory(&self) -> Directory {
8151        let query = self.selection.select("directory");
8152        Directory {
8153            proc: self.proc.clone(),
8154            selection: query,
8155            graphql_client: self.graphql_client.clone(),
8156        }
8157    }
8158    /// The Dagger engine container configuration and state
8159    pub fn engine(&self) -> Engine {
8160        let query = self.selection.select("engine");
8161        Engine {
8162            proc: self.proc.clone(),
8163            selection: query,
8164            graphql_client: self.graphql_client.clone(),
8165        }
8166    }
8167    /// Initialize a new environment
8168    pub fn env(&self) -> Env {
8169        let query = self.selection.select("env");
8170        Env {
8171            proc: self.proc.clone(),
8172            selection: query,
8173            graphql_client: self.graphql_client.clone(),
8174        }
8175    }
8176    /// Create a new error.
8177    ///
8178    /// # Arguments
8179    ///
8180    /// * `message` - A brief description of the error.
8181    pub fn error(&self, message: impl Into<String>) -> Error {
8182        let mut query = self.selection.select("error");
8183        query = query.arg("message", message.into());
8184        Error {
8185            proc: self.proc.clone(),
8186            selection: query,
8187            graphql_client: self.graphql_client.clone(),
8188        }
8189    }
8190    /// Creates a function.
8191    ///
8192    /// # Arguments
8193    ///
8194    /// * `name` - Name of the function, in its original format from the implementation language.
8195    /// * `return_type` - Return type of the function.
8196    pub fn function(
8197        &self,
8198        name: impl Into<String>,
8199        return_type: impl IntoID<TypeDefId>,
8200    ) -> Function {
8201        let mut query = self.selection.select("function");
8202        query = query.arg("name", name.into());
8203        query = query.arg_lazy(
8204            "returnType",
8205            Box::new(move || {
8206                let return_type = return_type.clone();
8207                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
8208            }),
8209        );
8210        Function {
8211            proc: self.proc.clone(),
8212            selection: query,
8213            graphql_client: self.graphql_client.clone(),
8214        }
8215    }
8216    /// Create a code generation result, given a directory containing the generated code.
8217    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
8218        let mut query = self.selection.select("generatedCode");
8219        query = query.arg_lazy(
8220            "code",
8221            Box::new(move || {
8222                let code = code.clone();
8223                Box::pin(async move { code.into_id().await.unwrap().quote() })
8224            }),
8225        );
8226        GeneratedCode {
8227            proc: self.proc.clone(),
8228            selection: query,
8229            graphql_client: self.graphql_client.clone(),
8230        }
8231    }
8232    /// Queries a Git repository.
8233    ///
8234    /// # Arguments
8235    ///
8236    /// * `url` - URL of the git repository.
8237    ///
8238    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
8239    ///
8240    /// Suffix ".git" is optional.
8241    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8242    pub fn git(&self, url: impl Into<String>) -> GitRepository {
8243        let mut query = self.selection.select("git");
8244        query = query.arg("url", url.into());
8245        GitRepository {
8246            proc: self.proc.clone(),
8247            selection: query,
8248            graphql_client: self.graphql_client.clone(),
8249        }
8250    }
8251    /// Queries a Git repository.
8252    ///
8253    /// # Arguments
8254    ///
8255    /// * `url` - URL of the git repository.
8256    ///
8257    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
8258    ///
8259    /// Suffix ".git" is optional.
8260    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8261    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
8262        let mut query = self.selection.select("git");
8263        query = query.arg("url", url.into());
8264        if let Some(keep_git_dir) = opts.keep_git_dir {
8265            query = query.arg("keepGitDir", keep_git_dir);
8266        }
8267        if let Some(experimental_service_host) = opts.experimental_service_host {
8268            query = query.arg("experimentalServiceHost", experimental_service_host);
8269        }
8270        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
8271            query = query.arg("sshKnownHosts", ssh_known_hosts);
8272        }
8273        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
8274            query = query.arg("sshAuthSocket", ssh_auth_socket);
8275        }
8276        GitRepository {
8277            proc: self.proc.clone(),
8278            selection: query,
8279            graphql_client: self.graphql_client.clone(),
8280        }
8281    }
8282    /// Queries the host environment.
8283    pub fn host(&self) -> Host {
8284        let query = self.selection.select("host");
8285        Host {
8286            proc: self.proc.clone(),
8287            selection: query,
8288            graphql_client: self.graphql_client.clone(),
8289        }
8290    }
8291    /// Returns a file containing an http remote url content.
8292    ///
8293    /// # Arguments
8294    ///
8295    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
8296    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8297    pub fn http(&self, url: impl Into<String>) -> File {
8298        let mut query = self.selection.select("http");
8299        query = query.arg("url", url.into());
8300        File {
8301            proc: self.proc.clone(),
8302            selection: query,
8303            graphql_client: self.graphql_client.clone(),
8304        }
8305    }
8306    /// Returns a file containing an http remote url content.
8307    ///
8308    /// # Arguments
8309    ///
8310    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
8311    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8312    pub fn http_opts(&self, url: impl Into<String>, opts: QueryHttpOpts) -> File {
8313        let mut query = self.selection.select("http");
8314        query = query.arg("url", url.into());
8315        if let Some(experimental_service_host) = opts.experimental_service_host {
8316            query = query.arg("experimentalServiceHost", experimental_service_host);
8317        }
8318        File {
8319            proc: self.proc.clone(),
8320            selection: query,
8321            graphql_client: self.graphql_client.clone(),
8322        }
8323    }
8324    /// Initialize a Large Language Model (LLM)
8325    ///
8326    /// # Arguments
8327    ///
8328    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8329    pub fn llm(&self) -> Llm {
8330        let query = self.selection.select("llm");
8331        Llm {
8332            proc: self.proc.clone(),
8333            selection: query,
8334            graphql_client: self.graphql_client.clone(),
8335        }
8336    }
8337    /// Initialize a Large Language Model (LLM)
8338    ///
8339    /// # Arguments
8340    ///
8341    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8342    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
8343        let mut query = self.selection.select("llm");
8344        if let Some(model) = opts.model {
8345            query = query.arg("model", model);
8346        }
8347        if let Some(max_api_calls) = opts.max_api_calls {
8348            query = query.arg("maxAPICalls", max_api_calls);
8349        }
8350        Llm {
8351            proc: self.proc.clone(),
8352            selection: query,
8353            graphql_client: self.graphql_client.clone(),
8354        }
8355    }
8356    /// Load a Binding from its ID.
8357    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
8358        let mut query = self.selection.select("loadBindingFromID");
8359        query = query.arg_lazy(
8360            "id",
8361            Box::new(move || {
8362                let id = id.clone();
8363                Box::pin(async move { id.into_id().await.unwrap().quote() })
8364            }),
8365        );
8366        Binding {
8367            proc: self.proc.clone(),
8368            selection: query,
8369            graphql_client: self.graphql_client.clone(),
8370        }
8371    }
8372    /// Load a CacheVolume from its ID.
8373    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
8374        let mut query = self.selection.select("loadCacheVolumeFromID");
8375        query = query.arg_lazy(
8376            "id",
8377            Box::new(move || {
8378                let id = id.clone();
8379                Box::pin(async move { id.into_id().await.unwrap().quote() })
8380            }),
8381        );
8382        CacheVolume {
8383            proc: self.proc.clone(),
8384            selection: query,
8385            graphql_client: self.graphql_client.clone(),
8386        }
8387    }
8388    /// Load a Container from its ID.
8389    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
8390        let mut query = self.selection.select("loadContainerFromID");
8391        query = query.arg_lazy(
8392            "id",
8393            Box::new(move || {
8394                let id = id.clone();
8395                Box::pin(async move { id.into_id().await.unwrap().quote() })
8396            }),
8397        );
8398        Container {
8399            proc: self.proc.clone(),
8400            selection: query,
8401            graphql_client: self.graphql_client.clone(),
8402        }
8403    }
8404    /// Load a CurrentModule from its ID.
8405    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
8406        let mut query = self.selection.select("loadCurrentModuleFromID");
8407        query = query.arg_lazy(
8408            "id",
8409            Box::new(move || {
8410                let id = id.clone();
8411                Box::pin(async move { id.into_id().await.unwrap().quote() })
8412            }),
8413        );
8414        CurrentModule {
8415            proc: self.proc.clone(),
8416            selection: query,
8417            graphql_client: self.graphql_client.clone(),
8418        }
8419    }
8420    /// Load a Directory from its ID.
8421    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
8422        let mut query = self.selection.select("loadDirectoryFromID");
8423        query = query.arg_lazy(
8424            "id",
8425            Box::new(move || {
8426                let id = id.clone();
8427                Box::pin(async move { id.into_id().await.unwrap().quote() })
8428            }),
8429        );
8430        Directory {
8431            proc: self.proc.clone(),
8432            selection: query,
8433            graphql_client: self.graphql_client.clone(),
8434        }
8435    }
8436    /// Load a EngineCacheEntry from its ID.
8437    pub fn load_engine_cache_entry_from_id(
8438        &self,
8439        id: impl IntoID<EngineCacheEntryId>,
8440    ) -> EngineCacheEntry {
8441        let mut query = self.selection.select("loadEngineCacheEntryFromID");
8442        query = query.arg_lazy(
8443            "id",
8444            Box::new(move || {
8445                let id = id.clone();
8446                Box::pin(async move { id.into_id().await.unwrap().quote() })
8447            }),
8448        );
8449        EngineCacheEntry {
8450            proc: self.proc.clone(),
8451            selection: query,
8452            graphql_client: self.graphql_client.clone(),
8453        }
8454    }
8455    /// Load a EngineCacheEntrySet from its ID.
8456    pub fn load_engine_cache_entry_set_from_id(
8457        &self,
8458        id: impl IntoID<EngineCacheEntrySetId>,
8459    ) -> EngineCacheEntrySet {
8460        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
8461        query = query.arg_lazy(
8462            "id",
8463            Box::new(move || {
8464                let id = id.clone();
8465                Box::pin(async move { id.into_id().await.unwrap().quote() })
8466            }),
8467        );
8468        EngineCacheEntrySet {
8469            proc: self.proc.clone(),
8470            selection: query,
8471            graphql_client: self.graphql_client.clone(),
8472        }
8473    }
8474    /// Load a EngineCache from its ID.
8475    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
8476        let mut query = self.selection.select("loadEngineCacheFromID");
8477        query = query.arg_lazy(
8478            "id",
8479            Box::new(move || {
8480                let id = id.clone();
8481                Box::pin(async move { id.into_id().await.unwrap().quote() })
8482            }),
8483        );
8484        EngineCache {
8485            proc: self.proc.clone(),
8486            selection: query,
8487            graphql_client: self.graphql_client.clone(),
8488        }
8489    }
8490    /// Load a Engine from its ID.
8491    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
8492        let mut query = self.selection.select("loadEngineFromID");
8493        query = query.arg_lazy(
8494            "id",
8495            Box::new(move || {
8496                let id = id.clone();
8497                Box::pin(async move { id.into_id().await.unwrap().quote() })
8498            }),
8499        );
8500        Engine {
8501            proc: self.proc.clone(),
8502            selection: query,
8503            graphql_client: self.graphql_client.clone(),
8504        }
8505    }
8506    /// Load a EnumTypeDef from its ID.
8507    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
8508        let mut query = self.selection.select("loadEnumTypeDefFromID");
8509        query = query.arg_lazy(
8510            "id",
8511            Box::new(move || {
8512                let id = id.clone();
8513                Box::pin(async move { id.into_id().await.unwrap().quote() })
8514            }),
8515        );
8516        EnumTypeDef {
8517            proc: self.proc.clone(),
8518            selection: query,
8519            graphql_client: self.graphql_client.clone(),
8520        }
8521    }
8522    /// Load a EnumValueTypeDef from its ID.
8523    pub fn load_enum_value_type_def_from_id(
8524        &self,
8525        id: impl IntoID<EnumValueTypeDefId>,
8526    ) -> EnumValueTypeDef {
8527        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
8528        query = query.arg_lazy(
8529            "id",
8530            Box::new(move || {
8531                let id = id.clone();
8532                Box::pin(async move { id.into_id().await.unwrap().quote() })
8533            }),
8534        );
8535        EnumValueTypeDef {
8536            proc: self.proc.clone(),
8537            selection: query,
8538            graphql_client: self.graphql_client.clone(),
8539        }
8540    }
8541    /// Load a Env from its ID.
8542    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
8543        let mut query = self.selection.select("loadEnvFromID");
8544        query = query.arg_lazy(
8545            "id",
8546            Box::new(move || {
8547                let id = id.clone();
8548                Box::pin(async move { id.into_id().await.unwrap().quote() })
8549            }),
8550        );
8551        Env {
8552            proc: self.proc.clone(),
8553            selection: query,
8554            graphql_client: self.graphql_client.clone(),
8555        }
8556    }
8557    /// Load a EnvVariable from its ID.
8558    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
8559        let mut query = self.selection.select("loadEnvVariableFromID");
8560        query = query.arg_lazy(
8561            "id",
8562            Box::new(move || {
8563                let id = id.clone();
8564                Box::pin(async move { id.into_id().await.unwrap().quote() })
8565            }),
8566        );
8567        EnvVariable {
8568            proc: self.proc.clone(),
8569            selection: query,
8570            graphql_client: self.graphql_client.clone(),
8571        }
8572    }
8573    /// Load a Error from its ID.
8574    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
8575        let mut query = self.selection.select("loadErrorFromID");
8576        query = query.arg_lazy(
8577            "id",
8578            Box::new(move || {
8579                let id = id.clone();
8580                Box::pin(async move { id.into_id().await.unwrap().quote() })
8581            }),
8582        );
8583        Error {
8584            proc: self.proc.clone(),
8585            selection: query,
8586            graphql_client: self.graphql_client.clone(),
8587        }
8588    }
8589    /// Load a ErrorValue from its ID.
8590    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
8591        let mut query = self.selection.select("loadErrorValueFromID");
8592        query = query.arg_lazy(
8593            "id",
8594            Box::new(move || {
8595                let id = id.clone();
8596                Box::pin(async move { id.into_id().await.unwrap().quote() })
8597            }),
8598        );
8599        ErrorValue {
8600            proc: self.proc.clone(),
8601            selection: query,
8602            graphql_client: self.graphql_client.clone(),
8603        }
8604    }
8605    /// Load a FieldTypeDef from its ID.
8606    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
8607        let mut query = self.selection.select("loadFieldTypeDefFromID");
8608        query = query.arg_lazy(
8609            "id",
8610            Box::new(move || {
8611                let id = id.clone();
8612                Box::pin(async move { id.into_id().await.unwrap().quote() })
8613            }),
8614        );
8615        FieldTypeDef {
8616            proc: self.proc.clone(),
8617            selection: query,
8618            graphql_client: self.graphql_client.clone(),
8619        }
8620    }
8621    /// Load a File from its ID.
8622    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
8623        let mut query = self.selection.select("loadFileFromID");
8624        query = query.arg_lazy(
8625            "id",
8626            Box::new(move || {
8627                let id = id.clone();
8628                Box::pin(async move { id.into_id().await.unwrap().quote() })
8629            }),
8630        );
8631        File {
8632            proc: self.proc.clone(),
8633            selection: query,
8634            graphql_client: self.graphql_client.clone(),
8635        }
8636    }
8637    /// Load a FunctionArg from its ID.
8638    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
8639        let mut query = self.selection.select("loadFunctionArgFromID");
8640        query = query.arg_lazy(
8641            "id",
8642            Box::new(move || {
8643                let id = id.clone();
8644                Box::pin(async move { id.into_id().await.unwrap().quote() })
8645            }),
8646        );
8647        FunctionArg {
8648            proc: self.proc.clone(),
8649            selection: query,
8650            graphql_client: self.graphql_client.clone(),
8651        }
8652    }
8653    /// Load a FunctionCallArgValue from its ID.
8654    pub fn load_function_call_arg_value_from_id(
8655        &self,
8656        id: impl IntoID<FunctionCallArgValueId>,
8657    ) -> FunctionCallArgValue {
8658        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
8659        query = query.arg_lazy(
8660            "id",
8661            Box::new(move || {
8662                let id = id.clone();
8663                Box::pin(async move { id.into_id().await.unwrap().quote() })
8664            }),
8665        );
8666        FunctionCallArgValue {
8667            proc: self.proc.clone(),
8668            selection: query,
8669            graphql_client: self.graphql_client.clone(),
8670        }
8671    }
8672    /// Load a FunctionCall from its ID.
8673    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
8674        let mut query = self.selection.select("loadFunctionCallFromID");
8675        query = query.arg_lazy(
8676            "id",
8677            Box::new(move || {
8678                let id = id.clone();
8679                Box::pin(async move { id.into_id().await.unwrap().quote() })
8680            }),
8681        );
8682        FunctionCall {
8683            proc: self.proc.clone(),
8684            selection: query,
8685            graphql_client: self.graphql_client.clone(),
8686        }
8687    }
8688    /// Load a Function from its ID.
8689    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
8690        let mut query = self.selection.select("loadFunctionFromID");
8691        query = query.arg_lazy(
8692            "id",
8693            Box::new(move || {
8694                let id = id.clone();
8695                Box::pin(async move { id.into_id().await.unwrap().quote() })
8696            }),
8697        );
8698        Function {
8699            proc: self.proc.clone(),
8700            selection: query,
8701            graphql_client: self.graphql_client.clone(),
8702        }
8703    }
8704    /// Load a GeneratedCode from its ID.
8705    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
8706        let mut query = self.selection.select("loadGeneratedCodeFromID");
8707        query = query.arg_lazy(
8708            "id",
8709            Box::new(move || {
8710                let id = id.clone();
8711                Box::pin(async move { id.into_id().await.unwrap().quote() })
8712            }),
8713        );
8714        GeneratedCode {
8715            proc: self.proc.clone(),
8716            selection: query,
8717            graphql_client: self.graphql_client.clone(),
8718        }
8719    }
8720    /// Load a GitRef from its ID.
8721    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
8722        let mut query = self.selection.select("loadGitRefFromID");
8723        query = query.arg_lazy(
8724            "id",
8725            Box::new(move || {
8726                let id = id.clone();
8727                Box::pin(async move { id.into_id().await.unwrap().quote() })
8728            }),
8729        );
8730        GitRef {
8731            proc: self.proc.clone(),
8732            selection: query,
8733            graphql_client: self.graphql_client.clone(),
8734        }
8735    }
8736    /// Load a GitRepository from its ID.
8737    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
8738        let mut query = self.selection.select("loadGitRepositoryFromID");
8739        query = query.arg_lazy(
8740            "id",
8741            Box::new(move || {
8742                let id = id.clone();
8743                Box::pin(async move { id.into_id().await.unwrap().quote() })
8744            }),
8745        );
8746        GitRepository {
8747            proc: self.proc.clone(),
8748            selection: query,
8749            graphql_client: self.graphql_client.clone(),
8750        }
8751    }
8752    /// Load a Host from its ID.
8753    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
8754        let mut query = self.selection.select("loadHostFromID");
8755        query = query.arg_lazy(
8756            "id",
8757            Box::new(move || {
8758                let id = id.clone();
8759                Box::pin(async move { id.into_id().await.unwrap().quote() })
8760            }),
8761        );
8762        Host {
8763            proc: self.proc.clone(),
8764            selection: query,
8765            graphql_client: self.graphql_client.clone(),
8766        }
8767    }
8768    /// Load a InputTypeDef from its ID.
8769    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
8770        let mut query = self.selection.select("loadInputTypeDefFromID");
8771        query = query.arg_lazy(
8772            "id",
8773            Box::new(move || {
8774                let id = id.clone();
8775                Box::pin(async move { id.into_id().await.unwrap().quote() })
8776            }),
8777        );
8778        InputTypeDef {
8779            proc: self.proc.clone(),
8780            selection: query,
8781            graphql_client: self.graphql_client.clone(),
8782        }
8783    }
8784    /// Load a InterfaceTypeDef from its ID.
8785    pub fn load_interface_type_def_from_id(
8786        &self,
8787        id: impl IntoID<InterfaceTypeDefId>,
8788    ) -> InterfaceTypeDef {
8789        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
8790        query = query.arg_lazy(
8791            "id",
8792            Box::new(move || {
8793                let id = id.clone();
8794                Box::pin(async move { id.into_id().await.unwrap().quote() })
8795            }),
8796        );
8797        InterfaceTypeDef {
8798            proc: self.proc.clone(),
8799            selection: query,
8800            graphql_client: self.graphql_client.clone(),
8801        }
8802    }
8803    /// Load a LLM from its ID.
8804    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
8805        let mut query = self.selection.select("loadLLMFromID");
8806        query = query.arg_lazy(
8807            "id",
8808            Box::new(move || {
8809                let id = id.clone();
8810                Box::pin(async move { id.into_id().await.unwrap().quote() })
8811            }),
8812        );
8813        Llm {
8814            proc: self.proc.clone(),
8815            selection: query,
8816            graphql_client: self.graphql_client.clone(),
8817        }
8818    }
8819    /// Load a LLMTokenUsage from its ID.
8820    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
8821        let mut query = self.selection.select("loadLLMTokenUsageFromID");
8822        query = query.arg_lazy(
8823            "id",
8824            Box::new(move || {
8825                let id = id.clone();
8826                Box::pin(async move { id.into_id().await.unwrap().quote() })
8827            }),
8828        );
8829        LlmTokenUsage {
8830            proc: self.proc.clone(),
8831            selection: query,
8832            graphql_client: self.graphql_client.clone(),
8833        }
8834    }
8835    /// Load a Label from its ID.
8836    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
8837        let mut query = self.selection.select("loadLabelFromID");
8838        query = query.arg_lazy(
8839            "id",
8840            Box::new(move || {
8841                let id = id.clone();
8842                Box::pin(async move { id.into_id().await.unwrap().quote() })
8843            }),
8844        );
8845        Label {
8846            proc: self.proc.clone(),
8847            selection: query,
8848            graphql_client: self.graphql_client.clone(),
8849        }
8850    }
8851    /// Load a ListTypeDef from its ID.
8852    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
8853        let mut query = self.selection.select("loadListTypeDefFromID");
8854        query = query.arg_lazy(
8855            "id",
8856            Box::new(move || {
8857                let id = id.clone();
8858                Box::pin(async move { id.into_id().await.unwrap().quote() })
8859            }),
8860        );
8861        ListTypeDef {
8862            proc: self.proc.clone(),
8863            selection: query,
8864            graphql_client: self.graphql_client.clone(),
8865        }
8866    }
8867    /// Load a ModuleConfigClient from its ID.
8868    pub fn load_module_config_client_from_id(
8869        &self,
8870        id: impl IntoID<ModuleConfigClientId>,
8871    ) -> ModuleConfigClient {
8872        let mut query = self.selection.select("loadModuleConfigClientFromID");
8873        query = query.arg_lazy(
8874            "id",
8875            Box::new(move || {
8876                let id = id.clone();
8877                Box::pin(async move { id.into_id().await.unwrap().quote() })
8878            }),
8879        );
8880        ModuleConfigClient {
8881            proc: self.proc.clone(),
8882            selection: query,
8883            graphql_client: self.graphql_client.clone(),
8884        }
8885    }
8886    /// Load a Module from its ID.
8887    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
8888        let mut query = self.selection.select("loadModuleFromID");
8889        query = query.arg_lazy(
8890            "id",
8891            Box::new(move || {
8892                let id = id.clone();
8893                Box::pin(async move { id.into_id().await.unwrap().quote() })
8894            }),
8895        );
8896        Module {
8897            proc: self.proc.clone(),
8898            selection: query,
8899            graphql_client: self.graphql_client.clone(),
8900        }
8901    }
8902    /// Load a ModuleSource from its ID.
8903    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
8904        let mut query = self.selection.select("loadModuleSourceFromID");
8905        query = query.arg_lazy(
8906            "id",
8907            Box::new(move || {
8908                let id = id.clone();
8909                Box::pin(async move { id.into_id().await.unwrap().quote() })
8910            }),
8911        );
8912        ModuleSource {
8913            proc: self.proc.clone(),
8914            selection: query,
8915            graphql_client: self.graphql_client.clone(),
8916        }
8917    }
8918    /// Load a ObjectTypeDef from its ID.
8919    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
8920        let mut query = self.selection.select("loadObjectTypeDefFromID");
8921        query = query.arg_lazy(
8922            "id",
8923            Box::new(move || {
8924                let id = id.clone();
8925                Box::pin(async move { id.into_id().await.unwrap().quote() })
8926            }),
8927        );
8928        ObjectTypeDef {
8929            proc: self.proc.clone(),
8930            selection: query,
8931            graphql_client: self.graphql_client.clone(),
8932        }
8933    }
8934    /// Load a Port from its ID.
8935    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
8936        let mut query = self.selection.select("loadPortFromID");
8937        query = query.arg_lazy(
8938            "id",
8939            Box::new(move || {
8940                let id = id.clone();
8941                Box::pin(async move { id.into_id().await.unwrap().quote() })
8942            }),
8943        );
8944        Port {
8945            proc: self.proc.clone(),
8946            selection: query,
8947            graphql_client: self.graphql_client.clone(),
8948        }
8949    }
8950    /// Load a SDKConfig from its ID.
8951    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
8952        let mut query = self.selection.select("loadSDKConfigFromID");
8953        query = query.arg_lazy(
8954            "id",
8955            Box::new(move || {
8956                let id = id.clone();
8957                Box::pin(async move { id.into_id().await.unwrap().quote() })
8958            }),
8959        );
8960        SdkConfig {
8961            proc: self.proc.clone(),
8962            selection: query,
8963            graphql_client: self.graphql_client.clone(),
8964        }
8965    }
8966    /// Load a ScalarTypeDef from its ID.
8967    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
8968        let mut query = self.selection.select("loadScalarTypeDefFromID");
8969        query = query.arg_lazy(
8970            "id",
8971            Box::new(move || {
8972                let id = id.clone();
8973                Box::pin(async move { id.into_id().await.unwrap().quote() })
8974            }),
8975        );
8976        ScalarTypeDef {
8977            proc: self.proc.clone(),
8978            selection: query,
8979            graphql_client: self.graphql_client.clone(),
8980        }
8981    }
8982    /// Load a Secret from its ID.
8983    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
8984        let mut query = self.selection.select("loadSecretFromID");
8985        query = query.arg_lazy(
8986            "id",
8987            Box::new(move || {
8988                let id = id.clone();
8989                Box::pin(async move { id.into_id().await.unwrap().quote() })
8990            }),
8991        );
8992        Secret {
8993            proc: self.proc.clone(),
8994            selection: query,
8995            graphql_client: self.graphql_client.clone(),
8996        }
8997    }
8998    /// Load a Secret from its Name.
8999    ///
9000    /// # Arguments
9001    ///
9002    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9003    pub fn load_secret_from_name(&self, name: impl Into<String>) -> Secret {
9004        let mut query = self.selection.select("loadSecretFromName");
9005        query = query.arg("name", name.into());
9006        Secret {
9007            proc: self.proc.clone(),
9008            selection: query,
9009            graphql_client: self.graphql_client.clone(),
9010        }
9011    }
9012    /// Load a Secret from its Name.
9013    ///
9014    /// # Arguments
9015    ///
9016    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9017    pub fn load_secret_from_name_opts<'a>(
9018        &self,
9019        name: impl Into<String>,
9020        opts: QueryLoadSecretFromNameOpts<'a>,
9021    ) -> Secret {
9022        let mut query = self.selection.select("loadSecretFromName");
9023        query = query.arg("name", name.into());
9024        if let Some(accessor) = opts.accessor {
9025            query = query.arg("accessor", accessor);
9026        }
9027        Secret {
9028            proc: self.proc.clone(),
9029            selection: query,
9030            graphql_client: self.graphql_client.clone(),
9031        }
9032    }
9033    /// Load a Service from its ID.
9034    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
9035        let mut query = self.selection.select("loadServiceFromID");
9036        query = query.arg_lazy(
9037            "id",
9038            Box::new(move || {
9039                let id = id.clone();
9040                Box::pin(async move { id.into_id().await.unwrap().quote() })
9041            }),
9042        );
9043        Service {
9044            proc: self.proc.clone(),
9045            selection: query,
9046            graphql_client: self.graphql_client.clone(),
9047        }
9048    }
9049    /// Load a Socket from its ID.
9050    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
9051        let mut query = self.selection.select("loadSocketFromID");
9052        query = query.arg_lazy(
9053            "id",
9054            Box::new(move || {
9055                let id = id.clone();
9056                Box::pin(async move { id.into_id().await.unwrap().quote() })
9057            }),
9058        );
9059        Socket {
9060            proc: self.proc.clone(),
9061            selection: query,
9062            graphql_client: self.graphql_client.clone(),
9063        }
9064    }
9065    /// Load a SourceMap from its ID.
9066    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
9067        let mut query = self.selection.select("loadSourceMapFromID");
9068        query = query.arg_lazy(
9069            "id",
9070            Box::new(move || {
9071                let id = id.clone();
9072                Box::pin(async move { id.into_id().await.unwrap().quote() })
9073            }),
9074        );
9075        SourceMap {
9076            proc: self.proc.clone(),
9077            selection: query,
9078            graphql_client: self.graphql_client.clone(),
9079        }
9080    }
9081    /// Load a Terminal from its ID.
9082    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
9083        let mut query = self.selection.select("loadTerminalFromID");
9084        query = query.arg_lazy(
9085            "id",
9086            Box::new(move || {
9087                let id = id.clone();
9088                Box::pin(async move { id.into_id().await.unwrap().quote() })
9089            }),
9090        );
9091        Terminal {
9092            proc: self.proc.clone(),
9093            selection: query,
9094            graphql_client: self.graphql_client.clone(),
9095        }
9096    }
9097    /// Load a TypeDef from its ID.
9098    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
9099        let mut query = self.selection.select("loadTypeDefFromID");
9100        query = query.arg_lazy(
9101            "id",
9102            Box::new(move || {
9103                let id = id.clone();
9104                Box::pin(async move { id.into_id().await.unwrap().quote() })
9105            }),
9106        );
9107        TypeDef {
9108            proc: self.proc.clone(),
9109            selection: query,
9110            graphql_client: self.graphql_client.clone(),
9111        }
9112    }
9113    /// Create a new module.
9114    pub fn module(&self) -> Module {
9115        let query = self.selection.select("module");
9116        Module {
9117            proc: self.proc.clone(),
9118            selection: query,
9119            graphql_client: self.graphql_client.clone(),
9120        }
9121    }
9122    /// Create a new module source instance from a source ref string
9123    ///
9124    /// # Arguments
9125    ///
9126    /// * `ref_string` - The string ref representation of the module source
9127    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9128    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
9129        let mut query = self.selection.select("moduleSource");
9130        query = query.arg("refString", ref_string.into());
9131        ModuleSource {
9132            proc: self.proc.clone(),
9133            selection: query,
9134            graphql_client: self.graphql_client.clone(),
9135        }
9136    }
9137    /// Create a new module source instance from a source ref string
9138    ///
9139    /// # Arguments
9140    ///
9141    /// * `ref_string` - The string ref representation of the module source
9142    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9143    pub fn module_source_opts<'a>(
9144        &self,
9145        ref_string: impl Into<String>,
9146        opts: QueryModuleSourceOpts<'a>,
9147    ) -> ModuleSource {
9148        let mut query = self.selection.select("moduleSource");
9149        query = query.arg("refString", ref_string.into());
9150        if let Some(ref_pin) = opts.ref_pin {
9151            query = query.arg("refPin", ref_pin);
9152        }
9153        if let Some(disable_find_up) = opts.disable_find_up {
9154            query = query.arg("disableFindUp", disable_find_up);
9155        }
9156        if let Some(allow_not_exists) = opts.allow_not_exists {
9157            query = query.arg("allowNotExists", allow_not_exists);
9158        }
9159        if let Some(require_kind) = opts.require_kind {
9160            query = query.arg("requireKind", require_kind);
9161        }
9162        ModuleSource {
9163            proc: self.proc.clone(),
9164            selection: query,
9165            graphql_client: self.graphql_client.clone(),
9166        }
9167    }
9168    /// Creates a new secret.
9169    ///
9170    /// # Arguments
9171    ///
9172    /// * `uri` - The URI of the secret store
9173    pub fn secret(&self, uri: impl Into<String>) -> Secret {
9174        let mut query = self.selection.select("secret");
9175        query = query.arg("uri", uri.into());
9176        Secret {
9177            proc: self.proc.clone(),
9178            selection: query,
9179            graphql_client: self.graphql_client.clone(),
9180        }
9181    }
9182    /// Sets a secret given a user defined name to its plaintext and returns the secret.
9183    /// The plaintext value is limited to a size of 128000 bytes.
9184    ///
9185    /// # Arguments
9186    ///
9187    /// * `name` - The user defined name for this secret
9188    /// * `plaintext` - The plaintext of the secret
9189    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
9190        let mut query = self.selection.select("setSecret");
9191        query = query.arg("name", name.into());
9192        query = query.arg("plaintext", plaintext.into());
9193        Secret {
9194            proc: self.proc.clone(),
9195            selection: query,
9196            graphql_client: self.graphql_client.clone(),
9197        }
9198    }
9199    /// Creates source map metadata.
9200    ///
9201    /// # Arguments
9202    ///
9203    /// * `filename` - The filename from the module source.
9204    /// * `line` - The line number within the filename.
9205    /// * `column` - The column number within the line.
9206    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
9207        let mut query = self.selection.select("sourceMap");
9208        query = query.arg("filename", filename.into());
9209        query = query.arg("line", line);
9210        query = query.arg("column", column);
9211        SourceMap {
9212            proc: self.proc.clone(),
9213            selection: query,
9214            graphql_client: self.graphql_client.clone(),
9215        }
9216    }
9217    /// Create a new TypeDef.
9218    pub fn type_def(&self) -> TypeDef {
9219        let query = self.selection.select("typeDef");
9220        TypeDef {
9221            proc: self.proc.clone(),
9222            selection: query,
9223            graphql_client: self.graphql_client.clone(),
9224        }
9225    }
9226    /// Get the current Dagger Engine version.
9227    pub async fn version(&self) -> Result<String, DaggerError> {
9228        let query = self.selection.select("version");
9229        query.execute(self.graphql_client.clone()).await
9230    }
9231}
9232#[derive(Clone)]
9233pub struct SdkConfig {
9234    pub proc: Option<Arc<DaggerSessionProc>>,
9235    pub selection: Selection,
9236    pub graphql_client: DynGraphQLClient,
9237}
9238impl SdkConfig {
9239    /// A unique identifier for this SDKConfig.
9240    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
9241        let query = self.selection.select("id");
9242        query.execute(self.graphql_client.clone()).await
9243    }
9244    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
9245    pub async fn source(&self) -> Result<String, DaggerError> {
9246        let query = self.selection.select("source");
9247        query.execute(self.graphql_client.clone()).await
9248    }
9249}
9250#[derive(Clone)]
9251pub struct ScalarTypeDef {
9252    pub proc: Option<Arc<DaggerSessionProc>>,
9253    pub selection: Selection,
9254    pub graphql_client: DynGraphQLClient,
9255}
9256impl ScalarTypeDef {
9257    /// A doc string for the scalar, if any.
9258    pub async fn description(&self) -> Result<String, DaggerError> {
9259        let query = self.selection.select("description");
9260        query.execute(self.graphql_client.clone()).await
9261    }
9262    /// A unique identifier for this ScalarTypeDef.
9263    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
9264        let query = self.selection.select("id");
9265        query.execute(self.graphql_client.clone()).await
9266    }
9267    /// The name of the scalar.
9268    pub async fn name(&self) -> Result<String, DaggerError> {
9269        let query = self.selection.select("name");
9270        query.execute(self.graphql_client.clone()).await
9271    }
9272    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
9273    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9274        let query = self.selection.select("sourceModuleName");
9275        query.execute(self.graphql_client.clone()).await
9276    }
9277}
9278#[derive(Clone)]
9279pub struct Secret {
9280    pub proc: Option<Arc<DaggerSessionProc>>,
9281    pub selection: Selection,
9282    pub graphql_client: DynGraphQLClient,
9283}
9284impl Secret {
9285    /// A unique identifier for this Secret.
9286    pub async fn id(&self) -> Result<SecretId, DaggerError> {
9287        let query = self.selection.select("id");
9288        query.execute(self.graphql_client.clone()).await
9289    }
9290    /// The name of this secret.
9291    pub async fn name(&self) -> Result<String, DaggerError> {
9292        let query = self.selection.select("name");
9293        query.execute(self.graphql_client.clone()).await
9294    }
9295    /// The value of this secret.
9296    pub async fn plaintext(&self) -> Result<String, DaggerError> {
9297        let query = self.selection.select("plaintext");
9298        query.execute(self.graphql_client.clone()).await
9299    }
9300    /// The URI of this secret.
9301    pub async fn uri(&self) -> Result<String, DaggerError> {
9302        let query = self.selection.select("uri");
9303        query.execute(self.graphql_client.clone()).await
9304    }
9305}
9306#[derive(Clone)]
9307pub struct Service {
9308    pub proc: Option<Arc<DaggerSessionProc>>,
9309    pub selection: Selection,
9310    pub graphql_client: DynGraphQLClient,
9311}
9312#[derive(Builder, Debug, PartialEq)]
9313pub struct ServiceEndpointOpts<'a> {
9314    /// The exposed port number for the endpoint
9315    #[builder(setter(into, strip_option), default)]
9316    pub port: Option<isize>,
9317    /// Return a URL with the given scheme, eg. http for http://
9318    #[builder(setter(into, strip_option), default)]
9319    pub scheme: Option<&'a str>,
9320}
9321#[derive(Builder, Debug, PartialEq)]
9322pub struct ServiceStopOpts {
9323    /// Immediately kill the service without waiting for a graceful exit
9324    #[builder(setter(into, strip_option), default)]
9325    pub kill: Option<bool>,
9326}
9327#[derive(Builder, Debug, PartialEq)]
9328pub struct ServiceUpOpts {
9329    /// List of frontend/backend port mappings to forward.
9330    /// Frontend is the port accepting traffic on the host, backend is the service port.
9331    #[builder(setter(into, strip_option), default)]
9332    pub ports: Option<Vec<PortForward>>,
9333    /// Bind each tunnel port to a random port on the host.
9334    #[builder(setter(into, strip_option), default)]
9335    pub random: Option<bool>,
9336}
9337impl Service {
9338    /// Retrieves an endpoint that clients can use to reach this container.
9339    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
9340    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
9341    ///
9342    /// # Arguments
9343    ///
9344    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9345    pub async fn endpoint(&self) -> Result<String, DaggerError> {
9346        let query = self.selection.select("endpoint");
9347        query.execute(self.graphql_client.clone()).await
9348    }
9349    /// Retrieves an endpoint that clients can use to reach this container.
9350    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
9351    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
9352    ///
9353    /// # Arguments
9354    ///
9355    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9356    pub async fn endpoint_opts<'a>(
9357        &self,
9358        opts: ServiceEndpointOpts<'a>,
9359    ) -> Result<String, DaggerError> {
9360        let mut query = self.selection.select("endpoint");
9361        if let Some(port) = opts.port {
9362            query = query.arg("port", port);
9363        }
9364        if let Some(scheme) = opts.scheme {
9365            query = query.arg("scheme", scheme);
9366        }
9367        query.execute(self.graphql_client.clone()).await
9368    }
9369    /// Retrieves a hostname which can be used by clients to reach this container.
9370    pub async fn hostname(&self) -> Result<String, DaggerError> {
9371        let query = self.selection.select("hostname");
9372        query.execute(self.graphql_client.clone()).await
9373    }
9374    /// A unique identifier for this Service.
9375    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
9376        let query = self.selection.select("id");
9377        query.execute(self.graphql_client.clone()).await
9378    }
9379    /// Retrieves the list of ports provided by the service.
9380    pub fn ports(&self) -> Vec<Port> {
9381        let query = self.selection.select("ports");
9382        vec![Port {
9383            proc: self.proc.clone(),
9384            selection: query,
9385            graphql_client: self.graphql_client.clone(),
9386        }]
9387    }
9388    /// Start the service and wait for its health checks to succeed.
9389    /// Services bound to a Container do not need to be manually started.
9390    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
9391        let query = self.selection.select("start");
9392        query.execute(self.graphql_client.clone()).await
9393    }
9394    /// Stop the service.
9395    ///
9396    /// # Arguments
9397    ///
9398    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9399    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
9400        let query = self.selection.select("stop");
9401        query.execute(self.graphql_client.clone()).await
9402    }
9403    /// Stop the service.
9404    ///
9405    /// # Arguments
9406    ///
9407    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9408    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
9409        let mut query = self.selection.select("stop");
9410        if let Some(kill) = opts.kill {
9411            query = query.arg("kill", kill);
9412        }
9413        query.execute(self.graphql_client.clone()).await
9414    }
9415    /// Creates a tunnel that forwards traffic from the caller's network to this service.
9416    ///
9417    /// # Arguments
9418    ///
9419    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9420    pub async fn up(&self) -> Result<Void, DaggerError> {
9421        let query = self.selection.select("up");
9422        query.execute(self.graphql_client.clone()).await
9423    }
9424    /// Creates a tunnel that forwards traffic from the caller's network to this service.
9425    ///
9426    /// # Arguments
9427    ///
9428    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9429    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
9430        let mut query = self.selection.select("up");
9431        if let Some(ports) = opts.ports {
9432            query = query.arg("ports", ports);
9433        }
9434        if let Some(random) = opts.random {
9435            query = query.arg("random", random);
9436        }
9437        query.execute(self.graphql_client.clone()).await
9438    }
9439    /// Configures a hostname which can be used by clients within the session to reach this container.
9440    ///
9441    /// # Arguments
9442    ///
9443    /// * `hostname` - The hostname to use.
9444    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
9445        let mut query = self.selection.select("withHostname");
9446        query = query.arg("hostname", hostname.into());
9447        Service {
9448            proc: self.proc.clone(),
9449            selection: query,
9450            graphql_client: self.graphql_client.clone(),
9451        }
9452    }
9453}
9454#[derive(Clone)]
9455pub struct Socket {
9456    pub proc: Option<Arc<DaggerSessionProc>>,
9457    pub selection: Selection,
9458    pub graphql_client: DynGraphQLClient,
9459}
9460impl Socket {
9461    /// A unique identifier for this Socket.
9462    pub async fn id(&self) -> Result<SocketId, DaggerError> {
9463        let query = self.selection.select("id");
9464        query.execute(self.graphql_client.clone()).await
9465    }
9466}
9467#[derive(Clone)]
9468pub struct SourceMap {
9469    pub proc: Option<Arc<DaggerSessionProc>>,
9470    pub selection: Selection,
9471    pub graphql_client: DynGraphQLClient,
9472}
9473impl SourceMap {
9474    /// The column number within the line.
9475    pub async fn column(&self) -> Result<isize, DaggerError> {
9476        let query = self.selection.select("column");
9477        query.execute(self.graphql_client.clone()).await
9478    }
9479    /// The filename from the module source.
9480    pub async fn filename(&self) -> Result<String, DaggerError> {
9481        let query = self.selection.select("filename");
9482        query.execute(self.graphql_client.clone()).await
9483    }
9484    /// A unique identifier for this SourceMap.
9485    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
9486        let query = self.selection.select("id");
9487        query.execute(self.graphql_client.clone()).await
9488    }
9489    /// The line number within the filename.
9490    pub async fn line(&self) -> Result<isize, DaggerError> {
9491        let query = self.selection.select("line");
9492        query.execute(self.graphql_client.clone()).await
9493    }
9494    /// The module dependency this was declared in.
9495    pub async fn module(&self) -> Result<String, DaggerError> {
9496        let query = self.selection.select("module");
9497        query.execute(self.graphql_client.clone()).await
9498    }
9499}
9500#[derive(Clone)]
9501pub struct Terminal {
9502    pub proc: Option<Arc<DaggerSessionProc>>,
9503    pub selection: Selection,
9504    pub graphql_client: DynGraphQLClient,
9505}
9506impl Terminal {
9507    /// A unique identifier for this Terminal.
9508    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
9509        let query = self.selection.select("id");
9510        query.execute(self.graphql_client.clone()).await
9511    }
9512    /// Forces evaluation of the pipeline in the engine.
9513    /// It doesn't run the default command if no exec has been set.
9514    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
9515        let query = self.selection.select("sync");
9516        query.execute(self.graphql_client.clone()).await
9517    }
9518}
9519#[derive(Clone)]
9520pub struct TypeDef {
9521    pub proc: Option<Arc<DaggerSessionProc>>,
9522    pub selection: Selection,
9523    pub graphql_client: DynGraphQLClient,
9524}
9525#[derive(Builder, Debug, PartialEq)]
9526pub struct TypeDefWithEnumOpts<'a> {
9527    /// A doc string for the enum, if any
9528    #[builder(setter(into, strip_option), default)]
9529    pub description: Option<&'a str>,
9530    /// The source map for the enum definition.
9531    #[builder(setter(into, strip_option), default)]
9532    pub source_map: Option<SourceMapId>,
9533}
9534#[derive(Builder, Debug, PartialEq)]
9535pub struct TypeDefWithEnumValueOpts<'a> {
9536    /// A doc string for the value, if any
9537    #[builder(setter(into, strip_option), default)]
9538    pub description: Option<&'a str>,
9539    /// The source map for the enum value definition.
9540    #[builder(setter(into, strip_option), default)]
9541    pub source_map: Option<SourceMapId>,
9542}
9543#[derive(Builder, Debug, PartialEq)]
9544pub struct TypeDefWithFieldOpts<'a> {
9545    /// A doc string for the field, if any
9546    #[builder(setter(into, strip_option), default)]
9547    pub description: Option<&'a str>,
9548    /// The source map for the field definition.
9549    #[builder(setter(into, strip_option), default)]
9550    pub source_map: Option<SourceMapId>,
9551}
9552#[derive(Builder, Debug, PartialEq)]
9553pub struct TypeDefWithInterfaceOpts<'a> {
9554    #[builder(setter(into, strip_option), default)]
9555    pub description: Option<&'a str>,
9556    #[builder(setter(into, strip_option), default)]
9557    pub source_map: Option<SourceMapId>,
9558}
9559#[derive(Builder, Debug, PartialEq)]
9560pub struct TypeDefWithObjectOpts<'a> {
9561    #[builder(setter(into, strip_option), default)]
9562    pub description: Option<&'a str>,
9563    #[builder(setter(into, strip_option), default)]
9564    pub source_map: Option<SourceMapId>,
9565}
9566#[derive(Builder, Debug, PartialEq)]
9567pub struct TypeDefWithScalarOpts<'a> {
9568    #[builder(setter(into, strip_option), default)]
9569    pub description: Option<&'a str>,
9570}
9571impl TypeDef {
9572    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
9573    pub fn as_enum(&self) -> EnumTypeDef {
9574        let query = self.selection.select("asEnum");
9575        EnumTypeDef {
9576            proc: self.proc.clone(),
9577            selection: query,
9578            graphql_client: self.graphql_client.clone(),
9579        }
9580    }
9581    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
9582    pub fn as_input(&self) -> InputTypeDef {
9583        let query = self.selection.select("asInput");
9584        InputTypeDef {
9585            proc: self.proc.clone(),
9586            selection: query,
9587            graphql_client: self.graphql_client.clone(),
9588        }
9589    }
9590    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
9591    pub fn as_interface(&self) -> InterfaceTypeDef {
9592        let query = self.selection.select("asInterface");
9593        InterfaceTypeDef {
9594            proc: self.proc.clone(),
9595            selection: query,
9596            graphql_client: self.graphql_client.clone(),
9597        }
9598    }
9599    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
9600    pub fn as_list(&self) -> ListTypeDef {
9601        let query = self.selection.select("asList");
9602        ListTypeDef {
9603            proc: self.proc.clone(),
9604            selection: query,
9605            graphql_client: self.graphql_client.clone(),
9606        }
9607    }
9608    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
9609    pub fn as_object(&self) -> ObjectTypeDef {
9610        let query = self.selection.select("asObject");
9611        ObjectTypeDef {
9612            proc: self.proc.clone(),
9613            selection: query,
9614            graphql_client: self.graphql_client.clone(),
9615        }
9616    }
9617    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
9618    pub fn as_scalar(&self) -> ScalarTypeDef {
9619        let query = self.selection.select("asScalar");
9620        ScalarTypeDef {
9621            proc: self.proc.clone(),
9622            selection: query,
9623            graphql_client: self.graphql_client.clone(),
9624        }
9625    }
9626    /// A unique identifier for this TypeDef.
9627    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
9628        let query = self.selection.select("id");
9629        query.execute(self.graphql_client.clone()).await
9630    }
9631    /// The kind of type this is (e.g. primitive, list, object).
9632    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
9633        let query = self.selection.select("kind");
9634        query.execute(self.graphql_client.clone()).await
9635    }
9636    /// Whether this type can be set to null. Defaults to false.
9637    pub async fn optional(&self) -> Result<bool, DaggerError> {
9638        let query = self.selection.select("optional");
9639        query.execute(self.graphql_client.clone()).await
9640    }
9641    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
9642    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
9643        let mut query = self.selection.select("withConstructor");
9644        query = query.arg_lazy(
9645            "function",
9646            Box::new(move || {
9647                let function = function.clone();
9648                Box::pin(async move { function.into_id().await.unwrap().quote() })
9649            }),
9650        );
9651        TypeDef {
9652            proc: self.proc.clone(),
9653            selection: query,
9654            graphql_client: self.graphql_client.clone(),
9655        }
9656    }
9657    /// Returns a TypeDef of kind Enum with the provided name.
9658    /// 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.
9659    ///
9660    /// # Arguments
9661    ///
9662    /// * `name` - The name of the enum
9663    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9664    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
9665        let mut query = self.selection.select("withEnum");
9666        query = query.arg("name", name.into());
9667        TypeDef {
9668            proc: self.proc.clone(),
9669            selection: query,
9670            graphql_client: self.graphql_client.clone(),
9671        }
9672    }
9673    /// Returns a TypeDef of kind Enum with the provided name.
9674    /// 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.
9675    ///
9676    /// # Arguments
9677    ///
9678    /// * `name` - The name of the enum
9679    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9680    pub fn with_enum_opts<'a>(
9681        &self,
9682        name: impl Into<String>,
9683        opts: TypeDefWithEnumOpts<'a>,
9684    ) -> TypeDef {
9685        let mut query = self.selection.select("withEnum");
9686        query = query.arg("name", name.into());
9687        if let Some(description) = opts.description {
9688            query = query.arg("description", description);
9689        }
9690        if let Some(source_map) = opts.source_map {
9691            query = query.arg("sourceMap", source_map);
9692        }
9693        TypeDef {
9694            proc: self.proc.clone(),
9695            selection: query,
9696            graphql_client: self.graphql_client.clone(),
9697        }
9698    }
9699    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
9700    ///
9701    /// # Arguments
9702    ///
9703    /// * `value` - The name of the value in the enum
9704    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9705    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
9706        let mut query = self.selection.select("withEnumValue");
9707        query = query.arg("value", value.into());
9708        TypeDef {
9709            proc: self.proc.clone(),
9710            selection: query,
9711            graphql_client: self.graphql_client.clone(),
9712        }
9713    }
9714    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
9715    ///
9716    /// # Arguments
9717    ///
9718    /// * `value` - The name of the value in the enum
9719    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9720    pub fn with_enum_value_opts<'a>(
9721        &self,
9722        value: impl Into<String>,
9723        opts: TypeDefWithEnumValueOpts<'a>,
9724    ) -> TypeDef {
9725        let mut query = self.selection.select("withEnumValue");
9726        query = query.arg("value", value.into());
9727        if let Some(description) = opts.description {
9728            query = query.arg("description", description);
9729        }
9730        if let Some(source_map) = opts.source_map {
9731            query = query.arg("sourceMap", source_map);
9732        }
9733        TypeDef {
9734            proc: self.proc.clone(),
9735            selection: query,
9736            graphql_client: self.graphql_client.clone(),
9737        }
9738    }
9739    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
9740    ///
9741    /// # Arguments
9742    ///
9743    /// * `name` - The name of the field in the object
9744    /// * `type_def` - The type of the field
9745    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9746    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
9747        let mut query = self.selection.select("withField");
9748        query = query.arg("name", name.into());
9749        query = query.arg_lazy(
9750            "typeDef",
9751            Box::new(move || {
9752                let type_def = type_def.clone();
9753                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9754            }),
9755        );
9756        TypeDef {
9757            proc: self.proc.clone(),
9758            selection: query,
9759            graphql_client: self.graphql_client.clone(),
9760        }
9761    }
9762    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
9763    ///
9764    /// # Arguments
9765    ///
9766    /// * `name` - The name of the field in the object
9767    /// * `type_def` - The type of the field
9768    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9769    pub fn with_field_opts<'a>(
9770        &self,
9771        name: impl Into<String>,
9772        type_def: impl IntoID<TypeDefId>,
9773        opts: TypeDefWithFieldOpts<'a>,
9774    ) -> TypeDef {
9775        let mut query = self.selection.select("withField");
9776        query = query.arg("name", name.into());
9777        query = query.arg_lazy(
9778            "typeDef",
9779            Box::new(move || {
9780                let type_def = type_def.clone();
9781                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9782            }),
9783        );
9784        if let Some(description) = opts.description {
9785            query = query.arg("description", description);
9786        }
9787        if let Some(source_map) = opts.source_map {
9788            query = query.arg("sourceMap", source_map);
9789        }
9790        TypeDef {
9791            proc: self.proc.clone(),
9792            selection: query,
9793            graphql_client: self.graphql_client.clone(),
9794        }
9795    }
9796    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
9797    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
9798        let mut query = self.selection.select("withFunction");
9799        query = query.arg_lazy(
9800            "function",
9801            Box::new(move || {
9802                let function = function.clone();
9803                Box::pin(async move { function.into_id().await.unwrap().quote() })
9804            }),
9805        );
9806        TypeDef {
9807            proc: self.proc.clone(),
9808            selection: query,
9809            graphql_client: self.graphql_client.clone(),
9810        }
9811    }
9812    /// Returns a TypeDef of kind Interface with the provided name.
9813    ///
9814    /// # Arguments
9815    ///
9816    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9817    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
9818        let mut query = self.selection.select("withInterface");
9819        query = query.arg("name", name.into());
9820        TypeDef {
9821            proc: self.proc.clone(),
9822            selection: query,
9823            graphql_client: self.graphql_client.clone(),
9824        }
9825    }
9826    /// Returns a TypeDef of kind Interface with the provided name.
9827    ///
9828    /// # Arguments
9829    ///
9830    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9831    pub fn with_interface_opts<'a>(
9832        &self,
9833        name: impl Into<String>,
9834        opts: TypeDefWithInterfaceOpts<'a>,
9835    ) -> TypeDef {
9836        let mut query = self.selection.select("withInterface");
9837        query = query.arg("name", name.into());
9838        if let Some(description) = opts.description {
9839            query = query.arg("description", description);
9840        }
9841        if let Some(source_map) = opts.source_map {
9842            query = query.arg("sourceMap", source_map);
9843        }
9844        TypeDef {
9845            proc: self.proc.clone(),
9846            selection: query,
9847            graphql_client: self.graphql_client.clone(),
9848        }
9849    }
9850    /// Sets the kind of the type.
9851    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
9852        let mut query = self.selection.select("withKind");
9853        query = query.arg("kind", kind);
9854        TypeDef {
9855            proc: self.proc.clone(),
9856            selection: query,
9857            graphql_client: self.graphql_client.clone(),
9858        }
9859    }
9860    /// Returns a TypeDef of kind List with the provided type for its elements.
9861    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
9862        let mut query = self.selection.select("withListOf");
9863        query = query.arg_lazy(
9864            "elementType",
9865            Box::new(move || {
9866                let element_type = element_type.clone();
9867                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
9868            }),
9869        );
9870        TypeDef {
9871            proc: self.proc.clone(),
9872            selection: query,
9873            graphql_client: self.graphql_client.clone(),
9874        }
9875    }
9876    /// Returns a TypeDef of kind Object with the provided name.
9877    /// 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.
9878    ///
9879    /// # Arguments
9880    ///
9881    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9882    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
9883        let mut query = self.selection.select("withObject");
9884        query = query.arg("name", name.into());
9885        TypeDef {
9886            proc: self.proc.clone(),
9887            selection: query,
9888            graphql_client: self.graphql_client.clone(),
9889        }
9890    }
9891    /// Returns a TypeDef of kind Object with the provided name.
9892    /// 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.
9893    ///
9894    /// # Arguments
9895    ///
9896    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9897    pub fn with_object_opts<'a>(
9898        &self,
9899        name: impl Into<String>,
9900        opts: TypeDefWithObjectOpts<'a>,
9901    ) -> TypeDef {
9902        let mut query = self.selection.select("withObject");
9903        query = query.arg("name", name.into());
9904        if let Some(description) = opts.description {
9905            query = query.arg("description", description);
9906        }
9907        if let Some(source_map) = opts.source_map {
9908            query = query.arg("sourceMap", source_map);
9909        }
9910        TypeDef {
9911            proc: self.proc.clone(),
9912            selection: query,
9913            graphql_client: self.graphql_client.clone(),
9914        }
9915    }
9916    /// Sets whether this type can be set to null.
9917    pub fn with_optional(&self, optional: bool) -> TypeDef {
9918        let mut query = self.selection.select("withOptional");
9919        query = query.arg("optional", optional);
9920        TypeDef {
9921            proc: self.proc.clone(),
9922            selection: query,
9923            graphql_client: self.graphql_client.clone(),
9924        }
9925    }
9926    /// Returns a TypeDef of kind Scalar with the provided name.
9927    ///
9928    /// # Arguments
9929    ///
9930    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9931    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
9932        let mut query = self.selection.select("withScalar");
9933        query = query.arg("name", name.into());
9934        TypeDef {
9935            proc: self.proc.clone(),
9936            selection: query,
9937            graphql_client: self.graphql_client.clone(),
9938        }
9939    }
9940    /// Returns a TypeDef of kind Scalar with the provided name.
9941    ///
9942    /// # Arguments
9943    ///
9944    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9945    pub fn with_scalar_opts<'a>(
9946        &self,
9947        name: impl Into<String>,
9948        opts: TypeDefWithScalarOpts<'a>,
9949    ) -> TypeDef {
9950        let mut query = self.selection.select("withScalar");
9951        query = query.arg("name", name.into());
9952        if let Some(description) = opts.description {
9953            query = query.arg("description", description);
9954        }
9955        TypeDef {
9956            proc: self.proc.clone(),
9957            selection: query,
9958            graphql_client: self.graphql_client.clone(),
9959        }
9960    }
9961}
9962#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
9963pub enum CacheSharingMode {
9964    #[serde(rename = "LOCKED")]
9965    Locked,
9966    #[serde(rename = "PRIVATE")]
9967    Private,
9968    #[serde(rename = "SHARED")]
9969    Shared,
9970}
9971#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
9972pub enum ImageLayerCompression {
9973    #[serde(rename = "EStarGZ")]
9974    EStarGz,
9975    #[serde(rename = "Gzip")]
9976    Gzip,
9977    #[serde(rename = "Uncompressed")]
9978    Uncompressed,
9979    #[serde(rename = "Zstd")]
9980    Zstd,
9981}
9982#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
9983pub enum ImageMediaTypes {
9984    #[serde(rename = "DockerMediaTypes")]
9985    DockerMediaTypes,
9986    #[serde(rename = "OCIMediaTypes")]
9987    OciMediaTypes,
9988}
9989#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
9990pub enum ModuleSourceKind {
9991    #[serde(rename = "DIR_SOURCE")]
9992    DirSource,
9993    #[serde(rename = "GIT_SOURCE")]
9994    GitSource,
9995    #[serde(rename = "LOCAL_SOURCE")]
9996    LocalSource,
9997}
9998#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
9999pub enum NetworkProtocol {
10000    #[serde(rename = "TCP")]
10001    Tcp,
10002    #[serde(rename = "UDP")]
10003    Udp,
10004}
10005#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10006pub enum ReturnType {
10007    #[serde(rename = "ANY")]
10008    Any,
10009    #[serde(rename = "FAILURE")]
10010    Failure,
10011    #[serde(rename = "SUCCESS")]
10012    Success,
10013}
10014#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10015pub enum TypeDefKind {
10016    #[serde(rename = "BOOLEAN_KIND")]
10017    BooleanKind,
10018    #[serde(rename = "ENUM_KIND")]
10019    EnumKind,
10020    #[serde(rename = "FLOAT_KIND")]
10021    FloatKind,
10022    #[serde(rename = "INPUT_KIND")]
10023    InputKind,
10024    #[serde(rename = "INTEGER_KIND")]
10025    IntegerKind,
10026    #[serde(rename = "INTERFACE_KIND")]
10027    InterfaceKind,
10028    #[serde(rename = "LIST_KIND")]
10029    ListKind,
10030    #[serde(rename = "OBJECT_KIND")]
10031    ObjectKind,
10032    #[serde(rename = "SCALAR_KIND")]
10033    ScalarKind,
10034    #[serde(rename = "STRING_KIND")]
10035    StringKind,
10036    #[serde(rename = "VOID_KIND")]
10037    VoidKind,
10038}