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