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 ChangesetId(pub String);
82impl From<&str> for ChangesetId {
83    fn from(value: &str) -> Self {
84        Self(value.to_string())
85    }
86}
87impl From<String> for ChangesetId {
88    fn from(value: String) -> Self {
89        Self(value)
90    }
91}
92impl IntoID<ChangesetId> for Changeset {
93    fn into_id(
94        self,
95    ) -> std::pin::Pin<
96        Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
97    > {
98        Box::pin(async move { self.id().await })
99    }
100}
101impl IntoID<ChangesetId> for ChangesetId {
102    fn into_id(
103        self,
104    ) -> std::pin::Pin<
105        Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
106    > {
107        Box::pin(async move { Ok::<ChangesetId, DaggerError>(self) })
108    }
109}
110impl ChangesetId {
111    fn quote(&self) -> String {
112        format!("\"{}\"", self.0.clone())
113    }
114}
115#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
116pub struct CloudId(pub String);
117impl From<&str> for CloudId {
118    fn from(value: &str) -> Self {
119        Self(value.to_string())
120    }
121}
122impl From<String> for CloudId {
123    fn from(value: String) -> Self {
124        Self(value)
125    }
126}
127impl IntoID<CloudId> for Cloud {
128    fn into_id(
129        self,
130    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
131    {
132        Box::pin(async move { self.id().await })
133    }
134}
135impl IntoID<CloudId> for CloudId {
136    fn into_id(
137        self,
138    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
139    {
140        Box::pin(async move { Ok::<CloudId, DaggerError>(self) })
141    }
142}
143impl CloudId {
144    fn quote(&self) -> String {
145        format!("\"{}\"", self.0.clone())
146    }
147}
148#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
149pub struct ContainerId(pub String);
150impl From<&str> for ContainerId {
151    fn from(value: &str) -> Self {
152        Self(value.to_string())
153    }
154}
155impl From<String> for ContainerId {
156    fn from(value: String) -> Self {
157        Self(value)
158    }
159}
160impl IntoID<ContainerId> for Container {
161    fn into_id(
162        self,
163    ) -> std::pin::Pin<
164        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
165    > {
166        Box::pin(async move { self.id().await })
167    }
168}
169impl IntoID<ContainerId> for ContainerId {
170    fn into_id(
171        self,
172    ) -> std::pin::Pin<
173        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
174    > {
175        Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
176    }
177}
178impl ContainerId {
179    fn quote(&self) -> String {
180        format!("\"{}\"", self.0.clone())
181    }
182}
183#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
184pub struct CurrentModuleId(pub String);
185impl From<&str> for CurrentModuleId {
186    fn from(value: &str) -> Self {
187        Self(value.to_string())
188    }
189}
190impl From<String> for CurrentModuleId {
191    fn from(value: String) -> Self {
192        Self(value)
193    }
194}
195impl IntoID<CurrentModuleId> for CurrentModule {
196    fn into_id(
197        self,
198    ) -> std::pin::Pin<
199        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
200    > {
201        Box::pin(async move { self.id().await })
202    }
203}
204impl IntoID<CurrentModuleId> for CurrentModuleId {
205    fn into_id(
206        self,
207    ) -> std::pin::Pin<
208        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
209    > {
210        Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
211    }
212}
213impl CurrentModuleId {
214    fn quote(&self) -> String {
215        format!("\"{}\"", self.0.clone())
216    }
217}
218#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
219pub struct DirectoryId(pub String);
220impl From<&str> for DirectoryId {
221    fn from(value: &str) -> Self {
222        Self(value.to_string())
223    }
224}
225impl From<String> for DirectoryId {
226    fn from(value: String) -> Self {
227        Self(value)
228    }
229}
230impl IntoID<DirectoryId> for Directory {
231    fn into_id(
232        self,
233    ) -> std::pin::Pin<
234        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
235    > {
236        Box::pin(async move { self.id().await })
237    }
238}
239impl IntoID<DirectoryId> for DirectoryId {
240    fn into_id(
241        self,
242    ) -> std::pin::Pin<
243        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
244    > {
245        Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
246    }
247}
248impl DirectoryId {
249    fn quote(&self) -> String {
250        format!("\"{}\"", self.0.clone())
251    }
252}
253#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
254pub struct EngineCacheEntryId(pub String);
255impl From<&str> for EngineCacheEntryId {
256    fn from(value: &str) -> Self {
257        Self(value.to_string())
258    }
259}
260impl From<String> for EngineCacheEntryId {
261    fn from(value: String) -> Self {
262        Self(value)
263    }
264}
265impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
266    fn into_id(
267        self,
268    ) -> std::pin::Pin<
269        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
270    > {
271        Box::pin(async move { self.id().await })
272    }
273}
274impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
275    fn into_id(
276        self,
277    ) -> std::pin::Pin<
278        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
279    > {
280        Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
281    }
282}
283impl EngineCacheEntryId {
284    fn quote(&self) -> String {
285        format!("\"{}\"", self.0.clone())
286    }
287}
288#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
289pub struct EngineCacheEntrySetId(pub String);
290impl From<&str> for EngineCacheEntrySetId {
291    fn from(value: &str) -> Self {
292        Self(value.to_string())
293    }
294}
295impl From<String> for EngineCacheEntrySetId {
296    fn from(value: String) -> Self {
297        Self(value)
298    }
299}
300impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
301    fn into_id(
302        self,
303    ) -> std::pin::Pin<
304        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
305    > {
306        Box::pin(async move { self.id().await })
307    }
308}
309impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
310    fn into_id(
311        self,
312    ) -> std::pin::Pin<
313        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
314    > {
315        Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
316    }
317}
318impl EngineCacheEntrySetId {
319    fn quote(&self) -> String {
320        format!("\"{}\"", self.0.clone())
321    }
322}
323#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
324pub struct EngineCacheId(pub String);
325impl From<&str> for EngineCacheId {
326    fn from(value: &str) -> Self {
327        Self(value.to_string())
328    }
329}
330impl From<String> for EngineCacheId {
331    fn from(value: String) -> Self {
332        Self(value)
333    }
334}
335impl IntoID<EngineCacheId> for EngineCache {
336    fn into_id(
337        self,
338    ) -> std::pin::Pin<
339        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
340    > {
341        Box::pin(async move { self.id().await })
342    }
343}
344impl IntoID<EngineCacheId> for EngineCacheId {
345    fn into_id(
346        self,
347    ) -> std::pin::Pin<
348        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
349    > {
350        Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
351    }
352}
353impl EngineCacheId {
354    fn quote(&self) -> String {
355        format!("\"{}\"", self.0.clone())
356    }
357}
358#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
359pub struct EngineId(pub String);
360impl From<&str> for EngineId {
361    fn from(value: &str) -> Self {
362        Self(value.to_string())
363    }
364}
365impl From<String> for EngineId {
366    fn from(value: String) -> Self {
367        Self(value)
368    }
369}
370impl IntoID<EngineId> for Engine {
371    fn into_id(
372        self,
373    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
374    {
375        Box::pin(async move { self.id().await })
376    }
377}
378impl IntoID<EngineId> for EngineId {
379    fn into_id(
380        self,
381    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
382    {
383        Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
384    }
385}
386impl EngineId {
387    fn quote(&self) -> String {
388        format!("\"{}\"", self.0.clone())
389    }
390}
391#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
392pub struct EnumTypeDefId(pub String);
393impl From<&str> for EnumTypeDefId {
394    fn from(value: &str) -> Self {
395        Self(value.to_string())
396    }
397}
398impl From<String> for EnumTypeDefId {
399    fn from(value: String) -> Self {
400        Self(value)
401    }
402}
403impl IntoID<EnumTypeDefId> for EnumTypeDef {
404    fn into_id(
405        self,
406    ) -> std::pin::Pin<
407        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
408    > {
409        Box::pin(async move { self.id().await })
410    }
411}
412impl IntoID<EnumTypeDefId> for EnumTypeDefId {
413    fn into_id(
414        self,
415    ) -> std::pin::Pin<
416        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
417    > {
418        Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
419    }
420}
421impl EnumTypeDefId {
422    fn quote(&self) -> String {
423        format!("\"{}\"", self.0.clone())
424    }
425}
426#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
427pub struct EnumValueTypeDefId(pub String);
428impl From<&str> for EnumValueTypeDefId {
429    fn from(value: &str) -> Self {
430        Self(value.to_string())
431    }
432}
433impl From<String> for EnumValueTypeDefId {
434    fn from(value: String) -> Self {
435        Self(value)
436    }
437}
438impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
439    fn into_id(
440        self,
441    ) -> std::pin::Pin<
442        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
443    > {
444        Box::pin(async move { self.id().await })
445    }
446}
447impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
448    fn into_id(
449        self,
450    ) -> std::pin::Pin<
451        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
452    > {
453        Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
454    }
455}
456impl EnumValueTypeDefId {
457    fn quote(&self) -> String {
458        format!("\"{}\"", self.0.clone())
459    }
460}
461#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
462pub struct EnvFileId(pub String);
463impl From<&str> for EnvFileId {
464    fn from(value: &str) -> Self {
465        Self(value.to_string())
466    }
467}
468impl From<String> for EnvFileId {
469    fn from(value: String) -> Self {
470        Self(value)
471    }
472}
473impl IntoID<EnvFileId> for EnvFile {
474    fn into_id(
475        self,
476    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
477    {
478        Box::pin(async move { self.id().await })
479    }
480}
481impl IntoID<EnvFileId> for EnvFileId {
482    fn into_id(
483        self,
484    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
485    {
486        Box::pin(async move { Ok::<EnvFileId, DaggerError>(self) })
487    }
488}
489impl EnvFileId {
490    fn quote(&self) -> String {
491        format!("\"{}\"", self.0.clone())
492    }
493}
494#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
495pub struct EnvId(pub String);
496impl From<&str> for EnvId {
497    fn from(value: &str) -> Self {
498        Self(value.to_string())
499    }
500}
501impl From<String> for EnvId {
502    fn from(value: String) -> Self {
503        Self(value)
504    }
505}
506impl IntoID<EnvId> for Env {
507    fn into_id(
508        self,
509    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
510    {
511        Box::pin(async move { self.id().await })
512    }
513}
514impl IntoID<EnvId> for EnvId {
515    fn into_id(
516        self,
517    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
518    {
519        Box::pin(async move { Ok::<EnvId, DaggerError>(self) })
520    }
521}
522impl EnvId {
523    fn quote(&self) -> String {
524        format!("\"{}\"", self.0.clone())
525    }
526}
527#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
528pub struct EnvVariableId(pub String);
529impl From<&str> for EnvVariableId {
530    fn from(value: &str) -> Self {
531        Self(value.to_string())
532    }
533}
534impl From<String> for EnvVariableId {
535    fn from(value: String) -> Self {
536        Self(value)
537    }
538}
539impl IntoID<EnvVariableId> for EnvVariable {
540    fn into_id(
541        self,
542    ) -> std::pin::Pin<
543        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
544    > {
545        Box::pin(async move { self.id().await })
546    }
547}
548impl IntoID<EnvVariableId> for EnvVariableId {
549    fn into_id(
550        self,
551    ) -> std::pin::Pin<
552        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
553    > {
554        Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
555    }
556}
557impl EnvVariableId {
558    fn quote(&self) -> String {
559        format!("\"{}\"", self.0.clone())
560    }
561}
562#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
563pub struct ErrorId(pub String);
564impl From<&str> for ErrorId {
565    fn from(value: &str) -> Self {
566        Self(value.to_string())
567    }
568}
569impl From<String> for ErrorId {
570    fn from(value: String) -> Self {
571        Self(value)
572    }
573}
574impl IntoID<ErrorId> for Error {
575    fn into_id(
576        self,
577    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
578    {
579        Box::pin(async move { self.id().await })
580    }
581}
582impl IntoID<ErrorId> for ErrorId {
583    fn into_id(
584        self,
585    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
586    {
587        Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
588    }
589}
590impl ErrorId {
591    fn quote(&self) -> String {
592        format!("\"{}\"", self.0.clone())
593    }
594}
595#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
596pub struct ErrorValueId(pub String);
597impl From<&str> for ErrorValueId {
598    fn from(value: &str) -> Self {
599        Self(value.to_string())
600    }
601}
602impl From<String> for ErrorValueId {
603    fn from(value: String) -> Self {
604        Self(value)
605    }
606}
607impl IntoID<ErrorValueId> for ErrorValue {
608    fn into_id(
609        self,
610    ) -> std::pin::Pin<
611        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
612    > {
613        Box::pin(async move { self.id().await })
614    }
615}
616impl IntoID<ErrorValueId> for ErrorValueId {
617    fn into_id(
618        self,
619    ) -> std::pin::Pin<
620        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
621    > {
622        Box::pin(async move { Ok::<ErrorValueId, DaggerError>(self) })
623    }
624}
625impl ErrorValueId {
626    fn quote(&self) -> String {
627        format!("\"{}\"", self.0.clone())
628    }
629}
630#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
631pub struct FieldTypeDefId(pub String);
632impl From<&str> for FieldTypeDefId {
633    fn from(value: &str) -> Self {
634        Self(value.to_string())
635    }
636}
637impl From<String> for FieldTypeDefId {
638    fn from(value: String) -> Self {
639        Self(value)
640    }
641}
642impl IntoID<FieldTypeDefId> for FieldTypeDef {
643    fn into_id(
644        self,
645    ) -> std::pin::Pin<
646        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
647    > {
648        Box::pin(async move { self.id().await })
649    }
650}
651impl IntoID<FieldTypeDefId> for FieldTypeDefId {
652    fn into_id(
653        self,
654    ) -> std::pin::Pin<
655        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
656    > {
657        Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
658    }
659}
660impl FieldTypeDefId {
661    fn quote(&self) -> String {
662        format!("\"{}\"", self.0.clone())
663    }
664}
665#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
666pub struct FileId(pub String);
667impl From<&str> for FileId {
668    fn from(value: &str) -> Self {
669        Self(value.to_string())
670    }
671}
672impl From<String> for FileId {
673    fn from(value: String) -> Self {
674        Self(value)
675    }
676}
677impl IntoID<FileId> for File {
678    fn into_id(
679        self,
680    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
681    {
682        Box::pin(async move { self.id().await })
683    }
684}
685impl IntoID<FileId> for FileId {
686    fn into_id(
687        self,
688    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
689    {
690        Box::pin(async move { Ok::<FileId, DaggerError>(self) })
691    }
692}
693impl FileId {
694    fn quote(&self) -> String {
695        format!("\"{}\"", self.0.clone())
696    }
697}
698#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
699pub struct FunctionArgId(pub String);
700impl From<&str> for FunctionArgId {
701    fn from(value: &str) -> Self {
702        Self(value.to_string())
703    }
704}
705impl From<String> for FunctionArgId {
706    fn from(value: String) -> Self {
707        Self(value)
708    }
709}
710impl IntoID<FunctionArgId> for FunctionArg {
711    fn into_id(
712        self,
713    ) -> std::pin::Pin<
714        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
715    > {
716        Box::pin(async move { self.id().await })
717    }
718}
719impl IntoID<FunctionArgId> for FunctionArgId {
720    fn into_id(
721        self,
722    ) -> std::pin::Pin<
723        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
724    > {
725        Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
726    }
727}
728impl FunctionArgId {
729    fn quote(&self) -> String {
730        format!("\"{}\"", self.0.clone())
731    }
732}
733#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
734pub struct FunctionCallArgValueId(pub String);
735impl From<&str> for FunctionCallArgValueId {
736    fn from(value: &str) -> Self {
737        Self(value.to_string())
738    }
739}
740impl From<String> for FunctionCallArgValueId {
741    fn from(value: String) -> Self {
742        Self(value)
743    }
744}
745impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
746    fn into_id(
747        self,
748    ) -> std::pin::Pin<
749        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
750    > {
751        Box::pin(async move { self.id().await })
752    }
753}
754impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
755    fn into_id(
756        self,
757    ) -> std::pin::Pin<
758        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
759    > {
760        Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
761    }
762}
763impl FunctionCallArgValueId {
764    fn quote(&self) -> String {
765        format!("\"{}\"", self.0.clone())
766    }
767}
768#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
769pub struct FunctionCallId(pub String);
770impl From<&str> for FunctionCallId {
771    fn from(value: &str) -> Self {
772        Self(value.to_string())
773    }
774}
775impl From<String> for FunctionCallId {
776    fn from(value: String) -> Self {
777        Self(value)
778    }
779}
780impl IntoID<FunctionCallId> for FunctionCall {
781    fn into_id(
782        self,
783    ) -> std::pin::Pin<
784        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
785    > {
786        Box::pin(async move { self.id().await })
787    }
788}
789impl IntoID<FunctionCallId> for FunctionCallId {
790    fn into_id(
791        self,
792    ) -> std::pin::Pin<
793        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
794    > {
795        Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
796    }
797}
798impl FunctionCallId {
799    fn quote(&self) -> String {
800        format!("\"{}\"", self.0.clone())
801    }
802}
803#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
804pub struct FunctionId(pub String);
805impl From<&str> for FunctionId {
806    fn from(value: &str) -> Self {
807        Self(value.to_string())
808    }
809}
810impl From<String> for FunctionId {
811    fn from(value: String) -> Self {
812        Self(value)
813    }
814}
815impl IntoID<FunctionId> for Function {
816    fn into_id(
817        self,
818    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
819    {
820        Box::pin(async move { self.id().await })
821    }
822}
823impl IntoID<FunctionId> for FunctionId {
824    fn into_id(
825        self,
826    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
827    {
828        Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
829    }
830}
831impl FunctionId {
832    fn quote(&self) -> String {
833        format!("\"{}\"", self.0.clone())
834    }
835}
836#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
837pub struct GeneratedCodeId(pub String);
838impl From<&str> for GeneratedCodeId {
839    fn from(value: &str) -> Self {
840        Self(value.to_string())
841    }
842}
843impl From<String> for GeneratedCodeId {
844    fn from(value: String) -> Self {
845        Self(value)
846    }
847}
848impl IntoID<GeneratedCodeId> for GeneratedCode {
849    fn into_id(
850        self,
851    ) -> std::pin::Pin<
852        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
853    > {
854        Box::pin(async move { self.id().await })
855    }
856}
857impl IntoID<GeneratedCodeId> for GeneratedCodeId {
858    fn into_id(
859        self,
860    ) -> std::pin::Pin<
861        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
862    > {
863        Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
864    }
865}
866impl GeneratedCodeId {
867    fn quote(&self) -> String {
868        format!("\"{}\"", self.0.clone())
869    }
870}
871#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
872pub struct GitRefId(pub String);
873impl From<&str> for GitRefId {
874    fn from(value: &str) -> Self {
875        Self(value.to_string())
876    }
877}
878impl From<String> for GitRefId {
879    fn from(value: String) -> Self {
880        Self(value)
881    }
882}
883impl IntoID<GitRefId> for GitRef {
884    fn into_id(
885        self,
886    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
887    {
888        Box::pin(async move { self.id().await })
889    }
890}
891impl IntoID<GitRefId> for GitRefId {
892    fn into_id(
893        self,
894    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
895    {
896        Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
897    }
898}
899impl GitRefId {
900    fn quote(&self) -> String {
901        format!("\"{}\"", self.0.clone())
902    }
903}
904#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
905pub struct GitRepositoryId(pub String);
906impl From<&str> for GitRepositoryId {
907    fn from(value: &str) -> Self {
908        Self(value.to_string())
909    }
910}
911impl From<String> for GitRepositoryId {
912    fn from(value: String) -> Self {
913        Self(value)
914    }
915}
916impl IntoID<GitRepositoryId> for GitRepository {
917    fn into_id(
918        self,
919    ) -> std::pin::Pin<
920        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
921    > {
922        Box::pin(async move { self.id().await })
923    }
924}
925impl IntoID<GitRepositoryId> for GitRepositoryId {
926    fn into_id(
927        self,
928    ) -> std::pin::Pin<
929        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
930    > {
931        Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
932    }
933}
934impl GitRepositoryId {
935    fn quote(&self) -> String {
936        format!("\"{}\"", self.0.clone())
937    }
938}
939#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
940pub struct HostId(pub String);
941impl From<&str> for HostId {
942    fn from(value: &str) -> Self {
943        Self(value.to_string())
944    }
945}
946impl From<String> for HostId {
947    fn from(value: String) -> Self {
948        Self(value)
949    }
950}
951impl IntoID<HostId> for Host {
952    fn into_id(
953        self,
954    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
955    {
956        Box::pin(async move { self.id().await })
957    }
958}
959impl IntoID<HostId> for HostId {
960    fn into_id(
961        self,
962    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
963    {
964        Box::pin(async move { Ok::<HostId, DaggerError>(self) })
965    }
966}
967impl HostId {
968    fn quote(&self) -> String {
969        format!("\"{}\"", self.0.clone())
970    }
971}
972#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
973pub struct InputTypeDefId(pub String);
974impl From<&str> for InputTypeDefId {
975    fn from(value: &str) -> Self {
976        Self(value.to_string())
977    }
978}
979impl From<String> for InputTypeDefId {
980    fn from(value: String) -> Self {
981        Self(value)
982    }
983}
984impl IntoID<InputTypeDefId> for InputTypeDef {
985    fn into_id(
986        self,
987    ) -> std::pin::Pin<
988        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
989    > {
990        Box::pin(async move { self.id().await })
991    }
992}
993impl IntoID<InputTypeDefId> for InputTypeDefId {
994    fn into_id(
995        self,
996    ) -> std::pin::Pin<
997        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
998    > {
999        Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
1000    }
1001}
1002impl InputTypeDefId {
1003    fn quote(&self) -> String {
1004        format!("\"{}\"", self.0.clone())
1005    }
1006}
1007#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1008pub struct InterfaceTypeDefId(pub String);
1009impl From<&str> for InterfaceTypeDefId {
1010    fn from(value: &str) -> Self {
1011        Self(value.to_string())
1012    }
1013}
1014impl From<String> for InterfaceTypeDefId {
1015    fn from(value: String) -> Self {
1016        Self(value)
1017    }
1018}
1019impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
1020    fn into_id(
1021        self,
1022    ) -> std::pin::Pin<
1023        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1024    > {
1025        Box::pin(async move { self.id().await })
1026    }
1027}
1028impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
1029    fn into_id(
1030        self,
1031    ) -> std::pin::Pin<
1032        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1033    > {
1034        Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
1035    }
1036}
1037impl InterfaceTypeDefId {
1038    fn quote(&self) -> String {
1039        format!("\"{}\"", self.0.clone())
1040    }
1041}
1042#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1043pub struct Json(pub String);
1044impl From<&str> for Json {
1045    fn from(value: &str) -> Self {
1046        Self(value.to_string())
1047    }
1048}
1049impl From<String> for Json {
1050    fn from(value: String) -> Self {
1051        Self(value)
1052    }
1053}
1054impl Json {
1055    fn quote(&self) -> String {
1056        format!("\"{}\"", self.0.clone())
1057    }
1058}
1059#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1060pub struct JsonValueId(pub String);
1061impl From<&str> for JsonValueId {
1062    fn from(value: &str) -> Self {
1063        Self(value.to_string())
1064    }
1065}
1066impl From<String> for JsonValueId {
1067    fn from(value: String) -> Self {
1068        Self(value)
1069    }
1070}
1071impl IntoID<JsonValueId> for JsonValue {
1072    fn into_id(
1073        self,
1074    ) -> std::pin::Pin<
1075        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1076    > {
1077        Box::pin(async move { self.id().await })
1078    }
1079}
1080impl IntoID<JsonValueId> for JsonValueId {
1081    fn into_id(
1082        self,
1083    ) -> std::pin::Pin<
1084        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1085    > {
1086        Box::pin(async move { Ok::<JsonValueId, DaggerError>(self) })
1087    }
1088}
1089impl JsonValueId {
1090    fn quote(&self) -> String {
1091        format!("\"{}\"", self.0.clone())
1092    }
1093}
1094#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1095pub struct Llmid(pub String);
1096impl From<&str> for Llmid {
1097    fn from(value: &str) -> Self {
1098        Self(value.to_string())
1099    }
1100}
1101impl From<String> for Llmid {
1102    fn from(value: String) -> Self {
1103        Self(value)
1104    }
1105}
1106impl IntoID<Llmid> for Llm {
1107    fn into_id(
1108        self,
1109    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1110    {
1111        Box::pin(async move { self.id().await })
1112    }
1113}
1114impl IntoID<Llmid> for Llmid {
1115    fn into_id(
1116        self,
1117    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1118    {
1119        Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
1120    }
1121}
1122impl Llmid {
1123    fn quote(&self) -> String {
1124        format!("\"{}\"", self.0.clone())
1125    }
1126}
1127#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1128pub struct LlmTokenUsageId(pub String);
1129impl From<&str> for LlmTokenUsageId {
1130    fn from(value: &str) -> Self {
1131        Self(value.to_string())
1132    }
1133}
1134impl From<String> for LlmTokenUsageId {
1135    fn from(value: String) -> Self {
1136        Self(value)
1137    }
1138}
1139impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
1140    fn into_id(
1141        self,
1142    ) -> std::pin::Pin<
1143        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1144    > {
1145        Box::pin(async move { self.id().await })
1146    }
1147}
1148impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
1149    fn into_id(
1150        self,
1151    ) -> std::pin::Pin<
1152        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1153    > {
1154        Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
1155    }
1156}
1157impl LlmTokenUsageId {
1158    fn quote(&self) -> String {
1159        format!("\"{}\"", self.0.clone())
1160    }
1161}
1162#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1163pub struct LabelId(pub String);
1164impl From<&str> for LabelId {
1165    fn from(value: &str) -> Self {
1166        Self(value.to_string())
1167    }
1168}
1169impl From<String> for LabelId {
1170    fn from(value: String) -> Self {
1171        Self(value)
1172    }
1173}
1174impl IntoID<LabelId> for Label {
1175    fn into_id(
1176        self,
1177    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1178    {
1179        Box::pin(async move { self.id().await })
1180    }
1181}
1182impl IntoID<LabelId> for LabelId {
1183    fn into_id(
1184        self,
1185    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1186    {
1187        Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
1188    }
1189}
1190impl LabelId {
1191    fn quote(&self) -> String {
1192        format!("\"{}\"", self.0.clone())
1193    }
1194}
1195#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1196pub struct ListTypeDefId(pub String);
1197impl From<&str> for ListTypeDefId {
1198    fn from(value: &str) -> Self {
1199        Self(value.to_string())
1200    }
1201}
1202impl From<String> for ListTypeDefId {
1203    fn from(value: String) -> Self {
1204        Self(value)
1205    }
1206}
1207impl IntoID<ListTypeDefId> for ListTypeDef {
1208    fn into_id(
1209        self,
1210    ) -> std::pin::Pin<
1211        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1212    > {
1213        Box::pin(async move { self.id().await })
1214    }
1215}
1216impl IntoID<ListTypeDefId> for ListTypeDefId {
1217    fn into_id(
1218        self,
1219    ) -> std::pin::Pin<
1220        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1221    > {
1222        Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
1223    }
1224}
1225impl ListTypeDefId {
1226    fn quote(&self) -> String {
1227        format!("\"{}\"", self.0.clone())
1228    }
1229}
1230#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1231pub struct ModuleConfigClientId(pub String);
1232impl From<&str> for ModuleConfigClientId {
1233    fn from(value: &str) -> Self {
1234        Self(value.to_string())
1235    }
1236}
1237impl From<String> for ModuleConfigClientId {
1238    fn from(value: String) -> Self {
1239        Self(value)
1240    }
1241}
1242impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
1243    fn into_id(
1244        self,
1245    ) -> std::pin::Pin<
1246        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1247    > {
1248        Box::pin(async move { self.id().await })
1249    }
1250}
1251impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
1252    fn into_id(
1253        self,
1254    ) -> std::pin::Pin<
1255        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1256    > {
1257        Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
1258    }
1259}
1260impl ModuleConfigClientId {
1261    fn quote(&self) -> String {
1262        format!("\"{}\"", self.0.clone())
1263    }
1264}
1265#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1266pub struct ModuleId(pub String);
1267impl From<&str> for ModuleId {
1268    fn from(value: &str) -> Self {
1269        Self(value.to_string())
1270    }
1271}
1272impl From<String> for ModuleId {
1273    fn from(value: String) -> Self {
1274        Self(value)
1275    }
1276}
1277impl IntoID<ModuleId> for Module {
1278    fn into_id(
1279        self,
1280    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1281    {
1282        Box::pin(async move { self.id().await })
1283    }
1284}
1285impl IntoID<ModuleId> for ModuleId {
1286    fn into_id(
1287        self,
1288    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1289    {
1290        Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
1291    }
1292}
1293impl ModuleId {
1294    fn quote(&self) -> String {
1295        format!("\"{}\"", self.0.clone())
1296    }
1297}
1298#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1299pub struct ModuleSourceId(pub String);
1300impl From<&str> for ModuleSourceId {
1301    fn from(value: &str) -> Self {
1302        Self(value.to_string())
1303    }
1304}
1305impl From<String> for ModuleSourceId {
1306    fn from(value: String) -> Self {
1307        Self(value)
1308    }
1309}
1310impl IntoID<ModuleSourceId> for ModuleSource {
1311    fn into_id(
1312        self,
1313    ) -> std::pin::Pin<
1314        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1315    > {
1316        Box::pin(async move { self.id().await })
1317    }
1318}
1319impl IntoID<ModuleSourceId> for ModuleSourceId {
1320    fn into_id(
1321        self,
1322    ) -> std::pin::Pin<
1323        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1324    > {
1325        Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1326    }
1327}
1328impl ModuleSourceId {
1329    fn quote(&self) -> String {
1330        format!("\"{}\"", self.0.clone())
1331    }
1332}
1333#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1334pub struct ObjectTypeDefId(pub String);
1335impl From<&str> for ObjectTypeDefId {
1336    fn from(value: &str) -> Self {
1337        Self(value.to_string())
1338    }
1339}
1340impl From<String> for ObjectTypeDefId {
1341    fn from(value: String) -> Self {
1342        Self(value)
1343    }
1344}
1345impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1346    fn into_id(
1347        self,
1348    ) -> std::pin::Pin<
1349        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1350    > {
1351        Box::pin(async move { self.id().await })
1352    }
1353}
1354impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1355    fn into_id(
1356        self,
1357    ) -> std::pin::Pin<
1358        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1359    > {
1360        Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1361    }
1362}
1363impl ObjectTypeDefId {
1364    fn quote(&self) -> String {
1365        format!("\"{}\"", self.0.clone())
1366    }
1367}
1368#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1369pub struct Platform(pub String);
1370impl From<&str> for Platform {
1371    fn from(value: &str) -> Self {
1372        Self(value.to_string())
1373    }
1374}
1375impl From<String> for Platform {
1376    fn from(value: String) -> Self {
1377        Self(value)
1378    }
1379}
1380impl Platform {
1381    fn quote(&self) -> String {
1382        format!("\"{}\"", self.0.clone())
1383    }
1384}
1385#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1386pub struct PortId(pub String);
1387impl From<&str> for PortId {
1388    fn from(value: &str) -> Self {
1389        Self(value.to_string())
1390    }
1391}
1392impl From<String> for PortId {
1393    fn from(value: String) -> Self {
1394        Self(value)
1395    }
1396}
1397impl IntoID<PortId> for Port {
1398    fn into_id(
1399        self,
1400    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1401    {
1402        Box::pin(async move { self.id().await })
1403    }
1404}
1405impl IntoID<PortId> for PortId {
1406    fn into_id(
1407        self,
1408    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1409    {
1410        Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1411    }
1412}
1413impl PortId {
1414    fn quote(&self) -> String {
1415        format!("\"{}\"", self.0.clone())
1416    }
1417}
1418#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1419pub struct SdkConfigId(pub String);
1420impl From<&str> for SdkConfigId {
1421    fn from(value: &str) -> Self {
1422        Self(value.to_string())
1423    }
1424}
1425impl From<String> for SdkConfigId {
1426    fn from(value: String) -> Self {
1427        Self(value)
1428    }
1429}
1430impl IntoID<SdkConfigId> for SdkConfig {
1431    fn into_id(
1432        self,
1433    ) -> std::pin::Pin<
1434        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1435    > {
1436        Box::pin(async move { self.id().await })
1437    }
1438}
1439impl IntoID<SdkConfigId> for SdkConfigId {
1440    fn into_id(
1441        self,
1442    ) -> std::pin::Pin<
1443        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1444    > {
1445        Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1446    }
1447}
1448impl SdkConfigId {
1449    fn quote(&self) -> String {
1450        format!("\"{}\"", self.0.clone())
1451    }
1452}
1453#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1454pub struct ScalarTypeDefId(pub String);
1455impl From<&str> for ScalarTypeDefId {
1456    fn from(value: &str) -> Self {
1457        Self(value.to_string())
1458    }
1459}
1460impl From<String> for ScalarTypeDefId {
1461    fn from(value: String) -> Self {
1462        Self(value)
1463    }
1464}
1465impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1466    fn into_id(
1467        self,
1468    ) -> std::pin::Pin<
1469        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1470    > {
1471        Box::pin(async move { self.id().await })
1472    }
1473}
1474impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1475    fn into_id(
1476        self,
1477    ) -> std::pin::Pin<
1478        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1479    > {
1480        Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1481    }
1482}
1483impl ScalarTypeDefId {
1484    fn quote(&self) -> String {
1485        format!("\"{}\"", self.0.clone())
1486    }
1487}
1488#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1489pub struct SearchResultId(pub String);
1490impl From<&str> for SearchResultId {
1491    fn from(value: &str) -> Self {
1492        Self(value.to_string())
1493    }
1494}
1495impl From<String> for SearchResultId {
1496    fn from(value: String) -> Self {
1497        Self(value)
1498    }
1499}
1500impl IntoID<SearchResultId> for SearchResult {
1501    fn into_id(
1502        self,
1503    ) -> std::pin::Pin<
1504        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1505    > {
1506        Box::pin(async move { self.id().await })
1507    }
1508}
1509impl IntoID<SearchResultId> for SearchResultId {
1510    fn into_id(
1511        self,
1512    ) -> std::pin::Pin<
1513        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1514    > {
1515        Box::pin(async move { Ok::<SearchResultId, DaggerError>(self) })
1516    }
1517}
1518impl SearchResultId {
1519    fn quote(&self) -> String {
1520        format!("\"{}\"", self.0.clone())
1521    }
1522}
1523#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1524pub struct SearchSubmatchId(pub String);
1525impl From<&str> for SearchSubmatchId {
1526    fn from(value: &str) -> Self {
1527        Self(value.to_string())
1528    }
1529}
1530impl From<String> for SearchSubmatchId {
1531    fn from(value: String) -> Self {
1532        Self(value)
1533    }
1534}
1535impl IntoID<SearchSubmatchId> for SearchSubmatch {
1536    fn into_id(
1537        self,
1538    ) -> std::pin::Pin<
1539        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1540    > {
1541        Box::pin(async move { self.id().await })
1542    }
1543}
1544impl IntoID<SearchSubmatchId> for SearchSubmatchId {
1545    fn into_id(
1546        self,
1547    ) -> std::pin::Pin<
1548        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1549    > {
1550        Box::pin(async move { Ok::<SearchSubmatchId, DaggerError>(self) })
1551    }
1552}
1553impl SearchSubmatchId {
1554    fn quote(&self) -> String {
1555        format!("\"{}\"", self.0.clone())
1556    }
1557}
1558#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1559pub struct SecretId(pub String);
1560impl From<&str> for SecretId {
1561    fn from(value: &str) -> Self {
1562        Self(value.to_string())
1563    }
1564}
1565impl From<String> for SecretId {
1566    fn from(value: String) -> Self {
1567        Self(value)
1568    }
1569}
1570impl IntoID<SecretId> for Secret {
1571    fn into_id(
1572        self,
1573    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1574    {
1575        Box::pin(async move { self.id().await })
1576    }
1577}
1578impl IntoID<SecretId> for SecretId {
1579    fn into_id(
1580        self,
1581    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1582    {
1583        Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1584    }
1585}
1586impl SecretId {
1587    fn quote(&self) -> String {
1588        format!("\"{}\"", self.0.clone())
1589    }
1590}
1591#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1592pub struct ServiceId(pub String);
1593impl From<&str> for ServiceId {
1594    fn from(value: &str) -> Self {
1595        Self(value.to_string())
1596    }
1597}
1598impl From<String> for ServiceId {
1599    fn from(value: String) -> Self {
1600        Self(value)
1601    }
1602}
1603impl IntoID<ServiceId> for Service {
1604    fn into_id(
1605        self,
1606    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1607    {
1608        Box::pin(async move { self.id().await })
1609    }
1610}
1611impl IntoID<ServiceId> for ServiceId {
1612    fn into_id(
1613        self,
1614    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1615    {
1616        Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1617    }
1618}
1619impl ServiceId {
1620    fn quote(&self) -> String {
1621        format!("\"{}\"", self.0.clone())
1622    }
1623}
1624#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1625pub struct SocketId(pub String);
1626impl From<&str> for SocketId {
1627    fn from(value: &str) -> Self {
1628        Self(value.to_string())
1629    }
1630}
1631impl From<String> for SocketId {
1632    fn from(value: String) -> Self {
1633        Self(value)
1634    }
1635}
1636impl IntoID<SocketId> for Socket {
1637    fn into_id(
1638        self,
1639    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1640    {
1641        Box::pin(async move { self.id().await })
1642    }
1643}
1644impl IntoID<SocketId> for SocketId {
1645    fn into_id(
1646        self,
1647    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1648    {
1649        Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1650    }
1651}
1652impl SocketId {
1653    fn quote(&self) -> String {
1654        format!("\"{}\"", self.0.clone())
1655    }
1656}
1657#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1658pub struct SourceMapId(pub String);
1659impl From<&str> for SourceMapId {
1660    fn from(value: &str) -> Self {
1661        Self(value.to_string())
1662    }
1663}
1664impl From<String> for SourceMapId {
1665    fn from(value: String) -> Self {
1666        Self(value)
1667    }
1668}
1669impl IntoID<SourceMapId> for SourceMap {
1670    fn into_id(
1671        self,
1672    ) -> std::pin::Pin<
1673        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1674    > {
1675        Box::pin(async move { self.id().await })
1676    }
1677}
1678impl IntoID<SourceMapId> for SourceMapId {
1679    fn into_id(
1680        self,
1681    ) -> std::pin::Pin<
1682        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1683    > {
1684        Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1685    }
1686}
1687impl SourceMapId {
1688    fn quote(&self) -> String {
1689        format!("\"{}\"", self.0.clone())
1690    }
1691}
1692#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1693pub struct TerminalId(pub String);
1694impl From<&str> for TerminalId {
1695    fn from(value: &str) -> Self {
1696        Self(value.to_string())
1697    }
1698}
1699impl From<String> for TerminalId {
1700    fn from(value: String) -> Self {
1701        Self(value)
1702    }
1703}
1704impl IntoID<TerminalId> for Terminal {
1705    fn into_id(
1706        self,
1707    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1708    {
1709        Box::pin(async move { self.id().await })
1710    }
1711}
1712impl IntoID<TerminalId> for TerminalId {
1713    fn into_id(
1714        self,
1715    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1716    {
1717        Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
1718    }
1719}
1720impl TerminalId {
1721    fn quote(&self) -> String {
1722        format!("\"{}\"", self.0.clone())
1723    }
1724}
1725#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1726pub struct TypeDefId(pub String);
1727impl From<&str> for TypeDefId {
1728    fn from(value: &str) -> Self {
1729        Self(value.to_string())
1730    }
1731}
1732impl From<String> for TypeDefId {
1733    fn from(value: String) -> Self {
1734        Self(value)
1735    }
1736}
1737impl IntoID<TypeDefId> for TypeDef {
1738    fn into_id(
1739        self,
1740    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1741    {
1742        Box::pin(async move { self.id().await })
1743    }
1744}
1745impl IntoID<TypeDefId> for TypeDefId {
1746    fn into_id(
1747        self,
1748    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1749    {
1750        Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
1751    }
1752}
1753impl TypeDefId {
1754    fn quote(&self) -> String {
1755        format!("\"{}\"", self.0.clone())
1756    }
1757}
1758#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1759pub struct Void(pub String);
1760impl From<&str> for Void {
1761    fn from(value: &str) -> Self {
1762        Self(value.to_string())
1763    }
1764}
1765impl From<String> for Void {
1766    fn from(value: String) -> Self {
1767        Self(value)
1768    }
1769}
1770impl Void {
1771    fn quote(&self) -> String {
1772        format!("\"{}\"", self.0.clone())
1773    }
1774}
1775#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1776pub struct BuildArg {
1777    pub name: String,
1778    pub value: String,
1779}
1780#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1781pub struct PipelineLabel {
1782    pub name: String,
1783    pub value: String,
1784}
1785#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1786pub struct PortForward {
1787    pub backend: isize,
1788    pub frontend: isize,
1789    pub protocol: NetworkProtocol,
1790}
1791#[derive(Clone)]
1792pub struct Binding {
1793    pub proc: Option<Arc<DaggerSessionProc>>,
1794    pub selection: Selection,
1795    pub graphql_client: DynGraphQLClient,
1796}
1797impl Binding {
1798    /// Retrieve the binding value, as type CacheVolume
1799    pub fn as_cache_volume(&self) -> CacheVolume {
1800        let query = self.selection.select("asCacheVolume");
1801        CacheVolume {
1802            proc: self.proc.clone(),
1803            selection: query,
1804            graphql_client: self.graphql_client.clone(),
1805        }
1806    }
1807    /// Retrieve the binding value, as type Changeset
1808    pub fn as_changeset(&self) -> Changeset {
1809        let query = self.selection.select("asChangeset");
1810        Changeset {
1811            proc: self.proc.clone(),
1812            selection: query,
1813            graphql_client: self.graphql_client.clone(),
1814        }
1815    }
1816    /// Retrieve the binding value, as type Cloud
1817    pub fn as_cloud(&self) -> Cloud {
1818        let query = self.selection.select("asCloud");
1819        Cloud {
1820            proc: self.proc.clone(),
1821            selection: query,
1822            graphql_client: self.graphql_client.clone(),
1823        }
1824    }
1825    /// Retrieve the binding value, as type Container
1826    pub fn as_container(&self) -> Container {
1827        let query = self.selection.select("asContainer");
1828        Container {
1829            proc: self.proc.clone(),
1830            selection: query,
1831            graphql_client: self.graphql_client.clone(),
1832        }
1833    }
1834    /// Retrieve the binding value, as type Directory
1835    pub fn as_directory(&self) -> Directory {
1836        let query = self.selection.select("asDirectory");
1837        Directory {
1838            proc: self.proc.clone(),
1839            selection: query,
1840            graphql_client: self.graphql_client.clone(),
1841        }
1842    }
1843    /// Retrieve the binding value, as type Env
1844    pub fn as_env(&self) -> Env {
1845        let query = self.selection.select("asEnv");
1846        Env {
1847            proc: self.proc.clone(),
1848            selection: query,
1849            graphql_client: self.graphql_client.clone(),
1850        }
1851    }
1852    /// Retrieve the binding value, as type EnvFile
1853    pub fn as_env_file(&self) -> EnvFile {
1854        let query = self.selection.select("asEnvFile");
1855        EnvFile {
1856            proc: self.proc.clone(),
1857            selection: query,
1858            graphql_client: self.graphql_client.clone(),
1859        }
1860    }
1861    /// Retrieve the binding value, as type File
1862    pub fn as_file(&self) -> File {
1863        let query = self.selection.select("asFile");
1864        File {
1865            proc: self.proc.clone(),
1866            selection: query,
1867            graphql_client: self.graphql_client.clone(),
1868        }
1869    }
1870    /// Retrieve the binding value, as type GitRef
1871    pub fn as_git_ref(&self) -> GitRef {
1872        let query = self.selection.select("asGitRef");
1873        GitRef {
1874            proc: self.proc.clone(),
1875            selection: query,
1876            graphql_client: self.graphql_client.clone(),
1877        }
1878    }
1879    /// Retrieve the binding value, as type GitRepository
1880    pub fn as_git_repository(&self) -> GitRepository {
1881        let query = self.selection.select("asGitRepository");
1882        GitRepository {
1883            proc: self.proc.clone(),
1884            selection: query,
1885            graphql_client: self.graphql_client.clone(),
1886        }
1887    }
1888    /// Retrieve the binding value, as type JSONValue
1889    pub fn as_json_value(&self) -> JsonValue {
1890        let query = self.selection.select("asJSONValue");
1891        JsonValue {
1892            proc: self.proc.clone(),
1893            selection: query,
1894            graphql_client: self.graphql_client.clone(),
1895        }
1896    }
1897    /// Retrieve the binding value, as type LLM
1898    pub fn as_llm(&self) -> Llm {
1899        let query = self.selection.select("asLLM");
1900        Llm {
1901            proc: self.proc.clone(),
1902            selection: query,
1903            graphql_client: self.graphql_client.clone(),
1904        }
1905    }
1906    /// Retrieve the binding value, as type Module
1907    pub fn as_module(&self) -> Module {
1908        let query = self.selection.select("asModule");
1909        Module {
1910            proc: self.proc.clone(),
1911            selection: query,
1912            graphql_client: self.graphql_client.clone(),
1913        }
1914    }
1915    /// Retrieve the binding value, as type ModuleConfigClient
1916    pub fn as_module_config_client(&self) -> ModuleConfigClient {
1917        let query = self.selection.select("asModuleConfigClient");
1918        ModuleConfigClient {
1919            proc: self.proc.clone(),
1920            selection: query,
1921            graphql_client: self.graphql_client.clone(),
1922        }
1923    }
1924    /// Retrieve the binding value, as type ModuleSource
1925    pub fn as_module_source(&self) -> ModuleSource {
1926        let query = self.selection.select("asModuleSource");
1927        ModuleSource {
1928            proc: self.proc.clone(),
1929            selection: query,
1930            graphql_client: self.graphql_client.clone(),
1931        }
1932    }
1933    /// Retrieve the binding value, as type SearchResult
1934    pub fn as_search_result(&self) -> SearchResult {
1935        let query = self.selection.select("asSearchResult");
1936        SearchResult {
1937            proc: self.proc.clone(),
1938            selection: query,
1939            graphql_client: self.graphql_client.clone(),
1940        }
1941    }
1942    /// Retrieve the binding value, as type SearchSubmatch
1943    pub fn as_search_submatch(&self) -> SearchSubmatch {
1944        let query = self.selection.select("asSearchSubmatch");
1945        SearchSubmatch {
1946            proc: self.proc.clone(),
1947            selection: query,
1948            graphql_client: self.graphql_client.clone(),
1949        }
1950    }
1951    /// Retrieve the binding value, as type Secret
1952    pub fn as_secret(&self) -> Secret {
1953        let query = self.selection.select("asSecret");
1954        Secret {
1955            proc: self.proc.clone(),
1956            selection: query,
1957            graphql_client: self.graphql_client.clone(),
1958        }
1959    }
1960    /// Retrieve the binding value, as type Service
1961    pub fn as_service(&self) -> Service {
1962        let query = self.selection.select("asService");
1963        Service {
1964            proc: self.proc.clone(),
1965            selection: query,
1966            graphql_client: self.graphql_client.clone(),
1967        }
1968    }
1969    /// Retrieve the binding value, as type Socket
1970    pub fn as_socket(&self) -> Socket {
1971        let query = self.selection.select("asSocket");
1972        Socket {
1973            proc: self.proc.clone(),
1974            selection: query,
1975            graphql_client: self.graphql_client.clone(),
1976        }
1977    }
1978    /// The binding's string value
1979    pub async fn as_string(&self) -> Result<String, DaggerError> {
1980        let query = self.selection.select("asString");
1981        query.execute(self.graphql_client.clone()).await
1982    }
1983    /// The digest of the binding value
1984    pub async fn digest(&self) -> Result<String, DaggerError> {
1985        let query = self.selection.select("digest");
1986        query.execute(self.graphql_client.clone()).await
1987    }
1988    /// A unique identifier for this Binding.
1989    pub async fn id(&self) -> Result<BindingId, DaggerError> {
1990        let query = self.selection.select("id");
1991        query.execute(self.graphql_client.clone()).await
1992    }
1993    /// Returns true if the binding is null
1994    pub async fn is_null(&self) -> Result<bool, DaggerError> {
1995        let query = self.selection.select("isNull");
1996        query.execute(self.graphql_client.clone()).await
1997    }
1998    /// The binding name
1999    pub async fn name(&self) -> Result<String, DaggerError> {
2000        let query = self.selection.select("name");
2001        query.execute(self.graphql_client.clone()).await
2002    }
2003    /// The binding type
2004    pub async fn type_name(&self) -> Result<String, DaggerError> {
2005        let query = self.selection.select("typeName");
2006        query.execute(self.graphql_client.clone()).await
2007    }
2008}
2009#[derive(Clone)]
2010pub struct CacheVolume {
2011    pub proc: Option<Arc<DaggerSessionProc>>,
2012    pub selection: Selection,
2013    pub graphql_client: DynGraphQLClient,
2014}
2015impl CacheVolume {
2016    /// A unique identifier for this CacheVolume.
2017    pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
2018        let query = self.selection.select("id");
2019        query.execute(self.graphql_client.clone()).await
2020    }
2021}
2022#[derive(Clone)]
2023pub struct Changeset {
2024    pub proc: Option<Arc<DaggerSessionProc>>,
2025    pub selection: Selection,
2026    pub graphql_client: DynGraphQLClient,
2027}
2028impl Changeset {
2029    /// Files and directories that were added in the newer directory.
2030    pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2031        let query = self.selection.select("addedPaths");
2032        query.execute(self.graphql_client.clone()).await
2033    }
2034    /// The newer/upper snapshot.
2035    pub fn after(&self) -> Directory {
2036        let query = self.selection.select("after");
2037        Directory {
2038            proc: self.proc.clone(),
2039            selection: query,
2040            graphql_client: self.graphql_client.clone(),
2041        }
2042    }
2043    /// Return a Git-compatible patch of the changes
2044    pub fn as_patch(&self) -> File {
2045        let query = self.selection.select("asPatch");
2046        File {
2047            proc: self.proc.clone(),
2048            selection: query,
2049            graphql_client: self.graphql_client.clone(),
2050        }
2051    }
2052    /// The older/lower snapshot to compare against.
2053    pub fn before(&self) -> Directory {
2054        let query = self.selection.select("before");
2055        Directory {
2056            proc: self.proc.clone(),
2057            selection: query,
2058            graphql_client: self.graphql_client.clone(),
2059        }
2060    }
2061    /// A unique identifier for this Changeset.
2062    pub async fn id(&self) -> Result<ChangesetId, DaggerError> {
2063        let query = self.selection.select("id");
2064        query.execute(self.graphql_client.clone()).await
2065    }
2066    /// Return a snapshot containing only the created and modified files
2067    pub fn layer(&self) -> Directory {
2068        let query = self.selection.select("layer");
2069        Directory {
2070            proc: self.proc.clone(),
2071            selection: query,
2072            graphql_client: self.graphql_client.clone(),
2073        }
2074    }
2075    /// Files and directories that existed before and were updated in the newer directory.
2076    pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2077        let query = self.selection.select("modifiedPaths");
2078        query.execute(self.graphql_client.clone()).await
2079    }
2080    /// Files and directories that were removed. Directories are indicated by a trailing slash, and their child paths are not included.
2081    pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2082        let query = self.selection.select("removedPaths");
2083        query.execute(self.graphql_client.clone()).await
2084    }
2085    /// Force evaluation in the engine.
2086    pub async fn sync(&self) -> Result<ChangesetId, DaggerError> {
2087        let query = self.selection.select("sync");
2088        query.execute(self.graphql_client.clone()).await
2089    }
2090}
2091#[derive(Clone)]
2092pub struct Cloud {
2093    pub proc: Option<Arc<DaggerSessionProc>>,
2094    pub selection: Selection,
2095    pub graphql_client: DynGraphQLClient,
2096}
2097impl Cloud {
2098    /// A unique identifier for this Cloud.
2099    pub async fn id(&self) -> Result<CloudId, DaggerError> {
2100        let query = self.selection.select("id");
2101        query.execute(self.graphql_client.clone()).await
2102    }
2103    /// The trace URL for the current session
2104    pub async fn trace_url(&self) -> Result<String, DaggerError> {
2105        let query = self.selection.select("traceURL");
2106        query.execute(self.graphql_client.clone()).await
2107    }
2108}
2109#[derive(Clone)]
2110pub struct Container {
2111    pub proc: Option<Arc<DaggerSessionProc>>,
2112    pub selection: Selection,
2113    pub graphql_client: DynGraphQLClient,
2114}
2115#[derive(Builder, Debug, PartialEq)]
2116pub struct ContainerAsServiceOpts<'a> {
2117    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2118    /// If empty, the container's default command is used.
2119    #[builder(setter(into, strip_option), default)]
2120    pub args: Option<Vec<&'a str>>,
2121    /// Replace "${VAR}" or "$VAR" in the args 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    /// Provides Dagger access to the executed command.
2125    #[builder(setter(into, strip_option), default)]
2126    pub experimental_privileged_nesting: Option<bool>,
2127    /// 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.
2128    #[builder(setter(into, strip_option), default)]
2129    pub insecure_root_capabilities: Option<bool>,
2130    /// If set, skip the automatic init process injected into containers by default.
2131    /// 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.
2132    #[builder(setter(into, strip_option), default)]
2133    pub no_init: Option<bool>,
2134    /// If the container has an entrypoint, prepend it to the args.
2135    #[builder(setter(into, strip_option), default)]
2136    pub use_entrypoint: Option<bool>,
2137}
2138#[derive(Builder, Debug, PartialEq)]
2139pub struct ContainerAsTarballOpts {
2140    /// Force each layer of the image to use the specified compression algorithm.
2141    /// 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.
2142    #[builder(setter(into, strip_option), default)]
2143    pub forced_compression: Option<ImageLayerCompression>,
2144    /// Use the specified media types for the image's layers.
2145    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2146    #[builder(setter(into, strip_option), default)]
2147    pub media_types: Option<ImageMediaTypes>,
2148    /// Identifiers for other platform specific containers.
2149    /// Used for multi-platform images.
2150    #[builder(setter(into, strip_option), default)]
2151    pub platform_variants: Option<Vec<ContainerId>>,
2152}
2153#[derive(Builder, Debug, PartialEq)]
2154pub struct ContainerBuildOpts<'a> {
2155    /// Additional build arguments.
2156    #[builder(setter(into, strip_option), default)]
2157    pub build_args: Option<Vec<BuildArg>>,
2158    /// Path to the Dockerfile to use.
2159    #[builder(setter(into, strip_option), default)]
2160    pub dockerfile: Option<&'a str>,
2161    /// If set, skip the automatic init process injected into containers created by RUN statements.
2162    /// 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.
2163    #[builder(setter(into, strip_option), default)]
2164    pub no_init: Option<bool>,
2165    /// Secrets to pass to the build.
2166    /// They will be mounted at /run/secrets/[secret-name] in the build container
2167    /// 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))
2168    #[builder(setter(into, strip_option), default)]
2169    pub secrets: Option<Vec<SecretId>>,
2170    /// Target build stage to build.
2171    #[builder(setter(into, strip_option), default)]
2172    pub target: Option<&'a str>,
2173}
2174#[derive(Builder, Debug, PartialEq)]
2175pub struct ContainerDirectoryOpts {
2176    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2177    #[builder(setter(into, strip_option), default)]
2178    pub expand: Option<bool>,
2179}
2180#[derive(Builder, Debug, PartialEq)]
2181pub struct ContainerExistsOpts {
2182    /// If specified, do not follow symlinks.
2183    #[builder(setter(into, strip_option), default)]
2184    pub do_not_follow_symlinks: Option<bool>,
2185    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
2186    #[builder(setter(into, strip_option), default)]
2187    pub expected_type: Option<ExistsType>,
2188}
2189#[derive(Builder, Debug, PartialEq)]
2190pub struct ContainerExportOpts {
2191    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2192    #[builder(setter(into, strip_option), default)]
2193    pub expand: Option<bool>,
2194    /// Force each layer of the exported image to use the specified compression algorithm.
2195    /// 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.
2196    #[builder(setter(into, strip_option), default)]
2197    pub forced_compression: Option<ImageLayerCompression>,
2198    /// Use the specified media types for the exported image's layers.
2199    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2200    #[builder(setter(into, strip_option), default)]
2201    pub media_types: Option<ImageMediaTypes>,
2202    /// Identifiers for other platform specific containers.
2203    /// Used for multi-platform image.
2204    #[builder(setter(into, strip_option), default)]
2205    pub platform_variants: Option<Vec<ContainerId>>,
2206}
2207#[derive(Builder, Debug, PartialEq)]
2208pub struct ContainerExportImageOpts {
2209    /// Force each layer of the exported image to use the specified compression algorithm.
2210    /// 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.
2211    #[builder(setter(into, strip_option), default)]
2212    pub forced_compression: Option<ImageLayerCompression>,
2213    /// Use the specified media types for the exported image's layers.
2214    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2215    #[builder(setter(into, strip_option), default)]
2216    pub media_types: Option<ImageMediaTypes>,
2217    /// Identifiers for other platform specific containers.
2218    /// Used for multi-platform image.
2219    #[builder(setter(into, strip_option), default)]
2220    pub platform_variants: Option<Vec<ContainerId>>,
2221}
2222#[derive(Builder, Debug, PartialEq)]
2223pub struct ContainerFileOpts {
2224    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2225    #[builder(setter(into, strip_option), default)]
2226    pub expand: Option<bool>,
2227}
2228#[derive(Builder, Debug, PartialEq)]
2229pub struct ContainerImportOpts<'a> {
2230    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
2231    #[builder(setter(into, strip_option), default)]
2232    pub tag: Option<&'a str>,
2233}
2234#[derive(Builder, Debug, PartialEq)]
2235pub struct ContainerPublishOpts {
2236    /// Force each layer of the published image to use the specified compression algorithm.
2237    /// 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.
2238    #[builder(setter(into, strip_option), default)]
2239    pub forced_compression: Option<ImageLayerCompression>,
2240    /// Use the specified media types for the published image's layers.
2241    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
2242    #[builder(setter(into, strip_option), default)]
2243    pub media_types: Option<ImageMediaTypes>,
2244    /// Identifiers for other platform specific containers.
2245    /// Used for multi-platform image.
2246    #[builder(setter(into, strip_option), default)]
2247    pub platform_variants: Option<Vec<ContainerId>>,
2248}
2249#[derive(Builder, Debug, PartialEq)]
2250pub struct ContainerTerminalOpts<'a> {
2251    /// If set, override the container's default terminal command and invoke these command arguments instead.
2252    #[builder(setter(into, strip_option), default)]
2253    pub cmd: Option<Vec<&'a str>>,
2254    /// Provides Dagger access to the executed command.
2255    #[builder(setter(into, strip_option), default)]
2256    pub experimental_privileged_nesting: Option<bool>,
2257    /// 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.
2258    #[builder(setter(into, strip_option), default)]
2259    pub insecure_root_capabilities: Option<bool>,
2260}
2261#[derive(Builder, Debug, PartialEq)]
2262pub struct ContainerUpOpts<'a> {
2263    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2264    /// If empty, the container's default command is used.
2265    #[builder(setter(into, strip_option), default)]
2266    pub args: Option<Vec<&'a str>>,
2267    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2268    #[builder(setter(into, strip_option), default)]
2269    pub expand: Option<bool>,
2270    /// Provides Dagger access to the executed command.
2271    #[builder(setter(into, strip_option), default)]
2272    pub experimental_privileged_nesting: Option<bool>,
2273    /// 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.
2274    #[builder(setter(into, strip_option), default)]
2275    pub insecure_root_capabilities: Option<bool>,
2276    /// If set, skip the automatic init process injected into containers by default.
2277    /// 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.
2278    #[builder(setter(into, strip_option), default)]
2279    pub no_init: Option<bool>,
2280    /// List of frontend/backend port mappings to forward.
2281    /// Frontend is the port accepting traffic on the host, backend is the service port.
2282    #[builder(setter(into, strip_option), default)]
2283    pub ports: Option<Vec<PortForward>>,
2284    /// Bind each tunnel port to a random port on the host.
2285    #[builder(setter(into, strip_option), default)]
2286    pub random: Option<bool>,
2287    /// If the container has an entrypoint, prepend it to the args.
2288    #[builder(setter(into, strip_option), default)]
2289    pub use_entrypoint: Option<bool>,
2290}
2291#[derive(Builder, Debug, PartialEq)]
2292pub struct ContainerWithDefaultTerminalCmdOpts {
2293    /// Provides Dagger access to the executed command.
2294    #[builder(setter(into, strip_option), default)]
2295    pub experimental_privileged_nesting: Option<bool>,
2296    /// 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.
2297    #[builder(setter(into, strip_option), default)]
2298    pub insecure_root_capabilities: Option<bool>,
2299}
2300#[derive(Builder, Debug, PartialEq)]
2301pub struct ContainerWithDirectoryOpts<'a> {
2302    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
2303    #[builder(setter(into, strip_option), default)]
2304    pub exclude: Option<Vec<&'a str>>,
2305    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2306    #[builder(setter(into, strip_option), default)]
2307    pub expand: Option<bool>,
2308    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
2309    #[builder(setter(into, strip_option), default)]
2310    pub include: Option<Vec<&'a str>>,
2311    /// A user:group to set for the directory and its contents.
2312    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2313    /// If the group is omitted, it defaults to the same as the user.
2314    #[builder(setter(into, strip_option), default)]
2315    pub owner: Option<&'a str>,
2316}
2317#[derive(Builder, Debug, PartialEq)]
2318pub struct ContainerWithEntrypointOpts {
2319    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
2320    #[builder(setter(into, strip_option), default)]
2321    pub keep_default_args: Option<bool>,
2322}
2323#[derive(Builder, Debug, PartialEq)]
2324pub struct ContainerWithEnvVariableOpts {
2325    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
2326    #[builder(setter(into, strip_option), default)]
2327    pub expand: Option<bool>,
2328}
2329#[derive(Builder, Debug, PartialEq)]
2330pub struct ContainerWithExecOpts<'a> {
2331    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2332    #[builder(setter(into, strip_option), default)]
2333    pub expand: Option<bool>,
2334    /// Exit codes this command is allowed to exit with without error
2335    #[builder(setter(into, strip_option), default)]
2336    pub expect: Option<ReturnType>,
2337    /// Provides Dagger access to the executed command.
2338    #[builder(setter(into, strip_option), default)]
2339    pub experimental_privileged_nesting: Option<bool>,
2340    /// Execute the command with all root capabilities. Like --privileged in Docker
2341    /// 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.
2342    #[builder(setter(into, strip_option), default)]
2343    pub insecure_root_capabilities: Option<bool>,
2344    /// Skip the automatic init process injected into containers by default.
2345    /// 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.
2346    #[builder(setter(into, strip_option), default)]
2347    pub no_init: Option<bool>,
2348    /// Redirect the command's standard error to a file in the container. Example: "./stderr.txt"
2349    #[builder(setter(into, strip_option), default)]
2350    pub redirect_stderr: Option<&'a str>,
2351    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
2352    #[builder(setter(into, strip_option), default)]
2353    pub redirect_stdin: Option<&'a str>,
2354    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
2355    #[builder(setter(into, strip_option), default)]
2356    pub redirect_stdout: Option<&'a str>,
2357    /// Content to write to the command's standard input. Example: "Hello world")
2358    #[builder(setter(into, strip_option), default)]
2359    pub stdin: Option<&'a str>,
2360    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
2361    #[builder(setter(into, strip_option), default)]
2362    pub use_entrypoint: Option<bool>,
2363}
2364#[derive(Builder, Debug, PartialEq)]
2365pub struct ContainerWithExposedPortOpts<'a> {
2366    /// Port description. Example: "payment API endpoint"
2367    #[builder(setter(into, strip_option), default)]
2368    pub description: Option<&'a str>,
2369    /// Skip the health check when run as a service.
2370    #[builder(setter(into, strip_option), default)]
2371    pub experimental_skip_healthcheck: Option<bool>,
2372    /// Network protocol. Example: "tcp"
2373    #[builder(setter(into, strip_option), default)]
2374    pub protocol: Option<NetworkProtocol>,
2375}
2376#[derive(Builder, Debug, PartialEq)]
2377pub struct ContainerWithFileOpts<'a> {
2378    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2379    #[builder(setter(into, strip_option), default)]
2380    pub expand: Option<bool>,
2381    /// A user:group to set for the file.
2382    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2383    /// If the group is omitted, it defaults to the same as the user.
2384    #[builder(setter(into, strip_option), default)]
2385    pub owner: Option<&'a str>,
2386    /// Permissions of the new file. Example: 0600
2387    #[builder(setter(into, strip_option), default)]
2388    pub permissions: Option<isize>,
2389}
2390#[derive(Builder, Debug, PartialEq)]
2391pub struct ContainerWithFilesOpts<'a> {
2392    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2393    #[builder(setter(into, strip_option), default)]
2394    pub expand: Option<bool>,
2395    /// A user:group to set for the files.
2396    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2397    /// If the group is omitted, it defaults to the same as the user.
2398    #[builder(setter(into, strip_option), default)]
2399    pub owner: Option<&'a str>,
2400    /// Permission given to the copied files (e.g., 0600).
2401    #[builder(setter(into, strip_option), default)]
2402    pub permissions: Option<isize>,
2403}
2404#[derive(Builder, Debug, PartialEq)]
2405pub struct ContainerWithMountedCacheOpts<'a> {
2406    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2407    #[builder(setter(into, strip_option), default)]
2408    pub expand: Option<bool>,
2409    /// A user:group to set for the mounted cache directory.
2410    /// 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.
2411    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2412    /// If the group is omitted, it defaults to the same as the user.
2413    #[builder(setter(into, strip_option), default)]
2414    pub owner: Option<&'a str>,
2415    /// Sharing mode of the cache volume.
2416    #[builder(setter(into, strip_option), default)]
2417    pub sharing: Option<CacheSharingMode>,
2418    /// Identifier of the directory to use as the cache volume's root.
2419    #[builder(setter(into, strip_option), default)]
2420    pub source: Option<DirectoryId>,
2421}
2422#[derive(Builder, Debug, PartialEq)]
2423pub struct ContainerWithMountedDirectoryOpts<'a> {
2424    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2425    #[builder(setter(into, strip_option), default)]
2426    pub expand: Option<bool>,
2427    /// A user:group to set for the mounted directory and its contents.
2428    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2429    /// If the group is omitted, it defaults to the same as the user.
2430    #[builder(setter(into, strip_option), default)]
2431    pub owner: Option<&'a str>,
2432}
2433#[derive(Builder, Debug, PartialEq)]
2434pub struct ContainerWithMountedFileOpts<'a> {
2435    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2436    #[builder(setter(into, strip_option), default)]
2437    pub expand: Option<bool>,
2438    /// A user or user:group to set for the mounted file.
2439    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2440    /// If the group is omitted, it defaults to the same as the user.
2441    #[builder(setter(into, strip_option), default)]
2442    pub owner: Option<&'a str>,
2443}
2444#[derive(Builder, Debug, PartialEq)]
2445pub struct ContainerWithMountedSecretOpts<'a> {
2446    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2447    #[builder(setter(into, strip_option), default)]
2448    pub expand: Option<bool>,
2449    /// Permission given to the mounted secret (e.g., 0600).
2450    /// This option requires an owner to be set to be active.
2451    #[builder(setter(into, strip_option), default)]
2452    pub mode: Option<isize>,
2453    /// A user:group to set for the mounted secret.
2454    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2455    /// If the group is omitted, it defaults to the same as the user.
2456    #[builder(setter(into, strip_option), default)]
2457    pub owner: Option<&'a str>,
2458}
2459#[derive(Builder, Debug, PartialEq)]
2460pub struct ContainerWithMountedTempOpts {
2461    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2462    #[builder(setter(into, strip_option), default)]
2463    pub expand: Option<bool>,
2464    /// Size of the temporary directory in bytes.
2465    #[builder(setter(into, strip_option), default)]
2466    pub size: Option<isize>,
2467}
2468#[derive(Builder, Debug, PartialEq)]
2469pub struct ContainerWithNewFileOpts<'a> {
2470    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2471    #[builder(setter(into, strip_option), default)]
2472    pub expand: Option<bool>,
2473    /// A user:group to set for the file.
2474    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2475    /// If the group is omitted, it defaults to the same as the user.
2476    #[builder(setter(into, strip_option), default)]
2477    pub owner: Option<&'a str>,
2478    /// Permissions of the new file. Example: 0600
2479    #[builder(setter(into, strip_option), default)]
2480    pub permissions: Option<isize>,
2481}
2482#[derive(Builder, Debug, PartialEq)]
2483pub struct ContainerWithSymlinkOpts {
2484    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2485    #[builder(setter(into, strip_option), default)]
2486    pub expand: Option<bool>,
2487}
2488#[derive(Builder, Debug, PartialEq)]
2489pub struct ContainerWithUnixSocketOpts<'a> {
2490    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2491    #[builder(setter(into, strip_option), default)]
2492    pub expand: Option<bool>,
2493    /// A user:group to set for the mounted socket.
2494    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2495    /// If the group is omitted, it defaults to the same as the user.
2496    #[builder(setter(into, strip_option), default)]
2497    pub owner: Option<&'a str>,
2498}
2499#[derive(Builder, Debug, PartialEq)]
2500pub struct ContainerWithWorkdirOpts {
2501    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2502    #[builder(setter(into, strip_option), default)]
2503    pub expand: Option<bool>,
2504}
2505#[derive(Builder, Debug, PartialEq)]
2506pub struct ContainerWithoutDirectoryOpts {
2507    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2508    #[builder(setter(into, strip_option), default)]
2509    pub expand: Option<bool>,
2510}
2511#[derive(Builder, Debug, PartialEq)]
2512pub struct ContainerWithoutEntrypointOpts {
2513    /// Don't remove the default arguments when unsetting the entrypoint.
2514    #[builder(setter(into, strip_option), default)]
2515    pub keep_default_args: Option<bool>,
2516}
2517#[derive(Builder, Debug, PartialEq)]
2518pub struct ContainerWithoutExposedPortOpts {
2519    /// Port protocol to unexpose
2520    #[builder(setter(into, strip_option), default)]
2521    pub protocol: Option<NetworkProtocol>,
2522}
2523#[derive(Builder, Debug, PartialEq)]
2524pub struct ContainerWithoutFileOpts {
2525    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2526    #[builder(setter(into, strip_option), default)]
2527    pub expand: Option<bool>,
2528}
2529#[derive(Builder, Debug, PartialEq)]
2530pub struct ContainerWithoutFilesOpts {
2531    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2532    #[builder(setter(into, strip_option), default)]
2533    pub expand: Option<bool>,
2534}
2535#[derive(Builder, Debug, PartialEq)]
2536pub struct ContainerWithoutMountOpts {
2537    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2538    #[builder(setter(into, strip_option), default)]
2539    pub expand: Option<bool>,
2540}
2541#[derive(Builder, Debug, PartialEq)]
2542pub struct ContainerWithoutUnixSocketOpts {
2543    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2544    #[builder(setter(into, strip_option), default)]
2545    pub expand: Option<bool>,
2546}
2547impl Container {
2548    /// Turn the container into a Service.
2549    /// Be sure to set any exposed ports before this conversion.
2550    ///
2551    /// # Arguments
2552    ///
2553    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2554    pub fn as_service(&self) -> Service {
2555        let query = self.selection.select("asService");
2556        Service {
2557            proc: self.proc.clone(),
2558            selection: query,
2559            graphql_client: self.graphql_client.clone(),
2560        }
2561    }
2562    /// Turn the container into a Service.
2563    /// Be sure to set any exposed ports before this conversion.
2564    ///
2565    /// # Arguments
2566    ///
2567    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2568    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2569        let mut query = self.selection.select("asService");
2570        if let Some(args) = opts.args {
2571            query = query.arg("args", args);
2572        }
2573        if let Some(use_entrypoint) = opts.use_entrypoint {
2574            query = query.arg("useEntrypoint", use_entrypoint);
2575        }
2576        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2577            query = query.arg(
2578                "experimentalPrivilegedNesting",
2579                experimental_privileged_nesting,
2580            );
2581        }
2582        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2583            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2584        }
2585        if let Some(expand) = opts.expand {
2586            query = query.arg("expand", expand);
2587        }
2588        if let Some(no_init) = opts.no_init {
2589            query = query.arg("noInit", no_init);
2590        }
2591        Service {
2592            proc: self.proc.clone(),
2593            selection: query,
2594            graphql_client: self.graphql_client.clone(),
2595        }
2596    }
2597    /// Package the container state as an OCI image, and return it as a tar archive
2598    ///
2599    /// # Arguments
2600    ///
2601    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2602    pub fn as_tarball(&self) -> File {
2603        let query = self.selection.select("asTarball");
2604        File {
2605            proc: self.proc.clone(),
2606            selection: query,
2607            graphql_client: self.graphql_client.clone(),
2608        }
2609    }
2610    /// Package the container state as an OCI image, and return it as a tar archive
2611    ///
2612    /// # Arguments
2613    ///
2614    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2615    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2616        let mut query = self.selection.select("asTarball");
2617        if let Some(platform_variants) = opts.platform_variants {
2618            query = query.arg("platformVariants", platform_variants);
2619        }
2620        if let Some(forced_compression) = opts.forced_compression {
2621            query = query.arg("forcedCompression", forced_compression);
2622        }
2623        if let Some(media_types) = opts.media_types {
2624            query = query.arg("mediaTypes", media_types);
2625        }
2626        File {
2627            proc: self.proc.clone(),
2628            selection: query,
2629            graphql_client: self.graphql_client.clone(),
2630        }
2631    }
2632    /// Initializes this container from a Dockerfile build.
2633    ///
2634    /// # Arguments
2635    ///
2636    /// * `context` - Directory context used by the Dockerfile.
2637    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2638    pub fn build(&self, context: impl IntoID<DirectoryId>) -> Container {
2639        let mut query = self.selection.select("build");
2640        query = query.arg_lazy(
2641            "context",
2642            Box::new(move || {
2643                let context = context.clone();
2644                Box::pin(async move { context.into_id().await.unwrap().quote() })
2645            }),
2646        );
2647        Container {
2648            proc: self.proc.clone(),
2649            selection: query,
2650            graphql_client: self.graphql_client.clone(),
2651        }
2652    }
2653    /// Initializes this container from a Dockerfile build.
2654    ///
2655    /// # Arguments
2656    ///
2657    /// * `context` - Directory context used by the Dockerfile.
2658    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2659    pub fn build_opts<'a>(
2660        &self,
2661        context: impl IntoID<DirectoryId>,
2662        opts: ContainerBuildOpts<'a>,
2663    ) -> Container {
2664        let mut query = self.selection.select("build");
2665        query = query.arg_lazy(
2666            "context",
2667            Box::new(move || {
2668                let context = context.clone();
2669                Box::pin(async move { context.into_id().await.unwrap().quote() })
2670            }),
2671        );
2672        if let Some(dockerfile) = opts.dockerfile {
2673            query = query.arg("dockerfile", dockerfile);
2674        }
2675        if let Some(target) = opts.target {
2676            query = query.arg("target", target);
2677        }
2678        if let Some(build_args) = opts.build_args {
2679            query = query.arg("buildArgs", build_args);
2680        }
2681        if let Some(secrets) = opts.secrets {
2682            query = query.arg("secrets", secrets);
2683        }
2684        if let Some(no_init) = opts.no_init {
2685            query = query.arg("noInit", no_init);
2686        }
2687        Container {
2688            proc: self.proc.clone(),
2689            selection: query,
2690            graphql_client: self.graphql_client.clone(),
2691        }
2692    }
2693    /// The combined buffered standard output and standard error stream of the last executed command
2694    /// Returns an error if no command was executed
2695    pub async fn combined_output(&self) -> Result<String, DaggerError> {
2696        let query = self.selection.select("combinedOutput");
2697        query.execute(self.graphql_client.clone()).await
2698    }
2699    /// Return the container's default arguments.
2700    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2701        let query = self.selection.select("defaultArgs");
2702        query.execute(self.graphql_client.clone()).await
2703    }
2704    /// Retrieve a directory from the container's root filesystem
2705    /// Mounts are included.
2706    ///
2707    /// # Arguments
2708    ///
2709    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2710    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2711    pub fn directory(&self, path: impl Into<String>) -> Directory {
2712        let mut query = self.selection.select("directory");
2713        query = query.arg("path", path.into());
2714        Directory {
2715            proc: self.proc.clone(),
2716            selection: query,
2717            graphql_client: self.graphql_client.clone(),
2718        }
2719    }
2720    /// Retrieve a directory from the container's root filesystem
2721    /// Mounts are included.
2722    ///
2723    /// # Arguments
2724    ///
2725    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2726    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2727    pub fn directory_opts(
2728        &self,
2729        path: impl Into<String>,
2730        opts: ContainerDirectoryOpts,
2731    ) -> Directory {
2732        let mut query = self.selection.select("directory");
2733        query = query.arg("path", path.into());
2734        if let Some(expand) = opts.expand {
2735            query = query.arg("expand", expand);
2736        }
2737        Directory {
2738            proc: self.proc.clone(),
2739            selection: query,
2740            graphql_client: self.graphql_client.clone(),
2741        }
2742    }
2743    /// Return the container's OCI entrypoint.
2744    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2745        let query = self.selection.select("entrypoint");
2746        query.execute(self.graphql_client.clone()).await
2747    }
2748    /// Retrieves the value of the specified environment variable.
2749    ///
2750    /// # Arguments
2751    ///
2752    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
2753    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2754        let mut query = self.selection.select("envVariable");
2755        query = query.arg("name", name.into());
2756        query.execute(self.graphql_client.clone()).await
2757    }
2758    /// Retrieves the list of environment variables passed to commands.
2759    pub fn env_variables(&self) -> Vec<EnvVariable> {
2760        let query = self.selection.select("envVariables");
2761        vec![EnvVariable {
2762            proc: self.proc.clone(),
2763            selection: query,
2764            graphql_client: self.graphql_client.clone(),
2765        }]
2766    }
2767    /// check if a file or directory exists
2768    ///
2769    /// # Arguments
2770    ///
2771    /// * `path` - Path to check (e.g., "/file.txt").
2772    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2773    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2774        let mut query = self.selection.select("exists");
2775        query = query.arg("path", path.into());
2776        query.execute(self.graphql_client.clone()).await
2777    }
2778    /// check if a file or directory exists
2779    ///
2780    /// # Arguments
2781    ///
2782    /// * `path` - Path to check (e.g., "/file.txt").
2783    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2784    pub async fn exists_opts(
2785        &self,
2786        path: impl Into<String>,
2787        opts: ContainerExistsOpts,
2788    ) -> Result<bool, DaggerError> {
2789        let mut query = self.selection.select("exists");
2790        query = query.arg("path", path.into());
2791        if let Some(expected_type) = opts.expected_type {
2792            query = query.arg("expectedType", expected_type);
2793        }
2794        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2795            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2796        }
2797        query.execute(self.graphql_client.clone()).await
2798    }
2799    /// The exit code of the last executed command
2800    /// Returns an error if no command was executed
2801    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2802        let query = self.selection.select("exitCode");
2803        query.execute(self.graphql_client.clone()).await
2804    }
2805    /// EXPERIMENTAL API! Subject to change/removal at any time.
2806    /// Configures all available GPUs on the host to be accessible to this container.
2807    /// This currently works for Nvidia devices only.
2808    pub fn experimental_with_all_gp_us(&self) -> Container {
2809        let query = self.selection.select("experimentalWithAllGPUs");
2810        Container {
2811            proc: self.proc.clone(),
2812            selection: query,
2813            graphql_client: self.graphql_client.clone(),
2814        }
2815    }
2816    /// EXPERIMENTAL API! Subject to change/removal at any time.
2817    /// Configures the provided list of devices to be accessible to this container.
2818    /// This currently works for Nvidia devices only.
2819    ///
2820    /// # Arguments
2821    ///
2822    /// * `devices` - List of devices to be accessible to this container.
2823    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2824        let mut query = self.selection.select("experimentalWithGPU");
2825        query = query.arg(
2826            "devices",
2827            devices
2828                .into_iter()
2829                .map(|i| i.into())
2830                .collect::<Vec<String>>(),
2831        );
2832        Container {
2833            proc: self.proc.clone(),
2834            selection: query,
2835            graphql_client: self.graphql_client.clone(),
2836        }
2837    }
2838    /// Writes the container as an OCI tarball to the destination file path on the host.
2839    /// It can also export platform variants.
2840    ///
2841    /// # Arguments
2842    ///
2843    /// * `path` - Host's destination path (e.g., "./tarball").
2844    ///
2845    /// Path can be relative to the engine's workdir or absolute.
2846    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2847    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2848        let mut query = self.selection.select("export");
2849        query = query.arg("path", path.into());
2850        query.execute(self.graphql_client.clone()).await
2851    }
2852    /// Writes the container as an OCI tarball to the destination file path on the host.
2853    /// It can also export platform variants.
2854    ///
2855    /// # Arguments
2856    ///
2857    /// * `path` - Host's destination path (e.g., "./tarball").
2858    ///
2859    /// Path can be relative to the engine's workdir or absolute.
2860    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2861    pub async fn export_opts(
2862        &self,
2863        path: impl Into<String>,
2864        opts: ContainerExportOpts,
2865    ) -> Result<String, DaggerError> {
2866        let mut query = self.selection.select("export");
2867        query = query.arg("path", path.into());
2868        if let Some(platform_variants) = opts.platform_variants {
2869            query = query.arg("platformVariants", platform_variants);
2870        }
2871        if let Some(forced_compression) = opts.forced_compression {
2872            query = query.arg("forcedCompression", forced_compression);
2873        }
2874        if let Some(media_types) = opts.media_types {
2875            query = query.arg("mediaTypes", media_types);
2876        }
2877        if let Some(expand) = opts.expand {
2878            query = query.arg("expand", expand);
2879        }
2880        query.execute(self.graphql_client.clone()).await
2881    }
2882    /// Exports the container as an image to the host's container image store.
2883    ///
2884    /// # Arguments
2885    ///
2886    /// * `name` - Name of image to export to in the host's store
2887    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2888    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2889        let mut query = self.selection.select("exportImage");
2890        query = query.arg("name", name.into());
2891        query.execute(self.graphql_client.clone()).await
2892    }
2893    /// Exports the container as an image to the host's container image store.
2894    ///
2895    /// # Arguments
2896    ///
2897    /// * `name` - Name of image to export to in the host's store
2898    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2899    pub async fn export_image_opts(
2900        &self,
2901        name: impl Into<String>,
2902        opts: ContainerExportImageOpts,
2903    ) -> Result<Void, DaggerError> {
2904        let mut query = self.selection.select("exportImage");
2905        query = query.arg("name", name.into());
2906        if let Some(platform_variants) = opts.platform_variants {
2907            query = query.arg("platformVariants", platform_variants);
2908        }
2909        if let Some(forced_compression) = opts.forced_compression {
2910            query = query.arg("forcedCompression", forced_compression);
2911        }
2912        if let Some(media_types) = opts.media_types {
2913            query = query.arg("mediaTypes", media_types);
2914        }
2915        query.execute(self.graphql_client.clone()).await
2916    }
2917    /// Retrieves the list of exposed ports.
2918    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
2919    pub fn exposed_ports(&self) -> Vec<Port> {
2920        let query = self.selection.select("exposedPorts");
2921        vec![Port {
2922            proc: self.proc.clone(),
2923            selection: query,
2924            graphql_client: self.graphql_client.clone(),
2925        }]
2926    }
2927    /// Retrieves a file at the given path.
2928    /// Mounts are included.
2929    ///
2930    /// # Arguments
2931    ///
2932    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2933    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2934    pub fn file(&self, path: impl Into<String>) -> File {
2935        let mut query = self.selection.select("file");
2936        query = query.arg("path", path.into());
2937        File {
2938            proc: self.proc.clone(),
2939            selection: query,
2940            graphql_client: self.graphql_client.clone(),
2941        }
2942    }
2943    /// Retrieves a file at the given path.
2944    /// Mounts are included.
2945    ///
2946    /// # Arguments
2947    ///
2948    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2949    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2950    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2951        let mut query = self.selection.select("file");
2952        query = query.arg("path", path.into());
2953        if let Some(expand) = opts.expand {
2954            query = query.arg("expand", expand);
2955        }
2956        File {
2957            proc: self.proc.clone(),
2958            selection: query,
2959            graphql_client: self.graphql_client.clone(),
2960        }
2961    }
2962    /// Download a container image, and apply it to the container state. All previous state will be lost.
2963    ///
2964    /// # Arguments
2965    ///
2966    /// * `address` - Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
2967    pub fn from(&self, address: impl Into<String>) -> Container {
2968        let mut query = self.selection.select("from");
2969        query = query.arg("address", address.into());
2970        Container {
2971            proc: self.proc.clone(),
2972            selection: query,
2973            graphql_client: self.graphql_client.clone(),
2974        }
2975    }
2976    /// A unique identifier for this Container.
2977    pub async fn id(&self) -> Result<ContainerId, DaggerError> {
2978        let query = self.selection.select("id");
2979        query.execute(self.graphql_client.clone()).await
2980    }
2981    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
2982    pub async fn image_ref(&self) -> Result<String, DaggerError> {
2983        let query = self.selection.select("imageRef");
2984        query.execute(self.graphql_client.clone()).await
2985    }
2986    /// Reads the container from an OCI tarball.
2987    ///
2988    /// # Arguments
2989    ///
2990    /// * `source` - File to read the container from.
2991    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2992    pub fn import(&self, source: impl IntoID<FileId>) -> Container {
2993        let mut query = self.selection.select("import");
2994        query = query.arg_lazy(
2995            "source",
2996            Box::new(move || {
2997                let source = source.clone();
2998                Box::pin(async move { source.into_id().await.unwrap().quote() })
2999            }),
3000        );
3001        Container {
3002            proc: self.proc.clone(),
3003            selection: query,
3004            graphql_client: self.graphql_client.clone(),
3005        }
3006    }
3007    /// Reads the container from an OCI tarball.
3008    ///
3009    /// # Arguments
3010    ///
3011    /// * `source` - File to read the container from.
3012    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3013    pub fn import_opts<'a>(
3014        &self,
3015        source: impl IntoID<FileId>,
3016        opts: ContainerImportOpts<'a>,
3017    ) -> Container {
3018        let mut query = self.selection.select("import");
3019        query = query.arg_lazy(
3020            "source",
3021            Box::new(move || {
3022                let source = source.clone();
3023                Box::pin(async move { source.into_id().await.unwrap().quote() })
3024            }),
3025        );
3026        if let Some(tag) = opts.tag {
3027            query = query.arg("tag", tag);
3028        }
3029        Container {
3030            proc: self.proc.clone(),
3031            selection: query,
3032            graphql_client: self.graphql_client.clone(),
3033        }
3034    }
3035    /// Retrieves the value of the specified label.
3036    ///
3037    /// # Arguments
3038    ///
3039    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3040    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3041        let mut query = self.selection.select("label");
3042        query = query.arg("name", name.into());
3043        query.execute(self.graphql_client.clone()).await
3044    }
3045    /// Retrieves the list of labels passed to container.
3046    pub fn labels(&self) -> Vec<Label> {
3047        let query = self.selection.select("labels");
3048        vec![Label {
3049            proc: self.proc.clone(),
3050            selection: query,
3051            graphql_client: self.graphql_client.clone(),
3052        }]
3053    }
3054    /// Retrieves the list of paths where a directory is mounted.
3055    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
3056        let query = self.selection.select("mounts");
3057        query.execute(self.graphql_client.clone()).await
3058    }
3059    /// The platform this container executes and publishes as.
3060    pub async fn platform(&self) -> Result<Platform, DaggerError> {
3061        let query = self.selection.select("platform");
3062        query.execute(self.graphql_client.clone()).await
3063    }
3064    /// Package the container state as an OCI image, and publish it to a registry
3065    /// Returns the fully qualified address of the published image, with digest
3066    ///
3067    /// # Arguments
3068    ///
3069    /// * `address` - The OCI address to publish to
3070    ///
3071    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
3072    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3073    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
3074        let mut query = self.selection.select("publish");
3075        query = query.arg("address", address.into());
3076        query.execute(self.graphql_client.clone()).await
3077    }
3078    /// Package the container state as an OCI image, and publish it to a registry
3079    /// Returns the fully qualified address of the published image, with digest
3080    ///
3081    /// # Arguments
3082    ///
3083    /// * `address` - The OCI address to publish to
3084    ///
3085    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
3086    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3087    pub async fn publish_opts(
3088        &self,
3089        address: impl Into<String>,
3090        opts: ContainerPublishOpts,
3091    ) -> Result<String, DaggerError> {
3092        let mut query = self.selection.select("publish");
3093        query = query.arg("address", address.into());
3094        if let Some(platform_variants) = opts.platform_variants {
3095            query = query.arg("platformVariants", platform_variants);
3096        }
3097        if let Some(forced_compression) = opts.forced_compression {
3098            query = query.arg("forcedCompression", forced_compression);
3099        }
3100        if let Some(media_types) = opts.media_types {
3101            query = query.arg("mediaTypes", media_types);
3102        }
3103        query.execute(self.graphql_client.clone()).await
3104    }
3105    /// 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.
3106    pub fn rootfs(&self) -> Directory {
3107        let query = self.selection.select("rootfs");
3108        Directory {
3109            proc: self.proc.clone(),
3110            selection: query,
3111            graphql_client: self.graphql_client.clone(),
3112        }
3113    }
3114    /// The buffered standard error stream of the last executed command
3115    /// Returns an error if no command was executed
3116    pub async fn stderr(&self) -> Result<String, DaggerError> {
3117        let query = self.selection.select("stderr");
3118        query.execute(self.graphql_client.clone()).await
3119    }
3120    /// The buffered standard output stream of the last executed command
3121    /// Returns an error if no command was executed
3122    pub async fn stdout(&self) -> Result<String, DaggerError> {
3123        let query = self.selection.select("stdout");
3124        query.execute(self.graphql_client.clone()).await
3125    }
3126    /// Forces evaluation of the pipeline in the engine.
3127    /// It doesn't run the default command if no exec has been set.
3128    pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
3129        let query = self.selection.select("sync");
3130        query.execute(self.graphql_client.clone()).await
3131    }
3132    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
3133    ///
3134    /// # Arguments
3135    ///
3136    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3137    pub fn terminal(&self) -> Container {
3138        let query = self.selection.select("terminal");
3139        Container {
3140            proc: self.proc.clone(),
3141            selection: query,
3142            graphql_client: self.graphql_client.clone(),
3143        }
3144    }
3145    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
3146    ///
3147    /// # Arguments
3148    ///
3149    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3150    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
3151        let mut query = self.selection.select("terminal");
3152        if let Some(cmd) = opts.cmd {
3153            query = query.arg("cmd", cmd);
3154        }
3155        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3156            query = query.arg(
3157                "experimentalPrivilegedNesting",
3158                experimental_privileged_nesting,
3159            );
3160        }
3161        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3162            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3163        }
3164        Container {
3165            proc: self.proc.clone(),
3166            selection: query,
3167            graphql_client: self.graphql_client.clone(),
3168        }
3169    }
3170    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3171    /// Be sure to set any exposed ports before calling this api.
3172    ///
3173    /// # Arguments
3174    ///
3175    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3176    pub async fn up(&self) -> Result<Void, DaggerError> {
3177        let query = self.selection.select("up");
3178        query.execute(self.graphql_client.clone()).await
3179    }
3180    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3181    /// Be sure to set any exposed ports before calling this api.
3182    ///
3183    /// # Arguments
3184    ///
3185    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3186    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
3187        let mut query = self.selection.select("up");
3188        if let Some(random) = opts.random {
3189            query = query.arg("random", random);
3190        }
3191        if let Some(ports) = opts.ports {
3192            query = query.arg("ports", ports);
3193        }
3194        if let Some(args) = opts.args {
3195            query = query.arg("args", args);
3196        }
3197        if let Some(use_entrypoint) = opts.use_entrypoint {
3198            query = query.arg("useEntrypoint", use_entrypoint);
3199        }
3200        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3201            query = query.arg(
3202                "experimentalPrivilegedNesting",
3203                experimental_privileged_nesting,
3204            );
3205        }
3206        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3207            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3208        }
3209        if let Some(expand) = opts.expand {
3210            query = query.arg("expand", expand);
3211        }
3212        if let Some(no_init) = opts.no_init {
3213            query = query.arg("noInit", no_init);
3214        }
3215        query.execute(self.graphql_client.clone()).await
3216    }
3217    /// Retrieves the user to be set for all commands.
3218    pub async fn user(&self) -> Result<String, DaggerError> {
3219        let query = self.selection.select("user");
3220        query.execute(self.graphql_client.clone()).await
3221    }
3222    /// Retrieves this container plus the given OCI anotation.
3223    ///
3224    /// # Arguments
3225    ///
3226    /// * `name` - The name of the annotation.
3227    /// * `value` - The value of the annotation.
3228    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3229        let mut query = self.selection.select("withAnnotation");
3230        query = query.arg("name", name.into());
3231        query = query.arg("value", value.into());
3232        Container {
3233            proc: self.proc.clone(),
3234            selection: query,
3235            graphql_client: self.graphql_client.clone(),
3236        }
3237    }
3238    /// Configures default arguments for future commands. Like CMD in Dockerfile.
3239    ///
3240    /// # Arguments
3241    ///
3242    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
3243    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
3244        let mut query = self.selection.select("withDefaultArgs");
3245        query = query.arg(
3246            "args",
3247            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3248        );
3249        Container {
3250            proc: self.proc.clone(),
3251            selection: query,
3252            graphql_client: self.graphql_client.clone(),
3253        }
3254    }
3255    /// Set the default command to invoke for the container's terminal API.
3256    ///
3257    /// # Arguments
3258    ///
3259    /// * `args` - The args of the command.
3260    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3261    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
3262        let mut query = self.selection.select("withDefaultTerminalCmd");
3263        query = query.arg(
3264            "args",
3265            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3266        );
3267        Container {
3268            proc: self.proc.clone(),
3269            selection: query,
3270            graphql_client: self.graphql_client.clone(),
3271        }
3272    }
3273    /// Set the default command to invoke for the container's terminal API.
3274    ///
3275    /// # Arguments
3276    ///
3277    /// * `args` - The args of the command.
3278    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3279    pub fn with_default_terminal_cmd_opts(
3280        &self,
3281        args: Vec<impl Into<String>>,
3282        opts: ContainerWithDefaultTerminalCmdOpts,
3283    ) -> Container {
3284        let mut query = self.selection.select("withDefaultTerminalCmd");
3285        query = query.arg(
3286            "args",
3287            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3288        );
3289        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3290            query = query.arg(
3291                "experimentalPrivilegedNesting",
3292                experimental_privileged_nesting,
3293            );
3294        }
3295        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3296            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3297        }
3298        Container {
3299            proc: self.proc.clone(),
3300            selection: query,
3301            graphql_client: self.graphql_client.clone(),
3302        }
3303    }
3304    /// Return a new container snapshot, with a directory added to its filesystem
3305    ///
3306    /// # Arguments
3307    ///
3308    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
3309    /// * `directory` - Identifier of the directory to write
3310    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3311    pub fn with_directory(
3312        &self,
3313        path: impl Into<String>,
3314        directory: impl IntoID<DirectoryId>,
3315    ) -> Container {
3316        let mut query = self.selection.select("withDirectory");
3317        query = query.arg("path", path.into());
3318        query = query.arg_lazy(
3319            "directory",
3320            Box::new(move || {
3321                let directory = directory.clone();
3322                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3323            }),
3324        );
3325        Container {
3326            proc: self.proc.clone(),
3327            selection: query,
3328            graphql_client: self.graphql_client.clone(),
3329        }
3330    }
3331    /// Return a new container snapshot, with a directory added to its filesystem
3332    ///
3333    /// # Arguments
3334    ///
3335    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
3336    /// * `directory` - Identifier of the directory to write
3337    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3338    pub fn with_directory_opts<'a>(
3339        &self,
3340        path: impl Into<String>,
3341        directory: impl IntoID<DirectoryId>,
3342        opts: ContainerWithDirectoryOpts<'a>,
3343    ) -> Container {
3344        let mut query = self.selection.select("withDirectory");
3345        query = query.arg("path", path.into());
3346        query = query.arg_lazy(
3347            "directory",
3348            Box::new(move || {
3349                let directory = directory.clone();
3350                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3351            }),
3352        );
3353        if let Some(exclude) = opts.exclude {
3354            query = query.arg("exclude", exclude);
3355        }
3356        if let Some(include) = opts.include {
3357            query = query.arg("include", include);
3358        }
3359        if let Some(owner) = opts.owner {
3360            query = query.arg("owner", owner);
3361        }
3362        if let Some(expand) = opts.expand {
3363            query = query.arg("expand", expand);
3364        }
3365        Container {
3366            proc: self.proc.clone(),
3367            selection: query,
3368            graphql_client: self.graphql_client.clone(),
3369        }
3370    }
3371    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
3372    ///
3373    /// # Arguments
3374    ///
3375    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
3376    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3377    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
3378        let mut query = self.selection.select("withEntrypoint");
3379        query = query.arg(
3380            "args",
3381            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3382        );
3383        Container {
3384            proc: self.proc.clone(),
3385            selection: query,
3386            graphql_client: self.graphql_client.clone(),
3387        }
3388    }
3389    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
3390    ///
3391    /// # Arguments
3392    ///
3393    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
3394    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3395    pub fn with_entrypoint_opts(
3396        &self,
3397        args: Vec<impl Into<String>>,
3398        opts: ContainerWithEntrypointOpts,
3399    ) -> Container {
3400        let mut query = self.selection.select("withEntrypoint");
3401        query = query.arg(
3402            "args",
3403            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3404        );
3405        if let Some(keep_default_args) = opts.keep_default_args {
3406            query = query.arg("keepDefaultArgs", keep_default_args);
3407        }
3408        Container {
3409            proc: self.proc.clone(),
3410            selection: query,
3411            graphql_client: self.graphql_client.clone(),
3412        }
3413    }
3414    /// Set a new environment variable in the container.
3415    ///
3416    /// # Arguments
3417    ///
3418    /// * `name` - Name of the environment variable (e.g., "HOST").
3419    /// * `value` - Value of the environment variable. (e.g., "localhost").
3420    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3421    pub fn with_env_variable(
3422        &self,
3423        name: impl Into<String>,
3424        value: impl Into<String>,
3425    ) -> Container {
3426        let mut query = self.selection.select("withEnvVariable");
3427        query = query.arg("name", name.into());
3428        query = query.arg("value", value.into());
3429        Container {
3430            proc: self.proc.clone(),
3431            selection: query,
3432            graphql_client: self.graphql_client.clone(),
3433        }
3434    }
3435    /// Set a new environment variable in the container.
3436    ///
3437    /// # Arguments
3438    ///
3439    /// * `name` - Name of the environment variable (e.g., "HOST").
3440    /// * `value` - Value of the environment variable. (e.g., "localhost").
3441    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3442    pub fn with_env_variable_opts(
3443        &self,
3444        name: impl Into<String>,
3445        value: impl Into<String>,
3446        opts: ContainerWithEnvVariableOpts,
3447    ) -> Container {
3448        let mut query = self.selection.select("withEnvVariable");
3449        query = query.arg("name", name.into());
3450        query = query.arg("value", value.into());
3451        if let Some(expand) = opts.expand {
3452            query = query.arg("expand", expand);
3453        }
3454        Container {
3455            proc: self.proc.clone(),
3456            selection: query,
3457            graphql_client: self.graphql_client.clone(),
3458        }
3459    }
3460    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3461    ///
3462    /// # Arguments
3463    ///
3464    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3465    ///
3466    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3467    ///
3468    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3469    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3470    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3471        let mut query = self.selection.select("withExec");
3472        query = query.arg(
3473            "args",
3474            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3475        );
3476        Container {
3477            proc: self.proc.clone(),
3478            selection: query,
3479            graphql_client: self.graphql_client.clone(),
3480        }
3481    }
3482    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3483    ///
3484    /// # Arguments
3485    ///
3486    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3487    ///
3488    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3489    ///
3490    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3491    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3492    pub fn with_exec_opts<'a>(
3493        &self,
3494        args: Vec<impl Into<String>>,
3495        opts: ContainerWithExecOpts<'a>,
3496    ) -> Container {
3497        let mut query = self.selection.select("withExec");
3498        query = query.arg(
3499            "args",
3500            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3501        );
3502        if let Some(use_entrypoint) = opts.use_entrypoint {
3503            query = query.arg("useEntrypoint", use_entrypoint);
3504        }
3505        if let Some(stdin) = opts.stdin {
3506            query = query.arg("stdin", stdin);
3507        }
3508        if let Some(redirect_stdin) = opts.redirect_stdin {
3509            query = query.arg("redirectStdin", redirect_stdin);
3510        }
3511        if let Some(redirect_stdout) = opts.redirect_stdout {
3512            query = query.arg("redirectStdout", redirect_stdout);
3513        }
3514        if let Some(redirect_stderr) = opts.redirect_stderr {
3515            query = query.arg("redirectStderr", redirect_stderr);
3516        }
3517        if let Some(expect) = opts.expect {
3518            query = query.arg("expect", expect);
3519        }
3520        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3521            query = query.arg(
3522                "experimentalPrivilegedNesting",
3523                experimental_privileged_nesting,
3524            );
3525        }
3526        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3527            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3528        }
3529        if let Some(expand) = opts.expand {
3530            query = query.arg("expand", expand);
3531        }
3532        if let Some(no_init) = opts.no_init {
3533            query = query.arg("noInit", no_init);
3534        }
3535        Container {
3536            proc: self.proc.clone(),
3537            selection: query,
3538            graphql_client: self.graphql_client.clone(),
3539        }
3540    }
3541    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3542    /// Exposed ports serve two purposes:
3543    /// - For health checks and introspection, when running services
3544    /// - For setting the EXPOSE OCI field when publishing the container
3545    ///
3546    /// # Arguments
3547    ///
3548    /// * `port` - Port number to expose. Example: 8080
3549    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3550    pub fn with_exposed_port(&self, port: isize) -> Container {
3551        let mut query = self.selection.select("withExposedPort");
3552        query = query.arg("port", port);
3553        Container {
3554            proc: self.proc.clone(),
3555            selection: query,
3556            graphql_client: self.graphql_client.clone(),
3557        }
3558    }
3559    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3560    /// Exposed ports serve two purposes:
3561    /// - For health checks and introspection, when running services
3562    /// - For setting the EXPOSE OCI field when publishing the container
3563    ///
3564    /// # Arguments
3565    ///
3566    /// * `port` - Port number to expose. Example: 8080
3567    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3568    pub fn with_exposed_port_opts<'a>(
3569        &self,
3570        port: isize,
3571        opts: ContainerWithExposedPortOpts<'a>,
3572    ) -> Container {
3573        let mut query = self.selection.select("withExposedPort");
3574        query = query.arg("port", port);
3575        if let Some(protocol) = opts.protocol {
3576            query = query.arg("protocol", protocol);
3577        }
3578        if let Some(description) = opts.description {
3579            query = query.arg("description", description);
3580        }
3581        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3582            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3583        }
3584        Container {
3585            proc: self.proc.clone(),
3586            selection: query,
3587            graphql_client: self.graphql_client.clone(),
3588        }
3589    }
3590    /// Return a container snapshot with a file added
3591    ///
3592    /// # Arguments
3593    ///
3594    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3595    /// * `source` - File to add
3596    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3597    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
3598        let mut query = self.selection.select("withFile");
3599        query = query.arg("path", path.into());
3600        query = query.arg_lazy(
3601            "source",
3602            Box::new(move || {
3603                let source = source.clone();
3604                Box::pin(async move { source.into_id().await.unwrap().quote() })
3605            }),
3606        );
3607        Container {
3608            proc: self.proc.clone(),
3609            selection: query,
3610            graphql_client: self.graphql_client.clone(),
3611        }
3612    }
3613    /// Return a container snapshot with a file added
3614    ///
3615    /// # Arguments
3616    ///
3617    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3618    /// * `source` - File to add
3619    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3620    pub fn with_file_opts<'a>(
3621        &self,
3622        path: impl Into<String>,
3623        source: impl IntoID<FileId>,
3624        opts: ContainerWithFileOpts<'a>,
3625    ) -> Container {
3626        let mut query = self.selection.select("withFile");
3627        query = query.arg("path", path.into());
3628        query = query.arg_lazy(
3629            "source",
3630            Box::new(move || {
3631                let source = source.clone();
3632                Box::pin(async move { source.into_id().await.unwrap().quote() })
3633            }),
3634        );
3635        if let Some(permissions) = opts.permissions {
3636            query = query.arg("permissions", permissions);
3637        }
3638        if let Some(owner) = opts.owner {
3639            query = query.arg("owner", owner);
3640        }
3641        if let Some(expand) = opts.expand {
3642            query = query.arg("expand", expand);
3643        }
3644        Container {
3645            proc: self.proc.clone(),
3646            selection: query,
3647            graphql_client: self.graphql_client.clone(),
3648        }
3649    }
3650    /// Retrieves this container plus the contents of the given files copied to the given path.
3651    ///
3652    /// # Arguments
3653    ///
3654    /// * `path` - Location where copied files should be placed (e.g., "/src").
3655    /// * `sources` - Identifiers of the files to copy.
3656    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3657    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
3658        let mut query = self.selection.select("withFiles");
3659        query = query.arg("path", path.into());
3660        query = query.arg("sources", sources);
3661        Container {
3662            proc: self.proc.clone(),
3663            selection: query,
3664            graphql_client: self.graphql_client.clone(),
3665        }
3666    }
3667    /// Retrieves this container plus the contents of the given files copied to the given path.
3668    ///
3669    /// # Arguments
3670    ///
3671    /// * `path` - Location where copied files should be placed (e.g., "/src").
3672    /// * `sources` - Identifiers of the files to copy.
3673    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3674    pub fn with_files_opts<'a>(
3675        &self,
3676        path: impl Into<String>,
3677        sources: Vec<FileId>,
3678        opts: ContainerWithFilesOpts<'a>,
3679    ) -> Container {
3680        let mut query = self.selection.select("withFiles");
3681        query = query.arg("path", path.into());
3682        query = query.arg("sources", sources);
3683        if let Some(permissions) = opts.permissions {
3684            query = query.arg("permissions", permissions);
3685        }
3686        if let Some(owner) = opts.owner {
3687            query = query.arg("owner", owner);
3688        }
3689        if let Some(expand) = opts.expand {
3690            query = query.arg("expand", expand);
3691        }
3692        Container {
3693            proc: self.proc.clone(),
3694            selection: query,
3695            graphql_client: self.graphql_client.clone(),
3696        }
3697    }
3698    /// Retrieves this container plus the given label.
3699    ///
3700    /// # Arguments
3701    ///
3702    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3703    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
3704    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3705        let mut query = self.selection.select("withLabel");
3706        query = query.arg("name", name.into());
3707        query = query.arg("value", value.into());
3708        Container {
3709            proc: self.proc.clone(),
3710            selection: query,
3711            graphql_client: self.graphql_client.clone(),
3712        }
3713    }
3714    /// Retrieves this container plus a cache volume mounted at the given path.
3715    ///
3716    /// # Arguments
3717    ///
3718    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3719    /// * `cache` - Identifier of the cache volume to mount.
3720    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3721    pub fn with_mounted_cache(
3722        &self,
3723        path: impl Into<String>,
3724        cache: impl IntoID<CacheVolumeId>,
3725    ) -> Container {
3726        let mut query = self.selection.select("withMountedCache");
3727        query = query.arg("path", path.into());
3728        query = query.arg_lazy(
3729            "cache",
3730            Box::new(move || {
3731                let cache = cache.clone();
3732                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3733            }),
3734        );
3735        Container {
3736            proc: self.proc.clone(),
3737            selection: query,
3738            graphql_client: self.graphql_client.clone(),
3739        }
3740    }
3741    /// Retrieves this container plus a cache volume mounted at the given path.
3742    ///
3743    /// # Arguments
3744    ///
3745    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3746    /// * `cache` - Identifier of the cache volume to mount.
3747    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3748    pub fn with_mounted_cache_opts<'a>(
3749        &self,
3750        path: impl Into<String>,
3751        cache: impl IntoID<CacheVolumeId>,
3752        opts: ContainerWithMountedCacheOpts<'a>,
3753    ) -> Container {
3754        let mut query = self.selection.select("withMountedCache");
3755        query = query.arg("path", path.into());
3756        query = query.arg_lazy(
3757            "cache",
3758            Box::new(move || {
3759                let cache = cache.clone();
3760                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3761            }),
3762        );
3763        if let Some(source) = opts.source {
3764            query = query.arg("source", source);
3765        }
3766        if let Some(sharing) = opts.sharing {
3767            query = query.arg("sharing", sharing);
3768        }
3769        if let Some(owner) = opts.owner {
3770            query = query.arg("owner", owner);
3771        }
3772        if let Some(expand) = opts.expand {
3773            query = query.arg("expand", expand);
3774        }
3775        Container {
3776            proc: self.proc.clone(),
3777            selection: query,
3778            graphql_client: self.graphql_client.clone(),
3779        }
3780    }
3781    /// Retrieves this container plus a directory mounted at the given path.
3782    ///
3783    /// # Arguments
3784    ///
3785    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3786    /// * `source` - Identifier of the mounted directory.
3787    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3788    pub fn with_mounted_directory(
3789        &self,
3790        path: impl Into<String>,
3791        source: impl IntoID<DirectoryId>,
3792    ) -> Container {
3793        let mut query = self.selection.select("withMountedDirectory");
3794        query = query.arg("path", path.into());
3795        query = query.arg_lazy(
3796            "source",
3797            Box::new(move || {
3798                let source = source.clone();
3799                Box::pin(async move { source.into_id().await.unwrap().quote() })
3800            }),
3801        );
3802        Container {
3803            proc: self.proc.clone(),
3804            selection: query,
3805            graphql_client: self.graphql_client.clone(),
3806        }
3807    }
3808    /// Retrieves this container plus a directory mounted at the given path.
3809    ///
3810    /// # Arguments
3811    ///
3812    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3813    /// * `source` - Identifier of the mounted directory.
3814    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3815    pub fn with_mounted_directory_opts<'a>(
3816        &self,
3817        path: impl Into<String>,
3818        source: impl IntoID<DirectoryId>,
3819        opts: ContainerWithMountedDirectoryOpts<'a>,
3820    ) -> Container {
3821        let mut query = self.selection.select("withMountedDirectory");
3822        query = query.arg("path", path.into());
3823        query = query.arg_lazy(
3824            "source",
3825            Box::new(move || {
3826                let source = source.clone();
3827                Box::pin(async move { source.into_id().await.unwrap().quote() })
3828            }),
3829        );
3830        if let Some(owner) = opts.owner {
3831            query = query.arg("owner", owner);
3832        }
3833        if let Some(expand) = opts.expand {
3834            query = query.arg("expand", expand);
3835        }
3836        Container {
3837            proc: self.proc.clone(),
3838            selection: query,
3839            graphql_client: self.graphql_client.clone(),
3840        }
3841    }
3842    /// Retrieves this container plus a file mounted at the given path.
3843    ///
3844    /// # Arguments
3845    ///
3846    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3847    /// * `source` - Identifier of the mounted file.
3848    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3849    pub fn with_mounted_file(
3850        &self,
3851        path: impl Into<String>,
3852        source: impl IntoID<FileId>,
3853    ) -> Container {
3854        let mut query = self.selection.select("withMountedFile");
3855        query = query.arg("path", path.into());
3856        query = query.arg_lazy(
3857            "source",
3858            Box::new(move || {
3859                let source = source.clone();
3860                Box::pin(async move { source.into_id().await.unwrap().quote() })
3861            }),
3862        );
3863        Container {
3864            proc: self.proc.clone(),
3865            selection: query,
3866            graphql_client: self.graphql_client.clone(),
3867        }
3868    }
3869    /// Retrieves this container plus a file mounted at the given path.
3870    ///
3871    /// # Arguments
3872    ///
3873    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3874    /// * `source` - Identifier of the mounted file.
3875    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3876    pub fn with_mounted_file_opts<'a>(
3877        &self,
3878        path: impl Into<String>,
3879        source: impl IntoID<FileId>,
3880        opts: ContainerWithMountedFileOpts<'a>,
3881    ) -> Container {
3882        let mut query = self.selection.select("withMountedFile");
3883        query = query.arg("path", path.into());
3884        query = query.arg_lazy(
3885            "source",
3886            Box::new(move || {
3887                let source = source.clone();
3888                Box::pin(async move { source.into_id().await.unwrap().quote() })
3889            }),
3890        );
3891        if let Some(owner) = opts.owner {
3892            query = query.arg("owner", owner);
3893        }
3894        if let Some(expand) = opts.expand {
3895            query = query.arg("expand", expand);
3896        }
3897        Container {
3898            proc: self.proc.clone(),
3899            selection: query,
3900            graphql_client: self.graphql_client.clone(),
3901        }
3902    }
3903    /// Retrieves this container plus a secret mounted into a file at the given path.
3904    ///
3905    /// # Arguments
3906    ///
3907    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3908    /// * `source` - Identifier of the secret to mount.
3909    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3910    pub fn with_mounted_secret(
3911        &self,
3912        path: impl Into<String>,
3913        source: impl IntoID<SecretId>,
3914    ) -> Container {
3915        let mut query = self.selection.select("withMountedSecret");
3916        query = query.arg("path", path.into());
3917        query = query.arg_lazy(
3918            "source",
3919            Box::new(move || {
3920                let source = source.clone();
3921                Box::pin(async move { source.into_id().await.unwrap().quote() })
3922            }),
3923        );
3924        Container {
3925            proc: self.proc.clone(),
3926            selection: query,
3927            graphql_client: self.graphql_client.clone(),
3928        }
3929    }
3930    /// Retrieves this container plus a secret mounted into a file at the given path.
3931    ///
3932    /// # Arguments
3933    ///
3934    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3935    /// * `source` - Identifier of the secret to mount.
3936    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3937    pub fn with_mounted_secret_opts<'a>(
3938        &self,
3939        path: impl Into<String>,
3940        source: impl IntoID<SecretId>,
3941        opts: ContainerWithMountedSecretOpts<'a>,
3942    ) -> Container {
3943        let mut query = self.selection.select("withMountedSecret");
3944        query = query.arg("path", path.into());
3945        query = query.arg_lazy(
3946            "source",
3947            Box::new(move || {
3948                let source = source.clone();
3949                Box::pin(async move { source.into_id().await.unwrap().quote() })
3950            }),
3951        );
3952        if let Some(owner) = opts.owner {
3953            query = query.arg("owner", owner);
3954        }
3955        if let Some(mode) = opts.mode {
3956            query = query.arg("mode", mode);
3957        }
3958        if let Some(expand) = opts.expand {
3959            query = query.arg("expand", expand);
3960        }
3961        Container {
3962            proc: self.proc.clone(),
3963            selection: query,
3964            graphql_client: self.graphql_client.clone(),
3965        }
3966    }
3967    /// 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.
3968    ///
3969    /// # Arguments
3970    ///
3971    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3972    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3973    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3974        let mut query = self.selection.select("withMountedTemp");
3975        query = query.arg("path", path.into());
3976        Container {
3977            proc: self.proc.clone(),
3978            selection: query,
3979            graphql_client: self.graphql_client.clone(),
3980        }
3981    }
3982    /// 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.
3983    ///
3984    /// # Arguments
3985    ///
3986    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3987    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3988    pub fn with_mounted_temp_opts(
3989        &self,
3990        path: impl Into<String>,
3991        opts: ContainerWithMountedTempOpts,
3992    ) -> Container {
3993        let mut query = self.selection.select("withMountedTemp");
3994        query = query.arg("path", path.into());
3995        if let Some(size) = opts.size {
3996            query = query.arg("size", size);
3997        }
3998        if let Some(expand) = opts.expand {
3999            query = query.arg("expand", expand);
4000        }
4001        Container {
4002            proc: self.proc.clone(),
4003            selection: query,
4004            graphql_client: self.graphql_client.clone(),
4005        }
4006    }
4007    /// Return a new container snapshot, with a file added to its filesystem with text content
4008    ///
4009    /// # Arguments
4010    ///
4011    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4012    /// * `contents` - Contents of the new file. Example: "Hello world!"
4013    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4014    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
4015        let mut query = self.selection.select("withNewFile");
4016        query = query.arg("path", path.into());
4017        query = query.arg("contents", contents.into());
4018        Container {
4019            proc: self.proc.clone(),
4020            selection: query,
4021            graphql_client: self.graphql_client.clone(),
4022        }
4023    }
4024    /// Return a new container snapshot, with a file added to its filesystem with text content
4025    ///
4026    /// # Arguments
4027    ///
4028    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4029    /// * `contents` - Contents of the new file. Example: "Hello world!"
4030    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4031    pub fn with_new_file_opts<'a>(
4032        &self,
4033        path: impl Into<String>,
4034        contents: impl Into<String>,
4035        opts: ContainerWithNewFileOpts<'a>,
4036    ) -> Container {
4037        let mut query = self.selection.select("withNewFile");
4038        query = query.arg("path", path.into());
4039        query = query.arg("contents", contents.into());
4040        if let Some(permissions) = opts.permissions {
4041            query = query.arg("permissions", permissions);
4042        }
4043        if let Some(owner) = opts.owner {
4044            query = query.arg("owner", owner);
4045        }
4046        if let Some(expand) = opts.expand {
4047            query = query.arg("expand", expand);
4048        }
4049        Container {
4050            proc: self.proc.clone(),
4051            selection: query,
4052            graphql_client: self.graphql_client.clone(),
4053        }
4054    }
4055    /// Attach credentials for future publishing to a registry. Use in combination with publish
4056    ///
4057    /// # Arguments
4058    ///
4059    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
4060    /// * `username` - The username to authenticate with. Example: "alice"
4061    /// * `secret` - The API key, password or token to authenticate to this registry
4062    pub fn with_registry_auth(
4063        &self,
4064        address: impl Into<String>,
4065        username: impl Into<String>,
4066        secret: impl IntoID<SecretId>,
4067    ) -> Container {
4068        let mut query = self.selection.select("withRegistryAuth");
4069        query = query.arg("address", address.into());
4070        query = query.arg("username", username.into());
4071        query = query.arg_lazy(
4072            "secret",
4073            Box::new(move || {
4074                let secret = secret.clone();
4075                Box::pin(async move { secret.into_id().await.unwrap().quote() })
4076            }),
4077        );
4078        Container {
4079            proc: self.proc.clone(),
4080            selection: query,
4081            graphql_client: self.graphql_client.clone(),
4082        }
4083    }
4084    /// Change the container's root filesystem. The previous root filesystem will be lost.
4085    ///
4086    /// # Arguments
4087    ///
4088    /// * `directory` - The new root filesystem.
4089    pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
4090        let mut query = self.selection.select("withRootfs");
4091        query = query.arg_lazy(
4092            "directory",
4093            Box::new(move || {
4094                let directory = directory.clone();
4095                Box::pin(async move { directory.into_id().await.unwrap().quote() })
4096            }),
4097        );
4098        Container {
4099            proc: self.proc.clone(),
4100            selection: query,
4101            graphql_client: self.graphql_client.clone(),
4102        }
4103    }
4104    /// Set a new environment variable, using a secret value
4105    ///
4106    /// # Arguments
4107    ///
4108    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
4109    /// * `secret` - Identifier of the secret value.
4110    pub fn with_secret_variable(
4111        &self,
4112        name: impl Into<String>,
4113        secret: impl IntoID<SecretId>,
4114    ) -> Container {
4115        let mut query = self.selection.select("withSecretVariable");
4116        query = query.arg("name", name.into());
4117        query = query.arg_lazy(
4118            "secret",
4119            Box::new(move || {
4120                let secret = secret.clone();
4121                Box::pin(async move { secret.into_id().await.unwrap().quote() })
4122            }),
4123        );
4124        Container {
4125            proc: self.proc.clone(),
4126            selection: query,
4127            graphql_client: self.graphql_client.clone(),
4128        }
4129    }
4130    /// Establish a runtime dependency from a container to a network service.
4131    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
4132    /// The service will be reachable from the container via the provided hostname alias.
4133    /// The service dependency will also convey to any files or directories produced by the container.
4134    ///
4135    /// # Arguments
4136    ///
4137    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
4138    /// * `service` - The target service
4139    pub fn with_service_binding(
4140        &self,
4141        alias: impl Into<String>,
4142        service: impl IntoID<ServiceId>,
4143    ) -> Container {
4144        let mut query = self.selection.select("withServiceBinding");
4145        query = query.arg("alias", alias.into());
4146        query = query.arg_lazy(
4147            "service",
4148            Box::new(move || {
4149                let service = service.clone();
4150                Box::pin(async move { service.into_id().await.unwrap().quote() })
4151            }),
4152        );
4153        Container {
4154            proc: self.proc.clone(),
4155            selection: query,
4156            graphql_client: self.graphql_client.clone(),
4157        }
4158    }
4159    /// Return a snapshot with a symlink
4160    ///
4161    /// # Arguments
4162    ///
4163    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4164    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4165    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4166    pub fn with_symlink(
4167        &self,
4168        target: impl Into<String>,
4169        link_name: impl Into<String>,
4170    ) -> Container {
4171        let mut query = self.selection.select("withSymlink");
4172        query = query.arg("target", target.into());
4173        query = query.arg("linkName", link_name.into());
4174        Container {
4175            proc: self.proc.clone(),
4176            selection: query,
4177            graphql_client: self.graphql_client.clone(),
4178        }
4179    }
4180    /// Return a snapshot with a symlink
4181    ///
4182    /// # Arguments
4183    ///
4184    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4185    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4186    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4187    pub fn with_symlink_opts(
4188        &self,
4189        target: impl Into<String>,
4190        link_name: impl Into<String>,
4191        opts: ContainerWithSymlinkOpts,
4192    ) -> Container {
4193        let mut query = self.selection.select("withSymlink");
4194        query = query.arg("target", target.into());
4195        query = query.arg("linkName", link_name.into());
4196        if let Some(expand) = opts.expand {
4197            query = query.arg("expand", expand);
4198        }
4199        Container {
4200            proc: self.proc.clone(),
4201            selection: query,
4202            graphql_client: self.graphql_client.clone(),
4203        }
4204    }
4205    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4206    ///
4207    /// # Arguments
4208    ///
4209    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4210    /// * `source` - Identifier of the socket to forward.
4211    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4212    pub fn with_unix_socket(
4213        &self,
4214        path: impl Into<String>,
4215        source: impl IntoID<SocketId>,
4216    ) -> Container {
4217        let mut query = self.selection.select("withUnixSocket");
4218        query = query.arg("path", path.into());
4219        query = query.arg_lazy(
4220            "source",
4221            Box::new(move || {
4222                let source = source.clone();
4223                Box::pin(async move { source.into_id().await.unwrap().quote() })
4224            }),
4225        );
4226        Container {
4227            proc: self.proc.clone(),
4228            selection: query,
4229            graphql_client: self.graphql_client.clone(),
4230        }
4231    }
4232    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4233    ///
4234    /// # Arguments
4235    ///
4236    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4237    /// * `source` - Identifier of the socket to forward.
4238    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4239    pub fn with_unix_socket_opts<'a>(
4240        &self,
4241        path: impl Into<String>,
4242        source: impl IntoID<SocketId>,
4243        opts: ContainerWithUnixSocketOpts<'a>,
4244    ) -> Container {
4245        let mut query = self.selection.select("withUnixSocket");
4246        query = query.arg("path", path.into());
4247        query = query.arg_lazy(
4248            "source",
4249            Box::new(move || {
4250                let source = source.clone();
4251                Box::pin(async move { source.into_id().await.unwrap().quote() })
4252            }),
4253        );
4254        if let Some(owner) = opts.owner {
4255            query = query.arg("owner", owner);
4256        }
4257        if let Some(expand) = opts.expand {
4258            query = query.arg("expand", expand);
4259        }
4260        Container {
4261            proc: self.proc.clone(),
4262            selection: query,
4263            graphql_client: self.graphql_client.clone(),
4264        }
4265    }
4266    /// Retrieves this container with a different command user.
4267    ///
4268    /// # Arguments
4269    ///
4270    /// * `name` - The user to set (e.g., "root").
4271    pub fn with_user(&self, name: impl Into<String>) -> Container {
4272        let mut query = self.selection.select("withUser");
4273        query = query.arg("name", name.into());
4274        Container {
4275            proc: self.proc.clone(),
4276            selection: query,
4277            graphql_client: self.graphql_client.clone(),
4278        }
4279    }
4280    /// Change the container's working directory. Like WORKDIR in Dockerfile.
4281    ///
4282    /// # Arguments
4283    ///
4284    /// * `path` - The path to set as the working directory (e.g., "/app").
4285    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4286    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
4287        let mut query = self.selection.select("withWorkdir");
4288        query = query.arg("path", path.into());
4289        Container {
4290            proc: self.proc.clone(),
4291            selection: query,
4292            graphql_client: self.graphql_client.clone(),
4293        }
4294    }
4295    /// Change the container's working directory. Like WORKDIR in Dockerfile.
4296    ///
4297    /// # Arguments
4298    ///
4299    /// * `path` - The path to set as the working directory (e.g., "/app").
4300    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4301    pub fn with_workdir_opts(
4302        &self,
4303        path: impl Into<String>,
4304        opts: ContainerWithWorkdirOpts,
4305    ) -> Container {
4306        let mut query = self.selection.select("withWorkdir");
4307        query = query.arg("path", path.into());
4308        if let Some(expand) = opts.expand {
4309            query = query.arg("expand", expand);
4310        }
4311        Container {
4312            proc: self.proc.clone(),
4313            selection: query,
4314            graphql_client: self.graphql_client.clone(),
4315        }
4316    }
4317    /// Retrieves this container minus the given OCI annotation.
4318    ///
4319    /// # Arguments
4320    ///
4321    /// * `name` - The name of the annotation.
4322    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
4323        let mut query = self.selection.select("withoutAnnotation");
4324        query = query.arg("name", name.into());
4325        Container {
4326            proc: self.proc.clone(),
4327            selection: query,
4328            graphql_client: self.graphql_client.clone(),
4329        }
4330    }
4331    /// Remove the container's default arguments.
4332    pub fn without_default_args(&self) -> Container {
4333        let query = self.selection.select("withoutDefaultArgs");
4334        Container {
4335            proc: self.proc.clone(),
4336            selection: query,
4337            graphql_client: self.graphql_client.clone(),
4338        }
4339    }
4340    /// Return a new container snapshot, with a directory removed from its filesystem
4341    ///
4342    /// # Arguments
4343    ///
4344    /// * `path` - Location of the directory to remove (e.g., ".github/").
4345    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4346    pub fn without_directory(&self, path: impl Into<String>) -> Container {
4347        let mut query = self.selection.select("withoutDirectory");
4348        query = query.arg("path", path.into());
4349        Container {
4350            proc: self.proc.clone(),
4351            selection: query,
4352            graphql_client: self.graphql_client.clone(),
4353        }
4354    }
4355    /// Return a new container snapshot, with a directory removed from its filesystem
4356    ///
4357    /// # Arguments
4358    ///
4359    /// * `path` - Location of the directory to remove (e.g., ".github/").
4360    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4361    pub fn without_directory_opts(
4362        &self,
4363        path: impl Into<String>,
4364        opts: ContainerWithoutDirectoryOpts,
4365    ) -> Container {
4366        let mut query = self.selection.select("withoutDirectory");
4367        query = query.arg("path", path.into());
4368        if let Some(expand) = opts.expand {
4369            query = query.arg("expand", expand);
4370        }
4371        Container {
4372            proc: self.proc.clone(),
4373            selection: query,
4374            graphql_client: self.graphql_client.clone(),
4375        }
4376    }
4377    /// Reset the container's OCI entrypoint.
4378    ///
4379    /// # Arguments
4380    ///
4381    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4382    pub fn without_entrypoint(&self) -> Container {
4383        let query = self.selection.select("withoutEntrypoint");
4384        Container {
4385            proc: self.proc.clone(),
4386            selection: query,
4387            graphql_client: self.graphql_client.clone(),
4388        }
4389    }
4390    /// Reset the container's OCI entrypoint.
4391    ///
4392    /// # Arguments
4393    ///
4394    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4395    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4396        let mut query = self.selection.select("withoutEntrypoint");
4397        if let Some(keep_default_args) = opts.keep_default_args {
4398            query = query.arg("keepDefaultArgs", keep_default_args);
4399        }
4400        Container {
4401            proc: self.proc.clone(),
4402            selection: query,
4403            graphql_client: self.graphql_client.clone(),
4404        }
4405    }
4406    /// Retrieves this container minus the given environment variable.
4407    ///
4408    /// # Arguments
4409    ///
4410    /// * `name` - The name of the environment variable (e.g., "HOST").
4411    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4412        let mut query = self.selection.select("withoutEnvVariable");
4413        query = query.arg("name", name.into());
4414        Container {
4415            proc: self.proc.clone(),
4416            selection: query,
4417            graphql_client: self.graphql_client.clone(),
4418        }
4419    }
4420    /// Unexpose a previously exposed port.
4421    ///
4422    /// # Arguments
4423    ///
4424    /// * `port` - Port number to unexpose
4425    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4426    pub fn without_exposed_port(&self, port: isize) -> Container {
4427        let mut query = self.selection.select("withoutExposedPort");
4428        query = query.arg("port", port);
4429        Container {
4430            proc: self.proc.clone(),
4431            selection: query,
4432            graphql_client: self.graphql_client.clone(),
4433        }
4434    }
4435    /// Unexpose a previously exposed port.
4436    ///
4437    /// # Arguments
4438    ///
4439    /// * `port` - Port number to unexpose
4440    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4441    pub fn without_exposed_port_opts(
4442        &self,
4443        port: isize,
4444        opts: ContainerWithoutExposedPortOpts,
4445    ) -> Container {
4446        let mut query = self.selection.select("withoutExposedPort");
4447        query = query.arg("port", port);
4448        if let Some(protocol) = opts.protocol {
4449            query = query.arg("protocol", protocol);
4450        }
4451        Container {
4452            proc: self.proc.clone(),
4453            selection: query,
4454            graphql_client: self.graphql_client.clone(),
4455        }
4456    }
4457    /// Retrieves this container with the file at the given path removed.
4458    ///
4459    /// # Arguments
4460    ///
4461    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4462    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4463    pub fn without_file(&self, path: impl Into<String>) -> Container {
4464        let mut query = self.selection.select("withoutFile");
4465        query = query.arg("path", path.into());
4466        Container {
4467            proc: self.proc.clone(),
4468            selection: query,
4469            graphql_client: self.graphql_client.clone(),
4470        }
4471    }
4472    /// Retrieves this container with the file at the given path removed.
4473    ///
4474    /// # Arguments
4475    ///
4476    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4477    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4478    pub fn without_file_opts(
4479        &self,
4480        path: impl Into<String>,
4481        opts: ContainerWithoutFileOpts,
4482    ) -> Container {
4483        let mut query = self.selection.select("withoutFile");
4484        query = query.arg("path", path.into());
4485        if let Some(expand) = opts.expand {
4486            query = query.arg("expand", expand);
4487        }
4488        Container {
4489            proc: self.proc.clone(),
4490            selection: query,
4491            graphql_client: self.graphql_client.clone(),
4492        }
4493    }
4494    /// Return a new container spanshot with specified files removed
4495    ///
4496    /// # Arguments
4497    ///
4498    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4499    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4500    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4501        let mut query = self.selection.select("withoutFiles");
4502        query = query.arg(
4503            "paths",
4504            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4505        );
4506        Container {
4507            proc: self.proc.clone(),
4508            selection: query,
4509            graphql_client: self.graphql_client.clone(),
4510        }
4511    }
4512    /// Return a new container spanshot with specified files removed
4513    ///
4514    /// # Arguments
4515    ///
4516    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4517    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4518    pub fn without_files_opts(
4519        &self,
4520        paths: Vec<impl Into<String>>,
4521        opts: ContainerWithoutFilesOpts,
4522    ) -> Container {
4523        let mut query = self.selection.select("withoutFiles");
4524        query = query.arg(
4525            "paths",
4526            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4527        );
4528        if let Some(expand) = opts.expand {
4529            query = query.arg("expand", expand);
4530        }
4531        Container {
4532            proc: self.proc.clone(),
4533            selection: query,
4534            graphql_client: self.graphql_client.clone(),
4535        }
4536    }
4537    /// Retrieves this container minus the given environment label.
4538    ///
4539    /// # Arguments
4540    ///
4541    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4542    pub fn without_label(&self, name: impl Into<String>) -> Container {
4543        let mut query = self.selection.select("withoutLabel");
4544        query = query.arg("name", name.into());
4545        Container {
4546            proc: self.proc.clone(),
4547            selection: query,
4548            graphql_client: self.graphql_client.clone(),
4549        }
4550    }
4551    /// Retrieves this container after unmounting everything at the given path.
4552    ///
4553    /// # Arguments
4554    ///
4555    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4556    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4557    pub fn without_mount(&self, path: impl Into<String>) -> Container {
4558        let mut query = self.selection.select("withoutMount");
4559        query = query.arg("path", path.into());
4560        Container {
4561            proc: self.proc.clone(),
4562            selection: query,
4563            graphql_client: self.graphql_client.clone(),
4564        }
4565    }
4566    /// Retrieves this container after unmounting everything at the given path.
4567    ///
4568    /// # Arguments
4569    ///
4570    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4571    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4572    pub fn without_mount_opts(
4573        &self,
4574        path: impl Into<String>,
4575        opts: ContainerWithoutMountOpts,
4576    ) -> Container {
4577        let mut query = self.selection.select("withoutMount");
4578        query = query.arg("path", path.into());
4579        if let Some(expand) = opts.expand {
4580            query = query.arg("expand", expand);
4581        }
4582        Container {
4583            proc: self.proc.clone(),
4584            selection: query,
4585            graphql_client: self.graphql_client.clone(),
4586        }
4587    }
4588    /// Retrieves this container without the registry authentication of a given address.
4589    ///
4590    /// # Arguments
4591    ///
4592    /// * `address` - Registry's address to remove the authentication from.
4593    ///
4594    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
4595    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4596        let mut query = self.selection.select("withoutRegistryAuth");
4597        query = query.arg("address", address.into());
4598        Container {
4599            proc: self.proc.clone(),
4600            selection: query,
4601            graphql_client: self.graphql_client.clone(),
4602        }
4603    }
4604    /// Retrieves this container minus the given environment variable containing the secret.
4605    ///
4606    /// # Arguments
4607    ///
4608    /// * `name` - The name of the environment variable (e.g., "HOST").
4609    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4610        let mut query = self.selection.select("withoutSecretVariable");
4611        query = query.arg("name", name.into());
4612        Container {
4613            proc: self.proc.clone(),
4614            selection: query,
4615            graphql_client: self.graphql_client.clone(),
4616        }
4617    }
4618    /// Retrieves this container with a previously added Unix socket removed.
4619    ///
4620    /// # Arguments
4621    ///
4622    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4623    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4624    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4625        let mut query = self.selection.select("withoutUnixSocket");
4626        query = query.arg("path", path.into());
4627        Container {
4628            proc: self.proc.clone(),
4629            selection: query,
4630            graphql_client: self.graphql_client.clone(),
4631        }
4632    }
4633    /// Retrieves this container with a previously added Unix socket removed.
4634    ///
4635    /// # Arguments
4636    ///
4637    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4638    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4639    pub fn without_unix_socket_opts(
4640        &self,
4641        path: impl Into<String>,
4642        opts: ContainerWithoutUnixSocketOpts,
4643    ) -> Container {
4644        let mut query = self.selection.select("withoutUnixSocket");
4645        query = query.arg("path", path.into());
4646        if let Some(expand) = opts.expand {
4647            query = query.arg("expand", expand);
4648        }
4649        Container {
4650            proc: self.proc.clone(),
4651            selection: query,
4652            graphql_client: self.graphql_client.clone(),
4653        }
4654    }
4655    /// Retrieves this container with an unset command user.
4656    /// Should default to root.
4657    pub fn without_user(&self) -> Container {
4658        let query = self.selection.select("withoutUser");
4659        Container {
4660            proc: self.proc.clone(),
4661            selection: query,
4662            graphql_client: self.graphql_client.clone(),
4663        }
4664    }
4665    /// Unset the container's working directory.
4666    /// Should default to "/".
4667    pub fn without_workdir(&self) -> Container {
4668        let query = self.selection.select("withoutWorkdir");
4669        Container {
4670            proc: self.proc.clone(),
4671            selection: query,
4672            graphql_client: self.graphql_client.clone(),
4673        }
4674    }
4675    /// Retrieves the working directory for all commands.
4676    pub async fn workdir(&self) -> Result<String, DaggerError> {
4677        let query = self.selection.select("workdir");
4678        query.execute(self.graphql_client.clone()).await
4679    }
4680}
4681#[derive(Clone)]
4682pub struct CurrentModule {
4683    pub proc: Option<Arc<DaggerSessionProc>>,
4684    pub selection: Selection,
4685    pub graphql_client: DynGraphQLClient,
4686}
4687#[derive(Builder, Debug, PartialEq)]
4688pub struct CurrentModuleWorkdirOpts<'a> {
4689    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4690    #[builder(setter(into, strip_option), default)]
4691    pub exclude: Option<Vec<&'a str>>,
4692    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4693    #[builder(setter(into, strip_option), default)]
4694    pub include: Option<Vec<&'a str>>,
4695}
4696impl CurrentModule {
4697    /// A unique identifier for this CurrentModule.
4698    pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
4699        let query = self.selection.select("id");
4700        query.execute(self.graphql_client.clone()).await
4701    }
4702    /// The name of the module being executed in
4703    pub async fn name(&self) -> Result<String, DaggerError> {
4704        let query = self.selection.select("name");
4705        query.execute(self.graphql_client.clone()).await
4706    }
4707    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
4708    pub fn source(&self) -> Directory {
4709        let query = self.selection.select("source");
4710        Directory {
4711            proc: self.proc.clone(),
4712            selection: query,
4713            graphql_client: self.graphql_client.clone(),
4714        }
4715    }
4716    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4717    ///
4718    /// # Arguments
4719    ///
4720    /// * `path` - Location of the directory to access (e.g., ".").
4721    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4722    pub fn workdir(&self, path: impl Into<String>) -> Directory {
4723        let mut query = self.selection.select("workdir");
4724        query = query.arg("path", path.into());
4725        Directory {
4726            proc: self.proc.clone(),
4727            selection: query,
4728            graphql_client: self.graphql_client.clone(),
4729        }
4730    }
4731    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4732    ///
4733    /// # Arguments
4734    ///
4735    /// * `path` - Location of the directory to access (e.g., ".").
4736    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4737    pub fn workdir_opts<'a>(
4738        &self,
4739        path: impl Into<String>,
4740        opts: CurrentModuleWorkdirOpts<'a>,
4741    ) -> Directory {
4742        let mut query = self.selection.select("workdir");
4743        query = query.arg("path", path.into());
4744        if let Some(exclude) = opts.exclude {
4745            query = query.arg("exclude", exclude);
4746        }
4747        if let Some(include) = opts.include {
4748            query = query.arg("include", include);
4749        }
4750        Directory {
4751            proc: self.proc.clone(),
4752            selection: query,
4753            graphql_client: self.graphql_client.clone(),
4754        }
4755    }
4756    /// 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.
4757    ///
4758    /// # Arguments
4759    ///
4760    /// * `path` - Location of the file to retrieve (e.g., "README.md").
4761    pub fn workdir_file(&self, path: impl Into<String>) -> File {
4762        let mut query = self.selection.select("workdirFile");
4763        query = query.arg("path", path.into());
4764        File {
4765            proc: self.proc.clone(),
4766            selection: query,
4767            graphql_client: self.graphql_client.clone(),
4768        }
4769    }
4770}
4771#[derive(Clone)]
4772pub struct Directory {
4773    pub proc: Option<Arc<DaggerSessionProc>>,
4774    pub selection: Selection,
4775    pub graphql_client: DynGraphQLClient,
4776}
4777#[derive(Builder, Debug, PartialEq)]
4778pub struct DirectoryAsModuleOpts<'a> {
4779    /// An optional subpath of the directory which contains the module's configuration file.
4780    /// If not set, the module source code is loaded from the root of the directory.
4781    #[builder(setter(into, strip_option), default)]
4782    pub source_root_path: Option<&'a str>,
4783}
4784#[derive(Builder, Debug, PartialEq)]
4785pub struct DirectoryAsModuleSourceOpts<'a> {
4786    /// An optional subpath of the directory which contains the module's configuration file.
4787    /// If not set, the module source code is loaded from the root of the directory.
4788    #[builder(setter(into, strip_option), default)]
4789    pub source_root_path: Option<&'a str>,
4790}
4791#[derive(Builder, Debug, PartialEq)]
4792pub struct DirectoryDockerBuildOpts<'a> {
4793    /// Build arguments to use in the build.
4794    #[builder(setter(into, strip_option), default)]
4795    pub build_args: Option<Vec<BuildArg>>,
4796    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
4797    #[builder(setter(into, strip_option), default)]
4798    pub dockerfile: Option<&'a str>,
4799    /// If set, skip the automatic init process injected into containers created by RUN statements.
4800    /// 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.
4801    #[builder(setter(into, strip_option), default)]
4802    pub no_init: Option<bool>,
4803    /// The platform to build.
4804    #[builder(setter(into, strip_option), default)]
4805    pub platform: Option<Platform>,
4806    /// Secrets to pass to the build.
4807    /// They will be mounted at /run/secrets/[secret-name].
4808    #[builder(setter(into, strip_option), default)]
4809    pub secrets: Option<Vec<SecretId>>,
4810    /// Target build stage to build.
4811    #[builder(setter(into, strip_option), default)]
4812    pub target: Option<&'a str>,
4813}
4814#[derive(Builder, Debug, PartialEq)]
4815pub struct DirectoryEntriesOpts<'a> {
4816    /// Location of the directory to look at (e.g., "/src").
4817    #[builder(setter(into, strip_option), default)]
4818    pub path: Option<&'a str>,
4819}
4820#[derive(Builder, Debug, PartialEq)]
4821pub struct DirectoryExistsOpts {
4822    /// If specified, do not follow symlinks.
4823    #[builder(setter(into, strip_option), default)]
4824    pub do_not_follow_symlinks: Option<bool>,
4825    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
4826    #[builder(setter(into, strip_option), default)]
4827    pub expected_type: Option<ExistsType>,
4828}
4829#[derive(Builder, Debug, PartialEq)]
4830pub struct DirectoryExportOpts {
4831    /// 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.
4832    #[builder(setter(into, strip_option), default)]
4833    pub wipe: Option<bool>,
4834}
4835#[derive(Builder, Debug, PartialEq)]
4836pub struct DirectoryFilterOpts<'a> {
4837    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
4838    #[builder(setter(into, strip_option), default)]
4839    pub exclude: Option<Vec<&'a str>>,
4840    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
4841    #[builder(setter(into, strip_option), default)]
4842    pub include: Option<Vec<&'a str>>,
4843}
4844#[derive(Builder, Debug, PartialEq)]
4845pub struct DirectorySearchOpts<'a> {
4846    /// Allow the . pattern to match newlines in multiline mode.
4847    #[builder(setter(into, strip_option), default)]
4848    pub dotall: Option<bool>,
4849    /// Only return matching files, not lines and content
4850    #[builder(setter(into, strip_option), default)]
4851    pub files_only: Option<bool>,
4852    /// Glob patterns to match (e.g., "*.md")
4853    #[builder(setter(into, strip_option), default)]
4854    pub globs: Option<Vec<&'a str>>,
4855    /// Enable case-insensitive matching.
4856    #[builder(setter(into, strip_option), default)]
4857    pub insensitive: Option<bool>,
4858    /// Limit the number of results to return
4859    #[builder(setter(into, strip_option), default)]
4860    pub limit: Option<isize>,
4861    /// Interpret the pattern as a literal string instead of a regular expression.
4862    #[builder(setter(into, strip_option), default)]
4863    pub literal: Option<bool>,
4864    /// Enable searching across multiple lines.
4865    #[builder(setter(into, strip_option), default)]
4866    pub multiline: Option<bool>,
4867    /// Directory or file paths to search
4868    #[builder(setter(into, strip_option), default)]
4869    pub paths: Option<Vec<&'a str>>,
4870    /// Skip hidden files (files starting with .).
4871    #[builder(setter(into, strip_option), default)]
4872    pub skip_hidden: Option<bool>,
4873    /// Honor .gitignore, .ignore, and .rgignore files.
4874    #[builder(setter(into, strip_option), default)]
4875    pub skip_ignored: Option<bool>,
4876}
4877#[derive(Builder, Debug, PartialEq)]
4878pub struct DirectoryTerminalOpts<'a> {
4879    /// If set, override the container's default terminal command and invoke these command arguments instead.
4880    #[builder(setter(into, strip_option), default)]
4881    pub cmd: Option<Vec<&'a str>>,
4882    /// If set, override the default container used for the terminal.
4883    #[builder(setter(into, strip_option), default)]
4884    pub container: Option<ContainerId>,
4885    /// Provides Dagger access to the executed command.
4886    #[builder(setter(into, strip_option), default)]
4887    pub experimental_privileged_nesting: Option<bool>,
4888    /// 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.
4889    #[builder(setter(into, strip_option), default)]
4890    pub insecure_root_capabilities: Option<bool>,
4891}
4892#[derive(Builder, Debug, PartialEq)]
4893pub struct DirectoryWithDirectoryOpts<'a> {
4894    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4895    #[builder(setter(into, strip_option), default)]
4896    pub exclude: Option<Vec<&'a str>>,
4897    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4898    #[builder(setter(into, strip_option), default)]
4899    pub include: Option<Vec<&'a str>>,
4900    /// A user:group to set for the copied directory and its contents.
4901    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
4902    /// If the group is omitted, it defaults to the same as the user.
4903    #[builder(setter(into, strip_option), default)]
4904    pub owner: Option<&'a str>,
4905}
4906#[derive(Builder, Debug, PartialEq)]
4907pub struct DirectoryWithFileOpts<'a> {
4908    /// A user:group to set for the copied directory and its contents.
4909    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
4910    /// If the group is omitted, it defaults to the same as the user.
4911    #[builder(setter(into, strip_option), default)]
4912    pub owner: Option<&'a str>,
4913    /// Permission given to the copied file (e.g., 0600).
4914    #[builder(setter(into, strip_option), default)]
4915    pub permissions: Option<isize>,
4916}
4917#[derive(Builder, Debug, PartialEq)]
4918pub struct DirectoryWithFilesOpts {
4919    /// Permission given to the copied files (e.g., 0600).
4920    #[builder(setter(into, strip_option), default)]
4921    pub permissions: Option<isize>,
4922}
4923#[derive(Builder, Debug, PartialEq)]
4924pub struct DirectoryWithNewDirectoryOpts {
4925    /// Permission granted to the created directory (e.g., 0777).
4926    #[builder(setter(into, strip_option), default)]
4927    pub permissions: Option<isize>,
4928}
4929#[derive(Builder, Debug, PartialEq)]
4930pub struct DirectoryWithNewFileOpts {
4931    /// Permissions of the new file. Example: 0600
4932    #[builder(setter(into, strip_option), default)]
4933    pub permissions: Option<isize>,
4934}
4935impl Directory {
4936    /// Converts this directory to a local git repository
4937    pub fn as_git(&self) -> GitRepository {
4938        let query = self.selection.select("asGit");
4939        GitRepository {
4940            proc: self.proc.clone(),
4941            selection: query,
4942            graphql_client: self.graphql_client.clone(),
4943        }
4944    }
4945    /// Load the directory as a Dagger module source
4946    ///
4947    /// # Arguments
4948    ///
4949    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4950    pub fn as_module(&self) -> Module {
4951        let query = self.selection.select("asModule");
4952        Module {
4953            proc: self.proc.clone(),
4954            selection: query,
4955            graphql_client: self.graphql_client.clone(),
4956        }
4957    }
4958    /// Load the directory as a Dagger module source
4959    ///
4960    /// # Arguments
4961    ///
4962    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4963    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4964        let mut query = self.selection.select("asModule");
4965        if let Some(source_root_path) = opts.source_root_path {
4966            query = query.arg("sourceRootPath", source_root_path);
4967        }
4968        Module {
4969            proc: self.proc.clone(),
4970            selection: query,
4971            graphql_client: self.graphql_client.clone(),
4972        }
4973    }
4974    /// Load the directory as a Dagger module source
4975    ///
4976    /// # Arguments
4977    ///
4978    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4979    pub fn as_module_source(&self) -> ModuleSource {
4980        let query = self.selection.select("asModuleSource");
4981        ModuleSource {
4982            proc: self.proc.clone(),
4983            selection: query,
4984            graphql_client: self.graphql_client.clone(),
4985        }
4986    }
4987    /// Load the directory as a Dagger module source
4988    ///
4989    /// # Arguments
4990    ///
4991    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4992    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4993        let mut query = self.selection.select("asModuleSource");
4994        if let Some(source_root_path) = opts.source_root_path {
4995            query = query.arg("sourceRootPath", source_root_path);
4996        }
4997        ModuleSource {
4998            proc: self.proc.clone(),
4999            selection: query,
5000            graphql_client: self.graphql_client.clone(),
5001        }
5002    }
5003    /// Return the difference between this directory and another directory, typically an older snapshot.
5004    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
5005    ///
5006    /// # Arguments
5007    ///
5008    /// * `from` - The base directory snapshot to compare against
5009    pub fn changes(&self, from: impl IntoID<DirectoryId>) -> Changeset {
5010        let mut query = self.selection.select("changes");
5011        query = query.arg_lazy(
5012            "from",
5013            Box::new(move || {
5014                let from = from.clone();
5015                Box::pin(async move { from.into_id().await.unwrap().quote() })
5016            }),
5017        );
5018        Changeset {
5019            proc: self.proc.clone(),
5020            selection: query,
5021            graphql_client: self.graphql_client.clone(),
5022        }
5023    }
5024    /// Change the owner of the directory contents recursively.
5025    ///
5026    /// # Arguments
5027    ///
5028    /// * `path` - Path of the directory to change ownership of (e.g., "/").
5029    /// * `owner` - A user:group to set for the mounted directory and its contents.
5030    ///
5031    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5032    ///
5033    /// If the group is omitted, it defaults to the same as the user.
5034    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
5035        let mut query = self.selection.select("chown");
5036        query = query.arg("path", path.into());
5037        query = query.arg("owner", owner.into());
5038        Directory {
5039            proc: self.proc.clone(),
5040            selection: query,
5041            graphql_client: self.graphql_client.clone(),
5042        }
5043    }
5044    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
5045    ///
5046    /// # Arguments
5047    ///
5048    /// * `other` - The directory to compare against
5049    pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
5050        let mut query = self.selection.select("diff");
5051        query = query.arg_lazy(
5052            "other",
5053            Box::new(move || {
5054                let other = other.clone();
5055                Box::pin(async move { other.into_id().await.unwrap().quote() })
5056            }),
5057        );
5058        Directory {
5059            proc: self.proc.clone(),
5060            selection: query,
5061            graphql_client: self.graphql_client.clone(),
5062        }
5063    }
5064    /// 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.
5065    pub async fn digest(&self) -> Result<String, DaggerError> {
5066        let query = self.selection.select("digest");
5067        query.execute(self.graphql_client.clone()).await
5068    }
5069    /// Retrieves a directory at the given path.
5070    ///
5071    /// # Arguments
5072    ///
5073    /// * `path` - Location of the directory to retrieve. Example: "/src"
5074    pub fn directory(&self, path: impl Into<String>) -> Directory {
5075        let mut query = self.selection.select("directory");
5076        query = query.arg("path", path.into());
5077        Directory {
5078            proc: self.proc.clone(),
5079            selection: query,
5080            graphql_client: self.graphql_client.clone(),
5081        }
5082    }
5083    /// 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.
5084    ///
5085    /// # Arguments
5086    ///
5087    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5088    pub fn docker_build(&self) -> Container {
5089        let query = self.selection.select("dockerBuild");
5090        Container {
5091            proc: self.proc.clone(),
5092            selection: query,
5093            graphql_client: self.graphql_client.clone(),
5094        }
5095    }
5096    /// 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.
5097    ///
5098    /// # Arguments
5099    ///
5100    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5101    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5102        let mut query = self.selection.select("dockerBuild");
5103        if let Some(dockerfile) = opts.dockerfile {
5104            query = query.arg("dockerfile", dockerfile);
5105        }
5106        if let Some(platform) = opts.platform {
5107            query = query.arg("platform", platform);
5108        }
5109        if let Some(build_args) = opts.build_args {
5110            query = query.arg("buildArgs", build_args);
5111        }
5112        if let Some(target) = opts.target {
5113            query = query.arg("target", target);
5114        }
5115        if let Some(secrets) = opts.secrets {
5116            query = query.arg("secrets", secrets);
5117        }
5118        if let Some(no_init) = opts.no_init {
5119            query = query.arg("noInit", no_init);
5120        }
5121        Container {
5122            proc: self.proc.clone(),
5123            selection: query,
5124            graphql_client: self.graphql_client.clone(),
5125        }
5126    }
5127    /// Returns a list of files and directories at the given path.
5128    ///
5129    /// # Arguments
5130    ///
5131    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5132    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
5133        let query = self.selection.select("entries");
5134        query.execute(self.graphql_client.clone()).await
5135    }
5136    /// Returns a list of files and directories at the given path.
5137    ///
5138    /// # Arguments
5139    ///
5140    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5141    pub async fn entries_opts<'a>(
5142        &self,
5143        opts: DirectoryEntriesOpts<'a>,
5144    ) -> Result<Vec<String>, DaggerError> {
5145        let mut query = self.selection.select("entries");
5146        if let Some(path) = opts.path {
5147            query = query.arg("path", path);
5148        }
5149        query.execute(self.graphql_client.clone()).await
5150    }
5151    /// check if a file or directory exists
5152    ///
5153    /// # Arguments
5154    ///
5155    /// * `path` - Path to check (e.g., "/file.txt").
5156    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5157    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5158        let mut query = self.selection.select("exists");
5159        query = query.arg("path", path.into());
5160        query.execute(self.graphql_client.clone()).await
5161    }
5162    /// check if a file or directory exists
5163    ///
5164    /// # Arguments
5165    ///
5166    /// * `path` - Path to check (e.g., "/file.txt").
5167    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5168    pub async fn exists_opts(
5169        &self,
5170        path: impl Into<String>,
5171        opts: DirectoryExistsOpts,
5172    ) -> Result<bool, DaggerError> {
5173        let mut query = self.selection.select("exists");
5174        query = query.arg("path", path.into());
5175        if let Some(expected_type) = opts.expected_type {
5176            query = query.arg("expectedType", expected_type);
5177        }
5178        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5179            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5180        }
5181        query.execute(self.graphql_client.clone()).await
5182    }
5183    /// Writes the contents of the directory to a path on the host.
5184    ///
5185    /// # Arguments
5186    ///
5187    /// * `path` - Location of the copied directory (e.g., "logs/").
5188    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5189    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5190        let mut query = self.selection.select("export");
5191        query = query.arg("path", path.into());
5192        query.execute(self.graphql_client.clone()).await
5193    }
5194    /// Writes the contents of the directory to a path on the host.
5195    ///
5196    /// # Arguments
5197    ///
5198    /// * `path` - Location of the copied directory (e.g., "logs/").
5199    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5200    pub async fn export_opts(
5201        &self,
5202        path: impl Into<String>,
5203        opts: DirectoryExportOpts,
5204    ) -> Result<String, DaggerError> {
5205        let mut query = self.selection.select("export");
5206        query = query.arg("path", path.into());
5207        if let Some(wipe) = opts.wipe {
5208            query = query.arg("wipe", wipe);
5209        }
5210        query.execute(self.graphql_client.clone()).await
5211    }
5212    /// Retrieve a file at the given path.
5213    ///
5214    /// # Arguments
5215    ///
5216    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5217    pub fn file(&self, path: impl Into<String>) -> File {
5218        let mut query = self.selection.select("file");
5219        query = query.arg("path", path.into());
5220        File {
5221            proc: self.proc.clone(),
5222            selection: query,
5223            graphql_client: self.graphql_client.clone(),
5224        }
5225    }
5226    /// Return a snapshot with some paths included or excluded
5227    ///
5228    /// # Arguments
5229    ///
5230    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5231    pub fn filter(&self) -> Directory {
5232        let query = self.selection.select("filter");
5233        Directory {
5234            proc: self.proc.clone(),
5235            selection: query,
5236            graphql_client: self.graphql_client.clone(),
5237        }
5238    }
5239    /// Return a snapshot with some paths included or excluded
5240    ///
5241    /// # Arguments
5242    ///
5243    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5244    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5245        let mut query = self.selection.select("filter");
5246        if let Some(exclude) = opts.exclude {
5247            query = query.arg("exclude", exclude);
5248        }
5249        if let Some(include) = opts.include {
5250            query = query.arg("include", include);
5251        }
5252        Directory {
5253            proc: self.proc.clone(),
5254            selection: query,
5255            graphql_client: self.graphql_client.clone(),
5256        }
5257    }
5258    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
5259    ///
5260    /// # Arguments
5261    ///
5262    /// * `name` - The name of the file or directory to search for
5263    /// * `start` - The path to start the search from
5264    pub async fn find_up(
5265        &self,
5266        name: impl Into<String>,
5267        start: impl Into<String>,
5268    ) -> Result<String, DaggerError> {
5269        let mut query = self.selection.select("findUp");
5270        query = query.arg("name", name.into());
5271        query = query.arg("start", start.into());
5272        query.execute(self.graphql_client.clone()).await
5273    }
5274    /// Returns a list of files and directories that matche the given pattern.
5275    ///
5276    /// # Arguments
5277    ///
5278    /// * `pattern` - Pattern to match (e.g., "*.md").
5279    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5280        let mut query = self.selection.select("glob");
5281        query = query.arg("pattern", pattern.into());
5282        query.execute(self.graphql_client.clone()).await
5283    }
5284    /// A unique identifier for this Directory.
5285    pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
5286        let query = self.selection.select("id");
5287        query.execute(self.graphql_client.clone()).await
5288    }
5289    /// Returns the name of the directory.
5290    pub async fn name(&self) -> Result<String, DaggerError> {
5291        let query = self.selection.select("name");
5292        query.execute(self.graphql_client.clone()).await
5293    }
5294    /// Searches for content matching the given regular expression or literal string.
5295    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5296    ///
5297    /// # Arguments
5298    ///
5299    /// * `pattern` - The text to match.
5300    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5301    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
5302        let mut query = self.selection.select("search");
5303        query = query.arg("pattern", pattern.into());
5304        vec![SearchResult {
5305            proc: self.proc.clone(),
5306            selection: query,
5307            graphql_client: self.graphql_client.clone(),
5308        }]
5309    }
5310    /// Searches for content matching the given regular expression or literal string.
5311    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5312    ///
5313    /// # Arguments
5314    ///
5315    /// * `pattern` - The text to match.
5316    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5317    pub fn search_opts<'a>(
5318        &self,
5319        pattern: impl Into<String>,
5320        opts: DirectorySearchOpts<'a>,
5321    ) -> Vec<SearchResult> {
5322        let mut query = self.selection.select("search");
5323        query = query.arg("pattern", pattern.into());
5324        if let Some(paths) = opts.paths {
5325            query = query.arg("paths", paths);
5326        }
5327        if let Some(globs) = opts.globs {
5328            query = query.arg("globs", globs);
5329        }
5330        if let Some(literal) = opts.literal {
5331            query = query.arg("literal", literal);
5332        }
5333        if let Some(multiline) = opts.multiline {
5334            query = query.arg("multiline", multiline);
5335        }
5336        if let Some(dotall) = opts.dotall {
5337            query = query.arg("dotall", dotall);
5338        }
5339        if let Some(insensitive) = opts.insensitive {
5340            query = query.arg("insensitive", insensitive);
5341        }
5342        if let Some(skip_ignored) = opts.skip_ignored {
5343            query = query.arg("skipIgnored", skip_ignored);
5344        }
5345        if let Some(skip_hidden) = opts.skip_hidden {
5346            query = query.arg("skipHidden", skip_hidden);
5347        }
5348        if let Some(files_only) = opts.files_only {
5349            query = query.arg("filesOnly", files_only);
5350        }
5351        if let Some(limit) = opts.limit {
5352            query = query.arg("limit", limit);
5353        }
5354        vec![SearchResult {
5355            proc: self.proc.clone(),
5356            selection: query,
5357            graphql_client: self.graphql_client.clone(),
5358        }]
5359    }
5360    /// Force evaluation in the engine.
5361    pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
5362        let query = self.selection.select("sync");
5363        query.execute(self.graphql_client.clone()).await
5364    }
5365    /// Opens an interactive terminal in new container with this directory mounted inside.
5366    ///
5367    /// # Arguments
5368    ///
5369    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5370    pub fn terminal(&self) -> Directory {
5371        let query = self.selection.select("terminal");
5372        Directory {
5373            proc: self.proc.clone(),
5374            selection: query,
5375            graphql_client: self.graphql_client.clone(),
5376        }
5377    }
5378    /// Opens an interactive terminal in new container with this directory mounted inside.
5379    ///
5380    /// # Arguments
5381    ///
5382    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5383    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5384        let mut query = self.selection.select("terminal");
5385        if let Some(container) = opts.container {
5386            query = query.arg("container", container);
5387        }
5388        if let Some(cmd) = opts.cmd {
5389            query = query.arg("cmd", cmd);
5390        }
5391        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5392            query = query.arg(
5393                "experimentalPrivilegedNesting",
5394                experimental_privileged_nesting,
5395            );
5396        }
5397        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5398            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5399        }
5400        Directory {
5401            proc: self.proc.clone(),
5402            selection: query,
5403            graphql_client: self.graphql_client.clone(),
5404        }
5405    }
5406    /// Return a directory with changes from another directory applied to it.
5407    ///
5408    /// # Arguments
5409    ///
5410    /// * `changes` - Changes to apply to the directory
5411    pub fn with_changes(&self, changes: impl IntoID<ChangesetId>) -> Directory {
5412        let mut query = self.selection.select("withChanges");
5413        query = query.arg_lazy(
5414            "changes",
5415            Box::new(move || {
5416                let changes = changes.clone();
5417                Box::pin(async move { changes.into_id().await.unwrap().quote() })
5418            }),
5419        );
5420        Directory {
5421            proc: self.proc.clone(),
5422            selection: query,
5423            graphql_client: self.graphql_client.clone(),
5424        }
5425    }
5426    /// Return a snapshot with a directory added
5427    ///
5428    /// # Arguments
5429    ///
5430    /// * `path` - Location of the written directory (e.g., "/src/").
5431    /// * `directory` - Identifier of the directory to copy.
5432    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5433    pub fn with_directory(
5434        &self,
5435        path: impl Into<String>,
5436        directory: impl IntoID<DirectoryId>,
5437    ) -> Directory {
5438        let mut query = self.selection.select("withDirectory");
5439        query = query.arg("path", path.into());
5440        query = query.arg_lazy(
5441            "directory",
5442            Box::new(move || {
5443                let directory = directory.clone();
5444                Box::pin(async move { directory.into_id().await.unwrap().quote() })
5445            }),
5446        );
5447        Directory {
5448            proc: self.proc.clone(),
5449            selection: query,
5450            graphql_client: self.graphql_client.clone(),
5451        }
5452    }
5453    /// Return a snapshot with a directory added
5454    ///
5455    /// # Arguments
5456    ///
5457    /// * `path` - Location of the written directory (e.g., "/src/").
5458    /// * `directory` - Identifier of the directory to copy.
5459    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5460    pub fn with_directory_opts<'a>(
5461        &self,
5462        path: impl Into<String>,
5463        directory: impl IntoID<DirectoryId>,
5464        opts: DirectoryWithDirectoryOpts<'a>,
5465    ) -> Directory {
5466        let mut query = self.selection.select("withDirectory");
5467        query = query.arg("path", path.into());
5468        query = query.arg_lazy(
5469            "directory",
5470            Box::new(move || {
5471                let directory = directory.clone();
5472                Box::pin(async move { directory.into_id().await.unwrap().quote() })
5473            }),
5474        );
5475        if let Some(exclude) = opts.exclude {
5476            query = query.arg("exclude", exclude);
5477        }
5478        if let Some(include) = opts.include {
5479            query = query.arg("include", include);
5480        }
5481        if let Some(owner) = opts.owner {
5482            query = query.arg("owner", owner);
5483        }
5484        Directory {
5485            proc: self.proc.clone(),
5486            selection: query,
5487            graphql_client: self.graphql_client.clone(),
5488        }
5489    }
5490    /// Retrieves this directory plus the contents of the given file copied to the given path.
5491    ///
5492    /// # Arguments
5493    ///
5494    /// * `path` - Location of the copied file (e.g., "/file.txt").
5495    /// * `source` - Identifier of the file to copy.
5496    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5497    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
5498        let mut query = self.selection.select("withFile");
5499        query = query.arg("path", path.into());
5500        query = query.arg_lazy(
5501            "source",
5502            Box::new(move || {
5503                let source = source.clone();
5504                Box::pin(async move { source.into_id().await.unwrap().quote() })
5505            }),
5506        );
5507        Directory {
5508            proc: self.proc.clone(),
5509            selection: query,
5510            graphql_client: self.graphql_client.clone(),
5511        }
5512    }
5513    /// Retrieves this directory plus the contents of the given file copied to the given path.
5514    ///
5515    /// # Arguments
5516    ///
5517    /// * `path` - Location of the copied file (e.g., "/file.txt").
5518    /// * `source` - Identifier of the file to copy.
5519    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5520    pub fn with_file_opts<'a>(
5521        &self,
5522        path: impl Into<String>,
5523        source: impl IntoID<FileId>,
5524        opts: DirectoryWithFileOpts<'a>,
5525    ) -> Directory {
5526        let mut query = self.selection.select("withFile");
5527        query = query.arg("path", path.into());
5528        query = query.arg_lazy(
5529            "source",
5530            Box::new(move || {
5531                let source = source.clone();
5532                Box::pin(async move { source.into_id().await.unwrap().quote() })
5533            }),
5534        );
5535        if let Some(permissions) = opts.permissions {
5536            query = query.arg("permissions", permissions);
5537        }
5538        if let Some(owner) = opts.owner {
5539            query = query.arg("owner", owner);
5540        }
5541        Directory {
5542            proc: self.proc.clone(),
5543            selection: query,
5544            graphql_client: self.graphql_client.clone(),
5545        }
5546    }
5547    /// Retrieves this directory plus the contents of the given files copied to the given path.
5548    ///
5549    /// # Arguments
5550    ///
5551    /// * `path` - Location where copied files should be placed (e.g., "/src").
5552    /// * `sources` - Identifiers of the files to copy.
5553    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5554    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
5555        let mut query = self.selection.select("withFiles");
5556        query = query.arg("path", path.into());
5557        query = query.arg("sources", sources);
5558        Directory {
5559            proc: self.proc.clone(),
5560            selection: query,
5561            graphql_client: self.graphql_client.clone(),
5562        }
5563    }
5564    /// Retrieves this directory plus the contents of the given files copied to the given path.
5565    ///
5566    /// # Arguments
5567    ///
5568    /// * `path` - Location where copied files should be placed (e.g., "/src").
5569    /// * `sources` - Identifiers of the files to copy.
5570    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5571    pub fn with_files_opts(
5572        &self,
5573        path: impl Into<String>,
5574        sources: Vec<FileId>,
5575        opts: DirectoryWithFilesOpts,
5576    ) -> Directory {
5577        let mut query = self.selection.select("withFiles");
5578        query = query.arg("path", path.into());
5579        query = query.arg("sources", sources);
5580        if let Some(permissions) = opts.permissions {
5581            query = query.arg("permissions", permissions);
5582        }
5583        Directory {
5584            proc: self.proc.clone(),
5585            selection: query,
5586            graphql_client: self.graphql_client.clone(),
5587        }
5588    }
5589    /// Retrieves this directory plus a new directory created at the given path.
5590    ///
5591    /// # Arguments
5592    ///
5593    /// * `path` - Location of the directory created (e.g., "/logs").
5594    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5595    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5596        let mut query = self.selection.select("withNewDirectory");
5597        query = query.arg("path", path.into());
5598        Directory {
5599            proc: self.proc.clone(),
5600            selection: query,
5601            graphql_client: self.graphql_client.clone(),
5602        }
5603    }
5604    /// Retrieves this directory plus a new directory created at the given path.
5605    ///
5606    /// # Arguments
5607    ///
5608    /// * `path` - Location of the directory created (e.g., "/logs").
5609    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5610    pub fn with_new_directory_opts(
5611        &self,
5612        path: impl Into<String>,
5613        opts: DirectoryWithNewDirectoryOpts,
5614    ) -> Directory {
5615        let mut query = self.selection.select("withNewDirectory");
5616        query = query.arg("path", path.into());
5617        if let Some(permissions) = opts.permissions {
5618            query = query.arg("permissions", permissions);
5619        }
5620        Directory {
5621            proc: self.proc.clone(),
5622            selection: query,
5623            graphql_client: self.graphql_client.clone(),
5624        }
5625    }
5626    /// Return a snapshot with a new file added
5627    ///
5628    /// # Arguments
5629    ///
5630    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5631    /// * `contents` - Contents of the new file. Example: "Hello world!"
5632    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5633    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5634        let mut query = self.selection.select("withNewFile");
5635        query = query.arg("path", path.into());
5636        query = query.arg("contents", contents.into());
5637        Directory {
5638            proc: self.proc.clone(),
5639            selection: query,
5640            graphql_client: self.graphql_client.clone(),
5641        }
5642    }
5643    /// Return a snapshot with a new file added
5644    ///
5645    /// # Arguments
5646    ///
5647    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5648    /// * `contents` - Contents of the new file. Example: "Hello world!"
5649    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5650    pub fn with_new_file_opts(
5651        &self,
5652        path: impl Into<String>,
5653        contents: impl Into<String>,
5654        opts: DirectoryWithNewFileOpts,
5655    ) -> Directory {
5656        let mut query = self.selection.select("withNewFile");
5657        query = query.arg("path", path.into());
5658        query = query.arg("contents", contents.into());
5659        if let Some(permissions) = opts.permissions {
5660            query = query.arg("permissions", permissions);
5661        }
5662        Directory {
5663            proc: self.proc.clone(),
5664            selection: query,
5665            graphql_client: self.graphql_client.clone(),
5666        }
5667    }
5668    /// Retrieves this directory with the given Git-compatible patch applied.
5669    ///
5670    /// # Arguments
5671    ///
5672    /// * `patch` - Patch to apply (e.g., "diff --git a/file.txt b/file.txt\nindex 1234567..abcdef8 100644\n--- a/file.txt\n+++ b/file.txt\n@@ -1,1 +1,1 @@\n-Hello\n+World\n").
5673    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5674        let mut query = self.selection.select("withPatch");
5675        query = query.arg("patch", patch.into());
5676        Directory {
5677            proc: self.proc.clone(),
5678            selection: query,
5679            graphql_client: self.graphql_client.clone(),
5680        }
5681    }
5682    /// Retrieves this directory with the given Git-compatible patch file applied.
5683    ///
5684    /// # Arguments
5685    ///
5686    /// * `patch` - File containing the patch to apply
5687    pub fn with_patch_file(&self, patch: impl IntoID<FileId>) -> Directory {
5688        let mut query = self.selection.select("withPatchFile");
5689        query = query.arg_lazy(
5690            "patch",
5691            Box::new(move || {
5692                let patch = patch.clone();
5693                Box::pin(async move { patch.into_id().await.unwrap().quote() })
5694            }),
5695        );
5696        Directory {
5697            proc: self.proc.clone(),
5698            selection: query,
5699            graphql_client: self.graphql_client.clone(),
5700        }
5701    }
5702    /// Return a snapshot with a symlink
5703    ///
5704    /// # Arguments
5705    ///
5706    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5707    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5708    pub fn with_symlink(
5709        &self,
5710        target: impl Into<String>,
5711        link_name: impl Into<String>,
5712    ) -> Directory {
5713        let mut query = self.selection.select("withSymlink");
5714        query = query.arg("target", target.into());
5715        query = query.arg("linkName", link_name.into());
5716        Directory {
5717            proc: self.proc.clone(),
5718            selection: query,
5719            graphql_client: self.graphql_client.clone(),
5720        }
5721    }
5722    /// Retrieves this directory with all file/dir timestamps set to the given time.
5723    ///
5724    /// # Arguments
5725    ///
5726    /// * `timestamp` - Timestamp to set dir/files in.
5727    ///
5728    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
5729    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5730        let mut query = self.selection.select("withTimestamps");
5731        query = query.arg("timestamp", timestamp);
5732        Directory {
5733            proc: self.proc.clone(),
5734            selection: query,
5735            graphql_client: self.graphql_client.clone(),
5736        }
5737    }
5738    /// Return a snapshot with a subdirectory removed
5739    ///
5740    /// # Arguments
5741    ///
5742    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
5743    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5744        let mut query = self.selection.select("withoutDirectory");
5745        query = query.arg("path", path.into());
5746        Directory {
5747            proc: self.proc.clone(),
5748            selection: query,
5749            graphql_client: self.graphql_client.clone(),
5750        }
5751    }
5752    /// Return a snapshot with a file removed
5753    ///
5754    /// # Arguments
5755    ///
5756    /// * `path` - Path of the file to remove (e.g., "/file.txt").
5757    pub fn without_file(&self, path: impl Into<String>) -> Directory {
5758        let mut query = self.selection.select("withoutFile");
5759        query = query.arg("path", path.into());
5760        Directory {
5761            proc: self.proc.clone(),
5762            selection: query,
5763            graphql_client: self.graphql_client.clone(),
5764        }
5765    }
5766    /// Return a snapshot with files removed
5767    ///
5768    /// # Arguments
5769    ///
5770    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
5771    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5772        let mut query = self.selection.select("withoutFiles");
5773        query = query.arg(
5774            "paths",
5775            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5776        );
5777        Directory {
5778            proc: self.proc.clone(),
5779            selection: query,
5780            graphql_client: self.graphql_client.clone(),
5781        }
5782    }
5783}
5784#[derive(Clone)]
5785pub struct Engine {
5786    pub proc: Option<Arc<DaggerSessionProc>>,
5787    pub selection: Selection,
5788    pub graphql_client: DynGraphQLClient,
5789}
5790impl Engine {
5791    /// A unique identifier for this Engine.
5792    pub async fn id(&self) -> Result<EngineId, DaggerError> {
5793        let query = self.selection.select("id");
5794        query.execute(self.graphql_client.clone()).await
5795    }
5796    /// The local (on-disk) cache for the Dagger engine
5797    pub fn local_cache(&self) -> EngineCache {
5798        let query = self.selection.select("localCache");
5799        EngineCache {
5800            proc: self.proc.clone(),
5801            selection: query,
5802            graphql_client: self.graphql_client.clone(),
5803        }
5804    }
5805}
5806#[derive(Clone)]
5807pub struct EngineCache {
5808    pub proc: Option<Arc<DaggerSessionProc>>,
5809    pub selection: Selection,
5810    pub graphql_client: DynGraphQLClient,
5811}
5812#[derive(Builder, Debug, PartialEq)]
5813pub struct EngineCacheEntrySetOpts<'a> {
5814    #[builder(setter(into, strip_option), default)]
5815    pub key: Option<&'a str>,
5816}
5817#[derive(Builder, Debug, PartialEq)]
5818pub struct EngineCachePruneOpts {
5819    /// Use the engine-wide default pruning policy if true, otherwise prune the whole cache of any releasable entries.
5820    #[builder(setter(into, strip_option), default)]
5821    pub use_default_policy: Option<bool>,
5822}
5823impl EngineCache {
5824    /// The current set of entries in the cache
5825    ///
5826    /// # Arguments
5827    ///
5828    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5829    pub fn entry_set(&self) -> EngineCacheEntrySet {
5830        let query = self.selection.select("entrySet");
5831        EngineCacheEntrySet {
5832            proc: self.proc.clone(),
5833            selection: query,
5834            graphql_client: self.graphql_client.clone(),
5835        }
5836    }
5837    /// The current set of entries in the cache
5838    ///
5839    /// # Arguments
5840    ///
5841    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5842    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5843        let mut query = self.selection.select("entrySet");
5844        if let Some(key) = opts.key {
5845            query = query.arg("key", key);
5846        }
5847        EngineCacheEntrySet {
5848            proc: self.proc.clone(),
5849            selection: query,
5850            graphql_client: self.graphql_client.clone(),
5851        }
5852    }
5853    /// A unique identifier for this EngineCache.
5854    pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
5855        let query = self.selection.select("id");
5856        query.execute(self.graphql_client.clone()).await
5857    }
5858    /// The maximum bytes to keep in the cache without pruning, after which automatic pruning may kick in.
5859    pub async fn keep_bytes(&self) -> Result<isize, DaggerError> {
5860        let query = self.selection.select("keepBytes");
5861        query.execute(self.graphql_client.clone()).await
5862    }
5863    /// The maximum bytes to keep in the cache without pruning.
5864    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5865        let query = self.selection.select("maxUsedSpace");
5866        query.execute(self.graphql_client.clone()).await
5867    }
5868    /// The target amount of free disk space the garbage collector will attempt to leave.
5869    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5870        let query = self.selection.select("minFreeSpace");
5871        query.execute(self.graphql_client.clone()).await
5872    }
5873    /// Prune the cache of releaseable entries
5874    ///
5875    /// # Arguments
5876    ///
5877    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5878    pub async fn prune(&self) -> Result<Void, DaggerError> {
5879        let query = self.selection.select("prune");
5880        query.execute(self.graphql_client.clone()).await
5881    }
5882    /// Prune the cache of releaseable entries
5883    ///
5884    /// # Arguments
5885    ///
5886    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5887    pub async fn prune_opts(&self, opts: EngineCachePruneOpts) -> Result<Void, DaggerError> {
5888        let mut query = self.selection.select("prune");
5889        if let Some(use_default_policy) = opts.use_default_policy {
5890            query = query.arg("useDefaultPolicy", use_default_policy);
5891        }
5892        query.execute(self.graphql_client.clone()).await
5893    }
5894    /// The minimum amount of disk space this policy is guaranteed to retain.
5895    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
5896        let query = self.selection.select("reservedSpace");
5897        query.execute(self.graphql_client.clone()).await
5898    }
5899    /// The target number of bytes to keep when pruning.
5900    pub async fn target_space(&self) -> Result<isize, DaggerError> {
5901        let query = self.selection.select("targetSpace");
5902        query.execute(self.graphql_client.clone()).await
5903    }
5904}
5905#[derive(Clone)]
5906pub struct EngineCacheEntry {
5907    pub proc: Option<Arc<DaggerSessionProc>>,
5908    pub selection: Selection,
5909    pub graphql_client: DynGraphQLClient,
5910}
5911impl EngineCacheEntry {
5912    /// Whether the cache entry is actively being used.
5913    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
5914        let query = self.selection.select("activelyUsed");
5915        query.execute(self.graphql_client.clone()).await
5916    }
5917    /// The time the cache entry was created, in Unix nanoseconds.
5918    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
5919        let query = self.selection.select("createdTimeUnixNano");
5920        query.execute(self.graphql_client.clone()).await
5921    }
5922    /// The description of the cache entry.
5923    pub async fn description(&self) -> Result<String, DaggerError> {
5924        let query = self.selection.select("description");
5925        query.execute(self.graphql_client.clone()).await
5926    }
5927    /// The disk space used by the cache entry.
5928    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5929        let query = self.selection.select("diskSpaceBytes");
5930        query.execute(self.graphql_client.clone()).await
5931    }
5932    /// A unique identifier for this EngineCacheEntry.
5933    pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
5934        let query = self.selection.select("id");
5935        query.execute(self.graphql_client.clone()).await
5936    }
5937    /// The most recent time the cache entry was used, in Unix nanoseconds.
5938    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
5939        let query = self.selection.select("mostRecentUseTimeUnixNano");
5940        query.execute(self.graphql_client.clone()).await
5941    }
5942}
5943#[derive(Clone)]
5944pub struct EngineCacheEntrySet {
5945    pub proc: Option<Arc<DaggerSessionProc>>,
5946    pub selection: Selection,
5947    pub graphql_client: DynGraphQLClient,
5948}
5949impl EngineCacheEntrySet {
5950    /// The total disk space used by the cache entries in this set.
5951    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5952        let query = self.selection.select("diskSpaceBytes");
5953        query.execute(self.graphql_client.clone()).await
5954    }
5955    /// The list of individual cache entries in the set
5956    pub fn entries(&self) -> Vec<EngineCacheEntry> {
5957        let query = self.selection.select("entries");
5958        vec![EngineCacheEntry {
5959            proc: self.proc.clone(),
5960            selection: query,
5961            graphql_client: self.graphql_client.clone(),
5962        }]
5963    }
5964    /// The number of cache entries in this set.
5965    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
5966        let query = self.selection.select("entryCount");
5967        query.execute(self.graphql_client.clone()).await
5968    }
5969    /// A unique identifier for this EngineCacheEntrySet.
5970    pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
5971        let query = self.selection.select("id");
5972        query.execute(self.graphql_client.clone()).await
5973    }
5974}
5975#[derive(Clone)]
5976pub struct EnumTypeDef {
5977    pub proc: Option<Arc<DaggerSessionProc>>,
5978    pub selection: Selection,
5979    pub graphql_client: DynGraphQLClient,
5980}
5981impl EnumTypeDef {
5982    /// A doc string for the enum, if any.
5983    pub async fn description(&self) -> Result<String, DaggerError> {
5984        let query = self.selection.select("description");
5985        query.execute(self.graphql_client.clone()).await
5986    }
5987    /// A unique identifier for this EnumTypeDef.
5988    pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
5989        let query = self.selection.select("id");
5990        query.execute(self.graphql_client.clone()).await
5991    }
5992    /// The members of the enum.
5993    pub fn members(&self) -> Vec<EnumValueTypeDef> {
5994        let query = self.selection.select("members");
5995        vec![EnumValueTypeDef {
5996            proc: self.proc.clone(),
5997            selection: query,
5998            graphql_client: self.graphql_client.clone(),
5999        }]
6000    }
6001    /// The name of the enum.
6002    pub async fn name(&self) -> Result<String, DaggerError> {
6003        let query = self.selection.select("name");
6004        query.execute(self.graphql_client.clone()).await
6005    }
6006    /// The location of this enum declaration.
6007    pub fn source_map(&self) -> SourceMap {
6008        let query = self.selection.select("sourceMap");
6009        SourceMap {
6010            proc: self.proc.clone(),
6011            selection: query,
6012            graphql_client: self.graphql_client.clone(),
6013        }
6014    }
6015    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
6016    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6017        let query = self.selection.select("sourceModuleName");
6018        query.execute(self.graphql_client.clone()).await
6019    }
6020    pub fn values(&self) -> Vec<EnumValueTypeDef> {
6021        let query = self.selection.select("values");
6022        vec![EnumValueTypeDef {
6023            proc: self.proc.clone(),
6024            selection: query,
6025            graphql_client: self.graphql_client.clone(),
6026        }]
6027    }
6028}
6029#[derive(Clone)]
6030pub struct EnumValueTypeDef {
6031    pub proc: Option<Arc<DaggerSessionProc>>,
6032    pub selection: Selection,
6033    pub graphql_client: DynGraphQLClient,
6034}
6035impl EnumValueTypeDef {
6036    /// A doc string for the enum member, if any.
6037    pub async fn description(&self) -> Result<String, DaggerError> {
6038        let query = self.selection.select("description");
6039        query.execute(self.graphql_client.clone()).await
6040    }
6041    /// A unique identifier for this EnumValueTypeDef.
6042    pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
6043        let query = self.selection.select("id");
6044        query.execute(self.graphql_client.clone()).await
6045    }
6046    /// The name of the enum member.
6047    pub async fn name(&self) -> Result<String, DaggerError> {
6048        let query = self.selection.select("name");
6049        query.execute(self.graphql_client.clone()).await
6050    }
6051    /// The location of this enum member declaration.
6052    pub fn source_map(&self) -> SourceMap {
6053        let query = self.selection.select("sourceMap");
6054        SourceMap {
6055            proc: self.proc.clone(),
6056            selection: query,
6057            graphql_client: self.graphql_client.clone(),
6058        }
6059    }
6060    /// The value of the enum member
6061    pub async fn value(&self) -> Result<String, DaggerError> {
6062        let query = self.selection.select("value");
6063        query.execute(self.graphql_client.clone()).await
6064    }
6065}
6066#[derive(Clone)]
6067pub struct Env {
6068    pub proc: Option<Arc<DaggerSessionProc>>,
6069    pub selection: Selection,
6070    pub graphql_client: DynGraphQLClient,
6071}
6072impl Env {
6073    /// A unique identifier for this Env.
6074    pub async fn id(&self) -> Result<EnvId, DaggerError> {
6075        let query = self.selection.select("id");
6076        query.execute(self.graphql_client.clone()).await
6077    }
6078    /// retrieve an input value by name
6079    pub fn input(&self, name: impl Into<String>) -> Binding {
6080        let mut query = self.selection.select("input");
6081        query = query.arg("name", name.into());
6082        Binding {
6083            proc: self.proc.clone(),
6084            selection: query,
6085            graphql_client: self.graphql_client.clone(),
6086        }
6087    }
6088    /// return all input values for the environment
6089    pub fn inputs(&self) -> Vec<Binding> {
6090        let query = self.selection.select("inputs");
6091        vec![Binding {
6092            proc: self.proc.clone(),
6093            selection: query,
6094            graphql_client: self.graphql_client.clone(),
6095        }]
6096    }
6097    /// retrieve an output value by name
6098    pub fn output(&self, name: impl Into<String>) -> Binding {
6099        let mut query = self.selection.select("output");
6100        query = query.arg("name", name.into());
6101        Binding {
6102            proc: self.proc.clone(),
6103            selection: query,
6104            graphql_client: self.graphql_client.clone(),
6105        }
6106    }
6107    /// return all output values for the environment
6108    pub fn outputs(&self) -> Vec<Binding> {
6109        let query = self.selection.select("outputs");
6110        vec![Binding {
6111            proc: self.proc.clone(),
6112            selection: query,
6113            graphql_client: self.graphql_client.clone(),
6114        }]
6115    }
6116    /// Create or update a binding of type CacheVolume in the environment
6117    ///
6118    /// # Arguments
6119    ///
6120    /// * `name` - The name of the binding
6121    /// * `value` - The CacheVolume value to assign to the binding
6122    /// * `description` - The purpose of the input
6123    pub fn with_cache_volume_input(
6124        &self,
6125        name: impl Into<String>,
6126        value: impl IntoID<CacheVolumeId>,
6127        description: impl Into<String>,
6128    ) -> Env {
6129        let mut query = self.selection.select("withCacheVolumeInput");
6130        query = query.arg("name", name.into());
6131        query = query.arg_lazy(
6132            "value",
6133            Box::new(move || {
6134                let value = value.clone();
6135                Box::pin(async move { value.into_id().await.unwrap().quote() })
6136            }),
6137        );
6138        query = query.arg("description", description.into());
6139        Env {
6140            proc: self.proc.clone(),
6141            selection: query,
6142            graphql_client: self.graphql_client.clone(),
6143        }
6144    }
6145    /// Declare a desired CacheVolume output to be assigned in the environment
6146    ///
6147    /// # Arguments
6148    ///
6149    /// * `name` - The name of the binding
6150    /// * `description` - A description of the desired value of the binding
6151    pub fn with_cache_volume_output(
6152        &self,
6153        name: impl Into<String>,
6154        description: impl Into<String>,
6155    ) -> Env {
6156        let mut query = self.selection.select("withCacheVolumeOutput");
6157        query = query.arg("name", name.into());
6158        query = query.arg("description", description.into());
6159        Env {
6160            proc: self.proc.clone(),
6161            selection: query,
6162            graphql_client: self.graphql_client.clone(),
6163        }
6164    }
6165    /// Create or update a binding of type Changeset in the environment
6166    ///
6167    /// # Arguments
6168    ///
6169    /// * `name` - The name of the binding
6170    /// * `value` - The Changeset value to assign to the binding
6171    /// * `description` - The purpose of the input
6172    pub fn with_changeset_input(
6173        &self,
6174        name: impl Into<String>,
6175        value: impl IntoID<ChangesetId>,
6176        description: impl Into<String>,
6177    ) -> Env {
6178        let mut query = self.selection.select("withChangesetInput");
6179        query = query.arg("name", name.into());
6180        query = query.arg_lazy(
6181            "value",
6182            Box::new(move || {
6183                let value = value.clone();
6184                Box::pin(async move { value.into_id().await.unwrap().quote() })
6185            }),
6186        );
6187        query = query.arg("description", description.into());
6188        Env {
6189            proc: self.proc.clone(),
6190            selection: query,
6191            graphql_client: self.graphql_client.clone(),
6192        }
6193    }
6194    /// Declare a desired Changeset output to be assigned in the environment
6195    ///
6196    /// # Arguments
6197    ///
6198    /// * `name` - The name of the binding
6199    /// * `description` - A description of the desired value of the binding
6200    pub fn with_changeset_output(
6201        &self,
6202        name: impl Into<String>,
6203        description: impl Into<String>,
6204    ) -> Env {
6205        let mut query = self.selection.select("withChangesetOutput");
6206        query = query.arg("name", name.into());
6207        query = query.arg("description", description.into());
6208        Env {
6209            proc: self.proc.clone(),
6210            selection: query,
6211            graphql_client: self.graphql_client.clone(),
6212        }
6213    }
6214    /// Create or update a binding of type Cloud in the environment
6215    ///
6216    /// # Arguments
6217    ///
6218    /// * `name` - The name of the binding
6219    /// * `value` - The Cloud value to assign to the binding
6220    /// * `description` - The purpose of the input
6221    pub fn with_cloud_input(
6222        &self,
6223        name: impl Into<String>,
6224        value: impl IntoID<CloudId>,
6225        description: impl Into<String>,
6226    ) -> Env {
6227        let mut query = self.selection.select("withCloudInput");
6228        query = query.arg("name", name.into());
6229        query = query.arg_lazy(
6230            "value",
6231            Box::new(move || {
6232                let value = value.clone();
6233                Box::pin(async move { value.into_id().await.unwrap().quote() })
6234            }),
6235        );
6236        query = query.arg("description", description.into());
6237        Env {
6238            proc: self.proc.clone(),
6239            selection: query,
6240            graphql_client: self.graphql_client.clone(),
6241        }
6242    }
6243    /// Declare a desired Cloud output to be assigned in the environment
6244    ///
6245    /// # Arguments
6246    ///
6247    /// * `name` - The name of the binding
6248    /// * `description` - A description of the desired value of the binding
6249    pub fn with_cloud_output(
6250        &self,
6251        name: impl Into<String>,
6252        description: impl Into<String>,
6253    ) -> Env {
6254        let mut query = self.selection.select("withCloudOutput");
6255        query = query.arg("name", name.into());
6256        query = query.arg("description", description.into());
6257        Env {
6258            proc: self.proc.clone(),
6259            selection: query,
6260            graphql_client: self.graphql_client.clone(),
6261        }
6262    }
6263    /// Create or update a binding of type Container in the environment
6264    ///
6265    /// # Arguments
6266    ///
6267    /// * `name` - The name of the binding
6268    /// * `value` - The Container value to assign to the binding
6269    /// * `description` - The purpose of the input
6270    pub fn with_container_input(
6271        &self,
6272        name: impl Into<String>,
6273        value: impl IntoID<ContainerId>,
6274        description: impl Into<String>,
6275    ) -> Env {
6276        let mut query = self.selection.select("withContainerInput");
6277        query = query.arg("name", name.into());
6278        query = query.arg_lazy(
6279            "value",
6280            Box::new(move || {
6281                let value = value.clone();
6282                Box::pin(async move { value.into_id().await.unwrap().quote() })
6283            }),
6284        );
6285        query = query.arg("description", description.into());
6286        Env {
6287            proc: self.proc.clone(),
6288            selection: query,
6289            graphql_client: self.graphql_client.clone(),
6290        }
6291    }
6292    /// Declare a desired Container output to be assigned in the environment
6293    ///
6294    /// # Arguments
6295    ///
6296    /// * `name` - The name of the binding
6297    /// * `description` - A description of the desired value of the binding
6298    pub fn with_container_output(
6299        &self,
6300        name: impl Into<String>,
6301        description: impl Into<String>,
6302    ) -> Env {
6303        let mut query = self.selection.select("withContainerOutput");
6304        query = query.arg("name", name.into());
6305        query = query.arg("description", description.into());
6306        Env {
6307            proc: self.proc.clone(),
6308            selection: query,
6309            graphql_client: self.graphql_client.clone(),
6310        }
6311    }
6312    /// Create or update a binding of type Directory in the environment
6313    ///
6314    /// # Arguments
6315    ///
6316    /// * `name` - The name of the binding
6317    /// * `value` - The Directory value to assign to the binding
6318    /// * `description` - The purpose of the input
6319    pub fn with_directory_input(
6320        &self,
6321        name: impl Into<String>,
6322        value: impl IntoID<DirectoryId>,
6323        description: impl Into<String>,
6324    ) -> Env {
6325        let mut query = self.selection.select("withDirectoryInput");
6326        query = query.arg("name", name.into());
6327        query = query.arg_lazy(
6328            "value",
6329            Box::new(move || {
6330                let value = value.clone();
6331                Box::pin(async move { value.into_id().await.unwrap().quote() })
6332            }),
6333        );
6334        query = query.arg("description", description.into());
6335        Env {
6336            proc: self.proc.clone(),
6337            selection: query,
6338            graphql_client: self.graphql_client.clone(),
6339        }
6340    }
6341    /// Declare a desired Directory output to be assigned in the environment
6342    ///
6343    /// # Arguments
6344    ///
6345    /// * `name` - The name of the binding
6346    /// * `description` - A description of the desired value of the binding
6347    pub fn with_directory_output(
6348        &self,
6349        name: impl Into<String>,
6350        description: impl Into<String>,
6351    ) -> Env {
6352        let mut query = self.selection.select("withDirectoryOutput");
6353        query = query.arg("name", name.into());
6354        query = query.arg("description", description.into());
6355        Env {
6356            proc: self.proc.clone(),
6357            selection: query,
6358            graphql_client: self.graphql_client.clone(),
6359        }
6360    }
6361    /// Create or update a binding of type EnvFile in the environment
6362    ///
6363    /// # Arguments
6364    ///
6365    /// * `name` - The name of the binding
6366    /// * `value` - The EnvFile value to assign to the binding
6367    /// * `description` - The purpose of the input
6368    pub fn with_env_file_input(
6369        &self,
6370        name: impl Into<String>,
6371        value: impl IntoID<EnvFileId>,
6372        description: impl Into<String>,
6373    ) -> Env {
6374        let mut query = self.selection.select("withEnvFileInput");
6375        query = query.arg("name", name.into());
6376        query = query.arg_lazy(
6377            "value",
6378            Box::new(move || {
6379                let value = value.clone();
6380                Box::pin(async move { value.into_id().await.unwrap().quote() })
6381            }),
6382        );
6383        query = query.arg("description", description.into());
6384        Env {
6385            proc: self.proc.clone(),
6386            selection: query,
6387            graphql_client: self.graphql_client.clone(),
6388        }
6389    }
6390    /// Declare a desired EnvFile output to be assigned in the environment
6391    ///
6392    /// # Arguments
6393    ///
6394    /// * `name` - The name of the binding
6395    /// * `description` - A description of the desired value of the binding
6396    pub fn with_env_file_output(
6397        &self,
6398        name: impl Into<String>,
6399        description: impl Into<String>,
6400    ) -> Env {
6401        let mut query = self.selection.select("withEnvFileOutput");
6402        query = query.arg("name", name.into());
6403        query = query.arg("description", description.into());
6404        Env {
6405            proc: self.proc.clone(),
6406            selection: query,
6407            graphql_client: self.graphql_client.clone(),
6408        }
6409    }
6410    /// Create or update a binding of type Env in the environment
6411    ///
6412    /// # Arguments
6413    ///
6414    /// * `name` - The name of the binding
6415    /// * `value` - The Env value to assign to the binding
6416    /// * `description` - The purpose of the input
6417    pub fn with_env_input(
6418        &self,
6419        name: impl Into<String>,
6420        value: impl IntoID<EnvId>,
6421        description: impl Into<String>,
6422    ) -> Env {
6423        let mut query = self.selection.select("withEnvInput");
6424        query = query.arg("name", name.into());
6425        query = query.arg_lazy(
6426            "value",
6427            Box::new(move || {
6428                let value = value.clone();
6429                Box::pin(async move { value.into_id().await.unwrap().quote() })
6430            }),
6431        );
6432        query = query.arg("description", description.into());
6433        Env {
6434            proc: self.proc.clone(),
6435            selection: query,
6436            graphql_client: self.graphql_client.clone(),
6437        }
6438    }
6439    /// Declare a desired Env output to be assigned in the environment
6440    ///
6441    /// # Arguments
6442    ///
6443    /// * `name` - The name of the binding
6444    /// * `description` - A description of the desired value of the binding
6445    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6446        let mut query = self.selection.select("withEnvOutput");
6447        query = query.arg("name", name.into());
6448        query = query.arg("description", description.into());
6449        Env {
6450            proc: self.proc.clone(),
6451            selection: query,
6452            graphql_client: self.graphql_client.clone(),
6453        }
6454    }
6455    /// Create or update a binding of type File in the environment
6456    ///
6457    /// # Arguments
6458    ///
6459    /// * `name` - The name of the binding
6460    /// * `value` - The File value to assign to the binding
6461    /// * `description` - The purpose of the input
6462    pub fn with_file_input(
6463        &self,
6464        name: impl Into<String>,
6465        value: impl IntoID<FileId>,
6466        description: impl Into<String>,
6467    ) -> Env {
6468        let mut query = self.selection.select("withFileInput");
6469        query = query.arg("name", name.into());
6470        query = query.arg_lazy(
6471            "value",
6472            Box::new(move || {
6473                let value = value.clone();
6474                Box::pin(async move { value.into_id().await.unwrap().quote() })
6475            }),
6476        );
6477        query = query.arg("description", description.into());
6478        Env {
6479            proc: self.proc.clone(),
6480            selection: query,
6481            graphql_client: self.graphql_client.clone(),
6482        }
6483    }
6484    /// Declare a desired File output to be assigned in the environment
6485    ///
6486    /// # Arguments
6487    ///
6488    /// * `name` - The name of the binding
6489    /// * `description` - A description of the desired value of the binding
6490    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6491        let mut query = self.selection.select("withFileOutput");
6492        query = query.arg("name", name.into());
6493        query = query.arg("description", description.into());
6494        Env {
6495            proc: self.proc.clone(),
6496            selection: query,
6497            graphql_client: self.graphql_client.clone(),
6498        }
6499    }
6500    /// Create or update a binding of type GitRef in the environment
6501    ///
6502    /// # Arguments
6503    ///
6504    /// * `name` - The name of the binding
6505    /// * `value` - The GitRef value to assign to the binding
6506    /// * `description` - The purpose of the input
6507    pub fn with_git_ref_input(
6508        &self,
6509        name: impl Into<String>,
6510        value: impl IntoID<GitRefId>,
6511        description: impl Into<String>,
6512    ) -> Env {
6513        let mut query = self.selection.select("withGitRefInput");
6514        query = query.arg("name", name.into());
6515        query = query.arg_lazy(
6516            "value",
6517            Box::new(move || {
6518                let value = value.clone();
6519                Box::pin(async move { value.into_id().await.unwrap().quote() })
6520            }),
6521        );
6522        query = query.arg("description", description.into());
6523        Env {
6524            proc: self.proc.clone(),
6525            selection: query,
6526            graphql_client: self.graphql_client.clone(),
6527        }
6528    }
6529    /// Declare a desired GitRef output to be assigned in the environment
6530    ///
6531    /// # Arguments
6532    ///
6533    /// * `name` - The name of the binding
6534    /// * `description` - A description of the desired value of the binding
6535    pub fn with_git_ref_output(
6536        &self,
6537        name: impl Into<String>,
6538        description: impl Into<String>,
6539    ) -> Env {
6540        let mut query = self.selection.select("withGitRefOutput");
6541        query = query.arg("name", name.into());
6542        query = query.arg("description", description.into());
6543        Env {
6544            proc: self.proc.clone(),
6545            selection: query,
6546            graphql_client: self.graphql_client.clone(),
6547        }
6548    }
6549    /// Create or update a binding of type GitRepository in the environment
6550    ///
6551    /// # Arguments
6552    ///
6553    /// * `name` - The name of the binding
6554    /// * `value` - The GitRepository value to assign to the binding
6555    /// * `description` - The purpose of the input
6556    pub fn with_git_repository_input(
6557        &self,
6558        name: impl Into<String>,
6559        value: impl IntoID<GitRepositoryId>,
6560        description: impl Into<String>,
6561    ) -> Env {
6562        let mut query = self.selection.select("withGitRepositoryInput");
6563        query = query.arg("name", name.into());
6564        query = query.arg_lazy(
6565            "value",
6566            Box::new(move || {
6567                let value = value.clone();
6568                Box::pin(async move { value.into_id().await.unwrap().quote() })
6569            }),
6570        );
6571        query = query.arg("description", description.into());
6572        Env {
6573            proc: self.proc.clone(),
6574            selection: query,
6575            graphql_client: self.graphql_client.clone(),
6576        }
6577    }
6578    /// Declare a desired GitRepository output to be assigned in the environment
6579    ///
6580    /// # Arguments
6581    ///
6582    /// * `name` - The name of the binding
6583    /// * `description` - A description of the desired value of the binding
6584    pub fn with_git_repository_output(
6585        &self,
6586        name: impl Into<String>,
6587        description: impl Into<String>,
6588    ) -> Env {
6589        let mut query = self.selection.select("withGitRepositoryOutput");
6590        query = query.arg("name", name.into());
6591        query = query.arg("description", description.into());
6592        Env {
6593            proc: self.proc.clone(),
6594            selection: query,
6595            graphql_client: self.graphql_client.clone(),
6596        }
6597    }
6598    /// Create or update a binding of type JSONValue in the environment
6599    ///
6600    /// # Arguments
6601    ///
6602    /// * `name` - The name of the binding
6603    /// * `value` - The JSONValue value to assign to the binding
6604    /// * `description` - The purpose of the input
6605    pub fn with_json_value_input(
6606        &self,
6607        name: impl Into<String>,
6608        value: impl IntoID<JsonValueId>,
6609        description: impl Into<String>,
6610    ) -> Env {
6611        let mut query = self.selection.select("withJSONValueInput");
6612        query = query.arg("name", name.into());
6613        query = query.arg_lazy(
6614            "value",
6615            Box::new(move || {
6616                let value = value.clone();
6617                Box::pin(async move { value.into_id().await.unwrap().quote() })
6618            }),
6619        );
6620        query = query.arg("description", description.into());
6621        Env {
6622            proc: self.proc.clone(),
6623            selection: query,
6624            graphql_client: self.graphql_client.clone(),
6625        }
6626    }
6627    /// Declare a desired JSONValue output to be assigned in the environment
6628    ///
6629    /// # Arguments
6630    ///
6631    /// * `name` - The name of the binding
6632    /// * `description` - A description of the desired value of the binding
6633    pub fn with_json_value_output(
6634        &self,
6635        name: impl Into<String>,
6636        description: impl Into<String>,
6637    ) -> Env {
6638        let mut query = self.selection.select("withJSONValueOutput");
6639        query = query.arg("name", name.into());
6640        query = query.arg("description", description.into());
6641        Env {
6642            proc: self.proc.clone(),
6643            selection: query,
6644            graphql_client: self.graphql_client.clone(),
6645        }
6646    }
6647    /// Create or update a binding of type LLM in the environment
6648    ///
6649    /// # Arguments
6650    ///
6651    /// * `name` - The name of the binding
6652    /// * `value` - The LLM value to assign to the binding
6653    /// * `description` - The purpose of the input
6654    pub fn with_llm_input(
6655        &self,
6656        name: impl Into<String>,
6657        value: impl IntoID<Llmid>,
6658        description: impl Into<String>,
6659    ) -> Env {
6660        let mut query = self.selection.select("withLLMInput");
6661        query = query.arg("name", name.into());
6662        query = query.arg_lazy(
6663            "value",
6664            Box::new(move || {
6665                let value = value.clone();
6666                Box::pin(async move { value.into_id().await.unwrap().quote() })
6667            }),
6668        );
6669        query = query.arg("description", description.into());
6670        Env {
6671            proc: self.proc.clone(),
6672            selection: query,
6673            graphql_client: self.graphql_client.clone(),
6674        }
6675    }
6676    /// Declare a desired LLM output to be assigned in the environment
6677    ///
6678    /// # Arguments
6679    ///
6680    /// * `name` - The name of the binding
6681    /// * `description` - A description of the desired value of the binding
6682    pub fn with_llm_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6683        let mut query = self.selection.select("withLLMOutput");
6684        query = query.arg("name", name.into());
6685        query = query.arg("description", description.into());
6686        Env {
6687            proc: self.proc.clone(),
6688            selection: query,
6689            graphql_client: self.graphql_client.clone(),
6690        }
6691    }
6692    /// Create or update a binding of type ModuleConfigClient in the environment
6693    ///
6694    /// # Arguments
6695    ///
6696    /// * `name` - The name of the binding
6697    /// * `value` - The ModuleConfigClient value to assign to the binding
6698    /// * `description` - The purpose of the input
6699    pub fn with_module_config_client_input(
6700        &self,
6701        name: impl Into<String>,
6702        value: impl IntoID<ModuleConfigClientId>,
6703        description: impl Into<String>,
6704    ) -> Env {
6705        let mut query = self.selection.select("withModuleConfigClientInput");
6706        query = query.arg("name", name.into());
6707        query = query.arg_lazy(
6708            "value",
6709            Box::new(move || {
6710                let value = value.clone();
6711                Box::pin(async move { value.into_id().await.unwrap().quote() })
6712            }),
6713        );
6714        query = query.arg("description", description.into());
6715        Env {
6716            proc: self.proc.clone(),
6717            selection: query,
6718            graphql_client: self.graphql_client.clone(),
6719        }
6720    }
6721    /// Declare a desired ModuleConfigClient output to be assigned in the environment
6722    ///
6723    /// # Arguments
6724    ///
6725    /// * `name` - The name of the binding
6726    /// * `description` - A description of the desired value of the binding
6727    pub fn with_module_config_client_output(
6728        &self,
6729        name: impl Into<String>,
6730        description: impl Into<String>,
6731    ) -> Env {
6732        let mut query = self.selection.select("withModuleConfigClientOutput");
6733        query = query.arg("name", name.into());
6734        query = query.arg("description", description.into());
6735        Env {
6736            proc: self.proc.clone(),
6737            selection: query,
6738            graphql_client: self.graphql_client.clone(),
6739        }
6740    }
6741    /// Create or update a binding of type Module in the environment
6742    ///
6743    /// # Arguments
6744    ///
6745    /// * `name` - The name of the binding
6746    /// * `value` - The Module value to assign to the binding
6747    /// * `description` - The purpose of the input
6748    pub fn with_module_input(
6749        &self,
6750        name: impl Into<String>,
6751        value: impl IntoID<ModuleId>,
6752        description: impl Into<String>,
6753    ) -> Env {
6754        let mut query = self.selection.select("withModuleInput");
6755        query = query.arg("name", name.into());
6756        query = query.arg_lazy(
6757            "value",
6758            Box::new(move || {
6759                let value = value.clone();
6760                Box::pin(async move { value.into_id().await.unwrap().quote() })
6761            }),
6762        );
6763        query = query.arg("description", description.into());
6764        Env {
6765            proc: self.proc.clone(),
6766            selection: query,
6767            graphql_client: self.graphql_client.clone(),
6768        }
6769    }
6770    /// Declare a desired Module output to be assigned in the environment
6771    ///
6772    /// # Arguments
6773    ///
6774    /// * `name` - The name of the binding
6775    /// * `description` - A description of the desired value of the binding
6776    pub fn with_module_output(
6777        &self,
6778        name: impl Into<String>,
6779        description: impl Into<String>,
6780    ) -> Env {
6781        let mut query = self.selection.select("withModuleOutput");
6782        query = query.arg("name", name.into());
6783        query = query.arg("description", description.into());
6784        Env {
6785            proc: self.proc.clone(),
6786            selection: query,
6787            graphql_client: self.graphql_client.clone(),
6788        }
6789    }
6790    /// Create or update a binding of type ModuleSource in the environment
6791    ///
6792    /// # Arguments
6793    ///
6794    /// * `name` - The name of the binding
6795    /// * `value` - The ModuleSource value to assign to the binding
6796    /// * `description` - The purpose of the input
6797    pub fn with_module_source_input(
6798        &self,
6799        name: impl Into<String>,
6800        value: impl IntoID<ModuleSourceId>,
6801        description: impl Into<String>,
6802    ) -> Env {
6803        let mut query = self.selection.select("withModuleSourceInput");
6804        query = query.arg("name", name.into());
6805        query = query.arg_lazy(
6806            "value",
6807            Box::new(move || {
6808                let value = value.clone();
6809                Box::pin(async move { value.into_id().await.unwrap().quote() })
6810            }),
6811        );
6812        query = query.arg("description", description.into());
6813        Env {
6814            proc: self.proc.clone(),
6815            selection: query,
6816            graphql_client: self.graphql_client.clone(),
6817        }
6818    }
6819    /// Declare a desired ModuleSource output to be assigned in the environment
6820    ///
6821    /// # Arguments
6822    ///
6823    /// * `name` - The name of the binding
6824    /// * `description` - A description of the desired value of the binding
6825    pub fn with_module_source_output(
6826        &self,
6827        name: impl Into<String>,
6828        description: impl Into<String>,
6829    ) -> Env {
6830        let mut query = self.selection.select("withModuleSourceOutput");
6831        query = query.arg("name", name.into());
6832        query = query.arg("description", description.into());
6833        Env {
6834            proc: self.proc.clone(),
6835            selection: query,
6836            graphql_client: self.graphql_client.clone(),
6837        }
6838    }
6839    /// Create or update a binding of type SearchResult in the environment
6840    ///
6841    /// # Arguments
6842    ///
6843    /// * `name` - The name of the binding
6844    /// * `value` - The SearchResult value to assign to the binding
6845    /// * `description` - The purpose of the input
6846    pub fn with_search_result_input(
6847        &self,
6848        name: impl Into<String>,
6849        value: impl IntoID<SearchResultId>,
6850        description: impl Into<String>,
6851    ) -> Env {
6852        let mut query = self.selection.select("withSearchResultInput");
6853        query = query.arg("name", name.into());
6854        query = query.arg_lazy(
6855            "value",
6856            Box::new(move || {
6857                let value = value.clone();
6858                Box::pin(async move { value.into_id().await.unwrap().quote() })
6859            }),
6860        );
6861        query = query.arg("description", description.into());
6862        Env {
6863            proc: self.proc.clone(),
6864            selection: query,
6865            graphql_client: self.graphql_client.clone(),
6866        }
6867    }
6868    /// Declare a desired SearchResult output to be assigned in the environment
6869    ///
6870    /// # Arguments
6871    ///
6872    /// * `name` - The name of the binding
6873    /// * `description` - A description of the desired value of the binding
6874    pub fn with_search_result_output(
6875        &self,
6876        name: impl Into<String>,
6877        description: impl Into<String>,
6878    ) -> Env {
6879        let mut query = self.selection.select("withSearchResultOutput");
6880        query = query.arg("name", name.into());
6881        query = query.arg("description", description.into());
6882        Env {
6883            proc: self.proc.clone(),
6884            selection: query,
6885            graphql_client: self.graphql_client.clone(),
6886        }
6887    }
6888    /// Create or update a binding of type SearchSubmatch in the environment
6889    ///
6890    /// # Arguments
6891    ///
6892    /// * `name` - The name of the binding
6893    /// * `value` - The SearchSubmatch value to assign to the binding
6894    /// * `description` - The purpose of the input
6895    pub fn with_search_submatch_input(
6896        &self,
6897        name: impl Into<String>,
6898        value: impl IntoID<SearchSubmatchId>,
6899        description: impl Into<String>,
6900    ) -> Env {
6901        let mut query = self.selection.select("withSearchSubmatchInput");
6902        query = query.arg("name", name.into());
6903        query = query.arg_lazy(
6904            "value",
6905            Box::new(move || {
6906                let value = value.clone();
6907                Box::pin(async move { value.into_id().await.unwrap().quote() })
6908            }),
6909        );
6910        query = query.arg("description", description.into());
6911        Env {
6912            proc: self.proc.clone(),
6913            selection: query,
6914            graphql_client: self.graphql_client.clone(),
6915        }
6916    }
6917    /// Declare a desired SearchSubmatch output to be assigned in the environment
6918    ///
6919    /// # Arguments
6920    ///
6921    /// * `name` - The name of the binding
6922    /// * `description` - A description of the desired value of the binding
6923    pub fn with_search_submatch_output(
6924        &self,
6925        name: impl Into<String>,
6926        description: impl Into<String>,
6927    ) -> Env {
6928        let mut query = self.selection.select("withSearchSubmatchOutput");
6929        query = query.arg("name", name.into());
6930        query = query.arg("description", description.into());
6931        Env {
6932            proc: self.proc.clone(),
6933            selection: query,
6934            graphql_client: self.graphql_client.clone(),
6935        }
6936    }
6937    /// Create or update a binding of type Secret in the environment
6938    ///
6939    /// # Arguments
6940    ///
6941    /// * `name` - The name of the binding
6942    /// * `value` - The Secret value to assign to the binding
6943    /// * `description` - The purpose of the input
6944    pub fn with_secret_input(
6945        &self,
6946        name: impl Into<String>,
6947        value: impl IntoID<SecretId>,
6948        description: impl Into<String>,
6949    ) -> Env {
6950        let mut query = self.selection.select("withSecretInput");
6951        query = query.arg("name", name.into());
6952        query = query.arg_lazy(
6953            "value",
6954            Box::new(move || {
6955                let value = value.clone();
6956                Box::pin(async move { value.into_id().await.unwrap().quote() })
6957            }),
6958        );
6959        query = query.arg("description", description.into());
6960        Env {
6961            proc: self.proc.clone(),
6962            selection: query,
6963            graphql_client: self.graphql_client.clone(),
6964        }
6965    }
6966    /// Declare a desired Secret output to be assigned in the environment
6967    ///
6968    /// # Arguments
6969    ///
6970    /// * `name` - The name of the binding
6971    /// * `description` - A description of the desired value of the binding
6972    pub fn with_secret_output(
6973        &self,
6974        name: impl Into<String>,
6975        description: impl Into<String>,
6976    ) -> Env {
6977        let mut query = self.selection.select("withSecretOutput");
6978        query = query.arg("name", name.into());
6979        query = query.arg("description", description.into());
6980        Env {
6981            proc: self.proc.clone(),
6982            selection: query,
6983            graphql_client: self.graphql_client.clone(),
6984        }
6985    }
6986    /// Create or update a binding of type Service in the environment
6987    ///
6988    /// # Arguments
6989    ///
6990    /// * `name` - The name of the binding
6991    /// * `value` - The Service value to assign to the binding
6992    /// * `description` - The purpose of the input
6993    pub fn with_service_input(
6994        &self,
6995        name: impl Into<String>,
6996        value: impl IntoID<ServiceId>,
6997        description: impl Into<String>,
6998    ) -> Env {
6999        let mut query = self.selection.select("withServiceInput");
7000        query = query.arg("name", name.into());
7001        query = query.arg_lazy(
7002            "value",
7003            Box::new(move || {
7004                let value = value.clone();
7005                Box::pin(async move { value.into_id().await.unwrap().quote() })
7006            }),
7007        );
7008        query = query.arg("description", description.into());
7009        Env {
7010            proc: self.proc.clone(),
7011            selection: query,
7012            graphql_client: self.graphql_client.clone(),
7013        }
7014    }
7015    /// Declare a desired Service output to be assigned in the environment
7016    ///
7017    /// # Arguments
7018    ///
7019    /// * `name` - The name of the binding
7020    /// * `description` - A description of the desired value of the binding
7021    pub fn with_service_output(
7022        &self,
7023        name: impl Into<String>,
7024        description: impl Into<String>,
7025    ) -> Env {
7026        let mut query = self.selection.select("withServiceOutput");
7027        query = query.arg("name", name.into());
7028        query = query.arg("description", description.into());
7029        Env {
7030            proc: self.proc.clone(),
7031            selection: query,
7032            graphql_client: self.graphql_client.clone(),
7033        }
7034    }
7035    /// Create or update a binding of type Socket in the environment
7036    ///
7037    /// # Arguments
7038    ///
7039    /// * `name` - The name of the binding
7040    /// * `value` - The Socket value to assign to the binding
7041    /// * `description` - The purpose of the input
7042    pub fn with_socket_input(
7043        &self,
7044        name: impl Into<String>,
7045        value: impl IntoID<SocketId>,
7046        description: impl Into<String>,
7047    ) -> Env {
7048        let mut query = self.selection.select("withSocketInput");
7049        query = query.arg("name", name.into());
7050        query = query.arg_lazy(
7051            "value",
7052            Box::new(move || {
7053                let value = value.clone();
7054                Box::pin(async move { value.into_id().await.unwrap().quote() })
7055            }),
7056        );
7057        query = query.arg("description", description.into());
7058        Env {
7059            proc: self.proc.clone(),
7060            selection: query,
7061            graphql_client: self.graphql_client.clone(),
7062        }
7063    }
7064    /// Declare a desired Socket output to be assigned in the environment
7065    ///
7066    /// # Arguments
7067    ///
7068    /// * `name` - The name of the binding
7069    /// * `description` - A description of the desired value of the binding
7070    pub fn with_socket_output(
7071        &self,
7072        name: impl Into<String>,
7073        description: impl Into<String>,
7074    ) -> Env {
7075        let mut query = self.selection.select("withSocketOutput");
7076        query = query.arg("name", name.into());
7077        query = query.arg("description", description.into());
7078        Env {
7079            proc: self.proc.clone(),
7080            selection: query,
7081            graphql_client: self.graphql_client.clone(),
7082        }
7083    }
7084    /// Create or update an input value of type string
7085    ///
7086    /// # Arguments
7087    ///
7088    /// * `name` - The name of the binding
7089    /// * `value` - The string value to assign to the binding
7090    /// * `description` - The description of the input
7091    pub fn with_string_input(
7092        &self,
7093        name: impl Into<String>,
7094        value: impl Into<String>,
7095        description: impl Into<String>,
7096    ) -> Env {
7097        let mut query = self.selection.select("withStringInput");
7098        query = query.arg("name", name.into());
7099        query = query.arg("value", value.into());
7100        query = query.arg("description", description.into());
7101        Env {
7102            proc: self.proc.clone(),
7103            selection: query,
7104            graphql_client: self.graphql_client.clone(),
7105        }
7106    }
7107    /// Create or update an input value of type string
7108    ///
7109    /// # Arguments
7110    ///
7111    /// * `name` - The name of the binding
7112    /// * `description` - The description of the output
7113    pub fn with_string_output(
7114        &self,
7115        name: impl Into<String>,
7116        description: impl Into<String>,
7117    ) -> Env {
7118        let mut query = self.selection.select("withStringOutput");
7119        query = query.arg("name", name.into());
7120        query = query.arg("description", description.into());
7121        Env {
7122            proc: self.proc.clone(),
7123            selection: query,
7124            graphql_client: self.graphql_client.clone(),
7125        }
7126    }
7127}
7128#[derive(Clone)]
7129pub struct EnvFile {
7130    pub proc: Option<Arc<DaggerSessionProc>>,
7131    pub selection: Selection,
7132    pub graphql_client: DynGraphQLClient,
7133}
7134impl EnvFile {
7135    /// Return as a file
7136    pub fn as_file(&self) -> File {
7137        let query = self.selection.select("asFile");
7138        File {
7139            proc: self.proc.clone(),
7140            selection: query,
7141            graphql_client: self.graphql_client.clone(),
7142        }
7143    }
7144    /// Check if a variable exists
7145    ///
7146    /// # Arguments
7147    ///
7148    /// * `name` - Variable name
7149    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
7150        let mut query = self.selection.select("exists");
7151        query = query.arg("name", name.into());
7152        query.execute(self.graphql_client.clone()).await
7153    }
7154    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
7155    ///
7156    /// # Arguments
7157    ///
7158    /// * `name` - Variable name
7159    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
7160        let mut query = self.selection.select("get");
7161        query = query.arg("name", name.into());
7162        query.execute(self.graphql_client.clone()).await
7163    }
7164    /// A unique identifier for this EnvFile.
7165    pub async fn id(&self) -> Result<EnvFileId, DaggerError> {
7166        let query = self.selection.select("id");
7167        query.execute(self.graphql_client.clone()).await
7168    }
7169    /// Return all variables
7170    pub fn variables(&self) -> Vec<EnvVariable> {
7171        let query = self.selection.select("variables");
7172        vec![EnvVariable {
7173            proc: self.proc.clone(),
7174            selection: query,
7175            graphql_client: self.graphql_client.clone(),
7176        }]
7177    }
7178    /// Add a variable
7179    ///
7180    /// # Arguments
7181    ///
7182    /// * `name` - Variable name
7183    /// * `value` - Variable value
7184    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
7185        let mut query = self.selection.select("withVariable");
7186        query = query.arg("name", name.into());
7187        query = query.arg("value", value.into());
7188        EnvFile {
7189            proc: self.proc.clone(),
7190            selection: query,
7191            graphql_client: self.graphql_client.clone(),
7192        }
7193    }
7194    /// Remove all occurrences of the named variable
7195    ///
7196    /// # Arguments
7197    ///
7198    /// * `name` - Variable name
7199    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
7200        let mut query = self.selection.select("withoutVariable");
7201        query = query.arg("name", name.into());
7202        EnvFile {
7203            proc: self.proc.clone(),
7204            selection: query,
7205            graphql_client: self.graphql_client.clone(),
7206        }
7207    }
7208}
7209#[derive(Clone)]
7210pub struct EnvVariable {
7211    pub proc: Option<Arc<DaggerSessionProc>>,
7212    pub selection: Selection,
7213    pub graphql_client: DynGraphQLClient,
7214}
7215impl EnvVariable {
7216    /// A unique identifier for this EnvVariable.
7217    pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
7218        let query = self.selection.select("id");
7219        query.execute(self.graphql_client.clone()).await
7220    }
7221    /// The environment variable name.
7222    pub async fn name(&self) -> Result<String, DaggerError> {
7223        let query = self.selection.select("name");
7224        query.execute(self.graphql_client.clone()).await
7225    }
7226    /// The environment variable value.
7227    pub async fn value(&self) -> Result<String, DaggerError> {
7228        let query = self.selection.select("value");
7229        query.execute(self.graphql_client.clone()).await
7230    }
7231}
7232#[derive(Clone)]
7233pub struct Error {
7234    pub proc: Option<Arc<DaggerSessionProc>>,
7235    pub selection: Selection,
7236    pub graphql_client: DynGraphQLClient,
7237}
7238impl Error {
7239    /// A unique identifier for this Error.
7240    pub async fn id(&self) -> Result<ErrorId, DaggerError> {
7241        let query = self.selection.select("id");
7242        query.execute(self.graphql_client.clone()).await
7243    }
7244    /// A description of the error.
7245    pub async fn message(&self) -> Result<String, DaggerError> {
7246        let query = self.selection.select("message");
7247        query.execute(self.graphql_client.clone()).await
7248    }
7249    /// The extensions of the error.
7250    pub fn values(&self) -> Vec<ErrorValue> {
7251        let query = self.selection.select("values");
7252        vec![ErrorValue {
7253            proc: self.proc.clone(),
7254            selection: query,
7255            graphql_client: self.graphql_client.clone(),
7256        }]
7257    }
7258    /// Add a value to the error.
7259    ///
7260    /// # Arguments
7261    ///
7262    /// * `name` - The name of the value.
7263    /// * `value` - The value to store on the error.
7264    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
7265        let mut query = self.selection.select("withValue");
7266        query = query.arg("name", name.into());
7267        query = query.arg("value", value);
7268        Error {
7269            proc: self.proc.clone(),
7270            selection: query,
7271            graphql_client: self.graphql_client.clone(),
7272        }
7273    }
7274}
7275#[derive(Clone)]
7276pub struct ErrorValue {
7277    pub proc: Option<Arc<DaggerSessionProc>>,
7278    pub selection: Selection,
7279    pub graphql_client: DynGraphQLClient,
7280}
7281impl ErrorValue {
7282    /// A unique identifier for this ErrorValue.
7283    pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
7284        let query = self.selection.select("id");
7285        query.execute(self.graphql_client.clone()).await
7286    }
7287    /// The name of the value.
7288    pub async fn name(&self) -> Result<String, DaggerError> {
7289        let query = self.selection.select("name");
7290        query.execute(self.graphql_client.clone()).await
7291    }
7292    /// The value.
7293    pub async fn value(&self) -> Result<Json, DaggerError> {
7294        let query = self.selection.select("value");
7295        query.execute(self.graphql_client.clone()).await
7296    }
7297}
7298#[derive(Clone)]
7299pub struct FieldTypeDef {
7300    pub proc: Option<Arc<DaggerSessionProc>>,
7301    pub selection: Selection,
7302    pub graphql_client: DynGraphQLClient,
7303}
7304impl FieldTypeDef {
7305    /// A doc string for the field, if any.
7306    pub async fn description(&self) -> Result<String, DaggerError> {
7307        let query = self.selection.select("description");
7308        query.execute(self.graphql_client.clone()).await
7309    }
7310    /// A unique identifier for this FieldTypeDef.
7311    pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
7312        let query = self.selection.select("id");
7313        query.execute(self.graphql_client.clone()).await
7314    }
7315    /// The name of the field in lowerCamelCase format.
7316    pub async fn name(&self) -> Result<String, DaggerError> {
7317        let query = self.selection.select("name");
7318        query.execute(self.graphql_client.clone()).await
7319    }
7320    /// The location of this field declaration.
7321    pub fn source_map(&self) -> SourceMap {
7322        let query = self.selection.select("sourceMap");
7323        SourceMap {
7324            proc: self.proc.clone(),
7325            selection: query,
7326            graphql_client: self.graphql_client.clone(),
7327        }
7328    }
7329    /// The type of the field.
7330    pub fn type_def(&self) -> TypeDef {
7331        let query = self.selection.select("typeDef");
7332        TypeDef {
7333            proc: self.proc.clone(),
7334            selection: query,
7335            graphql_client: self.graphql_client.clone(),
7336        }
7337    }
7338}
7339#[derive(Clone)]
7340pub struct File {
7341    pub proc: Option<Arc<DaggerSessionProc>>,
7342    pub selection: Selection,
7343    pub graphql_client: DynGraphQLClient,
7344}
7345#[derive(Builder, Debug, PartialEq)]
7346pub struct FileAsEnvFileOpts {
7347    /// Replace "${VAR}" or "$VAR" with the value of other vars
7348    #[builder(setter(into, strip_option), default)]
7349    pub expand: Option<bool>,
7350}
7351#[derive(Builder, Debug, PartialEq)]
7352pub struct FileContentsOpts {
7353    /// Maximum number of lines to read
7354    #[builder(setter(into, strip_option), default)]
7355    pub limit_lines: Option<isize>,
7356    /// Start reading after this line
7357    #[builder(setter(into, strip_option), default)]
7358    pub offset_lines: Option<isize>,
7359}
7360#[derive(Builder, Debug, PartialEq)]
7361pub struct FileDigestOpts {
7362    /// If true, exclude metadata from the digest.
7363    #[builder(setter(into, strip_option), default)]
7364    pub exclude_metadata: Option<bool>,
7365}
7366#[derive(Builder, Debug, PartialEq)]
7367pub struct FileExportOpts {
7368    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
7369    #[builder(setter(into, strip_option), default)]
7370    pub allow_parent_dir_path: Option<bool>,
7371}
7372#[derive(Builder, Debug, PartialEq)]
7373pub struct FileSearchOpts<'a> {
7374    /// Allow the . pattern to match newlines in multiline mode.
7375    #[builder(setter(into, strip_option), default)]
7376    pub dotall: Option<bool>,
7377    /// Only return matching files, not lines and content
7378    #[builder(setter(into, strip_option), default)]
7379    pub files_only: Option<bool>,
7380    #[builder(setter(into, strip_option), default)]
7381    pub globs: Option<Vec<&'a str>>,
7382    /// Enable case-insensitive matching.
7383    #[builder(setter(into, strip_option), default)]
7384    pub insensitive: Option<bool>,
7385    /// Limit the number of results to return
7386    #[builder(setter(into, strip_option), default)]
7387    pub limit: Option<isize>,
7388    /// Interpret the pattern as a literal string instead of a regular expression.
7389    #[builder(setter(into, strip_option), default)]
7390    pub literal: Option<bool>,
7391    /// Enable searching across multiple lines.
7392    #[builder(setter(into, strip_option), default)]
7393    pub multiline: Option<bool>,
7394    #[builder(setter(into, strip_option), default)]
7395    pub paths: Option<Vec<&'a str>>,
7396    /// Skip hidden files (files starting with .).
7397    #[builder(setter(into, strip_option), default)]
7398    pub skip_hidden: Option<bool>,
7399    /// Honor .gitignore, .ignore, and .rgignore files.
7400    #[builder(setter(into, strip_option), default)]
7401    pub skip_ignored: Option<bool>,
7402}
7403#[derive(Builder, Debug, PartialEq)]
7404pub struct FileWithReplacedOpts {
7405    /// Replace all occurrences of the pattern.
7406    #[builder(setter(into, strip_option), default)]
7407    pub all: Option<bool>,
7408    /// Replace the first match starting from the specified line.
7409    #[builder(setter(into, strip_option), default)]
7410    pub first_from: Option<isize>,
7411}
7412impl File {
7413    /// Parse as an env file
7414    ///
7415    /// # Arguments
7416    ///
7417    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7418    pub fn as_env_file(&self) -> EnvFile {
7419        let query = self.selection.select("asEnvFile");
7420        EnvFile {
7421            proc: self.proc.clone(),
7422            selection: query,
7423            graphql_client: self.graphql_client.clone(),
7424        }
7425    }
7426    /// Parse as an env file
7427    ///
7428    /// # Arguments
7429    ///
7430    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7431    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
7432        let mut query = self.selection.select("asEnvFile");
7433        if let Some(expand) = opts.expand {
7434            query = query.arg("expand", expand);
7435        }
7436        EnvFile {
7437            proc: self.proc.clone(),
7438            selection: query,
7439            graphql_client: self.graphql_client.clone(),
7440        }
7441    }
7442    /// Change the owner of the file recursively.
7443    ///
7444    /// # Arguments
7445    ///
7446    /// * `owner` - A user:group to set for the file.
7447    ///
7448    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
7449    ///
7450    /// If the group is omitted, it defaults to the same as the user.
7451    pub fn chown(&self, owner: impl Into<String>) -> File {
7452        let mut query = self.selection.select("chown");
7453        query = query.arg("owner", owner.into());
7454        File {
7455            proc: self.proc.clone(),
7456            selection: query,
7457            graphql_client: self.graphql_client.clone(),
7458        }
7459    }
7460    /// Retrieves the contents of the file.
7461    ///
7462    /// # Arguments
7463    ///
7464    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7465    pub async fn contents(&self) -> Result<String, DaggerError> {
7466        let query = self.selection.select("contents");
7467        query.execute(self.graphql_client.clone()).await
7468    }
7469    /// Retrieves the contents of the file.
7470    ///
7471    /// # Arguments
7472    ///
7473    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7474    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
7475        let mut query = self.selection.select("contents");
7476        if let Some(offset_lines) = opts.offset_lines {
7477            query = query.arg("offsetLines", offset_lines);
7478        }
7479        if let Some(limit_lines) = opts.limit_lines {
7480            query = query.arg("limitLines", limit_lines);
7481        }
7482        query.execute(self.graphql_client.clone()).await
7483    }
7484    /// 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.
7485    ///
7486    /// # Arguments
7487    ///
7488    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7489    pub async fn digest(&self) -> Result<String, DaggerError> {
7490        let query = self.selection.select("digest");
7491        query.execute(self.graphql_client.clone()).await
7492    }
7493    /// 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.
7494    ///
7495    /// # Arguments
7496    ///
7497    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7498    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
7499        let mut query = self.selection.select("digest");
7500        if let Some(exclude_metadata) = opts.exclude_metadata {
7501            query = query.arg("excludeMetadata", exclude_metadata);
7502        }
7503        query.execute(self.graphql_client.clone()).await
7504    }
7505    /// Writes the file to a file path on the host.
7506    ///
7507    /// # Arguments
7508    ///
7509    /// * `path` - Location of the written directory (e.g., "output.txt").
7510    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7511    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7512        let mut query = self.selection.select("export");
7513        query = query.arg("path", path.into());
7514        query.execute(self.graphql_client.clone()).await
7515    }
7516    /// Writes the file to a file path on the host.
7517    ///
7518    /// # Arguments
7519    ///
7520    /// * `path` - Location of the written directory (e.g., "output.txt").
7521    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7522    pub async fn export_opts(
7523        &self,
7524        path: impl Into<String>,
7525        opts: FileExportOpts,
7526    ) -> Result<String, DaggerError> {
7527        let mut query = self.selection.select("export");
7528        query = query.arg("path", path.into());
7529        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
7530            query = query.arg("allowParentDirPath", allow_parent_dir_path);
7531        }
7532        query.execute(self.graphql_client.clone()).await
7533    }
7534    /// A unique identifier for this File.
7535    pub async fn id(&self) -> Result<FileId, DaggerError> {
7536        let query = self.selection.select("id");
7537        query.execute(self.graphql_client.clone()).await
7538    }
7539    /// Retrieves the name of the file.
7540    pub async fn name(&self) -> Result<String, DaggerError> {
7541        let query = self.selection.select("name");
7542        query.execute(self.graphql_client.clone()).await
7543    }
7544    /// Searches for content matching the given regular expression or literal string.
7545    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
7546    ///
7547    /// # Arguments
7548    ///
7549    /// * `pattern` - The text to match.
7550    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7551    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
7552        let mut query = self.selection.select("search");
7553        query = query.arg("pattern", pattern.into());
7554        vec![SearchResult {
7555            proc: self.proc.clone(),
7556            selection: query,
7557            graphql_client: self.graphql_client.clone(),
7558        }]
7559    }
7560    /// Searches for content matching the given regular expression or literal string.
7561    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
7562    ///
7563    /// # Arguments
7564    ///
7565    /// * `pattern` - The text to match.
7566    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7567    pub fn search_opts<'a>(
7568        &self,
7569        pattern: impl Into<String>,
7570        opts: FileSearchOpts<'a>,
7571    ) -> Vec<SearchResult> {
7572        let mut query = self.selection.select("search");
7573        query = query.arg("pattern", pattern.into());
7574        if let Some(literal) = opts.literal {
7575            query = query.arg("literal", literal);
7576        }
7577        if let Some(multiline) = opts.multiline {
7578            query = query.arg("multiline", multiline);
7579        }
7580        if let Some(dotall) = opts.dotall {
7581            query = query.arg("dotall", dotall);
7582        }
7583        if let Some(insensitive) = opts.insensitive {
7584            query = query.arg("insensitive", insensitive);
7585        }
7586        if let Some(skip_ignored) = opts.skip_ignored {
7587            query = query.arg("skipIgnored", skip_ignored);
7588        }
7589        if let Some(skip_hidden) = opts.skip_hidden {
7590            query = query.arg("skipHidden", skip_hidden);
7591        }
7592        if let Some(files_only) = opts.files_only {
7593            query = query.arg("filesOnly", files_only);
7594        }
7595        if let Some(limit) = opts.limit {
7596            query = query.arg("limit", limit);
7597        }
7598        if let Some(paths) = opts.paths {
7599            query = query.arg("paths", paths);
7600        }
7601        if let Some(globs) = opts.globs {
7602            query = query.arg("globs", globs);
7603        }
7604        vec![SearchResult {
7605            proc: self.proc.clone(),
7606            selection: query,
7607            graphql_client: self.graphql_client.clone(),
7608        }]
7609    }
7610    /// Retrieves the size of the file, in bytes.
7611    pub async fn size(&self) -> Result<isize, DaggerError> {
7612        let query = self.selection.select("size");
7613        query.execute(self.graphql_client.clone()).await
7614    }
7615    /// Force evaluation in the engine.
7616    pub async fn sync(&self) -> Result<FileId, DaggerError> {
7617        let query = self.selection.select("sync");
7618        query.execute(self.graphql_client.clone()).await
7619    }
7620    /// Retrieves this file with its name set to the given name.
7621    ///
7622    /// # Arguments
7623    ///
7624    /// * `name` - Name to set file to.
7625    pub fn with_name(&self, name: impl Into<String>) -> File {
7626        let mut query = self.selection.select("withName");
7627        query = query.arg("name", name.into());
7628        File {
7629            proc: self.proc.clone(),
7630            selection: query,
7631            graphql_client: self.graphql_client.clone(),
7632        }
7633    }
7634    /// Retrieves the file with content replaced with the given text.
7635    /// If 'all' is true, all occurrences of the pattern will be replaced.
7636    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
7637    /// If neither are specified, and there are multiple matches for the pattern, this will error.
7638    /// If there are no matches for the pattern, this will error.
7639    ///
7640    /// # Arguments
7641    ///
7642    /// * `search` - The text to match.
7643    /// * `replacement` - The text to match.
7644    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7645    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
7646        let mut query = self.selection.select("withReplaced");
7647        query = query.arg("search", search.into());
7648        query = query.arg("replacement", replacement.into());
7649        File {
7650            proc: self.proc.clone(),
7651            selection: query,
7652            graphql_client: self.graphql_client.clone(),
7653        }
7654    }
7655    /// Retrieves the file with content replaced with the given text.
7656    /// If 'all' is true, all occurrences of the pattern will be replaced.
7657    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
7658    /// If neither are specified, and there are multiple matches for the pattern, this will error.
7659    /// If there are no matches for the pattern, this will error.
7660    ///
7661    /// # Arguments
7662    ///
7663    /// * `search` - The text to match.
7664    /// * `replacement` - The text to match.
7665    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7666    pub fn with_replaced_opts(
7667        &self,
7668        search: impl Into<String>,
7669        replacement: impl Into<String>,
7670        opts: FileWithReplacedOpts,
7671    ) -> File {
7672        let mut query = self.selection.select("withReplaced");
7673        query = query.arg("search", search.into());
7674        query = query.arg("replacement", replacement.into());
7675        if let Some(all) = opts.all {
7676            query = query.arg("all", all);
7677        }
7678        if let Some(first_from) = opts.first_from {
7679            query = query.arg("firstFrom", first_from);
7680        }
7681        File {
7682            proc: self.proc.clone(),
7683            selection: query,
7684            graphql_client: self.graphql_client.clone(),
7685        }
7686    }
7687    /// Retrieves this file with its created/modified timestamps set to the given time.
7688    ///
7689    /// # Arguments
7690    ///
7691    /// * `timestamp` - Timestamp to set dir/files in.
7692    ///
7693    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
7694    pub fn with_timestamps(&self, timestamp: isize) -> File {
7695        let mut query = self.selection.select("withTimestamps");
7696        query = query.arg("timestamp", timestamp);
7697        File {
7698            proc: self.proc.clone(),
7699            selection: query,
7700            graphql_client: self.graphql_client.clone(),
7701        }
7702    }
7703}
7704#[derive(Clone)]
7705pub struct Function {
7706    pub proc: Option<Arc<DaggerSessionProc>>,
7707    pub selection: Selection,
7708    pub graphql_client: DynGraphQLClient,
7709}
7710#[derive(Builder, Debug, PartialEq)]
7711pub struct FunctionWithArgOpts<'a> {
7712    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
7713    #[builder(setter(into, strip_option), default)]
7714    pub default_path: Option<&'a str>,
7715    /// A default value to use for this argument if not explicitly set by the caller, if any
7716    #[builder(setter(into, strip_option), default)]
7717    pub default_value: Option<Json>,
7718    /// A doc string for the argument, if any
7719    #[builder(setter(into, strip_option), default)]
7720    pub description: Option<&'a str>,
7721    /// Patterns to ignore when loading the contextual argument value.
7722    #[builder(setter(into, strip_option), default)]
7723    pub ignore: Option<Vec<&'a str>>,
7724    /// The source map for the argument definition.
7725    #[builder(setter(into, strip_option), default)]
7726    pub source_map: Option<SourceMapId>,
7727}
7728impl Function {
7729    /// Arguments accepted by the function, if any.
7730    pub fn args(&self) -> Vec<FunctionArg> {
7731        let query = self.selection.select("args");
7732        vec![FunctionArg {
7733            proc: self.proc.clone(),
7734            selection: query,
7735            graphql_client: self.graphql_client.clone(),
7736        }]
7737    }
7738    /// A doc string for the function, if any.
7739    pub async fn description(&self) -> Result<String, DaggerError> {
7740        let query = self.selection.select("description");
7741        query.execute(self.graphql_client.clone()).await
7742    }
7743    /// A unique identifier for this Function.
7744    pub async fn id(&self) -> Result<FunctionId, DaggerError> {
7745        let query = self.selection.select("id");
7746        query.execute(self.graphql_client.clone()).await
7747    }
7748    /// The name of the function.
7749    pub async fn name(&self) -> Result<String, DaggerError> {
7750        let query = self.selection.select("name");
7751        query.execute(self.graphql_client.clone()).await
7752    }
7753    /// The type returned by the function.
7754    pub fn return_type(&self) -> TypeDef {
7755        let query = self.selection.select("returnType");
7756        TypeDef {
7757            proc: self.proc.clone(),
7758            selection: query,
7759            graphql_client: self.graphql_client.clone(),
7760        }
7761    }
7762    /// The location of this function declaration.
7763    pub fn source_map(&self) -> SourceMap {
7764        let query = self.selection.select("sourceMap");
7765        SourceMap {
7766            proc: self.proc.clone(),
7767            selection: query,
7768            graphql_client: self.graphql_client.clone(),
7769        }
7770    }
7771    /// Returns the function with the provided argument
7772    ///
7773    /// # Arguments
7774    ///
7775    /// * `name` - The name of the argument
7776    /// * `type_def` - The type of the argument
7777    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7778    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
7779        let mut query = self.selection.select("withArg");
7780        query = query.arg("name", name.into());
7781        query = query.arg_lazy(
7782            "typeDef",
7783            Box::new(move || {
7784                let type_def = type_def.clone();
7785                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
7786            }),
7787        );
7788        Function {
7789            proc: self.proc.clone(),
7790            selection: query,
7791            graphql_client: self.graphql_client.clone(),
7792        }
7793    }
7794    /// Returns the function with the provided argument
7795    ///
7796    /// # Arguments
7797    ///
7798    /// * `name` - The name of the argument
7799    /// * `type_def` - The type of the argument
7800    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7801    pub fn with_arg_opts<'a>(
7802        &self,
7803        name: impl Into<String>,
7804        type_def: impl IntoID<TypeDefId>,
7805        opts: FunctionWithArgOpts<'a>,
7806    ) -> Function {
7807        let mut query = self.selection.select("withArg");
7808        query = query.arg("name", name.into());
7809        query = query.arg_lazy(
7810            "typeDef",
7811            Box::new(move || {
7812                let type_def = type_def.clone();
7813                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
7814            }),
7815        );
7816        if let Some(description) = opts.description {
7817            query = query.arg("description", description);
7818        }
7819        if let Some(default_value) = opts.default_value {
7820            query = query.arg("defaultValue", default_value);
7821        }
7822        if let Some(default_path) = opts.default_path {
7823            query = query.arg("defaultPath", default_path);
7824        }
7825        if let Some(ignore) = opts.ignore {
7826            query = query.arg("ignore", ignore);
7827        }
7828        if let Some(source_map) = opts.source_map {
7829            query = query.arg("sourceMap", source_map);
7830        }
7831        Function {
7832            proc: self.proc.clone(),
7833            selection: query,
7834            graphql_client: self.graphql_client.clone(),
7835        }
7836    }
7837    /// Returns the function with the given doc string.
7838    ///
7839    /// # Arguments
7840    ///
7841    /// * `description` - The doc string to set.
7842    pub fn with_description(&self, description: impl Into<String>) -> Function {
7843        let mut query = self.selection.select("withDescription");
7844        query = query.arg("description", description.into());
7845        Function {
7846            proc: self.proc.clone(),
7847            selection: query,
7848            graphql_client: self.graphql_client.clone(),
7849        }
7850    }
7851    /// Returns the function with the given source map.
7852    ///
7853    /// # Arguments
7854    ///
7855    /// * `source_map` - The source map for the function definition.
7856    pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
7857        let mut query = self.selection.select("withSourceMap");
7858        query = query.arg_lazy(
7859            "sourceMap",
7860            Box::new(move || {
7861                let source_map = source_map.clone();
7862                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
7863            }),
7864        );
7865        Function {
7866            proc: self.proc.clone(),
7867            selection: query,
7868            graphql_client: self.graphql_client.clone(),
7869        }
7870    }
7871}
7872#[derive(Clone)]
7873pub struct FunctionArg {
7874    pub proc: Option<Arc<DaggerSessionProc>>,
7875    pub selection: Selection,
7876    pub graphql_client: DynGraphQLClient,
7877}
7878impl FunctionArg {
7879    /// 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
7880    pub async fn default_path(&self) -> Result<String, DaggerError> {
7881        let query = self.selection.select("defaultPath");
7882        query.execute(self.graphql_client.clone()).await
7883    }
7884    /// A default value to use for this argument when not explicitly set by the caller, if any.
7885    pub async fn default_value(&self) -> Result<Json, DaggerError> {
7886        let query = self.selection.select("defaultValue");
7887        query.execute(self.graphql_client.clone()).await
7888    }
7889    /// A doc string for the argument, if any.
7890    pub async fn description(&self) -> Result<String, DaggerError> {
7891        let query = self.selection.select("description");
7892        query.execute(self.graphql_client.clone()).await
7893    }
7894    /// A unique identifier for this FunctionArg.
7895    pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
7896        let query = self.selection.select("id");
7897        query.execute(self.graphql_client.clone()).await
7898    }
7899    /// 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.
7900    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
7901        let query = self.selection.select("ignore");
7902        query.execute(self.graphql_client.clone()).await
7903    }
7904    /// The name of the argument in lowerCamelCase format.
7905    pub async fn name(&self) -> Result<String, DaggerError> {
7906        let query = self.selection.select("name");
7907        query.execute(self.graphql_client.clone()).await
7908    }
7909    /// The location of this arg declaration.
7910    pub fn source_map(&self) -> SourceMap {
7911        let query = self.selection.select("sourceMap");
7912        SourceMap {
7913            proc: self.proc.clone(),
7914            selection: query,
7915            graphql_client: self.graphql_client.clone(),
7916        }
7917    }
7918    /// The type of the argument.
7919    pub fn type_def(&self) -> TypeDef {
7920        let query = self.selection.select("typeDef");
7921        TypeDef {
7922            proc: self.proc.clone(),
7923            selection: query,
7924            graphql_client: self.graphql_client.clone(),
7925        }
7926    }
7927}
7928#[derive(Clone)]
7929pub struct FunctionCall {
7930    pub proc: Option<Arc<DaggerSessionProc>>,
7931    pub selection: Selection,
7932    pub graphql_client: DynGraphQLClient,
7933}
7934impl FunctionCall {
7935    /// A unique identifier for this FunctionCall.
7936    pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
7937        let query = self.selection.select("id");
7938        query.execute(self.graphql_client.clone()).await
7939    }
7940    /// The argument values the function is being invoked with.
7941    pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
7942        let query = self.selection.select("inputArgs");
7943        vec![FunctionCallArgValue {
7944            proc: self.proc.clone(),
7945            selection: query,
7946            graphql_client: self.graphql_client.clone(),
7947        }]
7948    }
7949    /// The name of the function being called.
7950    pub async fn name(&self) -> Result<String, DaggerError> {
7951        let query = self.selection.select("name");
7952        query.execute(self.graphql_client.clone()).await
7953    }
7954    /// 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.
7955    pub async fn parent(&self) -> Result<Json, DaggerError> {
7956        let query = self.selection.select("parent");
7957        query.execute(self.graphql_client.clone()).await
7958    }
7959    /// 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.
7960    pub async fn parent_name(&self) -> Result<String, DaggerError> {
7961        let query = self.selection.select("parentName");
7962        query.execute(self.graphql_client.clone()).await
7963    }
7964    /// Return an error from the function.
7965    ///
7966    /// # Arguments
7967    ///
7968    /// * `error` - The error to return.
7969    pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
7970        let mut query = self.selection.select("returnError");
7971        query = query.arg_lazy(
7972            "error",
7973            Box::new(move || {
7974                let error = error.clone();
7975                Box::pin(async move { error.into_id().await.unwrap().quote() })
7976            }),
7977        );
7978        query.execute(self.graphql_client.clone()).await
7979    }
7980    /// Set the return value of the function call to the provided value.
7981    ///
7982    /// # Arguments
7983    ///
7984    /// * `value` - JSON serialization of the return value.
7985    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
7986        let mut query = self.selection.select("returnValue");
7987        query = query.arg("value", value);
7988        query.execute(self.graphql_client.clone()).await
7989    }
7990}
7991#[derive(Clone)]
7992pub struct FunctionCallArgValue {
7993    pub proc: Option<Arc<DaggerSessionProc>>,
7994    pub selection: Selection,
7995    pub graphql_client: DynGraphQLClient,
7996}
7997impl FunctionCallArgValue {
7998    /// A unique identifier for this FunctionCallArgValue.
7999    pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
8000        let query = self.selection.select("id");
8001        query.execute(self.graphql_client.clone()).await
8002    }
8003    /// The name of the argument.
8004    pub async fn name(&self) -> Result<String, DaggerError> {
8005        let query = self.selection.select("name");
8006        query.execute(self.graphql_client.clone()).await
8007    }
8008    /// The value of the argument represented as a JSON serialized string.
8009    pub async fn value(&self) -> Result<Json, DaggerError> {
8010        let query = self.selection.select("value");
8011        query.execute(self.graphql_client.clone()).await
8012    }
8013}
8014#[derive(Clone)]
8015pub struct GeneratedCode {
8016    pub proc: Option<Arc<DaggerSessionProc>>,
8017    pub selection: Selection,
8018    pub graphql_client: DynGraphQLClient,
8019}
8020impl GeneratedCode {
8021    /// The directory containing the generated code.
8022    pub fn code(&self) -> Directory {
8023        let query = self.selection.select("code");
8024        Directory {
8025            proc: self.proc.clone(),
8026            selection: query,
8027            graphql_client: self.graphql_client.clone(),
8028        }
8029    }
8030    /// A unique identifier for this GeneratedCode.
8031    pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
8032        let query = self.selection.select("id");
8033        query.execute(self.graphql_client.clone()).await
8034    }
8035    /// List of paths to mark generated in version control (i.e. .gitattributes).
8036    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
8037        let query = self.selection.select("vcsGeneratedPaths");
8038        query.execute(self.graphql_client.clone()).await
8039    }
8040    /// List of paths to ignore in version control (i.e. .gitignore).
8041    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
8042        let query = self.selection.select("vcsIgnoredPaths");
8043        query.execute(self.graphql_client.clone()).await
8044    }
8045    /// Set the list of paths to mark generated in version control.
8046    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8047        let mut query = self.selection.select("withVCSGeneratedPaths");
8048        query = query.arg(
8049            "paths",
8050            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8051        );
8052        GeneratedCode {
8053            proc: self.proc.clone(),
8054            selection: query,
8055            graphql_client: self.graphql_client.clone(),
8056        }
8057    }
8058    /// Set the list of paths to ignore in version control.
8059    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8060        let mut query = self.selection.select("withVCSIgnoredPaths");
8061        query = query.arg(
8062            "paths",
8063            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8064        );
8065        GeneratedCode {
8066            proc: self.proc.clone(),
8067            selection: query,
8068            graphql_client: self.graphql_client.clone(),
8069        }
8070    }
8071}
8072#[derive(Clone)]
8073pub struct GitRef {
8074    pub proc: Option<Arc<DaggerSessionProc>>,
8075    pub selection: Selection,
8076    pub graphql_client: DynGraphQLClient,
8077}
8078#[derive(Builder, Debug, PartialEq)]
8079pub struct GitRefTreeOpts {
8080    /// The depth of the tree to fetch.
8081    #[builder(setter(into, strip_option), default)]
8082    pub depth: Option<isize>,
8083    /// Set to true to discard .git directory.
8084    #[builder(setter(into, strip_option), default)]
8085    pub discard_git_dir: Option<bool>,
8086}
8087impl GitRef {
8088    /// The resolved commit id at this ref.
8089    pub async fn commit(&self) -> Result<String, DaggerError> {
8090        let query = self.selection.select("commit");
8091        query.execute(self.graphql_client.clone()).await
8092    }
8093    /// Find the best common ancestor between this ref and another ref.
8094    ///
8095    /// # Arguments
8096    ///
8097    /// * `other` - The other ref to compare against.
8098    pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
8099        let mut query = self.selection.select("commonAncestor");
8100        query = query.arg_lazy(
8101            "other",
8102            Box::new(move || {
8103                let other = other.clone();
8104                Box::pin(async move { other.into_id().await.unwrap().quote() })
8105            }),
8106        );
8107        GitRef {
8108            proc: self.proc.clone(),
8109            selection: query,
8110            graphql_client: self.graphql_client.clone(),
8111        }
8112    }
8113    /// A unique identifier for this GitRef.
8114    pub async fn id(&self) -> Result<GitRefId, DaggerError> {
8115        let query = self.selection.select("id");
8116        query.execute(self.graphql_client.clone()).await
8117    }
8118    /// The resolved ref name at this ref.
8119    pub async fn r#ref(&self) -> Result<String, DaggerError> {
8120        let query = self.selection.select("ref");
8121        query.execute(self.graphql_client.clone()).await
8122    }
8123    /// The filesystem tree at this ref.
8124    ///
8125    /// # Arguments
8126    ///
8127    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8128    pub fn tree(&self) -> Directory {
8129        let query = self.selection.select("tree");
8130        Directory {
8131            proc: self.proc.clone(),
8132            selection: query,
8133            graphql_client: self.graphql_client.clone(),
8134        }
8135    }
8136    /// The filesystem tree at this ref.
8137    ///
8138    /// # Arguments
8139    ///
8140    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8141    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
8142        let mut query = self.selection.select("tree");
8143        if let Some(discard_git_dir) = opts.discard_git_dir {
8144            query = query.arg("discardGitDir", discard_git_dir);
8145        }
8146        if let Some(depth) = opts.depth {
8147            query = query.arg("depth", depth);
8148        }
8149        Directory {
8150            proc: self.proc.clone(),
8151            selection: query,
8152            graphql_client: self.graphql_client.clone(),
8153        }
8154    }
8155}
8156#[derive(Clone)]
8157pub struct GitRepository {
8158    pub proc: Option<Arc<DaggerSessionProc>>,
8159    pub selection: Selection,
8160    pub graphql_client: DynGraphQLClient,
8161}
8162#[derive(Builder, Debug, PartialEq)]
8163pub struct GitRepositoryBranchesOpts<'a> {
8164    /// Glob patterns (e.g., "refs/tags/v*").
8165    #[builder(setter(into, strip_option), default)]
8166    pub patterns: Option<Vec<&'a str>>,
8167}
8168#[derive(Builder, Debug, PartialEq)]
8169pub struct GitRepositoryTagsOpts<'a> {
8170    /// Glob patterns (e.g., "refs/tags/v*").
8171    #[builder(setter(into, strip_option), default)]
8172    pub patterns: Option<Vec<&'a str>>,
8173}
8174impl GitRepository {
8175    /// Returns details of a branch.
8176    ///
8177    /// # Arguments
8178    ///
8179    /// * `name` - Branch's name (e.g., "main").
8180    pub fn branch(&self, name: impl Into<String>) -> GitRef {
8181        let mut query = self.selection.select("branch");
8182        query = query.arg("name", name.into());
8183        GitRef {
8184            proc: self.proc.clone(),
8185            selection: query,
8186            graphql_client: self.graphql_client.clone(),
8187        }
8188    }
8189    /// branches that match any of the given glob patterns.
8190    ///
8191    /// # Arguments
8192    ///
8193    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8194    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
8195        let query = self.selection.select("branches");
8196        query.execute(self.graphql_client.clone()).await
8197    }
8198    /// branches that match any of the given glob patterns.
8199    ///
8200    /// # Arguments
8201    ///
8202    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8203    pub async fn branches_opts<'a>(
8204        &self,
8205        opts: GitRepositoryBranchesOpts<'a>,
8206    ) -> Result<Vec<String>, DaggerError> {
8207        let mut query = self.selection.select("branches");
8208        if let Some(patterns) = opts.patterns {
8209            query = query.arg("patterns", patterns);
8210        }
8211        query.execute(self.graphql_client.clone()).await
8212    }
8213    /// Returns details of a commit.
8214    ///
8215    /// # Arguments
8216    ///
8217    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
8218    pub fn commit(&self, id: impl Into<String>) -> GitRef {
8219        let mut query = self.selection.select("commit");
8220        query = query.arg("id", id.into());
8221        GitRef {
8222            proc: self.proc.clone(),
8223            selection: query,
8224            graphql_client: self.graphql_client.clone(),
8225        }
8226    }
8227    /// Returns details for HEAD.
8228    pub fn head(&self) -> GitRef {
8229        let query = self.selection.select("head");
8230        GitRef {
8231            proc: self.proc.clone(),
8232            selection: query,
8233            graphql_client: self.graphql_client.clone(),
8234        }
8235    }
8236    /// A unique identifier for this GitRepository.
8237    pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
8238        let query = self.selection.select("id");
8239        query.execute(self.graphql_client.clone()).await
8240    }
8241    /// Returns details for the latest semver tag.
8242    pub fn latest_version(&self) -> GitRef {
8243        let query = self.selection.select("latestVersion");
8244        GitRef {
8245            proc: self.proc.clone(),
8246            selection: query,
8247            graphql_client: self.graphql_client.clone(),
8248        }
8249    }
8250    /// Returns details of a ref.
8251    ///
8252    /// # Arguments
8253    ///
8254    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
8255    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
8256        let mut query = self.selection.select("ref");
8257        query = query.arg("name", name.into());
8258        GitRef {
8259            proc: self.proc.clone(),
8260            selection: query,
8261            graphql_client: self.graphql_client.clone(),
8262        }
8263    }
8264    /// Returns details of a tag.
8265    ///
8266    /// # Arguments
8267    ///
8268    /// * `name` - Tag's name (e.g., "v0.3.9").
8269    pub fn tag(&self, name: impl Into<String>) -> GitRef {
8270        let mut query = self.selection.select("tag");
8271        query = query.arg("name", name.into());
8272        GitRef {
8273            proc: self.proc.clone(),
8274            selection: query,
8275            graphql_client: self.graphql_client.clone(),
8276        }
8277    }
8278    /// tags that match any of the given glob patterns.
8279    ///
8280    /// # Arguments
8281    ///
8282    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8283    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
8284        let query = self.selection.select("tags");
8285        query.execute(self.graphql_client.clone()).await
8286    }
8287    /// tags that match any of the given glob patterns.
8288    ///
8289    /// # Arguments
8290    ///
8291    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8292    pub async fn tags_opts<'a>(
8293        &self,
8294        opts: GitRepositoryTagsOpts<'a>,
8295    ) -> Result<Vec<String>, DaggerError> {
8296        let mut query = self.selection.select("tags");
8297        if let Some(patterns) = opts.patterns {
8298            query = query.arg("patterns", patterns);
8299        }
8300        query.execute(self.graphql_client.clone()).await
8301    }
8302    /// The URL of the git repository.
8303    pub async fn url(&self) -> Result<String, DaggerError> {
8304        let query = self.selection.select("url");
8305        query.execute(self.graphql_client.clone()).await
8306    }
8307    /// Header to authenticate the remote with.
8308    ///
8309    /// # Arguments
8310    ///
8311    /// * `header` - Secret used to populate the Authorization HTTP header
8312    pub fn with_auth_header(&self, header: impl IntoID<SecretId>) -> GitRepository {
8313        let mut query = self.selection.select("withAuthHeader");
8314        query = query.arg_lazy(
8315            "header",
8316            Box::new(move || {
8317                let header = header.clone();
8318                Box::pin(async move { header.into_id().await.unwrap().quote() })
8319            }),
8320        );
8321        GitRepository {
8322            proc: self.proc.clone(),
8323            selection: query,
8324            graphql_client: self.graphql_client.clone(),
8325        }
8326    }
8327    /// Token to authenticate the remote with.
8328    ///
8329    /// # Arguments
8330    ///
8331    /// * `token` - Secret used to populate the password during basic HTTP Authorization
8332    pub fn with_auth_token(&self, token: impl IntoID<SecretId>) -> GitRepository {
8333        let mut query = self.selection.select("withAuthToken");
8334        query = query.arg_lazy(
8335            "token",
8336            Box::new(move || {
8337                let token = token.clone();
8338                Box::pin(async move { token.into_id().await.unwrap().quote() })
8339            }),
8340        );
8341        GitRepository {
8342            proc: self.proc.clone(),
8343            selection: query,
8344            graphql_client: self.graphql_client.clone(),
8345        }
8346    }
8347}
8348#[derive(Clone)]
8349pub struct Host {
8350    pub proc: Option<Arc<DaggerSessionProc>>,
8351    pub selection: Selection,
8352    pub graphql_client: DynGraphQLClient,
8353}
8354#[derive(Builder, Debug, PartialEq)]
8355pub struct HostDirectoryOpts<'a> {
8356    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
8357    #[builder(setter(into, strip_option), default)]
8358    pub exclude: Option<Vec<&'a str>>,
8359    /// Apply .gitignore filter rules inside the directory
8360    #[builder(setter(into, strip_option), default)]
8361    pub gitignore: Option<bool>,
8362    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
8363    #[builder(setter(into, strip_option), default)]
8364    pub include: Option<Vec<&'a str>>,
8365    /// If true, the directory will always be reloaded from the host.
8366    #[builder(setter(into, strip_option), default)]
8367    pub no_cache: Option<bool>,
8368}
8369#[derive(Builder, Debug, PartialEq)]
8370pub struct HostFileOpts {
8371    /// If true, the file will always be reloaded from the host.
8372    #[builder(setter(into, strip_option), default)]
8373    pub no_cache: Option<bool>,
8374}
8375#[derive(Builder, Debug, PartialEq)]
8376pub struct HostFindUpOpts {
8377    #[builder(setter(into, strip_option), default)]
8378    pub no_cache: Option<bool>,
8379}
8380#[derive(Builder, Debug, PartialEq)]
8381pub struct HostServiceOpts<'a> {
8382    /// Upstream host to forward traffic to.
8383    #[builder(setter(into, strip_option), default)]
8384    pub host: Option<&'a str>,
8385}
8386#[derive(Builder, Debug, PartialEq)]
8387pub struct HostTunnelOpts {
8388    /// Map each service port to the same port on the host, as if the service were running natively.
8389    /// Note: enabling may result in port conflicts.
8390    #[builder(setter(into, strip_option), default)]
8391    pub native: Option<bool>,
8392    /// Configure explicit port forwarding rules for the tunnel.
8393    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
8394    /// 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.
8395    /// If ports are given and native is true, the ports are additive.
8396    #[builder(setter(into, strip_option), default)]
8397    pub ports: Option<Vec<PortForward>>,
8398}
8399impl Host {
8400    /// Accesses a container image on the host.
8401    ///
8402    /// # Arguments
8403    ///
8404    /// * `name` - Name of the image to access.
8405    pub fn container_image(&self, name: impl Into<String>) -> Container {
8406        let mut query = self.selection.select("containerImage");
8407        query = query.arg("name", name.into());
8408        Container {
8409            proc: self.proc.clone(),
8410            selection: query,
8411            graphql_client: self.graphql_client.clone(),
8412        }
8413    }
8414    /// Accesses a directory on the host.
8415    ///
8416    /// # Arguments
8417    ///
8418    /// * `path` - Location of the directory to access (e.g., ".").
8419    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8420    pub fn directory(&self, path: impl Into<String>) -> Directory {
8421        let mut query = self.selection.select("directory");
8422        query = query.arg("path", path.into());
8423        Directory {
8424            proc: self.proc.clone(),
8425            selection: query,
8426            graphql_client: self.graphql_client.clone(),
8427        }
8428    }
8429    /// Accesses a directory on the host.
8430    ///
8431    /// # Arguments
8432    ///
8433    /// * `path` - Location of the directory to access (e.g., ".").
8434    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8435    pub fn directory_opts<'a>(
8436        &self,
8437        path: impl Into<String>,
8438        opts: HostDirectoryOpts<'a>,
8439    ) -> Directory {
8440        let mut query = self.selection.select("directory");
8441        query = query.arg("path", path.into());
8442        if let Some(exclude) = opts.exclude {
8443            query = query.arg("exclude", exclude);
8444        }
8445        if let Some(include) = opts.include {
8446            query = query.arg("include", include);
8447        }
8448        if let Some(no_cache) = opts.no_cache {
8449            query = query.arg("noCache", no_cache);
8450        }
8451        if let Some(gitignore) = opts.gitignore {
8452            query = query.arg("gitignore", gitignore);
8453        }
8454        Directory {
8455            proc: self.proc.clone(),
8456            selection: query,
8457            graphql_client: self.graphql_client.clone(),
8458        }
8459    }
8460    /// Accesses a file on the host.
8461    ///
8462    /// # Arguments
8463    ///
8464    /// * `path` - Location of the file to retrieve (e.g., "README.md").
8465    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8466    pub fn file(&self, path: impl Into<String>) -> File {
8467        let mut query = self.selection.select("file");
8468        query = query.arg("path", path.into());
8469        File {
8470            proc: self.proc.clone(),
8471            selection: query,
8472            graphql_client: self.graphql_client.clone(),
8473        }
8474    }
8475    /// Accesses a file on the host.
8476    ///
8477    /// # Arguments
8478    ///
8479    /// * `path` - Location of the file to retrieve (e.g., "README.md").
8480    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8481    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
8482        let mut query = self.selection.select("file");
8483        query = query.arg("path", path.into());
8484        if let Some(no_cache) = opts.no_cache {
8485            query = query.arg("noCache", no_cache);
8486        }
8487        File {
8488            proc: self.proc.clone(),
8489            selection: query,
8490            graphql_client: self.graphql_client.clone(),
8491        }
8492    }
8493    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
8494    ///
8495    /// # Arguments
8496    ///
8497    /// * `name` - name of the file or directory to search for
8498    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8499    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8500        let mut query = self.selection.select("findUp");
8501        query = query.arg("name", name.into());
8502        query.execute(self.graphql_client.clone()).await
8503    }
8504    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
8505    ///
8506    /// # Arguments
8507    ///
8508    /// * `name` - name of the file or directory to search for
8509    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8510    pub async fn find_up_opts(
8511        &self,
8512        name: impl Into<String>,
8513        opts: HostFindUpOpts,
8514    ) -> Result<String, DaggerError> {
8515        let mut query = self.selection.select("findUp");
8516        query = query.arg("name", name.into());
8517        if let Some(no_cache) = opts.no_cache {
8518            query = query.arg("noCache", no_cache);
8519        }
8520        query.execute(self.graphql_client.clone()).await
8521    }
8522    /// A unique identifier for this Host.
8523    pub async fn id(&self) -> Result<HostId, DaggerError> {
8524        let query = self.selection.select("id");
8525        query.execute(self.graphql_client.clone()).await
8526    }
8527    /// Creates a service that forwards traffic to a specified address via the host.
8528    ///
8529    /// # Arguments
8530    ///
8531    /// * `ports` - Ports to expose via the service, forwarding through the host network.
8532    ///
8533    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
8534    ///
8535    /// An empty set of ports is not valid; an error will be returned.
8536    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8537    pub fn service(&self, ports: Vec<PortForward>) -> Service {
8538        let mut query = self.selection.select("service");
8539        query = query.arg("ports", ports);
8540        Service {
8541            proc: self.proc.clone(),
8542            selection: query,
8543            graphql_client: self.graphql_client.clone(),
8544        }
8545    }
8546    /// Creates a service that forwards traffic to a specified address via the host.
8547    ///
8548    /// # Arguments
8549    ///
8550    /// * `ports` - Ports to expose via the service, forwarding through the host network.
8551    ///
8552    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
8553    ///
8554    /// An empty set of ports is not valid; an error will be returned.
8555    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8556    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
8557        let mut query = self.selection.select("service");
8558        query = query.arg("ports", ports);
8559        if let Some(host) = opts.host {
8560            query = query.arg("host", host);
8561        }
8562        Service {
8563            proc: self.proc.clone(),
8564            selection: query,
8565            graphql_client: self.graphql_client.clone(),
8566        }
8567    }
8568    /// Sets a secret given a user-defined name and the file path on the host, and returns the secret.
8569    /// The file is limited to a size of 512000 bytes.
8570    ///
8571    /// # Arguments
8572    ///
8573    /// * `name` - The user defined name for this secret.
8574    /// * `path` - Location of the file to set as a secret.
8575    pub fn set_secret_file(&self, name: impl Into<String>, path: impl Into<String>) -> Secret {
8576        let mut query = self.selection.select("setSecretFile");
8577        query = query.arg("name", name.into());
8578        query = query.arg("path", path.into());
8579        Secret {
8580            proc: self.proc.clone(),
8581            selection: query,
8582            graphql_client: self.graphql_client.clone(),
8583        }
8584    }
8585    /// Creates a tunnel that forwards traffic from the host to a service.
8586    ///
8587    /// # Arguments
8588    ///
8589    /// * `service` - Service to send traffic from the tunnel.
8590    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8591    pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
8592        let mut query = self.selection.select("tunnel");
8593        query = query.arg_lazy(
8594            "service",
8595            Box::new(move || {
8596                let service = service.clone();
8597                Box::pin(async move { service.into_id().await.unwrap().quote() })
8598            }),
8599        );
8600        Service {
8601            proc: self.proc.clone(),
8602            selection: query,
8603            graphql_client: self.graphql_client.clone(),
8604        }
8605    }
8606    /// Creates a tunnel that forwards traffic from the host to a service.
8607    ///
8608    /// # Arguments
8609    ///
8610    /// * `service` - Service to send traffic from the tunnel.
8611    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8612    pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
8613        let mut query = self.selection.select("tunnel");
8614        query = query.arg_lazy(
8615            "service",
8616            Box::new(move || {
8617                let service = service.clone();
8618                Box::pin(async move { service.into_id().await.unwrap().quote() })
8619            }),
8620        );
8621        if let Some(native) = opts.native {
8622            query = query.arg("native", native);
8623        }
8624        if let Some(ports) = opts.ports {
8625            query = query.arg("ports", ports);
8626        }
8627        Service {
8628            proc: self.proc.clone(),
8629            selection: query,
8630            graphql_client: self.graphql_client.clone(),
8631        }
8632    }
8633    /// Accesses a Unix socket on the host.
8634    ///
8635    /// # Arguments
8636    ///
8637    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
8638    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
8639        let mut query = self.selection.select("unixSocket");
8640        query = query.arg("path", path.into());
8641        Socket {
8642            proc: self.proc.clone(),
8643            selection: query,
8644            graphql_client: self.graphql_client.clone(),
8645        }
8646    }
8647}
8648#[derive(Clone)]
8649pub struct InputTypeDef {
8650    pub proc: Option<Arc<DaggerSessionProc>>,
8651    pub selection: Selection,
8652    pub graphql_client: DynGraphQLClient,
8653}
8654impl InputTypeDef {
8655    /// Static fields defined on this input object, if any.
8656    pub fn fields(&self) -> Vec<FieldTypeDef> {
8657        let query = self.selection.select("fields");
8658        vec![FieldTypeDef {
8659            proc: self.proc.clone(),
8660            selection: query,
8661            graphql_client: self.graphql_client.clone(),
8662        }]
8663    }
8664    /// A unique identifier for this InputTypeDef.
8665    pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
8666        let query = self.selection.select("id");
8667        query.execute(self.graphql_client.clone()).await
8668    }
8669    /// The name of the input object.
8670    pub async fn name(&self) -> Result<String, DaggerError> {
8671        let query = self.selection.select("name");
8672        query.execute(self.graphql_client.clone()).await
8673    }
8674}
8675#[derive(Clone)]
8676pub struct InterfaceTypeDef {
8677    pub proc: Option<Arc<DaggerSessionProc>>,
8678    pub selection: Selection,
8679    pub graphql_client: DynGraphQLClient,
8680}
8681impl InterfaceTypeDef {
8682    /// The doc string for the interface, if any.
8683    pub async fn description(&self) -> Result<String, DaggerError> {
8684        let query = self.selection.select("description");
8685        query.execute(self.graphql_client.clone()).await
8686    }
8687    /// Functions defined on this interface, if any.
8688    pub fn functions(&self) -> Vec<Function> {
8689        let query = self.selection.select("functions");
8690        vec![Function {
8691            proc: self.proc.clone(),
8692            selection: query,
8693            graphql_client: self.graphql_client.clone(),
8694        }]
8695    }
8696    /// A unique identifier for this InterfaceTypeDef.
8697    pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
8698        let query = self.selection.select("id");
8699        query.execute(self.graphql_client.clone()).await
8700    }
8701    /// The name of the interface.
8702    pub async fn name(&self) -> Result<String, DaggerError> {
8703        let query = self.selection.select("name");
8704        query.execute(self.graphql_client.clone()).await
8705    }
8706    /// The location of this interface declaration.
8707    pub fn source_map(&self) -> SourceMap {
8708        let query = self.selection.select("sourceMap");
8709        SourceMap {
8710            proc: self.proc.clone(),
8711            selection: query,
8712            graphql_client: self.graphql_client.clone(),
8713        }
8714    }
8715    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
8716    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8717        let query = self.selection.select("sourceModuleName");
8718        query.execute(self.graphql_client.clone()).await
8719    }
8720}
8721#[derive(Clone)]
8722pub struct JsonValue {
8723    pub proc: Option<Arc<DaggerSessionProc>>,
8724    pub selection: Selection,
8725    pub graphql_client: DynGraphQLClient,
8726}
8727#[derive(Builder, Debug, PartialEq)]
8728pub struct JsonValueContentsOpts<'a> {
8729    /// Optional line prefix
8730    #[builder(setter(into, strip_option), default)]
8731    pub indent: Option<&'a str>,
8732    /// Pretty-print
8733    #[builder(setter(into, strip_option), default)]
8734    pub pretty: Option<bool>,
8735}
8736impl JsonValue {
8737    /// Decode an array from json
8738    pub fn as_array(&self) -> Vec<JsonValue> {
8739        let query = self.selection.select("asArray");
8740        vec![JsonValue {
8741            proc: self.proc.clone(),
8742            selection: query,
8743            graphql_client: self.graphql_client.clone(),
8744        }]
8745    }
8746    /// Decode a boolean from json
8747    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
8748        let query = self.selection.select("asBoolean");
8749        query.execute(self.graphql_client.clone()).await
8750    }
8751    /// Decode an integer from json
8752    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
8753        let query = self.selection.select("asInteger");
8754        query.execute(self.graphql_client.clone()).await
8755    }
8756    /// Decode a string from json
8757    pub async fn as_string(&self) -> Result<String, DaggerError> {
8758        let query = self.selection.select("asString");
8759        query.execute(self.graphql_client.clone()).await
8760    }
8761    /// Return the value encoded as json
8762    ///
8763    /// # Arguments
8764    ///
8765    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8766    pub async fn contents(&self) -> Result<Json, DaggerError> {
8767        let query = self.selection.select("contents");
8768        query.execute(self.graphql_client.clone()).await
8769    }
8770    /// Return the value encoded as json
8771    ///
8772    /// # Arguments
8773    ///
8774    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8775    pub async fn contents_opts<'a>(
8776        &self,
8777        opts: JsonValueContentsOpts<'a>,
8778    ) -> Result<Json, DaggerError> {
8779        let mut query = self.selection.select("contents");
8780        if let Some(pretty) = opts.pretty {
8781            query = query.arg("pretty", pretty);
8782        }
8783        if let Some(indent) = opts.indent {
8784            query = query.arg("indent", indent);
8785        }
8786        query.execute(self.graphql_client.clone()).await
8787    }
8788    /// Lookup the field at the given path, and return its value.
8789    ///
8790    /// # Arguments
8791    ///
8792    /// * `path` - Path of the field to lookup, encoded as an array of field names
8793    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
8794        let mut query = self.selection.select("field");
8795        query = query.arg(
8796            "path",
8797            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8798        );
8799        JsonValue {
8800            proc: self.proc.clone(),
8801            selection: query,
8802            graphql_client: self.graphql_client.clone(),
8803        }
8804    }
8805    /// List fields of the encoded object
8806    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
8807        let query = self.selection.select("fields");
8808        query.execute(self.graphql_client.clone()).await
8809    }
8810    /// A unique identifier for this JSONValue.
8811    pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
8812        let query = self.selection.select("id");
8813        query.execute(self.graphql_client.clone()).await
8814    }
8815    /// Encode a boolean to json
8816    ///
8817    /// # Arguments
8818    ///
8819    /// * `value` - New boolean value
8820    pub fn new_boolean(&self, value: bool) -> JsonValue {
8821        let mut query = self.selection.select("newBoolean");
8822        query = query.arg("value", value);
8823        JsonValue {
8824            proc: self.proc.clone(),
8825            selection: query,
8826            graphql_client: self.graphql_client.clone(),
8827        }
8828    }
8829    /// Encode an integer to json
8830    ///
8831    /// # Arguments
8832    ///
8833    /// * `value` - New integer value
8834    pub fn new_integer(&self, value: isize) -> JsonValue {
8835        let mut query = self.selection.select("newInteger");
8836        query = query.arg("value", value);
8837        JsonValue {
8838            proc: self.proc.clone(),
8839            selection: query,
8840            graphql_client: self.graphql_client.clone(),
8841        }
8842    }
8843    /// Encode a string to json
8844    ///
8845    /// # Arguments
8846    ///
8847    /// * `value` - New string value
8848    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
8849        let mut query = self.selection.select("newString");
8850        query = query.arg("value", value.into());
8851        JsonValue {
8852            proc: self.proc.clone(),
8853            selection: query,
8854            graphql_client: self.graphql_client.clone(),
8855        }
8856    }
8857    /// Return a new json value, decoded from the given content
8858    ///
8859    /// # Arguments
8860    ///
8861    /// * `contents` - New JSON-encoded contents
8862    pub fn with_contents(&self, contents: Json) -> JsonValue {
8863        let mut query = self.selection.select("withContents");
8864        query = query.arg("contents", contents);
8865        JsonValue {
8866            proc: self.proc.clone(),
8867            selection: query,
8868            graphql_client: self.graphql_client.clone(),
8869        }
8870    }
8871    /// Set a new field at the given path
8872    ///
8873    /// # Arguments
8874    ///
8875    /// * `path` - Path of the field to set, encoded as an array of field names
8876    /// * `value` - The new value of the field
8877    pub fn with_field(
8878        &self,
8879        path: Vec<impl Into<String>>,
8880        value: impl IntoID<JsonValueId>,
8881    ) -> JsonValue {
8882        let mut query = self.selection.select("withField");
8883        query = query.arg(
8884            "path",
8885            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8886        );
8887        query = query.arg_lazy(
8888            "value",
8889            Box::new(move || {
8890                let value = value.clone();
8891                Box::pin(async move { value.into_id().await.unwrap().quote() })
8892            }),
8893        );
8894        JsonValue {
8895            proc: self.proc.clone(),
8896            selection: query,
8897            graphql_client: self.graphql_client.clone(),
8898        }
8899    }
8900}
8901#[derive(Clone)]
8902pub struct Llm {
8903    pub proc: Option<Arc<DaggerSessionProc>>,
8904    pub selection: Selection,
8905    pub graphql_client: DynGraphQLClient,
8906}
8907impl Llm {
8908    /// create a branch in the LLM's history
8909    pub fn attempt(&self, number: isize) -> Llm {
8910        let mut query = self.selection.select("attempt");
8911        query = query.arg("number", number);
8912        Llm {
8913            proc: self.proc.clone(),
8914            selection: query,
8915            graphql_client: self.graphql_client.clone(),
8916        }
8917    }
8918    /// returns the type of the current state
8919    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
8920        let mut query = self.selection.select("bindResult");
8921        query = query.arg("name", name.into());
8922        Binding {
8923            proc: self.proc.clone(),
8924            selection: query,
8925            graphql_client: self.graphql_client.clone(),
8926        }
8927    }
8928    /// return the LLM's current environment
8929    pub fn env(&self) -> Env {
8930        let query = self.selection.select("env");
8931        Env {
8932            proc: self.proc.clone(),
8933            selection: query,
8934            graphql_client: self.graphql_client.clone(),
8935        }
8936    }
8937    /// return the llm message history
8938    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
8939        let query = self.selection.select("history");
8940        query.execute(self.graphql_client.clone()).await
8941    }
8942    /// return the raw llm message history as json
8943    pub async fn history_json(&self) -> Result<Json, DaggerError> {
8944        let query = self.selection.select("historyJSON");
8945        query.execute(self.graphql_client.clone()).await
8946    }
8947    /// A unique identifier for this LLM.
8948    pub async fn id(&self) -> Result<Llmid, DaggerError> {
8949        let query = self.selection.select("id");
8950        query.execute(self.graphql_client.clone()).await
8951    }
8952    /// return the last llm reply from the history
8953    pub async fn last_reply(&self) -> Result<String, DaggerError> {
8954        let query = self.selection.select("lastReply");
8955        query.execute(self.graphql_client.clone()).await
8956    }
8957    /// synchronize LLM state
8958    pub fn r#loop(&self) -> Llm {
8959        let query = self.selection.select("loop");
8960        Llm {
8961            proc: self.proc.clone(),
8962            selection: query,
8963            graphql_client: self.graphql_client.clone(),
8964        }
8965    }
8966    /// return the model used by the llm
8967    pub async fn model(&self) -> Result<String, DaggerError> {
8968        let query = self.selection.select("model");
8969        query.execute(self.graphql_client.clone()).await
8970    }
8971    /// return the provider used by the llm
8972    pub async fn provider(&self) -> Result<String, DaggerError> {
8973        let query = self.selection.select("provider");
8974        query.execute(self.graphql_client.clone()).await
8975    }
8976    /// synchronize LLM state
8977    pub async fn sync(&self) -> Result<Llmid, DaggerError> {
8978        let query = self.selection.select("sync");
8979        query.execute(self.graphql_client.clone()).await
8980    }
8981    /// returns the token usage of the current state
8982    pub fn token_usage(&self) -> LlmTokenUsage {
8983        let query = self.selection.select("tokenUsage");
8984        LlmTokenUsage {
8985            proc: self.proc.clone(),
8986            selection: query,
8987            graphql_client: self.graphql_client.clone(),
8988        }
8989    }
8990    /// print documentation for available tools
8991    pub async fn tools(&self) -> Result<String, DaggerError> {
8992        let query = self.selection.select("tools");
8993        query.execute(self.graphql_client.clone()).await
8994    }
8995    /// allow the LLM to interact with an environment via MCP
8996    pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
8997        let mut query = self.selection.select("withEnv");
8998        query = query.arg_lazy(
8999            "env",
9000            Box::new(move || {
9001                let env = env.clone();
9002                Box::pin(async move { env.into_id().await.unwrap().quote() })
9003            }),
9004        );
9005        Llm {
9006            proc: self.proc.clone(),
9007            selection: query,
9008            graphql_client: self.graphql_client.clone(),
9009        }
9010    }
9011    /// swap out the llm model
9012    ///
9013    /// # Arguments
9014    ///
9015    /// * `model` - The model to use
9016    pub fn with_model(&self, model: impl Into<String>) -> Llm {
9017        let mut query = self.selection.select("withModel");
9018        query = query.arg("model", model.into());
9019        Llm {
9020            proc: self.proc.clone(),
9021            selection: query,
9022            graphql_client: self.graphql_client.clone(),
9023        }
9024    }
9025    /// append a prompt to the llm context
9026    ///
9027    /// # Arguments
9028    ///
9029    /// * `prompt` - The prompt to send
9030    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
9031        let mut query = self.selection.select("withPrompt");
9032        query = query.arg("prompt", prompt.into());
9033        Llm {
9034            proc: self.proc.clone(),
9035            selection: query,
9036            graphql_client: self.graphql_client.clone(),
9037        }
9038    }
9039    /// append the contents of a file to the llm context
9040    ///
9041    /// # Arguments
9042    ///
9043    /// * `file` - The file to read the prompt from
9044    pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
9045        let mut query = self.selection.select("withPromptFile");
9046        query = query.arg_lazy(
9047            "file",
9048            Box::new(move || {
9049                let file = file.clone();
9050                Box::pin(async move { file.into_id().await.unwrap().quote() })
9051            }),
9052        );
9053        Llm {
9054            proc: self.proc.clone(),
9055            selection: query,
9056            graphql_client: self.graphql_client.clone(),
9057        }
9058    }
9059    /// Add a system prompt to the LLM's environment
9060    ///
9061    /// # Arguments
9062    ///
9063    /// * `prompt` - The system prompt to send
9064    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
9065        let mut query = self.selection.select("withSystemPrompt");
9066        query = query.arg("prompt", prompt.into());
9067        Llm {
9068            proc: self.proc.clone(),
9069            selection: query,
9070            graphql_client: self.graphql_client.clone(),
9071        }
9072    }
9073    /// Disable the default system prompt
9074    pub fn without_default_system_prompt(&self) -> Llm {
9075        let query = self.selection.select("withoutDefaultSystemPrompt");
9076        Llm {
9077            proc: self.proc.clone(),
9078            selection: query,
9079            graphql_client: self.graphql_client.clone(),
9080        }
9081    }
9082}
9083#[derive(Clone)]
9084pub struct LlmTokenUsage {
9085    pub proc: Option<Arc<DaggerSessionProc>>,
9086    pub selection: Selection,
9087    pub graphql_client: DynGraphQLClient,
9088}
9089impl LlmTokenUsage {
9090    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
9091        let query = self.selection.select("cachedTokenReads");
9092        query.execute(self.graphql_client.clone()).await
9093    }
9094    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
9095        let query = self.selection.select("cachedTokenWrites");
9096        query.execute(self.graphql_client.clone()).await
9097    }
9098    /// A unique identifier for this LLMTokenUsage.
9099    pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
9100        let query = self.selection.select("id");
9101        query.execute(self.graphql_client.clone()).await
9102    }
9103    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
9104        let query = self.selection.select("inputTokens");
9105        query.execute(self.graphql_client.clone()).await
9106    }
9107    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
9108        let query = self.selection.select("outputTokens");
9109        query.execute(self.graphql_client.clone()).await
9110    }
9111    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
9112        let query = self.selection.select("totalTokens");
9113        query.execute(self.graphql_client.clone()).await
9114    }
9115}
9116#[derive(Clone)]
9117pub struct Label {
9118    pub proc: Option<Arc<DaggerSessionProc>>,
9119    pub selection: Selection,
9120    pub graphql_client: DynGraphQLClient,
9121}
9122impl Label {
9123    /// A unique identifier for this Label.
9124    pub async fn id(&self) -> Result<LabelId, DaggerError> {
9125        let query = self.selection.select("id");
9126        query.execute(self.graphql_client.clone()).await
9127    }
9128    /// The label name.
9129    pub async fn name(&self) -> Result<String, DaggerError> {
9130        let query = self.selection.select("name");
9131        query.execute(self.graphql_client.clone()).await
9132    }
9133    /// The label value.
9134    pub async fn value(&self) -> Result<String, DaggerError> {
9135        let query = self.selection.select("value");
9136        query.execute(self.graphql_client.clone()).await
9137    }
9138}
9139#[derive(Clone)]
9140pub struct ListTypeDef {
9141    pub proc: Option<Arc<DaggerSessionProc>>,
9142    pub selection: Selection,
9143    pub graphql_client: DynGraphQLClient,
9144}
9145impl ListTypeDef {
9146    /// The type of the elements in the list.
9147    pub fn element_type_def(&self) -> TypeDef {
9148        let query = self.selection.select("elementTypeDef");
9149        TypeDef {
9150            proc: self.proc.clone(),
9151            selection: query,
9152            graphql_client: self.graphql_client.clone(),
9153        }
9154    }
9155    /// A unique identifier for this ListTypeDef.
9156    pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
9157        let query = self.selection.select("id");
9158        query.execute(self.graphql_client.clone()).await
9159    }
9160}
9161#[derive(Clone)]
9162pub struct Module {
9163    pub proc: Option<Arc<DaggerSessionProc>>,
9164    pub selection: Selection,
9165    pub graphql_client: DynGraphQLClient,
9166}
9167#[derive(Builder, Debug, PartialEq)]
9168pub struct ModuleServeOpts {
9169    /// Expose the dependencies of this module to the client
9170    #[builder(setter(into, strip_option), default)]
9171    pub include_dependencies: Option<bool>,
9172}
9173impl Module {
9174    /// The dependencies of the module.
9175    pub fn dependencies(&self) -> Vec<Module> {
9176        let query = self.selection.select("dependencies");
9177        vec![Module {
9178            proc: self.proc.clone(),
9179            selection: query,
9180            graphql_client: self.graphql_client.clone(),
9181        }]
9182    }
9183    /// The doc string of the module, if any
9184    pub async fn description(&self) -> Result<String, DaggerError> {
9185        let query = self.selection.select("description");
9186        query.execute(self.graphql_client.clone()).await
9187    }
9188    /// Enumerations served by this module.
9189    pub fn enums(&self) -> Vec<TypeDef> {
9190        let query = self.selection.select("enums");
9191        vec![TypeDef {
9192            proc: self.proc.clone(),
9193            selection: query,
9194            graphql_client: self.graphql_client.clone(),
9195        }]
9196    }
9197    /// The generated files and directories made on top of the module source's context directory.
9198    pub fn generated_context_directory(&self) -> Directory {
9199        let query = self.selection.select("generatedContextDirectory");
9200        Directory {
9201            proc: self.proc.clone(),
9202            selection: query,
9203            graphql_client: self.graphql_client.clone(),
9204        }
9205    }
9206    /// A unique identifier for this Module.
9207    pub async fn id(&self) -> Result<ModuleId, DaggerError> {
9208        let query = self.selection.select("id");
9209        query.execute(self.graphql_client.clone()).await
9210    }
9211    /// Interfaces served by this module.
9212    pub fn interfaces(&self) -> Vec<TypeDef> {
9213        let query = self.selection.select("interfaces");
9214        vec![TypeDef {
9215            proc: self.proc.clone(),
9216            selection: query,
9217            graphql_client: self.graphql_client.clone(),
9218        }]
9219    }
9220    /// The name of the module
9221    pub async fn name(&self) -> Result<String, DaggerError> {
9222        let query = self.selection.select("name");
9223        query.execute(self.graphql_client.clone()).await
9224    }
9225    /// Objects served by this module.
9226    pub fn objects(&self) -> Vec<TypeDef> {
9227        let query = self.selection.select("objects");
9228        vec![TypeDef {
9229            proc: self.proc.clone(),
9230            selection: query,
9231            graphql_client: self.graphql_client.clone(),
9232        }]
9233    }
9234    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
9235    pub fn runtime(&self) -> Container {
9236        let query = self.selection.select("runtime");
9237        Container {
9238            proc: self.proc.clone(),
9239            selection: query,
9240            graphql_client: self.graphql_client.clone(),
9241        }
9242    }
9243    /// The SDK config used by this module.
9244    pub fn sdk(&self) -> SdkConfig {
9245        let query = self.selection.select("sdk");
9246        SdkConfig {
9247            proc: self.proc.clone(),
9248            selection: query,
9249            graphql_client: self.graphql_client.clone(),
9250        }
9251    }
9252    /// Serve a module's API in the current session.
9253    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
9254    ///
9255    /// # Arguments
9256    ///
9257    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9258    pub async fn serve(&self) -> Result<Void, DaggerError> {
9259        let query = self.selection.select("serve");
9260        query.execute(self.graphql_client.clone()).await
9261    }
9262    /// Serve a module's API in the current session.
9263    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
9264    ///
9265    /// # Arguments
9266    ///
9267    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9268    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
9269        let mut query = self.selection.select("serve");
9270        if let Some(include_dependencies) = opts.include_dependencies {
9271            query = query.arg("includeDependencies", include_dependencies);
9272        }
9273        query.execute(self.graphql_client.clone()).await
9274    }
9275    /// The source for the module.
9276    pub fn source(&self) -> ModuleSource {
9277        let query = self.selection.select("source");
9278        ModuleSource {
9279            proc: self.proc.clone(),
9280            selection: query,
9281            graphql_client: self.graphql_client.clone(),
9282        }
9283    }
9284    /// Forces evaluation of the module, including any loading into the engine and associated validation.
9285    pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
9286        let query = self.selection.select("sync");
9287        query.execute(self.graphql_client.clone()).await
9288    }
9289    /// Retrieves the module with the given description
9290    ///
9291    /// # Arguments
9292    ///
9293    /// * `description` - The description to set
9294    pub fn with_description(&self, description: impl Into<String>) -> Module {
9295        let mut query = self.selection.select("withDescription");
9296        query = query.arg("description", description.into());
9297        Module {
9298            proc: self.proc.clone(),
9299            selection: query,
9300            graphql_client: self.graphql_client.clone(),
9301        }
9302    }
9303    /// This module plus the given Enum type and associated values
9304    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
9305        let mut query = self.selection.select("withEnum");
9306        query = query.arg_lazy(
9307            "enum",
9308            Box::new(move || {
9309                let r#enum = r#enum.clone();
9310                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
9311            }),
9312        );
9313        Module {
9314            proc: self.proc.clone(),
9315            selection: query,
9316            graphql_client: self.graphql_client.clone(),
9317        }
9318    }
9319    /// This module plus the given Interface type and associated functions
9320    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
9321        let mut query = self.selection.select("withInterface");
9322        query = query.arg_lazy(
9323            "iface",
9324            Box::new(move || {
9325                let iface = iface.clone();
9326                Box::pin(async move { iface.into_id().await.unwrap().quote() })
9327            }),
9328        );
9329        Module {
9330            proc: self.proc.clone(),
9331            selection: query,
9332            graphql_client: self.graphql_client.clone(),
9333        }
9334    }
9335    /// This module plus the given Object type and associated functions.
9336    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
9337        let mut query = self.selection.select("withObject");
9338        query = query.arg_lazy(
9339            "object",
9340            Box::new(move || {
9341                let object = object.clone();
9342                Box::pin(async move { object.into_id().await.unwrap().quote() })
9343            }),
9344        );
9345        Module {
9346            proc: self.proc.clone(),
9347            selection: query,
9348            graphql_client: self.graphql_client.clone(),
9349        }
9350    }
9351}
9352#[derive(Clone)]
9353pub struct ModuleConfigClient {
9354    pub proc: Option<Arc<DaggerSessionProc>>,
9355    pub selection: Selection,
9356    pub graphql_client: DynGraphQLClient,
9357}
9358impl ModuleConfigClient {
9359    /// The directory the client is generated in.
9360    pub async fn directory(&self) -> Result<String, DaggerError> {
9361        let query = self.selection.select("directory");
9362        query.execute(self.graphql_client.clone()).await
9363    }
9364    /// The generator to use
9365    pub async fn generator(&self) -> Result<String, DaggerError> {
9366        let query = self.selection.select("generator");
9367        query.execute(self.graphql_client.clone()).await
9368    }
9369    /// A unique identifier for this ModuleConfigClient.
9370    pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
9371        let query = self.selection.select("id");
9372        query.execute(self.graphql_client.clone()).await
9373    }
9374}
9375#[derive(Clone)]
9376pub struct ModuleSource {
9377    pub proc: Option<Arc<DaggerSessionProc>>,
9378    pub selection: Selection,
9379    pub graphql_client: DynGraphQLClient,
9380}
9381impl ModuleSource {
9382    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
9383    pub fn as_module(&self) -> Module {
9384        let query = self.selection.select("asModule");
9385        Module {
9386            proc: self.proc.clone(),
9387            selection: query,
9388            graphql_client: self.graphql_client.clone(),
9389        }
9390    }
9391    /// A human readable ref string representation of this module source.
9392    pub async fn as_string(&self) -> Result<String, DaggerError> {
9393        let query = self.selection.select("asString");
9394        query.execute(self.graphql_client.clone()).await
9395    }
9396    /// The blueprint referenced by the module source.
9397    pub fn blueprint(&self) -> ModuleSource {
9398        let query = self.selection.select("blueprint");
9399        ModuleSource {
9400            proc: self.proc.clone(),
9401            selection: query,
9402            graphql_client: self.graphql_client.clone(),
9403        }
9404    }
9405    /// The ref to clone the root of the git repo from. Only valid for git sources.
9406    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
9407        let query = self.selection.select("cloneRef");
9408        query.execute(self.graphql_client.clone()).await
9409    }
9410    /// The resolved commit of the git repo this source points to.
9411    pub async fn commit(&self) -> Result<String, DaggerError> {
9412        let query = self.selection.select("commit");
9413        query.execute(self.graphql_client.clone()).await
9414    }
9415    /// The clients generated for the module.
9416    pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
9417        let query = self.selection.select("configClients");
9418        vec![ModuleConfigClient {
9419            proc: self.proc.clone(),
9420            selection: query,
9421            graphql_client: self.graphql_client.clone(),
9422        }]
9423    }
9424    /// Whether an existing dagger.json for the module was found.
9425    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
9426        let query = self.selection.select("configExists");
9427        query.execute(self.graphql_client.clone()).await
9428    }
9429    /// The full directory loaded for the module source, including the source code as a subdirectory.
9430    pub fn context_directory(&self) -> Directory {
9431        let query = self.selection.select("contextDirectory");
9432        Directory {
9433            proc: self.proc.clone(),
9434            selection: query,
9435            graphql_client: self.graphql_client.clone(),
9436        }
9437    }
9438    /// The dependencies of the module source.
9439    pub fn dependencies(&self) -> Vec<ModuleSource> {
9440        let query = self.selection.select("dependencies");
9441        vec![ModuleSource {
9442            proc: self.proc.clone(),
9443            selection: query,
9444            graphql_client: self.graphql_client.clone(),
9445        }]
9446    }
9447    /// 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.
9448    pub async fn digest(&self) -> Result<String, DaggerError> {
9449        let query = self.selection.select("digest");
9450        query.execute(self.graphql_client.clone()).await
9451    }
9452    /// The directory containing the module configuration and source code (source code may be in a subdir).
9453    ///
9454    /// # Arguments
9455    ///
9456    /// * `path` - A subpath from the source directory to select.
9457    pub fn directory(&self, path: impl Into<String>) -> Directory {
9458        let mut query = self.selection.select("directory");
9459        query = query.arg("path", path.into());
9460        Directory {
9461            proc: self.proc.clone(),
9462            selection: query,
9463            graphql_client: self.graphql_client.clone(),
9464        }
9465    }
9466    /// The engine version of the module.
9467    pub async fn engine_version(&self) -> Result<String, DaggerError> {
9468        let query = self.selection.select("engineVersion");
9469        query.execute(self.graphql_client.clone()).await
9470    }
9471    /// The generated files and directories made on top of the module source's context directory.
9472    pub fn generated_context_directory(&self) -> Directory {
9473        let query = self.selection.select("generatedContextDirectory");
9474        Directory {
9475            proc: self.proc.clone(),
9476            selection: query,
9477            graphql_client: self.graphql_client.clone(),
9478        }
9479    }
9480    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
9481    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
9482        let query = self.selection.select("htmlRepoURL");
9483        query.execute(self.graphql_client.clone()).await
9484    }
9485    /// The URL to the source's git repo in a web browser. Only valid for git sources.
9486    pub async fn html_url(&self) -> Result<String, DaggerError> {
9487        let query = self.selection.select("htmlURL");
9488        query.execute(self.graphql_client.clone()).await
9489    }
9490    /// A unique identifier for this ModuleSource.
9491    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
9492        let query = self.selection.select("id");
9493        query.execute(self.graphql_client.clone()).await
9494    }
9495    /// The kind of module source (currently local, git or dir).
9496    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
9497        let query = self.selection.select("kind");
9498        query.execute(self.graphql_client.clone()).await
9499    }
9500    /// 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.
9501    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
9502        let query = self.selection.select("localContextDirectoryPath");
9503        query.execute(self.graphql_client.clone()).await
9504    }
9505    /// The name of the module, including any setting via the withName API.
9506    pub async fn module_name(&self) -> Result<String, DaggerError> {
9507        let query = self.selection.select("moduleName");
9508        query.execute(self.graphql_client.clone()).await
9509    }
9510    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
9511    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
9512        let query = self.selection.select("moduleOriginalName");
9513        query.execute(self.graphql_client.clone()).await
9514    }
9515    /// The original subpath used when instantiating this module source, relative to the context directory.
9516    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
9517        let query = self.selection.select("originalSubpath");
9518        query.execute(self.graphql_client.clone()).await
9519    }
9520    /// The pinned version of this module source.
9521    pub async fn pin(&self) -> Result<String, DaggerError> {
9522        let query = self.selection.select("pin");
9523        query.execute(self.graphql_client.clone()).await
9524    }
9525    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
9526    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
9527        let query = self.selection.select("repoRootPath");
9528        query.execute(self.graphql_client.clone()).await
9529    }
9530    /// The SDK configuration of the module.
9531    pub fn sdk(&self) -> SdkConfig {
9532        let query = self.selection.select("sdk");
9533        SdkConfig {
9534            proc: self.proc.clone(),
9535            selection: query,
9536            graphql_client: self.graphql_client.clone(),
9537        }
9538    }
9539    /// The path, relative to the context directory, that contains the module's dagger.json.
9540    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
9541        let query = self.selection.select("sourceRootSubpath");
9542        query.execute(self.graphql_client.clone()).await
9543    }
9544    /// The path to the directory containing the module's source code, relative to the context directory.
9545    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
9546        let query = self.selection.select("sourceSubpath");
9547        query.execute(self.graphql_client.clone()).await
9548    }
9549    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
9550    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
9551        let query = self.selection.select("sync");
9552        query.execute(self.graphql_client.clone()).await
9553    }
9554    /// The specified version of the git repo this source points to.
9555    pub async fn version(&self) -> Result<String, DaggerError> {
9556        let query = self.selection.select("version");
9557        query.execute(self.graphql_client.clone()).await
9558    }
9559    /// Set a blueprint for the module source.
9560    ///
9561    /// # Arguments
9562    ///
9563    /// * `blueprint` - The blueprint module to set.
9564    pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
9565        let mut query = self.selection.select("withBlueprint");
9566        query = query.arg_lazy(
9567            "blueprint",
9568            Box::new(move || {
9569                let blueprint = blueprint.clone();
9570                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
9571            }),
9572        );
9573        ModuleSource {
9574            proc: self.proc.clone(),
9575            selection: query,
9576            graphql_client: self.graphql_client.clone(),
9577        }
9578    }
9579    /// Update the module source with a new client to generate.
9580    ///
9581    /// # Arguments
9582    ///
9583    /// * `generator` - The generator to use
9584    /// * `output_dir` - The output directory for the generated client.
9585    pub fn with_client(
9586        &self,
9587        generator: impl Into<String>,
9588        output_dir: impl Into<String>,
9589    ) -> ModuleSource {
9590        let mut query = self.selection.select("withClient");
9591        query = query.arg("generator", generator.into());
9592        query = query.arg("outputDir", output_dir.into());
9593        ModuleSource {
9594            proc: self.proc.clone(),
9595            selection: query,
9596            graphql_client: self.graphql_client.clone(),
9597        }
9598    }
9599    /// Append the provided dependencies to the module source's dependency list.
9600    ///
9601    /// # Arguments
9602    ///
9603    /// * `dependencies` - The dependencies to append.
9604    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
9605        let mut query = self.selection.select("withDependencies");
9606        query = query.arg("dependencies", dependencies);
9607        ModuleSource {
9608            proc: self.proc.clone(),
9609            selection: query,
9610            graphql_client: self.graphql_client.clone(),
9611        }
9612    }
9613    /// Upgrade the engine version of the module to the given value.
9614    ///
9615    /// # Arguments
9616    ///
9617    /// * `version` - The engine version to upgrade to.
9618    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
9619        let mut query = self.selection.select("withEngineVersion");
9620        query = query.arg("version", version.into());
9621        ModuleSource {
9622            proc: self.proc.clone(),
9623            selection: query,
9624            graphql_client: self.graphql_client.clone(),
9625        }
9626    }
9627    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
9628    ///
9629    /// # Arguments
9630    ///
9631    /// * `patterns` - The new additional include patterns.
9632    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
9633        let mut query = self.selection.select("withIncludes");
9634        query = query.arg(
9635            "patterns",
9636            patterns
9637                .into_iter()
9638                .map(|i| i.into())
9639                .collect::<Vec<String>>(),
9640        );
9641        ModuleSource {
9642            proc: self.proc.clone(),
9643            selection: query,
9644            graphql_client: self.graphql_client.clone(),
9645        }
9646    }
9647    /// Update the module source with a new name.
9648    ///
9649    /// # Arguments
9650    ///
9651    /// * `name` - The name to set.
9652    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
9653        let mut query = self.selection.select("withName");
9654        query = query.arg("name", name.into());
9655        ModuleSource {
9656            proc: self.proc.clone(),
9657            selection: query,
9658            graphql_client: self.graphql_client.clone(),
9659        }
9660    }
9661    /// Update the module source with a new SDK.
9662    ///
9663    /// # Arguments
9664    ///
9665    /// * `source` - The SDK source to set.
9666    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
9667        let mut query = self.selection.select("withSDK");
9668        query = query.arg("source", source.into());
9669        ModuleSource {
9670            proc: self.proc.clone(),
9671            selection: query,
9672            graphql_client: self.graphql_client.clone(),
9673        }
9674    }
9675    /// Update the module source with a new source subpath.
9676    ///
9677    /// # Arguments
9678    ///
9679    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
9680    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
9681        let mut query = self.selection.select("withSourceSubpath");
9682        query = query.arg("path", path.into());
9683        ModuleSource {
9684            proc: self.proc.clone(),
9685            selection: query,
9686            graphql_client: self.graphql_client.clone(),
9687        }
9688    }
9689    /// Update the blueprint module to the latest version.
9690    pub fn with_update_blueprint(&self) -> ModuleSource {
9691        let query = self.selection.select("withUpdateBlueprint");
9692        ModuleSource {
9693            proc: self.proc.clone(),
9694            selection: query,
9695            graphql_client: self.graphql_client.clone(),
9696        }
9697    }
9698    /// Update one or more module dependencies.
9699    ///
9700    /// # Arguments
9701    ///
9702    /// * `dependencies` - The dependencies to update.
9703    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
9704        let mut query = self.selection.select("withUpdateDependencies");
9705        query = query.arg(
9706            "dependencies",
9707            dependencies
9708                .into_iter()
9709                .map(|i| i.into())
9710                .collect::<Vec<String>>(),
9711        );
9712        ModuleSource {
9713            proc: self.proc.clone(),
9714            selection: query,
9715            graphql_client: self.graphql_client.clone(),
9716        }
9717    }
9718    /// Remove the current blueprint from the module source.
9719    pub fn without_blueprint(&self) -> ModuleSource {
9720        let query = self.selection.select("withoutBlueprint");
9721        ModuleSource {
9722            proc: self.proc.clone(),
9723            selection: query,
9724            graphql_client: self.graphql_client.clone(),
9725        }
9726    }
9727    /// Remove a client from the module source.
9728    ///
9729    /// # Arguments
9730    ///
9731    /// * `path` - The path of the client to remove.
9732    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
9733        let mut query = self.selection.select("withoutClient");
9734        query = query.arg("path", path.into());
9735        ModuleSource {
9736            proc: self.proc.clone(),
9737            selection: query,
9738            graphql_client: self.graphql_client.clone(),
9739        }
9740    }
9741    /// Remove the provided dependencies from the module source's dependency list.
9742    ///
9743    /// # Arguments
9744    ///
9745    /// * `dependencies` - The dependencies to remove.
9746    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
9747        let mut query = self.selection.select("withoutDependencies");
9748        query = query.arg(
9749            "dependencies",
9750            dependencies
9751                .into_iter()
9752                .map(|i| i.into())
9753                .collect::<Vec<String>>(),
9754        );
9755        ModuleSource {
9756            proc: self.proc.clone(),
9757            selection: query,
9758            graphql_client: self.graphql_client.clone(),
9759        }
9760    }
9761}
9762#[derive(Clone)]
9763pub struct ObjectTypeDef {
9764    pub proc: Option<Arc<DaggerSessionProc>>,
9765    pub selection: Selection,
9766    pub graphql_client: DynGraphQLClient,
9767}
9768impl ObjectTypeDef {
9769    /// The function used to construct new instances of this object, if any
9770    pub fn constructor(&self) -> Function {
9771        let query = self.selection.select("constructor");
9772        Function {
9773            proc: self.proc.clone(),
9774            selection: query,
9775            graphql_client: self.graphql_client.clone(),
9776        }
9777    }
9778    /// The doc string for the object, if any.
9779    pub async fn description(&self) -> Result<String, DaggerError> {
9780        let query = self.selection.select("description");
9781        query.execute(self.graphql_client.clone()).await
9782    }
9783    /// Static fields defined on this object, if any.
9784    pub fn fields(&self) -> Vec<FieldTypeDef> {
9785        let query = self.selection.select("fields");
9786        vec![FieldTypeDef {
9787            proc: self.proc.clone(),
9788            selection: query,
9789            graphql_client: self.graphql_client.clone(),
9790        }]
9791    }
9792    /// Functions defined on this object, if any.
9793    pub fn functions(&self) -> Vec<Function> {
9794        let query = self.selection.select("functions");
9795        vec![Function {
9796            proc: self.proc.clone(),
9797            selection: query,
9798            graphql_client: self.graphql_client.clone(),
9799        }]
9800    }
9801    /// A unique identifier for this ObjectTypeDef.
9802    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
9803        let query = self.selection.select("id");
9804        query.execute(self.graphql_client.clone()).await
9805    }
9806    /// The name of the object.
9807    pub async fn name(&self) -> Result<String, DaggerError> {
9808        let query = self.selection.select("name");
9809        query.execute(self.graphql_client.clone()).await
9810    }
9811    /// The location of this object declaration.
9812    pub fn source_map(&self) -> SourceMap {
9813        let query = self.selection.select("sourceMap");
9814        SourceMap {
9815            proc: self.proc.clone(),
9816            selection: query,
9817            graphql_client: self.graphql_client.clone(),
9818        }
9819    }
9820    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
9821    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9822        let query = self.selection.select("sourceModuleName");
9823        query.execute(self.graphql_client.clone()).await
9824    }
9825}
9826#[derive(Clone)]
9827pub struct Port {
9828    pub proc: Option<Arc<DaggerSessionProc>>,
9829    pub selection: Selection,
9830    pub graphql_client: DynGraphQLClient,
9831}
9832impl Port {
9833    /// The port description.
9834    pub async fn description(&self) -> Result<String, DaggerError> {
9835        let query = self.selection.select("description");
9836        query.execute(self.graphql_client.clone()).await
9837    }
9838    /// Skip the health check when run as a service.
9839    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
9840        let query = self.selection.select("experimentalSkipHealthcheck");
9841        query.execute(self.graphql_client.clone()).await
9842    }
9843    /// A unique identifier for this Port.
9844    pub async fn id(&self) -> Result<PortId, DaggerError> {
9845        let query = self.selection.select("id");
9846        query.execute(self.graphql_client.clone()).await
9847    }
9848    /// The port number.
9849    pub async fn port(&self) -> Result<isize, DaggerError> {
9850        let query = self.selection.select("port");
9851        query.execute(self.graphql_client.clone()).await
9852    }
9853    /// The transport layer protocol.
9854    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
9855        let query = self.selection.select("protocol");
9856        query.execute(self.graphql_client.clone()).await
9857    }
9858}
9859#[derive(Clone)]
9860pub struct Query {
9861    pub proc: Option<Arc<DaggerSessionProc>>,
9862    pub selection: Selection,
9863    pub graphql_client: DynGraphQLClient,
9864}
9865#[derive(Builder, Debug, PartialEq)]
9866pub struct QueryContainerOpts {
9867    /// Platform to initialize the container with. Defaults to the native platform of the current engine
9868    #[builder(setter(into, strip_option), default)]
9869    pub platform: Option<Platform>,
9870}
9871#[derive(Builder, Debug, PartialEq)]
9872pub struct QueryEnvOpts {
9873    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
9874    #[builder(setter(into, strip_option), default)]
9875    pub privileged: Option<bool>,
9876    /// Allow new outputs to be declared and saved in the environment
9877    #[builder(setter(into, strip_option), default)]
9878    pub writable: Option<bool>,
9879}
9880#[derive(Builder, Debug, PartialEq)]
9881pub struct QueryEnvFileOpts {
9882    /// Replace "${VAR}" or "$VAR" with the value of other vars
9883    #[builder(setter(into, strip_option), default)]
9884    pub expand: Option<bool>,
9885}
9886#[derive(Builder, Debug, PartialEq)]
9887pub struct QueryFileOpts {
9888    /// Permissions of the new file. Example: 0600
9889    #[builder(setter(into, strip_option), default)]
9890    pub permissions: Option<isize>,
9891}
9892#[derive(Builder, Debug, PartialEq)]
9893pub struct QueryGitOpts<'a> {
9894    /// A service which must be started before the repo is fetched.
9895    #[builder(setter(into, strip_option), default)]
9896    pub experimental_service_host: Option<ServiceId>,
9897    /// Secret used to populate the Authorization HTTP header
9898    #[builder(setter(into, strip_option), default)]
9899    pub http_auth_header: Option<SecretId>,
9900    /// Secret used to populate the password during basic HTTP Authorization
9901    #[builder(setter(into, strip_option), default)]
9902    pub http_auth_token: Option<SecretId>,
9903    /// Username used to populate the password during basic HTTP Authorization
9904    #[builder(setter(into, strip_option), default)]
9905    pub http_auth_username: Option<&'a str>,
9906    /// DEPRECATED: Set to true to keep .git directory.
9907    #[builder(setter(into, strip_option), default)]
9908    pub keep_git_dir: Option<bool>,
9909    /// Set SSH auth socket
9910    #[builder(setter(into, strip_option), default)]
9911    pub ssh_auth_socket: Option<SocketId>,
9912    /// Set SSH known hosts
9913    #[builder(setter(into, strip_option), default)]
9914    pub ssh_known_hosts: Option<&'a str>,
9915}
9916#[derive(Builder, Debug, PartialEq)]
9917pub struct QueryHttpOpts<'a> {
9918    /// Secret used to populate the Authorization HTTP header
9919    #[builder(setter(into, strip_option), default)]
9920    pub auth_header: Option<SecretId>,
9921    /// A service which must be started before the URL is fetched.
9922    #[builder(setter(into, strip_option), default)]
9923    pub experimental_service_host: Option<ServiceId>,
9924    /// File name to use for the file. Defaults to the last part of the URL.
9925    #[builder(setter(into, strip_option), default)]
9926    pub name: Option<&'a str>,
9927    /// Permissions to set on the file.
9928    #[builder(setter(into, strip_option), default)]
9929    pub permissions: Option<isize>,
9930}
9931#[derive(Builder, Debug, PartialEq)]
9932pub struct QueryLlmOpts<'a> {
9933    /// Cap the number of API calls for this LLM
9934    #[builder(setter(into, strip_option), default)]
9935    pub max_api_calls: Option<isize>,
9936    /// Model to use
9937    #[builder(setter(into, strip_option), default)]
9938    pub model: Option<&'a str>,
9939}
9940#[derive(Builder, Debug, PartialEq)]
9941pub struct QueryModuleSourceOpts<'a> {
9942    /// 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.
9943    #[builder(setter(into, strip_option), default)]
9944    pub allow_not_exists: Option<bool>,
9945    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
9946    #[builder(setter(into, strip_option), default)]
9947    pub disable_find_up: Option<bool>,
9948    /// The pinned version of the module source
9949    #[builder(setter(into, strip_option), default)]
9950    pub ref_pin: Option<&'a str>,
9951    /// If set, error out if the ref string is not of the provided requireKind.
9952    #[builder(setter(into, strip_option), default)]
9953    pub require_kind: Option<ModuleSourceKind>,
9954}
9955#[derive(Builder, Debug, PartialEq)]
9956pub struct QuerySecretOpts<'a> {
9957    /// 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.
9958    /// 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.
9959    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
9960    #[builder(setter(into, strip_option), default)]
9961    pub cache_key: Option<&'a str>,
9962}
9963impl Query {
9964    /// Constructs a cache volume for a given cache key.
9965    ///
9966    /// # Arguments
9967    ///
9968    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
9969    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
9970        let mut query = self.selection.select("cacheVolume");
9971        query = query.arg("key", key.into());
9972        CacheVolume {
9973            proc: self.proc.clone(),
9974            selection: query,
9975            graphql_client: self.graphql_client.clone(),
9976        }
9977    }
9978    /// Dagger Cloud configuration and state
9979    pub fn cloud(&self) -> Cloud {
9980        let query = self.selection.select("cloud");
9981        Cloud {
9982            proc: self.proc.clone(),
9983            selection: query,
9984            graphql_client: self.graphql_client.clone(),
9985        }
9986    }
9987    /// Creates a scratch container, with no image or metadata.
9988    /// To pull an image, follow up with the "from" function.
9989    ///
9990    /// # Arguments
9991    ///
9992    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9993    pub fn container(&self) -> Container {
9994        let query = self.selection.select("container");
9995        Container {
9996            proc: self.proc.clone(),
9997            selection: query,
9998            graphql_client: self.graphql_client.clone(),
9999        }
10000    }
10001    /// Creates a scratch container, with no image or metadata.
10002    /// To pull an image, follow up with the "from" function.
10003    ///
10004    /// # Arguments
10005    ///
10006    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10007    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
10008        let mut query = self.selection.select("container");
10009        if let Some(platform) = opts.platform {
10010            query = query.arg("platform", platform);
10011        }
10012        Container {
10013            proc: self.proc.clone(),
10014            selection: query,
10015            graphql_client: self.graphql_client.clone(),
10016        }
10017    }
10018    /// The FunctionCall context that the SDK caller is currently executing in.
10019    /// If the caller is not currently executing in a function, this will return an error.
10020    pub fn current_function_call(&self) -> FunctionCall {
10021        let query = self.selection.select("currentFunctionCall");
10022        FunctionCall {
10023            proc: self.proc.clone(),
10024            selection: query,
10025            graphql_client: self.graphql_client.clone(),
10026        }
10027    }
10028    /// The module currently being served in the session, if any.
10029    pub fn current_module(&self) -> CurrentModule {
10030        let query = self.selection.select("currentModule");
10031        CurrentModule {
10032            proc: self.proc.clone(),
10033            selection: query,
10034            graphql_client: self.graphql_client.clone(),
10035        }
10036    }
10037    /// The TypeDef representations of the objects currently being served in the session.
10038    pub fn current_type_defs(&self) -> Vec<TypeDef> {
10039        let query = self.selection.select("currentTypeDefs");
10040        vec![TypeDef {
10041            proc: self.proc.clone(),
10042            selection: query,
10043            graphql_client: self.graphql_client.clone(),
10044        }]
10045    }
10046    /// The default platform of the engine.
10047    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
10048        let query = self.selection.select("defaultPlatform");
10049        query.execute(self.graphql_client.clone()).await
10050    }
10051    /// Creates an empty directory.
10052    pub fn directory(&self) -> Directory {
10053        let query = self.selection.select("directory");
10054        Directory {
10055            proc: self.proc.clone(),
10056            selection: query,
10057            graphql_client: self.graphql_client.clone(),
10058        }
10059    }
10060    /// The Dagger engine container configuration and state
10061    pub fn engine(&self) -> Engine {
10062        let query = self.selection.select("engine");
10063        Engine {
10064            proc: self.proc.clone(),
10065            selection: query,
10066            graphql_client: self.graphql_client.clone(),
10067        }
10068    }
10069    /// Initialize a new environment
10070    ///
10071    /// # Arguments
10072    ///
10073    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10074    pub fn env(&self) -> Env {
10075        let query = self.selection.select("env");
10076        Env {
10077            proc: self.proc.clone(),
10078            selection: query,
10079            graphql_client: self.graphql_client.clone(),
10080        }
10081    }
10082    /// Initialize a new environment
10083    ///
10084    /// # Arguments
10085    ///
10086    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10087    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
10088        let mut query = self.selection.select("env");
10089        if let Some(privileged) = opts.privileged {
10090            query = query.arg("privileged", privileged);
10091        }
10092        if let Some(writable) = opts.writable {
10093            query = query.arg("writable", writable);
10094        }
10095        Env {
10096            proc: self.proc.clone(),
10097            selection: query,
10098            graphql_client: self.graphql_client.clone(),
10099        }
10100    }
10101    /// Initialize an environment file
10102    ///
10103    /// # Arguments
10104    ///
10105    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10106    pub fn env_file(&self) -> EnvFile {
10107        let query = self.selection.select("envFile");
10108        EnvFile {
10109            proc: self.proc.clone(),
10110            selection: query,
10111            graphql_client: self.graphql_client.clone(),
10112        }
10113    }
10114    /// Initialize an environment file
10115    ///
10116    /// # Arguments
10117    ///
10118    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10119    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
10120        let mut query = self.selection.select("envFile");
10121        if let Some(expand) = opts.expand {
10122            query = query.arg("expand", expand);
10123        }
10124        EnvFile {
10125            proc: self.proc.clone(),
10126            selection: query,
10127            graphql_client: self.graphql_client.clone(),
10128        }
10129    }
10130    /// Create a new error.
10131    ///
10132    /// # Arguments
10133    ///
10134    /// * `message` - A brief description of the error.
10135    pub fn error(&self, message: impl Into<String>) -> Error {
10136        let mut query = self.selection.select("error");
10137        query = query.arg("message", message.into());
10138        Error {
10139            proc: self.proc.clone(),
10140            selection: query,
10141            graphql_client: self.graphql_client.clone(),
10142        }
10143    }
10144    /// Creates a file with the specified contents.
10145    ///
10146    /// # Arguments
10147    ///
10148    /// * `name` - Name of the new file. Example: "foo.txt"
10149    /// * `contents` - Contents of the new file. Example: "Hello world!"
10150    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10151    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
10152        let mut query = self.selection.select("file");
10153        query = query.arg("name", name.into());
10154        query = query.arg("contents", contents.into());
10155        File {
10156            proc: self.proc.clone(),
10157            selection: query,
10158            graphql_client: self.graphql_client.clone(),
10159        }
10160    }
10161    /// Creates a file with the specified contents.
10162    ///
10163    /// # Arguments
10164    ///
10165    /// * `name` - Name of the new file. Example: "foo.txt"
10166    /// * `contents` - Contents of the new file. Example: "Hello world!"
10167    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10168    pub fn file_opts(
10169        &self,
10170        name: impl Into<String>,
10171        contents: impl Into<String>,
10172        opts: QueryFileOpts,
10173    ) -> File {
10174        let mut query = self.selection.select("file");
10175        query = query.arg("name", name.into());
10176        query = query.arg("contents", contents.into());
10177        if let Some(permissions) = opts.permissions {
10178            query = query.arg("permissions", permissions);
10179        }
10180        File {
10181            proc: self.proc.clone(),
10182            selection: query,
10183            graphql_client: self.graphql_client.clone(),
10184        }
10185    }
10186    /// Creates a function.
10187    ///
10188    /// # Arguments
10189    ///
10190    /// * `name` - Name of the function, in its original format from the implementation language.
10191    /// * `return_type` - Return type of the function.
10192    pub fn function(
10193        &self,
10194        name: impl Into<String>,
10195        return_type: impl IntoID<TypeDefId>,
10196    ) -> Function {
10197        let mut query = self.selection.select("function");
10198        query = query.arg("name", name.into());
10199        query = query.arg_lazy(
10200            "returnType",
10201            Box::new(move || {
10202                let return_type = return_type.clone();
10203                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
10204            }),
10205        );
10206        Function {
10207            proc: self.proc.clone(),
10208            selection: query,
10209            graphql_client: self.graphql_client.clone(),
10210        }
10211    }
10212    /// Create a code generation result, given a directory containing the generated code.
10213    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
10214        let mut query = self.selection.select("generatedCode");
10215        query = query.arg_lazy(
10216            "code",
10217            Box::new(move || {
10218                let code = code.clone();
10219                Box::pin(async move { code.into_id().await.unwrap().quote() })
10220            }),
10221        );
10222        GeneratedCode {
10223            proc: self.proc.clone(),
10224            selection: query,
10225            graphql_client: self.graphql_client.clone(),
10226        }
10227    }
10228    /// Queries a Git repository.
10229    ///
10230    /// # Arguments
10231    ///
10232    /// * `url` - URL of the git repository.
10233    ///
10234    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
10235    ///
10236    /// Suffix ".git" is optional.
10237    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10238    pub fn git(&self, url: impl Into<String>) -> GitRepository {
10239        let mut query = self.selection.select("git");
10240        query = query.arg("url", url.into());
10241        GitRepository {
10242            proc: self.proc.clone(),
10243            selection: query,
10244            graphql_client: self.graphql_client.clone(),
10245        }
10246    }
10247    /// Queries a Git repository.
10248    ///
10249    /// # Arguments
10250    ///
10251    /// * `url` - URL of the git repository.
10252    ///
10253    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
10254    ///
10255    /// Suffix ".git" is optional.
10256    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10257    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
10258        let mut query = self.selection.select("git");
10259        query = query.arg("url", url.into());
10260        if let Some(keep_git_dir) = opts.keep_git_dir {
10261            query = query.arg("keepGitDir", keep_git_dir);
10262        }
10263        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
10264            query = query.arg("sshKnownHosts", ssh_known_hosts);
10265        }
10266        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
10267            query = query.arg("sshAuthSocket", ssh_auth_socket);
10268        }
10269        if let Some(http_auth_username) = opts.http_auth_username {
10270            query = query.arg("httpAuthUsername", http_auth_username);
10271        }
10272        if let Some(http_auth_token) = opts.http_auth_token {
10273            query = query.arg("httpAuthToken", http_auth_token);
10274        }
10275        if let Some(http_auth_header) = opts.http_auth_header {
10276            query = query.arg("httpAuthHeader", http_auth_header);
10277        }
10278        if let Some(experimental_service_host) = opts.experimental_service_host {
10279            query = query.arg("experimentalServiceHost", experimental_service_host);
10280        }
10281        GitRepository {
10282            proc: self.proc.clone(),
10283            selection: query,
10284            graphql_client: self.graphql_client.clone(),
10285        }
10286    }
10287    /// Queries the host environment.
10288    pub fn host(&self) -> Host {
10289        let query = self.selection.select("host");
10290        Host {
10291            proc: self.proc.clone(),
10292            selection: query,
10293            graphql_client: self.graphql_client.clone(),
10294        }
10295    }
10296    /// Returns a file containing an http remote url content.
10297    ///
10298    /// # Arguments
10299    ///
10300    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
10301    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10302    pub fn http(&self, url: impl Into<String>) -> File {
10303        let mut query = self.selection.select("http");
10304        query = query.arg("url", url.into());
10305        File {
10306            proc: self.proc.clone(),
10307            selection: query,
10308            graphql_client: self.graphql_client.clone(),
10309        }
10310    }
10311    /// Returns a file containing an http remote url content.
10312    ///
10313    /// # Arguments
10314    ///
10315    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
10316    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10317    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
10318        let mut query = self.selection.select("http");
10319        query = query.arg("url", url.into());
10320        if let Some(name) = opts.name {
10321            query = query.arg("name", name);
10322        }
10323        if let Some(permissions) = opts.permissions {
10324            query = query.arg("permissions", permissions);
10325        }
10326        if let Some(auth_header) = opts.auth_header {
10327            query = query.arg("authHeader", auth_header);
10328        }
10329        if let Some(experimental_service_host) = opts.experimental_service_host {
10330            query = query.arg("experimentalServiceHost", experimental_service_host);
10331        }
10332        File {
10333            proc: self.proc.clone(),
10334            selection: query,
10335            graphql_client: self.graphql_client.clone(),
10336        }
10337    }
10338    /// Initialize a JSON value
10339    pub fn json(&self) -> JsonValue {
10340        let query = self.selection.select("json");
10341        JsonValue {
10342            proc: self.proc.clone(),
10343            selection: query,
10344            graphql_client: self.graphql_client.clone(),
10345        }
10346    }
10347    /// Initialize a Large Language Model (LLM)
10348    ///
10349    /// # Arguments
10350    ///
10351    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10352    pub fn llm(&self) -> Llm {
10353        let query = self.selection.select("llm");
10354        Llm {
10355            proc: self.proc.clone(),
10356            selection: query,
10357            graphql_client: self.graphql_client.clone(),
10358        }
10359    }
10360    /// Initialize a Large Language Model (LLM)
10361    ///
10362    /// # Arguments
10363    ///
10364    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10365    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
10366        let mut query = self.selection.select("llm");
10367        if let Some(model) = opts.model {
10368            query = query.arg("model", model);
10369        }
10370        if let Some(max_api_calls) = opts.max_api_calls {
10371            query = query.arg("maxAPICalls", max_api_calls);
10372        }
10373        Llm {
10374            proc: self.proc.clone(),
10375            selection: query,
10376            graphql_client: self.graphql_client.clone(),
10377        }
10378    }
10379    /// Load a Binding from its ID.
10380    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
10381        let mut query = self.selection.select("loadBindingFromID");
10382        query = query.arg_lazy(
10383            "id",
10384            Box::new(move || {
10385                let id = id.clone();
10386                Box::pin(async move { id.into_id().await.unwrap().quote() })
10387            }),
10388        );
10389        Binding {
10390            proc: self.proc.clone(),
10391            selection: query,
10392            graphql_client: self.graphql_client.clone(),
10393        }
10394    }
10395    /// Load a CacheVolume from its ID.
10396    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
10397        let mut query = self.selection.select("loadCacheVolumeFromID");
10398        query = query.arg_lazy(
10399            "id",
10400            Box::new(move || {
10401                let id = id.clone();
10402                Box::pin(async move { id.into_id().await.unwrap().quote() })
10403            }),
10404        );
10405        CacheVolume {
10406            proc: self.proc.clone(),
10407            selection: query,
10408            graphql_client: self.graphql_client.clone(),
10409        }
10410    }
10411    /// Load a Changeset from its ID.
10412    pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
10413        let mut query = self.selection.select("loadChangesetFromID");
10414        query = query.arg_lazy(
10415            "id",
10416            Box::new(move || {
10417                let id = id.clone();
10418                Box::pin(async move { id.into_id().await.unwrap().quote() })
10419            }),
10420        );
10421        Changeset {
10422            proc: self.proc.clone(),
10423            selection: query,
10424            graphql_client: self.graphql_client.clone(),
10425        }
10426    }
10427    /// Load a Cloud from its ID.
10428    pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
10429        let mut query = self.selection.select("loadCloudFromID");
10430        query = query.arg_lazy(
10431            "id",
10432            Box::new(move || {
10433                let id = id.clone();
10434                Box::pin(async move { id.into_id().await.unwrap().quote() })
10435            }),
10436        );
10437        Cloud {
10438            proc: self.proc.clone(),
10439            selection: query,
10440            graphql_client: self.graphql_client.clone(),
10441        }
10442    }
10443    /// Load a Container from its ID.
10444    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
10445        let mut query = self.selection.select("loadContainerFromID");
10446        query = query.arg_lazy(
10447            "id",
10448            Box::new(move || {
10449                let id = id.clone();
10450                Box::pin(async move { id.into_id().await.unwrap().quote() })
10451            }),
10452        );
10453        Container {
10454            proc: self.proc.clone(),
10455            selection: query,
10456            graphql_client: self.graphql_client.clone(),
10457        }
10458    }
10459    /// Load a CurrentModule from its ID.
10460    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
10461        let mut query = self.selection.select("loadCurrentModuleFromID");
10462        query = query.arg_lazy(
10463            "id",
10464            Box::new(move || {
10465                let id = id.clone();
10466                Box::pin(async move { id.into_id().await.unwrap().quote() })
10467            }),
10468        );
10469        CurrentModule {
10470            proc: self.proc.clone(),
10471            selection: query,
10472            graphql_client: self.graphql_client.clone(),
10473        }
10474    }
10475    /// Load a Directory from its ID.
10476    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
10477        let mut query = self.selection.select("loadDirectoryFromID");
10478        query = query.arg_lazy(
10479            "id",
10480            Box::new(move || {
10481                let id = id.clone();
10482                Box::pin(async move { id.into_id().await.unwrap().quote() })
10483            }),
10484        );
10485        Directory {
10486            proc: self.proc.clone(),
10487            selection: query,
10488            graphql_client: self.graphql_client.clone(),
10489        }
10490    }
10491    /// Load a EngineCacheEntry from its ID.
10492    pub fn load_engine_cache_entry_from_id(
10493        &self,
10494        id: impl IntoID<EngineCacheEntryId>,
10495    ) -> EngineCacheEntry {
10496        let mut query = self.selection.select("loadEngineCacheEntryFromID");
10497        query = query.arg_lazy(
10498            "id",
10499            Box::new(move || {
10500                let id = id.clone();
10501                Box::pin(async move { id.into_id().await.unwrap().quote() })
10502            }),
10503        );
10504        EngineCacheEntry {
10505            proc: self.proc.clone(),
10506            selection: query,
10507            graphql_client: self.graphql_client.clone(),
10508        }
10509    }
10510    /// Load a EngineCacheEntrySet from its ID.
10511    pub fn load_engine_cache_entry_set_from_id(
10512        &self,
10513        id: impl IntoID<EngineCacheEntrySetId>,
10514    ) -> EngineCacheEntrySet {
10515        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
10516        query = query.arg_lazy(
10517            "id",
10518            Box::new(move || {
10519                let id = id.clone();
10520                Box::pin(async move { id.into_id().await.unwrap().quote() })
10521            }),
10522        );
10523        EngineCacheEntrySet {
10524            proc: self.proc.clone(),
10525            selection: query,
10526            graphql_client: self.graphql_client.clone(),
10527        }
10528    }
10529    /// Load a EngineCache from its ID.
10530    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
10531        let mut query = self.selection.select("loadEngineCacheFromID");
10532        query = query.arg_lazy(
10533            "id",
10534            Box::new(move || {
10535                let id = id.clone();
10536                Box::pin(async move { id.into_id().await.unwrap().quote() })
10537            }),
10538        );
10539        EngineCache {
10540            proc: self.proc.clone(),
10541            selection: query,
10542            graphql_client: self.graphql_client.clone(),
10543        }
10544    }
10545    /// Load a Engine from its ID.
10546    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
10547        let mut query = self.selection.select("loadEngineFromID");
10548        query = query.arg_lazy(
10549            "id",
10550            Box::new(move || {
10551                let id = id.clone();
10552                Box::pin(async move { id.into_id().await.unwrap().quote() })
10553            }),
10554        );
10555        Engine {
10556            proc: self.proc.clone(),
10557            selection: query,
10558            graphql_client: self.graphql_client.clone(),
10559        }
10560    }
10561    /// Load a EnumTypeDef from its ID.
10562    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
10563        let mut query = self.selection.select("loadEnumTypeDefFromID");
10564        query = query.arg_lazy(
10565            "id",
10566            Box::new(move || {
10567                let id = id.clone();
10568                Box::pin(async move { id.into_id().await.unwrap().quote() })
10569            }),
10570        );
10571        EnumTypeDef {
10572            proc: self.proc.clone(),
10573            selection: query,
10574            graphql_client: self.graphql_client.clone(),
10575        }
10576    }
10577    /// Load a EnumValueTypeDef from its ID.
10578    pub fn load_enum_value_type_def_from_id(
10579        &self,
10580        id: impl IntoID<EnumValueTypeDefId>,
10581    ) -> EnumValueTypeDef {
10582        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
10583        query = query.arg_lazy(
10584            "id",
10585            Box::new(move || {
10586                let id = id.clone();
10587                Box::pin(async move { id.into_id().await.unwrap().quote() })
10588            }),
10589        );
10590        EnumValueTypeDef {
10591            proc: self.proc.clone(),
10592            selection: query,
10593            graphql_client: self.graphql_client.clone(),
10594        }
10595    }
10596    /// Load a EnvFile from its ID.
10597    pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
10598        let mut query = self.selection.select("loadEnvFileFromID");
10599        query = query.arg_lazy(
10600            "id",
10601            Box::new(move || {
10602                let id = id.clone();
10603                Box::pin(async move { id.into_id().await.unwrap().quote() })
10604            }),
10605        );
10606        EnvFile {
10607            proc: self.proc.clone(),
10608            selection: query,
10609            graphql_client: self.graphql_client.clone(),
10610        }
10611    }
10612    /// Load a Env from its ID.
10613    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
10614        let mut query = self.selection.select("loadEnvFromID");
10615        query = query.arg_lazy(
10616            "id",
10617            Box::new(move || {
10618                let id = id.clone();
10619                Box::pin(async move { id.into_id().await.unwrap().quote() })
10620            }),
10621        );
10622        Env {
10623            proc: self.proc.clone(),
10624            selection: query,
10625            graphql_client: self.graphql_client.clone(),
10626        }
10627    }
10628    /// Load a EnvVariable from its ID.
10629    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
10630        let mut query = self.selection.select("loadEnvVariableFromID");
10631        query = query.arg_lazy(
10632            "id",
10633            Box::new(move || {
10634                let id = id.clone();
10635                Box::pin(async move { id.into_id().await.unwrap().quote() })
10636            }),
10637        );
10638        EnvVariable {
10639            proc: self.proc.clone(),
10640            selection: query,
10641            graphql_client: self.graphql_client.clone(),
10642        }
10643    }
10644    /// Load a Error from its ID.
10645    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
10646        let mut query = self.selection.select("loadErrorFromID");
10647        query = query.arg_lazy(
10648            "id",
10649            Box::new(move || {
10650                let id = id.clone();
10651                Box::pin(async move { id.into_id().await.unwrap().quote() })
10652            }),
10653        );
10654        Error {
10655            proc: self.proc.clone(),
10656            selection: query,
10657            graphql_client: self.graphql_client.clone(),
10658        }
10659    }
10660    /// Load a ErrorValue from its ID.
10661    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
10662        let mut query = self.selection.select("loadErrorValueFromID");
10663        query = query.arg_lazy(
10664            "id",
10665            Box::new(move || {
10666                let id = id.clone();
10667                Box::pin(async move { id.into_id().await.unwrap().quote() })
10668            }),
10669        );
10670        ErrorValue {
10671            proc: self.proc.clone(),
10672            selection: query,
10673            graphql_client: self.graphql_client.clone(),
10674        }
10675    }
10676    /// Load a FieldTypeDef from its ID.
10677    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
10678        let mut query = self.selection.select("loadFieldTypeDefFromID");
10679        query = query.arg_lazy(
10680            "id",
10681            Box::new(move || {
10682                let id = id.clone();
10683                Box::pin(async move { id.into_id().await.unwrap().quote() })
10684            }),
10685        );
10686        FieldTypeDef {
10687            proc: self.proc.clone(),
10688            selection: query,
10689            graphql_client: self.graphql_client.clone(),
10690        }
10691    }
10692    /// Load a File from its ID.
10693    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
10694        let mut query = self.selection.select("loadFileFromID");
10695        query = query.arg_lazy(
10696            "id",
10697            Box::new(move || {
10698                let id = id.clone();
10699                Box::pin(async move { id.into_id().await.unwrap().quote() })
10700            }),
10701        );
10702        File {
10703            proc: self.proc.clone(),
10704            selection: query,
10705            graphql_client: self.graphql_client.clone(),
10706        }
10707    }
10708    /// Load a FunctionArg from its ID.
10709    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
10710        let mut query = self.selection.select("loadFunctionArgFromID");
10711        query = query.arg_lazy(
10712            "id",
10713            Box::new(move || {
10714                let id = id.clone();
10715                Box::pin(async move { id.into_id().await.unwrap().quote() })
10716            }),
10717        );
10718        FunctionArg {
10719            proc: self.proc.clone(),
10720            selection: query,
10721            graphql_client: self.graphql_client.clone(),
10722        }
10723    }
10724    /// Load a FunctionCallArgValue from its ID.
10725    pub fn load_function_call_arg_value_from_id(
10726        &self,
10727        id: impl IntoID<FunctionCallArgValueId>,
10728    ) -> FunctionCallArgValue {
10729        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
10730        query = query.arg_lazy(
10731            "id",
10732            Box::new(move || {
10733                let id = id.clone();
10734                Box::pin(async move { id.into_id().await.unwrap().quote() })
10735            }),
10736        );
10737        FunctionCallArgValue {
10738            proc: self.proc.clone(),
10739            selection: query,
10740            graphql_client: self.graphql_client.clone(),
10741        }
10742    }
10743    /// Load a FunctionCall from its ID.
10744    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
10745        let mut query = self.selection.select("loadFunctionCallFromID");
10746        query = query.arg_lazy(
10747            "id",
10748            Box::new(move || {
10749                let id = id.clone();
10750                Box::pin(async move { id.into_id().await.unwrap().quote() })
10751            }),
10752        );
10753        FunctionCall {
10754            proc: self.proc.clone(),
10755            selection: query,
10756            graphql_client: self.graphql_client.clone(),
10757        }
10758    }
10759    /// Load a Function from its ID.
10760    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
10761        let mut query = self.selection.select("loadFunctionFromID");
10762        query = query.arg_lazy(
10763            "id",
10764            Box::new(move || {
10765                let id = id.clone();
10766                Box::pin(async move { id.into_id().await.unwrap().quote() })
10767            }),
10768        );
10769        Function {
10770            proc: self.proc.clone(),
10771            selection: query,
10772            graphql_client: self.graphql_client.clone(),
10773        }
10774    }
10775    /// Load a GeneratedCode from its ID.
10776    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
10777        let mut query = self.selection.select("loadGeneratedCodeFromID");
10778        query = query.arg_lazy(
10779            "id",
10780            Box::new(move || {
10781                let id = id.clone();
10782                Box::pin(async move { id.into_id().await.unwrap().quote() })
10783            }),
10784        );
10785        GeneratedCode {
10786            proc: self.proc.clone(),
10787            selection: query,
10788            graphql_client: self.graphql_client.clone(),
10789        }
10790    }
10791    /// Load a GitRef from its ID.
10792    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
10793        let mut query = self.selection.select("loadGitRefFromID");
10794        query = query.arg_lazy(
10795            "id",
10796            Box::new(move || {
10797                let id = id.clone();
10798                Box::pin(async move { id.into_id().await.unwrap().quote() })
10799            }),
10800        );
10801        GitRef {
10802            proc: self.proc.clone(),
10803            selection: query,
10804            graphql_client: self.graphql_client.clone(),
10805        }
10806    }
10807    /// Load a GitRepository from its ID.
10808    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
10809        let mut query = self.selection.select("loadGitRepositoryFromID");
10810        query = query.arg_lazy(
10811            "id",
10812            Box::new(move || {
10813                let id = id.clone();
10814                Box::pin(async move { id.into_id().await.unwrap().quote() })
10815            }),
10816        );
10817        GitRepository {
10818            proc: self.proc.clone(),
10819            selection: query,
10820            graphql_client: self.graphql_client.clone(),
10821        }
10822    }
10823    /// Load a Host from its ID.
10824    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
10825        let mut query = self.selection.select("loadHostFromID");
10826        query = query.arg_lazy(
10827            "id",
10828            Box::new(move || {
10829                let id = id.clone();
10830                Box::pin(async move { id.into_id().await.unwrap().quote() })
10831            }),
10832        );
10833        Host {
10834            proc: self.proc.clone(),
10835            selection: query,
10836            graphql_client: self.graphql_client.clone(),
10837        }
10838    }
10839    /// Load a InputTypeDef from its ID.
10840    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
10841        let mut query = self.selection.select("loadInputTypeDefFromID");
10842        query = query.arg_lazy(
10843            "id",
10844            Box::new(move || {
10845                let id = id.clone();
10846                Box::pin(async move { id.into_id().await.unwrap().quote() })
10847            }),
10848        );
10849        InputTypeDef {
10850            proc: self.proc.clone(),
10851            selection: query,
10852            graphql_client: self.graphql_client.clone(),
10853        }
10854    }
10855    /// Load a InterfaceTypeDef from its ID.
10856    pub fn load_interface_type_def_from_id(
10857        &self,
10858        id: impl IntoID<InterfaceTypeDefId>,
10859    ) -> InterfaceTypeDef {
10860        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
10861        query = query.arg_lazy(
10862            "id",
10863            Box::new(move || {
10864                let id = id.clone();
10865                Box::pin(async move { id.into_id().await.unwrap().quote() })
10866            }),
10867        );
10868        InterfaceTypeDef {
10869            proc: self.proc.clone(),
10870            selection: query,
10871            graphql_client: self.graphql_client.clone(),
10872        }
10873    }
10874    /// Load a JSONValue from its ID.
10875    pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
10876        let mut query = self.selection.select("loadJSONValueFromID");
10877        query = query.arg_lazy(
10878            "id",
10879            Box::new(move || {
10880                let id = id.clone();
10881                Box::pin(async move { id.into_id().await.unwrap().quote() })
10882            }),
10883        );
10884        JsonValue {
10885            proc: self.proc.clone(),
10886            selection: query,
10887            graphql_client: self.graphql_client.clone(),
10888        }
10889    }
10890    /// Load a LLM from its ID.
10891    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
10892        let mut query = self.selection.select("loadLLMFromID");
10893        query = query.arg_lazy(
10894            "id",
10895            Box::new(move || {
10896                let id = id.clone();
10897                Box::pin(async move { id.into_id().await.unwrap().quote() })
10898            }),
10899        );
10900        Llm {
10901            proc: self.proc.clone(),
10902            selection: query,
10903            graphql_client: self.graphql_client.clone(),
10904        }
10905    }
10906    /// Load a LLMTokenUsage from its ID.
10907    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
10908        let mut query = self.selection.select("loadLLMTokenUsageFromID");
10909        query = query.arg_lazy(
10910            "id",
10911            Box::new(move || {
10912                let id = id.clone();
10913                Box::pin(async move { id.into_id().await.unwrap().quote() })
10914            }),
10915        );
10916        LlmTokenUsage {
10917            proc: self.proc.clone(),
10918            selection: query,
10919            graphql_client: self.graphql_client.clone(),
10920        }
10921    }
10922    /// Load a Label from its ID.
10923    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
10924        let mut query = self.selection.select("loadLabelFromID");
10925        query = query.arg_lazy(
10926            "id",
10927            Box::new(move || {
10928                let id = id.clone();
10929                Box::pin(async move { id.into_id().await.unwrap().quote() })
10930            }),
10931        );
10932        Label {
10933            proc: self.proc.clone(),
10934            selection: query,
10935            graphql_client: self.graphql_client.clone(),
10936        }
10937    }
10938    /// Load a ListTypeDef from its ID.
10939    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
10940        let mut query = self.selection.select("loadListTypeDefFromID");
10941        query = query.arg_lazy(
10942            "id",
10943            Box::new(move || {
10944                let id = id.clone();
10945                Box::pin(async move { id.into_id().await.unwrap().quote() })
10946            }),
10947        );
10948        ListTypeDef {
10949            proc: self.proc.clone(),
10950            selection: query,
10951            graphql_client: self.graphql_client.clone(),
10952        }
10953    }
10954    /// Load a ModuleConfigClient from its ID.
10955    pub fn load_module_config_client_from_id(
10956        &self,
10957        id: impl IntoID<ModuleConfigClientId>,
10958    ) -> ModuleConfigClient {
10959        let mut query = self.selection.select("loadModuleConfigClientFromID");
10960        query = query.arg_lazy(
10961            "id",
10962            Box::new(move || {
10963                let id = id.clone();
10964                Box::pin(async move { id.into_id().await.unwrap().quote() })
10965            }),
10966        );
10967        ModuleConfigClient {
10968            proc: self.proc.clone(),
10969            selection: query,
10970            graphql_client: self.graphql_client.clone(),
10971        }
10972    }
10973    /// Load a Module from its ID.
10974    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
10975        let mut query = self.selection.select("loadModuleFromID");
10976        query = query.arg_lazy(
10977            "id",
10978            Box::new(move || {
10979                let id = id.clone();
10980                Box::pin(async move { id.into_id().await.unwrap().quote() })
10981            }),
10982        );
10983        Module {
10984            proc: self.proc.clone(),
10985            selection: query,
10986            graphql_client: self.graphql_client.clone(),
10987        }
10988    }
10989    /// Load a ModuleSource from its ID.
10990    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
10991        let mut query = self.selection.select("loadModuleSourceFromID");
10992        query = query.arg_lazy(
10993            "id",
10994            Box::new(move || {
10995                let id = id.clone();
10996                Box::pin(async move { id.into_id().await.unwrap().quote() })
10997            }),
10998        );
10999        ModuleSource {
11000            proc: self.proc.clone(),
11001            selection: query,
11002            graphql_client: self.graphql_client.clone(),
11003        }
11004    }
11005    /// Load a ObjectTypeDef from its ID.
11006    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
11007        let mut query = self.selection.select("loadObjectTypeDefFromID");
11008        query = query.arg_lazy(
11009            "id",
11010            Box::new(move || {
11011                let id = id.clone();
11012                Box::pin(async move { id.into_id().await.unwrap().quote() })
11013            }),
11014        );
11015        ObjectTypeDef {
11016            proc: self.proc.clone(),
11017            selection: query,
11018            graphql_client: self.graphql_client.clone(),
11019        }
11020    }
11021    /// Load a Port from its ID.
11022    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
11023        let mut query = self.selection.select("loadPortFromID");
11024        query = query.arg_lazy(
11025            "id",
11026            Box::new(move || {
11027                let id = id.clone();
11028                Box::pin(async move { id.into_id().await.unwrap().quote() })
11029            }),
11030        );
11031        Port {
11032            proc: self.proc.clone(),
11033            selection: query,
11034            graphql_client: self.graphql_client.clone(),
11035        }
11036    }
11037    /// Load a SDKConfig from its ID.
11038    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
11039        let mut query = self.selection.select("loadSDKConfigFromID");
11040        query = query.arg_lazy(
11041            "id",
11042            Box::new(move || {
11043                let id = id.clone();
11044                Box::pin(async move { id.into_id().await.unwrap().quote() })
11045            }),
11046        );
11047        SdkConfig {
11048            proc: self.proc.clone(),
11049            selection: query,
11050            graphql_client: self.graphql_client.clone(),
11051        }
11052    }
11053    /// Load a ScalarTypeDef from its ID.
11054    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
11055        let mut query = self.selection.select("loadScalarTypeDefFromID");
11056        query = query.arg_lazy(
11057            "id",
11058            Box::new(move || {
11059                let id = id.clone();
11060                Box::pin(async move { id.into_id().await.unwrap().quote() })
11061            }),
11062        );
11063        ScalarTypeDef {
11064            proc: self.proc.clone(),
11065            selection: query,
11066            graphql_client: self.graphql_client.clone(),
11067        }
11068    }
11069    /// Load a SearchResult from its ID.
11070    pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
11071        let mut query = self.selection.select("loadSearchResultFromID");
11072        query = query.arg_lazy(
11073            "id",
11074            Box::new(move || {
11075                let id = id.clone();
11076                Box::pin(async move { id.into_id().await.unwrap().quote() })
11077            }),
11078        );
11079        SearchResult {
11080            proc: self.proc.clone(),
11081            selection: query,
11082            graphql_client: self.graphql_client.clone(),
11083        }
11084    }
11085    /// Load a SearchSubmatch from its ID.
11086    pub fn load_search_submatch_from_id(
11087        &self,
11088        id: impl IntoID<SearchSubmatchId>,
11089    ) -> SearchSubmatch {
11090        let mut query = self.selection.select("loadSearchSubmatchFromID");
11091        query = query.arg_lazy(
11092            "id",
11093            Box::new(move || {
11094                let id = id.clone();
11095                Box::pin(async move { id.into_id().await.unwrap().quote() })
11096            }),
11097        );
11098        SearchSubmatch {
11099            proc: self.proc.clone(),
11100            selection: query,
11101            graphql_client: self.graphql_client.clone(),
11102        }
11103    }
11104    /// Load a Secret from its ID.
11105    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
11106        let mut query = self.selection.select("loadSecretFromID");
11107        query = query.arg_lazy(
11108            "id",
11109            Box::new(move || {
11110                let id = id.clone();
11111                Box::pin(async move { id.into_id().await.unwrap().quote() })
11112            }),
11113        );
11114        Secret {
11115            proc: self.proc.clone(),
11116            selection: query,
11117            graphql_client: self.graphql_client.clone(),
11118        }
11119    }
11120    /// Load a Service from its ID.
11121    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
11122        let mut query = self.selection.select("loadServiceFromID");
11123        query = query.arg_lazy(
11124            "id",
11125            Box::new(move || {
11126                let id = id.clone();
11127                Box::pin(async move { id.into_id().await.unwrap().quote() })
11128            }),
11129        );
11130        Service {
11131            proc: self.proc.clone(),
11132            selection: query,
11133            graphql_client: self.graphql_client.clone(),
11134        }
11135    }
11136    /// Load a Socket from its ID.
11137    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
11138        let mut query = self.selection.select("loadSocketFromID");
11139        query = query.arg_lazy(
11140            "id",
11141            Box::new(move || {
11142                let id = id.clone();
11143                Box::pin(async move { id.into_id().await.unwrap().quote() })
11144            }),
11145        );
11146        Socket {
11147            proc: self.proc.clone(),
11148            selection: query,
11149            graphql_client: self.graphql_client.clone(),
11150        }
11151    }
11152    /// Load a SourceMap from its ID.
11153    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
11154        let mut query = self.selection.select("loadSourceMapFromID");
11155        query = query.arg_lazy(
11156            "id",
11157            Box::new(move || {
11158                let id = id.clone();
11159                Box::pin(async move { id.into_id().await.unwrap().quote() })
11160            }),
11161        );
11162        SourceMap {
11163            proc: self.proc.clone(),
11164            selection: query,
11165            graphql_client: self.graphql_client.clone(),
11166        }
11167    }
11168    /// Load a Terminal from its ID.
11169    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
11170        let mut query = self.selection.select("loadTerminalFromID");
11171        query = query.arg_lazy(
11172            "id",
11173            Box::new(move || {
11174                let id = id.clone();
11175                Box::pin(async move { id.into_id().await.unwrap().quote() })
11176            }),
11177        );
11178        Terminal {
11179            proc: self.proc.clone(),
11180            selection: query,
11181            graphql_client: self.graphql_client.clone(),
11182        }
11183    }
11184    /// Load a TypeDef from its ID.
11185    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
11186        let mut query = self.selection.select("loadTypeDefFromID");
11187        query = query.arg_lazy(
11188            "id",
11189            Box::new(move || {
11190                let id = id.clone();
11191                Box::pin(async move { id.into_id().await.unwrap().quote() })
11192            }),
11193        );
11194        TypeDef {
11195            proc: self.proc.clone(),
11196            selection: query,
11197            graphql_client: self.graphql_client.clone(),
11198        }
11199    }
11200    /// Create a new module.
11201    pub fn module(&self) -> Module {
11202        let query = self.selection.select("module");
11203        Module {
11204            proc: self.proc.clone(),
11205            selection: query,
11206            graphql_client: self.graphql_client.clone(),
11207        }
11208    }
11209    /// Create a new module source instance from a source ref string
11210    ///
11211    /// # Arguments
11212    ///
11213    /// * `ref_string` - The string ref representation of the module source
11214    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11215    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
11216        let mut query = self.selection.select("moduleSource");
11217        query = query.arg("refString", ref_string.into());
11218        ModuleSource {
11219            proc: self.proc.clone(),
11220            selection: query,
11221            graphql_client: self.graphql_client.clone(),
11222        }
11223    }
11224    /// Create a new module source instance from a source ref string
11225    ///
11226    /// # Arguments
11227    ///
11228    /// * `ref_string` - The string ref representation of the module source
11229    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11230    pub fn module_source_opts<'a>(
11231        &self,
11232        ref_string: impl Into<String>,
11233        opts: QueryModuleSourceOpts<'a>,
11234    ) -> ModuleSource {
11235        let mut query = self.selection.select("moduleSource");
11236        query = query.arg("refString", ref_string.into());
11237        if let Some(ref_pin) = opts.ref_pin {
11238            query = query.arg("refPin", ref_pin);
11239        }
11240        if let Some(disable_find_up) = opts.disable_find_up {
11241            query = query.arg("disableFindUp", disable_find_up);
11242        }
11243        if let Some(allow_not_exists) = opts.allow_not_exists {
11244            query = query.arg("allowNotExists", allow_not_exists);
11245        }
11246        if let Some(require_kind) = opts.require_kind {
11247            query = query.arg("requireKind", require_kind);
11248        }
11249        ModuleSource {
11250            proc: self.proc.clone(),
11251            selection: query,
11252            graphql_client: self.graphql_client.clone(),
11253        }
11254    }
11255    /// Creates a new secret.
11256    ///
11257    /// # Arguments
11258    ///
11259    /// * `uri` - The URI of the secret store
11260    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11261    pub fn secret(&self, uri: impl Into<String>) -> Secret {
11262        let mut query = self.selection.select("secret");
11263        query = query.arg("uri", uri.into());
11264        Secret {
11265            proc: self.proc.clone(),
11266            selection: query,
11267            graphql_client: self.graphql_client.clone(),
11268        }
11269    }
11270    /// Creates a new secret.
11271    ///
11272    /// # Arguments
11273    ///
11274    /// * `uri` - The URI of the secret store
11275    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11276    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
11277        let mut query = self.selection.select("secret");
11278        query = query.arg("uri", uri.into());
11279        if let Some(cache_key) = opts.cache_key {
11280            query = query.arg("cacheKey", cache_key);
11281        }
11282        Secret {
11283            proc: self.proc.clone(),
11284            selection: query,
11285            graphql_client: self.graphql_client.clone(),
11286        }
11287    }
11288    /// Sets a secret given a user defined name to its plaintext and returns the secret.
11289    /// The plaintext value is limited to a size of 128000 bytes.
11290    ///
11291    /// # Arguments
11292    ///
11293    /// * `name` - The user defined name for this secret
11294    /// * `plaintext` - The plaintext of the secret
11295    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
11296        let mut query = self.selection.select("setSecret");
11297        query = query.arg("name", name.into());
11298        query = query.arg("plaintext", plaintext.into());
11299        Secret {
11300            proc: self.proc.clone(),
11301            selection: query,
11302            graphql_client: self.graphql_client.clone(),
11303        }
11304    }
11305    /// Creates source map metadata.
11306    ///
11307    /// # Arguments
11308    ///
11309    /// * `filename` - The filename from the module source.
11310    /// * `line` - The line number within the filename.
11311    /// * `column` - The column number within the line.
11312    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
11313        let mut query = self.selection.select("sourceMap");
11314        query = query.arg("filename", filename.into());
11315        query = query.arg("line", line);
11316        query = query.arg("column", column);
11317        SourceMap {
11318            proc: self.proc.clone(),
11319            selection: query,
11320            graphql_client: self.graphql_client.clone(),
11321        }
11322    }
11323    /// Create a new TypeDef.
11324    pub fn type_def(&self) -> TypeDef {
11325        let query = self.selection.select("typeDef");
11326        TypeDef {
11327            proc: self.proc.clone(),
11328            selection: query,
11329            graphql_client: self.graphql_client.clone(),
11330        }
11331    }
11332    /// Get the current Dagger Engine version.
11333    pub async fn version(&self) -> Result<String, DaggerError> {
11334        let query = self.selection.select("version");
11335        query.execute(self.graphql_client.clone()).await
11336    }
11337}
11338#[derive(Clone)]
11339pub struct SdkConfig {
11340    pub proc: Option<Arc<DaggerSessionProc>>,
11341    pub selection: Selection,
11342    pub graphql_client: DynGraphQLClient,
11343}
11344impl SdkConfig {
11345    /// A unique identifier for this SDKConfig.
11346    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
11347        let query = self.selection.select("id");
11348        query.execute(self.graphql_client.clone()).await
11349    }
11350    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
11351    pub async fn source(&self) -> Result<String, DaggerError> {
11352        let query = self.selection.select("source");
11353        query.execute(self.graphql_client.clone()).await
11354    }
11355}
11356#[derive(Clone)]
11357pub struct ScalarTypeDef {
11358    pub proc: Option<Arc<DaggerSessionProc>>,
11359    pub selection: Selection,
11360    pub graphql_client: DynGraphQLClient,
11361}
11362impl ScalarTypeDef {
11363    /// A doc string for the scalar, if any.
11364    pub async fn description(&self) -> Result<String, DaggerError> {
11365        let query = self.selection.select("description");
11366        query.execute(self.graphql_client.clone()).await
11367    }
11368    /// A unique identifier for this ScalarTypeDef.
11369    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
11370        let query = self.selection.select("id");
11371        query.execute(self.graphql_client.clone()).await
11372    }
11373    /// The name of the scalar.
11374    pub async fn name(&self) -> Result<String, DaggerError> {
11375        let query = self.selection.select("name");
11376        query.execute(self.graphql_client.clone()).await
11377    }
11378    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
11379    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
11380        let query = self.selection.select("sourceModuleName");
11381        query.execute(self.graphql_client.clone()).await
11382    }
11383}
11384#[derive(Clone)]
11385pub struct SearchResult {
11386    pub proc: Option<Arc<DaggerSessionProc>>,
11387    pub selection: Selection,
11388    pub graphql_client: DynGraphQLClient,
11389}
11390impl SearchResult {
11391    /// The byte offset of this line within the file.
11392    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
11393        let query = self.selection.select("absoluteOffset");
11394        query.execute(self.graphql_client.clone()).await
11395    }
11396    /// The path to the file that matched.
11397    pub async fn file_path(&self) -> Result<String, DaggerError> {
11398        let query = self.selection.select("filePath");
11399        query.execute(self.graphql_client.clone()).await
11400    }
11401    /// A unique identifier for this SearchResult.
11402    pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
11403        let query = self.selection.select("id");
11404        query.execute(self.graphql_client.clone()).await
11405    }
11406    /// The first line that matched.
11407    pub async fn line_number(&self) -> Result<isize, DaggerError> {
11408        let query = self.selection.select("lineNumber");
11409        query.execute(self.graphql_client.clone()).await
11410    }
11411    /// The line content that matched.
11412    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
11413        let query = self.selection.select("matchedLines");
11414        query.execute(self.graphql_client.clone()).await
11415    }
11416    /// Sub-match positions and content within the matched lines.
11417    pub fn submatches(&self) -> Vec<SearchSubmatch> {
11418        let query = self.selection.select("submatches");
11419        vec![SearchSubmatch {
11420            proc: self.proc.clone(),
11421            selection: query,
11422            graphql_client: self.graphql_client.clone(),
11423        }]
11424    }
11425}
11426#[derive(Clone)]
11427pub struct SearchSubmatch {
11428    pub proc: Option<Arc<DaggerSessionProc>>,
11429    pub selection: Selection,
11430    pub graphql_client: DynGraphQLClient,
11431}
11432impl SearchSubmatch {
11433    /// The match's end offset within the matched lines.
11434    pub async fn end(&self) -> Result<isize, DaggerError> {
11435        let query = self.selection.select("end");
11436        query.execute(self.graphql_client.clone()).await
11437    }
11438    /// A unique identifier for this SearchSubmatch.
11439    pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
11440        let query = self.selection.select("id");
11441        query.execute(self.graphql_client.clone()).await
11442    }
11443    /// The match's start offset within the matched lines.
11444    pub async fn start(&self) -> Result<isize, DaggerError> {
11445        let query = self.selection.select("start");
11446        query.execute(self.graphql_client.clone()).await
11447    }
11448    /// The matched text.
11449    pub async fn text(&self) -> Result<String, DaggerError> {
11450        let query = self.selection.select("text");
11451        query.execute(self.graphql_client.clone()).await
11452    }
11453}
11454#[derive(Clone)]
11455pub struct Secret {
11456    pub proc: Option<Arc<DaggerSessionProc>>,
11457    pub selection: Selection,
11458    pub graphql_client: DynGraphQLClient,
11459}
11460impl Secret {
11461    /// A unique identifier for this Secret.
11462    pub async fn id(&self) -> Result<SecretId, DaggerError> {
11463        let query = self.selection.select("id");
11464        query.execute(self.graphql_client.clone()).await
11465    }
11466    /// The name of this secret.
11467    pub async fn name(&self) -> Result<String, DaggerError> {
11468        let query = self.selection.select("name");
11469        query.execute(self.graphql_client.clone()).await
11470    }
11471    /// The value of this secret.
11472    pub async fn plaintext(&self) -> Result<String, DaggerError> {
11473        let query = self.selection.select("plaintext");
11474        query.execute(self.graphql_client.clone()).await
11475    }
11476    /// The URI of this secret.
11477    pub async fn uri(&self) -> Result<String, DaggerError> {
11478        let query = self.selection.select("uri");
11479        query.execute(self.graphql_client.clone()).await
11480    }
11481}
11482#[derive(Clone)]
11483pub struct Service {
11484    pub proc: Option<Arc<DaggerSessionProc>>,
11485    pub selection: Selection,
11486    pub graphql_client: DynGraphQLClient,
11487}
11488#[derive(Builder, Debug, PartialEq)]
11489pub struct ServiceEndpointOpts<'a> {
11490    /// The exposed port number for the endpoint
11491    #[builder(setter(into, strip_option), default)]
11492    pub port: Option<isize>,
11493    /// Return a URL with the given scheme, eg. http for http://
11494    #[builder(setter(into, strip_option), default)]
11495    pub scheme: Option<&'a str>,
11496}
11497#[derive(Builder, Debug, PartialEq)]
11498pub struct ServiceStopOpts {
11499    /// Immediately kill the service without waiting for a graceful exit
11500    #[builder(setter(into, strip_option), default)]
11501    pub kill: Option<bool>,
11502}
11503#[derive(Builder, Debug, PartialEq)]
11504pub struct ServiceTerminalOpts<'a> {
11505    #[builder(setter(into, strip_option), default)]
11506    pub cmd: Option<Vec<&'a str>>,
11507}
11508#[derive(Builder, Debug, PartialEq)]
11509pub struct ServiceUpOpts {
11510    /// List of frontend/backend port mappings to forward.
11511    /// Frontend is the port accepting traffic on the host, backend is the service port.
11512    #[builder(setter(into, strip_option), default)]
11513    pub ports: Option<Vec<PortForward>>,
11514    /// Bind each tunnel port to a random port on the host.
11515    #[builder(setter(into, strip_option), default)]
11516    pub random: Option<bool>,
11517}
11518impl Service {
11519    /// Retrieves an endpoint that clients can use to reach this container.
11520    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
11521    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
11522    ///
11523    /// # Arguments
11524    ///
11525    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11526    pub async fn endpoint(&self) -> Result<String, DaggerError> {
11527        let query = self.selection.select("endpoint");
11528        query.execute(self.graphql_client.clone()).await
11529    }
11530    /// Retrieves an endpoint that clients can use to reach this container.
11531    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
11532    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
11533    ///
11534    /// # Arguments
11535    ///
11536    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11537    pub async fn endpoint_opts<'a>(
11538        &self,
11539        opts: ServiceEndpointOpts<'a>,
11540    ) -> Result<String, DaggerError> {
11541        let mut query = self.selection.select("endpoint");
11542        if let Some(port) = opts.port {
11543            query = query.arg("port", port);
11544        }
11545        if let Some(scheme) = opts.scheme {
11546            query = query.arg("scheme", scheme);
11547        }
11548        query.execute(self.graphql_client.clone()).await
11549    }
11550    /// Retrieves a hostname which can be used by clients to reach this container.
11551    pub async fn hostname(&self) -> Result<String, DaggerError> {
11552        let query = self.selection.select("hostname");
11553        query.execute(self.graphql_client.clone()).await
11554    }
11555    /// A unique identifier for this Service.
11556    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
11557        let query = self.selection.select("id");
11558        query.execute(self.graphql_client.clone()).await
11559    }
11560    /// Retrieves the list of ports provided by the service.
11561    pub fn ports(&self) -> Vec<Port> {
11562        let query = self.selection.select("ports");
11563        vec![Port {
11564            proc: self.proc.clone(),
11565            selection: query,
11566            graphql_client: self.graphql_client.clone(),
11567        }]
11568    }
11569    /// Start the service and wait for its health checks to succeed.
11570    /// Services bound to a Container do not need to be manually started.
11571    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
11572        let query = self.selection.select("start");
11573        query.execute(self.graphql_client.clone()).await
11574    }
11575    /// Stop the service.
11576    ///
11577    /// # Arguments
11578    ///
11579    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11580    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
11581        let query = self.selection.select("stop");
11582        query.execute(self.graphql_client.clone()).await
11583    }
11584    /// Stop the service.
11585    ///
11586    /// # Arguments
11587    ///
11588    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11589    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
11590        let mut query = self.selection.select("stop");
11591        if let Some(kill) = opts.kill {
11592            query = query.arg("kill", kill);
11593        }
11594        query.execute(self.graphql_client.clone()).await
11595    }
11596    /// Forces evaluation of the pipeline in the engine.
11597    pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
11598        let query = self.selection.select("sync");
11599        query.execute(self.graphql_client.clone()).await
11600    }
11601    ///
11602    /// # Arguments
11603    ///
11604    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11605    pub fn terminal(&self) -> Service {
11606        let query = self.selection.select("terminal");
11607        Service {
11608            proc: self.proc.clone(),
11609            selection: query,
11610            graphql_client: self.graphql_client.clone(),
11611        }
11612    }
11613    ///
11614    /// # Arguments
11615    ///
11616    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11617    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
11618        let mut query = self.selection.select("terminal");
11619        if let Some(cmd) = opts.cmd {
11620            query = query.arg("cmd", cmd);
11621        }
11622        Service {
11623            proc: self.proc.clone(),
11624            selection: query,
11625            graphql_client: self.graphql_client.clone(),
11626        }
11627    }
11628    /// Creates a tunnel that forwards traffic from the caller's network to this service.
11629    ///
11630    /// # Arguments
11631    ///
11632    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11633    pub async fn up(&self) -> Result<Void, DaggerError> {
11634        let query = self.selection.select("up");
11635        query.execute(self.graphql_client.clone()).await
11636    }
11637    /// Creates a tunnel that forwards traffic from the caller's network to this service.
11638    ///
11639    /// # Arguments
11640    ///
11641    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11642    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
11643        let mut query = self.selection.select("up");
11644        if let Some(ports) = opts.ports {
11645            query = query.arg("ports", ports);
11646        }
11647        if let Some(random) = opts.random {
11648            query = query.arg("random", random);
11649        }
11650        query.execute(self.graphql_client.clone()).await
11651    }
11652    /// Configures a hostname which can be used by clients within the session to reach this container.
11653    ///
11654    /// # Arguments
11655    ///
11656    /// * `hostname` - The hostname to use.
11657    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
11658        let mut query = self.selection.select("withHostname");
11659        query = query.arg("hostname", hostname.into());
11660        Service {
11661            proc: self.proc.clone(),
11662            selection: query,
11663            graphql_client: self.graphql_client.clone(),
11664        }
11665    }
11666}
11667#[derive(Clone)]
11668pub struct Socket {
11669    pub proc: Option<Arc<DaggerSessionProc>>,
11670    pub selection: Selection,
11671    pub graphql_client: DynGraphQLClient,
11672}
11673impl Socket {
11674    /// A unique identifier for this Socket.
11675    pub async fn id(&self) -> Result<SocketId, DaggerError> {
11676        let query = self.selection.select("id");
11677        query.execute(self.graphql_client.clone()).await
11678    }
11679}
11680#[derive(Clone)]
11681pub struct SourceMap {
11682    pub proc: Option<Arc<DaggerSessionProc>>,
11683    pub selection: Selection,
11684    pub graphql_client: DynGraphQLClient,
11685}
11686impl SourceMap {
11687    /// The column number within the line.
11688    pub async fn column(&self) -> Result<isize, DaggerError> {
11689        let query = self.selection.select("column");
11690        query.execute(self.graphql_client.clone()).await
11691    }
11692    /// The filename from the module source.
11693    pub async fn filename(&self) -> Result<String, DaggerError> {
11694        let query = self.selection.select("filename");
11695        query.execute(self.graphql_client.clone()).await
11696    }
11697    /// A unique identifier for this SourceMap.
11698    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
11699        let query = self.selection.select("id");
11700        query.execute(self.graphql_client.clone()).await
11701    }
11702    /// The line number within the filename.
11703    pub async fn line(&self) -> Result<isize, DaggerError> {
11704        let query = self.selection.select("line");
11705        query.execute(self.graphql_client.clone()).await
11706    }
11707    /// The module dependency this was declared in.
11708    pub async fn module(&self) -> Result<String, DaggerError> {
11709        let query = self.selection.select("module");
11710        query.execute(self.graphql_client.clone()).await
11711    }
11712    /// The URL to the file, if any. This can be used to link to the source map in the browser.
11713    pub async fn url(&self) -> Result<String, DaggerError> {
11714        let query = self.selection.select("url");
11715        query.execute(self.graphql_client.clone()).await
11716    }
11717}
11718#[derive(Clone)]
11719pub struct Terminal {
11720    pub proc: Option<Arc<DaggerSessionProc>>,
11721    pub selection: Selection,
11722    pub graphql_client: DynGraphQLClient,
11723}
11724impl Terminal {
11725    /// A unique identifier for this Terminal.
11726    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
11727        let query = self.selection.select("id");
11728        query.execute(self.graphql_client.clone()).await
11729    }
11730    /// Forces evaluation of the pipeline in the engine.
11731    /// It doesn't run the default command if no exec has been set.
11732    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
11733        let query = self.selection.select("sync");
11734        query.execute(self.graphql_client.clone()).await
11735    }
11736}
11737#[derive(Clone)]
11738pub struct TypeDef {
11739    pub proc: Option<Arc<DaggerSessionProc>>,
11740    pub selection: Selection,
11741    pub graphql_client: DynGraphQLClient,
11742}
11743#[derive(Builder, Debug, PartialEq)]
11744pub struct TypeDefWithEnumOpts<'a> {
11745    /// A doc string for the enum, if any
11746    #[builder(setter(into, strip_option), default)]
11747    pub description: Option<&'a str>,
11748    /// The source map for the enum definition.
11749    #[builder(setter(into, strip_option), default)]
11750    pub source_map: Option<SourceMapId>,
11751}
11752#[derive(Builder, Debug, PartialEq)]
11753pub struct TypeDefWithEnumMemberOpts<'a> {
11754    /// A doc string for the member, if any
11755    #[builder(setter(into, strip_option), default)]
11756    pub description: Option<&'a str>,
11757    /// The source map for the enum member definition.
11758    #[builder(setter(into, strip_option), default)]
11759    pub source_map: Option<SourceMapId>,
11760    /// The value of the member in the enum
11761    #[builder(setter(into, strip_option), default)]
11762    pub value: Option<&'a str>,
11763}
11764#[derive(Builder, Debug, PartialEq)]
11765pub struct TypeDefWithEnumValueOpts<'a> {
11766    /// A doc string for the value, if any
11767    #[builder(setter(into, strip_option), default)]
11768    pub description: Option<&'a str>,
11769    /// The source map for the enum value definition.
11770    #[builder(setter(into, strip_option), default)]
11771    pub source_map: Option<SourceMapId>,
11772}
11773#[derive(Builder, Debug, PartialEq)]
11774pub struct TypeDefWithFieldOpts<'a> {
11775    /// A doc string for the field, if any
11776    #[builder(setter(into, strip_option), default)]
11777    pub description: Option<&'a str>,
11778    /// The source map for the field definition.
11779    #[builder(setter(into, strip_option), default)]
11780    pub source_map: Option<SourceMapId>,
11781}
11782#[derive(Builder, Debug, PartialEq)]
11783pub struct TypeDefWithInterfaceOpts<'a> {
11784    #[builder(setter(into, strip_option), default)]
11785    pub description: Option<&'a str>,
11786    #[builder(setter(into, strip_option), default)]
11787    pub source_map: Option<SourceMapId>,
11788}
11789#[derive(Builder, Debug, PartialEq)]
11790pub struct TypeDefWithObjectOpts<'a> {
11791    #[builder(setter(into, strip_option), default)]
11792    pub description: Option<&'a str>,
11793    #[builder(setter(into, strip_option), default)]
11794    pub source_map: Option<SourceMapId>,
11795}
11796#[derive(Builder, Debug, PartialEq)]
11797pub struct TypeDefWithScalarOpts<'a> {
11798    #[builder(setter(into, strip_option), default)]
11799    pub description: Option<&'a str>,
11800}
11801impl TypeDef {
11802    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
11803    pub fn as_enum(&self) -> EnumTypeDef {
11804        let query = self.selection.select("asEnum");
11805        EnumTypeDef {
11806            proc: self.proc.clone(),
11807            selection: query,
11808            graphql_client: self.graphql_client.clone(),
11809        }
11810    }
11811    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
11812    pub fn as_input(&self) -> InputTypeDef {
11813        let query = self.selection.select("asInput");
11814        InputTypeDef {
11815            proc: self.proc.clone(),
11816            selection: query,
11817            graphql_client: self.graphql_client.clone(),
11818        }
11819    }
11820    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
11821    pub fn as_interface(&self) -> InterfaceTypeDef {
11822        let query = self.selection.select("asInterface");
11823        InterfaceTypeDef {
11824            proc: self.proc.clone(),
11825            selection: query,
11826            graphql_client: self.graphql_client.clone(),
11827        }
11828    }
11829    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
11830    pub fn as_list(&self) -> ListTypeDef {
11831        let query = self.selection.select("asList");
11832        ListTypeDef {
11833            proc: self.proc.clone(),
11834            selection: query,
11835            graphql_client: self.graphql_client.clone(),
11836        }
11837    }
11838    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
11839    pub fn as_object(&self) -> ObjectTypeDef {
11840        let query = self.selection.select("asObject");
11841        ObjectTypeDef {
11842            proc: self.proc.clone(),
11843            selection: query,
11844            graphql_client: self.graphql_client.clone(),
11845        }
11846    }
11847    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
11848    pub fn as_scalar(&self) -> ScalarTypeDef {
11849        let query = self.selection.select("asScalar");
11850        ScalarTypeDef {
11851            proc: self.proc.clone(),
11852            selection: query,
11853            graphql_client: self.graphql_client.clone(),
11854        }
11855    }
11856    /// A unique identifier for this TypeDef.
11857    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
11858        let query = self.selection.select("id");
11859        query.execute(self.graphql_client.clone()).await
11860    }
11861    /// The kind of type this is (e.g. primitive, list, object).
11862    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
11863        let query = self.selection.select("kind");
11864        query.execute(self.graphql_client.clone()).await
11865    }
11866    /// Whether this type can be set to null. Defaults to false.
11867    pub async fn optional(&self) -> Result<bool, DaggerError> {
11868        let query = self.selection.select("optional");
11869        query.execute(self.graphql_client.clone()).await
11870    }
11871    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
11872    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
11873        let mut query = self.selection.select("withConstructor");
11874        query = query.arg_lazy(
11875            "function",
11876            Box::new(move || {
11877                let function = function.clone();
11878                Box::pin(async move { function.into_id().await.unwrap().quote() })
11879            }),
11880        );
11881        TypeDef {
11882            proc: self.proc.clone(),
11883            selection: query,
11884            graphql_client: self.graphql_client.clone(),
11885        }
11886    }
11887    /// Returns a TypeDef of kind Enum with the provided name.
11888    /// 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.
11889    ///
11890    /// # Arguments
11891    ///
11892    /// * `name` - The name of the enum
11893    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11894    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
11895        let mut query = self.selection.select("withEnum");
11896        query = query.arg("name", name.into());
11897        TypeDef {
11898            proc: self.proc.clone(),
11899            selection: query,
11900            graphql_client: self.graphql_client.clone(),
11901        }
11902    }
11903    /// Returns a TypeDef of kind Enum with the provided name.
11904    /// 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.
11905    ///
11906    /// # Arguments
11907    ///
11908    /// * `name` - The name of the enum
11909    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11910    pub fn with_enum_opts<'a>(
11911        &self,
11912        name: impl Into<String>,
11913        opts: TypeDefWithEnumOpts<'a>,
11914    ) -> TypeDef {
11915        let mut query = self.selection.select("withEnum");
11916        query = query.arg("name", name.into());
11917        if let Some(description) = opts.description {
11918            query = query.arg("description", description);
11919        }
11920        if let Some(source_map) = opts.source_map {
11921            query = query.arg("sourceMap", source_map);
11922        }
11923        TypeDef {
11924            proc: self.proc.clone(),
11925            selection: query,
11926            graphql_client: self.graphql_client.clone(),
11927        }
11928    }
11929    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
11930    ///
11931    /// # Arguments
11932    ///
11933    /// * `name` - The name of the member in the enum
11934    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11935    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
11936        let mut query = self.selection.select("withEnumMember");
11937        query = query.arg("name", name.into());
11938        TypeDef {
11939            proc: self.proc.clone(),
11940            selection: query,
11941            graphql_client: self.graphql_client.clone(),
11942        }
11943    }
11944    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
11945    ///
11946    /// # Arguments
11947    ///
11948    /// * `name` - The name of the member in the enum
11949    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11950    pub fn with_enum_member_opts<'a>(
11951        &self,
11952        name: impl Into<String>,
11953        opts: TypeDefWithEnumMemberOpts<'a>,
11954    ) -> TypeDef {
11955        let mut query = self.selection.select("withEnumMember");
11956        query = query.arg("name", name.into());
11957        if let Some(value) = opts.value {
11958            query = query.arg("value", value);
11959        }
11960        if let Some(description) = opts.description {
11961            query = query.arg("description", description);
11962        }
11963        if let Some(source_map) = opts.source_map {
11964            query = query.arg("sourceMap", source_map);
11965        }
11966        TypeDef {
11967            proc: self.proc.clone(),
11968            selection: query,
11969            graphql_client: self.graphql_client.clone(),
11970        }
11971    }
11972    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
11973    ///
11974    /// # Arguments
11975    ///
11976    /// * `value` - The name of the value in the enum
11977    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11978    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
11979        let mut query = self.selection.select("withEnumValue");
11980        query = query.arg("value", value.into());
11981        TypeDef {
11982            proc: self.proc.clone(),
11983            selection: query,
11984            graphql_client: self.graphql_client.clone(),
11985        }
11986    }
11987    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
11988    ///
11989    /// # Arguments
11990    ///
11991    /// * `value` - The name of the value in the enum
11992    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11993    pub fn with_enum_value_opts<'a>(
11994        &self,
11995        value: impl Into<String>,
11996        opts: TypeDefWithEnumValueOpts<'a>,
11997    ) -> TypeDef {
11998        let mut query = self.selection.select("withEnumValue");
11999        query = query.arg("value", value.into());
12000        if let Some(description) = opts.description {
12001            query = query.arg("description", description);
12002        }
12003        if let Some(source_map) = opts.source_map {
12004            query = query.arg("sourceMap", source_map);
12005        }
12006        TypeDef {
12007            proc: self.proc.clone(),
12008            selection: query,
12009            graphql_client: self.graphql_client.clone(),
12010        }
12011    }
12012    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
12013    ///
12014    /// # Arguments
12015    ///
12016    /// * `name` - The name of the field in the object
12017    /// * `type_def` - The type of the field
12018    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12019    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
12020        let mut query = self.selection.select("withField");
12021        query = query.arg("name", name.into());
12022        query = query.arg_lazy(
12023            "typeDef",
12024            Box::new(move || {
12025                let type_def = type_def.clone();
12026                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
12027            }),
12028        );
12029        TypeDef {
12030            proc: self.proc.clone(),
12031            selection: query,
12032            graphql_client: self.graphql_client.clone(),
12033        }
12034    }
12035    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
12036    ///
12037    /// # Arguments
12038    ///
12039    /// * `name` - The name of the field in the object
12040    /// * `type_def` - The type of the field
12041    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12042    pub fn with_field_opts<'a>(
12043        &self,
12044        name: impl Into<String>,
12045        type_def: impl IntoID<TypeDefId>,
12046        opts: TypeDefWithFieldOpts<'a>,
12047    ) -> TypeDef {
12048        let mut query = self.selection.select("withField");
12049        query = query.arg("name", name.into());
12050        query = query.arg_lazy(
12051            "typeDef",
12052            Box::new(move || {
12053                let type_def = type_def.clone();
12054                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
12055            }),
12056        );
12057        if let Some(description) = opts.description {
12058            query = query.arg("description", description);
12059        }
12060        if let Some(source_map) = opts.source_map {
12061            query = query.arg("sourceMap", source_map);
12062        }
12063        TypeDef {
12064            proc: self.proc.clone(),
12065            selection: query,
12066            graphql_client: self.graphql_client.clone(),
12067        }
12068    }
12069    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
12070    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
12071        let mut query = self.selection.select("withFunction");
12072        query = query.arg_lazy(
12073            "function",
12074            Box::new(move || {
12075                let function = function.clone();
12076                Box::pin(async move { function.into_id().await.unwrap().quote() })
12077            }),
12078        );
12079        TypeDef {
12080            proc: self.proc.clone(),
12081            selection: query,
12082            graphql_client: self.graphql_client.clone(),
12083        }
12084    }
12085    /// Returns a TypeDef of kind Interface with the provided name.
12086    ///
12087    /// # Arguments
12088    ///
12089    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12090    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
12091        let mut query = self.selection.select("withInterface");
12092        query = query.arg("name", name.into());
12093        TypeDef {
12094            proc: self.proc.clone(),
12095            selection: query,
12096            graphql_client: self.graphql_client.clone(),
12097        }
12098    }
12099    /// Returns a TypeDef of kind Interface with the provided name.
12100    ///
12101    /// # Arguments
12102    ///
12103    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12104    pub fn with_interface_opts<'a>(
12105        &self,
12106        name: impl Into<String>,
12107        opts: TypeDefWithInterfaceOpts<'a>,
12108    ) -> TypeDef {
12109        let mut query = self.selection.select("withInterface");
12110        query = query.arg("name", name.into());
12111        if let Some(description) = opts.description {
12112            query = query.arg("description", description);
12113        }
12114        if let Some(source_map) = opts.source_map {
12115            query = query.arg("sourceMap", source_map);
12116        }
12117        TypeDef {
12118            proc: self.proc.clone(),
12119            selection: query,
12120            graphql_client: self.graphql_client.clone(),
12121        }
12122    }
12123    /// Sets the kind of the type.
12124    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
12125        let mut query = self.selection.select("withKind");
12126        query = query.arg("kind", kind);
12127        TypeDef {
12128            proc: self.proc.clone(),
12129            selection: query,
12130            graphql_client: self.graphql_client.clone(),
12131        }
12132    }
12133    /// Returns a TypeDef of kind List with the provided type for its elements.
12134    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
12135        let mut query = self.selection.select("withListOf");
12136        query = query.arg_lazy(
12137            "elementType",
12138            Box::new(move || {
12139                let element_type = element_type.clone();
12140                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
12141            }),
12142        );
12143        TypeDef {
12144            proc: self.proc.clone(),
12145            selection: query,
12146            graphql_client: self.graphql_client.clone(),
12147        }
12148    }
12149    /// Returns a TypeDef of kind Object with the provided name.
12150    /// 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.
12151    ///
12152    /// # Arguments
12153    ///
12154    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12155    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
12156        let mut query = self.selection.select("withObject");
12157        query = query.arg("name", name.into());
12158        TypeDef {
12159            proc: self.proc.clone(),
12160            selection: query,
12161            graphql_client: self.graphql_client.clone(),
12162        }
12163    }
12164    /// Returns a TypeDef of kind Object with the provided name.
12165    /// 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.
12166    ///
12167    /// # Arguments
12168    ///
12169    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12170    pub fn with_object_opts<'a>(
12171        &self,
12172        name: impl Into<String>,
12173        opts: TypeDefWithObjectOpts<'a>,
12174    ) -> TypeDef {
12175        let mut query = self.selection.select("withObject");
12176        query = query.arg("name", name.into());
12177        if let Some(description) = opts.description {
12178            query = query.arg("description", description);
12179        }
12180        if let Some(source_map) = opts.source_map {
12181            query = query.arg("sourceMap", source_map);
12182        }
12183        TypeDef {
12184            proc: self.proc.clone(),
12185            selection: query,
12186            graphql_client: self.graphql_client.clone(),
12187        }
12188    }
12189    /// Sets whether this type can be set to null.
12190    pub fn with_optional(&self, optional: bool) -> TypeDef {
12191        let mut query = self.selection.select("withOptional");
12192        query = query.arg("optional", optional);
12193        TypeDef {
12194            proc: self.proc.clone(),
12195            selection: query,
12196            graphql_client: self.graphql_client.clone(),
12197        }
12198    }
12199    /// Returns a TypeDef of kind Scalar with the provided name.
12200    ///
12201    /// # Arguments
12202    ///
12203    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12204    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
12205        let mut query = self.selection.select("withScalar");
12206        query = query.arg("name", name.into());
12207        TypeDef {
12208            proc: self.proc.clone(),
12209            selection: query,
12210            graphql_client: self.graphql_client.clone(),
12211        }
12212    }
12213    /// Returns a TypeDef of kind Scalar with the provided name.
12214    ///
12215    /// # Arguments
12216    ///
12217    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12218    pub fn with_scalar_opts<'a>(
12219        &self,
12220        name: impl Into<String>,
12221        opts: TypeDefWithScalarOpts<'a>,
12222    ) -> TypeDef {
12223        let mut query = self.selection.select("withScalar");
12224        query = query.arg("name", name.into());
12225        if let Some(description) = opts.description {
12226            query = query.arg("description", description);
12227        }
12228        TypeDef {
12229            proc: self.proc.clone(),
12230            selection: query,
12231            graphql_client: self.graphql_client.clone(),
12232        }
12233    }
12234}
12235#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12236pub enum CacheSharingMode {
12237    #[serde(rename = "LOCKED")]
12238    Locked,
12239    #[serde(rename = "PRIVATE")]
12240    Private,
12241    #[serde(rename = "SHARED")]
12242    Shared,
12243}
12244#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12245pub enum ExistsType {
12246    #[serde(rename = "DIRECTORY_TYPE")]
12247    DirectoryType,
12248    #[serde(rename = "REGULAR_TYPE")]
12249    RegularType,
12250    #[serde(rename = "SYMLINK_TYPE")]
12251    SymlinkType,
12252}
12253#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12254pub enum ImageLayerCompression {
12255    #[serde(rename = "EStarGZ")]
12256    EStarGz,
12257    #[serde(rename = "ESTARGZ")]
12258    Estargz,
12259    #[serde(rename = "Gzip")]
12260    Gzip,
12261    #[serde(rename = "Uncompressed")]
12262    Uncompressed,
12263    #[serde(rename = "Zstd")]
12264    Zstd,
12265}
12266#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12267pub enum ImageMediaTypes {
12268    #[serde(rename = "DOCKER")]
12269    Docker,
12270    #[serde(rename = "DockerMediaTypes")]
12271    DockerMediaTypes,
12272    #[serde(rename = "OCI")]
12273    Oci,
12274    #[serde(rename = "OCIMediaTypes")]
12275    OciMediaTypes,
12276}
12277#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12278pub enum ModuleSourceKind {
12279    #[serde(rename = "DIR")]
12280    Dir,
12281    #[serde(rename = "DIR_SOURCE")]
12282    DirSource,
12283    #[serde(rename = "GIT")]
12284    Git,
12285    #[serde(rename = "GIT_SOURCE")]
12286    GitSource,
12287    #[serde(rename = "LOCAL")]
12288    Local,
12289    #[serde(rename = "LOCAL_SOURCE")]
12290    LocalSource,
12291}
12292#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12293pub enum NetworkProtocol {
12294    #[serde(rename = "TCP")]
12295    Tcp,
12296    #[serde(rename = "UDP")]
12297    Udp,
12298}
12299#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12300pub enum ReturnType {
12301    #[serde(rename = "ANY")]
12302    Any,
12303    #[serde(rename = "FAILURE")]
12304    Failure,
12305    #[serde(rename = "SUCCESS")]
12306    Success,
12307}
12308#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12309pub enum TypeDefKind {
12310    #[serde(rename = "BOOLEAN")]
12311    Boolean,
12312    #[serde(rename = "BOOLEAN_KIND")]
12313    BooleanKind,
12314    #[serde(rename = "ENUM")]
12315    Enum,
12316    #[serde(rename = "ENUM_KIND")]
12317    EnumKind,
12318    #[serde(rename = "FLOAT")]
12319    Float,
12320    #[serde(rename = "FLOAT_KIND")]
12321    FloatKind,
12322    #[serde(rename = "INPUT")]
12323    Input,
12324    #[serde(rename = "INPUT_KIND")]
12325    InputKind,
12326    #[serde(rename = "INTEGER")]
12327    Integer,
12328    #[serde(rename = "INTEGER_KIND")]
12329    IntegerKind,
12330    #[serde(rename = "INTERFACE")]
12331    Interface,
12332    #[serde(rename = "INTERFACE_KIND")]
12333    InterfaceKind,
12334    #[serde(rename = "LIST")]
12335    List,
12336    #[serde(rename = "LIST_KIND")]
12337    ListKind,
12338    #[serde(rename = "OBJECT")]
12339    Object,
12340    #[serde(rename = "OBJECT_KIND")]
12341    ObjectKind,
12342    #[serde(rename = "SCALAR")]
12343    Scalar,
12344    #[serde(rename = "SCALAR_KIND")]
12345    ScalarKind,
12346    #[serde(rename = "STRING")]
12347    String,
12348    #[serde(rename = "STRING_KIND")]
12349    StringKind,
12350    #[serde(rename = "VOID")]
12351    Void,
12352    #[serde(rename = "VOID_KIND")]
12353    VoidKind,
12354}