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    /// The minimum amount of disk space this policy is guaranteed to retain.
5084    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
5085        let query = self.selection.select("reservedSpace");
5086        query.execute(self.graphql_client.clone()).await
5087    }
5088    /// The target number of bytes to keep when pruning.
5089    pub async fn target_space(&self) -> Result<isize, DaggerError> {
5090        let query = self.selection.select("targetSpace");
5091        query.execute(self.graphql_client.clone()).await
5092    }
5093}
5094#[derive(Clone)]
5095pub struct EngineCacheEntry {
5096    pub proc: Option<Arc<DaggerSessionProc>>,
5097    pub selection: Selection,
5098    pub graphql_client: DynGraphQLClient,
5099}
5100impl EngineCacheEntry {
5101    /// Whether the cache entry is actively being used.
5102    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
5103        let query = self.selection.select("activelyUsed");
5104        query.execute(self.graphql_client.clone()).await
5105    }
5106    /// The time the cache entry was created, in Unix nanoseconds.
5107    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
5108        let query = self.selection.select("createdTimeUnixNano");
5109        query.execute(self.graphql_client.clone()).await
5110    }
5111    /// The description of the cache entry.
5112    pub async fn description(&self) -> Result<String, DaggerError> {
5113        let query = self.selection.select("description");
5114        query.execute(self.graphql_client.clone()).await
5115    }
5116    /// The disk space used by the cache entry.
5117    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5118        let query = self.selection.select("diskSpaceBytes");
5119        query.execute(self.graphql_client.clone()).await
5120    }
5121    /// A unique identifier for this EngineCacheEntry.
5122    pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
5123        let query = self.selection.select("id");
5124        query.execute(self.graphql_client.clone()).await
5125    }
5126    /// The most recent time the cache entry was used, in Unix nanoseconds.
5127    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
5128        let query = self.selection.select("mostRecentUseTimeUnixNano");
5129        query.execute(self.graphql_client.clone()).await
5130    }
5131}
5132#[derive(Clone)]
5133pub struct EngineCacheEntrySet {
5134    pub proc: Option<Arc<DaggerSessionProc>>,
5135    pub selection: Selection,
5136    pub graphql_client: DynGraphQLClient,
5137}
5138impl EngineCacheEntrySet {
5139    /// The total disk space used by the cache entries in this set.
5140    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5141        let query = self.selection.select("diskSpaceBytes");
5142        query.execute(self.graphql_client.clone()).await
5143    }
5144    /// The list of individual cache entries in the set
5145    pub fn entries(&self) -> Vec<EngineCacheEntry> {
5146        let query = self.selection.select("entries");
5147        vec![EngineCacheEntry {
5148            proc: self.proc.clone(),
5149            selection: query,
5150            graphql_client: self.graphql_client.clone(),
5151        }]
5152    }
5153    /// The number of cache entries in this set.
5154    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
5155        let query = self.selection.select("entryCount");
5156        query.execute(self.graphql_client.clone()).await
5157    }
5158    /// A unique identifier for this EngineCacheEntrySet.
5159    pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
5160        let query = self.selection.select("id");
5161        query.execute(self.graphql_client.clone()).await
5162    }
5163}
5164#[derive(Clone)]
5165pub struct EnumTypeDef {
5166    pub proc: Option<Arc<DaggerSessionProc>>,
5167    pub selection: Selection,
5168    pub graphql_client: DynGraphQLClient,
5169}
5170impl EnumTypeDef {
5171    /// A doc string for the enum, if any.
5172    pub async fn description(&self) -> Result<String, DaggerError> {
5173        let query = self.selection.select("description");
5174        query.execute(self.graphql_client.clone()).await
5175    }
5176    /// A unique identifier for this EnumTypeDef.
5177    pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
5178        let query = self.selection.select("id");
5179        query.execute(self.graphql_client.clone()).await
5180    }
5181    /// The name of the enum.
5182    pub async fn name(&self) -> Result<String, DaggerError> {
5183        let query = self.selection.select("name");
5184        query.execute(self.graphql_client.clone()).await
5185    }
5186    /// The location of this enum declaration.
5187    pub fn source_map(&self) -> SourceMap {
5188        let query = self.selection.select("sourceMap");
5189        SourceMap {
5190            proc: self.proc.clone(),
5191            selection: query,
5192            graphql_client: self.graphql_client.clone(),
5193        }
5194    }
5195    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
5196    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
5197        let query = self.selection.select("sourceModuleName");
5198        query.execute(self.graphql_client.clone()).await
5199    }
5200    /// The values of the enum.
5201    pub fn values(&self) -> Vec<EnumValueTypeDef> {
5202        let query = self.selection.select("values");
5203        vec![EnumValueTypeDef {
5204            proc: self.proc.clone(),
5205            selection: query,
5206            graphql_client: self.graphql_client.clone(),
5207        }]
5208    }
5209}
5210#[derive(Clone)]
5211pub struct EnumValueTypeDef {
5212    pub proc: Option<Arc<DaggerSessionProc>>,
5213    pub selection: Selection,
5214    pub graphql_client: DynGraphQLClient,
5215}
5216impl EnumValueTypeDef {
5217    /// A doc string for the enum value, if any.
5218    pub async fn description(&self) -> Result<String, DaggerError> {
5219        let query = self.selection.select("description");
5220        query.execute(self.graphql_client.clone()).await
5221    }
5222    /// A unique identifier for this EnumValueTypeDef.
5223    pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
5224        let query = self.selection.select("id");
5225        query.execute(self.graphql_client.clone()).await
5226    }
5227    /// The name of the enum value.
5228    pub async fn name(&self) -> Result<String, DaggerError> {
5229        let query = self.selection.select("name");
5230        query.execute(self.graphql_client.clone()).await
5231    }
5232    /// The location of this enum value declaration.
5233    pub fn source_map(&self) -> SourceMap {
5234        let query = self.selection.select("sourceMap");
5235        SourceMap {
5236            proc: self.proc.clone(),
5237            selection: query,
5238            graphql_client: self.graphql_client.clone(),
5239        }
5240    }
5241}
5242#[derive(Clone)]
5243pub struct Env {
5244    pub proc: Option<Arc<DaggerSessionProc>>,
5245    pub selection: Selection,
5246    pub graphql_client: DynGraphQLClient,
5247}
5248impl Env {
5249    /// A unique identifier for this Env.
5250    pub async fn id(&self) -> Result<EnvId, DaggerError> {
5251        let query = self.selection.select("id");
5252        query.execute(self.graphql_client.clone()).await
5253    }
5254    /// retrieve an input value by name
5255    pub fn input(&self, name: impl Into<String>) -> Binding {
5256        let mut query = self.selection.select("input");
5257        query = query.arg("name", name.into());
5258        Binding {
5259            proc: self.proc.clone(),
5260            selection: query,
5261            graphql_client: self.graphql_client.clone(),
5262        }
5263    }
5264    /// return all input values for the environment
5265    pub fn inputs(&self) -> Vec<Binding> {
5266        let query = self.selection.select("inputs");
5267        vec![Binding {
5268            proc: self.proc.clone(),
5269            selection: query,
5270            graphql_client: self.graphql_client.clone(),
5271        }]
5272    }
5273    /// retrieve an output value by name
5274    pub fn output(&self, name: impl Into<String>) -> Binding {
5275        let mut query = self.selection.select("output");
5276        query = query.arg("name", name.into());
5277        Binding {
5278            proc: self.proc.clone(),
5279            selection: query,
5280            graphql_client: self.graphql_client.clone(),
5281        }
5282    }
5283    /// return all output values for the environment
5284    pub fn outputs(&self) -> Vec<Binding> {
5285        let query = self.selection.select("outputs");
5286        vec![Binding {
5287            proc: self.proc.clone(),
5288            selection: query,
5289            graphql_client: self.graphql_client.clone(),
5290        }]
5291    }
5292    /// Create or update a binding of type CacheVolume in the environment
5293    ///
5294    /// # Arguments
5295    ///
5296    /// * `name` - The name of the binding
5297    /// * `value` - The CacheVolume value to assign to the binding
5298    /// * `description` - The purpose of the input
5299    pub fn with_cache_volume_input(
5300        &self,
5301        name: impl Into<String>,
5302        value: impl IntoID<CacheVolumeId>,
5303        description: impl Into<String>,
5304    ) -> Env {
5305        let mut query = self.selection.select("withCacheVolumeInput");
5306        query = query.arg("name", name.into());
5307        query = query.arg_lazy(
5308            "value",
5309            Box::new(move || {
5310                let value = value.clone();
5311                Box::pin(async move { value.into_id().await.unwrap().quote() })
5312            }),
5313        );
5314        query = query.arg("description", description.into());
5315        Env {
5316            proc: self.proc.clone(),
5317            selection: query,
5318            graphql_client: self.graphql_client.clone(),
5319        }
5320    }
5321    /// Declare a desired CacheVolume output to be assigned in the environment
5322    ///
5323    /// # Arguments
5324    ///
5325    /// * `name` - The name of the binding
5326    /// * `description` - A description of the desired value of the binding
5327    pub fn with_cache_volume_output(
5328        &self,
5329        name: impl Into<String>,
5330        description: impl Into<String>,
5331    ) -> Env {
5332        let mut query = self.selection.select("withCacheVolumeOutput");
5333        query = query.arg("name", name.into());
5334        query = query.arg("description", description.into());
5335        Env {
5336            proc: self.proc.clone(),
5337            selection: query,
5338            graphql_client: self.graphql_client.clone(),
5339        }
5340    }
5341    /// Create or update a binding of type Container in the environment
5342    ///
5343    /// # Arguments
5344    ///
5345    /// * `name` - The name of the binding
5346    /// * `value` - The Container value to assign to the binding
5347    /// * `description` - The purpose of the input
5348    pub fn with_container_input(
5349        &self,
5350        name: impl Into<String>,
5351        value: impl IntoID<ContainerId>,
5352        description: impl Into<String>,
5353    ) -> Env {
5354        let mut query = self.selection.select("withContainerInput");
5355        query = query.arg("name", name.into());
5356        query = query.arg_lazy(
5357            "value",
5358            Box::new(move || {
5359                let value = value.clone();
5360                Box::pin(async move { value.into_id().await.unwrap().quote() })
5361            }),
5362        );
5363        query = query.arg("description", description.into());
5364        Env {
5365            proc: self.proc.clone(),
5366            selection: query,
5367            graphql_client: self.graphql_client.clone(),
5368        }
5369    }
5370    /// Declare a desired Container output to be assigned in the environment
5371    ///
5372    /// # Arguments
5373    ///
5374    /// * `name` - The name of the binding
5375    /// * `description` - A description of the desired value of the binding
5376    pub fn with_container_output(
5377        &self,
5378        name: impl Into<String>,
5379        description: impl Into<String>,
5380    ) -> Env {
5381        let mut query = self.selection.select("withContainerOutput");
5382        query = query.arg("name", name.into());
5383        query = query.arg("description", description.into());
5384        Env {
5385            proc: self.proc.clone(),
5386            selection: query,
5387            graphql_client: self.graphql_client.clone(),
5388        }
5389    }
5390    /// Create or update a binding of type Directory in the environment
5391    ///
5392    /// # Arguments
5393    ///
5394    /// * `name` - The name of the binding
5395    /// * `value` - The Directory value to assign to the binding
5396    /// * `description` - The purpose of the input
5397    pub fn with_directory_input(
5398        &self,
5399        name: impl Into<String>,
5400        value: impl IntoID<DirectoryId>,
5401        description: impl Into<String>,
5402    ) -> Env {
5403        let mut query = self.selection.select("withDirectoryInput");
5404        query = query.arg("name", name.into());
5405        query = query.arg_lazy(
5406            "value",
5407            Box::new(move || {
5408                let value = value.clone();
5409                Box::pin(async move { value.into_id().await.unwrap().quote() })
5410            }),
5411        );
5412        query = query.arg("description", description.into());
5413        Env {
5414            proc: self.proc.clone(),
5415            selection: query,
5416            graphql_client: self.graphql_client.clone(),
5417        }
5418    }
5419    /// Declare a desired Directory output to be assigned in the environment
5420    ///
5421    /// # Arguments
5422    ///
5423    /// * `name` - The name of the binding
5424    /// * `description` - A description of the desired value of the binding
5425    pub fn with_directory_output(
5426        &self,
5427        name: impl Into<String>,
5428        description: impl Into<String>,
5429    ) -> Env {
5430        let mut query = self.selection.select("withDirectoryOutput");
5431        query = query.arg("name", name.into());
5432        query = query.arg("description", description.into());
5433        Env {
5434            proc: self.proc.clone(),
5435            selection: query,
5436            graphql_client: self.graphql_client.clone(),
5437        }
5438    }
5439    /// Create or update a binding of type Env in the environment
5440    ///
5441    /// # Arguments
5442    ///
5443    /// * `name` - The name of the binding
5444    /// * `value` - The Env value to assign to the binding
5445    /// * `description` - The purpose of the input
5446    pub fn with_env_input(
5447        &self,
5448        name: impl Into<String>,
5449        value: impl IntoID<EnvId>,
5450        description: impl Into<String>,
5451    ) -> Env {
5452        let mut query = self.selection.select("withEnvInput");
5453        query = query.arg("name", name.into());
5454        query = query.arg_lazy(
5455            "value",
5456            Box::new(move || {
5457                let value = value.clone();
5458                Box::pin(async move { value.into_id().await.unwrap().quote() })
5459            }),
5460        );
5461        query = query.arg("description", description.into());
5462        Env {
5463            proc: self.proc.clone(),
5464            selection: query,
5465            graphql_client: self.graphql_client.clone(),
5466        }
5467    }
5468    /// Declare a desired Env output to be assigned in the environment
5469    ///
5470    /// # Arguments
5471    ///
5472    /// * `name` - The name of the binding
5473    /// * `description` - A description of the desired value of the binding
5474    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
5475        let mut query = self.selection.select("withEnvOutput");
5476        query = query.arg("name", name.into());
5477        query = query.arg("description", description.into());
5478        Env {
5479            proc: self.proc.clone(),
5480            selection: query,
5481            graphql_client: self.graphql_client.clone(),
5482        }
5483    }
5484    /// Create or update a binding of type File in the environment
5485    ///
5486    /// # Arguments
5487    ///
5488    /// * `name` - The name of the binding
5489    /// * `value` - The File value to assign to the binding
5490    /// * `description` - The purpose of the input
5491    pub fn with_file_input(
5492        &self,
5493        name: impl Into<String>,
5494        value: impl IntoID<FileId>,
5495        description: impl Into<String>,
5496    ) -> Env {
5497        let mut query = self.selection.select("withFileInput");
5498        query = query.arg("name", name.into());
5499        query = query.arg_lazy(
5500            "value",
5501            Box::new(move || {
5502                let value = value.clone();
5503                Box::pin(async move { value.into_id().await.unwrap().quote() })
5504            }),
5505        );
5506        query = query.arg("description", description.into());
5507        Env {
5508            proc: self.proc.clone(),
5509            selection: query,
5510            graphql_client: self.graphql_client.clone(),
5511        }
5512    }
5513    /// Declare a desired File output to be assigned in the environment
5514    ///
5515    /// # Arguments
5516    ///
5517    /// * `name` - The name of the binding
5518    /// * `description` - A description of the desired value of the binding
5519    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
5520        let mut query = self.selection.select("withFileOutput");
5521        query = query.arg("name", name.into());
5522        query = query.arg("description", description.into());
5523        Env {
5524            proc: self.proc.clone(),
5525            selection: query,
5526            graphql_client: self.graphql_client.clone(),
5527        }
5528    }
5529    /// Create or update a binding of type GitRef in the environment
5530    ///
5531    /// # Arguments
5532    ///
5533    /// * `name` - The name of the binding
5534    /// * `value` - The GitRef value to assign to the binding
5535    /// * `description` - The purpose of the input
5536    pub fn with_git_ref_input(
5537        &self,
5538        name: impl Into<String>,
5539        value: impl IntoID<GitRefId>,
5540        description: impl Into<String>,
5541    ) -> Env {
5542        let mut query = self.selection.select("withGitRefInput");
5543        query = query.arg("name", name.into());
5544        query = query.arg_lazy(
5545            "value",
5546            Box::new(move || {
5547                let value = value.clone();
5548                Box::pin(async move { value.into_id().await.unwrap().quote() })
5549            }),
5550        );
5551        query = query.arg("description", description.into());
5552        Env {
5553            proc: self.proc.clone(),
5554            selection: query,
5555            graphql_client: self.graphql_client.clone(),
5556        }
5557    }
5558    /// Declare a desired GitRef output to be assigned in the environment
5559    ///
5560    /// # Arguments
5561    ///
5562    /// * `name` - The name of the binding
5563    /// * `description` - A description of the desired value of the binding
5564    pub fn with_git_ref_output(
5565        &self,
5566        name: impl Into<String>,
5567        description: impl Into<String>,
5568    ) -> Env {
5569        let mut query = self.selection.select("withGitRefOutput");
5570        query = query.arg("name", name.into());
5571        query = query.arg("description", description.into());
5572        Env {
5573            proc: self.proc.clone(),
5574            selection: query,
5575            graphql_client: self.graphql_client.clone(),
5576        }
5577    }
5578    /// Create or update a binding of type GitRepository in the environment
5579    ///
5580    /// # Arguments
5581    ///
5582    /// * `name` - The name of the binding
5583    /// * `value` - The GitRepository value to assign to the binding
5584    /// * `description` - The purpose of the input
5585    pub fn with_git_repository_input(
5586        &self,
5587        name: impl Into<String>,
5588        value: impl IntoID<GitRepositoryId>,
5589        description: impl Into<String>,
5590    ) -> Env {
5591        let mut query = self.selection.select("withGitRepositoryInput");
5592        query = query.arg("name", name.into());
5593        query = query.arg_lazy(
5594            "value",
5595            Box::new(move || {
5596                let value = value.clone();
5597                Box::pin(async move { value.into_id().await.unwrap().quote() })
5598            }),
5599        );
5600        query = query.arg("description", description.into());
5601        Env {
5602            proc: self.proc.clone(),
5603            selection: query,
5604            graphql_client: self.graphql_client.clone(),
5605        }
5606    }
5607    /// Declare a desired GitRepository output to be assigned in the environment
5608    ///
5609    /// # Arguments
5610    ///
5611    /// * `name` - The name of the binding
5612    /// * `description` - A description of the desired value of the binding
5613    pub fn with_git_repository_output(
5614        &self,
5615        name: impl Into<String>,
5616        description: impl Into<String>,
5617    ) -> Env {
5618        let mut query = self.selection.select("withGitRepositoryOutput");
5619        query = query.arg("name", name.into());
5620        query = query.arg("description", description.into());
5621        Env {
5622            proc: self.proc.clone(),
5623            selection: query,
5624            graphql_client: self.graphql_client.clone(),
5625        }
5626    }
5627    /// Create or update a binding of type LLM in the environment
5628    ///
5629    /// # Arguments
5630    ///
5631    /// * `name` - The name of the binding
5632    /// * `value` - The LLM value to assign to the binding
5633    /// * `description` - The purpose of the input
5634    pub fn with_llm_input(
5635        &self,
5636        name: impl Into<String>,
5637        value: impl IntoID<Llmid>,
5638        description: impl Into<String>,
5639    ) -> Env {
5640        let mut query = self.selection.select("withLLMInput");
5641        query = query.arg("name", name.into());
5642        query = query.arg_lazy(
5643            "value",
5644            Box::new(move || {
5645                let value = value.clone();
5646                Box::pin(async move { value.into_id().await.unwrap().quote() })
5647            }),
5648        );
5649        query = query.arg("description", description.into());
5650        Env {
5651            proc: self.proc.clone(),
5652            selection: query,
5653            graphql_client: self.graphql_client.clone(),
5654        }
5655    }
5656    /// Declare a desired LLM output to be assigned in the environment
5657    ///
5658    /// # Arguments
5659    ///
5660    /// * `name` - The name of the binding
5661    /// * `description` - A description of the desired value of the binding
5662    pub fn with_llm_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
5663        let mut query = self.selection.select("withLLMOutput");
5664        query = query.arg("name", name.into());
5665        query = query.arg("description", description.into());
5666        Env {
5667            proc: self.proc.clone(),
5668            selection: query,
5669            graphql_client: self.graphql_client.clone(),
5670        }
5671    }
5672    /// Create or update a binding of type ModuleConfigClient in the environment
5673    ///
5674    /// # Arguments
5675    ///
5676    /// * `name` - The name of the binding
5677    /// * `value` - The ModuleConfigClient value to assign to the binding
5678    /// * `description` - The purpose of the input
5679    pub fn with_module_config_client_input(
5680        &self,
5681        name: impl Into<String>,
5682        value: impl IntoID<ModuleConfigClientId>,
5683        description: impl Into<String>,
5684    ) -> Env {
5685        let mut query = self.selection.select("withModuleConfigClientInput");
5686        query = query.arg("name", name.into());
5687        query = query.arg_lazy(
5688            "value",
5689            Box::new(move || {
5690                let value = value.clone();
5691                Box::pin(async move { value.into_id().await.unwrap().quote() })
5692            }),
5693        );
5694        query = query.arg("description", description.into());
5695        Env {
5696            proc: self.proc.clone(),
5697            selection: query,
5698            graphql_client: self.graphql_client.clone(),
5699        }
5700    }
5701    /// Declare a desired ModuleConfigClient output to be assigned in the environment
5702    ///
5703    /// # Arguments
5704    ///
5705    /// * `name` - The name of the binding
5706    /// * `description` - A description of the desired value of the binding
5707    pub fn with_module_config_client_output(
5708        &self,
5709        name: impl Into<String>,
5710        description: impl Into<String>,
5711    ) -> Env {
5712        let mut query = self.selection.select("withModuleConfigClientOutput");
5713        query = query.arg("name", name.into());
5714        query = query.arg("description", description.into());
5715        Env {
5716            proc: self.proc.clone(),
5717            selection: query,
5718            graphql_client: self.graphql_client.clone(),
5719        }
5720    }
5721    /// Create or update a binding of type Module in the environment
5722    ///
5723    /// # Arguments
5724    ///
5725    /// * `name` - The name of the binding
5726    /// * `value` - The Module value to assign to the binding
5727    /// * `description` - The purpose of the input
5728    pub fn with_module_input(
5729        &self,
5730        name: impl Into<String>,
5731        value: impl IntoID<ModuleId>,
5732        description: impl Into<String>,
5733    ) -> Env {
5734        let mut query = self.selection.select("withModuleInput");
5735        query = query.arg("name", name.into());
5736        query = query.arg_lazy(
5737            "value",
5738            Box::new(move || {
5739                let value = value.clone();
5740                Box::pin(async move { value.into_id().await.unwrap().quote() })
5741            }),
5742        );
5743        query = query.arg("description", description.into());
5744        Env {
5745            proc: self.proc.clone(),
5746            selection: query,
5747            graphql_client: self.graphql_client.clone(),
5748        }
5749    }
5750    /// Declare a desired Module output to be assigned in the environment
5751    ///
5752    /// # Arguments
5753    ///
5754    /// * `name` - The name of the binding
5755    /// * `description` - A description of the desired value of the binding
5756    pub fn with_module_output(
5757        &self,
5758        name: impl Into<String>,
5759        description: impl Into<String>,
5760    ) -> Env {
5761        let mut query = self.selection.select("withModuleOutput");
5762        query = query.arg("name", name.into());
5763        query = query.arg("description", description.into());
5764        Env {
5765            proc: self.proc.clone(),
5766            selection: query,
5767            graphql_client: self.graphql_client.clone(),
5768        }
5769    }
5770    /// Create or update a binding of type ModuleSource in the environment
5771    ///
5772    /// # Arguments
5773    ///
5774    /// * `name` - The name of the binding
5775    /// * `value` - The ModuleSource value to assign to the binding
5776    /// * `description` - The purpose of the input
5777    pub fn with_module_source_input(
5778        &self,
5779        name: impl Into<String>,
5780        value: impl IntoID<ModuleSourceId>,
5781        description: impl Into<String>,
5782    ) -> Env {
5783        let mut query = self.selection.select("withModuleSourceInput");
5784        query = query.arg("name", name.into());
5785        query = query.arg_lazy(
5786            "value",
5787            Box::new(move || {
5788                let value = value.clone();
5789                Box::pin(async move { value.into_id().await.unwrap().quote() })
5790            }),
5791        );
5792        query = query.arg("description", description.into());
5793        Env {
5794            proc: self.proc.clone(),
5795            selection: query,
5796            graphql_client: self.graphql_client.clone(),
5797        }
5798    }
5799    /// Declare a desired ModuleSource output to be assigned in the environment
5800    ///
5801    /// # Arguments
5802    ///
5803    /// * `name` - The name of the binding
5804    /// * `description` - A description of the desired value of the binding
5805    pub fn with_module_source_output(
5806        &self,
5807        name: impl Into<String>,
5808        description: impl Into<String>,
5809    ) -> Env {
5810        let mut query = self.selection.select("withModuleSourceOutput");
5811        query = query.arg("name", name.into());
5812        query = query.arg("description", description.into());
5813        Env {
5814            proc: self.proc.clone(),
5815            selection: query,
5816            graphql_client: self.graphql_client.clone(),
5817        }
5818    }
5819    /// Create or update a binding of type Secret in the environment
5820    ///
5821    /// # Arguments
5822    ///
5823    /// * `name` - The name of the binding
5824    /// * `value` - The Secret value to assign to the binding
5825    /// * `description` - The purpose of the input
5826    pub fn with_secret_input(
5827        &self,
5828        name: impl Into<String>,
5829        value: impl IntoID<SecretId>,
5830        description: impl Into<String>,
5831    ) -> Env {
5832        let mut query = self.selection.select("withSecretInput");
5833        query = query.arg("name", name.into());
5834        query = query.arg_lazy(
5835            "value",
5836            Box::new(move || {
5837                let value = value.clone();
5838                Box::pin(async move { value.into_id().await.unwrap().quote() })
5839            }),
5840        );
5841        query = query.arg("description", description.into());
5842        Env {
5843            proc: self.proc.clone(),
5844            selection: query,
5845            graphql_client: self.graphql_client.clone(),
5846        }
5847    }
5848    /// Declare a desired Secret output to be assigned in the environment
5849    ///
5850    /// # Arguments
5851    ///
5852    /// * `name` - The name of the binding
5853    /// * `description` - A description of the desired value of the binding
5854    pub fn with_secret_output(
5855        &self,
5856        name: impl Into<String>,
5857        description: impl Into<String>,
5858    ) -> Env {
5859        let mut query = self.selection.select("withSecretOutput");
5860        query = query.arg("name", name.into());
5861        query = query.arg("description", description.into());
5862        Env {
5863            proc: self.proc.clone(),
5864            selection: query,
5865            graphql_client: self.graphql_client.clone(),
5866        }
5867    }
5868    /// Create or update a binding of type Service in the environment
5869    ///
5870    /// # Arguments
5871    ///
5872    /// * `name` - The name of the binding
5873    /// * `value` - The Service value to assign to the binding
5874    /// * `description` - The purpose of the input
5875    pub fn with_service_input(
5876        &self,
5877        name: impl Into<String>,
5878        value: impl IntoID<ServiceId>,
5879        description: impl Into<String>,
5880    ) -> Env {
5881        let mut query = self.selection.select("withServiceInput");
5882        query = query.arg("name", name.into());
5883        query = query.arg_lazy(
5884            "value",
5885            Box::new(move || {
5886                let value = value.clone();
5887                Box::pin(async move { value.into_id().await.unwrap().quote() })
5888            }),
5889        );
5890        query = query.arg("description", description.into());
5891        Env {
5892            proc: self.proc.clone(),
5893            selection: query,
5894            graphql_client: self.graphql_client.clone(),
5895        }
5896    }
5897    /// Declare a desired Service output to be assigned in the environment
5898    ///
5899    /// # Arguments
5900    ///
5901    /// * `name` - The name of the binding
5902    /// * `description` - A description of the desired value of the binding
5903    pub fn with_service_output(
5904        &self,
5905        name: impl Into<String>,
5906        description: impl Into<String>,
5907    ) -> Env {
5908        let mut query = self.selection.select("withServiceOutput");
5909        query = query.arg("name", name.into());
5910        query = query.arg("description", description.into());
5911        Env {
5912            proc: self.proc.clone(),
5913            selection: query,
5914            graphql_client: self.graphql_client.clone(),
5915        }
5916    }
5917    /// Create or update a binding of type Socket in the environment
5918    ///
5919    /// # Arguments
5920    ///
5921    /// * `name` - The name of the binding
5922    /// * `value` - The Socket value to assign to the binding
5923    /// * `description` - The purpose of the input
5924    pub fn with_socket_input(
5925        &self,
5926        name: impl Into<String>,
5927        value: impl IntoID<SocketId>,
5928        description: impl Into<String>,
5929    ) -> Env {
5930        let mut query = self.selection.select("withSocketInput");
5931        query = query.arg("name", name.into());
5932        query = query.arg_lazy(
5933            "value",
5934            Box::new(move || {
5935                let value = value.clone();
5936                Box::pin(async move { value.into_id().await.unwrap().quote() })
5937            }),
5938        );
5939        query = query.arg("description", description.into());
5940        Env {
5941            proc: self.proc.clone(),
5942            selection: query,
5943            graphql_client: self.graphql_client.clone(),
5944        }
5945    }
5946    /// Declare a desired Socket output to be assigned in the environment
5947    ///
5948    /// # Arguments
5949    ///
5950    /// * `name` - The name of the binding
5951    /// * `description` - A description of the desired value of the binding
5952    pub fn with_socket_output(
5953        &self,
5954        name: impl Into<String>,
5955        description: impl Into<String>,
5956    ) -> Env {
5957        let mut query = self.selection.select("withSocketOutput");
5958        query = query.arg("name", name.into());
5959        query = query.arg("description", description.into());
5960        Env {
5961            proc: self.proc.clone(),
5962            selection: query,
5963            graphql_client: self.graphql_client.clone(),
5964        }
5965    }
5966    /// Create or update an input value of type string
5967    ///
5968    /// # Arguments
5969    ///
5970    /// * `name` - The name of the binding
5971    /// * `value` - The string value to assign to the binding
5972    /// * `description` - The description of the input
5973    pub fn with_string_input(
5974        &self,
5975        name: impl Into<String>,
5976        value: impl Into<String>,
5977        description: impl Into<String>,
5978    ) -> Env {
5979        let mut query = self.selection.select("withStringInput");
5980        query = query.arg("name", name.into());
5981        query = query.arg("value", value.into());
5982        query = query.arg("description", description.into());
5983        Env {
5984            proc: self.proc.clone(),
5985            selection: query,
5986            graphql_client: self.graphql_client.clone(),
5987        }
5988    }
5989    /// Create or update an input value of type string
5990    ///
5991    /// # Arguments
5992    ///
5993    /// * `name` - The name of the binding
5994    /// * `description` - The description of the output
5995    pub fn with_string_output(
5996        &self,
5997        name: impl Into<String>,
5998        description: impl Into<String>,
5999    ) -> Env {
6000        let mut query = self.selection.select("withStringOutput");
6001        query = query.arg("name", name.into());
6002        query = query.arg("description", description.into());
6003        Env {
6004            proc: self.proc.clone(),
6005            selection: query,
6006            graphql_client: self.graphql_client.clone(),
6007        }
6008    }
6009}
6010#[derive(Clone)]
6011pub struct EnvVariable {
6012    pub proc: Option<Arc<DaggerSessionProc>>,
6013    pub selection: Selection,
6014    pub graphql_client: DynGraphQLClient,
6015}
6016impl EnvVariable {
6017    /// A unique identifier for this EnvVariable.
6018    pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
6019        let query = self.selection.select("id");
6020        query.execute(self.graphql_client.clone()).await
6021    }
6022    /// The environment variable name.
6023    pub async fn name(&self) -> Result<String, DaggerError> {
6024        let query = self.selection.select("name");
6025        query.execute(self.graphql_client.clone()).await
6026    }
6027    /// The environment variable value.
6028    pub async fn value(&self) -> Result<String, DaggerError> {
6029        let query = self.selection.select("value");
6030        query.execute(self.graphql_client.clone()).await
6031    }
6032}
6033#[derive(Clone)]
6034pub struct Error {
6035    pub proc: Option<Arc<DaggerSessionProc>>,
6036    pub selection: Selection,
6037    pub graphql_client: DynGraphQLClient,
6038}
6039impl Error {
6040    /// A unique identifier for this Error.
6041    pub async fn id(&self) -> Result<ErrorId, DaggerError> {
6042        let query = self.selection.select("id");
6043        query.execute(self.graphql_client.clone()).await
6044    }
6045    /// A description of the error.
6046    pub async fn message(&self) -> Result<String, DaggerError> {
6047        let query = self.selection.select("message");
6048        query.execute(self.graphql_client.clone()).await
6049    }
6050    /// The extensions of the error.
6051    pub fn values(&self) -> Vec<ErrorValue> {
6052        let query = self.selection.select("values");
6053        vec![ErrorValue {
6054            proc: self.proc.clone(),
6055            selection: query,
6056            graphql_client: self.graphql_client.clone(),
6057        }]
6058    }
6059    /// Add a value to the error.
6060    ///
6061    /// # Arguments
6062    ///
6063    /// * `name` - The name of the value.
6064    /// * `value` - The value to store on the error.
6065    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
6066        let mut query = self.selection.select("withValue");
6067        query = query.arg("name", name.into());
6068        query = query.arg("value", value);
6069        Error {
6070            proc: self.proc.clone(),
6071            selection: query,
6072            graphql_client: self.graphql_client.clone(),
6073        }
6074    }
6075}
6076#[derive(Clone)]
6077pub struct ErrorValue {
6078    pub proc: Option<Arc<DaggerSessionProc>>,
6079    pub selection: Selection,
6080    pub graphql_client: DynGraphQLClient,
6081}
6082impl ErrorValue {
6083    /// A unique identifier for this ErrorValue.
6084    pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
6085        let query = self.selection.select("id");
6086        query.execute(self.graphql_client.clone()).await
6087    }
6088    /// The name of the value.
6089    pub async fn name(&self) -> Result<String, DaggerError> {
6090        let query = self.selection.select("name");
6091        query.execute(self.graphql_client.clone()).await
6092    }
6093    /// The value.
6094    pub async fn value(&self) -> Result<Json, DaggerError> {
6095        let query = self.selection.select("value");
6096        query.execute(self.graphql_client.clone()).await
6097    }
6098}
6099#[derive(Clone)]
6100pub struct FieldTypeDef {
6101    pub proc: Option<Arc<DaggerSessionProc>>,
6102    pub selection: Selection,
6103    pub graphql_client: DynGraphQLClient,
6104}
6105impl FieldTypeDef {
6106    /// A doc string for the field, if any.
6107    pub async fn description(&self) -> Result<String, DaggerError> {
6108        let query = self.selection.select("description");
6109        query.execute(self.graphql_client.clone()).await
6110    }
6111    /// A unique identifier for this FieldTypeDef.
6112    pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
6113        let query = self.selection.select("id");
6114        query.execute(self.graphql_client.clone()).await
6115    }
6116    /// The name of the field in lowerCamelCase format.
6117    pub async fn name(&self) -> Result<String, DaggerError> {
6118        let query = self.selection.select("name");
6119        query.execute(self.graphql_client.clone()).await
6120    }
6121    /// The location of this field declaration.
6122    pub fn source_map(&self) -> SourceMap {
6123        let query = self.selection.select("sourceMap");
6124        SourceMap {
6125            proc: self.proc.clone(),
6126            selection: query,
6127            graphql_client: self.graphql_client.clone(),
6128        }
6129    }
6130    /// The type of the field.
6131    pub fn type_def(&self) -> TypeDef {
6132        let query = self.selection.select("typeDef");
6133        TypeDef {
6134            proc: self.proc.clone(),
6135            selection: query,
6136            graphql_client: self.graphql_client.clone(),
6137        }
6138    }
6139}
6140#[derive(Clone)]
6141pub struct File {
6142    pub proc: Option<Arc<DaggerSessionProc>>,
6143    pub selection: Selection,
6144    pub graphql_client: DynGraphQLClient,
6145}
6146#[derive(Builder, Debug, PartialEq)]
6147pub struct FileDigestOpts {
6148    /// If true, exclude metadata from the digest.
6149    #[builder(setter(into, strip_option), default)]
6150    pub exclude_metadata: Option<bool>,
6151}
6152#[derive(Builder, Debug, PartialEq)]
6153pub struct FileExportOpts {
6154    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
6155    #[builder(setter(into, strip_option), default)]
6156    pub allow_parent_dir_path: Option<bool>,
6157}
6158impl File {
6159    /// Retrieves the contents of the file.
6160    pub async fn contents(&self) -> Result<String, DaggerError> {
6161        let query = self.selection.select("contents");
6162        query.execute(self.graphql_client.clone()).await
6163    }
6164    /// 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.
6165    ///
6166    /// # Arguments
6167    ///
6168    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6169    pub async fn digest(&self) -> Result<String, DaggerError> {
6170        let query = self.selection.select("digest");
6171        query.execute(self.graphql_client.clone()).await
6172    }
6173    /// 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.
6174    ///
6175    /// # Arguments
6176    ///
6177    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6178    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
6179        let mut query = self.selection.select("digest");
6180        if let Some(exclude_metadata) = opts.exclude_metadata {
6181            query = query.arg("excludeMetadata", exclude_metadata);
6182        }
6183        query.execute(self.graphql_client.clone()).await
6184    }
6185    /// Writes the file to a file path on the host.
6186    ///
6187    /// # Arguments
6188    ///
6189    /// * `path` - Location of the written directory (e.g., "output.txt").
6190    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6191    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
6192        let mut query = self.selection.select("export");
6193        query = query.arg("path", path.into());
6194        query.execute(self.graphql_client.clone()).await
6195    }
6196    /// Writes the file to a file path on the host.
6197    ///
6198    /// # Arguments
6199    ///
6200    /// * `path` - Location of the written directory (e.g., "output.txt").
6201    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6202    pub async fn export_opts(
6203        &self,
6204        path: impl Into<String>,
6205        opts: FileExportOpts,
6206    ) -> Result<String, DaggerError> {
6207        let mut query = self.selection.select("export");
6208        query = query.arg("path", path.into());
6209        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
6210            query = query.arg("allowParentDirPath", allow_parent_dir_path);
6211        }
6212        query.execute(self.graphql_client.clone()).await
6213    }
6214    /// A unique identifier for this File.
6215    pub async fn id(&self) -> Result<FileId, DaggerError> {
6216        let query = self.selection.select("id");
6217        query.execute(self.graphql_client.clone()).await
6218    }
6219    /// Retrieves the name of the file.
6220    pub async fn name(&self) -> Result<String, DaggerError> {
6221        let query = self.selection.select("name");
6222        query.execute(self.graphql_client.clone()).await
6223    }
6224    /// Retrieves the size of the file, in bytes.
6225    pub async fn size(&self) -> Result<isize, DaggerError> {
6226        let query = self.selection.select("size");
6227        query.execute(self.graphql_client.clone()).await
6228    }
6229    /// Force evaluation in the engine.
6230    pub async fn sync(&self) -> Result<FileId, DaggerError> {
6231        let query = self.selection.select("sync");
6232        query.execute(self.graphql_client.clone()).await
6233    }
6234    /// Retrieves this file with its name set to the given name.
6235    ///
6236    /// # Arguments
6237    ///
6238    /// * `name` - Name to set file to.
6239    pub fn with_name(&self, name: impl Into<String>) -> File {
6240        let mut query = self.selection.select("withName");
6241        query = query.arg("name", name.into());
6242        File {
6243            proc: self.proc.clone(),
6244            selection: query,
6245            graphql_client: self.graphql_client.clone(),
6246        }
6247    }
6248    /// Retrieves this file with its created/modified timestamps set to the given time.
6249    ///
6250    /// # Arguments
6251    ///
6252    /// * `timestamp` - Timestamp to set dir/files in.
6253    ///
6254    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
6255    pub fn with_timestamps(&self, timestamp: isize) -> File {
6256        let mut query = self.selection.select("withTimestamps");
6257        query = query.arg("timestamp", timestamp);
6258        File {
6259            proc: self.proc.clone(),
6260            selection: query,
6261            graphql_client: self.graphql_client.clone(),
6262        }
6263    }
6264}
6265#[derive(Clone)]
6266pub struct Function {
6267    pub proc: Option<Arc<DaggerSessionProc>>,
6268    pub selection: Selection,
6269    pub graphql_client: DynGraphQLClient,
6270}
6271#[derive(Builder, Debug, PartialEq)]
6272pub struct FunctionWithArgOpts<'a> {
6273    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
6274    #[builder(setter(into, strip_option), default)]
6275    pub default_path: Option<&'a str>,
6276    /// A default value to use for this argument if not explicitly set by the caller, if any
6277    #[builder(setter(into, strip_option), default)]
6278    pub default_value: Option<Json>,
6279    /// A doc string for the argument, if any
6280    #[builder(setter(into, strip_option), default)]
6281    pub description: Option<&'a str>,
6282    /// Patterns to ignore when loading the contextual argument value.
6283    #[builder(setter(into, strip_option), default)]
6284    pub ignore: Option<Vec<&'a str>>,
6285    /// The source map for the argument definition.
6286    #[builder(setter(into, strip_option), default)]
6287    pub source_map: Option<SourceMapId>,
6288}
6289impl Function {
6290    /// Arguments accepted by the function, if any.
6291    pub fn args(&self) -> Vec<FunctionArg> {
6292        let query = self.selection.select("args");
6293        vec![FunctionArg {
6294            proc: self.proc.clone(),
6295            selection: query,
6296            graphql_client: self.graphql_client.clone(),
6297        }]
6298    }
6299    /// A doc string for the function, if any.
6300    pub async fn description(&self) -> Result<String, DaggerError> {
6301        let query = self.selection.select("description");
6302        query.execute(self.graphql_client.clone()).await
6303    }
6304    /// A unique identifier for this Function.
6305    pub async fn id(&self) -> Result<FunctionId, DaggerError> {
6306        let query = self.selection.select("id");
6307        query.execute(self.graphql_client.clone()).await
6308    }
6309    /// The name of the function.
6310    pub async fn name(&self) -> Result<String, DaggerError> {
6311        let query = self.selection.select("name");
6312        query.execute(self.graphql_client.clone()).await
6313    }
6314    /// The type returned by the function.
6315    pub fn return_type(&self) -> TypeDef {
6316        let query = self.selection.select("returnType");
6317        TypeDef {
6318            proc: self.proc.clone(),
6319            selection: query,
6320            graphql_client: self.graphql_client.clone(),
6321        }
6322    }
6323    /// The location of this function declaration.
6324    pub fn source_map(&self) -> SourceMap {
6325        let query = self.selection.select("sourceMap");
6326        SourceMap {
6327            proc: self.proc.clone(),
6328            selection: query,
6329            graphql_client: self.graphql_client.clone(),
6330        }
6331    }
6332    /// Returns the function with the provided argument
6333    ///
6334    /// # Arguments
6335    ///
6336    /// * `name` - The name of the argument
6337    /// * `type_def` - The type of the argument
6338    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6339    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
6340        let mut query = self.selection.select("withArg");
6341        query = query.arg("name", name.into());
6342        query = query.arg_lazy(
6343            "typeDef",
6344            Box::new(move || {
6345                let type_def = type_def.clone();
6346                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
6347            }),
6348        );
6349        Function {
6350            proc: self.proc.clone(),
6351            selection: query,
6352            graphql_client: self.graphql_client.clone(),
6353        }
6354    }
6355    /// Returns the function with the provided argument
6356    ///
6357    /// # Arguments
6358    ///
6359    /// * `name` - The name of the argument
6360    /// * `type_def` - The type of the argument
6361    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6362    pub fn with_arg_opts<'a>(
6363        &self,
6364        name: impl Into<String>,
6365        type_def: impl IntoID<TypeDefId>,
6366        opts: FunctionWithArgOpts<'a>,
6367    ) -> Function {
6368        let mut query = self.selection.select("withArg");
6369        query = query.arg("name", name.into());
6370        query = query.arg_lazy(
6371            "typeDef",
6372            Box::new(move || {
6373                let type_def = type_def.clone();
6374                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
6375            }),
6376        );
6377        if let Some(description) = opts.description {
6378            query = query.arg("description", description);
6379        }
6380        if let Some(default_value) = opts.default_value {
6381            query = query.arg("defaultValue", default_value);
6382        }
6383        if let Some(default_path) = opts.default_path {
6384            query = query.arg("defaultPath", default_path);
6385        }
6386        if let Some(ignore) = opts.ignore {
6387            query = query.arg("ignore", ignore);
6388        }
6389        if let Some(source_map) = opts.source_map {
6390            query = query.arg("sourceMap", source_map);
6391        }
6392        Function {
6393            proc: self.proc.clone(),
6394            selection: query,
6395            graphql_client: self.graphql_client.clone(),
6396        }
6397    }
6398    /// Returns the function with the given doc string.
6399    ///
6400    /// # Arguments
6401    ///
6402    /// * `description` - The doc string to set.
6403    pub fn with_description(&self, description: impl Into<String>) -> Function {
6404        let mut query = self.selection.select("withDescription");
6405        query = query.arg("description", description.into());
6406        Function {
6407            proc: self.proc.clone(),
6408            selection: query,
6409            graphql_client: self.graphql_client.clone(),
6410        }
6411    }
6412    /// Returns the function with the given source map.
6413    ///
6414    /// # Arguments
6415    ///
6416    /// * `source_map` - The source map for the function definition.
6417    pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
6418        let mut query = self.selection.select("withSourceMap");
6419        query = query.arg_lazy(
6420            "sourceMap",
6421            Box::new(move || {
6422                let source_map = source_map.clone();
6423                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
6424            }),
6425        );
6426        Function {
6427            proc: self.proc.clone(),
6428            selection: query,
6429            graphql_client: self.graphql_client.clone(),
6430        }
6431    }
6432}
6433#[derive(Clone)]
6434pub struct FunctionArg {
6435    pub proc: Option<Arc<DaggerSessionProc>>,
6436    pub selection: Selection,
6437    pub graphql_client: DynGraphQLClient,
6438}
6439impl FunctionArg {
6440    /// 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
6441    pub async fn default_path(&self) -> Result<String, DaggerError> {
6442        let query = self.selection.select("defaultPath");
6443        query.execute(self.graphql_client.clone()).await
6444    }
6445    /// A default value to use for this argument when not explicitly set by the caller, if any.
6446    pub async fn default_value(&self) -> Result<Json, DaggerError> {
6447        let query = self.selection.select("defaultValue");
6448        query.execute(self.graphql_client.clone()).await
6449    }
6450    /// A doc string for the argument, if any.
6451    pub async fn description(&self) -> Result<String, DaggerError> {
6452        let query = self.selection.select("description");
6453        query.execute(self.graphql_client.clone()).await
6454    }
6455    /// A unique identifier for this FunctionArg.
6456    pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
6457        let query = self.selection.select("id");
6458        query.execute(self.graphql_client.clone()).await
6459    }
6460    /// 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.
6461    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
6462        let query = self.selection.select("ignore");
6463        query.execute(self.graphql_client.clone()).await
6464    }
6465    /// The name of the argument in lowerCamelCase format.
6466    pub async fn name(&self) -> Result<String, DaggerError> {
6467        let query = self.selection.select("name");
6468        query.execute(self.graphql_client.clone()).await
6469    }
6470    /// The location of this arg declaration.
6471    pub fn source_map(&self) -> SourceMap {
6472        let query = self.selection.select("sourceMap");
6473        SourceMap {
6474            proc: self.proc.clone(),
6475            selection: query,
6476            graphql_client: self.graphql_client.clone(),
6477        }
6478    }
6479    /// The type of the argument.
6480    pub fn type_def(&self) -> TypeDef {
6481        let query = self.selection.select("typeDef");
6482        TypeDef {
6483            proc: self.proc.clone(),
6484            selection: query,
6485            graphql_client: self.graphql_client.clone(),
6486        }
6487    }
6488}
6489#[derive(Clone)]
6490pub struct FunctionCall {
6491    pub proc: Option<Arc<DaggerSessionProc>>,
6492    pub selection: Selection,
6493    pub graphql_client: DynGraphQLClient,
6494}
6495impl FunctionCall {
6496    /// A unique identifier for this FunctionCall.
6497    pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
6498        let query = self.selection.select("id");
6499        query.execute(self.graphql_client.clone()).await
6500    }
6501    /// The argument values the function is being invoked with.
6502    pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
6503        let query = self.selection.select("inputArgs");
6504        vec![FunctionCallArgValue {
6505            proc: self.proc.clone(),
6506            selection: query,
6507            graphql_client: self.graphql_client.clone(),
6508        }]
6509    }
6510    /// The name of the function being called.
6511    pub async fn name(&self) -> Result<String, DaggerError> {
6512        let query = self.selection.select("name");
6513        query.execute(self.graphql_client.clone()).await
6514    }
6515    /// 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.
6516    pub async fn parent(&self) -> Result<Json, DaggerError> {
6517        let query = self.selection.select("parent");
6518        query.execute(self.graphql_client.clone()).await
6519    }
6520    /// 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.
6521    pub async fn parent_name(&self) -> Result<String, DaggerError> {
6522        let query = self.selection.select("parentName");
6523        query.execute(self.graphql_client.clone()).await
6524    }
6525    /// Return an error from the function.
6526    ///
6527    /// # Arguments
6528    ///
6529    /// * `error` - The error to return.
6530    pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
6531        let mut query = self.selection.select("returnError");
6532        query = query.arg_lazy(
6533            "error",
6534            Box::new(move || {
6535                let error = error.clone();
6536                Box::pin(async move { error.into_id().await.unwrap().quote() })
6537            }),
6538        );
6539        query.execute(self.graphql_client.clone()).await
6540    }
6541    /// Set the return value of the function call to the provided value.
6542    ///
6543    /// # Arguments
6544    ///
6545    /// * `value` - JSON serialization of the return value.
6546    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
6547        let mut query = self.selection.select("returnValue");
6548        query = query.arg("value", value);
6549        query.execute(self.graphql_client.clone()).await
6550    }
6551}
6552#[derive(Clone)]
6553pub struct FunctionCallArgValue {
6554    pub proc: Option<Arc<DaggerSessionProc>>,
6555    pub selection: Selection,
6556    pub graphql_client: DynGraphQLClient,
6557}
6558impl FunctionCallArgValue {
6559    /// A unique identifier for this FunctionCallArgValue.
6560    pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
6561        let query = self.selection.select("id");
6562        query.execute(self.graphql_client.clone()).await
6563    }
6564    /// The name of the argument.
6565    pub async fn name(&self) -> Result<String, DaggerError> {
6566        let query = self.selection.select("name");
6567        query.execute(self.graphql_client.clone()).await
6568    }
6569    /// The value of the argument represented as a JSON serialized string.
6570    pub async fn value(&self) -> Result<Json, DaggerError> {
6571        let query = self.selection.select("value");
6572        query.execute(self.graphql_client.clone()).await
6573    }
6574}
6575#[derive(Clone)]
6576pub struct GeneratedCode {
6577    pub proc: Option<Arc<DaggerSessionProc>>,
6578    pub selection: Selection,
6579    pub graphql_client: DynGraphQLClient,
6580}
6581impl GeneratedCode {
6582    /// The directory containing the generated code.
6583    pub fn code(&self) -> Directory {
6584        let query = self.selection.select("code");
6585        Directory {
6586            proc: self.proc.clone(),
6587            selection: query,
6588            graphql_client: self.graphql_client.clone(),
6589        }
6590    }
6591    /// A unique identifier for this GeneratedCode.
6592    pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
6593        let query = self.selection.select("id");
6594        query.execute(self.graphql_client.clone()).await
6595    }
6596    /// List of paths to mark generated in version control (i.e. .gitattributes).
6597    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
6598        let query = self.selection.select("vcsGeneratedPaths");
6599        query.execute(self.graphql_client.clone()).await
6600    }
6601    /// List of paths to ignore in version control (i.e. .gitignore).
6602    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
6603        let query = self.selection.select("vcsIgnoredPaths");
6604        query.execute(self.graphql_client.clone()).await
6605    }
6606    /// Set the list of paths to mark generated in version control.
6607    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
6608        let mut query = self.selection.select("withVCSGeneratedPaths");
6609        query = query.arg(
6610            "paths",
6611            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
6612        );
6613        GeneratedCode {
6614            proc: self.proc.clone(),
6615            selection: query,
6616            graphql_client: self.graphql_client.clone(),
6617        }
6618    }
6619    /// Set the list of paths to ignore in version control.
6620    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
6621        let mut query = self.selection.select("withVCSIgnoredPaths");
6622        query = query.arg(
6623            "paths",
6624            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
6625        );
6626        GeneratedCode {
6627            proc: self.proc.clone(),
6628            selection: query,
6629            graphql_client: self.graphql_client.clone(),
6630        }
6631    }
6632}
6633#[derive(Clone)]
6634pub struct GitRef {
6635    pub proc: Option<Arc<DaggerSessionProc>>,
6636    pub selection: Selection,
6637    pub graphql_client: DynGraphQLClient,
6638}
6639#[derive(Builder, Debug, PartialEq)]
6640pub struct GitRefTreeOpts {
6641    /// The depth of the tree to fetch.
6642    #[builder(setter(into, strip_option), default)]
6643    pub depth: Option<isize>,
6644    /// Set to true to discard .git directory.
6645    #[builder(setter(into, strip_option), default)]
6646    pub discard_git_dir: Option<bool>,
6647}
6648impl GitRef {
6649    /// The resolved commit id at this ref.
6650    pub async fn commit(&self) -> Result<String, DaggerError> {
6651        let query = self.selection.select("commit");
6652        query.execute(self.graphql_client.clone()).await
6653    }
6654    /// A unique identifier for this GitRef.
6655    pub async fn id(&self) -> Result<GitRefId, DaggerError> {
6656        let query = self.selection.select("id");
6657        query.execute(self.graphql_client.clone()).await
6658    }
6659    /// The resolved ref name at this ref.
6660    pub async fn r#ref(&self) -> Result<String, DaggerError> {
6661        let query = self.selection.select("ref");
6662        query.execute(self.graphql_client.clone()).await
6663    }
6664    /// The filesystem tree at this ref.
6665    ///
6666    /// # Arguments
6667    ///
6668    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6669    pub fn tree(&self) -> Directory {
6670        let query = self.selection.select("tree");
6671        Directory {
6672            proc: self.proc.clone(),
6673            selection: query,
6674            graphql_client: self.graphql_client.clone(),
6675        }
6676    }
6677    /// The filesystem tree at this ref.
6678    ///
6679    /// # Arguments
6680    ///
6681    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6682    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
6683        let mut query = self.selection.select("tree");
6684        if let Some(discard_git_dir) = opts.discard_git_dir {
6685            query = query.arg("discardGitDir", discard_git_dir);
6686        }
6687        if let Some(depth) = opts.depth {
6688            query = query.arg("depth", depth);
6689        }
6690        Directory {
6691            proc: self.proc.clone(),
6692            selection: query,
6693            graphql_client: self.graphql_client.clone(),
6694        }
6695    }
6696}
6697#[derive(Clone)]
6698pub struct GitRepository {
6699    pub proc: Option<Arc<DaggerSessionProc>>,
6700    pub selection: Selection,
6701    pub graphql_client: DynGraphQLClient,
6702}
6703#[derive(Builder, Debug, PartialEq)]
6704pub struct GitRepositoryBranchesOpts<'a> {
6705    /// Glob patterns (e.g., "refs/tags/v*").
6706    #[builder(setter(into, strip_option), default)]
6707    pub patterns: Option<Vec<&'a str>>,
6708}
6709#[derive(Builder, Debug, PartialEq)]
6710pub struct GitRepositoryTagsOpts<'a> {
6711    /// Glob patterns (e.g., "refs/tags/v*").
6712    #[builder(setter(into, strip_option), default)]
6713    pub patterns: Option<Vec<&'a str>>,
6714}
6715impl GitRepository {
6716    /// Returns details of a branch.
6717    ///
6718    /// # Arguments
6719    ///
6720    /// * `name` - Branch's name (e.g., "main").
6721    pub fn branch(&self, name: impl Into<String>) -> GitRef {
6722        let mut query = self.selection.select("branch");
6723        query = query.arg("name", name.into());
6724        GitRef {
6725            proc: self.proc.clone(),
6726            selection: query,
6727            graphql_client: self.graphql_client.clone(),
6728        }
6729    }
6730    /// branches that match any of the given glob patterns.
6731    ///
6732    /// # Arguments
6733    ///
6734    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6735    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
6736        let query = self.selection.select("branches");
6737        query.execute(self.graphql_client.clone()).await
6738    }
6739    /// branches that match any of the given glob patterns.
6740    ///
6741    /// # Arguments
6742    ///
6743    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6744    pub async fn branches_opts<'a>(
6745        &self,
6746        opts: GitRepositoryBranchesOpts<'a>,
6747    ) -> Result<Vec<String>, DaggerError> {
6748        let mut query = self.selection.select("branches");
6749        if let Some(patterns) = opts.patterns {
6750            query = query.arg("patterns", patterns);
6751        }
6752        query.execute(self.graphql_client.clone()).await
6753    }
6754    /// Returns details of a commit.
6755    ///
6756    /// # Arguments
6757    ///
6758    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
6759    pub fn commit(&self, id: impl Into<String>) -> GitRef {
6760        let mut query = self.selection.select("commit");
6761        query = query.arg("id", id.into());
6762        GitRef {
6763            proc: self.proc.clone(),
6764            selection: query,
6765            graphql_client: self.graphql_client.clone(),
6766        }
6767    }
6768    /// Returns details for HEAD.
6769    pub fn head(&self) -> GitRef {
6770        let query = self.selection.select("head");
6771        GitRef {
6772            proc: self.proc.clone(),
6773            selection: query,
6774            graphql_client: self.graphql_client.clone(),
6775        }
6776    }
6777    /// A unique identifier for this GitRepository.
6778    pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
6779        let query = self.selection.select("id");
6780        query.execute(self.graphql_client.clone()).await
6781    }
6782    /// Returns details of a ref.
6783    ///
6784    /// # Arguments
6785    ///
6786    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
6787    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
6788        let mut query = self.selection.select("ref");
6789        query = query.arg("name", name.into());
6790        GitRef {
6791            proc: self.proc.clone(),
6792            selection: query,
6793            graphql_client: self.graphql_client.clone(),
6794        }
6795    }
6796    /// Returns details of a tag.
6797    ///
6798    /// # Arguments
6799    ///
6800    /// * `name` - Tag's name (e.g., "v0.3.9").
6801    pub fn tag(&self, name: impl Into<String>) -> GitRef {
6802        let mut query = self.selection.select("tag");
6803        query = query.arg("name", name.into());
6804        GitRef {
6805            proc: self.proc.clone(),
6806            selection: query,
6807            graphql_client: self.graphql_client.clone(),
6808        }
6809    }
6810    /// tags that match any of the given glob patterns.
6811    ///
6812    /// # Arguments
6813    ///
6814    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6815    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
6816        let query = self.selection.select("tags");
6817        query.execute(self.graphql_client.clone()).await
6818    }
6819    /// tags that match any of the given glob patterns.
6820    ///
6821    /// # Arguments
6822    ///
6823    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6824    pub async fn tags_opts<'a>(
6825        &self,
6826        opts: GitRepositoryTagsOpts<'a>,
6827    ) -> Result<Vec<String>, DaggerError> {
6828        let mut query = self.selection.select("tags");
6829        if let Some(patterns) = opts.patterns {
6830            query = query.arg("patterns", patterns);
6831        }
6832        query.execute(self.graphql_client.clone()).await
6833    }
6834    /// Header to authenticate the remote with.
6835    ///
6836    /// # Arguments
6837    ///
6838    /// * `header` - Secret used to populate the Authorization HTTP header
6839    pub fn with_auth_header(&self, header: impl IntoID<SecretId>) -> GitRepository {
6840        let mut query = self.selection.select("withAuthHeader");
6841        query = query.arg_lazy(
6842            "header",
6843            Box::new(move || {
6844                let header = header.clone();
6845                Box::pin(async move { header.into_id().await.unwrap().quote() })
6846            }),
6847        );
6848        GitRepository {
6849            proc: self.proc.clone(),
6850            selection: query,
6851            graphql_client: self.graphql_client.clone(),
6852        }
6853    }
6854    /// Token to authenticate the remote with.
6855    ///
6856    /// # Arguments
6857    ///
6858    /// * `token` - Secret used to populate the password during basic HTTP Authorization
6859    pub fn with_auth_token(&self, token: impl IntoID<SecretId>) -> GitRepository {
6860        let mut query = self.selection.select("withAuthToken");
6861        query = query.arg_lazy(
6862            "token",
6863            Box::new(move || {
6864                let token = token.clone();
6865                Box::pin(async move { token.into_id().await.unwrap().quote() })
6866            }),
6867        );
6868        GitRepository {
6869            proc: self.proc.clone(),
6870            selection: query,
6871            graphql_client: self.graphql_client.clone(),
6872        }
6873    }
6874}
6875#[derive(Clone)]
6876pub struct Host {
6877    pub proc: Option<Arc<DaggerSessionProc>>,
6878    pub selection: Selection,
6879    pub graphql_client: DynGraphQLClient,
6880}
6881#[derive(Builder, Debug, PartialEq)]
6882pub struct HostDirectoryOpts<'a> {
6883    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
6884    #[builder(setter(into, strip_option), default)]
6885    pub exclude: Option<Vec<&'a str>>,
6886    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
6887    #[builder(setter(into, strip_option), default)]
6888    pub include: Option<Vec<&'a str>>,
6889    /// If true, the directory will always be reloaded from the host.
6890    #[builder(setter(into, strip_option), default)]
6891    pub no_cache: Option<bool>,
6892}
6893#[derive(Builder, Debug, PartialEq)]
6894pub struct HostFileOpts {
6895    /// If true, the file will always be reloaded from the host.
6896    #[builder(setter(into, strip_option), default)]
6897    pub no_cache: Option<bool>,
6898}
6899#[derive(Builder, Debug, PartialEq)]
6900pub struct HostServiceOpts<'a> {
6901    /// Upstream host to forward traffic to.
6902    #[builder(setter(into, strip_option), default)]
6903    pub host: Option<&'a str>,
6904}
6905#[derive(Builder, Debug, PartialEq)]
6906pub struct HostTunnelOpts {
6907    /// Map each service port to the same port on the host, as if the service were running natively.
6908    /// Note: enabling may result in port conflicts.
6909    #[builder(setter(into, strip_option), default)]
6910    pub native: Option<bool>,
6911    /// Configure explicit port forwarding rules for the tunnel.
6912    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
6913    /// 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.
6914    /// If ports are given and native is true, the ports are additive.
6915    #[builder(setter(into, strip_option), default)]
6916    pub ports: Option<Vec<PortForward>>,
6917}
6918impl Host {
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(&self, path: impl Into<String>) -> Directory {
6926        let mut query = self.selection.select("directory");
6927        query = query.arg("path", path.into());
6928        Directory {
6929            proc: self.proc.clone(),
6930            selection: query,
6931            graphql_client: self.graphql_client.clone(),
6932        }
6933    }
6934    /// Accesses a directory on the host.
6935    ///
6936    /// # Arguments
6937    ///
6938    /// * `path` - Location of the directory to access (e.g., ".").
6939    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6940    pub fn directory_opts<'a>(
6941        &self,
6942        path: impl Into<String>,
6943        opts: HostDirectoryOpts<'a>,
6944    ) -> Directory {
6945        let mut query = self.selection.select("directory");
6946        query = query.arg("path", path.into());
6947        if let Some(exclude) = opts.exclude {
6948            query = query.arg("exclude", exclude);
6949        }
6950        if let Some(include) = opts.include {
6951            query = query.arg("include", include);
6952        }
6953        if let Some(no_cache) = opts.no_cache {
6954            query = query.arg("noCache", no_cache);
6955        }
6956        Directory {
6957            proc: self.proc.clone(),
6958            selection: query,
6959            graphql_client: self.graphql_client.clone(),
6960        }
6961    }
6962    /// Accesses a file on the host.
6963    ///
6964    /// # Arguments
6965    ///
6966    /// * `path` - Location of the file to retrieve (e.g., "README.md").
6967    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6968    pub fn file(&self, path: impl Into<String>) -> File {
6969        let mut query = self.selection.select("file");
6970        query = query.arg("path", path.into());
6971        File {
6972            proc: self.proc.clone(),
6973            selection: query,
6974            graphql_client: self.graphql_client.clone(),
6975        }
6976    }
6977    /// Accesses a file on the host.
6978    ///
6979    /// # Arguments
6980    ///
6981    /// * `path` - Location of the file to retrieve (e.g., "README.md").
6982    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6983    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
6984        let mut query = self.selection.select("file");
6985        query = query.arg("path", path.into());
6986        if let Some(no_cache) = opts.no_cache {
6987            query = query.arg("noCache", no_cache);
6988        }
6989        File {
6990            proc: self.proc.clone(),
6991            selection: query,
6992            graphql_client: self.graphql_client.clone(),
6993        }
6994    }
6995    /// A unique identifier for this Host.
6996    pub async fn id(&self) -> Result<HostId, DaggerError> {
6997        let query = self.selection.select("id");
6998        query.execute(self.graphql_client.clone()).await
6999    }
7000    /// Creates a service that forwards traffic to a specified address via the host.
7001    ///
7002    /// # Arguments
7003    ///
7004    /// * `ports` - Ports to expose via the service, forwarding through the host network.
7005    ///
7006    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
7007    ///
7008    /// An empty set of ports is not valid; an error will be returned.
7009    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7010    pub fn service(&self, ports: Vec<PortForward>) -> Service {
7011        let mut query = self.selection.select("service");
7012        query = query.arg("ports", ports);
7013        Service {
7014            proc: self.proc.clone(),
7015            selection: query,
7016            graphql_client: self.graphql_client.clone(),
7017        }
7018    }
7019    /// Creates a service that forwards traffic to a specified address via the host.
7020    ///
7021    /// # Arguments
7022    ///
7023    /// * `ports` - Ports to expose via the service, forwarding through the host network.
7024    ///
7025    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
7026    ///
7027    /// An empty set of ports is not valid; an error will be returned.
7028    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7029    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
7030        let mut query = self.selection.select("service");
7031        query = query.arg("ports", ports);
7032        if let Some(host) = opts.host {
7033            query = query.arg("host", host);
7034        }
7035        Service {
7036            proc: self.proc.clone(),
7037            selection: query,
7038            graphql_client: self.graphql_client.clone(),
7039        }
7040    }
7041    /// Sets a secret given a user-defined name and the file path on the host, and returns the secret.
7042    /// The file is limited to a size of 512000 bytes.
7043    ///
7044    /// # Arguments
7045    ///
7046    /// * `name` - The user defined name for this secret.
7047    /// * `path` - Location of the file to set as a secret.
7048    pub fn set_secret_file(&self, name: impl Into<String>, path: impl Into<String>) -> Secret {
7049        let mut query = self.selection.select("setSecretFile");
7050        query = query.arg("name", name.into());
7051        query = query.arg("path", path.into());
7052        Secret {
7053            proc: self.proc.clone(),
7054            selection: query,
7055            graphql_client: self.graphql_client.clone(),
7056        }
7057    }
7058    /// Creates a tunnel that forwards traffic from the host to a service.
7059    ///
7060    /// # Arguments
7061    ///
7062    /// * `service` - Service to send traffic from the tunnel.
7063    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7064    pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
7065        let mut query = self.selection.select("tunnel");
7066        query = query.arg_lazy(
7067            "service",
7068            Box::new(move || {
7069                let service = service.clone();
7070                Box::pin(async move { service.into_id().await.unwrap().quote() })
7071            }),
7072        );
7073        Service {
7074            proc: self.proc.clone(),
7075            selection: query,
7076            graphql_client: self.graphql_client.clone(),
7077        }
7078    }
7079    /// Creates a tunnel that forwards traffic from the host to a service.
7080    ///
7081    /// # Arguments
7082    ///
7083    /// * `service` - Service to send traffic from the tunnel.
7084    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7085    pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
7086        let mut query = self.selection.select("tunnel");
7087        query = query.arg_lazy(
7088            "service",
7089            Box::new(move || {
7090                let service = service.clone();
7091                Box::pin(async move { service.into_id().await.unwrap().quote() })
7092            }),
7093        );
7094        if let Some(native) = opts.native {
7095            query = query.arg("native", native);
7096        }
7097        if let Some(ports) = opts.ports {
7098            query = query.arg("ports", ports);
7099        }
7100        Service {
7101            proc: self.proc.clone(),
7102            selection: query,
7103            graphql_client: self.graphql_client.clone(),
7104        }
7105    }
7106    /// Accesses a Unix socket on the host.
7107    ///
7108    /// # Arguments
7109    ///
7110    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
7111    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
7112        let mut query = self.selection.select("unixSocket");
7113        query = query.arg("path", path.into());
7114        Socket {
7115            proc: self.proc.clone(),
7116            selection: query,
7117            graphql_client: self.graphql_client.clone(),
7118        }
7119    }
7120}
7121#[derive(Clone)]
7122pub struct InputTypeDef {
7123    pub proc: Option<Arc<DaggerSessionProc>>,
7124    pub selection: Selection,
7125    pub graphql_client: DynGraphQLClient,
7126}
7127impl InputTypeDef {
7128    /// Static fields defined on this input object, if any.
7129    pub fn fields(&self) -> Vec<FieldTypeDef> {
7130        let query = self.selection.select("fields");
7131        vec![FieldTypeDef {
7132            proc: self.proc.clone(),
7133            selection: query,
7134            graphql_client: self.graphql_client.clone(),
7135        }]
7136    }
7137    /// A unique identifier for this InputTypeDef.
7138    pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
7139        let query = self.selection.select("id");
7140        query.execute(self.graphql_client.clone()).await
7141    }
7142    /// The name of the input object.
7143    pub async fn name(&self) -> Result<String, DaggerError> {
7144        let query = self.selection.select("name");
7145        query.execute(self.graphql_client.clone()).await
7146    }
7147}
7148#[derive(Clone)]
7149pub struct InterfaceTypeDef {
7150    pub proc: Option<Arc<DaggerSessionProc>>,
7151    pub selection: Selection,
7152    pub graphql_client: DynGraphQLClient,
7153}
7154impl InterfaceTypeDef {
7155    /// The doc string for the interface, if any.
7156    pub async fn description(&self) -> Result<String, DaggerError> {
7157        let query = self.selection.select("description");
7158        query.execute(self.graphql_client.clone()).await
7159    }
7160    /// Functions defined on this interface, if any.
7161    pub fn functions(&self) -> Vec<Function> {
7162        let query = self.selection.select("functions");
7163        vec![Function {
7164            proc: self.proc.clone(),
7165            selection: query,
7166            graphql_client: self.graphql_client.clone(),
7167        }]
7168    }
7169    /// A unique identifier for this InterfaceTypeDef.
7170    pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
7171        let query = self.selection.select("id");
7172        query.execute(self.graphql_client.clone()).await
7173    }
7174    /// The name of the interface.
7175    pub async fn name(&self) -> Result<String, DaggerError> {
7176        let query = self.selection.select("name");
7177        query.execute(self.graphql_client.clone()).await
7178    }
7179    /// The location of this interface declaration.
7180    pub fn source_map(&self) -> SourceMap {
7181        let query = self.selection.select("sourceMap");
7182        SourceMap {
7183            proc: self.proc.clone(),
7184            selection: query,
7185            graphql_client: self.graphql_client.clone(),
7186        }
7187    }
7188    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
7189    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
7190        let query = self.selection.select("sourceModuleName");
7191        query.execute(self.graphql_client.clone()).await
7192    }
7193}
7194#[derive(Clone)]
7195pub struct Llm {
7196    pub proc: Option<Arc<DaggerSessionProc>>,
7197    pub selection: Selection,
7198    pub graphql_client: DynGraphQLClient,
7199}
7200impl Llm {
7201    /// create a branch in the LLM's history
7202    pub fn attempt(&self, number: isize) -> Llm {
7203        let mut query = self.selection.select("attempt");
7204        query = query.arg("number", number);
7205        Llm {
7206            proc: self.proc.clone(),
7207            selection: query,
7208            graphql_client: self.graphql_client.clone(),
7209        }
7210    }
7211    /// returns the type of the current state
7212    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
7213        let mut query = self.selection.select("bindResult");
7214        query = query.arg("name", name.into());
7215        Binding {
7216            proc: self.proc.clone(),
7217            selection: query,
7218            graphql_client: self.graphql_client.clone(),
7219        }
7220    }
7221    /// return the LLM's current environment
7222    pub fn env(&self) -> Env {
7223        let query = self.selection.select("env");
7224        Env {
7225            proc: self.proc.clone(),
7226            selection: query,
7227            graphql_client: self.graphql_client.clone(),
7228        }
7229    }
7230    /// return the llm message history
7231    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
7232        let query = self.selection.select("history");
7233        query.execute(self.graphql_client.clone()).await
7234    }
7235    /// return the raw llm message history as json
7236    pub async fn history_json(&self) -> Result<Json, DaggerError> {
7237        let query = self.selection.select("historyJSON");
7238        query.execute(self.graphql_client.clone()).await
7239    }
7240    /// A unique identifier for this LLM.
7241    pub async fn id(&self) -> Result<Llmid, DaggerError> {
7242        let query = self.selection.select("id");
7243        query.execute(self.graphql_client.clone()).await
7244    }
7245    /// return the last llm reply from the history
7246    pub async fn last_reply(&self) -> Result<String, DaggerError> {
7247        let query = self.selection.select("lastReply");
7248        query.execute(self.graphql_client.clone()).await
7249    }
7250    /// synchronize LLM state
7251    pub fn r#loop(&self) -> Llm {
7252        let query = self.selection.select("loop");
7253        Llm {
7254            proc: self.proc.clone(),
7255            selection: query,
7256            graphql_client: self.graphql_client.clone(),
7257        }
7258    }
7259    /// return the model used by the llm
7260    pub async fn model(&self) -> Result<String, DaggerError> {
7261        let query = self.selection.select("model");
7262        query.execute(self.graphql_client.clone()).await
7263    }
7264    /// return the provider used by the llm
7265    pub async fn provider(&self) -> Result<String, DaggerError> {
7266        let query = self.selection.select("provider");
7267        query.execute(self.graphql_client.clone()).await
7268    }
7269    /// synchronize LLM state
7270    pub async fn sync(&self) -> Result<Llmid, DaggerError> {
7271        let query = self.selection.select("sync");
7272        query.execute(self.graphql_client.clone()).await
7273    }
7274    /// returns the token usage of the current state
7275    pub fn token_usage(&self) -> LlmTokenUsage {
7276        let query = self.selection.select("tokenUsage");
7277        LlmTokenUsage {
7278            proc: self.proc.clone(),
7279            selection: query,
7280            graphql_client: self.graphql_client.clone(),
7281        }
7282    }
7283    /// print documentation for available tools
7284    pub async fn tools(&self) -> Result<String, DaggerError> {
7285        let query = self.selection.select("tools");
7286        query.execute(self.graphql_client.clone()).await
7287    }
7288    /// allow the LLM to interact with an environment via MCP
7289    pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
7290        let mut query = self.selection.select("withEnv");
7291        query = query.arg_lazy(
7292            "env",
7293            Box::new(move || {
7294                let env = env.clone();
7295                Box::pin(async move { env.into_id().await.unwrap().quote() })
7296            }),
7297        );
7298        Llm {
7299            proc: self.proc.clone(),
7300            selection: query,
7301            graphql_client: self.graphql_client.clone(),
7302        }
7303    }
7304    /// swap out the llm model
7305    ///
7306    /// # Arguments
7307    ///
7308    /// * `model` - The model to use
7309    pub fn with_model(&self, model: impl Into<String>) -> Llm {
7310        let mut query = self.selection.select("withModel");
7311        query = query.arg("model", model.into());
7312        Llm {
7313            proc: self.proc.clone(),
7314            selection: query,
7315            graphql_client: self.graphql_client.clone(),
7316        }
7317    }
7318    /// append a prompt to the llm context
7319    ///
7320    /// # Arguments
7321    ///
7322    /// * `prompt` - The prompt to send
7323    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
7324        let mut query = self.selection.select("withPrompt");
7325        query = query.arg("prompt", prompt.into());
7326        Llm {
7327            proc: self.proc.clone(),
7328            selection: query,
7329            graphql_client: self.graphql_client.clone(),
7330        }
7331    }
7332    /// append the contents of a file to the llm context
7333    ///
7334    /// # Arguments
7335    ///
7336    /// * `file` - The file to read the prompt from
7337    pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
7338        let mut query = self.selection.select("withPromptFile");
7339        query = query.arg_lazy(
7340            "file",
7341            Box::new(move || {
7342                let file = file.clone();
7343                Box::pin(async move { file.into_id().await.unwrap().quote() })
7344            }),
7345        );
7346        Llm {
7347            proc: self.proc.clone(),
7348            selection: query,
7349            graphql_client: self.graphql_client.clone(),
7350        }
7351    }
7352    /// Add a system prompt to the LLM's environment
7353    ///
7354    /// # Arguments
7355    ///
7356    /// * `prompt` - The system prompt to send
7357    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
7358        let mut query = self.selection.select("withSystemPrompt");
7359        query = query.arg("prompt", prompt.into());
7360        Llm {
7361            proc: self.proc.clone(),
7362            selection: query,
7363            graphql_client: self.graphql_client.clone(),
7364        }
7365    }
7366    /// Disable the default system prompt
7367    pub fn without_default_system_prompt(&self) -> Llm {
7368        let query = self.selection.select("withoutDefaultSystemPrompt");
7369        Llm {
7370            proc: self.proc.clone(),
7371            selection: query,
7372            graphql_client: self.graphql_client.clone(),
7373        }
7374    }
7375}
7376#[derive(Clone)]
7377pub struct LlmTokenUsage {
7378    pub proc: Option<Arc<DaggerSessionProc>>,
7379    pub selection: Selection,
7380    pub graphql_client: DynGraphQLClient,
7381}
7382impl LlmTokenUsage {
7383    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
7384        let query = self.selection.select("cachedTokenReads");
7385        query.execute(self.graphql_client.clone()).await
7386    }
7387    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
7388        let query = self.selection.select("cachedTokenWrites");
7389        query.execute(self.graphql_client.clone()).await
7390    }
7391    /// A unique identifier for this LLMTokenUsage.
7392    pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
7393        let query = self.selection.select("id");
7394        query.execute(self.graphql_client.clone()).await
7395    }
7396    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
7397        let query = self.selection.select("inputTokens");
7398        query.execute(self.graphql_client.clone()).await
7399    }
7400    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
7401        let query = self.selection.select("outputTokens");
7402        query.execute(self.graphql_client.clone()).await
7403    }
7404    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
7405        let query = self.selection.select("totalTokens");
7406        query.execute(self.graphql_client.clone()).await
7407    }
7408}
7409#[derive(Clone)]
7410pub struct Label {
7411    pub proc: Option<Arc<DaggerSessionProc>>,
7412    pub selection: Selection,
7413    pub graphql_client: DynGraphQLClient,
7414}
7415impl Label {
7416    /// A unique identifier for this Label.
7417    pub async fn id(&self) -> Result<LabelId, DaggerError> {
7418        let query = self.selection.select("id");
7419        query.execute(self.graphql_client.clone()).await
7420    }
7421    /// The label name.
7422    pub async fn name(&self) -> Result<String, DaggerError> {
7423        let query = self.selection.select("name");
7424        query.execute(self.graphql_client.clone()).await
7425    }
7426    /// The label value.
7427    pub async fn value(&self) -> Result<String, DaggerError> {
7428        let query = self.selection.select("value");
7429        query.execute(self.graphql_client.clone()).await
7430    }
7431}
7432#[derive(Clone)]
7433pub struct ListTypeDef {
7434    pub proc: Option<Arc<DaggerSessionProc>>,
7435    pub selection: Selection,
7436    pub graphql_client: DynGraphQLClient,
7437}
7438impl ListTypeDef {
7439    /// The type of the elements in the list.
7440    pub fn element_type_def(&self) -> TypeDef {
7441        let query = self.selection.select("elementTypeDef");
7442        TypeDef {
7443            proc: self.proc.clone(),
7444            selection: query,
7445            graphql_client: self.graphql_client.clone(),
7446        }
7447    }
7448    /// A unique identifier for this ListTypeDef.
7449    pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
7450        let query = self.selection.select("id");
7451        query.execute(self.graphql_client.clone()).await
7452    }
7453}
7454#[derive(Clone)]
7455pub struct Module {
7456    pub proc: Option<Arc<DaggerSessionProc>>,
7457    pub selection: Selection,
7458    pub graphql_client: DynGraphQLClient,
7459}
7460#[derive(Builder, Debug, PartialEq)]
7461pub struct ModuleServeOpts {
7462    /// Expose the dependencies of this module to the client
7463    #[builder(setter(into, strip_option), default)]
7464    pub include_dependencies: Option<bool>,
7465}
7466impl Module {
7467    /// The dependencies of the module.
7468    pub fn dependencies(&self) -> Vec<Module> {
7469        let query = self.selection.select("dependencies");
7470        vec![Module {
7471            proc: self.proc.clone(),
7472            selection: query,
7473            graphql_client: self.graphql_client.clone(),
7474        }]
7475    }
7476    /// The doc string of the module, if any
7477    pub async fn description(&self) -> Result<String, DaggerError> {
7478        let query = self.selection.select("description");
7479        query.execute(self.graphql_client.clone()).await
7480    }
7481    /// Enumerations served by this module.
7482    pub fn enums(&self) -> Vec<TypeDef> {
7483        let query = self.selection.select("enums");
7484        vec![TypeDef {
7485            proc: self.proc.clone(),
7486            selection: query,
7487            graphql_client: self.graphql_client.clone(),
7488        }]
7489    }
7490    /// The generated files and directories made on top of the module source's context directory.
7491    pub fn generated_context_directory(&self) -> Directory {
7492        let query = self.selection.select("generatedContextDirectory");
7493        Directory {
7494            proc: self.proc.clone(),
7495            selection: query,
7496            graphql_client: self.graphql_client.clone(),
7497        }
7498    }
7499    /// A unique identifier for this Module.
7500    pub async fn id(&self) -> Result<ModuleId, DaggerError> {
7501        let query = self.selection.select("id");
7502        query.execute(self.graphql_client.clone()).await
7503    }
7504    /// Interfaces served by this module.
7505    pub fn interfaces(&self) -> Vec<TypeDef> {
7506        let query = self.selection.select("interfaces");
7507        vec![TypeDef {
7508            proc: self.proc.clone(),
7509            selection: query,
7510            graphql_client: self.graphql_client.clone(),
7511        }]
7512    }
7513    /// The name of the module
7514    pub async fn name(&self) -> Result<String, DaggerError> {
7515        let query = self.selection.select("name");
7516        query.execute(self.graphql_client.clone()).await
7517    }
7518    /// Objects served by this module.
7519    pub fn objects(&self) -> Vec<TypeDef> {
7520        let query = self.selection.select("objects");
7521        vec![TypeDef {
7522            proc: self.proc.clone(),
7523            selection: query,
7524            graphql_client: self.graphql_client.clone(),
7525        }]
7526    }
7527    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
7528    pub fn runtime(&self) -> Container {
7529        let query = self.selection.select("runtime");
7530        Container {
7531            proc: self.proc.clone(),
7532            selection: query,
7533            graphql_client: self.graphql_client.clone(),
7534        }
7535    }
7536    /// The SDK config used by this module.
7537    pub fn sdk(&self) -> SdkConfig {
7538        let query = self.selection.select("sdk");
7539        SdkConfig {
7540            proc: self.proc.clone(),
7541            selection: query,
7542            graphql_client: self.graphql_client.clone(),
7543        }
7544    }
7545    /// Serve a module's API in the current session.
7546    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
7547    ///
7548    /// # Arguments
7549    ///
7550    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7551    pub async fn serve(&self) -> Result<Void, DaggerError> {
7552        let query = self.selection.select("serve");
7553        query.execute(self.graphql_client.clone()).await
7554    }
7555    /// Serve a module's API in the current session.
7556    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
7557    ///
7558    /// # Arguments
7559    ///
7560    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7561    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
7562        let mut query = self.selection.select("serve");
7563        if let Some(include_dependencies) = opts.include_dependencies {
7564            query = query.arg("includeDependencies", include_dependencies);
7565        }
7566        query.execute(self.graphql_client.clone()).await
7567    }
7568    /// The source for the module.
7569    pub fn source(&self) -> ModuleSource {
7570        let query = self.selection.select("source");
7571        ModuleSource {
7572            proc: self.proc.clone(),
7573            selection: query,
7574            graphql_client: self.graphql_client.clone(),
7575        }
7576    }
7577    /// Forces evaluation of the module, including any loading into the engine and associated validation.
7578    pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
7579        let query = self.selection.select("sync");
7580        query.execute(self.graphql_client.clone()).await
7581    }
7582    /// Retrieves the module with the given description
7583    ///
7584    /// # Arguments
7585    ///
7586    /// * `description` - The description to set
7587    pub fn with_description(&self, description: impl Into<String>) -> Module {
7588        let mut query = self.selection.select("withDescription");
7589        query = query.arg("description", description.into());
7590        Module {
7591            proc: self.proc.clone(),
7592            selection: query,
7593            graphql_client: self.graphql_client.clone(),
7594        }
7595    }
7596    /// This module plus the given Enum type and associated values
7597    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
7598        let mut query = self.selection.select("withEnum");
7599        query = query.arg_lazy(
7600            "enum",
7601            Box::new(move || {
7602                let r#enum = r#enum.clone();
7603                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
7604            }),
7605        );
7606        Module {
7607            proc: self.proc.clone(),
7608            selection: query,
7609            graphql_client: self.graphql_client.clone(),
7610        }
7611    }
7612    /// This module plus the given Interface type and associated functions
7613    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
7614        let mut query = self.selection.select("withInterface");
7615        query = query.arg_lazy(
7616            "iface",
7617            Box::new(move || {
7618                let iface = iface.clone();
7619                Box::pin(async move { iface.into_id().await.unwrap().quote() })
7620            }),
7621        );
7622        Module {
7623            proc: self.proc.clone(),
7624            selection: query,
7625            graphql_client: self.graphql_client.clone(),
7626        }
7627    }
7628    /// This module plus the given Object type and associated functions.
7629    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
7630        let mut query = self.selection.select("withObject");
7631        query = query.arg_lazy(
7632            "object",
7633            Box::new(move || {
7634                let object = object.clone();
7635                Box::pin(async move { object.into_id().await.unwrap().quote() })
7636            }),
7637        );
7638        Module {
7639            proc: self.proc.clone(),
7640            selection: query,
7641            graphql_client: self.graphql_client.clone(),
7642        }
7643    }
7644}
7645#[derive(Clone)]
7646pub struct ModuleConfigClient {
7647    pub proc: Option<Arc<DaggerSessionProc>>,
7648    pub selection: Selection,
7649    pub graphql_client: DynGraphQLClient,
7650}
7651impl ModuleConfigClient {
7652    /// If true, generate the client in developer mode.
7653    pub async fn dev(&self) -> Result<bool, DaggerError> {
7654        let query = self.selection.select("dev");
7655        query.execute(self.graphql_client.clone()).await
7656    }
7657    /// The directory the client is generated in.
7658    pub async fn directory(&self) -> Result<String, DaggerError> {
7659        let query = self.selection.select("directory");
7660        query.execute(self.graphql_client.clone()).await
7661    }
7662    /// The generator to use
7663    pub async fn generator(&self) -> Result<String, DaggerError> {
7664        let query = self.selection.select("generator");
7665        query.execute(self.graphql_client.clone()).await
7666    }
7667    /// A unique identifier for this ModuleConfigClient.
7668    pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
7669        let query = self.selection.select("id");
7670        query.execute(self.graphql_client.clone()).await
7671    }
7672}
7673#[derive(Clone)]
7674pub struct ModuleSource {
7675    pub proc: Option<Arc<DaggerSessionProc>>,
7676    pub selection: Selection,
7677    pub graphql_client: DynGraphQLClient,
7678}
7679#[derive(Builder, Debug, PartialEq)]
7680pub struct ModuleSourceWithClientOpts {
7681    /// Generate in developer mode
7682    #[builder(setter(into, strip_option), default)]
7683    pub dev: Option<bool>,
7684}
7685impl ModuleSource {
7686    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
7687    pub fn as_module(&self) -> Module {
7688        let query = self.selection.select("asModule");
7689        Module {
7690            proc: self.proc.clone(),
7691            selection: query,
7692            graphql_client: self.graphql_client.clone(),
7693        }
7694    }
7695    /// A human readable ref string representation of this module source.
7696    pub async fn as_string(&self) -> Result<String, DaggerError> {
7697        let query = self.selection.select("asString");
7698        query.execute(self.graphql_client.clone()).await
7699    }
7700    /// The ref to clone the root of the git repo from. Only valid for git sources.
7701    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
7702        let query = self.selection.select("cloneRef");
7703        query.execute(self.graphql_client.clone()).await
7704    }
7705    /// The resolved commit of the git repo this source points to.
7706    pub async fn commit(&self) -> Result<String, DaggerError> {
7707        let query = self.selection.select("commit");
7708        query.execute(self.graphql_client.clone()).await
7709    }
7710    /// The clients generated for the module.
7711    pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
7712        let query = self.selection.select("configClients");
7713        vec![ModuleConfigClient {
7714            proc: self.proc.clone(),
7715            selection: query,
7716            graphql_client: self.graphql_client.clone(),
7717        }]
7718    }
7719    /// Whether an existing dagger.json for the module was found.
7720    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
7721        let query = self.selection.select("configExists");
7722        query.execute(self.graphql_client.clone()).await
7723    }
7724    /// The full directory loaded for the module source, including the source code as a subdirectory.
7725    pub fn context_directory(&self) -> Directory {
7726        let query = self.selection.select("contextDirectory");
7727        Directory {
7728            proc: self.proc.clone(),
7729            selection: query,
7730            graphql_client: self.graphql_client.clone(),
7731        }
7732    }
7733    /// The dependencies of the module source.
7734    pub fn dependencies(&self) -> Vec<ModuleSource> {
7735        let query = self.selection.select("dependencies");
7736        vec![ModuleSource {
7737            proc: self.proc.clone(),
7738            selection: query,
7739            graphql_client: self.graphql_client.clone(),
7740        }]
7741    }
7742    /// 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.
7743    pub async fn digest(&self) -> Result<String, DaggerError> {
7744        let query = self.selection.select("digest");
7745        query.execute(self.graphql_client.clone()).await
7746    }
7747    /// The directory containing the module configuration and source code (source code may be in a subdir).
7748    ///
7749    /// # Arguments
7750    ///
7751    /// * `path` - A subpath from the source directory to select.
7752    pub fn directory(&self, path: impl Into<String>) -> Directory {
7753        let mut query = self.selection.select("directory");
7754        query = query.arg("path", path.into());
7755        Directory {
7756            proc: self.proc.clone(),
7757            selection: query,
7758            graphql_client: self.graphql_client.clone(),
7759        }
7760    }
7761    /// The engine version of the module.
7762    pub async fn engine_version(&self) -> Result<String, DaggerError> {
7763        let query = self.selection.select("engineVersion");
7764        query.execute(self.graphql_client.clone()).await
7765    }
7766    /// The generated files and directories made on top of the module source's context directory.
7767    pub fn generated_context_directory(&self) -> Directory {
7768        let query = self.selection.select("generatedContextDirectory");
7769        Directory {
7770            proc: self.proc.clone(),
7771            selection: query,
7772            graphql_client: self.graphql_client.clone(),
7773        }
7774    }
7775    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
7776    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
7777        let query = self.selection.select("htmlRepoURL");
7778        query.execute(self.graphql_client.clone()).await
7779    }
7780    /// The URL to the source's git repo in a web browser. Only valid for git sources.
7781    pub async fn html_url(&self) -> Result<String, DaggerError> {
7782        let query = self.selection.select("htmlURL");
7783        query.execute(self.graphql_client.clone()).await
7784    }
7785    /// A unique identifier for this ModuleSource.
7786    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
7787        let query = self.selection.select("id");
7788        query.execute(self.graphql_client.clone()).await
7789    }
7790    /// The kind of module source (currently local, git or dir).
7791    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
7792        let query = self.selection.select("kind");
7793        query.execute(self.graphql_client.clone()).await
7794    }
7795    /// 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.
7796    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
7797        let query = self.selection.select("localContextDirectoryPath");
7798        query.execute(self.graphql_client.clone()).await
7799    }
7800    /// The name of the module, including any setting via the withName API.
7801    pub async fn module_name(&self) -> Result<String, DaggerError> {
7802        let query = self.selection.select("moduleName");
7803        query.execute(self.graphql_client.clone()).await
7804    }
7805    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
7806    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
7807        let query = self.selection.select("moduleOriginalName");
7808        query.execute(self.graphql_client.clone()).await
7809    }
7810    /// The original subpath used when instantiating this module source, relative to the context directory.
7811    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
7812        let query = self.selection.select("originalSubpath");
7813        query.execute(self.graphql_client.clone()).await
7814    }
7815    /// The pinned version of this module source.
7816    pub async fn pin(&self) -> Result<String, DaggerError> {
7817        let query = self.selection.select("pin");
7818        query.execute(self.graphql_client.clone()).await
7819    }
7820    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
7821    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
7822        let query = self.selection.select("repoRootPath");
7823        query.execute(self.graphql_client.clone()).await
7824    }
7825    /// The SDK configuration of the module.
7826    pub fn sdk(&self) -> SdkConfig {
7827        let query = self.selection.select("sdk");
7828        SdkConfig {
7829            proc: self.proc.clone(),
7830            selection: query,
7831            graphql_client: self.graphql_client.clone(),
7832        }
7833    }
7834    /// The path, relative to the context directory, that contains the module's dagger.json.
7835    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
7836        let query = self.selection.select("sourceRootSubpath");
7837        query.execute(self.graphql_client.clone()).await
7838    }
7839    /// The path to the directory containing the module's source code, relative to the context directory.
7840    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
7841        let query = self.selection.select("sourceSubpath");
7842        query.execute(self.graphql_client.clone()).await
7843    }
7844    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
7845    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
7846        let query = self.selection.select("sync");
7847        query.execute(self.graphql_client.clone()).await
7848    }
7849    /// The specified version of the git repo this source points to.
7850    pub async fn version(&self) -> Result<String, DaggerError> {
7851        let query = self.selection.select("version");
7852        query.execute(self.graphql_client.clone()).await
7853    }
7854    /// Update the module source with a new client to generate.
7855    ///
7856    /// # Arguments
7857    ///
7858    /// * `generator` - The generator to use
7859    /// * `output_dir` - The output directory for the generated client.
7860    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7861    pub fn with_client(
7862        &self,
7863        generator: impl Into<String>,
7864        output_dir: impl Into<String>,
7865    ) -> ModuleSource {
7866        let mut query = self.selection.select("withClient");
7867        query = query.arg("generator", generator.into());
7868        query = query.arg("outputDir", output_dir.into());
7869        ModuleSource {
7870            proc: self.proc.clone(),
7871            selection: query,
7872            graphql_client: self.graphql_client.clone(),
7873        }
7874    }
7875    /// Update the module source with a new client to generate.
7876    ///
7877    /// # Arguments
7878    ///
7879    /// * `generator` - The generator to use
7880    /// * `output_dir` - The output directory for the generated client.
7881    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7882    pub fn with_client_opts(
7883        &self,
7884        generator: impl Into<String>,
7885        output_dir: impl Into<String>,
7886        opts: ModuleSourceWithClientOpts,
7887    ) -> ModuleSource {
7888        let mut query = self.selection.select("withClient");
7889        query = query.arg("generator", generator.into());
7890        query = query.arg("outputDir", output_dir.into());
7891        if let Some(dev) = opts.dev {
7892            query = query.arg("dev", dev);
7893        }
7894        ModuleSource {
7895            proc: self.proc.clone(),
7896            selection: query,
7897            graphql_client: self.graphql_client.clone(),
7898        }
7899    }
7900    /// Append the provided dependencies to the module source's dependency list.
7901    ///
7902    /// # Arguments
7903    ///
7904    /// * `dependencies` - The dependencies to append.
7905    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
7906        let mut query = self.selection.select("withDependencies");
7907        query = query.arg("dependencies", dependencies);
7908        ModuleSource {
7909            proc: self.proc.clone(),
7910            selection: query,
7911            graphql_client: self.graphql_client.clone(),
7912        }
7913    }
7914    /// Upgrade the engine version of the module to the given value.
7915    ///
7916    /// # Arguments
7917    ///
7918    /// * `version` - The engine version to upgrade to.
7919    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
7920        let mut query = self.selection.select("withEngineVersion");
7921        query = query.arg("version", version.into());
7922        ModuleSource {
7923            proc: self.proc.clone(),
7924            selection: query,
7925            graphql_client: self.graphql_client.clone(),
7926        }
7927    }
7928    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
7929    ///
7930    /// # Arguments
7931    ///
7932    /// * `patterns` - The new additional include patterns.
7933    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
7934        let mut query = self.selection.select("withIncludes");
7935        query = query.arg(
7936            "patterns",
7937            patterns
7938                .into_iter()
7939                .map(|i| i.into())
7940                .collect::<Vec<String>>(),
7941        );
7942        ModuleSource {
7943            proc: self.proc.clone(),
7944            selection: query,
7945            graphql_client: self.graphql_client.clone(),
7946        }
7947    }
7948    /// Update the module source with a new name.
7949    ///
7950    /// # Arguments
7951    ///
7952    /// * `name` - The name to set.
7953    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
7954        let mut query = self.selection.select("withName");
7955        query = query.arg("name", name.into());
7956        ModuleSource {
7957            proc: self.proc.clone(),
7958            selection: query,
7959            graphql_client: self.graphql_client.clone(),
7960        }
7961    }
7962    /// Update the module source with a new SDK.
7963    ///
7964    /// # Arguments
7965    ///
7966    /// * `source` - The SDK source to set.
7967    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
7968        let mut query = self.selection.select("withSDK");
7969        query = query.arg("source", source.into());
7970        ModuleSource {
7971            proc: self.proc.clone(),
7972            selection: query,
7973            graphql_client: self.graphql_client.clone(),
7974        }
7975    }
7976    /// Update the module source with a new source subpath.
7977    ///
7978    /// # Arguments
7979    ///
7980    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
7981    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
7982        let mut query = self.selection.select("withSourceSubpath");
7983        query = query.arg("path", path.into());
7984        ModuleSource {
7985            proc: self.proc.clone(),
7986            selection: query,
7987            graphql_client: self.graphql_client.clone(),
7988        }
7989    }
7990    /// Update one or more module dependencies.
7991    ///
7992    /// # Arguments
7993    ///
7994    /// * `dependencies` - The dependencies to update.
7995    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
7996        let mut query = self.selection.select("withUpdateDependencies");
7997        query = query.arg(
7998            "dependencies",
7999            dependencies
8000                .into_iter()
8001                .map(|i| i.into())
8002                .collect::<Vec<String>>(),
8003        );
8004        ModuleSource {
8005            proc: self.proc.clone(),
8006            selection: query,
8007            graphql_client: self.graphql_client.clone(),
8008        }
8009    }
8010    /// Remove a client from the module source.
8011    ///
8012    /// # Arguments
8013    ///
8014    /// * `path` - The path of the client to remove.
8015    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
8016        let mut query = self.selection.select("withoutClient");
8017        query = query.arg("path", path.into());
8018        ModuleSource {
8019            proc: self.proc.clone(),
8020            selection: query,
8021            graphql_client: self.graphql_client.clone(),
8022        }
8023    }
8024    /// Remove the provided dependencies from the module source's dependency list.
8025    ///
8026    /// # Arguments
8027    ///
8028    /// * `dependencies` - The dependencies to remove.
8029    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
8030        let mut query = self.selection.select("withoutDependencies");
8031        query = query.arg(
8032            "dependencies",
8033            dependencies
8034                .into_iter()
8035                .map(|i| i.into())
8036                .collect::<Vec<String>>(),
8037        );
8038        ModuleSource {
8039            proc: self.proc.clone(),
8040            selection: query,
8041            graphql_client: self.graphql_client.clone(),
8042        }
8043    }
8044}
8045#[derive(Clone)]
8046pub struct ObjectTypeDef {
8047    pub proc: Option<Arc<DaggerSessionProc>>,
8048    pub selection: Selection,
8049    pub graphql_client: DynGraphQLClient,
8050}
8051impl ObjectTypeDef {
8052    /// The function used to construct new instances of this object, if any
8053    pub fn constructor(&self) -> Function {
8054        let query = self.selection.select("constructor");
8055        Function {
8056            proc: self.proc.clone(),
8057            selection: query,
8058            graphql_client: self.graphql_client.clone(),
8059        }
8060    }
8061    /// The doc string for the object, if any.
8062    pub async fn description(&self) -> Result<String, DaggerError> {
8063        let query = self.selection.select("description");
8064        query.execute(self.graphql_client.clone()).await
8065    }
8066    /// Static fields defined on this object, if any.
8067    pub fn fields(&self) -> Vec<FieldTypeDef> {
8068        let query = self.selection.select("fields");
8069        vec![FieldTypeDef {
8070            proc: self.proc.clone(),
8071            selection: query,
8072            graphql_client: self.graphql_client.clone(),
8073        }]
8074    }
8075    /// Functions defined on this object, if any.
8076    pub fn functions(&self) -> Vec<Function> {
8077        let query = self.selection.select("functions");
8078        vec![Function {
8079            proc: self.proc.clone(),
8080            selection: query,
8081            graphql_client: self.graphql_client.clone(),
8082        }]
8083    }
8084    /// A unique identifier for this ObjectTypeDef.
8085    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
8086        let query = self.selection.select("id");
8087        query.execute(self.graphql_client.clone()).await
8088    }
8089    /// The name of the object.
8090    pub async fn name(&self) -> Result<String, DaggerError> {
8091        let query = self.selection.select("name");
8092        query.execute(self.graphql_client.clone()).await
8093    }
8094    /// The location of this object declaration.
8095    pub fn source_map(&self) -> SourceMap {
8096        let query = self.selection.select("sourceMap");
8097        SourceMap {
8098            proc: self.proc.clone(),
8099            selection: query,
8100            graphql_client: self.graphql_client.clone(),
8101        }
8102    }
8103    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
8104    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8105        let query = self.selection.select("sourceModuleName");
8106        query.execute(self.graphql_client.clone()).await
8107    }
8108}
8109#[derive(Clone)]
8110pub struct Port {
8111    pub proc: Option<Arc<DaggerSessionProc>>,
8112    pub selection: Selection,
8113    pub graphql_client: DynGraphQLClient,
8114}
8115impl Port {
8116    /// The port description.
8117    pub async fn description(&self) -> Result<String, DaggerError> {
8118        let query = self.selection.select("description");
8119        query.execute(self.graphql_client.clone()).await
8120    }
8121    /// Skip the health check when run as a service.
8122    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
8123        let query = self.selection.select("experimentalSkipHealthcheck");
8124        query.execute(self.graphql_client.clone()).await
8125    }
8126    /// A unique identifier for this Port.
8127    pub async fn id(&self) -> Result<PortId, DaggerError> {
8128        let query = self.selection.select("id");
8129        query.execute(self.graphql_client.clone()).await
8130    }
8131    /// The port number.
8132    pub async fn port(&self) -> Result<isize, DaggerError> {
8133        let query = self.selection.select("port");
8134        query.execute(self.graphql_client.clone()).await
8135    }
8136    /// The transport layer protocol.
8137    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
8138        let query = self.selection.select("protocol");
8139        query.execute(self.graphql_client.clone()).await
8140    }
8141}
8142#[derive(Clone)]
8143pub struct Query {
8144    pub proc: Option<Arc<DaggerSessionProc>>,
8145    pub selection: Selection,
8146    pub graphql_client: DynGraphQLClient,
8147}
8148#[derive(Builder, Debug, PartialEq)]
8149pub struct QueryCacheVolumeOpts<'a> {
8150    #[builder(setter(into, strip_option), default)]
8151    pub namespace: Option<&'a str>,
8152}
8153#[derive(Builder, Debug, PartialEq)]
8154pub struct QueryContainerOpts {
8155    /// Platform to initialize the container with. Defaults to the native platform of the current engine
8156    #[builder(setter(into, strip_option), default)]
8157    pub platform: Option<Platform>,
8158}
8159#[derive(Builder, Debug, PartialEq)]
8160pub struct QueryEnvOpts {
8161    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
8162    #[builder(setter(into, strip_option), default)]
8163    pub privileged: Option<bool>,
8164    /// Allow new outputs to be declared and saved in the environment
8165    #[builder(setter(into, strip_option), default)]
8166    pub writable: Option<bool>,
8167}
8168#[derive(Builder, Debug, PartialEq)]
8169pub struct QueryFileOpts {
8170    /// Permissions of the new file. Example: 0600
8171    #[builder(setter(into, strip_option), default)]
8172    pub permissions: Option<isize>,
8173}
8174#[derive(Builder, Debug, PartialEq)]
8175pub struct QueryGitOpts<'a> {
8176    /// A service which must be started before the repo is fetched.
8177    #[builder(setter(into, strip_option), default)]
8178    pub experimental_service_host: Option<ServiceId>,
8179    /// Secret used to populate the Authorization HTTP header
8180    #[builder(setter(into, strip_option), default)]
8181    pub http_auth_header: Option<SecretId>,
8182    /// Secret used to populate the password during basic HTTP Authorization
8183    #[builder(setter(into, strip_option), default)]
8184    pub http_auth_token: Option<SecretId>,
8185    /// DEPRECATED: Set to true to keep .git directory.
8186    #[builder(setter(into, strip_option), default)]
8187    pub keep_git_dir: Option<bool>,
8188    /// Set SSH auth socket
8189    #[builder(setter(into, strip_option), default)]
8190    pub ssh_auth_socket: Option<SocketId>,
8191    /// Set SSH known hosts
8192    #[builder(setter(into, strip_option), default)]
8193    pub ssh_known_hosts: Option<&'a str>,
8194}
8195#[derive(Builder, Debug, PartialEq)]
8196pub struct QueryHttpOpts<'a> {
8197    /// Secret used to populate the Authorization HTTP header
8198    #[builder(setter(into, strip_option), default)]
8199    pub auth_header: Option<SecretId>,
8200    /// A service which must be started before the URL is fetched.
8201    #[builder(setter(into, strip_option), default)]
8202    pub experimental_service_host: Option<ServiceId>,
8203    /// File name to use for the file. Defaults to the last part of the URL.
8204    #[builder(setter(into, strip_option), default)]
8205    pub name: Option<&'a str>,
8206    /// Permissions to set on the file.
8207    #[builder(setter(into, strip_option), default)]
8208    pub permissions: Option<isize>,
8209}
8210#[derive(Builder, Debug, PartialEq)]
8211pub struct QueryLlmOpts<'a> {
8212    /// Cap the number of API calls for this LLM
8213    #[builder(setter(into, strip_option), default)]
8214    pub max_api_calls: Option<isize>,
8215    /// Model to use
8216    #[builder(setter(into, strip_option), default)]
8217    pub model: Option<&'a str>,
8218}
8219#[derive(Builder, Debug, PartialEq)]
8220pub struct QueryModuleSourceOpts<'a> {
8221    /// 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.
8222    #[builder(setter(into, strip_option), default)]
8223    pub allow_not_exists: Option<bool>,
8224    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
8225    #[builder(setter(into, strip_option), default)]
8226    pub disable_find_up: Option<bool>,
8227    /// The pinned version of the module source
8228    #[builder(setter(into, strip_option), default)]
8229    pub ref_pin: Option<&'a str>,
8230    /// If set, error out if the ref string is not of the provided requireKind.
8231    #[builder(setter(into, strip_option), default)]
8232    pub require_kind: Option<ModuleSourceKind>,
8233}
8234#[derive(Builder, Debug, PartialEq)]
8235pub struct QuerySecretOpts<'a> {
8236    /// 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.
8237    /// 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.
8238    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
8239    #[builder(setter(into, strip_option), default)]
8240    pub cache_key: Option<&'a str>,
8241}
8242impl Query {
8243    /// Constructs a cache volume for a given cache key.
8244    ///
8245    /// # Arguments
8246    ///
8247    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
8248    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8249    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
8250        let mut query = self.selection.select("cacheVolume");
8251        query = query.arg("key", key.into());
8252        CacheVolume {
8253            proc: self.proc.clone(),
8254            selection: query,
8255            graphql_client: self.graphql_client.clone(),
8256        }
8257    }
8258    /// Constructs a cache volume for a given cache key.
8259    ///
8260    /// # Arguments
8261    ///
8262    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
8263    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8264    pub fn cache_volume_opts<'a>(
8265        &self,
8266        key: impl Into<String>,
8267        opts: QueryCacheVolumeOpts<'a>,
8268    ) -> CacheVolume {
8269        let mut query = self.selection.select("cacheVolume");
8270        query = query.arg("key", key.into());
8271        if let Some(namespace) = opts.namespace {
8272            query = query.arg("namespace", namespace);
8273        }
8274        CacheVolume {
8275            proc: self.proc.clone(),
8276            selection: query,
8277            graphql_client: self.graphql_client.clone(),
8278        }
8279    }
8280    /// Creates a scratch container, with no image or metadata.
8281    /// To pull an image, follow up with the "from" function.
8282    ///
8283    /// # Arguments
8284    ///
8285    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8286    pub fn container(&self) -> Container {
8287        let query = self.selection.select("container");
8288        Container {
8289            proc: self.proc.clone(),
8290            selection: query,
8291            graphql_client: self.graphql_client.clone(),
8292        }
8293    }
8294    /// Creates a scratch container, with no image or metadata.
8295    /// To pull an image, follow up with the "from" function.
8296    ///
8297    /// # Arguments
8298    ///
8299    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8300    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
8301        let mut query = self.selection.select("container");
8302        if let Some(platform) = opts.platform {
8303            query = query.arg("platform", platform);
8304        }
8305        Container {
8306            proc: self.proc.clone(),
8307            selection: query,
8308            graphql_client: self.graphql_client.clone(),
8309        }
8310    }
8311    /// The FunctionCall context that the SDK caller is currently executing in.
8312    /// If the caller is not currently executing in a function, this will return an error.
8313    pub fn current_function_call(&self) -> FunctionCall {
8314        let query = self.selection.select("currentFunctionCall");
8315        FunctionCall {
8316            proc: self.proc.clone(),
8317            selection: query,
8318            graphql_client: self.graphql_client.clone(),
8319        }
8320    }
8321    /// The module currently being served in the session, if any.
8322    pub fn current_module(&self) -> CurrentModule {
8323        let query = self.selection.select("currentModule");
8324        CurrentModule {
8325            proc: self.proc.clone(),
8326            selection: query,
8327            graphql_client: self.graphql_client.clone(),
8328        }
8329    }
8330    /// The TypeDef representations of the objects currently being served in the session.
8331    pub fn current_type_defs(&self) -> Vec<TypeDef> {
8332        let query = self.selection.select("currentTypeDefs");
8333        vec![TypeDef {
8334            proc: self.proc.clone(),
8335            selection: query,
8336            graphql_client: self.graphql_client.clone(),
8337        }]
8338    }
8339    /// The default platform of the engine.
8340    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
8341        let query = self.selection.select("defaultPlatform");
8342        query.execute(self.graphql_client.clone()).await
8343    }
8344    /// Creates an empty directory.
8345    pub fn directory(&self) -> Directory {
8346        let query = self.selection.select("directory");
8347        Directory {
8348            proc: self.proc.clone(),
8349            selection: query,
8350            graphql_client: self.graphql_client.clone(),
8351        }
8352    }
8353    /// The Dagger engine container configuration and state
8354    pub fn engine(&self) -> Engine {
8355        let query = self.selection.select("engine");
8356        Engine {
8357            proc: self.proc.clone(),
8358            selection: query,
8359            graphql_client: self.graphql_client.clone(),
8360        }
8361    }
8362    /// Initialize a new environment
8363    ///
8364    /// # Arguments
8365    ///
8366    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8367    pub fn env(&self) -> Env {
8368        let query = self.selection.select("env");
8369        Env {
8370            proc: self.proc.clone(),
8371            selection: query,
8372            graphql_client: self.graphql_client.clone(),
8373        }
8374    }
8375    /// Initialize a new environment
8376    ///
8377    /// # Arguments
8378    ///
8379    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8380    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
8381        let mut query = self.selection.select("env");
8382        if let Some(privileged) = opts.privileged {
8383            query = query.arg("privileged", privileged);
8384        }
8385        if let Some(writable) = opts.writable {
8386            query = query.arg("writable", writable);
8387        }
8388        Env {
8389            proc: self.proc.clone(),
8390            selection: query,
8391            graphql_client: self.graphql_client.clone(),
8392        }
8393    }
8394    /// Create a new error.
8395    ///
8396    /// # Arguments
8397    ///
8398    /// * `message` - A brief description of the error.
8399    pub fn error(&self, message: impl Into<String>) -> Error {
8400        let mut query = self.selection.select("error");
8401        query = query.arg("message", message.into());
8402        Error {
8403            proc: self.proc.clone(),
8404            selection: query,
8405            graphql_client: self.graphql_client.clone(),
8406        }
8407    }
8408    /// Creates a file with the specified contents.
8409    ///
8410    /// # Arguments
8411    ///
8412    /// * `name` - Name of the new file. Example: "foo.txt"
8413    /// * `contents` - Contents of the new file. Example: "Hello world!"
8414    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8415    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
8416        let mut query = self.selection.select("file");
8417        query = query.arg("name", name.into());
8418        query = query.arg("contents", contents.into());
8419        File {
8420            proc: self.proc.clone(),
8421            selection: query,
8422            graphql_client: self.graphql_client.clone(),
8423        }
8424    }
8425    /// Creates a file with the specified contents.
8426    ///
8427    /// # Arguments
8428    ///
8429    /// * `name` - Name of the new file. Example: "foo.txt"
8430    /// * `contents` - Contents of the new file. Example: "Hello world!"
8431    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8432    pub fn file_opts(
8433        &self,
8434        name: impl Into<String>,
8435        contents: impl Into<String>,
8436        opts: QueryFileOpts,
8437    ) -> File {
8438        let mut query = self.selection.select("file");
8439        query = query.arg("name", name.into());
8440        query = query.arg("contents", contents.into());
8441        if let Some(permissions) = opts.permissions {
8442            query = query.arg("permissions", permissions);
8443        }
8444        File {
8445            proc: self.proc.clone(),
8446            selection: query,
8447            graphql_client: self.graphql_client.clone(),
8448        }
8449    }
8450    /// Creates a function.
8451    ///
8452    /// # Arguments
8453    ///
8454    /// * `name` - Name of the function, in its original format from the implementation language.
8455    /// * `return_type` - Return type of the function.
8456    pub fn function(
8457        &self,
8458        name: impl Into<String>,
8459        return_type: impl IntoID<TypeDefId>,
8460    ) -> Function {
8461        let mut query = self.selection.select("function");
8462        query = query.arg("name", name.into());
8463        query = query.arg_lazy(
8464            "returnType",
8465            Box::new(move || {
8466                let return_type = return_type.clone();
8467                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
8468            }),
8469        );
8470        Function {
8471            proc: self.proc.clone(),
8472            selection: query,
8473            graphql_client: self.graphql_client.clone(),
8474        }
8475    }
8476    /// Create a code generation result, given a directory containing the generated code.
8477    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
8478        let mut query = self.selection.select("generatedCode");
8479        query = query.arg_lazy(
8480            "code",
8481            Box::new(move || {
8482                let code = code.clone();
8483                Box::pin(async move { code.into_id().await.unwrap().quote() })
8484            }),
8485        );
8486        GeneratedCode {
8487            proc: self.proc.clone(),
8488            selection: query,
8489            graphql_client: self.graphql_client.clone(),
8490        }
8491    }
8492    /// Queries a Git repository.
8493    ///
8494    /// # Arguments
8495    ///
8496    /// * `url` - URL of the git repository.
8497    ///
8498    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
8499    ///
8500    /// Suffix ".git" is optional.
8501    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8502    pub fn git(&self, url: impl Into<String>) -> GitRepository {
8503        let mut query = self.selection.select("git");
8504        query = query.arg("url", url.into());
8505        GitRepository {
8506            proc: self.proc.clone(),
8507            selection: query,
8508            graphql_client: self.graphql_client.clone(),
8509        }
8510    }
8511    /// Queries a Git repository.
8512    ///
8513    /// # Arguments
8514    ///
8515    /// * `url` - URL of the git repository.
8516    ///
8517    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
8518    ///
8519    /// Suffix ".git" is optional.
8520    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8521    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
8522        let mut query = self.selection.select("git");
8523        query = query.arg("url", url.into());
8524        if let Some(keep_git_dir) = opts.keep_git_dir {
8525            query = query.arg("keepGitDir", keep_git_dir);
8526        }
8527        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
8528            query = query.arg("sshKnownHosts", ssh_known_hosts);
8529        }
8530        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
8531            query = query.arg("sshAuthSocket", ssh_auth_socket);
8532        }
8533        if let Some(http_auth_token) = opts.http_auth_token {
8534            query = query.arg("httpAuthToken", http_auth_token);
8535        }
8536        if let Some(http_auth_header) = opts.http_auth_header {
8537            query = query.arg("httpAuthHeader", http_auth_header);
8538        }
8539        if let Some(experimental_service_host) = opts.experimental_service_host {
8540            query = query.arg("experimentalServiceHost", experimental_service_host);
8541        }
8542        GitRepository {
8543            proc: self.proc.clone(),
8544            selection: query,
8545            graphql_client: self.graphql_client.clone(),
8546        }
8547    }
8548    /// Queries the host environment.
8549    pub fn host(&self) -> Host {
8550        let query = self.selection.select("host");
8551        Host {
8552            proc: self.proc.clone(),
8553            selection: query,
8554            graphql_client: self.graphql_client.clone(),
8555        }
8556    }
8557    /// Returns a file containing an http remote url content.
8558    ///
8559    /// # Arguments
8560    ///
8561    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
8562    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8563    pub fn http(&self, url: impl Into<String>) -> File {
8564        let mut query = self.selection.select("http");
8565        query = query.arg("url", url.into());
8566        File {
8567            proc: self.proc.clone(),
8568            selection: query,
8569            graphql_client: self.graphql_client.clone(),
8570        }
8571    }
8572    /// Returns a file containing an http remote url content.
8573    ///
8574    /// # Arguments
8575    ///
8576    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
8577    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8578    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
8579        let mut query = self.selection.select("http");
8580        query = query.arg("url", url.into());
8581        if let Some(name) = opts.name {
8582            query = query.arg("name", name);
8583        }
8584        if let Some(permissions) = opts.permissions {
8585            query = query.arg("permissions", permissions);
8586        }
8587        if let Some(auth_header) = opts.auth_header {
8588            query = query.arg("authHeader", auth_header);
8589        }
8590        if let Some(experimental_service_host) = opts.experimental_service_host {
8591            query = query.arg("experimentalServiceHost", experimental_service_host);
8592        }
8593        File {
8594            proc: self.proc.clone(),
8595            selection: query,
8596            graphql_client: self.graphql_client.clone(),
8597        }
8598    }
8599    /// Initialize a Large Language Model (LLM)
8600    ///
8601    /// # Arguments
8602    ///
8603    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8604    pub fn llm(&self) -> Llm {
8605        let query = self.selection.select("llm");
8606        Llm {
8607            proc: self.proc.clone(),
8608            selection: query,
8609            graphql_client: self.graphql_client.clone(),
8610        }
8611    }
8612    /// Initialize a Large Language Model (LLM)
8613    ///
8614    /// # Arguments
8615    ///
8616    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8617    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
8618        let mut query = self.selection.select("llm");
8619        if let Some(model) = opts.model {
8620            query = query.arg("model", model);
8621        }
8622        if let Some(max_api_calls) = opts.max_api_calls {
8623            query = query.arg("maxAPICalls", max_api_calls);
8624        }
8625        Llm {
8626            proc: self.proc.clone(),
8627            selection: query,
8628            graphql_client: self.graphql_client.clone(),
8629        }
8630    }
8631    /// Load a Binding from its ID.
8632    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
8633        let mut query = self.selection.select("loadBindingFromID");
8634        query = query.arg_lazy(
8635            "id",
8636            Box::new(move || {
8637                let id = id.clone();
8638                Box::pin(async move { id.into_id().await.unwrap().quote() })
8639            }),
8640        );
8641        Binding {
8642            proc: self.proc.clone(),
8643            selection: query,
8644            graphql_client: self.graphql_client.clone(),
8645        }
8646    }
8647    /// Load a CacheVolume from its ID.
8648    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
8649        let mut query = self.selection.select("loadCacheVolumeFromID");
8650        query = query.arg_lazy(
8651            "id",
8652            Box::new(move || {
8653                let id = id.clone();
8654                Box::pin(async move { id.into_id().await.unwrap().quote() })
8655            }),
8656        );
8657        CacheVolume {
8658            proc: self.proc.clone(),
8659            selection: query,
8660            graphql_client: self.graphql_client.clone(),
8661        }
8662    }
8663    /// Load a Container from its ID.
8664    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
8665        let mut query = self.selection.select("loadContainerFromID");
8666        query = query.arg_lazy(
8667            "id",
8668            Box::new(move || {
8669                let id = id.clone();
8670                Box::pin(async move { id.into_id().await.unwrap().quote() })
8671            }),
8672        );
8673        Container {
8674            proc: self.proc.clone(),
8675            selection: query,
8676            graphql_client: self.graphql_client.clone(),
8677        }
8678    }
8679    /// Load a CurrentModule from its ID.
8680    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
8681        let mut query = self.selection.select("loadCurrentModuleFromID");
8682        query = query.arg_lazy(
8683            "id",
8684            Box::new(move || {
8685                let id = id.clone();
8686                Box::pin(async move { id.into_id().await.unwrap().quote() })
8687            }),
8688        );
8689        CurrentModule {
8690            proc: self.proc.clone(),
8691            selection: query,
8692            graphql_client: self.graphql_client.clone(),
8693        }
8694    }
8695    /// Load a Directory from its ID.
8696    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
8697        let mut query = self.selection.select("loadDirectoryFromID");
8698        query = query.arg_lazy(
8699            "id",
8700            Box::new(move || {
8701                let id = id.clone();
8702                Box::pin(async move { id.into_id().await.unwrap().quote() })
8703            }),
8704        );
8705        Directory {
8706            proc: self.proc.clone(),
8707            selection: query,
8708            graphql_client: self.graphql_client.clone(),
8709        }
8710    }
8711    /// Load a EngineCacheEntry from its ID.
8712    pub fn load_engine_cache_entry_from_id(
8713        &self,
8714        id: impl IntoID<EngineCacheEntryId>,
8715    ) -> EngineCacheEntry {
8716        let mut query = self.selection.select("loadEngineCacheEntryFromID");
8717        query = query.arg_lazy(
8718            "id",
8719            Box::new(move || {
8720                let id = id.clone();
8721                Box::pin(async move { id.into_id().await.unwrap().quote() })
8722            }),
8723        );
8724        EngineCacheEntry {
8725            proc: self.proc.clone(),
8726            selection: query,
8727            graphql_client: self.graphql_client.clone(),
8728        }
8729    }
8730    /// Load a EngineCacheEntrySet from its ID.
8731    pub fn load_engine_cache_entry_set_from_id(
8732        &self,
8733        id: impl IntoID<EngineCacheEntrySetId>,
8734    ) -> EngineCacheEntrySet {
8735        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
8736        query = query.arg_lazy(
8737            "id",
8738            Box::new(move || {
8739                let id = id.clone();
8740                Box::pin(async move { id.into_id().await.unwrap().quote() })
8741            }),
8742        );
8743        EngineCacheEntrySet {
8744            proc: self.proc.clone(),
8745            selection: query,
8746            graphql_client: self.graphql_client.clone(),
8747        }
8748    }
8749    /// Load a EngineCache from its ID.
8750    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
8751        let mut query = self.selection.select("loadEngineCacheFromID");
8752        query = query.arg_lazy(
8753            "id",
8754            Box::new(move || {
8755                let id = id.clone();
8756                Box::pin(async move { id.into_id().await.unwrap().quote() })
8757            }),
8758        );
8759        EngineCache {
8760            proc: self.proc.clone(),
8761            selection: query,
8762            graphql_client: self.graphql_client.clone(),
8763        }
8764    }
8765    /// Load a Engine from its ID.
8766    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
8767        let mut query = self.selection.select("loadEngineFromID");
8768        query = query.arg_lazy(
8769            "id",
8770            Box::new(move || {
8771                let id = id.clone();
8772                Box::pin(async move { id.into_id().await.unwrap().quote() })
8773            }),
8774        );
8775        Engine {
8776            proc: self.proc.clone(),
8777            selection: query,
8778            graphql_client: self.graphql_client.clone(),
8779        }
8780    }
8781    /// Load a EnumTypeDef from its ID.
8782    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
8783        let mut query = self.selection.select("loadEnumTypeDefFromID");
8784        query = query.arg_lazy(
8785            "id",
8786            Box::new(move || {
8787                let id = id.clone();
8788                Box::pin(async move { id.into_id().await.unwrap().quote() })
8789            }),
8790        );
8791        EnumTypeDef {
8792            proc: self.proc.clone(),
8793            selection: query,
8794            graphql_client: self.graphql_client.clone(),
8795        }
8796    }
8797    /// Load a EnumValueTypeDef from its ID.
8798    pub fn load_enum_value_type_def_from_id(
8799        &self,
8800        id: impl IntoID<EnumValueTypeDefId>,
8801    ) -> EnumValueTypeDef {
8802        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
8803        query = query.arg_lazy(
8804            "id",
8805            Box::new(move || {
8806                let id = id.clone();
8807                Box::pin(async move { id.into_id().await.unwrap().quote() })
8808            }),
8809        );
8810        EnumValueTypeDef {
8811            proc: self.proc.clone(),
8812            selection: query,
8813            graphql_client: self.graphql_client.clone(),
8814        }
8815    }
8816    /// Load a Env from its ID.
8817    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
8818        let mut query = self.selection.select("loadEnvFromID");
8819        query = query.arg_lazy(
8820            "id",
8821            Box::new(move || {
8822                let id = id.clone();
8823                Box::pin(async move { id.into_id().await.unwrap().quote() })
8824            }),
8825        );
8826        Env {
8827            proc: self.proc.clone(),
8828            selection: query,
8829            graphql_client: self.graphql_client.clone(),
8830        }
8831    }
8832    /// Load a EnvVariable from its ID.
8833    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
8834        let mut query = self.selection.select("loadEnvVariableFromID");
8835        query = query.arg_lazy(
8836            "id",
8837            Box::new(move || {
8838                let id = id.clone();
8839                Box::pin(async move { id.into_id().await.unwrap().quote() })
8840            }),
8841        );
8842        EnvVariable {
8843            proc: self.proc.clone(),
8844            selection: query,
8845            graphql_client: self.graphql_client.clone(),
8846        }
8847    }
8848    /// Load a Error from its ID.
8849    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
8850        let mut query = self.selection.select("loadErrorFromID");
8851        query = query.arg_lazy(
8852            "id",
8853            Box::new(move || {
8854                let id = id.clone();
8855                Box::pin(async move { id.into_id().await.unwrap().quote() })
8856            }),
8857        );
8858        Error {
8859            proc: self.proc.clone(),
8860            selection: query,
8861            graphql_client: self.graphql_client.clone(),
8862        }
8863    }
8864    /// Load a ErrorValue from its ID.
8865    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
8866        let mut query = self.selection.select("loadErrorValueFromID");
8867        query = query.arg_lazy(
8868            "id",
8869            Box::new(move || {
8870                let id = id.clone();
8871                Box::pin(async move { id.into_id().await.unwrap().quote() })
8872            }),
8873        );
8874        ErrorValue {
8875            proc: self.proc.clone(),
8876            selection: query,
8877            graphql_client: self.graphql_client.clone(),
8878        }
8879    }
8880    /// Load a FieldTypeDef from its ID.
8881    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
8882        let mut query = self.selection.select("loadFieldTypeDefFromID");
8883        query = query.arg_lazy(
8884            "id",
8885            Box::new(move || {
8886                let id = id.clone();
8887                Box::pin(async move { id.into_id().await.unwrap().quote() })
8888            }),
8889        );
8890        FieldTypeDef {
8891            proc: self.proc.clone(),
8892            selection: query,
8893            graphql_client: self.graphql_client.clone(),
8894        }
8895    }
8896    /// Load a File from its ID.
8897    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
8898        let mut query = self.selection.select("loadFileFromID");
8899        query = query.arg_lazy(
8900            "id",
8901            Box::new(move || {
8902                let id = id.clone();
8903                Box::pin(async move { id.into_id().await.unwrap().quote() })
8904            }),
8905        );
8906        File {
8907            proc: self.proc.clone(),
8908            selection: query,
8909            graphql_client: self.graphql_client.clone(),
8910        }
8911    }
8912    /// Load a FunctionArg from its ID.
8913    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
8914        let mut query = self.selection.select("loadFunctionArgFromID");
8915        query = query.arg_lazy(
8916            "id",
8917            Box::new(move || {
8918                let id = id.clone();
8919                Box::pin(async move { id.into_id().await.unwrap().quote() })
8920            }),
8921        );
8922        FunctionArg {
8923            proc: self.proc.clone(),
8924            selection: query,
8925            graphql_client: self.graphql_client.clone(),
8926        }
8927    }
8928    /// Load a FunctionCallArgValue from its ID.
8929    pub fn load_function_call_arg_value_from_id(
8930        &self,
8931        id: impl IntoID<FunctionCallArgValueId>,
8932    ) -> FunctionCallArgValue {
8933        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
8934        query = query.arg_lazy(
8935            "id",
8936            Box::new(move || {
8937                let id = id.clone();
8938                Box::pin(async move { id.into_id().await.unwrap().quote() })
8939            }),
8940        );
8941        FunctionCallArgValue {
8942            proc: self.proc.clone(),
8943            selection: query,
8944            graphql_client: self.graphql_client.clone(),
8945        }
8946    }
8947    /// Load a FunctionCall from its ID.
8948    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
8949        let mut query = self.selection.select("loadFunctionCallFromID");
8950        query = query.arg_lazy(
8951            "id",
8952            Box::new(move || {
8953                let id = id.clone();
8954                Box::pin(async move { id.into_id().await.unwrap().quote() })
8955            }),
8956        );
8957        FunctionCall {
8958            proc: self.proc.clone(),
8959            selection: query,
8960            graphql_client: self.graphql_client.clone(),
8961        }
8962    }
8963    /// Load a Function from its ID.
8964    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
8965        let mut query = self.selection.select("loadFunctionFromID");
8966        query = query.arg_lazy(
8967            "id",
8968            Box::new(move || {
8969                let id = id.clone();
8970                Box::pin(async move { id.into_id().await.unwrap().quote() })
8971            }),
8972        );
8973        Function {
8974            proc: self.proc.clone(),
8975            selection: query,
8976            graphql_client: self.graphql_client.clone(),
8977        }
8978    }
8979    /// Load a GeneratedCode from its ID.
8980    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
8981        let mut query = self.selection.select("loadGeneratedCodeFromID");
8982        query = query.arg_lazy(
8983            "id",
8984            Box::new(move || {
8985                let id = id.clone();
8986                Box::pin(async move { id.into_id().await.unwrap().quote() })
8987            }),
8988        );
8989        GeneratedCode {
8990            proc: self.proc.clone(),
8991            selection: query,
8992            graphql_client: self.graphql_client.clone(),
8993        }
8994    }
8995    /// Load a GitRef from its ID.
8996    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
8997        let mut query = self.selection.select("loadGitRefFromID");
8998        query = query.arg_lazy(
8999            "id",
9000            Box::new(move || {
9001                let id = id.clone();
9002                Box::pin(async move { id.into_id().await.unwrap().quote() })
9003            }),
9004        );
9005        GitRef {
9006            proc: self.proc.clone(),
9007            selection: query,
9008            graphql_client: self.graphql_client.clone(),
9009        }
9010    }
9011    /// Load a GitRepository from its ID.
9012    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
9013        let mut query = self.selection.select("loadGitRepositoryFromID");
9014        query = query.arg_lazy(
9015            "id",
9016            Box::new(move || {
9017                let id = id.clone();
9018                Box::pin(async move { id.into_id().await.unwrap().quote() })
9019            }),
9020        );
9021        GitRepository {
9022            proc: self.proc.clone(),
9023            selection: query,
9024            graphql_client: self.graphql_client.clone(),
9025        }
9026    }
9027    /// Load a Host from its ID.
9028    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
9029        let mut query = self.selection.select("loadHostFromID");
9030        query = query.arg_lazy(
9031            "id",
9032            Box::new(move || {
9033                let id = id.clone();
9034                Box::pin(async move { id.into_id().await.unwrap().quote() })
9035            }),
9036        );
9037        Host {
9038            proc: self.proc.clone(),
9039            selection: query,
9040            graphql_client: self.graphql_client.clone(),
9041        }
9042    }
9043    /// Load a InputTypeDef from its ID.
9044    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
9045        let mut query = self.selection.select("loadInputTypeDefFromID");
9046        query = query.arg_lazy(
9047            "id",
9048            Box::new(move || {
9049                let id = id.clone();
9050                Box::pin(async move { id.into_id().await.unwrap().quote() })
9051            }),
9052        );
9053        InputTypeDef {
9054            proc: self.proc.clone(),
9055            selection: query,
9056            graphql_client: self.graphql_client.clone(),
9057        }
9058    }
9059    /// Load a InterfaceTypeDef from its ID.
9060    pub fn load_interface_type_def_from_id(
9061        &self,
9062        id: impl IntoID<InterfaceTypeDefId>,
9063    ) -> InterfaceTypeDef {
9064        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
9065        query = query.arg_lazy(
9066            "id",
9067            Box::new(move || {
9068                let id = id.clone();
9069                Box::pin(async move { id.into_id().await.unwrap().quote() })
9070            }),
9071        );
9072        InterfaceTypeDef {
9073            proc: self.proc.clone(),
9074            selection: query,
9075            graphql_client: self.graphql_client.clone(),
9076        }
9077    }
9078    /// Load a LLM from its ID.
9079    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
9080        let mut query = self.selection.select("loadLLMFromID");
9081        query = query.arg_lazy(
9082            "id",
9083            Box::new(move || {
9084                let id = id.clone();
9085                Box::pin(async move { id.into_id().await.unwrap().quote() })
9086            }),
9087        );
9088        Llm {
9089            proc: self.proc.clone(),
9090            selection: query,
9091            graphql_client: self.graphql_client.clone(),
9092        }
9093    }
9094    /// Load a LLMTokenUsage from its ID.
9095    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
9096        let mut query = self.selection.select("loadLLMTokenUsageFromID");
9097        query = query.arg_lazy(
9098            "id",
9099            Box::new(move || {
9100                let id = id.clone();
9101                Box::pin(async move { id.into_id().await.unwrap().quote() })
9102            }),
9103        );
9104        LlmTokenUsage {
9105            proc: self.proc.clone(),
9106            selection: query,
9107            graphql_client: self.graphql_client.clone(),
9108        }
9109    }
9110    /// Load a Label from its ID.
9111    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
9112        let mut query = self.selection.select("loadLabelFromID");
9113        query = query.arg_lazy(
9114            "id",
9115            Box::new(move || {
9116                let id = id.clone();
9117                Box::pin(async move { id.into_id().await.unwrap().quote() })
9118            }),
9119        );
9120        Label {
9121            proc: self.proc.clone(),
9122            selection: query,
9123            graphql_client: self.graphql_client.clone(),
9124        }
9125    }
9126    /// Load a ListTypeDef from its ID.
9127    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
9128        let mut query = self.selection.select("loadListTypeDefFromID");
9129        query = query.arg_lazy(
9130            "id",
9131            Box::new(move || {
9132                let id = id.clone();
9133                Box::pin(async move { id.into_id().await.unwrap().quote() })
9134            }),
9135        );
9136        ListTypeDef {
9137            proc: self.proc.clone(),
9138            selection: query,
9139            graphql_client: self.graphql_client.clone(),
9140        }
9141    }
9142    /// Load a ModuleConfigClient from its ID.
9143    pub fn load_module_config_client_from_id(
9144        &self,
9145        id: impl IntoID<ModuleConfigClientId>,
9146    ) -> ModuleConfigClient {
9147        let mut query = self.selection.select("loadModuleConfigClientFromID");
9148        query = query.arg_lazy(
9149            "id",
9150            Box::new(move || {
9151                let id = id.clone();
9152                Box::pin(async move { id.into_id().await.unwrap().quote() })
9153            }),
9154        );
9155        ModuleConfigClient {
9156            proc: self.proc.clone(),
9157            selection: query,
9158            graphql_client: self.graphql_client.clone(),
9159        }
9160    }
9161    /// Load a Module from its ID.
9162    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
9163        let mut query = self.selection.select("loadModuleFromID");
9164        query = query.arg_lazy(
9165            "id",
9166            Box::new(move || {
9167                let id = id.clone();
9168                Box::pin(async move { id.into_id().await.unwrap().quote() })
9169            }),
9170        );
9171        Module {
9172            proc: self.proc.clone(),
9173            selection: query,
9174            graphql_client: self.graphql_client.clone(),
9175        }
9176    }
9177    /// Load a ModuleSource from its ID.
9178    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
9179        let mut query = self.selection.select("loadModuleSourceFromID");
9180        query = query.arg_lazy(
9181            "id",
9182            Box::new(move || {
9183                let id = id.clone();
9184                Box::pin(async move { id.into_id().await.unwrap().quote() })
9185            }),
9186        );
9187        ModuleSource {
9188            proc: self.proc.clone(),
9189            selection: query,
9190            graphql_client: self.graphql_client.clone(),
9191        }
9192    }
9193    /// Load a ObjectTypeDef from its ID.
9194    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
9195        let mut query = self.selection.select("loadObjectTypeDefFromID");
9196        query = query.arg_lazy(
9197            "id",
9198            Box::new(move || {
9199                let id = id.clone();
9200                Box::pin(async move { id.into_id().await.unwrap().quote() })
9201            }),
9202        );
9203        ObjectTypeDef {
9204            proc: self.proc.clone(),
9205            selection: query,
9206            graphql_client: self.graphql_client.clone(),
9207        }
9208    }
9209    /// Load a Port from its ID.
9210    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
9211        let mut query = self.selection.select("loadPortFromID");
9212        query = query.arg_lazy(
9213            "id",
9214            Box::new(move || {
9215                let id = id.clone();
9216                Box::pin(async move { id.into_id().await.unwrap().quote() })
9217            }),
9218        );
9219        Port {
9220            proc: self.proc.clone(),
9221            selection: query,
9222            graphql_client: self.graphql_client.clone(),
9223        }
9224    }
9225    /// Load a SDKConfig from its ID.
9226    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
9227        let mut query = self.selection.select("loadSDKConfigFromID");
9228        query = query.arg_lazy(
9229            "id",
9230            Box::new(move || {
9231                let id = id.clone();
9232                Box::pin(async move { id.into_id().await.unwrap().quote() })
9233            }),
9234        );
9235        SdkConfig {
9236            proc: self.proc.clone(),
9237            selection: query,
9238            graphql_client: self.graphql_client.clone(),
9239        }
9240    }
9241    /// Load a ScalarTypeDef from its ID.
9242    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
9243        let mut query = self.selection.select("loadScalarTypeDefFromID");
9244        query = query.arg_lazy(
9245            "id",
9246            Box::new(move || {
9247                let id = id.clone();
9248                Box::pin(async move { id.into_id().await.unwrap().quote() })
9249            }),
9250        );
9251        ScalarTypeDef {
9252            proc: self.proc.clone(),
9253            selection: query,
9254            graphql_client: self.graphql_client.clone(),
9255        }
9256    }
9257    /// Load a Secret from its ID.
9258    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
9259        let mut query = self.selection.select("loadSecretFromID");
9260        query = query.arg_lazy(
9261            "id",
9262            Box::new(move || {
9263                let id = id.clone();
9264                Box::pin(async move { id.into_id().await.unwrap().quote() })
9265            }),
9266        );
9267        Secret {
9268            proc: self.proc.clone(),
9269            selection: query,
9270            graphql_client: self.graphql_client.clone(),
9271        }
9272    }
9273    /// Load a Service from its ID.
9274    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
9275        let mut query = self.selection.select("loadServiceFromID");
9276        query = query.arg_lazy(
9277            "id",
9278            Box::new(move || {
9279                let id = id.clone();
9280                Box::pin(async move { id.into_id().await.unwrap().quote() })
9281            }),
9282        );
9283        Service {
9284            proc: self.proc.clone(),
9285            selection: query,
9286            graphql_client: self.graphql_client.clone(),
9287        }
9288    }
9289    /// Load a Socket from its ID.
9290    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
9291        let mut query = self.selection.select("loadSocketFromID");
9292        query = query.arg_lazy(
9293            "id",
9294            Box::new(move || {
9295                let id = id.clone();
9296                Box::pin(async move { id.into_id().await.unwrap().quote() })
9297            }),
9298        );
9299        Socket {
9300            proc: self.proc.clone(),
9301            selection: query,
9302            graphql_client: self.graphql_client.clone(),
9303        }
9304    }
9305    /// Load a SourceMap from its ID.
9306    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
9307        let mut query = self.selection.select("loadSourceMapFromID");
9308        query = query.arg_lazy(
9309            "id",
9310            Box::new(move || {
9311                let id = id.clone();
9312                Box::pin(async move { id.into_id().await.unwrap().quote() })
9313            }),
9314        );
9315        SourceMap {
9316            proc: self.proc.clone(),
9317            selection: query,
9318            graphql_client: self.graphql_client.clone(),
9319        }
9320    }
9321    /// Load a Terminal from its ID.
9322    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
9323        let mut query = self.selection.select("loadTerminalFromID");
9324        query = query.arg_lazy(
9325            "id",
9326            Box::new(move || {
9327                let id = id.clone();
9328                Box::pin(async move { id.into_id().await.unwrap().quote() })
9329            }),
9330        );
9331        Terminal {
9332            proc: self.proc.clone(),
9333            selection: query,
9334            graphql_client: self.graphql_client.clone(),
9335        }
9336    }
9337    /// Load a TypeDef from its ID.
9338    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
9339        let mut query = self.selection.select("loadTypeDefFromID");
9340        query = query.arg_lazy(
9341            "id",
9342            Box::new(move || {
9343                let id = id.clone();
9344                Box::pin(async move { id.into_id().await.unwrap().quote() })
9345            }),
9346        );
9347        TypeDef {
9348            proc: self.proc.clone(),
9349            selection: query,
9350            graphql_client: self.graphql_client.clone(),
9351        }
9352    }
9353    /// Create a new module.
9354    pub fn module(&self) -> Module {
9355        let query = self.selection.select("module");
9356        Module {
9357            proc: self.proc.clone(),
9358            selection: query,
9359            graphql_client: self.graphql_client.clone(),
9360        }
9361    }
9362    /// Create a new module source instance from a source ref string
9363    ///
9364    /// # Arguments
9365    ///
9366    /// * `ref_string` - The string ref representation of the module source
9367    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9368    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
9369        let mut query = self.selection.select("moduleSource");
9370        query = query.arg("refString", ref_string.into());
9371        ModuleSource {
9372            proc: self.proc.clone(),
9373            selection: query,
9374            graphql_client: self.graphql_client.clone(),
9375        }
9376    }
9377    /// Create a new module source instance from a source ref string
9378    ///
9379    /// # Arguments
9380    ///
9381    /// * `ref_string` - The string ref representation of the module source
9382    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9383    pub fn module_source_opts<'a>(
9384        &self,
9385        ref_string: impl Into<String>,
9386        opts: QueryModuleSourceOpts<'a>,
9387    ) -> ModuleSource {
9388        let mut query = self.selection.select("moduleSource");
9389        query = query.arg("refString", ref_string.into());
9390        if let Some(ref_pin) = opts.ref_pin {
9391            query = query.arg("refPin", ref_pin);
9392        }
9393        if let Some(disable_find_up) = opts.disable_find_up {
9394            query = query.arg("disableFindUp", disable_find_up);
9395        }
9396        if let Some(allow_not_exists) = opts.allow_not_exists {
9397            query = query.arg("allowNotExists", allow_not_exists);
9398        }
9399        if let Some(require_kind) = opts.require_kind {
9400            query = query.arg("requireKind", require_kind);
9401        }
9402        ModuleSource {
9403            proc: self.proc.clone(),
9404            selection: query,
9405            graphql_client: self.graphql_client.clone(),
9406        }
9407    }
9408    /// Creates a new secret.
9409    ///
9410    /// # Arguments
9411    ///
9412    /// * `uri` - The URI of the secret store
9413    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9414    pub fn secret(&self, uri: impl Into<String>) -> Secret {
9415        let mut query = self.selection.select("secret");
9416        query = query.arg("uri", uri.into());
9417        Secret {
9418            proc: self.proc.clone(),
9419            selection: query,
9420            graphql_client: self.graphql_client.clone(),
9421        }
9422    }
9423    /// Creates a new secret.
9424    ///
9425    /// # Arguments
9426    ///
9427    /// * `uri` - The URI of the secret store
9428    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9429    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
9430        let mut query = self.selection.select("secret");
9431        query = query.arg("uri", uri.into());
9432        if let Some(cache_key) = opts.cache_key {
9433            query = query.arg("cacheKey", cache_key);
9434        }
9435        Secret {
9436            proc: self.proc.clone(),
9437            selection: query,
9438            graphql_client: self.graphql_client.clone(),
9439        }
9440    }
9441    /// Sets a secret given a user defined name to its plaintext and returns the secret.
9442    /// The plaintext value is limited to a size of 128000 bytes.
9443    ///
9444    /// # Arguments
9445    ///
9446    /// * `name` - The user defined name for this secret
9447    /// * `plaintext` - The plaintext of the secret
9448    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
9449        let mut query = self.selection.select("setSecret");
9450        query = query.arg("name", name.into());
9451        query = query.arg("plaintext", plaintext.into());
9452        Secret {
9453            proc: self.proc.clone(),
9454            selection: query,
9455            graphql_client: self.graphql_client.clone(),
9456        }
9457    }
9458    /// Creates source map metadata.
9459    ///
9460    /// # Arguments
9461    ///
9462    /// * `filename` - The filename from the module source.
9463    /// * `line` - The line number within the filename.
9464    /// * `column` - The column number within the line.
9465    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
9466        let mut query = self.selection.select("sourceMap");
9467        query = query.arg("filename", filename.into());
9468        query = query.arg("line", line);
9469        query = query.arg("column", column);
9470        SourceMap {
9471            proc: self.proc.clone(),
9472            selection: query,
9473            graphql_client: self.graphql_client.clone(),
9474        }
9475    }
9476    /// Create a new TypeDef.
9477    pub fn type_def(&self) -> TypeDef {
9478        let query = self.selection.select("typeDef");
9479        TypeDef {
9480            proc: self.proc.clone(),
9481            selection: query,
9482            graphql_client: self.graphql_client.clone(),
9483        }
9484    }
9485    /// Get the current Dagger Engine version.
9486    pub async fn version(&self) -> Result<String, DaggerError> {
9487        let query = self.selection.select("version");
9488        query.execute(self.graphql_client.clone()).await
9489    }
9490}
9491#[derive(Clone)]
9492pub struct SdkConfig {
9493    pub proc: Option<Arc<DaggerSessionProc>>,
9494    pub selection: Selection,
9495    pub graphql_client: DynGraphQLClient,
9496}
9497impl SdkConfig {
9498    /// A unique identifier for this SDKConfig.
9499    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
9500        let query = self.selection.select("id");
9501        query.execute(self.graphql_client.clone()).await
9502    }
9503    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
9504    pub async fn source(&self) -> Result<String, DaggerError> {
9505        let query = self.selection.select("source");
9506        query.execute(self.graphql_client.clone()).await
9507    }
9508}
9509#[derive(Clone)]
9510pub struct ScalarTypeDef {
9511    pub proc: Option<Arc<DaggerSessionProc>>,
9512    pub selection: Selection,
9513    pub graphql_client: DynGraphQLClient,
9514}
9515impl ScalarTypeDef {
9516    /// A doc string for the scalar, if any.
9517    pub async fn description(&self) -> Result<String, DaggerError> {
9518        let query = self.selection.select("description");
9519        query.execute(self.graphql_client.clone()).await
9520    }
9521    /// A unique identifier for this ScalarTypeDef.
9522    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
9523        let query = self.selection.select("id");
9524        query.execute(self.graphql_client.clone()).await
9525    }
9526    /// The name of the scalar.
9527    pub async fn name(&self) -> Result<String, DaggerError> {
9528        let query = self.selection.select("name");
9529        query.execute(self.graphql_client.clone()).await
9530    }
9531    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
9532    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9533        let query = self.selection.select("sourceModuleName");
9534        query.execute(self.graphql_client.clone()).await
9535    }
9536}
9537#[derive(Clone)]
9538pub struct Secret {
9539    pub proc: Option<Arc<DaggerSessionProc>>,
9540    pub selection: Selection,
9541    pub graphql_client: DynGraphQLClient,
9542}
9543impl Secret {
9544    /// A unique identifier for this Secret.
9545    pub async fn id(&self) -> Result<SecretId, DaggerError> {
9546        let query = self.selection.select("id");
9547        query.execute(self.graphql_client.clone()).await
9548    }
9549    /// The name of this secret.
9550    pub async fn name(&self) -> Result<String, DaggerError> {
9551        let query = self.selection.select("name");
9552        query.execute(self.graphql_client.clone()).await
9553    }
9554    /// The value of this secret.
9555    pub async fn plaintext(&self) -> Result<String, DaggerError> {
9556        let query = self.selection.select("plaintext");
9557        query.execute(self.graphql_client.clone()).await
9558    }
9559    /// The URI of this secret.
9560    pub async fn uri(&self) -> Result<String, DaggerError> {
9561        let query = self.selection.select("uri");
9562        query.execute(self.graphql_client.clone()).await
9563    }
9564}
9565#[derive(Clone)]
9566pub struct Service {
9567    pub proc: Option<Arc<DaggerSessionProc>>,
9568    pub selection: Selection,
9569    pub graphql_client: DynGraphQLClient,
9570}
9571#[derive(Builder, Debug, PartialEq)]
9572pub struct ServiceEndpointOpts<'a> {
9573    /// The exposed port number for the endpoint
9574    #[builder(setter(into, strip_option), default)]
9575    pub port: Option<isize>,
9576    /// Return a URL with the given scheme, eg. http for http://
9577    #[builder(setter(into, strip_option), default)]
9578    pub scheme: Option<&'a str>,
9579}
9580#[derive(Builder, Debug, PartialEq)]
9581pub struct ServiceStopOpts {
9582    /// Immediately kill the service without waiting for a graceful exit
9583    #[builder(setter(into, strip_option), default)]
9584    pub kill: Option<bool>,
9585}
9586#[derive(Builder, Debug, PartialEq)]
9587pub struct ServiceUpOpts {
9588    /// List of frontend/backend port mappings to forward.
9589    /// Frontend is the port accepting traffic on the host, backend is the service port.
9590    #[builder(setter(into, strip_option), default)]
9591    pub ports: Option<Vec<PortForward>>,
9592    /// Bind each tunnel port to a random port on the host.
9593    #[builder(setter(into, strip_option), default)]
9594    pub random: Option<bool>,
9595}
9596impl Service {
9597    /// Retrieves an endpoint that clients can use to reach this container.
9598    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
9599    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
9600    ///
9601    /// # Arguments
9602    ///
9603    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9604    pub async fn endpoint(&self) -> Result<String, DaggerError> {
9605        let query = self.selection.select("endpoint");
9606        query.execute(self.graphql_client.clone()).await
9607    }
9608    /// Retrieves an endpoint that clients can use to reach this container.
9609    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
9610    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
9611    ///
9612    /// # Arguments
9613    ///
9614    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9615    pub async fn endpoint_opts<'a>(
9616        &self,
9617        opts: ServiceEndpointOpts<'a>,
9618    ) -> Result<String, DaggerError> {
9619        let mut query = self.selection.select("endpoint");
9620        if let Some(port) = opts.port {
9621            query = query.arg("port", port);
9622        }
9623        if let Some(scheme) = opts.scheme {
9624            query = query.arg("scheme", scheme);
9625        }
9626        query.execute(self.graphql_client.clone()).await
9627    }
9628    /// Retrieves a hostname which can be used by clients to reach this container.
9629    pub async fn hostname(&self) -> Result<String, DaggerError> {
9630        let query = self.selection.select("hostname");
9631        query.execute(self.graphql_client.clone()).await
9632    }
9633    /// A unique identifier for this Service.
9634    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
9635        let query = self.selection.select("id");
9636        query.execute(self.graphql_client.clone()).await
9637    }
9638    /// Retrieves the list of ports provided by the service.
9639    pub fn ports(&self) -> Vec<Port> {
9640        let query = self.selection.select("ports");
9641        vec![Port {
9642            proc: self.proc.clone(),
9643            selection: query,
9644            graphql_client: self.graphql_client.clone(),
9645        }]
9646    }
9647    /// Start the service and wait for its health checks to succeed.
9648    /// Services bound to a Container do not need to be manually started.
9649    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
9650        let query = self.selection.select("start");
9651        query.execute(self.graphql_client.clone()).await
9652    }
9653    /// Stop the service.
9654    ///
9655    /// # Arguments
9656    ///
9657    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9658    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
9659        let query = self.selection.select("stop");
9660        query.execute(self.graphql_client.clone()).await
9661    }
9662    /// Stop the service.
9663    ///
9664    /// # Arguments
9665    ///
9666    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9667    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
9668        let mut query = self.selection.select("stop");
9669        if let Some(kill) = opts.kill {
9670            query = query.arg("kill", kill);
9671        }
9672        query.execute(self.graphql_client.clone()).await
9673    }
9674    /// Creates a tunnel that forwards traffic from the caller's network to this service.
9675    ///
9676    /// # Arguments
9677    ///
9678    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9679    pub async fn up(&self) -> Result<Void, DaggerError> {
9680        let query = self.selection.select("up");
9681        query.execute(self.graphql_client.clone()).await
9682    }
9683    /// Creates a tunnel that forwards traffic from the caller's network to this service.
9684    ///
9685    /// # Arguments
9686    ///
9687    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9688    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
9689        let mut query = self.selection.select("up");
9690        if let Some(ports) = opts.ports {
9691            query = query.arg("ports", ports);
9692        }
9693        if let Some(random) = opts.random {
9694            query = query.arg("random", random);
9695        }
9696        query.execute(self.graphql_client.clone()).await
9697    }
9698    /// Configures a hostname which can be used by clients within the session to reach this container.
9699    ///
9700    /// # Arguments
9701    ///
9702    /// * `hostname` - The hostname to use.
9703    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
9704        let mut query = self.selection.select("withHostname");
9705        query = query.arg("hostname", hostname.into());
9706        Service {
9707            proc: self.proc.clone(),
9708            selection: query,
9709            graphql_client: self.graphql_client.clone(),
9710        }
9711    }
9712}
9713#[derive(Clone)]
9714pub struct Socket {
9715    pub proc: Option<Arc<DaggerSessionProc>>,
9716    pub selection: Selection,
9717    pub graphql_client: DynGraphQLClient,
9718}
9719impl Socket {
9720    /// A unique identifier for this Socket.
9721    pub async fn id(&self) -> Result<SocketId, DaggerError> {
9722        let query = self.selection.select("id");
9723        query.execute(self.graphql_client.clone()).await
9724    }
9725}
9726#[derive(Clone)]
9727pub struct SourceMap {
9728    pub proc: Option<Arc<DaggerSessionProc>>,
9729    pub selection: Selection,
9730    pub graphql_client: DynGraphQLClient,
9731}
9732impl SourceMap {
9733    /// The column number within the line.
9734    pub async fn column(&self) -> Result<isize, DaggerError> {
9735        let query = self.selection.select("column");
9736        query.execute(self.graphql_client.clone()).await
9737    }
9738    /// The filename from the module source.
9739    pub async fn filename(&self) -> Result<String, DaggerError> {
9740        let query = self.selection.select("filename");
9741        query.execute(self.graphql_client.clone()).await
9742    }
9743    /// A unique identifier for this SourceMap.
9744    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
9745        let query = self.selection.select("id");
9746        query.execute(self.graphql_client.clone()).await
9747    }
9748    /// The line number within the filename.
9749    pub async fn line(&self) -> Result<isize, DaggerError> {
9750        let query = self.selection.select("line");
9751        query.execute(self.graphql_client.clone()).await
9752    }
9753    /// The module dependency this was declared in.
9754    pub async fn module(&self) -> Result<String, DaggerError> {
9755        let query = self.selection.select("module");
9756        query.execute(self.graphql_client.clone()).await
9757    }
9758}
9759#[derive(Clone)]
9760pub struct Terminal {
9761    pub proc: Option<Arc<DaggerSessionProc>>,
9762    pub selection: Selection,
9763    pub graphql_client: DynGraphQLClient,
9764}
9765impl Terminal {
9766    /// A unique identifier for this Terminal.
9767    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
9768        let query = self.selection.select("id");
9769        query.execute(self.graphql_client.clone()).await
9770    }
9771    /// Forces evaluation of the pipeline in the engine.
9772    /// It doesn't run the default command if no exec has been set.
9773    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
9774        let query = self.selection.select("sync");
9775        query.execute(self.graphql_client.clone()).await
9776    }
9777}
9778#[derive(Clone)]
9779pub struct TypeDef {
9780    pub proc: Option<Arc<DaggerSessionProc>>,
9781    pub selection: Selection,
9782    pub graphql_client: DynGraphQLClient,
9783}
9784#[derive(Builder, Debug, PartialEq)]
9785pub struct TypeDefWithEnumOpts<'a> {
9786    /// A doc string for the enum, if any
9787    #[builder(setter(into, strip_option), default)]
9788    pub description: Option<&'a str>,
9789    /// The source map for the enum definition.
9790    #[builder(setter(into, strip_option), default)]
9791    pub source_map: Option<SourceMapId>,
9792}
9793#[derive(Builder, Debug, PartialEq)]
9794pub struct TypeDefWithEnumValueOpts<'a> {
9795    /// A doc string for the value, if any
9796    #[builder(setter(into, strip_option), default)]
9797    pub description: Option<&'a str>,
9798    /// The source map for the enum value definition.
9799    #[builder(setter(into, strip_option), default)]
9800    pub source_map: Option<SourceMapId>,
9801}
9802#[derive(Builder, Debug, PartialEq)]
9803pub struct TypeDefWithFieldOpts<'a> {
9804    /// A doc string for the field, if any
9805    #[builder(setter(into, strip_option), default)]
9806    pub description: Option<&'a str>,
9807    /// The source map for the field definition.
9808    #[builder(setter(into, strip_option), default)]
9809    pub source_map: Option<SourceMapId>,
9810}
9811#[derive(Builder, Debug, PartialEq)]
9812pub struct TypeDefWithInterfaceOpts<'a> {
9813    #[builder(setter(into, strip_option), default)]
9814    pub description: Option<&'a str>,
9815    #[builder(setter(into, strip_option), default)]
9816    pub source_map: Option<SourceMapId>,
9817}
9818#[derive(Builder, Debug, PartialEq)]
9819pub struct TypeDefWithObjectOpts<'a> {
9820    #[builder(setter(into, strip_option), default)]
9821    pub description: Option<&'a str>,
9822    #[builder(setter(into, strip_option), default)]
9823    pub source_map: Option<SourceMapId>,
9824}
9825#[derive(Builder, Debug, PartialEq)]
9826pub struct TypeDefWithScalarOpts<'a> {
9827    #[builder(setter(into, strip_option), default)]
9828    pub description: Option<&'a str>,
9829}
9830impl TypeDef {
9831    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
9832    pub fn as_enum(&self) -> EnumTypeDef {
9833        let query = self.selection.select("asEnum");
9834        EnumTypeDef {
9835            proc: self.proc.clone(),
9836            selection: query,
9837            graphql_client: self.graphql_client.clone(),
9838        }
9839    }
9840    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
9841    pub fn as_input(&self) -> InputTypeDef {
9842        let query = self.selection.select("asInput");
9843        InputTypeDef {
9844            proc: self.proc.clone(),
9845            selection: query,
9846            graphql_client: self.graphql_client.clone(),
9847        }
9848    }
9849    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
9850    pub fn as_interface(&self) -> InterfaceTypeDef {
9851        let query = self.selection.select("asInterface");
9852        InterfaceTypeDef {
9853            proc: self.proc.clone(),
9854            selection: query,
9855            graphql_client: self.graphql_client.clone(),
9856        }
9857    }
9858    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
9859    pub fn as_list(&self) -> ListTypeDef {
9860        let query = self.selection.select("asList");
9861        ListTypeDef {
9862            proc: self.proc.clone(),
9863            selection: query,
9864            graphql_client: self.graphql_client.clone(),
9865        }
9866    }
9867    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
9868    pub fn as_object(&self) -> ObjectTypeDef {
9869        let query = self.selection.select("asObject");
9870        ObjectTypeDef {
9871            proc: self.proc.clone(),
9872            selection: query,
9873            graphql_client: self.graphql_client.clone(),
9874        }
9875    }
9876    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
9877    pub fn as_scalar(&self) -> ScalarTypeDef {
9878        let query = self.selection.select("asScalar");
9879        ScalarTypeDef {
9880            proc: self.proc.clone(),
9881            selection: query,
9882            graphql_client: self.graphql_client.clone(),
9883        }
9884    }
9885    /// A unique identifier for this TypeDef.
9886    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
9887        let query = self.selection.select("id");
9888        query.execute(self.graphql_client.clone()).await
9889    }
9890    /// The kind of type this is (e.g. primitive, list, object).
9891    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
9892        let query = self.selection.select("kind");
9893        query.execute(self.graphql_client.clone()).await
9894    }
9895    /// Whether this type can be set to null. Defaults to false.
9896    pub async fn optional(&self) -> Result<bool, DaggerError> {
9897        let query = self.selection.select("optional");
9898        query.execute(self.graphql_client.clone()).await
9899    }
9900    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
9901    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
9902        let mut query = self.selection.select("withConstructor");
9903        query = query.arg_lazy(
9904            "function",
9905            Box::new(move || {
9906                let function = function.clone();
9907                Box::pin(async move { function.into_id().await.unwrap().quote() })
9908            }),
9909        );
9910        TypeDef {
9911            proc: self.proc.clone(),
9912            selection: query,
9913            graphql_client: self.graphql_client.clone(),
9914        }
9915    }
9916    /// Returns a TypeDef of kind Enum with the provided name.
9917    /// 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.
9918    ///
9919    /// # Arguments
9920    ///
9921    /// * `name` - The name of the enum
9922    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9923    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
9924        let mut query = self.selection.select("withEnum");
9925        query = query.arg("name", name.into());
9926        TypeDef {
9927            proc: self.proc.clone(),
9928            selection: query,
9929            graphql_client: self.graphql_client.clone(),
9930        }
9931    }
9932    /// Returns a TypeDef of kind Enum with the provided name.
9933    /// 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.
9934    ///
9935    /// # Arguments
9936    ///
9937    /// * `name` - The name of the enum
9938    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9939    pub fn with_enum_opts<'a>(
9940        &self,
9941        name: impl Into<String>,
9942        opts: TypeDefWithEnumOpts<'a>,
9943    ) -> TypeDef {
9944        let mut query = self.selection.select("withEnum");
9945        query = query.arg("name", name.into());
9946        if let Some(description) = opts.description {
9947            query = query.arg("description", description);
9948        }
9949        if let Some(source_map) = opts.source_map {
9950            query = query.arg("sourceMap", source_map);
9951        }
9952        TypeDef {
9953            proc: self.proc.clone(),
9954            selection: query,
9955            graphql_client: self.graphql_client.clone(),
9956        }
9957    }
9958    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
9959    ///
9960    /// # Arguments
9961    ///
9962    /// * `value` - The name of the value in the enum
9963    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9964    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
9965        let mut query = self.selection.select("withEnumValue");
9966        query = query.arg("value", value.into());
9967        TypeDef {
9968            proc: self.proc.clone(),
9969            selection: query,
9970            graphql_client: self.graphql_client.clone(),
9971        }
9972    }
9973    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
9974    ///
9975    /// # Arguments
9976    ///
9977    /// * `value` - The name of the value in the enum
9978    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9979    pub fn with_enum_value_opts<'a>(
9980        &self,
9981        value: impl Into<String>,
9982        opts: TypeDefWithEnumValueOpts<'a>,
9983    ) -> TypeDef {
9984        let mut query = self.selection.select("withEnumValue");
9985        query = query.arg("value", value.into());
9986        if let Some(description) = opts.description {
9987            query = query.arg("description", description);
9988        }
9989        if let Some(source_map) = opts.source_map {
9990            query = query.arg("sourceMap", source_map);
9991        }
9992        TypeDef {
9993            proc: self.proc.clone(),
9994            selection: query,
9995            graphql_client: self.graphql_client.clone(),
9996        }
9997    }
9998    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
9999    ///
10000    /// # Arguments
10001    ///
10002    /// * `name` - The name of the field in the object
10003    /// * `type_def` - The type of the field
10004    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10005    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
10006        let mut query = self.selection.select("withField");
10007        query = query.arg("name", name.into());
10008        query = query.arg_lazy(
10009            "typeDef",
10010            Box::new(move || {
10011                let type_def = type_def.clone();
10012                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
10013            }),
10014        );
10015        TypeDef {
10016            proc: self.proc.clone(),
10017            selection: query,
10018            graphql_client: self.graphql_client.clone(),
10019        }
10020    }
10021    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
10022    ///
10023    /// # Arguments
10024    ///
10025    /// * `name` - The name of the field in the object
10026    /// * `type_def` - The type of the field
10027    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10028    pub fn with_field_opts<'a>(
10029        &self,
10030        name: impl Into<String>,
10031        type_def: impl IntoID<TypeDefId>,
10032        opts: TypeDefWithFieldOpts<'a>,
10033    ) -> TypeDef {
10034        let mut query = self.selection.select("withField");
10035        query = query.arg("name", name.into());
10036        query = query.arg_lazy(
10037            "typeDef",
10038            Box::new(move || {
10039                let type_def = type_def.clone();
10040                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
10041            }),
10042        );
10043        if let Some(description) = opts.description {
10044            query = query.arg("description", description);
10045        }
10046        if let Some(source_map) = opts.source_map {
10047            query = query.arg("sourceMap", source_map);
10048        }
10049        TypeDef {
10050            proc: self.proc.clone(),
10051            selection: query,
10052            graphql_client: self.graphql_client.clone(),
10053        }
10054    }
10055    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
10056    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
10057        let mut query = self.selection.select("withFunction");
10058        query = query.arg_lazy(
10059            "function",
10060            Box::new(move || {
10061                let function = function.clone();
10062                Box::pin(async move { function.into_id().await.unwrap().quote() })
10063            }),
10064        );
10065        TypeDef {
10066            proc: self.proc.clone(),
10067            selection: query,
10068            graphql_client: self.graphql_client.clone(),
10069        }
10070    }
10071    /// Returns a TypeDef of kind Interface with the provided name.
10072    ///
10073    /// # Arguments
10074    ///
10075    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10076    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
10077        let mut query = self.selection.select("withInterface");
10078        query = query.arg("name", name.into());
10079        TypeDef {
10080            proc: self.proc.clone(),
10081            selection: query,
10082            graphql_client: self.graphql_client.clone(),
10083        }
10084    }
10085    /// Returns a TypeDef of kind Interface with the provided name.
10086    ///
10087    /// # Arguments
10088    ///
10089    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10090    pub fn with_interface_opts<'a>(
10091        &self,
10092        name: impl Into<String>,
10093        opts: TypeDefWithInterfaceOpts<'a>,
10094    ) -> TypeDef {
10095        let mut query = self.selection.select("withInterface");
10096        query = query.arg("name", name.into());
10097        if let Some(description) = opts.description {
10098            query = query.arg("description", description);
10099        }
10100        if let Some(source_map) = opts.source_map {
10101            query = query.arg("sourceMap", source_map);
10102        }
10103        TypeDef {
10104            proc: self.proc.clone(),
10105            selection: query,
10106            graphql_client: self.graphql_client.clone(),
10107        }
10108    }
10109    /// Sets the kind of the type.
10110    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
10111        let mut query = self.selection.select("withKind");
10112        query = query.arg("kind", kind);
10113        TypeDef {
10114            proc: self.proc.clone(),
10115            selection: query,
10116            graphql_client: self.graphql_client.clone(),
10117        }
10118    }
10119    /// Returns a TypeDef of kind List with the provided type for its elements.
10120    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
10121        let mut query = self.selection.select("withListOf");
10122        query = query.arg_lazy(
10123            "elementType",
10124            Box::new(move || {
10125                let element_type = element_type.clone();
10126                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
10127            }),
10128        );
10129        TypeDef {
10130            proc: self.proc.clone(),
10131            selection: query,
10132            graphql_client: self.graphql_client.clone(),
10133        }
10134    }
10135    /// Returns a TypeDef of kind Object with the provided name.
10136    /// 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.
10137    ///
10138    /// # Arguments
10139    ///
10140    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10141    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
10142        let mut query = self.selection.select("withObject");
10143        query = query.arg("name", name.into());
10144        TypeDef {
10145            proc: self.proc.clone(),
10146            selection: query,
10147            graphql_client: self.graphql_client.clone(),
10148        }
10149    }
10150    /// Returns a TypeDef of kind Object with the provided name.
10151    /// 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.
10152    ///
10153    /// # Arguments
10154    ///
10155    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10156    pub fn with_object_opts<'a>(
10157        &self,
10158        name: impl Into<String>,
10159        opts: TypeDefWithObjectOpts<'a>,
10160    ) -> TypeDef {
10161        let mut query = self.selection.select("withObject");
10162        query = query.arg("name", name.into());
10163        if let Some(description) = opts.description {
10164            query = query.arg("description", description);
10165        }
10166        if let Some(source_map) = opts.source_map {
10167            query = query.arg("sourceMap", source_map);
10168        }
10169        TypeDef {
10170            proc: self.proc.clone(),
10171            selection: query,
10172            graphql_client: self.graphql_client.clone(),
10173        }
10174    }
10175    /// Sets whether this type can be set to null.
10176    pub fn with_optional(&self, optional: bool) -> TypeDef {
10177        let mut query = self.selection.select("withOptional");
10178        query = query.arg("optional", optional);
10179        TypeDef {
10180            proc: self.proc.clone(),
10181            selection: query,
10182            graphql_client: self.graphql_client.clone(),
10183        }
10184    }
10185    /// Returns a TypeDef of kind Scalar with the provided name.
10186    ///
10187    /// # Arguments
10188    ///
10189    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10190    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
10191        let mut query = self.selection.select("withScalar");
10192        query = query.arg("name", name.into());
10193        TypeDef {
10194            proc: self.proc.clone(),
10195            selection: query,
10196            graphql_client: self.graphql_client.clone(),
10197        }
10198    }
10199    /// Returns a TypeDef of kind Scalar with the provided name.
10200    ///
10201    /// # Arguments
10202    ///
10203    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10204    pub fn with_scalar_opts<'a>(
10205        &self,
10206        name: impl Into<String>,
10207        opts: TypeDefWithScalarOpts<'a>,
10208    ) -> TypeDef {
10209        let mut query = self.selection.select("withScalar");
10210        query = query.arg("name", name.into());
10211        if let Some(description) = opts.description {
10212            query = query.arg("description", description);
10213        }
10214        TypeDef {
10215            proc: self.proc.clone(),
10216            selection: query,
10217            graphql_client: self.graphql_client.clone(),
10218        }
10219    }
10220}
10221#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10222pub enum CacheSharingMode {
10223    #[serde(rename = "LOCKED")]
10224    Locked,
10225    #[serde(rename = "PRIVATE")]
10226    Private,
10227    #[serde(rename = "SHARED")]
10228    Shared,
10229}
10230#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10231pub enum ImageLayerCompression {
10232    #[serde(rename = "EStarGZ")]
10233    EStarGz,
10234    #[serde(rename = "Gzip")]
10235    Gzip,
10236    #[serde(rename = "Uncompressed")]
10237    Uncompressed,
10238    #[serde(rename = "Zstd")]
10239    Zstd,
10240}
10241#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10242pub enum ImageMediaTypes {
10243    #[serde(rename = "DockerMediaTypes")]
10244    DockerMediaTypes,
10245    #[serde(rename = "OCIMediaTypes")]
10246    OciMediaTypes,
10247}
10248#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10249pub enum ModuleSourceKind {
10250    #[serde(rename = "DIR_SOURCE")]
10251    DirSource,
10252    #[serde(rename = "GIT_SOURCE")]
10253    GitSource,
10254    #[serde(rename = "LOCAL_SOURCE")]
10255    LocalSource,
10256}
10257#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10258pub enum NetworkProtocol {
10259    #[serde(rename = "TCP")]
10260    Tcp,
10261    #[serde(rename = "UDP")]
10262    Udp,
10263}
10264#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10265pub enum ReturnType {
10266    #[serde(rename = "ANY")]
10267    Any,
10268    #[serde(rename = "FAILURE")]
10269    Failure,
10270    #[serde(rename = "SUCCESS")]
10271    Success,
10272}
10273#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
10274pub enum TypeDefKind {
10275    #[serde(rename = "BOOLEAN_KIND")]
10276    BooleanKind,
10277    #[serde(rename = "ENUM_KIND")]
10278    EnumKind,
10279    #[serde(rename = "FLOAT_KIND")]
10280    FloatKind,
10281    #[serde(rename = "INPUT_KIND")]
10282    InputKind,
10283    #[serde(rename = "INTEGER_KIND")]
10284    IntegerKind,
10285    #[serde(rename = "INTERFACE_KIND")]
10286    InterfaceKind,
10287    #[serde(rename = "LIST_KIND")]
10288    ListKind,
10289    #[serde(rename = "OBJECT_KIND")]
10290    ObjectKind,
10291    #[serde(rename = "SCALAR_KIND")]
10292    ScalarKind,
10293    #[serde(rename = "STRING_KIND")]
10294    StringKind,
10295    #[serde(rename = "VOID_KIND")]
10296    VoidKind,
10297}