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