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 CloudId(pub String);
82impl From<&str> for CloudId {
83    fn from(value: &str) -> Self {
84        Self(value.to_string())
85    }
86}
87impl From<String> for CloudId {
88    fn from(value: String) -> Self {
89        Self(value)
90    }
91}
92impl IntoID<CloudId> for Cloud {
93    fn into_id(
94        self,
95    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
96    {
97        Box::pin(async move { self.id().await })
98    }
99}
100impl IntoID<CloudId> for CloudId {
101    fn into_id(
102        self,
103    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
104    {
105        Box::pin(async move { Ok::<CloudId, DaggerError>(self) })
106    }
107}
108impl CloudId {
109    fn quote(&self) -> String {
110        format!("\"{}\"", self.0.clone())
111    }
112}
113#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
114pub struct ContainerId(pub String);
115impl From<&str> for ContainerId {
116    fn from(value: &str) -> Self {
117        Self(value.to_string())
118    }
119}
120impl From<String> for ContainerId {
121    fn from(value: String) -> Self {
122        Self(value)
123    }
124}
125impl IntoID<ContainerId> for Container {
126    fn into_id(
127        self,
128    ) -> std::pin::Pin<
129        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
130    > {
131        Box::pin(async move { self.id().await })
132    }
133}
134impl IntoID<ContainerId> for ContainerId {
135    fn into_id(
136        self,
137    ) -> std::pin::Pin<
138        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
139    > {
140        Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
141    }
142}
143impl ContainerId {
144    fn quote(&self) -> String {
145        format!("\"{}\"", self.0.clone())
146    }
147}
148#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
149pub struct CurrentModuleId(pub String);
150impl From<&str> for CurrentModuleId {
151    fn from(value: &str) -> Self {
152        Self(value.to_string())
153    }
154}
155impl From<String> for CurrentModuleId {
156    fn from(value: String) -> Self {
157        Self(value)
158    }
159}
160impl IntoID<CurrentModuleId> for CurrentModule {
161    fn into_id(
162        self,
163    ) -> std::pin::Pin<
164        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
165    > {
166        Box::pin(async move { self.id().await })
167    }
168}
169impl IntoID<CurrentModuleId> for CurrentModuleId {
170    fn into_id(
171        self,
172    ) -> std::pin::Pin<
173        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
174    > {
175        Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
176    }
177}
178impl CurrentModuleId {
179    fn quote(&self) -> String {
180        format!("\"{}\"", self.0.clone())
181    }
182}
183#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
184pub struct DirectoryId(pub String);
185impl From<&str> for DirectoryId {
186    fn from(value: &str) -> Self {
187        Self(value.to_string())
188    }
189}
190impl From<String> for DirectoryId {
191    fn from(value: String) -> Self {
192        Self(value)
193    }
194}
195impl IntoID<DirectoryId> for Directory {
196    fn into_id(
197        self,
198    ) -> std::pin::Pin<
199        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
200    > {
201        Box::pin(async move { self.id().await })
202    }
203}
204impl IntoID<DirectoryId> for DirectoryId {
205    fn into_id(
206        self,
207    ) -> std::pin::Pin<
208        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
209    > {
210        Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
211    }
212}
213impl DirectoryId {
214    fn quote(&self) -> String {
215        format!("\"{}\"", self.0.clone())
216    }
217}
218#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
219pub struct EngineCacheEntryId(pub String);
220impl From<&str> for EngineCacheEntryId {
221    fn from(value: &str) -> Self {
222        Self(value.to_string())
223    }
224}
225impl From<String> for EngineCacheEntryId {
226    fn from(value: String) -> Self {
227        Self(value)
228    }
229}
230impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
231    fn into_id(
232        self,
233    ) -> std::pin::Pin<
234        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
235    > {
236        Box::pin(async move { self.id().await })
237    }
238}
239impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
240    fn into_id(
241        self,
242    ) -> std::pin::Pin<
243        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
244    > {
245        Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
246    }
247}
248impl EngineCacheEntryId {
249    fn quote(&self) -> String {
250        format!("\"{}\"", self.0.clone())
251    }
252}
253#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
254pub struct EngineCacheEntrySetId(pub String);
255impl From<&str> for EngineCacheEntrySetId {
256    fn from(value: &str) -> Self {
257        Self(value.to_string())
258    }
259}
260impl From<String> for EngineCacheEntrySetId {
261    fn from(value: String) -> Self {
262        Self(value)
263    }
264}
265impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
266    fn into_id(
267        self,
268    ) -> std::pin::Pin<
269        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
270    > {
271        Box::pin(async move { self.id().await })
272    }
273}
274impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
275    fn into_id(
276        self,
277    ) -> std::pin::Pin<
278        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
279    > {
280        Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
281    }
282}
283impl EngineCacheEntrySetId {
284    fn quote(&self) -> String {
285        format!("\"{}\"", self.0.clone())
286    }
287}
288#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
289pub struct EngineCacheId(pub String);
290impl From<&str> for EngineCacheId {
291    fn from(value: &str) -> Self {
292        Self(value.to_string())
293    }
294}
295impl From<String> for EngineCacheId {
296    fn from(value: String) -> Self {
297        Self(value)
298    }
299}
300impl IntoID<EngineCacheId> for EngineCache {
301    fn into_id(
302        self,
303    ) -> std::pin::Pin<
304        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
305    > {
306        Box::pin(async move { self.id().await })
307    }
308}
309impl IntoID<EngineCacheId> for EngineCacheId {
310    fn into_id(
311        self,
312    ) -> std::pin::Pin<
313        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
314    > {
315        Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
316    }
317}
318impl EngineCacheId {
319    fn quote(&self) -> String {
320        format!("\"{}\"", self.0.clone())
321    }
322}
323#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
324pub struct EngineId(pub String);
325impl From<&str> for EngineId {
326    fn from(value: &str) -> Self {
327        Self(value.to_string())
328    }
329}
330impl From<String> for EngineId {
331    fn from(value: String) -> Self {
332        Self(value)
333    }
334}
335impl IntoID<EngineId> for Engine {
336    fn into_id(
337        self,
338    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
339    {
340        Box::pin(async move { self.id().await })
341    }
342}
343impl IntoID<EngineId> for EngineId {
344    fn into_id(
345        self,
346    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
347    {
348        Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
349    }
350}
351impl EngineId {
352    fn quote(&self) -> String {
353        format!("\"{}\"", self.0.clone())
354    }
355}
356#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
357pub struct EnumTypeDefId(pub String);
358impl From<&str> for EnumTypeDefId {
359    fn from(value: &str) -> Self {
360        Self(value.to_string())
361    }
362}
363impl From<String> for EnumTypeDefId {
364    fn from(value: String) -> Self {
365        Self(value)
366    }
367}
368impl IntoID<EnumTypeDefId> for EnumTypeDef {
369    fn into_id(
370        self,
371    ) -> std::pin::Pin<
372        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
373    > {
374        Box::pin(async move { self.id().await })
375    }
376}
377impl IntoID<EnumTypeDefId> for EnumTypeDefId {
378    fn into_id(
379        self,
380    ) -> std::pin::Pin<
381        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
382    > {
383        Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
384    }
385}
386impl EnumTypeDefId {
387    fn quote(&self) -> String {
388        format!("\"{}\"", self.0.clone())
389    }
390}
391#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
392pub struct EnumValueTypeDefId(pub String);
393impl From<&str> for EnumValueTypeDefId {
394    fn from(value: &str) -> Self {
395        Self(value.to_string())
396    }
397}
398impl From<String> for EnumValueTypeDefId {
399    fn from(value: String) -> Self {
400        Self(value)
401    }
402}
403impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
404    fn into_id(
405        self,
406    ) -> std::pin::Pin<
407        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
408    > {
409        Box::pin(async move { self.id().await })
410    }
411}
412impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
413    fn into_id(
414        self,
415    ) -> std::pin::Pin<
416        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
417    > {
418        Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
419    }
420}
421impl EnumValueTypeDefId {
422    fn quote(&self) -> String {
423        format!("\"{}\"", self.0.clone())
424    }
425}
426#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
427pub struct EnvId(pub String);
428impl From<&str> for EnvId {
429    fn from(value: &str) -> Self {
430        Self(value.to_string())
431    }
432}
433impl From<String> for EnvId {
434    fn from(value: String) -> Self {
435        Self(value)
436    }
437}
438impl IntoID<EnvId> for Env {
439    fn into_id(
440        self,
441    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
442    {
443        Box::pin(async move { self.id().await })
444    }
445}
446impl IntoID<EnvId> for EnvId {
447    fn into_id(
448        self,
449    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
450    {
451        Box::pin(async move { Ok::<EnvId, DaggerError>(self) })
452    }
453}
454impl EnvId {
455    fn quote(&self) -> String {
456        format!("\"{}\"", self.0.clone())
457    }
458}
459#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
460pub struct EnvVariableId(pub String);
461impl From<&str> for EnvVariableId {
462    fn from(value: &str) -> Self {
463        Self(value.to_string())
464    }
465}
466impl From<String> for EnvVariableId {
467    fn from(value: String) -> Self {
468        Self(value)
469    }
470}
471impl IntoID<EnvVariableId> for EnvVariable {
472    fn into_id(
473        self,
474    ) -> std::pin::Pin<
475        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
476    > {
477        Box::pin(async move { self.id().await })
478    }
479}
480impl IntoID<EnvVariableId> for EnvVariableId {
481    fn into_id(
482        self,
483    ) -> std::pin::Pin<
484        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
485    > {
486        Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
487    }
488}
489impl EnvVariableId {
490    fn quote(&self) -> String {
491        format!("\"{}\"", self.0.clone())
492    }
493}
494#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
495pub struct ErrorId(pub String);
496impl From<&str> for ErrorId {
497    fn from(value: &str) -> Self {
498        Self(value.to_string())
499    }
500}
501impl From<String> for ErrorId {
502    fn from(value: String) -> Self {
503        Self(value)
504    }
505}
506impl IntoID<ErrorId> for Error {
507    fn into_id(
508        self,
509    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
510    {
511        Box::pin(async move { self.id().await })
512    }
513}
514impl IntoID<ErrorId> for ErrorId {
515    fn into_id(
516        self,
517    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
518    {
519        Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
520    }
521}
522impl ErrorId {
523    fn quote(&self) -> String {
524        format!("\"{}\"", self.0.clone())
525    }
526}
527#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
528pub struct ErrorValueId(pub String);
529impl From<&str> for ErrorValueId {
530    fn from(value: &str) -> Self {
531        Self(value.to_string())
532    }
533}
534impl From<String> for ErrorValueId {
535    fn from(value: String) -> Self {
536        Self(value)
537    }
538}
539impl IntoID<ErrorValueId> for ErrorValue {
540    fn into_id(
541        self,
542    ) -> std::pin::Pin<
543        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
544    > {
545        Box::pin(async move { self.id().await })
546    }
547}
548impl IntoID<ErrorValueId> for ErrorValueId {
549    fn into_id(
550        self,
551    ) -> std::pin::Pin<
552        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
553    > {
554        Box::pin(async move { Ok::<ErrorValueId, DaggerError>(self) })
555    }
556}
557impl ErrorValueId {
558    fn quote(&self) -> String {
559        format!("\"{}\"", self.0.clone())
560    }
561}
562#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
563pub struct FieldTypeDefId(pub String);
564impl From<&str> for FieldTypeDefId {
565    fn from(value: &str) -> Self {
566        Self(value.to_string())
567    }
568}
569impl From<String> for FieldTypeDefId {
570    fn from(value: String) -> Self {
571        Self(value)
572    }
573}
574impl IntoID<FieldTypeDefId> for FieldTypeDef {
575    fn into_id(
576        self,
577    ) -> std::pin::Pin<
578        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
579    > {
580        Box::pin(async move { self.id().await })
581    }
582}
583impl IntoID<FieldTypeDefId> for FieldTypeDefId {
584    fn into_id(
585        self,
586    ) -> std::pin::Pin<
587        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
588    > {
589        Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
590    }
591}
592impl FieldTypeDefId {
593    fn quote(&self) -> String {
594        format!("\"{}\"", self.0.clone())
595    }
596}
597#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
598pub struct FileId(pub String);
599impl From<&str> for FileId {
600    fn from(value: &str) -> Self {
601        Self(value.to_string())
602    }
603}
604impl From<String> for FileId {
605    fn from(value: String) -> Self {
606        Self(value)
607    }
608}
609impl IntoID<FileId> for File {
610    fn into_id(
611        self,
612    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
613    {
614        Box::pin(async move { self.id().await })
615    }
616}
617impl IntoID<FileId> for FileId {
618    fn into_id(
619        self,
620    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
621    {
622        Box::pin(async move { Ok::<FileId, DaggerError>(self) })
623    }
624}
625impl FileId {
626    fn quote(&self) -> String {
627        format!("\"{}\"", self.0.clone())
628    }
629}
630#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
631pub struct FunctionArgId(pub String);
632impl From<&str> for FunctionArgId {
633    fn from(value: &str) -> Self {
634        Self(value.to_string())
635    }
636}
637impl From<String> for FunctionArgId {
638    fn from(value: String) -> Self {
639        Self(value)
640    }
641}
642impl IntoID<FunctionArgId> for FunctionArg {
643    fn into_id(
644        self,
645    ) -> std::pin::Pin<
646        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
647    > {
648        Box::pin(async move { self.id().await })
649    }
650}
651impl IntoID<FunctionArgId> for FunctionArgId {
652    fn into_id(
653        self,
654    ) -> std::pin::Pin<
655        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
656    > {
657        Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
658    }
659}
660impl FunctionArgId {
661    fn quote(&self) -> String {
662        format!("\"{}\"", self.0.clone())
663    }
664}
665#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
666pub struct FunctionCallArgValueId(pub String);
667impl From<&str> for FunctionCallArgValueId {
668    fn from(value: &str) -> Self {
669        Self(value.to_string())
670    }
671}
672impl From<String> for FunctionCallArgValueId {
673    fn from(value: String) -> Self {
674        Self(value)
675    }
676}
677impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
678    fn into_id(
679        self,
680    ) -> std::pin::Pin<
681        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
682    > {
683        Box::pin(async move { self.id().await })
684    }
685}
686impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
687    fn into_id(
688        self,
689    ) -> std::pin::Pin<
690        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
691    > {
692        Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
693    }
694}
695impl FunctionCallArgValueId {
696    fn quote(&self) -> String {
697        format!("\"{}\"", self.0.clone())
698    }
699}
700#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
701pub struct FunctionCallId(pub String);
702impl From<&str> for FunctionCallId {
703    fn from(value: &str) -> Self {
704        Self(value.to_string())
705    }
706}
707impl From<String> for FunctionCallId {
708    fn from(value: String) -> Self {
709        Self(value)
710    }
711}
712impl IntoID<FunctionCallId> for FunctionCall {
713    fn into_id(
714        self,
715    ) -> std::pin::Pin<
716        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
717    > {
718        Box::pin(async move { self.id().await })
719    }
720}
721impl IntoID<FunctionCallId> for FunctionCallId {
722    fn into_id(
723        self,
724    ) -> std::pin::Pin<
725        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
726    > {
727        Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
728    }
729}
730impl FunctionCallId {
731    fn quote(&self) -> String {
732        format!("\"{}\"", self.0.clone())
733    }
734}
735#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
736pub struct FunctionId(pub String);
737impl From<&str> for FunctionId {
738    fn from(value: &str) -> Self {
739        Self(value.to_string())
740    }
741}
742impl From<String> for FunctionId {
743    fn from(value: String) -> Self {
744        Self(value)
745    }
746}
747impl IntoID<FunctionId> for Function {
748    fn into_id(
749        self,
750    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
751    {
752        Box::pin(async move { self.id().await })
753    }
754}
755impl IntoID<FunctionId> for FunctionId {
756    fn into_id(
757        self,
758    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
759    {
760        Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
761    }
762}
763impl FunctionId {
764    fn quote(&self) -> String {
765        format!("\"{}\"", self.0.clone())
766    }
767}
768#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
769pub struct GeneratedCodeId(pub String);
770impl From<&str> for GeneratedCodeId {
771    fn from(value: &str) -> Self {
772        Self(value.to_string())
773    }
774}
775impl From<String> for GeneratedCodeId {
776    fn from(value: String) -> Self {
777        Self(value)
778    }
779}
780impl IntoID<GeneratedCodeId> for GeneratedCode {
781    fn into_id(
782        self,
783    ) -> std::pin::Pin<
784        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
785    > {
786        Box::pin(async move { self.id().await })
787    }
788}
789impl IntoID<GeneratedCodeId> for GeneratedCodeId {
790    fn into_id(
791        self,
792    ) -> std::pin::Pin<
793        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
794    > {
795        Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
796    }
797}
798impl GeneratedCodeId {
799    fn quote(&self) -> String {
800        format!("\"{}\"", self.0.clone())
801    }
802}
803#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
804pub struct GitRefId(pub String);
805impl From<&str> for GitRefId {
806    fn from(value: &str) -> Self {
807        Self(value.to_string())
808    }
809}
810impl From<String> for GitRefId {
811    fn from(value: String) -> Self {
812        Self(value)
813    }
814}
815impl IntoID<GitRefId> for GitRef {
816    fn into_id(
817        self,
818    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
819    {
820        Box::pin(async move { self.id().await })
821    }
822}
823impl IntoID<GitRefId> for GitRefId {
824    fn into_id(
825        self,
826    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
827    {
828        Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
829    }
830}
831impl GitRefId {
832    fn quote(&self) -> String {
833        format!("\"{}\"", self.0.clone())
834    }
835}
836#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
837pub struct GitRepositoryId(pub String);
838impl From<&str> for GitRepositoryId {
839    fn from(value: &str) -> Self {
840        Self(value.to_string())
841    }
842}
843impl From<String> for GitRepositoryId {
844    fn from(value: String) -> Self {
845        Self(value)
846    }
847}
848impl IntoID<GitRepositoryId> for GitRepository {
849    fn into_id(
850        self,
851    ) -> std::pin::Pin<
852        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
853    > {
854        Box::pin(async move { self.id().await })
855    }
856}
857impl IntoID<GitRepositoryId> for GitRepositoryId {
858    fn into_id(
859        self,
860    ) -> std::pin::Pin<
861        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
862    > {
863        Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
864    }
865}
866impl GitRepositoryId {
867    fn quote(&self) -> String {
868        format!("\"{}\"", self.0.clone())
869    }
870}
871#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
872pub struct HostId(pub String);
873impl From<&str> for HostId {
874    fn from(value: &str) -> Self {
875        Self(value.to_string())
876    }
877}
878impl From<String> for HostId {
879    fn from(value: String) -> Self {
880        Self(value)
881    }
882}
883impl IntoID<HostId> for Host {
884    fn into_id(
885        self,
886    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
887    {
888        Box::pin(async move { self.id().await })
889    }
890}
891impl IntoID<HostId> for HostId {
892    fn into_id(
893        self,
894    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
895    {
896        Box::pin(async move { Ok::<HostId, DaggerError>(self) })
897    }
898}
899impl HostId {
900    fn quote(&self) -> String {
901        format!("\"{}\"", self.0.clone())
902    }
903}
904#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
905pub struct InputTypeDefId(pub String);
906impl From<&str> for InputTypeDefId {
907    fn from(value: &str) -> Self {
908        Self(value.to_string())
909    }
910}
911impl From<String> for InputTypeDefId {
912    fn from(value: String) -> Self {
913        Self(value)
914    }
915}
916impl IntoID<InputTypeDefId> for InputTypeDef {
917    fn into_id(
918        self,
919    ) -> std::pin::Pin<
920        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
921    > {
922        Box::pin(async move { self.id().await })
923    }
924}
925impl IntoID<InputTypeDefId> for InputTypeDefId {
926    fn into_id(
927        self,
928    ) -> std::pin::Pin<
929        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
930    > {
931        Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
932    }
933}
934impl InputTypeDefId {
935    fn quote(&self) -> String {
936        format!("\"{}\"", self.0.clone())
937    }
938}
939#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
940pub struct InterfaceTypeDefId(pub String);
941impl From<&str> for InterfaceTypeDefId {
942    fn from(value: &str) -> Self {
943        Self(value.to_string())
944    }
945}
946impl From<String> for InterfaceTypeDefId {
947    fn from(value: String) -> Self {
948        Self(value)
949    }
950}
951impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
952    fn into_id(
953        self,
954    ) -> std::pin::Pin<
955        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
956    > {
957        Box::pin(async move { self.id().await })
958    }
959}
960impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
961    fn into_id(
962        self,
963    ) -> std::pin::Pin<
964        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
965    > {
966        Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
967    }
968}
969impl InterfaceTypeDefId {
970    fn quote(&self) -> String {
971        format!("\"{}\"", self.0.clone())
972    }
973}
974#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
975pub struct Json(pub String);
976impl From<&str> for Json {
977    fn from(value: &str) -> Self {
978        Self(value.to_string())
979    }
980}
981impl From<String> for Json {
982    fn from(value: String) -> Self {
983        Self(value)
984    }
985}
986impl Json {
987    fn quote(&self) -> String {
988        format!("\"{}\"", self.0.clone())
989    }
990}
991#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
992pub struct Llmid(pub String);
993impl From<&str> for Llmid {
994    fn from(value: &str) -> Self {
995        Self(value.to_string())
996    }
997}
998impl From<String> for Llmid {
999    fn from(value: String) -> Self {
1000        Self(value)
1001    }
1002}
1003impl IntoID<Llmid> for Llm {
1004    fn into_id(
1005        self,
1006    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1007    {
1008        Box::pin(async move { self.id().await })
1009    }
1010}
1011impl IntoID<Llmid> for Llmid {
1012    fn into_id(
1013        self,
1014    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1015    {
1016        Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
1017    }
1018}
1019impl Llmid {
1020    fn quote(&self) -> String {
1021        format!("\"{}\"", self.0.clone())
1022    }
1023}
1024#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1025pub struct LlmTokenUsageId(pub String);
1026impl From<&str> for LlmTokenUsageId {
1027    fn from(value: &str) -> Self {
1028        Self(value.to_string())
1029    }
1030}
1031impl From<String> for LlmTokenUsageId {
1032    fn from(value: String) -> Self {
1033        Self(value)
1034    }
1035}
1036impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
1037    fn into_id(
1038        self,
1039    ) -> std::pin::Pin<
1040        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1041    > {
1042        Box::pin(async move { self.id().await })
1043    }
1044}
1045impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
1046    fn into_id(
1047        self,
1048    ) -> std::pin::Pin<
1049        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1050    > {
1051        Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
1052    }
1053}
1054impl LlmTokenUsageId {
1055    fn quote(&self) -> String {
1056        format!("\"{}\"", self.0.clone())
1057    }
1058}
1059#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1060pub struct LabelId(pub String);
1061impl From<&str> for LabelId {
1062    fn from(value: &str) -> Self {
1063        Self(value.to_string())
1064    }
1065}
1066impl From<String> for LabelId {
1067    fn from(value: String) -> Self {
1068        Self(value)
1069    }
1070}
1071impl IntoID<LabelId> for Label {
1072    fn into_id(
1073        self,
1074    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1075    {
1076        Box::pin(async move { self.id().await })
1077    }
1078}
1079impl IntoID<LabelId> for LabelId {
1080    fn into_id(
1081        self,
1082    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1083    {
1084        Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
1085    }
1086}
1087impl LabelId {
1088    fn quote(&self) -> String {
1089        format!("\"{}\"", self.0.clone())
1090    }
1091}
1092#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1093pub struct ListTypeDefId(pub String);
1094impl From<&str> for ListTypeDefId {
1095    fn from(value: &str) -> Self {
1096        Self(value.to_string())
1097    }
1098}
1099impl From<String> for ListTypeDefId {
1100    fn from(value: String) -> Self {
1101        Self(value)
1102    }
1103}
1104impl IntoID<ListTypeDefId> for ListTypeDef {
1105    fn into_id(
1106        self,
1107    ) -> std::pin::Pin<
1108        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1109    > {
1110        Box::pin(async move { self.id().await })
1111    }
1112}
1113impl IntoID<ListTypeDefId> for ListTypeDefId {
1114    fn into_id(
1115        self,
1116    ) -> std::pin::Pin<
1117        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1118    > {
1119        Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
1120    }
1121}
1122impl ListTypeDefId {
1123    fn quote(&self) -> String {
1124        format!("\"{}\"", self.0.clone())
1125    }
1126}
1127#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1128pub struct ModuleConfigClientId(pub String);
1129impl From<&str> for ModuleConfigClientId {
1130    fn from(value: &str) -> Self {
1131        Self(value.to_string())
1132    }
1133}
1134impl From<String> for ModuleConfigClientId {
1135    fn from(value: String) -> Self {
1136        Self(value)
1137    }
1138}
1139impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
1140    fn into_id(
1141        self,
1142    ) -> std::pin::Pin<
1143        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1144    > {
1145        Box::pin(async move { self.id().await })
1146    }
1147}
1148impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
1149    fn into_id(
1150        self,
1151    ) -> std::pin::Pin<
1152        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1153    > {
1154        Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
1155    }
1156}
1157impl ModuleConfigClientId {
1158    fn quote(&self) -> String {
1159        format!("\"{}\"", self.0.clone())
1160    }
1161}
1162#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1163pub struct ModuleId(pub String);
1164impl From<&str> for ModuleId {
1165    fn from(value: &str) -> Self {
1166        Self(value.to_string())
1167    }
1168}
1169impl From<String> for ModuleId {
1170    fn from(value: String) -> Self {
1171        Self(value)
1172    }
1173}
1174impl IntoID<ModuleId> for Module {
1175    fn into_id(
1176        self,
1177    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1178    {
1179        Box::pin(async move { self.id().await })
1180    }
1181}
1182impl IntoID<ModuleId> for ModuleId {
1183    fn into_id(
1184        self,
1185    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1186    {
1187        Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
1188    }
1189}
1190impl ModuleId {
1191    fn quote(&self) -> String {
1192        format!("\"{}\"", self.0.clone())
1193    }
1194}
1195#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1196pub struct ModuleSourceId(pub String);
1197impl From<&str> for ModuleSourceId {
1198    fn from(value: &str) -> Self {
1199        Self(value.to_string())
1200    }
1201}
1202impl From<String> for ModuleSourceId {
1203    fn from(value: String) -> Self {
1204        Self(value)
1205    }
1206}
1207impl IntoID<ModuleSourceId> for ModuleSource {
1208    fn into_id(
1209        self,
1210    ) -> std::pin::Pin<
1211        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1212    > {
1213        Box::pin(async move { self.id().await })
1214    }
1215}
1216impl IntoID<ModuleSourceId> for ModuleSourceId {
1217    fn into_id(
1218        self,
1219    ) -> std::pin::Pin<
1220        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1221    > {
1222        Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1223    }
1224}
1225impl ModuleSourceId {
1226    fn quote(&self) -> String {
1227        format!("\"{}\"", self.0.clone())
1228    }
1229}
1230#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1231pub struct ObjectTypeDefId(pub String);
1232impl From<&str> for ObjectTypeDefId {
1233    fn from(value: &str) -> Self {
1234        Self(value.to_string())
1235    }
1236}
1237impl From<String> for ObjectTypeDefId {
1238    fn from(value: String) -> Self {
1239        Self(value)
1240    }
1241}
1242impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1243    fn into_id(
1244        self,
1245    ) -> std::pin::Pin<
1246        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1247    > {
1248        Box::pin(async move { self.id().await })
1249    }
1250}
1251impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1252    fn into_id(
1253        self,
1254    ) -> std::pin::Pin<
1255        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1256    > {
1257        Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1258    }
1259}
1260impl ObjectTypeDefId {
1261    fn quote(&self) -> String {
1262        format!("\"{}\"", self.0.clone())
1263    }
1264}
1265#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1266pub struct Platform(pub String);
1267impl From<&str> for Platform {
1268    fn from(value: &str) -> Self {
1269        Self(value.to_string())
1270    }
1271}
1272impl From<String> for Platform {
1273    fn from(value: String) -> Self {
1274        Self(value)
1275    }
1276}
1277impl Platform {
1278    fn quote(&self) -> String {
1279        format!("\"{}\"", self.0.clone())
1280    }
1281}
1282#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1283pub struct PortId(pub String);
1284impl From<&str> for PortId {
1285    fn from(value: &str) -> Self {
1286        Self(value.to_string())
1287    }
1288}
1289impl From<String> for PortId {
1290    fn from(value: String) -> Self {
1291        Self(value)
1292    }
1293}
1294impl IntoID<PortId> for Port {
1295    fn into_id(
1296        self,
1297    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1298    {
1299        Box::pin(async move { self.id().await })
1300    }
1301}
1302impl IntoID<PortId> for PortId {
1303    fn into_id(
1304        self,
1305    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1306    {
1307        Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1308    }
1309}
1310impl PortId {
1311    fn quote(&self) -> String {
1312        format!("\"{}\"", self.0.clone())
1313    }
1314}
1315#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1316pub struct SdkConfigId(pub String);
1317impl From<&str> for SdkConfigId {
1318    fn from(value: &str) -> Self {
1319        Self(value.to_string())
1320    }
1321}
1322impl From<String> for SdkConfigId {
1323    fn from(value: String) -> Self {
1324        Self(value)
1325    }
1326}
1327impl IntoID<SdkConfigId> for SdkConfig {
1328    fn into_id(
1329        self,
1330    ) -> std::pin::Pin<
1331        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1332    > {
1333        Box::pin(async move { self.id().await })
1334    }
1335}
1336impl IntoID<SdkConfigId> for SdkConfigId {
1337    fn into_id(
1338        self,
1339    ) -> std::pin::Pin<
1340        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1341    > {
1342        Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1343    }
1344}
1345impl SdkConfigId {
1346    fn quote(&self) -> String {
1347        format!("\"{}\"", self.0.clone())
1348    }
1349}
1350#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1351pub struct ScalarTypeDefId(pub String);
1352impl From<&str> for ScalarTypeDefId {
1353    fn from(value: &str) -> Self {
1354        Self(value.to_string())
1355    }
1356}
1357impl From<String> for ScalarTypeDefId {
1358    fn from(value: String) -> Self {
1359        Self(value)
1360    }
1361}
1362impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1363    fn into_id(
1364        self,
1365    ) -> std::pin::Pin<
1366        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1367    > {
1368        Box::pin(async move { self.id().await })
1369    }
1370}
1371impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1372    fn into_id(
1373        self,
1374    ) -> std::pin::Pin<
1375        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1376    > {
1377        Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1378    }
1379}
1380impl ScalarTypeDefId {
1381    fn quote(&self) -> String {
1382        format!("\"{}\"", self.0.clone())
1383    }
1384}
1385#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1386pub struct SecretId(pub String);
1387impl From<&str> for SecretId {
1388    fn from(value: &str) -> Self {
1389        Self(value.to_string())
1390    }
1391}
1392impl From<String> for SecretId {
1393    fn from(value: String) -> Self {
1394        Self(value)
1395    }
1396}
1397impl IntoID<SecretId> for Secret {
1398    fn into_id(
1399        self,
1400    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1401    {
1402        Box::pin(async move { self.id().await })
1403    }
1404}
1405impl IntoID<SecretId> for SecretId {
1406    fn into_id(
1407        self,
1408    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1409    {
1410        Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1411    }
1412}
1413impl SecretId {
1414    fn quote(&self) -> String {
1415        format!("\"{}\"", self.0.clone())
1416    }
1417}
1418#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1419pub struct ServiceId(pub String);
1420impl From<&str> for ServiceId {
1421    fn from(value: &str) -> Self {
1422        Self(value.to_string())
1423    }
1424}
1425impl From<String> for ServiceId {
1426    fn from(value: String) -> Self {
1427        Self(value)
1428    }
1429}
1430impl IntoID<ServiceId> for Service {
1431    fn into_id(
1432        self,
1433    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1434    {
1435        Box::pin(async move { self.id().await })
1436    }
1437}
1438impl IntoID<ServiceId> for ServiceId {
1439    fn into_id(
1440        self,
1441    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1442    {
1443        Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1444    }
1445}
1446impl ServiceId {
1447    fn quote(&self) -> String {
1448        format!("\"{}\"", self.0.clone())
1449    }
1450}
1451#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1452pub struct SocketId(pub String);
1453impl From<&str> for SocketId {
1454    fn from(value: &str) -> Self {
1455        Self(value.to_string())
1456    }
1457}
1458impl From<String> for SocketId {
1459    fn from(value: String) -> Self {
1460        Self(value)
1461    }
1462}
1463impl IntoID<SocketId> for Socket {
1464    fn into_id(
1465        self,
1466    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1467    {
1468        Box::pin(async move { self.id().await })
1469    }
1470}
1471impl IntoID<SocketId> for SocketId {
1472    fn into_id(
1473        self,
1474    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1475    {
1476        Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1477    }
1478}
1479impl SocketId {
1480    fn quote(&self) -> String {
1481        format!("\"{}\"", self.0.clone())
1482    }
1483}
1484#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1485pub struct SourceMapId(pub String);
1486impl From<&str> for SourceMapId {
1487    fn from(value: &str) -> Self {
1488        Self(value.to_string())
1489    }
1490}
1491impl From<String> for SourceMapId {
1492    fn from(value: String) -> Self {
1493        Self(value)
1494    }
1495}
1496impl IntoID<SourceMapId> for SourceMap {
1497    fn into_id(
1498        self,
1499    ) -> std::pin::Pin<
1500        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1501    > {
1502        Box::pin(async move { self.id().await })
1503    }
1504}
1505impl IntoID<SourceMapId> for SourceMapId {
1506    fn into_id(
1507        self,
1508    ) -> std::pin::Pin<
1509        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1510    > {
1511        Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1512    }
1513}
1514impl SourceMapId {
1515    fn quote(&self) -> String {
1516        format!("\"{}\"", self.0.clone())
1517    }
1518}
1519#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1520pub struct TerminalId(pub String);
1521impl From<&str> for TerminalId {
1522    fn from(value: &str) -> Self {
1523        Self(value.to_string())
1524    }
1525}
1526impl From<String> for TerminalId {
1527    fn from(value: String) -> Self {
1528        Self(value)
1529    }
1530}
1531impl IntoID<TerminalId> for Terminal {
1532    fn into_id(
1533        self,
1534    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1535    {
1536        Box::pin(async move { self.id().await })
1537    }
1538}
1539impl IntoID<TerminalId> for TerminalId {
1540    fn into_id(
1541        self,
1542    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1543    {
1544        Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
1545    }
1546}
1547impl TerminalId {
1548    fn quote(&self) -> String {
1549        format!("\"{}\"", self.0.clone())
1550    }
1551}
1552#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1553pub struct TypeDefId(pub String);
1554impl From<&str> for TypeDefId {
1555    fn from(value: &str) -> Self {
1556        Self(value.to_string())
1557    }
1558}
1559impl From<String> for TypeDefId {
1560    fn from(value: String) -> Self {
1561        Self(value)
1562    }
1563}
1564impl IntoID<TypeDefId> for TypeDef {
1565    fn into_id(
1566        self,
1567    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1568    {
1569        Box::pin(async move { self.id().await })
1570    }
1571}
1572impl IntoID<TypeDefId> for TypeDefId {
1573    fn into_id(
1574        self,
1575    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1576    {
1577        Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
1578    }
1579}
1580impl TypeDefId {
1581    fn quote(&self) -> String {
1582        format!("\"{}\"", self.0.clone())
1583    }
1584}
1585#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1586pub struct Void(pub String);
1587impl From<&str> for Void {
1588    fn from(value: &str) -> Self {
1589        Self(value.to_string())
1590    }
1591}
1592impl From<String> for Void {
1593    fn from(value: String) -> Self {
1594        Self(value)
1595    }
1596}
1597impl Void {
1598    fn quote(&self) -> String {
1599        format!("\"{}\"", self.0.clone())
1600    }
1601}
1602#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1603pub struct BuildArg {
1604    pub name: String,
1605    pub value: String,
1606}
1607#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1608pub struct PipelineLabel {
1609    pub name: String,
1610    pub value: String,
1611}
1612#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1613pub struct PortForward {
1614    pub backend: isize,
1615    pub frontend: isize,
1616    pub protocol: NetworkProtocol,
1617}
1618#[derive(Clone)]
1619pub struct Binding {
1620    pub proc: Option<Arc<DaggerSessionProc>>,
1621    pub selection: Selection,
1622    pub graphql_client: DynGraphQLClient,
1623}
1624impl Binding {
1625    /// Retrieve the binding value, as type CacheVolume
1626    pub fn as_cache_volume(&self) -> CacheVolume {
1627        let query = self.selection.select("asCacheVolume");
1628        CacheVolume {
1629            proc: self.proc.clone(),
1630            selection: query,
1631            graphql_client: self.graphql_client.clone(),
1632        }
1633    }
1634    /// Retrieve the binding value, as type Cloud
1635    pub fn as_cloud(&self) -> Cloud {
1636        let query = self.selection.select("asCloud");
1637        Cloud {
1638            proc: self.proc.clone(),
1639            selection: query,
1640            graphql_client: self.graphql_client.clone(),
1641        }
1642    }
1643    /// Retrieve the binding value, as type Container
1644    pub fn as_container(&self) -> Container {
1645        let query = self.selection.select("asContainer");
1646        Container {
1647            proc: self.proc.clone(),
1648            selection: query,
1649            graphql_client: self.graphql_client.clone(),
1650        }
1651    }
1652    /// Retrieve the binding value, as type Directory
1653    pub fn as_directory(&self) -> Directory {
1654        let query = self.selection.select("asDirectory");
1655        Directory {
1656            proc: self.proc.clone(),
1657            selection: query,
1658            graphql_client: self.graphql_client.clone(),
1659        }
1660    }
1661    /// Retrieve the binding value, as type Env
1662    pub fn as_env(&self) -> Env {
1663        let query = self.selection.select("asEnv");
1664        Env {
1665            proc: self.proc.clone(),
1666            selection: query,
1667            graphql_client: self.graphql_client.clone(),
1668        }
1669    }
1670    /// Retrieve the binding value, as type File
1671    pub fn as_file(&self) -> File {
1672        let query = self.selection.select("asFile");
1673        File {
1674            proc: self.proc.clone(),
1675            selection: query,
1676            graphql_client: self.graphql_client.clone(),
1677        }
1678    }
1679    /// Retrieve the binding value, as type GitRef
1680    pub fn as_git_ref(&self) -> GitRef {
1681        let query = self.selection.select("asGitRef");
1682        GitRef {
1683            proc: self.proc.clone(),
1684            selection: query,
1685            graphql_client: self.graphql_client.clone(),
1686        }
1687    }
1688    /// Retrieve the binding value, as type GitRepository
1689    pub fn as_git_repository(&self) -> GitRepository {
1690        let query = self.selection.select("asGitRepository");
1691        GitRepository {
1692            proc: self.proc.clone(),
1693            selection: query,
1694            graphql_client: self.graphql_client.clone(),
1695        }
1696    }
1697    /// Retrieve the binding value, as type LLM
1698    pub fn as_llm(&self) -> Llm {
1699        let query = self.selection.select("asLLM");
1700        Llm {
1701            proc: self.proc.clone(),
1702            selection: query,
1703            graphql_client: self.graphql_client.clone(),
1704        }
1705    }
1706    /// Retrieve the binding value, as type Module
1707    pub fn as_module(&self) -> Module {
1708        let query = self.selection.select("asModule");
1709        Module {
1710            proc: self.proc.clone(),
1711            selection: query,
1712            graphql_client: self.graphql_client.clone(),
1713        }
1714    }
1715    /// Retrieve the binding value, as type ModuleConfigClient
1716    pub fn as_module_config_client(&self) -> ModuleConfigClient {
1717        let query = self.selection.select("asModuleConfigClient");
1718        ModuleConfigClient {
1719            proc: self.proc.clone(),
1720            selection: query,
1721            graphql_client: self.graphql_client.clone(),
1722        }
1723    }
1724    /// Retrieve the binding value, as type ModuleSource
1725    pub fn as_module_source(&self) -> ModuleSource {
1726        let query = self.selection.select("asModuleSource");
1727        ModuleSource {
1728            proc: self.proc.clone(),
1729            selection: query,
1730            graphql_client: self.graphql_client.clone(),
1731        }
1732    }
1733    /// Retrieve the binding value, as type Secret
1734    pub fn as_secret(&self) -> Secret {
1735        let query = self.selection.select("asSecret");
1736        Secret {
1737            proc: self.proc.clone(),
1738            selection: query,
1739            graphql_client: self.graphql_client.clone(),
1740        }
1741    }
1742    /// Retrieve the binding value, as type Service
1743    pub fn as_service(&self) -> Service {
1744        let query = self.selection.select("asService");
1745        Service {
1746            proc: self.proc.clone(),
1747            selection: query,
1748            graphql_client: self.graphql_client.clone(),
1749        }
1750    }
1751    /// Retrieve the binding value, as type Socket
1752    pub fn as_socket(&self) -> Socket {
1753        let query = self.selection.select("asSocket");
1754        Socket {
1755            proc: self.proc.clone(),
1756            selection: query,
1757            graphql_client: self.graphql_client.clone(),
1758        }
1759    }
1760    /// The binding's string value
1761    pub async fn as_string(&self) -> Result<String, DaggerError> {
1762        let query = self.selection.select("asString");
1763        query.execute(self.graphql_client.clone()).await
1764    }
1765    /// The digest of the binding value
1766    pub async fn digest(&self) -> Result<String, DaggerError> {
1767        let query = self.selection.select("digest");
1768        query.execute(self.graphql_client.clone()).await
1769    }
1770    /// A unique identifier for this Binding.
1771    pub async fn id(&self) -> Result<BindingId, DaggerError> {
1772        let query = self.selection.select("id");
1773        query.execute(self.graphql_client.clone()).await
1774    }
1775    /// Returns true if the binding is null
1776    pub async fn is_null(&self) -> Result<bool, DaggerError> {
1777        let query = self.selection.select("isNull");
1778        query.execute(self.graphql_client.clone()).await
1779    }
1780    /// The binding name
1781    pub async fn name(&self) -> Result<String, DaggerError> {
1782        let query = self.selection.select("name");
1783        query.execute(self.graphql_client.clone()).await
1784    }
1785    /// The binding type
1786    pub async fn type_name(&self) -> Result<String, DaggerError> {
1787        let query = self.selection.select("typeName");
1788        query.execute(self.graphql_client.clone()).await
1789    }
1790}
1791#[derive(Clone)]
1792pub struct CacheVolume {
1793    pub proc: Option<Arc<DaggerSessionProc>>,
1794    pub selection: Selection,
1795    pub graphql_client: DynGraphQLClient,
1796}
1797impl CacheVolume {
1798    /// A unique identifier for this CacheVolume.
1799    pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
1800        let query = self.selection.select("id");
1801        query.execute(self.graphql_client.clone()).await
1802    }
1803}
1804#[derive(Clone)]
1805pub struct Cloud {
1806    pub proc: Option<Arc<DaggerSessionProc>>,
1807    pub selection: Selection,
1808    pub graphql_client: DynGraphQLClient,
1809}
1810impl Cloud {
1811    /// A unique identifier for this Cloud.
1812    pub async fn id(&self) -> Result<CloudId, DaggerError> {
1813        let query = self.selection.select("id");
1814        query.execute(self.graphql_client.clone()).await
1815    }
1816    /// The trace URL for the current session
1817    pub async fn trace_url(&self) -> Result<String, DaggerError> {
1818        let query = self.selection.select("traceURL");
1819        query.execute(self.graphql_client.clone()).await
1820    }
1821}
1822#[derive(Clone)]
1823pub struct Container {
1824    pub proc: Option<Arc<DaggerSessionProc>>,
1825    pub selection: Selection,
1826    pub graphql_client: DynGraphQLClient,
1827}
1828#[derive(Builder, Debug, PartialEq)]
1829pub struct ContainerAsServiceOpts<'a> {
1830    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1831    /// If empty, the container's default command is used.
1832    #[builder(setter(into, strip_option), default)]
1833    pub args: Option<Vec<&'a str>>,
1834    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1835    #[builder(setter(into, strip_option), default)]
1836    pub expand: Option<bool>,
1837    /// Provides Dagger access to the executed command.
1838    #[builder(setter(into, strip_option), default)]
1839    pub experimental_privileged_nesting: Option<bool>,
1840    /// 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.
1841    #[builder(setter(into, strip_option), default)]
1842    pub insecure_root_capabilities: Option<bool>,
1843    /// If set, skip the automatic init process injected into containers by default.
1844    /// 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.
1845    #[builder(setter(into, strip_option), default)]
1846    pub no_init: Option<bool>,
1847    /// If the container has an entrypoint, prepend it to the args.
1848    #[builder(setter(into, strip_option), default)]
1849    pub use_entrypoint: Option<bool>,
1850}
1851#[derive(Builder, Debug, PartialEq)]
1852pub struct ContainerAsTarballOpts {
1853    /// Force each layer of the image to use the specified compression algorithm.
1854    /// 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.
1855    #[builder(setter(into, strip_option), default)]
1856    pub forced_compression: Option<ImageLayerCompression>,
1857    /// Use the specified media types for the image's layers.
1858    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1859    #[builder(setter(into, strip_option), default)]
1860    pub media_types: Option<ImageMediaTypes>,
1861    /// Identifiers for other platform specific containers.
1862    /// Used for multi-platform images.
1863    #[builder(setter(into, strip_option), default)]
1864    pub platform_variants: Option<Vec<ContainerId>>,
1865}
1866#[derive(Builder, Debug, PartialEq)]
1867pub struct ContainerBuildOpts<'a> {
1868    /// Additional build arguments.
1869    #[builder(setter(into, strip_option), default)]
1870    pub build_args: Option<Vec<BuildArg>>,
1871    /// Path to the Dockerfile to use.
1872    #[builder(setter(into, strip_option), default)]
1873    pub dockerfile: Option<&'a str>,
1874    /// If set, skip the automatic init process injected into containers created by RUN statements.
1875    /// 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.
1876    #[builder(setter(into, strip_option), default)]
1877    pub no_init: Option<bool>,
1878    /// Secrets to pass to the build.
1879    /// They will be mounted at /run/secrets/[secret-name] in the build container
1880    /// 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))
1881    #[builder(setter(into, strip_option), default)]
1882    pub secrets: Option<Vec<SecretId>>,
1883    /// Target build stage to build.
1884    #[builder(setter(into, strip_option), default)]
1885    pub target: Option<&'a str>,
1886}
1887#[derive(Builder, Debug, PartialEq)]
1888pub struct ContainerDirectoryOpts {
1889    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1890    #[builder(setter(into, strip_option), default)]
1891    pub expand: Option<bool>,
1892}
1893#[derive(Builder, Debug, PartialEq)]
1894pub struct ContainerExportOpts {
1895    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1896    #[builder(setter(into, strip_option), default)]
1897    pub expand: Option<bool>,
1898    /// Force each layer of the exported image to use the specified compression algorithm.
1899    /// 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.
1900    #[builder(setter(into, strip_option), default)]
1901    pub forced_compression: Option<ImageLayerCompression>,
1902    /// Use the specified media types for the exported image's layers.
1903    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1904    #[builder(setter(into, strip_option), default)]
1905    pub media_types: Option<ImageMediaTypes>,
1906    /// Identifiers for other platform specific containers.
1907    /// Used for multi-platform image.
1908    #[builder(setter(into, strip_option), default)]
1909    pub platform_variants: Option<Vec<ContainerId>>,
1910}
1911#[derive(Builder, Debug, PartialEq)]
1912pub struct ContainerExportImageOpts {
1913    /// Force each layer of the exported image to use the specified compression algorithm.
1914    /// 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.
1915    #[builder(setter(into, strip_option), default)]
1916    pub forced_compression: Option<ImageLayerCompression>,
1917    /// Use the specified media types for the exported image's layers.
1918    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1919    #[builder(setter(into, strip_option), default)]
1920    pub media_types: Option<ImageMediaTypes>,
1921    /// Identifiers for other platform specific containers.
1922    /// Used for multi-platform image.
1923    #[builder(setter(into, strip_option), default)]
1924    pub platform_variants: Option<Vec<ContainerId>>,
1925}
1926#[derive(Builder, Debug, PartialEq)]
1927pub struct ContainerFileOpts {
1928    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1929    #[builder(setter(into, strip_option), default)]
1930    pub expand: Option<bool>,
1931}
1932#[derive(Builder, Debug, PartialEq)]
1933pub struct ContainerImportOpts<'a> {
1934    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
1935    #[builder(setter(into, strip_option), default)]
1936    pub tag: Option<&'a str>,
1937}
1938#[derive(Builder, Debug, PartialEq)]
1939pub struct ContainerPublishOpts {
1940    /// Force each layer of the published image to use the specified compression algorithm.
1941    /// 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.
1942    #[builder(setter(into, strip_option), default)]
1943    pub forced_compression: Option<ImageLayerCompression>,
1944    /// Use the specified media types for the published image's layers.
1945    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
1946    #[builder(setter(into, strip_option), default)]
1947    pub media_types: Option<ImageMediaTypes>,
1948    /// Identifiers for other platform specific containers.
1949    /// Used for multi-platform image.
1950    #[builder(setter(into, strip_option), default)]
1951    pub platform_variants: Option<Vec<ContainerId>>,
1952}
1953#[derive(Builder, Debug, PartialEq)]
1954pub struct ContainerTerminalOpts<'a> {
1955    /// If set, override the container's default terminal command and invoke these command arguments instead.
1956    #[builder(setter(into, strip_option), default)]
1957    pub cmd: Option<Vec<&'a str>>,
1958    /// Provides Dagger access to the executed command.
1959    #[builder(setter(into, strip_option), default)]
1960    pub experimental_privileged_nesting: Option<bool>,
1961    /// 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.
1962    #[builder(setter(into, strip_option), default)]
1963    pub insecure_root_capabilities: Option<bool>,
1964}
1965#[derive(Builder, Debug, PartialEq)]
1966pub struct ContainerUpOpts<'a> {
1967    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1968    /// If empty, the container's default command is used.
1969    #[builder(setter(into, strip_option), default)]
1970    pub args: Option<Vec<&'a str>>,
1971    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1972    #[builder(setter(into, strip_option), default)]
1973    pub expand: Option<bool>,
1974    /// Provides Dagger access to the executed command.
1975    #[builder(setter(into, strip_option), default)]
1976    pub experimental_privileged_nesting: Option<bool>,
1977    /// 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.
1978    #[builder(setter(into, strip_option), default)]
1979    pub insecure_root_capabilities: Option<bool>,
1980    /// If set, skip the automatic init process injected into containers by default.
1981    /// 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.
1982    #[builder(setter(into, strip_option), default)]
1983    pub no_init: Option<bool>,
1984    /// List of frontend/backend port mappings to forward.
1985    /// Frontend is the port accepting traffic on the host, backend is the service port.
1986    #[builder(setter(into, strip_option), default)]
1987    pub ports: Option<Vec<PortForward>>,
1988    /// Bind each tunnel port to a random port on the host.
1989    #[builder(setter(into, strip_option), default)]
1990    pub random: Option<bool>,
1991    /// If the container has an entrypoint, prepend it to the args.
1992    #[builder(setter(into, strip_option), default)]
1993    pub use_entrypoint: Option<bool>,
1994}
1995#[derive(Builder, Debug, PartialEq)]
1996pub struct ContainerWithDefaultTerminalCmdOpts {
1997    /// Provides Dagger access to the executed command.
1998    #[builder(setter(into, strip_option), default)]
1999    pub experimental_privileged_nesting: Option<bool>,
2000    /// 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.
2001    #[builder(setter(into, strip_option), default)]
2002    pub insecure_root_capabilities: Option<bool>,
2003}
2004#[derive(Builder, Debug, PartialEq)]
2005pub struct ContainerWithDirectoryOpts<'a> {
2006    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
2007    #[builder(setter(into, strip_option), default)]
2008    pub exclude: Option<Vec<&'a str>>,
2009    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2010    #[builder(setter(into, strip_option), default)]
2011    pub expand: Option<bool>,
2012    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
2013    #[builder(setter(into, strip_option), default)]
2014    pub include: Option<Vec<&'a str>>,
2015    /// A user:group to set for the directory and its contents.
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}
2021#[derive(Builder, Debug, PartialEq)]
2022pub struct ContainerWithEntrypointOpts {
2023    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
2024    #[builder(setter(into, strip_option), default)]
2025    pub keep_default_args: Option<bool>,
2026}
2027#[derive(Builder, Debug, PartialEq)]
2028pub struct ContainerWithEnvVariableOpts {
2029    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
2030    #[builder(setter(into, strip_option), default)]
2031    pub expand: Option<bool>,
2032}
2033#[derive(Builder, Debug, PartialEq)]
2034pub struct ContainerWithExecOpts<'a> {
2035    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2036    #[builder(setter(into, strip_option), default)]
2037    pub expand: Option<bool>,
2038    /// Exit codes this command is allowed to exit with without error
2039    #[builder(setter(into, strip_option), default)]
2040    pub expect: Option<ReturnType>,
2041    /// Provides Dagger access to the executed command.
2042    #[builder(setter(into, strip_option), default)]
2043    pub experimental_privileged_nesting: Option<bool>,
2044    /// Execute the command with all root capabilities. Like --privileged in Docker
2045    /// 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.
2046    #[builder(setter(into, strip_option), default)]
2047    pub insecure_root_capabilities: Option<bool>,
2048    /// Skip the automatic init process injected into containers by default.
2049    /// 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.
2050    #[builder(setter(into, strip_option), default)]
2051    pub no_init: Option<bool>,
2052    /// Like redirectStdout, but for standard error
2053    #[builder(setter(into, strip_option), default)]
2054    pub redirect_stderr: Option<&'a str>,
2055    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
2056    #[builder(setter(into, strip_option), default)]
2057    pub redirect_stdout: Option<&'a str>,
2058    /// Content to write to the command's standard input. Example: "Hello world")
2059    #[builder(setter(into, strip_option), default)]
2060    pub stdin: Option<&'a str>,
2061    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
2062    #[builder(setter(into, strip_option), default)]
2063    pub use_entrypoint: Option<bool>,
2064}
2065#[derive(Builder, Debug, PartialEq)]
2066pub struct ContainerWithExposedPortOpts<'a> {
2067    /// Port description. Example: "payment API endpoint"
2068    #[builder(setter(into, strip_option), default)]
2069    pub description: Option<&'a str>,
2070    /// Skip the health check when run as a service.
2071    #[builder(setter(into, strip_option), default)]
2072    pub experimental_skip_healthcheck: Option<bool>,
2073    /// Network protocol. Example: "tcp"
2074    #[builder(setter(into, strip_option), default)]
2075    pub protocol: Option<NetworkProtocol>,
2076}
2077#[derive(Builder, Debug, PartialEq)]
2078pub struct ContainerWithFileOpts<'a> {
2079    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2080    #[builder(setter(into, strip_option), default)]
2081    pub expand: Option<bool>,
2082    /// A user:group to set for the file.
2083    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2084    /// If the group is omitted, it defaults to the same as the user.
2085    #[builder(setter(into, strip_option), default)]
2086    pub owner: Option<&'a str>,
2087    /// Permissions of the new file. Example: 0600
2088    #[builder(setter(into, strip_option), default)]
2089    pub permissions: Option<isize>,
2090}
2091#[derive(Builder, Debug, PartialEq)]
2092pub struct ContainerWithFilesOpts<'a> {
2093    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2094    #[builder(setter(into, strip_option), default)]
2095    pub expand: Option<bool>,
2096    /// A user:group to set for the files.
2097    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2098    /// If the group is omitted, it defaults to the same as the user.
2099    #[builder(setter(into, strip_option), default)]
2100    pub owner: Option<&'a str>,
2101    /// Permission given to the copied files (e.g., 0600).
2102    #[builder(setter(into, strip_option), default)]
2103    pub permissions: Option<isize>,
2104}
2105#[derive(Builder, Debug, PartialEq)]
2106pub struct ContainerWithMountedCacheOpts<'a> {
2107    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2108    #[builder(setter(into, strip_option), default)]
2109    pub expand: Option<bool>,
2110    /// A user:group to set for the mounted cache directory.
2111    /// 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.
2112    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2113    /// If the group is omitted, it defaults to the same as the user.
2114    #[builder(setter(into, strip_option), default)]
2115    pub owner: Option<&'a str>,
2116    /// Sharing mode of the cache volume.
2117    #[builder(setter(into, strip_option), default)]
2118    pub sharing: Option<CacheSharingMode>,
2119    /// Identifier of the directory to use as the cache volume's root.
2120    #[builder(setter(into, strip_option), default)]
2121    pub source: Option<DirectoryId>,
2122}
2123#[derive(Builder, Debug, PartialEq)]
2124pub struct ContainerWithMountedDirectoryOpts<'a> {
2125    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2126    #[builder(setter(into, strip_option), default)]
2127    pub expand: Option<bool>,
2128    /// A user:group to set for the mounted directory and its contents.
2129    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2130    /// If the group is omitted, it defaults to the same as the user.
2131    #[builder(setter(into, strip_option), default)]
2132    pub owner: Option<&'a str>,
2133}
2134#[derive(Builder, Debug, PartialEq)]
2135pub struct ContainerWithMountedFileOpts<'a> {
2136    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2137    #[builder(setter(into, strip_option), default)]
2138    pub expand: Option<bool>,
2139    /// A user or user:group to set for the mounted file.
2140    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2141    /// If the group is omitted, it defaults to the same as the user.
2142    #[builder(setter(into, strip_option), default)]
2143    pub owner: Option<&'a str>,
2144}
2145#[derive(Builder, Debug, PartialEq)]
2146pub struct ContainerWithMountedSecretOpts<'a> {
2147    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2148    #[builder(setter(into, strip_option), default)]
2149    pub expand: Option<bool>,
2150    /// Permission given to the mounted secret (e.g., 0600).
2151    /// This option requires an owner to be set to be active.
2152    #[builder(setter(into, strip_option), default)]
2153    pub mode: Option<isize>,
2154    /// A user:group to set for the mounted secret.
2155    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2156    /// If the group is omitted, it defaults to the same as the user.
2157    #[builder(setter(into, strip_option), default)]
2158    pub owner: Option<&'a str>,
2159}
2160#[derive(Builder, Debug, PartialEq)]
2161pub struct ContainerWithMountedTempOpts {
2162    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2163    #[builder(setter(into, strip_option), default)]
2164    pub expand: Option<bool>,
2165    /// Size of the temporary directory in bytes.
2166    #[builder(setter(into, strip_option), default)]
2167    pub size: Option<isize>,
2168}
2169#[derive(Builder, Debug, PartialEq)]
2170pub struct ContainerWithNewFileOpts<'a> {
2171    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2172    #[builder(setter(into, strip_option), default)]
2173    pub expand: Option<bool>,
2174    /// A user:group to set for the file.
2175    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2176    /// If the group is omitted, it defaults to the same as the user.
2177    #[builder(setter(into, strip_option), default)]
2178    pub owner: Option<&'a str>,
2179    /// Permissions of the new file. Example: 0600
2180    #[builder(setter(into, strip_option), default)]
2181    pub permissions: Option<isize>,
2182}
2183#[derive(Builder, Debug, PartialEq)]
2184pub struct ContainerWithSymlinkOpts {
2185    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2186    #[builder(setter(into, strip_option), default)]
2187    pub expand: Option<bool>,
2188}
2189#[derive(Builder, Debug, PartialEq)]
2190pub struct ContainerWithUnixSocketOpts<'a> {
2191    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2192    #[builder(setter(into, strip_option), default)]
2193    pub expand: Option<bool>,
2194    /// A user:group to set for the mounted socket.
2195    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2196    /// If the group is omitted, it defaults to the same as the user.
2197    #[builder(setter(into, strip_option), default)]
2198    pub owner: Option<&'a str>,
2199}
2200#[derive(Builder, Debug, PartialEq)]
2201pub struct ContainerWithWorkdirOpts {
2202    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2203    #[builder(setter(into, strip_option), default)]
2204    pub expand: Option<bool>,
2205}
2206#[derive(Builder, Debug, PartialEq)]
2207pub struct ContainerWithoutDirectoryOpts {
2208    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2209    #[builder(setter(into, strip_option), default)]
2210    pub expand: Option<bool>,
2211}
2212#[derive(Builder, Debug, PartialEq)]
2213pub struct ContainerWithoutEntrypointOpts {
2214    /// Don't remove the default arguments when unsetting the entrypoint.
2215    #[builder(setter(into, strip_option), default)]
2216    pub keep_default_args: Option<bool>,
2217}
2218#[derive(Builder, Debug, PartialEq)]
2219pub struct ContainerWithoutExposedPortOpts {
2220    /// Port protocol to unexpose
2221    #[builder(setter(into, strip_option), default)]
2222    pub protocol: Option<NetworkProtocol>,
2223}
2224#[derive(Builder, Debug, PartialEq)]
2225pub struct ContainerWithoutFileOpts {
2226    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2227    #[builder(setter(into, strip_option), default)]
2228    pub expand: Option<bool>,
2229}
2230#[derive(Builder, Debug, PartialEq)]
2231pub struct ContainerWithoutFilesOpts {
2232    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2233    #[builder(setter(into, strip_option), default)]
2234    pub expand: Option<bool>,
2235}
2236#[derive(Builder, Debug, PartialEq)]
2237pub struct ContainerWithoutMountOpts {
2238    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2239    #[builder(setter(into, strip_option), default)]
2240    pub expand: Option<bool>,
2241}
2242#[derive(Builder, Debug, PartialEq)]
2243pub struct ContainerWithoutUnixSocketOpts {
2244    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2245    #[builder(setter(into, strip_option), default)]
2246    pub expand: Option<bool>,
2247}
2248impl Container {
2249    /// Turn the container into a Service.
2250    /// Be sure to set any exposed ports before this conversion.
2251    ///
2252    /// # Arguments
2253    ///
2254    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2255    pub fn as_service(&self) -> Service {
2256        let query = self.selection.select("asService");
2257        Service {
2258            proc: self.proc.clone(),
2259            selection: query,
2260            graphql_client: self.graphql_client.clone(),
2261        }
2262    }
2263    /// Turn the container into a Service.
2264    /// Be sure to set any exposed ports before this conversion.
2265    ///
2266    /// # Arguments
2267    ///
2268    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2269    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2270        let mut query = self.selection.select("asService");
2271        if let Some(args) = opts.args {
2272            query = query.arg("args", args);
2273        }
2274        if let Some(use_entrypoint) = opts.use_entrypoint {
2275            query = query.arg("useEntrypoint", use_entrypoint);
2276        }
2277        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2278            query = query.arg(
2279                "experimentalPrivilegedNesting",
2280                experimental_privileged_nesting,
2281            );
2282        }
2283        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2284            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2285        }
2286        if let Some(expand) = opts.expand {
2287            query = query.arg("expand", expand);
2288        }
2289        if let Some(no_init) = opts.no_init {
2290            query = query.arg("noInit", no_init);
2291        }
2292        Service {
2293            proc: self.proc.clone(),
2294            selection: query,
2295            graphql_client: self.graphql_client.clone(),
2296        }
2297    }
2298    /// Package the container state as an OCI image, and return it as a tar archive
2299    ///
2300    /// # Arguments
2301    ///
2302    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2303    pub fn as_tarball(&self) -> File {
2304        let query = self.selection.select("asTarball");
2305        File {
2306            proc: self.proc.clone(),
2307            selection: query,
2308            graphql_client: self.graphql_client.clone(),
2309        }
2310    }
2311    /// Package the container state as an OCI image, and return it as a tar archive
2312    ///
2313    /// # Arguments
2314    ///
2315    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2316    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2317        let mut query = self.selection.select("asTarball");
2318        if let Some(platform_variants) = opts.platform_variants {
2319            query = query.arg("platformVariants", platform_variants);
2320        }
2321        if let Some(forced_compression) = opts.forced_compression {
2322            query = query.arg("forcedCompression", forced_compression);
2323        }
2324        if let Some(media_types) = opts.media_types {
2325            query = query.arg("mediaTypes", media_types);
2326        }
2327        File {
2328            proc: self.proc.clone(),
2329            selection: query,
2330            graphql_client: self.graphql_client.clone(),
2331        }
2332    }
2333    /// Initializes this container from a Dockerfile build.
2334    ///
2335    /// # Arguments
2336    ///
2337    /// * `context` - Directory context used by the Dockerfile.
2338    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2339    pub fn build(&self, context: impl IntoID<DirectoryId>) -> Container {
2340        let mut query = self.selection.select("build");
2341        query = query.arg_lazy(
2342            "context",
2343            Box::new(move || {
2344                let context = context.clone();
2345                Box::pin(async move { context.into_id().await.unwrap().quote() })
2346            }),
2347        );
2348        Container {
2349            proc: self.proc.clone(),
2350            selection: query,
2351            graphql_client: self.graphql_client.clone(),
2352        }
2353    }
2354    /// Initializes this container from a Dockerfile build.
2355    ///
2356    /// # Arguments
2357    ///
2358    /// * `context` - Directory context used by the Dockerfile.
2359    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2360    pub fn build_opts<'a>(
2361        &self,
2362        context: impl IntoID<DirectoryId>,
2363        opts: ContainerBuildOpts<'a>,
2364    ) -> Container {
2365        let mut query = self.selection.select("build");
2366        query = query.arg_lazy(
2367            "context",
2368            Box::new(move || {
2369                let context = context.clone();
2370                Box::pin(async move { context.into_id().await.unwrap().quote() })
2371            }),
2372        );
2373        if let Some(dockerfile) = opts.dockerfile {
2374            query = query.arg("dockerfile", dockerfile);
2375        }
2376        if let Some(target) = opts.target {
2377            query = query.arg("target", target);
2378        }
2379        if let Some(build_args) = opts.build_args {
2380            query = query.arg("buildArgs", build_args);
2381        }
2382        if let Some(secrets) = opts.secrets {
2383            query = query.arg("secrets", secrets);
2384        }
2385        if let Some(no_init) = opts.no_init {
2386            query = query.arg("noInit", no_init);
2387        }
2388        Container {
2389            proc: self.proc.clone(),
2390            selection: query,
2391            graphql_client: self.graphql_client.clone(),
2392        }
2393    }
2394    /// Return the container's default arguments.
2395    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2396        let query = self.selection.select("defaultArgs");
2397        query.execute(self.graphql_client.clone()).await
2398    }
2399    /// Retrieve a directory from the container's root filesystem
2400    /// Mounts are included.
2401    ///
2402    /// # Arguments
2403    ///
2404    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2405    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2406    pub fn directory(&self, path: impl Into<String>) -> Directory {
2407        let mut query = self.selection.select("directory");
2408        query = query.arg("path", path.into());
2409        Directory {
2410            proc: self.proc.clone(),
2411            selection: query,
2412            graphql_client: self.graphql_client.clone(),
2413        }
2414    }
2415    /// Retrieve a directory from the container's root filesystem
2416    /// Mounts are included.
2417    ///
2418    /// # Arguments
2419    ///
2420    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2421    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2422    pub fn directory_opts(
2423        &self,
2424        path: impl Into<String>,
2425        opts: ContainerDirectoryOpts,
2426    ) -> Directory {
2427        let mut query = self.selection.select("directory");
2428        query = query.arg("path", path.into());
2429        if let Some(expand) = opts.expand {
2430            query = query.arg("expand", expand);
2431        }
2432        Directory {
2433            proc: self.proc.clone(),
2434            selection: query,
2435            graphql_client: self.graphql_client.clone(),
2436        }
2437    }
2438    /// Return the container's OCI entrypoint.
2439    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2440        let query = self.selection.select("entrypoint");
2441        query.execute(self.graphql_client.clone()).await
2442    }
2443    /// Retrieves the value of the specified environment variable.
2444    ///
2445    /// # Arguments
2446    ///
2447    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
2448    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2449        let mut query = self.selection.select("envVariable");
2450        query = query.arg("name", name.into());
2451        query.execute(self.graphql_client.clone()).await
2452    }
2453    /// Retrieves the list of environment variables passed to commands.
2454    pub fn env_variables(&self) -> Vec<EnvVariable> {
2455        let query = self.selection.select("envVariables");
2456        vec![EnvVariable {
2457            proc: self.proc.clone(),
2458            selection: query,
2459            graphql_client: self.graphql_client.clone(),
2460        }]
2461    }
2462    /// The exit code of the last executed command
2463    /// Returns an error if no command was executed
2464    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2465        let query = self.selection.select("exitCode");
2466        query.execute(self.graphql_client.clone()).await
2467    }
2468    /// EXPERIMENTAL API! Subject to change/removal at any time.
2469    /// Configures all available GPUs on the host to be accessible to this container.
2470    /// This currently works for Nvidia devices only.
2471    pub fn experimental_with_all_gp_us(&self) -> Container {
2472        let query = self.selection.select("experimentalWithAllGPUs");
2473        Container {
2474            proc: self.proc.clone(),
2475            selection: query,
2476            graphql_client: self.graphql_client.clone(),
2477        }
2478    }
2479    /// EXPERIMENTAL API! Subject to change/removal at any time.
2480    /// Configures the provided list of devices to be accessible to this container.
2481    /// This currently works for Nvidia devices only.
2482    ///
2483    /// # Arguments
2484    ///
2485    /// * `devices` - List of devices to be accessible to this container.
2486    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2487        let mut query = self.selection.select("experimentalWithGPU");
2488        query = query.arg(
2489            "devices",
2490            devices
2491                .into_iter()
2492                .map(|i| i.into())
2493                .collect::<Vec<String>>(),
2494        );
2495        Container {
2496            proc: self.proc.clone(),
2497            selection: query,
2498            graphql_client: self.graphql_client.clone(),
2499        }
2500    }
2501    /// Writes the container as an OCI tarball to the destination file path on the host.
2502    /// It can also export platform variants.
2503    ///
2504    /// # Arguments
2505    ///
2506    /// * `path` - Host's destination path (e.g., "./tarball").
2507    ///
2508    /// Path can be relative to the engine's workdir or absolute.
2509    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2510    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2511        let mut query = self.selection.select("export");
2512        query = query.arg("path", path.into());
2513        query.execute(self.graphql_client.clone()).await
2514    }
2515    /// Writes the container as an OCI tarball to the destination file path on the host.
2516    /// It can also export platform variants.
2517    ///
2518    /// # Arguments
2519    ///
2520    /// * `path` - Host's destination path (e.g., "./tarball").
2521    ///
2522    /// Path can be relative to the engine's workdir or absolute.
2523    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2524    pub async fn export_opts(
2525        &self,
2526        path: impl Into<String>,
2527        opts: ContainerExportOpts,
2528    ) -> Result<String, DaggerError> {
2529        let mut query = self.selection.select("export");
2530        query = query.arg("path", path.into());
2531        if let Some(platform_variants) = opts.platform_variants {
2532            query = query.arg("platformVariants", platform_variants);
2533        }
2534        if let Some(forced_compression) = opts.forced_compression {
2535            query = query.arg("forcedCompression", forced_compression);
2536        }
2537        if let Some(media_types) = opts.media_types {
2538            query = query.arg("mediaTypes", media_types);
2539        }
2540        if let Some(expand) = opts.expand {
2541            query = query.arg("expand", expand);
2542        }
2543        query.execute(self.graphql_client.clone()).await
2544    }
2545    /// Exports the container as an image to the host's container image store.
2546    ///
2547    /// # Arguments
2548    ///
2549    /// * `name` - Name of image to export to in the host's store
2550    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2551    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2552        let mut query = self.selection.select("exportImage");
2553        query = query.arg("name", name.into());
2554        query.execute(self.graphql_client.clone()).await
2555    }
2556    /// Exports the container as an image to the host's container image store.
2557    ///
2558    /// # Arguments
2559    ///
2560    /// * `name` - Name of image to export to in the host's store
2561    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2562    pub async fn export_image_opts(
2563        &self,
2564        name: impl Into<String>,
2565        opts: ContainerExportImageOpts,
2566    ) -> Result<Void, DaggerError> {
2567        let mut query = self.selection.select("exportImage");
2568        query = query.arg("name", name.into());
2569        if let Some(platform_variants) = opts.platform_variants {
2570            query = query.arg("platformVariants", platform_variants);
2571        }
2572        if let Some(forced_compression) = opts.forced_compression {
2573            query = query.arg("forcedCompression", forced_compression);
2574        }
2575        if let Some(media_types) = opts.media_types {
2576            query = query.arg("mediaTypes", media_types);
2577        }
2578        query.execute(self.graphql_client.clone()).await
2579    }
2580    /// Retrieves the list of exposed ports.
2581    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
2582    pub fn exposed_ports(&self) -> Vec<Port> {
2583        let query = self.selection.select("exposedPorts");
2584        vec![Port {
2585            proc: self.proc.clone(),
2586            selection: query,
2587            graphql_client: self.graphql_client.clone(),
2588        }]
2589    }
2590    /// Retrieves a file at the given path.
2591    /// Mounts are included.
2592    ///
2593    /// # Arguments
2594    ///
2595    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2596    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2597    pub fn file(&self, path: impl Into<String>) -> File {
2598        let mut query = self.selection.select("file");
2599        query = query.arg("path", path.into());
2600        File {
2601            proc: self.proc.clone(),
2602            selection: query,
2603            graphql_client: self.graphql_client.clone(),
2604        }
2605    }
2606    /// Retrieves a file at the given path.
2607    /// Mounts are included.
2608    ///
2609    /// # Arguments
2610    ///
2611    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2612    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2613    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2614        let mut query = self.selection.select("file");
2615        query = query.arg("path", path.into());
2616        if let Some(expand) = opts.expand {
2617            query = query.arg("expand", expand);
2618        }
2619        File {
2620            proc: self.proc.clone(),
2621            selection: query,
2622            graphql_client: self.graphql_client.clone(),
2623        }
2624    }
2625    /// Download a container image, and apply it to the container state. All previous state will be lost.
2626    ///
2627    /// # Arguments
2628    ///
2629    /// * `address` - Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
2630    pub fn from(&self, address: impl Into<String>) -> Container {
2631        let mut query = self.selection.select("from");
2632        query = query.arg("address", address.into());
2633        Container {
2634            proc: self.proc.clone(),
2635            selection: query,
2636            graphql_client: self.graphql_client.clone(),
2637        }
2638    }
2639    /// A unique identifier for this Container.
2640    pub async fn id(&self) -> Result<ContainerId, DaggerError> {
2641        let query = self.selection.select("id");
2642        query.execute(self.graphql_client.clone()).await
2643    }
2644    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
2645    pub async fn image_ref(&self) -> Result<String, DaggerError> {
2646        let query = self.selection.select("imageRef");
2647        query.execute(self.graphql_client.clone()).await
2648    }
2649    /// Reads the container from an OCI tarball.
2650    ///
2651    /// # Arguments
2652    ///
2653    /// * `source` - File to read the container from.
2654    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2655    pub fn import(&self, source: impl IntoID<FileId>) -> Container {
2656        let mut query = self.selection.select("import");
2657        query = query.arg_lazy(
2658            "source",
2659            Box::new(move || {
2660                let source = source.clone();
2661                Box::pin(async move { source.into_id().await.unwrap().quote() })
2662            }),
2663        );
2664        Container {
2665            proc: self.proc.clone(),
2666            selection: query,
2667            graphql_client: self.graphql_client.clone(),
2668        }
2669    }
2670    /// Reads the container from an OCI tarball.
2671    ///
2672    /// # Arguments
2673    ///
2674    /// * `source` - File to read the container from.
2675    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2676    pub fn import_opts<'a>(
2677        &self,
2678        source: impl IntoID<FileId>,
2679        opts: ContainerImportOpts<'a>,
2680    ) -> Container {
2681        let mut query = self.selection.select("import");
2682        query = query.arg_lazy(
2683            "source",
2684            Box::new(move || {
2685                let source = source.clone();
2686                Box::pin(async move { source.into_id().await.unwrap().quote() })
2687            }),
2688        );
2689        if let Some(tag) = opts.tag {
2690            query = query.arg("tag", tag);
2691        }
2692        Container {
2693            proc: self.proc.clone(),
2694            selection: query,
2695            graphql_client: self.graphql_client.clone(),
2696        }
2697    }
2698    /// Retrieves the value of the specified label.
2699    ///
2700    /// # Arguments
2701    ///
2702    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
2703    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2704        let mut query = self.selection.select("label");
2705        query = query.arg("name", name.into());
2706        query.execute(self.graphql_client.clone()).await
2707    }
2708    /// Retrieves the list of labels passed to container.
2709    pub fn labels(&self) -> Vec<Label> {
2710        let query = self.selection.select("labels");
2711        vec![Label {
2712            proc: self.proc.clone(),
2713            selection: query,
2714            graphql_client: self.graphql_client.clone(),
2715        }]
2716    }
2717    /// Retrieves the list of paths where a directory is mounted.
2718    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2719        let query = self.selection.select("mounts");
2720        query.execute(self.graphql_client.clone()).await
2721    }
2722    /// The platform this container executes and publishes as.
2723    pub async fn platform(&self) -> Result<Platform, DaggerError> {
2724        let query = self.selection.select("platform");
2725        query.execute(self.graphql_client.clone()).await
2726    }
2727    /// Package the container state as an OCI image, and publish it to a registry
2728    /// Returns the fully qualified address of the published image, with digest
2729    ///
2730    /// # Arguments
2731    ///
2732    /// * `address` - The OCI address to publish to
2733    ///
2734    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
2735    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2736    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2737        let mut query = self.selection.select("publish");
2738        query = query.arg("address", address.into());
2739        query.execute(self.graphql_client.clone()).await
2740    }
2741    /// Package the container state as an OCI image, and publish it to a registry
2742    /// Returns the fully qualified address of the published image, with digest
2743    ///
2744    /// # Arguments
2745    ///
2746    /// * `address` - The OCI address to publish to
2747    ///
2748    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
2749    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2750    pub async fn publish_opts(
2751        &self,
2752        address: impl Into<String>,
2753        opts: ContainerPublishOpts,
2754    ) -> Result<String, DaggerError> {
2755        let mut query = self.selection.select("publish");
2756        query = query.arg("address", address.into());
2757        if let Some(platform_variants) = opts.platform_variants {
2758            query = query.arg("platformVariants", platform_variants);
2759        }
2760        if let Some(forced_compression) = opts.forced_compression {
2761            query = query.arg("forcedCompression", forced_compression);
2762        }
2763        if let Some(media_types) = opts.media_types {
2764            query = query.arg("mediaTypes", media_types);
2765        }
2766        query.execute(self.graphql_client.clone()).await
2767    }
2768    /// 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.
2769    pub fn rootfs(&self) -> Directory {
2770        let query = self.selection.select("rootfs");
2771        Directory {
2772            proc: self.proc.clone(),
2773            selection: query,
2774            graphql_client: self.graphql_client.clone(),
2775        }
2776    }
2777    /// The buffered standard error stream of the last executed command
2778    /// Returns an error if no command was executed
2779    pub async fn stderr(&self) -> Result<String, DaggerError> {
2780        let query = self.selection.select("stderr");
2781        query.execute(self.graphql_client.clone()).await
2782    }
2783    /// The buffered standard output stream of the last executed command
2784    /// Returns an error if no command was executed
2785    pub async fn stdout(&self) -> Result<String, DaggerError> {
2786        let query = self.selection.select("stdout");
2787        query.execute(self.graphql_client.clone()).await
2788    }
2789    /// Forces evaluation of the pipeline in the engine.
2790    /// It doesn't run the default command if no exec has been set.
2791    pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
2792        let query = self.selection.select("sync");
2793        query.execute(self.graphql_client.clone()).await
2794    }
2795    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2796    ///
2797    /// # Arguments
2798    ///
2799    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2800    pub fn terminal(&self) -> Container {
2801        let query = self.selection.select("terminal");
2802        Container {
2803            proc: self.proc.clone(),
2804            selection: query,
2805            graphql_client: self.graphql_client.clone(),
2806        }
2807    }
2808    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2809    ///
2810    /// # Arguments
2811    ///
2812    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2813    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2814        let mut query = self.selection.select("terminal");
2815        if let Some(cmd) = opts.cmd {
2816            query = query.arg("cmd", cmd);
2817        }
2818        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2819            query = query.arg(
2820                "experimentalPrivilegedNesting",
2821                experimental_privileged_nesting,
2822            );
2823        }
2824        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2825            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2826        }
2827        Container {
2828            proc: self.proc.clone(),
2829            selection: query,
2830            graphql_client: self.graphql_client.clone(),
2831        }
2832    }
2833    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
2834    /// Be sure to set any exposed ports before calling this api.
2835    ///
2836    /// # Arguments
2837    ///
2838    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2839    pub async fn up(&self) -> Result<Void, DaggerError> {
2840        let query = self.selection.select("up");
2841        query.execute(self.graphql_client.clone()).await
2842    }
2843    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
2844    /// Be sure to set any exposed ports before calling this api.
2845    ///
2846    /// # Arguments
2847    ///
2848    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2849    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
2850        let mut query = self.selection.select("up");
2851        if let Some(random) = opts.random {
2852            query = query.arg("random", random);
2853        }
2854        if let Some(ports) = opts.ports {
2855            query = query.arg("ports", ports);
2856        }
2857        if let Some(args) = opts.args {
2858            query = query.arg("args", args);
2859        }
2860        if let Some(use_entrypoint) = opts.use_entrypoint {
2861            query = query.arg("useEntrypoint", use_entrypoint);
2862        }
2863        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2864            query = query.arg(
2865                "experimentalPrivilegedNesting",
2866                experimental_privileged_nesting,
2867            );
2868        }
2869        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2870            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2871        }
2872        if let Some(expand) = opts.expand {
2873            query = query.arg("expand", expand);
2874        }
2875        if let Some(no_init) = opts.no_init {
2876            query = query.arg("noInit", no_init);
2877        }
2878        query.execute(self.graphql_client.clone()).await
2879    }
2880    /// Retrieves the user to be set for all commands.
2881    pub async fn user(&self) -> Result<String, DaggerError> {
2882        let query = self.selection.select("user");
2883        query.execute(self.graphql_client.clone()).await
2884    }
2885    /// Retrieves this container plus the given OCI anotation.
2886    ///
2887    /// # Arguments
2888    ///
2889    /// * `name` - The name of the annotation.
2890    /// * `value` - The value of the annotation.
2891    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2892        let mut query = self.selection.select("withAnnotation");
2893        query = query.arg("name", name.into());
2894        query = query.arg("value", value.into());
2895        Container {
2896            proc: self.proc.clone(),
2897            selection: query,
2898            graphql_client: self.graphql_client.clone(),
2899        }
2900    }
2901    /// Configures default arguments for future commands. Like CMD in Dockerfile.
2902    ///
2903    /// # Arguments
2904    ///
2905    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
2906    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
2907        let mut query = self.selection.select("withDefaultArgs");
2908        query = query.arg(
2909            "args",
2910            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2911        );
2912        Container {
2913            proc: self.proc.clone(),
2914            selection: query,
2915            graphql_client: self.graphql_client.clone(),
2916        }
2917    }
2918    /// Set the default command to invoke for the container's terminal API.
2919    ///
2920    /// # Arguments
2921    ///
2922    /// * `args` - The args of the command.
2923    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2924    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
2925        let mut query = self.selection.select("withDefaultTerminalCmd");
2926        query = query.arg(
2927            "args",
2928            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2929        );
2930        Container {
2931            proc: self.proc.clone(),
2932            selection: query,
2933            graphql_client: self.graphql_client.clone(),
2934        }
2935    }
2936    /// Set the default command to invoke for the container's terminal API.
2937    ///
2938    /// # Arguments
2939    ///
2940    /// * `args` - The args of the command.
2941    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2942    pub fn with_default_terminal_cmd_opts(
2943        &self,
2944        args: Vec<impl Into<String>>,
2945        opts: ContainerWithDefaultTerminalCmdOpts,
2946    ) -> Container {
2947        let mut query = self.selection.select("withDefaultTerminalCmd");
2948        query = query.arg(
2949            "args",
2950            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2951        );
2952        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2953            query = query.arg(
2954                "experimentalPrivilegedNesting",
2955                experimental_privileged_nesting,
2956            );
2957        }
2958        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2959            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2960        }
2961        Container {
2962            proc: self.proc.clone(),
2963            selection: query,
2964            graphql_client: self.graphql_client.clone(),
2965        }
2966    }
2967    /// Return a new container snapshot, with a directory added to its filesystem
2968    ///
2969    /// # Arguments
2970    ///
2971    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
2972    /// * `directory` - Identifier of the directory to write
2973    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2974    pub fn with_directory(
2975        &self,
2976        path: impl Into<String>,
2977        directory: impl IntoID<DirectoryId>,
2978    ) -> Container {
2979        let mut query = self.selection.select("withDirectory");
2980        query = query.arg("path", path.into());
2981        query = query.arg_lazy(
2982            "directory",
2983            Box::new(move || {
2984                let directory = directory.clone();
2985                Box::pin(async move { directory.into_id().await.unwrap().quote() })
2986            }),
2987        );
2988        Container {
2989            proc: self.proc.clone(),
2990            selection: query,
2991            graphql_client: self.graphql_client.clone(),
2992        }
2993    }
2994    /// Return a new container snapshot, with a directory added to its filesystem
2995    ///
2996    /// # Arguments
2997    ///
2998    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
2999    /// * `directory` - Identifier of the directory to write
3000    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3001    pub fn with_directory_opts<'a>(
3002        &self,
3003        path: impl Into<String>,
3004        directory: impl IntoID<DirectoryId>,
3005        opts: ContainerWithDirectoryOpts<'a>,
3006    ) -> Container {
3007        let mut query = self.selection.select("withDirectory");
3008        query = query.arg("path", path.into());
3009        query = query.arg_lazy(
3010            "directory",
3011            Box::new(move || {
3012                let directory = directory.clone();
3013                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3014            }),
3015        );
3016        if let Some(exclude) = opts.exclude {
3017            query = query.arg("exclude", exclude);
3018        }
3019        if let Some(include) = opts.include {
3020            query = query.arg("include", include);
3021        }
3022        if let Some(owner) = opts.owner {
3023            query = query.arg("owner", owner);
3024        }
3025        if let Some(expand) = opts.expand {
3026            query = query.arg("expand", expand);
3027        }
3028        Container {
3029            proc: self.proc.clone(),
3030            selection: query,
3031            graphql_client: self.graphql_client.clone(),
3032        }
3033    }
3034    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
3035    ///
3036    /// # Arguments
3037    ///
3038    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
3039    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3040    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
3041        let mut query = self.selection.select("withEntrypoint");
3042        query = query.arg(
3043            "args",
3044            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3045        );
3046        Container {
3047            proc: self.proc.clone(),
3048            selection: query,
3049            graphql_client: self.graphql_client.clone(),
3050        }
3051    }
3052    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
3053    ///
3054    /// # Arguments
3055    ///
3056    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
3057    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3058    pub fn with_entrypoint_opts(
3059        &self,
3060        args: Vec<impl Into<String>>,
3061        opts: ContainerWithEntrypointOpts,
3062    ) -> Container {
3063        let mut query = self.selection.select("withEntrypoint");
3064        query = query.arg(
3065            "args",
3066            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3067        );
3068        if let Some(keep_default_args) = opts.keep_default_args {
3069            query = query.arg("keepDefaultArgs", keep_default_args);
3070        }
3071        Container {
3072            proc: self.proc.clone(),
3073            selection: query,
3074            graphql_client: self.graphql_client.clone(),
3075        }
3076    }
3077    /// Set a new environment variable in the container.
3078    ///
3079    /// # Arguments
3080    ///
3081    /// * `name` - Name of the environment variable (e.g., "HOST").
3082    /// * `value` - Value of the environment variable. (e.g., "localhost").
3083    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3084    pub fn with_env_variable(
3085        &self,
3086        name: impl Into<String>,
3087        value: impl Into<String>,
3088    ) -> Container {
3089        let mut query = self.selection.select("withEnvVariable");
3090        query = query.arg("name", name.into());
3091        query = query.arg("value", value.into());
3092        Container {
3093            proc: self.proc.clone(),
3094            selection: query,
3095            graphql_client: self.graphql_client.clone(),
3096        }
3097    }
3098    /// Set a new environment variable in the container.
3099    ///
3100    /// # Arguments
3101    ///
3102    /// * `name` - Name of the environment variable (e.g., "HOST").
3103    /// * `value` - Value of the environment variable. (e.g., "localhost").
3104    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3105    pub fn with_env_variable_opts(
3106        &self,
3107        name: impl Into<String>,
3108        value: impl Into<String>,
3109        opts: ContainerWithEnvVariableOpts,
3110    ) -> Container {
3111        let mut query = self.selection.select("withEnvVariable");
3112        query = query.arg("name", name.into());
3113        query = query.arg("value", value.into());
3114        if let Some(expand) = opts.expand {
3115            query = query.arg("expand", expand);
3116        }
3117        Container {
3118            proc: self.proc.clone(),
3119            selection: query,
3120            graphql_client: self.graphql_client.clone(),
3121        }
3122    }
3123    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3124    ///
3125    /// # Arguments
3126    ///
3127    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3128    ///
3129    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3130    ///
3131    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3132    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3133    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3134        let mut query = self.selection.select("withExec");
3135        query = query.arg(
3136            "args",
3137            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3138        );
3139        Container {
3140            proc: self.proc.clone(),
3141            selection: query,
3142            graphql_client: self.graphql_client.clone(),
3143        }
3144    }
3145    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3146    ///
3147    /// # Arguments
3148    ///
3149    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3150    ///
3151    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3152    ///
3153    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3154    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3155    pub fn with_exec_opts<'a>(
3156        &self,
3157        args: Vec<impl Into<String>>,
3158        opts: ContainerWithExecOpts<'a>,
3159    ) -> Container {
3160        let mut query = self.selection.select("withExec");
3161        query = query.arg(
3162            "args",
3163            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3164        );
3165        if let Some(use_entrypoint) = opts.use_entrypoint {
3166            query = query.arg("useEntrypoint", use_entrypoint);
3167        }
3168        if let Some(stdin) = opts.stdin {
3169            query = query.arg("stdin", stdin);
3170        }
3171        if let Some(redirect_stdout) = opts.redirect_stdout {
3172            query = query.arg("redirectStdout", redirect_stdout);
3173        }
3174        if let Some(redirect_stderr) = opts.redirect_stderr {
3175            query = query.arg("redirectStderr", redirect_stderr);
3176        }
3177        if let Some(expect) = opts.expect {
3178            query = query.arg("expect", expect);
3179        }
3180        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3181            query = query.arg(
3182                "experimentalPrivilegedNesting",
3183                experimental_privileged_nesting,
3184            );
3185        }
3186        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3187            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3188        }
3189        if let Some(expand) = opts.expand {
3190            query = query.arg("expand", expand);
3191        }
3192        if let Some(no_init) = opts.no_init {
3193            query = query.arg("noInit", no_init);
3194        }
3195        Container {
3196            proc: self.proc.clone(),
3197            selection: query,
3198            graphql_client: self.graphql_client.clone(),
3199        }
3200    }
3201    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3202    /// Exposed ports serve two purposes:
3203    /// - For health checks and introspection, when running services
3204    /// - For setting the EXPOSE OCI field when publishing the container
3205    ///
3206    /// # Arguments
3207    ///
3208    /// * `port` - Port number to expose. Example: 8080
3209    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3210    pub fn with_exposed_port(&self, port: isize) -> Container {
3211        let mut query = self.selection.select("withExposedPort");
3212        query = query.arg("port", port);
3213        Container {
3214            proc: self.proc.clone(),
3215            selection: query,
3216            graphql_client: self.graphql_client.clone(),
3217        }
3218    }
3219    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3220    /// Exposed ports serve two purposes:
3221    /// - For health checks and introspection, when running services
3222    /// - For setting the EXPOSE OCI field when publishing the container
3223    ///
3224    /// # Arguments
3225    ///
3226    /// * `port` - Port number to expose. Example: 8080
3227    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3228    pub fn with_exposed_port_opts<'a>(
3229        &self,
3230        port: isize,
3231        opts: ContainerWithExposedPortOpts<'a>,
3232    ) -> Container {
3233        let mut query = self.selection.select("withExposedPort");
3234        query = query.arg("port", port);
3235        if let Some(protocol) = opts.protocol {
3236            query = query.arg("protocol", protocol);
3237        }
3238        if let Some(description) = opts.description {
3239            query = query.arg("description", description);
3240        }
3241        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3242            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3243        }
3244        Container {
3245            proc: self.proc.clone(),
3246            selection: query,
3247            graphql_client: self.graphql_client.clone(),
3248        }
3249    }
3250    /// Return a container snapshot with a file added
3251    ///
3252    /// # Arguments
3253    ///
3254    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3255    /// * `source` - File to add
3256    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3257    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
3258        let mut query = self.selection.select("withFile");
3259        query = query.arg("path", path.into());
3260        query = query.arg_lazy(
3261            "source",
3262            Box::new(move || {
3263                let source = source.clone();
3264                Box::pin(async move { source.into_id().await.unwrap().quote() })
3265            }),
3266        );
3267        Container {
3268            proc: self.proc.clone(),
3269            selection: query,
3270            graphql_client: self.graphql_client.clone(),
3271        }
3272    }
3273    /// Return a container snapshot with a file added
3274    ///
3275    /// # Arguments
3276    ///
3277    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3278    /// * `source` - File to add
3279    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3280    pub fn with_file_opts<'a>(
3281        &self,
3282        path: impl Into<String>,
3283        source: impl IntoID<FileId>,
3284        opts: ContainerWithFileOpts<'a>,
3285    ) -> Container {
3286        let mut query = self.selection.select("withFile");
3287        query = query.arg("path", path.into());
3288        query = query.arg_lazy(
3289            "source",
3290            Box::new(move || {
3291                let source = source.clone();
3292                Box::pin(async move { source.into_id().await.unwrap().quote() })
3293            }),
3294        );
3295        if let Some(permissions) = opts.permissions {
3296            query = query.arg("permissions", permissions);
3297        }
3298        if let Some(owner) = opts.owner {
3299            query = query.arg("owner", owner);
3300        }
3301        if let Some(expand) = opts.expand {
3302            query = query.arg("expand", expand);
3303        }
3304        Container {
3305            proc: self.proc.clone(),
3306            selection: query,
3307            graphql_client: self.graphql_client.clone(),
3308        }
3309    }
3310    /// Retrieves this container plus the contents of the given files copied to the given path.
3311    ///
3312    /// # Arguments
3313    ///
3314    /// * `path` - Location where copied files should be placed (e.g., "/src").
3315    /// * `sources` - Identifiers of the files to copy.
3316    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3317    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
3318        let mut query = self.selection.select("withFiles");
3319        query = query.arg("path", path.into());
3320        query = query.arg("sources", sources);
3321        Container {
3322            proc: self.proc.clone(),
3323            selection: query,
3324            graphql_client: self.graphql_client.clone(),
3325        }
3326    }
3327    /// Retrieves this container plus the contents of the given files copied to the given path.
3328    ///
3329    /// # Arguments
3330    ///
3331    /// * `path` - Location where copied files should be placed (e.g., "/src").
3332    /// * `sources` - Identifiers of the files to copy.
3333    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3334    pub fn with_files_opts<'a>(
3335        &self,
3336        path: impl Into<String>,
3337        sources: Vec<FileId>,
3338        opts: ContainerWithFilesOpts<'a>,
3339    ) -> Container {
3340        let mut query = self.selection.select("withFiles");
3341        query = query.arg("path", path.into());
3342        query = query.arg("sources", sources);
3343        if let Some(permissions) = opts.permissions {
3344            query = query.arg("permissions", permissions);
3345        }
3346        if let Some(owner) = opts.owner {
3347            query = query.arg("owner", owner);
3348        }
3349        if let Some(expand) = opts.expand {
3350            query = query.arg("expand", expand);
3351        }
3352        Container {
3353            proc: self.proc.clone(),
3354            selection: query,
3355            graphql_client: self.graphql_client.clone(),
3356        }
3357    }
3358    /// Retrieves this container plus the given label.
3359    ///
3360    /// # Arguments
3361    ///
3362    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3363    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
3364    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3365        let mut query = self.selection.select("withLabel");
3366        query = query.arg("name", name.into());
3367        query = query.arg("value", value.into());
3368        Container {
3369            proc: self.proc.clone(),
3370            selection: query,
3371            graphql_client: self.graphql_client.clone(),
3372        }
3373    }
3374    /// Retrieves this container plus a cache volume mounted at the given path.
3375    ///
3376    /// # Arguments
3377    ///
3378    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3379    /// * `cache` - Identifier of the cache volume to mount.
3380    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3381    pub fn with_mounted_cache(
3382        &self,
3383        path: impl Into<String>,
3384        cache: impl IntoID<CacheVolumeId>,
3385    ) -> Container {
3386        let mut query = self.selection.select("withMountedCache");
3387        query = query.arg("path", path.into());
3388        query = query.arg_lazy(
3389            "cache",
3390            Box::new(move || {
3391                let cache = cache.clone();
3392                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3393            }),
3394        );
3395        Container {
3396            proc: self.proc.clone(),
3397            selection: query,
3398            graphql_client: self.graphql_client.clone(),
3399        }
3400    }
3401    /// Retrieves this container plus a cache volume mounted at the given path.
3402    ///
3403    /// # Arguments
3404    ///
3405    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3406    /// * `cache` - Identifier of the cache volume to mount.
3407    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3408    pub fn with_mounted_cache_opts<'a>(
3409        &self,
3410        path: impl Into<String>,
3411        cache: impl IntoID<CacheVolumeId>,
3412        opts: ContainerWithMountedCacheOpts<'a>,
3413    ) -> Container {
3414        let mut query = self.selection.select("withMountedCache");
3415        query = query.arg("path", path.into());
3416        query = query.arg_lazy(
3417            "cache",
3418            Box::new(move || {
3419                let cache = cache.clone();
3420                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3421            }),
3422        );
3423        if let Some(source) = opts.source {
3424            query = query.arg("source", source);
3425        }
3426        if let Some(sharing) = opts.sharing {
3427            query = query.arg("sharing", sharing);
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 directory mounted at the given path.
3442    ///
3443    /// # Arguments
3444    ///
3445    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3446    /// * `source` - Identifier of the mounted directory.
3447    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3448    pub fn with_mounted_directory(
3449        &self,
3450        path: impl Into<String>,
3451        source: impl IntoID<DirectoryId>,
3452    ) -> Container {
3453        let mut query = self.selection.select("withMountedDirectory");
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 directory mounted at the given path.
3469    ///
3470    /// # Arguments
3471    ///
3472    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3473    /// * `source` - Identifier of the mounted directory.
3474    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3475    pub fn with_mounted_directory_opts<'a>(
3476        &self,
3477        path: impl Into<String>,
3478        source: impl IntoID<DirectoryId>,
3479        opts: ContainerWithMountedDirectoryOpts<'a>,
3480    ) -> Container {
3481        let mut query = self.selection.select("withMountedDirectory");
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(expand) = opts.expand {
3494            query = query.arg("expand", expand);
3495        }
3496        Container {
3497            proc: self.proc.clone(),
3498            selection: query,
3499            graphql_client: self.graphql_client.clone(),
3500        }
3501    }
3502    /// Retrieves this container plus a file mounted at the given path.
3503    ///
3504    /// # Arguments
3505    ///
3506    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3507    /// * `source` - Identifier of the mounted file.
3508    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3509    pub fn with_mounted_file(
3510        &self,
3511        path: impl Into<String>,
3512        source: impl IntoID<FileId>,
3513    ) -> Container {
3514        let mut query = self.selection.select("withMountedFile");
3515        query = query.arg("path", path.into());
3516        query = query.arg_lazy(
3517            "source",
3518            Box::new(move || {
3519                let source = source.clone();
3520                Box::pin(async move { source.into_id().await.unwrap().quote() })
3521            }),
3522        );
3523        Container {
3524            proc: self.proc.clone(),
3525            selection: query,
3526            graphql_client: self.graphql_client.clone(),
3527        }
3528    }
3529    /// Retrieves this container plus a file mounted at the given path.
3530    ///
3531    /// # Arguments
3532    ///
3533    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3534    /// * `source` - Identifier of the mounted file.
3535    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3536    pub fn with_mounted_file_opts<'a>(
3537        &self,
3538        path: impl Into<String>,
3539        source: impl IntoID<FileId>,
3540        opts: ContainerWithMountedFileOpts<'a>,
3541    ) -> Container {
3542        let mut query = self.selection.select("withMountedFile");
3543        query = query.arg("path", path.into());
3544        query = query.arg_lazy(
3545            "source",
3546            Box::new(move || {
3547                let source = source.clone();
3548                Box::pin(async move { source.into_id().await.unwrap().quote() })
3549            }),
3550        );
3551        if let Some(owner) = opts.owner {
3552            query = query.arg("owner", owner);
3553        }
3554        if let Some(expand) = opts.expand {
3555            query = query.arg("expand", expand);
3556        }
3557        Container {
3558            proc: self.proc.clone(),
3559            selection: query,
3560            graphql_client: self.graphql_client.clone(),
3561        }
3562    }
3563    /// Retrieves this container plus a secret mounted into a file at the given path.
3564    ///
3565    /// # Arguments
3566    ///
3567    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3568    /// * `source` - Identifier of the secret to mount.
3569    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3570    pub fn with_mounted_secret(
3571        &self,
3572        path: impl Into<String>,
3573        source: impl IntoID<SecretId>,
3574    ) -> Container {
3575        let mut query = self.selection.select("withMountedSecret");
3576        query = query.arg("path", path.into());
3577        query = query.arg_lazy(
3578            "source",
3579            Box::new(move || {
3580                let source = source.clone();
3581                Box::pin(async move { source.into_id().await.unwrap().quote() })
3582            }),
3583        );
3584        Container {
3585            proc: self.proc.clone(),
3586            selection: query,
3587            graphql_client: self.graphql_client.clone(),
3588        }
3589    }
3590    /// Retrieves this container plus a secret mounted into a file at the given path.
3591    ///
3592    /// # Arguments
3593    ///
3594    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3595    /// * `source` - Identifier of the secret to mount.
3596    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3597    pub fn with_mounted_secret_opts<'a>(
3598        &self,
3599        path: impl Into<String>,
3600        source: impl IntoID<SecretId>,
3601        opts: ContainerWithMountedSecretOpts<'a>,
3602    ) -> Container {
3603        let mut query = self.selection.select("withMountedSecret");
3604        query = query.arg("path", path.into());
3605        query = query.arg_lazy(
3606            "source",
3607            Box::new(move || {
3608                let source = source.clone();
3609                Box::pin(async move { source.into_id().await.unwrap().quote() })
3610            }),
3611        );
3612        if let Some(owner) = opts.owner {
3613            query = query.arg("owner", owner);
3614        }
3615        if let Some(mode) = opts.mode {
3616            query = query.arg("mode", mode);
3617        }
3618        if let Some(expand) = opts.expand {
3619            query = query.arg("expand", expand);
3620        }
3621        Container {
3622            proc: self.proc.clone(),
3623            selection: query,
3624            graphql_client: self.graphql_client.clone(),
3625        }
3626    }
3627    /// 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.
3628    ///
3629    /// # Arguments
3630    ///
3631    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3632    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3633    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3634        let mut query = self.selection.select("withMountedTemp");
3635        query = query.arg("path", path.into());
3636        Container {
3637            proc: self.proc.clone(),
3638            selection: query,
3639            graphql_client: self.graphql_client.clone(),
3640        }
3641    }
3642    /// 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.
3643    ///
3644    /// # Arguments
3645    ///
3646    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3647    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3648    pub fn with_mounted_temp_opts(
3649        &self,
3650        path: impl Into<String>,
3651        opts: ContainerWithMountedTempOpts,
3652    ) -> Container {
3653        let mut query = self.selection.select("withMountedTemp");
3654        query = query.arg("path", path.into());
3655        if let Some(size) = opts.size {
3656            query = query.arg("size", size);
3657        }
3658        if let Some(expand) = opts.expand {
3659            query = query.arg("expand", expand);
3660        }
3661        Container {
3662            proc: self.proc.clone(),
3663            selection: query,
3664            graphql_client: self.graphql_client.clone(),
3665        }
3666    }
3667    /// Return a new container snapshot, with a file added to its filesystem with text content
3668    ///
3669    /// # Arguments
3670    ///
3671    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
3672    /// * `contents` - Contents of the new file. Example: "Hello world!"
3673    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3674    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3675        let mut query = self.selection.select("withNewFile");
3676        query = query.arg("path", path.into());
3677        query = query.arg("contents", contents.into());
3678        Container {
3679            proc: self.proc.clone(),
3680            selection: query,
3681            graphql_client: self.graphql_client.clone(),
3682        }
3683    }
3684    /// Return a new container snapshot, with a file added to its filesystem with text content
3685    ///
3686    /// # Arguments
3687    ///
3688    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
3689    /// * `contents` - Contents of the new file. Example: "Hello world!"
3690    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3691    pub fn with_new_file_opts<'a>(
3692        &self,
3693        path: impl Into<String>,
3694        contents: impl Into<String>,
3695        opts: ContainerWithNewFileOpts<'a>,
3696    ) -> Container {
3697        let mut query = self.selection.select("withNewFile");
3698        query = query.arg("path", path.into());
3699        query = query.arg("contents", contents.into());
3700        if let Some(permissions) = opts.permissions {
3701            query = query.arg("permissions", permissions);
3702        }
3703        if let Some(owner) = opts.owner {
3704            query = query.arg("owner", owner);
3705        }
3706        if let Some(expand) = opts.expand {
3707            query = query.arg("expand", expand);
3708        }
3709        Container {
3710            proc: self.proc.clone(),
3711            selection: query,
3712            graphql_client: self.graphql_client.clone(),
3713        }
3714    }
3715    /// Attach credentials for future publishing to a registry. Use in combination with publish
3716    ///
3717    /// # Arguments
3718    ///
3719    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
3720    /// * `username` - The username to authenticate with. Example: "alice"
3721    /// * `secret` - The API key, password or token to authenticate to this registry
3722    pub fn with_registry_auth(
3723        &self,
3724        address: impl Into<String>,
3725        username: impl Into<String>,
3726        secret: impl IntoID<SecretId>,
3727    ) -> Container {
3728        let mut query = self.selection.select("withRegistryAuth");
3729        query = query.arg("address", address.into());
3730        query = query.arg("username", username.into());
3731        query = query.arg_lazy(
3732            "secret",
3733            Box::new(move || {
3734                let secret = secret.clone();
3735                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3736            }),
3737        );
3738        Container {
3739            proc: self.proc.clone(),
3740            selection: query,
3741            graphql_client: self.graphql_client.clone(),
3742        }
3743    }
3744    /// Change the container's root filesystem. The previous root filesystem will be lost.
3745    ///
3746    /// # Arguments
3747    ///
3748    /// * `directory` - The new root filesystem.
3749    pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
3750        let mut query = self.selection.select("withRootfs");
3751        query = query.arg_lazy(
3752            "directory",
3753            Box::new(move || {
3754                let directory = directory.clone();
3755                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3756            }),
3757        );
3758        Container {
3759            proc: self.proc.clone(),
3760            selection: query,
3761            graphql_client: self.graphql_client.clone(),
3762        }
3763    }
3764    /// Set a new environment variable, using a secret value
3765    ///
3766    /// # Arguments
3767    ///
3768    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
3769    /// * `secret` - Identifier of the secret value.
3770    pub fn with_secret_variable(
3771        &self,
3772        name: impl Into<String>,
3773        secret: impl IntoID<SecretId>,
3774    ) -> Container {
3775        let mut query = self.selection.select("withSecretVariable");
3776        query = query.arg("name", name.into());
3777        query = query.arg_lazy(
3778            "secret",
3779            Box::new(move || {
3780                let secret = secret.clone();
3781                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3782            }),
3783        );
3784        Container {
3785            proc: self.proc.clone(),
3786            selection: query,
3787            graphql_client: self.graphql_client.clone(),
3788        }
3789    }
3790    /// Establish a runtime dependency from a container to a network service.
3791    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
3792    /// The service will be reachable from the container via the provided hostname alias.
3793    /// The service dependency will also convey to any files or directories produced by the container.
3794    ///
3795    /// # Arguments
3796    ///
3797    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
3798    /// * `service` - The target service
3799    pub fn with_service_binding(
3800        &self,
3801        alias: impl Into<String>,
3802        service: impl IntoID<ServiceId>,
3803    ) -> Container {
3804        let mut query = self.selection.select("withServiceBinding");
3805        query = query.arg("alias", alias.into());
3806        query = query.arg_lazy(
3807            "service",
3808            Box::new(move || {
3809                let service = service.clone();
3810                Box::pin(async move { service.into_id().await.unwrap().quote() })
3811            }),
3812        );
3813        Container {
3814            proc: self.proc.clone(),
3815            selection: query,
3816            graphql_client: self.graphql_client.clone(),
3817        }
3818    }
3819    /// Return a snapshot with a symlink
3820    ///
3821    /// # Arguments
3822    ///
3823    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
3824    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
3825    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3826    pub fn with_symlink(
3827        &self,
3828        target: impl Into<String>,
3829        link_name: impl Into<String>,
3830    ) -> Container {
3831        let mut query = self.selection.select("withSymlink");
3832        query = query.arg("target", target.into());
3833        query = query.arg("linkName", link_name.into());
3834        Container {
3835            proc: self.proc.clone(),
3836            selection: query,
3837            graphql_client: self.graphql_client.clone(),
3838        }
3839    }
3840    /// Return a snapshot with a symlink
3841    ///
3842    /// # Arguments
3843    ///
3844    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
3845    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
3846    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3847    pub fn with_symlink_opts(
3848        &self,
3849        target: impl Into<String>,
3850        link_name: impl Into<String>,
3851        opts: ContainerWithSymlinkOpts,
3852    ) -> Container {
3853        let mut query = self.selection.select("withSymlink");
3854        query = query.arg("target", target.into());
3855        query = query.arg("linkName", link_name.into());
3856        if let Some(expand) = opts.expand {
3857            query = query.arg("expand", expand);
3858        }
3859        Container {
3860            proc: self.proc.clone(),
3861            selection: query,
3862            graphql_client: self.graphql_client.clone(),
3863        }
3864    }
3865    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
3866    ///
3867    /// # Arguments
3868    ///
3869    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
3870    /// * `source` - Identifier of the socket to forward.
3871    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3872    pub fn with_unix_socket(
3873        &self,
3874        path: impl Into<String>,
3875        source: impl IntoID<SocketId>,
3876    ) -> Container {
3877        let mut query = self.selection.select("withUnixSocket");
3878        query = query.arg("path", path.into());
3879        query = query.arg_lazy(
3880            "source",
3881            Box::new(move || {
3882                let source = source.clone();
3883                Box::pin(async move { source.into_id().await.unwrap().quote() })
3884            }),
3885        );
3886        Container {
3887            proc: self.proc.clone(),
3888            selection: query,
3889            graphql_client: self.graphql_client.clone(),
3890        }
3891    }
3892    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
3893    ///
3894    /// # Arguments
3895    ///
3896    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
3897    /// * `source` - Identifier of the socket to forward.
3898    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3899    pub fn with_unix_socket_opts<'a>(
3900        &self,
3901        path: impl Into<String>,
3902        source: impl IntoID<SocketId>,
3903        opts: ContainerWithUnixSocketOpts<'a>,
3904    ) -> Container {
3905        let mut query = self.selection.select("withUnixSocket");
3906        query = query.arg("path", path.into());
3907        query = query.arg_lazy(
3908            "source",
3909            Box::new(move || {
3910                let source = source.clone();
3911                Box::pin(async move { source.into_id().await.unwrap().quote() })
3912            }),
3913        );
3914        if let Some(owner) = opts.owner {
3915            query = query.arg("owner", owner);
3916        }
3917        if let Some(expand) = opts.expand {
3918            query = query.arg("expand", expand);
3919        }
3920        Container {
3921            proc: self.proc.clone(),
3922            selection: query,
3923            graphql_client: self.graphql_client.clone(),
3924        }
3925    }
3926    /// Retrieves this container with a different command user.
3927    ///
3928    /// # Arguments
3929    ///
3930    /// * `name` - The user to set (e.g., "root").
3931    pub fn with_user(&self, name: impl Into<String>) -> Container {
3932        let mut query = self.selection.select("withUser");
3933        query = query.arg("name", name.into());
3934        Container {
3935            proc: self.proc.clone(),
3936            selection: query,
3937            graphql_client: self.graphql_client.clone(),
3938        }
3939    }
3940    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3941    ///
3942    /// # Arguments
3943    ///
3944    /// * `path` - The path to set as the working directory (e.g., "/app").
3945    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3946    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3947        let mut query = self.selection.select("withWorkdir");
3948        query = query.arg("path", path.into());
3949        Container {
3950            proc: self.proc.clone(),
3951            selection: query,
3952            graphql_client: self.graphql_client.clone(),
3953        }
3954    }
3955    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3956    ///
3957    /// # Arguments
3958    ///
3959    /// * `path` - The path to set as the working directory (e.g., "/app").
3960    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3961    pub fn with_workdir_opts(
3962        &self,
3963        path: impl Into<String>,
3964        opts: ContainerWithWorkdirOpts,
3965    ) -> Container {
3966        let mut query = self.selection.select("withWorkdir");
3967        query = query.arg("path", path.into());
3968        if let Some(expand) = opts.expand {
3969            query = query.arg("expand", expand);
3970        }
3971        Container {
3972            proc: self.proc.clone(),
3973            selection: query,
3974            graphql_client: self.graphql_client.clone(),
3975        }
3976    }
3977    /// Retrieves this container minus the given OCI annotation.
3978    ///
3979    /// # Arguments
3980    ///
3981    /// * `name` - The name of the annotation.
3982    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3983        let mut query = self.selection.select("withoutAnnotation");
3984        query = query.arg("name", name.into());
3985        Container {
3986            proc: self.proc.clone(),
3987            selection: query,
3988            graphql_client: self.graphql_client.clone(),
3989        }
3990    }
3991    /// Remove the container's default arguments.
3992    pub fn without_default_args(&self) -> Container {
3993        let query = self.selection.select("withoutDefaultArgs");
3994        Container {
3995            proc: self.proc.clone(),
3996            selection: query,
3997            graphql_client: self.graphql_client.clone(),
3998        }
3999    }
4000    /// Return a new container snapshot, with a directory removed from its filesystem
4001    ///
4002    /// # Arguments
4003    ///
4004    /// * `path` - Location of the directory to remove (e.g., ".github/").
4005    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4006    pub fn without_directory(&self, path: impl Into<String>) -> Container {
4007        let mut query = self.selection.select("withoutDirectory");
4008        query = query.arg("path", path.into());
4009        Container {
4010            proc: self.proc.clone(),
4011            selection: query,
4012            graphql_client: self.graphql_client.clone(),
4013        }
4014    }
4015    /// Return a new container snapshot, with a directory removed from its filesystem
4016    ///
4017    /// # Arguments
4018    ///
4019    /// * `path` - Location of the directory to remove (e.g., ".github/").
4020    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4021    pub fn without_directory_opts(
4022        &self,
4023        path: impl Into<String>,
4024        opts: ContainerWithoutDirectoryOpts,
4025    ) -> Container {
4026        let mut query = self.selection.select("withoutDirectory");
4027        query = query.arg("path", path.into());
4028        if let Some(expand) = opts.expand {
4029            query = query.arg("expand", expand);
4030        }
4031        Container {
4032            proc: self.proc.clone(),
4033            selection: query,
4034            graphql_client: self.graphql_client.clone(),
4035        }
4036    }
4037    /// Reset the container's OCI entrypoint.
4038    ///
4039    /// # Arguments
4040    ///
4041    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4042    pub fn without_entrypoint(&self) -> Container {
4043        let query = self.selection.select("withoutEntrypoint");
4044        Container {
4045            proc: self.proc.clone(),
4046            selection: query,
4047            graphql_client: self.graphql_client.clone(),
4048        }
4049    }
4050    /// Reset the container's OCI entrypoint.
4051    ///
4052    /// # Arguments
4053    ///
4054    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4055    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4056        let mut query = self.selection.select("withoutEntrypoint");
4057        if let Some(keep_default_args) = opts.keep_default_args {
4058            query = query.arg("keepDefaultArgs", keep_default_args);
4059        }
4060        Container {
4061            proc: self.proc.clone(),
4062            selection: query,
4063            graphql_client: self.graphql_client.clone(),
4064        }
4065    }
4066    /// Retrieves this container minus the given environment variable.
4067    ///
4068    /// # Arguments
4069    ///
4070    /// * `name` - The name of the environment variable (e.g., "HOST").
4071    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4072        let mut query = self.selection.select("withoutEnvVariable");
4073        query = query.arg("name", name.into());
4074        Container {
4075            proc: self.proc.clone(),
4076            selection: query,
4077            graphql_client: self.graphql_client.clone(),
4078        }
4079    }
4080    /// Unexpose a previously exposed port.
4081    ///
4082    /// # Arguments
4083    ///
4084    /// * `port` - Port number to unexpose
4085    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4086    pub fn without_exposed_port(&self, port: isize) -> Container {
4087        let mut query = self.selection.select("withoutExposedPort");
4088        query = query.arg("port", port);
4089        Container {
4090            proc: self.proc.clone(),
4091            selection: query,
4092            graphql_client: self.graphql_client.clone(),
4093        }
4094    }
4095    /// Unexpose a previously exposed port.
4096    ///
4097    /// # Arguments
4098    ///
4099    /// * `port` - Port number to unexpose
4100    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4101    pub fn without_exposed_port_opts(
4102        &self,
4103        port: isize,
4104        opts: ContainerWithoutExposedPortOpts,
4105    ) -> Container {
4106        let mut query = self.selection.select("withoutExposedPort");
4107        query = query.arg("port", port);
4108        if let Some(protocol) = opts.protocol {
4109            query = query.arg("protocol", protocol);
4110        }
4111        Container {
4112            proc: self.proc.clone(),
4113            selection: query,
4114            graphql_client: self.graphql_client.clone(),
4115        }
4116    }
4117    /// Retrieves this container with the file at the given path removed.
4118    ///
4119    /// # Arguments
4120    ///
4121    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4122    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4123    pub fn without_file(&self, path: impl Into<String>) -> Container {
4124        let mut query = self.selection.select("withoutFile");
4125        query = query.arg("path", path.into());
4126        Container {
4127            proc: self.proc.clone(),
4128            selection: query,
4129            graphql_client: self.graphql_client.clone(),
4130        }
4131    }
4132    /// Retrieves this container with the file at the given path removed.
4133    ///
4134    /// # Arguments
4135    ///
4136    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4137    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4138    pub fn without_file_opts(
4139        &self,
4140        path: impl Into<String>,
4141        opts: ContainerWithoutFileOpts,
4142    ) -> Container {
4143        let mut query = self.selection.select("withoutFile");
4144        query = query.arg("path", path.into());
4145        if let Some(expand) = opts.expand {
4146            query = query.arg("expand", expand);
4147        }
4148        Container {
4149            proc: self.proc.clone(),
4150            selection: query,
4151            graphql_client: self.graphql_client.clone(),
4152        }
4153    }
4154    /// Return a new container spanshot with specified files removed
4155    ///
4156    /// # Arguments
4157    ///
4158    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4159    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4160    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4161        let mut query = self.selection.select("withoutFiles");
4162        query = query.arg(
4163            "paths",
4164            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4165        );
4166        Container {
4167            proc: self.proc.clone(),
4168            selection: query,
4169            graphql_client: self.graphql_client.clone(),
4170        }
4171    }
4172    /// Return a new container spanshot with specified files removed
4173    ///
4174    /// # Arguments
4175    ///
4176    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4177    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4178    pub fn without_files_opts(
4179        &self,
4180        paths: Vec<impl Into<String>>,
4181        opts: ContainerWithoutFilesOpts,
4182    ) -> Container {
4183        let mut query = self.selection.select("withoutFiles");
4184        query = query.arg(
4185            "paths",
4186            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4187        );
4188        if let Some(expand) = opts.expand {
4189            query = query.arg("expand", expand);
4190        }
4191        Container {
4192            proc: self.proc.clone(),
4193            selection: query,
4194            graphql_client: self.graphql_client.clone(),
4195        }
4196    }
4197    /// Retrieves this container minus the given environment label.
4198    ///
4199    /// # Arguments
4200    ///
4201    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4202    pub fn without_label(&self, name: impl Into<String>) -> Container {
4203        let mut query = self.selection.select("withoutLabel");
4204        query = query.arg("name", name.into());
4205        Container {
4206            proc: self.proc.clone(),
4207            selection: query,
4208            graphql_client: self.graphql_client.clone(),
4209        }
4210    }
4211    /// Retrieves this container after unmounting everything at the given path.
4212    ///
4213    /// # Arguments
4214    ///
4215    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4216    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4217    pub fn without_mount(&self, path: impl Into<String>) -> Container {
4218        let mut query = self.selection.select("withoutMount");
4219        query = query.arg("path", path.into());
4220        Container {
4221            proc: self.proc.clone(),
4222            selection: query,
4223            graphql_client: self.graphql_client.clone(),
4224        }
4225    }
4226    /// Retrieves this container after unmounting everything at the given path.
4227    ///
4228    /// # Arguments
4229    ///
4230    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4231    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4232    pub fn without_mount_opts(
4233        &self,
4234        path: impl Into<String>,
4235        opts: ContainerWithoutMountOpts,
4236    ) -> Container {
4237        let mut query = self.selection.select("withoutMount");
4238        query = query.arg("path", path.into());
4239        if let Some(expand) = opts.expand {
4240            query = query.arg("expand", expand);
4241        }
4242        Container {
4243            proc: self.proc.clone(),
4244            selection: query,
4245            graphql_client: self.graphql_client.clone(),
4246        }
4247    }
4248    /// Retrieves this container without the registry authentication of a given address.
4249    ///
4250    /// # Arguments
4251    ///
4252    /// * `address` - Registry's address to remove the authentication from.
4253    ///
4254    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
4255    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4256        let mut query = self.selection.select("withoutRegistryAuth");
4257        query = query.arg("address", address.into());
4258        Container {
4259            proc: self.proc.clone(),
4260            selection: query,
4261            graphql_client: self.graphql_client.clone(),
4262        }
4263    }
4264    /// Retrieves this container minus the given environment variable containing the secret.
4265    ///
4266    /// # Arguments
4267    ///
4268    /// * `name` - The name of the environment variable (e.g., "HOST").
4269    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4270        let mut query = self.selection.select("withoutSecretVariable");
4271        query = query.arg("name", name.into());
4272        Container {
4273            proc: self.proc.clone(),
4274            selection: query,
4275            graphql_client: self.graphql_client.clone(),
4276        }
4277    }
4278    /// Retrieves this container with a previously added Unix socket removed.
4279    ///
4280    /// # Arguments
4281    ///
4282    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4283    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4284    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4285        let mut query = self.selection.select("withoutUnixSocket");
4286        query = query.arg("path", path.into());
4287        Container {
4288            proc: self.proc.clone(),
4289            selection: query,
4290            graphql_client: self.graphql_client.clone(),
4291        }
4292    }
4293    /// Retrieves this container with a previously added Unix socket removed.
4294    ///
4295    /// # Arguments
4296    ///
4297    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4298    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4299    pub fn without_unix_socket_opts(
4300        &self,
4301        path: impl Into<String>,
4302        opts: ContainerWithoutUnixSocketOpts,
4303    ) -> Container {
4304        let mut query = self.selection.select("withoutUnixSocket");
4305        query = query.arg("path", path.into());
4306        if let Some(expand) = opts.expand {
4307            query = query.arg("expand", expand);
4308        }
4309        Container {
4310            proc: self.proc.clone(),
4311            selection: query,
4312            graphql_client: self.graphql_client.clone(),
4313        }
4314    }
4315    /// Retrieves this container with an unset command user.
4316    /// Should default to root.
4317    pub fn without_user(&self) -> Container {
4318        let query = self.selection.select("withoutUser");
4319        Container {
4320            proc: self.proc.clone(),
4321            selection: query,
4322            graphql_client: self.graphql_client.clone(),
4323        }
4324    }
4325    /// Unset the container's working directory.
4326    /// Should default to "/".
4327    pub fn without_workdir(&self) -> Container {
4328        let query = self.selection.select("withoutWorkdir");
4329        Container {
4330            proc: self.proc.clone(),
4331            selection: query,
4332            graphql_client: self.graphql_client.clone(),
4333        }
4334    }
4335    /// Retrieves the working directory for all commands.
4336    pub async fn workdir(&self) -> Result<String, DaggerError> {
4337        let query = self.selection.select("workdir");
4338        query.execute(self.graphql_client.clone()).await
4339    }
4340}
4341#[derive(Clone)]
4342pub struct CurrentModule {
4343    pub proc: Option<Arc<DaggerSessionProc>>,
4344    pub selection: Selection,
4345    pub graphql_client: DynGraphQLClient,
4346}
4347#[derive(Builder, Debug, PartialEq)]
4348pub struct CurrentModuleWorkdirOpts<'a> {
4349    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4350    #[builder(setter(into, strip_option), default)]
4351    pub exclude: Option<Vec<&'a str>>,
4352    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4353    #[builder(setter(into, strip_option), default)]
4354    pub include: Option<Vec<&'a str>>,
4355}
4356impl CurrentModule {
4357    /// A unique identifier for this CurrentModule.
4358    pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
4359        let query = self.selection.select("id");
4360        query.execute(self.graphql_client.clone()).await
4361    }
4362    /// The name of the module being executed in
4363    pub async fn name(&self) -> Result<String, DaggerError> {
4364        let query = self.selection.select("name");
4365        query.execute(self.graphql_client.clone()).await
4366    }
4367    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
4368    pub fn source(&self) -> Directory {
4369        let query = self.selection.select("source");
4370        Directory {
4371            proc: self.proc.clone(),
4372            selection: query,
4373            graphql_client: self.graphql_client.clone(),
4374        }
4375    }
4376    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4377    ///
4378    /// # Arguments
4379    ///
4380    /// * `path` - Location of the directory to access (e.g., ".").
4381    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4382    pub fn workdir(&self, path: impl Into<String>) -> Directory {
4383        let mut query = self.selection.select("workdir");
4384        query = query.arg("path", path.into());
4385        Directory {
4386            proc: self.proc.clone(),
4387            selection: query,
4388            graphql_client: self.graphql_client.clone(),
4389        }
4390    }
4391    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4392    ///
4393    /// # Arguments
4394    ///
4395    /// * `path` - Location of the directory to access (e.g., ".").
4396    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4397    pub fn workdir_opts<'a>(
4398        &self,
4399        path: impl Into<String>,
4400        opts: CurrentModuleWorkdirOpts<'a>,
4401    ) -> Directory {
4402        let mut query = self.selection.select("workdir");
4403        query = query.arg("path", path.into());
4404        if let Some(exclude) = opts.exclude {
4405            query = query.arg("exclude", exclude);
4406        }
4407        if let Some(include) = opts.include {
4408            query = query.arg("include", include);
4409        }
4410        Directory {
4411            proc: self.proc.clone(),
4412            selection: query,
4413            graphql_client: self.graphql_client.clone(),
4414        }
4415    }
4416    /// 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.
4417    ///
4418    /// # Arguments
4419    ///
4420    /// * `path` - Location of the file to retrieve (e.g., "README.md").
4421    pub fn workdir_file(&self, path: impl Into<String>) -> File {
4422        let mut query = self.selection.select("workdirFile");
4423        query = query.arg("path", path.into());
4424        File {
4425            proc: self.proc.clone(),
4426            selection: query,
4427            graphql_client: self.graphql_client.clone(),
4428        }
4429    }
4430}
4431#[derive(Clone)]
4432pub struct Directory {
4433    pub proc: Option<Arc<DaggerSessionProc>>,
4434    pub selection: Selection,
4435    pub graphql_client: DynGraphQLClient,
4436}
4437#[derive(Builder, Debug, PartialEq)]
4438pub struct DirectoryAsModuleOpts<'a> {
4439    /// An optional subpath of the directory which contains the module's configuration file.
4440    /// If not set, the module source code is loaded from the root of the directory.
4441    #[builder(setter(into, strip_option), default)]
4442    pub source_root_path: Option<&'a str>,
4443}
4444#[derive(Builder, Debug, PartialEq)]
4445pub struct DirectoryAsModuleSourceOpts<'a> {
4446    /// An optional subpath of the directory which contains the module's configuration file.
4447    /// If not set, the module source code is loaded from the root of the directory.
4448    #[builder(setter(into, strip_option), default)]
4449    pub source_root_path: Option<&'a str>,
4450}
4451#[derive(Builder, Debug, PartialEq)]
4452pub struct DirectoryDockerBuildOpts<'a> {
4453    /// Build arguments to use in the build.
4454    #[builder(setter(into, strip_option), default)]
4455    pub build_args: Option<Vec<BuildArg>>,
4456    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
4457    #[builder(setter(into, strip_option), default)]
4458    pub dockerfile: Option<&'a str>,
4459    /// If set, skip the automatic init process injected into containers created by RUN statements.
4460    /// 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.
4461    #[builder(setter(into, strip_option), default)]
4462    pub no_init: Option<bool>,
4463    /// The platform to build.
4464    #[builder(setter(into, strip_option), default)]
4465    pub platform: Option<Platform>,
4466    /// Secrets to pass to the build.
4467    /// They will be mounted at /run/secrets/[secret-name].
4468    #[builder(setter(into, strip_option), default)]
4469    pub secrets: Option<Vec<SecretId>>,
4470    /// Target build stage to build.
4471    #[builder(setter(into, strip_option), default)]
4472    pub target: Option<&'a str>,
4473}
4474#[derive(Builder, Debug, PartialEq)]
4475pub struct DirectoryEntriesOpts<'a> {
4476    /// Location of the directory to look at (e.g., "/src").
4477    #[builder(setter(into, strip_option), default)]
4478    pub path: Option<&'a str>,
4479}
4480#[derive(Builder, Debug, PartialEq)]
4481pub struct DirectoryExportOpts {
4482    /// 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.
4483    #[builder(setter(into, strip_option), default)]
4484    pub wipe: Option<bool>,
4485}
4486#[derive(Builder, Debug, PartialEq)]
4487pub struct DirectoryFilterOpts<'a> {
4488    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
4489    #[builder(setter(into, strip_option), default)]
4490    pub exclude: Option<Vec<&'a str>>,
4491    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
4492    #[builder(setter(into, strip_option), default)]
4493    pub include: Option<Vec<&'a str>>,
4494}
4495#[derive(Builder, Debug, PartialEq)]
4496pub struct DirectoryTerminalOpts<'a> {
4497    /// If set, override the container's default terminal command and invoke these command arguments instead.
4498    #[builder(setter(into, strip_option), default)]
4499    pub cmd: Option<Vec<&'a str>>,
4500    /// If set, override the default container used for the terminal.
4501    #[builder(setter(into, strip_option), default)]
4502    pub container: Option<ContainerId>,
4503    /// Provides Dagger access to the executed command.
4504    #[builder(setter(into, strip_option), default)]
4505    pub experimental_privileged_nesting: Option<bool>,
4506    /// 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.
4507    #[builder(setter(into, strip_option), default)]
4508    pub insecure_root_capabilities: Option<bool>,
4509}
4510#[derive(Builder, Debug, PartialEq)]
4511pub struct DirectoryWithDirectoryOpts<'a> {
4512    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4513    #[builder(setter(into, strip_option), default)]
4514    pub exclude: Option<Vec<&'a str>>,
4515    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4516    #[builder(setter(into, strip_option), default)]
4517    pub include: Option<Vec<&'a str>>,
4518}
4519#[derive(Builder, Debug, PartialEq)]
4520pub struct DirectoryWithFileOpts {
4521    /// Permission given to the copied file (e.g., 0600).
4522    #[builder(setter(into, strip_option), default)]
4523    pub permissions: Option<isize>,
4524}
4525#[derive(Builder, Debug, PartialEq)]
4526pub struct DirectoryWithFilesOpts {
4527    /// Permission given to the copied files (e.g., 0600).
4528    #[builder(setter(into, strip_option), default)]
4529    pub permissions: Option<isize>,
4530}
4531#[derive(Builder, Debug, PartialEq)]
4532pub struct DirectoryWithNewDirectoryOpts {
4533    /// Permission granted to the created directory (e.g., 0777).
4534    #[builder(setter(into, strip_option), default)]
4535    pub permissions: Option<isize>,
4536}
4537#[derive(Builder, Debug, PartialEq)]
4538pub struct DirectoryWithNewFileOpts {
4539    /// Permissions of the new file. Example: 0600
4540    #[builder(setter(into, strip_option), default)]
4541    pub permissions: Option<isize>,
4542}
4543impl Directory {
4544    /// Converts this directory to a local git repository
4545    pub fn as_git(&self) -> GitRepository {
4546        let query = self.selection.select("asGit");
4547        GitRepository {
4548            proc: self.proc.clone(),
4549            selection: query,
4550            graphql_client: self.graphql_client.clone(),
4551        }
4552    }
4553    /// Load the directory as a Dagger module source
4554    ///
4555    /// # Arguments
4556    ///
4557    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4558    pub fn as_module(&self) -> Module {
4559        let query = self.selection.select("asModule");
4560        Module {
4561            proc: self.proc.clone(),
4562            selection: query,
4563            graphql_client: self.graphql_client.clone(),
4564        }
4565    }
4566    /// Load the directory as a Dagger module source
4567    ///
4568    /// # Arguments
4569    ///
4570    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4571    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4572        let mut query = self.selection.select("asModule");
4573        if let Some(source_root_path) = opts.source_root_path {
4574            query = query.arg("sourceRootPath", source_root_path);
4575        }
4576        Module {
4577            proc: self.proc.clone(),
4578            selection: query,
4579            graphql_client: self.graphql_client.clone(),
4580        }
4581    }
4582    /// Load the directory as a Dagger module source
4583    ///
4584    /// # Arguments
4585    ///
4586    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4587    pub fn as_module_source(&self) -> ModuleSource {
4588        let query = self.selection.select("asModuleSource");
4589        ModuleSource {
4590            proc: self.proc.clone(),
4591            selection: query,
4592            graphql_client: self.graphql_client.clone(),
4593        }
4594    }
4595    /// Load the directory as a Dagger module source
4596    ///
4597    /// # Arguments
4598    ///
4599    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4600    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4601        let mut query = self.selection.select("asModuleSource");
4602        if let Some(source_root_path) = opts.source_root_path {
4603            query = query.arg("sourceRootPath", source_root_path);
4604        }
4605        ModuleSource {
4606            proc: self.proc.clone(),
4607            selection: query,
4608            graphql_client: self.graphql_client.clone(),
4609        }
4610    }
4611    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
4612    ///
4613    /// # Arguments
4614    ///
4615    /// * `other` - The directory to compare against
4616    pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
4617        let mut query = self.selection.select("diff");
4618        query = query.arg_lazy(
4619            "other",
4620            Box::new(move || {
4621                let other = other.clone();
4622                Box::pin(async move { other.into_id().await.unwrap().quote() })
4623            }),
4624        );
4625        Directory {
4626            proc: self.proc.clone(),
4627            selection: query,
4628            graphql_client: self.graphql_client.clone(),
4629        }
4630    }
4631    /// 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.
4632    pub async fn digest(&self) -> Result<String, DaggerError> {
4633        let query = self.selection.select("digest");
4634        query.execute(self.graphql_client.clone()).await
4635    }
4636    /// Retrieves a directory at the given path.
4637    ///
4638    /// # Arguments
4639    ///
4640    /// * `path` - Location of the directory to retrieve. Example: "/src"
4641    pub fn directory(&self, path: impl Into<String>) -> Directory {
4642        let mut query = self.selection.select("directory");
4643        query = query.arg("path", path.into());
4644        Directory {
4645            proc: self.proc.clone(),
4646            selection: query,
4647            graphql_client: self.graphql_client.clone(),
4648        }
4649    }
4650    /// 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.
4651    ///
4652    /// # Arguments
4653    ///
4654    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4655    pub fn docker_build(&self) -> Container {
4656        let query = self.selection.select("dockerBuild");
4657        Container {
4658            proc: self.proc.clone(),
4659            selection: query,
4660            graphql_client: self.graphql_client.clone(),
4661        }
4662    }
4663    /// 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.
4664    ///
4665    /// # Arguments
4666    ///
4667    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4668    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
4669        let mut query = self.selection.select("dockerBuild");
4670        if let Some(dockerfile) = opts.dockerfile {
4671            query = query.arg("dockerfile", dockerfile);
4672        }
4673        if let Some(platform) = opts.platform {
4674            query = query.arg("platform", platform);
4675        }
4676        if let Some(build_args) = opts.build_args {
4677            query = query.arg("buildArgs", build_args);
4678        }
4679        if let Some(target) = opts.target {
4680            query = query.arg("target", target);
4681        }
4682        if let Some(secrets) = opts.secrets {
4683            query = query.arg("secrets", secrets);
4684        }
4685        if let Some(no_init) = opts.no_init {
4686            query = query.arg("noInit", no_init);
4687        }
4688        Container {
4689            proc: self.proc.clone(),
4690            selection: query,
4691            graphql_client: self.graphql_client.clone(),
4692        }
4693    }
4694    /// Returns a list of files and directories at the given path.
4695    ///
4696    /// # Arguments
4697    ///
4698    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4699    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
4700        let query = self.selection.select("entries");
4701        query.execute(self.graphql_client.clone()).await
4702    }
4703    /// Returns a list of files and directories at the given path.
4704    ///
4705    /// # Arguments
4706    ///
4707    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4708    pub async fn entries_opts<'a>(
4709        &self,
4710        opts: DirectoryEntriesOpts<'a>,
4711    ) -> Result<Vec<String>, DaggerError> {
4712        let mut query = self.selection.select("entries");
4713        if let Some(path) = opts.path {
4714            query = query.arg("path", path);
4715        }
4716        query.execute(self.graphql_client.clone()).await
4717    }
4718    /// Writes the contents of the directory to a path on the host.
4719    ///
4720    /// # Arguments
4721    ///
4722    /// * `path` - Location of the copied directory (e.g., "logs/").
4723    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4724    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4725        let mut query = self.selection.select("export");
4726        query = query.arg("path", path.into());
4727        query.execute(self.graphql_client.clone()).await
4728    }
4729    /// Writes the contents of the directory to a path on the host.
4730    ///
4731    /// # Arguments
4732    ///
4733    /// * `path` - Location of the copied directory (e.g., "logs/").
4734    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4735    pub async fn export_opts(
4736        &self,
4737        path: impl Into<String>,
4738        opts: DirectoryExportOpts,
4739    ) -> Result<String, DaggerError> {
4740        let mut query = self.selection.select("export");
4741        query = query.arg("path", path.into());
4742        if let Some(wipe) = opts.wipe {
4743            query = query.arg("wipe", wipe);
4744        }
4745        query.execute(self.graphql_client.clone()).await
4746    }
4747    /// Retrieve a file at the given path.
4748    ///
4749    /// # Arguments
4750    ///
4751    /// * `path` - Location of the file to retrieve (e.g., "README.md").
4752    pub fn file(&self, path: impl Into<String>) -> File {
4753        let mut query = self.selection.select("file");
4754        query = query.arg("path", path.into());
4755        File {
4756            proc: self.proc.clone(),
4757            selection: query,
4758            graphql_client: self.graphql_client.clone(),
4759        }
4760    }
4761    /// Return a snapshot with some paths included or excluded
4762    ///
4763    /// # Arguments
4764    ///
4765    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4766    pub fn filter(&self) -> Directory {
4767        let query = self.selection.select("filter");
4768        Directory {
4769            proc: self.proc.clone(),
4770            selection: query,
4771            graphql_client: self.graphql_client.clone(),
4772        }
4773    }
4774    /// Return a snapshot with some paths included or excluded
4775    ///
4776    /// # Arguments
4777    ///
4778    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4779    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
4780        let mut query = self.selection.select("filter");
4781        if let Some(exclude) = opts.exclude {
4782            query = query.arg("exclude", exclude);
4783        }
4784        if let Some(include) = opts.include {
4785            query = query.arg("include", include);
4786        }
4787        Directory {
4788            proc: self.proc.clone(),
4789            selection: query,
4790            graphql_client: self.graphql_client.clone(),
4791        }
4792    }
4793    /// Returns a list of files and directories that matche the given pattern.
4794    ///
4795    /// # Arguments
4796    ///
4797    /// * `pattern` - Pattern to match (e.g., "*.md").
4798    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
4799        let mut query = self.selection.select("glob");
4800        query = query.arg("pattern", pattern.into());
4801        query.execute(self.graphql_client.clone()).await
4802    }
4803    /// A unique identifier for this Directory.
4804    pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
4805        let query = self.selection.select("id");
4806        query.execute(self.graphql_client.clone()).await
4807    }
4808    /// Returns the name of the directory.
4809    pub async fn name(&self) -> Result<String, DaggerError> {
4810        let query = self.selection.select("name");
4811        query.execute(self.graphql_client.clone()).await
4812    }
4813    /// Force evaluation in the engine.
4814    pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
4815        let query = self.selection.select("sync");
4816        query.execute(self.graphql_client.clone()).await
4817    }
4818    /// Opens an interactive terminal in new container with this directory mounted inside.
4819    ///
4820    /// # Arguments
4821    ///
4822    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4823    pub fn terminal(&self) -> Directory {
4824        let query = self.selection.select("terminal");
4825        Directory {
4826            proc: self.proc.clone(),
4827            selection: query,
4828            graphql_client: self.graphql_client.clone(),
4829        }
4830    }
4831    /// Opens an interactive terminal in new container with this directory mounted inside.
4832    ///
4833    /// # Arguments
4834    ///
4835    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4836    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
4837        let mut query = self.selection.select("terminal");
4838        if let Some(container) = opts.container {
4839            query = query.arg("container", container);
4840        }
4841        if let Some(cmd) = opts.cmd {
4842            query = query.arg("cmd", cmd);
4843        }
4844        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4845            query = query.arg(
4846                "experimentalPrivilegedNesting",
4847                experimental_privileged_nesting,
4848            );
4849        }
4850        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4851            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4852        }
4853        Directory {
4854            proc: self.proc.clone(),
4855            selection: query,
4856            graphql_client: self.graphql_client.clone(),
4857        }
4858    }
4859    /// Return a snapshot with a directory added
4860    ///
4861    /// # Arguments
4862    ///
4863    /// * `path` - Location of the written directory (e.g., "/src/").
4864    /// * `directory` - Identifier of the directory to copy.
4865    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4866    pub fn with_directory(
4867        &self,
4868        path: impl Into<String>,
4869        directory: impl IntoID<DirectoryId>,
4870    ) -> Directory {
4871        let mut query = self.selection.select("withDirectory");
4872        query = query.arg("path", path.into());
4873        query = query.arg_lazy(
4874            "directory",
4875            Box::new(move || {
4876                let directory = directory.clone();
4877                Box::pin(async move { directory.into_id().await.unwrap().quote() })
4878            }),
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 directory added
4887    ///
4888    /// # Arguments
4889    ///
4890    /// * `path` - Location of the written directory (e.g., "/src/").
4891    /// * `directory` - Identifier of the directory to copy.
4892    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4893    pub fn with_directory_opts<'a>(
4894        &self,
4895        path: impl Into<String>,
4896        directory: impl IntoID<DirectoryId>,
4897        opts: DirectoryWithDirectoryOpts<'a>,
4898    ) -> Directory {
4899        let mut query = self.selection.select("withDirectory");
4900        query = query.arg("path", path.into());
4901        query = query.arg_lazy(
4902            "directory",
4903            Box::new(move || {
4904                let directory = directory.clone();
4905                Box::pin(async move { directory.into_id().await.unwrap().quote() })
4906            }),
4907        );
4908        if let Some(exclude) = opts.exclude {
4909            query = query.arg("exclude", exclude);
4910        }
4911        if let Some(include) = opts.include {
4912            query = query.arg("include", include);
4913        }
4914        Directory {
4915            proc: self.proc.clone(),
4916            selection: query,
4917            graphql_client: self.graphql_client.clone(),
4918        }
4919    }
4920    /// Retrieves this directory plus the contents of the given file copied to the given path.
4921    ///
4922    /// # Arguments
4923    ///
4924    /// * `path` - Location of the copied file (e.g., "/file.txt").
4925    /// * `source` - Identifier of the file to copy.
4926    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4927    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
4928        let mut query = self.selection.select("withFile");
4929        query = query.arg("path", path.into());
4930        query = query.arg_lazy(
4931            "source",
4932            Box::new(move || {
4933                let source = source.clone();
4934                Box::pin(async move { source.into_id().await.unwrap().quote() })
4935            }),
4936        );
4937        Directory {
4938            proc: self.proc.clone(),
4939            selection: query,
4940            graphql_client: self.graphql_client.clone(),
4941        }
4942    }
4943    /// Retrieves this directory plus the contents of the given file copied to the given path.
4944    ///
4945    /// # Arguments
4946    ///
4947    /// * `path` - Location of the copied file (e.g., "/file.txt").
4948    /// * `source` - Identifier of the file to copy.
4949    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4950    pub fn with_file_opts(
4951        &self,
4952        path: impl Into<String>,
4953        source: impl IntoID<FileId>,
4954        opts: DirectoryWithFileOpts,
4955    ) -> Directory {
4956        let mut query = self.selection.select("withFile");
4957        query = query.arg("path", path.into());
4958        query = query.arg_lazy(
4959            "source",
4960            Box::new(move || {
4961                let source = source.clone();
4962                Box::pin(async move { source.into_id().await.unwrap().quote() })
4963            }),
4964        );
4965        if let Some(permissions) = opts.permissions {
4966            query = query.arg("permissions", permissions);
4967        }
4968        Directory {
4969            proc: self.proc.clone(),
4970            selection: query,
4971            graphql_client: self.graphql_client.clone(),
4972        }
4973    }
4974    /// Retrieves this directory plus the contents of the given files copied to the given path.
4975    ///
4976    /// # Arguments
4977    ///
4978    /// * `path` - Location where copied files should be placed (e.g., "/src").
4979    /// * `sources` - Identifiers of the files to copy.
4980    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4981    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
4982        let mut query = self.selection.select("withFiles");
4983        query = query.arg("path", path.into());
4984        query = query.arg("sources", sources);
4985        Directory {
4986            proc: self.proc.clone(),
4987            selection: query,
4988            graphql_client: self.graphql_client.clone(),
4989        }
4990    }
4991    /// Retrieves this directory plus the contents of the given files copied to the given path.
4992    ///
4993    /// # Arguments
4994    ///
4995    /// * `path` - Location where copied files should be placed (e.g., "/src").
4996    /// * `sources` - Identifiers of the files to copy.
4997    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4998    pub fn with_files_opts(
4999        &self,
5000        path: impl Into<String>,
5001        sources: Vec<FileId>,
5002        opts: DirectoryWithFilesOpts,
5003    ) -> Directory {
5004        let mut query = self.selection.select("withFiles");
5005        query = query.arg("path", path.into());
5006        query = query.arg("sources", sources);
5007        if let Some(permissions) = opts.permissions {
5008            query = query.arg("permissions", permissions);
5009        }
5010        Directory {
5011            proc: self.proc.clone(),
5012            selection: query,
5013            graphql_client: self.graphql_client.clone(),
5014        }
5015    }
5016    /// Retrieves this directory plus a new directory created at the given path.
5017    ///
5018    /// # Arguments
5019    ///
5020    /// * `path` - Location of the directory created (e.g., "/logs").
5021    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5022    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5023        let mut query = self.selection.select("withNewDirectory");
5024        query = query.arg("path", path.into());
5025        Directory {
5026            proc: self.proc.clone(),
5027            selection: query,
5028            graphql_client: self.graphql_client.clone(),
5029        }
5030    }
5031    /// Retrieves this directory plus a new directory created at the given path.
5032    ///
5033    /// # Arguments
5034    ///
5035    /// * `path` - Location of the directory created (e.g., "/logs").
5036    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5037    pub fn with_new_directory_opts(
5038        &self,
5039        path: impl Into<String>,
5040        opts: DirectoryWithNewDirectoryOpts,
5041    ) -> Directory {
5042        let mut query = self.selection.select("withNewDirectory");
5043        query = query.arg("path", path.into());
5044        if let Some(permissions) = opts.permissions {
5045            query = query.arg("permissions", permissions);
5046        }
5047        Directory {
5048            proc: self.proc.clone(),
5049            selection: query,
5050            graphql_client: self.graphql_client.clone(),
5051        }
5052    }
5053    /// Return a snapshot with a new file added
5054    ///
5055    /// # Arguments
5056    ///
5057    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5058    /// * `contents` - Contents of the new file. Example: "Hello world!"
5059    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5060    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5061        let mut query = self.selection.select("withNewFile");
5062        query = query.arg("path", path.into());
5063        query = query.arg("contents", contents.into());
5064        Directory {
5065            proc: self.proc.clone(),
5066            selection: query,
5067            graphql_client: self.graphql_client.clone(),
5068        }
5069    }
5070    /// Return a snapshot with a new file added
5071    ///
5072    /// # Arguments
5073    ///
5074    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5075    /// * `contents` - Contents of the new file. Example: "Hello world!"
5076    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5077    pub fn with_new_file_opts(
5078        &self,
5079        path: impl Into<String>,
5080        contents: impl Into<String>,
5081        opts: DirectoryWithNewFileOpts,
5082    ) -> Directory {
5083        let mut query = self.selection.select("withNewFile");
5084        query = query.arg("path", path.into());
5085        query = query.arg("contents", contents.into());
5086        if let Some(permissions) = opts.permissions {
5087            query = query.arg("permissions", permissions);
5088        }
5089        Directory {
5090            proc: self.proc.clone(),
5091            selection: query,
5092            graphql_client: self.graphql_client.clone(),
5093        }
5094    }
5095    /// Retrieves this directory with the given Git-compatible patch applied.
5096    ///
5097    /// # Arguments
5098    ///
5099    /// * `patch` - Patch to apply (e.g., "diff --git a/file.txt b/file.txt\nindex 1234567..abcdef8 100644\n--- a/file.txt\n+++ b/file.txt\n@@ -1,1 +1,1 @@\n-Hello\n+World\n").
5100    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5101        let mut query = self.selection.select("withPatch");
5102        query = query.arg("patch", patch.into());
5103        Directory {
5104            proc: self.proc.clone(),
5105            selection: query,
5106            graphql_client: self.graphql_client.clone(),
5107        }
5108    }
5109    /// Return a snapshot with a symlink
5110    ///
5111    /// # Arguments
5112    ///
5113    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5114    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5115    pub fn with_symlink(
5116        &self,
5117        target: impl Into<String>,
5118        link_name: impl Into<String>,
5119    ) -> Directory {
5120        let mut query = self.selection.select("withSymlink");
5121        query = query.arg("target", target.into());
5122        query = query.arg("linkName", link_name.into());
5123        Directory {
5124            proc: self.proc.clone(),
5125            selection: query,
5126            graphql_client: self.graphql_client.clone(),
5127        }
5128    }
5129    /// Retrieves this directory with all file/dir timestamps set to the given time.
5130    ///
5131    /// # Arguments
5132    ///
5133    /// * `timestamp` - Timestamp to set dir/files in.
5134    ///
5135    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
5136    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5137        let mut query = self.selection.select("withTimestamps");
5138        query = query.arg("timestamp", timestamp);
5139        Directory {
5140            proc: self.proc.clone(),
5141            selection: query,
5142            graphql_client: self.graphql_client.clone(),
5143        }
5144    }
5145    /// Return a snapshot with a subdirectory removed
5146    ///
5147    /// # Arguments
5148    ///
5149    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
5150    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5151        let mut query = self.selection.select("withoutDirectory");
5152        query = query.arg("path", path.into());
5153        Directory {
5154            proc: self.proc.clone(),
5155            selection: query,
5156            graphql_client: self.graphql_client.clone(),
5157        }
5158    }
5159    /// Return a snapshot with a file removed
5160    ///
5161    /// # Arguments
5162    ///
5163    /// * `path` - Path of the file to remove (e.g., "/file.txt").
5164    pub fn without_file(&self, path: impl Into<String>) -> Directory {
5165        let mut query = self.selection.select("withoutFile");
5166        query = query.arg("path", path.into());
5167        Directory {
5168            proc: self.proc.clone(),
5169            selection: query,
5170            graphql_client: self.graphql_client.clone(),
5171        }
5172    }
5173    /// Return a snapshot with files removed
5174    ///
5175    /// # Arguments
5176    ///
5177    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
5178    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5179        let mut query = self.selection.select("withoutFiles");
5180        query = query.arg(
5181            "paths",
5182            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5183        );
5184        Directory {
5185            proc: self.proc.clone(),
5186            selection: query,
5187            graphql_client: self.graphql_client.clone(),
5188        }
5189    }
5190}
5191#[derive(Clone)]
5192pub struct Engine {
5193    pub proc: Option<Arc<DaggerSessionProc>>,
5194    pub selection: Selection,
5195    pub graphql_client: DynGraphQLClient,
5196}
5197impl Engine {
5198    /// A unique identifier for this Engine.
5199    pub async fn id(&self) -> Result<EngineId, DaggerError> {
5200        let query = self.selection.select("id");
5201        query.execute(self.graphql_client.clone()).await
5202    }
5203    /// The local (on-disk) cache for the Dagger engine
5204    pub fn local_cache(&self) -> EngineCache {
5205        let query = self.selection.select("localCache");
5206        EngineCache {
5207            proc: self.proc.clone(),
5208            selection: query,
5209            graphql_client: self.graphql_client.clone(),
5210        }
5211    }
5212}
5213#[derive(Clone)]
5214pub struct EngineCache {
5215    pub proc: Option<Arc<DaggerSessionProc>>,
5216    pub selection: Selection,
5217    pub graphql_client: DynGraphQLClient,
5218}
5219#[derive(Builder, Debug, PartialEq)]
5220pub struct EngineCacheEntrySetOpts<'a> {
5221    #[builder(setter(into, strip_option), default)]
5222    pub key: Option<&'a str>,
5223}
5224#[derive(Builder, Debug, PartialEq)]
5225pub struct EngineCachePruneOpts {
5226    /// Use the engine-wide default pruning policy if true, otherwise prune the whole cache of any releasable entries.
5227    #[builder(setter(into, strip_option), default)]
5228    pub use_default_policy: Option<bool>,
5229}
5230impl EngineCache {
5231    /// The current set of entries in the cache
5232    ///
5233    /// # Arguments
5234    ///
5235    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5236    pub fn entry_set(&self) -> EngineCacheEntrySet {
5237        let query = self.selection.select("entrySet");
5238        EngineCacheEntrySet {
5239            proc: self.proc.clone(),
5240            selection: query,
5241            graphql_client: self.graphql_client.clone(),
5242        }
5243    }
5244    /// The current set of entries in the cache
5245    ///
5246    /// # Arguments
5247    ///
5248    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5249    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5250        let mut query = self.selection.select("entrySet");
5251        if let Some(key) = opts.key {
5252            query = query.arg("key", key);
5253        }
5254        EngineCacheEntrySet {
5255            proc: self.proc.clone(),
5256            selection: query,
5257            graphql_client: self.graphql_client.clone(),
5258        }
5259    }
5260    /// A unique identifier for this EngineCache.
5261    pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
5262        let query = self.selection.select("id");
5263        query.execute(self.graphql_client.clone()).await
5264    }
5265    /// The maximum bytes to keep in the cache without pruning, after which automatic pruning may kick in.
5266    pub async fn keep_bytes(&self) -> Result<isize, DaggerError> {
5267        let query = self.selection.select("keepBytes");
5268        query.execute(self.graphql_client.clone()).await
5269    }
5270    /// The maximum bytes to keep in the cache without pruning.
5271    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5272        let query = self.selection.select("maxUsedSpace");
5273        query.execute(self.graphql_client.clone()).await
5274    }
5275    /// The target amount of free disk space the garbage collector will attempt to leave.
5276    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5277        let query = self.selection.select("minFreeSpace");
5278        query.execute(self.graphql_client.clone()).await
5279    }
5280    /// Prune the cache of releaseable entries
5281    ///
5282    /// # Arguments
5283    ///
5284    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5285    pub async fn prune(&self) -> Result<Void, DaggerError> {
5286        let query = self.selection.select("prune");
5287        query.execute(self.graphql_client.clone()).await
5288    }
5289    /// Prune the cache of releaseable entries
5290    ///
5291    /// # Arguments
5292    ///
5293    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5294    pub async fn prune_opts(&self, opts: EngineCachePruneOpts) -> Result<Void, DaggerError> {
5295        let mut query = self.selection.select("prune");
5296        if let Some(use_default_policy) = opts.use_default_policy {
5297            query = query.arg("useDefaultPolicy", use_default_policy);
5298        }
5299        query.execute(self.graphql_client.clone()).await
5300    }
5301    /// The minimum amount of disk space this policy is guaranteed to retain.
5302    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
5303        let query = self.selection.select("reservedSpace");
5304        query.execute(self.graphql_client.clone()).await
5305    }
5306    /// The target number of bytes to keep when pruning.
5307    pub async fn target_space(&self) -> Result<isize, DaggerError> {
5308        let query = self.selection.select("targetSpace");
5309        query.execute(self.graphql_client.clone()).await
5310    }
5311}
5312#[derive(Clone)]
5313pub struct EngineCacheEntry {
5314    pub proc: Option<Arc<DaggerSessionProc>>,
5315    pub selection: Selection,
5316    pub graphql_client: DynGraphQLClient,
5317}
5318impl EngineCacheEntry {
5319    /// Whether the cache entry is actively being used.
5320    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
5321        let query = self.selection.select("activelyUsed");
5322        query.execute(self.graphql_client.clone()).await
5323    }
5324    /// The time the cache entry was created, in Unix nanoseconds.
5325    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
5326        let query = self.selection.select("createdTimeUnixNano");
5327        query.execute(self.graphql_client.clone()).await
5328    }
5329    /// The description of the cache entry.
5330    pub async fn description(&self) -> Result<String, DaggerError> {
5331        let query = self.selection.select("description");
5332        query.execute(self.graphql_client.clone()).await
5333    }
5334    /// The disk space used by the cache entry.
5335    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5336        let query = self.selection.select("diskSpaceBytes");
5337        query.execute(self.graphql_client.clone()).await
5338    }
5339    /// A unique identifier for this EngineCacheEntry.
5340    pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
5341        let query = self.selection.select("id");
5342        query.execute(self.graphql_client.clone()).await
5343    }
5344    /// The most recent time the cache entry was used, in Unix nanoseconds.
5345    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
5346        let query = self.selection.select("mostRecentUseTimeUnixNano");
5347        query.execute(self.graphql_client.clone()).await
5348    }
5349}
5350#[derive(Clone)]
5351pub struct EngineCacheEntrySet {
5352    pub proc: Option<Arc<DaggerSessionProc>>,
5353    pub selection: Selection,
5354    pub graphql_client: DynGraphQLClient,
5355}
5356impl EngineCacheEntrySet {
5357    /// The total disk space used by the cache entries in this set.
5358    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5359        let query = self.selection.select("diskSpaceBytes");
5360        query.execute(self.graphql_client.clone()).await
5361    }
5362    /// The list of individual cache entries in the set
5363    pub fn entries(&self) -> Vec<EngineCacheEntry> {
5364        let query = self.selection.select("entries");
5365        vec![EngineCacheEntry {
5366            proc: self.proc.clone(),
5367            selection: query,
5368            graphql_client: self.graphql_client.clone(),
5369        }]
5370    }
5371    /// The number of cache entries in this set.
5372    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
5373        let query = self.selection.select("entryCount");
5374        query.execute(self.graphql_client.clone()).await
5375    }
5376    /// A unique identifier for this EngineCacheEntrySet.
5377    pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
5378        let query = self.selection.select("id");
5379        query.execute(self.graphql_client.clone()).await
5380    }
5381}
5382#[derive(Clone)]
5383pub struct EnumTypeDef {
5384    pub proc: Option<Arc<DaggerSessionProc>>,
5385    pub selection: Selection,
5386    pub graphql_client: DynGraphQLClient,
5387}
5388impl EnumTypeDef {
5389    /// A doc string for the enum, if any.
5390    pub async fn description(&self) -> Result<String, DaggerError> {
5391        let query = self.selection.select("description");
5392        query.execute(self.graphql_client.clone()).await
5393    }
5394    /// A unique identifier for this EnumTypeDef.
5395    pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
5396        let query = self.selection.select("id");
5397        query.execute(self.graphql_client.clone()).await
5398    }
5399    /// The members of the enum.
5400    pub fn members(&self) -> Vec<EnumValueTypeDef> {
5401        let query = self.selection.select("members");
5402        vec![EnumValueTypeDef {
5403            proc: self.proc.clone(),
5404            selection: query,
5405            graphql_client: self.graphql_client.clone(),
5406        }]
5407    }
5408    /// The name of the enum.
5409    pub async fn name(&self) -> Result<String, DaggerError> {
5410        let query = self.selection.select("name");
5411        query.execute(self.graphql_client.clone()).await
5412    }
5413    /// The location of this enum declaration.
5414    pub fn source_map(&self) -> SourceMap {
5415        let query = self.selection.select("sourceMap");
5416        SourceMap {
5417            proc: self.proc.clone(),
5418            selection: query,
5419            graphql_client: self.graphql_client.clone(),
5420        }
5421    }
5422    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
5423    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
5424        let query = self.selection.select("sourceModuleName");
5425        query.execute(self.graphql_client.clone()).await
5426    }
5427    pub fn values(&self) -> Vec<EnumValueTypeDef> {
5428        let query = self.selection.select("values");
5429        vec![EnumValueTypeDef {
5430            proc: self.proc.clone(),
5431            selection: query,
5432            graphql_client: self.graphql_client.clone(),
5433        }]
5434    }
5435}
5436#[derive(Clone)]
5437pub struct EnumValueTypeDef {
5438    pub proc: Option<Arc<DaggerSessionProc>>,
5439    pub selection: Selection,
5440    pub graphql_client: DynGraphQLClient,
5441}
5442impl EnumValueTypeDef {
5443    /// A doc string for the enum member, if any.
5444    pub async fn description(&self) -> Result<String, DaggerError> {
5445        let query = self.selection.select("description");
5446        query.execute(self.graphql_client.clone()).await
5447    }
5448    /// A unique identifier for this EnumValueTypeDef.
5449    pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
5450        let query = self.selection.select("id");
5451        query.execute(self.graphql_client.clone()).await
5452    }
5453    /// The name of the enum member.
5454    pub async fn name(&self) -> Result<String, DaggerError> {
5455        let query = self.selection.select("name");
5456        query.execute(self.graphql_client.clone()).await
5457    }
5458    /// The location of this enum member declaration.
5459    pub fn source_map(&self) -> SourceMap {
5460        let query = self.selection.select("sourceMap");
5461        SourceMap {
5462            proc: self.proc.clone(),
5463            selection: query,
5464            graphql_client: self.graphql_client.clone(),
5465        }
5466    }
5467    /// The value of the enum member
5468    pub async fn value(&self) -> Result<String, DaggerError> {
5469        let query = self.selection.select("value");
5470        query.execute(self.graphql_client.clone()).await
5471    }
5472}
5473#[derive(Clone)]
5474pub struct Env {
5475    pub proc: Option<Arc<DaggerSessionProc>>,
5476    pub selection: Selection,
5477    pub graphql_client: DynGraphQLClient,
5478}
5479impl Env {
5480    /// A unique identifier for this Env.
5481    pub async fn id(&self) -> Result<EnvId, DaggerError> {
5482        let query = self.selection.select("id");
5483        query.execute(self.graphql_client.clone()).await
5484    }
5485    /// retrieve an input value by name
5486    pub fn input(&self, name: impl Into<String>) -> Binding {
5487        let mut query = self.selection.select("input");
5488        query = query.arg("name", name.into());
5489        Binding {
5490            proc: self.proc.clone(),
5491            selection: query,
5492            graphql_client: self.graphql_client.clone(),
5493        }
5494    }
5495    /// return all input values for the environment
5496    pub fn inputs(&self) -> Vec<Binding> {
5497        let query = self.selection.select("inputs");
5498        vec![Binding {
5499            proc: self.proc.clone(),
5500            selection: query,
5501            graphql_client: self.graphql_client.clone(),
5502        }]
5503    }
5504    /// retrieve an output value by name
5505    pub fn output(&self, name: impl Into<String>) -> Binding {
5506        let mut query = self.selection.select("output");
5507        query = query.arg("name", name.into());
5508        Binding {
5509            proc: self.proc.clone(),
5510            selection: query,
5511            graphql_client: self.graphql_client.clone(),
5512        }
5513    }
5514    /// return all output values for the environment
5515    pub fn outputs(&self) -> Vec<Binding> {
5516        let query = self.selection.select("outputs");
5517        vec![Binding {
5518            proc: self.proc.clone(),
5519            selection: query,
5520            graphql_client: self.graphql_client.clone(),
5521        }]
5522    }
5523    /// Create or update a binding of type CacheVolume in the environment
5524    ///
5525    /// # Arguments
5526    ///
5527    /// * `name` - The name of the binding
5528    /// * `value` - The CacheVolume value to assign to the binding
5529    /// * `description` - The purpose of the input
5530    pub fn with_cache_volume_input(
5531        &self,
5532        name: impl Into<String>,
5533        value: impl IntoID<CacheVolumeId>,
5534        description: impl Into<String>,
5535    ) -> Env {
5536        let mut query = self.selection.select("withCacheVolumeInput");
5537        query = query.arg("name", name.into());
5538        query = query.arg_lazy(
5539            "value",
5540            Box::new(move || {
5541                let value = value.clone();
5542                Box::pin(async move { value.into_id().await.unwrap().quote() })
5543            }),
5544        );
5545        query = query.arg("description", description.into());
5546        Env {
5547            proc: self.proc.clone(),
5548            selection: query,
5549            graphql_client: self.graphql_client.clone(),
5550        }
5551    }
5552    /// Declare a desired CacheVolume output to be assigned in the environment
5553    ///
5554    /// # Arguments
5555    ///
5556    /// * `name` - The name of the binding
5557    /// * `description` - A description of the desired value of the binding
5558    pub fn with_cache_volume_output(
5559        &self,
5560        name: impl Into<String>,
5561        description: impl Into<String>,
5562    ) -> Env {
5563        let mut query = self.selection.select("withCacheVolumeOutput");
5564        query = query.arg("name", name.into());
5565        query = query.arg("description", description.into());
5566        Env {
5567            proc: self.proc.clone(),
5568            selection: query,
5569            graphql_client: self.graphql_client.clone(),
5570        }
5571    }
5572    /// Create or update a binding of type Cloud in the environment
5573    ///
5574    /// # Arguments
5575    ///
5576    /// * `name` - The name of the binding
5577    /// * `value` - The Cloud value to assign to the binding
5578    /// * `description` - The purpose of the input
5579    pub fn with_cloud_input(
5580        &self,
5581        name: impl Into<String>,
5582        value: impl IntoID<CloudId>,
5583        description: impl Into<String>,
5584    ) -> Env {
5585        let mut query = self.selection.select("withCloudInput");
5586        query = query.arg("name", name.into());
5587        query = query.arg_lazy(
5588            "value",
5589            Box::new(move || {
5590                let value = value.clone();
5591                Box::pin(async move { value.into_id().await.unwrap().quote() })
5592            }),
5593        );
5594        query = query.arg("description", description.into());
5595        Env {
5596            proc: self.proc.clone(),
5597            selection: query,
5598            graphql_client: self.graphql_client.clone(),
5599        }
5600    }
5601    /// Declare a desired Cloud output to be assigned in the environment
5602    ///
5603    /// # Arguments
5604    ///
5605    /// * `name` - The name of the binding
5606    /// * `description` - A description of the desired value of the binding
5607    pub fn with_cloud_output(
5608        &self,
5609        name: impl Into<String>,
5610        description: impl Into<String>,
5611    ) -> Env {
5612        let mut query = self.selection.select("withCloudOutput");
5613        query = query.arg("name", name.into());
5614        query = query.arg("description", description.into());
5615        Env {
5616            proc: self.proc.clone(),
5617            selection: query,
5618            graphql_client: self.graphql_client.clone(),
5619        }
5620    }
5621    /// Create or update a binding of type Container in the environment
5622    ///
5623    /// # Arguments
5624    ///
5625    /// * `name` - The name of the binding
5626    /// * `value` - The Container value to assign to the binding
5627    /// * `description` - The purpose of the input
5628    pub fn with_container_input(
5629        &self,
5630        name: impl Into<String>,
5631        value: impl IntoID<ContainerId>,
5632        description: impl Into<String>,
5633    ) -> Env {
5634        let mut query = self.selection.select("withContainerInput");
5635        query = query.arg("name", name.into());
5636        query = query.arg_lazy(
5637            "value",
5638            Box::new(move || {
5639                let value = value.clone();
5640                Box::pin(async move { value.into_id().await.unwrap().quote() })
5641            }),
5642        );
5643        query = query.arg("description", description.into());
5644        Env {
5645            proc: self.proc.clone(),
5646            selection: query,
5647            graphql_client: self.graphql_client.clone(),
5648        }
5649    }
5650    /// Declare a desired Container output to be assigned in the environment
5651    ///
5652    /// # Arguments
5653    ///
5654    /// * `name` - The name of the binding
5655    /// * `description` - A description of the desired value of the binding
5656    pub fn with_container_output(
5657        &self,
5658        name: impl Into<String>,
5659        description: impl Into<String>,
5660    ) -> Env {
5661        let mut query = self.selection.select("withContainerOutput");
5662        query = query.arg("name", name.into());
5663        query = query.arg("description", description.into());
5664        Env {
5665            proc: self.proc.clone(),
5666            selection: query,
5667            graphql_client: self.graphql_client.clone(),
5668        }
5669    }
5670    /// Create or update a binding of type Directory in the environment
5671    ///
5672    /// # Arguments
5673    ///
5674    /// * `name` - The name of the binding
5675    /// * `value` - The Directory value to assign to the binding
5676    /// * `description` - The purpose of the input
5677    pub fn with_directory_input(
5678        &self,
5679        name: impl Into<String>,
5680        value: impl IntoID<DirectoryId>,
5681        description: impl Into<String>,
5682    ) -> Env {
5683        let mut query = self.selection.select("withDirectoryInput");
5684        query = query.arg("name", name.into());
5685        query = query.arg_lazy(
5686            "value",
5687            Box::new(move || {
5688                let value = value.clone();
5689                Box::pin(async move { value.into_id().await.unwrap().quote() })
5690            }),
5691        );
5692        query = query.arg("description", description.into());
5693        Env {
5694            proc: self.proc.clone(),
5695            selection: query,
5696            graphql_client: self.graphql_client.clone(),
5697        }
5698    }
5699    /// Declare a desired Directory output to be assigned in the environment
5700    ///
5701    /// # Arguments
5702    ///
5703    /// * `name` - The name of the binding
5704    /// * `description` - A description of the desired value of the binding
5705    pub fn with_directory_output(
5706        &self,
5707        name: impl Into<String>,
5708        description: impl Into<String>,
5709    ) -> Env {
5710        let mut query = self.selection.select("withDirectoryOutput");
5711        query = query.arg("name", name.into());
5712        query = query.arg("description", description.into());
5713        Env {
5714            proc: self.proc.clone(),
5715            selection: query,
5716            graphql_client: self.graphql_client.clone(),
5717        }
5718    }
5719    /// Create or update a binding of type Env in the environment
5720    ///
5721    /// # Arguments
5722    ///
5723    /// * `name` - The name of the binding
5724    /// * `value` - The Env value to assign to the binding
5725    /// * `description` - The purpose of the input
5726    pub fn with_env_input(
5727        &self,
5728        name: impl Into<String>,
5729        value: impl IntoID<EnvId>,
5730        description: impl Into<String>,
5731    ) -> Env {
5732        let mut query = self.selection.select("withEnvInput");
5733        query = query.arg("name", name.into());
5734        query = query.arg_lazy(
5735            "value",
5736            Box::new(move || {
5737                let value = value.clone();
5738                Box::pin(async move { value.into_id().await.unwrap().quote() })
5739            }),
5740        );
5741        query = query.arg("description", description.into());
5742        Env {
5743            proc: self.proc.clone(),
5744            selection: query,
5745            graphql_client: self.graphql_client.clone(),
5746        }
5747    }
5748    /// Declare a desired Env output to be assigned in the environment
5749    ///
5750    /// # Arguments
5751    ///
5752    /// * `name` - The name of the binding
5753    /// * `description` - A description of the desired value of the binding
5754    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
5755        let mut query = self.selection.select("withEnvOutput");
5756        query = query.arg("name", name.into());
5757        query = query.arg("description", description.into());
5758        Env {
5759            proc: self.proc.clone(),
5760            selection: query,
5761            graphql_client: self.graphql_client.clone(),
5762        }
5763    }
5764    /// Create or update a binding of type File in the environment
5765    ///
5766    /// # Arguments
5767    ///
5768    /// * `name` - The name of the binding
5769    /// * `value` - The File value to assign to the binding
5770    /// * `description` - The purpose of the input
5771    pub fn with_file_input(
5772        &self,
5773        name: impl Into<String>,
5774        value: impl IntoID<FileId>,
5775        description: impl Into<String>,
5776    ) -> Env {
5777        let mut query = self.selection.select("withFileInput");
5778        query = query.arg("name", name.into());
5779        query = query.arg_lazy(
5780            "value",
5781            Box::new(move || {
5782                let value = value.clone();
5783                Box::pin(async move { value.into_id().await.unwrap().quote() })
5784            }),
5785        );
5786        query = query.arg("description", description.into());
5787        Env {
5788            proc: self.proc.clone(),
5789            selection: query,
5790            graphql_client: self.graphql_client.clone(),
5791        }
5792    }
5793    /// Declare a desired File output to be assigned in the environment
5794    ///
5795    /// # Arguments
5796    ///
5797    /// * `name` - The name of the binding
5798    /// * `description` - A description of the desired value of the binding
5799    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
5800        let mut query = self.selection.select("withFileOutput");
5801        query = query.arg("name", name.into());
5802        query = query.arg("description", description.into());
5803        Env {
5804            proc: self.proc.clone(),
5805            selection: query,
5806            graphql_client: self.graphql_client.clone(),
5807        }
5808    }
5809    /// Create or update a binding of type GitRef in the environment
5810    ///
5811    /// # Arguments
5812    ///
5813    /// * `name` - The name of the binding
5814    /// * `value` - The GitRef value to assign to the binding
5815    /// * `description` - The purpose of the input
5816    pub fn with_git_ref_input(
5817        &self,
5818        name: impl Into<String>,
5819        value: impl IntoID<GitRefId>,
5820        description: impl Into<String>,
5821    ) -> Env {
5822        let mut query = self.selection.select("withGitRefInput");
5823        query = query.arg("name", name.into());
5824        query = query.arg_lazy(
5825            "value",
5826            Box::new(move || {
5827                let value = value.clone();
5828                Box::pin(async move { value.into_id().await.unwrap().quote() })
5829            }),
5830        );
5831        query = query.arg("description", description.into());
5832        Env {
5833            proc: self.proc.clone(),
5834            selection: query,
5835            graphql_client: self.graphql_client.clone(),
5836        }
5837    }
5838    /// Declare a desired GitRef output to be assigned in the environment
5839    ///
5840    /// # Arguments
5841    ///
5842    /// * `name` - The name of the binding
5843    /// * `description` - A description of the desired value of the binding
5844    pub fn with_git_ref_output(
5845        &self,
5846        name: impl Into<String>,
5847        description: impl Into<String>,
5848    ) -> Env {
5849        let mut query = self.selection.select("withGitRefOutput");
5850        query = query.arg("name", name.into());
5851        query = query.arg("description", description.into());
5852        Env {
5853            proc: self.proc.clone(),
5854            selection: query,
5855            graphql_client: self.graphql_client.clone(),
5856        }
5857    }
5858    /// Create or update a binding of type GitRepository in the environment
5859    ///
5860    /// # Arguments
5861    ///
5862    /// * `name` - The name of the binding
5863    /// * `value` - The GitRepository value to assign to the binding
5864    /// * `description` - The purpose of the input
5865    pub fn with_git_repository_input(
5866        &self,
5867        name: impl Into<String>,
5868        value: impl IntoID<GitRepositoryId>,
5869        description: impl Into<String>,
5870    ) -> Env {
5871        let mut query = self.selection.select("withGitRepositoryInput");
5872        query = query.arg("name", name.into());
5873        query = query.arg_lazy(
5874            "value",
5875            Box::new(move || {
5876                let value = value.clone();
5877                Box::pin(async move { value.into_id().await.unwrap().quote() })
5878            }),
5879        );
5880        query = query.arg("description", description.into());
5881        Env {
5882            proc: self.proc.clone(),
5883            selection: query,
5884            graphql_client: self.graphql_client.clone(),
5885        }
5886    }
5887    /// Declare a desired GitRepository output to be assigned in the environment
5888    ///
5889    /// # Arguments
5890    ///
5891    /// * `name` - The name of the binding
5892    /// * `description` - A description of the desired value of the binding
5893    pub fn with_git_repository_output(
5894        &self,
5895        name: impl Into<String>,
5896        description: impl Into<String>,
5897    ) -> Env {
5898        let mut query = self.selection.select("withGitRepositoryOutput");
5899        query = query.arg("name", name.into());
5900        query = query.arg("description", description.into());
5901        Env {
5902            proc: self.proc.clone(),
5903            selection: query,
5904            graphql_client: self.graphql_client.clone(),
5905        }
5906    }
5907    /// Create or update a binding of type LLM in the environment
5908    ///
5909    /// # Arguments
5910    ///
5911    /// * `name` - The name of the binding
5912    /// * `value` - The LLM value to assign to the binding
5913    /// * `description` - The purpose of the input
5914    pub fn with_llm_input(
5915        &self,
5916        name: impl Into<String>,
5917        value: impl IntoID<Llmid>,
5918        description: impl Into<String>,
5919    ) -> Env {
5920        let mut query = self.selection.select("withLLMInput");
5921        query = query.arg("name", name.into());
5922        query = query.arg_lazy(
5923            "value",
5924            Box::new(move || {
5925                let value = value.clone();
5926                Box::pin(async move { value.into_id().await.unwrap().quote() })
5927            }),
5928        );
5929        query = query.arg("description", description.into());
5930        Env {
5931            proc: self.proc.clone(),
5932            selection: query,
5933            graphql_client: self.graphql_client.clone(),
5934        }
5935    }
5936    /// Declare a desired LLM output to be assigned in the environment
5937    ///
5938    /// # Arguments
5939    ///
5940    /// * `name` - The name of the binding
5941    /// * `description` - A description of the desired value of the binding
5942    pub fn with_llm_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
5943        let mut query = self.selection.select("withLLMOutput");
5944        query = query.arg("name", name.into());
5945        query = query.arg("description", description.into());
5946        Env {
5947            proc: self.proc.clone(),
5948            selection: query,
5949            graphql_client: self.graphql_client.clone(),
5950        }
5951    }
5952    /// Create or update a binding of type ModuleConfigClient in the environment
5953    ///
5954    /// # Arguments
5955    ///
5956    /// * `name` - The name of the binding
5957    /// * `value` - The ModuleConfigClient value to assign to the binding
5958    /// * `description` - The purpose of the input
5959    pub fn with_module_config_client_input(
5960        &self,
5961        name: impl Into<String>,
5962        value: impl IntoID<ModuleConfigClientId>,
5963        description: impl Into<String>,
5964    ) -> Env {
5965        let mut query = self.selection.select("withModuleConfigClientInput");
5966        query = query.arg("name", name.into());
5967        query = query.arg_lazy(
5968            "value",
5969            Box::new(move || {
5970                let value = value.clone();
5971                Box::pin(async move { value.into_id().await.unwrap().quote() })
5972            }),
5973        );
5974        query = query.arg("description", description.into());
5975        Env {
5976            proc: self.proc.clone(),
5977            selection: query,
5978            graphql_client: self.graphql_client.clone(),
5979        }
5980    }
5981    /// Declare a desired ModuleConfigClient output to be assigned in the environment
5982    ///
5983    /// # Arguments
5984    ///
5985    /// * `name` - The name of the binding
5986    /// * `description` - A description of the desired value of the binding
5987    pub fn with_module_config_client_output(
5988        &self,
5989        name: impl Into<String>,
5990        description: impl Into<String>,
5991    ) -> Env {
5992        let mut query = self.selection.select("withModuleConfigClientOutput");
5993        query = query.arg("name", name.into());
5994        query = query.arg("description", description.into());
5995        Env {
5996            proc: self.proc.clone(),
5997            selection: query,
5998            graphql_client: self.graphql_client.clone(),
5999        }
6000    }
6001    /// Create or update a binding of type Module in the environment
6002    ///
6003    /// # Arguments
6004    ///
6005    /// * `name` - The name of the binding
6006    /// * `value` - The Module value to assign to the binding
6007    /// * `description` - The purpose of the input
6008    pub fn with_module_input(
6009        &self,
6010        name: impl Into<String>,
6011        value: impl IntoID<ModuleId>,
6012        description: impl Into<String>,
6013    ) -> Env {
6014        let mut query = self.selection.select("withModuleInput");
6015        query = query.arg("name", name.into());
6016        query = query.arg_lazy(
6017            "value",
6018            Box::new(move || {
6019                let value = value.clone();
6020                Box::pin(async move { value.into_id().await.unwrap().quote() })
6021            }),
6022        );
6023        query = query.arg("description", description.into());
6024        Env {
6025            proc: self.proc.clone(),
6026            selection: query,
6027            graphql_client: self.graphql_client.clone(),
6028        }
6029    }
6030    /// Declare a desired Module output to be assigned in the environment
6031    ///
6032    /// # Arguments
6033    ///
6034    /// * `name` - The name of the binding
6035    /// * `description` - A description of the desired value of the binding
6036    pub fn with_module_output(
6037        &self,
6038        name: impl Into<String>,
6039        description: impl Into<String>,
6040    ) -> Env {
6041        let mut query = self.selection.select("withModuleOutput");
6042        query = query.arg("name", name.into());
6043        query = query.arg("description", description.into());
6044        Env {
6045            proc: self.proc.clone(),
6046            selection: query,
6047            graphql_client: self.graphql_client.clone(),
6048        }
6049    }
6050    /// Create or update a binding of type ModuleSource in the environment
6051    ///
6052    /// # Arguments
6053    ///
6054    /// * `name` - The name of the binding
6055    /// * `value` - The ModuleSource value to assign to the binding
6056    /// * `description` - The purpose of the input
6057    pub fn with_module_source_input(
6058        &self,
6059        name: impl Into<String>,
6060        value: impl IntoID<ModuleSourceId>,
6061        description: impl Into<String>,
6062    ) -> Env {
6063        let mut query = self.selection.select("withModuleSourceInput");
6064        query = query.arg("name", name.into());
6065        query = query.arg_lazy(
6066            "value",
6067            Box::new(move || {
6068                let value = value.clone();
6069                Box::pin(async move { value.into_id().await.unwrap().quote() })
6070            }),
6071        );
6072        query = query.arg("description", description.into());
6073        Env {
6074            proc: self.proc.clone(),
6075            selection: query,
6076            graphql_client: self.graphql_client.clone(),
6077        }
6078    }
6079    /// Declare a desired ModuleSource output to be assigned in the environment
6080    ///
6081    /// # Arguments
6082    ///
6083    /// * `name` - The name of the binding
6084    /// * `description` - A description of the desired value of the binding
6085    pub fn with_module_source_output(
6086        &self,
6087        name: impl Into<String>,
6088        description: impl Into<String>,
6089    ) -> Env {
6090        let mut query = self.selection.select("withModuleSourceOutput");
6091        query = query.arg("name", name.into());
6092        query = query.arg("description", description.into());
6093        Env {
6094            proc: self.proc.clone(),
6095            selection: query,
6096            graphql_client: self.graphql_client.clone(),
6097        }
6098    }
6099    /// Create or update a binding of type Secret in the environment
6100    ///
6101    /// # Arguments
6102    ///
6103    /// * `name` - The name of the binding
6104    /// * `value` - The Secret value to assign to the binding
6105    /// * `description` - The purpose of the input
6106    pub fn with_secret_input(
6107        &self,
6108        name: impl Into<String>,
6109        value: impl IntoID<SecretId>,
6110        description: impl Into<String>,
6111    ) -> Env {
6112        let mut query = self.selection.select("withSecretInput");
6113        query = query.arg("name", name.into());
6114        query = query.arg_lazy(
6115            "value",
6116            Box::new(move || {
6117                let value = value.clone();
6118                Box::pin(async move { value.into_id().await.unwrap().quote() })
6119            }),
6120        );
6121        query = query.arg("description", description.into());
6122        Env {
6123            proc: self.proc.clone(),
6124            selection: query,
6125            graphql_client: self.graphql_client.clone(),
6126        }
6127    }
6128    /// Declare a desired Secret output to be assigned in the environment
6129    ///
6130    /// # Arguments
6131    ///
6132    /// * `name` - The name of the binding
6133    /// * `description` - A description of the desired value of the binding
6134    pub fn with_secret_output(
6135        &self,
6136        name: impl Into<String>,
6137        description: impl Into<String>,
6138    ) -> Env {
6139        let mut query = self.selection.select("withSecretOutput");
6140        query = query.arg("name", name.into());
6141        query = query.arg("description", description.into());
6142        Env {
6143            proc: self.proc.clone(),
6144            selection: query,
6145            graphql_client: self.graphql_client.clone(),
6146        }
6147    }
6148    /// Create or update a binding of type Service in the environment
6149    ///
6150    /// # Arguments
6151    ///
6152    /// * `name` - The name of the binding
6153    /// * `value` - The Service value to assign to the binding
6154    /// * `description` - The purpose of the input
6155    pub fn with_service_input(
6156        &self,
6157        name: impl Into<String>,
6158        value: impl IntoID<ServiceId>,
6159        description: impl Into<String>,
6160    ) -> Env {
6161        let mut query = self.selection.select("withServiceInput");
6162        query = query.arg("name", name.into());
6163        query = query.arg_lazy(
6164            "value",
6165            Box::new(move || {
6166                let value = value.clone();
6167                Box::pin(async move { value.into_id().await.unwrap().quote() })
6168            }),
6169        );
6170        query = query.arg("description", description.into());
6171        Env {
6172            proc: self.proc.clone(),
6173            selection: query,
6174            graphql_client: self.graphql_client.clone(),
6175        }
6176    }
6177    /// Declare a desired Service output to be assigned in the environment
6178    ///
6179    /// # Arguments
6180    ///
6181    /// * `name` - The name of the binding
6182    /// * `description` - A description of the desired value of the binding
6183    pub fn with_service_output(
6184        &self,
6185        name: impl Into<String>,
6186        description: impl Into<String>,
6187    ) -> Env {
6188        let mut query = self.selection.select("withServiceOutput");
6189        query = query.arg("name", name.into());
6190        query = query.arg("description", description.into());
6191        Env {
6192            proc: self.proc.clone(),
6193            selection: query,
6194            graphql_client: self.graphql_client.clone(),
6195        }
6196    }
6197    /// Create or update a binding of type Socket in the environment
6198    ///
6199    /// # Arguments
6200    ///
6201    /// * `name` - The name of the binding
6202    /// * `value` - The Socket value to assign to the binding
6203    /// * `description` - The purpose of the input
6204    pub fn with_socket_input(
6205        &self,
6206        name: impl Into<String>,
6207        value: impl IntoID<SocketId>,
6208        description: impl Into<String>,
6209    ) -> Env {
6210        let mut query = self.selection.select("withSocketInput");
6211        query = query.arg("name", name.into());
6212        query = query.arg_lazy(
6213            "value",
6214            Box::new(move || {
6215                let value = value.clone();
6216                Box::pin(async move { value.into_id().await.unwrap().quote() })
6217            }),
6218        );
6219        query = query.arg("description", description.into());
6220        Env {
6221            proc: self.proc.clone(),
6222            selection: query,
6223            graphql_client: self.graphql_client.clone(),
6224        }
6225    }
6226    /// Declare a desired Socket output to be assigned in the environment
6227    ///
6228    /// # Arguments
6229    ///
6230    /// * `name` - The name of the binding
6231    /// * `description` - A description of the desired value of the binding
6232    pub fn with_socket_output(
6233        &self,
6234        name: impl Into<String>,
6235        description: impl Into<String>,
6236    ) -> Env {
6237        let mut query = self.selection.select("withSocketOutput");
6238        query = query.arg("name", name.into());
6239        query = query.arg("description", description.into());
6240        Env {
6241            proc: self.proc.clone(),
6242            selection: query,
6243            graphql_client: self.graphql_client.clone(),
6244        }
6245    }
6246    /// Create or update an input value of type string
6247    ///
6248    /// # Arguments
6249    ///
6250    /// * `name` - The name of the binding
6251    /// * `value` - The string value to assign to the binding
6252    /// * `description` - The description of the input
6253    pub fn with_string_input(
6254        &self,
6255        name: impl Into<String>,
6256        value: impl Into<String>,
6257        description: impl Into<String>,
6258    ) -> Env {
6259        let mut query = self.selection.select("withStringInput");
6260        query = query.arg("name", name.into());
6261        query = query.arg("value", value.into());
6262        query = query.arg("description", description.into());
6263        Env {
6264            proc: self.proc.clone(),
6265            selection: query,
6266            graphql_client: self.graphql_client.clone(),
6267        }
6268    }
6269    /// Create or update an input value of type string
6270    ///
6271    /// # Arguments
6272    ///
6273    /// * `name` - The name of the binding
6274    /// * `description` - The description of the output
6275    pub fn with_string_output(
6276        &self,
6277        name: impl Into<String>,
6278        description: impl Into<String>,
6279    ) -> Env {
6280        let mut query = self.selection.select("withStringOutput");
6281        query = query.arg("name", name.into());
6282        query = query.arg("description", description.into());
6283        Env {
6284            proc: self.proc.clone(),
6285            selection: query,
6286            graphql_client: self.graphql_client.clone(),
6287        }
6288    }
6289}
6290#[derive(Clone)]
6291pub struct EnvVariable {
6292    pub proc: Option<Arc<DaggerSessionProc>>,
6293    pub selection: Selection,
6294    pub graphql_client: DynGraphQLClient,
6295}
6296impl EnvVariable {
6297    /// A unique identifier for this EnvVariable.
6298    pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
6299        let query = self.selection.select("id");
6300        query.execute(self.graphql_client.clone()).await
6301    }
6302    /// The environment variable name.
6303    pub async fn name(&self) -> Result<String, DaggerError> {
6304        let query = self.selection.select("name");
6305        query.execute(self.graphql_client.clone()).await
6306    }
6307    /// The environment variable value.
6308    pub async fn value(&self) -> Result<String, DaggerError> {
6309        let query = self.selection.select("value");
6310        query.execute(self.graphql_client.clone()).await
6311    }
6312}
6313#[derive(Clone)]
6314pub struct Error {
6315    pub proc: Option<Arc<DaggerSessionProc>>,
6316    pub selection: Selection,
6317    pub graphql_client: DynGraphQLClient,
6318}
6319impl Error {
6320    /// A unique identifier for this Error.
6321    pub async fn id(&self) -> Result<ErrorId, DaggerError> {
6322        let query = self.selection.select("id");
6323        query.execute(self.graphql_client.clone()).await
6324    }
6325    /// A description of the error.
6326    pub async fn message(&self) -> Result<String, DaggerError> {
6327        let query = self.selection.select("message");
6328        query.execute(self.graphql_client.clone()).await
6329    }
6330    /// The extensions of the error.
6331    pub fn values(&self) -> Vec<ErrorValue> {
6332        let query = self.selection.select("values");
6333        vec![ErrorValue {
6334            proc: self.proc.clone(),
6335            selection: query,
6336            graphql_client: self.graphql_client.clone(),
6337        }]
6338    }
6339    /// Add a value to the error.
6340    ///
6341    /// # Arguments
6342    ///
6343    /// * `name` - The name of the value.
6344    /// * `value` - The value to store on the error.
6345    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
6346        let mut query = self.selection.select("withValue");
6347        query = query.arg("name", name.into());
6348        query = query.arg("value", value);
6349        Error {
6350            proc: self.proc.clone(),
6351            selection: query,
6352            graphql_client: self.graphql_client.clone(),
6353        }
6354    }
6355}
6356#[derive(Clone)]
6357pub struct ErrorValue {
6358    pub proc: Option<Arc<DaggerSessionProc>>,
6359    pub selection: Selection,
6360    pub graphql_client: DynGraphQLClient,
6361}
6362impl ErrorValue {
6363    /// A unique identifier for this ErrorValue.
6364    pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
6365        let query = self.selection.select("id");
6366        query.execute(self.graphql_client.clone()).await
6367    }
6368    /// The name of the value.
6369    pub async fn name(&self) -> Result<String, DaggerError> {
6370        let query = self.selection.select("name");
6371        query.execute(self.graphql_client.clone()).await
6372    }
6373    /// The value.
6374    pub async fn value(&self) -> Result<Json, DaggerError> {
6375        let query = self.selection.select("value");
6376        query.execute(self.graphql_client.clone()).await
6377    }
6378}
6379#[derive(Clone)]
6380pub struct FieldTypeDef {
6381    pub proc: Option<Arc<DaggerSessionProc>>,
6382    pub selection: Selection,
6383    pub graphql_client: DynGraphQLClient,
6384}
6385impl FieldTypeDef {
6386    /// A doc string for the field, if any.
6387    pub async fn description(&self) -> Result<String, DaggerError> {
6388        let query = self.selection.select("description");
6389        query.execute(self.graphql_client.clone()).await
6390    }
6391    /// A unique identifier for this FieldTypeDef.
6392    pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
6393        let query = self.selection.select("id");
6394        query.execute(self.graphql_client.clone()).await
6395    }
6396    /// The name of the field in lowerCamelCase format.
6397    pub async fn name(&self) -> Result<String, DaggerError> {
6398        let query = self.selection.select("name");
6399        query.execute(self.graphql_client.clone()).await
6400    }
6401    /// The location of this field declaration.
6402    pub fn source_map(&self) -> SourceMap {
6403        let query = self.selection.select("sourceMap");
6404        SourceMap {
6405            proc: self.proc.clone(),
6406            selection: query,
6407            graphql_client: self.graphql_client.clone(),
6408        }
6409    }
6410    /// The type of the field.
6411    pub fn type_def(&self) -> TypeDef {
6412        let query = self.selection.select("typeDef");
6413        TypeDef {
6414            proc: self.proc.clone(),
6415            selection: query,
6416            graphql_client: self.graphql_client.clone(),
6417        }
6418    }
6419}
6420#[derive(Clone)]
6421pub struct File {
6422    pub proc: Option<Arc<DaggerSessionProc>>,
6423    pub selection: Selection,
6424    pub graphql_client: DynGraphQLClient,
6425}
6426#[derive(Builder, Debug, PartialEq)]
6427pub struct FileDigestOpts {
6428    /// If true, exclude metadata from the digest.
6429    #[builder(setter(into, strip_option), default)]
6430    pub exclude_metadata: Option<bool>,
6431}
6432#[derive(Builder, Debug, PartialEq)]
6433pub struct FileExportOpts {
6434    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
6435    #[builder(setter(into, strip_option), default)]
6436    pub allow_parent_dir_path: Option<bool>,
6437}
6438impl File {
6439    /// Retrieves the contents of the file.
6440    pub async fn contents(&self) -> Result<String, DaggerError> {
6441        let query = self.selection.select("contents");
6442        query.execute(self.graphql_client.clone()).await
6443    }
6444    /// 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.
6445    ///
6446    /// # Arguments
6447    ///
6448    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6449    pub async fn digest(&self) -> Result<String, DaggerError> {
6450        let query = self.selection.select("digest");
6451        query.execute(self.graphql_client.clone()).await
6452    }
6453    /// 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.
6454    ///
6455    /// # Arguments
6456    ///
6457    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6458    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
6459        let mut query = self.selection.select("digest");
6460        if let Some(exclude_metadata) = opts.exclude_metadata {
6461            query = query.arg("excludeMetadata", exclude_metadata);
6462        }
6463        query.execute(self.graphql_client.clone()).await
6464    }
6465    /// Writes the file to a file path on the host.
6466    ///
6467    /// # Arguments
6468    ///
6469    /// * `path` - Location of the written directory (e.g., "output.txt").
6470    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6471    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
6472        let mut query = self.selection.select("export");
6473        query = query.arg("path", path.into());
6474        query.execute(self.graphql_client.clone()).await
6475    }
6476    /// Writes the file to a file path on the host.
6477    ///
6478    /// # Arguments
6479    ///
6480    /// * `path` - Location of the written directory (e.g., "output.txt").
6481    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6482    pub async fn export_opts(
6483        &self,
6484        path: impl Into<String>,
6485        opts: FileExportOpts,
6486    ) -> Result<String, DaggerError> {
6487        let mut query = self.selection.select("export");
6488        query = query.arg("path", path.into());
6489        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
6490            query = query.arg("allowParentDirPath", allow_parent_dir_path);
6491        }
6492        query.execute(self.graphql_client.clone()).await
6493    }
6494    /// A unique identifier for this File.
6495    pub async fn id(&self) -> Result<FileId, DaggerError> {
6496        let query = self.selection.select("id");
6497        query.execute(self.graphql_client.clone()).await
6498    }
6499    /// Retrieves the name of the file.
6500    pub async fn name(&self) -> Result<String, DaggerError> {
6501        let query = self.selection.select("name");
6502        query.execute(self.graphql_client.clone()).await
6503    }
6504    /// Retrieves the size of the file, in bytes.
6505    pub async fn size(&self) -> Result<isize, DaggerError> {
6506        let query = self.selection.select("size");
6507        query.execute(self.graphql_client.clone()).await
6508    }
6509    /// Force evaluation in the engine.
6510    pub async fn sync(&self) -> Result<FileId, DaggerError> {
6511        let query = self.selection.select("sync");
6512        query.execute(self.graphql_client.clone()).await
6513    }
6514    /// Retrieves this file with its name set to the given name.
6515    ///
6516    /// # Arguments
6517    ///
6518    /// * `name` - Name to set file to.
6519    pub fn with_name(&self, name: impl Into<String>) -> File {
6520        let mut query = self.selection.select("withName");
6521        query = query.arg("name", name.into());
6522        File {
6523            proc: self.proc.clone(),
6524            selection: query,
6525            graphql_client: self.graphql_client.clone(),
6526        }
6527    }
6528    /// Retrieves this file with its created/modified timestamps set to the given time.
6529    ///
6530    /// # Arguments
6531    ///
6532    /// * `timestamp` - Timestamp to set dir/files in.
6533    ///
6534    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
6535    pub fn with_timestamps(&self, timestamp: isize) -> File {
6536        let mut query = self.selection.select("withTimestamps");
6537        query = query.arg("timestamp", timestamp);
6538        File {
6539            proc: self.proc.clone(),
6540            selection: query,
6541            graphql_client: self.graphql_client.clone(),
6542        }
6543    }
6544}
6545#[derive(Clone)]
6546pub struct Function {
6547    pub proc: Option<Arc<DaggerSessionProc>>,
6548    pub selection: Selection,
6549    pub graphql_client: DynGraphQLClient,
6550}
6551#[derive(Builder, Debug, PartialEq)]
6552pub struct FunctionWithArgOpts<'a> {
6553    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
6554    #[builder(setter(into, strip_option), default)]
6555    pub default_path: Option<&'a str>,
6556    /// A default value to use for this argument if not explicitly set by the caller, if any
6557    #[builder(setter(into, strip_option), default)]
6558    pub default_value: Option<Json>,
6559    /// A doc string for the argument, if any
6560    #[builder(setter(into, strip_option), default)]
6561    pub description: Option<&'a str>,
6562    /// Patterns to ignore when loading the contextual argument value.
6563    #[builder(setter(into, strip_option), default)]
6564    pub ignore: Option<Vec<&'a str>>,
6565    /// The source map for the argument definition.
6566    #[builder(setter(into, strip_option), default)]
6567    pub source_map: Option<SourceMapId>,
6568}
6569impl Function {
6570    /// Arguments accepted by the function, if any.
6571    pub fn args(&self) -> Vec<FunctionArg> {
6572        let query = self.selection.select("args");
6573        vec![FunctionArg {
6574            proc: self.proc.clone(),
6575            selection: query,
6576            graphql_client: self.graphql_client.clone(),
6577        }]
6578    }
6579    /// A doc string for the function, if any.
6580    pub async fn description(&self) -> Result<String, DaggerError> {
6581        let query = self.selection.select("description");
6582        query.execute(self.graphql_client.clone()).await
6583    }
6584    /// A unique identifier for this Function.
6585    pub async fn id(&self) -> Result<FunctionId, DaggerError> {
6586        let query = self.selection.select("id");
6587        query.execute(self.graphql_client.clone()).await
6588    }
6589    /// The name of the function.
6590    pub async fn name(&self) -> Result<String, DaggerError> {
6591        let query = self.selection.select("name");
6592        query.execute(self.graphql_client.clone()).await
6593    }
6594    /// The type returned by the function.
6595    pub fn return_type(&self) -> TypeDef {
6596        let query = self.selection.select("returnType");
6597        TypeDef {
6598            proc: self.proc.clone(),
6599            selection: query,
6600            graphql_client: self.graphql_client.clone(),
6601        }
6602    }
6603    /// The location of this function declaration.
6604    pub fn source_map(&self) -> SourceMap {
6605        let query = self.selection.select("sourceMap");
6606        SourceMap {
6607            proc: self.proc.clone(),
6608            selection: query,
6609            graphql_client: self.graphql_client.clone(),
6610        }
6611    }
6612    /// Returns the function with the provided argument
6613    ///
6614    /// # Arguments
6615    ///
6616    /// * `name` - The name of the argument
6617    /// * `type_def` - The type of the argument
6618    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6619    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
6620        let mut query = self.selection.select("withArg");
6621        query = query.arg("name", name.into());
6622        query = query.arg_lazy(
6623            "typeDef",
6624            Box::new(move || {
6625                let type_def = type_def.clone();
6626                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
6627            }),
6628        );
6629        Function {
6630            proc: self.proc.clone(),
6631            selection: query,
6632            graphql_client: self.graphql_client.clone(),
6633        }
6634    }
6635    /// Returns the function with the provided argument
6636    ///
6637    /// # Arguments
6638    ///
6639    /// * `name` - The name of the argument
6640    /// * `type_def` - The type of the argument
6641    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6642    pub fn with_arg_opts<'a>(
6643        &self,
6644        name: impl Into<String>,
6645        type_def: impl IntoID<TypeDefId>,
6646        opts: FunctionWithArgOpts<'a>,
6647    ) -> Function {
6648        let mut query = self.selection.select("withArg");
6649        query = query.arg("name", name.into());
6650        query = query.arg_lazy(
6651            "typeDef",
6652            Box::new(move || {
6653                let type_def = type_def.clone();
6654                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
6655            }),
6656        );
6657        if let Some(description) = opts.description {
6658            query = query.arg("description", description);
6659        }
6660        if let Some(default_value) = opts.default_value {
6661            query = query.arg("defaultValue", default_value);
6662        }
6663        if let Some(default_path) = opts.default_path {
6664            query = query.arg("defaultPath", default_path);
6665        }
6666        if let Some(ignore) = opts.ignore {
6667            query = query.arg("ignore", ignore);
6668        }
6669        if let Some(source_map) = opts.source_map {
6670            query = query.arg("sourceMap", source_map);
6671        }
6672        Function {
6673            proc: self.proc.clone(),
6674            selection: query,
6675            graphql_client: self.graphql_client.clone(),
6676        }
6677    }
6678    /// Returns the function with the given doc string.
6679    ///
6680    /// # Arguments
6681    ///
6682    /// * `description` - The doc string to set.
6683    pub fn with_description(&self, description: impl Into<String>) -> Function {
6684        let mut query = self.selection.select("withDescription");
6685        query = query.arg("description", description.into());
6686        Function {
6687            proc: self.proc.clone(),
6688            selection: query,
6689            graphql_client: self.graphql_client.clone(),
6690        }
6691    }
6692    /// Returns the function with the given source map.
6693    ///
6694    /// # Arguments
6695    ///
6696    /// * `source_map` - The source map for the function definition.
6697    pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
6698        let mut query = self.selection.select("withSourceMap");
6699        query = query.arg_lazy(
6700            "sourceMap",
6701            Box::new(move || {
6702                let source_map = source_map.clone();
6703                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
6704            }),
6705        );
6706        Function {
6707            proc: self.proc.clone(),
6708            selection: query,
6709            graphql_client: self.graphql_client.clone(),
6710        }
6711    }
6712}
6713#[derive(Clone)]
6714pub struct FunctionArg {
6715    pub proc: Option<Arc<DaggerSessionProc>>,
6716    pub selection: Selection,
6717    pub graphql_client: DynGraphQLClient,
6718}
6719impl FunctionArg {
6720    /// 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
6721    pub async fn default_path(&self) -> Result<String, DaggerError> {
6722        let query = self.selection.select("defaultPath");
6723        query.execute(self.graphql_client.clone()).await
6724    }
6725    /// A default value to use for this argument when not explicitly set by the caller, if any.
6726    pub async fn default_value(&self) -> Result<Json, DaggerError> {
6727        let query = self.selection.select("defaultValue");
6728        query.execute(self.graphql_client.clone()).await
6729    }
6730    /// A doc string for the argument, if any.
6731    pub async fn description(&self) -> Result<String, DaggerError> {
6732        let query = self.selection.select("description");
6733        query.execute(self.graphql_client.clone()).await
6734    }
6735    /// A unique identifier for this FunctionArg.
6736    pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
6737        let query = self.selection.select("id");
6738        query.execute(self.graphql_client.clone()).await
6739    }
6740    /// 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.
6741    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
6742        let query = self.selection.select("ignore");
6743        query.execute(self.graphql_client.clone()).await
6744    }
6745    /// The name of the argument in lowerCamelCase format.
6746    pub async fn name(&self) -> Result<String, DaggerError> {
6747        let query = self.selection.select("name");
6748        query.execute(self.graphql_client.clone()).await
6749    }
6750    /// The location of this arg declaration.
6751    pub fn source_map(&self) -> SourceMap {
6752        let query = self.selection.select("sourceMap");
6753        SourceMap {
6754            proc: self.proc.clone(),
6755            selection: query,
6756            graphql_client: self.graphql_client.clone(),
6757        }
6758    }
6759    /// The type of the argument.
6760    pub fn type_def(&self) -> TypeDef {
6761        let query = self.selection.select("typeDef");
6762        TypeDef {
6763            proc: self.proc.clone(),
6764            selection: query,
6765            graphql_client: self.graphql_client.clone(),
6766        }
6767    }
6768}
6769#[derive(Clone)]
6770pub struct FunctionCall {
6771    pub proc: Option<Arc<DaggerSessionProc>>,
6772    pub selection: Selection,
6773    pub graphql_client: DynGraphQLClient,
6774}
6775impl FunctionCall {
6776    /// A unique identifier for this FunctionCall.
6777    pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
6778        let query = self.selection.select("id");
6779        query.execute(self.graphql_client.clone()).await
6780    }
6781    /// The argument values the function is being invoked with.
6782    pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
6783        let query = self.selection.select("inputArgs");
6784        vec![FunctionCallArgValue {
6785            proc: self.proc.clone(),
6786            selection: query,
6787            graphql_client: self.graphql_client.clone(),
6788        }]
6789    }
6790    /// The name of the function being called.
6791    pub async fn name(&self) -> Result<String, DaggerError> {
6792        let query = self.selection.select("name");
6793        query.execute(self.graphql_client.clone()).await
6794    }
6795    /// 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.
6796    pub async fn parent(&self) -> Result<Json, DaggerError> {
6797        let query = self.selection.select("parent");
6798        query.execute(self.graphql_client.clone()).await
6799    }
6800    /// 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.
6801    pub async fn parent_name(&self) -> Result<String, DaggerError> {
6802        let query = self.selection.select("parentName");
6803        query.execute(self.graphql_client.clone()).await
6804    }
6805    /// Return an error from the function.
6806    ///
6807    /// # Arguments
6808    ///
6809    /// * `error` - The error to return.
6810    pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
6811        let mut query = self.selection.select("returnError");
6812        query = query.arg_lazy(
6813            "error",
6814            Box::new(move || {
6815                let error = error.clone();
6816                Box::pin(async move { error.into_id().await.unwrap().quote() })
6817            }),
6818        );
6819        query.execute(self.graphql_client.clone()).await
6820    }
6821    /// Set the return value of the function call to the provided value.
6822    ///
6823    /// # Arguments
6824    ///
6825    /// * `value` - JSON serialization of the return value.
6826    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
6827        let mut query = self.selection.select("returnValue");
6828        query = query.arg("value", value);
6829        query.execute(self.graphql_client.clone()).await
6830    }
6831}
6832#[derive(Clone)]
6833pub struct FunctionCallArgValue {
6834    pub proc: Option<Arc<DaggerSessionProc>>,
6835    pub selection: Selection,
6836    pub graphql_client: DynGraphQLClient,
6837}
6838impl FunctionCallArgValue {
6839    /// A unique identifier for this FunctionCallArgValue.
6840    pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
6841        let query = self.selection.select("id");
6842        query.execute(self.graphql_client.clone()).await
6843    }
6844    /// The name of the argument.
6845    pub async fn name(&self) -> Result<String, DaggerError> {
6846        let query = self.selection.select("name");
6847        query.execute(self.graphql_client.clone()).await
6848    }
6849    /// The value of the argument represented as a JSON serialized string.
6850    pub async fn value(&self) -> Result<Json, DaggerError> {
6851        let query = self.selection.select("value");
6852        query.execute(self.graphql_client.clone()).await
6853    }
6854}
6855#[derive(Clone)]
6856pub struct GeneratedCode {
6857    pub proc: Option<Arc<DaggerSessionProc>>,
6858    pub selection: Selection,
6859    pub graphql_client: DynGraphQLClient,
6860}
6861impl GeneratedCode {
6862    /// The directory containing the generated code.
6863    pub fn code(&self) -> Directory {
6864        let query = self.selection.select("code");
6865        Directory {
6866            proc: self.proc.clone(),
6867            selection: query,
6868            graphql_client: self.graphql_client.clone(),
6869        }
6870    }
6871    /// A unique identifier for this GeneratedCode.
6872    pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
6873        let query = self.selection.select("id");
6874        query.execute(self.graphql_client.clone()).await
6875    }
6876    /// List of paths to mark generated in version control (i.e. .gitattributes).
6877    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
6878        let query = self.selection.select("vcsGeneratedPaths");
6879        query.execute(self.graphql_client.clone()).await
6880    }
6881    /// List of paths to ignore in version control (i.e. .gitignore).
6882    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
6883        let query = self.selection.select("vcsIgnoredPaths");
6884        query.execute(self.graphql_client.clone()).await
6885    }
6886    /// Set the list of paths to mark generated in version control.
6887    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
6888        let mut query = self.selection.select("withVCSGeneratedPaths");
6889        query = query.arg(
6890            "paths",
6891            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
6892        );
6893        GeneratedCode {
6894            proc: self.proc.clone(),
6895            selection: query,
6896            graphql_client: self.graphql_client.clone(),
6897        }
6898    }
6899    /// Set the list of paths to ignore in version control.
6900    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
6901        let mut query = self.selection.select("withVCSIgnoredPaths");
6902        query = query.arg(
6903            "paths",
6904            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
6905        );
6906        GeneratedCode {
6907            proc: self.proc.clone(),
6908            selection: query,
6909            graphql_client: self.graphql_client.clone(),
6910        }
6911    }
6912}
6913#[derive(Clone)]
6914pub struct GitRef {
6915    pub proc: Option<Arc<DaggerSessionProc>>,
6916    pub selection: Selection,
6917    pub graphql_client: DynGraphQLClient,
6918}
6919#[derive(Builder, Debug, PartialEq)]
6920pub struct GitRefTreeOpts {
6921    /// The depth of the tree to fetch.
6922    #[builder(setter(into, strip_option), default)]
6923    pub depth: Option<isize>,
6924    /// Set to true to discard .git directory.
6925    #[builder(setter(into, strip_option), default)]
6926    pub discard_git_dir: Option<bool>,
6927}
6928impl GitRef {
6929    /// The resolved commit id at this ref.
6930    pub async fn commit(&self) -> Result<String, DaggerError> {
6931        let query = self.selection.select("commit");
6932        query.execute(self.graphql_client.clone()).await
6933    }
6934    /// A unique identifier for this GitRef.
6935    pub async fn id(&self) -> Result<GitRefId, DaggerError> {
6936        let query = self.selection.select("id");
6937        query.execute(self.graphql_client.clone()).await
6938    }
6939    /// The resolved ref name at this ref.
6940    pub async fn r#ref(&self) -> Result<String, DaggerError> {
6941        let query = self.selection.select("ref");
6942        query.execute(self.graphql_client.clone()).await
6943    }
6944    /// The filesystem tree at this ref.
6945    ///
6946    /// # Arguments
6947    ///
6948    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6949    pub fn tree(&self) -> Directory {
6950        let query = self.selection.select("tree");
6951        Directory {
6952            proc: self.proc.clone(),
6953            selection: query,
6954            graphql_client: self.graphql_client.clone(),
6955        }
6956    }
6957    /// The filesystem tree at this ref.
6958    ///
6959    /// # Arguments
6960    ///
6961    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6962    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
6963        let mut query = self.selection.select("tree");
6964        if let Some(discard_git_dir) = opts.discard_git_dir {
6965            query = query.arg("discardGitDir", discard_git_dir);
6966        }
6967        if let Some(depth) = opts.depth {
6968            query = query.arg("depth", depth);
6969        }
6970        Directory {
6971            proc: self.proc.clone(),
6972            selection: query,
6973            graphql_client: self.graphql_client.clone(),
6974        }
6975    }
6976}
6977#[derive(Clone)]
6978pub struct GitRepository {
6979    pub proc: Option<Arc<DaggerSessionProc>>,
6980    pub selection: Selection,
6981    pub graphql_client: DynGraphQLClient,
6982}
6983#[derive(Builder, Debug, PartialEq)]
6984pub struct GitRepositoryBranchesOpts<'a> {
6985    /// Glob patterns (e.g., "refs/tags/v*").
6986    #[builder(setter(into, strip_option), default)]
6987    pub patterns: Option<Vec<&'a str>>,
6988}
6989#[derive(Builder, Debug, PartialEq)]
6990pub struct GitRepositoryTagsOpts<'a> {
6991    /// Glob patterns (e.g., "refs/tags/v*").
6992    #[builder(setter(into, strip_option), default)]
6993    pub patterns: Option<Vec<&'a str>>,
6994}
6995impl GitRepository {
6996    /// Returns details of a branch.
6997    ///
6998    /// # Arguments
6999    ///
7000    /// * `name` - Branch's name (e.g., "main").
7001    pub fn branch(&self, name: impl Into<String>) -> GitRef {
7002        let mut query = self.selection.select("branch");
7003        query = query.arg("name", name.into());
7004        GitRef {
7005            proc: self.proc.clone(),
7006            selection: query,
7007            graphql_client: self.graphql_client.clone(),
7008        }
7009    }
7010    /// branches that match any of the given glob patterns.
7011    ///
7012    /// # Arguments
7013    ///
7014    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7015    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
7016        let query = self.selection.select("branches");
7017        query.execute(self.graphql_client.clone()).await
7018    }
7019    /// branches that match any of the given glob patterns.
7020    ///
7021    /// # Arguments
7022    ///
7023    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7024    pub async fn branches_opts<'a>(
7025        &self,
7026        opts: GitRepositoryBranchesOpts<'a>,
7027    ) -> Result<Vec<String>, DaggerError> {
7028        let mut query = self.selection.select("branches");
7029        if let Some(patterns) = opts.patterns {
7030            query = query.arg("patterns", patterns);
7031        }
7032        query.execute(self.graphql_client.clone()).await
7033    }
7034    /// Returns details of a commit.
7035    ///
7036    /// # Arguments
7037    ///
7038    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
7039    pub fn commit(&self, id: impl Into<String>) -> GitRef {
7040        let mut query = self.selection.select("commit");
7041        query = query.arg("id", id.into());
7042        GitRef {
7043            proc: self.proc.clone(),
7044            selection: query,
7045            graphql_client: self.graphql_client.clone(),
7046        }
7047    }
7048    /// Returns details for HEAD.
7049    pub fn head(&self) -> GitRef {
7050        let query = self.selection.select("head");
7051        GitRef {
7052            proc: self.proc.clone(),
7053            selection: query,
7054            graphql_client: self.graphql_client.clone(),
7055        }
7056    }
7057    /// A unique identifier for this GitRepository.
7058    pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
7059        let query = self.selection.select("id");
7060        query.execute(self.graphql_client.clone()).await
7061    }
7062    /// Returns details for the latest semver tag.
7063    pub fn latest_version(&self) -> GitRef {
7064        let query = self.selection.select("latestVersion");
7065        GitRef {
7066            proc: self.proc.clone(),
7067            selection: query,
7068            graphql_client: self.graphql_client.clone(),
7069        }
7070    }
7071    /// Returns details of a ref.
7072    ///
7073    /// # Arguments
7074    ///
7075    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
7076    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
7077        let mut query = self.selection.select("ref");
7078        query = query.arg("name", name.into());
7079        GitRef {
7080            proc: self.proc.clone(),
7081            selection: query,
7082            graphql_client: self.graphql_client.clone(),
7083        }
7084    }
7085    /// Returns details of a tag.
7086    ///
7087    /// # Arguments
7088    ///
7089    /// * `name` - Tag's name (e.g., "v0.3.9").
7090    pub fn tag(&self, name: impl Into<String>) -> GitRef {
7091        let mut query = self.selection.select("tag");
7092        query = query.arg("name", name.into());
7093        GitRef {
7094            proc: self.proc.clone(),
7095            selection: query,
7096            graphql_client: self.graphql_client.clone(),
7097        }
7098    }
7099    /// tags that match any of the given glob patterns.
7100    ///
7101    /// # Arguments
7102    ///
7103    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7104    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
7105        let query = self.selection.select("tags");
7106        query.execute(self.graphql_client.clone()).await
7107    }
7108    /// tags that match any of the given glob patterns.
7109    ///
7110    /// # Arguments
7111    ///
7112    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7113    pub async fn tags_opts<'a>(
7114        &self,
7115        opts: GitRepositoryTagsOpts<'a>,
7116    ) -> Result<Vec<String>, DaggerError> {
7117        let mut query = self.selection.select("tags");
7118        if let Some(patterns) = opts.patterns {
7119            query = query.arg("patterns", patterns);
7120        }
7121        query.execute(self.graphql_client.clone()).await
7122    }
7123    /// Header to authenticate the remote with.
7124    ///
7125    /// # Arguments
7126    ///
7127    /// * `header` - Secret used to populate the Authorization HTTP header
7128    pub fn with_auth_header(&self, header: impl IntoID<SecretId>) -> GitRepository {
7129        let mut query = self.selection.select("withAuthHeader");
7130        query = query.arg_lazy(
7131            "header",
7132            Box::new(move || {
7133                let header = header.clone();
7134                Box::pin(async move { header.into_id().await.unwrap().quote() })
7135            }),
7136        );
7137        GitRepository {
7138            proc: self.proc.clone(),
7139            selection: query,
7140            graphql_client: self.graphql_client.clone(),
7141        }
7142    }
7143    /// Token to authenticate the remote with.
7144    ///
7145    /// # Arguments
7146    ///
7147    /// * `token` - Secret used to populate the password during basic HTTP Authorization
7148    pub fn with_auth_token(&self, token: impl IntoID<SecretId>) -> GitRepository {
7149        let mut query = self.selection.select("withAuthToken");
7150        query = query.arg_lazy(
7151            "token",
7152            Box::new(move || {
7153                let token = token.clone();
7154                Box::pin(async move { token.into_id().await.unwrap().quote() })
7155            }),
7156        );
7157        GitRepository {
7158            proc: self.proc.clone(),
7159            selection: query,
7160            graphql_client: self.graphql_client.clone(),
7161        }
7162    }
7163}
7164#[derive(Clone)]
7165pub struct Host {
7166    pub proc: Option<Arc<DaggerSessionProc>>,
7167    pub selection: Selection,
7168    pub graphql_client: DynGraphQLClient,
7169}
7170#[derive(Builder, Debug, PartialEq)]
7171pub struct HostDirectoryOpts<'a> {
7172    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
7173    #[builder(setter(into, strip_option), default)]
7174    pub exclude: Option<Vec<&'a str>>,
7175    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
7176    #[builder(setter(into, strip_option), default)]
7177    pub include: Option<Vec<&'a str>>,
7178    /// If true, the directory will always be reloaded from the host.
7179    #[builder(setter(into, strip_option), default)]
7180    pub no_cache: Option<bool>,
7181}
7182#[derive(Builder, Debug, PartialEq)]
7183pub struct HostFileOpts {
7184    /// If true, the file will always be reloaded from the host.
7185    #[builder(setter(into, strip_option), default)]
7186    pub no_cache: Option<bool>,
7187}
7188#[derive(Builder, Debug, PartialEq)]
7189pub struct HostServiceOpts<'a> {
7190    /// Upstream host to forward traffic to.
7191    #[builder(setter(into, strip_option), default)]
7192    pub host: Option<&'a str>,
7193}
7194#[derive(Builder, Debug, PartialEq)]
7195pub struct HostTunnelOpts {
7196    /// Map each service port to the same port on the host, as if the service were running natively.
7197    /// Note: enabling may result in port conflicts.
7198    #[builder(setter(into, strip_option), default)]
7199    pub native: Option<bool>,
7200    /// Configure explicit port forwarding rules for the tunnel.
7201    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
7202    /// 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.
7203    /// If ports are given and native is true, the ports are additive.
7204    #[builder(setter(into, strip_option), default)]
7205    pub ports: Option<Vec<PortForward>>,
7206}
7207impl Host {
7208    /// Accesses a directory on the host.
7209    ///
7210    /// # Arguments
7211    ///
7212    /// * `path` - Location of the directory to access (e.g., ".").
7213    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7214    pub fn directory(&self, path: impl Into<String>) -> Directory {
7215        let mut query = self.selection.select("directory");
7216        query = query.arg("path", path.into());
7217        Directory {
7218            proc: self.proc.clone(),
7219            selection: query,
7220            graphql_client: self.graphql_client.clone(),
7221        }
7222    }
7223    /// Accesses a directory on the host.
7224    ///
7225    /// # Arguments
7226    ///
7227    /// * `path` - Location of the directory to access (e.g., ".").
7228    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7229    pub fn directory_opts<'a>(
7230        &self,
7231        path: impl Into<String>,
7232        opts: HostDirectoryOpts<'a>,
7233    ) -> Directory {
7234        let mut query = self.selection.select("directory");
7235        query = query.arg("path", path.into());
7236        if let Some(exclude) = opts.exclude {
7237            query = query.arg("exclude", exclude);
7238        }
7239        if let Some(include) = opts.include {
7240            query = query.arg("include", include);
7241        }
7242        if let Some(no_cache) = opts.no_cache {
7243            query = query.arg("noCache", no_cache);
7244        }
7245        Directory {
7246            proc: self.proc.clone(),
7247            selection: query,
7248            graphql_client: self.graphql_client.clone(),
7249        }
7250    }
7251    /// Accesses a file on the host.
7252    ///
7253    /// # Arguments
7254    ///
7255    /// * `path` - Location of the file to retrieve (e.g., "README.md").
7256    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7257    pub fn file(&self, path: impl Into<String>) -> File {
7258        let mut query = self.selection.select("file");
7259        query = query.arg("path", path.into());
7260        File {
7261            proc: self.proc.clone(),
7262            selection: query,
7263            graphql_client: self.graphql_client.clone(),
7264        }
7265    }
7266    /// Accesses a file on the host.
7267    ///
7268    /// # Arguments
7269    ///
7270    /// * `path` - Location of the file to retrieve (e.g., "README.md").
7271    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7272    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
7273        let mut query = self.selection.select("file");
7274        query = query.arg("path", path.into());
7275        if let Some(no_cache) = opts.no_cache {
7276            query = query.arg("noCache", no_cache);
7277        }
7278        File {
7279            proc: self.proc.clone(),
7280            selection: query,
7281            graphql_client: self.graphql_client.clone(),
7282        }
7283    }
7284    /// A unique identifier for this Host.
7285    pub async fn id(&self) -> Result<HostId, DaggerError> {
7286        let query = self.selection.select("id");
7287        query.execute(self.graphql_client.clone()).await
7288    }
7289    /// Creates a service that forwards traffic to a specified address via the host.
7290    ///
7291    /// # Arguments
7292    ///
7293    /// * `ports` - Ports to expose via the service, forwarding through the host network.
7294    ///
7295    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
7296    ///
7297    /// An empty set of ports is not valid; an error will be returned.
7298    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7299    pub fn service(&self, ports: Vec<PortForward>) -> Service {
7300        let mut query = self.selection.select("service");
7301        query = query.arg("ports", ports);
7302        Service {
7303            proc: self.proc.clone(),
7304            selection: query,
7305            graphql_client: self.graphql_client.clone(),
7306        }
7307    }
7308    /// Creates a service that forwards traffic to a specified address via the host.
7309    ///
7310    /// # Arguments
7311    ///
7312    /// * `ports` - Ports to expose via the service, forwarding through the host network.
7313    ///
7314    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
7315    ///
7316    /// An empty set of ports is not valid; an error will be returned.
7317    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7318    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
7319        let mut query = self.selection.select("service");
7320        query = query.arg("ports", ports);
7321        if let Some(host) = opts.host {
7322            query = query.arg("host", host);
7323        }
7324        Service {
7325            proc: self.proc.clone(),
7326            selection: query,
7327            graphql_client: self.graphql_client.clone(),
7328        }
7329    }
7330    /// Sets a secret given a user-defined name and the file path on the host, and returns the secret.
7331    /// The file is limited to a size of 512000 bytes.
7332    ///
7333    /// # Arguments
7334    ///
7335    /// * `name` - The user defined name for this secret.
7336    /// * `path` - Location of the file to set as a secret.
7337    pub fn set_secret_file(&self, name: impl Into<String>, path: impl Into<String>) -> Secret {
7338        let mut query = self.selection.select("setSecretFile");
7339        query = query.arg("name", name.into());
7340        query = query.arg("path", path.into());
7341        Secret {
7342            proc: self.proc.clone(),
7343            selection: query,
7344            graphql_client: self.graphql_client.clone(),
7345        }
7346    }
7347    /// Creates a tunnel that forwards traffic from the host to a service.
7348    ///
7349    /// # Arguments
7350    ///
7351    /// * `service` - Service to send traffic from the tunnel.
7352    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7353    pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
7354        let mut query = self.selection.select("tunnel");
7355        query = query.arg_lazy(
7356            "service",
7357            Box::new(move || {
7358                let service = service.clone();
7359                Box::pin(async move { service.into_id().await.unwrap().quote() })
7360            }),
7361        );
7362        Service {
7363            proc: self.proc.clone(),
7364            selection: query,
7365            graphql_client: self.graphql_client.clone(),
7366        }
7367    }
7368    /// Creates a tunnel that forwards traffic from the host to a service.
7369    ///
7370    /// # Arguments
7371    ///
7372    /// * `service` - Service to send traffic from the tunnel.
7373    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7374    pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
7375        let mut query = self.selection.select("tunnel");
7376        query = query.arg_lazy(
7377            "service",
7378            Box::new(move || {
7379                let service = service.clone();
7380                Box::pin(async move { service.into_id().await.unwrap().quote() })
7381            }),
7382        );
7383        if let Some(native) = opts.native {
7384            query = query.arg("native", native);
7385        }
7386        if let Some(ports) = opts.ports {
7387            query = query.arg("ports", ports);
7388        }
7389        Service {
7390            proc: self.proc.clone(),
7391            selection: query,
7392            graphql_client: self.graphql_client.clone(),
7393        }
7394    }
7395    /// Accesses a Unix socket on the host.
7396    ///
7397    /// # Arguments
7398    ///
7399    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
7400    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
7401        let mut query = self.selection.select("unixSocket");
7402        query = query.arg("path", path.into());
7403        Socket {
7404            proc: self.proc.clone(),
7405            selection: query,
7406            graphql_client: self.graphql_client.clone(),
7407        }
7408    }
7409}
7410#[derive(Clone)]
7411pub struct InputTypeDef {
7412    pub proc: Option<Arc<DaggerSessionProc>>,
7413    pub selection: Selection,
7414    pub graphql_client: DynGraphQLClient,
7415}
7416impl InputTypeDef {
7417    /// Static fields defined on this input object, if any.
7418    pub fn fields(&self) -> Vec<FieldTypeDef> {
7419        let query = self.selection.select("fields");
7420        vec![FieldTypeDef {
7421            proc: self.proc.clone(),
7422            selection: query,
7423            graphql_client: self.graphql_client.clone(),
7424        }]
7425    }
7426    /// A unique identifier for this InputTypeDef.
7427    pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
7428        let query = self.selection.select("id");
7429        query.execute(self.graphql_client.clone()).await
7430    }
7431    /// The name of the input object.
7432    pub async fn name(&self) -> Result<String, DaggerError> {
7433        let query = self.selection.select("name");
7434        query.execute(self.graphql_client.clone()).await
7435    }
7436}
7437#[derive(Clone)]
7438pub struct InterfaceTypeDef {
7439    pub proc: Option<Arc<DaggerSessionProc>>,
7440    pub selection: Selection,
7441    pub graphql_client: DynGraphQLClient,
7442}
7443impl InterfaceTypeDef {
7444    /// The doc string for the interface, if any.
7445    pub async fn description(&self) -> Result<String, DaggerError> {
7446        let query = self.selection.select("description");
7447        query.execute(self.graphql_client.clone()).await
7448    }
7449    /// Functions defined on this interface, if any.
7450    pub fn functions(&self) -> Vec<Function> {
7451        let query = self.selection.select("functions");
7452        vec![Function {
7453            proc: self.proc.clone(),
7454            selection: query,
7455            graphql_client: self.graphql_client.clone(),
7456        }]
7457    }
7458    /// A unique identifier for this InterfaceTypeDef.
7459    pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
7460        let query = self.selection.select("id");
7461        query.execute(self.graphql_client.clone()).await
7462    }
7463    /// The name of the interface.
7464    pub async fn name(&self) -> Result<String, DaggerError> {
7465        let query = self.selection.select("name");
7466        query.execute(self.graphql_client.clone()).await
7467    }
7468    /// The location of this interface declaration.
7469    pub fn source_map(&self) -> SourceMap {
7470        let query = self.selection.select("sourceMap");
7471        SourceMap {
7472            proc: self.proc.clone(),
7473            selection: query,
7474            graphql_client: self.graphql_client.clone(),
7475        }
7476    }
7477    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
7478    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
7479        let query = self.selection.select("sourceModuleName");
7480        query.execute(self.graphql_client.clone()).await
7481    }
7482}
7483#[derive(Clone)]
7484pub struct Llm {
7485    pub proc: Option<Arc<DaggerSessionProc>>,
7486    pub selection: Selection,
7487    pub graphql_client: DynGraphQLClient,
7488}
7489impl Llm {
7490    /// create a branch in the LLM's history
7491    pub fn attempt(&self, number: isize) -> Llm {
7492        let mut query = self.selection.select("attempt");
7493        query = query.arg("number", number);
7494        Llm {
7495            proc: self.proc.clone(),
7496            selection: query,
7497            graphql_client: self.graphql_client.clone(),
7498        }
7499    }
7500    /// returns the type of the current state
7501    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
7502        let mut query = self.selection.select("bindResult");
7503        query = query.arg("name", name.into());
7504        Binding {
7505            proc: self.proc.clone(),
7506            selection: query,
7507            graphql_client: self.graphql_client.clone(),
7508        }
7509    }
7510    /// return the LLM's current environment
7511    pub fn env(&self) -> Env {
7512        let query = self.selection.select("env");
7513        Env {
7514            proc: self.proc.clone(),
7515            selection: query,
7516            graphql_client: self.graphql_client.clone(),
7517        }
7518    }
7519    /// return the llm message history
7520    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
7521        let query = self.selection.select("history");
7522        query.execute(self.graphql_client.clone()).await
7523    }
7524    /// return the raw llm message history as json
7525    pub async fn history_json(&self) -> Result<Json, DaggerError> {
7526        let query = self.selection.select("historyJSON");
7527        query.execute(self.graphql_client.clone()).await
7528    }
7529    /// A unique identifier for this LLM.
7530    pub async fn id(&self) -> Result<Llmid, DaggerError> {
7531        let query = self.selection.select("id");
7532        query.execute(self.graphql_client.clone()).await
7533    }
7534    /// return the last llm reply from the history
7535    pub async fn last_reply(&self) -> Result<String, DaggerError> {
7536        let query = self.selection.select("lastReply");
7537        query.execute(self.graphql_client.clone()).await
7538    }
7539    /// synchronize LLM state
7540    pub fn r#loop(&self) -> Llm {
7541        let query = self.selection.select("loop");
7542        Llm {
7543            proc: self.proc.clone(),
7544            selection: query,
7545            graphql_client: self.graphql_client.clone(),
7546        }
7547    }
7548    /// return the model used by the llm
7549    pub async fn model(&self) -> Result<String, DaggerError> {
7550        let query = self.selection.select("model");
7551        query.execute(self.graphql_client.clone()).await
7552    }
7553    /// return the provider used by the llm
7554    pub async fn provider(&self) -> Result<String, DaggerError> {
7555        let query = self.selection.select("provider");
7556        query.execute(self.graphql_client.clone()).await
7557    }
7558    /// synchronize LLM state
7559    pub async fn sync(&self) -> Result<Llmid, DaggerError> {
7560        let query = self.selection.select("sync");
7561        query.execute(self.graphql_client.clone()).await
7562    }
7563    /// returns the token usage of the current state
7564    pub fn token_usage(&self) -> LlmTokenUsage {
7565        let query = self.selection.select("tokenUsage");
7566        LlmTokenUsage {
7567            proc: self.proc.clone(),
7568            selection: query,
7569            graphql_client: self.graphql_client.clone(),
7570        }
7571    }
7572    /// print documentation for available tools
7573    pub async fn tools(&self) -> Result<String, DaggerError> {
7574        let query = self.selection.select("tools");
7575        query.execute(self.graphql_client.clone()).await
7576    }
7577    /// allow the LLM to interact with an environment via MCP
7578    pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
7579        let mut query = self.selection.select("withEnv");
7580        query = query.arg_lazy(
7581            "env",
7582            Box::new(move || {
7583                let env = env.clone();
7584                Box::pin(async move { env.into_id().await.unwrap().quote() })
7585            }),
7586        );
7587        Llm {
7588            proc: self.proc.clone(),
7589            selection: query,
7590            graphql_client: self.graphql_client.clone(),
7591        }
7592    }
7593    /// swap out the llm model
7594    ///
7595    /// # Arguments
7596    ///
7597    /// * `model` - The model to use
7598    pub fn with_model(&self, model: impl Into<String>) -> Llm {
7599        let mut query = self.selection.select("withModel");
7600        query = query.arg("model", model.into());
7601        Llm {
7602            proc: self.proc.clone(),
7603            selection: query,
7604            graphql_client: self.graphql_client.clone(),
7605        }
7606    }
7607    /// append a prompt to the llm context
7608    ///
7609    /// # Arguments
7610    ///
7611    /// * `prompt` - The prompt to send
7612    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
7613        let mut query = self.selection.select("withPrompt");
7614        query = query.arg("prompt", prompt.into());
7615        Llm {
7616            proc: self.proc.clone(),
7617            selection: query,
7618            graphql_client: self.graphql_client.clone(),
7619        }
7620    }
7621    /// append the contents of a file to the llm context
7622    ///
7623    /// # Arguments
7624    ///
7625    /// * `file` - The file to read the prompt from
7626    pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
7627        let mut query = self.selection.select("withPromptFile");
7628        query = query.arg_lazy(
7629            "file",
7630            Box::new(move || {
7631                let file = file.clone();
7632                Box::pin(async move { file.into_id().await.unwrap().quote() })
7633            }),
7634        );
7635        Llm {
7636            proc: self.proc.clone(),
7637            selection: query,
7638            graphql_client: self.graphql_client.clone(),
7639        }
7640    }
7641    /// Add a system prompt to the LLM's environment
7642    ///
7643    /// # Arguments
7644    ///
7645    /// * `prompt` - The system prompt to send
7646    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
7647        let mut query = self.selection.select("withSystemPrompt");
7648        query = query.arg("prompt", prompt.into());
7649        Llm {
7650            proc: self.proc.clone(),
7651            selection: query,
7652            graphql_client: self.graphql_client.clone(),
7653        }
7654    }
7655    /// Disable the default system prompt
7656    pub fn without_default_system_prompt(&self) -> Llm {
7657        let query = self.selection.select("withoutDefaultSystemPrompt");
7658        Llm {
7659            proc: self.proc.clone(),
7660            selection: query,
7661            graphql_client: self.graphql_client.clone(),
7662        }
7663    }
7664}
7665#[derive(Clone)]
7666pub struct LlmTokenUsage {
7667    pub proc: Option<Arc<DaggerSessionProc>>,
7668    pub selection: Selection,
7669    pub graphql_client: DynGraphQLClient,
7670}
7671impl LlmTokenUsage {
7672    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
7673        let query = self.selection.select("cachedTokenReads");
7674        query.execute(self.graphql_client.clone()).await
7675    }
7676    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
7677        let query = self.selection.select("cachedTokenWrites");
7678        query.execute(self.graphql_client.clone()).await
7679    }
7680    /// A unique identifier for this LLMTokenUsage.
7681    pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
7682        let query = self.selection.select("id");
7683        query.execute(self.graphql_client.clone()).await
7684    }
7685    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
7686        let query = self.selection.select("inputTokens");
7687        query.execute(self.graphql_client.clone()).await
7688    }
7689    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
7690        let query = self.selection.select("outputTokens");
7691        query.execute(self.graphql_client.clone()).await
7692    }
7693    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
7694        let query = self.selection.select("totalTokens");
7695        query.execute(self.graphql_client.clone()).await
7696    }
7697}
7698#[derive(Clone)]
7699pub struct Label {
7700    pub proc: Option<Arc<DaggerSessionProc>>,
7701    pub selection: Selection,
7702    pub graphql_client: DynGraphQLClient,
7703}
7704impl Label {
7705    /// A unique identifier for this Label.
7706    pub async fn id(&self) -> Result<LabelId, DaggerError> {
7707        let query = self.selection.select("id");
7708        query.execute(self.graphql_client.clone()).await
7709    }
7710    /// The label name.
7711    pub async fn name(&self) -> Result<String, DaggerError> {
7712        let query = self.selection.select("name");
7713        query.execute(self.graphql_client.clone()).await
7714    }
7715    /// The label value.
7716    pub async fn value(&self) -> Result<String, DaggerError> {
7717        let query = self.selection.select("value");
7718        query.execute(self.graphql_client.clone()).await
7719    }
7720}
7721#[derive(Clone)]
7722pub struct ListTypeDef {
7723    pub proc: Option<Arc<DaggerSessionProc>>,
7724    pub selection: Selection,
7725    pub graphql_client: DynGraphQLClient,
7726}
7727impl ListTypeDef {
7728    /// The type of the elements in the list.
7729    pub fn element_type_def(&self) -> TypeDef {
7730        let query = self.selection.select("elementTypeDef");
7731        TypeDef {
7732            proc: self.proc.clone(),
7733            selection: query,
7734            graphql_client: self.graphql_client.clone(),
7735        }
7736    }
7737    /// A unique identifier for this ListTypeDef.
7738    pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
7739        let query = self.selection.select("id");
7740        query.execute(self.graphql_client.clone()).await
7741    }
7742}
7743#[derive(Clone)]
7744pub struct Module {
7745    pub proc: Option<Arc<DaggerSessionProc>>,
7746    pub selection: Selection,
7747    pub graphql_client: DynGraphQLClient,
7748}
7749#[derive(Builder, Debug, PartialEq)]
7750pub struct ModuleServeOpts {
7751    /// Expose the dependencies of this module to the client
7752    #[builder(setter(into, strip_option), default)]
7753    pub include_dependencies: Option<bool>,
7754}
7755impl Module {
7756    /// The dependencies of the module.
7757    pub fn dependencies(&self) -> Vec<Module> {
7758        let query = self.selection.select("dependencies");
7759        vec![Module {
7760            proc: self.proc.clone(),
7761            selection: query,
7762            graphql_client: self.graphql_client.clone(),
7763        }]
7764    }
7765    /// The doc string of the module, if any
7766    pub async fn description(&self) -> Result<String, DaggerError> {
7767        let query = self.selection.select("description");
7768        query.execute(self.graphql_client.clone()).await
7769    }
7770    /// Enumerations served by this module.
7771    pub fn enums(&self) -> Vec<TypeDef> {
7772        let query = self.selection.select("enums");
7773        vec![TypeDef {
7774            proc: self.proc.clone(),
7775            selection: query,
7776            graphql_client: self.graphql_client.clone(),
7777        }]
7778    }
7779    /// The generated files and directories made on top of the module source's context directory.
7780    pub fn generated_context_directory(&self) -> Directory {
7781        let query = self.selection.select("generatedContextDirectory");
7782        Directory {
7783            proc: self.proc.clone(),
7784            selection: query,
7785            graphql_client: self.graphql_client.clone(),
7786        }
7787    }
7788    /// A unique identifier for this Module.
7789    pub async fn id(&self) -> Result<ModuleId, DaggerError> {
7790        let query = self.selection.select("id");
7791        query.execute(self.graphql_client.clone()).await
7792    }
7793    /// Interfaces served by this module.
7794    pub fn interfaces(&self) -> Vec<TypeDef> {
7795        let query = self.selection.select("interfaces");
7796        vec![TypeDef {
7797            proc: self.proc.clone(),
7798            selection: query,
7799            graphql_client: self.graphql_client.clone(),
7800        }]
7801    }
7802    /// The name of the module
7803    pub async fn name(&self) -> Result<String, DaggerError> {
7804        let query = self.selection.select("name");
7805        query.execute(self.graphql_client.clone()).await
7806    }
7807    /// Objects served by this module.
7808    pub fn objects(&self) -> Vec<TypeDef> {
7809        let query = self.selection.select("objects");
7810        vec![TypeDef {
7811            proc: self.proc.clone(),
7812            selection: query,
7813            graphql_client: self.graphql_client.clone(),
7814        }]
7815    }
7816    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
7817    pub fn runtime(&self) -> Container {
7818        let query = self.selection.select("runtime");
7819        Container {
7820            proc: self.proc.clone(),
7821            selection: query,
7822            graphql_client: self.graphql_client.clone(),
7823        }
7824    }
7825    /// The SDK config used by this module.
7826    pub fn sdk(&self) -> SdkConfig {
7827        let query = self.selection.select("sdk");
7828        SdkConfig {
7829            proc: self.proc.clone(),
7830            selection: query,
7831            graphql_client: self.graphql_client.clone(),
7832        }
7833    }
7834    /// Serve a module's API in the current session.
7835    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
7836    ///
7837    /// # Arguments
7838    ///
7839    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7840    pub async fn serve(&self) -> Result<Void, DaggerError> {
7841        let query = self.selection.select("serve");
7842        query.execute(self.graphql_client.clone()).await
7843    }
7844    /// Serve a module's API in the current session.
7845    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
7846    ///
7847    /// # Arguments
7848    ///
7849    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7850    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
7851        let mut query = self.selection.select("serve");
7852        if let Some(include_dependencies) = opts.include_dependencies {
7853            query = query.arg("includeDependencies", include_dependencies);
7854        }
7855        query.execute(self.graphql_client.clone()).await
7856    }
7857    /// The source for the module.
7858    pub fn source(&self) -> ModuleSource {
7859        let query = self.selection.select("source");
7860        ModuleSource {
7861            proc: self.proc.clone(),
7862            selection: query,
7863            graphql_client: self.graphql_client.clone(),
7864        }
7865    }
7866    /// Forces evaluation of the module, including any loading into the engine and associated validation.
7867    pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
7868        let query = self.selection.select("sync");
7869        query.execute(self.graphql_client.clone()).await
7870    }
7871    /// Retrieves the module with the given description
7872    ///
7873    /// # Arguments
7874    ///
7875    /// * `description` - The description to set
7876    pub fn with_description(&self, description: impl Into<String>) -> Module {
7877        let mut query = self.selection.select("withDescription");
7878        query = query.arg("description", description.into());
7879        Module {
7880            proc: self.proc.clone(),
7881            selection: query,
7882            graphql_client: self.graphql_client.clone(),
7883        }
7884    }
7885    /// This module plus the given Enum type and associated values
7886    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
7887        let mut query = self.selection.select("withEnum");
7888        query = query.arg_lazy(
7889            "enum",
7890            Box::new(move || {
7891                let r#enum = r#enum.clone();
7892                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
7893            }),
7894        );
7895        Module {
7896            proc: self.proc.clone(),
7897            selection: query,
7898            graphql_client: self.graphql_client.clone(),
7899        }
7900    }
7901    /// This module plus the given Interface type and associated functions
7902    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
7903        let mut query = self.selection.select("withInterface");
7904        query = query.arg_lazy(
7905            "iface",
7906            Box::new(move || {
7907                let iface = iface.clone();
7908                Box::pin(async move { iface.into_id().await.unwrap().quote() })
7909            }),
7910        );
7911        Module {
7912            proc: self.proc.clone(),
7913            selection: query,
7914            graphql_client: self.graphql_client.clone(),
7915        }
7916    }
7917    /// This module plus the given Object type and associated functions.
7918    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
7919        let mut query = self.selection.select("withObject");
7920        query = query.arg_lazy(
7921            "object",
7922            Box::new(move || {
7923                let object = object.clone();
7924                Box::pin(async move { object.into_id().await.unwrap().quote() })
7925            }),
7926        );
7927        Module {
7928            proc: self.proc.clone(),
7929            selection: query,
7930            graphql_client: self.graphql_client.clone(),
7931        }
7932    }
7933}
7934#[derive(Clone)]
7935pub struct ModuleConfigClient {
7936    pub proc: Option<Arc<DaggerSessionProc>>,
7937    pub selection: Selection,
7938    pub graphql_client: DynGraphQLClient,
7939}
7940impl ModuleConfigClient {
7941    /// The directory the client is generated in.
7942    pub async fn directory(&self) -> Result<String, DaggerError> {
7943        let query = self.selection.select("directory");
7944        query.execute(self.graphql_client.clone()).await
7945    }
7946    /// The generator to use
7947    pub async fn generator(&self) -> Result<String, DaggerError> {
7948        let query = self.selection.select("generator");
7949        query.execute(self.graphql_client.clone()).await
7950    }
7951    /// A unique identifier for this ModuleConfigClient.
7952    pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
7953        let query = self.selection.select("id");
7954        query.execute(self.graphql_client.clone()).await
7955    }
7956}
7957#[derive(Clone)]
7958pub struct ModuleSource {
7959    pub proc: Option<Arc<DaggerSessionProc>>,
7960    pub selection: Selection,
7961    pub graphql_client: DynGraphQLClient,
7962}
7963impl ModuleSource {
7964    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
7965    pub fn as_module(&self) -> Module {
7966        let query = self.selection.select("asModule");
7967        Module {
7968            proc: self.proc.clone(),
7969            selection: query,
7970            graphql_client: self.graphql_client.clone(),
7971        }
7972    }
7973    /// A human readable ref string representation of this module source.
7974    pub async fn as_string(&self) -> Result<String, DaggerError> {
7975        let query = self.selection.select("asString");
7976        query.execute(self.graphql_client.clone()).await
7977    }
7978    /// The blueprint referenced by the module source.
7979    pub fn blueprint(&self) -> ModuleSource {
7980        let query = self.selection.select("blueprint");
7981        ModuleSource {
7982            proc: self.proc.clone(),
7983            selection: query,
7984            graphql_client: self.graphql_client.clone(),
7985        }
7986    }
7987    /// The ref to clone the root of the git repo from. Only valid for git sources.
7988    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
7989        let query = self.selection.select("cloneRef");
7990        query.execute(self.graphql_client.clone()).await
7991    }
7992    /// The resolved commit of the git repo this source points to.
7993    pub async fn commit(&self) -> Result<String, DaggerError> {
7994        let query = self.selection.select("commit");
7995        query.execute(self.graphql_client.clone()).await
7996    }
7997    /// The clients generated for the module.
7998    pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
7999        let query = self.selection.select("configClients");
8000        vec![ModuleConfigClient {
8001            proc: self.proc.clone(),
8002            selection: query,
8003            graphql_client: self.graphql_client.clone(),
8004        }]
8005    }
8006    /// Whether an existing dagger.json for the module was found.
8007    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
8008        let query = self.selection.select("configExists");
8009        query.execute(self.graphql_client.clone()).await
8010    }
8011    /// The full directory loaded for the module source, including the source code as a subdirectory.
8012    pub fn context_directory(&self) -> Directory {
8013        let query = self.selection.select("contextDirectory");
8014        Directory {
8015            proc: self.proc.clone(),
8016            selection: query,
8017            graphql_client: self.graphql_client.clone(),
8018        }
8019    }
8020    /// The dependencies of the module source.
8021    pub fn dependencies(&self) -> Vec<ModuleSource> {
8022        let query = self.selection.select("dependencies");
8023        vec![ModuleSource {
8024            proc: self.proc.clone(),
8025            selection: query,
8026            graphql_client: self.graphql_client.clone(),
8027        }]
8028    }
8029    /// 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.
8030    pub async fn digest(&self) -> Result<String, DaggerError> {
8031        let query = self.selection.select("digest");
8032        query.execute(self.graphql_client.clone()).await
8033    }
8034    /// The directory containing the module configuration and source code (source code may be in a subdir).
8035    ///
8036    /// # Arguments
8037    ///
8038    /// * `path` - A subpath from the source directory to select.
8039    pub fn directory(&self, path: impl Into<String>) -> Directory {
8040        let mut query = self.selection.select("directory");
8041        query = query.arg("path", path.into());
8042        Directory {
8043            proc: self.proc.clone(),
8044            selection: query,
8045            graphql_client: self.graphql_client.clone(),
8046        }
8047    }
8048    /// The engine version of the module.
8049    pub async fn engine_version(&self) -> Result<String, DaggerError> {
8050        let query = self.selection.select("engineVersion");
8051        query.execute(self.graphql_client.clone()).await
8052    }
8053    /// The generated files and directories made on top of the module source's context directory.
8054    pub fn generated_context_directory(&self) -> Directory {
8055        let query = self.selection.select("generatedContextDirectory");
8056        Directory {
8057            proc: self.proc.clone(),
8058            selection: query,
8059            graphql_client: self.graphql_client.clone(),
8060        }
8061    }
8062    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
8063    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
8064        let query = self.selection.select("htmlRepoURL");
8065        query.execute(self.graphql_client.clone()).await
8066    }
8067    /// The URL to the source's git repo in a web browser. Only valid for git sources.
8068    pub async fn html_url(&self) -> Result<String, DaggerError> {
8069        let query = self.selection.select("htmlURL");
8070        query.execute(self.graphql_client.clone()).await
8071    }
8072    /// A unique identifier for this ModuleSource.
8073    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
8074        let query = self.selection.select("id");
8075        query.execute(self.graphql_client.clone()).await
8076    }
8077    /// The kind of module source (currently local, git or dir).
8078    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
8079        let query = self.selection.select("kind");
8080        query.execute(self.graphql_client.clone()).await
8081    }
8082    /// 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.
8083    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
8084        let query = self.selection.select("localContextDirectoryPath");
8085        query.execute(self.graphql_client.clone()).await
8086    }
8087    /// The name of the module, including any setting via the withName API.
8088    pub async fn module_name(&self) -> Result<String, DaggerError> {
8089        let query = self.selection.select("moduleName");
8090        query.execute(self.graphql_client.clone()).await
8091    }
8092    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
8093    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
8094        let query = self.selection.select("moduleOriginalName");
8095        query.execute(self.graphql_client.clone()).await
8096    }
8097    /// The original subpath used when instantiating this module source, relative to the context directory.
8098    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
8099        let query = self.selection.select("originalSubpath");
8100        query.execute(self.graphql_client.clone()).await
8101    }
8102    /// The pinned version of this module source.
8103    pub async fn pin(&self) -> Result<String, DaggerError> {
8104        let query = self.selection.select("pin");
8105        query.execute(self.graphql_client.clone()).await
8106    }
8107    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
8108    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
8109        let query = self.selection.select("repoRootPath");
8110        query.execute(self.graphql_client.clone()).await
8111    }
8112    /// The SDK configuration of the module.
8113    pub fn sdk(&self) -> SdkConfig {
8114        let query = self.selection.select("sdk");
8115        SdkConfig {
8116            proc: self.proc.clone(),
8117            selection: query,
8118            graphql_client: self.graphql_client.clone(),
8119        }
8120    }
8121    /// The path, relative to the context directory, that contains the module's dagger.json.
8122    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
8123        let query = self.selection.select("sourceRootSubpath");
8124        query.execute(self.graphql_client.clone()).await
8125    }
8126    /// The path to the directory containing the module's source code, relative to the context directory.
8127    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
8128        let query = self.selection.select("sourceSubpath");
8129        query.execute(self.graphql_client.clone()).await
8130    }
8131    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
8132    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
8133        let query = self.selection.select("sync");
8134        query.execute(self.graphql_client.clone()).await
8135    }
8136    /// The specified version of the git repo this source points to.
8137    pub async fn version(&self) -> Result<String, DaggerError> {
8138        let query = self.selection.select("version");
8139        query.execute(self.graphql_client.clone()).await
8140    }
8141    /// Set a blueprint for the module source.
8142    ///
8143    /// # Arguments
8144    ///
8145    /// * `blueprint` - The blueprint module to set.
8146    pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
8147        let mut query = self.selection.select("withBlueprint");
8148        query = query.arg_lazy(
8149            "blueprint",
8150            Box::new(move || {
8151                let blueprint = blueprint.clone();
8152                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
8153            }),
8154        );
8155        ModuleSource {
8156            proc: self.proc.clone(),
8157            selection: query,
8158            graphql_client: self.graphql_client.clone(),
8159        }
8160    }
8161    /// Update the module source with a new client to generate.
8162    ///
8163    /// # Arguments
8164    ///
8165    /// * `generator` - The generator to use
8166    /// * `output_dir` - The output directory for the generated client.
8167    pub fn with_client(
8168        &self,
8169        generator: impl Into<String>,
8170        output_dir: impl Into<String>,
8171    ) -> ModuleSource {
8172        let mut query = self.selection.select("withClient");
8173        query = query.arg("generator", generator.into());
8174        query = query.arg("outputDir", output_dir.into());
8175        ModuleSource {
8176            proc: self.proc.clone(),
8177            selection: query,
8178            graphql_client: self.graphql_client.clone(),
8179        }
8180    }
8181    /// Append the provided dependencies to the module source's dependency list.
8182    ///
8183    /// # Arguments
8184    ///
8185    /// * `dependencies` - The dependencies to append.
8186    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
8187        let mut query = self.selection.select("withDependencies");
8188        query = query.arg("dependencies", dependencies);
8189        ModuleSource {
8190            proc: self.proc.clone(),
8191            selection: query,
8192            graphql_client: self.graphql_client.clone(),
8193        }
8194    }
8195    /// Upgrade the engine version of the module to the given value.
8196    ///
8197    /// # Arguments
8198    ///
8199    /// * `version` - The engine version to upgrade to.
8200    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
8201        let mut query = self.selection.select("withEngineVersion");
8202        query = query.arg("version", version.into());
8203        ModuleSource {
8204            proc: self.proc.clone(),
8205            selection: query,
8206            graphql_client: self.graphql_client.clone(),
8207        }
8208    }
8209    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
8210    ///
8211    /// # Arguments
8212    ///
8213    /// * `patterns` - The new additional include patterns.
8214    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
8215        let mut query = self.selection.select("withIncludes");
8216        query = query.arg(
8217            "patterns",
8218            patterns
8219                .into_iter()
8220                .map(|i| i.into())
8221                .collect::<Vec<String>>(),
8222        );
8223        ModuleSource {
8224            proc: self.proc.clone(),
8225            selection: query,
8226            graphql_client: self.graphql_client.clone(),
8227        }
8228    }
8229    /// Update the module source with a new name.
8230    ///
8231    /// # Arguments
8232    ///
8233    /// * `name` - The name to set.
8234    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
8235        let mut query = self.selection.select("withName");
8236        query = query.arg("name", name.into());
8237        ModuleSource {
8238            proc: self.proc.clone(),
8239            selection: query,
8240            graphql_client: self.graphql_client.clone(),
8241        }
8242    }
8243    /// Update the module source with a new SDK.
8244    ///
8245    /// # Arguments
8246    ///
8247    /// * `source` - The SDK source to set.
8248    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
8249        let mut query = self.selection.select("withSDK");
8250        query = query.arg("source", source.into());
8251        ModuleSource {
8252            proc: self.proc.clone(),
8253            selection: query,
8254            graphql_client: self.graphql_client.clone(),
8255        }
8256    }
8257    /// Update the module source with a new source subpath.
8258    ///
8259    /// # Arguments
8260    ///
8261    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
8262    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
8263        let mut query = self.selection.select("withSourceSubpath");
8264        query = query.arg("path", path.into());
8265        ModuleSource {
8266            proc: self.proc.clone(),
8267            selection: query,
8268            graphql_client: self.graphql_client.clone(),
8269        }
8270    }
8271    /// Update the blueprint module to the latest version.
8272    pub fn with_update_blueprint(&self) -> ModuleSource {
8273        let query = self.selection.select("withUpdateBlueprint");
8274        ModuleSource {
8275            proc: self.proc.clone(),
8276            selection: query,
8277            graphql_client: self.graphql_client.clone(),
8278        }
8279    }
8280    /// Update one or more module dependencies.
8281    ///
8282    /// # Arguments
8283    ///
8284    /// * `dependencies` - The dependencies to update.
8285    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
8286        let mut query = self.selection.select("withUpdateDependencies");
8287        query = query.arg(
8288            "dependencies",
8289            dependencies
8290                .into_iter()
8291                .map(|i| i.into())
8292                .collect::<Vec<String>>(),
8293        );
8294        ModuleSource {
8295            proc: self.proc.clone(),
8296            selection: query,
8297            graphql_client: self.graphql_client.clone(),
8298        }
8299    }
8300    /// Remove the current blueprint from the module source.
8301    pub fn without_blueprint(&self) -> ModuleSource {
8302        let query = self.selection.select("withoutBlueprint");
8303        ModuleSource {
8304            proc: self.proc.clone(),
8305            selection: query,
8306            graphql_client: self.graphql_client.clone(),
8307        }
8308    }
8309    /// Remove a client from the module source.
8310    ///
8311    /// # Arguments
8312    ///
8313    /// * `path` - The path of the client to remove.
8314    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
8315        let mut query = self.selection.select("withoutClient");
8316        query = query.arg("path", path.into());
8317        ModuleSource {
8318            proc: self.proc.clone(),
8319            selection: query,
8320            graphql_client: self.graphql_client.clone(),
8321        }
8322    }
8323    /// Remove the provided dependencies from the module source's dependency list.
8324    ///
8325    /// # Arguments
8326    ///
8327    /// * `dependencies` - The dependencies to remove.
8328    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
8329        let mut query = self.selection.select("withoutDependencies");
8330        query = query.arg(
8331            "dependencies",
8332            dependencies
8333                .into_iter()
8334                .map(|i| i.into())
8335                .collect::<Vec<String>>(),
8336        );
8337        ModuleSource {
8338            proc: self.proc.clone(),
8339            selection: query,
8340            graphql_client: self.graphql_client.clone(),
8341        }
8342    }
8343}
8344#[derive(Clone)]
8345pub struct ObjectTypeDef {
8346    pub proc: Option<Arc<DaggerSessionProc>>,
8347    pub selection: Selection,
8348    pub graphql_client: DynGraphQLClient,
8349}
8350impl ObjectTypeDef {
8351    /// The function used to construct new instances of this object, if any
8352    pub fn constructor(&self) -> Function {
8353        let query = self.selection.select("constructor");
8354        Function {
8355            proc: self.proc.clone(),
8356            selection: query,
8357            graphql_client: self.graphql_client.clone(),
8358        }
8359    }
8360    /// The doc string for the object, if any.
8361    pub async fn description(&self) -> Result<String, DaggerError> {
8362        let query = self.selection.select("description");
8363        query.execute(self.graphql_client.clone()).await
8364    }
8365    /// Static fields defined on this object, if any.
8366    pub fn fields(&self) -> Vec<FieldTypeDef> {
8367        let query = self.selection.select("fields");
8368        vec![FieldTypeDef {
8369            proc: self.proc.clone(),
8370            selection: query,
8371            graphql_client: self.graphql_client.clone(),
8372        }]
8373    }
8374    /// Functions defined on this object, if any.
8375    pub fn functions(&self) -> Vec<Function> {
8376        let query = self.selection.select("functions");
8377        vec![Function {
8378            proc: self.proc.clone(),
8379            selection: query,
8380            graphql_client: self.graphql_client.clone(),
8381        }]
8382    }
8383    /// A unique identifier for this ObjectTypeDef.
8384    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
8385        let query = self.selection.select("id");
8386        query.execute(self.graphql_client.clone()).await
8387    }
8388    /// The name of the object.
8389    pub async fn name(&self) -> Result<String, DaggerError> {
8390        let query = self.selection.select("name");
8391        query.execute(self.graphql_client.clone()).await
8392    }
8393    /// The location of this object declaration.
8394    pub fn source_map(&self) -> SourceMap {
8395        let query = self.selection.select("sourceMap");
8396        SourceMap {
8397            proc: self.proc.clone(),
8398            selection: query,
8399            graphql_client: self.graphql_client.clone(),
8400        }
8401    }
8402    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
8403    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8404        let query = self.selection.select("sourceModuleName");
8405        query.execute(self.graphql_client.clone()).await
8406    }
8407}
8408#[derive(Clone)]
8409pub struct Port {
8410    pub proc: Option<Arc<DaggerSessionProc>>,
8411    pub selection: Selection,
8412    pub graphql_client: DynGraphQLClient,
8413}
8414impl Port {
8415    /// The port description.
8416    pub async fn description(&self) -> Result<String, DaggerError> {
8417        let query = self.selection.select("description");
8418        query.execute(self.graphql_client.clone()).await
8419    }
8420    /// Skip the health check when run as a service.
8421    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
8422        let query = self.selection.select("experimentalSkipHealthcheck");
8423        query.execute(self.graphql_client.clone()).await
8424    }
8425    /// A unique identifier for this Port.
8426    pub async fn id(&self) -> Result<PortId, DaggerError> {
8427        let query = self.selection.select("id");
8428        query.execute(self.graphql_client.clone()).await
8429    }
8430    /// The port number.
8431    pub async fn port(&self) -> Result<isize, DaggerError> {
8432        let query = self.selection.select("port");
8433        query.execute(self.graphql_client.clone()).await
8434    }
8435    /// The transport layer protocol.
8436    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
8437        let query = self.selection.select("protocol");
8438        query.execute(self.graphql_client.clone()).await
8439    }
8440}
8441#[derive(Clone)]
8442pub struct Query {
8443    pub proc: Option<Arc<DaggerSessionProc>>,
8444    pub selection: Selection,
8445    pub graphql_client: DynGraphQLClient,
8446}
8447#[derive(Builder, Debug, PartialEq)]
8448pub struct QueryContainerOpts {
8449    /// Platform to initialize the container with. Defaults to the native platform of the current engine
8450    #[builder(setter(into, strip_option), default)]
8451    pub platform: Option<Platform>,
8452}
8453#[derive(Builder, Debug, PartialEq)]
8454pub struct QueryEnvOpts {
8455    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
8456    #[builder(setter(into, strip_option), default)]
8457    pub privileged: Option<bool>,
8458    /// Allow new outputs to be declared and saved in the environment
8459    #[builder(setter(into, strip_option), default)]
8460    pub writable: Option<bool>,
8461}
8462#[derive(Builder, Debug, PartialEq)]
8463pub struct QueryFileOpts {
8464    /// Permissions of the new file. Example: 0600
8465    #[builder(setter(into, strip_option), default)]
8466    pub permissions: Option<isize>,
8467}
8468#[derive(Builder, Debug, PartialEq)]
8469pub struct QueryGitOpts<'a> {
8470    /// A service which must be started before the repo is fetched.
8471    #[builder(setter(into, strip_option), default)]
8472    pub experimental_service_host: Option<ServiceId>,
8473    /// Secret used to populate the Authorization HTTP header
8474    #[builder(setter(into, strip_option), default)]
8475    pub http_auth_header: Option<SecretId>,
8476    /// Secret used to populate the password during basic HTTP Authorization
8477    #[builder(setter(into, strip_option), default)]
8478    pub http_auth_token: Option<SecretId>,
8479    /// Username used to populate the password during basic HTTP Authorization
8480    #[builder(setter(into, strip_option), default)]
8481    pub http_auth_username: Option<&'a str>,
8482    /// DEPRECATED: Set to true to keep .git directory.
8483    #[builder(setter(into, strip_option), default)]
8484    pub keep_git_dir: Option<bool>,
8485    /// Set SSH auth socket
8486    #[builder(setter(into, strip_option), default)]
8487    pub ssh_auth_socket: Option<SocketId>,
8488    /// Set SSH known hosts
8489    #[builder(setter(into, strip_option), default)]
8490    pub ssh_known_hosts: Option<&'a str>,
8491}
8492#[derive(Builder, Debug, PartialEq)]
8493pub struct QueryHttpOpts<'a> {
8494    /// Secret used to populate the Authorization HTTP header
8495    #[builder(setter(into, strip_option), default)]
8496    pub auth_header: Option<SecretId>,
8497    /// A service which must be started before the URL is fetched.
8498    #[builder(setter(into, strip_option), default)]
8499    pub experimental_service_host: Option<ServiceId>,
8500    /// File name to use for the file. Defaults to the last part of the URL.
8501    #[builder(setter(into, strip_option), default)]
8502    pub name: Option<&'a str>,
8503    /// Permissions to set on the file.
8504    #[builder(setter(into, strip_option), default)]
8505    pub permissions: Option<isize>,
8506}
8507#[derive(Builder, Debug, PartialEq)]
8508pub struct QueryLlmOpts<'a> {
8509    /// Cap the number of API calls for this LLM
8510    #[builder(setter(into, strip_option), default)]
8511    pub max_api_calls: Option<isize>,
8512    /// Model to use
8513    #[builder(setter(into, strip_option), default)]
8514    pub model: Option<&'a str>,
8515}
8516#[derive(Builder, Debug, PartialEq)]
8517pub struct QueryModuleSourceOpts<'a> {
8518    /// 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.
8519    #[builder(setter(into, strip_option), default)]
8520    pub allow_not_exists: Option<bool>,
8521    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
8522    #[builder(setter(into, strip_option), default)]
8523    pub disable_find_up: Option<bool>,
8524    /// The pinned version of the module source
8525    #[builder(setter(into, strip_option), default)]
8526    pub ref_pin: Option<&'a str>,
8527    /// If set, error out if the ref string is not of the provided requireKind.
8528    #[builder(setter(into, strip_option), default)]
8529    pub require_kind: Option<ModuleSourceKind>,
8530}
8531#[derive(Builder, Debug, PartialEq)]
8532pub struct QuerySecretOpts<'a> {
8533    /// If set, the given string will be used as the cache key for this secret. This means that any secrets with the same cache key will be considered equivalent in terms of cache lookups, even if they have different URIs or plaintext values.
8534    /// For example, two secrets with the same cache key provided as secret env vars to other wise equivalent containers will result in the container withExecs hitting the cache for each other.
8535    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
8536    #[builder(setter(into, strip_option), default)]
8537    pub cache_key: Option<&'a str>,
8538}
8539impl Query {
8540    /// Constructs a cache volume for a given cache key.
8541    ///
8542    /// # Arguments
8543    ///
8544    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
8545    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
8546        let mut query = self.selection.select("cacheVolume");
8547        query = query.arg("key", key.into());
8548        CacheVolume {
8549            proc: self.proc.clone(),
8550            selection: query,
8551            graphql_client: self.graphql_client.clone(),
8552        }
8553    }
8554    /// Dagger Cloud configuration and state
8555    pub fn cloud(&self) -> Cloud {
8556        let query = self.selection.select("cloud");
8557        Cloud {
8558            proc: self.proc.clone(),
8559            selection: query,
8560            graphql_client: self.graphql_client.clone(),
8561        }
8562    }
8563    /// Creates a scratch container, with no image or metadata.
8564    /// To pull an image, follow up with the "from" function.
8565    ///
8566    /// # Arguments
8567    ///
8568    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8569    pub fn container(&self) -> Container {
8570        let query = self.selection.select("container");
8571        Container {
8572            proc: self.proc.clone(),
8573            selection: query,
8574            graphql_client: self.graphql_client.clone(),
8575        }
8576    }
8577    /// Creates a scratch container, with no image or metadata.
8578    /// To pull an image, follow up with the "from" function.
8579    ///
8580    /// # Arguments
8581    ///
8582    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8583    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
8584        let mut query = self.selection.select("container");
8585        if let Some(platform) = opts.platform {
8586            query = query.arg("platform", platform);
8587        }
8588        Container {
8589            proc: self.proc.clone(),
8590            selection: query,
8591            graphql_client: self.graphql_client.clone(),
8592        }
8593    }
8594    /// The FunctionCall context that the SDK caller is currently executing in.
8595    /// If the caller is not currently executing in a function, this will return an error.
8596    pub fn current_function_call(&self) -> FunctionCall {
8597        let query = self.selection.select("currentFunctionCall");
8598        FunctionCall {
8599            proc: self.proc.clone(),
8600            selection: query,
8601            graphql_client: self.graphql_client.clone(),
8602        }
8603    }
8604    /// The module currently being served in the session, if any.
8605    pub fn current_module(&self) -> CurrentModule {
8606        let query = self.selection.select("currentModule");
8607        CurrentModule {
8608            proc: self.proc.clone(),
8609            selection: query,
8610            graphql_client: self.graphql_client.clone(),
8611        }
8612    }
8613    /// The TypeDef representations of the objects currently being served in the session.
8614    pub fn current_type_defs(&self) -> Vec<TypeDef> {
8615        let query = self.selection.select("currentTypeDefs");
8616        vec![TypeDef {
8617            proc: self.proc.clone(),
8618            selection: query,
8619            graphql_client: self.graphql_client.clone(),
8620        }]
8621    }
8622    /// The default platform of the engine.
8623    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
8624        let query = self.selection.select("defaultPlatform");
8625        query.execute(self.graphql_client.clone()).await
8626    }
8627    /// Creates an empty directory.
8628    pub fn directory(&self) -> Directory {
8629        let query = self.selection.select("directory");
8630        Directory {
8631            proc: self.proc.clone(),
8632            selection: query,
8633            graphql_client: self.graphql_client.clone(),
8634        }
8635    }
8636    /// The Dagger engine container configuration and state
8637    pub fn engine(&self) -> Engine {
8638        let query = self.selection.select("engine");
8639        Engine {
8640            proc: self.proc.clone(),
8641            selection: query,
8642            graphql_client: self.graphql_client.clone(),
8643        }
8644    }
8645    /// Initialize a new environment
8646    ///
8647    /// # Arguments
8648    ///
8649    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8650    pub fn env(&self) -> Env {
8651        let query = self.selection.select("env");
8652        Env {
8653            proc: self.proc.clone(),
8654            selection: query,
8655            graphql_client: self.graphql_client.clone(),
8656        }
8657    }
8658    /// Initialize a new environment
8659    ///
8660    /// # Arguments
8661    ///
8662    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8663    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
8664        let mut query = self.selection.select("env");
8665        if let Some(privileged) = opts.privileged {
8666            query = query.arg("privileged", privileged);
8667        }
8668        if let Some(writable) = opts.writable {
8669            query = query.arg("writable", writable);
8670        }
8671        Env {
8672            proc: self.proc.clone(),
8673            selection: query,
8674            graphql_client: self.graphql_client.clone(),
8675        }
8676    }
8677    /// Create a new error.
8678    ///
8679    /// # Arguments
8680    ///
8681    /// * `message` - A brief description of the error.
8682    pub fn error(&self, message: impl Into<String>) -> Error {
8683        let mut query = self.selection.select("error");
8684        query = query.arg("message", message.into());
8685        Error {
8686            proc: self.proc.clone(),
8687            selection: query,
8688            graphql_client: self.graphql_client.clone(),
8689        }
8690    }
8691    /// Creates a file with the specified contents.
8692    ///
8693    /// # Arguments
8694    ///
8695    /// * `name` - Name of the new file. Example: "foo.txt"
8696    /// * `contents` - Contents of the new file. Example: "Hello world!"
8697    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8698    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
8699        let mut query = self.selection.select("file");
8700        query = query.arg("name", name.into());
8701        query = query.arg("contents", contents.into());
8702        File {
8703            proc: self.proc.clone(),
8704            selection: query,
8705            graphql_client: self.graphql_client.clone(),
8706        }
8707    }
8708    /// Creates a file with the specified contents.
8709    ///
8710    /// # Arguments
8711    ///
8712    /// * `name` - Name of the new file. Example: "foo.txt"
8713    /// * `contents` - Contents of the new file. Example: "Hello world!"
8714    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8715    pub fn file_opts(
8716        &self,
8717        name: impl Into<String>,
8718        contents: impl Into<String>,
8719        opts: QueryFileOpts,
8720    ) -> File {
8721        let mut query = self.selection.select("file");
8722        query = query.arg("name", name.into());
8723        query = query.arg("contents", contents.into());
8724        if let Some(permissions) = opts.permissions {
8725            query = query.arg("permissions", permissions);
8726        }
8727        File {
8728            proc: self.proc.clone(),
8729            selection: query,
8730            graphql_client: self.graphql_client.clone(),
8731        }
8732    }
8733    /// Creates a function.
8734    ///
8735    /// # Arguments
8736    ///
8737    /// * `name` - Name of the function, in its original format from the implementation language.
8738    /// * `return_type` - Return type of the function.
8739    pub fn function(
8740        &self,
8741        name: impl Into<String>,
8742        return_type: impl IntoID<TypeDefId>,
8743    ) -> Function {
8744        let mut query = self.selection.select("function");
8745        query = query.arg("name", name.into());
8746        query = query.arg_lazy(
8747            "returnType",
8748            Box::new(move || {
8749                let return_type = return_type.clone();
8750                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
8751            }),
8752        );
8753        Function {
8754            proc: self.proc.clone(),
8755            selection: query,
8756            graphql_client: self.graphql_client.clone(),
8757        }
8758    }
8759    /// Create a code generation result, given a directory containing the generated code.
8760    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
8761        let mut query = self.selection.select("generatedCode");
8762        query = query.arg_lazy(
8763            "code",
8764            Box::new(move || {
8765                let code = code.clone();
8766                Box::pin(async move { code.into_id().await.unwrap().quote() })
8767            }),
8768        );
8769        GeneratedCode {
8770            proc: self.proc.clone(),
8771            selection: query,
8772            graphql_client: self.graphql_client.clone(),
8773        }
8774    }
8775    /// Queries a Git repository.
8776    ///
8777    /// # Arguments
8778    ///
8779    /// * `url` - URL of the git repository.
8780    ///
8781    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
8782    ///
8783    /// Suffix ".git" is optional.
8784    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8785    pub fn git(&self, url: impl Into<String>) -> GitRepository {
8786        let mut query = self.selection.select("git");
8787        query = query.arg("url", url.into());
8788        GitRepository {
8789            proc: self.proc.clone(),
8790            selection: query,
8791            graphql_client: self.graphql_client.clone(),
8792        }
8793    }
8794    /// Queries a Git repository.
8795    ///
8796    /// # Arguments
8797    ///
8798    /// * `url` - URL of the git repository.
8799    ///
8800    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
8801    ///
8802    /// Suffix ".git" is optional.
8803    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8804    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
8805        let mut query = self.selection.select("git");
8806        query = query.arg("url", url.into());
8807        if let Some(keep_git_dir) = opts.keep_git_dir {
8808            query = query.arg("keepGitDir", keep_git_dir);
8809        }
8810        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
8811            query = query.arg("sshKnownHosts", ssh_known_hosts);
8812        }
8813        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
8814            query = query.arg("sshAuthSocket", ssh_auth_socket);
8815        }
8816        if let Some(http_auth_username) = opts.http_auth_username {
8817            query = query.arg("httpAuthUsername", http_auth_username);
8818        }
8819        if let Some(http_auth_token) = opts.http_auth_token {
8820            query = query.arg("httpAuthToken", http_auth_token);
8821        }
8822        if let Some(http_auth_header) = opts.http_auth_header {
8823            query = query.arg("httpAuthHeader", http_auth_header);
8824        }
8825        if let Some(experimental_service_host) = opts.experimental_service_host {
8826            query = query.arg("experimentalServiceHost", experimental_service_host);
8827        }
8828        GitRepository {
8829            proc: self.proc.clone(),
8830            selection: query,
8831            graphql_client: self.graphql_client.clone(),
8832        }
8833    }
8834    /// Queries the host environment.
8835    pub fn host(&self) -> Host {
8836        let query = self.selection.select("host");
8837        Host {
8838            proc: self.proc.clone(),
8839            selection: query,
8840            graphql_client: self.graphql_client.clone(),
8841        }
8842    }
8843    /// Returns a file containing an http remote url content.
8844    ///
8845    /// # Arguments
8846    ///
8847    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
8848    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8849    pub fn http(&self, url: impl Into<String>) -> File {
8850        let mut query = self.selection.select("http");
8851        query = query.arg("url", url.into());
8852        File {
8853            proc: self.proc.clone(),
8854            selection: query,
8855            graphql_client: self.graphql_client.clone(),
8856        }
8857    }
8858    /// Returns a file containing an http remote url content.
8859    ///
8860    /// # Arguments
8861    ///
8862    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
8863    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8864    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
8865        let mut query = self.selection.select("http");
8866        query = query.arg("url", url.into());
8867        if let Some(name) = opts.name {
8868            query = query.arg("name", name);
8869        }
8870        if let Some(permissions) = opts.permissions {
8871            query = query.arg("permissions", permissions);
8872        }
8873        if let Some(auth_header) = opts.auth_header {
8874            query = query.arg("authHeader", auth_header);
8875        }
8876        if let Some(experimental_service_host) = opts.experimental_service_host {
8877            query = query.arg("experimentalServiceHost", experimental_service_host);
8878        }
8879        File {
8880            proc: self.proc.clone(),
8881            selection: query,
8882            graphql_client: self.graphql_client.clone(),
8883        }
8884    }
8885    /// Initialize a Large Language Model (LLM)
8886    ///
8887    /// # Arguments
8888    ///
8889    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8890    pub fn llm(&self) -> Llm {
8891        let query = self.selection.select("llm");
8892        Llm {
8893            proc: self.proc.clone(),
8894            selection: query,
8895            graphql_client: self.graphql_client.clone(),
8896        }
8897    }
8898    /// Initialize a Large Language Model (LLM)
8899    ///
8900    /// # Arguments
8901    ///
8902    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8903    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
8904        let mut query = self.selection.select("llm");
8905        if let Some(model) = opts.model {
8906            query = query.arg("model", model);
8907        }
8908        if let Some(max_api_calls) = opts.max_api_calls {
8909            query = query.arg("maxAPICalls", max_api_calls);
8910        }
8911        Llm {
8912            proc: self.proc.clone(),
8913            selection: query,
8914            graphql_client: self.graphql_client.clone(),
8915        }
8916    }
8917    /// Load a Binding from its ID.
8918    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
8919        let mut query = self.selection.select("loadBindingFromID");
8920        query = query.arg_lazy(
8921            "id",
8922            Box::new(move || {
8923                let id = id.clone();
8924                Box::pin(async move { id.into_id().await.unwrap().quote() })
8925            }),
8926        );
8927        Binding {
8928            proc: self.proc.clone(),
8929            selection: query,
8930            graphql_client: self.graphql_client.clone(),
8931        }
8932    }
8933    /// Load a CacheVolume from its ID.
8934    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
8935        let mut query = self.selection.select("loadCacheVolumeFromID");
8936        query = query.arg_lazy(
8937            "id",
8938            Box::new(move || {
8939                let id = id.clone();
8940                Box::pin(async move { id.into_id().await.unwrap().quote() })
8941            }),
8942        );
8943        CacheVolume {
8944            proc: self.proc.clone(),
8945            selection: query,
8946            graphql_client: self.graphql_client.clone(),
8947        }
8948    }
8949    /// Load a Cloud from its ID.
8950    pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
8951        let mut query = self.selection.select("loadCloudFromID");
8952        query = query.arg_lazy(
8953            "id",
8954            Box::new(move || {
8955                let id = id.clone();
8956                Box::pin(async move { id.into_id().await.unwrap().quote() })
8957            }),
8958        );
8959        Cloud {
8960            proc: self.proc.clone(),
8961            selection: query,
8962            graphql_client: self.graphql_client.clone(),
8963        }
8964    }
8965    /// Load a Container from its ID.
8966    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
8967        let mut query = self.selection.select("loadContainerFromID");
8968        query = query.arg_lazy(
8969            "id",
8970            Box::new(move || {
8971                let id = id.clone();
8972                Box::pin(async move { id.into_id().await.unwrap().quote() })
8973            }),
8974        );
8975        Container {
8976            proc: self.proc.clone(),
8977            selection: query,
8978            graphql_client: self.graphql_client.clone(),
8979        }
8980    }
8981    /// Load a CurrentModule from its ID.
8982    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
8983        let mut query = self.selection.select("loadCurrentModuleFromID");
8984        query = query.arg_lazy(
8985            "id",
8986            Box::new(move || {
8987                let id = id.clone();
8988                Box::pin(async move { id.into_id().await.unwrap().quote() })
8989            }),
8990        );
8991        CurrentModule {
8992            proc: self.proc.clone(),
8993            selection: query,
8994            graphql_client: self.graphql_client.clone(),
8995        }
8996    }
8997    /// Load a Directory from its ID.
8998    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
8999        let mut query = self.selection.select("loadDirectoryFromID");
9000        query = query.arg_lazy(
9001            "id",
9002            Box::new(move || {
9003                let id = id.clone();
9004                Box::pin(async move { id.into_id().await.unwrap().quote() })
9005            }),
9006        );
9007        Directory {
9008            proc: self.proc.clone(),
9009            selection: query,
9010            graphql_client: self.graphql_client.clone(),
9011        }
9012    }
9013    /// Load a EngineCacheEntry from its ID.
9014    pub fn load_engine_cache_entry_from_id(
9015        &self,
9016        id: impl IntoID<EngineCacheEntryId>,
9017    ) -> EngineCacheEntry {
9018        let mut query = self.selection.select("loadEngineCacheEntryFromID");
9019        query = query.arg_lazy(
9020            "id",
9021            Box::new(move || {
9022                let id = id.clone();
9023                Box::pin(async move { id.into_id().await.unwrap().quote() })
9024            }),
9025        );
9026        EngineCacheEntry {
9027            proc: self.proc.clone(),
9028            selection: query,
9029            graphql_client: self.graphql_client.clone(),
9030        }
9031    }
9032    /// Load a EngineCacheEntrySet from its ID.
9033    pub fn load_engine_cache_entry_set_from_id(
9034        &self,
9035        id: impl IntoID<EngineCacheEntrySetId>,
9036    ) -> EngineCacheEntrySet {
9037        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
9038        query = query.arg_lazy(
9039            "id",
9040            Box::new(move || {
9041                let id = id.clone();
9042                Box::pin(async move { id.into_id().await.unwrap().quote() })
9043            }),
9044        );
9045        EngineCacheEntrySet {
9046            proc: self.proc.clone(),
9047            selection: query,
9048            graphql_client: self.graphql_client.clone(),
9049        }
9050    }
9051    /// Load a EngineCache from its ID.
9052    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
9053        let mut query = self.selection.select("loadEngineCacheFromID");
9054        query = query.arg_lazy(
9055            "id",
9056            Box::new(move || {
9057                let id = id.clone();
9058                Box::pin(async move { id.into_id().await.unwrap().quote() })
9059            }),
9060        );
9061        EngineCache {
9062            proc: self.proc.clone(),
9063            selection: query,
9064            graphql_client: self.graphql_client.clone(),
9065        }
9066    }
9067    /// Load a Engine from its ID.
9068    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
9069        let mut query = self.selection.select("loadEngineFromID");
9070        query = query.arg_lazy(
9071            "id",
9072            Box::new(move || {
9073                let id = id.clone();
9074                Box::pin(async move { id.into_id().await.unwrap().quote() })
9075            }),
9076        );
9077        Engine {
9078            proc: self.proc.clone(),
9079            selection: query,
9080            graphql_client: self.graphql_client.clone(),
9081        }
9082    }
9083    /// Load a EnumTypeDef from its ID.
9084    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
9085        let mut query = self.selection.select("loadEnumTypeDefFromID");
9086        query = query.arg_lazy(
9087            "id",
9088            Box::new(move || {
9089                let id = id.clone();
9090                Box::pin(async move { id.into_id().await.unwrap().quote() })
9091            }),
9092        );
9093        EnumTypeDef {
9094            proc: self.proc.clone(),
9095            selection: query,
9096            graphql_client: self.graphql_client.clone(),
9097        }
9098    }
9099    /// Load a EnumValueTypeDef from its ID.
9100    pub fn load_enum_value_type_def_from_id(
9101        &self,
9102        id: impl IntoID<EnumValueTypeDefId>,
9103    ) -> EnumValueTypeDef {
9104        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
9105        query = query.arg_lazy(
9106            "id",
9107            Box::new(move || {
9108                let id = id.clone();
9109                Box::pin(async move { id.into_id().await.unwrap().quote() })
9110            }),
9111        );
9112        EnumValueTypeDef {
9113            proc: self.proc.clone(),
9114            selection: query,
9115            graphql_client: self.graphql_client.clone(),
9116        }
9117    }
9118    /// Load a Env from its ID.
9119    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
9120        let mut query = self.selection.select("loadEnvFromID");
9121        query = query.arg_lazy(
9122            "id",
9123            Box::new(move || {
9124                let id = id.clone();
9125                Box::pin(async move { id.into_id().await.unwrap().quote() })
9126            }),
9127        );
9128        Env {
9129            proc: self.proc.clone(),
9130            selection: query,
9131            graphql_client: self.graphql_client.clone(),
9132        }
9133    }
9134    /// Load a EnvVariable from its ID.
9135    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
9136        let mut query = self.selection.select("loadEnvVariableFromID");
9137        query = query.arg_lazy(
9138            "id",
9139            Box::new(move || {
9140                let id = id.clone();
9141                Box::pin(async move { id.into_id().await.unwrap().quote() })
9142            }),
9143        );
9144        EnvVariable {
9145            proc: self.proc.clone(),
9146            selection: query,
9147            graphql_client: self.graphql_client.clone(),
9148        }
9149    }
9150    /// Load a Error from its ID.
9151    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
9152        let mut query = self.selection.select("loadErrorFromID");
9153        query = query.arg_lazy(
9154            "id",
9155            Box::new(move || {
9156                let id = id.clone();
9157                Box::pin(async move { id.into_id().await.unwrap().quote() })
9158            }),
9159        );
9160        Error {
9161            proc: self.proc.clone(),
9162            selection: query,
9163            graphql_client: self.graphql_client.clone(),
9164        }
9165    }
9166    /// Load a ErrorValue from its ID.
9167    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
9168        let mut query = self.selection.select("loadErrorValueFromID");
9169        query = query.arg_lazy(
9170            "id",
9171            Box::new(move || {
9172                let id = id.clone();
9173                Box::pin(async move { id.into_id().await.unwrap().quote() })
9174            }),
9175        );
9176        ErrorValue {
9177            proc: self.proc.clone(),
9178            selection: query,
9179            graphql_client: self.graphql_client.clone(),
9180        }
9181    }
9182    /// Load a FieldTypeDef from its ID.
9183    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
9184        let mut query = self.selection.select("loadFieldTypeDefFromID");
9185        query = query.arg_lazy(
9186            "id",
9187            Box::new(move || {
9188                let id = id.clone();
9189                Box::pin(async move { id.into_id().await.unwrap().quote() })
9190            }),
9191        );
9192        FieldTypeDef {
9193            proc: self.proc.clone(),
9194            selection: query,
9195            graphql_client: self.graphql_client.clone(),
9196        }
9197    }
9198    /// Load a File from its ID.
9199    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
9200        let mut query = self.selection.select("loadFileFromID");
9201        query = query.arg_lazy(
9202            "id",
9203            Box::new(move || {
9204                let id = id.clone();
9205                Box::pin(async move { id.into_id().await.unwrap().quote() })
9206            }),
9207        );
9208        File {
9209            proc: self.proc.clone(),
9210            selection: query,
9211            graphql_client: self.graphql_client.clone(),
9212        }
9213    }
9214    /// Load a FunctionArg from its ID.
9215    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
9216        let mut query = self.selection.select("loadFunctionArgFromID");
9217        query = query.arg_lazy(
9218            "id",
9219            Box::new(move || {
9220                let id = id.clone();
9221                Box::pin(async move { id.into_id().await.unwrap().quote() })
9222            }),
9223        );
9224        FunctionArg {
9225            proc: self.proc.clone(),
9226            selection: query,
9227            graphql_client: self.graphql_client.clone(),
9228        }
9229    }
9230    /// Load a FunctionCallArgValue from its ID.
9231    pub fn load_function_call_arg_value_from_id(
9232        &self,
9233        id: impl IntoID<FunctionCallArgValueId>,
9234    ) -> FunctionCallArgValue {
9235        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
9236        query = query.arg_lazy(
9237            "id",
9238            Box::new(move || {
9239                let id = id.clone();
9240                Box::pin(async move { id.into_id().await.unwrap().quote() })
9241            }),
9242        );
9243        FunctionCallArgValue {
9244            proc: self.proc.clone(),
9245            selection: query,
9246            graphql_client: self.graphql_client.clone(),
9247        }
9248    }
9249    /// Load a FunctionCall from its ID.
9250    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
9251        let mut query = self.selection.select("loadFunctionCallFromID");
9252        query = query.arg_lazy(
9253            "id",
9254            Box::new(move || {
9255                let id = id.clone();
9256                Box::pin(async move { id.into_id().await.unwrap().quote() })
9257            }),
9258        );
9259        FunctionCall {
9260            proc: self.proc.clone(),
9261            selection: query,
9262            graphql_client: self.graphql_client.clone(),
9263        }
9264    }
9265    /// Load a Function from its ID.
9266    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
9267        let mut query = self.selection.select("loadFunctionFromID");
9268        query = query.arg_lazy(
9269            "id",
9270            Box::new(move || {
9271                let id = id.clone();
9272                Box::pin(async move { id.into_id().await.unwrap().quote() })
9273            }),
9274        );
9275        Function {
9276            proc: self.proc.clone(),
9277            selection: query,
9278            graphql_client: self.graphql_client.clone(),
9279        }
9280    }
9281    /// Load a GeneratedCode from its ID.
9282    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
9283        let mut query = self.selection.select("loadGeneratedCodeFromID");
9284        query = query.arg_lazy(
9285            "id",
9286            Box::new(move || {
9287                let id = id.clone();
9288                Box::pin(async move { id.into_id().await.unwrap().quote() })
9289            }),
9290        );
9291        GeneratedCode {
9292            proc: self.proc.clone(),
9293            selection: query,
9294            graphql_client: self.graphql_client.clone(),
9295        }
9296    }
9297    /// Load a GitRef from its ID.
9298    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
9299        let mut query = self.selection.select("loadGitRefFromID");
9300        query = query.arg_lazy(
9301            "id",
9302            Box::new(move || {
9303                let id = id.clone();
9304                Box::pin(async move { id.into_id().await.unwrap().quote() })
9305            }),
9306        );
9307        GitRef {
9308            proc: self.proc.clone(),
9309            selection: query,
9310            graphql_client: self.graphql_client.clone(),
9311        }
9312    }
9313    /// Load a GitRepository from its ID.
9314    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
9315        let mut query = self.selection.select("loadGitRepositoryFromID");
9316        query = query.arg_lazy(
9317            "id",
9318            Box::new(move || {
9319                let id = id.clone();
9320                Box::pin(async move { id.into_id().await.unwrap().quote() })
9321            }),
9322        );
9323        GitRepository {
9324            proc: self.proc.clone(),
9325            selection: query,
9326            graphql_client: self.graphql_client.clone(),
9327        }
9328    }
9329    /// Load a Host from its ID.
9330    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
9331        let mut query = self.selection.select("loadHostFromID");
9332        query = query.arg_lazy(
9333            "id",
9334            Box::new(move || {
9335                let id = id.clone();
9336                Box::pin(async move { id.into_id().await.unwrap().quote() })
9337            }),
9338        );
9339        Host {
9340            proc: self.proc.clone(),
9341            selection: query,
9342            graphql_client: self.graphql_client.clone(),
9343        }
9344    }
9345    /// Load a InputTypeDef from its ID.
9346    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
9347        let mut query = self.selection.select("loadInputTypeDefFromID");
9348        query = query.arg_lazy(
9349            "id",
9350            Box::new(move || {
9351                let id = id.clone();
9352                Box::pin(async move { id.into_id().await.unwrap().quote() })
9353            }),
9354        );
9355        InputTypeDef {
9356            proc: self.proc.clone(),
9357            selection: query,
9358            graphql_client: self.graphql_client.clone(),
9359        }
9360    }
9361    /// Load a InterfaceTypeDef from its ID.
9362    pub fn load_interface_type_def_from_id(
9363        &self,
9364        id: impl IntoID<InterfaceTypeDefId>,
9365    ) -> InterfaceTypeDef {
9366        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
9367        query = query.arg_lazy(
9368            "id",
9369            Box::new(move || {
9370                let id = id.clone();
9371                Box::pin(async move { id.into_id().await.unwrap().quote() })
9372            }),
9373        );
9374        InterfaceTypeDef {
9375            proc: self.proc.clone(),
9376            selection: query,
9377            graphql_client: self.graphql_client.clone(),
9378        }
9379    }
9380    /// Load a LLM from its ID.
9381    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
9382        let mut query = self.selection.select("loadLLMFromID");
9383        query = query.arg_lazy(
9384            "id",
9385            Box::new(move || {
9386                let id = id.clone();
9387                Box::pin(async move { id.into_id().await.unwrap().quote() })
9388            }),
9389        );
9390        Llm {
9391            proc: self.proc.clone(),
9392            selection: query,
9393            graphql_client: self.graphql_client.clone(),
9394        }
9395    }
9396    /// Load a LLMTokenUsage from its ID.
9397    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
9398        let mut query = self.selection.select("loadLLMTokenUsageFromID");
9399        query = query.arg_lazy(
9400            "id",
9401            Box::new(move || {
9402                let id = id.clone();
9403                Box::pin(async move { id.into_id().await.unwrap().quote() })
9404            }),
9405        );
9406        LlmTokenUsage {
9407            proc: self.proc.clone(),
9408            selection: query,
9409            graphql_client: self.graphql_client.clone(),
9410        }
9411    }
9412    /// Load a Label from its ID.
9413    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
9414        let mut query = self.selection.select("loadLabelFromID");
9415        query = query.arg_lazy(
9416            "id",
9417            Box::new(move || {
9418                let id = id.clone();
9419                Box::pin(async move { id.into_id().await.unwrap().quote() })
9420            }),
9421        );
9422        Label {
9423            proc: self.proc.clone(),
9424            selection: query,
9425            graphql_client: self.graphql_client.clone(),
9426        }
9427    }
9428    /// Load a ListTypeDef from its ID.
9429    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
9430        let mut query = self.selection.select("loadListTypeDefFromID");
9431        query = query.arg_lazy(
9432            "id",
9433            Box::new(move || {
9434                let id = id.clone();
9435                Box::pin(async move { id.into_id().await.unwrap().quote() })
9436            }),
9437        );
9438        ListTypeDef {
9439            proc: self.proc.clone(),
9440            selection: query,
9441            graphql_client: self.graphql_client.clone(),
9442        }
9443    }
9444    /// Load a ModuleConfigClient from its ID.
9445    pub fn load_module_config_client_from_id(
9446        &self,
9447        id: impl IntoID<ModuleConfigClientId>,
9448    ) -> ModuleConfigClient {
9449        let mut query = self.selection.select("loadModuleConfigClientFromID");
9450        query = query.arg_lazy(
9451            "id",
9452            Box::new(move || {
9453                let id = id.clone();
9454                Box::pin(async move { id.into_id().await.unwrap().quote() })
9455            }),
9456        );
9457        ModuleConfigClient {
9458            proc: self.proc.clone(),
9459            selection: query,
9460            graphql_client: self.graphql_client.clone(),
9461        }
9462    }
9463    /// Load a Module from its ID.
9464    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
9465        let mut query = self.selection.select("loadModuleFromID");
9466        query = query.arg_lazy(
9467            "id",
9468            Box::new(move || {
9469                let id = id.clone();
9470                Box::pin(async move { id.into_id().await.unwrap().quote() })
9471            }),
9472        );
9473        Module {
9474            proc: self.proc.clone(),
9475            selection: query,
9476            graphql_client: self.graphql_client.clone(),
9477        }
9478    }
9479    /// Load a ModuleSource from its ID.
9480    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
9481        let mut query = self.selection.select("loadModuleSourceFromID");
9482        query = query.arg_lazy(
9483            "id",
9484            Box::new(move || {
9485                let id = id.clone();
9486                Box::pin(async move { id.into_id().await.unwrap().quote() })
9487            }),
9488        );
9489        ModuleSource {
9490            proc: self.proc.clone(),
9491            selection: query,
9492            graphql_client: self.graphql_client.clone(),
9493        }
9494    }
9495    /// Load a ObjectTypeDef from its ID.
9496    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
9497        let mut query = self.selection.select("loadObjectTypeDefFromID");
9498        query = query.arg_lazy(
9499            "id",
9500            Box::new(move || {
9501                let id = id.clone();
9502                Box::pin(async move { id.into_id().await.unwrap().quote() })
9503            }),
9504        );
9505        ObjectTypeDef {
9506            proc: self.proc.clone(),
9507            selection: query,
9508            graphql_client: self.graphql_client.clone(),
9509        }
9510    }
9511    /// Load a Port from its ID.
9512    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
9513        let mut query = self.selection.select("loadPortFromID");
9514        query = query.arg_lazy(
9515            "id",
9516            Box::new(move || {
9517                let id = id.clone();
9518                Box::pin(async move { id.into_id().await.unwrap().quote() })
9519            }),
9520        );
9521        Port {
9522            proc: self.proc.clone(),
9523            selection: query,
9524            graphql_client: self.graphql_client.clone(),
9525        }
9526    }
9527    /// Load a SDKConfig from its ID.
9528    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
9529        let mut query = self.selection.select("loadSDKConfigFromID");
9530        query = query.arg_lazy(
9531            "id",
9532            Box::new(move || {
9533                let id = id.clone();
9534                Box::pin(async move { id.into_id().await.unwrap().quote() })
9535            }),
9536        );
9537        SdkConfig {
9538            proc: self.proc.clone(),
9539            selection: query,
9540            graphql_client: self.graphql_client.clone(),
9541        }
9542    }
9543    /// Load a ScalarTypeDef from its ID.
9544    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
9545        let mut query = self.selection.select("loadScalarTypeDefFromID");
9546        query = query.arg_lazy(
9547            "id",
9548            Box::new(move || {
9549                let id = id.clone();
9550                Box::pin(async move { id.into_id().await.unwrap().quote() })
9551            }),
9552        );
9553        ScalarTypeDef {
9554            proc: self.proc.clone(),
9555            selection: query,
9556            graphql_client: self.graphql_client.clone(),
9557        }
9558    }
9559    /// Load a Secret from its ID.
9560    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
9561        let mut query = self.selection.select("loadSecretFromID");
9562        query = query.arg_lazy(
9563            "id",
9564            Box::new(move || {
9565                let id = id.clone();
9566                Box::pin(async move { id.into_id().await.unwrap().quote() })
9567            }),
9568        );
9569        Secret {
9570            proc: self.proc.clone(),
9571            selection: query,
9572            graphql_client: self.graphql_client.clone(),
9573        }
9574    }
9575    /// Load a Service from its ID.
9576    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
9577        let mut query = self.selection.select("loadServiceFromID");
9578        query = query.arg_lazy(
9579            "id",
9580            Box::new(move || {
9581                let id = id.clone();
9582                Box::pin(async move { id.into_id().await.unwrap().quote() })
9583            }),
9584        );
9585        Service {
9586            proc: self.proc.clone(),
9587            selection: query,
9588            graphql_client: self.graphql_client.clone(),
9589        }
9590    }
9591    /// Load a Socket from its ID.
9592    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
9593        let mut query = self.selection.select("loadSocketFromID");
9594        query = query.arg_lazy(
9595            "id",
9596            Box::new(move || {
9597                let id = id.clone();
9598                Box::pin(async move { id.into_id().await.unwrap().quote() })
9599            }),
9600        );
9601        Socket {
9602            proc: self.proc.clone(),
9603            selection: query,
9604            graphql_client: self.graphql_client.clone(),
9605        }
9606    }
9607    /// Load a SourceMap from its ID.
9608    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
9609        let mut query = self.selection.select("loadSourceMapFromID");
9610        query = query.arg_lazy(
9611            "id",
9612            Box::new(move || {
9613                let id = id.clone();
9614                Box::pin(async move { id.into_id().await.unwrap().quote() })
9615            }),
9616        );
9617        SourceMap {
9618            proc: self.proc.clone(),
9619            selection: query,
9620            graphql_client: self.graphql_client.clone(),
9621        }
9622    }
9623    /// Load a Terminal from its ID.
9624    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
9625        let mut query = self.selection.select("loadTerminalFromID");
9626        query = query.arg_lazy(
9627            "id",
9628            Box::new(move || {
9629                let id = id.clone();
9630                Box::pin(async move { id.into_id().await.unwrap().quote() })
9631            }),
9632        );
9633        Terminal {
9634            proc: self.proc.clone(),
9635            selection: query,
9636            graphql_client: self.graphql_client.clone(),
9637        }
9638    }
9639    /// Load a TypeDef from its ID.
9640    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
9641        let mut query = self.selection.select("loadTypeDefFromID");
9642        query = query.arg_lazy(
9643            "id",
9644            Box::new(move || {
9645                let id = id.clone();
9646                Box::pin(async move { id.into_id().await.unwrap().quote() })
9647            }),
9648        );
9649        TypeDef {
9650            proc: self.proc.clone(),
9651            selection: query,
9652            graphql_client: self.graphql_client.clone(),
9653        }
9654    }
9655    /// Create a new module.
9656    pub fn module(&self) -> Module {
9657        let query = self.selection.select("module");
9658        Module {
9659            proc: self.proc.clone(),
9660            selection: query,
9661            graphql_client: self.graphql_client.clone(),
9662        }
9663    }
9664    /// Create a new module source instance from a source ref string
9665    ///
9666    /// # Arguments
9667    ///
9668    /// * `ref_string` - The string ref representation of the module source
9669    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9670    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
9671        let mut query = self.selection.select("moduleSource");
9672        query = query.arg("refString", ref_string.into());
9673        ModuleSource {
9674            proc: self.proc.clone(),
9675            selection: query,
9676            graphql_client: self.graphql_client.clone(),
9677        }
9678    }
9679    /// Create a new module source instance from a source ref string
9680    ///
9681    /// # Arguments
9682    ///
9683    /// * `ref_string` - The string ref representation of the module source
9684    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9685    pub fn module_source_opts<'a>(
9686        &self,
9687        ref_string: impl Into<String>,
9688        opts: QueryModuleSourceOpts<'a>,
9689    ) -> ModuleSource {
9690        let mut query = self.selection.select("moduleSource");
9691        query = query.arg("refString", ref_string.into());
9692        if let Some(ref_pin) = opts.ref_pin {
9693            query = query.arg("refPin", ref_pin);
9694        }
9695        if let Some(disable_find_up) = opts.disable_find_up {
9696            query = query.arg("disableFindUp", disable_find_up);
9697        }
9698        if let Some(allow_not_exists) = opts.allow_not_exists {
9699            query = query.arg("allowNotExists", allow_not_exists);
9700        }
9701        if let Some(require_kind) = opts.require_kind {
9702            query = query.arg("requireKind", require_kind);
9703        }
9704        ModuleSource {
9705            proc: self.proc.clone(),
9706            selection: query,
9707            graphql_client: self.graphql_client.clone(),
9708        }
9709    }
9710    /// Creates a new secret.
9711    ///
9712    /// # Arguments
9713    ///
9714    /// * `uri` - The URI of the secret store
9715    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9716    pub fn secret(&self, uri: impl Into<String>) -> Secret {
9717        let mut query = self.selection.select("secret");
9718        query = query.arg("uri", uri.into());
9719        Secret {
9720            proc: self.proc.clone(),
9721            selection: query,
9722            graphql_client: self.graphql_client.clone(),
9723        }
9724    }
9725    /// Creates a new secret.
9726    ///
9727    /// # Arguments
9728    ///
9729    /// * `uri` - The URI of the secret store
9730    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9731    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
9732        let mut query = self.selection.select("secret");
9733        query = query.arg("uri", uri.into());
9734        if let Some(cache_key) = opts.cache_key {
9735            query = query.arg("cacheKey", cache_key);
9736        }
9737        Secret {
9738            proc: self.proc.clone(),
9739            selection: query,
9740            graphql_client: self.graphql_client.clone(),
9741        }
9742    }
9743    /// Sets a secret given a user defined name to its plaintext and returns the secret.
9744    /// The plaintext value is limited to a size of 128000 bytes.
9745    ///
9746    /// # Arguments
9747    ///
9748    /// * `name` - The user defined name for this secret
9749    /// * `plaintext` - The plaintext of the secret
9750    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
9751        let mut query = self.selection.select("setSecret");
9752        query = query.arg("name", name.into());
9753        query = query.arg("plaintext", plaintext.into());
9754        Secret {
9755            proc: self.proc.clone(),
9756            selection: query,
9757            graphql_client: self.graphql_client.clone(),
9758        }
9759    }
9760    /// Creates source map metadata.
9761    ///
9762    /// # Arguments
9763    ///
9764    /// * `filename` - The filename from the module source.
9765    /// * `line` - The line number within the filename.
9766    /// * `column` - The column number within the line.
9767    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
9768        let mut query = self.selection.select("sourceMap");
9769        query = query.arg("filename", filename.into());
9770        query = query.arg("line", line);
9771        query = query.arg("column", column);
9772        SourceMap {
9773            proc: self.proc.clone(),
9774            selection: query,
9775            graphql_client: self.graphql_client.clone(),
9776        }
9777    }
9778    /// Create a new TypeDef.
9779    pub fn type_def(&self) -> TypeDef {
9780        let query = self.selection.select("typeDef");
9781        TypeDef {
9782            proc: self.proc.clone(),
9783            selection: query,
9784            graphql_client: self.graphql_client.clone(),
9785        }
9786    }
9787    /// Get the current Dagger Engine version.
9788    pub async fn version(&self) -> Result<String, DaggerError> {
9789        let query = self.selection.select("version");
9790        query.execute(self.graphql_client.clone()).await
9791    }
9792}
9793#[derive(Clone)]
9794pub struct SdkConfig {
9795    pub proc: Option<Arc<DaggerSessionProc>>,
9796    pub selection: Selection,
9797    pub graphql_client: DynGraphQLClient,
9798}
9799impl SdkConfig {
9800    /// A unique identifier for this SDKConfig.
9801    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
9802        let query = self.selection.select("id");
9803        query.execute(self.graphql_client.clone()).await
9804    }
9805    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
9806    pub async fn source(&self) -> Result<String, DaggerError> {
9807        let query = self.selection.select("source");
9808        query.execute(self.graphql_client.clone()).await
9809    }
9810}
9811#[derive(Clone)]
9812pub struct ScalarTypeDef {
9813    pub proc: Option<Arc<DaggerSessionProc>>,
9814    pub selection: Selection,
9815    pub graphql_client: DynGraphQLClient,
9816}
9817impl ScalarTypeDef {
9818    /// A doc string for the scalar, if any.
9819    pub async fn description(&self) -> Result<String, DaggerError> {
9820        let query = self.selection.select("description");
9821        query.execute(self.graphql_client.clone()).await
9822    }
9823    /// A unique identifier for this ScalarTypeDef.
9824    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
9825        let query = self.selection.select("id");
9826        query.execute(self.graphql_client.clone()).await
9827    }
9828    /// The name of the scalar.
9829    pub async fn name(&self) -> Result<String, DaggerError> {
9830        let query = self.selection.select("name");
9831        query.execute(self.graphql_client.clone()).await
9832    }
9833    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
9834    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9835        let query = self.selection.select("sourceModuleName");
9836        query.execute(self.graphql_client.clone()).await
9837    }
9838}
9839#[derive(Clone)]
9840pub struct Secret {
9841    pub proc: Option<Arc<DaggerSessionProc>>,
9842    pub selection: Selection,
9843    pub graphql_client: DynGraphQLClient,
9844}
9845impl Secret {
9846    /// A unique identifier for this Secret.
9847    pub async fn id(&self) -> Result<SecretId, DaggerError> {
9848        let query = self.selection.select("id");
9849        query.execute(self.graphql_client.clone()).await
9850    }
9851    /// The name of this secret.
9852    pub async fn name(&self) -> Result<String, DaggerError> {
9853        let query = self.selection.select("name");
9854        query.execute(self.graphql_client.clone()).await
9855    }
9856    /// The value of this secret.
9857    pub async fn plaintext(&self) -> Result<String, DaggerError> {
9858        let query = self.selection.select("plaintext");
9859        query.execute(self.graphql_client.clone()).await
9860    }
9861    /// The URI of this secret.
9862    pub async fn uri(&self) -> Result<String, DaggerError> {
9863        let query = self.selection.select("uri");
9864        query.execute(self.graphql_client.clone()).await
9865    }
9866}
9867#[derive(Clone)]
9868pub struct Service {
9869    pub proc: Option<Arc<DaggerSessionProc>>,
9870    pub selection: Selection,
9871    pub graphql_client: DynGraphQLClient,
9872}
9873#[derive(Builder, Debug, PartialEq)]
9874pub struct ServiceEndpointOpts<'a> {
9875    /// The exposed port number for the endpoint
9876    #[builder(setter(into, strip_option), default)]
9877    pub port: Option<isize>,
9878    /// Return a URL with the given scheme, eg. http for http://
9879    #[builder(setter(into, strip_option), default)]
9880    pub scheme: Option<&'a str>,
9881}
9882#[derive(Builder, Debug, PartialEq)]
9883pub struct ServiceStopOpts {
9884    /// Immediately kill the service without waiting for a graceful exit
9885    #[builder(setter(into, strip_option), default)]
9886    pub kill: Option<bool>,
9887}
9888#[derive(Builder, Debug, PartialEq)]
9889pub struct ServiceUpOpts {
9890    /// List of frontend/backend port mappings to forward.
9891    /// Frontend is the port accepting traffic on the host, backend is the service port.
9892    #[builder(setter(into, strip_option), default)]
9893    pub ports: Option<Vec<PortForward>>,
9894    /// Bind each tunnel port to a random port on the host.
9895    #[builder(setter(into, strip_option), default)]
9896    pub random: Option<bool>,
9897}
9898impl Service {
9899    /// Retrieves an endpoint that clients can use to reach this container.
9900    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
9901    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
9902    ///
9903    /// # Arguments
9904    ///
9905    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9906    pub async fn endpoint(&self) -> Result<String, DaggerError> {
9907        let query = self.selection.select("endpoint");
9908        query.execute(self.graphql_client.clone()).await
9909    }
9910    /// Retrieves an endpoint that clients can use to reach this container.
9911    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
9912    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
9913    ///
9914    /// # Arguments
9915    ///
9916    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9917    pub async fn endpoint_opts<'a>(
9918        &self,
9919        opts: ServiceEndpointOpts<'a>,
9920    ) -> Result<String, DaggerError> {
9921        let mut query = self.selection.select("endpoint");
9922        if let Some(port) = opts.port {
9923            query = query.arg("port", port);
9924        }
9925        if let Some(scheme) = opts.scheme {
9926            query = query.arg("scheme", scheme);
9927        }
9928        query.execute(self.graphql_client.clone()).await
9929    }
9930    /// Retrieves a hostname which can be used by clients to reach this container.
9931    pub async fn hostname(&self) -> Result<String, DaggerError> {
9932        let query = self.selection.select("hostname");
9933        query.execute(self.graphql_client.clone()).await
9934    }
9935    /// A unique identifier for this Service.
9936    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
9937        let query = self.selection.select("id");
9938        query.execute(self.graphql_client.clone()).await
9939    }
9940    /// Retrieves the list of ports provided by the service.
9941    pub fn ports(&self) -> Vec<Port> {
9942        let query = self.selection.select("ports");
9943        vec![Port {
9944            proc: self.proc.clone(),
9945            selection: query,
9946            graphql_client: self.graphql_client.clone(),
9947        }]
9948    }
9949    /// Start the service and wait for its health checks to succeed.
9950    /// Services bound to a Container do not need to be manually started.
9951    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
9952        let query = self.selection.select("start");
9953        query.execute(self.graphql_client.clone()).await
9954    }
9955    /// Stop the service.
9956    ///
9957    /// # Arguments
9958    ///
9959    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9960    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
9961        let query = self.selection.select("stop");
9962        query.execute(self.graphql_client.clone()).await
9963    }
9964    /// Stop the service.
9965    ///
9966    /// # Arguments
9967    ///
9968    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9969    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
9970        let mut query = self.selection.select("stop");
9971        if let Some(kill) = opts.kill {
9972            query = query.arg("kill", kill);
9973        }
9974        query.execute(self.graphql_client.clone()).await
9975    }
9976    /// Creates a tunnel that forwards traffic from the caller's network to this service.
9977    ///
9978    /// # Arguments
9979    ///
9980    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9981    pub async fn up(&self) -> Result<Void, DaggerError> {
9982        let query = self.selection.select("up");
9983        query.execute(self.graphql_client.clone()).await
9984    }
9985    /// Creates a tunnel that forwards traffic from the caller's network to this service.
9986    ///
9987    /// # Arguments
9988    ///
9989    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9990    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
9991        let mut query = self.selection.select("up");
9992        if let Some(ports) = opts.ports {
9993            query = query.arg("ports", ports);
9994        }
9995        if let Some(random) = opts.random {
9996            query = query.arg("random", random);
9997        }
9998        query.execute(self.graphql_client.clone()).await
9999    }
10000    /// Configures a hostname which can be used by clients within the session to reach this container.
10001    ///
10002    /// # Arguments
10003    ///
10004    /// * `hostname` - The hostname to use.
10005    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
10006        let mut query = self.selection.select("withHostname");
10007        query = query.arg("hostname", hostname.into());
10008        Service {
10009            proc: self.proc.clone(),
10010            selection: query,
10011            graphql_client: self.graphql_client.clone(),
10012        }
10013    }
10014}
10015#[derive(Clone)]
10016pub struct Socket {
10017    pub proc: Option<Arc<DaggerSessionProc>>,
10018    pub selection: Selection,
10019    pub graphql_client: DynGraphQLClient,
10020}
10021impl Socket {
10022    /// A unique identifier for this Socket.
10023    pub async fn id(&self) -> Result<SocketId, DaggerError> {
10024        let query = self.selection.select("id");
10025        query.execute(self.graphql_client.clone()).await
10026    }
10027}
10028#[derive(Clone)]
10029pub struct SourceMap {
10030    pub proc: Option<Arc<DaggerSessionProc>>,
10031    pub selection: Selection,
10032    pub graphql_client: DynGraphQLClient,
10033}
10034impl SourceMap {
10035    /// The column number within the line.
10036    pub async fn column(&self) -> Result<isize, DaggerError> {
10037        let query = self.selection.select("column");
10038        query.execute(self.graphql_client.clone()).await
10039    }
10040    /// The filename from the module source.
10041    pub async fn filename(&self) -> Result<String, DaggerError> {
10042        let query = self.selection.select("filename");
10043        query.execute(self.graphql_client.clone()).await
10044    }
10045    /// A unique identifier for this SourceMap.
10046    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
10047        let query = self.selection.select("id");
10048        query.execute(self.graphql_client.clone()).await
10049    }
10050    /// The line number within the filename.
10051    pub async fn line(&self) -> Result<isize, DaggerError> {
10052        let query = self.selection.select("line");
10053        query.execute(self.graphql_client.clone()).await
10054    }
10055    /// The module dependency this was declared in.
10056    pub async fn module(&self) -> Result<String, DaggerError> {
10057        let query = self.selection.select("module");
10058        query.execute(self.graphql_client.clone()).await
10059    }
10060}
10061#[derive(Clone)]
10062pub struct Terminal {
10063    pub proc: Option<Arc<DaggerSessionProc>>,
10064    pub selection: Selection,
10065    pub graphql_client: DynGraphQLClient,
10066}
10067impl Terminal {
10068    /// A unique identifier for this Terminal.
10069    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
10070        let query = self.selection.select("id");
10071        query.execute(self.graphql_client.clone()).await
10072    }
10073    /// Forces evaluation of the pipeline in the engine.
10074    /// It doesn't run the default command if no exec has been set.
10075    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
10076        let query = self.selection.select("sync");
10077        query.execute(self.graphql_client.clone()).await
10078    }
10079}
10080#[derive(Clone)]
10081pub struct TypeDef {
10082    pub proc: Option<Arc<DaggerSessionProc>>,
10083    pub selection: Selection,
10084    pub graphql_client: DynGraphQLClient,
10085}
10086#[derive(Builder, Debug, PartialEq)]
10087pub struct TypeDefWithEnumOpts<'a> {
10088    /// A doc string for the enum, if any
10089    #[builder(setter(into, strip_option), default)]
10090    pub description: Option<&'a str>,
10091    /// The source map for the enum definition.
10092    #[builder(setter(into, strip_option), default)]
10093    pub source_map: Option<SourceMapId>,
10094}
10095#[derive(Builder, Debug, PartialEq)]
10096pub struct TypeDefWithEnumMemberOpts<'a> {
10097    /// A doc string for the member, if any
10098    #[builder(setter(into, strip_option), default)]
10099    pub description: Option<&'a str>,
10100    /// The source map for the enum member definition.
10101    #[builder(setter(into, strip_option), default)]
10102    pub source_map: Option<SourceMapId>,
10103    /// The value of the member in the enum
10104    #[builder(setter(into, strip_option), default)]
10105    pub value: Option<&'a str>,
10106}
10107#[derive(Builder, Debug, PartialEq)]
10108pub struct TypeDefWithEnumValueOpts<'a> {
10109    /// A doc string for the value, if any
10110    #[builder(setter(into, strip_option), default)]
10111    pub description: Option<&'a str>,
10112    /// The source map for the enum value definition.
10113    #[builder(setter(into, strip_option), default)]
10114    pub source_map: Option<SourceMapId>,
10115}
10116#[derive(Builder, Debug, PartialEq)]
10117pub struct TypeDefWithFieldOpts<'a> {
10118    /// A doc string for the field, if any
10119    #[builder(setter(into, strip_option), default)]
10120    pub description: Option<&'a str>,
10121    /// The source map for the field definition.
10122    #[builder(setter(into, strip_option), default)]
10123    pub source_map: Option<SourceMapId>,
10124}
10125#[derive(Builder, Debug, PartialEq)]
10126pub struct TypeDefWithInterfaceOpts<'a> {
10127    #[builder(setter(into, strip_option), default)]
10128    pub description: Option<&'a str>,
10129    #[builder(setter(into, strip_option), default)]
10130    pub source_map: Option<SourceMapId>,
10131}
10132#[derive(Builder, Debug, PartialEq)]
10133pub struct TypeDefWithObjectOpts<'a> {
10134    #[builder(setter(into, strip_option), default)]
10135    pub description: Option<&'a str>,
10136    #[builder(setter(into, strip_option), default)]
10137    pub source_map: Option<SourceMapId>,
10138}
10139#[derive(Builder, Debug, PartialEq)]
10140pub struct TypeDefWithScalarOpts<'a> {
10141    #[builder(setter(into, strip_option), default)]
10142    pub description: Option<&'a str>,
10143}
10144impl TypeDef {
10145    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
10146    pub fn as_enum(&self) -> EnumTypeDef {
10147        let query = self.selection.select("asEnum");
10148        EnumTypeDef {
10149            proc: self.proc.clone(),
10150            selection: query,
10151            graphql_client: self.graphql_client.clone(),
10152        }
10153    }
10154    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
10155    pub fn as_input(&self) -> InputTypeDef {
10156        let query = self.selection.select("asInput");
10157        InputTypeDef {
10158            proc: self.proc.clone(),
10159            selection: query,
10160            graphql_client: self.graphql_client.clone(),
10161        }
10162    }
10163    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
10164    pub fn as_interface(&self) -> InterfaceTypeDef {
10165        let query = self.selection.select("asInterface");
10166        InterfaceTypeDef {
10167            proc: self.proc.clone(),
10168            selection: query,
10169            graphql_client: self.graphql_client.clone(),
10170        }
10171    }
10172    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
10173    pub fn as_list(&self) -> ListTypeDef {
10174        let query = self.selection.select("asList");
10175        ListTypeDef {
10176            proc: self.proc.clone(),
10177            selection: query,
10178            graphql_client: self.graphql_client.clone(),
10179        }
10180    }
10181    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
10182    pub fn as_object(&self) -> ObjectTypeDef {
10183        let query = self.selection.select("asObject");
10184        ObjectTypeDef {
10185            proc: self.proc.clone(),
10186            selection: query,
10187            graphql_client: self.graphql_client.clone(),
10188        }
10189    }
10190    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
10191    pub fn as_scalar(&self) -> ScalarTypeDef {
10192        let query = self.selection.select("asScalar");
10193        ScalarTypeDef {
10194            proc: self.proc.clone(),
10195            selection: query,
10196            graphql_client: self.graphql_client.clone(),
10197        }
10198    }
10199    /// A unique identifier for this TypeDef.
10200    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
10201        let query = self.selection.select("id");
10202        query.execute(self.graphql_client.clone()).await
10203    }
10204    /// The kind of type this is (e.g. primitive, list, object).
10205    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
10206        let query = self.selection.select("kind");
10207        query.execute(self.graphql_client.clone()).await
10208    }
10209    /// Whether this type can be set to null. Defaults to false.
10210    pub async fn optional(&self) -> Result<bool, DaggerError> {
10211        let query = self.selection.select("optional");
10212        query.execute(self.graphql_client.clone()).await
10213    }
10214    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
10215    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
10216        let mut query = self.selection.select("withConstructor");
10217        query = query.arg_lazy(
10218            "function",
10219            Box::new(move || {
10220                let function = function.clone();
10221                Box::pin(async move { function.into_id().await.unwrap().quote() })
10222            }),
10223        );
10224        TypeDef {
10225            proc: self.proc.clone(),
10226            selection: query,
10227            graphql_client: self.graphql_client.clone(),
10228        }
10229    }
10230    /// Returns a TypeDef of kind Enum with the provided name.
10231    /// 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.
10232    ///
10233    /// # Arguments
10234    ///
10235    /// * `name` - The name of the enum
10236    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10237    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
10238        let mut query = self.selection.select("withEnum");
10239        query = query.arg("name", name.into());
10240        TypeDef {
10241            proc: self.proc.clone(),
10242            selection: query,
10243            graphql_client: self.graphql_client.clone(),
10244        }
10245    }
10246    /// Returns a TypeDef of kind Enum with the provided name.
10247    /// 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.
10248    ///
10249    /// # Arguments
10250    ///
10251    /// * `name` - The name of the enum
10252    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10253    pub fn with_enum_opts<'a>(
10254        &self,
10255        name: impl Into<String>,
10256        opts: TypeDefWithEnumOpts<'a>,
10257    ) -> TypeDef {
10258        let mut query = self.selection.select("withEnum");
10259        query = query.arg("name", name.into());
10260        if let Some(description) = opts.description {
10261            query = query.arg("description", description);
10262        }
10263        if let Some(source_map) = opts.source_map {
10264            query = query.arg("sourceMap", source_map);
10265        }
10266        TypeDef {
10267            proc: self.proc.clone(),
10268            selection: query,
10269            graphql_client: self.graphql_client.clone(),
10270        }
10271    }
10272    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
10273    ///
10274    /// # Arguments
10275    ///
10276    /// * `name` - The name of the member in the enum
10277    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10278    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
10279        let mut query = self.selection.select("withEnumMember");
10280        query = query.arg("name", name.into());
10281        TypeDef {
10282            proc: self.proc.clone(),
10283            selection: query,
10284            graphql_client: self.graphql_client.clone(),
10285        }
10286    }
10287    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
10288    ///
10289    /// # Arguments
10290    ///
10291    /// * `name` - The name of the member in the enum
10292    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10293    pub fn with_enum_member_opts<'a>(
10294        &self,
10295        name: impl Into<String>,
10296        opts: TypeDefWithEnumMemberOpts<'a>,
10297    ) -> TypeDef {
10298        let mut query = self.selection.select("withEnumMember");
10299        query = query.arg("name", name.into());
10300        if let Some(value) = opts.value {
10301            query = query.arg("value", value);
10302        }
10303        if let Some(description) = opts.description {
10304            query = query.arg("description", description);
10305        }
10306        if let Some(source_map) = opts.source_map {
10307            query = query.arg("sourceMap", source_map);
10308        }
10309        TypeDef {
10310            proc: self.proc.clone(),
10311            selection: query,
10312            graphql_client: self.graphql_client.clone(),
10313        }
10314    }
10315    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
10316    ///
10317    /// # Arguments
10318    ///
10319    /// * `value` - The name of the value in the enum
10320    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10321    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
10322        let mut query = self.selection.select("withEnumValue");
10323        query = query.arg("value", value.into());
10324        TypeDef {
10325            proc: self.proc.clone(),
10326            selection: query,
10327            graphql_client: self.graphql_client.clone(),
10328        }
10329    }
10330    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
10331    ///
10332    /// # Arguments
10333    ///
10334    /// * `value` - The name of the value in the enum
10335    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10336    pub fn with_enum_value_opts<'a>(
10337        &self,
10338        value: impl Into<String>,
10339        opts: TypeDefWithEnumValueOpts<'a>,
10340    ) -> TypeDef {
10341        let mut query = self.selection.select("withEnumValue");
10342        query = query.arg("value", value.into());
10343        if let Some(description) = opts.description {
10344            query = query.arg("description", description);
10345        }
10346        if let Some(source_map) = opts.source_map {
10347            query = query.arg("sourceMap", source_map);
10348        }
10349        TypeDef {
10350            proc: self.proc.clone(),
10351            selection: query,
10352            graphql_client: self.graphql_client.clone(),
10353        }
10354    }
10355    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
10356    ///
10357    /// # Arguments
10358    ///
10359    /// * `name` - The name of the field in the object
10360    /// * `type_def` - The type of the field
10361    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10362    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
10363        let mut query = self.selection.select("withField");
10364        query = query.arg("name", name.into());
10365        query = query.arg_lazy(
10366            "typeDef",
10367            Box::new(move || {
10368                let type_def = type_def.clone();
10369                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
10370            }),
10371        );
10372        TypeDef {
10373            proc: self.proc.clone(),
10374            selection: query,
10375            graphql_client: self.graphql_client.clone(),
10376        }
10377    }
10378    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
10379    ///
10380    /// # Arguments
10381    ///
10382    /// * `name` - The name of the field in the object
10383    /// * `type_def` - The type of the field
10384    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10385    pub fn with_field_opts<'a>(
10386        &self,
10387        name: impl Into<String>,
10388        type_def: impl IntoID<TypeDefId>,
10389        opts: TypeDefWithFieldOpts<'a>,
10390    ) -> TypeDef {
10391        let mut query = self.selection.select("withField");
10392        query = query.arg("name", name.into());
10393        query = query.arg_lazy(
10394            "typeDef",
10395            Box::new(move || {
10396                let type_def = type_def.clone();
10397                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
10398            }),
10399        );
10400        if let Some(description) = opts.description {
10401            query = query.arg("description", description);
10402        }
10403        if let Some(source_map) = opts.source_map {
10404            query = query.arg("sourceMap", source_map);
10405        }
10406        TypeDef {
10407            proc: self.proc.clone(),
10408            selection: query,
10409            graphql_client: self.graphql_client.clone(),
10410        }
10411    }
10412    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
10413    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
10414        let mut query = self.selection.select("withFunction");
10415        query = query.arg_lazy(
10416            "function",
10417            Box::new(move || {
10418                let function = function.clone();
10419                Box::pin(async move { function.into_id().await.unwrap().quote() })
10420            }),
10421        );
10422        TypeDef {
10423            proc: self.proc.clone(),
10424            selection: query,
10425            graphql_client: self.graphql_client.clone(),
10426        }
10427    }
10428    /// Returns a TypeDef of kind Interface with the provided name.
10429    ///
10430    /// # Arguments
10431    ///
10432    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10433    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
10434        let mut query = self.selection.select("withInterface");
10435        query = query.arg("name", name.into());
10436        TypeDef {
10437            proc: self.proc.clone(),
10438            selection: query,
10439            graphql_client: self.graphql_client.clone(),
10440        }
10441    }
10442    /// Returns a TypeDef of kind Interface with the provided name.
10443    ///
10444    /// # Arguments
10445    ///
10446    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10447    pub fn with_interface_opts<'a>(
10448        &self,
10449        name: impl Into<String>,
10450        opts: TypeDefWithInterfaceOpts<'a>,
10451    ) -> TypeDef {
10452        let mut query = self.selection.select("withInterface");
10453        query = query.arg("name", name.into());
10454        if let Some(description) = opts.description {
10455            query = query.arg("description", description);
10456        }
10457        if let Some(source_map) = opts.source_map {
10458            query = query.arg("sourceMap", source_map);
10459        }
10460        TypeDef {
10461            proc: self.proc.clone(),
10462            selection: query,
10463            graphql_client: self.graphql_client.clone(),
10464        }
10465    }
10466    /// Sets the kind of the type.
10467    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
10468        let mut query = self.selection.select("withKind");
10469        query = query.arg("kind", kind);
10470        TypeDef {
10471            proc: self.proc.clone(),
10472            selection: query,
10473            graphql_client: self.graphql_client.clone(),
10474        }
10475    }
10476    /// Returns a TypeDef of kind List with the provided type for its elements.
10477    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
10478        let mut query = self.selection.select("withListOf");
10479        query = query.arg_lazy(
10480            "elementType",
10481            Box::new(move || {
10482                let element_type = element_type.clone();
10483                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
10484            }),
10485        );
10486        TypeDef {
10487            proc: self.proc.clone(),
10488            selection: query,
10489            graphql_client: self.graphql_client.clone(),
10490        }
10491    }
10492    /// Returns a TypeDef of kind Object with the provided name.
10493    /// 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.
10494    ///
10495    /// # Arguments
10496    ///
10497    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10498    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
10499        let mut query = self.selection.select("withObject");
10500        query = query.arg("name", name.into());
10501        TypeDef {
10502            proc: self.proc.clone(),
10503            selection: query,
10504            graphql_client: self.graphql_client.clone(),
10505        }
10506    }
10507    /// Returns a TypeDef of kind Object with the provided name.
10508    /// 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.
10509    ///
10510    /// # Arguments
10511    ///
10512    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10513    pub fn with_object_opts<'a>(
10514        &self,
10515        name: impl Into<String>,
10516        opts: TypeDefWithObjectOpts<'a>,
10517    ) -> TypeDef {
10518        let mut query = self.selection.select("withObject");
10519        query = query.arg("name", name.into());
10520        if let Some(description) = opts.description {
10521            query = query.arg("description", description);
10522        }
10523        if let Some(source_map) = opts.source_map {
10524            query = query.arg("sourceMap", source_map);
10525        }
10526        TypeDef {
10527            proc: self.proc.clone(),
10528            selection: query,
10529            graphql_client: self.graphql_client.clone(),
10530        }
10531    }
10532    /// Sets whether this type can be set to null.
10533    pub fn with_optional(&self, optional: bool) -> TypeDef {
10534        let mut query = self.selection.select("withOptional");
10535        query = query.arg("optional", optional);
10536        TypeDef {
10537            proc: self.proc.clone(),
10538            selection: query,
10539            graphql_client: self.graphql_client.clone(),
10540        }
10541    }
10542    /// Returns a TypeDef of kind Scalar with the provided name.
10543    ///
10544    /// # Arguments
10545    ///
10546    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10547    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
10548        let mut query = self.selection.select("withScalar");
10549        query = query.arg("name", name.into());
10550        TypeDef {
10551            proc: self.proc.clone(),
10552            selection: query,
10553            graphql_client: self.graphql_client.clone(),
10554        }
10555    }
10556    /// Returns a TypeDef of kind Scalar with the provided name.
10557    ///
10558    /// # Arguments
10559    ///
10560    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10561    pub fn with_scalar_opts<'a>(
10562        &self,
10563        name: impl Into<String>,
10564        opts: TypeDefWithScalarOpts<'a>,
10565    ) -> TypeDef {
10566        let mut query = self.selection.select("withScalar");
10567        query = query.arg("name", name.into());
10568        if let Some(description) = opts.description {
10569            query = query.arg("description", description);
10570        }
10571        TypeDef {
10572            proc: self.proc.clone(),
10573            selection: query,
10574            graphql_client: self.graphql_client.clone(),
10575        }
10576    }
10577}
10578#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10579pub enum CacheSharingMode {
10580    #[serde(rename = "LOCKED")]
10581    Locked,
10582    #[serde(rename = "PRIVATE")]
10583    Private,
10584    #[serde(rename = "SHARED")]
10585    Shared,
10586}
10587#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10588pub enum ImageLayerCompression {
10589    #[serde(rename = "EStarGZ")]
10590    EStarGz,
10591    #[serde(rename = "ESTARGZ")]
10592    Estargz,
10593    #[serde(rename = "Gzip")]
10594    Gzip,
10595    #[serde(rename = "Uncompressed")]
10596    Uncompressed,
10597    #[serde(rename = "Zstd")]
10598    Zstd,
10599}
10600#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10601pub enum ImageMediaTypes {
10602    #[serde(rename = "DOCKER")]
10603    Docker,
10604    #[serde(rename = "DockerMediaTypes")]
10605    DockerMediaTypes,
10606    #[serde(rename = "OCI")]
10607    Oci,
10608    #[serde(rename = "OCIMediaTypes")]
10609    OciMediaTypes,
10610}
10611#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10612pub enum ModuleSourceKind {
10613    #[serde(rename = "DIR")]
10614    Dir,
10615    #[serde(rename = "DIR_SOURCE")]
10616    DirSource,
10617    #[serde(rename = "GIT")]
10618    Git,
10619    #[serde(rename = "GIT_SOURCE")]
10620    GitSource,
10621    #[serde(rename = "LOCAL")]
10622    Local,
10623    #[serde(rename = "LOCAL_SOURCE")]
10624    LocalSource,
10625}
10626#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10627pub enum NetworkProtocol {
10628    #[serde(rename = "TCP")]
10629    Tcp,
10630    #[serde(rename = "UDP")]
10631    Udp,
10632}
10633#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10634pub enum ReturnType {
10635    #[serde(rename = "ANY")]
10636    Any,
10637    #[serde(rename = "FAILURE")]
10638    Failure,
10639    #[serde(rename = "SUCCESS")]
10640    Success,
10641}
10642#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10643pub enum TypeDefKind {
10644    #[serde(rename = "BOOLEAN")]
10645    Boolean,
10646    #[serde(rename = "BOOLEAN_KIND")]
10647    BooleanKind,
10648    #[serde(rename = "ENUM")]
10649    Enum,
10650    #[serde(rename = "ENUM_KIND")]
10651    EnumKind,
10652    #[serde(rename = "FLOAT")]
10653    Float,
10654    #[serde(rename = "FLOAT_KIND")]
10655    FloatKind,
10656    #[serde(rename = "INPUT")]
10657    Input,
10658    #[serde(rename = "INPUT_KIND")]
10659    InputKind,
10660    #[serde(rename = "INTEGER")]
10661    Integer,
10662    #[serde(rename = "INTEGER_KIND")]
10663    IntegerKind,
10664    #[serde(rename = "INTERFACE")]
10665    Interface,
10666    #[serde(rename = "INTERFACE_KIND")]
10667    InterfaceKind,
10668    #[serde(rename = "LIST")]
10669    List,
10670    #[serde(rename = "LIST_KIND")]
10671    ListKind,
10672    #[serde(rename = "OBJECT")]
10673    Object,
10674    #[serde(rename = "OBJECT_KIND")]
10675    ObjectKind,
10676    #[serde(rename = "SCALAR")]
10677    Scalar,
10678    #[serde(rename = "SCALAR_KIND")]
10679    ScalarKind,
10680    #[serde(rename = "STRING")]
10681    String,
10682    #[serde(rename = "STRING_KIND")]
10683    StringKind,
10684    #[serde(rename = "VOID")]
10685    Void,
10686    #[serde(rename = "VOID_KIND")]
10687    VoidKind,
10688}