dagger_sdk/
gen.rs

1#![allow(clippy::needless_lifetimes)]
2
3use crate::core::cli_session::DaggerSessionProc;
4use crate::core::graphql_client::DynGraphQLClient;
5use crate::errors::DaggerError;
6use crate::id::IntoID;
7use crate::querybuilder::Selection;
8use derive_builder::Builder;
9use serde::{Deserialize, Serialize};
10use std::sync::Arc;
11
12#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
13pub struct BindingId(pub String);
14impl From<&str> for BindingId {
15    fn from(value: &str) -> Self {
16        Self(value.to_string())
17    }
18}
19impl From<String> for BindingId {
20    fn from(value: String) -> Self {
21        Self(value)
22    }
23}
24impl IntoID<BindingId> for Binding {
25    fn into_id(
26        self,
27    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
28    {
29        Box::pin(async move { self.id().await })
30    }
31}
32impl IntoID<BindingId> for BindingId {
33    fn into_id(
34        self,
35    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
36    {
37        Box::pin(async move { Ok::<BindingId, DaggerError>(self) })
38    }
39}
40impl BindingId {
41    fn quote(&self) -> String {
42        format!("\"{}\"", self.0.clone())
43    }
44}
45#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
46pub struct CacheVolumeId(pub String);
47impl From<&str> for CacheVolumeId {
48    fn from(value: &str) -> Self {
49        Self(value.to_string())
50    }
51}
52impl From<String> for CacheVolumeId {
53    fn from(value: String) -> Self {
54        Self(value)
55    }
56}
57impl IntoID<CacheVolumeId> for CacheVolume {
58    fn into_id(
59        self,
60    ) -> std::pin::Pin<
61        Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
62    > {
63        Box::pin(async move { self.id().await })
64    }
65}
66impl IntoID<CacheVolumeId> for CacheVolumeId {
67    fn into_id(
68        self,
69    ) -> std::pin::Pin<
70        Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
71    > {
72        Box::pin(async move { Ok::<CacheVolumeId, DaggerError>(self) })
73    }
74}
75impl CacheVolumeId {
76    fn quote(&self) -> String {
77        format!("\"{}\"", self.0.clone())
78    }
79}
80#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
81pub struct ContainerId(pub String);
82impl From<&str> for ContainerId {
83    fn from(value: &str) -> Self {
84        Self(value.to_string())
85    }
86}
87impl From<String> for ContainerId {
88    fn from(value: String) -> Self {
89        Self(value)
90    }
91}
92impl IntoID<ContainerId> for Container {
93    fn into_id(
94        self,
95    ) -> std::pin::Pin<
96        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
97    > {
98        Box::pin(async move { self.id().await })
99    }
100}
101impl IntoID<ContainerId> for ContainerId {
102    fn into_id(
103        self,
104    ) -> std::pin::Pin<
105        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
106    > {
107        Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
108    }
109}
110impl ContainerId {
111    fn quote(&self) -> String {
112        format!("\"{}\"", self.0.clone())
113    }
114}
115#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
116pub struct CurrentModuleId(pub String);
117impl From<&str> for CurrentModuleId {
118    fn from(value: &str) -> Self {
119        Self(value.to_string())
120    }
121}
122impl From<String> for CurrentModuleId {
123    fn from(value: String) -> Self {
124        Self(value)
125    }
126}
127impl IntoID<CurrentModuleId> for CurrentModule {
128    fn into_id(
129        self,
130    ) -> std::pin::Pin<
131        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
132    > {
133        Box::pin(async move { self.id().await })
134    }
135}
136impl IntoID<CurrentModuleId> for CurrentModuleId {
137    fn into_id(
138        self,
139    ) -> std::pin::Pin<
140        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
141    > {
142        Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
143    }
144}
145impl CurrentModuleId {
146    fn quote(&self) -> String {
147        format!("\"{}\"", self.0.clone())
148    }
149}
150#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
151pub struct DirectoryId(pub String);
152impl From<&str> for DirectoryId {
153    fn from(value: &str) -> Self {
154        Self(value.to_string())
155    }
156}
157impl From<String> for DirectoryId {
158    fn from(value: String) -> Self {
159        Self(value)
160    }
161}
162impl IntoID<DirectoryId> for Directory {
163    fn into_id(
164        self,
165    ) -> std::pin::Pin<
166        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
167    > {
168        Box::pin(async move { self.id().await })
169    }
170}
171impl IntoID<DirectoryId> for DirectoryId {
172    fn into_id(
173        self,
174    ) -> std::pin::Pin<
175        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
176    > {
177        Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
178    }
179}
180impl DirectoryId {
181    fn quote(&self) -> String {
182        format!("\"{}\"", self.0.clone())
183    }
184}
185#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
186pub struct EngineCacheEntryId(pub String);
187impl From<&str> for EngineCacheEntryId {
188    fn from(value: &str) -> Self {
189        Self(value.to_string())
190    }
191}
192impl From<String> for EngineCacheEntryId {
193    fn from(value: String) -> Self {
194        Self(value)
195    }
196}
197impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
198    fn into_id(
199        self,
200    ) -> std::pin::Pin<
201        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
202    > {
203        Box::pin(async move { self.id().await })
204    }
205}
206impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
207    fn into_id(
208        self,
209    ) -> std::pin::Pin<
210        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
211    > {
212        Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
213    }
214}
215impl EngineCacheEntryId {
216    fn quote(&self) -> String {
217        format!("\"{}\"", self.0.clone())
218    }
219}
220#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
221pub struct EngineCacheEntrySetId(pub String);
222impl From<&str> for EngineCacheEntrySetId {
223    fn from(value: &str) -> Self {
224        Self(value.to_string())
225    }
226}
227impl From<String> for EngineCacheEntrySetId {
228    fn from(value: String) -> Self {
229        Self(value)
230    }
231}
232impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
233    fn into_id(
234        self,
235    ) -> std::pin::Pin<
236        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
237    > {
238        Box::pin(async move { self.id().await })
239    }
240}
241impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
242    fn into_id(
243        self,
244    ) -> std::pin::Pin<
245        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
246    > {
247        Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
248    }
249}
250impl EngineCacheEntrySetId {
251    fn quote(&self) -> String {
252        format!("\"{}\"", self.0.clone())
253    }
254}
255#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
256pub struct EngineCacheId(pub String);
257impl From<&str> for EngineCacheId {
258    fn from(value: &str) -> Self {
259        Self(value.to_string())
260    }
261}
262impl From<String> for EngineCacheId {
263    fn from(value: String) -> Self {
264        Self(value)
265    }
266}
267impl IntoID<EngineCacheId> for EngineCache {
268    fn into_id(
269        self,
270    ) -> std::pin::Pin<
271        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
272    > {
273        Box::pin(async move { self.id().await })
274    }
275}
276impl IntoID<EngineCacheId> for EngineCacheId {
277    fn into_id(
278        self,
279    ) -> std::pin::Pin<
280        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
281    > {
282        Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
283    }
284}
285impl EngineCacheId {
286    fn quote(&self) -> String {
287        format!("\"{}\"", self.0.clone())
288    }
289}
290#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
291pub struct EngineId(pub String);
292impl From<&str> for EngineId {
293    fn from(value: &str) -> Self {
294        Self(value.to_string())
295    }
296}
297impl From<String> for EngineId {
298    fn from(value: String) -> Self {
299        Self(value)
300    }
301}
302impl IntoID<EngineId> for Engine {
303    fn into_id(
304        self,
305    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
306    {
307        Box::pin(async move { self.id().await })
308    }
309}
310impl IntoID<EngineId> for EngineId {
311    fn into_id(
312        self,
313    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
314    {
315        Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
316    }
317}
318impl EngineId {
319    fn quote(&self) -> String {
320        format!("\"{}\"", self.0.clone())
321    }
322}
323#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
324pub struct EnumTypeDefId(pub String);
325impl From<&str> for EnumTypeDefId {
326    fn from(value: &str) -> Self {
327        Self(value.to_string())
328    }
329}
330impl From<String> for EnumTypeDefId {
331    fn from(value: String) -> Self {
332        Self(value)
333    }
334}
335impl IntoID<EnumTypeDefId> for EnumTypeDef {
336    fn into_id(
337        self,
338    ) -> std::pin::Pin<
339        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
340    > {
341        Box::pin(async move { self.id().await })
342    }
343}
344impl IntoID<EnumTypeDefId> for EnumTypeDefId {
345    fn into_id(
346        self,
347    ) -> std::pin::Pin<
348        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
349    > {
350        Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
351    }
352}
353impl EnumTypeDefId {
354    fn quote(&self) -> String {
355        format!("\"{}\"", self.0.clone())
356    }
357}
358#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
359pub struct EnumValueTypeDefId(pub String);
360impl From<&str> for EnumValueTypeDefId {
361    fn from(value: &str) -> Self {
362        Self(value.to_string())
363    }
364}
365impl From<String> for EnumValueTypeDefId {
366    fn from(value: String) -> Self {
367        Self(value)
368    }
369}
370impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
371    fn into_id(
372        self,
373    ) -> std::pin::Pin<
374        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
375    > {
376        Box::pin(async move { self.id().await })
377    }
378}
379impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
380    fn into_id(
381        self,
382    ) -> std::pin::Pin<
383        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
384    > {
385        Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
386    }
387}
388impl EnumValueTypeDefId {
389    fn quote(&self) -> String {
390        format!("\"{}\"", self.0.clone())
391    }
392}
393#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
394pub struct EnvId(pub String);
395impl From<&str> for EnvId {
396    fn from(value: &str) -> Self {
397        Self(value.to_string())
398    }
399}
400impl From<String> for EnvId {
401    fn from(value: String) -> Self {
402        Self(value)
403    }
404}
405impl IntoID<EnvId> for Env {
406    fn into_id(
407        self,
408    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
409    {
410        Box::pin(async move { self.id().await })
411    }
412}
413impl IntoID<EnvId> for EnvId {
414    fn into_id(
415        self,
416    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
417    {
418        Box::pin(async move { Ok::<EnvId, DaggerError>(self) })
419    }
420}
421impl EnvId {
422    fn quote(&self) -> String {
423        format!("\"{}\"", self.0.clone())
424    }
425}
426#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
427pub struct EnvVariableId(pub String);
428impl From<&str> for EnvVariableId {
429    fn from(value: &str) -> Self {
430        Self(value.to_string())
431    }
432}
433impl From<String> for EnvVariableId {
434    fn from(value: String) -> Self {
435        Self(value)
436    }
437}
438impl IntoID<EnvVariableId> for EnvVariable {
439    fn into_id(
440        self,
441    ) -> std::pin::Pin<
442        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
443    > {
444        Box::pin(async move { self.id().await })
445    }
446}
447impl IntoID<EnvVariableId> for EnvVariableId {
448    fn into_id(
449        self,
450    ) -> std::pin::Pin<
451        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
452    > {
453        Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
454    }
455}
456impl EnvVariableId {
457    fn quote(&self) -> String {
458        format!("\"{}\"", self.0.clone())
459    }
460}
461#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
462pub struct ErrorId(pub String);
463impl From<&str> for ErrorId {
464    fn from(value: &str) -> Self {
465        Self(value.to_string())
466    }
467}
468impl From<String> for ErrorId {
469    fn from(value: String) -> Self {
470        Self(value)
471    }
472}
473impl IntoID<ErrorId> for Error {
474    fn into_id(
475        self,
476    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
477    {
478        Box::pin(async move { self.id().await })
479    }
480}
481impl IntoID<ErrorId> for ErrorId {
482    fn into_id(
483        self,
484    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
485    {
486        Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
487    }
488}
489impl ErrorId {
490    fn quote(&self) -> String {
491        format!("\"{}\"", self.0.clone())
492    }
493}
494#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
495pub struct ErrorValueId(pub String);
496impl From<&str> for ErrorValueId {
497    fn from(value: &str) -> Self {
498        Self(value.to_string())
499    }
500}
501impl From<String> for ErrorValueId {
502    fn from(value: String) -> Self {
503        Self(value)
504    }
505}
506impl IntoID<ErrorValueId> for ErrorValue {
507    fn into_id(
508        self,
509    ) -> std::pin::Pin<
510        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
511    > {
512        Box::pin(async move { self.id().await })
513    }
514}
515impl IntoID<ErrorValueId> for ErrorValueId {
516    fn into_id(
517        self,
518    ) -> std::pin::Pin<
519        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
520    > {
521        Box::pin(async move { Ok::<ErrorValueId, DaggerError>(self) })
522    }
523}
524impl ErrorValueId {
525    fn quote(&self) -> String {
526        format!("\"{}\"", self.0.clone())
527    }
528}
529#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
530pub struct FieldTypeDefId(pub String);
531impl From<&str> for FieldTypeDefId {
532    fn from(value: &str) -> Self {
533        Self(value.to_string())
534    }
535}
536impl From<String> for FieldTypeDefId {
537    fn from(value: String) -> Self {
538        Self(value)
539    }
540}
541impl IntoID<FieldTypeDefId> for FieldTypeDef {
542    fn into_id(
543        self,
544    ) -> std::pin::Pin<
545        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
546    > {
547        Box::pin(async move { self.id().await })
548    }
549}
550impl IntoID<FieldTypeDefId> for FieldTypeDefId {
551    fn into_id(
552        self,
553    ) -> std::pin::Pin<
554        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
555    > {
556        Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
557    }
558}
559impl FieldTypeDefId {
560    fn quote(&self) -> String {
561        format!("\"{}\"", self.0.clone())
562    }
563}
564#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
565pub struct FileId(pub String);
566impl From<&str> for FileId {
567    fn from(value: &str) -> Self {
568        Self(value.to_string())
569    }
570}
571impl From<String> for FileId {
572    fn from(value: String) -> Self {
573        Self(value)
574    }
575}
576impl IntoID<FileId> for File {
577    fn into_id(
578        self,
579    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
580    {
581        Box::pin(async move { self.id().await })
582    }
583}
584impl IntoID<FileId> for FileId {
585    fn into_id(
586        self,
587    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
588    {
589        Box::pin(async move { Ok::<FileId, DaggerError>(self) })
590    }
591}
592impl FileId {
593    fn quote(&self) -> String {
594        format!("\"{}\"", self.0.clone())
595    }
596}
597#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
598pub struct FunctionArgId(pub String);
599impl From<&str> for FunctionArgId {
600    fn from(value: &str) -> Self {
601        Self(value.to_string())
602    }
603}
604impl From<String> for FunctionArgId {
605    fn from(value: String) -> Self {
606        Self(value)
607    }
608}
609impl IntoID<FunctionArgId> for FunctionArg {
610    fn into_id(
611        self,
612    ) -> std::pin::Pin<
613        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
614    > {
615        Box::pin(async move { self.id().await })
616    }
617}
618impl IntoID<FunctionArgId> for FunctionArgId {
619    fn into_id(
620        self,
621    ) -> std::pin::Pin<
622        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
623    > {
624        Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
625    }
626}
627impl FunctionArgId {
628    fn quote(&self) -> String {
629        format!("\"{}\"", self.0.clone())
630    }
631}
632#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
633pub struct FunctionCallArgValueId(pub String);
634impl From<&str> for FunctionCallArgValueId {
635    fn from(value: &str) -> Self {
636        Self(value.to_string())
637    }
638}
639impl From<String> for FunctionCallArgValueId {
640    fn from(value: String) -> Self {
641        Self(value)
642    }
643}
644impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
645    fn into_id(
646        self,
647    ) -> std::pin::Pin<
648        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
649    > {
650        Box::pin(async move { self.id().await })
651    }
652}
653impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
654    fn into_id(
655        self,
656    ) -> std::pin::Pin<
657        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
658    > {
659        Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
660    }
661}
662impl FunctionCallArgValueId {
663    fn quote(&self) -> String {
664        format!("\"{}\"", self.0.clone())
665    }
666}
667#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
668pub struct FunctionCallId(pub String);
669impl From<&str> for FunctionCallId {
670    fn from(value: &str) -> Self {
671        Self(value.to_string())
672    }
673}
674impl From<String> for FunctionCallId {
675    fn from(value: String) -> Self {
676        Self(value)
677    }
678}
679impl IntoID<FunctionCallId> for FunctionCall {
680    fn into_id(
681        self,
682    ) -> std::pin::Pin<
683        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
684    > {
685        Box::pin(async move { self.id().await })
686    }
687}
688impl IntoID<FunctionCallId> for FunctionCallId {
689    fn into_id(
690        self,
691    ) -> std::pin::Pin<
692        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
693    > {
694        Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
695    }
696}
697impl FunctionCallId {
698    fn quote(&self) -> String {
699        format!("\"{}\"", self.0.clone())
700    }
701}
702#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
703pub struct FunctionId(pub String);
704impl From<&str> for FunctionId {
705    fn from(value: &str) -> Self {
706        Self(value.to_string())
707    }
708}
709impl From<String> for FunctionId {
710    fn from(value: String) -> Self {
711        Self(value)
712    }
713}
714impl IntoID<FunctionId> for Function {
715    fn into_id(
716        self,
717    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
718    {
719        Box::pin(async move { self.id().await })
720    }
721}
722impl IntoID<FunctionId> for FunctionId {
723    fn into_id(
724        self,
725    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
726    {
727        Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
728    }
729}
730impl FunctionId {
731    fn quote(&self) -> String {
732        format!("\"{}\"", self.0.clone())
733    }
734}
735#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
736pub struct GeneratedCodeId(pub String);
737impl From<&str> for GeneratedCodeId {
738    fn from(value: &str) -> Self {
739        Self(value.to_string())
740    }
741}
742impl From<String> for GeneratedCodeId {
743    fn from(value: String) -> Self {
744        Self(value)
745    }
746}
747impl IntoID<GeneratedCodeId> for GeneratedCode {
748    fn into_id(
749        self,
750    ) -> std::pin::Pin<
751        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
752    > {
753        Box::pin(async move { self.id().await })
754    }
755}
756impl IntoID<GeneratedCodeId> for GeneratedCodeId {
757    fn into_id(
758        self,
759    ) -> std::pin::Pin<
760        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
761    > {
762        Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
763    }
764}
765impl GeneratedCodeId {
766    fn quote(&self) -> String {
767        format!("\"{}\"", self.0.clone())
768    }
769}
770#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
771pub struct GitRefId(pub String);
772impl From<&str> for GitRefId {
773    fn from(value: &str) -> Self {
774        Self(value.to_string())
775    }
776}
777impl From<String> for GitRefId {
778    fn from(value: String) -> Self {
779        Self(value)
780    }
781}
782impl IntoID<GitRefId> for GitRef {
783    fn into_id(
784        self,
785    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
786    {
787        Box::pin(async move { self.id().await })
788    }
789}
790impl IntoID<GitRefId> for GitRefId {
791    fn into_id(
792        self,
793    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
794    {
795        Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
796    }
797}
798impl GitRefId {
799    fn quote(&self) -> String {
800        format!("\"{}\"", self.0.clone())
801    }
802}
803#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
804pub struct GitRepositoryId(pub String);
805impl From<&str> for GitRepositoryId {
806    fn from(value: &str) -> Self {
807        Self(value.to_string())
808    }
809}
810impl From<String> for GitRepositoryId {
811    fn from(value: String) -> Self {
812        Self(value)
813    }
814}
815impl IntoID<GitRepositoryId> for GitRepository {
816    fn into_id(
817        self,
818    ) -> std::pin::Pin<
819        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
820    > {
821        Box::pin(async move { self.id().await })
822    }
823}
824impl IntoID<GitRepositoryId> for GitRepositoryId {
825    fn into_id(
826        self,
827    ) -> std::pin::Pin<
828        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
829    > {
830        Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
831    }
832}
833impl GitRepositoryId {
834    fn quote(&self) -> String {
835        format!("\"{}\"", self.0.clone())
836    }
837}
838#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
839pub struct HostId(pub String);
840impl From<&str> for HostId {
841    fn from(value: &str) -> Self {
842        Self(value.to_string())
843    }
844}
845impl From<String> for HostId {
846    fn from(value: String) -> Self {
847        Self(value)
848    }
849}
850impl IntoID<HostId> for Host {
851    fn into_id(
852        self,
853    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
854    {
855        Box::pin(async move { self.id().await })
856    }
857}
858impl IntoID<HostId> for HostId {
859    fn into_id(
860        self,
861    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
862    {
863        Box::pin(async move { Ok::<HostId, DaggerError>(self) })
864    }
865}
866impl HostId {
867    fn quote(&self) -> String {
868        format!("\"{}\"", self.0.clone())
869    }
870}
871#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
872pub struct InputTypeDefId(pub String);
873impl From<&str> for InputTypeDefId {
874    fn from(value: &str) -> Self {
875        Self(value.to_string())
876    }
877}
878impl From<String> for InputTypeDefId {
879    fn from(value: String) -> Self {
880        Self(value)
881    }
882}
883impl IntoID<InputTypeDefId> for InputTypeDef {
884    fn into_id(
885        self,
886    ) -> std::pin::Pin<
887        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
888    > {
889        Box::pin(async move { self.id().await })
890    }
891}
892impl IntoID<InputTypeDefId> for InputTypeDefId {
893    fn into_id(
894        self,
895    ) -> std::pin::Pin<
896        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
897    > {
898        Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
899    }
900}
901impl InputTypeDefId {
902    fn quote(&self) -> String {
903        format!("\"{}\"", self.0.clone())
904    }
905}
906#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
907pub struct InterfaceTypeDefId(pub String);
908impl From<&str> for InterfaceTypeDefId {
909    fn from(value: &str) -> Self {
910        Self(value.to_string())
911    }
912}
913impl From<String> for InterfaceTypeDefId {
914    fn from(value: String) -> Self {
915        Self(value)
916    }
917}
918impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
919    fn into_id(
920        self,
921    ) -> std::pin::Pin<
922        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
923    > {
924        Box::pin(async move { self.id().await })
925    }
926}
927impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
928    fn into_id(
929        self,
930    ) -> std::pin::Pin<
931        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
932    > {
933        Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
934    }
935}
936impl InterfaceTypeDefId {
937    fn quote(&self) -> String {
938        format!("\"{}\"", self.0.clone())
939    }
940}
941#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
942pub struct Json(pub String);
943impl From<&str> for Json {
944    fn from(value: &str) -> Self {
945        Self(value.to_string())
946    }
947}
948impl From<String> for Json {
949    fn from(value: String) -> Self {
950        Self(value)
951    }
952}
953impl Json {
954    fn quote(&self) -> String {
955        format!("\"{}\"", self.0.clone())
956    }
957}
958#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
959pub struct Llmid(pub String);
960impl From<&str> for Llmid {
961    fn from(value: &str) -> Self {
962        Self(value.to_string())
963    }
964}
965impl From<String> for Llmid {
966    fn from(value: String) -> Self {
967        Self(value)
968    }
969}
970impl IntoID<Llmid> for Llm {
971    fn into_id(
972        self,
973    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
974    {
975        Box::pin(async move { self.id().await })
976    }
977}
978impl IntoID<Llmid> for Llmid {
979    fn into_id(
980        self,
981    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
982    {
983        Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
984    }
985}
986impl Llmid {
987    fn quote(&self) -> String {
988        format!("\"{}\"", self.0.clone())
989    }
990}
991#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
992pub struct LlmTokenUsageId(pub String);
993impl From<&str> for LlmTokenUsageId {
994    fn from(value: &str) -> Self {
995        Self(value.to_string())
996    }
997}
998impl From<String> for LlmTokenUsageId {
999    fn from(value: String) -> Self {
1000        Self(value)
1001    }
1002}
1003impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
1004    fn into_id(
1005        self,
1006    ) -> std::pin::Pin<
1007        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1008    > {
1009        Box::pin(async move { self.id().await })
1010    }
1011}
1012impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
1013    fn into_id(
1014        self,
1015    ) -> std::pin::Pin<
1016        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1017    > {
1018        Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
1019    }
1020}
1021impl LlmTokenUsageId {
1022    fn quote(&self) -> String {
1023        format!("\"{}\"", self.0.clone())
1024    }
1025}
1026#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1027pub struct LabelId(pub String);
1028impl From<&str> for LabelId {
1029    fn from(value: &str) -> Self {
1030        Self(value.to_string())
1031    }
1032}
1033impl From<String> for LabelId {
1034    fn from(value: String) -> Self {
1035        Self(value)
1036    }
1037}
1038impl IntoID<LabelId> for Label {
1039    fn into_id(
1040        self,
1041    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1042    {
1043        Box::pin(async move { self.id().await })
1044    }
1045}
1046impl IntoID<LabelId> for LabelId {
1047    fn into_id(
1048        self,
1049    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1050    {
1051        Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
1052    }
1053}
1054impl LabelId {
1055    fn quote(&self) -> String {
1056        format!("\"{}\"", self.0.clone())
1057    }
1058}
1059#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1060pub struct ListTypeDefId(pub String);
1061impl From<&str> for ListTypeDefId {
1062    fn from(value: &str) -> Self {
1063        Self(value.to_string())
1064    }
1065}
1066impl From<String> for ListTypeDefId {
1067    fn from(value: String) -> Self {
1068        Self(value)
1069    }
1070}
1071impl IntoID<ListTypeDefId> for ListTypeDef {
1072    fn into_id(
1073        self,
1074    ) -> std::pin::Pin<
1075        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1076    > {
1077        Box::pin(async move { self.id().await })
1078    }
1079}
1080impl IntoID<ListTypeDefId> for ListTypeDefId {
1081    fn into_id(
1082        self,
1083    ) -> std::pin::Pin<
1084        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1085    > {
1086        Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
1087    }
1088}
1089impl ListTypeDefId {
1090    fn quote(&self) -> String {
1091        format!("\"{}\"", self.0.clone())
1092    }
1093}
1094#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1095pub struct ModuleConfigClientId(pub String);
1096impl From<&str> for ModuleConfigClientId {
1097    fn from(value: &str) -> Self {
1098        Self(value.to_string())
1099    }
1100}
1101impl From<String> for ModuleConfigClientId {
1102    fn from(value: String) -> Self {
1103        Self(value)
1104    }
1105}
1106impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
1107    fn into_id(
1108        self,
1109    ) -> std::pin::Pin<
1110        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1111    > {
1112        Box::pin(async move { self.id().await })
1113    }
1114}
1115impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
1116    fn into_id(
1117        self,
1118    ) -> std::pin::Pin<
1119        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1120    > {
1121        Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
1122    }
1123}
1124impl ModuleConfigClientId {
1125    fn quote(&self) -> String {
1126        format!("\"{}\"", self.0.clone())
1127    }
1128}
1129#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1130pub struct ModuleId(pub String);
1131impl From<&str> for ModuleId {
1132    fn from(value: &str) -> Self {
1133        Self(value.to_string())
1134    }
1135}
1136impl From<String> for ModuleId {
1137    fn from(value: String) -> Self {
1138        Self(value)
1139    }
1140}
1141impl IntoID<ModuleId> for Module {
1142    fn into_id(
1143        self,
1144    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1145    {
1146        Box::pin(async move { self.id().await })
1147    }
1148}
1149impl IntoID<ModuleId> for ModuleId {
1150    fn into_id(
1151        self,
1152    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1153    {
1154        Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
1155    }
1156}
1157impl ModuleId {
1158    fn quote(&self) -> String {
1159        format!("\"{}\"", self.0.clone())
1160    }
1161}
1162#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1163pub struct ModuleSourceId(pub String);
1164impl From<&str> for ModuleSourceId {
1165    fn from(value: &str) -> Self {
1166        Self(value.to_string())
1167    }
1168}
1169impl From<String> for ModuleSourceId {
1170    fn from(value: String) -> Self {
1171        Self(value)
1172    }
1173}
1174impl IntoID<ModuleSourceId> for ModuleSource {
1175    fn into_id(
1176        self,
1177    ) -> std::pin::Pin<
1178        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1179    > {
1180        Box::pin(async move { self.id().await })
1181    }
1182}
1183impl IntoID<ModuleSourceId> for ModuleSourceId {
1184    fn into_id(
1185        self,
1186    ) -> std::pin::Pin<
1187        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1188    > {
1189        Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1190    }
1191}
1192impl ModuleSourceId {
1193    fn quote(&self) -> String {
1194        format!("\"{}\"", self.0.clone())
1195    }
1196}
1197#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1198pub struct ObjectTypeDefId(pub String);
1199impl From<&str> for ObjectTypeDefId {
1200    fn from(value: &str) -> Self {
1201        Self(value.to_string())
1202    }
1203}
1204impl From<String> for ObjectTypeDefId {
1205    fn from(value: String) -> Self {
1206        Self(value)
1207    }
1208}
1209impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1210    fn into_id(
1211        self,
1212    ) -> std::pin::Pin<
1213        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1214    > {
1215        Box::pin(async move { self.id().await })
1216    }
1217}
1218impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1219    fn into_id(
1220        self,
1221    ) -> std::pin::Pin<
1222        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1223    > {
1224        Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1225    }
1226}
1227impl ObjectTypeDefId {
1228    fn quote(&self) -> String {
1229        format!("\"{}\"", self.0.clone())
1230    }
1231}
1232#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1233pub struct Platform(pub String);
1234impl From<&str> for Platform {
1235    fn from(value: &str) -> Self {
1236        Self(value.to_string())
1237    }
1238}
1239impl From<String> for Platform {
1240    fn from(value: String) -> Self {
1241        Self(value)
1242    }
1243}
1244impl Platform {
1245    fn quote(&self) -> String {
1246        format!("\"{}\"", self.0.clone())
1247    }
1248}
1249#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1250pub struct PortId(pub String);
1251impl From<&str> for PortId {
1252    fn from(value: &str) -> Self {
1253        Self(value.to_string())
1254    }
1255}
1256impl From<String> for PortId {
1257    fn from(value: String) -> Self {
1258        Self(value)
1259    }
1260}
1261impl IntoID<PortId> for Port {
1262    fn into_id(
1263        self,
1264    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1265    {
1266        Box::pin(async move { self.id().await })
1267    }
1268}
1269impl IntoID<PortId> for PortId {
1270    fn into_id(
1271        self,
1272    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1273    {
1274        Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1275    }
1276}
1277impl PortId {
1278    fn quote(&self) -> String {
1279        format!("\"{}\"", self.0.clone())
1280    }
1281}
1282#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1283pub struct SdkConfigId(pub String);
1284impl From<&str> for SdkConfigId {
1285    fn from(value: &str) -> Self {
1286        Self(value.to_string())
1287    }
1288}
1289impl From<String> for SdkConfigId {
1290    fn from(value: String) -> Self {
1291        Self(value)
1292    }
1293}
1294impl IntoID<SdkConfigId> for SdkConfig {
1295    fn into_id(
1296        self,
1297    ) -> std::pin::Pin<
1298        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1299    > {
1300        Box::pin(async move { self.id().await })
1301    }
1302}
1303impl IntoID<SdkConfigId> for SdkConfigId {
1304    fn into_id(
1305        self,
1306    ) -> std::pin::Pin<
1307        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1308    > {
1309        Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1310    }
1311}
1312impl SdkConfigId {
1313    fn quote(&self) -> String {
1314        format!("\"{}\"", self.0.clone())
1315    }
1316}
1317#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1318pub struct ScalarTypeDefId(pub String);
1319impl From<&str> for ScalarTypeDefId {
1320    fn from(value: &str) -> Self {
1321        Self(value.to_string())
1322    }
1323}
1324impl From<String> for ScalarTypeDefId {
1325    fn from(value: String) -> Self {
1326        Self(value)
1327    }
1328}
1329impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1330    fn into_id(
1331        self,
1332    ) -> std::pin::Pin<
1333        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1334    > {
1335        Box::pin(async move { self.id().await })
1336    }
1337}
1338impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1339    fn into_id(
1340        self,
1341    ) -> std::pin::Pin<
1342        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1343    > {
1344        Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1345    }
1346}
1347impl ScalarTypeDefId {
1348    fn quote(&self) -> String {
1349        format!("\"{}\"", self.0.clone())
1350    }
1351}
1352#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1353pub struct SecretId(pub String);
1354impl From<&str> for SecretId {
1355    fn from(value: &str) -> Self {
1356        Self(value.to_string())
1357    }
1358}
1359impl From<String> for SecretId {
1360    fn from(value: String) -> Self {
1361        Self(value)
1362    }
1363}
1364impl IntoID<SecretId> for Secret {
1365    fn into_id(
1366        self,
1367    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1368    {
1369        Box::pin(async move { self.id().await })
1370    }
1371}
1372impl IntoID<SecretId> for SecretId {
1373    fn into_id(
1374        self,
1375    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1376    {
1377        Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1378    }
1379}
1380impl SecretId {
1381    fn quote(&self) -> String {
1382        format!("\"{}\"", self.0.clone())
1383    }
1384}
1385#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1386pub struct ServiceId(pub String);
1387impl From<&str> for ServiceId {
1388    fn from(value: &str) -> Self {
1389        Self(value.to_string())
1390    }
1391}
1392impl From<String> for ServiceId {
1393    fn from(value: String) -> Self {
1394        Self(value)
1395    }
1396}
1397impl IntoID<ServiceId> for Service {
1398    fn into_id(
1399        self,
1400    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1401    {
1402        Box::pin(async move { self.id().await })
1403    }
1404}
1405impl IntoID<ServiceId> for ServiceId {
1406    fn into_id(
1407        self,
1408    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1409    {
1410        Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1411    }
1412}
1413impl ServiceId {
1414    fn quote(&self) -> String {
1415        format!("\"{}\"", self.0.clone())
1416    }
1417}
1418#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1419pub struct SocketId(pub String);
1420impl From<&str> for SocketId {
1421    fn from(value: &str) -> Self {
1422        Self(value.to_string())
1423    }
1424}
1425impl From<String> for SocketId {
1426    fn from(value: String) -> Self {
1427        Self(value)
1428    }
1429}
1430impl IntoID<SocketId> for Socket {
1431    fn into_id(
1432        self,
1433    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1434    {
1435        Box::pin(async move { self.id().await })
1436    }
1437}
1438impl IntoID<SocketId> for SocketId {
1439    fn into_id(
1440        self,
1441    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1442    {
1443        Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1444    }
1445}
1446impl SocketId {
1447    fn quote(&self) -> String {
1448        format!("\"{}\"", self.0.clone())
1449    }
1450}
1451#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1452pub struct SourceMapId(pub String);
1453impl From<&str> for SourceMapId {
1454    fn from(value: &str) -> Self {
1455        Self(value.to_string())
1456    }
1457}
1458impl From<String> for SourceMapId {
1459    fn from(value: String) -> Self {
1460        Self(value)
1461    }
1462}
1463impl IntoID<SourceMapId> for SourceMap {
1464    fn into_id(
1465        self,
1466    ) -> std::pin::Pin<
1467        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1468    > {
1469        Box::pin(async move { self.id().await })
1470    }
1471}
1472impl IntoID<SourceMapId> for SourceMapId {
1473    fn into_id(
1474        self,
1475    ) -> std::pin::Pin<
1476        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1477    > {
1478        Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1479    }
1480}
1481impl SourceMapId {
1482    fn quote(&self) -> String {
1483        format!("\"{}\"", self.0.clone())
1484    }
1485}
1486#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1487pub struct TerminalId(pub String);
1488impl From<&str> for TerminalId {
1489    fn from(value: &str) -> Self {
1490        Self(value.to_string())
1491    }
1492}
1493impl From<String> for TerminalId {
1494    fn from(value: String) -> Self {
1495        Self(value)
1496    }
1497}
1498impl IntoID<TerminalId> for Terminal {
1499    fn into_id(
1500        self,
1501    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1502    {
1503        Box::pin(async move { self.id().await })
1504    }
1505}
1506impl IntoID<TerminalId> for TerminalId {
1507    fn into_id(
1508        self,
1509    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1510    {
1511        Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
1512    }
1513}
1514impl TerminalId {
1515    fn quote(&self) -> String {
1516        format!("\"{}\"", self.0.clone())
1517    }
1518}
1519#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1520pub struct TypeDefId(pub String);
1521impl From<&str> for TypeDefId {
1522    fn from(value: &str) -> Self {
1523        Self(value.to_string())
1524    }
1525}
1526impl From<String> for TypeDefId {
1527    fn from(value: String) -> Self {
1528        Self(value)
1529    }
1530}
1531impl IntoID<TypeDefId> for TypeDef {
1532    fn into_id(
1533        self,
1534    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1535    {
1536        Box::pin(async move { self.id().await })
1537    }
1538}
1539impl IntoID<TypeDefId> for TypeDefId {
1540    fn into_id(
1541        self,
1542    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1543    {
1544        Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
1545    }
1546}
1547impl TypeDefId {
1548    fn quote(&self) -> String {
1549        format!("\"{}\"", self.0.clone())
1550    }
1551}
1552#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1553pub struct Void(pub String);
1554impl From<&str> for Void {
1555    fn from(value: &str) -> Self {
1556        Self(value.to_string())
1557    }
1558}
1559impl From<String> for Void {
1560    fn from(value: String) -> Self {
1561        Self(value)
1562    }
1563}
1564impl Void {
1565    fn quote(&self) -> String {
1566        format!("\"{}\"", self.0.clone())
1567    }
1568}
1569#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1570pub struct BuildArg {
1571    pub name: String,
1572    pub value: String,
1573}
1574#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1575pub struct PipelineLabel {
1576    pub name: String,
1577    pub value: String,
1578}
1579#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1580pub struct PortForward {
1581    pub backend: isize,
1582    pub frontend: isize,
1583    pub protocol: NetworkProtocol,
1584}
1585#[derive(Clone)]
1586pub struct Binding {
1587    pub proc: Option<Arc<DaggerSessionProc>>,
1588    pub selection: Selection,
1589    pub graphql_client: DynGraphQLClient,
1590}
1591impl Binding {
1592    /// Retrieve the binding value, as type CacheVolume
1593    pub fn as_cache_volume(&self) -> CacheVolume {
1594        let query = self.selection.select("asCacheVolume");
1595        CacheVolume {
1596            proc: self.proc.clone(),
1597            selection: query,
1598            graphql_client: self.graphql_client.clone(),
1599        }
1600    }
1601    /// Retrieve the binding value, as type Container
1602    pub fn as_container(&self) -> Container {
1603        let query = self.selection.select("asContainer");
1604        Container {
1605            proc: self.proc.clone(),
1606            selection: query,
1607            graphql_client: self.graphql_client.clone(),
1608        }
1609    }
1610    /// Retrieve the binding value, as type Directory
1611    pub fn as_directory(&self) -> Directory {
1612        let query = self.selection.select("asDirectory");
1613        Directory {
1614            proc: self.proc.clone(),
1615            selection: query,
1616            graphql_client: self.graphql_client.clone(),
1617        }
1618    }
1619    /// Retrieve the binding value, as type Env
1620    pub fn as_env(&self) -> Env {
1621        let query = self.selection.select("asEnv");
1622        Env {
1623            proc: self.proc.clone(),
1624            selection: query,
1625            graphql_client: self.graphql_client.clone(),
1626        }
1627    }
1628    /// Retrieve the binding value, as type File
1629    pub fn as_file(&self) -> File {
1630        let query = self.selection.select("asFile");
1631        File {
1632            proc: self.proc.clone(),
1633            selection: query,
1634            graphql_client: self.graphql_client.clone(),
1635        }
1636    }
1637    /// Retrieve the binding value, as type GitRef
1638    pub fn as_git_ref(&self) -> GitRef {
1639        let query = self.selection.select("asGitRef");
1640        GitRef {
1641            proc: self.proc.clone(),
1642            selection: query,
1643            graphql_client: self.graphql_client.clone(),
1644        }
1645    }
1646    /// Retrieve the binding value, as type GitRepository
1647    pub fn as_git_repository(&self) -> GitRepository {
1648        let query = self.selection.select("asGitRepository");
1649        GitRepository {
1650            proc: self.proc.clone(),
1651            selection: query,
1652            graphql_client: self.graphql_client.clone(),
1653        }
1654    }
1655    /// Retrieve the binding value, as type LLM
1656    pub fn as_llm(&self) -> Llm {
1657        let query = self.selection.select("asLLM");
1658        Llm {
1659            proc: self.proc.clone(),
1660            selection: query,
1661            graphql_client: self.graphql_client.clone(),
1662        }
1663    }
1664    /// Retrieve the binding value, as type Module
1665    pub fn as_module(&self) -> Module {
1666        let query = self.selection.select("asModule");
1667        Module {
1668            proc: self.proc.clone(),
1669            selection: query,
1670            graphql_client: self.graphql_client.clone(),
1671        }
1672    }
1673    /// Retrieve the binding value, as type ModuleConfigClient
1674    pub fn as_module_config_client(&self) -> ModuleConfigClient {
1675        let query = self.selection.select("asModuleConfigClient");
1676        ModuleConfigClient {
1677            proc: self.proc.clone(),
1678            selection: query,
1679            graphql_client: self.graphql_client.clone(),
1680        }
1681    }
1682    /// Retrieve the binding value, as type ModuleSource
1683    pub fn as_module_source(&self) -> ModuleSource {
1684        let query = self.selection.select("asModuleSource");
1685        ModuleSource {
1686            proc: self.proc.clone(),
1687            selection: query,
1688            graphql_client: self.graphql_client.clone(),
1689        }
1690    }
1691    /// Retrieve the binding value, as type Secret
1692    pub fn as_secret(&self) -> Secret {
1693        let query = self.selection.select("asSecret");
1694        Secret {
1695            proc: self.proc.clone(),
1696            selection: query,
1697            graphql_client: self.graphql_client.clone(),
1698        }
1699    }
1700    /// Retrieve the binding value, as type Service
1701    pub fn as_service(&self) -> Service {
1702        let query = self.selection.select("asService");
1703        Service {
1704            proc: self.proc.clone(),
1705            selection: query,
1706            graphql_client: self.graphql_client.clone(),
1707        }
1708    }
1709    /// Retrieve the binding value, as type Socket
1710    pub fn as_socket(&self) -> Socket {
1711        let query = self.selection.select("asSocket");
1712        Socket {
1713            proc: self.proc.clone(),
1714            selection: query,
1715            graphql_client: self.graphql_client.clone(),
1716        }
1717    }
1718    /// The binding's string value
1719    pub async fn as_string(&self) -> Result<String, DaggerError> {
1720        let query = self.selection.select("asString");
1721        query.execute(self.graphql_client.clone()).await
1722    }
1723    /// The digest of the binding value
1724    pub async fn digest(&self) -> Result<String, DaggerError> {
1725        let query = self.selection.select("digest");
1726        query.execute(self.graphql_client.clone()).await
1727    }
1728    /// A unique identifier for this Binding.
1729    pub async fn id(&self) -> Result<BindingId, DaggerError> {
1730        let query = self.selection.select("id");
1731        query.execute(self.graphql_client.clone()).await
1732    }
1733    /// Returns true if the binding is null
1734    pub async fn is_null(&self) -> Result<bool, DaggerError> {
1735        let query = self.selection.select("isNull");
1736        query.execute(self.graphql_client.clone()).await
1737    }
1738    /// The binding name
1739    pub async fn name(&self) -> Result<String, DaggerError> {
1740        let query = self.selection.select("name");
1741        query.execute(self.graphql_client.clone()).await
1742    }
1743    /// The binding type
1744    pub async fn type_name(&self) -> Result<String, DaggerError> {
1745        let query = self.selection.select("typeName");
1746        query.execute(self.graphql_client.clone()).await
1747    }
1748}
1749#[derive(Clone)]
1750pub struct CacheVolume {
1751    pub proc: Option<Arc<DaggerSessionProc>>,
1752    pub selection: Selection,
1753    pub graphql_client: DynGraphQLClient,
1754}
1755impl CacheVolume {
1756    /// A unique identifier for this CacheVolume.
1757    pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
1758        let query = self.selection.select("id");
1759        query.execute(self.graphql_client.clone()).await
1760    }
1761}
1762#[derive(Clone)]
1763pub struct Container {
1764    pub proc: Option<Arc<DaggerSessionProc>>,
1765    pub selection: Selection,
1766    pub graphql_client: DynGraphQLClient,
1767}
1768#[derive(Builder, Debug, PartialEq)]
1769pub struct ContainerAsServiceOpts<'a> {
1770    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1771    /// If empty, the container's default command is used.
1772    #[builder(setter(into, strip_option), default)]
1773    pub args: Option<Vec<&'a str>>,
1774    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1775    #[builder(setter(into, strip_option), default)]
1776    pub expand: Option<bool>,
1777    /// Provides Dagger access to the executed command.
1778    #[builder(setter(into, strip_option), default)]
1779    pub experimental_privileged_nesting: Option<bool>,
1780    /// 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.
1781    #[builder(setter(into, strip_option), default)]
1782    pub insecure_root_capabilities: Option<bool>,
1783    /// If set, skip the automatic init process injected into containers by default.
1784    /// 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.
1785    #[builder(setter(into, strip_option), default)]
1786    pub no_init: Option<bool>,
1787    /// If the container has an entrypoint, prepend it to the args.
1788    #[builder(setter(into, strip_option), default)]
1789    pub use_entrypoint: Option<bool>,
1790}
1791#[derive(Builder, Debug, PartialEq)]
1792pub struct ContainerAsTarballOpts {
1793    /// Force each layer of the image to use the specified compression algorithm.
1794    /// 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.
1795    #[builder(setter(into, strip_option), default)]
1796    pub forced_compression: Option<ImageLayerCompression>,
1797    /// Use the specified media types for the image's layers.
1798    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1799    #[builder(setter(into, strip_option), default)]
1800    pub media_types: Option<ImageMediaTypes>,
1801    /// Identifiers for other platform specific containers.
1802    /// Used for multi-platform images.
1803    #[builder(setter(into, strip_option), default)]
1804    pub platform_variants: Option<Vec<ContainerId>>,
1805}
1806#[derive(Builder, Debug, PartialEq)]
1807pub struct ContainerBuildOpts<'a> {
1808    /// Additional build arguments.
1809    #[builder(setter(into, strip_option), default)]
1810    pub build_args: Option<Vec<BuildArg>>,
1811    /// Path to the Dockerfile to use.
1812    #[builder(setter(into, strip_option), default)]
1813    pub dockerfile: Option<&'a str>,
1814    /// If set, skip the automatic init process injected into containers created by RUN statements.
1815    /// 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.
1816    #[builder(setter(into, strip_option), default)]
1817    pub no_init: Option<bool>,
1818    /// Secrets to pass to the build.
1819    /// They will be mounted at /run/secrets/[secret-name] in the build container
1820    /// 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))
1821    #[builder(setter(into, strip_option), default)]
1822    pub secrets: Option<Vec<SecretId>>,
1823    /// Target build stage to build.
1824    #[builder(setter(into, strip_option), default)]
1825    pub target: Option<&'a str>,
1826}
1827#[derive(Builder, Debug, PartialEq)]
1828pub struct ContainerDirectoryOpts {
1829    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1830    #[builder(setter(into, strip_option), default)]
1831    pub expand: Option<bool>,
1832}
1833#[derive(Builder, Debug, PartialEq)]
1834pub struct ContainerExportOpts {
1835    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1836    #[builder(setter(into, strip_option), default)]
1837    pub expand: Option<bool>,
1838    /// Force each layer of the exported image to use the specified compression algorithm.
1839    /// 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.
1840    #[builder(setter(into, strip_option), default)]
1841    pub forced_compression: Option<ImageLayerCompression>,
1842    /// Use the specified media types for the exported image's layers.
1843    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1844    #[builder(setter(into, strip_option), default)]
1845    pub media_types: Option<ImageMediaTypes>,
1846    /// Identifiers for other platform specific containers.
1847    /// Used for multi-platform image.
1848    #[builder(setter(into, strip_option), default)]
1849    pub platform_variants: Option<Vec<ContainerId>>,
1850}
1851#[derive(Builder, Debug, PartialEq)]
1852pub struct ContainerFileOpts {
1853    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1854    #[builder(setter(into, strip_option), default)]
1855    pub expand: Option<bool>,
1856}
1857#[derive(Builder, Debug, PartialEq)]
1858pub struct ContainerImportOpts<'a> {
1859    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
1860    #[builder(setter(into, strip_option), default)]
1861    pub tag: Option<&'a str>,
1862}
1863#[derive(Builder, Debug, PartialEq)]
1864pub struct ContainerPublishOpts {
1865    /// Force each layer of the published image to use the specified compression algorithm.
1866    /// 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.
1867    #[builder(setter(into, strip_option), default)]
1868    pub forced_compression: Option<ImageLayerCompression>,
1869    /// Use the specified media types for the published image's layers.
1870    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
1871    #[builder(setter(into, strip_option), default)]
1872    pub media_types: Option<ImageMediaTypes>,
1873    /// Identifiers for other platform specific containers.
1874    /// Used for multi-platform image.
1875    #[builder(setter(into, strip_option), default)]
1876    pub platform_variants: Option<Vec<ContainerId>>,
1877}
1878#[derive(Builder, Debug, PartialEq)]
1879pub struct ContainerTerminalOpts<'a> {
1880    /// If set, override the container's default terminal command and invoke these command arguments instead.
1881    #[builder(setter(into, strip_option), default)]
1882    pub cmd: Option<Vec<&'a str>>,
1883    /// Provides Dagger access to the executed command.
1884    #[builder(setter(into, strip_option), default)]
1885    pub experimental_privileged_nesting: Option<bool>,
1886    /// 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.
1887    #[builder(setter(into, strip_option), default)]
1888    pub insecure_root_capabilities: Option<bool>,
1889}
1890#[derive(Builder, Debug, PartialEq)]
1891pub struct ContainerUpOpts<'a> {
1892    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1893    /// If empty, the container's default command is used.
1894    #[builder(setter(into, strip_option), default)]
1895    pub args: Option<Vec<&'a str>>,
1896    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1897    #[builder(setter(into, strip_option), default)]
1898    pub expand: Option<bool>,
1899    /// Provides Dagger access to the executed command.
1900    #[builder(setter(into, strip_option), default)]
1901    pub experimental_privileged_nesting: Option<bool>,
1902    /// 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.
1903    #[builder(setter(into, strip_option), default)]
1904    pub insecure_root_capabilities: Option<bool>,
1905    /// If set, skip the automatic init process injected into containers by default.
1906    /// 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.
1907    #[builder(setter(into, strip_option), default)]
1908    pub no_init: Option<bool>,
1909    /// List of frontend/backend port mappings to forward.
1910    /// Frontend is the port accepting traffic on the host, backend is the service port.
1911    #[builder(setter(into, strip_option), default)]
1912    pub ports: Option<Vec<PortForward>>,
1913    /// Bind each tunnel port to a random port on the host.
1914    #[builder(setter(into, strip_option), default)]
1915    pub random: Option<bool>,
1916    /// If the container has an entrypoint, prepend it to the args.
1917    #[builder(setter(into, strip_option), default)]
1918    pub use_entrypoint: Option<bool>,
1919}
1920#[derive(Builder, Debug, PartialEq)]
1921pub struct ContainerWithDefaultTerminalCmdOpts {
1922    /// Provides Dagger access to the executed command.
1923    #[builder(setter(into, strip_option), default)]
1924    pub experimental_privileged_nesting: Option<bool>,
1925    /// 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.
1926    #[builder(setter(into, strip_option), default)]
1927    pub insecure_root_capabilities: Option<bool>,
1928}
1929#[derive(Builder, Debug, PartialEq)]
1930pub struct ContainerWithDirectoryOpts<'a> {
1931    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
1932    #[builder(setter(into, strip_option), default)]
1933    pub exclude: Option<Vec<&'a str>>,
1934    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1935    #[builder(setter(into, strip_option), default)]
1936    pub expand: Option<bool>,
1937    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
1938    #[builder(setter(into, strip_option), default)]
1939    pub include: Option<Vec<&'a str>>,
1940    /// A user:group to set for the directory and its contents.
1941    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
1942    /// If the group is omitted, it defaults to the same as the user.
1943    #[builder(setter(into, strip_option), default)]
1944    pub owner: Option<&'a str>,
1945}
1946#[derive(Builder, Debug, PartialEq)]
1947pub struct ContainerWithEntrypointOpts {
1948    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
1949    #[builder(setter(into, strip_option), default)]
1950    pub keep_default_args: Option<bool>,
1951}
1952#[derive(Builder, Debug, PartialEq)]
1953pub struct ContainerWithEnvVariableOpts {
1954    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
1955    #[builder(setter(into, strip_option), default)]
1956    pub expand: Option<bool>,
1957}
1958#[derive(Builder, Debug, PartialEq)]
1959pub struct ContainerWithExecOpts<'a> {
1960    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1961    #[builder(setter(into, strip_option), default)]
1962    pub expand: Option<bool>,
1963    /// Exit codes this command is allowed to exit with without error
1964    #[builder(setter(into, strip_option), default)]
1965    pub expect: Option<ReturnType>,
1966    /// Provides Dagger access to the executed command.
1967    #[builder(setter(into, strip_option), default)]
1968    pub experimental_privileged_nesting: Option<bool>,
1969    /// Execute the command with all root capabilities. Like --privileged in Docker
1970    /// 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.
1971    #[builder(setter(into, strip_option), default)]
1972    pub insecure_root_capabilities: Option<bool>,
1973    /// Skip the automatic init process injected into containers by default.
1974    /// 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.
1975    #[builder(setter(into, strip_option), default)]
1976    pub no_init: Option<bool>,
1977    /// Like redirectStdout, but for standard error
1978    #[builder(setter(into, strip_option), default)]
1979    pub redirect_stderr: Option<&'a str>,
1980    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
1981    #[builder(setter(into, strip_option), default)]
1982    pub redirect_stdout: Option<&'a str>,
1983    /// Content to write to the command's standard input. Example: "Hello world")
1984    #[builder(setter(into, strip_option), default)]
1985    pub stdin: Option<&'a str>,
1986    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
1987    #[builder(setter(into, strip_option), default)]
1988    pub use_entrypoint: Option<bool>,
1989}
1990#[derive(Builder, Debug, PartialEq)]
1991pub struct ContainerWithExposedPortOpts<'a> {
1992    /// Port description. Example: "payment API endpoint"
1993    #[builder(setter(into, strip_option), default)]
1994    pub description: Option<&'a str>,
1995    /// Skip the health check when run as a service.
1996    #[builder(setter(into, strip_option), default)]
1997    pub experimental_skip_healthcheck: Option<bool>,
1998    /// Network protocol. Example: "tcp"
1999    #[builder(setter(into, strip_option), default)]
2000    pub protocol: Option<NetworkProtocol>,
2001}
2002#[derive(Builder, Debug, PartialEq)]
2003pub struct ContainerWithFileOpts<'a> {
2004    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2005    #[builder(setter(into, strip_option), default)]
2006    pub expand: Option<bool>,
2007    /// A user:group to set for the file.
2008    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2009    /// If the group is omitted, it defaults to the same as the user.
2010    #[builder(setter(into, strip_option), default)]
2011    pub owner: Option<&'a str>,
2012    /// Permissions of the new file. Example: 0600
2013    #[builder(setter(into, strip_option), default)]
2014    pub permissions: Option<isize>,
2015}
2016#[derive(Builder, Debug, PartialEq)]
2017pub struct ContainerWithFilesOpts<'a> {
2018    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2019    #[builder(setter(into, strip_option), default)]
2020    pub expand: Option<bool>,
2021    /// A user:group to set for the files.
2022    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2023    /// If the group is omitted, it defaults to the same as the user.
2024    #[builder(setter(into, strip_option), default)]
2025    pub owner: Option<&'a str>,
2026    /// Permission given to the copied files (e.g., 0600).
2027    #[builder(setter(into, strip_option), default)]
2028    pub permissions: Option<isize>,
2029}
2030#[derive(Builder, Debug, PartialEq)]
2031pub struct ContainerWithMountedCacheOpts<'a> {
2032    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2033    #[builder(setter(into, strip_option), default)]
2034    pub expand: Option<bool>,
2035    /// A user:group to set for the mounted cache directory.
2036    /// 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.
2037    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2038    /// If the group is omitted, it defaults to the same as the user.
2039    #[builder(setter(into, strip_option), default)]
2040    pub owner: Option<&'a str>,
2041    /// Sharing mode of the cache volume.
2042    #[builder(setter(into, strip_option), default)]
2043    pub sharing: Option<CacheSharingMode>,
2044    /// Identifier of the directory to use as the cache volume's root.
2045    #[builder(setter(into, strip_option), default)]
2046    pub source: Option<DirectoryId>,
2047}
2048#[derive(Builder, Debug, PartialEq)]
2049pub struct ContainerWithMountedDirectoryOpts<'a> {
2050    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2051    #[builder(setter(into, strip_option), default)]
2052    pub expand: Option<bool>,
2053    /// A user:group to set for the mounted directory and its contents.
2054    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2055    /// If the group is omitted, it defaults to the same as the user.
2056    #[builder(setter(into, strip_option), default)]
2057    pub owner: Option<&'a str>,
2058}
2059#[derive(Builder, Debug, PartialEq)]
2060pub struct ContainerWithMountedFileOpts<'a> {
2061    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2062    #[builder(setter(into, strip_option), default)]
2063    pub expand: Option<bool>,
2064    /// A user or user:group to set for the mounted file.
2065    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2066    /// If the group is omitted, it defaults to the same as the user.
2067    #[builder(setter(into, strip_option), default)]
2068    pub owner: Option<&'a str>,
2069}
2070#[derive(Builder, Debug, PartialEq)]
2071pub struct ContainerWithMountedSecretOpts<'a> {
2072    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2073    #[builder(setter(into, strip_option), default)]
2074    pub expand: Option<bool>,
2075    /// Permission given to the mounted secret (e.g., 0600).
2076    /// This option requires an owner to be set to be active.
2077    #[builder(setter(into, strip_option), default)]
2078    pub mode: Option<isize>,
2079    /// A user:group to set for the mounted secret.
2080    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2081    /// If the group is omitted, it defaults to the same as the user.
2082    #[builder(setter(into, strip_option), default)]
2083    pub owner: Option<&'a str>,
2084}
2085#[derive(Builder, Debug, PartialEq)]
2086pub struct ContainerWithMountedTempOpts {
2087    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2088    #[builder(setter(into, strip_option), default)]
2089    pub expand: Option<bool>,
2090    /// Size of the temporary directory in bytes.
2091    #[builder(setter(into, strip_option), default)]
2092    pub size: Option<isize>,
2093}
2094#[derive(Builder, Debug, PartialEq)]
2095pub struct ContainerWithNewFileOpts<'a> {
2096    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2097    #[builder(setter(into, strip_option), default)]
2098    pub expand: Option<bool>,
2099    /// A user:group to set for the file.
2100    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2101    /// If the group is omitted, it defaults to the same as the user.
2102    #[builder(setter(into, strip_option), default)]
2103    pub owner: Option<&'a str>,
2104    /// Permissions of the new file. Example: 0600
2105    #[builder(setter(into, strip_option), default)]
2106    pub permissions: Option<isize>,
2107}
2108#[derive(Builder, Debug, PartialEq)]
2109pub struct ContainerWithUnixSocketOpts<'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 socket.
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 ContainerWithWorkdirOpts {
2121    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2122    #[builder(setter(into, strip_option), default)]
2123    pub expand: Option<bool>,
2124}
2125#[derive(Builder, Debug, PartialEq)]
2126pub struct ContainerWithoutDirectoryOpts {
2127    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2128    #[builder(setter(into, strip_option), default)]
2129    pub expand: Option<bool>,
2130}
2131#[derive(Builder, Debug, PartialEq)]
2132pub struct ContainerWithoutEntrypointOpts {
2133    /// Don't remove the default arguments when unsetting the entrypoint.
2134    #[builder(setter(into, strip_option), default)]
2135    pub keep_default_args: Option<bool>,
2136}
2137#[derive(Builder, Debug, PartialEq)]
2138pub struct ContainerWithoutExposedPortOpts {
2139    /// Port protocol to unexpose
2140    #[builder(setter(into, strip_option), default)]
2141    pub protocol: Option<NetworkProtocol>,
2142}
2143#[derive(Builder, Debug, PartialEq)]
2144pub struct ContainerWithoutFileOpts {
2145    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2146    #[builder(setter(into, strip_option), default)]
2147    pub expand: Option<bool>,
2148}
2149#[derive(Builder, Debug, PartialEq)]
2150pub struct ContainerWithoutFilesOpts {
2151    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2152    #[builder(setter(into, strip_option), default)]
2153    pub expand: Option<bool>,
2154}
2155#[derive(Builder, Debug, PartialEq)]
2156pub struct ContainerWithoutMountOpts {
2157    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2158    #[builder(setter(into, strip_option), default)]
2159    pub expand: Option<bool>,
2160}
2161#[derive(Builder, Debug, PartialEq)]
2162pub struct ContainerWithoutUnixSocketOpts {
2163    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2164    #[builder(setter(into, strip_option), default)]
2165    pub expand: Option<bool>,
2166}
2167impl Container {
2168    /// Turn the container into a Service.
2169    /// Be sure to set any exposed ports before this conversion.
2170    ///
2171    /// # Arguments
2172    ///
2173    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2174    pub fn as_service(&self) -> Service {
2175        let query = self.selection.select("asService");
2176        Service {
2177            proc: self.proc.clone(),
2178            selection: query,
2179            graphql_client: self.graphql_client.clone(),
2180        }
2181    }
2182    /// Turn the container into a Service.
2183    /// Be sure to set any exposed ports before this conversion.
2184    ///
2185    /// # Arguments
2186    ///
2187    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2188    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2189        let mut query = self.selection.select("asService");
2190        if let Some(args) = opts.args {
2191            query = query.arg("args", args);
2192        }
2193        if let Some(use_entrypoint) = opts.use_entrypoint {
2194            query = query.arg("useEntrypoint", use_entrypoint);
2195        }
2196        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2197            query = query.arg(
2198                "experimentalPrivilegedNesting",
2199                experimental_privileged_nesting,
2200            );
2201        }
2202        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2203            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2204        }
2205        if let Some(expand) = opts.expand {
2206            query = query.arg("expand", expand);
2207        }
2208        if let Some(no_init) = opts.no_init {
2209            query = query.arg("noInit", no_init);
2210        }
2211        Service {
2212            proc: self.proc.clone(),
2213            selection: query,
2214            graphql_client: self.graphql_client.clone(),
2215        }
2216    }
2217    /// Package the container state as an OCI image, and return it as a tar archive
2218    ///
2219    /// # Arguments
2220    ///
2221    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2222    pub fn as_tarball(&self) -> File {
2223        let query = self.selection.select("asTarball");
2224        File {
2225            proc: self.proc.clone(),
2226            selection: query,
2227            graphql_client: self.graphql_client.clone(),
2228        }
2229    }
2230    /// Package the container state as an OCI image, and return it as a tar archive
2231    ///
2232    /// # Arguments
2233    ///
2234    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2235    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2236        let mut query = self.selection.select("asTarball");
2237        if let Some(platform_variants) = opts.platform_variants {
2238            query = query.arg("platformVariants", platform_variants);
2239        }
2240        if let Some(forced_compression) = opts.forced_compression {
2241            query = query.arg("forcedCompression", forced_compression);
2242        }
2243        if let Some(media_types) = opts.media_types {
2244            query = query.arg("mediaTypes", media_types);
2245        }
2246        File {
2247            proc: self.proc.clone(),
2248            selection: query,
2249            graphql_client: self.graphql_client.clone(),
2250        }
2251    }
2252    /// Initializes this container from a Dockerfile build.
2253    ///
2254    /// # Arguments
2255    ///
2256    /// * `context` - Directory context used by the Dockerfile.
2257    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2258    pub fn build(&self, context: impl IntoID<DirectoryId>) -> Container {
2259        let mut query = self.selection.select("build");
2260        query = query.arg_lazy(
2261            "context",
2262            Box::new(move || {
2263                let context = context.clone();
2264                Box::pin(async move { context.into_id().await.unwrap().quote() })
2265            }),
2266        );
2267        Container {
2268            proc: self.proc.clone(),
2269            selection: query,
2270            graphql_client: self.graphql_client.clone(),
2271        }
2272    }
2273    /// Initializes this container from a Dockerfile build.
2274    ///
2275    /// # Arguments
2276    ///
2277    /// * `context` - Directory context used by the Dockerfile.
2278    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2279    pub fn build_opts<'a>(
2280        &self,
2281        context: impl IntoID<DirectoryId>,
2282        opts: ContainerBuildOpts<'a>,
2283    ) -> Container {
2284        let mut query = self.selection.select("build");
2285        query = query.arg_lazy(
2286            "context",
2287            Box::new(move || {
2288                let context = context.clone();
2289                Box::pin(async move { context.into_id().await.unwrap().quote() })
2290            }),
2291        );
2292        if let Some(dockerfile) = opts.dockerfile {
2293            query = query.arg("dockerfile", dockerfile);
2294        }
2295        if let Some(target) = opts.target {
2296            query = query.arg("target", target);
2297        }
2298        if let Some(build_args) = opts.build_args {
2299            query = query.arg("buildArgs", build_args);
2300        }
2301        if let Some(secrets) = opts.secrets {
2302            query = query.arg("secrets", secrets);
2303        }
2304        if let Some(no_init) = opts.no_init {
2305            query = query.arg("noInit", no_init);
2306        }
2307        Container {
2308            proc: self.proc.clone(),
2309            selection: query,
2310            graphql_client: self.graphql_client.clone(),
2311        }
2312    }
2313    /// Return the container's default arguments.
2314    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2315        let query = self.selection.select("defaultArgs");
2316        query.execute(self.graphql_client.clone()).await
2317    }
2318    /// Retrieve a directory from the container's root filesystem
2319    /// Mounts are included.
2320    ///
2321    /// # Arguments
2322    ///
2323    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2324    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2325    pub fn directory(&self, path: impl Into<String>) -> Directory {
2326        let mut query = self.selection.select("directory");
2327        query = query.arg("path", path.into());
2328        Directory {
2329            proc: self.proc.clone(),
2330            selection: query,
2331            graphql_client: self.graphql_client.clone(),
2332        }
2333    }
2334    /// Retrieve a directory from the container's root filesystem
2335    /// Mounts are included.
2336    ///
2337    /// # Arguments
2338    ///
2339    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2340    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2341    pub fn directory_opts(
2342        &self,
2343        path: impl Into<String>,
2344        opts: ContainerDirectoryOpts,
2345    ) -> Directory {
2346        let mut query = self.selection.select("directory");
2347        query = query.arg("path", path.into());
2348        if let Some(expand) = opts.expand {
2349            query = query.arg("expand", expand);
2350        }
2351        Directory {
2352            proc: self.proc.clone(),
2353            selection: query,
2354            graphql_client: self.graphql_client.clone(),
2355        }
2356    }
2357    /// Return the container's OCI entrypoint.
2358    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2359        let query = self.selection.select("entrypoint");
2360        query.execute(self.graphql_client.clone()).await
2361    }
2362    /// Retrieves the value of the specified environment variable.
2363    ///
2364    /// # Arguments
2365    ///
2366    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
2367    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2368        let mut query = self.selection.select("envVariable");
2369        query = query.arg("name", name.into());
2370        query.execute(self.graphql_client.clone()).await
2371    }
2372    /// Retrieves the list of environment variables passed to commands.
2373    pub fn env_variables(&self) -> Vec<EnvVariable> {
2374        let query = self.selection.select("envVariables");
2375        vec![EnvVariable {
2376            proc: self.proc.clone(),
2377            selection: query,
2378            graphql_client: self.graphql_client.clone(),
2379        }]
2380    }
2381    /// The exit code of the last executed command
2382    /// Returns an error if no command was executed
2383    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2384        let query = self.selection.select("exitCode");
2385        query.execute(self.graphql_client.clone()).await
2386    }
2387    /// EXPERIMENTAL API! Subject to change/removal at any time.
2388    /// Configures all available GPUs on the host to be accessible to this container.
2389    /// This currently works for Nvidia devices only.
2390    pub fn experimental_with_all_gp_us(&self) -> Container {
2391        let query = self.selection.select("experimentalWithAllGPUs");
2392        Container {
2393            proc: self.proc.clone(),
2394            selection: query,
2395            graphql_client: self.graphql_client.clone(),
2396        }
2397    }
2398    /// EXPERIMENTAL API! Subject to change/removal at any time.
2399    /// Configures the provided list of devices to be accessible to this container.
2400    /// This currently works for Nvidia devices only.
2401    ///
2402    /// # Arguments
2403    ///
2404    /// * `devices` - List of devices to be accessible to this container.
2405    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2406        let mut query = self.selection.select("experimentalWithGPU");
2407        query = query.arg(
2408            "devices",
2409            devices
2410                .into_iter()
2411                .map(|i| i.into())
2412                .collect::<Vec<String>>(),
2413        );
2414        Container {
2415            proc: self.proc.clone(),
2416            selection: query,
2417            graphql_client: self.graphql_client.clone(),
2418        }
2419    }
2420    /// Writes the container as an OCI tarball to the destination file path on the host.
2421    /// It can also export platform variants.
2422    ///
2423    /// # Arguments
2424    ///
2425    /// * `path` - Host's destination path (e.g., "./tarball").
2426    ///
2427    /// Path can be relative to the engine's workdir or absolute.
2428    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2429    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2430        let mut query = self.selection.select("export");
2431        query = query.arg("path", path.into());
2432        query.execute(self.graphql_client.clone()).await
2433    }
2434    /// Writes the container as an OCI tarball to the destination file path on the host.
2435    /// It can also export platform variants.
2436    ///
2437    /// # Arguments
2438    ///
2439    /// * `path` - Host's destination path (e.g., "./tarball").
2440    ///
2441    /// Path can be relative to the engine's workdir or absolute.
2442    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2443    pub async fn export_opts(
2444        &self,
2445        path: impl Into<String>,
2446        opts: ContainerExportOpts,
2447    ) -> Result<String, DaggerError> {
2448        let mut query = self.selection.select("export");
2449        query = query.arg("path", path.into());
2450        if let Some(platform_variants) = opts.platform_variants {
2451            query = query.arg("platformVariants", platform_variants);
2452        }
2453        if let Some(forced_compression) = opts.forced_compression {
2454            query = query.arg("forcedCompression", forced_compression);
2455        }
2456        if let Some(media_types) = opts.media_types {
2457            query = query.arg("mediaTypes", media_types);
2458        }
2459        if let Some(expand) = opts.expand {
2460            query = query.arg("expand", expand);
2461        }
2462        query.execute(self.graphql_client.clone()).await
2463    }
2464    /// Retrieves the list of exposed ports.
2465    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
2466    pub fn exposed_ports(&self) -> Vec<Port> {
2467        let query = self.selection.select("exposedPorts");
2468        vec![Port {
2469            proc: self.proc.clone(),
2470            selection: query,
2471            graphql_client: self.graphql_client.clone(),
2472        }]
2473    }
2474    /// Retrieves a file at the given path.
2475    /// Mounts are included.
2476    ///
2477    /// # Arguments
2478    ///
2479    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2480    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2481    pub fn file(&self, path: impl Into<String>) -> File {
2482        let mut query = self.selection.select("file");
2483        query = query.arg("path", path.into());
2484        File {
2485            proc: self.proc.clone(),
2486            selection: query,
2487            graphql_client: self.graphql_client.clone(),
2488        }
2489    }
2490    /// Retrieves a file at the given path.
2491    /// Mounts are included.
2492    ///
2493    /// # Arguments
2494    ///
2495    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2496    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2497    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2498        let mut query = self.selection.select("file");
2499        query = query.arg("path", path.into());
2500        if let Some(expand) = opts.expand {
2501            query = query.arg("expand", expand);
2502        }
2503        File {
2504            proc: self.proc.clone(),
2505            selection: query,
2506            graphql_client: self.graphql_client.clone(),
2507        }
2508    }
2509    /// Download a container image, and apply it to the container state. All previous state will be lost.
2510    ///
2511    /// # Arguments
2512    ///
2513    /// * `address` - Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
2514    pub fn from(&self, address: impl Into<String>) -> Container {
2515        let mut query = self.selection.select("from");
2516        query = query.arg("address", address.into());
2517        Container {
2518            proc: self.proc.clone(),
2519            selection: query,
2520            graphql_client: self.graphql_client.clone(),
2521        }
2522    }
2523    /// A unique identifier for this Container.
2524    pub async fn id(&self) -> Result<ContainerId, DaggerError> {
2525        let query = self.selection.select("id");
2526        query.execute(self.graphql_client.clone()).await
2527    }
2528    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
2529    pub async fn image_ref(&self) -> Result<String, DaggerError> {
2530        let query = self.selection.select("imageRef");
2531        query.execute(self.graphql_client.clone()).await
2532    }
2533    /// Reads the container from an OCI tarball.
2534    ///
2535    /// # Arguments
2536    ///
2537    /// * `source` - File to read the container from.
2538    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2539    pub fn import(&self, source: impl IntoID<FileId>) -> Container {
2540        let mut query = self.selection.select("import");
2541        query = query.arg_lazy(
2542            "source",
2543            Box::new(move || {
2544                let source = source.clone();
2545                Box::pin(async move { source.into_id().await.unwrap().quote() })
2546            }),
2547        );
2548        Container {
2549            proc: self.proc.clone(),
2550            selection: query,
2551            graphql_client: self.graphql_client.clone(),
2552        }
2553    }
2554    /// Reads the container from an OCI tarball.
2555    ///
2556    /// # Arguments
2557    ///
2558    /// * `source` - File to read the container from.
2559    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2560    pub fn import_opts<'a>(
2561        &self,
2562        source: impl IntoID<FileId>,
2563        opts: ContainerImportOpts<'a>,
2564    ) -> Container {
2565        let mut query = self.selection.select("import");
2566        query = query.arg_lazy(
2567            "source",
2568            Box::new(move || {
2569                let source = source.clone();
2570                Box::pin(async move { source.into_id().await.unwrap().quote() })
2571            }),
2572        );
2573        if let Some(tag) = opts.tag {
2574            query = query.arg("tag", tag);
2575        }
2576        Container {
2577            proc: self.proc.clone(),
2578            selection: query,
2579            graphql_client: self.graphql_client.clone(),
2580        }
2581    }
2582    /// Retrieves the value of the specified label.
2583    ///
2584    /// # Arguments
2585    ///
2586    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
2587    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2588        let mut query = self.selection.select("label");
2589        query = query.arg("name", name.into());
2590        query.execute(self.graphql_client.clone()).await
2591    }
2592    /// Retrieves the list of labels passed to container.
2593    pub fn labels(&self) -> Vec<Label> {
2594        let query = self.selection.select("labels");
2595        vec![Label {
2596            proc: self.proc.clone(),
2597            selection: query,
2598            graphql_client: self.graphql_client.clone(),
2599        }]
2600    }
2601    /// Retrieves the list of paths where a directory is mounted.
2602    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2603        let query = self.selection.select("mounts");
2604        query.execute(self.graphql_client.clone()).await
2605    }
2606    /// The platform this container executes and publishes as.
2607    pub async fn platform(&self) -> Result<Platform, DaggerError> {
2608        let query = self.selection.select("platform");
2609        query.execute(self.graphql_client.clone()).await
2610    }
2611    /// Package the container state as an OCI image, and publish it to a registry
2612    /// Returns the fully qualified address of the published image, with digest
2613    ///
2614    /// # Arguments
2615    ///
2616    /// * `address` - The OCI address to publish to
2617    ///
2618    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
2619    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2620    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2621        let mut query = self.selection.select("publish");
2622        query = query.arg("address", address.into());
2623        query.execute(self.graphql_client.clone()).await
2624    }
2625    /// Package the container state as an OCI image, and publish it to a registry
2626    /// Returns the fully qualified address of the published image, with digest
2627    ///
2628    /// # Arguments
2629    ///
2630    /// * `address` - The OCI address to publish to
2631    ///
2632    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
2633    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2634    pub async fn publish_opts(
2635        &self,
2636        address: impl Into<String>,
2637        opts: ContainerPublishOpts,
2638    ) -> Result<String, DaggerError> {
2639        let mut query = self.selection.select("publish");
2640        query = query.arg("address", address.into());
2641        if let Some(platform_variants) = opts.platform_variants {
2642            query = query.arg("platformVariants", platform_variants);
2643        }
2644        if let Some(forced_compression) = opts.forced_compression {
2645            query = query.arg("forcedCompression", forced_compression);
2646        }
2647        if let Some(media_types) = opts.media_types {
2648            query = query.arg("mediaTypes", media_types);
2649        }
2650        query.execute(self.graphql_client.clone()).await
2651    }
2652    /// 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.
2653    pub fn rootfs(&self) -> Directory {
2654        let query = self.selection.select("rootfs");
2655        Directory {
2656            proc: self.proc.clone(),
2657            selection: query,
2658            graphql_client: self.graphql_client.clone(),
2659        }
2660    }
2661    /// The buffered standard error stream of the last executed command
2662    /// Returns an error if no command was executed
2663    pub async fn stderr(&self) -> Result<String, DaggerError> {
2664        let query = self.selection.select("stderr");
2665        query.execute(self.graphql_client.clone()).await
2666    }
2667    /// The buffered standard output stream of the last executed command
2668    /// Returns an error if no command was executed
2669    pub async fn stdout(&self) -> Result<String, DaggerError> {
2670        let query = self.selection.select("stdout");
2671        query.execute(self.graphql_client.clone()).await
2672    }
2673    /// Forces evaluation of the pipeline in the engine.
2674    /// It doesn't run the default command if no exec has been set.
2675    pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
2676        let query = self.selection.select("sync");
2677        query.execute(self.graphql_client.clone()).await
2678    }
2679    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2680    ///
2681    /// # Arguments
2682    ///
2683    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2684    pub fn terminal(&self) -> Container {
2685        let query = self.selection.select("terminal");
2686        Container {
2687            proc: self.proc.clone(),
2688            selection: query,
2689            graphql_client: self.graphql_client.clone(),
2690        }
2691    }
2692    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2693    ///
2694    /// # Arguments
2695    ///
2696    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2697    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2698        let mut query = self.selection.select("terminal");
2699        if let Some(cmd) = opts.cmd {
2700            query = query.arg("cmd", cmd);
2701        }
2702        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2703            query = query.arg(
2704                "experimentalPrivilegedNesting",
2705                experimental_privileged_nesting,
2706            );
2707        }
2708        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2709            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2710        }
2711        Container {
2712            proc: self.proc.clone(),
2713            selection: query,
2714            graphql_client: self.graphql_client.clone(),
2715        }
2716    }
2717    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
2718    /// Be sure to set any exposed ports before calling this api.
2719    ///
2720    /// # Arguments
2721    ///
2722    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2723    pub async fn up(&self) -> Result<Void, DaggerError> {
2724        let query = self.selection.select("up");
2725        query.execute(self.graphql_client.clone()).await
2726    }
2727    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
2728    /// Be sure to set any exposed ports before calling this api.
2729    ///
2730    /// # Arguments
2731    ///
2732    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2733    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
2734        let mut query = self.selection.select("up");
2735        if let Some(random) = opts.random {
2736            query = query.arg("random", random);
2737        }
2738        if let Some(ports) = opts.ports {
2739            query = query.arg("ports", ports);
2740        }
2741        if let Some(args) = opts.args {
2742            query = query.arg("args", args);
2743        }
2744        if let Some(use_entrypoint) = opts.use_entrypoint {
2745            query = query.arg("useEntrypoint", use_entrypoint);
2746        }
2747        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2748            query = query.arg(
2749                "experimentalPrivilegedNesting",
2750                experimental_privileged_nesting,
2751            );
2752        }
2753        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2754            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2755        }
2756        if let Some(expand) = opts.expand {
2757            query = query.arg("expand", expand);
2758        }
2759        if let Some(no_init) = opts.no_init {
2760            query = query.arg("noInit", no_init);
2761        }
2762        query.execute(self.graphql_client.clone()).await
2763    }
2764    /// Retrieves the user to be set for all commands.
2765    pub async fn user(&self) -> Result<String, DaggerError> {
2766        let query = self.selection.select("user");
2767        query.execute(self.graphql_client.clone()).await
2768    }
2769    /// Retrieves this container plus the given OCI anotation.
2770    ///
2771    /// # Arguments
2772    ///
2773    /// * `name` - The name of the annotation.
2774    /// * `value` - The value of the annotation.
2775    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2776        let mut query = self.selection.select("withAnnotation");
2777        query = query.arg("name", name.into());
2778        query = query.arg("value", value.into());
2779        Container {
2780            proc: self.proc.clone(),
2781            selection: query,
2782            graphql_client: self.graphql_client.clone(),
2783        }
2784    }
2785    /// Configures default arguments for future commands. Like CMD in Dockerfile.
2786    ///
2787    /// # Arguments
2788    ///
2789    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
2790    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
2791        let mut query = self.selection.select("withDefaultArgs");
2792        query = query.arg(
2793            "args",
2794            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2795        );
2796        Container {
2797            proc: self.proc.clone(),
2798            selection: query,
2799            graphql_client: self.graphql_client.clone(),
2800        }
2801    }
2802    /// Set the default command to invoke for the container's terminal API.
2803    ///
2804    /// # Arguments
2805    ///
2806    /// * `args` - The args of the command.
2807    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2808    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
2809        let mut query = self.selection.select("withDefaultTerminalCmd");
2810        query = query.arg(
2811            "args",
2812            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2813        );
2814        Container {
2815            proc: self.proc.clone(),
2816            selection: query,
2817            graphql_client: self.graphql_client.clone(),
2818        }
2819    }
2820    /// Set the default command to invoke for the container's terminal API.
2821    ///
2822    /// # Arguments
2823    ///
2824    /// * `args` - The args of the command.
2825    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2826    pub fn with_default_terminal_cmd_opts(
2827        &self,
2828        args: Vec<impl Into<String>>,
2829        opts: ContainerWithDefaultTerminalCmdOpts,
2830    ) -> Container {
2831        let mut query = self.selection.select("withDefaultTerminalCmd");
2832        query = query.arg(
2833            "args",
2834            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2835        );
2836        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2837            query = query.arg(
2838                "experimentalPrivilegedNesting",
2839                experimental_privileged_nesting,
2840            );
2841        }
2842        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2843            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2844        }
2845        Container {
2846            proc: self.proc.clone(),
2847            selection: query,
2848            graphql_client: self.graphql_client.clone(),
2849        }
2850    }
2851    /// Return a new container snapshot, with a directory added to its filesystem
2852    ///
2853    /// # Arguments
2854    ///
2855    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
2856    /// * `directory` - Identifier of the directory to write
2857    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2858    pub fn with_directory(
2859        &self,
2860        path: impl Into<String>,
2861        directory: impl IntoID<DirectoryId>,
2862    ) -> Container {
2863        let mut query = self.selection.select("withDirectory");
2864        query = query.arg("path", path.into());
2865        query = query.arg_lazy(
2866            "directory",
2867            Box::new(move || {
2868                let directory = directory.clone();
2869                Box::pin(async move { directory.into_id().await.unwrap().quote() })
2870            }),
2871        );
2872        Container {
2873            proc: self.proc.clone(),
2874            selection: query,
2875            graphql_client: self.graphql_client.clone(),
2876        }
2877    }
2878    /// Return a new container snapshot, with a directory added to its filesystem
2879    ///
2880    /// # Arguments
2881    ///
2882    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
2883    /// * `directory` - Identifier of the directory to write
2884    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2885    pub fn with_directory_opts<'a>(
2886        &self,
2887        path: impl Into<String>,
2888        directory: impl IntoID<DirectoryId>,
2889        opts: ContainerWithDirectoryOpts<'a>,
2890    ) -> Container {
2891        let mut query = self.selection.select("withDirectory");
2892        query = query.arg("path", path.into());
2893        query = query.arg_lazy(
2894            "directory",
2895            Box::new(move || {
2896                let directory = directory.clone();
2897                Box::pin(async move { directory.into_id().await.unwrap().quote() })
2898            }),
2899        );
2900        if let Some(exclude) = opts.exclude {
2901            query = query.arg("exclude", exclude);
2902        }
2903        if let Some(include) = opts.include {
2904            query = query.arg("include", include);
2905        }
2906        if let Some(owner) = opts.owner {
2907            query = query.arg("owner", owner);
2908        }
2909        if let Some(expand) = opts.expand {
2910            query = query.arg("expand", expand);
2911        }
2912        Container {
2913            proc: self.proc.clone(),
2914            selection: query,
2915            graphql_client: self.graphql_client.clone(),
2916        }
2917    }
2918    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
2919    ///
2920    /// # Arguments
2921    ///
2922    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
2923    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2924    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
2925        let mut query = self.selection.select("withEntrypoint");
2926        query = query.arg(
2927            "args",
2928            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2929        );
2930        Container {
2931            proc: self.proc.clone(),
2932            selection: query,
2933            graphql_client: self.graphql_client.clone(),
2934        }
2935    }
2936    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
2937    ///
2938    /// # Arguments
2939    ///
2940    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
2941    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2942    pub fn with_entrypoint_opts(
2943        &self,
2944        args: Vec<impl Into<String>>,
2945        opts: ContainerWithEntrypointOpts,
2946    ) -> Container {
2947        let mut query = self.selection.select("withEntrypoint");
2948        query = query.arg(
2949            "args",
2950            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2951        );
2952        if let Some(keep_default_args) = opts.keep_default_args {
2953            query = query.arg("keepDefaultArgs", keep_default_args);
2954        }
2955        Container {
2956            proc: self.proc.clone(),
2957            selection: query,
2958            graphql_client: self.graphql_client.clone(),
2959        }
2960    }
2961    /// Set a new environment variable in the container.
2962    ///
2963    /// # Arguments
2964    ///
2965    /// * `name` - Name of the environment variable (e.g., "HOST").
2966    /// * `value` - Value of the environment variable. (e.g., "localhost").
2967    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2968    pub fn with_env_variable(
2969        &self,
2970        name: impl Into<String>,
2971        value: impl Into<String>,
2972    ) -> Container {
2973        let mut query = self.selection.select("withEnvVariable");
2974        query = query.arg("name", name.into());
2975        query = query.arg("value", value.into());
2976        Container {
2977            proc: self.proc.clone(),
2978            selection: query,
2979            graphql_client: self.graphql_client.clone(),
2980        }
2981    }
2982    /// Set a new environment variable in the container.
2983    ///
2984    /// # Arguments
2985    ///
2986    /// * `name` - Name of the environment variable (e.g., "HOST").
2987    /// * `value` - Value of the environment variable. (e.g., "localhost").
2988    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2989    pub fn with_env_variable_opts(
2990        &self,
2991        name: impl Into<String>,
2992        value: impl Into<String>,
2993        opts: ContainerWithEnvVariableOpts,
2994    ) -> Container {
2995        let mut query = self.selection.select("withEnvVariable");
2996        query = query.arg("name", name.into());
2997        query = query.arg("value", value.into());
2998        if let Some(expand) = opts.expand {
2999            query = query.arg("expand", expand);
3000        }
3001        Container {
3002            proc: self.proc.clone(),
3003            selection: query,
3004            graphql_client: self.graphql_client.clone(),
3005        }
3006    }
3007    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3008    ///
3009    /// # Arguments
3010    ///
3011    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3012    ///
3013    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3014    ///
3015    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3016    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3017    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3018        let mut query = self.selection.select("withExec");
3019        query = query.arg(
3020            "args",
3021            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3022        );
3023        Container {
3024            proc: self.proc.clone(),
3025            selection: query,
3026            graphql_client: self.graphql_client.clone(),
3027        }
3028    }
3029    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3030    ///
3031    /// # Arguments
3032    ///
3033    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3034    ///
3035    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3036    ///
3037    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3038    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3039    pub fn with_exec_opts<'a>(
3040        &self,
3041        args: Vec<impl Into<String>>,
3042        opts: ContainerWithExecOpts<'a>,
3043    ) -> Container {
3044        let mut query = self.selection.select("withExec");
3045        query = query.arg(
3046            "args",
3047            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3048        );
3049        if let Some(use_entrypoint) = opts.use_entrypoint {
3050            query = query.arg("useEntrypoint", use_entrypoint);
3051        }
3052        if let Some(stdin) = opts.stdin {
3053            query = query.arg("stdin", stdin);
3054        }
3055        if let Some(redirect_stdout) = opts.redirect_stdout {
3056            query = query.arg("redirectStdout", redirect_stdout);
3057        }
3058        if let Some(redirect_stderr) = opts.redirect_stderr {
3059            query = query.arg("redirectStderr", redirect_stderr);
3060        }
3061        if let Some(expect) = opts.expect {
3062            query = query.arg("expect", expect);
3063        }
3064        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3065            query = query.arg(
3066                "experimentalPrivilegedNesting",
3067                experimental_privileged_nesting,
3068            );
3069        }
3070        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3071            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3072        }
3073        if let Some(expand) = opts.expand {
3074            query = query.arg("expand", expand);
3075        }
3076        if let Some(no_init) = opts.no_init {
3077            query = query.arg("noInit", no_init);
3078        }
3079        Container {
3080            proc: self.proc.clone(),
3081            selection: query,
3082            graphql_client: self.graphql_client.clone(),
3083        }
3084    }
3085    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3086    /// Exposed ports serve two purposes:
3087    /// - For health checks and introspection, when running services
3088    /// - For setting the EXPOSE OCI field when publishing the container
3089    ///
3090    /// # Arguments
3091    ///
3092    /// * `port` - Port number to expose. Example: 8080
3093    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3094    pub fn with_exposed_port(&self, port: isize) -> Container {
3095        let mut query = self.selection.select("withExposedPort");
3096        query = query.arg("port", port);
3097        Container {
3098            proc: self.proc.clone(),
3099            selection: query,
3100            graphql_client: self.graphql_client.clone(),
3101        }
3102    }
3103    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3104    /// Exposed ports serve two purposes:
3105    /// - For health checks and introspection, when running services
3106    /// - For setting the EXPOSE OCI field when publishing the container
3107    ///
3108    /// # Arguments
3109    ///
3110    /// * `port` - Port number to expose. Example: 8080
3111    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3112    pub fn with_exposed_port_opts<'a>(
3113        &self,
3114        port: isize,
3115        opts: ContainerWithExposedPortOpts<'a>,
3116    ) -> Container {
3117        let mut query = self.selection.select("withExposedPort");
3118        query = query.arg("port", port);
3119        if let Some(protocol) = opts.protocol {
3120            query = query.arg("protocol", protocol);
3121        }
3122        if let Some(description) = opts.description {
3123            query = query.arg("description", description);
3124        }
3125        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3126            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3127        }
3128        Container {
3129            proc: self.proc.clone(),
3130            selection: query,
3131            graphql_client: self.graphql_client.clone(),
3132        }
3133    }
3134    /// Return a container snapshot with a file added
3135    ///
3136    /// # Arguments
3137    ///
3138    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3139    /// * `source` - File to add
3140    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3141    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
3142        let mut query = self.selection.select("withFile");
3143        query = query.arg("path", path.into());
3144        query = query.arg_lazy(
3145            "source",
3146            Box::new(move || {
3147                let source = source.clone();
3148                Box::pin(async move { source.into_id().await.unwrap().quote() })
3149            }),
3150        );
3151        Container {
3152            proc: self.proc.clone(),
3153            selection: query,
3154            graphql_client: self.graphql_client.clone(),
3155        }
3156    }
3157    /// Return a container snapshot with a file added
3158    ///
3159    /// # Arguments
3160    ///
3161    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3162    /// * `source` - File to add
3163    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3164    pub fn with_file_opts<'a>(
3165        &self,
3166        path: impl Into<String>,
3167        source: impl IntoID<FileId>,
3168        opts: ContainerWithFileOpts<'a>,
3169    ) -> Container {
3170        let mut query = self.selection.select("withFile");
3171        query = query.arg("path", path.into());
3172        query = query.arg_lazy(
3173            "source",
3174            Box::new(move || {
3175                let source = source.clone();
3176                Box::pin(async move { source.into_id().await.unwrap().quote() })
3177            }),
3178        );
3179        if let Some(permissions) = opts.permissions {
3180            query = query.arg("permissions", permissions);
3181        }
3182        if let Some(owner) = opts.owner {
3183            query = query.arg("owner", owner);
3184        }
3185        if let Some(expand) = opts.expand {
3186            query = query.arg("expand", expand);
3187        }
3188        Container {
3189            proc: self.proc.clone(),
3190            selection: query,
3191            graphql_client: self.graphql_client.clone(),
3192        }
3193    }
3194    /// Retrieves this container plus the contents of the given files copied to the given path.
3195    ///
3196    /// # Arguments
3197    ///
3198    /// * `path` - Location where copied files should be placed (e.g., "/src").
3199    /// * `sources` - Identifiers of the files to copy.
3200    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3201    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
3202        let mut query = self.selection.select("withFiles");
3203        query = query.arg("path", path.into());
3204        query = query.arg("sources", sources);
3205        Container {
3206            proc: self.proc.clone(),
3207            selection: query,
3208            graphql_client: self.graphql_client.clone(),
3209        }
3210    }
3211    /// Retrieves this container plus the contents of the given files copied to the given path.
3212    ///
3213    /// # Arguments
3214    ///
3215    /// * `path` - Location where copied files should be placed (e.g., "/src").
3216    /// * `sources` - Identifiers of the files to copy.
3217    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3218    pub fn with_files_opts<'a>(
3219        &self,
3220        path: impl Into<String>,
3221        sources: Vec<FileId>,
3222        opts: ContainerWithFilesOpts<'a>,
3223    ) -> Container {
3224        let mut query = self.selection.select("withFiles");
3225        query = query.arg("path", path.into());
3226        query = query.arg("sources", sources);
3227        if let Some(permissions) = opts.permissions {
3228            query = query.arg("permissions", permissions);
3229        }
3230        if let Some(owner) = opts.owner {
3231            query = query.arg("owner", owner);
3232        }
3233        if let Some(expand) = opts.expand {
3234            query = query.arg("expand", expand);
3235        }
3236        Container {
3237            proc: self.proc.clone(),
3238            selection: query,
3239            graphql_client: self.graphql_client.clone(),
3240        }
3241    }
3242    /// Retrieves this container plus the given label.
3243    ///
3244    /// # Arguments
3245    ///
3246    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3247    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
3248    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3249        let mut query = self.selection.select("withLabel");
3250        query = query.arg("name", name.into());
3251        query = query.arg("value", value.into());
3252        Container {
3253            proc: self.proc.clone(),
3254            selection: query,
3255            graphql_client: self.graphql_client.clone(),
3256        }
3257    }
3258    /// Retrieves this container plus a cache volume mounted at the given path.
3259    ///
3260    /// # Arguments
3261    ///
3262    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3263    /// * `cache` - Identifier of the cache volume to mount.
3264    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3265    pub fn with_mounted_cache(
3266        &self,
3267        path: impl Into<String>,
3268        cache: impl IntoID<CacheVolumeId>,
3269    ) -> Container {
3270        let mut query = self.selection.select("withMountedCache");
3271        query = query.arg("path", path.into());
3272        query = query.arg_lazy(
3273            "cache",
3274            Box::new(move || {
3275                let cache = cache.clone();
3276                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3277            }),
3278        );
3279        Container {
3280            proc: self.proc.clone(),
3281            selection: query,
3282            graphql_client: self.graphql_client.clone(),
3283        }
3284    }
3285    /// Retrieves this container plus a cache volume mounted at the given path.
3286    ///
3287    /// # Arguments
3288    ///
3289    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3290    /// * `cache` - Identifier of the cache volume to mount.
3291    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3292    pub fn with_mounted_cache_opts<'a>(
3293        &self,
3294        path: impl Into<String>,
3295        cache: impl IntoID<CacheVolumeId>,
3296        opts: ContainerWithMountedCacheOpts<'a>,
3297    ) -> Container {
3298        let mut query = self.selection.select("withMountedCache");
3299        query = query.arg("path", path.into());
3300        query = query.arg_lazy(
3301            "cache",
3302            Box::new(move || {
3303                let cache = cache.clone();
3304                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3305            }),
3306        );
3307        if let Some(source) = opts.source {
3308            query = query.arg("source", source);
3309        }
3310        if let Some(sharing) = opts.sharing {
3311            query = query.arg("sharing", sharing);
3312        }
3313        if let Some(owner) = opts.owner {
3314            query = query.arg("owner", owner);
3315        }
3316        if let Some(expand) = opts.expand {
3317            query = query.arg("expand", expand);
3318        }
3319        Container {
3320            proc: self.proc.clone(),
3321            selection: query,
3322            graphql_client: self.graphql_client.clone(),
3323        }
3324    }
3325    /// Retrieves this container plus a directory mounted at the given path.
3326    ///
3327    /// # Arguments
3328    ///
3329    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3330    /// * `source` - Identifier of the mounted directory.
3331    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3332    pub fn with_mounted_directory(
3333        &self,
3334        path: impl Into<String>,
3335        source: impl IntoID<DirectoryId>,
3336    ) -> Container {
3337        let mut query = self.selection.select("withMountedDirectory");
3338        query = query.arg("path", path.into());
3339        query = query.arg_lazy(
3340            "source",
3341            Box::new(move || {
3342                let source = source.clone();
3343                Box::pin(async move { source.into_id().await.unwrap().quote() })
3344            }),
3345        );
3346        Container {
3347            proc: self.proc.clone(),
3348            selection: query,
3349            graphql_client: self.graphql_client.clone(),
3350        }
3351    }
3352    /// Retrieves this container plus a directory mounted at the given path.
3353    ///
3354    /// # Arguments
3355    ///
3356    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3357    /// * `source` - Identifier of the mounted directory.
3358    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3359    pub fn with_mounted_directory_opts<'a>(
3360        &self,
3361        path: impl Into<String>,
3362        source: impl IntoID<DirectoryId>,
3363        opts: ContainerWithMountedDirectoryOpts<'a>,
3364    ) -> Container {
3365        let mut query = self.selection.select("withMountedDirectory");
3366        query = query.arg("path", path.into());
3367        query = query.arg_lazy(
3368            "source",
3369            Box::new(move || {
3370                let source = source.clone();
3371                Box::pin(async move { source.into_id().await.unwrap().quote() })
3372            }),
3373        );
3374        if let Some(owner) = opts.owner {
3375            query = query.arg("owner", owner);
3376        }
3377        if let Some(expand) = opts.expand {
3378            query = query.arg("expand", expand);
3379        }
3380        Container {
3381            proc: self.proc.clone(),
3382            selection: query,
3383            graphql_client: self.graphql_client.clone(),
3384        }
3385    }
3386    /// Retrieves this container plus a file mounted at the given path.
3387    ///
3388    /// # Arguments
3389    ///
3390    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3391    /// * `source` - Identifier of the mounted file.
3392    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3393    pub fn with_mounted_file(
3394        &self,
3395        path: impl Into<String>,
3396        source: impl IntoID<FileId>,
3397    ) -> Container {
3398        let mut query = self.selection.select("withMountedFile");
3399        query = query.arg("path", path.into());
3400        query = query.arg_lazy(
3401            "source",
3402            Box::new(move || {
3403                let source = source.clone();
3404                Box::pin(async move { source.into_id().await.unwrap().quote() })
3405            }),
3406        );
3407        Container {
3408            proc: self.proc.clone(),
3409            selection: query,
3410            graphql_client: self.graphql_client.clone(),
3411        }
3412    }
3413    /// Retrieves this container plus a file mounted at the given path.
3414    ///
3415    /// # Arguments
3416    ///
3417    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3418    /// * `source` - Identifier of the mounted file.
3419    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3420    pub fn with_mounted_file_opts<'a>(
3421        &self,
3422        path: impl Into<String>,
3423        source: impl IntoID<FileId>,
3424        opts: ContainerWithMountedFileOpts<'a>,
3425    ) -> Container {
3426        let mut query = self.selection.select("withMountedFile");
3427        query = query.arg("path", path.into());
3428        query = query.arg_lazy(
3429            "source",
3430            Box::new(move || {
3431                let source = source.clone();
3432                Box::pin(async move { source.into_id().await.unwrap().quote() })
3433            }),
3434        );
3435        if let Some(owner) = opts.owner {
3436            query = query.arg("owner", owner);
3437        }
3438        if let Some(expand) = opts.expand {
3439            query = query.arg("expand", expand);
3440        }
3441        Container {
3442            proc: self.proc.clone(),
3443            selection: query,
3444            graphql_client: self.graphql_client.clone(),
3445        }
3446    }
3447    /// Retrieves this container plus a secret mounted into a file at the given path.
3448    ///
3449    /// # Arguments
3450    ///
3451    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3452    /// * `source` - Identifier of the secret to mount.
3453    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3454    pub fn with_mounted_secret(
3455        &self,
3456        path: impl Into<String>,
3457        source: impl IntoID<SecretId>,
3458    ) -> Container {
3459        let mut query = self.selection.select("withMountedSecret");
3460        query = query.arg("path", path.into());
3461        query = query.arg_lazy(
3462            "source",
3463            Box::new(move || {
3464                let source = source.clone();
3465                Box::pin(async move { source.into_id().await.unwrap().quote() })
3466            }),
3467        );
3468        Container {
3469            proc: self.proc.clone(),
3470            selection: query,
3471            graphql_client: self.graphql_client.clone(),
3472        }
3473    }
3474    /// Retrieves this container plus a secret mounted into a file at the given path.
3475    ///
3476    /// # Arguments
3477    ///
3478    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3479    /// * `source` - Identifier of the secret to mount.
3480    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3481    pub fn with_mounted_secret_opts<'a>(
3482        &self,
3483        path: impl Into<String>,
3484        source: impl IntoID<SecretId>,
3485        opts: ContainerWithMountedSecretOpts<'a>,
3486    ) -> Container {
3487        let mut query = self.selection.select("withMountedSecret");
3488        query = query.arg("path", path.into());
3489        query = query.arg_lazy(
3490            "source",
3491            Box::new(move || {
3492                let source = source.clone();
3493                Box::pin(async move { source.into_id().await.unwrap().quote() })
3494            }),
3495        );
3496        if let Some(owner) = opts.owner {
3497            query = query.arg("owner", owner);
3498        }
3499        if let Some(mode) = opts.mode {
3500            query = query.arg("mode", mode);
3501        }
3502        if let Some(expand) = opts.expand {
3503            query = query.arg("expand", expand);
3504        }
3505        Container {
3506            proc: self.proc.clone(),
3507            selection: query,
3508            graphql_client: self.graphql_client.clone(),
3509        }
3510    }
3511    /// 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.
3512    ///
3513    /// # Arguments
3514    ///
3515    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3516    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3517    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3518        let mut query = self.selection.select("withMountedTemp");
3519        query = query.arg("path", path.into());
3520        Container {
3521            proc: self.proc.clone(),
3522            selection: query,
3523            graphql_client: self.graphql_client.clone(),
3524        }
3525    }
3526    /// 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.
3527    ///
3528    /// # Arguments
3529    ///
3530    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3531    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3532    pub fn with_mounted_temp_opts(
3533        &self,
3534        path: impl Into<String>,
3535        opts: ContainerWithMountedTempOpts,
3536    ) -> Container {
3537        let mut query = self.selection.select("withMountedTemp");
3538        query = query.arg("path", path.into());
3539        if let Some(size) = opts.size {
3540            query = query.arg("size", size);
3541        }
3542        if let Some(expand) = opts.expand {
3543            query = query.arg("expand", expand);
3544        }
3545        Container {
3546            proc: self.proc.clone(),
3547            selection: query,
3548            graphql_client: self.graphql_client.clone(),
3549        }
3550    }
3551    /// Return a new container snapshot, with a file added to its filesystem with text content
3552    ///
3553    /// # Arguments
3554    ///
3555    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
3556    /// * `contents` - Contents of the new file. Example: "Hello world!"
3557    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3558    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3559        let mut query = self.selection.select("withNewFile");
3560        query = query.arg("path", path.into());
3561        query = query.arg("contents", contents.into());
3562        Container {
3563            proc: self.proc.clone(),
3564            selection: query,
3565            graphql_client: self.graphql_client.clone(),
3566        }
3567    }
3568    /// Return a new container snapshot, with a file added to its filesystem with text content
3569    ///
3570    /// # Arguments
3571    ///
3572    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
3573    /// * `contents` - Contents of the new file. Example: "Hello world!"
3574    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3575    pub fn with_new_file_opts<'a>(
3576        &self,
3577        path: impl Into<String>,
3578        contents: impl Into<String>,
3579        opts: ContainerWithNewFileOpts<'a>,
3580    ) -> Container {
3581        let mut query = self.selection.select("withNewFile");
3582        query = query.arg("path", path.into());
3583        query = query.arg("contents", contents.into());
3584        if let Some(permissions) = opts.permissions {
3585            query = query.arg("permissions", permissions);
3586        }
3587        if let Some(owner) = opts.owner {
3588            query = query.arg("owner", owner);
3589        }
3590        if let Some(expand) = opts.expand {
3591            query = query.arg("expand", expand);
3592        }
3593        Container {
3594            proc: self.proc.clone(),
3595            selection: query,
3596            graphql_client: self.graphql_client.clone(),
3597        }
3598    }
3599    /// Attach credentials for future publishing to a registry. Use in combination with publish
3600    ///
3601    /// # Arguments
3602    ///
3603    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
3604    /// * `username` - The username to authenticate with. Example: "alice"
3605    /// * `secret` - The API key, password or token to authenticate to this registry
3606    pub fn with_registry_auth(
3607        &self,
3608        address: impl Into<String>,
3609        username: impl Into<String>,
3610        secret: impl IntoID<SecretId>,
3611    ) -> Container {
3612        let mut query = self.selection.select("withRegistryAuth");
3613        query = query.arg("address", address.into());
3614        query = query.arg("username", username.into());
3615        query = query.arg_lazy(
3616            "secret",
3617            Box::new(move || {
3618                let secret = secret.clone();
3619                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3620            }),
3621        );
3622        Container {
3623            proc: self.proc.clone(),
3624            selection: query,
3625            graphql_client: self.graphql_client.clone(),
3626        }
3627    }
3628    /// Change the container's root filesystem. The previous root filesystem will be lost.
3629    ///
3630    /// # Arguments
3631    ///
3632    /// * `directory` - The new root filesystem.
3633    pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
3634        let mut query = self.selection.select("withRootfs");
3635        query = query.arg_lazy(
3636            "directory",
3637            Box::new(move || {
3638                let directory = directory.clone();
3639                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3640            }),
3641        );
3642        Container {
3643            proc: self.proc.clone(),
3644            selection: query,
3645            graphql_client: self.graphql_client.clone(),
3646        }
3647    }
3648    /// Set a new environment variable, using a secret value
3649    ///
3650    /// # Arguments
3651    ///
3652    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
3653    /// * `secret` - Identifier of the secret value.
3654    pub fn with_secret_variable(
3655        &self,
3656        name: impl Into<String>,
3657        secret: impl IntoID<SecretId>,
3658    ) -> Container {
3659        let mut query = self.selection.select("withSecretVariable");
3660        query = query.arg("name", name.into());
3661        query = query.arg_lazy(
3662            "secret",
3663            Box::new(move || {
3664                let secret = secret.clone();
3665                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3666            }),
3667        );
3668        Container {
3669            proc: self.proc.clone(),
3670            selection: query,
3671            graphql_client: self.graphql_client.clone(),
3672        }
3673    }
3674    /// Establish a runtime dependency on a from a container to a network service.
3675    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
3676    /// The service will be reachable from the container via the provided hostname alias.
3677    /// The service dependency will also convey to any files or directories produced by the container.
3678    ///
3679    /// # Arguments
3680    ///
3681    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
3682    /// * `service` - The target service
3683    pub fn with_service_binding(
3684        &self,
3685        alias: impl Into<String>,
3686        service: impl IntoID<ServiceId>,
3687    ) -> Container {
3688        let mut query = self.selection.select("withServiceBinding");
3689        query = query.arg("alias", alias.into());
3690        query = query.arg_lazy(
3691            "service",
3692            Box::new(move || {
3693                let service = service.clone();
3694                Box::pin(async move { service.into_id().await.unwrap().quote() })
3695            }),
3696        );
3697        Container {
3698            proc: self.proc.clone(),
3699            selection: query,
3700            graphql_client: self.graphql_client.clone(),
3701        }
3702    }
3703    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
3704    ///
3705    /// # Arguments
3706    ///
3707    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
3708    /// * `source` - Identifier of the socket to forward.
3709    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3710    pub fn with_unix_socket(
3711        &self,
3712        path: impl Into<String>,
3713        source: impl IntoID<SocketId>,
3714    ) -> Container {
3715        let mut query = self.selection.select("withUnixSocket");
3716        query = query.arg("path", path.into());
3717        query = query.arg_lazy(
3718            "source",
3719            Box::new(move || {
3720                let source = source.clone();
3721                Box::pin(async move { source.into_id().await.unwrap().quote() })
3722            }),
3723        );
3724        Container {
3725            proc: self.proc.clone(),
3726            selection: query,
3727            graphql_client: self.graphql_client.clone(),
3728        }
3729    }
3730    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
3731    ///
3732    /// # Arguments
3733    ///
3734    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
3735    /// * `source` - Identifier of the socket to forward.
3736    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3737    pub fn with_unix_socket_opts<'a>(
3738        &self,
3739        path: impl Into<String>,
3740        source: impl IntoID<SocketId>,
3741        opts: ContainerWithUnixSocketOpts<'a>,
3742    ) -> Container {
3743        let mut query = self.selection.select("withUnixSocket");
3744        query = query.arg("path", path.into());
3745        query = query.arg_lazy(
3746            "source",
3747            Box::new(move || {
3748                let source = source.clone();
3749                Box::pin(async move { source.into_id().await.unwrap().quote() })
3750            }),
3751        );
3752        if let Some(owner) = opts.owner {
3753            query = query.arg("owner", owner);
3754        }
3755        if let Some(expand) = opts.expand {
3756            query = query.arg("expand", expand);
3757        }
3758        Container {
3759            proc: self.proc.clone(),
3760            selection: query,
3761            graphql_client: self.graphql_client.clone(),
3762        }
3763    }
3764    /// Retrieves this container with a different command user.
3765    ///
3766    /// # Arguments
3767    ///
3768    /// * `name` - The user to set (e.g., "root").
3769    pub fn with_user(&self, name: impl Into<String>) -> Container {
3770        let mut query = self.selection.select("withUser");
3771        query = query.arg("name", name.into());
3772        Container {
3773            proc: self.proc.clone(),
3774            selection: query,
3775            graphql_client: self.graphql_client.clone(),
3776        }
3777    }
3778    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3779    ///
3780    /// # Arguments
3781    ///
3782    /// * `path` - The path to set as the working directory (e.g., "/app").
3783    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3784    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3785        let mut query = self.selection.select("withWorkdir");
3786        query = query.arg("path", path.into());
3787        Container {
3788            proc: self.proc.clone(),
3789            selection: query,
3790            graphql_client: self.graphql_client.clone(),
3791        }
3792    }
3793    /// Change the container's working directory. Like WORKDIR in Dockerfile.
3794    ///
3795    /// # Arguments
3796    ///
3797    /// * `path` - The path to set as the working directory (e.g., "/app").
3798    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3799    pub fn with_workdir_opts(
3800        &self,
3801        path: impl Into<String>,
3802        opts: ContainerWithWorkdirOpts,
3803    ) -> Container {
3804        let mut query = self.selection.select("withWorkdir");
3805        query = query.arg("path", path.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 minus the given OCI annotation.
3816    ///
3817    /// # Arguments
3818    ///
3819    /// * `name` - The name of the annotation.
3820    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3821        let mut query = self.selection.select("withoutAnnotation");
3822        query = query.arg("name", name.into());
3823        Container {
3824            proc: self.proc.clone(),
3825            selection: query,
3826            graphql_client: self.graphql_client.clone(),
3827        }
3828    }
3829    /// Remove the container's default arguments.
3830    pub fn without_default_args(&self) -> Container {
3831        let query = self.selection.select("withoutDefaultArgs");
3832        Container {
3833            proc: self.proc.clone(),
3834            selection: query,
3835            graphql_client: self.graphql_client.clone(),
3836        }
3837    }
3838    /// Return a new container snapshot, with a directory removed from its filesystem
3839    ///
3840    /// # Arguments
3841    ///
3842    /// * `path` - Location of the directory to remove (e.g., ".github/").
3843    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3844    pub fn without_directory(&self, path: impl Into<String>) -> Container {
3845        let mut query = self.selection.select("withoutDirectory");
3846        query = query.arg("path", path.into());
3847        Container {
3848            proc: self.proc.clone(),
3849            selection: query,
3850            graphql_client: self.graphql_client.clone(),
3851        }
3852    }
3853    /// Return a new container snapshot, with a directory removed from its filesystem
3854    ///
3855    /// # Arguments
3856    ///
3857    /// * `path` - Location of the directory to remove (e.g., ".github/").
3858    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3859    pub fn without_directory_opts(
3860        &self,
3861        path: impl Into<String>,
3862        opts: ContainerWithoutDirectoryOpts,
3863    ) -> Container {
3864        let mut query = self.selection.select("withoutDirectory");
3865        query = query.arg("path", path.into());
3866        if let Some(expand) = opts.expand {
3867            query = query.arg("expand", expand);
3868        }
3869        Container {
3870            proc: self.proc.clone(),
3871            selection: query,
3872            graphql_client: self.graphql_client.clone(),
3873        }
3874    }
3875    /// Reset the container's OCI entrypoint.
3876    ///
3877    /// # Arguments
3878    ///
3879    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3880    pub fn without_entrypoint(&self) -> Container {
3881        let query = self.selection.select("withoutEntrypoint");
3882        Container {
3883            proc: self.proc.clone(),
3884            selection: query,
3885            graphql_client: self.graphql_client.clone(),
3886        }
3887    }
3888    /// Reset the container's OCI entrypoint.
3889    ///
3890    /// # Arguments
3891    ///
3892    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3893    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
3894        let mut query = self.selection.select("withoutEntrypoint");
3895        if let Some(keep_default_args) = opts.keep_default_args {
3896            query = query.arg("keepDefaultArgs", keep_default_args);
3897        }
3898        Container {
3899            proc: self.proc.clone(),
3900            selection: query,
3901            graphql_client: self.graphql_client.clone(),
3902        }
3903    }
3904    /// Retrieves this container minus the given environment variable.
3905    ///
3906    /// # Arguments
3907    ///
3908    /// * `name` - The name of the environment variable (e.g., "HOST").
3909    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
3910        let mut query = self.selection.select("withoutEnvVariable");
3911        query = query.arg("name", name.into());
3912        Container {
3913            proc: self.proc.clone(),
3914            selection: query,
3915            graphql_client: self.graphql_client.clone(),
3916        }
3917    }
3918    /// Unexpose a previously exposed port.
3919    ///
3920    /// # Arguments
3921    ///
3922    /// * `port` - Port number to unexpose
3923    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3924    pub fn without_exposed_port(&self, port: isize) -> Container {
3925        let mut query = self.selection.select("withoutExposedPort");
3926        query = query.arg("port", port);
3927        Container {
3928            proc: self.proc.clone(),
3929            selection: query,
3930            graphql_client: self.graphql_client.clone(),
3931        }
3932    }
3933    /// Unexpose a previously exposed port.
3934    ///
3935    /// # Arguments
3936    ///
3937    /// * `port` - Port number to unexpose
3938    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3939    pub fn without_exposed_port_opts(
3940        &self,
3941        port: isize,
3942        opts: ContainerWithoutExposedPortOpts,
3943    ) -> Container {
3944        let mut query = self.selection.select("withoutExposedPort");
3945        query = query.arg("port", port);
3946        if let Some(protocol) = opts.protocol {
3947            query = query.arg("protocol", protocol);
3948        }
3949        Container {
3950            proc: self.proc.clone(),
3951            selection: query,
3952            graphql_client: self.graphql_client.clone(),
3953        }
3954    }
3955    /// Retrieves this container with the file at the given path removed.
3956    ///
3957    /// # Arguments
3958    ///
3959    /// * `path` - Location of the file to remove (e.g., "/file.txt").
3960    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3961    pub fn without_file(&self, path: impl Into<String>) -> Container {
3962        let mut query = self.selection.select("withoutFile");
3963        query = query.arg("path", path.into());
3964        Container {
3965            proc: self.proc.clone(),
3966            selection: query,
3967            graphql_client: self.graphql_client.clone(),
3968        }
3969    }
3970    /// Retrieves this container with the file at the given path removed.
3971    ///
3972    /// # Arguments
3973    ///
3974    /// * `path` - Location of the file to remove (e.g., "/file.txt").
3975    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3976    pub fn without_file_opts(
3977        &self,
3978        path: impl Into<String>,
3979        opts: ContainerWithoutFileOpts,
3980    ) -> Container {
3981        let mut query = self.selection.select("withoutFile");
3982        query = query.arg("path", path.into());
3983        if let Some(expand) = opts.expand {
3984            query = query.arg("expand", expand);
3985        }
3986        Container {
3987            proc: self.proc.clone(),
3988            selection: query,
3989            graphql_client: self.graphql_client.clone(),
3990        }
3991    }
3992    /// Return a new container spanshot with specified files removed
3993    ///
3994    /// # Arguments
3995    ///
3996    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
3997    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3998    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
3999        let mut query = self.selection.select("withoutFiles");
4000        query = query.arg(
4001            "paths",
4002            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4003        );
4004        Container {
4005            proc: self.proc.clone(),
4006            selection: query,
4007            graphql_client: self.graphql_client.clone(),
4008        }
4009    }
4010    /// Return a new container spanshot with specified files removed
4011    ///
4012    /// # Arguments
4013    ///
4014    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4015    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4016    pub fn without_files_opts(
4017        &self,
4018        paths: Vec<impl Into<String>>,
4019        opts: ContainerWithoutFilesOpts,
4020    ) -> Container {
4021        let mut query = self.selection.select("withoutFiles");
4022        query = query.arg(
4023            "paths",
4024            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4025        );
4026        if let Some(expand) = opts.expand {
4027            query = query.arg("expand", expand);
4028        }
4029        Container {
4030            proc: self.proc.clone(),
4031            selection: query,
4032            graphql_client: self.graphql_client.clone(),
4033        }
4034    }
4035    /// Retrieves this container minus the given environment label.
4036    ///
4037    /// # Arguments
4038    ///
4039    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4040    pub fn without_label(&self, name: impl Into<String>) -> Container {
4041        let mut query = self.selection.select("withoutLabel");
4042        query = query.arg("name", name.into());
4043        Container {
4044            proc: self.proc.clone(),
4045            selection: query,
4046            graphql_client: self.graphql_client.clone(),
4047        }
4048    }
4049    /// Retrieves this container after unmounting everything at the given path.
4050    ///
4051    /// # Arguments
4052    ///
4053    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4054    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4055    pub fn without_mount(&self, path: impl Into<String>) -> Container {
4056        let mut query = self.selection.select("withoutMount");
4057        query = query.arg("path", path.into());
4058        Container {
4059            proc: self.proc.clone(),
4060            selection: query,
4061            graphql_client: self.graphql_client.clone(),
4062        }
4063    }
4064    /// Retrieves this container after unmounting everything at the given path.
4065    ///
4066    /// # Arguments
4067    ///
4068    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4069    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4070    pub fn without_mount_opts(
4071        &self,
4072        path: impl Into<String>,
4073        opts: ContainerWithoutMountOpts,
4074    ) -> Container {
4075        let mut query = self.selection.select("withoutMount");
4076        query = query.arg("path", path.into());
4077        if let Some(expand) = opts.expand {
4078            query = query.arg("expand", expand);
4079        }
4080        Container {
4081            proc: self.proc.clone(),
4082            selection: query,
4083            graphql_client: self.graphql_client.clone(),
4084        }
4085    }
4086    /// Retrieves this container without the registry authentication of a given address.
4087    ///
4088    /// # Arguments
4089    ///
4090    /// * `address` - Registry's address to remove the authentication from.
4091    ///
4092    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
4093    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4094        let mut query = self.selection.select("withoutRegistryAuth");
4095        query = query.arg("address", address.into());
4096        Container {
4097            proc: self.proc.clone(),
4098            selection: query,
4099            graphql_client: self.graphql_client.clone(),
4100        }
4101    }
4102    /// Retrieves this container minus the given environment variable containing the secret.
4103    ///
4104    /// # Arguments
4105    ///
4106    /// * `name` - The name of the environment variable (e.g., "HOST").
4107    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4108        let mut query = self.selection.select("withoutSecretVariable");
4109        query = query.arg("name", name.into());
4110        Container {
4111            proc: self.proc.clone(),
4112            selection: query,
4113            graphql_client: self.graphql_client.clone(),
4114        }
4115    }
4116    /// Retrieves this container with a previously added Unix socket removed.
4117    ///
4118    /// # Arguments
4119    ///
4120    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4121    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4122    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4123        let mut query = self.selection.select("withoutUnixSocket");
4124        query = query.arg("path", path.into());
4125        Container {
4126            proc: self.proc.clone(),
4127            selection: query,
4128            graphql_client: self.graphql_client.clone(),
4129        }
4130    }
4131    /// Retrieves this container with a previously added Unix socket removed.
4132    ///
4133    /// # Arguments
4134    ///
4135    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4136    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4137    pub fn without_unix_socket_opts(
4138        &self,
4139        path: impl Into<String>,
4140        opts: ContainerWithoutUnixSocketOpts,
4141    ) -> Container {
4142        let mut query = self.selection.select("withoutUnixSocket");
4143        query = query.arg("path", path.into());
4144        if let Some(expand) = opts.expand {
4145            query = query.arg("expand", expand);
4146        }
4147        Container {
4148            proc: self.proc.clone(),
4149            selection: query,
4150            graphql_client: self.graphql_client.clone(),
4151        }
4152    }
4153    /// Retrieves this container with an unset command user.
4154    /// Should default to root.
4155    pub fn without_user(&self) -> Container {
4156        let query = self.selection.select("withoutUser");
4157        Container {
4158            proc: self.proc.clone(),
4159            selection: query,
4160            graphql_client: self.graphql_client.clone(),
4161        }
4162    }
4163    /// Unset the container's working directory.
4164    /// Should default to "/".
4165    pub fn without_workdir(&self) -> Container {
4166        let query = self.selection.select("withoutWorkdir");
4167        Container {
4168            proc: self.proc.clone(),
4169            selection: query,
4170            graphql_client: self.graphql_client.clone(),
4171        }
4172    }
4173    /// Retrieves the working directory for all commands.
4174    pub async fn workdir(&self) -> Result<String, DaggerError> {
4175        let query = self.selection.select("workdir");
4176        query.execute(self.graphql_client.clone()).await
4177    }
4178}
4179#[derive(Clone)]
4180pub struct CurrentModule {
4181    pub proc: Option<Arc<DaggerSessionProc>>,
4182    pub selection: Selection,
4183    pub graphql_client: DynGraphQLClient,
4184}
4185#[derive(Builder, Debug, PartialEq)]
4186pub struct CurrentModuleWorkdirOpts<'a> {
4187    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4188    #[builder(setter(into, strip_option), default)]
4189    pub exclude: Option<Vec<&'a str>>,
4190    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4191    #[builder(setter(into, strip_option), default)]
4192    pub include: Option<Vec<&'a str>>,
4193}
4194impl CurrentModule {
4195    /// A unique identifier for this CurrentModule.
4196    pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
4197        let query = self.selection.select("id");
4198        query.execute(self.graphql_client.clone()).await
4199    }
4200    /// The name of the module being executed in
4201    pub async fn name(&self) -> Result<String, DaggerError> {
4202        let query = self.selection.select("name");
4203        query.execute(self.graphql_client.clone()).await
4204    }
4205    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
4206    pub fn source(&self) -> Directory {
4207        let query = self.selection.select("source");
4208        Directory {
4209            proc: self.proc.clone(),
4210            selection: query,
4211            graphql_client: self.graphql_client.clone(),
4212        }
4213    }
4214    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4215    ///
4216    /// # Arguments
4217    ///
4218    /// * `path` - Location of the directory to access (e.g., ".").
4219    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4220    pub fn workdir(&self, path: impl Into<String>) -> Directory {
4221        let mut query = self.selection.select("workdir");
4222        query = query.arg("path", path.into());
4223        Directory {
4224            proc: self.proc.clone(),
4225            selection: query,
4226            graphql_client: self.graphql_client.clone(),
4227        }
4228    }
4229    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4230    ///
4231    /// # Arguments
4232    ///
4233    /// * `path` - Location of the directory to access (e.g., ".").
4234    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4235    pub fn workdir_opts<'a>(
4236        &self,
4237        path: impl Into<String>,
4238        opts: CurrentModuleWorkdirOpts<'a>,
4239    ) -> Directory {
4240        let mut query = self.selection.select("workdir");
4241        query = query.arg("path", path.into());
4242        if let Some(exclude) = opts.exclude {
4243            query = query.arg("exclude", exclude);
4244        }
4245        if let Some(include) = opts.include {
4246            query = query.arg("include", include);
4247        }
4248        Directory {
4249            proc: self.proc.clone(),
4250            selection: query,
4251            graphql_client: self.graphql_client.clone(),
4252        }
4253    }
4254    /// 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.
4255    ///
4256    /// # Arguments
4257    ///
4258    /// * `path` - Location of the file to retrieve (e.g., "README.md").
4259    pub fn workdir_file(&self, path: impl Into<String>) -> File {
4260        let mut query = self.selection.select("workdirFile");
4261        query = query.arg("path", path.into());
4262        File {
4263            proc: self.proc.clone(),
4264            selection: query,
4265            graphql_client: self.graphql_client.clone(),
4266        }
4267    }
4268}
4269#[derive(Clone)]
4270pub struct Directory {
4271    pub proc: Option<Arc<DaggerSessionProc>>,
4272    pub selection: Selection,
4273    pub graphql_client: DynGraphQLClient,
4274}
4275#[derive(Builder, Debug, PartialEq)]
4276pub struct DirectoryAsModuleOpts<'a> {
4277    /// An optional subpath of the directory which contains the module's configuration file.
4278    /// If not set, the module source code is loaded from the root of the directory.
4279    #[builder(setter(into, strip_option), default)]
4280    pub source_root_path: Option<&'a str>,
4281}
4282#[derive(Builder, Debug, PartialEq)]
4283pub struct DirectoryAsModuleSourceOpts<'a> {
4284    /// An optional subpath of the directory which contains the module's configuration file.
4285    /// If not set, the module source code is loaded from the root of the directory.
4286    #[builder(setter(into, strip_option), default)]
4287    pub source_root_path: Option<&'a str>,
4288}
4289#[derive(Builder, Debug, PartialEq)]
4290pub struct DirectoryDockerBuildOpts<'a> {
4291    /// Build arguments to use in the build.
4292    #[builder(setter(into, strip_option), default)]
4293    pub build_args: Option<Vec<BuildArg>>,
4294    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
4295    #[builder(setter(into, strip_option), default)]
4296    pub dockerfile: Option<&'a str>,
4297    /// If set, skip the automatic init process injected into containers created by RUN statements.
4298    /// 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.
4299    #[builder(setter(into, strip_option), default)]
4300    pub no_init: Option<bool>,
4301    /// The platform to build.
4302    #[builder(setter(into, strip_option), default)]
4303    pub platform: Option<Platform>,
4304    /// Secrets to pass to the build.
4305    /// They will be mounted at /run/secrets/[secret-name].
4306    #[builder(setter(into, strip_option), default)]
4307    pub secrets: Option<Vec<SecretId>>,
4308    /// Target build stage to build.
4309    #[builder(setter(into, strip_option), default)]
4310    pub target: Option<&'a str>,
4311}
4312#[derive(Builder, Debug, PartialEq)]
4313pub struct DirectoryEntriesOpts<'a> {
4314    /// Location of the directory to look at (e.g., "/src").
4315    #[builder(setter(into, strip_option), default)]
4316    pub path: Option<&'a str>,
4317}
4318#[derive(Builder, Debug, PartialEq)]
4319pub struct DirectoryExportOpts {
4320    /// 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.
4321    #[builder(setter(into, strip_option), default)]
4322    pub wipe: Option<bool>,
4323}
4324#[derive(Builder, Debug, PartialEq)]
4325pub struct DirectoryFilterOpts<'a> {
4326    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
4327    #[builder(setter(into, strip_option), default)]
4328    pub exclude: Option<Vec<&'a str>>,
4329    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
4330    #[builder(setter(into, strip_option), default)]
4331    pub include: Option<Vec<&'a str>>,
4332}
4333#[derive(Builder, Debug, PartialEq)]
4334pub struct DirectoryTerminalOpts<'a> {
4335    /// If set, override the container's default terminal command and invoke these command arguments instead.
4336    #[builder(setter(into, strip_option), default)]
4337    pub cmd: Option<Vec<&'a str>>,
4338    /// If set, override the default container used for the terminal.
4339    #[builder(setter(into, strip_option), default)]
4340    pub container: Option<ContainerId>,
4341    /// Provides Dagger access to the executed command.
4342    #[builder(setter(into, strip_option), default)]
4343    pub experimental_privileged_nesting: Option<bool>,
4344    /// 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.
4345    #[builder(setter(into, strip_option), default)]
4346    pub insecure_root_capabilities: Option<bool>,
4347}
4348#[derive(Builder, Debug, PartialEq)]
4349pub struct DirectoryWithDirectoryOpts<'a> {
4350    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4351    #[builder(setter(into, strip_option), default)]
4352    pub exclude: Option<Vec<&'a str>>,
4353    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4354    #[builder(setter(into, strip_option), default)]
4355    pub include: Option<Vec<&'a str>>,
4356}
4357#[derive(Builder, Debug, PartialEq)]
4358pub struct DirectoryWithFileOpts {
4359    /// Permission given to the copied file (e.g., 0600).
4360    #[builder(setter(into, strip_option), default)]
4361    pub permissions: Option<isize>,
4362}
4363#[derive(Builder, Debug, PartialEq)]
4364pub struct DirectoryWithFilesOpts {
4365    /// Permission given to the copied files (e.g., 0600).
4366    #[builder(setter(into, strip_option), default)]
4367    pub permissions: Option<isize>,
4368}
4369#[derive(Builder, Debug, PartialEq)]
4370pub struct DirectoryWithNewDirectoryOpts {
4371    /// Permission granted to the created directory (e.g., 0777).
4372    #[builder(setter(into, strip_option), default)]
4373    pub permissions: Option<isize>,
4374}
4375#[derive(Builder, Debug, PartialEq)]
4376pub struct DirectoryWithNewFileOpts {
4377    /// Permissions of the new file. Example: 0600
4378    #[builder(setter(into, strip_option), default)]
4379    pub permissions: Option<isize>,
4380}
4381impl Directory {
4382    /// Converts this directory to a local git repository
4383    pub fn as_git(&self) -> GitRepository {
4384        let query = self.selection.select("asGit");
4385        GitRepository {
4386            proc: self.proc.clone(),
4387            selection: query,
4388            graphql_client: self.graphql_client.clone(),
4389        }
4390    }
4391    /// Load the directory as a Dagger module source
4392    ///
4393    /// # Arguments
4394    ///
4395    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4396    pub fn as_module(&self) -> Module {
4397        let query = self.selection.select("asModule");
4398        Module {
4399            proc: self.proc.clone(),
4400            selection: query,
4401            graphql_client: self.graphql_client.clone(),
4402        }
4403    }
4404    /// Load the directory as a Dagger module source
4405    ///
4406    /// # Arguments
4407    ///
4408    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4409    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4410        let mut query = self.selection.select("asModule");
4411        if let Some(source_root_path) = opts.source_root_path {
4412            query = query.arg("sourceRootPath", source_root_path);
4413        }
4414        Module {
4415            proc: self.proc.clone(),
4416            selection: query,
4417            graphql_client: self.graphql_client.clone(),
4418        }
4419    }
4420    /// Load the directory as a Dagger module source
4421    ///
4422    /// # Arguments
4423    ///
4424    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4425    pub fn as_module_source(&self) -> ModuleSource {
4426        let query = self.selection.select("asModuleSource");
4427        ModuleSource {
4428            proc: self.proc.clone(),
4429            selection: query,
4430            graphql_client: self.graphql_client.clone(),
4431        }
4432    }
4433    /// Load the directory as a Dagger module source
4434    ///
4435    /// # Arguments
4436    ///
4437    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4438    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4439        let mut query = self.selection.select("asModuleSource");
4440        if let Some(source_root_path) = opts.source_root_path {
4441            query = query.arg("sourceRootPath", source_root_path);
4442        }
4443        ModuleSource {
4444            proc: self.proc.clone(),
4445            selection: query,
4446            graphql_client: self.graphql_client.clone(),
4447        }
4448    }
4449    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
4450    ///
4451    /// # Arguments
4452    ///
4453    /// * `other` - The directory to compare against
4454    pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
4455        let mut query = self.selection.select("diff");
4456        query = query.arg_lazy(
4457            "other",
4458            Box::new(move || {
4459                let other = other.clone();
4460                Box::pin(async move { other.into_id().await.unwrap().quote() })
4461            }),
4462        );
4463        Directory {
4464            proc: self.proc.clone(),
4465            selection: query,
4466            graphql_client: self.graphql_client.clone(),
4467        }
4468    }
4469    /// 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.
4470    pub async fn digest(&self) -> Result<String, DaggerError> {
4471        let query = self.selection.select("digest");
4472        query.execute(self.graphql_client.clone()).await
4473    }
4474    /// Retrieves a directory at the given path.
4475    ///
4476    /// # Arguments
4477    ///
4478    /// * `path` - Location of the directory to retrieve. Example: "/src"
4479    pub fn directory(&self, path: impl Into<String>) -> Directory {
4480        let mut query = self.selection.select("directory");
4481        query = query.arg("path", path.into());
4482        Directory {
4483            proc: self.proc.clone(),
4484            selection: query,
4485            graphql_client: self.graphql_client.clone(),
4486        }
4487    }
4488    /// 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.
4489    ///
4490    /// # Arguments
4491    ///
4492    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4493    pub fn docker_build(&self) -> Container {
4494        let query = self.selection.select("dockerBuild");
4495        Container {
4496            proc: self.proc.clone(),
4497            selection: query,
4498            graphql_client: self.graphql_client.clone(),
4499        }
4500    }
4501    /// 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.
4502    ///
4503    /// # Arguments
4504    ///
4505    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4506    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
4507        let mut query = self.selection.select("dockerBuild");
4508        if let Some(dockerfile) = opts.dockerfile {
4509            query = query.arg("dockerfile", dockerfile);
4510        }
4511        if let Some(platform) = opts.platform {
4512            query = query.arg("platform", platform);
4513        }
4514        if let Some(build_args) = opts.build_args {
4515            query = query.arg("buildArgs", build_args);
4516        }
4517        if let Some(target) = opts.target {
4518            query = query.arg("target", target);
4519        }
4520        if let Some(secrets) = opts.secrets {
4521            query = query.arg("secrets", secrets);
4522        }
4523        if let Some(no_init) = opts.no_init {
4524            query = query.arg("noInit", no_init);
4525        }
4526        Container {
4527            proc: self.proc.clone(),
4528            selection: query,
4529            graphql_client: self.graphql_client.clone(),
4530        }
4531    }
4532    /// Returns a list of files and directories at the given path.
4533    ///
4534    /// # Arguments
4535    ///
4536    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4537    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
4538        let query = self.selection.select("entries");
4539        query.execute(self.graphql_client.clone()).await
4540    }
4541    /// Returns a list of files and directories at the given path.
4542    ///
4543    /// # Arguments
4544    ///
4545    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4546    pub async fn entries_opts<'a>(
4547        &self,
4548        opts: DirectoryEntriesOpts<'a>,
4549    ) -> Result<Vec<String>, DaggerError> {
4550        let mut query = self.selection.select("entries");
4551        if let Some(path) = opts.path {
4552            query = query.arg("path", path);
4553        }
4554        query.execute(self.graphql_client.clone()).await
4555    }
4556    /// Writes the contents of the directory to a path on the host.
4557    ///
4558    /// # Arguments
4559    ///
4560    /// * `path` - Location of the copied directory (e.g., "logs/").
4561    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4562    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4563        let mut query = self.selection.select("export");
4564        query = query.arg("path", path.into());
4565        query.execute(self.graphql_client.clone()).await
4566    }
4567    /// Writes the contents of the directory to a path on the host.
4568    ///
4569    /// # Arguments
4570    ///
4571    /// * `path` - Location of the copied directory (e.g., "logs/").
4572    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4573    pub async fn export_opts(
4574        &self,
4575        path: impl Into<String>,
4576        opts: DirectoryExportOpts,
4577    ) -> Result<String, DaggerError> {
4578        let mut query = self.selection.select("export");
4579        query = query.arg("path", path.into());
4580        if let Some(wipe) = opts.wipe {
4581            query = query.arg("wipe", wipe);
4582        }
4583        query.execute(self.graphql_client.clone()).await
4584    }
4585    /// Retrieve a file at the given path.
4586    ///
4587    /// # Arguments
4588    ///
4589    /// * `path` - Location of the file to retrieve (e.g., "README.md").
4590    pub fn file(&self, path: impl Into<String>) -> File {
4591        let mut query = self.selection.select("file");
4592        query = query.arg("path", path.into());
4593        File {
4594            proc: self.proc.clone(),
4595            selection: query,
4596            graphql_client: self.graphql_client.clone(),
4597        }
4598    }
4599    /// Return a snapshot with some paths included or excluded
4600    ///
4601    /// # Arguments
4602    ///
4603    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4604    pub fn filter(&self) -> Directory {
4605        let query = self.selection.select("filter");
4606        Directory {
4607            proc: self.proc.clone(),
4608            selection: query,
4609            graphql_client: self.graphql_client.clone(),
4610        }
4611    }
4612    /// Return a snapshot with some paths included or excluded
4613    ///
4614    /// # Arguments
4615    ///
4616    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4617    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
4618        let mut query = self.selection.select("filter");
4619        if let Some(exclude) = opts.exclude {
4620            query = query.arg("exclude", exclude);
4621        }
4622        if let Some(include) = opts.include {
4623            query = query.arg("include", include);
4624        }
4625        Directory {
4626            proc: self.proc.clone(),
4627            selection: query,
4628            graphql_client: self.graphql_client.clone(),
4629        }
4630    }
4631    /// Returns a list of files and directories that matche the given pattern.
4632    ///
4633    /// # Arguments
4634    ///
4635    /// * `pattern` - Pattern to match (e.g., "*.md").
4636    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
4637        let mut query = self.selection.select("glob");
4638        query = query.arg("pattern", pattern.into());
4639        query.execute(self.graphql_client.clone()).await
4640    }
4641    /// A unique identifier for this Directory.
4642    pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
4643        let query = self.selection.select("id");
4644        query.execute(self.graphql_client.clone()).await
4645    }
4646    /// Returns the name of the directory.
4647    pub async fn name(&self) -> Result<String, DaggerError> {
4648        let query = self.selection.select("name");
4649        query.execute(self.graphql_client.clone()).await
4650    }
4651    /// Force evaluation in the engine.
4652    pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
4653        let query = self.selection.select("sync");
4654        query.execute(self.graphql_client.clone()).await
4655    }
4656    /// Opens an interactive terminal in new container with this directory mounted inside.
4657    ///
4658    /// # Arguments
4659    ///
4660    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4661    pub fn terminal(&self) -> Directory {
4662        let query = self.selection.select("terminal");
4663        Directory {
4664            proc: self.proc.clone(),
4665            selection: query,
4666            graphql_client: self.graphql_client.clone(),
4667        }
4668    }
4669    /// Opens an interactive terminal in new container with this directory mounted inside.
4670    ///
4671    /// # Arguments
4672    ///
4673    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4674    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
4675        let mut query = self.selection.select("terminal");
4676        if let Some(container) = opts.container {
4677            query = query.arg("container", container);
4678        }
4679        if let Some(cmd) = opts.cmd {
4680            query = query.arg("cmd", cmd);
4681        }
4682        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4683            query = query.arg(
4684                "experimentalPrivilegedNesting",
4685                experimental_privileged_nesting,
4686            );
4687        }
4688        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4689            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4690        }
4691        Directory {
4692            proc: self.proc.clone(),
4693            selection: query,
4694            graphql_client: self.graphql_client.clone(),
4695        }
4696    }
4697    /// Return a snapshot with a directory added
4698    ///
4699    /// # Arguments
4700    ///
4701    /// * `path` - Location of the written directory (e.g., "/src/").
4702    /// * `directory` - Identifier of the directory to copy.
4703    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4704    pub fn with_directory(
4705        &self,
4706        path: impl Into<String>,
4707        directory: impl IntoID<DirectoryId>,
4708    ) -> Directory {
4709        let mut query = self.selection.select("withDirectory");
4710        query = query.arg("path", path.into());
4711        query = query.arg_lazy(
4712            "directory",
4713            Box::new(move || {
4714                let directory = directory.clone();
4715                Box::pin(async move { directory.into_id().await.unwrap().quote() })
4716            }),
4717        );
4718        Directory {
4719            proc: self.proc.clone(),
4720            selection: query,
4721            graphql_client: self.graphql_client.clone(),
4722        }
4723    }
4724    /// Return a snapshot with a directory added
4725    ///
4726    /// # Arguments
4727    ///
4728    /// * `path` - Location of the written directory (e.g., "/src/").
4729    /// * `directory` - Identifier of the directory to copy.
4730    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4731    pub fn with_directory_opts<'a>(
4732        &self,
4733        path: impl Into<String>,
4734        directory: impl IntoID<DirectoryId>,
4735        opts: DirectoryWithDirectoryOpts<'a>,
4736    ) -> Directory {
4737        let mut query = self.selection.select("withDirectory");
4738        query = query.arg("path", path.into());
4739        query = query.arg_lazy(
4740            "directory",
4741            Box::new(move || {
4742                let directory = directory.clone();
4743                Box::pin(async move { directory.into_id().await.unwrap().quote() })
4744            }),
4745        );
4746        if let Some(exclude) = opts.exclude {
4747            query = query.arg("exclude", exclude);
4748        }
4749        if let Some(include) = opts.include {
4750            query = query.arg("include", include);
4751        }
4752        Directory {
4753            proc: self.proc.clone(),
4754            selection: query,
4755            graphql_client: self.graphql_client.clone(),
4756        }
4757    }
4758    /// Retrieves this directory plus the contents of the given file copied to the given path.
4759    ///
4760    /// # Arguments
4761    ///
4762    /// * `path` - Location of the copied file (e.g., "/file.txt").
4763    /// * `source` - Identifier of the file to copy.
4764    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4765    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
4766        let mut query = self.selection.select("withFile");
4767        query = query.arg("path", path.into());
4768        query = query.arg_lazy(
4769            "source",
4770            Box::new(move || {
4771                let source = source.clone();
4772                Box::pin(async move { source.into_id().await.unwrap().quote() })
4773            }),
4774        );
4775        Directory {
4776            proc: self.proc.clone(),
4777            selection: query,
4778            graphql_client: self.graphql_client.clone(),
4779        }
4780    }
4781    /// Retrieves this directory plus the contents of the given file copied to the given path.
4782    ///
4783    /// # Arguments
4784    ///
4785    /// * `path` - Location of the copied file (e.g., "/file.txt").
4786    /// * `source` - Identifier of the file to copy.
4787    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4788    pub fn with_file_opts(
4789        &self,
4790        path: impl Into<String>,
4791        source: impl IntoID<FileId>,
4792        opts: DirectoryWithFileOpts,
4793    ) -> Directory {
4794        let mut query = self.selection.select("withFile");
4795        query = query.arg("path", path.into());
4796        query = query.arg_lazy(
4797            "source",
4798            Box::new(move || {
4799                let source = source.clone();
4800                Box::pin(async move { source.into_id().await.unwrap().quote() })
4801            }),
4802        );
4803        if let Some(permissions) = opts.permissions {
4804            query = query.arg("permissions", permissions);
4805        }
4806        Directory {
4807            proc: self.proc.clone(),
4808            selection: query,
4809            graphql_client: self.graphql_client.clone(),
4810        }
4811    }
4812    /// Retrieves this directory plus the contents of the given files copied to the given path.
4813    ///
4814    /// # Arguments
4815    ///
4816    /// * `path` - Location where copied files should be placed (e.g., "/src").
4817    /// * `sources` - Identifiers of the files to copy.
4818    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4819    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
4820        let mut query = self.selection.select("withFiles");
4821        query = query.arg("path", path.into());
4822        query = query.arg("sources", sources);
4823        Directory {
4824            proc: self.proc.clone(),
4825            selection: query,
4826            graphql_client: self.graphql_client.clone(),
4827        }
4828    }
4829    /// Retrieves this directory plus the contents of the given files copied to the given path.
4830    ///
4831    /// # Arguments
4832    ///
4833    /// * `path` - Location where copied files should be placed (e.g., "/src").
4834    /// * `sources` - Identifiers of the files to copy.
4835    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4836    pub fn with_files_opts(
4837        &self,
4838        path: impl Into<String>,
4839        sources: Vec<FileId>,
4840        opts: DirectoryWithFilesOpts,
4841    ) -> Directory {
4842        let mut query = self.selection.select("withFiles");
4843        query = query.arg("path", path.into());
4844        query = query.arg("sources", sources);
4845        if let Some(permissions) = opts.permissions {
4846            query = query.arg("permissions", permissions);
4847        }
4848        Directory {
4849            proc: self.proc.clone(),
4850            selection: query,
4851            graphql_client: self.graphql_client.clone(),
4852        }
4853    }
4854    /// Retrieves this directory plus a new directory created at the given path.
4855    ///
4856    /// # Arguments
4857    ///
4858    /// * `path` - Location of the directory created (e.g., "/logs").
4859    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4860    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
4861        let mut query = self.selection.select("withNewDirectory");
4862        query = query.arg("path", path.into());
4863        Directory {
4864            proc: self.proc.clone(),
4865            selection: query,
4866            graphql_client: self.graphql_client.clone(),
4867        }
4868    }
4869    /// Retrieves this directory plus a new directory created at the given path.
4870    ///
4871    /// # Arguments
4872    ///
4873    /// * `path` - Location of the directory created (e.g., "/logs").
4874    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4875    pub fn with_new_directory_opts(
4876        &self,
4877        path: impl Into<String>,
4878        opts: DirectoryWithNewDirectoryOpts,
4879    ) -> Directory {
4880        let mut query = self.selection.select("withNewDirectory");
4881        query = query.arg("path", path.into());
4882        if let Some(permissions) = opts.permissions {
4883            query = query.arg("permissions", permissions);
4884        }
4885        Directory {
4886            proc: self.proc.clone(),
4887            selection: query,
4888            graphql_client: self.graphql_client.clone(),
4889        }
4890    }
4891    /// Return a snapshot with a new file added
4892    ///
4893    /// # Arguments
4894    ///
4895    /// * `path` - Path of the new file. Example: "foo/bar.txt"
4896    /// * `contents` - Contents of the new file. Example: "Hello world!"
4897    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4898    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
4899        let mut query = self.selection.select("withNewFile");
4900        query = query.arg("path", path.into());
4901        query = query.arg("contents", contents.into());
4902        Directory {
4903            proc: self.proc.clone(),
4904            selection: query,
4905            graphql_client: self.graphql_client.clone(),
4906        }
4907    }
4908    /// Return a snapshot with a new file added
4909    ///
4910    /// # Arguments
4911    ///
4912    /// * `path` - Path of the new file. Example: "foo/bar.txt"
4913    /// * `contents` - Contents of the new file. Example: "Hello world!"
4914    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4915    pub fn with_new_file_opts(
4916        &self,
4917        path: impl Into<String>,
4918        contents: impl Into<String>,
4919        opts: DirectoryWithNewFileOpts,
4920    ) -> Directory {
4921        let mut query = self.selection.select("withNewFile");
4922        query = query.arg("path", path.into());
4923        query = query.arg("contents", contents.into());
4924        if let Some(permissions) = opts.permissions {
4925            query = query.arg("permissions", permissions);
4926        }
4927        Directory {
4928            proc: self.proc.clone(),
4929            selection: query,
4930            graphql_client: self.graphql_client.clone(),
4931        }
4932    }
4933    /// Retrieves this directory with all file/dir timestamps set to the given time.
4934    ///
4935    /// # Arguments
4936    ///
4937    /// * `timestamp` - Timestamp to set dir/files in.
4938    ///
4939    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
4940    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
4941        let mut query = self.selection.select("withTimestamps");
4942        query = query.arg("timestamp", timestamp);
4943        Directory {
4944            proc: self.proc.clone(),
4945            selection: query,
4946            graphql_client: self.graphql_client.clone(),
4947        }
4948    }
4949    /// Return a snapshot with a subdirectory removed
4950    ///
4951    /// # Arguments
4952    ///
4953    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
4954    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
4955        let mut query = self.selection.select("withoutDirectory");
4956        query = query.arg("path", path.into());
4957        Directory {
4958            proc: self.proc.clone(),
4959            selection: query,
4960            graphql_client: self.graphql_client.clone(),
4961        }
4962    }
4963    /// Return a snapshot with a file removed
4964    ///
4965    /// # Arguments
4966    ///
4967    /// * `path` - Path of the file to remove (e.g., "/file.txt").
4968    pub fn without_file(&self, path: impl Into<String>) -> Directory {
4969        let mut query = self.selection.select("withoutFile");
4970        query = query.arg("path", path.into());
4971        Directory {
4972            proc: self.proc.clone(),
4973            selection: query,
4974            graphql_client: self.graphql_client.clone(),
4975        }
4976    }
4977    /// Return a snapshot with files removed
4978    ///
4979    /// # Arguments
4980    ///
4981    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
4982    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
4983        let mut query = self.selection.select("withoutFiles");
4984        query = query.arg(
4985            "paths",
4986            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4987        );
4988        Directory {
4989            proc: self.proc.clone(),
4990            selection: query,
4991            graphql_client: self.graphql_client.clone(),
4992        }
4993    }
4994}
4995#[derive(Clone)]
4996pub struct Engine {
4997    pub proc: Option<Arc<DaggerSessionProc>>,
4998    pub selection: Selection,
4999    pub graphql_client: DynGraphQLClient,
5000}
5001impl Engine {
5002    /// A unique identifier for this Engine.
5003    pub async fn id(&self) -> Result<EngineId, DaggerError> {
5004        let query = self.selection.select("id");
5005        query.execute(self.graphql_client.clone()).await
5006    }
5007    /// The local (on-disk) cache for the Dagger engine
5008    pub fn local_cache(&self) -> EngineCache {
5009        let query = self.selection.select("localCache");
5010        EngineCache {
5011            proc: self.proc.clone(),
5012            selection: query,
5013            graphql_client: self.graphql_client.clone(),
5014        }
5015    }
5016}
5017#[derive(Clone)]
5018pub struct EngineCache {
5019    pub proc: Option<Arc<DaggerSessionProc>>,
5020    pub selection: Selection,
5021    pub graphql_client: DynGraphQLClient,
5022}
5023#[derive(Builder, Debug, PartialEq)]
5024pub struct EngineCacheEntrySetOpts<'a> {
5025    #[builder(setter(into, strip_option), default)]
5026    pub key: Option<&'a str>,
5027}
5028impl EngineCache {
5029    /// The current set of entries in the cache
5030    ///
5031    /// # Arguments
5032    ///
5033    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5034    pub fn entry_set(&self) -> EngineCacheEntrySet {
5035        let query = self.selection.select("entrySet");
5036        EngineCacheEntrySet {
5037            proc: self.proc.clone(),
5038            selection: query,
5039            graphql_client: self.graphql_client.clone(),
5040        }
5041    }
5042    /// The current set of entries in the cache
5043    ///
5044    /// # Arguments
5045    ///
5046    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5047    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5048        let mut query = self.selection.select("entrySet");
5049        if let Some(key) = opts.key {
5050            query = query.arg("key", key);
5051        }
5052        EngineCacheEntrySet {
5053            proc: self.proc.clone(),
5054            selection: query,
5055            graphql_client: self.graphql_client.clone(),
5056        }
5057    }
5058    /// A unique identifier for this EngineCache.
5059    pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
5060        let query = self.selection.select("id");
5061        query.execute(self.graphql_client.clone()).await
5062    }
5063    /// The maximum bytes to keep in the cache without pruning, after which automatic pruning may kick in.
5064    pub async fn keep_bytes(&self) -> Result<isize, DaggerError> {
5065        let query = self.selection.select("keepBytes");
5066        query.execute(self.graphql_client.clone()).await
5067    }
5068    /// The maximum bytes to keep in the cache without pruning.
5069    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5070        let query = self.selection.select("maxUsedSpace");
5071        query.execute(self.graphql_client.clone()).await
5072    }
5073    /// The target amount of free disk space the garbage collector will attempt to leave.
5074    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5075        let query = self.selection.select("minFreeSpace");
5076        query.execute(self.graphql_client.clone()).await
5077    }
5078    /// Prune the cache of releaseable entries
5079    pub async fn prune(&self) -> Result<Void, DaggerError> {
5080        let query = self.selection.select("prune");
5081        query.execute(self.graphql_client.clone()).await
5082    }
5083    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
5084        let query = self.selection.select("reservedSpace");
5085        query.execute(self.graphql_client.clone()).await
5086    }
5087}
5088#[derive(Clone)]
5089pub struct EngineCacheEntry {
5090    pub proc: Option<Arc<DaggerSessionProc>>,
5091    pub selection: Selection,
5092    pub graphql_client: DynGraphQLClient,
5093}
5094impl EngineCacheEntry {
5095    /// Whether the cache entry is actively being used.
5096    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
5097        let query = self.selection.select("activelyUsed");
5098        query.execute(self.graphql_client.clone()).await
5099    }
5100    /// The time the cache entry was created, in Unix nanoseconds.
5101    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
5102        let query = self.selection.select("createdTimeUnixNano");
5103        query.execute(self.graphql_client.clone()).await
5104    }
5105    /// The description of the cache entry.
5106    pub async fn description(&self) -> Result<String, DaggerError> {
5107        let query = self.selection.select("description");
5108        query.execute(self.graphql_client.clone()).await
5109    }
5110    /// The disk space used by the cache entry.
5111    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5112        let query = self.selection.select("diskSpaceBytes");
5113        query.execute(self.graphql_client.clone()).await
5114    }
5115    /// A unique identifier for this EngineCacheEntry.
5116    pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
5117        let query = self.selection.select("id");
5118        query.execute(self.graphql_client.clone()).await
5119    }
5120    /// The most recent time the cache entry was used, in Unix nanoseconds.
5121    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
5122        let query = self.selection.select("mostRecentUseTimeUnixNano");
5123        query.execute(self.graphql_client.clone()).await
5124    }
5125}
5126#[derive(Clone)]
5127pub struct EngineCacheEntrySet {
5128    pub proc: Option<Arc<DaggerSessionProc>>,
5129    pub selection: Selection,
5130    pub graphql_client: DynGraphQLClient,
5131}
5132impl EngineCacheEntrySet {
5133    /// The total disk space used by the cache entries in this set.
5134    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5135        let query = self.selection.select("diskSpaceBytes");
5136        query.execute(self.graphql_client.clone()).await
5137    }
5138    /// The list of individual cache entries in the set
5139    pub fn entries(&self) -> Vec<EngineCacheEntry> {
5140        let query = self.selection.select("entries");
5141        vec![EngineCacheEntry {
5142            proc: self.proc.clone(),
5143            selection: query,
5144            graphql_client: self.graphql_client.clone(),
5145        }]
5146    }
5147    /// The number of cache entries in this set.
5148    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
5149        let query = self.selection.select("entryCount");
5150        query.execute(self.graphql_client.clone()).await
5151    }
5152    /// A unique identifier for this EngineCacheEntrySet.
5153    pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
5154        let query = self.selection.select("id");
5155        query.execute(self.graphql_client.clone()).await
5156    }
5157}
5158#[derive(Clone)]
5159pub struct EnumTypeDef {
5160    pub proc: Option<Arc<DaggerSessionProc>>,
5161    pub selection: Selection,
5162    pub graphql_client: DynGraphQLClient,
5163}
5164impl EnumTypeDef {
5165    /// A doc string for the enum, if any.
5166    pub async fn description(&self) -> Result<String, DaggerError> {
5167        let query = self.selection.select("description");
5168        query.execute(self.graphql_client.clone()).await
5169    }
5170    /// A unique identifier for this EnumTypeDef.
5171    pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
5172        let query = self.selection.select("id");
5173        query.execute(self.graphql_client.clone()).await
5174    }
5175    /// The name of the enum.
5176    pub async fn name(&self) -> Result<String, DaggerError> {
5177        let query = self.selection.select("name");
5178        query.execute(self.graphql_client.clone()).await
5179    }
5180    /// The location of this enum declaration.
5181    pub fn source_map(&self) -> SourceMap {
5182        let query = self.selection.select("sourceMap");
5183        SourceMap {
5184            proc: self.proc.clone(),
5185            selection: query,
5186            graphql_client: self.graphql_client.clone(),
5187        }
5188    }
5189    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
5190    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
5191        let query = self.selection.select("sourceModuleName");
5192        query.execute(self.graphql_client.clone()).await
5193    }
5194    /// The values of the enum.
5195    pub fn values(&self) -> Vec<EnumValueTypeDef> {
5196        let query = self.selection.select("values");
5197        vec![EnumValueTypeDef {
5198            proc: self.proc.clone(),
5199            selection: query,
5200            graphql_client: self.graphql_client.clone(),
5201        }]
5202    }
5203}
5204#[derive(Clone)]
5205pub struct EnumValueTypeDef {
5206    pub proc: Option<Arc<DaggerSessionProc>>,
5207    pub selection: Selection,
5208    pub graphql_client: DynGraphQLClient,
5209}
5210impl EnumValueTypeDef {
5211    /// A doc string for the enum value, if any.
5212    pub async fn description(&self) -> Result<String, DaggerError> {
5213        let query = self.selection.select("description");
5214        query.execute(self.graphql_client.clone()).await
5215    }
5216    /// A unique identifier for this EnumValueTypeDef.
5217    pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
5218        let query = self.selection.select("id");
5219        query.execute(self.graphql_client.clone()).await
5220    }
5221    /// The name of the enum value.
5222    pub async fn name(&self) -> Result<String, DaggerError> {
5223        let query = self.selection.select("name");
5224        query.execute(self.graphql_client.clone()).await
5225    }
5226    /// The location of this enum value declaration.
5227    pub fn source_map(&self) -> SourceMap {
5228        let query = self.selection.select("sourceMap");
5229        SourceMap {
5230            proc: self.proc.clone(),
5231            selection: query,
5232            graphql_client: self.graphql_client.clone(),
5233        }
5234    }
5235}
5236#[derive(Clone)]
5237pub struct Env {
5238    pub proc: Option<Arc<DaggerSessionProc>>,
5239    pub selection: Selection,
5240    pub graphql_client: DynGraphQLClient,
5241}
5242impl Env {
5243    /// A unique identifier for this Env.
5244    pub async fn id(&self) -> Result<EnvId, DaggerError> {
5245        let query = self.selection.select("id");
5246        query.execute(self.graphql_client.clone()).await
5247    }
5248    /// retrieve an input value by name
5249    pub fn input(&self, name: impl Into<String>) -> Binding {
5250        let mut query = self.selection.select("input");
5251        query = query.arg("name", name.into());
5252        Binding {
5253            proc: self.proc.clone(),
5254            selection: query,
5255            graphql_client: self.graphql_client.clone(),
5256        }
5257    }
5258    /// return all input values for the environment
5259    pub fn inputs(&self) -> Vec<Binding> {
5260        let query = self.selection.select("inputs");
5261        vec![Binding {
5262            proc: self.proc.clone(),
5263            selection: query,
5264            graphql_client: self.graphql_client.clone(),
5265        }]
5266    }
5267    /// retrieve an output value by name
5268    pub fn output(&self, name: impl Into<String>) -> Binding {
5269        let mut query = self.selection.select("output");
5270        query = query.arg("name", name.into());
5271        Binding {
5272            proc: self.proc.clone(),
5273            selection: query,
5274            graphql_client: self.graphql_client.clone(),
5275        }
5276    }
5277    /// return all output values for the environment
5278    pub fn outputs(&self) -> Vec<Binding> {
5279        let query = self.selection.select("outputs");
5280        vec![Binding {
5281            proc: self.proc.clone(),
5282            selection: query,
5283            graphql_client: self.graphql_client.clone(),
5284        }]
5285    }
5286    /// Create or update a binding of type CacheVolume in the environment
5287    ///
5288    /// # Arguments
5289    ///
5290    /// * `name` - The name of the binding
5291    /// * `value` - The CacheVolume value to assign to the binding
5292    /// * `description` - The purpose of the input
5293    pub fn with_cache_volume_input(
5294        &self,
5295        name: impl Into<String>,
5296        value: impl IntoID<CacheVolumeId>,
5297        description: impl Into<String>,
5298    ) -> Env {
5299        let mut query = self.selection.select("withCacheVolumeInput");
5300        query = query.arg("name", name.into());
5301        query = query.arg_lazy(
5302            "value",
5303            Box::new(move || {
5304                let value = value.clone();
5305                Box::pin(async move { value.into_id().await.unwrap().quote() })
5306            }),
5307        );
5308        query = query.arg("description", description.into());
5309        Env {
5310            proc: self.proc.clone(),
5311            selection: query,
5312            graphql_client: self.graphql_client.clone(),
5313        }
5314    }
5315    /// Declare a desired CacheVolume output to be assigned in the environment
5316    ///
5317    /// # Arguments
5318    ///
5319    /// * `name` - The name of the binding
5320    /// * `description` - A description of the desired value of the binding
5321    pub fn with_cache_volume_output(
5322        &self,
5323        name: impl Into<String>,
5324        description: impl Into<String>,
5325    ) -> Env {
5326        let mut query = self.selection.select("withCacheVolumeOutput");
5327        query = query.arg("name", name.into());
5328        query = query.arg("description", description.into());
5329        Env {
5330            proc: self.proc.clone(),
5331            selection: query,
5332            graphql_client: self.graphql_client.clone(),
5333        }
5334    }
5335    /// Create or update a binding of type Container in the environment
5336    ///
5337    /// # Arguments
5338    ///
5339    /// * `name` - The name of the binding
5340    /// * `value` - The Container value to assign to the binding
5341    /// * `description` - The purpose of the input
5342    pub fn with_container_input(
5343        &self,
5344        name: impl Into<String>,
5345        value: impl IntoID<ContainerId>,
5346        description: impl Into<String>,
5347    ) -> Env {
5348        let mut query = self.selection.select("withContainerInput");
5349        query = query.arg("name", name.into());
5350        query = query.arg_lazy(
5351            "value",
5352            Box::new(move || {
5353                let value = value.clone();
5354                Box::pin(async move { value.into_id().await.unwrap().quote() })
5355            }),
5356        );
5357        query = query.arg("description", description.into());
5358        Env {
5359            proc: self.proc.clone(),
5360            selection: query,
5361            graphql_client: self.graphql_client.clone(),
5362        }
5363    }
5364    /// Declare a desired Container output to be assigned in the environment
5365    ///
5366    /// # Arguments
5367    ///
5368    /// * `name` - The name of the binding
5369    /// * `description` - A description of the desired value of the binding
5370    pub fn with_container_output(
5371        &self,
5372        name: impl Into<String>,
5373        description: impl Into<String>,
5374    ) -> Env {
5375        let mut query = self.selection.select("withContainerOutput");
5376        query = query.arg("name", name.into());
5377        query = query.arg("description", description.into());
5378        Env {
5379            proc: self.proc.clone(),
5380            selection: query,
5381            graphql_client: self.graphql_client.clone(),
5382        }
5383    }
5384    /// Create or update a binding of type Directory in the environment
5385    ///
5386    /// # Arguments
5387    ///
5388    /// * `name` - The name of the binding
5389    /// * `value` - The Directory value to assign to the binding
5390    /// * `description` - The purpose of the input
5391    pub fn with_directory_input(
5392        &self,
5393        name: impl Into<String>,
5394        value: impl IntoID<DirectoryId>,
5395        description: impl Into<String>,
5396    ) -> Env {
5397        let mut query = self.selection.select("withDirectoryInput");
5398        query = query.arg("name", name.into());
5399        query = query.arg_lazy(
5400            "value",
5401            Box::new(move || {
5402                let value = value.clone();
5403                Box::pin(async move { value.into_id().await.unwrap().quote() })
5404            }),
5405        );
5406        query = query.arg("description", description.into());
5407        Env {
5408            proc: self.proc.clone(),
5409            selection: query,
5410            graphql_client: self.graphql_client.clone(),
5411        }
5412    }
5413    /// Declare a desired Directory output to be assigned in the environment
5414    ///
5415    /// # Arguments
5416    ///
5417    /// * `name` - The name of the binding
5418    /// * `description` - A description of the desired value of the binding
5419    pub fn with_directory_output(
5420        &self,
5421        name: impl Into<String>,
5422        description: impl Into<String>,
5423    ) -> Env {
5424        let mut query = self.selection.select("withDirectoryOutput");
5425        query = query.arg("name", name.into());
5426        query = query.arg("description", description.into());
5427        Env {
5428            proc: self.proc.clone(),
5429            selection: query,
5430            graphql_client: self.graphql_client.clone(),
5431        }
5432    }
5433    /// Create or update a binding of type Env in the environment
5434    ///
5435    /// # Arguments
5436    ///
5437    /// * `name` - The name of the binding
5438    /// * `value` - The Env value to assign to the binding
5439    /// * `description` - The purpose of the input
5440    pub fn with_env_input(
5441        &self,
5442        name: impl Into<String>,
5443        value: impl IntoID<EnvId>,
5444        description: impl Into<String>,
5445    ) -> Env {
5446        let mut query = self.selection.select("withEnvInput");
5447        query = query.arg("name", name.into());
5448        query = query.arg_lazy(
5449            "value",
5450            Box::new(move || {
5451                let value = value.clone();
5452                Box::pin(async move { value.into_id().await.unwrap().quote() })
5453            }),
5454        );
5455        query = query.arg("description", description.into());
5456        Env {
5457            proc: self.proc.clone(),
5458            selection: query,
5459            graphql_client: self.graphql_client.clone(),
5460        }
5461    }
5462    /// Declare a desired Env output to be assigned in the environment
5463    ///
5464    /// # Arguments
5465    ///
5466    /// * `name` - The name of the binding
5467    /// * `description` - A description of the desired value of the binding
5468    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
5469        let mut query = self.selection.select("withEnvOutput");
5470        query = query.arg("name", name.into());
5471        query = query.arg("description", description.into());
5472        Env {
5473            proc: self.proc.clone(),
5474            selection: query,
5475            graphql_client: self.graphql_client.clone(),
5476        }
5477    }
5478    /// Create or update a binding of type File in the environment
5479    ///
5480    /// # Arguments
5481    ///
5482    /// * `name` - The name of the binding
5483    /// * `value` - The File value to assign to the binding
5484    /// * `description` - The purpose of the input
5485    pub fn with_file_input(
5486        &self,
5487        name: impl Into<String>,
5488        value: impl IntoID<FileId>,
5489        description: impl Into<String>,
5490    ) -> Env {
5491        let mut query = self.selection.select("withFileInput");
5492        query = query.arg("name", name.into());
5493        query = query.arg_lazy(
5494            "value",
5495            Box::new(move || {
5496                let value = value.clone();
5497                Box::pin(async move { value.into_id().await.unwrap().quote() })
5498            }),
5499        );
5500        query = query.arg("description", description.into());
5501        Env {
5502            proc: self.proc.clone(),
5503            selection: query,
5504            graphql_client: self.graphql_client.clone(),
5505        }
5506    }
5507    /// Declare a desired File output to be assigned in the environment
5508    ///
5509    /// # Arguments
5510    ///
5511    /// * `name` - The name of the binding
5512    /// * `description` - A description of the desired value of the binding
5513    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
5514        let mut query = self.selection.select("withFileOutput");
5515        query = query.arg("name", name.into());
5516        query = query.arg("description", description.into());
5517        Env {
5518            proc: self.proc.clone(),
5519            selection: query,
5520            graphql_client: self.graphql_client.clone(),
5521        }
5522    }
5523    /// Create or update a binding of type GitRef in the environment
5524    ///
5525    /// # Arguments
5526    ///
5527    /// * `name` - The name of the binding
5528    /// * `value` - The GitRef value to assign to the binding
5529    /// * `description` - The purpose of the input
5530    pub fn with_git_ref_input(
5531        &self,
5532        name: impl Into<String>,
5533        value: impl IntoID<GitRefId>,
5534        description: impl Into<String>,
5535    ) -> Env {
5536        let mut query = self.selection.select("withGitRefInput");
5537        query = query.arg("name", name.into());
5538        query = query.arg_lazy(
5539            "value",
5540            Box::new(move || {
5541                let value = value.clone();
5542                Box::pin(async move { value.into_id().await.unwrap().quote() })
5543            }),
5544        );
5545        query = query.arg("description", description.into());
5546        Env {
5547            proc: self.proc.clone(),
5548            selection: query,
5549            graphql_client: self.graphql_client.clone(),
5550        }
5551    }
5552    /// Declare a desired GitRef output to be assigned in the environment
5553    ///
5554    /// # Arguments
5555    ///
5556    /// * `name` - The name of the binding
5557    /// * `description` - A description of the desired value of the binding
5558    pub fn with_git_ref_output(
5559        &self,
5560        name: impl Into<String>,
5561        description: impl Into<String>,
5562    ) -> Env {
5563        let mut query = self.selection.select("withGitRefOutput");
5564        query = query.arg("name", name.into());
5565        query = query.arg("description", description.into());
5566        Env {
5567            proc: self.proc.clone(),
5568            selection: query,
5569            graphql_client: self.graphql_client.clone(),
5570        }
5571    }
5572    /// Create or update a binding of type GitRepository in the environment
5573    ///
5574    /// # Arguments
5575    ///
5576    /// * `name` - The name of the binding
5577    /// * `value` - The GitRepository value to assign to the binding
5578    /// * `description` - The purpose of the input
5579    pub fn with_git_repository_input(
5580        &self,
5581        name: impl Into<String>,
5582        value: impl IntoID<GitRepositoryId>,
5583        description: impl Into<String>,
5584    ) -> Env {
5585        let mut query = self.selection.select("withGitRepositoryInput");
5586        query = query.arg("name", name.into());
5587        query = query.arg_lazy(
5588            "value",
5589            Box::new(move || {
5590                let value = value.clone();
5591                Box::pin(async move { value.into_id().await.unwrap().quote() })
5592            }),
5593        );
5594        query = query.arg("description", description.into());
5595        Env {
5596            proc: self.proc.clone(),
5597            selection: query,
5598            graphql_client: self.graphql_client.clone(),
5599        }
5600    }
5601    /// Declare a desired GitRepository output to be assigned in the environment
5602    ///
5603    /// # Arguments
5604    ///
5605    /// * `name` - The name of the binding
5606    /// * `description` - A description of the desired value of the binding
5607    pub fn with_git_repository_output(
5608        &self,
5609        name: impl Into<String>,
5610        description: impl Into<String>,
5611    ) -> Env {
5612        let mut query = self.selection.select("withGitRepositoryOutput");
5613        query = query.arg("name", name.into());
5614        query = query.arg("description", description.into());
5615        Env {
5616            proc: self.proc.clone(),
5617            selection: query,
5618            graphql_client: self.graphql_client.clone(),
5619        }
5620    }
5621    /// Create or update a binding of type LLM in the environment
5622    ///
5623    /// # Arguments
5624    ///
5625    /// * `name` - The name of the binding
5626    /// * `value` - The LLM value to assign to the binding
5627    /// * `description` - The purpose of the input
5628    pub fn with_llm_input(
5629        &self,
5630        name: impl Into<String>,
5631        value: impl IntoID<Llmid>,
5632        description: impl Into<String>,
5633    ) -> Env {
5634        let mut query = self.selection.select("withLLMInput");
5635        query = query.arg("name", name.into());
5636        query = query.arg_lazy(
5637            "value",
5638            Box::new(move || {
5639                let value = value.clone();
5640                Box::pin(async move { value.into_id().await.unwrap().quote() })
5641            }),
5642        );
5643        query = query.arg("description", description.into());
5644        Env {
5645            proc: self.proc.clone(),
5646            selection: query,
5647            graphql_client: self.graphql_client.clone(),
5648        }
5649    }
5650    /// Declare a desired LLM output to be assigned in the environment
5651    ///
5652    /// # Arguments
5653    ///
5654    /// * `name` - The name of the binding
5655    /// * `description` - A description of the desired value of the binding
5656    pub fn with_llm_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
5657        let mut query = self.selection.select("withLLMOutput");
5658        query = query.arg("name", name.into());
5659        query = query.arg("description", description.into());
5660        Env {
5661            proc: self.proc.clone(),
5662            selection: query,
5663            graphql_client: self.graphql_client.clone(),
5664        }
5665    }
5666    /// Create or update a binding of type ModuleConfigClient in the environment
5667    ///
5668    /// # Arguments
5669    ///
5670    /// * `name` - The name of the binding
5671    /// * `value` - The ModuleConfigClient value to assign to the binding
5672    /// * `description` - The purpose of the input
5673    pub fn with_module_config_client_input(
5674        &self,
5675        name: impl Into<String>,
5676        value: impl IntoID<ModuleConfigClientId>,
5677        description: impl Into<String>,
5678    ) -> Env {
5679        let mut query = self.selection.select("withModuleConfigClientInput");
5680        query = query.arg("name", name.into());
5681        query = query.arg_lazy(
5682            "value",
5683            Box::new(move || {
5684                let value = value.clone();
5685                Box::pin(async move { value.into_id().await.unwrap().quote() })
5686            }),
5687        );
5688        query = query.arg("description", description.into());
5689        Env {
5690            proc: self.proc.clone(),
5691            selection: query,
5692            graphql_client: self.graphql_client.clone(),
5693        }
5694    }
5695    /// Declare a desired ModuleConfigClient output to be assigned in the environment
5696    ///
5697    /// # Arguments
5698    ///
5699    /// * `name` - The name of the binding
5700    /// * `description` - A description of the desired value of the binding
5701    pub fn with_module_config_client_output(
5702        &self,
5703        name: impl Into<String>,
5704        description: impl Into<String>,
5705    ) -> Env {
5706        let mut query = self.selection.select("withModuleConfigClientOutput");
5707        query = query.arg("name", name.into());
5708        query = query.arg("description", description.into());
5709        Env {
5710            proc: self.proc.clone(),
5711            selection: query,
5712            graphql_client: self.graphql_client.clone(),
5713        }
5714    }
5715    /// Create or update a binding of type Module in the environment
5716    ///
5717    /// # Arguments
5718    ///
5719    /// * `name` - The name of the binding
5720    /// * `value` - The Module value to assign to the binding
5721    /// * `description` - The purpose of the input
5722    pub fn with_module_input(
5723        &self,
5724        name: impl Into<String>,
5725        value: impl IntoID<ModuleId>,
5726        description: impl Into<String>,
5727    ) -> Env {
5728        let mut query = self.selection.select("withModuleInput");
5729        query = query.arg("name", name.into());
5730        query = query.arg_lazy(
5731            "value",
5732            Box::new(move || {
5733                let value = value.clone();
5734                Box::pin(async move { value.into_id().await.unwrap().quote() })
5735            }),
5736        );
5737        query = query.arg("description", description.into());
5738        Env {
5739            proc: self.proc.clone(),
5740            selection: query,
5741            graphql_client: self.graphql_client.clone(),
5742        }
5743    }
5744    /// Declare a desired Module output to be assigned in the environment
5745    ///
5746    /// # Arguments
5747    ///
5748    /// * `name` - The name of the binding
5749    /// * `description` - A description of the desired value of the binding
5750    pub fn with_module_output(
5751        &self,
5752        name: impl Into<String>,
5753        description: impl Into<String>,
5754    ) -> Env {
5755        let mut query = self.selection.select("withModuleOutput");
5756        query = query.arg("name", name.into());
5757        query = query.arg("description", description.into());
5758        Env {
5759            proc: self.proc.clone(),
5760            selection: query,
5761            graphql_client: self.graphql_client.clone(),
5762        }
5763    }
5764    /// Create or update a binding of type ModuleSource in the environment
5765    ///
5766    /// # Arguments
5767    ///
5768    /// * `name` - The name of the binding
5769    /// * `value` - The ModuleSource value to assign to the binding
5770    /// * `description` - The purpose of the input
5771    pub fn with_module_source_input(
5772        &self,
5773        name: impl Into<String>,
5774        value: impl IntoID<ModuleSourceId>,
5775        description: impl Into<String>,
5776    ) -> Env {
5777        let mut query = self.selection.select("withModuleSourceInput");
5778        query = query.arg("name", name.into());
5779        query = query.arg_lazy(
5780            "value",
5781            Box::new(move || {
5782                let value = value.clone();
5783                Box::pin(async move { value.into_id().await.unwrap().quote() })
5784            }),
5785        );
5786        query = query.arg("description", description.into());
5787        Env {
5788            proc: self.proc.clone(),
5789            selection: query,
5790            graphql_client: self.graphql_client.clone(),
5791        }
5792    }
5793    /// Declare a desired ModuleSource output to be assigned in the environment
5794    ///
5795    /// # Arguments
5796    ///
5797    /// * `name` - The name of the binding
5798    /// * `description` - A description of the desired value of the binding
5799    pub fn with_module_source_output(
5800        &self,
5801        name: impl Into<String>,
5802        description: impl Into<String>,
5803    ) -> Env {
5804        let mut query = self.selection.select("withModuleSourceOutput");
5805        query = query.arg("name", name.into());
5806        query = query.arg("description", description.into());
5807        Env {
5808            proc: self.proc.clone(),
5809            selection: query,
5810            graphql_client: self.graphql_client.clone(),
5811        }
5812    }
5813    /// Create or update a binding of type Secret in the environment
5814    ///
5815    /// # Arguments
5816    ///
5817    /// * `name` - The name of the binding
5818    /// * `value` - The Secret value to assign to the binding
5819    /// * `description` - The purpose of the input
5820    pub fn with_secret_input(
5821        &self,
5822        name: impl Into<String>,
5823        value: impl IntoID<SecretId>,
5824        description: impl Into<String>,
5825    ) -> Env {
5826        let mut query = self.selection.select("withSecretInput");
5827        query = query.arg("name", name.into());
5828        query = query.arg_lazy(
5829            "value",
5830            Box::new(move || {
5831                let value = value.clone();
5832                Box::pin(async move { value.into_id().await.unwrap().quote() })
5833            }),
5834        );
5835        query = query.arg("description", description.into());
5836        Env {
5837            proc: self.proc.clone(),
5838            selection: query,
5839            graphql_client: self.graphql_client.clone(),
5840        }
5841    }
5842    /// Declare a desired Secret output to be assigned in the environment
5843    ///
5844    /// # Arguments
5845    ///
5846    /// * `name` - The name of the binding
5847    /// * `description` - A description of the desired value of the binding
5848    pub fn with_secret_output(
5849        &self,
5850        name: impl Into<String>,
5851        description: impl Into<String>,
5852    ) -> Env {
5853        let mut query = self.selection.select("withSecretOutput");
5854        query = query.arg("name", name.into());
5855        query = query.arg("description", description.into());
5856        Env {
5857            proc: self.proc.clone(),
5858            selection: query,
5859            graphql_client: self.graphql_client.clone(),
5860        }
5861    }
5862    /// Create or update a binding of type Service in the environment
5863    ///
5864    /// # Arguments
5865    ///
5866    /// * `name` - The name of the binding
5867    /// * `value` - The Service value to assign to the binding
5868    /// * `description` - The purpose of the input
5869    pub fn with_service_input(
5870        &self,
5871        name: impl Into<String>,
5872        value: impl IntoID<ServiceId>,
5873        description: impl Into<String>,
5874    ) -> Env {
5875        let mut query = self.selection.select("withServiceInput");
5876        query = query.arg("name", name.into());
5877        query = query.arg_lazy(
5878            "value",
5879            Box::new(move || {
5880                let value = value.clone();
5881                Box::pin(async move { value.into_id().await.unwrap().quote() })
5882            }),
5883        );
5884        query = query.arg("description", description.into());
5885        Env {
5886            proc: self.proc.clone(),
5887            selection: query,
5888            graphql_client: self.graphql_client.clone(),
5889        }
5890    }
5891    /// Declare a desired Service output to be assigned in the environment
5892    ///
5893    /// # Arguments
5894    ///
5895    /// * `name` - The name of the binding
5896    /// * `description` - A description of the desired value of the binding
5897    pub fn with_service_output(
5898        &self,
5899        name: impl Into<String>,
5900        description: impl Into<String>,
5901    ) -> Env {
5902        let mut query = self.selection.select("withServiceOutput");
5903        query = query.arg("name", name.into());
5904        query = query.arg("description", description.into());
5905        Env {
5906            proc: self.proc.clone(),
5907            selection: query,
5908            graphql_client: self.graphql_client.clone(),
5909        }
5910    }
5911    /// Create or update a binding of type Socket in the environment
5912    ///
5913    /// # Arguments
5914    ///
5915    /// * `name` - The name of the binding
5916    /// * `value` - The Socket value to assign to the binding
5917    /// * `description` - The purpose of the input
5918    pub fn with_socket_input(
5919        &self,
5920        name: impl Into<String>,
5921        value: impl IntoID<SocketId>,
5922        description: impl Into<String>,
5923    ) -> Env {
5924        let mut query = self.selection.select("withSocketInput");
5925        query = query.arg("name", name.into());
5926        query = query.arg_lazy(
5927            "value",
5928            Box::new(move || {
5929                let value = value.clone();
5930                Box::pin(async move { value.into_id().await.unwrap().quote() })
5931            }),
5932        );
5933        query = query.arg("description", description.into());
5934        Env {
5935            proc: self.proc.clone(),
5936            selection: query,
5937            graphql_client: self.graphql_client.clone(),
5938        }
5939    }
5940    /// Declare a desired Socket output to be assigned in the environment
5941    ///
5942    /// # Arguments
5943    ///
5944    /// * `name` - The name of the binding
5945    /// * `description` - A description of the desired value of the binding
5946    pub fn with_socket_output(
5947        &self,
5948        name: impl Into<String>,
5949        description: impl Into<String>,
5950    ) -> Env {
5951        let mut query = self.selection.select("withSocketOutput");
5952        query = query.arg("name", name.into());
5953        query = query.arg("description", description.into());
5954        Env {
5955            proc: self.proc.clone(),
5956            selection: query,
5957            graphql_client: self.graphql_client.clone(),
5958        }
5959    }
5960    /// Create or update an input value of type string
5961    ///
5962    /// # Arguments
5963    ///
5964    /// * `name` - The name of the binding
5965    /// * `value` - The string value to assign to the binding
5966    /// * `description` - The description of the input
5967    pub fn with_string_input(
5968        &self,
5969        name: impl Into<String>,
5970        value: impl Into<String>,
5971        description: impl Into<String>,
5972    ) -> Env {
5973        let mut query = self.selection.select("withStringInput");
5974        query = query.arg("name", name.into());
5975        query = query.arg("value", value.into());
5976        query = query.arg("description", description.into());
5977        Env {
5978            proc: self.proc.clone(),
5979            selection: query,
5980            graphql_client: self.graphql_client.clone(),
5981        }
5982    }
5983    /// Create or update an input value of type string
5984    ///
5985    /// # Arguments
5986    ///
5987    /// * `name` - The name of the binding
5988    /// * `description` - The description of the output
5989    pub fn with_string_output(
5990        &self,
5991        name: impl Into<String>,
5992        description: impl Into<String>,
5993    ) -> Env {
5994        let mut query = self.selection.select("withStringOutput");
5995        query = query.arg("name", name.into());
5996        query = query.arg("description", description.into());
5997        Env {
5998            proc: self.proc.clone(),
5999            selection: query,
6000            graphql_client: self.graphql_client.clone(),
6001        }
6002    }
6003}
6004#[derive(Clone)]
6005pub struct EnvVariable {
6006    pub proc: Option<Arc<DaggerSessionProc>>,
6007    pub selection: Selection,
6008    pub graphql_client: DynGraphQLClient,
6009}
6010impl EnvVariable {
6011    /// A unique identifier for this EnvVariable.
6012    pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
6013        let query = self.selection.select("id");
6014        query.execute(self.graphql_client.clone()).await
6015    }
6016    /// The environment variable name.
6017    pub async fn name(&self) -> Result<String, DaggerError> {
6018        let query = self.selection.select("name");
6019        query.execute(self.graphql_client.clone()).await
6020    }
6021    /// The environment variable value.
6022    pub async fn value(&self) -> Result<String, DaggerError> {
6023        let query = self.selection.select("value");
6024        query.execute(self.graphql_client.clone()).await
6025    }
6026}
6027#[derive(Clone)]
6028pub struct Error {
6029    pub proc: Option<Arc<DaggerSessionProc>>,
6030    pub selection: Selection,
6031    pub graphql_client: DynGraphQLClient,
6032}
6033impl Error {
6034    /// A unique identifier for this Error.
6035    pub async fn id(&self) -> Result<ErrorId, DaggerError> {
6036        let query = self.selection.select("id");
6037        query.execute(self.graphql_client.clone()).await
6038    }
6039    /// A description of the error.
6040    pub async fn message(&self) -> Result<String, DaggerError> {
6041        let query = self.selection.select("message");
6042        query.execute(self.graphql_client.clone()).await
6043    }
6044    /// The extensions of the error.
6045    pub fn values(&self) -> Vec<ErrorValue> {
6046        let query = self.selection.select("values");
6047        vec![ErrorValue {
6048            proc: self.proc.clone(),
6049            selection: query,
6050            graphql_client: self.graphql_client.clone(),
6051        }]
6052    }
6053    /// Add a value to the error.
6054    ///
6055    /// # Arguments
6056    ///
6057    /// * `name` - The name of the value.
6058    /// * `value` - The value to store on the error.
6059    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
6060        let mut query = self.selection.select("withValue");
6061        query = query.arg("name", name.into());
6062        query = query.arg("value", value);
6063        Error {
6064            proc: self.proc.clone(),
6065            selection: query,
6066            graphql_client: self.graphql_client.clone(),
6067        }
6068    }
6069}
6070#[derive(Clone)]
6071pub struct ErrorValue {
6072    pub proc: Option<Arc<DaggerSessionProc>>,
6073    pub selection: Selection,
6074    pub graphql_client: DynGraphQLClient,
6075}
6076impl ErrorValue {
6077    /// A unique identifier for this ErrorValue.
6078    pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
6079        let query = self.selection.select("id");
6080        query.execute(self.graphql_client.clone()).await
6081    }
6082    /// The name of the value.
6083    pub async fn name(&self) -> Result<String, DaggerError> {
6084        let query = self.selection.select("name");
6085        query.execute(self.graphql_client.clone()).await
6086    }
6087    /// The value.
6088    pub async fn value(&self) -> Result<Json, DaggerError> {
6089        let query = self.selection.select("value");
6090        query.execute(self.graphql_client.clone()).await
6091    }
6092}
6093#[derive(Clone)]
6094pub struct FieldTypeDef {
6095    pub proc: Option<Arc<DaggerSessionProc>>,
6096    pub selection: Selection,
6097    pub graphql_client: DynGraphQLClient,
6098}
6099impl FieldTypeDef {
6100    /// A doc string for the field, if any.
6101    pub async fn description(&self) -> Result<String, DaggerError> {
6102        let query = self.selection.select("description");
6103        query.execute(self.graphql_client.clone()).await
6104    }
6105    /// A unique identifier for this FieldTypeDef.
6106    pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
6107        let query = self.selection.select("id");
6108        query.execute(self.graphql_client.clone()).await
6109    }
6110    /// The name of the field in lowerCamelCase format.
6111    pub async fn name(&self) -> Result<String, DaggerError> {
6112        let query = self.selection.select("name");
6113        query.execute(self.graphql_client.clone()).await
6114    }
6115    /// The location of this field declaration.
6116    pub fn source_map(&self) -> SourceMap {
6117        let query = self.selection.select("sourceMap");
6118        SourceMap {
6119            proc: self.proc.clone(),
6120            selection: query,
6121            graphql_client: self.graphql_client.clone(),
6122        }
6123    }
6124    /// The type of the field.
6125    pub fn type_def(&self) -> TypeDef {
6126        let query = self.selection.select("typeDef");
6127        TypeDef {
6128            proc: self.proc.clone(),
6129            selection: query,
6130            graphql_client: self.graphql_client.clone(),
6131        }
6132    }
6133}
6134#[derive(Clone)]
6135pub struct File {
6136    pub proc: Option<Arc<DaggerSessionProc>>,
6137    pub selection: Selection,
6138    pub graphql_client: DynGraphQLClient,
6139}
6140#[derive(Builder, Debug, PartialEq)]
6141pub struct FileDigestOpts {
6142    /// If true, exclude metadata from the digest.
6143    #[builder(setter(into, strip_option), default)]
6144    pub exclude_metadata: Option<bool>,
6145}
6146#[derive(Builder, Debug, PartialEq)]
6147pub struct FileExportOpts {
6148    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
6149    #[builder(setter(into, strip_option), default)]
6150    pub allow_parent_dir_path: Option<bool>,
6151}
6152impl File {
6153    /// Retrieves the contents of the file.
6154    pub async fn contents(&self) -> Result<String, DaggerError> {
6155        let query = self.selection.select("contents");
6156        query.execute(self.graphql_client.clone()).await
6157    }
6158    /// 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.
6159    ///
6160    /// # Arguments
6161    ///
6162    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6163    pub async fn digest(&self) -> Result<String, DaggerError> {
6164        let query = self.selection.select("digest");
6165        query.execute(self.graphql_client.clone()).await
6166    }
6167    /// 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.
6168    ///
6169    /// # Arguments
6170    ///
6171    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6172    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
6173        let mut query = self.selection.select("digest");
6174        if let Some(exclude_metadata) = opts.exclude_metadata {
6175            query = query.arg("excludeMetadata", exclude_metadata);
6176        }
6177        query.execute(self.graphql_client.clone()).await
6178    }
6179    /// Writes the file to a file path on the host.
6180    ///
6181    /// # Arguments
6182    ///
6183    /// * `path` - Location of the written directory (e.g., "output.txt").
6184    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6185    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
6186        let mut query = self.selection.select("export");
6187        query = query.arg("path", path.into());
6188        query.execute(self.graphql_client.clone()).await
6189    }
6190    /// Writes the file to a file path on the host.
6191    ///
6192    /// # Arguments
6193    ///
6194    /// * `path` - Location of the written directory (e.g., "output.txt").
6195    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6196    pub async fn export_opts(
6197        &self,
6198        path: impl Into<String>,
6199        opts: FileExportOpts,
6200    ) -> Result<String, DaggerError> {
6201        let mut query = self.selection.select("export");
6202        query = query.arg("path", path.into());
6203        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
6204            query = query.arg("allowParentDirPath", allow_parent_dir_path);
6205        }
6206        query.execute(self.graphql_client.clone()).await
6207    }
6208    /// A unique identifier for this File.
6209    pub async fn id(&self) -> Result<FileId, DaggerError> {
6210        let query = self.selection.select("id");
6211        query.execute(self.graphql_client.clone()).await
6212    }
6213    /// Retrieves the name of the file.
6214    pub async fn name(&self) -> Result<String, DaggerError> {
6215        let query = self.selection.select("name");
6216        query.execute(self.graphql_client.clone()).await
6217    }
6218    /// Retrieves the size of the file, in bytes.
6219    pub async fn size(&self) -> Result<isize, DaggerError> {
6220        let query = self.selection.select("size");
6221        query.execute(self.graphql_client.clone()).await
6222    }
6223    /// Force evaluation in the engine.
6224    pub async fn sync(&self) -> Result<FileId, DaggerError> {
6225        let query = self.selection.select("sync");
6226        query.execute(self.graphql_client.clone()).await
6227    }
6228    /// Retrieves this file with its name set to the given name.
6229    ///
6230    /// # Arguments
6231    ///
6232    /// * `name` - Name to set file to.
6233    pub fn with_name(&self, name: impl Into<String>) -> File {
6234        let mut query = self.selection.select("withName");
6235        query = query.arg("name", name.into());
6236        File {
6237            proc: self.proc.clone(),
6238            selection: query,
6239            graphql_client: self.graphql_client.clone(),
6240        }
6241    }
6242    /// Retrieves this file with its created/modified timestamps set to the given time.
6243    ///
6244    /// # Arguments
6245    ///
6246    /// * `timestamp` - Timestamp to set dir/files in.
6247    ///
6248    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
6249    pub fn with_timestamps(&self, timestamp: isize) -> File {
6250        let mut query = self.selection.select("withTimestamps");
6251        query = query.arg("timestamp", timestamp);
6252        File {
6253            proc: self.proc.clone(),
6254            selection: query,
6255            graphql_client: self.graphql_client.clone(),
6256        }
6257    }
6258}
6259#[derive(Clone)]
6260pub struct Function {
6261    pub proc: Option<Arc<DaggerSessionProc>>,
6262    pub selection: Selection,
6263    pub graphql_client: DynGraphQLClient,
6264}
6265#[derive(Builder, Debug, PartialEq)]
6266pub struct FunctionWithArgOpts<'a> {
6267    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
6268    #[builder(setter(into, strip_option), default)]
6269    pub default_path: Option<&'a str>,
6270    /// A default value to use for this argument if not explicitly set by the caller, if any
6271    #[builder(setter(into, strip_option), default)]
6272    pub default_value: Option<Json>,
6273    /// A doc string for the argument, if any
6274    #[builder(setter(into, strip_option), default)]
6275    pub description: Option<&'a str>,
6276    /// Patterns to ignore when loading the contextual argument value.
6277    #[builder(setter(into, strip_option), default)]
6278    pub ignore: Option<Vec<&'a str>>,
6279    /// The source map for the argument definition.
6280    #[builder(setter(into, strip_option), default)]
6281    pub source_map: Option<SourceMapId>,
6282}
6283impl Function {
6284    /// Arguments accepted by the function, if any.
6285    pub fn args(&self) -> Vec<FunctionArg> {
6286        let query = self.selection.select("args");
6287        vec![FunctionArg {
6288            proc: self.proc.clone(),
6289            selection: query,
6290            graphql_client: self.graphql_client.clone(),
6291        }]
6292    }
6293    /// A doc string for the function, if any.
6294    pub async fn description(&self) -> Result<String, DaggerError> {
6295        let query = self.selection.select("description");
6296        query.execute(self.graphql_client.clone()).await
6297    }
6298    /// A unique identifier for this Function.
6299    pub async fn id(&self) -> Result<FunctionId, DaggerError> {
6300        let query = self.selection.select("id");
6301        query.execute(self.graphql_client.clone()).await
6302    }
6303    /// The name of the function.
6304    pub async fn name(&self) -> Result<String, DaggerError> {
6305        let query = self.selection.select("name");
6306        query.execute(self.graphql_client.clone()).await
6307    }
6308    /// The type returned by the function.
6309    pub fn return_type(&self) -> TypeDef {
6310        let query = self.selection.select("returnType");
6311        TypeDef {
6312            proc: self.proc.clone(),
6313            selection: query,
6314            graphql_client: self.graphql_client.clone(),
6315        }
6316    }
6317    /// The location of this function declaration.
6318    pub fn source_map(&self) -> SourceMap {
6319        let query = self.selection.select("sourceMap");
6320        SourceMap {
6321            proc: self.proc.clone(),
6322            selection: query,
6323            graphql_client: self.graphql_client.clone(),
6324        }
6325    }
6326    /// Returns the function with the provided argument
6327    ///
6328    /// # Arguments
6329    ///
6330    /// * `name` - The name of the argument
6331    /// * `type_def` - The type of the argument
6332    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6333    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
6334        let mut query = self.selection.select("withArg");
6335        query = query.arg("name", name.into());
6336        query = query.arg_lazy(
6337            "typeDef",
6338            Box::new(move || {
6339                let type_def = type_def.clone();
6340                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
6341            }),
6342        );
6343        Function {
6344            proc: self.proc.clone(),
6345            selection: query,
6346            graphql_client: self.graphql_client.clone(),
6347        }
6348    }
6349    /// Returns the function with the provided argument
6350    ///
6351    /// # Arguments
6352    ///
6353    /// * `name` - The name of the argument
6354    /// * `type_def` - The type of the argument
6355    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6356    pub fn with_arg_opts<'a>(
6357        &self,
6358        name: impl Into<String>,
6359        type_def: impl IntoID<TypeDefId>,
6360        opts: FunctionWithArgOpts<'a>,
6361    ) -> Function {
6362        let mut query = self.selection.select("withArg");
6363        query = query.arg("name", name.into());
6364        query = query.arg_lazy(
6365            "typeDef",
6366            Box::new(move || {
6367                let type_def = type_def.clone();
6368                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
6369            }),
6370        );
6371        if let Some(description) = opts.description {
6372            query = query.arg("description", description);
6373        }
6374        if let Some(default_value) = opts.default_value {
6375            query = query.arg("defaultValue", default_value);
6376        }
6377        if let Some(default_path) = opts.default_path {
6378            query = query.arg("defaultPath", default_path);
6379        }
6380        if let Some(ignore) = opts.ignore {
6381            query = query.arg("ignore", ignore);
6382        }
6383        if let Some(source_map) = opts.source_map {
6384            query = query.arg("sourceMap", source_map);
6385        }
6386        Function {
6387            proc: self.proc.clone(),
6388            selection: query,
6389            graphql_client: self.graphql_client.clone(),
6390        }
6391    }
6392    /// Returns the function with the given doc string.
6393    ///
6394    /// # Arguments
6395    ///
6396    /// * `description` - The doc string to set.
6397    pub fn with_description(&self, description: impl Into<String>) -> Function {
6398        let mut query = self.selection.select("withDescription");
6399        query = query.arg("description", description.into());
6400        Function {
6401            proc: self.proc.clone(),
6402            selection: query,
6403            graphql_client: self.graphql_client.clone(),
6404        }
6405    }
6406    /// Returns the function with the given source map.
6407    ///
6408    /// # Arguments
6409    ///
6410    /// * `source_map` - The source map for the function definition.
6411    pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
6412        let mut query = self.selection.select("withSourceMap");
6413        query = query.arg_lazy(
6414            "sourceMap",
6415            Box::new(move || {
6416                let source_map = source_map.clone();
6417                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
6418            }),
6419        );
6420        Function {
6421            proc: self.proc.clone(),
6422            selection: query,
6423            graphql_client: self.graphql_client.clone(),
6424        }
6425    }
6426}
6427#[derive(Clone)]
6428pub struct FunctionArg {
6429    pub proc: Option<Arc<DaggerSessionProc>>,
6430    pub selection: Selection,
6431    pub graphql_client: DynGraphQLClient,
6432}
6433impl FunctionArg {
6434    /// 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
6435    pub async fn default_path(&self) -> Result<String, DaggerError> {
6436        let query = self.selection.select("defaultPath");
6437        query.execute(self.graphql_client.clone()).await
6438    }
6439    /// A default value to use for this argument when not explicitly set by the caller, if any.
6440    pub async fn default_value(&self) -> Result<Json, DaggerError> {
6441        let query = self.selection.select("defaultValue");
6442        query.execute(self.graphql_client.clone()).await
6443    }
6444    /// A doc string for the argument, if any.
6445    pub async fn description(&self) -> Result<String, DaggerError> {
6446        let query = self.selection.select("description");
6447        query.execute(self.graphql_client.clone()).await
6448    }
6449    /// A unique identifier for this FunctionArg.
6450    pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
6451        let query = self.selection.select("id");
6452        query.execute(self.graphql_client.clone()).await
6453    }
6454    /// 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.
6455    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
6456        let query = self.selection.select("ignore");
6457        query.execute(self.graphql_client.clone()).await
6458    }
6459    /// The name of the argument in lowerCamelCase format.
6460    pub async fn name(&self) -> Result<String, DaggerError> {
6461        let query = self.selection.select("name");
6462        query.execute(self.graphql_client.clone()).await
6463    }
6464    /// The location of this arg declaration.
6465    pub fn source_map(&self) -> SourceMap {
6466        let query = self.selection.select("sourceMap");
6467        SourceMap {
6468            proc: self.proc.clone(),
6469            selection: query,
6470            graphql_client: self.graphql_client.clone(),
6471        }
6472    }
6473    /// The type of the argument.
6474    pub fn type_def(&self) -> TypeDef {
6475        let query = self.selection.select("typeDef");
6476        TypeDef {
6477            proc: self.proc.clone(),
6478            selection: query,
6479            graphql_client: self.graphql_client.clone(),
6480        }
6481    }
6482}
6483#[derive(Clone)]
6484pub struct FunctionCall {
6485    pub proc: Option<Arc<DaggerSessionProc>>,
6486    pub selection: Selection,
6487    pub graphql_client: DynGraphQLClient,
6488}
6489impl FunctionCall {
6490    /// A unique identifier for this FunctionCall.
6491    pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
6492        let query = self.selection.select("id");
6493        query.execute(self.graphql_client.clone()).await
6494    }
6495    /// The argument values the function is being invoked with.
6496    pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
6497        let query = self.selection.select("inputArgs");
6498        vec![FunctionCallArgValue {
6499            proc: self.proc.clone(),
6500            selection: query,
6501            graphql_client: self.graphql_client.clone(),
6502        }]
6503    }
6504    /// The name of the function being called.
6505    pub async fn name(&self) -> Result<String, DaggerError> {
6506        let query = self.selection.select("name");
6507        query.execute(self.graphql_client.clone()).await
6508    }
6509    /// 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.
6510    pub async fn parent(&self) -> Result<Json, DaggerError> {
6511        let query = self.selection.select("parent");
6512        query.execute(self.graphql_client.clone()).await
6513    }
6514    /// 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.
6515    pub async fn parent_name(&self) -> Result<String, DaggerError> {
6516        let query = self.selection.select("parentName");
6517        query.execute(self.graphql_client.clone()).await
6518    }
6519    /// Return an error from the function.
6520    ///
6521    /// # Arguments
6522    ///
6523    /// * `error` - The error to return.
6524    pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
6525        let mut query = self.selection.select("returnError");
6526        query = query.arg_lazy(
6527            "error",
6528            Box::new(move || {
6529                let error = error.clone();
6530                Box::pin(async move { error.into_id().await.unwrap().quote() })
6531            }),
6532        );
6533        query.execute(self.graphql_client.clone()).await
6534    }
6535    /// Set the return value of the function call to the provided value.
6536    ///
6537    /// # Arguments
6538    ///
6539    /// * `value` - JSON serialization of the return value.
6540    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
6541        let mut query = self.selection.select("returnValue");
6542        query = query.arg("value", value);
6543        query.execute(self.graphql_client.clone()).await
6544    }
6545}
6546#[derive(Clone)]
6547pub struct FunctionCallArgValue {
6548    pub proc: Option<Arc<DaggerSessionProc>>,
6549    pub selection: Selection,
6550    pub graphql_client: DynGraphQLClient,
6551}
6552impl FunctionCallArgValue {
6553    /// A unique identifier for this FunctionCallArgValue.
6554    pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
6555        let query = self.selection.select("id");
6556        query.execute(self.graphql_client.clone()).await
6557    }
6558    /// The name of the argument.
6559    pub async fn name(&self) -> Result<String, DaggerError> {
6560        let query = self.selection.select("name");
6561        query.execute(self.graphql_client.clone()).await
6562    }
6563    /// The value of the argument represented as a JSON serialized string.
6564    pub async fn value(&self) -> Result<Json, DaggerError> {
6565        let query = self.selection.select("value");
6566        query.execute(self.graphql_client.clone()).await
6567    }
6568}
6569#[derive(Clone)]
6570pub struct GeneratedCode {
6571    pub proc: Option<Arc<DaggerSessionProc>>,
6572    pub selection: Selection,
6573    pub graphql_client: DynGraphQLClient,
6574}
6575impl GeneratedCode {
6576    /// The directory containing the generated code.
6577    pub fn code(&self) -> Directory {
6578        let query = self.selection.select("code");
6579        Directory {
6580            proc: self.proc.clone(),
6581            selection: query,
6582            graphql_client: self.graphql_client.clone(),
6583        }
6584    }
6585    /// A unique identifier for this GeneratedCode.
6586    pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
6587        let query = self.selection.select("id");
6588        query.execute(self.graphql_client.clone()).await
6589    }
6590    /// List of paths to mark generated in version control (i.e. .gitattributes).
6591    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
6592        let query = self.selection.select("vcsGeneratedPaths");
6593        query.execute(self.graphql_client.clone()).await
6594    }
6595    /// List of paths to ignore in version control (i.e. .gitignore).
6596    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
6597        let query = self.selection.select("vcsIgnoredPaths");
6598        query.execute(self.graphql_client.clone()).await
6599    }
6600    /// Set the list of paths to mark generated in version control.
6601    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
6602        let mut query = self.selection.select("withVCSGeneratedPaths");
6603        query = query.arg(
6604            "paths",
6605            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
6606        );
6607        GeneratedCode {
6608            proc: self.proc.clone(),
6609            selection: query,
6610            graphql_client: self.graphql_client.clone(),
6611        }
6612    }
6613    /// Set the list of paths to ignore in version control.
6614    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
6615        let mut query = self.selection.select("withVCSIgnoredPaths");
6616        query = query.arg(
6617            "paths",
6618            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
6619        );
6620        GeneratedCode {
6621            proc: self.proc.clone(),
6622            selection: query,
6623            graphql_client: self.graphql_client.clone(),
6624        }
6625    }
6626}
6627#[derive(Clone)]
6628pub struct GitRef {
6629    pub proc: Option<Arc<DaggerSessionProc>>,
6630    pub selection: Selection,
6631    pub graphql_client: DynGraphQLClient,
6632}
6633#[derive(Builder, Debug, PartialEq)]
6634pub struct GitRefTreeOpts {
6635    /// The depth of the tree to fetch.
6636    #[builder(setter(into, strip_option), default)]
6637    pub depth: Option<isize>,
6638    /// Set to true to discard .git directory.
6639    #[builder(setter(into, strip_option), default)]
6640    pub discard_git_dir: Option<bool>,
6641}
6642impl GitRef {
6643    /// The resolved commit id at this ref.
6644    pub async fn commit(&self) -> Result<String, DaggerError> {
6645        let query = self.selection.select("commit");
6646        query.execute(self.graphql_client.clone()).await
6647    }
6648    /// A unique identifier for this GitRef.
6649    pub async fn id(&self) -> Result<GitRefId, DaggerError> {
6650        let query = self.selection.select("id");
6651        query.execute(self.graphql_client.clone()).await
6652    }
6653    /// The resolved ref name at this ref.
6654    pub async fn r#ref(&self) -> Result<String, DaggerError> {
6655        let query = self.selection.select("ref");
6656        query.execute(self.graphql_client.clone()).await
6657    }
6658    /// The filesystem tree at this ref.
6659    ///
6660    /// # Arguments
6661    ///
6662    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6663    pub fn tree(&self) -> Directory {
6664        let query = self.selection.select("tree");
6665        Directory {
6666            proc: self.proc.clone(),
6667            selection: query,
6668            graphql_client: self.graphql_client.clone(),
6669        }
6670    }
6671    /// The filesystem tree at this ref.
6672    ///
6673    /// # Arguments
6674    ///
6675    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6676    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
6677        let mut query = self.selection.select("tree");
6678        if let Some(discard_git_dir) = opts.discard_git_dir {
6679            query = query.arg("discardGitDir", discard_git_dir);
6680        }
6681        if let Some(depth) = opts.depth {
6682            query = query.arg("depth", depth);
6683        }
6684        Directory {
6685            proc: self.proc.clone(),
6686            selection: query,
6687            graphql_client: self.graphql_client.clone(),
6688        }
6689    }
6690}
6691#[derive(Clone)]
6692pub struct GitRepository {
6693    pub proc: Option<Arc<DaggerSessionProc>>,
6694    pub selection: Selection,
6695    pub graphql_client: DynGraphQLClient,
6696}
6697#[derive(Builder, Debug, PartialEq)]
6698pub struct GitRepositoryBranchesOpts<'a> {
6699    /// Glob patterns (e.g., "refs/tags/v*").
6700    #[builder(setter(into, strip_option), default)]
6701    pub patterns: Option<Vec<&'a str>>,
6702}
6703#[derive(Builder, Debug, PartialEq)]
6704pub struct GitRepositoryTagsOpts<'a> {
6705    /// Glob patterns (e.g., "refs/tags/v*").
6706    #[builder(setter(into, strip_option), default)]
6707    pub patterns: Option<Vec<&'a str>>,
6708}
6709impl GitRepository {
6710    /// Returns details of a branch.
6711    ///
6712    /// # Arguments
6713    ///
6714    /// * `name` - Branch's name (e.g., "main").
6715    pub fn branch(&self, name: impl Into<String>) -> GitRef {
6716        let mut query = self.selection.select("branch");
6717        query = query.arg("name", name.into());
6718        GitRef {
6719            proc: self.proc.clone(),
6720            selection: query,
6721            graphql_client: self.graphql_client.clone(),
6722        }
6723    }
6724    /// branches that match any of the given glob patterns.
6725    ///
6726    /// # Arguments
6727    ///
6728    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6729    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
6730        let query = self.selection.select("branches");
6731        query.execute(self.graphql_client.clone()).await
6732    }
6733    /// branches that match any of the given glob patterns.
6734    ///
6735    /// # Arguments
6736    ///
6737    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6738    pub async fn branches_opts<'a>(
6739        &self,
6740        opts: GitRepositoryBranchesOpts<'a>,
6741    ) -> Result<Vec<String>, DaggerError> {
6742        let mut query = self.selection.select("branches");
6743        if let Some(patterns) = opts.patterns {
6744            query = query.arg("patterns", patterns);
6745        }
6746        query.execute(self.graphql_client.clone()).await
6747    }
6748    /// Returns details of a commit.
6749    ///
6750    /// # Arguments
6751    ///
6752    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
6753    pub fn commit(&self, id: impl Into<String>) -> GitRef {
6754        let mut query = self.selection.select("commit");
6755        query = query.arg("id", id.into());
6756        GitRef {
6757            proc: self.proc.clone(),
6758            selection: query,
6759            graphql_client: self.graphql_client.clone(),
6760        }
6761    }
6762    /// Returns details for HEAD.
6763    pub fn head(&self) -> GitRef {
6764        let query = self.selection.select("head");
6765        GitRef {
6766            proc: self.proc.clone(),
6767            selection: query,
6768            graphql_client: self.graphql_client.clone(),
6769        }
6770    }
6771    /// A unique identifier for this GitRepository.
6772    pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
6773        let query = self.selection.select("id");
6774        query.execute(self.graphql_client.clone()).await
6775    }
6776    /// Returns details of a ref.
6777    ///
6778    /// # Arguments
6779    ///
6780    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
6781    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
6782        let mut query = self.selection.select("ref");
6783        query = query.arg("name", name.into());
6784        GitRef {
6785            proc: self.proc.clone(),
6786            selection: query,
6787            graphql_client: self.graphql_client.clone(),
6788        }
6789    }
6790    /// Returns details of a tag.
6791    ///
6792    /// # Arguments
6793    ///
6794    /// * `name` - Tag's name (e.g., "v0.3.9").
6795    pub fn tag(&self, name: impl Into<String>) -> GitRef {
6796        let mut query = self.selection.select("tag");
6797        query = query.arg("name", name.into());
6798        GitRef {
6799            proc: self.proc.clone(),
6800            selection: query,
6801            graphql_client: self.graphql_client.clone(),
6802        }
6803    }
6804    /// tags that match any of the given glob patterns.
6805    ///
6806    /// # Arguments
6807    ///
6808    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6809    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
6810        let query = self.selection.select("tags");
6811        query.execute(self.graphql_client.clone()).await
6812    }
6813    /// tags that match any of the given glob patterns.
6814    ///
6815    /// # Arguments
6816    ///
6817    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6818    pub async fn tags_opts<'a>(
6819        &self,
6820        opts: GitRepositoryTagsOpts<'a>,
6821    ) -> Result<Vec<String>, DaggerError> {
6822        let mut query = self.selection.select("tags");
6823        if let Some(patterns) = opts.patterns {
6824            query = query.arg("patterns", patterns);
6825        }
6826        query.execute(self.graphql_client.clone()).await
6827    }
6828    /// Header to authenticate the remote with.
6829    ///
6830    /// # Arguments
6831    ///
6832    /// * `header` - Secret used to populate the Authorization HTTP header
6833    pub fn with_auth_header(&self, header: impl IntoID<SecretId>) -> GitRepository {
6834        let mut query = self.selection.select("withAuthHeader");
6835        query = query.arg_lazy(
6836            "header",
6837            Box::new(move || {
6838                let header = header.clone();
6839                Box::pin(async move { header.into_id().await.unwrap().quote() })
6840            }),
6841        );
6842        GitRepository {
6843            proc: self.proc.clone(),
6844            selection: query,
6845            graphql_client: self.graphql_client.clone(),
6846        }
6847    }
6848    /// Token to authenticate the remote with.
6849    ///
6850    /// # Arguments
6851    ///
6852    /// * `token` - Secret used to populate the password during basic HTTP Authorization
6853    pub fn with_auth_token(&self, token: impl IntoID<SecretId>) -> GitRepository {
6854        let mut query = self.selection.select("withAuthToken");
6855        query = query.arg_lazy(
6856            "token",
6857            Box::new(move || {
6858                let token = token.clone();
6859                Box::pin(async move { token.into_id().await.unwrap().quote() })
6860            }),
6861        );
6862        GitRepository {
6863            proc: self.proc.clone(),
6864            selection: query,
6865            graphql_client: self.graphql_client.clone(),
6866        }
6867    }
6868}
6869#[derive(Clone)]
6870pub struct Host {
6871    pub proc: Option<Arc<DaggerSessionProc>>,
6872    pub selection: Selection,
6873    pub graphql_client: DynGraphQLClient,
6874}
6875#[derive(Builder, Debug, PartialEq)]
6876pub struct HostDirectoryOpts<'a> {
6877    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
6878    #[builder(setter(into, strip_option), default)]
6879    pub exclude: Option<Vec<&'a str>>,
6880    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
6881    #[builder(setter(into, strip_option), default)]
6882    pub include: Option<Vec<&'a str>>,
6883}
6884#[derive(Builder, Debug, PartialEq)]
6885pub struct HostServiceOpts<'a> {
6886    /// Upstream host to forward traffic to.
6887    #[builder(setter(into, strip_option), default)]
6888    pub host: Option<&'a str>,
6889}
6890#[derive(Builder, Debug, PartialEq)]
6891pub struct HostTunnelOpts {
6892    /// Map each service port to the same port on the host, as if the service were running natively.
6893    /// Note: enabling may result in port conflicts.
6894    #[builder(setter(into, strip_option), default)]
6895    pub native: Option<bool>,
6896    /// Configure explicit port forwarding rules for the tunnel.
6897    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
6898    /// 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.
6899    /// If ports are given and native is true, the ports are additive.
6900    #[builder(setter(into, strip_option), default)]
6901    pub ports: Option<Vec<PortForward>>,
6902}
6903impl Host {
6904    /// Accesses a directory on the host.
6905    ///
6906    /// # Arguments
6907    ///
6908    /// * `path` - Location of the directory to access (e.g., ".").
6909    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6910    pub fn directory(&self, path: impl Into<String>) -> Directory {
6911        let mut query = self.selection.select("directory");
6912        query = query.arg("path", path.into());
6913        Directory {
6914            proc: self.proc.clone(),
6915            selection: query,
6916            graphql_client: self.graphql_client.clone(),
6917        }
6918    }
6919    /// Accesses a directory on the host.
6920    ///
6921    /// # Arguments
6922    ///
6923    /// * `path` - Location of the directory to access (e.g., ".").
6924    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6925    pub fn directory_opts<'a>(
6926        &self,
6927        path: impl Into<String>,
6928        opts: HostDirectoryOpts<'a>,
6929    ) -> Directory {
6930        let mut query = self.selection.select("directory");
6931        query = query.arg("path", path.into());
6932        if let Some(exclude) = opts.exclude {
6933            query = query.arg("exclude", exclude);
6934        }
6935        if let Some(include) = opts.include {
6936            query = query.arg("include", include);
6937        }
6938        Directory {
6939            proc: self.proc.clone(),
6940            selection: query,
6941            graphql_client: self.graphql_client.clone(),
6942        }
6943    }
6944    /// Accesses a file on the host.
6945    ///
6946    /// # Arguments
6947    ///
6948    /// * `path` - Location of the file to retrieve (e.g., "README.md").
6949    pub fn file(&self, path: impl Into<String>) -> File {
6950        let mut query = self.selection.select("file");
6951        query = query.arg("path", path.into());
6952        File {
6953            proc: self.proc.clone(),
6954            selection: query,
6955            graphql_client: self.graphql_client.clone(),
6956        }
6957    }
6958    /// A unique identifier for this Host.
6959    pub async fn id(&self) -> Result<HostId, DaggerError> {
6960        let query = self.selection.select("id");
6961        query.execute(self.graphql_client.clone()).await
6962    }
6963    /// Creates a service that forwards traffic to a specified address via the host.
6964    ///
6965    /// # Arguments
6966    ///
6967    /// * `ports` - Ports to expose via the service, forwarding through the host network.
6968    ///
6969    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
6970    ///
6971    /// An empty set of ports is not valid; an error will be returned.
6972    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6973    pub fn service(&self, ports: Vec<PortForward>) -> Service {
6974        let mut query = self.selection.select("service");
6975        query = query.arg("ports", ports);
6976        Service {
6977            proc: self.proc.clone(),
6978            selection: query,
6979            graphql_client: self.graphql_client.clone(),
6980        }
6981    }
6982    /// Creates a service that forwards traffic to a specified address via the host.
6983    ///
6984    /// # Arguments
6985    ///
6986    /// * `ports` - Ports to expose via the service, forwarding through the host network.
6987    ///
6988    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
6989    ///
6990    /// An empty set of ports is not valid; an error will be returned.
6991    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6992    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
6993        let mut query = self.selection.select("service");
6994        query = query.arg("ports", ports);
6995        if let Some(host) = opts.host {
6996            query = query.arg("host", host);
6997        }
6998        Service {
6999            proc: self.proc.clone(),
7000            selection: query,
7001            graphql_client: self.graphql_client.clone(),
7002        }
7003    }
7004    /// Sets a secret given a user-defined name and the file path on the host, and returns the secret.
7005    /// The file is limited to a size of 512000 bytes.
7006    ///
7007    /// # Arguments
7008    ///
7009    /// * `name` - The user defined name for this secret.
7010    /// * `path` - Location of the file to set as a secret.
7011    pub fn set_secret_file(&self, name: impl Into<String>, path: impl Into<String>) -> Secret {
7012        let mut query = self.selection.select("setSecretFile");
7013        query = query.arg("name", name.into());
7014        query = query.arg("path", path.into());
7015        Secret {
7016            proc: self.proc.clone(),
7017            selection: query,
7018            graphql_client: self.graphql_client.clone(),
7019        }
7020    }
7021    /// Creates a tunnel that forwards traffic from the host to a service.
7022    ///
7023    /// # Arguments
7024    ///
7025    /// * `service` - Service to send traffic from the tunnel.
7026    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7027    pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
7028        let mut query = self.selection.select("tunnel");
7029        query = query.arg_lazy(
7030            "service",
7031            Box::new(move || {
7032                let service = service.clone();
7033                Box::pin(async move { service.into_id().await.unwrap().quote() })
7034            }),
7035        );
7036        Service {
7037            proc: self.proc.clone(),
7038            selection: query,
7039            graphql_client: self.graphql_client.clone(),
7040        }
7041    }
7042    /// Creates a tunnel that forwards traffic from the host to a service.
7043    ///
7044    /// # Arguments
7045    ///
7046    /// * `service` - Service to send traffic from the tunnel.
7047    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7048    pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
7049        let mut query = self.selection.select("tunnel");
7050        query = query.arg_lazy(
7051            "service",
7052            Box::new(move || {
7053                let service = service.clone();
7054                Box::pin(async move { service.into_id().await.unwrap().quote() })
7055            }),
7056        );
7057        if let Some(native) = opts.native {
7058            query = query.arg("native", native);
7059        }
7060        if let Some(ports) = opts.ports {
7061            query = query.arg("ports", ports);
7062        }
7063        Service {
7064            proc: self.proc.clone(),
7065            selection: query,
7066            graphql_client: self.graphql_client.clone(),
7067        }
7068    }
7069    /// Accesses a Unix socket on the host.
7070    ///
7071    /// # Arguments
7072    ///
7073    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
7074    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
7075        let mut query = self.selection.select("unixSocket");
7076        query = query.arg("path", path.into());
7077        Socket {
7078            proc: self.proc.clone(),
7079            selection: query,
7080            graphql_client: self.graphql_client.clone(),
7081        }
7082    }
7083}
7084#[derive(Clone)]
7085pub struct InputTypeDef {
7086    pub proc: Option<Arc<DaggerSessionProc>>,
7087    pub selection: Selection,
7088    pub graphql_client: DynGraphQLClient,
7089}
7090impl InputTypeDef {
7091    /// Static fields defined on this input object, if any.
7092    pub fn fields(&self) -> Vec<FieldTypeDef> {
7093        let query = self.selection.select("fields");
7094        vec![FieldTypeDef {
7095            proc: self.proc.clone(),
7096            selection: query,
7097            graphql_client: self.graphql_client.clone(),
7098        }]
7099    }
7100    /// A unique identifier for this InputTypeDef.
7101    pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
7102        let query = self.selection.select("id");
7103        query.execute(self.graphql_client.clone()).await
7104    }
7105    /// The name of the input object.
7106    pub async fn name(&self) -> Result<String, DaggerError> {
7107        let query = self.selection.select("name");
7108        query.execute(self.graphql_client.clone()).await
7109    }
7110}
7111#[derive(Clone)]
7112pub struct InterfaceTypeDef {
7113    pub proc: Option<Arc<DaggerSessionProc>>,
7114    pub selection: Selection,
7115    pub graphql_client: DynGraphQLClient,
7116}
7117impl InterfaceTypeDef {
7118    /// The doc string for the interface, if any.
7119    pub async fn description(&self) -> Result<String, DaggerError> {
7120        let query = self.selection.select("description");
7121        query.execute(self.graphql_client.clone()).await
7122    }
7123    /// Functions defined on this interface, if any.
7124    pub fn functions(&self) -> Vec<Function> {
7125        let query = self.selection.select("functions");
7126        vec![Function {
7127            proc: self.proc.clone(),
7128            selection: query,
7129            graphql_client: self.graphql_client.clone(),
7130        }]
7131    }
7132    /// A unique identifier for this InterfaceTypeDef.
7133    pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
7134        let query = self.selection.select("id");
7135        query.execute(self.graphql_client.clone()).await
7136    }
7137    /// The name of the interface.
7138    pub async fn name(&self) -> Result<String, DaggerError> {
7139        let query = self.selection.select("name");
7140        query.execute(self.graphql_client.clone()).await
7141    }
7142    /// The location of this interface declaration.
7143    pub fn source_map(&self) -> SourceMap {
7144        let query = self.selection.select("sourceMap");
7145        SourceMap {
7146            proc: self.proc.clone(),
7147            selection: query,
7148            graphql_client: self.graphql_client.clone(),
7149        }
7150    }
7151    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
7152    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
7153        let query = self.selection.select("sourceModuleName");
7154        query.execute(self.graphql_client.clone()).await
7155    }
7156}
7157#[derive(Clone)]
7158pub struct Llm {
7159    pub proc: Option<Arc<DaggerSessionProc>>,
7160    pub selection: Selection,
7161    pub graphql_client: DynGraphQLClient,
7162}
7163impl Llm {
7164    /// create a branch in the LLM's history
7165    pub fn attempt(&self, number: isize) -> Llm {
7166        let mut query = self.selection.select("attempt");
7167        query = query.arg("number", number);
7168        Llm {
7169            proc: self.proc.clone(),
7170            selection: query,
7171            graphql_client: self.graphql_client.clone(),
7172        }
7173    }
7174    /// returns the type of the current state
7175    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
7176        let mut query = self.selection.select("bindResult");
7177        query = query.arg("name", name.into());
7178        Binding {
7179            proc: self.proc.clone(),
7180            selection: query,
7181            graphql_client: self.graphql_client.clone(),
7182        }
7183    }
7184    /// return the LLM's current environment
7185    pub fn env(&self) -> Env {
7186        let query = self.selection.select("env");
7187        Env {
7188            proc: self.proc.clone(),
7189            selection: query,
7190            graphql_client: self.graphql_client.clone(),
7191        }
7192    }
7193    /// return the llm message history
7194    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
7195        let query = self.selection.select("history");
7196        query.execute(self.graphql_client.clone()).await
7197    }
7198    /// return the raw llm message history as json
7199    pub async fn history_json(&self) -> Result<Json, DaggerError> {
7200        let query = self.selection.select("historyJSON");
7201        query.execute(self.graphql_client.clone()).await
7202    }
7203    /// A unique identifier for this LLM.
7204    pub async fn id(&self) -> Result<Llmid, DaggerError> {
7205        let query = self.selection.select("id");
7206        query.execute(self.graphql_client.clone()).await
7207    }
7208    /// return the last llm reply from the history
7209    pub async fn last_reply(&self) -> Result<String, DaggerError> {
7210        let query = self.selection.select("lastReply");
7211        query.execute(self.graphql_client.clone()).await
7212    }
7213    /// synchronize LLM state
7214    pub fn r#loop(&self) -> Llm {
7215        let query = self.selection.select("loop");
7216        Llm {
7217            proc: self.proc.clone(),
7218            selection: query,
7219            graphql_client: self.graphql_client.clone(),
7220        }
7221    }
7222    /// return the model used by the llm
7223    pub async fn model(&self) -> Result<String, DaggerError> {
7224        let query = self.selection.select("model");
7225        query.execute(self.graphql_client.clone()).await
7226    }
7227    /// return the provider used by the llm
7228    pub async fn provider(&self) -> Result<String, DaggerError> {
7229        let query = self.selection.select("provider");
7230        query.execute(self.graphql_client.clone()).await
7231    }
7232    /// synchronize LLM state
7233    pub async fn sync(&self) -> Result<Llmid, DaggerError> {
7234        let query = self.selection.select("sync");
7235        query.execute(self.graphql_client.clone()).await
7236    }
7237    /// returns the token usage of the current state
7238    pub fn token_usage(&self) -> LlmTokenUsage {
7239        let query = self.selection.select("tokenUsage");
7240        LlmTokenUsage {
7241            proc: self.proc.clone(),
7242            selection: query,
7243            graphql_client: self.graphql_client.clone(),
7244        }
7245    }
7246    /// print documentation for available tools
7247    pub async fn tools(&self) -> Result<String, DaggerError> {
7248        let query = self.selection.select("tools");
7249        query.execute(self.graphql_client.clone()).await
7250    }
7251    /// allow the LLM to interact with an environment via MCP
7252    pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
7253        let mut query = self.selection.select("withEnv");
7254        query = query.arg_lazy(
7255            "env",
7256            Box::new(move || {
7257                let env = env.clone();
7258                Box::pin(async move { env.into_id().await.unwrap().quote() })
7259            }),
7260        );
7261        Llm {
7262            proc: self.proc.clone(),
7263            selection: query,
7264            graphql_client: self.graphql_client.clone(),
7265        }
7266    }
7267    /// swap out the llm model
7268    ///
7269    /// # Arguments
7270    ///
7271    /// * `model` - The model to use
7272    pub fn with_model(&self, model: impl Into<String>) -> Llm {
7273        let mut query = self.selection.select("withModel");
7274        query = query.arg("model", model.into());
7275        Llm {
7276            proc: self.proc.clone(),
7277            selection: query,
7278            graphql_client: self.graphql_client.clone(),
7279        }
7280    }
7281    /// append a prompt to the llm context
7282    ///
7283    /// # Arguments
7284    ///
7285    /// * `prompt` - The prompt to send
7286    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
7287        let mut query = self.selection.select("withPrompt");
7288        query = query.arg("prompt", prompt.into());
7289        Llm {
7290            proc: self.proc.clone(),
7291            selection: query,
7292            graphql_client: self.graphql_client.clone(),
7293        }
7294    }
7295    /// append the contents of a file to the llm context
7296    ///
7297    /// # Arguments
7298    ///
7299    /// * `file` - The file to read the prompt from
7300    pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
7301        let mut query = self.selection.select("withPromptFile");
7302        query = query.arg_lazy(
7303            "file",
7304            Box::new(move || {
7305                let file = file.clone();
7306                Box::pin(async move { file.into_id().await.unwrap().quote() })
7307            }),
7308        );
7309        Llm {
7310            proc: self.proc.clone(),
7311            selection: query,
7312            graphql_client: self.graphql_client.clone(),
7313        }
7314    }
7315    /// Add a system prompt to the LLM's environment
7316    ///
7317    /// # Arguments
7318    ///
7319    /// * `prompt` - The system prompt to send
7320    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
7321        let mut query = self.selection.select("withSystemPrompt");
7322        query = query.arg("prompt", prompt.into());
7323        Llm {
7324            proc: self.proc.clone(),
7325            selection: query,
7326            graphql_client: self.graphql_client.clone(),
7327        }
7328    }
7329    /// Disable the default system prompt
7330    pub fn without_default_system_prompt(&self) -> Llm {
7331        let query = self.selection.select("withoutDefaultSystemPrompt");
7332        Llm {
7333            proc: self.proc.clone(),
7334            selection: query,
7335            graphql_client: self.graphql_client.clone(),
7336        }
7337    }
7338}
7339#[derive(Clone)]
7340pub struct LlmTokenUsage {
7341    pub proc: Option<Arc<DaggerSessionProc>>,
7342    pub selection: Selection,
7343    pub graphql_client: DynGraphQLClient,
7344}
7345impl LlmTokenUsage {
7346    /// A unique identifier for this LLMTokenUsage.
7347    pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
7348        let query = self.selection.select("id");
7349        query.execute(self.graphql_client.clone()).await
7350    }
7351    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
7352        let query = self.selection.select("inputTokens");
7353        query.execute(self.graphql_client.clone()).await
7354    }
7355    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
7356        let query = self.selection.select("outputTokens");
7357        query.execute(self.graphql_client.clone()).await
7358    }
7359    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
7360        let query = self.selection.select("totalTokens");
7361        query.execute(self.graphql_client.clone()).await
7362    }
7363}
7364#[derive(Clone)]
7365pub struct Label {
7366    pub proc: Option<Arc<DaggerSessionProc>>,
7367    pub selection: Selection,
7368    pub graphql_client: DynGraphQLClient,
7369}
7370impl Label {
7371    /// A unique identifier for this Label.
7372    pub async fn id(&self) -> Result<LabelId, DaggerError> {
7373        let query = self.selection.select("id");
7374        query.execute(self.graphql_client.clone()).await
7375    }
7376    /// The label name.
7377    pub async fn name(&self) -> Result<String, DaggerError> {
7378        let query = self.selection.select("name");
7379        query.execute(self.graphql_client.clone()).await
7380    }
7381    /// The label value.
7382    pub async fn value(&self) -> Result<String, DaggerError> {
7383        let query = self.selection.select("value");
7384        query.execute(self.graphql_client.clone()).await
7385    }
7386}
7387#[derive(Clone)]
7388pub struct ListTypeDef {
7389    pub proc: Option<Arc<DaggerSessionProc>>,
7390    pub selection: Selection,
7391    pub graphql_client: DynGraphQLClient,
7392}
7393impl ListTypeDef {
7394    /// The type of the elements in the list.
7395    pub fn element_type_def(&self) -> TypeDef {
7396        let query = self.selection.select("elementTypeDef");
7397        TypeDef {
7398            proc: self.proc.clone(),
7399            selection: query,
7400            graphql_client: self.graphql_client.clone(),
7401        }
7402    }
7403    /// A unique identifier for this ListTypeDef.
7404    pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
7405        let query = self.selection.select("id");
7406        query.execute(self.graphql_client.clone()).await
7407    }
7408}
7409#[derive(Clone)]
7410pub struct Module {
7411    pub proc: Option<Arc<DaggerSessionProc>>,
7412    pub selection: Selection,
7413    pub graphql_client: DynGraphQLClient,
7414}
7415#[derive(Builder, Debug, PartialEq)]
7416pub struct ModuleServeOpts {
7417    /// Expose the dependencies of this module to the client
7418    #[builder(setter(into, strip_option), default)]
7419    pub include_dependencies: Option<bool>,
7420}
7421impl Module {
7422    /// The dependencies of the module.
7423    pub fn dependencies(&self) -> Vec<Module> {
7424        let query = self.selection.select("dependencies");
7425        vec![Module {
7426            proc: self.proc.clone(),
7427            selection: query,
7428            graphql_client: self.graphql_client.clone(),
7429        }]
7430    }
7431    /// The doc string of the module, if any
7432    pub async fn description(&self) -> Result<String, DaggerError> {
7433        let query = self.selection.select("description");
7434        query.execute(self.graphql_client.clone()).await
7435    }
7436    /// Enumerations served by this module.
7437    pub fn enums(&self) -> Vec<TypeDef> {
7438        let query = self.selection.select("enums");
7439        vec![TypeDef {
7440            proc: self.proc.clone(),
7441            selection: query,
7442            graphql_client: self.graphql_client.clone(),
7443        }]
7444    }
7445    /// The generated files and directories made on top of the module source's context directory.
7446    pub fn generated_context_directory(&self) -> Directory {
7447        let query = self.selection.select("generatedContextDirectory");
7448        Directory {
7449            proc: self.proc.clone(),
7450            selection: query,
7451            graphql_client: self.graphql_client.clone(),
7452        }
7453    }
7454    /// A unique identifier for this Module.
7455    pub async fn id(&self) -> Result<ModuleId, DaggerError> {
7456        let query = self.selection.select("id");
7457        query.execute(self.graphql_client.clone()).await
7458    }
7459    /// Interfaces served by this module.
7460    pub fn interfaces(&self) -> Vec<TypeDef> {
7461        let query = self.selection.select("interfaces");
7462        vec![TypeDef {
7463            proc: self.proc.clone(),
7464            selection: query,
7465            graphql_client: self.graphql_client.clone(),
7466        }]
7467    }
7468    /// The name of the module
7469    pub async fn name(&self) -> Result<String, DaggerError> {
7470        let query = self.selection.select("name");
7471        query.execute(self.graphql_client.clone()).await
7472    }
7473    /// Objects served by this module.
7474    pub fn objects(&self) -> Vec<TypeDef> {
7475        let query = self.selection.select("objects");
7476        vec![TypeDef {
7477            proc: self.proc.clone(),
7478            selection: query,
7479            graphql_client: self.graphql_client.clone(),
7480        }]
7481    }
7482    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
7483    pub fn runtime(&self) -> Container {
7484        let query = self.selection.select("runtime");
7485        Container {
7486            proc: self.proc.clone(),
7487            selection: query,
7488            graphql_client: self.graphql_client.clone(),
7489        }
7490    }
7491    /// The SDK config used by this module.
7492    pub fn sdk(&self) -> SdkConfig {
7493        let query = self.selection.select("sdk");
7494        SdkConfig {
7495            proc: self.proc.clone(),
7496            selection: query,
7497            graphql_client: self.graphql_client.clone(),
7498        }
7499    }
7500    /// Serve a module's API in the current session.
7501    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
7502    ///
7503    /// # Arguments
7504    ///
7505    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7506    pub async fn serve(&self) -> Result<Void, DaggerError> {
7507        let query = self.selection.select("serve");
7508        query.execute(self.graphql_client.clone()).await
7509    }
7510    /// Serve a module's API in the current session.
7511    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
7512    ///
7513    /// # Arguments
7514    ///
7515    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7516    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
7517        let mut query = self.selection.select("serve");
7518        if let Some(include_dependencies) = opts.include_dependencies {
7519            query = query.arg("includeDependencies", include_dependencies);
7520        }
7521        query.execute(self.graphql_client.clone()).await
7522    }
7523    /// The source for the module.
7524    pub fn source(&self) -> ModuleSource {
7525        let query = self.selection.select("source");
7526        ModuleSource {
7527            proc: self.proc.clone(),
7528            selection: query,
7529            graphql_client: self.graphql_client.clone(),
7530        }
7531    }
7532    /// Forces evaluation of the module, including any loading into the engine and associated validation.
7533    pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
7534        let query = self.selection.select("sync");
7535        query.execute(self.graphql_client.clone()).await
7536    }
7537    /// Retrieves the module with the given description
7538    ///
7539    /// # Arguments
7540    ///
7541    /// * `description` - The description to set
7542    pub fn with_description(&self, description: impl Into<String>) -> Module {
7543        let mut query = self.selection.select("withDescription");
7544        query = query.arg("description", description.into());
7545        Module {
7546            proc: self.proc.clone(),
7547            selection: query,
7548            graphql_client: self.graphql_client.clone(),
7549        }
7550    }
7551    /// This module plus the given Enum type and associated values
7552    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
7553        let mut query = self.selection.select("withEnum");
7554        query = query.arg_lazy(
7555            "enum",
7556            Box::new(move || {
7557                let r#enum = r#enum.clone();
7558                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
7559            }),
7560        );
7561        Module {
7562            proc: self.proc.clone(),
7563            selection: query,
7564            graphql_client: self.graphql_client.clone(),
7565        }
7566    }
7567    /// This module plus the given Interface type and associated functions
7568    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
7569        let mut query = self.selection.select("withInterface");
7570        query = query.arg_lazy(
7571            "iface",
7572            Box::new(move || {
7573                let iface = iface.clone();
7574                Box::pin(async move { iface.into_id().await.unwrap().quote() })
7575            }),
7576        );
7577        Module {
7578            proc: self.proc.clone(),
7579            selection: query,
7580            graphql_client: self.graphql_client.clone(),
7581        }
7582    }
7583    /// This module plus the given Object type and associated functions.
7584    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
7585        let mut query = self.selection.select("withObject");
7586        query = query.arg_lazy(
7587            "object",
7588            Box::new(move || {
7589                let object = object.clone();
7590                Box::pin(async move { object.into_id().await.unwrap().quote() })
7591            }),
7592        );
7593        Module {
7594            proc: self.proc.clone(),
7595            selection: query,
7596            graphql_client: self.graphql_client.clone(),
7597        }
7598    }
7599}
7600#[derive(Clone)]
7601pub struct ModuleConfigClient {
7602    pub proc: Option<Arc<DaggerSessionProc>>,
7603    pub selection: Selection,
7604    pub graphql_client: DynGraphQLClient,
7605}
7606impl ModuleConfigClient {
7607    /// If true, generate the client in developer mode.
7608    pub async fn dev(&self) -> Result<bool, DaggerError> {
7609        let query = self.selection.select("dev");
7610        query.execute(self.graphql_client.clone()).await
7611    }
7612    /// The directory the client is generated in.
7613    pub async fn directory(&self) -> Result<String, DaggerError> {
7614        let query = self.selection.select("directory");
7615        query.execute(self.graphql_client.clone()).await
7616    }
7617    /// The generator to use
7618    pub async fn generator(&self) -> Result<String, DaggerError> {
7619        let query = self.selection.select("generator");
7620        query.execute(self.graphql_client.clone()).await
7621    }
7622    /// A unique identifier for this ModuleConfigClient.
7623    pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
7624        let query = self.selection.select("id");
7625        query.execute(self.graphql_client.clone()).await
7626    }
7627}
7628#[derive(Clone)]
7629pub struct ModuleSource {
7630    pub proc: Option<Arc<DaggerSessionProc>>,
7631    pub selection: Selection,
7632    pub graphql_client: DynGraphQLClient,
7633}
7634#[derive(Builder, Debug, PartialEq)]
7635pub struct ModuleSourceWithClientOpts {
7636    /// Generate in developer mode
7637    #[builder(setter(into, strip_option), default)]
7638    pub dev: Option<bool>,
7639}
7640impl ModuleSource {
7641    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
7642    pub fn as_module(&self) -> Module {
7643        let query = self.selection.select("asModule");
7644        Module {
7645            proc: self.proc.clone(),
7646            selection: query,
7647            graphql_client: self.graphql_client.clone(),
7648        }
7649    }
7650    /// A human readable ref string representation of this module source.
7651    pub async fn as_string(&self) -> Result<String, DaggerError> {
7652        let query = self.selection.select("asString");
7653        query.execute(self.graphql_client.clone()).await
7654    }
7655    /// The ref to clone the root of the git repo from. Only valid for git sources.
7656    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
7657        let query = self.selection.select("cloneRef");
7658        query.execute(self.graphql_client.clone()).await
7659    }
7660    /// The resolved commit of the git repo this source points to.
7661    pub async fn commit(&self) -> Result<String, DaggerError> {
7662        let query = self.selection.select("commit");
7663        query.execute(self.graphql_client.clone()).await
7664    }
7665    /// The clients generated for the module.
7666    pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
7667        let query = self.selection.select("configClients");
7668        vec![ModuleConfigClient {
7669            proc: self.proc.clone(),
7670            selection: query,
7671            graphql_client: self.graphql_client.clone(),
7672        }]
7673    }
7674    /// Whether an existing dagger.json for the module was found.
7675    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
7676        let query = self.selection.select("configExists");
7677        query.execute(self.graphql_client.clone()).await
7678    }
7679    /// The full directory loaded for the module source, including the source code as a subdirectory.
7680    pub fn context_directory(&self) -> Directory {
7681        let query = self.selection.select("contextDirectory");
7682        Directory {
7683            proc: self.proc.clone(),
7684            selection: query,
7685            graphql_client: self.graphql_client.clone(),
7686        }
7687    }
7688    /// The dependencies of the module source.
7689    pub fn dependencies(&self) -> Vec<ModuleSource> {
7690        let query = self.selection.select("dependencies");
7691        vec![ModuleSource {
7692            proc: self.proc.clone(),
7693            selection: query,
7694            graphql_client: self.graphql_client.clone(),
7695        }]
7696    }
7697    /// 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.
7698    pub async fn digest(&self) -> Result<String, DaggerError> {
7699        let query = self.selection.select("digest");
7700        query.execute(self.graphql_client.clone()).await
7701    }
7702    /// The directory containing the module configuration and source code (source code may be in a subdir).
7703    ///
7704    /// # Arguments
7705    ///
7706    /// * `path` - A subpath from the source directory to select.
7707    pub fn directory(&self, path: impl Into<String>) -> Directory {
7708        let mut query = self.selection.select("directory");
7709        query = query.arg("path", path.into());
7710        Directory {
7711            proc: self.proc.clone(),
7712            selection: query,
7713            graphql_client: self.graphql_client.clone(),
7714        }
7715    }
7716    /// The engine version of the module.
7717    pub async fn engine_version(&self) -> Result<String, DaggerError> {
7718        let query = self.selection.select("engineVersion");
7719        query.execute(self.graphql_client.clone()).await
7720    }
7721    /// The generated files and directories made on top of the module source's context directory.
7722    pub fn generated_context_directory(&self) -> Directory {
7723        let query = self.selection.select("generatedContextDirectory");
7724        Directory {
7725            proc: self.proc.clone(),
7726            selection: query,
7727            graphql_client: self.graphql_client.clone(),
7728        }
7729    }
7730    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
7731    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
7732        let query = self.selection.select("htmlRepoURL");
7733        query.execute(self.graphql_client.clone()).await
7734    }
7735    /// The URL to the source's git repo in a web browser. Only valid for git sources.
7736    pub async fn html_url(&self) -> Result<String, DaggerError> {
7737        let query = self.selection.select("htmlURL");
7738        query.execute(self.graphql_client.clone()).await
7739    }
7740    /// A unique identifier for this ModuleSource.
7741    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
7742        let query = self.selection.select("id");
7743        query.execute(self.graphql_client.clone()).await
7744    }
7745    /// The kind of module source (currently local, git or dir).
7746    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
7747        let query = self.selection.select("kind");
7748        query.execute(self.graphql_client.clone()).await
7749    }
7750    /// 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.
7751    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
7752        let query = self.selection.select("localContextDirectoryPath");
7753        query.execute(self.graphql_client.clone()).await
7754    }
7755    /// The name of the module, including any setting via the withName API.
7756    pub async fn module_name(&self) -> Result<String, DaggerError> {
7757        let query = self.selection.select("moduleName");
7758        query.execute(self.graphql_client.clone()).await
7759    }
7760    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
7761    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
7762        let query = self.selection.select("moduleOriginalName");
7763        query.execute(self.graphql_client.clone()).await
7764    }
7765    /// The original subpath used when instantiating this module source, relative to the context directory.
7766    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
7767        let query = self.selection.select("originalSubpath");
7768        query.execute(self.graphql_client.clone()).await
7769    }
7770    /// The pinned version of this module source.
7771    pub async fn pin(&self) -> Result<String, DaggerError> {
7772        let query = self.selection.select("pin");
7773        query.execute(self.graphql_client.clone()).await
7774    }
7775    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
7776    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
7777        let query = self.selection.select("repoRootPath");
7778        query.execute(self.graphql_client.clone()).await
7779    }
7780    /// The SDK configuration of the module.
7781    pub fn sdk(&self) -> SdkConfig {
7782        let query = self.selection.select("sdk");
7783        SdkConfig {
7784            proc: self.proc.clone(),
7785            selection: query,
7786            graphql_client: self.graphql_client.clone(),
7787        }
7788    }
7789    /// The path, relative to the context directory, that contains the module's dagger.json.
7790    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
7791        let query = self.selection.select("sourceRootSubpath");
7792        query.execute(self.graphql_client.clone()).await
7793    }
7794    /// The path to the directory containing the module's source code, relative to the context directory.
7795    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
7796        let query = self.selection.select("sourceSubpath");
7797        query.execute(self.graphql_client.clone()).await
7798    }
7799    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
7800    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
7801        let query = self.selection.select("sync");
7802        query.execute(self.graphql_client.clone()).await
7803    }
7804    /// The specified version of the git repo this source points to.
7805    pub async fn version(&self) -> Result<String, DaggerError> {
7806        let query = self.selection.select("version");
7807        query.execute(self.graphql_client.clone()).await
7808    }
7809    /// Update the module source with a new client to generate.
7810    ///
7811    /// # Arguments
7812    ///
7813    /// * `generator` - The generator to use
7814    /// * `output_dir` - The output directory for the generated client.
7815    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7816    pub fn with_client(
7817        &self,
7818        generator: impl Into<String>,
7819        output_dir: impl Into<String>,
7820    ) -> ModuleSource {
7821        let mut query = self.selection.select("withClient");
7822        query = query.arg("generator", generator.into());
7823        query = query.arg("outputDir", output_dir.into());
7824        ModuleSource {
7825            proc: self.proc.clone(),
7826            selection: query,
7827            graphql_client: self.graphql_client.clone(),
7828        }
7829    }
7830    /// Update the module source with a new client to generate.
7831    ///
7832    /// # Arguments
7833    ///
7834    /// * `generator` - The generator to use
7835    /// * `output_dir` - The output directory for the generated client.
7836    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7837    pub fn with_client_opts(
7838        &self,
7839        generator: impl Into<String>,
7840        output_dir: impl Into<String>,
7841        opts: ModuleSourceWithClientOpts,
7842    ) -> ModuleSource {
7843        let mut query = self.selection.select("withClient");
7844        query = query.arg("generator", generator.into());
7845        query = query.arg("outputDir", output_dir.into());
7846        if let Some(dev) = opts.dev {
7847            query = query.arg("dev", dev);
7848        }
7849        ModuleSource {
7850            proc: self.proc.clone(),
7851            selection: query,
7852            graphql_client: self.graphql_client.clone(),
7853        }
7854    }
7855    /// Append the provided dependencies to the module source's dependency list.
7856    ///
7857    /// # Arguments
7858    ///
7859    /// * `dependencies` - The dependencies to append.
7860    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
7861        let mut query = self.selection.select("withDependencies");
7862        query = query.arg("dependencies", dependencies);
7863        ModuleSource {
7864            proc: self.proc.clone(),
7865            selection: query,
7866            graphql_client: self.graphql_client.clone(),
7867        }
7868    }
7869    /// Upgrade the engine version of the module to the given value.
7870    ///
7871    /// # Arguments
7872    ///
7873    /// * `version` - The engine version to upgrade to.
7874    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
7875        let mut query = self.selection.select("withEngineVersion");
7876        query = query.arg("version", version.into());
7877        ModuleSource {
7878            proc: self.proc.clone(),
7879            selection: query,
7880            graphql_client: self.graphql_client.clone(),
7881        }
7882    }
7883    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
7884    ///
7885    /// # Arguments
7886    ///
7887    /// * `patterns` - The new additional include patterns.
7888    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
7889        let mut query = self.selection.select("withIncludes");
7890        query = query.arg(
7891            "patterns",
7892            patterns
7893                .into_iter()
7894                .map(|i| i.into())
7895                .collect::<Vec<String>>(),
7896        );
7897        ModuleSource {
7898            proc: self.proc.clone(),
7899            selection: query,
7900            graphql_client: self.graphql_client.clone(),
7901        }
7902    }
7903    /// Update the module source with a new name.
7904    ///
7905    /// # Arguments
7906    ///
7907    /// * `name` - The name to set.
7908    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
7909        let mut query = self.selection.select("withName");
7910        query = query.arg("name", name.into());
7911        ModuleSource {
7912            proc: self.proc.clone(),
7913            selection: query,
7914            graphql_client: self.graphql_client.clone(),
7915        }
7916    }
7917    /// Update the module source with a new SDK.
7918    ///
7919    /// # Arguments
7920    ///
7921    /// * `source` - The SDK source to set.
7922    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
7923        let mut query = self.selection.select("withSDK");
7924        query = query.arg("source", source.into());
7925        ModuleSource {
7926            proc: self.proc.clone(),
7927            selection: query,
7928            graphql_client: self.graphql_client.clone(),
7929        }
7930    }
7931    /// Update the module source with a new source subpath.
7932    ///
7933    /// # Arguments
7934    ///
7935    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
7936    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
7937        let mut query = self.selection.select("withSourceSubpath");
7938        query = query.arg("path", path.into());
7939        ModuleSource {
7940            proc: self.proc.clone(),
7941            selection: query,
7942            graphql_client: self.graphql_client.clone(),
7943        }
7944    }
7945    /// Update one or more module dependencies.
7946    ///
7947    /// # Arguments
7948    ///
7949    /// * `dependencies` - The dependencies to update.
7950    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
7951        let mut query = self.selection.select("withUpdateDependencies");
7952        query = query.arg(
7953            "dependencies",
7954            dependencies
7955                .into_iter()
7956                .map(|i| i.into())
7957                .collect::<Vec<String>>(),
7958        );
7959        ModuleSource {
7960            proc: self.proc.clone(),
7961            selection: query,
7962            graphql_client: self.graphql_client.clone(),
7963        }
7964    }
7965    /// Remove a client from the module source.
7966    ///
7967    /// # Arguments
7968    ///
7969    /// * `path` - The path of the client to remove.
7970    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
7971        let mut query = self.selection.select("withoutClient");
7972        query = query.arg("path", path.into());
7973        ModuleSource {
7974            proc: self.proc.clone(),
7975            selection: query,
7976            graphql_client: self.graphql_client.clone(),
7977        }
7978    }
7979    /// Remove the provided dependencies from the module source's dependency list.
7980    ///
7981    /// # Arguments
7982    ///
7983    /// * `dependencies` - The dependencies to remove.
7984    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
7985        let mut query = self.selection.select("withoutDependencies");
7986        query = query.arg(
7987            "dependencies",
7988            dependencies
7989                .into_iter()
7990                .map(|i| i.into())
7991                .collect::<Vec<String>>(),
7992        );
7993        ModuleSource {
7994            proc: self.proc.clone(),
7995            selection: query,
7996            graphql_client: self.graphql_client.clone(),
7997        }
7998    }
7999}
8000#[derive(Clone)]
8001pub struct ObjectTypeDef {
8002    pub proc: Option<Arc<DaggerSessionProc>>,
8003    pub selection: Selection,
8004    pub graphql_client: DynGraphQLClient,
8005}
8006impl ObjectTypeDef {
8007    /// The function used to construct new instances of this object, if any
8008    pub fn constructor(&self) -> Function {
8009        let query = self.selection.select("constructor");
8010        Function {
8011            proc: self.proc.clone(),
8012            selection: query,
8013            graphql_client: self.graphql_client.clone(),
8014        }
8015    }
8016    /// The doc string for the object, if any.
8017    pub async fn description(&self) -> Result<String, DaggerError> {
8018        let query = self.selection.select("description");
8019        query.execute(self.graphql_client.clone()).await
8020    }
8021    /// Static fields defined on this object, if any.
8022    pub fn fields(&self) -> Vec<FieldTypeDef> {
8023        let query = self.selection.select("fields");
8024        vec![FieldTypeDef {
8025            proc: self.proc.clone(),
8026            selection: query,
8027            graphql_client: self.graphql_client.clone(),
8028        }]
8029    }
8030    /// Functions defined on this object, if any.
8031    pub fn functions(&self) -> Vec<Function> {
8032        let query = self.selection.select("functions");
8033        vec![Function {
8034            proc: self.proc.clone(),
8035            selection: query,
8036            graphql_client: self.graphql_client.clone(),
8037        }]
8038    }
8039    /// A unique identifier for this ObjectTypeDef.
8040    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
8041        let query = self.selection.select("id");
8042        query.execute(self.graphql_client.clone()).await
8043    }
8044    /// The name of the object.
8045    pub async fn name(&self) -> Result<String, DaggerError> {
8046        let query = self.selection.select("name");
8047        query.execute(self.graphql_client.clone()).await
8048    }
8049    /// The location of this object declaration.
8050    pub fn source_map(&self) -> SourceMap {
8051        let query = self.selection.select("sourceMap");
8052        SourceMap {
8053            proc: self.proc.clone(),
8054            selection: query,
8055            graphql_client: self.graphql_client.clone(),
8056        }
8057    }
8058    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
8059    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8060        let query = self.selection.select("sourceModuleName");
8061        query.execute(self.graphql_client.clone()).await
8062    }
8063}
8064#[derive(Clone)]
8065pub struct Port {
8066    pub proc: Option<Arc<DaggerSessionProc>>,
8067    pub selection: Selection,
8068    pub graphql_client: DynGraphQLClient,
8069}
8070impl Port {
8071    /// The port description.
8072    pub async fn description(&self) -> Result<String, DaggerError> {
8073        let query = self.selection.select("description");
8074        query.execute(self.graphql_client.clone()).await
8075    }
8076    /// Skip the health check when run as a service.
8077    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
8078        let query = self.selection.select("experimentalSkipHealthcheck");
8079        query.execute(self.graphql_client.clone()).await
8080    }
8081    /// A unique identifier for this Port.
8082    pub async fn id(&self) -> Result<PortId, DaggerError> {
8083        let query = self.selection.select("id");
8084        query.execute(self.graphql_client.clone()).await
8085    }
8086    /// The port number.
8087    pub async fn port(&self) -> Result<isize, DaggerError> {
8088        let query = self.selection.select("port");
8089        query.execute(self.graphql_client.clone()).await
8090    }
8091    /// The transport layer protocol.
8092    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
8093        let query = self.selection.select("protocol");
8094        query.execute(self.graphql_client.clone()).await
8095    }
8096}
8097#[derive(Clone)]
8098pub struct Query {
8099    pub proc: Option<Arc<DaggerSessionProc>>,
8100    pub selection: Selection,
8101    pub graphql_client: DynGraphQLClient,
8102}
8103#[derive(Builder, Debug, PartialEq)]
8104pub struct QueryCacheVolumeOpts<'a> {
8105    #[builder(setter(into, strip_option), default)]
8106    pub namespace: Option<&'a str>,
8107}
8108#[derive(Builder, Debug, PartialEq)]
8109pub struct QueryContainerOpts {
8110    /// Platform to initialize the container with. Defaults to the native platform of the current engine
8111    #[builder(setter(into, strip_option), default)]
8112    pub platform: Option<Platform>,
8113}
8114#[derive(Builder, Debug, PartialEq)]
8115pub struct QueryEnvOpts {
8116    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
8117    #[builder(setter(into, strip_option), default)]
8118    pub privileged: Option<bool>,
8119    /// Allow new outputs to be declared and saved in the environment
8120    #[builder(setter(into, strip_option), default)]
8121    pub writable: Option<bool>,
8122}
8123#[derive(Builder, Debug, PartialEq)]
8124pub struct QueryFileOpts {
8125    /// Permissions of the new file. Example: 0600
8126    #[builder(setter(into, strip_option), default)]
8127    pub permissions: Option<isize>,
8128}
8129#[derive(Builder, Debug, PartialEq)]
8130pub struct QueryGitOpts<'a> {
8131    /// A service which must be started before the repo is fetched.
8132    #[builder(setter(into, strip_option), default)]
8133    pub experimental_service_host: Option<ServiceId>,
8134    /// Secret used to populate the Authorization HTTP header
8135    #[builder(setter(into, strip_option), default)]
8136    pub http_auth_header: Option<SecretId>,
8137    /// Secret used to populate the password during basic HTTP Authorization
8138    #[builder(setter(into, strip_option), default)]
8139    pub http_auth_token: Option<SecretId>,
8140    /// DEPRECATED: Set to true to keep .git directory.
8141    #[builder(setter(into, strip_option), default)]
8142    pub keep_git_dir: Option<bool>,
8143    /// Set SSH auth socket
8144    #[builder(setter(into, strip_option), default)]
8145    pub ssh_auth_socket: Option<SocketId>,
8146    /// Set SSH known hosts
8147    #[builder(setter(into, strip_option), default)]
8148    pub ssh_known_hosts: Option<&'a str>,
8149}
8150#[derive(Builder, Debug, PartialEq)]
8151pub struct QueryHttpOpts {
8152    /// A service which must be started before the URL is fetched.
8153    #[builder(setter(into, strip_option), default)]
8154    pub experimental_service_host: Option<ServiceId>,
8155}
8156#[derive(Builder, Debug, PartialEq)]
8157pub struct QueryLlmOpts<'a> {
8158    /// Cap the number of API calls for this LLM
8159    #[builder(setter(into, strip_option), default)]
8160    pub max_api_calls: Option<isize>,
8161    /// Model to use
8162    #[builder(setter(into, strip_option), default)]
8163    pub model: Option<&'a str>,
8164}
8165#[derive(Builder, Debug, PartialEq)]
8166pub struct QueryModuleSourceOpts<'a> {
8167    /// 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.
8168    #[builder(setter(into, strip_option), default)]
8169    pub allow_not_exists: Option<bool>,
8170    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
8171    #[builder(setter(into, strip_option), default)]
8172    pub disable_find_up: Option<bool>,
8173    /// The pinned version of the module source
8174    #[builder(setter(into, strip_option), default)]
8175    pub ref_pin: Option<&'a str>,
8176    /// If set, error out if the ref string is not of the provided requireKind.
8177    #[builder(setter(into, strip_option), default)]
8178    pub require_kind: Option<ModuleSourceKind>,
8179}
8180#[derive(Builder, Debug, PartialEq)]
8181pub struct QuerySecretOpts<'a> {
8182    /// 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.
8183    /// 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.
8184    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
8185    #[builder(setter(into, strip_option), default)]
8186    pub cache_key: Option<&'a str>,
8187}
8188impl Query {
8189    /// Constructs a cache volume for a given cache key.
8190    ///
8191    /// # Arguments
8192    ///
8193    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
8194    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8195    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
8196        let mut query = self.selection.select("cacheVolume");
8197        query = query.arg("key", key.into());
8198        CacheVolume {
8199            proc: self.proc.clone(),
8200            selection: query,
8201            graphql_client: self.graphql_client.clone(),
8202        }
8203    }
8204    /// Constructs a cache volume for a given cache key.
8205    ///
8206    /// # Arguments
8207    ///
8208    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
8209    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8210    pub fn cache_volume_opts<'a>(
8211        &self,
8212        key: impl Into<String>,
8213        opts: QueryCacheVolumeOpts<'a>,
8214    ) -> CacheVolume {
8215        let mut query = self.selection.select("cacheVolume");
8216        query = query.arg("key", key.into());
8217        if let Some(namespace) = opts.namespace {
8218            query = query.arg("namespace", namespace);
8219        }
8220        CacheVolume {
8221            proc: self.proc.clone(),
8222            selection: query,
8223            graphql_client: self.graphql_client.clone(),
8224        }
8225    }
8226    /// Creates a scratch container, with no image or metadata.
8227    /// To pull an image, follow up with the "from" function.
8228    ///
8229    /// # Arguments
8230    ///
8231    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8232    pub fn container(&self) -> Container {
8233        let query = self.selection.select("container");
8234        Container {
8235            proc: self.proc.clone(),
8236            selection: query,
8237            graphql_client: self.graphql_client.clone(),
8238        }
8239    }
8240    /// Creates a scratch container, with no image or metadata.
8241    /// To pull an image, follow up with the "from" function.
8242    ///
8243    /// # Arguments
8244    ///
8245    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8246    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
8247        let mut query = self.selection.select("container");
8248        if let Some(platform) = opts.platform {
8249            query = query.arg("platform", platform);
8250        }
8251        Container {
8252            proc: self.proc.clone(),
8253            selection: query,
8254            graphql_client: self.graphql_client.clone(),
8255        }
8256    }
8257    /// The FunctionCall context that the SDK caller is currently executing in.
8258    /// If the caller is not currently executing in a function, this will return an error.
8259    pub fn current_function_call(&self) -> FunctionCall {
8260        let query = self.selection.select("currentFunctionCall");
8261        FunctionCall {
8262            proc: self.proc.clone(),
8263            selection: query,
8264            graphql_client: self.graphql_client.clone(),
8265        }
8266    }
8267    /// The module currently being served in the session, if any.
8268    pub fn current_module(&self) -> CurrentModule {
8269        let query = self.selection.select("currentModule");
8270        CurrentModule {
8271            proc: self.proc.clone(),
8272            selection: query,
8273            graphql_client: self.graphql_client.clone(),
8274        }
8275    }
8276    /// The TypeDef representations of the objects currently being served in the session.
8277    pub fn current_type_defs(&self) -> Vec<TypeDef> {
8278        let query = self.selection.select("currentTypeDefs");
8279        vec![TypeDef {
8280            proc: self.proc.clone(),
8281            selection: query,
8282            graphql_client: self.graphql_client.clone(),
8283        }]
8284    }
8285    /// The default platform of the engine.
8286    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
8287        let query = self.selection.select("defaultPlatform");
8288        query.execute(self.graphql_client.clone()).await
8289    }
8290    /// Creates an empty directory.
8291    pub fn directory(&self) -> Directory {
8292        let query = self.selection.select("directory");
8293        Directory {
8294            proc: self.proc.clone(),
8295            selection: query,
8296            graphql_client: self.graphql_client.clone(),
8297        }
8298    }
8299    /// The Dagger engine container configuration and state
8300    pub fn engine(&self) -> Engine {
8301        let query = self.selection.select("engine");
8302        Engine {
8303            proc: self.proc.clone(),
8304            selection: query,
8305            graphql_client: self.graphql_client.clone(),
8306        }
8307    }
8308    /// Initialize a new environment
8309    ///
8310    /// # Arguments
8311    ///
8312    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8313    pub fn env(&self) -> Env {
8314        let query = self.selection.select("env");
8315        Env {
8316            proc: self.proc.clone(),
8317            selection: query,
8318            graphql_client: self.graphql_client.clone(),
8319        }
8320    }
8321    /// Initialize a new environment
8322    ///
8323    /// # Arguments
8324    ///
8325    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8326    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
8327        let mut query = self.selection.select("env");
8328        if let Some(privileged) = opts.privileged {
8329            query = query.arg("privileged", privileged);
8330        }
8331        if let Some(writable) = opts.writable {
8332            query = query.arg("writable", writable);
8333        }
8334        Env {
8335            proc: self.proc.clone(),
8336            selection: query,
8337            graphql_client: self.graphql_client.clone(),
8338        }
8339    }
8340    /// Create a new error.
8341    ///
8342    /// # Arguments
8343    ///
8344    /// * `message` - A brief description of the error.
8345    pub fn error(&self, message: impl Into<String>) -> Error {
8346        let mut query = self.selection.select("error");
8347        query = query.arg("message", message.into());
8348        Error {
8349            proc: self.proc.clone(),
8350            selection: query,
8351            graphql_client: self.graphql_client.clone(),
8352        }
8353    }
8354    /// Creates a file with the specified contents.
8355    ///
8356    /// # Arguments
8357    ///
8358    /// * `name` - Name of the new file. Example: "foo.txt"
8359    /// * `contents` - Contents of the new file. Example: "Hello world!"
8360    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8361    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
8362        let mut query = self.selection.select("file");
8363        query = query.arg("name", name.into());
8364        query = query.arg("contents", contents.into());
8365        File {
8366            proc: self.proc.clone(),
8367            selection: query,
8368            graphql_client: self.graphql_client.clone(),
8369        }
8370    }
8371    /// Creates a file with the specified contents.
8372    ///
8373    /// # Arguments
8374    ///
8375    /// * `name` - Name of the new file. Example: "foo.txt"
8376    /// * `contents` - Contents of the new file. Example: "Hello world!"
8377    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8378    pub fn file_opts(
8379        &self,
8380        name: impl Into<String>,
8381        contents: impl Into<String>,
8382        opts: QueryFileOpts,
8383    ) -> File {
8384        let mut query = self.selection.select("file");
8385        query = query.arg("name", name.into());
8386        query = query.arg("contents", contents.into());
8387        if let Some(permissions) = opts.permissions {
8388            query = query.arg("permissions", permissions);
8389        }
8390        File {
8391            proc: self.proc.clone(),
8392            selection: query,
8393            graphql_client: self.graphql_client.clone(),
8394        }
8395    }
8396    /// Creates a function.
8397    ///
8398    /// # Arguments
8399    ///
8400    /// * `name` - Name of the function, in its original format from the implementation language.
8401    /// * `return_type` - Return type of the function.
8402    pub fn function(
8403        &self,
8404        name: impl Into<String>,
8405        return_type: impl IntoID<TypeDefId>,
8406    ) -> Function {
8407        let mut query = self.selection.select("function");
8408        query = query.arg("name", name.into());
8409        query = query.arg_lazy(
8410            "returnType",
8411            Box::new(move || {
8412                let return_type = return_type.clone();
8413                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
8414            }),
8415        );
8416        Function {
8417            proc: self.proc.clone(),
8418            selection: query,
8419            graphql_client: self.graphql_client.clone(),
8420        }
8421    }
8422    /// Create a code generation result, given a directory containing the generated code.
8423    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
8424        let mut query = self.selection.select("generatedCode");
8425        query = query.arg_lazy(
8426            "code",
8427            Box::new(move || {
8428                let code = code.clone();
8429                Box::pin(async move { code.into_id().await.unwrap().quote() })
8430            }),
8431        );
8432        GeneratedCode {
8433            proc: self.proc.clone(),
8434            selection: query,
8435            graphql_client: self.graphql_client.clone(),
8436        }
8437    }
8438    /// Queries a Git repository.
8439    ///
8440    /// # Arguments
8441    ///
8442    /// * `url` - URL of the git repository.
8443    ///
8444    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
8445    ///
8446    /// Suffix ".git" is optional.
8447    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8448    pub fn git(&self, url: impl Into<String>) -> GitRepository {
8449        let mut query = self.selection.select("git");
8450        query = query.arg("url", url.into());
8451        GitRepository {
8452            proc: self.proc.clone(),
8453            selection: query,
8454            graphql_client: self.graphql_client.clone(),
8455        }
8456    }
8457    /// Queries a Git repository.
8458    ///
8459    /// # Arguments
8460    ///
8461    /// * `url` - URL of the git repository.
8462    ///
8463    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
8464    ///
8465    /// Suffix ".git" is optional.
8466    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8467    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
8468        let mut query = self.selection.select("git");
8469        query = query.arg("url", url.into());
8470        if let Some(keep_git_dir) = opts.keep_git_dir {
8471            query = query.arg("keepGitDir", keep_git_dir);
8472        }
8473        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
8474            query = query.arg("sshKnownHosts", ssh_known_hosts);
8475        }
8476        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
8477            query = query.arg("sshAuthSocket", ssh_auth_socket);
8478        }
8479        if let Some(http_auth_token) = opts.http_auth_token {
8480            query = query.arg("httpAuthToken", http_auth_token);
8481        }
8482        if let Some(http_auth_header) = opts.http_auth_header {
8483            query = query.arg("httpAuthHeader", http_auth_header);
8484        }
8485        if let Some(experimental_service_host) = opts.experimental_service_host {
8486            query = query.arg("experimentalServiceHost", experimental_service_host);
8487        }
8488        GitRepository {
8489            proc: self.proc.clone(),
8490            selection: query,
8491            graphql_client: self.graphql_client.clone(),
8492        }
8493    }
8494    /// Queries the host environment.
8495    pub fn host(&self) -> Host {
8496        let query = self.selection.select("host");
8497        Host {
8498            proc: self.proc.clone(),
8499            selection: query,
8500            graphql_client: self.graphql_client.clone(),
8501        }
8502    }
8503    /// Returns a file containing an http remote url content.
8504    ///
8505    /// # Arguments
8506    ///
8507    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
8508    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8509    pub fn http(&self, url: impl Into<String>) -> File {
8510        let mut query = self.selection.select("http");
8511        query = query.arg("url", url.into());
8512        File {
8513            proc: self.proc.clone(),
8514            selection: query,
8515            graphql_client: self.graphql_client.clone(),
8516        }
8517    }
8518    /// Returns a file containing an http remote url content.
8519    ///
8520    /// # Arguments
8521    ///
8522    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
8523    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8524    pub fn http_opts(&self, url: impl Into<String>, opts: QueryHttpOpts) -> File {
8525        let mut query = self.selection.select("http");
8526        query = query.arg("url", url.into());
8527        if let Some(experimental_service_host) = opts.experimental_service_host {
8528            query = query.arg("experimentalServiceHost", experimental_service_host);
8529        }
8530        File {
8531            proc: self.proc.clone(),
8532            selection: query,
8533            graphql_client: self.graphql_client.clone(),
8534        }
8535    }
8536    /// Initialize a Large Language Model (LLM)
8537    ///
8538    /// # Arguments
8539    ///
8540    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8541    pub fn llm(&self) -> Llm {
8542        let query = self.selection.select("llm");
8543        Llm {
8544            proc: self.proc.clone(),
8545            selection: query,
8546            graphql_client: self.graphql_client.clone(),
8547        }
8548    }
8549    /// Initialize a Large Language Model (LLM)
8550    ///
8551    /// # Arguments
8552    ///
8553    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8554    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
8555        let mut query = self.selection.select("llm");
8556        if let Some(model) = opts.model {
8557            query = query.arg("model", model);
8558        }
8559        if let Some(max_api_calls) = opts.max_api_calls {
8560            query = query.arg("maxAPICalls", max_api_calls);
8561        }
8562        Llm {
8563            proc: self.proc.clone(),
8564            selection: query,
8565            graphql_client: self.graphql_client.clone(),
8566        }
8567    }
8568    /// Load a Binding from its ID.
8569    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
8570        let mut query = self.selection.select("loadBindingFromID");
8571        query = query.arg_lazy(
8572            "id",
8573            Box::new(move || {
8574                let id = id.clone();
8575                Box::pin(async move { id.into_id().await.unwrap().quote() })
8576            }),
8577        );
8578        Binding {
8579            proc: self.proc.clone(),
8580            selection: query,
8581            graphql_client: self.graphql_client.clone(),
8582        }
8583    }
8584    /// Load a CacheVolume from its ID.
8585    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
8586        let mut query = self.selection.select("loadCacheVolumeFromID");
8587        query = query.arg_lazy(
8588            "id",
8589            Box::new(move || {
8590                let id = id.clone();
8591                Box::pin(async move { id.into_id().await.unwrap().quote() })
8592            }),
8593        );
8594        CacheVolume {
8595            proc: self.proc.clone(),
8596            selection: query,
8597            graphql_client: self.graphql_client.clone(),
8598        }
8599    }
8600    /// Load a Container from its ID.
8601    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
8602        let mut query = self.selection.select("loadContainerFromID");
8603        query = query.arg_lazy(
8604            "id",
8605            Box::new(move || {
8606                let id = id.clone();
8607                Box::pin(async move { id.into_id().await.unwrap().quote() })
8608            }),
8609        );
8610        Container {
8611            proc: self.proc.clone(),
8612            selection: query,
8613            graphql_client: self.graphql_client.clone(),
8614        }
8615    }
8616    /// Load a CurrentModule from its ID.
8617    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
8618        let mut query = self.selection.select("loadCurrentModuleFromID");
8619        query = query.arg_lazy(
8620            "id",
8621            Box::new(move || {
8622                let id = id.clone();
8623                Box::pin(async move { id.into_id().await.unwrap().quote() })
8624            }),
8625        );
8626        CurrentModule {
8627            proc: self.proc.clone(),
8628            selection: query,
8629            graphql_client: self.graphql_client.clone(),
8630        }
8631    }
8632    /// Load a Directory from its ID.
8633    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
8634        let mut query = self.selection.select("loadDirectoryFromID");
8635        query = query.arg_lazy(
8636            "id",
8637            Box::new(move || {
8638                let id = id.clone();
8639                Box::pin(async move { id.into_id().await.unwrap().quote() })
8640            }),
8641        );
8642        Directory {
8643            proc: self.proc.clone(),
8644            selection: query,
8645            graphql_client: self.graphql_client.clone(),
8646        }
8647    }
8648    /// Load a EngineCacheEntry from its ID.
8649    pub fn load_engine_cache_entry_from_id(
8650        &self,
8651        id: impl IntoID<EngineCacheEntryId>,
8652    ) -> EngineCacheEntry {
8653        let mut query = self.selection.select("loadEngineCacheEntryFromID");
8654        query = query.arg_lazy(
8655            "id",
8656            Box::new(move || {
8657                let id = id.clone();
8658                Box::pin(async move { id.into_id().await.unwrap().quote() })
8659            }),
8660        );
8661        EngineCacheEntry {
8662            proc: self.proc.clone(),
8663            selection: query,
8664            graphql_client: self.graphql_client.clone(),
8665        }
8666    }
8667    /// Load a EngineCacheEntrySet from its ID.
8668    pub fn load_engine_cache_entry_set_from_id(
8669        &self,
8670        id: impl IntoID<EngineCacheEntrySetId>,
8671    ) -> EngineCacheEntrySet {
8672        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
8673        query = query.arg_lazy(
8674            "id",
8675            Box::new(move || {
8676                let id = id.clone();
8677                Box::pin(async move { id.into_id().await.unwrap().quote() })
8678            }),
8679        );
8680        EngineCacheEntrySet {
8681            proc: self.proc.clone(),
8682            selection: query,
8683            graphql_client: self.graphql_client.clone(),
8684        }
8685    }
8686    /// Load a EngineCache from its ID.
8687    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
8688        let mut query = self.selection.select("loadEngineCacheFromID");
8689        query = query.arg_lazy(
8690            "id",
8691            Box::new(move || {
8692                let id = id.clone();
8693                Box::pin(async move { id.into_id().await.unwrap().quote() })
8694            }),
8695        );
8696        EngineCache {
8697            proc: self.proc.clone(),
8698            selection: query,
8699            graphql_client: self.graphql_client.clone(),
8700        }
8701    }
8702    /// Load a Engine from its ID.
8703    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
8704        let mut query = self.selection.select("loadEngineFromID");
8705        query = query.arg_lazy(
8706            "id",
8707            Box::new(move || {
8708                let id = id.clone();
8709                Box::pin(async move { id.into_id().await.unwrap().quote() })
8710            }),
8711        );
8712        Engine {
8713            proc: self.proc.clone(),
8714            selection: query,
8715            graphql_client: self.graphql_client.clone(),
8716        }
8717    }
8718    /// Load a EnumTypeDef from its ID.
8719    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
8720        let mut query = self.selection.select("loadEnumTypeDefFromID");
8721        query = query.arg_lazy(
8722            "id",
8723            Box::new(move || {
8724                let id = id.clone();
8725                Box::pin(async move { id.into_id().await.unwrap().quote() })
8726            }),
8727        );
8728        EnumTypeDef {
8729            proc: self.proc.clone(),
8730            selection: query,
8731            graphql_client: self.graphql_client.clone(),
8732        }
8733    }
8734    /// Load a EnumValueTypeDef from its ID.
8735    pub fn load_enum_value_type_def_from_id(
8736        &self,
8737        id: impl IntoID<EnumValueTypeDefId>,
8738    ) -> EnumValueTypeDef {
8739        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
8740        query = query.arg_lazy(
8741            "id",
8742            Box::new(move || {
8743                let id = id.clone();
8744                Box::pin(async move { id.into_id().await.unwrap().quote() })
8745            }),
8746        );
8747        EnumValueTypeDef {
8748            proc: self.proc.clone(),
8749            selection: query,
8750            graphql_client: self.graphql_client.clone(),
8751        }
8752    }
8753    /// Load a Env from its ID.
8754    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
8755        let mut query = self.selection.select("loadEnvFromID");
8756        query = query.arg_lazy(
8757            "id",
8758            Box::new(move || {
8759                let id = id.clone();
8760                Box::pin(async move { id.into_id().await.unwrap().quote() })
8761            }),
8762        );
8763        Env {
8764            proc: self.proc.clone(),
8765            selection: query,
8766            graphql_client: self.graphql_client.clone(),
8767        }
8768    }
8769    /// Load a EnvVariable from its ID.
8770    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
8771        let mut query = self.selection.select("loadEnvVariableFromID");
8772        query = query.arg_lazy(
8773            "id",
8774            Box::new(move || {
8775                let id = id.clone();
8776                Box::pin(async move { id.into_id().await.unwrap().quote() })
8777            }),
8778        );
8779        EnvVariable {
8780            proc: self.proc.clone(),
8781            selection: query,
8782            graphql_client: self.graphql_client.clone(),
8783        }
8784    }
8785    /// Load a Error from its ID.
8786    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
8787        let mut query = self.selection.select("loadErrorFromID");
8788        query = query.arg_lazy(
8789            "id",
8790            Box::new(move || {
8791                let id = id.clone();
8792                Box::pin(async move { id.into_id().await.unwrap().quote() })
8793            }),
8794        );
8795        Error {
8796            proc: self.proc.clone(),
8797            selection: query,
8798            graphql_client: self.graphql_client.clone(),
8799        }
8800    }
8801    /// Load a ErrorValue from its ID.
8802    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
8803        let mut query = self.selection.select("loadErrorValueFromID");
8804        query = query.arg_lazy(
8805            "id",
8806            Box::new(move || {
8807                let id = id.clone();
8808                Box::pin(async move { id.into_id().await.unwrap().quote() })
8809            }),
8810        );
8811        ErrorValue {
8812            proc: self.proc.clone(),
8813            selection: query,
8814            graphql_client: self.graphql_client.clone(),
8815        }
8816    }
8817    /// Load a FieldTypeDef from its ID.
8818    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
8819        let mut query = self.selection.select("loadFieldTypeDefFromID");
8820        query = query.arg_lazy(
8821            "id",
8822            Box::new(move || {
8823                let id = id.clone();
8824                Box::pin(async move { id.into_id().await.unwrap().quote() })
8825            }),
8826        );
8827        FieldTypeDef {
8828            proc: self.proc.clone(),
8829            selection: query,
8830            graphql_client: self.graphql_client.clone(),
8831        }
8832    }
8833    /// Load a File from its ID.
8834    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
8835        let mut query = self.selection.select("loadFileFromID");
8836        query = query.arg_lazy(
8837            "id",
8838            Box::new(move || {
8839                let id = id.clone();
8840                Box::pin(async move { id.into_id().await.unwrap().quote() })
8841            }),
8842        );
8843        File {
8844            proc: self.proc.clone(),
8845            selection: query,
8846            graphql_client: self.graphql_client.clone(),
8847        }
8848    }
8849    /// Load a FunctionArg from its ID.
8850    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
8851        let mut query = self.selection.select("loadFunctionArgFromID");
8852        query = query.arg_lazy(
8853            "id",
8854            Box::new(move || {
8855                let id = id.clone();
8856                Box::pin(async move { id.into_id().await.unwrap().quote() })
8857            }),
8858        );
8859        FunctionArg {
8860            proc: self.proc.clone(),
8861            selection: query,
8862            graphql_client: self.graphql_client.clone(),
8863        }
8864    }
8865    /// Load a FunctionCallArgValue from its ID.
8866    pub fn load_function_call_arg_value_from_id(
8867        &self,
8868        id: impl IntoID<FunctionCallArgValueId>,
8869    ) -> FunctionCallArgValue {
8870        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
8871        query = query.arg_lazy(
8872            "id",
8873            Box::new(move || {
8874                let id = id.clone();
8875                Box::pin(async move { id.into_id().await.unwrap().quote() })
8876            }),
8877        );
8878        FunctionCallArgValue {
8879            proc: self.proc.clone(),
8880            selection: query,
8881            graphql_client: self.graphql_client.clone(),
8882        }
8883    }
8884    /// Load a FunctionCall from its ID.
8885    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
8886        let mut query = self.selection.select("loadFunctionCallFromID");
8887        query = query.arg_lazy(
8888            "id",
8889            Box::new(move || {
8890                let id = id.clone();
8891                Box::pin(async move { id.into_id().await.unwrap().quote() })
8892            }),
8893        );
8894        FunctionCall {
8895            proc: self.proc.clone(),
8896            selection: query,
8897            graphql_client: self.graphql_client.clone(),
8898        }
8899    }
8900    /// Load a Function from its ID.
8901    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
8902        let mut query = self.selection.select("loadFunctionFromID");
8903        query = query.arg_lazy(
8904            "id",
8905            Box::new(move || {
8906                let id = id.clone();
8907                Box::pin(async move { id.into_id().await.unwrap().quote() })
8908            }),
8909        );
8910        Function {
8911            proc: self.proc.clone(),
8912            selection: query,
8913            graphql_client: self.graphql_client.clone(),
8914        }
8915    }
8916    /// Load a GeneratedCode from its ID.
8917    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
8918        let mut query = self.selection.select("loadGeneratedCodeFromID");
8919        query = query.arg_lazy(
8920            "id",
8921            Box::new(move || {
8922                let id = id.clone();
8923                Box::pin(async move { id.into_id().await.unwrap().quote() })
8924            }),
8925        );
8926        GeneratedCode {
8927            proc: self.proc.clone(),
8928            selection: query,
8929            graphql_client: self.graphql_client.clone(),
8930        }
8931    }
8932    /// Load a GitRef from its ID.
8933    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
8934        let mut query = self.selection.select("loadGitRefFromID");
8935        query = query.arg_lazy(
8936            "id",
8937            Box::new(move || {
8938                let id = id.clone();
8939                Box::pin(async move { id.into_id().await.unwrap().quote() })
8940            }),
8941        );
8942        GitRef {
8943            proc: self.proc.clone(),
8944            selection: query,
8945            graphql_client: self.graphql_client.clone(),
8946        }
8947    }
8948    /// Load a GitRepository from its ID.
8949    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
8950        let mut query = self.selection.select("loadGitRepositoryFromID");
8951        query = query.arg_lazy(
8952            "id",
8953            Box::new(move || {
8954                let id = id.clone();
8955                Box::pin(async move { id.into_id().await.unwrap().quote() })
8956            }),
8957        );
8958        GitRepository {
8959            proc: self.proc.clone(),
8960            selection: query,
8961            graphql_client: self.graphql_client.clone(),
8962        }
8963    }
8964    /// Load a Host from its ID.
8965    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
8966        let mut query = self.selection.select("loadHostFromID");
8967        query = query.arg_lazy(
8968            "id",
8969            Box::new(move || {
8970                let id = id.clone();
8971                Box::pin(async move { id.into_id().await.unwrap().quote() })
8972            }),
8973        );
8974        Host {
8975            proc: self.proc.clone(),
8976            selection: query,
8977            graphql_client: self.graphql_client.clone(),
8978        }
8979    }
8980    /// Load a InputTypeDef from its ID.
8981    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
8982        let mut query = self.selection.select("loadInputTypeDefFromID");
8983        query = query.arg_lazy(
8984            "id",
8985            Box::new(move || {
8986                let id = id.clone();
8987                Box::pin(async move { id.into_id().await.unwrap().quote() })
8988            }),
8989        );
8990        InputTypeDef {
8991            proc: self.proc.clone(),
8992            selection: query,
8993            graphql_client: self.graphql_client.clone(),
8994        }
8995    }
8996    /// Load a InterfaceTypeDef from its ID.
8997    pub fn load_interface_type_def_from_id(
8998        &self,
8999        id: impl IntoID<InterfaceTypeDefId>,
9000    ) -> InterfaceTypeDef {
9001        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
9002        query = query.arg_lazy(
9003            "id",
9004            Box::new(move || {
9005                let id = id.clone();
9006                Box::pin(async move { id.into_id().await.unwrap().quote() })
9007            }),
9008        );
9009        InterfaceTypeDef {
9010            proc: self.proc.clone(),
9011            selection: query,
9012            graphql_client: self.graphql_client.clone(),
9013        }
9014    }
9015    /// Load a LLM from its ID.
9016    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
9017        let mut query = self.selection.select("loadLLMFromID");
9018        query = query.arg_lazy(
9019            "id",
9020            Box::new(move || {
9021                let id = id.clone();
9022                Box::pin(async move { id.into_id().await.unwrap().quote() })
9023            }),
9024        );
9025        Llm {
9026            proc: self.proc.clone(),
9027            selection: query,
9028            graphql_client: self.graphql_client.clone(),
9029        }
9030    }
9031    /// Load a LLMTokenUsage from its ID.
9032    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
9033        let mut query = self.selection.select("loadLLMTokenUsageFromID");
9034        query = query.arg_lazy(
9035            "id",
9036            Box::new(move || {
9037                let id = id.clone();
9038                Box::pin(async move { id.into_id().await.unwrap().quote() })
9039            }),
9040        );
9041        LlmTokenUsage {
9042            proc: self.proc.clone(),
9043            selection: query,
9044            graphql_client: self.graphql_client.clone(),
9045        }
9046    }
9047    /// Load a Label from its ID.
9048    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
9049        let mut query = self.selection.select("loadLabelFromID");
9050        query = query.arg_lazy(
9051            "id",
9052            Box::new(move || {
9053                let id = id.clone();
9054                Box::pin(async move { id.into_id().await.unwrap().quote() })
9055            }),
9056        );
9057        Label {
9058            proc: self.proc.clone(),
9059            selection: query,
9060            graphql_client: self.graphql_client.clone(),
9061        }
9062    }
9063    /// Load a ListTypeDef from its ID.
9064    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
9065        let mut query = self.selection.select("loadListTypeDefFromID");
9066        query = query.arg_lazy(
9067            "id",
9068            Box::new(move || {
9069                let id = id.clone();
9070                Box::pin(async move { id.into_id().await.unwrap().quote() })
9071            }),
9072        );
9073        ListTypeDef {
9074            proc: self.proc.clone(),
9075            selection: query,
9076            graphql_client: self.graphql_client.clone(),
9077        }
9078    }
9079    /// Load a ModuleConfigClient from its ID.
9080    pub fn load_module_config_client_from_id(
9081        &self,
9082        id: impl IntoID<ModuleConfigClientId>,
9083    ) -> ModuleConfigClient {
9084        let mut query = self.selection.select("loadModuleConfigClientFromID");
9085        query = query.arg_lazy(
9086            "id",
9087            Box::new(move || {
9088                let id = id.clone();
9089                Box::pin(async move { id.into_id().await.unwrap().quote() })
9090            }),
9091        );
9092        ModuleConfigClient {
9093            proc: self.proc.clone(),
9094            selection: query,
9095            graphql_client: self.graphql_client.clone(),
9096        }
9097    }
9098    /// Load a Module from its ID.
9099    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
9100        let mut query = self.selection.select("loadModuleFromID");
9101        query = query.arg_lazy(
9102            "id",
9103            Box::new(move || {
9104                let id = id.clone();
9105                Box::pin(async move { id.into_id().await.unwrap().quote() })
9106            }),
9107        );
9108        Module {
9109            proc: self.proc.clone(),
9110            selection: query,
9111            graphql_client: self.graphql_client.clone(),
9112        }
9113    }
9114    /// Load a ModuleSource from its ID.
9115    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
9116        let mut query = self.selection.select("loadModuleSourceFromID");
9117        query = query.arg_lazy(
9118            "id",
9119            Box::new(move || {
9120                let id = id.clone();
9121                Box::pin(async move { id.into_id().await.unwrap().quote() })
9122            }),
9123        );
9124        ModuleSource {
9125            proc: self.proc.clone(),
9126            selection: query,
9127            graphql_client: self.graphql_client.clone(),
9128        }
9129    }
9130    /// Load a ObjectTypeDef from its ID.
9131    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
9132        let mut query = self.selection.select("loadObjectTypeDefFromID");
9133        query = query.arg_lazy(
9134            "id",
9135            Box::new(move || {
9136                let id = id.clone();
9137                Box::pin(async move { id.into_id().await.unwrap().quote() })
9138            }),
9139        );
9140        ObjectTypeDef {
9141            proc: self.proc.clone(),
9142            selection: query,
9143            graphql_client: self.graphql_client.clone(),
9144        }
9145    }
9146    /// Load a Port from its ID.
9147    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
9148        let mut query = self.selection.select("loadPortFromID");
9149        query = query.arg_lazy(
9150            "id",
9151            Box::new(move || {
9152                let id = id.clone();
9153                Box::pin(async move { id.into_id().await.unwrap().quote() })
9154            }),
9155        );
9156        Port {
9157            proc: self.proc.clone(),
9158            selection: query,
9159            graphql_client: self.graphql_client.clone(),
9160        }
9161    }
9162    /// Load a SDKConfig from its ID.
9163    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
9164        let mut query = self.selection.select("loadSDKConfigFromID");
9165        query = query.arg_lazy(
9166            "id",
9167            Box::new(move || {
9168                let id = id.clone();
9169                Box::pin(async move { id.into_id().await.unwrap().quote() })
9170            }),
9171        );
9172        SdkConfig {
9173            proc: self.proc.clone(),
9174            selection: query,
9175            graphql_client: self.graphql_client.clone(),
9176        }
9177    }
9178    /// Load a ScalarTypeDef from its ID.
9179    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
9180        let mut query = self.selection.select("loadScalarTypeDefFromID");
9181        query = query.arg_lazy(
9182            "id",
9183            Box::new(move || {
9184                let id = id.clone();
9185                Box::pin(async move { id.into_id().await.unwrap().quote() })
9186            }),
9187        );
9188        ScalarTypeDef {
9189            proc: self.proc.clone(),
9190            selection: query,
9191            graphql_client: self.graphql_client.clone(),
9192        }
9193    }
9194    /// Load a Secret from its ID.
9195    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
9196        let mut query = self.selection.select("loadSecretFromID");
9197        query = query.arg_lazy(
9198            "id",
9199            Box::new(move || {
9200                let id = id.clone();
9201                Box::pin(async move { id.into_id().await.unwrap().quote() })
9202            }),
9203        );
9204        Secret {
9205            proc: self.proc.clone(),
9206            selection: query,
9207            graphql_client: self.graphql_client.clone(),
9208        }
9209    }
9210    /// Load a Service from its ID.
9211    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
9212        let mut query = self.selection.select("loadServiceFromID");
9213        query = query.arg_lazy(
9214            "id",
9215            Box::new(move || {
9216                let id = id.clone();
9217                Box::pin(async move { id.into_id().await.unwrap().quote() })
9218            }),
9219        );
9220        Service {
9221            proc: self.proc.clone(),
9222            selection: query,
9223            graphql_client: self.graphql_client.clone(),
9224        }
9225    }
9226    /// Load a Socket from its ID.
9227    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
9228        let mut query = self.selection.select("loadSocketFromID");
9229        query = query.arg_lazy(
9230            "id",
9231            Box::new(move || {
9232                let id = id.clone();
9233                Box::pin(async move { id.into_id().await.unwrap().quote() })
9234            }),
9235        );
9236        Socket {
9237            proc: self.proc.clone(),
9238            selection: query,
9239            graphql_client: self.graphql_client.clone(),
9240        }
9241    }
9242    /// Load a SourceMap from its ID.
9243    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
9244        let mut query = self.selection.select("loadSourceMapFromID");
9245        query = query.arg_lazy(
9246            "id",
9247            Box::new(move || {
9248                let id = id.clone();
9249                Box::pin(async move { id.into_id().await.unwrap().quote() })
9250            }),
9251        );
9252        SourceMap {
9253            proc: self.proc.clone(),
9254            selection: query,
9255            graphql_client: self.graphql_client.clone(),
9256        }
9257    }
9258    /// Load a Terminal from its ID.
9259    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
9260        let mut query = self.selection.select("loadTerminalFromID");
9261        query = query.arg_lazy(
9262            "id",
9263            Box::new(move || {
9264                let id = id.clone();
9265                Box::pin(async move { id.into_id().await.unwrap().quote() })
9266            }),
9267        );
9268        Terminal {
9269            proc: self.proc.clone(),
9270            selection: query,
9271            graphql_client: self.graphql_client.clone(),
9272        }
9273    }
9274    /// Load a TypeDef from its ID.
9275    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
9276        let mut query = self.selection.select("loadTypeDefFromID");
9277        query = query.arg_lazy(
9278            "id",
9279            Box::new(move || {
9280                let id = id.clone();
9281                Box::pin(async move { id.into_id().await.unwrap().quote() })
9282            }),
9283        );
9284        TypeDef {
9285            proc: self.proc.clone(),
9286            selection: query,
9287            graphql_client: self.graphql_client.clone(),
9288        }
9289    }
9290    /// Create a new module.
9291    pub fn module(&self) -> Module {
9292        let query = self.selection.select("module");
9293        Module {
9294            proc: self.proc.clone(),
9295            selection: query,
9296            graphql_client: self.graphql_client.clone(),
9297        }
9298    }
9299    /// Create a new module source instance from a source ref string
9300    ///
9301    /// # Arguments
9302    ///
9303    /// * `ref_string` - The string ref representation of the module source
9304    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9305    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
9306        let mut query = self.selection.select("moduleSource");
9307        query = query.arg("refString", ref_string.into());
9308        ModuleSource {
9309            proc: self.proc.clone(),
9310            selection: query,
9311            graphql_client: self.graphql_client.clone(),
9312        }
9313    }
9314    /// Create a new module source instance from a source ref string
9315    ///
9316    /// # Arguments
9317    ///
9318    /// * `ref_string` - The string ref representation of the module source
9319    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9320    pub fn module_source_opts<'a>(
9321        &self,
9322        ref_string: impl Into<String>,
9323        opts: QueryModuleSourceOpts<'a>,
9324    ) -> ModuleSource {
9325        let mut query = self.selection.select("moduleSource");
9326        query = query.arg("refString", ref_string.into());
9327        if let Some(ref_pin) = opts.ref_pin {
9328            query = query.arg("refPin", ref_pin);
9329        }
9330        if let Some(disable_find_up) = opts.disable_find_up {
9331            query = query.arg("disableFindUp", disable_find_up);
9332        }
9333        if let Some(allow_not_exists) = opts.allow_not_exists {
9334            query = query.arg("allowNotExists", allow_not_exists);
9335        }
9336        if let Some(require_kind) = opts.require_kind {
9337            query = query.arg("requireKind", require_kind);
9338        }
9339        ModuleSource {
9340            proc: self.proc.clone(),
9341            selection: query,
9342            graphql_client: self.graphql_client.clone(),
9343        }
9344    }
9345    /// Creates a new secret.
9346    ///
9347    /// # Arguments
9348    ///
9349    /// * `uri` - The URI of the secret store
9350    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9351    pub fn secret(&self, uri: impl Into<String>) -> Secret {
9352        let mut query = self.selection.select("secret");
9353        query = query.arg("uri", uri.into());
9354        Secret {
9355            proc: self.proc.clone(),
9356            selection: query,
9357            graphql_client: self.graphql_client.clone(),
9358        }
9359    }
9360    /// Creates a new secret.
9361    ///
9362    /// # Arguments
9363    ///
9364    /// * `uri` - The URI of the secret store
9365    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9366    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
9367        let mut query = self.selection.select("secret");
9368        query = query.arg("uri", uri.into());
9369        if let Some(cache_key) = opts.cache_key {
9370            query = query.arg("cacheKey", cache_key);
9371        }
9372        Secret {
9373            proc: self.proc.clone(),
9374            selection: query,
9375            graphql_client: self.graphql_client.clone(),
9376        }
9377    }
9378    /// Sets a secret given a user defined name to its plaintext and returns the secret.
9379    /// The plaintext value is limited to a size of 128000 bytes.
9380    ///
9381    /// # Arguments
9382    ///
9383    /// * `name` - The user defined name for this secret
9384    /// * `plaintext` - The plaintext of the secret
9385    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
9386        let mut query = self.selection.select("setSecret");
9387        query = query.arg("name", name.into());
9388        query = query.arg("plaintext", plaintext.into());
9389        Secret {
9390            proc: self.proc.clone(),
9391            selection: query,
9392            graphql_client: self.graphql_client.clone(),
9393        }
9394    }
9395    /// Creates source map metadata.
9396    ///
9397    /// # Arguments
9398    ///
9399    /// * `filename` - The filename from the module source.
9400    /// * `line` - The line number within the filename.
9401    /// * `column` - The column number within the line.
9402    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
9403        let mut query = self.selection.select("sourceMap");
9404        query = query.arg("filename", filename.into());
9405        query = query.arg("line", line);
9406        query = query.arg("column", column);
9407        SourceMap {
9408            proc: self.proc.clone(),
9409            selection: query,
9410            graphql_client: self.graphql_client.clone(),
9411        }
9412    }
9413    /// Create a new TypeDef.
9414    pub fn type_def(&self) -> TypeDef {
9415        let query = self.selection.select("typeDef");
9416        TypeDef {
9417            proc: self.proc.clone(),
9418            selection: query,
9419            graphql_client: self.graphql_client.clone(),
9420        }
9421    }
9422    /// Get the current Dagger Engine version.
9423    pub async fn version(&self) -> Result<String, DaggerError> {
9424        let query = self.selection.select("version");
9425        query.execute(self.graphql_client.clone()).await
9426    }
9427}
9428#[derive(Clone)]
9429pub struct SdkConfig {
9430    pub proc: Option<Arc<DaggerSessionProc>>,
9431    pub selection: Selection,
9432    pub graphql_client: DynGraphQLClient,
9433}
9434impl SdkConfig {
9435    /// A unique identifier for this SDKConfig.
9436    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
9437        let query = self.selection.select("id");
9438        query.execute(self.graphql_client.clone()).await
9439    }
9440    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
9441    pub async fn source(&self) -> Result<String, DaggerError> {
9442        let query = self.selection.select("source");
9443        query.execute(self.graphql_client.clone()).await
9444    }
9445}
9446#[derive(Clone)]
9447pub struct ScalarTypeDef {
9448    pub proc: Option<Arc<DaggerSessionProc>>,
9449    pub selection: Selection,
9450    pub graphql_client: DynGraphQLClient,
9451}
9452impl ScalarTypeDef {
9453    /// A doc string for the scalar, if any.
9454    pub async fn description(&self) -> Result<String, DaggerError> {
9455        let query = self.selection.select("description");
9456        query.execute(self.graphql_client.clone()).await
9457    }
9458    /// A unique identifier for this ScalarTypeDef.
9459    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
9460        let query = self.selection.select("id");
9461        query.execute(self.graphql_client.clone()).await
9462    }
9463    /// The name of the scalar.
9464    pub async fn name(&self) -> Result<String, DaggerError> {
9465        let query = self.selection.select("name");
9466        query.execute(self.graphql_client.clone()).await
9467    }
9468    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
9469    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9470        let query = self.selection.select("sourceModuleName");
9471        query.execute(self.graphql_client.clone()).await
9472    }
9473}
9474#[derive(Clone)]
9475pub struct Secret {
9476    pub proc: Option<Arc<DaggerSessionProc>>,
9477    pub selection: Selection,
9478    pub graphql_client: DynGraphQLClient,
9479}
9480impl Secret {
9481    /// A unique identifier for this Secret.
9482    pub async fn id(&self) -> Result<SecretId, DaggerError> {
9483        let query = self.selection.select("id");
9484        query.execute(self.graphql_client.clone()).await
9485    }
9486    /// The name of this secret.
9487    pub async fn name(&self) -> Result<String, DaggerError> {
9488        let query = self.selection.select("name");
9489        query.execute(self.graphql_client.clone()).await
9490    }
9491    /// The value of this secret.
9492    pub async fn plaintext(&self) -> Result<String, DaggerError> {
9493        let query = self.selection.select("plaintext");
9494        query.execute(self.graphql_client.clone()).await
9495    }
9496    /// The URI of this secret.
9497    pub async fn uri(&self) -> Result<String, DaggerError> {
9498        let query = self.selection.select("uri");
9499        query.execute(self.graphql_client.clone()).await
9500    }
9501}
9502#[derive(Clone)]
9503pub struct Service {
9504    pub proc: Option<Arc<DaggerSessionProc>>,
9505    pub selection: Selection,
9506    pub graphql_client: DynGraphQLClient,
9507}
9508#[derive(Builder, Debug, PartialEq)]
9509pub struct ServiceEndpointOpts<'a> {
9510    /// The exposed port number for the endpoint
9511    #[builder(setter(into, strip_option), default)]
9512    pub port: Option<isize>,
9513    /// Return a URL with the given scheme, eg. http for http://
9514    #[builder(setter(into, strip_option), default)]
9515    pub scheme: Option<&'a str>,
9516}
9517#[derive(Builder, Debug, PartialEq)]
9518pub struct ServiceStopOpts {
9519    /// Immediately kill the service without waiting for a graceful exit
9520    #[builder(setter(into, strip_option), default)]
9521    pub kill: Option<bool>,
9522}
9523#[derive(Builder, Debug, PartialEq)]
9524pub struct ServiceUpOpts {
9525    /// List of frontend/backend port mappings to forward.
9526    /// Frontend is the port accepting traffic on the host, backend is the service port.
9527    #[builder(setter(into, strip_option), default)]
9528    pub ports: Option<Vec<PortForward>>,
9529    /// Bind each tunnel port to a random port on the host.
9530    #[builder(setter(into, strip_option), default)]
9531    pub random: Option<bool>,
9532}
9533impl Service {
9534    /// Retrieves an endpoint that clients can use to reach this container.
9535    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
9536    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
9537    ///
9538    /// # Arguments
9539    ///
9540    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9541    pub async fn endpoint(&self) -> Result<String, DaggerError> {
9542        let query = self.selection.select("endpoint");
9543        query.execute(self.graphql_client.clone()).await
9544    }
9545    /// Retrieves an endpoint that clients can use to reach this container.
9546    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
9547    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
9548    ///
9549    /// # Arguments
9550    ///
9551    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9552    pub async fn endpoint_opts<'a>(
9553        &self,
9554        opts: ServiceEndpointOpts<'a>,
9555    ) -> Result<String, DaggerError> {
9556        let mut query = self.selection.select("endpoint");
9557        if let Some(port) = opts.port {
9558            query = query.arg("port", port);
9559        }
9560        if let Some(scheme) = opts.scheme {
9561            query = query.arg("scheme", scheme);
9562        }
9563        query.execute(self.graphql_client.clone()).await
9564    }
9565    /// Retrieves a hostname which can be used by clients to reach this container.
9566    pub async fn hostname(&self) -> Result<String, DaggerError> {
9567        let query = self.selection.select("hostname");
9568        query.execute(self.graphql_client.clone()).await
9569    }
9570    /// A unique identifier for this Service.
9571    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
9572        let query = self.selection.select("id");
9573        query.execute(self.graphql_client.clone()).await
9574    }
9575    /// Retrieves the list of ports provided by the service.
9576    pub fn ports(&self) -> Vec<Port> {
9577        let query = self.selection.select("ports");
9578        vec![Port {
9579            proc: self.proc.clone(),
9580            selection: query,
9581            graphql_client: self.graphql_client.clone(),
9582        }]
9583    }
9584    /// Start the service and wait for its health checks to succeed.
9585    /// Services bound to a Container do not need to be manually started.
9586    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
9587        let query = self.selection.select("start");
9588        query.execute(self.graphql_client.clone()).await
9589    }
9590    /// Stop the service.
9591    ///
9592    /// # Arguments
9593    ///
9594    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9595    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
9596        let query = self.selection.select("stop");
9597        query.execute(self.graphql_client.clone()).await
9598    }
9599    /// Stop the service.
9600    ///
9601    /// # Arguments
9602    ///
9603    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9604    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
9605        let mut query = self.selection.select("stop");
9606        if let Some(kill) = opts.kill {
9607            query = query.arg("kill", kill);
9608        }
9609        query.execute(self.graphql_client.clone()).await
9610    }
9611    /// Creates a tunnel that forwards traffic from the caller's network to this service.
9612    ///
9613    /// # Arguments
9614    ///
9615    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9616    pub async fn up(&self) -> Result<Void, DaggerError> {
9617        let query = self.selection.select("up");
9618        query.execute(self.graphql_client.clone()).await
9619    }
9620    /// Creates a tunnel that forwards traffic from the caller's network to this service.
9621    ///
9622    /// # Arguments
9623    ///
9624    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9625    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
9626        let mut query = self.selection.select("up");
9627        if let Some(ports) = opts.ports {
9628            query = query.arg("ports", ports);
9629        }
9630        if let Some(random) = opts.random {
9631            query = query.arg("random", random);
9632        }
9633        query.execute(self.graphql_client.clone()).await
9634    }
9635    /// Configures a hostname which can be used by clients within the session to reach this container.
9636    ///
9637    /// # Arguments
9638    ///
9639    /// * `hostname` - The hostname to use.
9640    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
9641        let mut query = self.selection.select("withHostname");
9642        query = query.arg("hostname", hostname.into());
9643        Service {
9644            proc: self.proc.clone(),
9645            selection: query,
9646            graphql_client: self.graphql_client.clone(),
9647        }
9648    }
9649}
9650#[derive(Clone)]
9651pub struct Socket {
9652    pub proc: Option<Arc<DaggerSessionProc>>,
9653    pub selection: Selection,
9654    pub graphql_client: DynGraphQLClient,
9655}
9656impl Socket {
9657    /// A unique identifier for this Socket.
9658    pub async fn id(&self) -> Result<SocketId, DaggerError> {
9659        let query = self.selection.select("id");
9660        query.execute(self.graphql_client.clone()).await
9661    }
9662}
9663#[derive(Clone)]
9664pub struct SourceMap {
9665    pub proc: Option<Arc<DaggerSessionProc>>,
9666    pub selection: Selection,
9667    pub graphql_client: DynGraphQLClient,
9668}
9669impl SourceMap {
9670    /// The column number within the line.
9671    pub async fn column(&self) -> Result<isize, DaggerError> {
9672        let query = self.selection.select("column");
9673        query.execute(self.graphql_client.clone()).await
9674    }
9675    /// The filename from the module source.
9676    pub async fn filename(&self) -> Result<String, DaggerError> {
9677        let query = self.selection.select("filename");
9678        query.execute(self.graphql_client.clone()).await
9679    }
9680    /// A unique identifier for this SourceMap.
9681    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
9682        let query = self.selection.select("id");
9683        query.execute(self.graphql_client.clone()).await
9684    }
9685    /// The line number within the filename.
9686    pub async fn line(&self) -> Result<isize, DaggerError> {
9687        let query = self.selection.select("line");
9688        query.execute(self.graphql_client.clone()).await
9689    }
9690    /// The module dependency this was declared in.
9691    pub async fn module(&self) -> Result<String, DaggerError> {
9692        let query = self.selection.select("module");
9693        query.execute(self.graphql_client.clone()).await
9694    }
9695}
9696#[derive(Clone)]
9697pub struct Terminal {
9698    pub proc: Option<Arc<DaggerSessionProc>>,
9699    pub selection: Selection,
9700    pub graphql_client: DynGraphQLClient,
9701}
9702impl Terminal {
9703    /// A unique identifier for this Terminal.
9704    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
9705        let query = self.selection.select("id");
9706        query.execute(self.graphql_client.clone()).await
9707    }
9708    /// Forces evaluation of the pipeline in the engine.
9709    /// It doesn't run the default command if no exec has been set.
9710    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
9711        let query = self.selection.select("sync");
9712        query.execute(self.graphql_client.clone()).await
9713    }
9714}
9715#[derive(Clone)]
9716pub struct TypeDef {
9717    pub proc: Option<Arc<DaggerSessionProc>>,
9718    pub selection: Selection,
9719    pub graphql_client: DynGraphQLClient,
9720}
9721#[derive(Builder, Debug, PartialEq)]
9722pub struct TypeDefWithEnumOpts<'a> {
9723    /// A doc string for the enum, if any
9724    #[builder(setter(into, strip_option), default)]
9725    pub description: Option<&'a str>,
9726    /// The source map for the enum definition.
9727    #[builder(setter(into, strip_option), default)]
9728    pub source_map: Option<SourceMapId>,
9729}
9730#[derive(Builder, Debug, PartialEq)]
9731pub struct TypeDefWithEnumValueOpts<'a> {
9732    /// A doc string for the value, if any
9733    #[builder(setter(into, strip_option), default)]
9734    pub description: Option<&'a str>,
9735    /// The source map for the enum value definition.
9736    #[builder(setter(into, strip_option), default)]
9737    pub source_map: Option<SourceMapId>,
9738}
9739#[derive(Builder, Debug, PartialEq)]
9740pub struct TypeDefWithFieldOpts<'a> {
9741    /// A doc string for the field, if any
9742    #[builder(setter(into, strip_option), default)]
9743    pub description: Option<&'a str>,
9744    /// The source map for the field definition.
9745    #[builder(setter(into, strip_option), default)]
9746    pub source_map: Option<SourceMapId>,
9747}
9748#[derive(Builder, Debug, PartialEq)]
9749pub struct TypeDefWithInterfaceOpts<'a> {
9750    #[builder(setter(into, strip_option), default)]
9751    pub description: Option<&'a str>,
9752    #[builder(setter(into, strip_option), default)]
9753    pub source_map: Option<SourceMapId>,
9754}
9755#[derive(Builder, Debug, PartialEq)]
9756pub struct TypeDefWithObjectOpts<'a> {
9757    #[builder(setter(into, strip_option), default)]
9758    pub description: Option<&'a str>,
9759    #[builder(setter(into, strip_option), default)]
9760    pub source_map: Option<SourceMapId>,
9761}
9762#[derive(Builder, Debug, PartialEq)]
9763pub struct TypeDefWithScalarOpts<'a> {
9764    #[builder(setter(into, strip_option), default)]
9765    pub description: Option<&'a str>,
9766}
9767impl TypeDef {
9768    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
9769    pub fn as_enum(&self) -> EnumTypeDef {
9770        let query = self.selection.select("asEnum");
9771        EnumTypeDef {
9772            proc: self.proc.clone(),
9773            selection: query,
9774            graphql_client: self.graphql_client.clone(),
9775        }
9776    }
9777    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
9778    pub fn as_input(&self) -> InputTypeDef {
9779        let query = self.selection.select("asInput");
9780        InputTypeDef {
9781            proc: self.proc.clone(),
9782            selection: query,
9783            graphql_client: self.graphql_client.clone(),
9784        }
9785    }
9786    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
9787    pub fn as_interface(&self) -> InterfaceTypeDef {
9788        let query = self.selection.select("asInterface");
9789        InterfaceTypeDef {
9790            proc: self.proc.clone(),
9791            selection: query,
9792            graphql_client: self.graphql_client.clone(),
9793        }
9794    }
9795    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
9796    pub fn as_list(&self) -> ListTypeDef {
9797        let query = self.selection.select("asList");
9798        ListTypeDef {
9799            proc: self.proc.clone(),
9800            selection: query,
9801            graphql_client: self.graphql_client.clone(),
9802        }
9803    }
9804    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
9805    pub fn as_object(&self) -> ObjectTypeDef {
9806        let query = self.selection.select("asObject");
9807        ObjectTypeDef {
9808            proc: self.proc.clone(),
9809            selection: query,
9810            graphql_client: self.graphql_client.clone(),
9811        }
9812    }
9813    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
9814    pub fn as_scalar(&self) -> ScalarTypeDef {
9815        let query = self.selection.select("asScalar");
9816        ScalarTypeDef {
9817            proc: self.proc.clone(),
9818            selection: query,
9819            graphql_client: self.graphql_client.clone(),
9820        }
9821    }
9822    /// A unique identifier for this TypeDef.
9823    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
9824        let query = self.selection.select("id");
9825        query.execute(self.graphql_client.clone()).await
9826    }
9827    /// The kind of type this is (e.g. primitive, list, object).
9828    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
9829        let query = self.selection.select("kind");
9830        query.execute(self.graphql_client.clone()).await
9831    }
9832    /// Whether this type can be set to null. Defaults to false.
9833    pub async fn optional(&self) -> Result<bool, DaggerError> {
9834        let query = self.selection.select("optional");
9835        query.execute(self.graphql_client.clone()).await
9836    }
9837    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
9838    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
9839        let mut query = self.selection.select("withConstructor");
9840        query = query.arg_lazy(
9841            "function",
9842            Box::new(move || {
9843                let function = function.clone();
9844                Box::pin(async move { function.into_id().await.unwrap().quote() })
9845            }),
9846        );
9847        TypeDef {
9848            proc: self.proc.clone(),
9849            selection: query,
9850            graphql_client: self.graphql_client.clone(),
9851        }
9852    }
9853    /// Returns a TypeDef of kind Enum with the provided name.
9854    /// 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.
9855    ///
9856    /// # Arguments
9857    ///
9858    /// * `name` - The name of the enum
9859    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9860    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
9861        let mut query = self.selection.select("withEnum");
9862        query = query.arg("name", name.into());
9863        TypeDef {
9864            proc: self.proc.clone(),
9865            selection: query,
9866            graphql_client: self.graphql_client.clone(),
9867        }
9868    }
9869    /// Returns a TypeDef of kind Enum with the provided name.
9870    /// 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.
9871    ///
9872    /// # Arguments
9873    ///
9874    /// * `name` - The name of the enum
9875    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9876    pub fn with_enum_opts<'a>(
9877        &self,
9878        name: impl Into<String>,
9879        opts: TypeDefWithEnumOpts<'a>,
9880    ) -> TypeDef {
9881        let mut query = self.selection.select("withEnum");
9882        query = query.arg("name", name.into());
9883        if let Some(description) = opts.description {
9884            query = query.arg("description", description);
9885        }
9886        if let Some(source_map) = opts.source_map {
9887            query = query.arg("sourceMap", source_map);
9888        }
9889        TypeDef {
9890            proc: self.proc.clone(),
9891            selection: query,
9892            graphql_client: self.graphql_client.clone(),
9893        }
9894    }
9895    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
9896    ///
9897    /// # Arguments
9898    ///
9899    /// * `value` - The name of the value in the enum
9900    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9901    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
9902        let mut query = self.selection.select("withEnumValue");
9903        query = query.arg("value", value.into());
9904        TypeDef {
9905            proc: self.proc.clone(),
9906            selection: query,
9907            graphql_client: self.graphql_client.clone(),
9908        }
9909    }
9910    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
9911    ///
9912    /// # Arguments
9913    ///
9914    /// * `value` - The name of the value in the enum
9915    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9916    pub fn with_enum_value_opts<'a>(
9917        &self,
9918        value: impl Into<String>,
9919        opts: TypeDefWithEnumValueOpts<'a>,
9920    ) -> TypeDef {
9921        let mut query = self.selection.select("withEnumValue");
9922        query = query.arg("value", value.into());
9923        if let Some(description) = opts.description {
9924            query = query.arg("description", description);
9925        }
9926        if let Some(source_map) = opts.source_map {
9927            query = query.arg("sourceMap", source_map);
9928        }
9929        TypeDef {
9930            proc: self.proc.clone(),
9931            selection: query,
9932            graphql_client: self.graphql_client.clone(),
9933        }
9934    }
9935    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
9936    ///
9937    /// # Arguments
9938    ///
9939    /// * `name` - The name of the field in the object
9940    /// * `type_def` - The type of the field
9941    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9942    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
9943        let mut query = self.selection.select("withField");
9944        query = query.arg("name", name.into());
9945        query = query.arg_lazy(
9946            "typeDef",
9947            Box::new(move || {
9948                let type_def = type_def.clone();
9949                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9950            }),
9951        );
9952        TypeDef {
9953            proc: self.proc.clone(),
9954            selection: query,
9955            graphql_client: self.graphql_client.clone(),
9956        }
9957    }
9958    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
9959    ///
9960    /// # Arguments
9961    ///
9962    /// * `name` - The name of the field in the object
9963    /// * `type_def` - The type of the field
9964    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9965    pub fn with_field_opts<'a>(
9966        &self,
9967        name: impl Into<String>,
9968        type_def: impl IntoID<TypeDefId>,
9969        opts: TypeDefWithFieldOpts<'a>,
9970    ) -> TypeDef {
9971        let mut query = self.selection.select("withField");
9972        query = query.arg("name", name.into());
9973        query = query.arg_lazy(
9974            "typeDef",
9975            Box::new(move || {
9976                let type_def = type_def.clone();
9977                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9978            }),
9979        );
9980        if let Some(description) = opts.description {
9981            query = query.arg("description", description);
9982        }
9983        if let Some(source_map) = opts.source_map {
9984            query = query.arg("sourceMap", source_map);
9985        }
9986        TypeDef {
9987            proc: self.proc.clone(),
9988            selection: query,
9989            graphql_client: self.graphql_client.clone(),
9990        }
9991    }
9992    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
9993    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
9994        let mut query = self.selection.select("withFunction");
9995        query = query.arg_lazy(
9996            "function",
9997            Box::new(move || {
9998                let function = function.clone();
9999                Box::pin(async move { function.into_id().await.unwrap().quote() })
10000            }),
10001        );
10002        TypeDef {
10003            proc: self.proc.clone(),
10004            selection: query,
10005            graphql_client: self.graphql_client.clone(),
10006        }
10007    }
10008    /// Returns a TypeDef of kind Interface with the provided name.
10009    ///
10010    /// # Arguments
10011    ///
10012    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10013    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
10014        let mut query = self.selection.select("withInterface");
10015        query = query.arg("name", name.into());
10016        TypeDef {
10017            proc: self.proc.clone(),
10018            selection: query,
10019            graphql_client: self.graphql_client.clone(),
10020        }
10021    }
10022    /// Returns a TypeDef of kind Interface with the provided name.
10023    ///
10024    /// # Arguments
10025    ///
10026    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10027    pub fn with_interface_opts<'a>(
10028        &self,
10029        name: impl Into<String>,
10030        opts: TypeDefWithInterfaceOpts<'a>,
10031    ) -> TypeDef {
10032        let mut query = self.selection.select("withInterface");
10033        query = query.arg("name", name.into());
10034        if let Some(description) = opts.description {
10035            query = query.arg("description", description);
10036        }
10037        if let Some(source_map) = opts.source_map {
10038            query = query.arg("sourceMap", source_map);
10039        }
10040        TypeDef {
10041            proc: self.proc.clone(),
10042            selection: query,
10043            graphql_client: self.graphql_client.clone(),
10044        }
10045    }
10046    /// Sets the kind of the type.
10047    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
10048        let mut query = self.selection.select("withKind");
10049        query = query.arg("kind", kind);
10050        TypeDef {
10051            proc: self.proc.clone(),
10052            selection: query,
10053            graphql_client: self.graphql_client.clone(),
10054        }
10055    }
10056    /// Returns a TypeDef of kind List with the provided type for its elements.
10057    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
10058        let mut query = self.selection.select("withListOf");
10059        query = query.arg_lazy(
10060            "elementType",
10061            Box::new(move || {
10062                let element_type = element_type.clone();
10063                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
10064            }),
10065        );
10066        TypeDef {
10067            proc: self.proc.clone(),
10068            selection: query,
10069            graphql_client: self.graphql_client.clone(),
10070        }
10071    }
10072    /// Returns a TypeDef of kind Object with the provided name.
10073    /// 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.
10074    ///
10075    /// # Arguments
10076    ///
10077    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10078    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
10079        let mut query = self.selection.select("withObject");
10080        query = query.arg("name", name.into());
10081        TypeDef {
10082            proc: self.proc.clone(),
10083            selection: query,
10084            graphql_client: self.graphql_client.clone(),
10085        }
10086    }
10087    /// Returns a TypeDef of kind Object with the provided name.
10088    /// 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.
10089    ///
10090    /// # Arguments
10091    ///
10092    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10093    pub fn with_object_opts<'a>(
10094        &self,
10095        name: impl Into<String>,
10096        opts: TypeDefWithObjectOpts<'a>,
10097    ) -> TypeDef {
10098        let mut query = self.selection.select("withObject");
10099        query = query.arg("name", name.into());
10100        if let Some(description) = opts.description {
10101            query = query.arg("description", description);
10102        }
10103        if let Some(source_map) = opts.source_map {
10104            query = query.arg("sourceMap", source_map);
10105        }
10106        TypeDef {
10107            proc: self.proc.clone(),
10108            selection: query,
10109            graphql_client: self.graphql_client.clone(),
10110        }
10111    }
10112    /// Sets whether this type can be set to null.
10113    pub fn with_optional(&self, optional: bool) -> TypeDef {
10114        let mut query = self.selection.select("withOptional");
10115        query = query.arg("optional", optional);
10116        TypeDef {
10117            proc: self.proc.clone(),
10118            selection: query,
10119            graphql_client: self.graphql_client.clone(),
10120        }
10121    }
10122    /// Returns a TypeDef of kind Scalar with the provided name.
10123    ///
10124    /// # Arguments
10125    ///
10126    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10127    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
10128        let mut query = self.selection.select("withScalar");
10129        query = query.arg("name", name.into());
10130        TypeDef {
10131            proc: self.proc.clone(),
10132            selection: query,
10133            graphql_client: self.graphql_client.clone(),
10134        }
10135    }
10136    /// Returns a TypeDef of kind Scalar with the provided name.
10137    ///
10138    /// # Arguments
10139    ///
10140    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10141    pub fn with_scalar_opts<'a>(
10142        &self,
10143        name: impl Into<String>,
10144        opts: TypeDefWithScalarOpts<'a>,
10145    ) -> TypeDef {
10146        let mut query = self.selection.select("withScalar");
10147        query = query.arg("name", name.into());
10148        if let Some(description) = opts.description {
10149            query = query.arg("description", description);
10150        }
10151        TypeDef {
10152            proc: self.proc.clone(),
10153            selection: query,
10154            graphql_client: self.graphql_client.clone(),
10155        }
10156    }
10157}
10158#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10159pub enum CacheSharingMode {
10160    #[serde(rename = "LOCKED")]
10161    Locked,
10162    #[serde(rename = "PRIVATE")]
10163    Private,
10164    #[serde(rename = "SHARED")]
10165    Shared,
10166}
10167#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10168pub enum ImageLayerCompression {
10169    #[serde(rename = "EStarGZ")]
10170    EStarGz,
10171    #[serde(rename = "Gzip")]
10172    Gzip,
10173    #[serde(rename = "Uncompressed")]
10174    Uncompressed,
10175    #[serde(rename = "Zstd")]
10176    Zstd,
10177}
10178#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10179pub enum ImageMediaTypes {
10180    #[serde(rename = "DockerMediaTypes")]
10181    DockerMediaTypes,
10182    #[serde(rename = "OCIMediaTypes")]
10183    OciMediaTypes,
10184}
10185#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10186pub enum ModuleSourceKind {
10187    #[serde(rename = "DIR_SOURCE")]
10188    DirSource,
10189    #[serde(rename = "GIT_SOURCE")]
10190    GitSource,
10191    #[serde(rename = "LOCAL_SOURCE")]
10192    LocalSource,
10193}
10194#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10195pub enum NetworkProtocol {
10196    #[serde(rename = "TCP")]
10197    Tcp,
10198    #[serde(rename = "UDP")]
10199    Udp,
10200}
10201#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10202pub enum ReturnType {
10203    #[serde(rename = "ANY")]
10204    Any,
10205    #[serde(rename = "FAILURE")]
10206    Failure,
10207    #[serde(rename = "SUCCESS")]
10208    Success,
10209}
10210#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10211pub enum TypeDefKind {
10212    #[serde(rename = "BOOLEAN_KIND")]
10213    BooleanKind,
10214    #[serde(rename = "ENUM_KIND")]
10215    EnumKind,
10216    #[serde(rename = "FLOAT_KIND")]
10217    FloatKind,
10218    #[serde(rename = "INPUT_KIND")]
10219    InputKind,
10220    #[serde(rename = "INTEGER_KIND")]
10221    IntegerKind,
10222    #[serde(rename = "INTERFACE_KIND")]
10223    InterfaceKind,
10224    #[serde(rename = "LIST_KIND")]
10225    ListKind,
10226    #[serde(rename = "OBJECT_KIND")]
10227    ObjectKind,
10228    #[serde(rename = "SCALAR_KIND")]
10229    ScalarKind,
10230    #[serde(rename = "STRING_KIND")]
10231    StringKind,
10232    #[serde(rename = "VOID_KIND")]
10233    VoidKind,
10234}