dagger_sdk/
gen.rs

1#![allow(clippy::needless_lifetimes)]
2
3use crate::core::cli_session::DaggerSessionProc;
4use crate::core::graphql_client::DynGraphQLClient;
5use crate::errors::DaggerError;
6use crate::id::IntoID;
7use crate::querybuilder::Selection;
8use derive_builder::Builder;
9use serde::{Deserialize, Serialize};
10use std::sync::Arc;
11
12#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
13pub struct BindingId(pub String);
14impl From<&str> for BindingId {
15    fn from(value: &str) -> Self {
16        Self(value.to_string())
17    }
18}
19impl From<String> for BindingId {
20    fn from(value: String) -> Self {
21        Self(value)
22    }
23}
24impl IntoID<BindingId> for Binding {
25    fn into_id(
26        self,
27    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
28    {
29        Box::pin(async move { self.id().await })
30    }
31}
32impl IntoID<BindingId> for BindingId {
33    fn into_id(
34        self,
35    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
36    {
37        Box::pin(async move { Ok::<BindingId, DaggerError>(self) })
38    }
39}
40impl BindingId {
41    fn quote(&self) -> String {
42        format!("\"{}\"", self.0.clone())
43    }
44}
45#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
46pub struct CacheVolumeId(pub String);
47impl From<&str> for CacheVolumeId {
48    fn from(value: &str) -> Self {
49        Self(value.to_string())
50    }
51}
52impl From<String> for CacheVolumeId {
53    fn from(value: String) -> Self {
54        Self(value)
55    }
56}
57impl IntoID<CacheVolumeId> for CacheVolume {
58    fn into_id(
59        self,
60    ) -> std::pin::Pin<
61        Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
62    > {
63        Box::pin(async move { self.id().await })
64    }
65}
66impl IntoID<CacheVolumeId> for CacheVolumeId {
67    fn into_id(
68        self,
69    ) -> std::pin::Pin<
70        Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
71    > {
72        Box::pin(async move { Ok::<CacheVolumeId, DaggerError>(self) })
73    }
74}
75impl CacheVolumeId {
76    fn quote(&self) -> String {
77        format!("\"{}\"", self.0.clone())
78    }
79}
80#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
81pub struct CloudId(pub String);
82impl From<&str> for CloudId {
83    fn from(value: &str) -> Self {
84        Self(value.to_string())
85    }
86}
87impl From<String> for CloudId {
88    fn from(value: String) -> Self {
89        Self(value)
90    }
91}
92impl IntoID<CloudId> for Cloud {
93    fn into_id(
94        self,
95    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
96    {
97        Box::pin(async move { self.id().await })
98    }
99}
100impl IntoID<CloudId> for CloudId {
101    fn into_id(
102        self,
103    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
104    {
105        Box::pin(async move { Ok::<CloudId, DaggerError>(self) })
106    }
107}
108impl CloudId {
109    fn quote(&self) -> String {
110        format!("\"{}\"", self.0.clone())
111    }
112}
113#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
114pub struct ContainerId(pub String);
115impl From<&str> for ContainerId {
116    fn from(value: &str) -> Self {
117        Self(value.to_string())
118    }
119}
120impl From<String> for ContainerId {
121    fn from(value: String) -> Self {
122        Self(value)
123    }
124}
125impl IntoID<ContainerId> for Container {
126    fn into_id(
127        self,
128    ) -> std::pin::Pin<
129        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
130    > {
131        Box::pin(async move { self.id().await })
132    }
133}
134impl IntoID<ContainerId> for ContainerId {
135    fn into_id(
136        self,
137    ) -> std::pin::Pin<
138        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
139    > {
140        Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
141    }
142}
143impl ContainerId {
144    fn quote(&self) -> String {
145        format!("\"{}\"", self.0.clone())
146    }
147}
148#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
149pub struct CurrentModuleId(pub String);
150impl From<&str> for CurrentModuleId {
151    fn from(value: &str) -> Self {
152        Self(value.to_string())
153    }
154}
155impl From<String> for CurrentModuleId {
156    fn from(value: String) -> Self {
157        Self(value)
158    }
159}
160impl IntoID<CurrentModuleId> for CurrentModule {
161    fn into_id(
162        self,
163    ) -> std::pin::Pin<
164        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
165    > {
166        Box::pin(async move { self.id().await })
167    }
168}
169impl IntoID<CurrentModuleId> for CurrentModuleId {
170    fn into_id(
171        self,
172    ) -> std::pin::Pin<
173        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
174    > {
175        Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
176    }
177}
178impl CurrentModuleId {
179    fn quote(&self) -> String {
180        format!("\"{}\"", self.0.clone())
181    }
182}
183#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
184pub struct DirectoryId(pub String);
185impl From<&str> for DirectoryId {
186    fn from(value: &str) -> Self {
187        Self(value.to_string())
188    }
189}
190impl From<String> for DirectoryId {
191    fn from(value: String) -> Self {
192        Self(value)
193    }
194}
195impl IntoID<DirectoryId> for Directory {
196    fn into_id(
197        self,
198    ) -> std::pin::Pin<
199        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
200    > {
201        Box::pin(async move { self.id().await })
202    }
203}
204impl IntoID<DirectoryId> for DirectoryId {
205    fn into_id(
206        self,
207    ) -> std::pin::Pin<
208        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
209    > {
210        Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
211    }
212}
213impl DirectoryId {
214    fn quote(&self) -> String {
215        format!("\"{}\"", self.0.clone())
216    }
217}
218#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
219pub struct EngineCacheEntryId(pub String);
220impl From<&str> for EngineCacheEntryId {
221    fn from(value: &str) -> Self {
222        Self(value.to_string())
223    }
224}
225impl From<String> for EngineCacheEntryId {
226    fn from(value: String) -> Self {
227        Self(value)
228    }
229}
230impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
231    fn into_id(
232        self,
233    ) -> std::pin::Pin<
234        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
235    > {
236        Box::pin(async move { self.id().await })
237    }
238}
239impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
240    fn into_id(
241        self,
242    ) -> std::pin::Pin<
243        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
244    > {
245        Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
246    }
247}
248impl EngineCacheEntryId {
249    fn quote(&self) -> String {
250        format!("\"{}\"", self.0.clone())
251    }
252}
253#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
254pub struct EngineCacheEntrySetId(pub String);
255impl From<&str> for EngineCacheEntrySetId {
256    fn from(value: &str) -> Self {
257        Self(value.to_string())
258    }
259}
260impl From<String> for EngineCacheEntrySetId {
261    fn from(value: String) -> Self {
262        Self(value)
263    }
264}
265impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
266    fn into_id(
267        self,
268    ) -> std::pin::Pin<
269        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
270    > {
271        Box::pin(async move { self.id().await })
272    }
273}
274impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
275    fn into_id(
276        self,
277    ) -> std::pin::Pin<
278        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
279    > {
280        Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
281    }
282}
283impl EngineCacheEntrySetId {
284    fn quote(&self) -> String {
285        format!("\"{}\"", self.0.clone())
286    }
287}
288#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
289pub struct EngineCacheId(pub String);
290impl From<&str> for EngineCacheId {
291    fn from(value: &str) -> Self {
292        Self(value.to_string())
293    }
294}
295impl From<String> for EngineCacheId {
296    fn from(value: String) -> Self {
297        Self(value)
298    }
299}
300impl IntoID<EngineCacheId> for EngineCache {
301    fn into_id(
302        self,
303    ) -> std::pin::Pin<
304        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
305    > {
306        Box::pin(async move { self.id().await })
307    }
308}
309impl IntoID<EngineCacheId> for EngineCacheId {
310    fn into_id(
311        self,
312    ) -> std::pin::Pin<
313        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
314    > {
315        Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
316    }
317}
318impl EngineCacheId {
319    fn quote(&self) -> String {
320        format!("\"{}\"", self.0.clone())
321    }
322}
323#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
324pub struct EngineId(pub String);
325impl From<&str> for EngineId {
326    fn from(value: &str) -> Self {
327        Self(value.to_string())
328    }
329}
330impl From<String> for EngineId {
331    fn from(value: String) -> Self {
332        Self(value)
333    }
334}
335impl IntoID<EngineId> for Engine {
336    fn into_id(
337        self,
338    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
339    {
340        Box::pin(async move { self.id().await })
341    }
342}
343impl IntoID<EngineId> for EngineId {
344    fn into_id(
345        self,
346    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
347    {
348        Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
349    }
350}
351impl EngineId {
352    fn quote(&self) -> String {
353        format!("\"{}\"", self.0.clone())
354    }
355}
356#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
357pub struct EnumTypeDefId(pub String);
358impl From<&str> for EnumTypeDefId {
359    fn from(value: &str) -> Self {
360        Self(value.to_string())
361    }
362}
363impl From<String> for EnumTypeDefId {
364    fn from(value: String) -> Self {
365        Self(value)
366    }
367}
368impl IntoID<EnumTypeDefId> for EnumTypeDef {
369    fn into_id(
370        self,
371    ) -> std::pin::Pin<
372        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
373    > {
374        Box::pin(async move { self.id().await })
375    }
376}
377impl IntoID<EnumTypeDefId> for EnumTypeDefId {
378    fn into_id(
379        self,
380    ) -> std::pin::Pin<
381        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
382    > {
383        Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
384    }
385}
386impl EnumTypeDefId {
387    fn quote(&self) -> String {
388        format!("\"{}\"", self.0.clone())
389    }
390}
391#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
392pub struct EnumValueTypeDefId(pub String);
393impl From<&str> for EnumValueTypeDefId {
394    fn from(value: &str) -> Self {
395        Self(value.to_string())
396    }
397}
398impl From<String> for EnumValueTypeDefId {
399    fn from(value: String) -> Self {
400        Self(value)
401    }
402}
403impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
404    fn into_id(
405        self,
406    ) -> std::pin::Pin<
407        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
408    > {
409        Box::pin(async move { self.id().await })
410    }
411}
412impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
413    fn into_id(
414        self,
415    ) -> std::pin::Pin<
416        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
417    > {
418        Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
419    }
420}
421impl EnumValueTypeDefId {
422    fn quote(&self) -> String {
423        format!("\"{}\"", self.0.clone())
424    }
425}
426#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
427pub struct EnvId(pub String);
428impl From<&str> for EnvId {
429    fn from(value: &str) -> Self {
430        Self(value.to_string())
431    }
432}
433impl From<String> for EnvId {
434    fn from(value: String) -> Self {
435        Self(value)
436    }
437}
438impl IntoID<EnvId> for Env {
439    fn into_id(
440        self,
441    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
442    {
443        Box::pin(async move { self.id().await })
444    }
445}
446impl IntoID<EnvId> for EnvId {
447    fn into_id(
448        self,
449    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
450    {
451        Box::pin(async move { Ok::<EnvId, DaggerError>(self) })
452    }
453}
454impl EnvId {
455    fn quote(&self) -> String {
456        format!("\"{}\"", self.0.clone())
457    }
458}
459#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
460pub struct EnvVariableId(pub String);
461impl From<&str> for EnvVariableId {
462    fn from(value: &str) -> Self {
463        Self(value.to_string())
464    }
465}
466impl From<String> for EnvVariableId {
467    fn from(value: String) -> Self {
468        Self(value)
469    }
470}
471impl IntoID<EnvVariableId> for EnvVariable {
472    fn into_id(
473        self,
474    ) -> std::pin::Pin<
475        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
476    > {
477        Box::pin(async move { self.id().await })
478    }
479}
480impl IntoID<EnvVariableId> for EnvVariableId {
481    fn into_id(
482        self,
483    ) -> std::pin::Pin<
484        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
485    > {
486        Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
487    }
488}
489impl EnvVariableId {
490    fn quote(&self) -> String {
491        format!("\"{}\"", self.0.clone())
492    }
493}
494#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
495pub struct ErrorId(pub String);
496impl From<&str> for ErrorId {
497    fn from(value: &str) -> Self {
498        Self(value.to_string())
499    }
500}
501impl From<String> for ErrorId {
502    fn from(value: String) -> Self {
503        Self(value)
504    }
505}
506impl IntoID<ErrorId> for Error {
507    fn into_id(
508        self,
509    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
510    {
511        Box::pin(async move { self.id().await })
512    }
513}
514impl IntoID<ErrorId> for ErrorId {
515    fn into_id(
516        self,
517    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
518    {
519        Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
520    }
521}
522impl ErrorId {
523    fn quote(&self) -> String {
524        format!("\"{}\"", self.0.clone())
525    }
526}
527#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
528pub struct ErrorValueId(pub String);
529impl From<&str> for ErrorValueId {
530    fn from(value: &str) -> Self {
531        Self(value.to_string())
532    }
533}
534impl From<String> for ErrorValueId {
535    fn from(value: String) -> Self {
536        Self(value)
537    }
538}
539impl IntoID<ErrorValueId> for ErrorValue {
540    fn into_id(
541        self,
542    ) -> std::pin::Pin<
543        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
544    > {
545        Box::pin(async move { self.id().await })
546    }
547}
548impl IntoID<ErrorValueId> for ErrorValueId {
549    fn into_id(
550        self,
551    ) -> std::pin::Pin<
552        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
553    > {
554        Box::pin(async move { Ok::<ErrorValueId, DaggerError>(self) })
555    }
556}
557impl ErrorValueId {
558    fn quote(&self) -> String {
559        format!("\"{}\"", self.0.clone())
560    }
561}
562#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
563pub struct FieldTypeDefId(pub String);
564impl From<&str> for FieldTypeDefId {
565    fn from(value: &str) -> Self {
566        Self(value.to_string())
567    }
568}
569impl From<String> for FieldTypeDefId {
570    fn from(value: String) -> Self {
571        Self(value)
572    }
573}
574impl IntoID<FieldTypeDefId> for FieldTypeDef {
575    fn into_id(
576        self,
577    ) -> std::pin::Pin<
578        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
579    > {
580        Box::pin(async move { self.id().await })
581    }
582}
583impl IntoID<FieldTypeDefId> for FieldTypeDefId {
584    fn into_id(
585        self,
586    ) -> std::pin::Pin<
587        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
588    > {
589        Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
590    }
591}
592impl FieldTypeDefId {
593    fn quote(&self) -> String {
594        format!("\"{}\"", self.0.clone())
595    }
596}
597#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
598pub struct FileId(pub String);
599impl From<&str> for FileId {
600    fn from(value: &str) -> Self {
601        Self(value.to_string())
602    }
603}
604impl From<String> for FileId {
605    fn from(value: String) -> Self {
606        Self(value)
607    }
608}
609impl IntoID<FileId> for File {
610    fn into_id(
611        self,
612    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
613    {
614        Box::pin(async move { self.id().await })
615    }
616}
617impl IntoID<FileId> for FileId {
618    fn into_id(
619        self,
620    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
621    {
622        Box::pin(async move { Ok::<FileId, DaggerError>(self) })
623    }
624}
625impl FileId {
626    fn quote(&self) -> String {
627        format!("\"{}\"", self.0.clone())
628    }
629}
630#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
631pub struct FunctionArgId(pub String);
632impl From<&str> for FunctionArgId {
633    fn from(value: &str) -> Self {
634        Self(value.to_string())
635    }
636}
637impl From<String> for FunctionArgId {
638    fn from(value: String) -> Self {
639        Self(value)
640    }
641}
642impl IntoID<FunctionArgId> for FunctionArg {
643    fn into_id(
644        self,
645    ) -> std::pin::Pin<
646        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
647    > {
648        Box::pin(async move { self.id().await })
649    }
650}
651impl IntoID<FunctionArgId> for FunctionArgId {
652    fn into_id(
653        self,
654    ) -> std::pin::Pin<
655        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
656    > {
657        Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
658    }
659}
660impl FunctionArgId {
661    fn quote(&self) -> String {
662        format!("\"{}\"", self.0.clone())
663    }
664}
665#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
666pub struct FunctionCallArgValueId(pub String);
667impl From<&str> for FunctionCallArgValueId {
668    fn from(value: &str) -> Self {
669        Self(value.to_string())
670    }
671}
672impl From<String> for FunctionCallArgValueId {
673    fn from(value: String) -> Self {
674        Self(value)
675    }
676}
677impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
678    fn into_id(
679        self,
680    ) -> std::pin::Pin<
681        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
682    > {
683        Box::pin(async move { self.id().await })
684    }
685}
686impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
687    fn into_id(
688        self,
689    ) -> std::pin::Pin<
690        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
691    > {
692        Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
693    }
694}
695impl FunctionCallArgValueId {
696    fn quote(&self) -> String {
697        format!("\"{}\"", self.0.clone())
698    }
699}
700#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
701pub struct FunctionCallId(pub String);
702impl From<&str> for FunctionCallId {
703    fn from(value: &str) -> Self {
704        Self(value.to_string())
705    }
706}
707impl From<String> for FunctionCallId {
708    fn from(value: String) -> Self {
709        Self(value)
710    }
711}
712impl IntoID<FunctionCallId> for FunctionCall {
713    fn into_id(
714        self,
715    ) -> std::pin::Pin<
716        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
717    > {
718        Box::pin(async move { self.id().await })
719    }
720}
721impl IntoID<FunctionCallId> for FunctionCallId {
722    fn into_id(
723        self,
724    ) -> std::pin::Pin<
725        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
726    > {
727        Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
728    }
729}
730impl FunctionCallId {
731    fn quote(&self) -> String {
732        format!("\"{}\"", self.0.clone())
733    }
734}
735#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
736pub struct FunctionId(pub String);
737impl From<&str> for FunctionId {
738    fn from(value: &str) -> Self {
739        Self(value.to_string())
740    }
741}
742impl From<String> for FunctionId {
743    fn from(value: String) -> Self {
744        Self(value)
745    }
746}
747impl IntoID<FunctionId> for Function {
748    fn into_id(
749        self,
750    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
751    {
752        Box::pin(async move { self.id().await })
753    }
754}
755impl IntoID<FunctionId> for FunctionId {
756    fn into_id(
757        self,
758    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
759    {
760        Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
761    }
762}
763impl FunctionId {
764    fn quote(&self) -> String {
765        format!("\"{}\"", self.0.clone())
766    }
767}
768#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
769pub struct GeneratedCodeId(pub String);
770impl From<&str> for GeneratedCodeId {
771    fn from(value: &str) -> Self {
772        Self(value.to_string())
773    }
774}
775impl From<String> for GeneratedCodeId {
776    fn from(value: String) -> Self {
777        Self(value)
778    }
779}
780impl IntoID<GeneratedCodeId> for GeneratedCode {
781    fn into_id(
782        self,
783    ) -> std::pin::Pin<
784        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
785    > {
786        Box::pin(async move { self.id().await })
787    }
788}
789impl IntoID<GeneratedCodeId> for GeneratedCodeId {
790    fn into_id(
791        self,
792    ) -> std::pin::Pin<
793        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
794    > {
795        Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
796    }
797}
798impl GeneratedCodeId {
799    fn quote(&self) -> String {
800        format!("\"{}\"", self.0.clone())
801    }
802}
803#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
804pub struct GitRefId(pub String);
805impl From<&str> for GitRefId {
806    fn from(value: &str) -> Self {
807        Self(value.to_string())
808    }
809}
810impl From<String> for GitRefId {
811    fn from(value: String) -> Self {
812        Self(value)
813    }
814}
815impl IntoID<GitRefId> for GitRef {
816    fn into_id(
817        self,
818    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
819    {
820        Box::pin(async move { self.id().await })
821    }
822}
823impl IntoID<GitRefId> for GitRefId {
824    fn into_id(
825        self,
826    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
827    {
828        Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
829    }
830}
831impl GitRefId {
832    fn quote(&self) -> String {
833        format!("\"{}\"", self.0.clone())
834    }
835}
836#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
837pub struct GitRepositoryId(pub String);
838impl From<&str> for GitRepositoryId {
839    fn from(value: &str) -> Self {
840        Self(value.to_string())
841    }
842}
843impl From<String> for GitRepositoryId {
844    fn from(value: String) -> Self {
845        Self(value)
846    }
847}
848impl IntoID<GitRepositoryId> for GitRepository {
849    fn into_id(
850        self,
851    ) -> std::pin::Pin<
852        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
853    > {
854        Box::pin(async move { self.id().await })
855    }
856}
857impl IntoID<GitRepositoryId> for GitRepositoryId {
858    fn into_id(
859        self,
860    ) -> std::pin::Pin<
861        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
862    > {
863        Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
864    }
865}
866impl GitRepositoryId {
867    fn quote(&self) -> String {
868        format!("\"{}\"", self.0.clone())
869    }
870}
871#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
872pub struct HostId(pub String);
873impl From<&str> for HostId {
874    fn from(value: &str) -> Self {
875        Self(value.to_string())
876    }
877}
878impl From<String> for HostId {
879    fn from(value: String) -> Self {
880        Self(value)
881    }
882}
883impl IntoID<HostId> for Host {
884    fn into_id(
885        self,
886    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
887    {
888        Box::pin(async move { self.id().await })
889    }
890}
891impl IntoID<HostId> for HostId {
892    fn into_id(
893        self,
894    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
895    {
896        Box::pin(async move { Ok::<HostId, DaggerError>(self) })
897    }
898}
899impl HostId {
900    fn quote(&self) -> String {
901        format!("\"{}\"", self.0.clone())
902    }
903}
904#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
905pub struct InputTypeDefId(pub String);
906impl From<&str> for InputTypeDefId {
907    fn from(value: &str) -> Self {
908        Self(value.to_string())
909    }
910}
911impl From<String> for InputTypeDefId {
912    fn from(value: String) -> Self {
913        Self(value)
914    }
915}
916impl IntoID<InputTypeDefId> for InputTypeDef {
917    fn into_id(
918        self,
919    ) -> std::pin::Pin<
920        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
921    > {
922        Box::pin(async move { self.id().await })
923    }
924}
925impl IntoID<InputTypeDefId> for InputTypeDefId {
926    fn into_id(
927        self,
928    ) -> std::pin::Pin<
929        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
930    > {
931        Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
932    }
933}
934impl InputTypeDefId {
935    fn quote(&self) -> String {
936        format!("\"{}\"", self.0.clone())
937    }
938}
939#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
940pub struct InterfaceTypeDefId(pub String);
941impl From<&str> for InterfaceTypeDefId {
942    fn from(value: &str) -> Self {
943        Self(value.to_string())
944    }
945}
946impl From<String> for InterfaceTypeDefId {
947    fn from(value: String) -> Self {
948        Self(value)
949    }
950}
951impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
952    fn into_id(
953        self,
954    ) -> std::pin::Pin<
955        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
956    > {
957        Box::pin(async move { self.id().await })
958    }
959}
960impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
961    fn into_id(
962        self,
963    ) -> std::pin::Pin<
964        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
965    > {
966        Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
967    }
968}
969impl InterfaceTypeDefId {
970    fn quote(&self) -> String {
971        format!("\"{}\"", self.0.clone())
972    }
973}
974#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
975pub struct Json(pub String);
976impl From<&str> for Json {
977    fn from(value: &str) -> Self {
978        Self(value.to_string())
979    }
980}
981impl From<String> for Json {
982    fn from(value: String) -> Self {
983        Self(value)
984    }
985}
986impl Json {
987    fn quote(&self) -> String {
988        format!("\"{}\"", self.0.clone())
989    }
990}
991#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
992pub struct JsonValueId(pub String);
993impl From<&str> for JsonValueId {
994    fn from(value: &str) -> Self {
995        Self(value.to_string())
996    }
997}
998impl From<String> for JsonValueId {
999    fn from(value: String) -> Self {
1000        Self(value)
1001    }
1002}
1003impl IntoID<JsonValueId> for JsonValue {
1004    fn into_id(
1005        self,
1006    ) -> std::pin::Pin<
1007        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1008    > {
1009        Box::pin(async move { self.id().await })
1010    }
1011}
1012impl IntoID<JsonValueId> for JsonValueId {
1013    fn into_id(
1014        self,
1015    ) -> std::pin::Pin<
1016        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1017    > {
1018        Box::pin(async move { Ok::<JsonValueId, DaggerError>(self) })
1019    }
1020}
1021impl JsonValueId {
1022    fn quote(&self) -> String {
1023        format!("\"{}\"", self.0.clone())
1024    }
1025}
1026#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1027pub struct Llmid(pub String);
1028impl From<&str> for Llmid {
1029    fn from(value: &str) -> Self {
1030        Self(value.to_string())
1031    }
1032}
1033impl From<String> for Llmid {
1034    fn from(value: String) -> Self {
1035        Self(value)
1036    }
1037}
1038impl IntoID<Llmid> for Llm {
1039    fn into_id(
1040        self,
1041    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1042    {
1043        Box::pin(async move { self.id().await })
1044    }
1045}
1046impl IntoID<Llmid> for Llmid {
1047    fn into_id(
1048        self,
1049    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1050    {
1051        Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
1052    }
1053}
1054impl Llmid {
1055    fn quote(&self) -> String {
1056        format!("\"{}\"", self.0.clone())
1057    }
1058}
1059#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1060pub struct LlmTokenUsageId(pub String);
1061impl From<&str> for LlmTokenUsageId {
1062    fn from(value: &str) -> Self {
1063        Self(value.to_string())
1064    }
1065}
1066impl From<String> for LlmTokenUsageId {
1067    fn from(value: String) -> Self {
1068        Self(value)
1069    }
1070}
1071impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
1072    fn into_id(
1073        self,
1074    ) -> std::pin::Pin<
1075        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1076    > {
1077        Box::pin(async move { self.id().await })
1078    }
1079}
1080impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
1081    fn into_id(
1082        self,
1083    ) -> std::pin::Pin<
1084        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1085    > {
1086        Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
1087    }
1088}
1089impl LlmTokenUsageId {
1090    fn quote(&self) -> String {
1091        format!("\"{}\"", self.0.clone())
1092    }
1093}
1094#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1095pub struct LabelId(pub String);
1096impl From<&str> for LabelId {
1097    fn from(value: &str) -> Self {
1098        Self(value.to_string())
1099    }
1100}
1101impl From<String> for LabelId {
1102    fn from(value: String) -> Self {
1103        Self(value)
1104    }
1105}
1106impl IntoID<LabelId> for Label {
1107    fn into_id(
1108        self,
1109    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1110    {
1111        Box::pin(async move { self.id().await })
1112    }
1113}
1114impl IntoID<LabelId> for LabelId {
1115    fn into_id(
1116        self,
1117    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1118    {
1119        Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
1120    }
1121}
1122impl LabelId {
1123    fn quote(&self) -> String {
1124        format!("\"{}\"", self.0.clone())
1125    }
1126}
1127#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1128pub struct ListTypeDefId(pub String);
1129impl From<&str> for ListTypeDefId {
1130    fn from(value: &str) -> Self {
1131        Self(value.to_string())
1132    }
1133}
1134impl From<String> for ListTypeDefId {
1135    fn from(value: String) -> Self {
1136        Self(value)
1137    }
1138}
1139impl IntoID<ListTypeDefId> for ListTypeDef {
1140    fn into_id(
1141        self,
1142    ) -> std::pin::Pin<
1143        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1144    > {
1145        Box::pin(async move { self.id().await })
1146    }
1147}
1148impl IntoID<ListTypeDefId> for ListTypeDefId {
1149    fn into_id(
1150        self,
1151    ) -> std::pin::Pin<
1152        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1153    > {
1154        Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
1155    }
1156}
1157impl ListTypeDefId {
1158    fn quote(&self) -> String {
1159        format!("\"{}\"", self.0.clone())
1160    }
1161}
1162#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1163pub struct ModuleConfigClientId(pub String);
1164impl From<&str> for ModuleConfigClientId {
1165    fn from(value: &str) -> Self {
1166        Self(value.to_string())
1167    }
1168}
1169impl From<String> for ModuleConfigClientId {
1170    fn from(value: String) -> Self {
1171        Self(value)
1172    }
1173}
1174impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
1175    fn into_id(
1176        self,
1177    ) -> std::pin::Pin<
1178        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1179    > {
1180        Box::pin(async move { self.id().await })
1181    }
1182}
1183impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
1184    fn into_id(
1185        self,
1186    ) -> std::pin::Pin<
1187        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1188    > {
1189        Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
1190    }
1191}
1192impl ModuleConfigClientId {
1193    fn quote(&self) -> String {
1194        format!("\"{}\"", self.0.clone())
1195    }
1196}
1197#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1198pub struct ModuleId(pub String);
1199impl From<&str> for ModuleId {
1200    fn from(value: &str) -> Self {
1201        Self(value.to_string())
1202    }
1203}
1204impl From<String> for ModuleId {
1205    fn from(value: String) -> Self {
1206        Self(value)
1207    }
1208}
1209impl IntoID<ModuleId> for Module {
1210    fn into_id(
1211        self,
1212    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1213    {
1214        Box::pin(async move { self.id().await })
1215    }
1216}
1217impl IntoID<ModuleId> for ModuleId {
1218    fn into_id(
1219        self,
1220    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1221    {
1222        Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
1223    }
1224}
1225impl ModuleId {
1226    fn quote(&self) -> String {
1227        format!("\"{}\"", self.0.clone())
1228    }
1229}
1230#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1231pub struct ModuleSourceId(pub String);
1232impl From<&str> for ModuleSourceId {
1233    fn from(value: &str) -> Self {
1234        Self(value.to_string())
1235    }
1236}
1237impl From<String> for ModuleSourceId {
1238    fn from(value: String) -> Self {
1239        Self(value)
1240    }
1241}
1242impl IntoID<ModuleSourceId> for ModuleSource {
1243    fn into_id(
1244        self,
1245    ) -> std::pin::Pin<
1246        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1247    > {
1248        Box::pin(async move { self.id().await })
1249    }
1250}
1251impl IntoID<ModuleSourceId> for ModuleSourceId {
1252    fn into_id(
1253        self,
1254    ) -> std::pin::Pin<
1255        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1256    > {
1257        Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1258    }
1259}
1260impl ModuleSourceId {
1261    fn quote(&self) -> String {
1262        format!("\"{}\"", self.0.clone())
1263    }
1264}
1265#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1266pub struct ObjectTypeDefId(pub String);
1267impl From<&str> for ObjectTypeDefId {
1268    fn from(value: &str) -> Self {
1269        Self(value.to_string())
1270    }
1271}
1272impl From<String> for ObjectTypeDefId {
1273    fn from(value: String) -> Self {
1274        Self(value)
1275    }
1276}
1277impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1278    fn into_id(
1279        self,
1280    ) -> std::pin::Pin<
1281        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1282    > {
1283        Box::pin(async move { self.id().await })
1284    }
1285}
1286impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1287    fn into_id(
1288        self,
1289    ) -> std::pin::Pin<
1290        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1291    > {
1292        Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1293    }
1294}
1295impl ObjectTypeDefId {
1296    fn quote(&self) -> String {
1297        format!("\"{}\"", self.0.clone())
1298    }
1299}
1300#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1301pub struct Platform(pub String);
1302impl From<&str> for Platform {
1303    fn from(value: &str) -> Self {
1304        Self(value.to_string())
1305    }
1306}
1307impl From<String> for Platform {
1308    fn from(value: String) -> Self {
1309        Self(value)
1310    }
1311}
1312impl Platform {
1313    fn quote(&self) -> String {
1314        format!("\"{}\"", self.0.clone())
1315    }
1316}
1317#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1318pub struct PortId(pub String);
1319impl From<&str> for PortId {
1320    fn from(value: &str) -> Self {
1321        Self(value.to_string())
1322    }
1323}
1324impl From<String> for PortId {
1325    fn from(value: String) -> Self {
1326        Self(value)
1327    }
1328}
1329impl IntoID<PortId> for Port {
1330    fn into_id(
1331        self,
1332    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1333    {
1334        Box::pin(async move { self.id().await })
1335    }
1336}
1337impl IntoID<PortId> for PortId {
1338    fn into_id(
1339        self,
1340    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1341    {
1342        Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1343    }
1344}
1345impl PortId {
1346    fn quote(&self) -> String {
1347        format!("\"{}\"", self.0.clone())
1348    }
1349}
1350#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1351pub struct SdkConfigId(pub String);
1352impl From<&str> for SdkConfigId {
1353    fn from(value: &str) -> Self {
1354        Self(value.to_string())
1355    }
1356}
1357impl From<String> for SdkConfigId {
1358    fn from(value: String) -> Self {
1359        Self(value)
1360    }
1361}
1362impl IntoID<SdkConfigId> for SdkConfig {
1363    fn into_id(
1364        self,
1365    ) -> std::pin::Pin<
1366        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1367    > {
1368        Box::pin(async move { self.id().await })
1369    }
1370}
1371impl IntoID<SdkConfigId> for SdkConfigId {
1372    fn into_id(
1373        self,
1374    ) -> std::pin::Pin<
1375        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1376    > {
1377        Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1378    }
1379}
1380impl SdkConfigId {
1381    fn quote(&self) -> String {
1382        format!("\"{}\"", self.0.clone())
1383    }
1384}
1385#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1386pub struct ScalarTypeDefId(pub String);
1387impl From<&str> for ScalarTypeDefId {
1388    fn from(value: &str) -> Self {
1389        Self(value.to_string())
1390    }
1391}
1392impl From<String> for ScalarTypeDefId {
1393    fn from(value: String) -> Self {
1394        Self(value)
1395    }
1396}
1397impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1398    fn into_id(
1399        self,
1400    ) -> std::pin::Pin<
1401        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1402    > {
1403        Box::pin(async move { self.id().await })
1404    }
1405}
1406impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1407    fn into_id(
1408        self,
1409    ) -> std::pin::Pin<
1410        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1411    > {
1412        Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1413    }
1414}
1415impl ScalarTypeDefId {
1416    fn quote(&self) -> String {
1417        format!("\"{}\"", self.0.clone())
1418    }
1419}
1420#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1421pub struct SearchResultId(pub String);
1422impl From<&str> for SearchResultId {
1423    fn from(value: &str) -> Self {
1424        Self(value.to_string())
1425    }
1426}
1427impl From<String> for SearchResultId {
1428    fn from(value: String) -> Self {
1429        Self(value)
1430    }
1431}
1432impl IntoID<SearchResultId> for SearchResult {
1433    fn into_id(
1434        self,
1435    ) -> std::pin::Pin<
1436        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1437    > {
1438        Box::pin(async move { self.id().await })
1439    }
1440}
1441impl IntoID<SearchResultId> for SearchResultId {
1442    fn into_id(
1443        self,
1444    ) -> std::pin::Pin<
1445        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1446    > {
1447        Box::pin(async move { Ok::<SearchResultId, DaggerError>(self) })
1448    }
1449}
1450impl SearchResultId {
1451    fn quote(&self) -> String {
1452        format!("\"{}\"", self.0.clone())
1453    }
1454}
1455#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1456pub struct SearchSubmatchId(pub String);
1457impl From<&str> for SearchSubmatchId {
1458    fn from(value: &str) -> Self {
1459        Self(value.to_string())
1460    }
1461}
1462impl From<String> for SearchSubmatchId {
1463    fn from(value: String) -> Self {
1464        Self(value)
1465    }
1466}
1467impl IntoID<SearchSubmatchId> for SearchSubmatch {
1468    fn into_id(
1469        self,
1470    ) -> std::pin::Pin<
1471        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1472    > {
1473        Box::pin(async move { self.id().await })
1474    }
1475}
1476impl IntoID<SearchSubmatchId> for SearchSubmatchId {
1477    fn into_id(
1478        self,
1479    ) -> std::pin::Pin<
1480        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1481    > {
1482        Box::pin(async move { Ok::<SearchSubmatchId, DaggerError>(self) })
1483    }
1484}
1485impl SearchSubmatchId {
1486    fn quote(&self) -> String {
1487        format!("\"{}\"", self.0.clone())
1488    }
1489}
1490#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1491pub struct SecretId(pub String);
1492impl From<&str> for SecretId {
1493    fn from(value: &str) -> Self {
1494        Self(value.to_string())
1495    }
1496}
1497impl From<String> for SecretId {
1498    fn from(value: String) -> Self {
1499        Self(value)
1500    }
1501}
1502impl IntoID<SecretId> for Secret {
1503    fn into_id(
1504        self,
1505    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1506    {
1507        Box::pin(async move { self.id().await })
1508    }
1509}
1510impl IntoID<SecretId> for SecretId {
1511    fn into_id(
1512        self,
1513    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1514    {
1515        Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1516    }
1517}
1518impl SecretId {
1519    fn quote(&self) -> String {
1520        format!("\"{}\"", self.0.clone())
1521    }
1522}
1523#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1524pub struct ServiceId(pub String);
1525impl From<&str> for ServiceId {
1526    fn from(value: &str) -> Self {
1527        Self(value.to_string())
1528    }
1529}
1530impl From<String> for ServiceId {
1531    fn from(value: String) -> Self {
1532        Self(value)
1533    }
1534}
1535impl IntoID<ServiceId> for Service {
1536    fn into_id(
1537        self,
1538    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1539    {
1540        Box::pin(async move { self.id().await })
1541    }
1542}
1543impl IntoID<ServiceId> for ServiceId {
1544    fn into_id(
1545        self,
1546    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1547    {
1548        Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1549    }
1550}
1551impl ServiceId {
1552    fn quote(&self) -> String {
1553        format!("\"{}\"", self.0.clone())
1554    }
1555}
1556#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1557pub struct SocketId(pub String);
1558impl From<&str> for SocketId {
1559    fn from(value: &str) -> Self {
1560        Self(value.to_string())
1561    }
1562}
1563impl From<String> for SocketId {
1564    fn from(value: String) -> Self {
1565        Self(value)
1566    }
1567}
1568impl IntoID<SocketId> for Socket {
1569    fn into_id(
1570        self,
1571    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1572    {
1573        Box::pin(async move { self.id().await })
1574    }
1575}
1576impl IntoID<SocketId> for SocketId {
1577    fn into_id(
1578        self,
1579    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1580    {
1581        Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1582    }
1583}
1584impl SocketId {
1585    fn quote(&self) -> String {
1586        format!("\"{}\"", self.0.clone())
1587    }
1588}
1589#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1590pub struct SourceMapId(pub String);
1591impl From<&str> for SourceMapId {
1592    fn from(value: &str) -> Self {
1593        Self(value.to_string())
1594    }
1595}
1596impl From<String> for SourceMapId {
1597    fn from(value: String) -> Self {
1598        Self(value)
1599    }
1600}
1601impl IntoID<SourceMapId> for SourceMap {
1602    fn into_id(
1603        self,
1604    ) -> std::pin::Pin<
1605        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1606    > {
1607        Box::pin(async move { self.id().await })
1608    }
1609}
1610impl IntoID<SourceMapId> for SourceMapId {
1611    fn into_id(
1612        self,
1613    ) -> std::pin::Pin<
1614        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1615    > {
1616        Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1617    }
1618}
1619impl SourceMapId {
1620    fn quote(&self) -> String {
1621        format!("\"{}\"", self.0.clone())
1622    }
1623}
1624#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1625pub struct TerminalId(pub String);
1626impl From<&str> for TerminalId {
1627    fn from(value: &str) -> Self {
1628        Self(value.to_string())
1629    }
1630}
1631impl From<String> for TerminalId {
1632    fn from(value: String) -> Self {
1633        Self(value)
1634    }
1635}
1636impl IntoID<TerminalId> for Terminal {
1637    fn into_id(
1638        self,
1639    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1640    {
1641        Box::pin(async move { self.id().await })
1642    }
1643}
1644impl IntoID<TerminalId> for TerminalId {
1645    fn into_id(
1646        self,
1647    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1648    {
1649        Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
1650    }
1651}
1652impl TerminalId {
1653    fn quote(&self) -> String {
1654        format!("\"{}\"", self.0.clone())
1655    }
1656}
1657#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1658pub struct TypeDefId(pub String);
1659impl From<&str> for TypeDefId {
1660    fn from(value: &str) -> Self {
1661        Self(value.to_string())
1662    }
1663}
1664impl From<String> for TypeDefId {
1665    fn from(value: String) -> Self {
1666        Self(value)
1667    }
1668}
1669impl IntoID<TypeDefId> for TypeDef {
1670    fn into_id(
1671        self,
1672    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1673    {
1674        Box::pin(async move { self.id().await })
1675    }
1676}
1677impl IntoID<TypeDefId> for TypeDefId {
1678    fn into_id(
1679        self,
1680    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1681    {
1682        Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
1683    }
1684}
1685impl TypeDefId {
1686    fn quote(&self) -> String {
1687        format!("\"{}\"", self.0.clone())
1688    }
1689}
1690#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1691pub struct Void(pub String);
1692impl From<&str> for Void {
1693    fn from(value: &str) -> Self {
1694        Self(value.to_string())
1695    }
1696}
1697impl From<String> for Void {
1698    fn from(value: String) -> Self {
1699        Self(value)
1700    }
1701}
1702impl Void {
1703    fn quote(&self) -> String {
1704        format!("\"{}\"", self.0.clone())
1705    }
1706}
1707#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1708pub struct BuildArg {
1709    pub name: String,
1710    pub value: String,
1711}
1712#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1713pub struct PipelineLabel {
1714    pub name: String,
1715    pub value: String,
1716}
1717#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1718pub struct PortForward {
1719    pub backend: isize,
1720    pub frontend: isize,
1721    pub protocol: NetworkProtocol,
1722}
1723#[derive(Clone)]
1724pub struct Binding {
1725    pub proc: Option<Arc<DaggerSessionProc>>,
1726    pub selection: Selection,
1727    pub graphql_client: DynGraphQLClient,
1728}
1729impl Binding {
1730    /// Retrieve the binding value, as type CacheVolume
1731    pub fn as_cache_volume(&self) -> CacheVolume {
1732        let query = self.selection.select("asCacheVolume");
1733        CacheVolume {
1734            proc: self.proc.clone(),
1735            selection: query,
1736            graphql_client: self.graphql_client.clone(),
1737        }
1738    }
1739    /// Retrieve the binding value, as type Cloud
1740    pub fn as_cloud(&self) -> Cloud {
1741        let query = self.selection.select("asCloud");
1742        Cloud {
1743            proc: self.proc.clone(),
1744            selection: query,
1745            graphql_client: self.graphql_client.clone(),
1746        }
1747    }
1748    /// Retrieve the binding value, as type Container
1749    pub fn as_container(&self) -> Container {
1750        let query = self.selection.select("asContainer");
1751        Container {
1752            proc: self.proc.clone(),
1753            selection: query,
1754            graphql_client: self.graphql_client.clone(),
1755        }
1756    }
1757    /// Retrieve the binding value, as type Directory
1758    pub fn as_directory(&self) -> Directory {
1759        let query = self.selection.select("asDirectory");
1760        Directory {
1761            proc: self.proc.clone(),
1762            selection: query,
1763            graphql_client: self.graphql_client.clone(),
1764        }
1765    }
1766    /// Retrieve the binding value, as type Env
1767    pub fn as_env(&self) -> Env {
1768        let query = self.selection.select("asEnv");
1769        Env {
1770            proc: self.proc.clone(),
1771            selection: query,
1772            graphql_client: self.graphql_client.clone(),
1773        }
1774    }
1775    /// Retrieve the binding value, as type File
1776    pub fn as_file(&self) -> File {
1777        let query = self.selection.select("asFile");
1778        File {
1779            proc: self.proc.clone(),
1780            selection: query,
1781            graphql_client: self.graphql_client.clone(),
1782        }
1783    }
1784    /// Retrieve the binding value, as type GitRef
1785    pub fn as_git_ref(&self) -> GitRef {
1786        let query = self.selection.select("asGitRef");
1787        GitRef {
1788            proc: self.proc.clone(),
1789            selection: query,
1790            graphql_client: self.graphql_client.clone(),
1791        }
1792    }
1793    /// Retrieve the binding value, as type GitRepository
1794    pub fn as_git_repository(&self) -> GitRepository {
1795        let query = self.selection.select("asGitRepository");
1796        GitRepository {
1797            proc: self.proc.clone(),
1798            selection: query,
1799            graphql_client: self.graphql_client.clone(),
1800        }
1801    }
1802    /// Retrieve the binding value, as type JSONValue
1803    pub fn as_json_value(&self) -> JsonValue {
1804        let query = self.selection.select("asJSONValue");
1805        JsonValue {
1806            proc: self.proc.clone(),
1807            selection: query,
1808            graphql_client: self.graphql_client.clone(),
1809        }
1810    }
1811    /// Retrieve the binding value, as type LLM
1812    pub fn as_llm(&self) -> Llm {
1813        let query = self.selection.select("asLLM");
1814        Llm {
1815            proc: self.proc.clone(),
1816            selection: query,
1817            graphql_client: self.graphql_client.clone(),
1818        }
1819    }
1820    /// Retrieve the binding value, as type Module
1821    pub fn as_module(&self) -> Module {
1822        let query = self.selection.select("asModule");
1823        Module {
1824            proc: self.proc.clone(),
1825            selection: query,
1826            graphql_client: self.graphql_client.clone(),
1827        }
1828    }
1829    /// Retrieve the binding value, as type ModuleConfigClient
1830    pub fn as_module_config_client(&self) -> ModuleConfigClient {
1831        let query = self.selection.select("asModuleConfigClient");
1832        ModuleConfigClient {
1833            proc: self.proc.clone(),
1834            selection: query,
1835            graphql_client: self.graphql_client.clone(),
1836        }
1837    }
1838    /// Retrieve the binding value, as type ModuleSource
1839    pub fn as_module_source(&self) -> ModuleSource {
1840        let query = self.selection.select("asModuleSource");
1841        ModuleSource {
1842            proc: self.proc.clone(),
1843            selection: query,
1844            graphql_client: self.graphql_client.clone(),
1845        }
1846    }
1847    /// Retrieve the binding value, as type SearchResult
1848    pub fn as_search_result(&self) -> SearchResult {
1849        let query = self.selection.select("asSearchResult");
1850        SearchResult {
1851            proc: self.proc.clone(),
1852            selection: query,
1853            graphql_client: self.graphql_client.clone(),
1854        }
1855    }
1856    /// Retrieve the binding value, as type SearchSubmatch
1857    pub fn as_search_submatch(&self) -> SearchSubmatch {
1858        let query = self.selection.select("asSearchSubmatch");
1859        SearchSubmatch {
1860            proc: self.proc.clone(),
1861            selection: query,
1862            graphql_client: self.graphql_client.clone(),
1863        }
1864    }
1865    /// Retrieve the binding value, as type Secret
1866    pub fn as_secret(&self) -> Secret {
1867        let query = self.selection.select("asSecret");
1868        Secret {
1869            proc: self.proc.clone(),
1870            selection: query,
1871            graphql_client: self.graphql_client.clone(),
1872        }
1873    }
1874    /// Retrieve the binding value, as type Service
1875    pub fn as_service(&self) -> Service {
1876        let query = self.selection.select("asService");
1877        Service {
1878            proc: self.proc.clone(),
1879            selection: query,
1880            graphql_client: self.graphql_client.clone(),
1881        }
1882    }
1883    /// Retrieve the binding value, as type Socket
1884    pub fn as_socket(&self) -> Socket {
1885        let query = self.selection.select("asSocket");
1886        Socket {
1887            proc: self.proc.clone(),
1888            selection: query,
1889            graphql_client: self.graphql_client.clone(),
1890        }
1891    }
1892    /// The binding's string value
1893    pub async fn as_string(&self) -> Result<String, DaggerError> {
1894        let query = self.selection.select("asString");
1895        query.execute(self.graphql_client.clone()).await
1896    }
1897    /// The digest of the binding value
1898    pub async fn digest(&self) -> Result<String, DaggerError> {
1899        let query = self.selection.select("digest");
1900        query.execute(self.graphql_client.clone()).await
1901    }
1902    /// A unique identifier for this Binding.
1903    pub async fn id(&self) -> Result<BindingId, DaggerError> {
1904        let query = self.selection.select("id");
1905        query.execute(self.graphql_client.clone()).await
1906    }
1907    /// Returns true if the binding is null
1908    pub async fn is_null(&self) -> Result<bool, DaggerError> {
1909        let query = self.selection.select("isNull");
1910        query.execute(self.graphql_client.clone()).await
1911    }
1912    /// The binding name
1913    pub async fn name(&self) -> Result<String, DaggerError> {
1914        let query = self.selection.select("name");
1915        query.execute(self.graphql_client.clone()).await
1916    }
1917    /// The binding type
1918    pub async fn type_name(&self) -> Result<String, DaggerError> {
1919        let query = self.selection.select("typeName");
1920        query.execute(self.graphql_client.clone()).await
1921    }
1922}
1923#[derive(Clone)]
1924pub struct CacheVolume {
1925    pub proc: Option<Arc<DaggerSessionProc>>,
1926    pub selection: Selection,
1927    pub graphql_client: DynGraphQLClient,
1928}
1929impl CacheVolume {
1930    /// A unique identifier for this CacheVolume.
1931    pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
1932        let query = self.selection.select("id");
1933        query.execute(self.graphql_client.clone()).await
1934    }
1935}
1936#[derive(Clone)]
1937pub struct Cloud {
1938    pub proc: Option<Arc<DaggerSessionProc>>,
1939    pub selection: Selection,
1940    pub graphql_client: DynGraphQLClient,
1941}
1942impl Cloud {
1943    /// A unique identifier for this Cloud.
1944    pub async fn id(&self) -> Result<CloudId, DaggerError> {
1945        let query = self.selection.select("id");
1946        query.execute(self.graphql_client.clone()).await
1947    }
1948    /// The trace URL for the current session
1949    pub async fn trace_url(&self) -> Result<String, DaggerError> {
1950        let query = self.selection.select("traceURL");
1951        query.execute(self.graphql_client.clone()).await
1952    }
1953}
1954#[derive(Clone)]
1955pub struct Container {
1956    pub proc: Option<Arc<DaggerSessionProc>>,
1957    pub selection: Selection,
1958    pub graphql_client: DynGraphQLClient,
1959}
1960#[derive(Builder, Debug, PartialEq)]
1961pub struct ContainerAsServiceOpts<'a> {
1962    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1963    /// If empty, the container's default command is used.
1964    #[builder(setter(into, strip_option), default)]
1965    pub args: Option<Vec<&'a str>>,
1966    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1967    #[builder(setter(into, strip_option), default)]
1968    pub expand: Option<bool>,
1969    /// Provides Dagger access to the executed command.
1970    #[builder(setter(into, strip_option), default)]
1971    pub experimental_privileged_nesting: Option<bool>,
1972    /// 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.
1973    #[builder(setter(into, strip_option), default)]
1974    pub insecure_root_capabilities: Option<bool>,
1975    /// If set, skip the automatic init process injected into containers by default.
1976    /// 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.
1977    #[builder(setter(into, strip_option), default)]
1978    pub no_init: Option<bool>,
1979    /// If the container has an entrypoint, prepend it to the args.
1980    #[builder(setter(into, strip_option), default)]
1981    pub use_entrypoint: Option<bool>,
1982}
1983#[derive(Builder, Debug, PartialEq)]
1984pub struct ContainerAsTarballOpts {
1985    /// Force each layer of the image to use the specified compression algorithm.
1986    /// 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.
1987    #[builder(setter(into, strip_option), default)]
1988    pub forced_compression: Option<ImageLayerCompression>,
1989    /// Use the specified media types for the image's layers.
1990    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
1991    #[builder(setter(into, strip_option), default)]
1992    pub media_types: Option<ImageMediaTypes>,
1993    /// Identifiers for other platform specific containers.
1994    /// Used for multi-platform images.
1995    #[builder(setter(into, strip_option), default)]
1996    pub platform_variants: Option<Vec<ContainerId>>,
1997}
1998#[derive(Builder, Debug, PartialEq)]
1999pub struct ContainerBuildOpts<'a> {
2000    /// Additional build arguments.
2001    #[builder(setter(into, strip_option), default)]
2002    pub build_args: Option<Vec<BuildArg>>,
2003    /// Path to the Dockerfile to use.
2004    #[builder(setter(into, strip_option), default)]
2005    pub dockerfile: Option<&'a str>,
2006    /// If set, skip the automatic init process injected into containers created by RUN statements.
2007    /// 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.
2008    #[builder(setter(into, strip_option), default)]
2009    pub no_init: Option<bool>,
2010    /// Secrets to pass to the build.
2011    /// They will be mounted at /run/secrets/[secret-name] in the build container
2012    /// 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))
2013    #[builder(setter(into, strip_option), default)]
2014    pub secrets: Option<Vec<SecretId>>,
2015    /// Target build stage to build.
2016    #[builder(setter(into, strip_option), default)]
2017    pub target: Option<&'a str>,
2018}
2019#[derive(Builder, Debug, PartialEq)]
2020pub struct ContainerDirectoryOpts {
2021    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2022    #[builder(setter(into, strip_option), default)]
2023    pub expand: Option<bool>,
2024}
2025#[derive(Builder, Debug, PartialEq)]
2026pub struct ContainerExistsOpts {
2027    /// If specified, do not follow symlinks.
2028    #[builder(setter(into, strip_option), default)]
2029    pub do_not_follow_symlinks: Option<bool>,
2030    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
2031    #[builder(setter(into, strip_option), default)]
2032    pub expected_type: Option<ExistsType>,
2033}
2034#[derive(Builder, Debug, PartialEq)]
2035pub struct ContainerExportOpts {
2036    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2037    #[builder(setter(into, strip_option), default)]
2038    pub expand: Option<bool>,
2039    /// Force each layer of the exported image to use the specified compression algorithm.
2040    /// 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.
2041    #[builder(setter(into, strip_option), default)]
2042    pub forced_compression: Option<ImageLayerCompression>,
2043    /// Use the specified media types for the exported image's layers.
2044    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2045    #[builder(setter(into, strip_option), default)]
2046    pub media_types: Option<ImageMediaTypes>,
2047    /// Identifiers for other platform specific containers.
2048    /// Used for multi-platform image.
2049    #[builder(setter(into, strip_option), default)]
2050    pub platform_variants: Option<Vec<ContainerId>>,
2051}
2052#[derive(Builder, Debug, PartialEq)]
2053pub struct ContainerExportImageOpts {
2054    /// Force each layer of the exported image to use the specified compression algorithm.
2055    /// 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.
2056    #[builder(setter(into, strip_option), default)]
2057    pub forced_compression: Option<ImageLayerCompression>,
2058    /// Use the specified media types for the exported image's layers.
2059    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2060    #[builder(setter(into, strip_option), default)]
2061    pub media_types: Option<ImageMediaTypes>,
2062    /// Identifiers for other platform specific containers.
2063    /// Used for multi-platform image.
2064    #[builder(setter(into, strip_option), default)]
2065    pub platform_variants: Option<Vec<ContainerId>>,
2066}
2067#[derive(Builder, Debug, PartialEq)]
2068pub struct ContainerFileOpts {
2069    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2070    #[builder(setter(into, strip_option), default)]
2071    pub expand: Option<bool>,
2072}
2073#[derive(Builder, Debug, PartialEq)]
2074pub struct ContainerImportOpts<'a> {
2075    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
2076    #[builder(setter(into, strip_option), default)]
2077    pub tag: Option<&'a str>,
2078}
2079#[derive(Builder, Debug, PartialEq)]
2080pub struct ContainerPublishOpts {
2081    /// Force each layer of the published image to use the specified compression algorithm.
2082    /// 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.
2083    #[builder(setter(into, strip_option), default)]
2084    pub forced_compression: Option<ImageLayerCompression>,
2085    /// Use the specified media types for the published image's layers.
2086    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
2087    #[builder(setter(into, strip_option), default)]
2088    pub media_types: Option<ImageMediaTypes>,
2089    /// Identifiers for other platform specific containers.
2090    /// Used for multi-platform image.
2091    #[builder(setter(into, strip_option), default)]
2092    pub platform_variants: Option<Vec<ContainerId>>,
2093}
2094#[derive(Builder, Debug, PartialEq)]
2095pub struct ContainerTerminalOpts<'a> {
2096    /// If set, override the container's default terminal command and invoke these command arguments instead.
2097    #[builder(setter(into, strip_option), default)]
2098    pub cmd: Option<Vec<&'a str>>,
2099    /// Provides Dagger access to the executed command.
2100    #[builder(setter(into, strip_option), default)]
2101    pub experimental_privileged_nesting: Option<bool>,
2102    /// 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.
2103    #[builder(setter(into, strip_option), default)]
2104    pub insecure_root_capabilities: Option<bool>,
2105}
2106#[derive(Builder, Debug, PartialEq)]
2107pub struct ContainerUpOpts<'a> {
2108    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2109    /// If empty, the container's default command is used.
2110    #[builder(setter(into, strip_option), default)]
2111    pub args: Option<Vec<&'a str>>,
2112    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2113    #[builder(setter(into, strip_option), default)]
2114    pub expand: Option<bool>,
2115    /// Provides Dagger access to the executed command.
2116    #[builder(setter(into, strip_option), default)]
2117    pub experimental_privileged_nesting: Option<bool>,
2118    /// 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.
2119    #[builder(setter(into, strip_option), default)]
2120    pub insecure_root_capabilities: Option<bool>,
2121    /// If set, skip the automatic init process injected into containers by default.
2122    /// 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.
2123    #[builder(setter(into, strip_option), default)]
2124    pub no_init: Option<bool>,
2125    /// List of frontend/backend port mappings to forward.
2126    /// Frontend is the port accepting traffic on the host, backend is the service port.
2127    #[builder(setter(into, strip_option), default)]
2128    pub ports: Option<Vec<PortForward>>,
2129    /// Bind each tunnel port to a random port on the host.
2130    #[builder(setter(into, strip_option), default)]
2131    pub random: Option<bool>,
2132    /// If the container has an entrypoint, prepend it to the args.
2133    #[builder(setter(into, strip_option), default)]
2134    pub use_entrypoint: Option<bool>,
2135}
2136#[derive(Builder, Debug, PartialEq)]
2137pub struct ContainerWithDefaultTerminalCmdOpts {
2138    /// Provides Dagger access to the executed command.
2139    #[builder(setter(into, strip_option), default)]
2140    pub experimental_privileged_nesting: Option<bool>,
2141    /// 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.
2142    #[builder(setter(into, strip_option), default)]
2143    pub insecure_root_capabilities: Option<bool>,
2144}
2145#[derive(Builder, Debug, PartialEq)]
2146pub struct ContainerWithDirectoryOpts<'a> {
2147    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
2148    #[builder(setter(into, strip_option), default)]
2149    pub exclude: Option<Vec<&'a str>>,
2150    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2151    #[builder(setter(into, strip_option), default)]
2152    pub expand: Option<bool>,
2153    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
2154    #[builder(setter(into, strip_option), default)]
2155    pub include: Option<Vec<&'a str>>,
2156    /// A user:group to set for the directory and its contents.
2157    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2158    /// If the group is omitted, it defaults to the same as the user.
2159    #[builder(setter(into, strip_option), default)]
2160    pub owner: Option<&'a str>,
2161}
2162#[derive(Builder, Debug, PartialEq)]
2163pub struct ContainerWithEntrypointOpts {
2164    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
2165    #[builder(setter(into, strip_option), default)]
2166    pub keep_default_args: Option<bool>,
2167}
2168#[derive(Builder, Debug, PartialEq)]
2169pub struct ContainerWithEnvVariableOpts {
2170    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
2171    #[builder(setter(into, strip_option), default)]
2172    pub expand: Option<bool>,
2173}
2174#[derive(Builder, Debug, PartialEq)]
2175pub struct ContainerWithExecOpts<'a> {
2176    /// Replace "${VAR}" or "$VAR" in the args 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    /// Exit codes this command is allowed to exit with without error
2180    #[builder(setter(into, strip_option), default)]
2181    pub expect: Option<ReturnType>,
2182    /// Provides Dagger access to the executed command.
2183    #[builder(setter(into, strip_option), default)]
2184    pub experimental_privileged_nesting: Option<bool>,
2185    /// Execute the command with all root capabilities. Like --privileged in Docker
2186    /// 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.
2187    #[builder(setter(into, strip_option), default)]
2188    pub insecure_root_capabilities: Option<bool>,
2189    /// Skip the automatic init process injected into containers by default.
2190    /// 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.
2191    #[builder(setter(into, strip_option), default)]
2192    pub no_init: Option<bool>,
2193    /// Redirect the command's standard error to a file in the container. Example: "./stderr.txt"
2194    #[builder(setter(into, strip_option), default)]
2195    pub redirect_stderr: Option<&'a str>,
2196    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
2197    #[builder(setter(into, strip_option), default)]
2198    pub redirect_stdin: Option<&'a str>,
2199    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
2200    #[builder(setter(into, strip_option), default)]
2201    pub redirect_stdout: Option<&'a str>,
2202    /// Content to write to the command's standard input. Example: "Hello world")
2203    #[builder(setter(into, strip_option), default)]
2204    pub stdin: Option<&'a str>,
2205    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
2206    #[builder(setter(into, strip_option), default)]
2207    pub use_entrypoint: Option<bool>,
2208}
2209#[derive(Builder, Debug, PartialEq)]
2210pub struct ContainerWithExposedPortOpts<'a> {
2211    /// Port description. Example: "payment API endpoint"
2212    #[builder(setter(into, strip_option), default)]
2213    pub description: Option<&'a str>,
2214    /// Skip the health check when run as a service.
2215    #[builder(setter(into, strip_option), default)]
2216    pub experimental_skip_healthcheck: Option<bool>,
2217    /// Network protocol. Example: "tcp"
2218    #[builder(setter(into, strip_option), default)]
2219    pub protocol: Option<NetworkProtocol>,
2220}
2221#[derive(Builder, Debug, PartialEq)]
2222pub struct ContainerWithFileOpts<'a> {
2223    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2224    #[builder(setter(into, strip_option), default)]
2225    pub expand: Option<bool>,
2226    /// A user:group to set for the file.
2227    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2228    /// If the group is omitted, it defaults to the same as the user.
2229    #[builder(setter(into, strip_option), default)]
2230    pub owner: Option<&'a str>,
2231    /// Permissions of the new file. Example: 0600
2232    #[builder(setter(into, strip_option), default)]
2233    pub permissions: Option<isize>,
2234}
2235#[derive(Builder, Debug, PartialEq)]
2236pub struct ContainerWithFilesOpts<'a> {
2237    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2238    #[builder(setter(into, strip_option), default)]
2239    pub expand: Option<bool>,
2240    /// A user:group to set for the files.
2241    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2242    /// If the group is omitted, it defaults to the same as the user.
2243    #[builder(setter(into, strip_option), default)]
2244    pub owner: Option<&'a str>,
2245    /// Permission given to the copied files (e.g., 0600).
2246    #[builder(setter(into, strip_option), default)]
2247    pub permissions: Option<isize>,
2248}
2249#[derive(Builder, Debug, PartialEq)]
2250pub struct ContainerWithMountedCacheOpts<'a> {
2251    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2252    #[builder(setter(into, strip_option), default)]
2253    pub expand: Option<bool>,
2254    /// A user:group to set for the mounted cache directory.
2255    /// 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.
2256    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2257    /// If the group is omitted, it defaults to the same as the user.
2258    #[builder(setter(into, strip_option), default)]
2259    pub owner: Option<&'a str>,
2260    /// Sharing mode of the cache volume.
2261    #[builder(setter(into, strip_option), default)]
2262    pub sharing: Option<CacheSharingMode>,
2263    /// Identifier of the directory to use as the cache volume's root.
2264    #[builder(setter(into, strip_option), default)]
2265    pub source: Option<DirectoryId>,
2266}
2267#[derive(Builder, Debug, PartialEq)]
2268pub struct ContainerWithMountedDirectoryOpts<'a> {
2269    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2270    #[builder(setter(into, strip_option), default)]
2271    pub expand: Option<bool>,
2272    /// A user:group to set for the mounted directory and its contents.
2273    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2274    /// If the group is omitted, it defaults to the same as the user.
2275    #[builder(setter(into, strip_option), default)]
2276    pub owner: Option<&'a str>,
2277}
2278#[derive(Builder, Debug, PartialEq)]
2279pub struct ContainerWithMountedFileOpts<'a> {
2280    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2281    #[builder(setter(into, strip_option), default)]
2282    pub expand: Option<bool>,
2283    /// A user or user:group to set for the mounted file.
2284    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2285    /// If the group is omitted, it defaults to the same as the user.
2286    #[builder(setter(into, strip_option), default)]
2287    pub owner: Option<&'a str>,
2288}
2289#[derive(Builder, Debug, PartialEq)]
2290pub struct ContainerWithMountedSecretOpts<'a> {
2291    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2292    #[builder(setter(into, strip_option), default)]
2293    pub expand: Option<bool>,
2294    /// Permission given to the mounted secret (e.g., 0600).
2295    /// This option requires an owner to be set to be active.
2296    #[builder(setter(into, strip_option), default)]
2297    pub mode: Option<isize>,
2298    /// A user:group to set for the mounted secret.
2299    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2300    /// If the group is omitted, it defaults to the same as the user.
2301    #[builder(setter(into, strip_option), default)]
2302    pub owner: Option<&'a str>,
2303}
2304#[derive(Builder, Debug, PartialEq)]
2305pub struct ContainerWithMountedTempOpts {
2306    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2307    #[builder(setter(into, strip_option), default)]
2308    pub expand: Option<bool>,
2309    /// Size of the temporary directory in bytes.
2310    #[builder(setter(into, strip_option), default)]
2311    pub size: Option<isize>,
2312}
2313#[derive(Builder, Debug, PartialEq)]
2314pub struct ContainerWithNewFileOpts<'a> {
2315    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2316    #[builder(setter(into, strip_option), default)]
2317    pub expand: Option<bool>,
2318    /// A user:group to set for the file.
2319    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2320    /// If the group is omitted, it defaults to the same as the user.
2321    #[builder(setter(into, strip_option), default)]
2322    pub owner: Option<&'a str>,
2323    /// Permissions of the new file. Example: 0600
2324    #[builder(setter(into, strip_option), default)]
2325    pub permissions: Option<isize>,
2326}
2327#[derive(Builder, Debug, PartialEq)]
2328pub struct ContainerWithSymlinkOpts {
2329    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2330    #[builder(setter(into, strip_option), default)]
2331    pub expand: Option<bool>,
2332}
2333#[derive(Builder, Debug, PartialEq)]
2334pub struct ContainerWithUnixSocketOpts<'a> {
2335    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2336    #[builder(setter(into, strip_option), default)]
2337    pub expand: Option<bool>,
2338    /// A user:group to set for the mounted socket.
2339    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2340    /// If the group is omitted, it defaults to the same as the user.
2341    #[builder(setter(into, strip_option), default)]
2342    pub owner: Option<&'a str>,
2343}
2344#[derive(Builder, Debug, PartialEq)]
2345pub struct ContainerWithWorkdirOpts {
2346    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2347    #[builder(setter(into, strip_option), default)]
2348    pub expand: Option<bool>,
2349}
2350#[derive(Builder, Debug, PartialEq)]
2351pub struct ContainerWithoutDirectoryOpts {
2352    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2353    #[builder(setter(into, strip_option), default)]
2354    pub expand: Option<bool>,
2355}
2356#[derive(Builder, Debug, PartialEq)]
2357pub struct ContainerWithoutEntrypointOpts {
2358    /// Don't remove the default arguments when unsetting the entrypoint.
2359    #[builder(setter(into, strip_option), default)]
2360    pub keep_default_args: Option<bool>,
2361}
2362#[derive(Builder, Debug, PartialEq)]
2363pub struct ContainerWithoutExposedPortOpts {
2364    /// Port protocol to unexpose
2365    #[builder(setter(into, strip_option), default)]
2366    pub protocol: Option<NetworkProtocol>,
2367}
2368#[derive(Builder, Debug, PartialEq)]
2369pub struct ContainerWithoutFileOpts {
2370    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2371    #[builder(setter(into, strip_option), default)]
2372    pub expand: Option<bool>,
2373}
2374#[derive(Builder, Debug, PartialEq)]
2375pub struct ContainerWithoutFilesOpts {
2376    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2377    #[builder(setter(into, strip_option), default)]
2378    pub expand: Option<bool>,
2379}
2380#[derive(Builder, Debug, PartialEq)]
2381pub struct ContainerWithoutMountOpts {
2382    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2383    #[builder(setter(into, strip_option), default)]
2384    pub expand: Option<bool>,
2385}
2386#[derive(Builder, Debug, PartialEq)]
2387pub struct ContainerWithoutUnixSocketOpts {
2388    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2389    #[builder(setter(into, strip_option), default)]
2390    pub expand: Option<bool>,
2391}
2392impl Container {
2393    /// Turn the container into a Service.
2394    /// Be sure to set any exposed ports before this conversion.
2395    ///
2396    /// # Arguments
2397    ///
2398    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2399    pub fn as_service(&self) -> Service {
2400        let query = self.selection.select("asService");
2401        Service {
2402            proc: self.proc.clone(),
2403            selection: query,
2404            graphql_client: self.graphql_client.clone(),
2405        }
2406    }
2407    /// Turn the container into a Service.
2408    /// Be sure to set any exposed ports before this conversion.
2409    ///
2410    /// # Arguments
2411    ///
2412    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2413    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2414        let mut query = self.selection.select("asService");
2415        if let Some(args) = opts.args {
2416            query = query.arg("args", args);
2417        }
2418        if let Some(use_entrypoint) = opts.use_entrypoint {
2419            query = query.arg("useEntrypoint", use_entrypoint);
2420        }
2421        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2422            query = query.arg(
2423                "experimentalPrivilegedNesting",
2424                experimental_privileged_nesting,
2425            );
2426        }
2427        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2428            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2429        }
2430        if let Some(expand) = opts.expand {
2431            query = query.arg("expand", expand);
2432        }
2433        if let Some(no_init) = opts.no_init {
2434            query = query.arg("noInit", no_init);
2435        }
2436        Service {
2437            proc: self.proc.clone(),
2438            selection: query,
2439            graphql_client: self.graphql_client.clone(),
2440        }
2441    }
2442    /// Package the container state as an OCI image, and return it as a tar archive
2443    ///
2444    /// # Arguments
2445    ///
2446    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2447    pub fn as_tarball(&self) -> File {
2448        let query = self.selection.select("asTarball");
2449        File {
2450            proc: self.proc.clone(),
2451            selection: query,
2452            graphql_client: self.graphql_client.clone(),
2453        }
2454    }
2455    /// Package the container state as an OCI image, and return it as a tar archive
2456    ///
2457    /// # Arguments
2458    ///
2459    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2460    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2461        let mut query = self.selection.select("asTarball");
2462        if let Some(platform_variants) = opts.platform_variants {
2463            query = query.arg("platformVariants", platform_variants);
2464        }
2465        if let Some(forced_compression) = opts.forced_compression {
2466            query = query.arg("forcedCompression", forced_compression);
2467        }
2468        if let Some(media_types) = opts.media_types {
2469            query = query.arg("mediaTypes", media_types);
2470        }
2471        File {
2472            proc: self.proc.clone(),
2473            selection: query,
2474            graphql_client: self.graphql_client.clone(),
2475        }
2476    }
2477    /// Initializes this container from a Dockerfile build.
2478    ///
2479    /// # Arguments
2480    ///
2481    /// * `context` - Directory context used by the Dockerfile.
2482    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2483    pub fn build(&self, context: impl IntoID<DirectoryId>) -> Container {
2484        let mut query = self.selection.select("build");
2485        query = query.arg_lazy(
2486            "context",
2487            Box::new(move || {
2488                let context = context.clone();
2489                Box::pin(async move { context.into_id().await.unwrap().quote() })
2490            }),
2491        );
2492        Container {
2493            proc: self.proc.clone(),
2494            selection: query,
2495            graphql_client: self.graphql_client.clone(),
2496        }
2497    }
2498    /// Initializes this container from a Dockerfile build.
2499    ///
2500    /// # Arguments
2501    ///
2502    /// * `context` - Directory context used by the Dockerfile.
2503    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2504    pub fn build_opts<'a>(
2505        &self,
2506        context: impl IntoID<DirectoryId>,
2507        opts: ContainerBuildOpts<'a>,
2508    ) -> Container {
2509        let mut query = self.selection.select("build");
2510        query = query.arg_lazy(
2511            "context",
2512            Box::new(move || {
2513                let context = context.clone();
2514                Box::pin(async move { context.into_id().await.unwrap().quote() })
2515            }),
2516        );
2517        if let Some(dockerfile) = opts.dockerfile {
2518            query = query.arg("dockerfile", dockerfile);
2519        }
2520        if let Some(target) = opts.target {
2521            query = query.arg("target", target);
2522        }
2523        if let Some(build_args) = opts.build_args {
2524            query = query.arg("buildArgs", build_args);
2525        }
2526        if let Some(secrets) = opts.secrets {
2527            query = query.arg("secrets", secrets);
2528        }
2529        if let Some(no_init) = opts.no_init {
2530            query = query.arg("noInit", no_init);
2531        }
2532        Container {
2533            proc: self.proc.clone(),
2534            selection: query,
2535            graphql_client: self.graphql_client.clone(),
2536        }
2537    }
2538    /// The combined buffered standard output and standard error stream of the last executed command
2539    /// Returns an error if no command was executed
2540    pub async fn combined_output(&self) -> Result<String, DaggerError> {
2541        let query = self.selection.select("combinedOutput");
2542        query.execute(self.graphql_client.clone()).await
2543    }
2544    /// Return the container's default arguments.
2545    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2546        let query = self.selection.select("defaultArgs");
2547        query.execute(self.graphql_client.clone()).await
2548    }
2549    /// Retrieve a directory from the container's root filesystem
2550    /// Mounts are included.
2551    ///
2552    /// # Arguments
2553    ///
2554    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2555    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2556    pub fn directory(&self, path: impl Into<String>) -> Directory {
2557        let mut query = self.selection.select("directory");
2558        query = query.arg("path", path.into());
2559        Directory {
2560            proc: self.proc.clone(),
2561            selection: query,
2562            graphql_client: self.graphql_client.clone(),
2563        }
2564    }
2565    /// Retrieve a directory from the container's root filesystem
2566    /// Mounts are included.
2567    ///
2568    /// # Arguments
2569    ///
2570    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2571    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2572    pub fn directory_opts(
2573        &self,
2574        path: impl Into<String>,
2575        opts: ContainerDirectoryOpts,
2576    ) -> Directory {
2577        let mut query = self.selection.select("directory");
2578        query = query.arg("path", path.into());
2579        if let Some(expand) = opts.expand {
2580            query = query.arg("expand", expand);
2581        }
2582        Directory {
2583            proc: self.proc.clone(),
2584            selection: query,
2585            graphql_client: self.graphql_client.clone(),
2586        }
2587    }
2588    /// Return the container's OCI entrypoint.
2589    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2590        let query = self.selection.select("entrypoint");
2591        query.execute(self.graphql_client.clone()).await
2592    }
2593    /// Retrieves the value of the specified environment variable.
2594    ///
2595    /// # Arguments
2596    ///
2597    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
2598    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2599        let mut query = self.selection.select("envVariable");
2600        query = query.arg("name", name.into());
2601        query.execute(self.graphql_client.clone()).await
2602    }
2603    /// Retrieves the list of environment variables passed to commands.
2604    pub fn env_variables(&self) -> Vec<EnvVariable> {
2605        let query = self.selection.select("envVariables");
2606        vec![EnvVariable {
2607            proc: self.proc.clone(),
2608            selection: query,
2609            graphql_client: self.graphql_client.clone(),
2610        }]
2611    }
2612    /// check if a file or directory exists
2613    ///
2614    /// # Arguments
2615    ///
2616    /// * `path` - Path to check (e.g., "/file.txt").
2617    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2618    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2619        let mut query = self.selection.select("exists");
2620        query = query.arg("path", path.into());
2621        query.execute(self.graphql_client.clone()).await
2622    }
2623    /// check if a file or directory exists
2624    ///
2625    /// # Arguments
2626    ///
2627    /// * `path` - Path to check (e.g., "/file.txt").
2628    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2629    pub async fn exists_opts(
2630        &self,
2631        path: impl Into<String>,
2632        opts: ContainerExistsOpts,
2633    ) -> Result<bool, DaggerError> {
2634        let mut query = self.selection.select("exists");
2635        query = query.arg("path", path.into());
2636        if let Some(expected_type) = opts.expected_type {
2637            query = query.arg("expectedType", expected_type);
2638        }
2639        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2640            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2641        }
2642        query.execute(self.graphql_client.clone()).await
2643    }
2644    /// The exit code of the last executed command
2645    /// Returns an error if no command was executed
2646    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2647        let query = self.selection.select("exitCode");
2648        query.execute(self.graphql_client.clone()).await
2649    }
2650    /// EXPERIMENTAL API! Subject to change/removal at any time.
2651    /// Configures all available GPUs on the host to be accessible to this container.
2652    /// This currently works for Nvidia devices only.
2653    pub fn experimental_with_all_gp_us(&self) -> Container {
2654        let query = self.selection.select("experimentalWithAllGPUs");
2655        Container {
2656            proc: self.proc.clone(),
2657            selection: query,
2658            graphql_client: self.graphql_client.clone(),
2659        }
2660    }
2661    /// EXPERIMENTAL API! Subject to change/removal at any time.
2662    /// Configures the provided list of devices to be accessible to this container.
2663    /// This currently works for Nvidia devices only.
2664    ///
2665    /// # Arguments
2666    ///
2667    /// * `devices` - List of devices to be accessible to this container.
2668    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2669        let mut query = self.selection.select("experimentalWithGPU");
2670        query = query.arg(
2671            "devices",
2672            devices
2673                .into_iter()
2674                .map(|i| i.into())
2675                .collect::<Vec<String>>(),
2676        );
2677        Container {
2678            proc: self.proc.clone(),
2679            selection: query,
2680            graphql_client: self.graphql_client.clone(),
2681        }
2682    }
2683    /// Writes the container as an OCI tarball to the destination file path on the host.
2684    /// It can also export platform variants.
2685    ///
2686    /// # Arguments
2687    ///
2688    /// * `path` - Host's destination path (e.g., "./tarball").
2689    ///
2690    /// Path can be relative to the engine's workdir or absolute.
2691    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2692    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2693        let mut query = self.selection.select("export");
2694        query = query.arg("path", path.into());
2695        query.execute(self.graphql_client.clone()).await
2696    }
2697    /// Writes the container as an OCI tarball to the destination file path on the host.
2698    /// It can also export platform variants.
2699    ///
2700    /// # Arguments
2701    ///
2702    /// * `path` - Host's destination path (e.g., "./tarball").
2703    ///
2704    /// Path can be relative to the engine's workdir or absolute.
2705    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2706    pub async fn export_opts(
2707        &self,
2708        path: impl Into<String>,
2709        opts: ContainerExportOpts,
2710    ) -> Result<String, DaggerError> {
2711        let mut query = self.selection.select("export");
2712        query = query.arg("path", path.into());
2713        if let Some(platform_variants) = opts.platform_variants {
2714            query = query.arg("platformVariants", platform_variants);
2715        }
2716        if let Some(forced_compression) = opts.forced_compression {
2717            query = query.arg("forcedCompression", forced_compression);
2718        }
2719        if let Some(media_types) = opts.media_types {
2720            query = query.arg("mediaTypes", media_types);
2721        }
2722        if let Some(expand) = opts.expand {
2723            query = query.arg("expand", expand);
2724        }
2725        query.execute(self.graphql_client.clone()).await
2726    }
2727    /// Exports the container as an image to the host's container image store.
2728    ///
2729    /// # Arguments
2730    ///
2731    /// * `name` - Name of image to export to in the host's store
2732    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2733    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2734        let mut query = self.selection.select("exportImage");
2735        query = query.arg("name", name.into());
2736        query.execute(self.graphql_client.clone()).await
2737    }
2738    /// Exports the container as an image to the host's container image store.
2739    ///
2740    /// # Arguments
2741    ///
2742    /// * `name` - Name of image to export to in the host's store
2743    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2744    pub async fn export_image_opts(
2745        &self,
2746        name: impl Into<String>,
2747        opts: ContainerExportImageOpts,
2748    ) -> Result<Void, DaggerError> {
2749        let mut query = self.selection.select("exportImage");
2750        query = query.arg("name", name.into());
2751        if let Some(platform_variants) = opts.platform_variants {
2752            query = query.arg("platformVariants", platform_variants);
2753        }
2754        if let Some(forced_compression) = opts.forced_compression {
2755            query = query.arg("forcedCompression", forced_compression);
2756        }
2757        if let Some(media_types) = opts.media_types {
2758            query = query.arg("mediaTypes", media_types);
2759        }
2760        query.execute(self.graphql_client.clone()).await
2761    }
2762    /// Retrieves the list of exposed ports.
2763    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
2764    pub fn exposed_ports(&self) -> Vec<Port> {
2765        let query = self.selection.select("exposedPorts");
2766        vec![Port {
2767            proc: self.proc.clone(),
2768            selection: query,
2769            graphql_client: self.graphql_client.clone(),
2770        }]
2771    }
2772    /// Retrieves a file at the given path.
2773    /// Mounts are included.
2774    ///
2775    /// # Arguments
2776    ///
2777    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2778    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2779    pub fn file(&self, path: impl Into<String>) -> File {
2780        let mut query = self.selection.select("file");
2781        query = query.arg("path", path.into());
2782        File {
2783            proc: self.proc.clone(),
2784            selection: query,
2785            graphql_client: self.graphql_client.clone(),
2786        }
2787    }
2788    /// Retrieves a file at the given path.
2789    /// Mounts are included.
2790    ///
2791    /// # Arguments
2792    ///
2793    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
2794    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2795    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2796        let mut query = self.selection.select("file");
2797        query = query.arg("path", path.into());
2798        if let Some(expand) = opts.expand {
2799            query = query.arg("expand", expand);
2800        }
2801        File {
2802            proc: self.proc.clone(),
2803            selection: query,
2804            graphql_client: self.graphql_client.clone(),
2805        }
2806    }
2807    /// Download a container image, and apply it to the container state. All previous state will be lost.
2808    ///
2809    /// # Arguments
2810    ///
2811    /// * `address` - Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
2812    pub fn from(&self, address: impl Into<String>) -> Container {
2813        let mut query = self.selection.select("from");
2814        query = query.arg("address", address.into());
2815        Container {
2816            proc: self.proc.clone(),
2817            selection: query,
2818            graphql_client: self.graphql_client.clone(),
2819        }
2820    }
2821    /// A unique identifier for this Container.
2822    pub async fn id(&self) -> Result<ContainerId, DaggerError> {
2823        let query = self.selection.select("id");
2824        query.execute(self.graphql_client.clone()).await
2825    }
2826    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
2827    pub async fn image_ref(&self) -> Result<String, DaggerError> {
2828        let query = self.selection.select("imageRef");
2829        query.execute(self.graphql_client.clone()).await
2830    }
2831    /// Reads the container from an OCI tarball.
2832    ///
2833    /// # Arguments
2834    ///
2835    /// * `source` - File to read the container from.
2836    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2837    pub fn import(&self, source: impl IntoID<FileId>) -> Container {
2838        let mut query = self.selection.select("import");
2839        query = query.arg_lazy(
2840            "source",
2841            Box::new(move || {
2842                let source = source.clone();
2843                Box::pin(async move { source.into_id().await.unwrap().quote() })
2844            }),
2845        );
2846        Container {
2847            proc: self.proc.clone(),
2848            selection: query,
2849            graphql_client: self.graphql_client.clone(),
2850        }
2851    }
2852    /// Reads the container from an OCI tarball.
2853    ///
2854    /// # Arguments
2855    ///
2856    /// * `source` - File to read the container from.
2857    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2858    pub fn import_opts<'a>(
2859        &self,
2860        source: impl IntoID<FileId>,
2861        opts: ContainerImportOpts<'a>,
2862    ) -> Container {
2863        let mut query = self.selection.select("import");
2864        query = query.arg_lazy(
2865            "source",
2866            Box::new(move || {
2867                let source = source.clone();
2868                Box::pin(async move { source.into_id().await.unwrap().quote() })
2869            }),
2870        );
2871        if let Some(tag) = opts.tag {
2872            query = query.arg("tag", tag);
2873        }
2874        Container {
2875            proc: self.proc.clone(),
2876            selection: query,
2877            graphql_client: self.graphql_client.clone(),
2878        }
2879    }
2880    /// Retrieves the value of the specified label.
2881    ///
2882    /// # Arguments
2883    ///
2884    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
2885    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2886        let mut query = self.selection.select("label");
2887        query = query.arg("name", name.into());
2888        query.execute(self.graphql_client.clone()).await
2889    }
2890    /// Retrieves the list of labels passed to container.
2891    pub fn labels(&self) -> Vec<Label> {
2892        let query = self.selection.select("labels");
2893        vec![Label {
2894            proc: self.proc.clone(),
2895            selection: query,
2896            graphql_client: self.graphql_client.clone(),
2897        }]
2898    }
2899    /// Retrieves the list of paths where a directory is mounted.
2900    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2901        let query = self.selection.select("mounts");
2902        query.execute(self.graphql_client.clone()).await
2903    }
2904    /// The platform this container executes and publishes as.
2905    pub async fn platform(&self) -> Result<Platform, DaggerError> {
2906        let query = self.selection.select("platform");
2907        query.execute(self.graphql_client.clone()).await
2908    }
2909    /// Package the container state as an OCI image, and publish it to a registry
2910    /// Returns the fully qualified address of the published image, with digest
2911    ///
2912    /// # Arguments
2913    ///
2914    /// * `address` - The OCI address to publish to
2915    ///
2916    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
2917    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2918    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2919        let mut query = self.selection.select("publish");
2920        query = query.arg("address", address.into());
2921        query.execute(self.graphql_client.clone()).await
2922    }
2923    /// Package the container state as an OCI image, and publish it to a registry
2924    /// Returns the fully qualified address of the published image, with digest
2925    ///
2926    /// # Arguments
2927    ///
2928    /// * `address` - The OCI address to publish to
2929    ///
2930    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
2931    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2932    pub async fn publish_opts(
2933        &self,
2934        address: impl Into<String>,
2935        opts: ContainerPublishOpts,
2936    ) -> Result<String, DaggerError> {
2937        let mut query = self.selection.select("publish");
2938        query = query.arg("address", address.into());
2939        if let Some(platform_variants) = opts.platform_variants {
2940            query = query.arg("platformVariants", platform_variants);
2941        }
2942        if let Some(forced_compression) = opts.forced_compression {
2943            query = query.arg("forcedCompression", forced_compression);
2944        }
2945        if let Some(media_types) = opts.media_types {
2946            query = query.arg("mediaTypes", media_types);
2947        }
2948        query.execute(self.graphql_client.clone()).await
2949    }
2950    /// 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.
2951    pub fn rootfs(&self) -> Directory {
2952        let query = self.selection.select("rootfs");
2953        Directory {
2954            proc: self.proc.clone(),
2955            selection: query,
2956            graphql_client: self.graphql_client.clone(),
2957        }
2958    }
2959    /// The buffered standard error stream of the last executed command
2960    /// Returns an error if no command was executed
2961    pub async fn stderr(&self) -> Result<String, DaggerError> {
2962        let query = self.selection.select("stderr");
2963        query.execute(self.graphql_client.clone()).await
2964    }
2965    /// The buffered standard output stream of the last executed command
2966    /// Returns an error if no command was executed
2967    pub async fn stdout(&self) -> Result<String, DaggerError> {
2968        let query = self.selection.select("stdout");
2969        query.execute(self.graphql_client.clone()).await
2970    }
2971    /// Forces evaluation of the pipeline in the engine.
2972    /// It doesn't run the default command if no exec has been set.
2973    pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
2974        let query = self.selection.select("sync");
2975        query.execute(self.graphql_client.clone()).await
2976    }
2977    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2978    ///
2979    /// # Arguments
2980    ///
2981    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2982    pub fn terminal(&self) -> Container {
2983        let query = self.selection.select("terminal");
2984        Container {
2985            proc: self.proc.clone(),
2986            selection: query,
2987            graphql_client: self.graphql_client.clone(),
2988        }
2989    }
2990    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
2991    ///
2992    /// # Arguments
2993    ///
2994    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2995    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2996        let mut query = self.selection.select("terminal");
2997        if let Some(cmd) = opts.cmd {
2998            query = query.arg("cmd", cmd);
2999        }
3000        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3001            query = query.arg(
3002                "experimentalPrivilegedNesting",
3003                experimental_privileged_nesting,
3004            );
3005        }
3006        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3007            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3008        }
3009        Container {
3010            proc: self.proc.clone(),
3011            selection: query,
3012            graphql_client: self.graphql_client.clone(),
3013        }
3014    }
3015    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3016    /// Be sure to set any exposed ports before calling this api.
3017    ///
3018    /// # Arguments
3019    ///
3020    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3021    pub async fn up(&self) -> Result<Void, DaggerError> {
3022        let query = self.selection.select("up");
3023        query.execute(self.graphql_client.clone()).await
3024    }
3025    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3026    /// Be sure to set any exposed ports before calling this api.
3027    ///
3028    /// # Arguments
3029    ///
3030    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3031    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
3032        let mut query = self.selection.select("up");
3033        if let Some(random) = opts.random {
3034            query = query.arg("random", random);
3035        }
3036        if let Some(ports) = opts.ports {
3037            query = query.arg("ports", ports);
3038        }
3039        if let Some(args) = opts.args {
3040            query = query.arg("args", args);
3041        }
3042        if let Some(use_entrypoint) = opts.use_entrypoint {
3043            query = query.arg("useEntrypoint", use_entrypoint);
3044        }
3045        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3046            query = query.arg(
3047                "experimentalPrivilegedNesting",
3048                experimental_privileged_nesting,
3049            );
3050        }
3051        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3052            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3053        }
3054        if let Some(expand) = opts.expand {
3055            query = query.arg("expand", expand);
3056        }
3057        if let Some(no_init) = opts.no_init {
3058            query = query.arg("noInit", no_init);
3059        }
3060        query.execute(self.graphql_client.clone()).await
3061    }
3062    /// Retrieves the user to be set for all commands.
3063    pub async fn user(&self) -> Result<String, DaggerError> {
3064        let query = self.selection.select("user");
3065        query.execute(self.graphql_client.clone()).await
3066    }
3067    /// Retrieves this container plus the given OCI anotation.
3068    ///
3069    /// # Arguments
3070    ///
3071    /// * `name` - The name of the annotation.
3072    /// * `value` - The value of the annotation.
3073    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3074        let mut query = self.selection.select("withAnnotation");
3075        query = query.arg("name", name.into());
3076        query = query.arg("value", value.into());
3077        Container {
3078            proc: self.proc.clone(),
3079            selection: query,
3080            graphql_client: self.graphql_client.clone(),
3081        }
3082    }
3083    /// Configures default arguments for future commands. Like CMD in Dockerfile.
3084    ///
3085    /// # Arguments
3086    ///
3087    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
3088    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
3089        let mut query = self.selection.select("withDefaultArgs");
3090        query = query.arg(
3091            "args",
3092            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3093        );
3094        Container {
3095            proc: self.proc.clone(),
3096            selection: query,
3097            graphql_client: self.graphql_client.clone(),
3098        }
3099    }
3100    /// Set the default command to invoke for the container's terminal API.
3101    ///
3102    /// # Arguments
3103    ///
3104    /// * `args` - The args of the command.
3105    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3106    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
3107        let mut query = self.selection.select("withDefaultTerminalCmd");
3108        query = query.arg(
3109            "args",
3110            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3111        );
3112        Container {
3113            proc: self.proc.clone(),
3114            selection: query,
3115            graphql_client: self.graphql_client.clone(),
3116        }
3117    }
3118    /// Set the default command to invoke for the container's terminal API.
3119    ///
3120    /// # Arguments
3121    ///
3122    /// * `args` - The args of the command.
3123    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3124    pub fn with_default_terminal_cmd_opts(
3125        &self,
3126        args: Vec<impl Into<String>>,
3127        opts: ContainerWithDefaultTerminalCmdOpts,
3128    ) -> Container {
3129        let mut query = self.selection.select("withDefaultTerminalCmd");
3130        query = query.arg(
3131            "args",
3132            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3133        );
3134        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3135            query = query.arg(
3136                "experimentalPrivilegedNesting",
3137                experimental_privileged_nesting,
3138            );
3139        }
3140        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3141            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3142        }
3143        Container {
3144            proc: self.proc.clone(),
3145            selection: query,
3146            graphql_client: self.graphql_client.clone(),
3147        }
3148    }
3149    /// Return a new container snapshot, with a directory added to its filesystem
3150    ///
3151    /// # Arguments
3152    ///
3153    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
3154    /// * `directory` - Identifier of the directory to write
3155    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3156    pub fn with_directory(
3157        &self,
3158        path: impl Into<String>,
3159        directory: impl IntoID<DirectoryId>,
3160    ) -> Container {
3161        let mut query = self.selection.select("withDirectory");
3162        query = query.arg("path", path.into());
3163        query = query.arg_lazy(
3164            "directory",
3165            Box::new(move || {
3166                let directory = directory.clone();
3167                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3168            }),
3169        );
3170        Container {
3171            proc: self.proc.clone(),
3172            selection: query,
3173            graphql_client: self.graphql_client.clone(),
3174        }
3175    }
3176    /// Return a new container snapshot, with a directory added to its filesystem
3177    ///
3178    /// # Arguments
3179    ///
3180    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
3181    /// * `directory` - Identifier of the directory to write
3182    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3183    pub fn with_directory_opts<'a>(
3184        &self,
3185        path: impl Into<String>,
3186        directory: impl IntoID<DirectoryId>,
3187        opts: ContainerWithDirectoryOpts<'a>,
3188    ) -> Container {
3189        let mut query = self.selection.select("withDirectory");
3190        query = query.arg("path", path.into());
3191        query = query.arg_lazy(
3192            "directory",
3193            Box::new(move || {
3194                let directory = directory.clone();
3195                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3196            }),
3197        );
3198        if let Some(exclude) = opts.exclude {
3199            query = query.arg("exclude", exclude);
3200        }
3201        if let Some(include) = opts.include {
3202            query = query.arg("include", include);
3203        }
3204        if let Some(owner) = opts.owner {
3205            query = query.arg("owner", owner);
3206        }
3207        if let Some(expand) = opts.expand {
3208            query = query.arg("expand", expand);
3209        }
3210        Container {
3211            proc: self.proc.clone(),
3212            selection: query,
3213            graphql_client: self.graphql_client.clone(),
3214        }
3215    }
3216    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
3217    ///
3218    /// # Arguments
3219    ///
3220    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
3221    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3222    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
3223        let mut query = self.selection.select("withEntrypoint");
3224        query = query.arg(
3225            "args",
3226            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3227        );
3228        Container {
3229            proc: self.proc.clone(),
3230            selection: query,
3231            graphql_client: self.graphql_client.clone(),
3232        }
3233    }
3234    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
3235    ///
3236    /// # Arguments
3237    ///
3238    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
3239    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3240    pub fn with_entrypoint_opts(
3241        &self,
3242        args: Vec<impl Into<String>>,
3243        opts: ContainerWithEntrypointOpts,
3244    ) -> Container {
3245        let mut query = self.selection.select("withEntrypoint");
3246        query = query.arg(
3247            "args",
3248            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3249        );
3250        if let Some(keep_default_args) = opts.keep_default_args {
3251            query = query.arg("keepDefaultArgs", keep_default_args);
3252        }
3253        Container {
3254            proc: self.proc.clone(),
3255            selection: query,
3256            graphql_client: self.graphql_client.clone(),
3257        }
3258    }
3259    /// Set a new environment variable in the container.
3260    ///
3261    /// # Arguments
3262    ///
3263    /// * `name` - Name of the environment variable (e.g., "HOST").
3264    /// * `value` - Value of the environment variable. (e.g., "localhost").
3265    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3266    pub fn with_env_variable(
3267        &self,
3268        name: impl Into<String>,
3269        value: impl Into<String>,
3270    ) -> Container {
3271        let mut query = self.selection.select("withEnvVariable");
3272        query = query.arg("name", name.into());
3273        query = query.arg("value", value.into());
3274        Container {
3275            proc: self.proc.clone(),
3276            selection: query,
3277            graphql_client: self.graphql_client.clone(),
3278        }
3279    }
3280    /// Set a new environment variable in the container.
3281    ///
3282    /// # Arguments
3283    ///
3284    /// * `name` - Name of the environment variable (e.g., "HOST").
3285    /// * `value` - Value of the environment variable. (e.g., "localhost").
3286    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3287    pub fn with_env_variable_opts(
3288        &self,
3289        name: impl Into<String>,
3290        value: impl Into<String>,
3291        opts: ContainerWithEnvVariableOpts,
3292    ) -> Container {
3293        let mut query = self.selection.select("withEnvVariable");
3294        query = query.arg("name", name.into());
3295        query = query.arg("value", value.into());
3296        if let Some(expand) = opts.expand {
3297            query = query.arg("expand", expand);
3298        }
3299        Container {
3300            proc: self.proc.clone(),
3301            selection: query,
3302            graphql_client: self.graphql_client.clone(),
3303        }
3304    }
3305    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3306    ///
3307    /// # Arguments
3308    ///
3309    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3310    ///
3311    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3312    ///
3313    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3314    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3315    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3316        let mut query = self.selection.select("withExec");
3317        query = query.arg(
3318            "args",
3319            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3320        );
3321        Container {
3322            proc: self.proc.clone(),
3323            selection: query,
3324            graphql_client: self.graphql_client.clone(),
3325        }
3326    }
3327    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3328    ///
3329    /// # Arguments
3330    ///
3331    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3332    ///
3333    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3334    ///
3335    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3336    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3337    pub fn with_exec_opts<'a>(
3338        &self,
3339        args: Vec<impl Into<String>>,
3340        opts: ContainerWithExecOpts<'a>,
3341    ) -> Container {
3342        let mut query = self.selection.select("withExec");
3343        query = query.arg(
3344            "args",
3345            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3346        );
3347        if let Some(use_entrypoint) = opts.use_entrypoint {
3348            query = query.arg("useEntrypoint", use_entrypoint);
3349        }
3350        if let Some(stdin) = opts.stdin {
3351            query = query.arg("stdin", stdin);
3352        }
3353        if let Some(redirect_stdin) = opts.redirect_stdin {
3354            query = query.arg("redirectStdin", redirect_stdin);
3355        }
3356        if let Some(redirect_stdout) = opts.redirect_stdout {
3357            query = query.arg("redirectStdout", redirect_stdout);
3358        }
3359        if let Some(redirect_stderr) = opts.redirect_stderr {
3360            query = query.arg("redirectStderr", redirect_stderr);
3361        }
3362        if let Some(expect) = opts.expect {
3363            query = query.arg("expect", expect);
3364        }
3365        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3366            query = query.arg(
3367                "experimentalPrivilegedNesting",
3368                experimental_privileged_nesting,
3369            );
3370        }
3371        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3372            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3373        }
3374        if let Some(expand) = opts.expand {
3375            query = query.arg("expand", expand);
3376        }
3377        if let Some(no_init) = opts.no_init {
3378            query = query.arg("noInit", no_init);
3379        }
3380        Container {
3381            proc: self.proc.clone(),
3382            selection: query,
3383            graphql_client: self.graphql_client.clone(),
3384        }
3385    }
3386    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3387    /// Exposed ports serve two purposes:
3388    /// - For health checks and introspection, when running services
3389    /// - For setting the EXPOSE OCI field when publishing the container
3390    ///
3391    /// # Arguments
3392    ///
3393    /// * `port` - Port number to expose. Example: 8080
3394    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3395    pub fn with_exposed_port(&self, port: isize) -> Container {
3396        let mut query = self.selection.select("withExposedPort");
3397        query = query.arg("port", port);
3398        Container {
3399            proc: self.proc.clone(),
3400            selection: query,
3401            graphql_client: self.graphql_client.clone(),
3402        }
3403    }
3404    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3405    /// Exposed ports serve two purposes:
3406    /// - For health checks and introspection, when running services
3407    /// - For setting the EXPOSE OCI field when publishing the container
3408    ///
3409    /// # Arguments
3410    ///
3411    /// * `port` - Port number to expose. Example: 8080
3412    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3413    pub fn with_exposed_port_opts<'a>(
3414        &self,
3415        port: isize,
3416        opts: ContainerWithExposedPortOpts<'a>,
3417    ) -> Container {
3418        let mut query = self.selection.select("withExposedPort");
3419        query = query.arg("port", port);
3420        if let Some(protocol) = opts.protocol {
3421            query = query.arg("protocol", protocol);
3422        }
3423        if let Some(description) = opts.description {
3424            query = query.arg("description", description);
3425        }
3426        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3427            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3428        }
3429        Container {
3430            proc: self.proc.clone(),
3431            selection: query,
3432            graphql_client: self.graphql_client.clone(),
3433        }
3434    }
3435    /// Return a container snapshot with a file added
3436    ///
3437    /// # Arguments
3438    ///
3439    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3440    /// * `source` - File to add
3441    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3442    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
3443        let mut query = self.selection.select("withFile");
3444        query = query.arg("path", path.into());
3445        query = query.arg_lazy(
3446            "source",
3447            Box::new(move || {
3448                let source = source.clone();
3449                Box::pin(async move { source.into_id().await.unwrap().quote() })
3450            }),
3451        );
3452        Container {
3453            proc: self.proc.clone(),
3454            selection: query,
3455            graphql_client: self.graphql_client.clone(),
3456        }
3457    }
3458    /// Return a container snapshot with a file added
3459    ///
3460    /// # Arguments
3461    ///
3462    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3463    /// * `source` - File to add
3464    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3465    pub fn with_file_opts<'a>(
3466        &self,
3467        path: impl Into<String>,
3468        source: impl IntoID<FileId>,
3469        opts: ContainerWithFileOpts<'a>,
3470    ) -> Container {
3471        let mut query = self.selection.select("withFile");
3472        query = query.arg("path", path.into());
3473        query = query.arg_lazy(
3474            "source",
3475            Box::new(move || {
3476                let source = source.clone();
3477                Box::pin(async move { source.into_id().await.unwrap().quote() })
3478            }),
3479        );
3480        if let Some(permissions) = opts.permissions {
3481            query = query.arg("permissions", permissions);
3482        }
3483        if let Some(owner) = opts.owner {
3484            query = query.arg("owner", owner);
3485        }
3486        if let Some(expand) = opts.expand {
3487            query = query.arg("expand", expand);
3488        }
3489        Container {
3490            proc: self.proc.clone(),
3491            selection: query,
3492            graphql_client: self.graphql_client.clone(),
3493        }
3494    }
3495    /// Retrieves this container plus the contents of the given files copied to the given path.
3496    ///
3497    /// # Arguments
3498    ///
3499    /// * `path` - Location where copied files should be placed (e.g., "/src").
3500    /// * `sources` - Identifiers of the files to copy.
3501    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3502    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
3503        let mut query = self.selection.select("withFiles");
3504        query = query.arg("path", path.into());
3505        query = query.arg("sources", sources);
3506        Container {
3507            proc: self.proc.clone(),
3508            selection: query,
3509            graphql_client: self.graphql_client.clone(),
3510        }
3511    }
3512    /// Retrieves this container plus the contents of the given files copied to the given path.
3513    ///
3514    /// # Arguments
3515    ///
3516    /// * `path` - Location where copied files should be placed (e.g., "/src").
3517    /// * `sources` - Identifiers of the files to copy.
3518    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3519    pub fn with_files_opts<'a>(
3520        &self,
3521        path: impl Into<String>,
3522        sources: Vec<FileId>,
3523        opts: ContainerWithFilesOpts<'a>,
3524    ) -> Container {
3525        let mut query = self.selection.select("withFiles");
3526        query = query.arg("path", path.into());
3527        query = query.arg("sources", sources);
3528        if let Some(permissions) = opts.permissions {
3529            query = query.arg("permissions", permissions);
3530        }
3531        if let Some(owner) = opts.owner {
3532            query = query.arg("owner", owner);
3533        }
3534        if let Some(expand) = opts.expand {
3535            query = query.arg("expand", expand);
3536        }
3537        Container {
3538            proc: self.proc.clone(),
3539            selection: query,
3540            graphql_client: self.graphql_client.clone(),
3541        }
3542    }
3543    /// Retrieves this container plus the given label.
3544    ///
3545    /// # Arguments
3546    ///
3547    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3548    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
3549    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3550        let mut query = self.selection.select("withLabel");
3551        query = query.arg("name", name.into());
3552        query = query.arg("value", value.into());
3553        Container {
3554            proc: self.proc.clone(),
3555            selection: query,
3556            graphql_client: self.graphql_client.clone(),
3557        }
3558    }
3559    /// Retrieves this container plus a cache volume mounted at the given path.
3560    ///
3561    /// # Arguments
3562    ///
3563    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3564    /// * `cache` - Identifier of the cache volume to mount.
3565    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3566    pub fn with_mounted_cache(
3567        &self,
3568        path: impl Into<String>,
3569        cache: impl IntoID<CacheVolumeId>,
3570    ) -> Container {
3571        let mut query = self.selection.select("withMountedCache");
3572        query = query.arg("path", path.into());
3573        query = query.arg_lazy(
3574            "cache",
3575            Box::new(move || {
3576                let cache = cache.clone();
3577                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3578            }),
3579        );
3580        Container {
3581            proc: self.proc.clone(),
3582            selection: query,
3583            graphql_client: self.graphql_client.clone(),
3584        }
3585    }
3586    /// Retrieves this container plus a cache volume mounted at the given path.
3587    ///
3588    /// # Arguments
3589    ///
3590    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3591    /// * `cache` - Identifier of the cache volume to mount.
3592    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3593    pub fn with_mounted_cache_opts<'a>(
3594        &self,
3595        path: impl Into<String>,
3596        cache: impl IntoID<CacheVolumeId>,
3597        opts: ContainerWithMountedCacheOpts<'a>,
3598    ) -> Container {
3599        let mut query = self.selection.select("withMountedCache");
3600        query = query.arg("path", path.into());
3601        query = query.arg_lazy(
3602            "cache",
3603            Box::new(move || {
3604                let cache = cache.clone();
3605                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3606            }),
3607        );
3608        if let Some(source) = opts.source {
3609            query = query.arg("source", source);
3610        }
3611        if let Some(sharing) = opts.sharing {
3612            query = query.arg("sharing", sharing);
3613        }
3614        if let Some(owner) = opts.owner {
3615            query = query.arg("owner", owner);
3616        }
3617        if let Some(expand) = opts.expand {
3618            query = query.arg("expand", expand);
3619        }
3620        Container {
3621            proc: self.proc.clone(),
3622            selection: query,
3623            graphql_client: self.graphql_client.clone(),
3624        }
3625    }
3626    /// Retrieves this container plus a directory mounted at the given path.
3627    ///
3628    /// # Arguments
3629    ///
3630    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3631    /// * `source` - Identifier of the mounted directory.
3632    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3633    pub fn with_mounted_directory(
3634        &self,
3635        path: impl Into<String>,
3636        source: impl IntoID<DirectoryId>,
3637    ) -> Container {
3638        let mut query = self.selection.select("withMountedDirectory");
3639        query = query.arg("path", path.into());
3640        query = query.arg_lazy(
3641            "source",
3642            Box::new(move || {
3643                let source = source.clone();
3644                Box::pin(async move { source.into_id().await.unwrap().quote() })
3645            }),
3646        );
3647        Container {
3648            proc: self.proc.clone(),
3649            selection: query,
3650            graphql_client: self.graphql_client.clone(),
3651        }
3652    }
3653    /// Retrieves this container plus a directory mounted at the given path.
3654    ///
3655    /// # Arguments
3656    ///
3657    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3658    /// * `source` - Identifier of the mounted directory.
3659    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3660    pub fn with_mounted_directory_opts<'a>(
3661        &self,
3662        path: impl Into<String>,
3663        source: impl IntoID<DirectoryId>,
3664        opts: ContainerWithMountedDirectoryOpts<'a>,
3665    ) -> Container {
3666        let mut query = self.selection.select("withMountedDirectory");
3667        query = query.arg("path", path.into());
3668        query = query.arg_lazy(
3669            "source",
3670            Box::new(move || {
3671                let source = source.clone();
3672                Box::pin(async move { source.into_id().await.unwrap().quote() })
3673            }),
3674        );
3675        if let Some(owner) = opts.owner {
3676            query = query.arg("owner", owner);
3677        }
3678        if let Some(expand) = opts.expand {
3679            query = query.arg("expand", expand);
3680        }
3681        Container {
3682            proc: self.proc.clone(),
3683            selection: query,
3684            graphql_client: self.graphql_client.clone(),
3685        }
3686    }
3687    /// Retrieves this container plus a file mounted at the given path.
3688    ///
3689    /// # Arguments
3690    ///
3691    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3692    /// * `source` - Identifier of the mounted file.
3693    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3694    pub fn with_mounted_file(
3695        &self,
3696        path: impl Into<String>,
3697        source: impl IntoID<FileId>,
3698    ) -> Container {
3699        let mut query = self.selection.select("withMountedFile");
3700        query = query.arg("path", path.into());
3701        query = query.arg_lazy(
3702            "source",
3703            Box::new(move || {
3704                let source = source.clone();
3705                Box::pin(async move { source.into_id().await.unwrap().quote() })
3706            }),
3707        );
3708        Container {
3709            proc: self.proc.clone(),
3710            selection: query,
3711            graphql_client: self.graphql_client.clone(),
3712        }
3713    }
3714    /// Retrieves this container plus a file mounted at the given path.
3715    ///
3716    /// # Arguments
3717    ///
3718    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3719    /// * `source` - Identifier of the mounted file.
3720    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3721    pub fn with_mounted_file_opts<'a>(
3722        &self,
3723        path: impl Into<String>,
3724        source: impl IntoID<FileId>,
3725        opts: ContainerWithMountedFileOpts<'a>,
3726    ) -> Container {
3727        let mut query = self.selection.select("withMountedFile");
3728        query = query.arg("path", path.into());
3729        query = query.arg_lazy(
3730            "source",
3731            Box::new(move || {
3732                let source = source.clone();
3733                Box::pin(async move { source.into_id().await.unwrap().quote() })
3734            }),
3735        );
3736        if let Some(owner) = opts.owner {
3737            query = query.arg("owner", owner);
3738        }
3739        if let Some(expand) = opts.expand {
3740            query = query.arg("expand", expand);
3741        }
3742        Container {
3743            proc: self.proc.clone(),
3744            selection: query,
3745            graphql_client: self.graphql_client.clone(),
3746        }
3747    }
3748    /// Retrieves this container plus a secret mounted into a file at the given path.
3749    ///
3750    /// # Arguments
3751    ///
3752    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3753    /// * `source` - Identifier of the secret to mount.
3754    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3755    pub fn with_mounted_secret(
3756        &self,
3757        path: impl Into<String>,
3758        source: impl IntoID<SecretId>,
3759    ) -> Container {
3760        let mut query = self.selection.select("withMountedSecret");
3761        query = query.arg("path", path.into());
3762        query = query.arg_lazy(
3763            "source",
3764            Box::new(move || {
3765                let source = source.clone();
3766                Box::pin(async move { source.into_id().await.unwrap().quote() })
3767            }),
3768        );
3769        Container {
3770            proc: self.proc.clone(),
3771            selection: query,
3772            graphql_client: self.graphql_client.clone(),
3773        }
3774    }
3775    /// Retrieves this container plus a secret mounted into a file at the given path.
3776    ///
3777    /// # Arguments
3778    ///
3779    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
3780    /// * `source` - Identifier of the secret to mount.
3781    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3782    pub fn with_mounted_secret_opts<'a>(
3783        &self,
3784        path: impl Into<String>,
3785        source: impl IntoID<SecretId>,
3786        opts: ContainerWithMountedSecretOpts<'a>,
3787    ) -> Container {
3788        let mut query = self.selection.select("withMountedSecret");
3789        query = query.arg("path", path.into());
3790        query = query.arg_lazy(
3791            "source",
3792            Box::new(move || {
3793                let source = source.clone();
3794                Box::pin(async move { source.into_id().await.unwrap().quote() })
3795            }),
3796        );
3797        if let Some(owner) = opts.owner {
3798            query = query.arg("owner", owner);
3799        }
3800        if let Some(mode) = opts.mode {
3801            query = query.arg("mode", mode);
3802        }
3803        if let Some(expand) = opts.expand {
3804            query = query.arg("expand", expand);
3805        }
3806        Container {
3807            proc: self.proc.clone(),
3808            selection: query,
3809            graphql_client: self.graphql_client.clone(),
3810        }
3811    }
3812    /// 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.
3813    ///
3814    /// # Arguments
3815    ///
3816    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3817    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3818    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3819        let mut query = self.selection.select("withMountedTemp");
3820        query = query.arg("path", path.into());
3821        Container {
3822            proc: self.proc.clone(),
3823            selection: query,
3824            graphql_client: self.graphql_client.clone(),
3825        }
3826    }
3827    /// 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.
3828    ///
3829    /// # Arguments
3830    ///
3831    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
3832    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3833    pub fn with_mounted_temp_opts(
3834        &self,
3835        path: impl Into<String>,
3836        opts: ContainerWithMountedTempOpts,
3837    ) -> Container {
3838        let mut query = self.selection.select("withMountedTemp");
3839        query = query.arg("path", path.into());
3840        if let Some(size) = opts.size {
3841            query = query.arg("size", size);
3842        }
3843        if let Some(expand) = opts.expand {
3844            query = query.arg("expand", expand);
3845        }
3846        Container {
3847            proc: self.proc.clone(),
3848            selection: query,
3849            graphql_client: self.graphql_client.clone(),
3850        }
3851    }
3852    /// Return a new container snapshot, with a file added to its filesystem with text content
3853    ///
3854    /// # Arguments
3855    ///
3856    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
3857    /// * `contents` - Contents of the new file. Example: "Hello world!"
3858    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3859    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3860        let mut query = self.selection.select("withNewFile");
3861        query = query.arg("path", path.into());
3862        query = query.arg("contents", contents.into());
3863        Container {
3864            proc: self.proc.clone(),
3865            selection: query,
3866            graphql_client: self.graphql_client.clone(),
3867        }
3868    }
3869    /// Return a new container snapshot, with a file added to its filesystem with text content
3870    ///
3871    /// # Arguments
3872    ///
3873    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
3874    /// * `contents` - Contents of the new file. Example: "Hello world!"
3875    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3876    pub fn with_new_file_opts<'a>(
3877        &self,
3878        path: impl Into<String>,
3879        contents: impl Into<String>,
3880        opts: ContainerWithNewFileOpts<'a>,
3881    ) -> Container {
3882        let mut query = self.selection.select("withNewFile");
3883        query = query.arg("path", path.into());
3884        query = query.arg("contents", contents.into());
3885        if let Some(permissions) = opts.permissions {
3886            query = query.arg("permissions", permissions);
3887        }
3888        if let Some(owner) = opts.owner {
3889            query = query.arg("owner", owner);
3890        }
3891        if let Some(expand) = opts.expand {
3892            query = query.arg("expand", expand);
3893        }
3894        Container {
3895            proc: self.proc.clone(),
3896            selection: query,
3897            graphql_client: self.graphql_client.clone(),
3898        }
3899    }
3900    /// Attach credentials for future publishing to a registry. Use in combination with publish
3901    ///
3902    /// # Arguments
3903    ///
3904    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
3905    /// * `username` - The username to authenticate with. Example: "alice"
3906    /// * `secret` - The API key, password or token to authenticate to this registry
3907    pub fn with_registry_auth(
3908        &self,
3909        address: impl Into<String>,
3910        username: impl Into<String>,
3911        secret: impl IntoID<SecretId>,
3912    ) -> Container {
3913        let mut query = self.selection.select("withRegistryAuth");
3914        query = query.arg("address", address.into());
3915        query = query.arg("username", username.into());
3916        query = query.arg_lazy(
3917            "secret",
3918            Box::new(move || {
3919                let secret = secret.clone();
3920                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3921            }),
3922        );
3923        Container {
3924            proc: self.proc.clone(),
3925            selection: query,
3926            graphql_client: self.graphql_client.clone(),
3927        }
3928    }
3929    /// Change the container's root filesystem. The previous root filesystem will be lost.
3930    ///
3931    /// # Arguments
3932    ///
3933    /// * `directory` - The new root filesystem.
3934    pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
3935        let mut query = self.selection.select("withRootfs");
3936        query = query.arg_lazy(
3937            "directory",
3938            Box::new(move || {
3939                let directory = directory.clone();
3940                Box::pin(async move { directory.into_id().await.unwrap().quote() })
3941            }),
3942        );
3943        Container {
3944            proc: self.proc.clone(),
3945            selection: query,
3946            graphql_client: self.graphql_client.clone(),
3947        }
3948    }
3949    /// Set a new environment variable, using a secret value
3950    ///
3951    /// # Arguments
3952    ///
3953    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
3954    /// * `secret` - Identifier of the secret value.
3955    pub fn with_secret_variable(
3956        &self,
3957        name: impl Into<String>,
3958        secret: impl IntoID<SecretId>,
3959    ) -> Container {
3960        let mut query = self.selection.select("withSecretVariable");
3961        query = query.arg("name", name.into());
3962        query = query.arg_lazy(
3963            "secret",
3964            Box::new(move || {
3965                let secret = secret.clone();
3966                Box::pin(async move { secret.into_id().await.unwrap().quote() })
3967            }),
3968        );
3969        Container {
3970            proc: self.proc.clone(),
3971            selection: query,
3972            graphql_client: self.graphql_client.clone(),
3973        }
3974    }
3975    /// Establish a runtime dependency from a container to a network service.
3976    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
3977    /// The service will be reachable from the container via the provided hostname alias.
3978    /// The service dependency will also convey to any files or directories produced by the container.
3979    ///
3980    /// # Arguments
3981    ///
3982    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
3983    /// * `service` - The target service
3984    pub fn with_service_binding(
3985        &self,
3986        alias: impl Into<String>,
3987        service: impl IntoID<ServiceId>,
3988    ) -> Container {
3989        let mut query = self.selection.select("withServiceBinding");
3990        query = query.arg("alias", alias.into());
3991        query = query.arg_lazy(
3992            "service",
3993            Box::new(move || {
3994                let service = service.clone();
3995                Box::pin(async move { service.into_id().await.unwrap().quote() })
3996            }),
3997        );
3998        Container {
3999            proc: self.proc.clone(),
4000            selection: query,
4001            graphql_client: self.graphql_client.clone(),
4002        }
4003    }
4004    /// Return a snapshot with a symlink
4005    ///
4006    /// # Arguments
4007    ///
4008    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4009    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4010    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4011    pub fn with_symlink(
4012        &self,
4013        target: impl Into<String>,
4014        link_name: impl Into<String>,
4015    ) -> Container {
4016        let mut query = self.selection.select("withSymlink");
4017        query = query.arg("target", target.into());
4018        query = query.arg("linkName", link_name.into());
4019        Container {
4020            proc: self.proc.clone(),
4021            selection: query,
4022            graphql_client: self.graphql_client.clone(),
4023        }
4024    }
4025    /// Return a snapshot with a symlink
4026    ///
4027    /// # Arguments
4028    ///
4029    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4030    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4031    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4032    pub fn with_symlink_opts(
4033        &self,
4034        target: impl Into<String>,
4035        link_name: impl Into<String>,
4036        opts: ContainerWithSymlinkOpts,
4037    ) -> Container {
4038        let mut query = self.selection.select("withSymlink");
4039        query = query.arg("target", target.into());
4040        query = query.arg("linkName", link_name.into());
4041        if let Some(expand) = opts.expand {
4042            query = query.arg("expand", expand);
4043        }
4044        Container {
4045            proc: self.proc.clone(),
4046            selection: query,
4047            graphql_client: self.graphql_client.clone(),
4048        }
4049    }
4050    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4051    ///
4052    /// # Arguments
4053    ///
4054    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4055    /// * `source` - Identifier of the socket to forward.
4056    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4057    pub fn with_unix_socket(
4058        &self,
4059        path: impl Into<String>,
4060        source: impl IntoID<SocketId>,
4061    ) -> Container {
4062        let mut query = self.selection.select("withUnixSocket");
4063        query = query.arg("path", path.into());
4064        query = query.arg_lazy(
4065            "source",
4066            Box::new(move || {
4067                let source = source.clone();
4068                Box::pin(async move { source.into_id().await.unwrap().quote() })
4069            }),
4070        );
4071        Container {
4072            proc: self.proc.clone(),
4073            selection: query,
4074            graphql_client: self.graphql_client.clone(),
4075        }
4076    }
4077    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4078    ///
4079    /// # Arguments
4080    ///
4081    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4082    /// * `source` - Identifier of the socket to forward.
4083    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4084    pub fn with_unix_socket_opts<'a>(
4085        &self,
4086        path: impl Into<String>,
4087        source: impl IntoID<SocketId>,
4088        opts: ContainerWithUnixSocketOpts<'a>,
4089    ) -> Container {
4090        let mut query = self.selection.select("withUnixSocket");
4091        query = query.arg("path", path.into());
4092        query = query.arg_lazy(
4093            "source",
4094            Box::new(move || {
4095                let source = source.clone();
4096                Box::pin(async move { source.into_id().await.unwrap().quote() })
4097            }),
4098        );
4099        if let Some(owner) = opts.owner {
4100            query = query.arg("owner", owner);
4101        }
4102        if let Some(expand) = opts.expand {
4103            query = query.arg("expand", expand);
4104        }
4105        Container {
4106            proc: self.proc.clone(),
4107            selection: query,
4108            graphql_client: self.graphql_client.clone(),
4109        }
4110    }
4111    /// Retrieves this container with a different command user.
4112    ///
4113    /// # Arguments
4114    ///
4115    /// * `name` - The user to set (e.g., "root").
4116    pub fn with_user(&self, name: impl Into<String>) -> Container {
4117        let mut query = self.selection.select("withUser");
4118        query = query.arg("name", name.into());
4119        Container {
4120            proc: self.proc.clone(),
4121            selection: query,
4122            graphql_client: self.graphql_client.clone(),
4123        }
4124    }
4125    /// Change the container's working directory. Like WORKDIR in Dockerfile.
4126    ///
4127    /// # Arguments
4128    ///
4129    /// * `path` - The path to set as the working directory (e.g., "/app").
4130    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4131    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
4132        let mut query = self.selection.select("withWorkdir");
4133        query = query.arg("path", path.into());
4134        Container {
4135            proc: self.proc.clone(),
4136            selection: query,
4137            graphql_client: self.graphql_client.clone(),
4138        }
4139    }
4140    /// Change the container's working directory. Like WORKDIR in Dockerfile.
4141    ///
4142    /// # Arguments
4143    ///
4144    /// * `path` - The path to set as the working directory (e.g., "/app").
4145    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4146    pub fn with_workdir_opts(
4147        &self,
4148        path: impl Into<String>,
4149        opts: ContainerWithWorkdirOpts,
4150    ) -> Container {
4151        let mut query = self.selection.select("withWorkdir");
4152        query = query.arg("path", path.into());
4153        if let Some(expand) = opts.expand {
4154            query = query.arg("expand", expand);
4155        }
4156        Container {
4157            proc: self.proc.clone(),
4158            selection: query,
4159            graphql_client: self.graphql_client.clone(),
4160        }
4161    }
4162    /// Retrieves this container minus the given OCI annotation.
4163    ///
4164    /// # Arguments
4165    ///
4166    /// * `name` - The name of the annotation.
4167    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
4168        let mut query = self.selection.select("withoutAnnotation");
4169        query = query.arg("name", name.into());
4170        Container {
4171            proc: self.proc.clone(),
4172            selection: query,
4173            graphql_client: self.graphql_client.clone(),
4174        }
4175    }
4176    /// Remove the container's default arguments.
4177    pub fn without_default_args(&self) -> Container {
4178        let query = self.selection.select("withoutDefaultArgs");
4179        Container {
4180            proc: self.proc.clone(),
4181            selection: query,
4182            graphql_client: self.graphql_client.clone(),
4183        }
4184    }
4185    /// Return a new container snapshot, with a directory removed from its filesystem
4186    ///
4187    /// # Arguments
4188    ///
4189    /// * `path` - Location of the directory to remove (e.g., ".github/").
4190    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4191    pub fn without_directory(&self, path: impl Into<String>) -> Container {
4192        let mut query = self.selection.select("withoutDirectory");
4193        query = query.arg("path", path.into());
4194        Container {
4195            proc: self.proc.clone(),
4196            selection: query,
4197            graphql_client: self.graphql_client.clone(),
4198        }
4199    }
4200    /// Return a new container snapshot, with a directory removed from its filesystem
4201    ///
4202    /// # Arguments
4203    ///
4204    /// * `path` - Location of the directory to remove (e.g., ".github/").
4205    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4206    pub fn without_directory_opts(
4207        &self,
4208        path: impl Into<String>,
4209        opts: ContainerWithoutDirectoryOpts,
4210    ) -> Container {
4211        let mut query = self.selection.select("withoutDirectory");
4212        query = query.arg("path", path.into());
4213        if let Some(expand) = opts.expand {
4214            query = query.arg("expand", expand);
4215        }
4216        Container {
4217            proc: self.proc.clone(),
4218            selection: query,
4219            graphql_client: self.graphql_client.clone(),
4220        }
4221    }
4222    /// Reset the container's OCI entrypoint.
4223    ///
4224    /// # Arguments
4225    ///
4226    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4227    pub fn without_entrypoint(&self) -> Container {
4228        let query = self.selection.select("withoutEntrypoint");
4229        Container {
4230            proc: self.proc.clone(),
4231            selection: query,
4232            graphql_client: self.graphql_client.clone(),
4233        }
4234    }
4235    /// Reset the container's OCI entrypoint.
4236    ///
4237    /// # Arguments
4238    ///
4239    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4240    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4241        let mut query = self.selection.select("withoutEntrypoint");
4242        if let Some(keep_default_args) = opts.keep_default_args {
4243            query = query.arg("keepDefaultArgs", keep_default_args);
4244        }
4245        Container {
4246            proc: self.proc.clone(),
4247            selection: query,
4248            graphql_client: self.graphql_client.clone(),
4249        }
4250    }
4251    /// Retrieves this container minus the given environment variable.
4252    ///
4253    /// # Arguments
4254    ///
4255    /// * `name` - The name of the environment variable (e.g., "HOST").
4256    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4257        let mut query = self.selection.select("withoutEnvVariable");
4258        query = query.arg("name", name.into());
4259        Container {
4260            proc: self.proc.clone(),
4261            selection: query,
4262            graphql_client: self.graphql_client.clone(),
4263        }
4264    }
4265    /// Unexpose a previously exposed port.
4266    ///
4267    /// # Arguments
4268    ///
4269    /// * `port` - Port number to unexpose
4270    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4271    pub fn without_exposed_port(&self, port: isize) -> Container {
4272        let mut query = self.selection.select("withoutExposedPort");
4273        query = query.arg("port", port);
4274        Container {
4275            proc: self.proc.clone(),
4276            selection: query,
4277            graphql_client: self.graphql_client.clone(),
4278        }
4279    }
4280    /// Unexpose a previously exposed port.
4281    ///
4282    /// # Arguments
4283    ///
4284    /// * `port` - Port number to unexpose
4285    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4286    pub fn without_exposed_port_opts(
4287        &self,
4288        port: isize,
4289        opts: ContainerWithoutExposedPortOpts,
4290    ) -> Container {
4291        let mut query = self.selection.select("withoutExposedPort");
4292        query = query.arg("port", port);
4293        if let Some(protocol) = opts.protocol {
4294            query = query.arg("protocol", protocol);
4295        }
4296        Container {
4297            proc: self.proc.clone(),
4298            selection: query,
4299            graphql_client: self.graphql_client.clone(),
4300        }
4301    }
4302    /// Retrieves this container with the file at the given path removed.
4303    ///
4304    /// # Arguments
4305    ///
4306    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4307    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4308    pub fn without_file(&self, path: impl Into<String>) -> Container {
4309        let mut query = self.selection.select("withoutFile");
4310        query = query.arg("path", path.into());
4311        Container {
4312            proc: self.proc.clone(),
4313            selection: query,
4314            graphql_client: self.graphql_client.clone(),
4315        }
4316    }
4317    /// Retrieves this container with the file at the given path removed.
4318    ///
4319    /// # Arguments
4320    ///
4321    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4322    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4323    pub fn without_file_opts(
4324        &self,
4325        path: impl Into<String>,
4326        opts: ContainerWithoutFileOpts,
4327    ) -> Container {
4328        let mut query = self.selection.select("withoutFile");
4329        query = query.arg("path", path.into());
4330        if let Some(expand) = opts.expand {
4331            query = query.arg("expand", expand);
4332        }
4333        Container {
4334            proc: self.proc.clone(),
4335            selection: query,
4336            graphql_client: self.graphql_client.clone(),
4337        }
4338    }
4339    /// Return a new container spanshot with specified files removed
4340    ///
4341    /// # Arguments
4342    ///
4343    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4344    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4345    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4346        let mut query = self.selection.select("withoutFiles");
4347        query = query.arg(
4348            "paths",
4349            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4350        );
4351        Container {
4352            proc: self.proc.clone(),
4353            selection: query,
4354            graphql_client: self.graphql_client.clone(),
4355        }
4356    }
4357    /// Return a new container spanshot with specified files removed
4358    ///
4359    /// # Arguments
4360    ///
4361    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4362    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4363    pub fn without_files_opts(
4364        &self,
4365        paths: Vec<impl Into<String>>,
4366        opts: ContainerWithoutFilesOpts,
4367    ) -> Container {
4368        let mut query = self.selection.select("withoutFiles");
4369        query = query.arg(
4370            "paths",
4371            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4372        );
4373        if let Some(expand) = opts.expand {
4374            query = query.arg("expand", expand);
4375        }
4376        Container {
4377            proc: self.proc.clone(),
4378            selection: query,
4379            graphql_client: self.graphql_client.clone(),
4380        }
4381    }
4382    /// Retrieves this container minus the given environment label.
4383    ///
4384    /// # Arguments
4385    ///
4386    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4387    pub fn without_label(&self, name: impl Into<String>) -> Container {
4388        let mut query = self.selection.select("withoutLabel");
4389        query = query.arg("name", name.into());
4390        Container {
4391            proc: self.proc.clone(),
4392            selection: query,
4393            graphql_client: self.graphql_client.clone(),
4394        }
4395    }
4396    /// Retrieves this container after unmounting everything at the given path.
4397    ///
4398    /// # Arguments
4399    ///
4400    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4401    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4402    pub fn without_mount(&self, path: impl Into<String>) -> Container {
4403        let mut query = self.selection.select("withoutMount");
4404        query = query.arg("path", path.into());
4405        Container {
4406            proc: self.proc.clone(),
4407            selection: query,
4408            graphql_client: self.graphql_client.clone(),
4409        }
4410    }
4411    /// Retrieves this container after unmounting everything at the given path.
4412    ///
4413    /// # Arguments
4414    ///
4415    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4416    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4417    pub fn without_mount_opts(
4418        &self,
4419        path: impl Into<String>,
4420        opts: ContainerWithoutMountOpts,
4421    ) -> Container {
4422        let mut query = self.selection.select("withoutMount");
4423        query = query.arg("path", path.into());
4424        if let Some(expand) = opts.expand {
4425            query = query.arg("expand", expand);
4426        }
4427        Container {
4428            proc: self.proc.clone(),
4429            selection: query,
4430            graphql_client: self.graphql_client.clone(),
4431        }
4432    }
4433    /// Retrieves this container without the registry authentication of a given address.
4434    ///
4435    /// # Arguments
4436    ///
4437    /// * `address` - Registry's address to remove the authentication from.
4438    ///
4439    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
4440    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4441        let mut query = self.selection.select("withoutRegistryAuth");
4442        query = query.arg("address", address.into());
4443        Container {
4444            proc: self.proc.clone(),
4445            selection: query,
4446            graphql_client: self.graphql_client.clone(),
4447        }
4448    }
4449    /// Retrieves this container minus the given environment variable containing the secret.
4450    ///
4451    /// # Arguments
4452    ///
4453    /// * `name` - The name of the environment variable (e.g., "HOST").
4454    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4455        let mut query = self.selection.select("withoutSecretVariable");
4456        query = query.arg("name", name.into());
4457        Container {
4458            proc: self.proc.clone(),
4459            selection: query,
4460            graphql_client: self.graphql_client.clone(),
4461        }
4462    }
4463    /// Retrieves this container with a previously added Unix socket removed.
4464    ///
4465    /// # Arguments
4466    ///
4467    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4468    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4469    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4470        let mut query = self.selection.select("withoutUnixSocket");
4471        query = query.arg("path", path.into());
4472        Container {
4473            proc: self.proc.clone(),
4474            selection: query,
4475            graphql_client: self.graphql_client.clone(),
4476        }
4477    }
4478    /// Retrieves this container with a previously added Unix socket removed.
4479    ///
4480    /// # Arguments
4481    ///
4482    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4483    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4484    pub fn without_unix_socket_opts(
4485        &self,
4486        path: impl Into<String>,
4487        opts: ContainerWithoutUnixSocketOpts,
4488    ) -> Container {
4489        let mut query = self.selection.select("withoutUnixSocket");
4490        query = query.arg("path", path.into());
4491        if let Some(expand) = opts.expand {
4492            query = query.arg("expand", expand);
4493        }
4494        Container {
4495            proc: self.proc.clone(),
4496            selection: query,
4497            graphql_client: self.graphql_client.clone(),
4498        }
4499    }
4500    /// Retrieves this container with an unset command user.
4501    /// Should default to root.
4502    pub fn without_user(&self) -> Container {
4503        let query = self.selection.select("withoutUser");
4504        Container {
4505            proc: self.proc.clone(),
4506            selection: query,
4507            graphql_client: self.graphql_client.clone(),
4508        }
4509    }
4510    /// Unset the container's working directory.
4511    /// Should default to "/".
4512    pub fn without_workdir(&self) -> Container {
4513        let query = self.selection.select("withoutWorkdir");
4514        Container {
4515            proc: self.proc.clone(),
4516            selection: query,
4517            graphql_client: self.graphql_client.clone(),
4518        }
4519    }
4520    /// Retrieves the working directory for all commands.
4521    pub async fn workdir(&self) -> Result<String, DaggerError> {
4522        let query = self.selection.select("workdir");
4523        query.execute(self.graphql_client.clone()).await
4524    }
4525}
4526#[derive(Clone)]
4527pub struct CurrentModule {
4528    pub proc: Option<Arc<DaggerSessionProc>>,
4529    pub selection: Selection,
4530    pub graphql_client: DynGraphQLClient,
4531}
4532#[derive(Builder, Debug, PartialEq)]
4533pub struct CurrentModuleWorkdirOpts<'a> {
4534    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4535    #[builder(setter(into, strip_option), default)]
4536    pub exclude: Option<Vec<&'a str>>,
4537    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4538    #[builder(setter(into, strip_option), default)]
4539    pub include: Option<Vec<&'a str>>,
4540}
4541impl CurrentModule {
4542    /// A unique identifier for this CurrentModule.
4543    pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
4544        let query = self.selection.select("id");
4545        query.execute(self.graphql_client.clone()).await
4546    }
4547    /// The name of the module being executed in
4548    pub async fn name(&self) -> Result<String, DaggerError> {
4549        let query = self.selection.select("name");
4550        query.execute(self.graphql_client.clone()).await
4551    }
4552    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
4553    pub fn source(&self) -> Directory {
4554        let query = self.selection.select("source");
4555        Directory {
4556            proc: self.proc.clone(),
4557            selection: query,
4558            graphql_client: self.graphql_client.clone(),
4559        }
4560    }
4561    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4562    ///
4563    /// # Arguments
4564    ///
4565    /// * `path` - Location of the directory to access (e.g., ".").
4566    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4567    pub fn workdir(&self, path: impl Into<String>) -> Directory {
4568        let mut query = self.selection.select("workdir");
4569        query = query.arg("path", path.into());
4570        Directory {
4571            proc: self.proc.clone(),
4572            selection: query,
4573            graphql_client: self.graphql_client.clone(),
4574        }
4575    }
4576    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4577    ///
4578    /// # Arguments
4579    ///
4580    /// * `path` - Location of the directory to access (e.g., ".").
4581    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4582    pub fn workdir_opts<'a>(
4583        &self,
4584        path: impl Into<String>,
4585        opts: CurrentModuleWorkdirOpts<'a>,
4586    ) -> Directory {
4587        let mut query = self.selection.select("workdir");
4588        query = query.arg("path", path.into());
4589        if let Some(exclude) = opts.exclude {
4590            query = query.arg("exclude", exclude);
4591        }
4592        if let Some(include) = opts.include {
4593            query = query.arg("include", include);
4594        }
4595        Directory {
4596            proc: self.proc.clone(),
4597            selection: query,
4598            graphql_client: self.graphql_client.clone(),
4599        }
4600    }
4601    /// 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.
4602    ///
4603    /// # Arguments
4604    ///
4605    /// * `path` - Location of the file to retrieve (e.g., "README.md").
4606    pub fn workdir_file(&self, path: impl Into<String>) -> File {
4607        let mut query = self.selection.select("workdirFile");
4608        query = query.arg("path", path.into());
4609        File {
4610            proc: self.proc.clone(),
4611            selection: query,
4612            graphql_client: self.graphql_client.clone(),
4613        }
4614    }
4615}
4616#[derive(Clone)]
4617pub struct Directory {
4618    pub proc: Option<Arc<DaggerSessionProc>>,
4619    pub selection: Selection,
4620    pub graphql_client: DynGraphQLClient,
4621}
4622#[derive(Builder, Debug, PartialEq)]
4623pub struct DirectoryAsModuleOpts<'a> {
4624    /// An optional subpath of the directory which contains the module's configuration file.
4625    /// If not set, the module source code is loaded from the root of the directory.
4626    #[builder(setter(into, strip_option), default)]
4627    pub source_root_path: Option<&'a str>,
4628}
4629#[derive(Builder, Debug, PartialEq)]
4630pub struct DirectoryAsModuleSourceOpts<'a> {
4631    /// An optional subpath of the directory which contains the module's configuration file.
4632    /// If not set, the module source code is loaded from the root of the directory.
4633    #[builder(setter(into, strip_option), default)]
4634    pub source_root_path: Option<&'a str>,
4635}
4636#[derive(Builder, Debug, PartialEq)]
4637pub struct DirectoryDockerBuildOpts<'a> {
4638    /// Build arguments to use in the build.
4639    #[builder(setter(into, strip_option), default)]
4640    pub build_args: Option<Vec<BuildArg>>,
4641    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
4642    #[builder(setter(into, strip_option), default)]
4643    pub dockerfile: Option<&'a str>,
4644    /// If set, skip the automatic init process injected into containers created by RUN statements.
4645    /// 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.
4646    #[builder(setter(into, strip_option), default)]
4647    pub no_init: Option<bool>,
4648    /// The platform to build.
4649    #[builder(setter(into, strip_option), default)]
4650    pub platform: Option<Platform>,
4651    /// Secrets to pass to the build.
4652    /// They will be mounted at /run/secrets/[secret-name].
4653    #[builder(setter(into, strip_option), default)]
4654    pub secrets: Option<Vec<SecretId>>,
4655    /// Target build stage to build.
4656    #[builder(setter(into, strip_option), default)]
4657    pub target: Option<&'a str>,
4658}
4659#[derive(Builder, Debug, PartialEq)]
4660pub struct DirectoryEntriesOpts<'a> {
4661    /// Location of the directory to look at (e.g., "/src").
4662    #[builder(setter(into, strip_option), default)]
4663    pub path: Option<&'a str>,
4664}
4665#[derive(Builder, Debug, PartialEq)]
4666pub struct DirectoryExistsOpts {
4667    /// If specified, do not follow symlinks.
4668    #[builder(setter(into, strip_option), default)]
4669    pub do_not_follow_symlinks: Option<bool>,
4670    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
4671    #[builder(setter(into, strip_option), default)]
4672    pub expected_type: Option<ExistsType>,
4673}
4674#[derive(Builder, Debug, PartialEq)]
4675pub struct DirectoryExportOpts {
4676    /// 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.
4677    #[builder(setter(into, strip_option), default)]
4678    pub wipe: Option<bool>,
4679}
4680#[derive(Builder, Debug, PartialEq)]
4681pub struct DirectoryFilterOpts<'a> {
4682    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
4683    #[builder(setter(into, strip_option), default)]
4684    pub exclude: Option<Vec<&'a str>>,
4685    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
4686    #[builder(setter(into, strip_option), default)]
4687    pub include: Option<Vec<&'a str>>,
4688}
4689#[derive(Builder, Debug, PartialEq)]
4690pub struct DirectorySearchOpts<'a> {
4691    /// Allow the . pattern to match newlines in multiline mode.
4692    #[builder(setter(into, strip_option), default)]
4693    pub dotall: Option<bool>,
4694    /// Only return matching files, not lines and content
4695    #[builder(setter(into, strip_option), default)]
4696    pub files_only: Option<bool>,
4697    /// Glob patterns to match (e.g., "*.md")
4698    #[builder(setter(into, strip_option), default)]
4699    pub globs: Option<Vec<&'a str>>,
4700    /// Enable case-insensitive matching.
4701    #[builder(setter(into, strip_option), default)]
4702    pub insensitive: Option<bool>,
4703    /// Limit the number of results to return
4704    #[builder(setter(into, strip_option), default)]
4705    pub limit: Option<isize>,
4706    /// Interpret the pattern as a literal string instead of a regular expression.
4707    #[builder(setter(into, strip_option), default)]
4708    pub literal: Option<bool>,
4709    /// Enable searching across multiple lines.
4710    #[builder(setter(into, strip_option), default)]
4711    pub multiline: Option<bool>,
4712    /// Directory or file paths to search
4713    #[builder(setter(into, strip_option), default)]
4714    pub paths: Option<Vec<&'a str>>,
4715    /// Skip hidden files (files starting with .).
4716    #[builder(setter(into, strip_option), default)]
4717    pub skip_hidden: Option<bool>,
4718    /// Honor .gitignore, .ignore, and .rgignore files.
4719    #[builder(setter(into, strip_option), default)]
4720    pub skip_ignored: Option<bool>,
4721}
4722#[derive(Builder, Debug, PartialEq)]
4723pub struct DirectoryTerminalOpts<'a> {
4724    /// If set, override the container's default terminal command and invoke these command arguments instead.
4725    #[builder(setter(into, strip_option), default)]
4726    pub cmd: Option<Vec<&'a str>>,
4727    /// If set, override the default container used for the terminal.
4728    #[builder(setter(into, strip_option), default)]
4729    pub container: Option<ContainerId>,
4730    /// Provides Dagger access to the executed command.
4731    #[builder(setter(into, strip_option), default)]
4732    pub experimental_privileged_nesting: Option<bool>,
4733    /// 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.
4734    #[builder(setter(into, strip_option), default)]
4735    pub insecure_root_capabilities: Option<bool>,
4736}
4737#[derive(Builder, Debug, PartialEq)]
4738pub struct DirectoryWithDirectoryOpts<'a> {
4739    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4740    #[builder(setter(into, strip_option), default)]
4741    pub exclude: Option<Vec<&'a str>>,
4742    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4743    #[builder(setter(into, strip_option), default)]
4744    pub include: Option<Vec<&'a str>>,
4745}
4746#[derive(Builder, Debug, PartialEq)]
4747pub struct DirectoryWithFileOpts {
4748    /// Permission given to the copied file (e.g., 0600).
4749    #[builder(setter(into, strip_option), default)]
4750    pub permissions: Option<isize>,
4751}
4752#[derive(Builder, Debug, PartialEq)]
4753pub struct DirectoryWithFilesOpts {
4754    /// Permission given to the copied files (e.g., 0600).
4755    #[builder(setter(into, strip_option), default)]
4756    pub permissions: Option<isize>,
4757}
4758#[derive(Builder, Debug, PartialEq)]
4759pub struct DirectoryWithNewDirectoryOpts {
4760    /// Permission granted to the created directory (e.g., 0777).
4761    #[builder(setter(into, strip_option), default)]
4762    pub permissions: Option<isize>,
4763}
4764#[derive(Builder, Debug, PartialEq)]
4765pub struct DirectoryWithNewFileOpts {
4766    /// Permissions of the new file. Example: 0600
4767    #[builder(setter(into, strip_option), default)]
4768    pub permissions: Option<isize>,
4769}
4770impl Directory {
4771    /// Converts this directory to a local git repository
4772    pub fn as_git(&self) -> GitRepository {
4773        let query = self.selection.select("asGit");
4774        GitRepository {
4775            proc: self.proc.clone(),
4776            selection: query,
4777            graphql_client: self.graphql_client.clone(),
4778        }
4779    }
4780    /// Load the directory as a Dagger module source
4781    ///
4782    /// # Arguments
4783    ///
4784    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4785    pub fn as_module(&self) -> Module {
4786        let query = self.selection.select("asModule");
4787        Module {
4788            proc: self.proc.clone(),
4789            selection: query,
4790            graphql_client: self.graphql_client.clone(),
4791        }
4792    }
4793    /// Load the directory as a Dagger module source
4794    ///
4795    /// # Arguments
4796    ///
4797    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4798    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4799        let mut query = self.selection.select("asModule");
4800        if let Some(source_root_path) = opts.source_root_path {
4801            query = query.arg("sourceRootPath", source_root_path);
4802        }
4803        Module {
4804            proc: self.proc.clone(),
4805            selection: query,
4806            graphql_client: self.graphql_client.clone(),
4807        }
4808    }
4809    /// Load the directory as a Dagger module source
4810    ///
4811    /// # Arguments
4812    ///
4813    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4814    pub fn as_module_source(&self) -> ModuleSource {
4815        let query = self.selection.select("asModuleSource");
4816        ModuleSource {
4817            proc: self.proc.clone(),
4818            selection: query,
4819            graphql_client: self.graphql_client.clone(),
4820        }
4821    }
4822    /// Load the directory as a Dagger module source
4823    ///
4824    /// # Arguments
4825    ///
4826    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4827    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4828        let mut query = self.selection.select("asModuleSource");
4829        if let Some(source_root_path) = opts.source_root_path {
4830            query = query.arg("sourceRootPath", source_root_path);
4831        }
4832        ModuleSource {
4833            proc: self.proc.clone(),
4834            selection: query,
4835            graphql_client: self.graphql_client.clone(),
4836        }
4837    }
4838    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
4839    ///
4840    /// # Arguments
4841    ///
4842    /// * `other` - The directory to compare against
4843    pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
4844        let mut query = self.selection.select("diff");
4845        query = query.arg_lazy(
4846            "other",
4847            Box::new(move || {
4848                let other = other.clone();
4849                Box::pin(async move { other.into_id().await.unwrap().quote() })
4850            }),
4851        );
4852        Directory {
4853            proc: self.proc.clone(),
4854            selection: query,
4855            graphql_client: self.graphql_client.clone(),
4856        }
4857    }
4858    /// 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.
4859    pub async fn digest(&self) -> Result<String, DaggerError> {
4860        let query = self.selection.select("digest");
4861        query.execute(self.graphql_client.clone()).await
4862    }
4863    /// Retrieves a directory at the given path.
4864    ///
4865    /// # Arguments
4866    ///
4867    /// * `path` - Location of the directory to retrieve. Example: "/src"
4868    pub fn directory(&self, path: impl Into<String>) -> Directory {
4869        let mut query = self.selection.select("directory");
4870        query = query.arg("path", path.into());
4871        Directory {
4872            proc: self.proc.clone(),
4873            selection: query,
4874            graphql_client: self.graphql_client.clone(),
4875        }
4876    }
4877    /// 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.
4878    ///
4879    /// # Arguments
4880    ///
4881    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4882    pub fn docker_build(&self) -> Container {
4883        let query = self.selection.select("dockerBuild");
4884        Container {
4885            proc: self.proc.clone(),
4886            selection: query,
4887            graphql_client: self.graphql_client.clone(),
4888        }
4889    }
4890    /// 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.
4891    ///
4892    /// # Arguments
4893    ///
4894    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4895    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
4896        let mut query = self.selection.select("dockerBuild");
4897        if let Some(dockerfile) = opts.dockerfile {
4898            query = query.arg("dockerfile", dockerfile);
4899        }
4900        if let Some(platform) = opts.platform {
4901            query = query.arg("platform", platform);
4902        }
4903        if let Some(build_args) = opts.build_args {
4904            query = query.arg("buildArgs", build_args);
4905        }
4906        if let Some(target) = opts.target {
4907            query = query.arg("target", target);
4908        }
4909        if let Some(secrets) = opts.secrets {
4910            query = query.arg("secrets", secrets);
4911        }
4912        if let Some(no_init) = opts.no_init {
4913            query = query.arg("noInit", no_init);
4914        }
4915        Container {
4916            proc: self.proc.clone(),
4917            selection: query,
4918            graphql_client: self.graphql_client.clone(),
4919        }
4920    }
4921    /// Returns a list of files and directories at the given path.
4922    ///
4923    /// # Arguments
4924    ///
4925    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4926    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
4927        let query = self.selection.select("entries");
4928        query.execute(self.graphql_client.clone()).await
4929    }
4930    /// Returns a list of files and directories at the given path.
4931    ///
4932    /// # Arguments
4933    ///
4934    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4935    pub async fn entries_opts<'a>(
4936        &self,
4937        opts: DirectoryEntriesOpts<'a>,
4938    ) -> Result<Vec<String>, DaggerError> {
4939        let mut query = self.selection.select("entries");
4940        if let Some(path) = opts.path {
4941            query = query.arg("path", path);
4942        }
4943        query.execute(self.graphql_client.clone()).await
4944    }
4945    /// check if a file or directory exists
4946    ///
4947    /// # Arguments
4948    ///
4949    /// * `path` - Path to check (e.g., "/file.txt").
4950    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4951    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
4952        let mut query = self.selection.select("exists");
4953        query = query.arg("path", path.into());
4954        query.execute(self.graphql_client.clone()).await
4955    }
4956    /// check if a file or directory exists
4957    ///
4958    /// # Arguments
4959    ///
4960    /// * `path` - Path to check (e.g., "/file.txt").
4961    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4962    pub async fn exists_opts(
4963        &self,
4964        path: impl Into<String>,
4965        opts: DirectoryExistsOpts,
4966    ) -> Result<bool, DaggerError> {
4967        let mut query = self.selection.select("exists");
4968        query = query.arg("path", path.into());
4969        if let Some(expected_type) = opts.expected_type {
4970            query = query.arg("expectedType", expected_type);
4971        }
4972        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
4973            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
4974        }
4975        query.execute(self.graphql_client.clone()).await
4976    }
4977    /// Writes the contents of the directory to a path on the host.
4978    ///
4979    /// # Arguments
4980    ///
4981    /// * `path` - Location of the copied directory (e.g., "logs/").
4982    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4983    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4984        let mut query = self.selection.select("export");
4985        query = query.arg("path", path.into());
4986        query.execute(self.graphql_client.clone()).await
4987    }
4988    /// Writes the contents of the directory to a path on the host.
4989    ///
4990    /// # Arguments
4991    ///
4992    /// * `path` - Location of the copied directory (e.g., "logs/").
4993    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4994    pub async fn export_opts(
4995        &self,
4996        path: impl Into<String>,
4997        opts: DirectoryExportOpts,
4998    ) -> Result<String, DaggerError> {
4999        let mut query = self.selection.select("export");
5000        query = query.arg("path", path.into());
5001        if let Some(wipe) = opts.wipe {
5002            query = query.arg("wipe", wipe);
5003        }
5004        query.execute(self.graphql_client.clone()).await
5005    }
5006    /// Retrieve a file at the given path.
5007    ///
5008    /// # Arguments
5009    ///
5010    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5011    pub fn file(&self, path: impl Into<String>) -> File {
5012        let mut query = self.selection.select("file");
5013        query = query.arg("path", path.into());
5014        File {
5015            proc: self.proc.clone(),
5016            selection: query,
5017            graphql_client: self.graphql_client.clone(),
5018        }
5019    }
5020    /// Return a snapshot with some paths included or excluded
5021    ///
5022    /// # Arguments
5023    ///
5024    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5025    pub fn filter(&self) -> Directory {
5026        let query = self.selection.select("filter");
5027        Directory {
5028            proc: self.proc.clone(),
5029            selection: query,
5030            graphql_client: self.graphql_client.clone(),
5031        }
5032    }
5033    /// Return a snapshot with some paths included or excluded
5034    ///
5035    /// # Arguments
5036    ///
5037    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5038    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5039        let mut query = self.selection.select("filter");
5040        if let Some(exclude) = opts.exclude {
5041            query = query.arg("exclude", exclude);
5042        }
5043        if let Some(include) = opts.include {
5044            query = query.arg("include", include);
5045        }
5046        Directory {
5047            proc: self.proc.clone(),
5048            selection: query,
5049            graphql_client: self.graphql_client.clone(),
5050        }
5051    }
5052    /// Returns a list of files and directories that matche the given pattern.
5053    ///
5054    /// # Arguments
5055    ///
5056    /// * `pattern` - Pattern to match (e.g., "*.md").
5057    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5058        let mut query = self.selection.select("glob");
5059        query = query.arg("pattern", pattern.into());
5060        query.execute(self.graphql_client.clone()).await
5061    }
5062    /// A unique identifier for this Directory.
5063    pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
5064        let query = self.selection.select("id");
5065        query.execute(self.graphql_client.clone()).await
5066    }
5067    /// Returns the name of the directory.
5068    pub async fn name(&self) -> Result<String, DaggerError> {
5069        let query = self.selection.select("name");
5070        query.execute(self.graphql_client.clone()).await
5071    }
5072    /// Searches for content matching the given regular expression or literal string.
5073    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5074    ///
5075    /// # Arguments
5076    ///
5077    /// * `pattern` - The text to match.
5078    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5079    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
5080        let mut query = self.selection.select("search");
5081        query = query.arg("pattern", pattern.into());
5082        vec![SearchResult {
5083            proc: self.proc.clone(),
5084            selection: query,
5085            graphql_client: self.graphql_client.clone(),
5086        }]
5087    }
5088    /// Searches for content matching the given regular expression or literal string.
5089    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5090    ///
5091    /// # Arguments
5092    ///
5093    /// * `pattern` - The text to match.
5094    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5095    pub fn search_opts<'a>(
5096        &self,
5097        pattern: impl Into<String>,
5098        opts: DirectorySearchOpts<'a>,
5099    ) -> Vec<SearchResult> {
5100        let mut query = self.selection.select("search");
5101        query = query.arg("pattern", pattern.into());
5102        if let Some(paths) = opts.paths {
5103            query = query.arg("paths", paths);
5104        }
5105        if let Some(globs) = opts.globs {
5106            query = query.arg("globs", globs);
5107        }
5108        if let Some(literal) = opts.literal {
5109            query = query.arg("literal", literal);
5110        }
5111        if let Some(multiline) = opts.multiline {
5112            query = query.arg("multiline", multiline);
5113        }
5114        if let Some(dotall) = opts.dotall {
5115            query = query.arg("dotall", dotall);
5116        }
5117        if let Some(insensitive) = opts.insensitive {
5118            query = query.arg("insensitive", insensitive);
5119        }
5120        if let Some(skip_ignored) = opts.skip_ignored {
5121            query = query.arg("skipIgnored", skip_ignored);
5122        }
5123        if let Some(skip_hidden) = opts.skip_hidden {
5124            query = query.arg("skipHidden", skip_hidden);
5125        }
5126        if let Some(files_only) = opts.files_only {
5127            query = query.arg("filesOnly", files_only);
5128        }
5129        if let Some(limit) = opts.limit {
5130            query = query.arg("limit", limit);
5131        }
5132        vec![SearchResult {
5133            proc: self.proc.clone(),
5134            selection: query,
5135            graphql_client: self.graphql_client.clone(),
5136        }]
5137    }
5138    /// Force evaluation in the engine.
5139    pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
5140        let query = self.selection.select("sync");
5141        query.execute(self.graphql_client.clone()).await
5142    }
5143    /// Opens an interactive terminal in new container with this directory mounted inside.
5144    ///
5145    /// # Arguments
5146    ///
5147    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5148    pub fn terminal(&self) -> Directory {
5149        let query = self.selection.select("terminal");
5150        Directory {
5151            proc: self.proc.clone(),
5152            selection: query,
5153            graphql_client: self.graphql_client.clone(),
5154        }
5155    }
5156    /// Opens an interactive terminal in new container with this directory mounted inside.
5157    ///
5158    /// # Arguments
5159    ///
5160    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5161    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5162        let mut query = self.selection.select("terminal");
5163        if let Some(container) = opts.container {
5164            query = query.arg("container", container);
5165        }
5166        if let Some(cmd) = opts.cmd {
5167            query = query.arg("cmd", cmd);
5168        }
5169        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5170            query = query.arg(
5171                "experimentalPrivilegedNesting",
5172                experimental_privileged_nesting,
5173            );
5174        }
5175        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5176            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5177        }
5178        Directory {
5179            proc: self.proc.clone(),
5180            selection: query,
5181            graphql_client: self.graphql_client.clone(),
5182        }
5183    }
5184    /// Return a snapshot with a directory added
5185    ///
5186    /// # Arguments
5187    ///
5188    /// * `path` - Location of the written directory (e.g., "/src/").
5189    /// * `directory` - Identifier of the directory to copy.
5190    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5191    pub fn with_directory(
5192        &self,
5193        path: impl Into<String>,
5194        directory: impl IntoID<DirectoryId>,
5195    ) -> Directory {
5196        let mut query = self.selection.select("withDirectory");
5197        query = query.arg("path", path.into());
5198        query = query.arg_lazy(
5199            "directory",
5200            Box::new(move || {
5201                let directory = directory.clone();
5202                Box::pin(async move { directory.into_id().await.unwrap().quote() })
5203            }),
5204        );
5205        Directory {
5206            proc: self.proc.clone(),
5207            selection: query,
5208            graphql_client: self.graphql_client.clone(),
5209        }
5210    }
5211    /// Return a snapshot with a directory added
5212    ///
5213    /// # Arguments
5214    ///
5215    /// * `path` - Location of the written directory (e.g., "/src/").
5216    /// * `directory` - Identifier of the directory to copy.
5217    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5218    pub fn with_directory_opts<'a>(
5219        &self,
5220        path: impl Into<String>,
5221        directory: impl IntoID<DirectoryId>,
5222        opts: DirectoryWithDirectoryOpts<'a>,
5223    ) -> Directory {
5224        let mut query = self.selection.select("withDirectory");
5225        query = query.arg("path", path.into());
5226        query = query.arg_lazy(
5227            "directory",
5228            Box::new(move || {
5229                let directory = directory.clone();
5230                Box::pin(async move { directory.into_id().await.unwrap().quote() })
5231            }),
5232        );
5233        if let Some(exclude) = opts.exclude {
5234            query = query.arg("exclude", exclude);
5235        }
5236        if let Some(include) = opts.include {
5237            query = query.arg("include", include);
5238        }
5239        Directory {
5240            proc: self.proc.clone(),
5241            selection: query,
5242            graphql_client: self.graphql_client.clone(),
5243        }
5244    }
5245    /// Retrieves this directory plus the contents of the given file copied to the given path.
5246    ///
5247    /// # Arguments
5248    ///
5249    /// * `path` - Location of the copied file (e.g., "/file.txt").
5250    /// * `source` - Identifier of the file to copy.
5251    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5252    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
5253        let mut query = self.selection.select("withFile");
5254        query = query.arg("path", path.into());
5255        query = query.arg_lazy(
5256            "source",
5257            Box::new(move || {
5258                let source = source.clone();
5259                Box::pin(async move { source.into_id().await.unwrap().quote() })
5260            }),
5261        );
5262        Directory {
5263            proc: self.proc.clone(),
5264            selection: query,
5265            graphql_client: self.graphql_client.clone(),
5266        }
5267    }
5268    /// Retrieves this directory plus the contents of the given file copied to the given path.
5269    ///
5270    /// # Arguments
5271    ///
5272    /// * `path` - Location of the copied file (e.g., "/file.txt").
5273    /// * `source` - Identifier of the file to copy.
5274    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5275    pub fn with_file_opts(
5276        &self,
5277        path: impl Into<String>,
5278        source: impl IntoID<FileId>,
5279        opts: DirectoryWithFileOpts,
5280    ) -> Directory {
5281        let mut query = self.selection.select("withFile");
5282        query = query.arg("path", path.into());
5283        query = query.arg_lazy(
5284            "source",
5285            Box::new(move || {
5286                let source = source.clone();
5287                Box::pin(async move { source.into_id().await.unwrap().quote() })
5288            }),
5289        );
5290        if let Some(permissions) = opts.permissions {
5291            query = query.arg("permissions", permissions);
5292        }
5293        Directory {
5294            proc: self.proc.clone(),
5295            selection: query,
5296            graphql_client: self.graphql_client.clone(),
5297        }
5298    }
5299    /// Retrieves this directory plus the contents of the given files copied to the given path.
5300    ///
5301    /// # Arguments
5302    ///
5303    /// * `path` - Location where copied files should be placed (e.g., "/src").
5304    /// * `sources` - Identifiers of the files to copy.
5305    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5306    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
5307        let mut query = self.selection.select("withFiles");
5308        query = query.arg("path", path.into());
5309        query = query.arg("sources", sources);
5310        Directory {
5311            proc: self.proc.clone(),
5312            selection: query,
5313            graphql_client: self.graphql_client.clone(),
5314        }
5315    }
5316    /// Retrieves this directory plus the contents of the given files copied to the given path.
5317    ///
5318    /// # Arguments
5319    ///
5320    /// * `path` - Location where copied files should be placed (e.g., "/src").
5321    /// * `sources` - Identifiers of the files to copy.
5322    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5323    pub fn with_files_opts(
5324        &self,
5325        path: impl Into<String>,
5326        sources: Vec<FileId>,
5327        opts: DirectoryWithFilesOpts,
5328    ) -> Directory {
5329        let mut query = self.selection.select("withFiles");
5330        query = query.arg("path", path.into());
5331        query = query.arg("sources", sources);
5332        if let Some(permissions) = opts.permissions {
5333            query = query.arg("permissions", permissions);
5334        }
5335        Directory {
5336            proc: self.proc.clone(),
5337            selection: query,
5338            graphql_client: self.graphql_client.clone(),
5339        }
5340    }
5341    /// Retrieves this directory plus a new directory created at the given path.
5342    ///
5343    /// # Arguments
5344    ///
5345    /// * `path` - Location of the directory created (e.g., "/logs").
5346    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5347    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5348        let mut query = self.selection.select("withNewDirectory");
5349        query = query.arg("path", path.into());
5350        Directory {
5351            proc: self.proc.clone(),
5352            selection: query,
5353            graphql_client: self.graphql_client.clone(),
5354        }
5355    }
5356    /// Retrieves this directory plus a new directory created at the given path.
5357    ///
5358    /// # Arguments
5359    ///
5360    /// * `path` - Location of the directory created (e.g., "/logs").
5361    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5362    pub fn with_new_directory_opts(
5363        &self,
5364        path: impl Into<String>,
5365        opts: DirectoryWithNewDirectoryOpts,
5366    ) -> Directory {
5367        let mut query = self.selection.select("withNewDirectory");
5368        query = query.arg("path", path.into());
5369        if let Some(permissions) = opts.permissions {
5370            query = query.arg("permissions", permissions);
5371        }
5372        Directory {
5373            proc: self.proc.clone(),
5374            selection: query,
5375            graphql_client: self.graphql_client.clone(),
5376        }
5377    }
5378    /// Return a snapshot with a new file added
5379    ///
5380    /// # Arguments
5381    ///
5382    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5383    /// * `contents` - Contents of the new file. Example: "Hello world!"
5384    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5385    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5386        let mut query = self.selection.select("withNewFile");
5387        query = query.arg("path", path.into());
5388        query = query.arg("contents", contents.into());
5389        Directory {
5390            proc: self.proc.clone(),
5391            selection: query,
5392            graphql_client: self.graphql_client.clone(),
5393        }
5394    }
5395    /// Return a snapshot with a new file added
5396    ///
5397    /// # Arguments
5398    ///
5399    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5400    /// * `contents` - Contents of the new file. Example: "Hello world!"
5401    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5402    pub fn with_new_file_opts(
5403        &self,
5404        path: impl Into<String>,
5405        contents: impl Into<String>,
5406        opts: DirectoryWithNewFileOpts,
5407    ) -> Directory {
5408        let mut query = self.selection.select("withNewFile");
5409        query = query.arg("path", path.into());
5410        query = query.arg("contents", contents.into());
5411        if let Some(permissions) = opts.permissions {
5412            query = query.arg("permissions", permissions);
5413        }
5414        Directory {
5415            proc: self.proc.clone(),
5416            selection: query,
5417            graphql_client: self.graphql_client.clone(),
5418        }
5419    }
5420    /// Retrieves this directory with the given Git-compatible patch applied.
5421    ///
5422    /// # Arguments
5423    ///
5424    /// * `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").
5425    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5426        let mut query = self.selection.select("withPatch");
5427        query = query.arg("patch", patch.into());
5428        Directory {
5429            proc: self.proc.clone(),
5430            selection: query,
5431            graphql_client: self.graphql_client.clone(),
5432        }
5433    }
5434    /// Return a snapshot with a symlink
5435    ///
5436    /// # Arguments
5437    ///
5438    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5439    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5440    pub fn with_symlink(
5441        &self,
5442        target: impl Into<String>,
5443        link_name: impl Into<String>,
5444    ) -> Directory {
5445        let mut query = self.selection.select("withSymlink");
5446        query = query.arg("target", target.into());
5447        query = query.arg("linkName", link_name.into());
5448        Directory {
5449            proc: self.proc.clone(),
5450            selection: query,
5451            graphql_client: self.graphql_client.clone(),
5452        }
5453    }
5454    /// Retrieves this directory with all file/dir timestamps set to the given time.
5455    ///
5456    /// # Arguments
5457    ///
5458    /// * `timestamp` - Timestamp to set dir/files in.
5459    ///
5460    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
5461    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5462        let mut query = self.selection.select("withTimestamps");
5463        query = query.arg("timestamp", timestamp);
5464        Directory {
5465            proc: self.proc.clone(),
5466            selection: query,
5467            graphql_client: self.graphql_client.clone(),
5468        }
5469    }
5470    /// Return a snapshot with a subdirectory removed
5471    ///
5472    /// # Arguments
5473    ///
5474    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
5475    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5476        let mut query = self.selection.select("withoutDirectory");
5477        query = query.arg("path", path.into());
5478        Directory {
5479            proc: self.proc.clone(),
5480            selection: query,
5481            graphql_client: self.graphql_client.clone(),
5482        }
5483    }
5484    /// Return a snapshot with a file removed
5485    ///
5486    /// # Arguments
5487    ///
5488    /// * `path` - Path of the file to remove (e.g., "/file.txt").
5489    pub fn without_file(&self, path: impl Into<String>) -> Directory {
5490        let mut query = self.selection.select("withoutFile");
5491        query = query.arg("path", path.into());
5492        Directory {
5493            proc: self.proc.clone(),
5494            selection: query,
5495            graphql_client: self.graphql_client.clone(),
5496        }
5497    }
5498    /// Return a snapshot with files removed
5499    ///
5500    /// # Arguments
5501    ///
5502    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
5503    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5504        let mut query = self.selection.select("withoutFiles");
5505        query = query.arg(
5506            "paths",
5507            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5508        );
5509        Directory {
5510            proc: self.proc.clone(),
5511            selection: query,
5512            graphql_client: self.graphql_client.clone(),
5513        }
5514    }
5515}
5516#[derive(Clone)]
5517pub struct Engine {
5518    pub proc: Option<Arc<DaggerSessionProc>>,
5519    pub selection: Selection,
5520    pub graphql_client: DynGraphQLClient,
5521}
5522impl Engine {
5523    /// A unique identifier for this Engine.
5524    pub async fn id(&self) -> Result<EngineId, DaggerError> {
5525        let query = self.selection.select("id");
5526        query.execute(self.graphql_client.clone()).await
5527    }
5528    /// The local (on-disk) cache for the Dagger engine
5529    pub fn local_cache(&self) -> EngineCache {
5530        let query = self.selection.select("localCache");
5531        EngineCache {
5532            proc: self.proc.clone(),
5533            selection: query,
5534            graphql_client: self.graphql_client.clone(),
5535        }
5536    }
5537}
5538#[derive(Clone)]
5539pub struct EngineCache {
5540    pub proc: Option<Arc<DaggerSessionProc>>,
5541    pub selection: Selection,
5542    pub graphql_client: DynGraphQLClient,
5543}
5544#[derive(Builder, Debug, PartialEq)]
5545pub struct EngineCacheEntrySetOpts<'a> {
5546    #[builder(setter(into, strip_option), default)]
5547    pub key: Option<&'a str>,
5548}
5549#[derive(Builder, Debug, PartialEq)]
5550pub struct EngineCachePruneOpts {
5551    /// Use the engine-wide default pruning policy if true, otherwise prune the whole cache of any releasable entries.
5552    #[builder(setter(into, strip_option), default)]
5553    pub use_default_policy: Option<bool>,
5554}
5555impl EngineCache {
5556    /// The current set of entries in the cache
5557    ///
5558    /// # Arguments
5559    ///
5560    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5561    pub fn entry_set(&self) -> EngineCacheEntrySet {
5562        let query = self.selection.select("entrySet");
5563        EngineCacheEntrySet {
5564            proc: self.proc.clone(),
5565            selection: query,
5566            graphql_client: self.graphql_client.clone(),
5567        }
5568    }
5569    /// The current set of entries in the cache
5570    ///
5571    /// # Arguments
5572    ///
5573    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5574    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5575        let mut query = self.selection.select("entrySet");
5576        if let Some(key) = opts.key {
5577            query = query.arg("key", key);
5578        }
5579        EngineCacheEntrySet {
5580            proc: self.proc.clone(),
5581            selection: query,
5582            graphql_client: self.graphql_client.clone(),
5583        }
5584    }
5585    /// A unique identifier for this EngineCache.
5586    pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
5587        let query = self.selection.select("id");
5588        query.execute(self.graphql_client.clone()).await
5589    }
5590    /// The maximum bytes to keep in the cache without pruning, after which automatic pruning may kick in.
5591    pub async fn keep_bytes(&self) -> Result<isize, DaggerError> {
5592        let query = self.selection.select("keepBytes");
5593        query.execute(self.graphql_client.clone()).await
5594    }
5595    /// The maximum bytes to keep in the cache without pruning.
5596    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5597        let query = self.selection.select("maxUsedSpace");
5598        query.execute(self.graphql_client.clone()).await
5599    }
5600    /// The target amount of free disk space the garbage collector will attempt to leave.
5601    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5602        let query = self.selection.select("minFreeSpace");
5603        query.execute(self.graphql_client.clone()).await
5604    }
5605    /// Prune the cache of releaseable entries
5606    ///
5607    /// # Arguments
5608    ///
5609    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5610    pub async fn prune(&self) -> Result<Void, DaggerError> {
5611        let query = self.selection.select("prune");
5612        query.execute(self.graphql_client.clone()).await
5613    }
5614    /// Prune the cache of releaseable entries
5615    ///
5616    /// # Arguments
5617    ///
5618    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5619    pub async fn prune_opts(&self, opts: EngineCachePruneOpts) -> Result<Void, DaggerError> {
5620        let mut query = self.selection.select("prune");
5621        if let Some(use_default_policy) = opts.use_default_policy {
5622            query = query.arg("useDefaultPolicy", use_default_policy);
5623        }
5624        query.execute(self.graphql_client.clone()).await
5625    }
5626    /// The minimum amount of disk space this policy is guaranteed to retain.
5627    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
5628        let query = self.selection.select("reservedSpace");
5629        query.execute(self.graphql_client.clone()).await
5630    }
5631    /// The target number of bytes to keep when pruning.
5632    pub async fn target_space(&self) -> Result<isize, DaggerError> {
5633        let query = self.selection.select("targetSpace");
5634        query.execute(self.graphql_client.clone()).await
5635    }
5636}
5637#[derive(Clone)]
5638pub struct EngineCacheEntry {
5639    pub proc: Option<Arc<DaggerSessionProc>>,
5640    pub selection: Selection,
5641    pub graphql_client: DynGraphQLClient,
5642}
5643impl EngineCacheEntry {
5644    /// Whether the cache entry is actively being used.
5645    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
5646        let query = self.selection.select("activelyUsed");
5647        query.execute(self.graphql_client.clone()).await
5648    }
5649    /// The time the cache entry was created, in Unix nanoseconds.
5650    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
5651        let query = self.selection.select("createdTimeUnixNano");
5652        query.execute(self.graphql_client.clone()).await
5653    }
5654    /// The description of the cache entry.
5655    pub async fn description(&self) -> Result<String, DaggerError> {
5656        let query = self.selection.select("description");
5657        query.execute(self.graphql_client.clone()).await
5658    }
5659    /// The disk space used by the cache entry.
5660    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5661        let query = self.selection.select("diskSpaceBytes");
5662        query.execute(self.graphql_client.clone()).await
5663    }
5664    /// A unique identifier for this EngineCacheEntry.
5665    pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
5666        let query = self.selection.select("id");
5667        query.execute(self.graphql_client.clone()).await
5668    }
5669    /// The most recent time the cache entry was used, in Unix nanoseconds.
5670    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
5671        let query = self.selection.select("mostRecentUseTimeUnixNano");
5672        query.execute(self.graphql_client.clone()).await
5673    }
5674}
5675#[derive(Clone)]
5676pub struct EngineCacheEntrySet {
5677    pub proc: Option<Arc<DaggerSessionProc>>,
5678    pub selection: Selection,
5679    pub graphql_client: DynGraphQLClient,
5680}
5681impl EngineCacheEntrySet {
5682    /// The total disk space used by the cache entries in this set.
5683    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
5684        let query = self.selection.select("diskSpaceBytes");
5685        query.execute(self.graphql_client.clone()).await
5686    }
5687    /// The list of individual cache entries in the set
5688    pub fn entries(&self) -> Vec<EngineCacheEntry> {
5689        let query = self.selection.select("entries");
5690        vec![EngineCacheEntry {
5691            proc: self.proc.clone(),
5692            selection: query,
5693            graphql_client: self.graphql_client.clone(),
5694        }]
5695    }
5696    /// The number of cache entries in this set.
5697    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
5698        let query = self.selection.select("entryCount");
5699        query.execute(self.graphql_client.clone()).await
5700    }
5701    /// A unique identifier for this EngineCacheEntrySet.
5702    pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
5703        let query = self.selection.select("id");
5704        query.execute(self.graphql_client.clone()).await
5705    }
5706}
5707#[derive(Clone)]
5708pub struct EnumTypeDef {
5709    pub proc: Option<Arc<DaggerSessionProc>>,
5710    pub selection: Selection,
5711    pub graphql_client: DynGraphQLClient,
5712}
5713impl EnumTypeDef {
5714    /// A doc string for the enum, if any.
5715    pub async fn description(&self) -> Result<String, DaggerError> {
5716        let query = self.selection.select("description");
5717        query.execute(self.graphql_client.clone()).await
5718    }
5719    /// A unique identifier for this EnumTypeDef.
5720    pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
5721        let query = self.selection.select("id");
5722        query.execute(self.graphql_client.clone()).await
5723    }
5724    /// The members of the enum.
5725    pub fn members(&self) -> Vec<EnumValueTypeDef> {
5726        let query = self.selection.select("members");
5727        vec![EnumValueTypeDef {
5728            proc: self.proc.clone(),
5729            selection: query,
5730            graphql_client: self.graphql_client.clone(),
5731        }]
5732    }
5733    /// The name of the enum.
5734    pub async fn name(&self) -> Result<String, DaggerError> {
5735        let query = self.selection.select("name");
5736        query.execute(self.graphql_client.clone()).await
5737    }
5738    /// The location of this enum declaration.
5739    pub fn source_map(&self) -> SourceMap {
5740        let query = self.selection.select("sourceMap");
5741        SourceMap {
5742            proc: self.proc.clone(),
5743            selection: query,
5744            graphql_client: self.graphql_client.clone(),
5745        }
5746    }
5747    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
5748    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
5749        let query = self.selection.select("sourceModuleName");
5750        query.execute(self.graphql_client.clone()).await
5751    }
5752    pub fn values(&self) -> Vec<EnumValueTypeDef> {
5753        let query = self.selection.select("values");
5754        vec![EnumValueTypeDef {
5755            proc: self.proc.clone(),
5756            selection: query,
5757            graphql_client: self.graphql_client.clone(),
5758        }]
5759    }
5760}
5761#[derive(Clone)]
5762pub struct EnumValueTypeDef {
5763    pub proc: Option<Arc<DaggerSessionProc>>,
5764    pub selection: Selection,
5765    pub graphql_client: DynGraphQLClient,
5766}
5767impl EnumValueTypeDef {
5768    /// A doc string for the enum member, if any.
5769    pub async fn description(&self) -> Result<String, DaggerError> {
5770        let query = self.selection.select("description");
5771        query.execute(self.graphql_client.clone()).await
5772    }
5773    /// A unique identifier for this EnumValueTypeDef.
5774    pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
5775        let query = self.selection.select("id");
5776        query.execute(self.graphql_client.clone()).await
5777    }
5778    /// The name of the enum member.
5779    pub async fn name(&self) -> Result<String, DaggerError> {
5780        let query = self.selection.select("name");
5781        query.execute(self.graphql_client.clone()).await
5782    }
5783    /// The location of this enum member declaration.
5784    pub fn source_map(&self) -> SourceMap {
5785        let query = self.selection.select("sourceMap");
5786        SourceMap {
5787            proc: self.proc.clone(),
5788            selection: query,
5789            graphql_client: self.graphql_client.clone(),
5790        }
5791    }
5792    /// The value of the enum member
5793    pub async fn value(&self) -> Result<String, DaggerError> {
5794        let query = self.selection.select("value");
5795        query.execute(self.graphql_client.clone()).await
5796    }
5797}
5798#[derive(Clone)]
5799pub struct Env {
5800    pub proc: Option<Arc<DaggerSessionProc>>,
5801    pub selection: Selection,
5802    pub graphql_client: DynGraphQLClient,
5803}
5804impl Env {
5805    /// A unique identifier for this Env.
5806    pub async fn id(&self) -> Result<EnvId, DaggerError> {
5807        let query = self.selection.select("id");
5808        query.execute(self.graphql_client.clone()).await
5809    }
5810    /// retrieve an input value by name
5811    pub fn input(&self, name: impl Into<String>) -> Binding {
5812        let mut query = self.selection.select("input");
5813        query = query.arg("name", name.into());
5814        Binding {
5815            proc: self.proc.clone(),
5816            selection: query,
5817            graphql_client: self.graphql_client.clone(),
5818        }
5819    }
5820    /// return all input values for the environment
5821    pub fn inputs(&self) -> Vec<Binding> {
5822        let query = self.selection.select("inputs");
5823        vec![Binding {
5824            proc: self.proc.clone(),
5825            selection: query,
5826            graphql_client: self.graphql_client.clone(),
5827        }]
5828    }
5829    /// retrieve an output value by name
5830    pub fn output(&self, name: impl Into<String>) -> Binding {
5831        let mut query = self.selection.select("output");
5832        query = query.arg("name", name.into());
5833        Binding {
5834            proc: self.proc.clone(),
5835            selection: query,
5836            graphql_client: self.graphql_client.clone(),
5837        }
5838    }
5839    /// return all output values for the environment
5840    pub fn outputs(&self) -> Vec<Binding> {
5841        let query = self.selection.select("outputs");
5842        vec![Binding {
5843            proc: self.proc.clone(),
5844            selection: query,
5845            graphql_client: self.graphql_client.clone(),
5846        }]
5847    }
5848    /// Create or update a binding of type CacheVolume in the environment
5849    ///
5850    /// # Arguments
5851    ///
5852    /// * `name` - The name of the binding
5853    /// * `value` - The CacheVolume value to assign to the binding
5854    /// * `description` - The purpose of the input
5855    pub fn with_cache_volume_input(
5856        &self,
5857        name: impl Into<String>,
5858        value: impl IntoID<CacheVolumeId>,
5859        description: impl Into<String>,
5860    ) -> Env {
5861        let mut query = self.selection.select("withCacheVolumeInput");
5862        query = query.arg("name", name.into());
5863        query = query.arg_lazy(
5864            "value",
5865            Box::new(move || {
5866                let value = value.clone();
5867                Box::pin(async move { value.into_id().await.unwrap().quote() })
5868            }),
5869        );
5870        query = query.arg("description", description.into());
5871        Env {
5872            proc: self.proc.clone(),
5873            selection: query,
5874            graphql_client: self.graphql_client.clone(),
5875        }
5876    }
5877    /// Declare a desired CacheVolume output to be assigned in the environment
5878    ///
5879    /// # Arguments
5880    ///
5881    /// * `name` - The name of the binding
5882    /// * `description` - A description of the desired value of the binding
5883    pub fn with_cache_volume_output(
5884        &self,
5885        name: impl Into<String>,
5886        description: impl Into<String>,
5887    ) -> Env {
5888        let mut query = self.selection.select("withCacheVolumeOutput");
5889        query = query.arg("name", name.into());
5890        query = query.arg("description", description.into());
5891        Env {
5892            proc: self.proc.clone(),
5893            selection: query,
5894            graphql_client: self.graphql_client.clone(),
5895        }
5896    }
5897    /// Create or update a binding of type Cloud in the environment
5898    ///
5899    /// # Arguments
5900    ///
5901    /// * `name` - The name of the binding
5902    /// * `value` - The Cloud value to assign to the binding
5903    /// * `description` - The purpose of the input
5904    pub fn with_cloud_input(
5905        &self,
5906        name: impl Into<String>,
5907        value: impl IntoID<CloudId>,
5908        description: impl Into<String>,
5909    ) -> Env {
5910        let mut query = self.selection.select("withCloudInput");
5911        query = query.arg("name", name.into());
5912        query = query.arg_lazy(
5913            "value",
5914            Box::new(move || {
5915                let value = value.clone();
5916                Box::pin(async move { value.into_id().await.unwrap().quote() })
5917            }),
5918        );
5919        query = query.arg("description", description.into());
5920        Env {
5921            proc: self.proc.clone(),
5922            selection: query,
5923            graphql_client: self.graphql_client.clone(),
5924        }
5925    }
5926    /// Declare a desired Cloud output to be assigned in the environment
5927    ///
5928    /// # Arguments
5929    ///
5930    /// * `name` - The name of the binding
5931    /// * `description` - A description of the desired value of the binding
5932    pub fn with_cloud_output(
5933        &self,
5934        name: impl Into<String>,
5935        description: impl Into<String>,
5936    ) -> Env {
5937        let mut query = self.selection.select("withCloudOutput");
5938        query = query.arg("name", name.into());
5939        query = query.arg("description", description.into());
5940        Env {
5941            proc: self.proc.clone(),
5942            selection: query,
5943            graphql_client: self.graphql_client.clone(),
5944        }
5945    }
5946    /// Create or update a binding of type Container in the environment
5947    ///
5948    /// # Arguments
5949    ///
5950    /// * `name` - The name of the binding
5951    /// * `value` - The Container value to assign to the binding
5952    /// * `description` - The purpose of the input
5953    pub fn with_container_input(
5954        &self,
5955        name: impl Into<String>,
5956        value: impl IntoID<ContainerId>,
5957        description: impl Into<String>,
5958    ) -> Env {
5959        let mut query = self.selection.select("withContainerInput");
5960        query = query.arg("name", name.into());
5961        query = query.arg_lazy(
5962            "value",
5963            Box::new(move || {
5964                let value = value.clone();
5965                Box::pin(async move { value.into_id().await.unwrap().quote() })
5966            }),
5967        );
5968        query = query.arg("description", description.into());
5969        Env {
5970            proc: self.proc.clone(),
5971            selection: query,
5972            graphql_client: self.graphql_client.clone(),
5973        }
5974    }
5975    /// Declare a desired Container output to be assigned in the environment
5976    ///
5977    /// # Arguments
5978    ///
5979    /// * `name` - The name of the binding
5980    /// * `description` - A description of the desired value of the binding
5981    pub fn with_container_output(
5982        &self,
5983        name: impl Into<String>,
5984        description: impl Into<String>,
5985    ) -> Env {
5986        let mut query = self.selection.select("withContainerOutput");
5987        query = query.arg("name", name.into());
5988        query = query.arg("description", description.into());
5989        Env {
5990            proc: self.proc.clone(),
5991            selection: query,
5992            graphql_client: self.graphql_client.clone(),
5993        }
5994    }
5995    /// Create or update a binding of type Directory in the environment
5996    ///
5997    /// # Arguments
5998    ///
5999    /// * `name` - The name of the binding
6000    /// * `value` - The Directory value to assign to the binding
6001    /// * `description` - The purpose of the input
6002    pub fn with_directory_input(
6003        &self,
6004        name: impl Into<String>,
6005        value: impl IntoID<DirectoryId>,
6006        description: impl Into<String>,
6007    ) -> Env {
6008        let mut query = self.selection.select("withDirectoryInput");
6009        query = query.arg("name", name.into());
6010        query = query.arg_lazy(
6011            "value",
6012            Box::new(move || {
6013                let value = value.clone();
6014                Box::pin(async move { value.into_id().await.unwrap().quote() })
6015            }),
6016        );
6017        query = query.arg("description", description.into());
6018        Env {
6019            proc: self.proc.clone(),
6020            selection: query,
6021            graphql_client: self.graphql_client.clone(),
6022        }
6023    }
6024    /// Declare a desired Directory output to be assigned in the environment
6025    ///
6026    /// # Arguments
6027    ///
6028    /// * `name` - The name of the binding
6029    /// * `description` - A description of the desired value of the binding
6030    pub fn with_directory_output(
6031        &self,
6032        name: impl Into<String>,
6033        description: impl Into<String>,
6034    ) -> Env {
6035        let mut query = self.selection.select("withDirectoryOutput");
6036        query = query.arg("name", name.into());
6037        query = query.arg("description", description.into());
6038        Env {
6039            proc: self.proc.clone(),
6040            selection: query,
6041            graphql_client: self.graphql_client.clone(),
6042        }
6043    }
6044    /// Create or update a binding of type Env in the environment
6045    ///
6046    /// # Arguments
6047    ///
6048    /// * `name` - The name of the binding
6049    /// * `value` - The Env value to assign to the binding
6050    /// * `description` - The purpose of the input
6051    pub fn with_env_input(
6052        &self,
6053        name: impl Into<String>,
6054        value: impl IntoID<EnvId>,
6055        description: impl Into<String>,
6056    ) -> Env {
6057        let mut query = self.selection.select("withEnvInput");
6058        query = query.arg("name", name.into());
6059        query = query.arg_lazy(
6060            "value",
6061            Box::new(move || {
6062                let value = value.clone();
6063                Box::pin(async move { value.into_id().await.unwrap().quote() })
6064            }),
6065        );
6066        query = query.arg("description", description.into());
6067        Env {
6068            proc: self.proc.clone(),
6069            selection: query,
6070            graphql_client: self.graphql_client.clone(),
6071        }
6072    }
6073    /// Declare a desired Env output to be assigned in the environment
6074    ///
6075    /// # Arguments
6076    ///
6077    /// * `name` - The name of the binding
6078    /// * `description` - A description of the desired value of the binding
6079    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6080        let mut query = self.selection.select("withEnvOutput");
6081        query = query.arg("name", name.into());
6082        query = query.arg("description", description.into());
6083        Env {
6084            proc: self.proc.clone(),
6085            selection: query,
6086            graphql_client: self.graphql_client.clone(),
6087        }
6088    }
6089    /// Create or update a binding of type File in the environment
6090    ///
6091    /// # Arguments
6092    ///
6093    /// * `name` - The name of the binding
6094    /// * `value` - The File value to assign to the binding
6095    /// * `description` - The purpose of the input
6096    pub fn with_file_input(
6097        &self,
6098        name: impl Into<String>,
6099        value: impl IntoID<FileId>,
6100        description: impl Into<String>,
6101    ) -> Env {
6102        let mut query = self.selection.select("withFileInput");
6103        query = query.arg("name", name.into());
6104        query = query.arg_lazy(
6105            "value",
6106            Box::new(move || {
6107                let value = value.clone();
6108                Box::pin(async move { value.into_id().await.unwrap().quote() })
6109            }),
6110        );
6111        query = query.arg("description", description.into());
6112        Env {
6113            proc: self.proc.clone(),
6114            selection: query,
6115            graphql_client: self.graphql_client.clone(),
6116        }
6117    }
6118    /// Declare a desired File output to be assigned in the environment
6119    ///
6120    /// # Arguments
6121    ///
6122    /// * `name` - The name of the binding
6123    /// * `description` - A description of the desired value of the binding
6124    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6125        let mut query = self.selection.select("withFileOutput");
6126        query = query.arg("name", name.into());
6127        query = query.arg("description", description.into());
6128        Env {
6129            proc: self.proc.clone(),
6130            selection: query,
6131            graphql_client: self.graphql_client.clone(),
6132        }
6133    }
6134    /// Create or update a binding of type GitRef in the environment
6135    ///
6136    /// # Arguments
6137    ///
6138    /// * `name` - The name of the binding
6139    /// * `value` - The GitRef value to assign to the binding
6140    /// * `description` - The purpose of the input
6141    pub fn with_git_ref_input(
6142        &self,
6143        name: impl Into<String>,
6144        value: impl IntoID<GitRefId>,
6145        description: impl Into<String>,
6146    ) -> Env {
6147        let mut query = self.selection.select("withGitRefInput");
6148        query = query.arg("name", name.into());
6149        query = query.arg_lazy(
6150            "value",
6151            Box::new(move || {
6152                let value = value.clone();
6153                Box::pin(async move { value.into_id().await.unwrap().quote() })
6154            }),
6155        );
6156        query = query.arg("description", description.into());
6157        Env {
6158            proc: self.proc.clone(),
6159            selection: query,
6160            graphql_client: self.graphql_client.clone(),
6161        }
6162    }
6163    /// Declare a desired GitRef output to be assigned in the environment
6164    ///
6165    /// # Arguments
6166    ///
6167    /// * `name` - The name of the binding
6168    /// * `description` - A description of the desired value of the binding
6169    pub fn with_git_ref_output(
6170        &self,
6171        name: impl Into<String>,
6172        description: impl Into<String>,
6173    ) -> Env {
6174        let mut query = self.selection.select("withGitRefOutput");
6175        query = query.arg("name", name.into());
6176        query = query.arg("description", description.into());
6177        Env {
6178            proc: self.proc.clone(),
6179            selection: query,
6180            graphql_client: self.graphql_client.clone(),
6181        }
6182    }
6183    /// Create or update a binding of type GitRepository in the environment
6184    ///
6185    /// # Arguments
6186    ///
6187    /// * `name` - The name of the binding
6188    /// * `value` - The GitRepository value to assign to the binding
6189    /// * `description` - The purpose of the input
6190    pub fn with_git_repository_input(
6191        &self,
6192        name: impl Into<String>,
6193        value: impl IntoID<GitRepositoryId>,
6194        description: impl Into<String>,
6195    ) -> Env {
6196        let mut query = self.selection.select("withGitRepositoryInput");
6197        query = query.arg("name", name.into());
6198        query = query.arg_lazy(
6199            "value",
6200            Box::new(move || {
6201                let value = value.clone();
6202                Box::pin(async move { value.into_id().await.unwrap().quote() })
6203            }),
6204        );
6205        query = query.arg("description", description.into());
6206        Env {
6207            proc: self.proc.clone(),
6208            selection: query,
6209            graphql_client: self.graphql_client.clone(),
6210        }
6211    }
6212    /// Declare a desired GitRepository output to be assigned in the environment
6213    ///
6214    /// # Arguments
6215    ///
6216    /// * `name` - The name of the binding
6217    /// * `description` - A description of the desired value of the binding
6218    pub fn with_git_repository_output(
6219        &self,
6220        name: impl Into<String>,
6221        description: impl Into<String>,
6222    ) -> Env {
6223        let mut query = self.selection.select("withGitRepositoryOutput");
6224        query = query.arg("name", name.into());
6225        query = query.arg("description", description.into());
6226        Env {
6227            proc: self.proc.clone(),
6228            selection: query,
6229            graphql_client: self.graphql_client.clone(),
6230        }
6231    }
6232    /// Create or update a binding of type JSONValue in the environment
6233    ///
6234    /// # Arguments
6235    ///
6236    /// * `name` - The name of the binding
6237    /// * `value` - The JSONValue value to assign to the binding
6238    /// * `description` - The purpose of the input
6239    pub fn with_json_value_input(
6240        &self,
6241        name: impl Into<String>,
6242        value: impl IntoID<JsonValueId>,
6243        description: impl Into<String>,
6244    ) -> Env {
6245        let mut query = self.selection.select("withJSONValueInput");
6246        query = query.arg("name", name.into());
6247        query = query.arg_lazy(
6248            "value",
6249            Box::new(move || {
6250                let value = value.clone();
6251                Box::pin(async move { value.into_id().await.unwrap().quote() })
6252            }),
6253        );
6254        query = query.arg("description", description.into());
6255        Env {
6256            proc: self.proc.clone(),
6257            selection: query,
6258            graphql_client: self.graphql_client.clone(),
6259        }
6260    }
6261    /// Declare a desired JSONValue output to be assigned in the environment
6262    ///
6263    /// # Arguments
6264    ///
6265    /// * `name` - The name of the binding
6266    /// * `description` - A description of the desired value of the binding
6267    pub fn with_json_value_output(
6268        &self,
6269        name: impl Into<String>,
6270        description: impl Into<String>,
6271    ) -> Env {
6272        let mut query = self.selection.select("withJSONValueOutput");
6273        query = query.arg("name", name.into());
6274        query = query.arg("description", description.into());
6275        Env {
6276            proc: self.proc.clone(),
6277            selection: query,
6278            graphql_client: self.graphql_client.clone(),
6279        }
6280    }
6281    /// Create or update a binding of type LLM in the environment
6282    ///
6283    /// # Arguments
6284    ///
6285    /// * `name` - The name of the binding
6286    /// * `value` - The LLM value to assign to the binding
6287    /// * `description` - The purpose of the input
6288    pub fn with_llm_input(
6289        &self,
6290        name: impl Into<String>,
6291        value: impl IntoID<Llmid>,
6292        description: impl Into<String>,
6293    ) -> Env {
6294        let mut query = self.selection.select("withLLMInput");
6295        query = query.arg("name", name.into());
6296        query = query.arg_lazy(
6297            "value",
6298            Box::new(move || {
6299                let value = value.clone();
6300                Box::pin(async move { value.into_id().await.unwrap().quote() })
6301            }),
6302        );
6303        query = query.arg("description", description.into());
6304        Env {
6305            proc: self.proc.clone(),
6306            selection: query,
6307            graphql_client: self.graphql_client.clone(),
6308        }
6309    }
6310    /// Declare a desired LLM output to be assigned in the environment
6311    ///
6312    /// # Arguments
6313    ///
6314    /// * `name` - The name of the binding
6315    /// * `description` - A description of the desired value of the binding
6316    pub fn with_llm_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6317        let mut query = self.selection.select("withLLMOutput");
6318        query = query.arg("name", name.into());
6319        query = query.arg("description", description.into());
6320        Env {
6321            proc: self.proc.clone(),
6322            selection: query,
6323            graphql_client: self.graphql_client.clone(),
6324        }
6325    }
6326    /// Create or update a binding of type ModuleConfigClient in the environment
6327    ///
6328    /// # Arguments
6329    ///
6330    /// * `name` - The name of the binding
6331    /// * `value` - The ModuleConfigClient value to assign to the binding
6332    /// * `description` - The purpose of the input
6333    pub fn with_module_config_client_input(
6334        &self,
6335        name: impl Into<String>,
6336        value: impl IntoID<ModuleConfigClientId>,
6337        description: impl Into<String>,
6338    ) -> Env {
6339        let mut query = self.selection.select("withModuleConfigClientInput");
6340        query = query.arg("name", name.into());
6341        query = query.arg_lazy(
6342            "value",
6343            Box::new(move || {
6344                let value = value.clone();
6345                Box::pin(async move { value.into_id().await.unwrap().quote() })
6346            }),
6347        );
6348        query = query.arg("description", description.into());
6349        Env {
6350            proc: self.proc.clone(),
6351            selection: query,
6352            graphql_client: self.graphql_client.clone(),
6353        }
6354    }
6355    /// Declare a desired ModuleConfigClient output to be assigned in the environment
6356    ///
6357    /// # Arguments
6358    ///
6359    /// * `name` - The name of the binding
6360    /// * `description` - A description of the desired value of the binding
6361    pub fn with_module_config_client_output(
6362        &self,
6363        name: impl Into<String>,
6364        description: impl Into<String>,
6365    ) -> Env {
6366        let mut query = self.selection.select("withModuleConfigClientOutput");
6367        query = query.arg("name", name.into());
6368        query = query.arg("description", description.into());
6369        Env {
6370            proc: self.proc.clone(),
6371            selection: query,
6372            graphql_client: self.graphql_client.clone(),
6373        }
6374    }
6375    /// Create or update a binding of type Module in the environment
6376    ///
6377    /// # Arguments
6378    ///
6379    /// * `name` - The name of the binding
6380    /// * `value` - The Module value to assign to the binding
6381    /// * `description` - The purpose of the input
6382    pub fn with_module_input(
6383        &self,
6384        name: impl Into<String>,
6385        value: impl IntoID<ModuleId>,
6386        description: impl Into<String>,
6387    ) -> Env {
6388        let mut query = self.selection.select("withModuleInput");
6389        query = query.arg("name", name.into());
6390        query = query.arg_lazy(
6391            "value",
6392            Box::new(move || {
6393                let value = value.clone();
6394                Box::pin(async move { value.into_id().await.unwrap().quote() })
6395            }),
6396        );
6397        query = query.arg("description", description.into());
6398        Env {
6399            proc: self.proc.clone(),
6400            selection: query,
6401            graphql_client: self.graphql_client.clone(),
6402        }
6403    }
6404    /// Declare a desired Module output to be assigned in the environment
6405    ///
6406    /// # Arguments
6407    ///
6408    /// * `name` - The name of the binding
6409    /// * `description` - A description of the desired value of the binding
6410    pub fn with_module_output(
6411        &self,
6412        name: impl Into<String>,
6413        description: impl Into<String>,
6414    ) -> Env {
6415        let mut query = self.selection.select("withModuleOutput");
6416        query = query.arg("name", name.into());
6417        query = query.arg("description", description.into());
6418        Env {
6419            proc: self.proc.clone(),
6420            selection: query,
6421            graphql_client: self.graphql_client.clone(),
6422        }
6423    }
6424    /// Create or update a binding of type ModuleSource in the environment
6425    ///
6426    /// # Arguments
6427    ///
6428    /// * `name` - The name of the binding
6429    /// * `value` - The ModuleSource value to assign to the binding
6430    /// * `description` - The purpose of the input
6431    pub fn with_module_source_input(
6432        &self,
6433        name: impl Into<String>,
6434        value: impl IntoID<ModuleSourceId>,
6435        description: impl Into<String>,
6436    ) -> Env {
6437        let mut query = self.selection.select("withModuleSourceInput");
6438        query = query.arg("name", name.into());
6439        query = query.arg_lazy(
6440            "value",
6441            Box::new(move || {
6442                let value = value.clone();
6443                Box::pin(async move { value.into_id().await.unwrap().quote() })
6444            }),
6445        );
6446        query = query.arg("description", description.into());
6447        Env {
6448            proc: self.proc.clone(),
6449            selection: query,
6450            graphql_client: self.graphql_client.clone(),
6451        }
6452    }
6453    /// Declare a desired ModuleSource output to be assigned in the environment
6454    ///
6455    /// # Arguments
6456    ///
6457    /// * `name` - The name of the binding
6458    /// * `description` - A description of the desired value of the binding
6459    pub fn with_module_source_output(
6460        &self,
6461        name: impl Into<String>,
6462        description: impl Into<String>,
6463    ) -> Env {
6464        let mut query = self.selection.select("withModuleSourceOutput");
6465        query = query.arg("name", name.into());
6466        query = query.arg("description", description.into());
6467        Env {
6468            proc: self.proc.clone(),
6469            selection: query,
6470            graphql_client: self.graphql_client.clone(),
6471        }
6472    }
6473    /// Create or update a binding of type SearchResult in the environment
6474    ///
6475    /// # Arguments
6476    ///
6477    /// * `name` - The name of the binding
6478    /// * `value` - The SearchResult value to assign to the binding
6479    /// * `description` - The purpose of the input
6480    pub fn with_search_result_input(
6481        &self,
6482        name: impl Into<String>,
6483        value: impl IntoID<SearchResultId>,
6484        description: impl Into<String>,
6485    ) -> Env {
6486        let mut query = self.selection.select("withSearchResultInput");
6487        query = query.arg("name", name.into());
6488        query = query.arg_lazy(
6489            "value",
6490            Box::new(move || {
6491                let value = value.clone();
6492                Box::pin(async move { value.into_id().await.unwrap().quote() })
6493            }),
6494        );
6495        query = query.arg("description", description.into());
6496        Env {
6497            proc: self.proc.clone(),
6498            selection: query,
6499            graphql_client: self.graphql_client.clone(),
6500        }
6501    }
6502    /// Declare a desired SearchResult output to be assigned in the environment
6503    ///
6504    /// # Arguments
6505    ///
6506    /// * `name` - The name of the binding
6507    /// * `description` - A description of the desired value of the binding
6508    pub fn with_search_result_output(
6509        &self,
6510        name: impl Into<String>,
6511        description: impl Into<String>,
6512    ) -> Env {
6513        let mut query = self.selection.select("withSearchResultOutput");
6514        query = query.arg("name", name.into());
6515        query = query.arg("description", description.into());
6516        Env {
6517            proc: self.proc.clone(),
6518            selection: query,
6519            graphql_client: self.graphql_client.clone(),
6520        }
6521    }
6522    /// Create or update a binding of type SearchSubmatch in the environment
6523    ///
6524    /// # Arguments
6525    ///
6526    /// * `name` - The name of the binding
6527    /// * `value` - The SearchSubmatch value to assign to the binding
6528    /// * `description` - The purpose of the input
6529    pub fn with_search_submatch_input(
6530        &self,
6531        name: impl Into<String>,
6532        value: impl IntoID<SearchSubmatchId>,
6533        description: impl Into<String>,
6534    ) -> Env {
6535        let mut query = self.selection.select("withSearchSubmatchInput");
6536        query = query.arg("name", name.into());
6537        query = query.arg_lazy(
6538            "value",
6539            Box::new(move || {
6540                let value = value.clone();
6541                Box::pin(async move { value.into_id().await.unwrap().quote() })
6542            }),
6543        );
6544        query = query.arg("description", description.into());
6545        Env {
6546            proc: self.proc.clone(),
6547            selection: query,
6548            graphql_client: self.graphql_client.clone(),
6549        }
6550    }
6551    /// Declare a desired SearchSubmatch output to be assigned in the environment
6552    ///
6553    /// # Arguments
6554    ///
6555    /// * `name` - The name of the binding
6556    /// * `description` - A description of the desired value of the binding
6557    pub fn with_search_submatch_output(
6558        &self,
6559        name: impl Into<String>,
6560        description: impl Into<String>,
6561    ) -> Env {
6562        let mut query = self.selection.select("withSearchSubmatchOutput");
6563        query = query.arg("name", name.into());
6564        query = query.arg("description", description.into());
6565        Env {
6566            proc: self.proc.clone(),
6567            selection: query,
6568            graphql_client: self.graphql_client.clone(),
6569        }
6570    }
6571    /// Create or update a binding of type Secret in the environment
6572    ///
6573    /// # Arguments
6574    ///
6575    /// * `name` - The name of the binding
6576    /// * `value` - The Secret value to assign to the binding
6577    /// * `description` - The purpose of the input
6578    pub fn with_secret_input(
6579        &self,
6580        name: impl Into<String>,
6581        value: impl IntoID<SecretId>,
6582        description: impl Into<String>,
6583    ) -> Env {
6584        let mut query = self.selection.select("withSecretInput");
6585        query = query.arg("name", name.into());
6586        query = query.arg_lazy(
6587            "value",
6588            Box::new(move || {
6589                let value = value.clone();
6590                Box::pin(async move { value.into_id().await.unwrap().quote() })
6591            }),
6592        );
6593        query = query.arg("description", description.into());
6594        Env {
6595            proc: self.proc.clone(),
6596            selection: query,
6597            graphql_client: self.graphql_client.clone(),
6598        }
6599    }
6600    /// Declare a desired Secret output to be assigned in the environment
6601    ///
6602    /// # Arguments
6603    ///
6604    /// * `name` - The name of the binding
6605    /// * `description` - A description of the desired value of the binding
6606    pub fn with_secret_output(
6607        &self,
6608        name: impl Into<String>,
6609        description: impl Into<String>,
6610    ) -> Env {
6611        let mut query = self.selection.select("withSecretOutput");
6612        query = query.arg("name", name.into());
6613        query = query.arg("description", description.into());
6614        Env {
6615            proc: self.proc.clone(),
6616            selection: query,
6617            graphql_client: self.graphql_client.clone(),
6618        }
6619    }
6620    /// Create or update a binding of type Service in the environment
6621    ///
6622    /// # Arguments
6623    ///
6624    /// * `name` - The name of the binding
6625    /// * `value` - The Service value to assign to the binding
6626    /// * `description` - The purpose of the input
6627    pub fn with_service_input(
6628        &self,
6629        name: impl Into<String>,
6630        value: impl IntoID<ServiceId>,
6631        description: impl Into<String>,
6632    ) -> Env {
6633        let mut query = self.selection.select("withServiceInput");
6634        query = query.arg("name", name.into());
6635        query = query.arg_lazy(
6636            "value",
6637            Box::new(move || {
6638                let value = value.clone();
6639                Box::pin(async move { value.into_id().await.unwrap().quote() })
6640            }),
6641        );
6642        query = query.arg("description", description.into());
6643        Env {
6644            proc: self.proc.clone(),
6645            selection: query,
6646            graphql_client: self.graphql_client.clone(),
6647        }
6648    }
6649    /// Declare a desired Service output to be assigned in the environment
6650    ///
6651    /// # Arguments
6652    ///
6653    /// * `name` - The name of the binding
6654    /// * `description` - A description of the desired value of the binding
6655    pub fn with_service_output(
6656        &self,
6657        name: impl Into<String>,
6658        description: impl Into<String>,
6659    ) -> Env {
6660        let mut query = self.selection.select("withServiceOutput");
6661        query = query.arg("name", name.into());
6662        query = query.arg("description", description.into());
6663        Env {
6664            proc: self.proc.clone(),
6665            selection: query,
6666            graphql_client: self.graphql_client.clone(),
6667        }
6668    }
6669    /// Create or update a binding of type Socket in the environment
6670    ///
6671    /// # Arguments
6672    ///
6673    /// * `name` - The name of the binding
6674    /// * `value` - The Socket value to assign to the binding
6675    /// * `description` - The purpose of the input
6676    pub fn with_socket_input(
6677        &self,
6678        name: impl Into<String>,
6679        value: impl IntoID<SocketId>,
6680        description: impl Into<String>,
6681    ) -> Env {
6682        let mut query = self.selection.select("withSocketInput");
6683        query = query.arg("name", name.into());
6684        query = query.arg_lazy(
6685            "value",
6686            Box::new(move || {
6687                let value = value.clone();
6688                Box::pin(async move { value.into_id().await.unwrap().quote() })
6689            }),
6690        );
6691        query = query.arg("description", description.into());
6692        Env {
6693            proc: self.proc.clone(),
6694            selection: query,
6695            graphql_client: self.graphql_client.clone(),
6696        }
6697    }
6698    /// Declare a desired Socket output to be assigned in the environment
6699    ///
6700    /// # Arguments
6701    ///
6702    /// * `name` - The name of the binding
6703    /// * `description` - A description of the desired value of the binding
6704    pub fn with_socket_output(
6705        &self,
6706        name: impl Into<String>,
6707        description: impl Into<String>,
6708    ) -> Env {
6709        let mut query = self.selection.select("withSocketOutput");
6710        query = query.arg("name", name.into());
6711        query = query.arg("description", description.into());
6712        Env {
6713            proc: self.proc.clone(),
6714            selection: query,
6715            graphql_client: self.graphql_client.clone(),
6716        }
6717    }
6718    /// Create or update an input value of type string
6719    ///
6720    /// # Arguments
6721    ///
6722    /// * `name` - The name of the binding
6723    /// * `value` - The string value to assign to the binding
6724    /// * `description` - The description of the input
6725    pub fn with_string_input(
6726        &self,
6727        name: impl Into<String>,
6728        value: impl Into<String>,
6729        description: impl Into<String>,
6730    ) -> Env {
6731        let mut query = self.selection.select("withStringInput");
6732        query = query.arg("name", name.into());
6733        query = query.arg("value", value.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 an input value of type string
6742    ///
6743    /// # Arguments
6744    ///
6745    /// * `name` - The name of the binding
6746    /// * `description` - The description of the output
6747    pub fn with_string_output(
6748        &self,
6749        name: impl Into<String>,
6750        description: impl Into<String>,
6751    ) -> Env {
6752        let mut query = self.selection.select("withStringOutput");
6753        query = query.arg("name", name.into());
6754        query = query.arg("description", description.into());
6755        Env {
6756            proc: self.proc.clone(),
6757            selection: query,
6758            graphql_client: self.graphql_client.clone(),
6759        }
6760    }
6761}
6762#[derive(Clone)]
6763pub struct EnvVariable {
6764    pub proc: Option<Arc<DaggerSessionProc>>,
6765    pub selection: Selection,
6766    pub graphql_client: DynGraphQLClient,
6767}
6768impl EnvVariable {
6769    /// A unique identifier for this EnvVariable.
6770    pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
6771        let query = self.selection.select("id");
6772        query.execute(self.graphql_client.clone()).await
6773    }
6774    /// The environment variable name.
6775    pub async fn name(&self) -> Result<String, DaggerError> {
6776        let query = self.selection.select("name");
6777        query.execute(self.graphql_client.clone()).await
6778    }
6779    /// The environment variable value.
6780    pub async fn value(&self) -> Result<String, DaggerError> {
6781        let query = self.selection.select("value");
6782        query.execute(self.graphql_client.clone()).await
6783    }
6784}
6785#[derive(Clone)]
6786pub struct Error {
6787    pub proc: Option<Arc<DaggerSessionProc>>,
6788    pub selection: Selection,
6789    pub graphql_client: DynGraphQLClient,
6790}
6791impl Error {
6792    /// A unique identifier for this Error.
6793    pub async fn id(&self) -> Result<ErrorId, DaggerError> {
6794        let query = self.selection.select("id");
6795        query.execute(self.graphql_client.clone()).await
6796    }
6797    /// A description of the error.
6798    pub async fn message(&self) -> Result<String, DaggerError> {
6799        let query = self.selection.select("message");
6800        query.execute(self.graphql_client.clone()).await
6801    }
6802    /// The extensions of the error.
6803    pub fn values(&self) -> Vec<ErrorValue> {
6804        let query = self.selection.select("values");
6805        vec![ErrorValue {
6806            proc: self.proc.clone(),
6807            selection: query,
6808            graphql_client: self.graphql_client.clone(),
6809        }]
6810    }
6811    /// Add a value to the error.
6812    ///
6813    /// # Arguments
6814    ///
6815    /// * `name` - The name of the value.
6816    /// * `value` - The value to store on the error.
6817    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
6818        let mut query = self.selection.select("withValue");
6819        query = query.arg("name", name.into());
6820        query = query.arg("value", value);
6821        Error {
6822            proc: self.proc.clone(),
6823            selection: query,
6824            graphql_client: self.graphql_client.clone(),
6825        }
6826    }
6827}
6828#[derive(Clone)]
6829pub struct ErrorValue {
6830    pub proc: Option<Arc<DaggerSessionProc>>,
6831    pub selection: Selection,
6832    pub graphql_client: DynGraphQLClient,
6833}
6834impl ErrorValue {
6835    /// A unique identifier for this ErrorValue.
6836    pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
6837        let query = self.selection.select("id");
6838        query.execute(self.graphql_client.clone()).await
6839    }
6840    /// The name of the value.
6841    pub async fn name(&self) -> Result<String, DaggerError> {
6842        let query = self.selection.select("name");
6843        query.execute(self.graphql_client.clone()).await
6844    }
6845    /// The value.
6846    pub async fn value(&self) -> Result<Json, DaggerError> {
6847        let query = self.selection.select("value");
6848        query.execute(self.graphql_client.clone()).await
6849    }
6850}
6851#[derive(Clone)]
6852pub struct FieldTypeDef {
6853    pub proc: Option<Arc<DaggerSessionProc>>,
6854    pub selection: Selection,
6855    pub graphql_client: DynGraphQLClient,
6856}
6857impl FieldTypeDef {
6858    /// A doc string for the field, if any.
6859    pub async fn description(&self) -> Result<String, DaggerError> {
6860        let query = self.selection.select("description");
6861        query.execute(self.graphql_client.clone()).await
6862    }
6863    /// A unique identifier for this FieldTypeDef.
6864    pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
6865        let query = self.selection.select("id");
6866        query.execute(self.graphql_client.clone()).await
6867    }
6868    /// The name of the field in lowerCamelCase format.
6869    pub async fn name(&self) -> Result<String, DaggerError> {
6870        let query = self.selection.select("name");
6871        query.execute(self.graphql_client.clone()).await
6872    }
6873    /// The location of this field declaration.
6874    pub fn source_map(&self) -> SourceMap {
6875        let query = self.selection.select("sourceMap");
6876        SourceMap {
6877            proc: self.proc.clone(),
6878            selection: query,
6879            graphql_client: self.graphql_client.clone(),
6880        }
6881    }
6882    /// The type of the field.
6883    pub fn type_def(&self) -> TypeDef {
6884        let query = self.selection.select("typeDef");
6885        TypeDef {
6886            proc: self.proc.clone(),
6887            selection: query,
6888            graphql_client: self.graphql_client.clone(),
6889        }
6890    }
6891}
6892#[derive(Clone)]
6893pub struct File {
6894    pub proc: Option<Arc<DaggerSessionProc>>,
6895    pub selection: Selection,
6896    pub graphql_client: DynGraphQLClient,
6897}
6898#[derive(Builder, Debug, PartialEq)]
6899pub struct FileContentsOpts {
6900    /// Maximum number of lines to read
6901    #[builder(setter(into, strip_option), default)]
6902    pub limit_lines: Option<isize>,
6903    /// Start reading after this line
6904    #[builder(setter(into, strip_option), default)]
6905    pub offset_lines: Option<isize>,
6906}
6907#[derive(Builder, Debug, PartialEq)]
6908pub struct FileDigestOpts {
6909    /// If true, exclude metadata from the digest.
6910    #[builder(setter(into, strip_option), default)]
6911    pub exclude_metadata: Option<bool>,
6912}
6913#[derive(Builder, Debug, PartialEq)]
6914pub struct FileExportOpts {
6915    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
6916    #[builder(setter(into, strip_option), default)]
6917    pub allow_parent_dir_path: Option<bool>,
6918}
6919#[derive(Builder, Debug, PartialEq)]
6920pub struct FileSearchOpts<'a> {
6921    /// Allow the . pattern to match newlines in multiline mode.
6922    #[builder(setter(into, strip_option), default)]
6923    pub dotall: Option<bool>,
6924    /// Only return matching files, not lines and content
6925    #[builder(setter(into, strip_option), default)]
6926    pub files_only: Option<bool>,
6927    #[builder(setter(into, strip_option), default)]
6928    pub globs: Option<Vec<&'a str>>,
6929    /// Enable case-insensitive matching.
6930    #[builder(setter(into, strip_option), default)]
6931    pub insensitive: Option<bool>,
6932    /// Limit the number of results to return
6933    #[builder(setter(into, strip_option), default)]
6934    pub limit: Option<isize>,
6935    /// Interpret the pattern as a literal string instead of a regular expression.
6936    #[builder(setter(into, strip_option), default)]
6937    pub literal: Option<bool>,
6938    /// Enable searching across multiple lines.
6939    #[builder(setter(into, strip_option), default)]
6940    pub multiline: Option<bool>,
6941    #[builder(setter(into, strip_option), default)]
6942    pub paths: Option<Vec<&'a str>>,
6943    /// Skip hidden files (files starting with .).
6944    #[builder(setter(into, strip_option), default)]
6945    pub skip_hidden: Option<bool>,
6946    /// Honor .gitignore, .ignore, and .rgignore files.
6947    #[builder(setter(into, strip_option), default)]
6948    pub skip_ignored: Option<bool>,
6949}
6950#[derive(Builder, Debug, PartialEq)]
6951pub struct FileWithReplacedOpts {
6952    /// Replace all occurrences of the pattern.
6953    #[builder(setter(into, strip_option), default)]
6954    pub all: Option<bool>,
6955    /// Replace the first match starting from the specified line.
6956    #[builder(setter(into, strip_option), default)]
6957    pub first_from: Option<isize>,
6958}
6959impl File {
6960    /// Retrieves the contents of the file.
6961    ///
6962    /// # Arguments
6963    ///
6964    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6965    pub async fn contents(&self) -> Result<String, DaggerError> {
6966        let query = self.selection.select("contents");
6967        query.execute(self.graphql_client.clone()).await
6968    }
6969    /// Retrieves the contents of the file.
6970    ///
6971    /// # Arguments
6972    ///
6973    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6974    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
6975        let mut query = self.selection.select("contents");
6976        if let Some(offset_lines) = opts.offset_lines {
6977            query = query.arg("offsetLines", offset_lines);
6978        }
6979        if let Some(limit_lines) = opts.limit_lines {
6980            query = query.arg("limitLines", limit_lines);
6981        }
6982        query.execute(self.graphql_client.clone()).await
6983    }
6984    /// 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.
6985    ///
6986    /// # Arguments
6987    ///
6988    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6989    pub async fn digest(&self) -> Result<String, DaggerError> {
6990        let query = self.selection.select("digest");
6991        query.execute(self.graphql_client.clone()).await
6992    }
6993    /// 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.
6994    ///
6995    /// # Arguments
6996    ///
6997    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6998    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
6999        let mut query = self.selection.select("digest");
7000        if let Some(exclude_metadata) = opts.exclude_metadata {
7001            query = query.arg("excludeMetadata", exclude_metadata);
7002        }
7003        query.execute(self.graphql_client.clone()).await
7004    }
7005    /// Writes the file to a file path on the host.
7006    ///
7007    /// # Arguments
7008    ///
7009    /// * `path` - Location of the written directory (e.g., "output.txt").
7010    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7011    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7012        let mut query = self.selection.select("export");
7013        query = query.arg("path", path.into());
7014        query.execute(self.graphql_client.clone()).await
7015    }
7016    /// Writes the file to a file path on the host.
7017    ///
7018    /// # Arguments
7019    ///
7020    /// * `path` - Location of the written directory (e.g., "output.txt").
7021    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7022    pub async fn export_opts(
7023        &self,
7024        path: impl Into<String>,
7025        opts: FileExportOpts,
7026    ) -> Result<String, DaggerError> {
7027        let mut query = self.selection.select("export");
7028        query = query.arg("path", path.into());
7029        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
7030            query = query.arg("allowParentDirPath", allow_parent_dir_path);
7031        }
7032        query.execute(self.graphql_client.clone()).await
7033    }
7034    /// A unique identifier for this File.
7035    pub async fn id(&self) -> Result<FileId, DaggerError> {
7036        let query = self.selection.select("id");
7037        query.execute(self.graphql_client.clone()).await
7038    }
7039    /// Retrieves the name of the file.
7040    pub async fn name(&self) -> Result<String, DaggerError> {
7041        let query = self.selection.select("name");
7042        query.execute(self.graphql_client.clone()).await
7043    }
7044    /// Searches for content matching the given regular expression or literal string.
7045    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
7046    ///
7047    /// # Arguments
7048    ///
7049    /// * `pattern` - The text to match.
7050    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7051    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
7052        let mut query = self.selection.select("search");
7053        query = query.arg("pattern", pattern.into());
7054        vec![SearchResult {
7055            proc: self.proc.clone(),
7056            selection: query,
7057            graphql_client: self.graphql_client.clone(),
7058        }]
7059    }
7060    /// Searches for content matching the given regular expression or literal string.
7061    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
7062    ///
7063    /// # Arguments
7064    ///
7065    /// * `pattern` - The text to match.
7066    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7067    pub fn search_opts<'a>(
7068        &self,
7069        pattern: impl Into<String>,
7070        opts: FileSearchOpts<'a>,
7071    ) -> Vec<SearchResult> {
7072        let mut query = self.selection.select("search");
7073        query = query.arg("pattern", pattern.into());
7074        if let Some(literal) = opts.literal {
7075            query = query.arg("literal", literal);
7076        }
7077        if let Some(multiline) = opts.multiline {
7078            query = query.arg("multiline", multiline);
7079        }
7080        if let Some(dotall) = opts.dotall {
7081            query = query.arg("dotall", dotall);
7082        }
7083        if let Some(insensitive) = opts.insensitive {
7084            query = query.arg("insensitive", insensitive);
7085        }
7086        if let Some(skip_ignored) = opts.skip_ignored {
7087            query = query.arg("skipIgnored", skip_ignored);
7088        }
7089        if let Some(skip_hidden) = opts.skip_hidden {
7090            query = query.arg("skipHidden", skip_hidden);
7091        }
7092        if let Some(files_only) = opts.files_only {
7093            query = query.arg("filesOnly", files_only);
7094        }
7095        if let Some(limit) = opts.limit {
7096            query = query.arg("limit", limit);
7097        }
7098        if let Some(paths) = opts.paths {
7099            query = query.arg("paths", paths);
7100        }
7101        if let Some(globs) = opts.globs {
7102            query = query.arg("globs", globs);
7103        }
7104        vec![SearchResult {
7105            proc: self.proc.clone(),
7106            selection: query,
7107            graphql_client: self.graphql_client.clone(),
7108        }]
7109    }
7110    /// Retrieves the size of the file, in bytes.
7111    pub async fn size(&self) -> Result<isize, DaggerError> {
7112        let query = self.selection.select("size");
7113        query.execute(self.graphql_client.clone()).await
7114    }
7115    /// Force evaluation in the engine.
7116    pub async fn sync(&self) -> Result<FileId, DaggerError> {
7117        let query = self.selection.select("sync");
7118        query.execute(self.graphql_client.clone()).await
7119    }
7120    /// Retrieves this file with its name set to the given name.
7121    ///
7122    /// # Arguments
7123    ///
7124    /// * `name` - Name to set file to.
7125    pub fn with_name(&self, name: impl Into<String>) -> File {
7126        let mut query = self.selection.select("withName");
7127        query = query.arg("name", name.into());
7128        File {
7129            proc: self.proc.clone(),
7130            selection: query,
7131            graphql_client: self.graphql_client.clone(),
7132        }
7133    }
7134    /// Retrieves the file with content replaced with the given text.
7135    /// If 'all' is true, all occurrences of the pattern will be replaced.
7136    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
7137    /// If neither are specified, and there are multiple matches for the pattern, this will error.
7138    /// If there are no matches for the pattern, this will error.
7139    ///
7140    /// # Arguments
7141    ///
7142    /// * `search` - The text to match.
7143    /// * `replacement` - The text to match.
7144    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7145    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
7146        let mut query = self.selection.select("withReplaced");
7147        query = query.arg("search", search.into());
7148        query = query.arg("replacement", replacement.into());
7149        File {
7150            proc: self.proc.clone(),
7151            selection: query,
7152            graphql_client: self.graphql_client.clone(),
7153        }
7154    }
7155    /// Retrieves the file with content replaced with the given text.
7156    /// If 'all' is true, all occurrences of the pattern will be replaced.
7157    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
7158    /// If neither are specified, and there are multiple matches for the pattern, this will error.
7159    /// If there are no matches for the pattern, this will error.
7160    ///
7161    /// # Arguments
7162    ///
7163    /// * `search` - The text to match.
7164    /// * `replacement` - The text to match.
7165    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7166    pub fn with_replaced_opts(
7167        &self,
7168        search: impl Into<String>,
7169        replacement: impl Into<String>,
7170        opts: FileWithReplacedOpts,
7171    ) -> File {
7172        let mut query = self.selection.select("withReplaced");
7173        query = query.arg("search", search.into());
7174        query = query.arg("replacement", replacement.into());
7175        if let Some(all) = opts.all {
7176            query = query.arg("all", all);
7177        }
7178        if let Some(first_from) = opts.first_from {
7179            query = query.arg("firstFrom", first_from);
7180        }
7181        File {
7182            proc: self.proc.clone(),
7183            selection: query,
7184            graphql_client: self.graphql_client.clone(),
7185        }
7186    }
7187    /// Retrieves this file with its created/modified timestamps set to the given time.
7188    ///
7189    /// # Arguments
7190    ///
7191    /// * `timestamp` - Timestamp to set dir/files in.
7192    ///
7193    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
7194    pub fn with_timestamps(&self, timestamp: isize) -> File {
7195        let mut query = self.selection.select("withTimestamps");
7196        query = query.arg("timestamp", timestamp);
7197        File {
7198            proc: self.proc.clone(),
7199            selection: query,
7200            graphql_client: self.graphql_client.clone(),
7201        }
7202    }
7203}
7204#[derive(Clone)]
7205pub struct Function {
7206    pub proc: Option<Arc<DaggerSessionProc>>,
7207    pub selection: Selection,
7208    pub graphql_client: DynGraphQLClient,
7209}
7210#[derive(Builder, Debug, PartialEq)]
7211pub struct FunctionWithArgOpts<'a> {
7212    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
7213    #[builder(setter(into, strip_option), default)]
7214    pub default_path: Option<&'a str>,
7215    /// A default value to use for this argument if not explicitly set by the caller, if any
7216    #[builder(setter(into, strip_option), default)]
7217    pub default_value: Option<Json>,
7218    /// A doc string for the argument, if any
7219    #[builder(setter(into, strip_option), default)]
7220    pub description: Option<&'a str>,
7221    /// Patterns to ignore when loading the contextual argument value.
7222    #[builder(setter(into, strip_option), default)]
7223    pub ignore: Option<Vec<&'a str>>,
7224    /// The source map for the argument definition.
7225    #[builder(setter(into, strip_option), default)]
7226    pub source_map: Option<SourceMapId>,
7227}
7228impl Function {
7229    /// Arguments accepted by the function, if any.
7230    pub fn args(&self) -> Vec<FunctionArg> {
7231        let query = self.selection.select("args");
7232        vec![FunctionArg {
7233            proc: self.proc.clone(),
7234            selection: query,
7235            graphql_client: self.graphql_client.clone(),
7236        }]
7237    }
7238    /// A doc string for the function, if any.
7239    pub async fn description(&self) -> Result<String, DaggerError> {
7240        let query = self.selection.select("description");
7241        query.execute(self.graphql_client.clone()).await
7242    }
7243    /// A unique identifier for this Function.
7244    pub async fn id(&self) -> Result<FunctionId, DaggerError> {
7245        let query = self.selection.select("id");
7246        query.execute(self.graphql_client.clone()).await
7247    }
7248    /// The name of the function.
7249    pub async fn name(&self) -> Result<String, DaggerError> {
7250        let query = self.selection.select("name");
7251        query.execute(self.graphql_client.clone()).await
7252    }
7253    /// The type returned by the function.
7254    pub fn return_type(&self) -> TypeDef {
7255        let query = self.selection.select("returnType");
7256        TypeDef {
7257            proc: self.proc.clone(),
7258            selection: query,
7259            graphql_client: self.graphql_client.clone(),
7260        }
7261    }
7262    /// The location of this function declaration.
7263    pub fn source_map(&self) -> SourceMap {
7264        let query = self.selection.select("sourceMap");
7265        SourceMap {
7266            proc: self.proc.clone(),
7267            selection: query,
7268            graphql_client: self.graphql_client.clone(),
7269        }
7270    }
7271    /// Returns the function with the provided argument
7272    ///
7273    /// # Arguments
7274    ///
7275    /// * `name` - The name of the argument
7276    /// * `type_def` - The type of the argument
7277    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7278    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
7279        let mut query = self.selection.select("withArg");
7280        query = query.arg("name", name.into());
7281        query = query.arg_lazy(
7282            "typeDef",
7283            Box::new(move || {
7284                let type_def = type_def.clone();
7285                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
7286            }),
7287        );
7288        Function {
7289            proc: self.proc.clone(),
7290            selection: query,
7291            graphql_client: self.graphql_client.clone(),
7292        }
7293    }
7294    /// Returns the function with the provided argument
7295    ///
7296    /// # Arguments
7297    ///
7298    /// * `name` - The name of the argument
7299    /// * `type_def` - The type of the argument
7300    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7301    pub fn with_arg_opts<'a>(
7302        &self,
7303        name: impl Into<String>,
7304        type_def: impl IntoID<TypeDefId>,
7305        opts: FunctionWithArgOpts<'a>,
7306    ) -> Function {
7307        let mut query = self.selection.select("withArg");
7308        query = query.arg("name", name.into());
7309        query = query.arg_lazy(
7310            "typeDef",
7311            Box::new(move || {
7312                let type_def = type_def.clone();
7313                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
7314            }),
7315        );
7316        if let Some(description) = opts.description {
7317            query = query.arg("description", description);
7318        }
7319        if let Some(default_value) = opts.default_value {
7320            query = query.arg("defaultValue", default_value);
7321        }
7322        if let Some(default_path) = opts.default_path {
7323            query = query.arg("defaultPath", default_path);
7324        }
7325        if let Some(ignore) = opts.ignore {
7326            query = query.arg("ignore", ignore);
7327        }
7328        if let Some(source_map) = opts.source_map {
7329            query = query.arg("sourceMap", source_map);
7330        }
7331        Function {
7332            proc: self.proc.clone(),
7333            selection: query,
7334            graphql_client: self.graphql_client.clone(),
7335        }
7336    }
7337    /// Returns the function with the given doc string.
7338    ///
7339    /// # Arguments
7340    ///
7341    /// * `description` - The doc string to set.
7342    pub fn with_description(&self, description: impl Into<String>) -> Function {
7343        let mut query = self.selection.select("withDescription");
7344        query = query.arg("description", description.into());
7345        Function {
7346            proc: self.proc.clone(),
7347            selection: query,
7348            graphql_client: self.graphql_client.clone(),
7349        }
7350    }
7351    /// Returns the function with the given source map.
7352    ///
7353    /// # Arguments
7354    ///
7355    /// * `source_map` - The source map for the function definition.
7356    pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
7357        let mut query = self.selection.select("withSourceMap");
7358        query = query.arg_lazy(
7359            "sourceMap",
7360            Box::new(move || {
7361                let source_map = source_map.clone();
7362                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
7363            }),
7364        );
7365        Function {
7366            proc: self.proc.clone(),
7367            selection: query,
7368            graphql_client: self.graphql_client.clone(),
7369        }
7370    }
7371}
7372#[derive(Clone)]
7373pub struct FunctionArg {
7374    pub proc: Option<Arc<DaggerSessionProc>>,
7375    pub selection: Selection,
7376    pub graphql_client: DynGraphQLClient,
7377}
7378impl FunctionArg {
7379    /// 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
7380    pub async fn default_path(&self) -> Result<String, DaggerError> {
7381        let query = self.selection.select("defaultPath");
7382        query.execute(self.graphql_client.clone()).await
7383    }
7384    /// A default value to use for this argument when not explicitly set by the caller, if any.
7385    pub async fn default_value(&self) -> Result<Json, DaggerError> {
7386        let query = self.selection.select("defaultValue");
7387        query.execute(self.graphql_client.clone()).await
7388    }
7389    /// A doc string for the argument, if any.
7390    pub async fn description(&self) -> Result<String, DaggerError> {
7391        let query = self.selection.select("description");
7392        query.execute(self.graphql_client.clone()).await
7393    }
7394    /// A unique identifier for this FunctionArg.
7395    pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
7396        let query = self.selection.select("id");
7397        query.execute(self.graphql_client.clone()).await
7398    }
7399    /// 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.
7400    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
7401        let query = self.selection.select("ignore");
7402        query.execute(self.graphql_client.clone()).await
7403    }
7404    /// The name of the argument in lowerCamelCase format.
7405    pub async fn name(&self) -> Result<String, DaggerError> {
7406        let query = self.selection.select("name");
7407        query.execute(self.graphql_client.clone()).await
7408    }
7409    /// The location of this arg declaration.
7410    pub fn source_map(&self) -> SourceMap {
7411        let query = self.selection.select("sourceMap");
7412        SourceMap {
7413            proc: self.proc.clone(),
7414            selection: query,
7415            graphql_client: self.graphql_client.clone(),
7416        }
7417    }
7418    /// The type of the argument.
7419    pub fn type_def(&self) -> TypeDef {
7420        let query = self.selection.select("typeDef");
7421        TypeDef {
7422            proc: self.proc.clone(),
7423            selection: query,
7424            graphql_client: self.graphql_client.clone(),
7425        }
7426    }
7427}
7428#[derive(Clone)]
7429pub struct FunctionCall {
7430    pub proc: Option<Arc<DaggerSessionProc>>,
7431    pub selection: Selection,
7432    pub graphql_client: DynGraphQLClient,
7433}
7434impl FunctionCall {
7435    /// A unique identifier for this FunctionCall.
7436    pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
7437        let query = self.selection.select("id");
7438        query.execute(self.graphql_client.clone()).await
7439    }
7440    /// The argument values the function is being invoked with.
7441    pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
7442        let query = self.selection.select("inputArgs");
7443        vec![FunctionCallArgValue {
7444            proc: self.proc.clone(),
7445            selection: query,
7446            graphql_client: self.graphql_client.clone(),
7447        }]
7448    }
7449    /// The name of the function being called.
7450    pub async fn name(&self) -> Result<String, DaggerError> {
7451        let query = self.selection.select("name");
7452        query.execute(self.graphql_client.clone()).await
7453    }
7454    /// 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.
7455    pub async fn parent(&self) -> Result<Json, DaggerError> {
7456        let query = self.selection.select("parent");
7457        query.execute(self.graphql_client.clone()).await
7458    }
7459    /// 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.
7460    pub async fn parent_name(&self) -> Result<String, DaggerError> {
7461        let query = self.selection.select("parentName");
7462        query.execute(self.graphql_client.clone()).await
7463    }
7464    /// Return an error from the function.
7465    ///
7466    /// # Arguments
7467    ///
7468    /// * `error` - The error to return.
7469    pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
7470        let mut query = self.selection.select("returnError");
7471        query = query.arg_lazy(
7472            "error",
7473            Box::new(move || {
7474                let error = error.clone();
7475                Box::pin(async move { error.into_id().await.unwrap().quote() })
7476            }),
7477        );
7478        query.execute(self.graphql_client.clone()).await
7479    }
7480    /// Set the return value of the function call to the provided value.
7481    ///
7482    /// # Arguments
7483    ///
7484    /// * `value` - JSON serialization of the return value.
7485    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
7486        let mut query = self.selection.select("returnValue");
7487        query = query.arg("value", value);
7488        query.execute(self.graphql_client.clone()).await
7489    }
7490}
7491#[derive(Clone)]
7492pub struct FunctionCallArgValue {
7493    pub proc: Option<Arc<DaggerSessionProc>>,
7494    pub selection: Selection,
7495    pub graphql_client: DynGraphQLClient,
7496}
7497impl FunctionCallArgValue {
7498    /// A unique identifier for this FunctionCallArgValue.
7499    pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
7500        let query = self.selection.select("id");
7501        query.execute(self.graphql_client.clone()).await
7502    }
7503    /// The name of the argument.
7504    pub async fn name(&self) -> Result<String, DaggerError> {
7505        let query = self.selection.select("name");
7506        query.execute(self.graphql_client.clone()).await
7507    }
7508    /// The value of the argument represented as a JSON serialized string.
7509    pub async fn value(&self) -> Result<Json, DaggerError> {
7510        let query = self.selection.select("value");
7511        query.execute(self.graphql_client.clone()).await
7512    }
7513}
7514#[derive(Clone)]
7515pub struct GeneratedCode {
7516    pub proc: Option<Arc<DaggerSessionProc>>,
7517    pub selection: Selection,
7518    pub graphql_client: DynGraphQLClient,
7519}
7520impl GeneratedCode {
7521    /// The directory containing the generated code.
7522    pub fn code(&self) -> Directory {
7523        let query = self.selection.select("code");
7524        Directory {
7525            proc: self.proc.clone(),
7526            selection: query,
7527            graphql_client: self.graphql_client.clone(),
7528        }
7529    }
7530    /// A unique identifier for this GeneratedCode.
7531    pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
7532        let query = self.selection.select("id");
7533        query.execute(self.graphql_client.clone()).await
7534    }
7535    /// List of paths to mark generated in version control (i.e. .gitattributes).
7536    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
7537        let query = self.selection.select("vcsGeneratedPaths");
7538        query.execute(self.graphql_client.clone()).await
7539    }
7540    /// List of paths to ignore in version control (i.e. .gitignore).
7541    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
7542        let query = self.selection.select("vcsIgnoredPaths");
7543        query.execute(self.graphql_client.clone()).await
7544    }
7545    /// Set the list of paths to mark generated in version control.
7546    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
7547        let mut query = self.selection.select("withVCSGeneratedPaths");
7548        query = query.arg(
7549            "paths",
7550            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
7551        );
7552        GeneratedCode {
7553            proc: self.proc.clone(),
7554            selection: query,
7555            graphql_client: self.graphql_client.clone(),
7556        }
7557    }
7558    /// Set the list of paths to ignore in version control.
7559    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
7560        let mut query = self.selection.select("withVCSIgnoredPaths");
7561        query = query.arg(
7562            "paths",
7563            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
7564        );
7565        GeneratedCode {
7566            proc: self.proc.clone(),
7567            selection: query,
7568            graphql_client: self.graphql_client.clone(),
7569        }
7570    }
7571}
7572#[derive(Clone)]
7573pub struct GitRef {
7574    pub proc: Option<Arc<DaggerSessionProc>>,
7575    pub selection: Selection,
7576    pub graphql_client: DynGraphQLClient,
7577}
7578#[derive(Builder, Debug, PartialEq)]
7579pub struct GitRefTreeOpts {
7580    /// The depth of the tree to fetch.
7581    #[builder(setter(into, strip_option), default)]
7582    pub depth: Option<isize>,
7583    /// Set to true to discard .git directory.
7584    #[builder(setter(into, strip_option), default)]
7585    pub discard_git_dir: Option<bool>,
7586}
7587impl GitRef {
7588    /// The resolved commit id at this ref.
7589    pub async fn commit(&self) -> Result<String, DaggerError> {
7590        let query = self.selection.select("commit");
7591        query.execute(self.graphql_client.clone()).await
7592    }
7593    /// Find the best common ancestor between this ref and another ref.
7594    ///
7595    /// # Arguments
7596    ///
7597    /// * `other` - The other ref to compare against.
7598    pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
7599        let mut query = self.selection.select("commonAncestor");
7600        query = query.arg_lazy(
7601            "other",
7602            Box::new(move || {
7603                let other = other.clone();
7604                Box::pin(async move { other.into_id().await.unwrap().quote() })
7605            }),
7606        );
7607        GitRef {
7608            proc: self.proc.clone(),
7609            selection: query,
7610            graphql_client: self.graphql_client.clone(),
7611        }
7612    }
7613    /// A unique identifier for this GitRef.
7614    pub async fn id(&self) -> Result<GitRefId, DaggerError> {
7615        let query = self.selection.select("id");
7616        query.execute(self.graphql_client.clone()).await
7617    }
7618    /// The resolved ref name at this ref.
7619    pub async fn r#ref(&self) -> Result<String, DaggerError> {
7620        let query = self.selection.select("ref");
7621        query.execute(self.graphql_client.clone()).await
7622    }
7623    /// The filesystem tree at this ref.
7624    ///
7625    /// # Arguments
7626    ///
7627    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7628    pub fn tree(&self) -> Directory {
7629        let query = self.selection.select("tree");
7630        Directory {
7631            proc: self.proc.clone(),
7632            selection: query,
7633            graphql_client: self.graphql_client.clone(),
7634        }
7635    }
7636    /// The filesystem tree at this ref.
7637    ///
7638    /// # Arguments
7639    ///
7640    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7641    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
7642        let mut query = self.selection.select("tree");
7643        if let Some(discard_git_dir) = opts.discard_git_dir {
7644            query = query.arg("discardGitDir", discard_git_dir);
7645        }
7646        if let Some(depth) = opts.depth {
7647            query = query.arg("depth", depth);
7648        }
7649        Directory {
7650            proc: self.proc.clone(),
7651            selection: query,
7652            graphql_client: self.graphql_client.clone(),
7653        }
7654    }
7655}
7656#[derive(Clone)]
7657pub struct GitRepository {
7658    pub proc: Option<Arc<DaggerSessionProc>>,
7659    pub selection: Selection,
7660    pub graphql_client: DynGraphQLClient,
7661}
7662#[derive(Builder, Debug, PartialEq)]
7663pub struct GitRepositoryBranchesOpts<'a> {
7664    /// Glob patterns (e.g., "refs/tags/v*").
7665    #[builder(setter(into, strip_option), default)]
7666    pub patterns: Option<Vec<&'a str>>,
7667}
7668#[derive(Builder, Debug, PartialEq)]
7669pub struct GitRepositoryTagsOpts<'a> {
7670    /// Glob patterns (e.g., "refs/tags/v*").
7671    #[builder(setter(into, strip_option), default)]
7672    pub patterns: Option<Vec<&'a str>>,
7673}
7674impl GitRepository {
7675    /// Returns details of a branch.
7676    ///
7677    /// # Arguments
7678    ///
7679    /// * `name` - Branch's name (e.g., "main").
7680    pub fn branch(&self, name: impl Into<String>) -> GitRef {
7681        let mut query = self.selection.select("branch");
7682        query = query.arg("name", name.into());
7683        GitRef {
7684            proc: self.proc.clone(),
7685            selection: query,
7686            graphql_client: self.graphql_client.clone(),
7687        }
7688    }
7689    /// branches that match any of the given glob patterns.
7690    ///
7691    /// # Arguments
7692    ///
7693    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7694    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
7695        let query = self.selection.select("branches");
7696        query.execute(self.graphql_client.clone()).await
7697    }
7698    /// branches that match any of the given glob patterns.
7699    ///
7700    /// # Arguments
7701    ///
7702    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7703    pub async fn branches_opts<'a>(
7704        &self,
7705        opts: GitRepositoryBranchesOpts<'a>,
7706    ) -> Result<Vec<String>, DaggerError> {
7707        let mut query = self.selection.select("branches");
7708        if let Some(patterns) = opts.patterns {
7709            query = query.arg("patterns", patterns);
7710        }
7711        query.execute(self.graphql_client.clone()).await
7712    }
7713    /// Returns details of a commit.
7714    ///
7715    /// # Arguments
7716    ///
7717    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
7718    pub fn commit(&self, id: impl Into<String>) -> GitRef {
7719        let mut query = self.selection.select("commit");
7720        query = query.arg("id", id.into());
7721        GitRef {
7722            proc: self.proc.clone(),
7723            selection: query,
7724            graphql_client: self.graphql_client.clone(),
7725        }
7726    }
7727    /// Returns details for HEAD.
7728    pub fn head(&self) -> GitRef {
7729        let query = self.selection.select("head");
7730        GitRef {
7731            proc: self.proc.clone(),
7732            selection: query,
7733            graphql_client: self.graphql_client.clone(),
7734        }
7735    }
7736    /// A unique identifier for this GitRepository.
7737    pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
7738        let query = self.selection.select("id");
7739        query.execute(self.graphql_client.clone()).await
7740    }
7741    /// Returns details for the latest semver tag.
7742    pub fn latest_version(&self) -> GitRef {
7743        let query = self.selection.select("latestVersion");
7744        GitRef {
7745            proc: self.proc.clone(),
7746            selection: query,
7747            graphql_client: self.graphql_client.clone(),
7748        }
7749    }
7750    /// Returns details of a ref.
7751    ///
7752    /// # Arguments
7753    ///
7754    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
7755    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
7756        let mut query = self.selection.select("ref");
7757        query = query.arg("name", name.into());
7758        GitRef {
7759            proc: self.proc.clone(),
7760            selection: query,
7761            graphql_client: self.graphql_client.clone(),
7762        }
7763    }
7764    /// Returns details of a tag.
7765    ///
7766    /// # Arguments
7767    ///
7768    /// * `name` - Tag's name (e.g., "v0.3.9").
7769    pub fn tag(&self, name: impl Into<String>) -> GitRef {
7770        let mut query = self.selection.select("tag");
7771        query = query.arg("name", name.into());
7772        GitRef {
7773            proc: self.proc.clone(),
7774            selection: query,
7775            graphql_client: self.graphql_client.clone(),
7776        }
7777    }
7778    /// tags that match any of the given glob patterns.
7779    ///
7780    /// # Arguments
7781    ///
7782    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7783    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
7784        let query = self.selection.select("tags");
7785        query.execute(self.graphql_client.clone()).await
7786    }
7787    /// tags that match any of the given glob patterns.
7788    ///
7789    /// # Arguments
7790    ///
7791    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7792    pub async fn tags_opts<'a>(
7793        &self,
7794        opts: GitRepositoryTagsOpts<'a>,
7795    ) -> Result<Vec<String>, DaggerError> {
7796        let mut query = self.selection.select("tags");
7797        if let Some(patterns) = opts.patterns {
7798            query = query.arg("patterns", patterns);
7799        }
7800        query.execute(self.graphql_client.clone()).await
7801    }
7802    /// The URL of the git repository.
7803    pub async fn url(&self) -> Result<String, DaggerError> {
7804        let query = self.selection.select("url");
7805        query.execute(self.graphql_client.clone()).await
7806    }
7807    /// Header to authenticate the remote with.
7808    ///
7809    /// # Arguments
7810    ///
7811    /// * `header` - Secret used to populate the Authorization HTTP header
7812    pub fn with_auth_header(&self, header: impl IntoID<SecretId>) -> GitRepository {
7813        let mut query = self.selection.select("withAuthHeader");
7814        query = query.arg_lazy(
7815            "header",
7816            Box::new(move || {
7817                let header = header.clone();
7818                Box::pin(async move { header.into_id().await.unwrap().quote() })
7819            }),
7820        );
7821        GitRepository {
7822            proc: self.proc.clone(),
7823            selection: query,
7824            graphql_client: self.graphql_client.clone(),
7825        }
7826    }
7827    /// Token to authenticate the remote with.
7828    ///
7829    /// # Arguments
7830    ///
7831    /// * `token` - Secret used to populate the password during basic HTTP Authorization
7832    pub fn with_auth_token(&self, token: impl IntoID<SecretId>) -> GitRepository {
7833        let mut query = self.selection.select("withAuthToken");
7834        query = query.arg_lazy(
7835            "token",
7836            Box::new(move || {
7837                let token = token.clone();
7838                Box::pin(async move { token.into_id().await.unwrap().quote() })
7839            }),
7840        );
7841        GitRepository {
7842            proc: self.proc.clone(),
7843            selection: query,
7844            graphql_client: self.graphql_client.clone(),
7845        }
7846    }
7847}
7848#[derive(Clone)]
7849pub struct Host {
7850    pub proc: Option<Arc<DaggerSessionProc>>,
7851    pub selection: Selection,
7852    pub graphql_client: DynGraphQLClient,
7853}
7854#[derive(Builder, Debug, PartialEq)]
7855pub struct HostDirectoryOpts<'a> {
7856    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
7857    #[builder(setter(into, strip_option), default)]
7858    pub exclude: Option<Vec<&'a str>>,
7859    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
7860    #[builder(setter(into, strip_option), default)]
7861    pub include: Option<Vec<&'a str>>,
7862    /// If true, the directory will always be reloaded from the host.
7863    #[builder(setter(into, strip_option), default)]
7864    pub no_cache: Option<bool>,
7865    /// Don't apply .gitignore filter rules inside the directory
7866    #[builder(setter(into, strip_option), default)]
7867    pub no_git_auto_ignore: Option<bool>,
7868}
7869#[derive(Builder, Debug, PartialEq)]
7870pub struct HostFileOpts {
7871    /// If true, the file will always be reloaded from the host.
7872    #[builder(setter(into, strip_option), default)]
7873    pub no_cache: Option<bool>,
7874}
7875#[derive(Builder, Debug, PartialEq)]
7876pub struct HostServiceOpts<'a> {
7877    /// Upstream host to forward traffic to.
7878    #[builder(setter(into, strip_option), default)]
7879    pub host: Option<&'a str>,
7880}
7881#[derive(Builder, Debug, PartialEq)]
7882pub struct HostTunnelOpts {
7883    /// Map each service port to the same port on the host, as if the service were running natively.
7884    /// Note: enabling may result in port conflicts.
7885    #[builder(setter(into, strip_option), default)]
7886    pub native: Option<bool>,
7887    /// Configure explicit port forwarding rules for the tunnel.
7888    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
7889    /// 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.
7890    /// If ports are given and native is true, the ports are additive.
7891    #[builder(setter(into, strip_option), default)]
7892    pub ports: Option<Vec<PortForward>>,
7893}
7894impl Host {
7895    /// Accesses a container image on the host.
7896    ///
7897    /// # Arguments
7898    ///
7899    /// * `name` - Name of the image to access.
7900    pub fn container_image(&self, name: impl Into<String>) -> Container {
7901        let mut query = self.selection.select("containerImage");
7902        query = query.arg("name", name.into());
7903        Container {
7904            proc: self.proc.clone(),
7905            selection: query,
7906            graphql_client: self.graphql_client.clone(),
7907        }
7908    }
7909    /// Accesses a directory on the host.
7910    ///
7911    /// # Arguments
7912    ///
7913    /// * `path` - Location of the directory to access (e.g., ".").
7914    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7915    pub fn directory(&self, path: impl Into<String>) -> Directory {
7916        let mut query = self.selection.select("directory");
7917        query = query.arg("path", path.into());
7918        Directory {
7919            proc: self.proc.clone(),
7920            selection: query,
7921            graphql_client: self.graphql_client.clone(),
7922        }
7923    }
7924    /// Accesses a directory on the host.
7925    ///
7926    /// # Arguments
7927    ///
7928    /// * `path` - Location of the directory to access (e.g., ".").
7929    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7930    pub fn directory_opts<'a>(
7931        &self,
7932        path: impl Into<String>,
7933        opts: HostDirectoryOpts<'a>,
7934    ) -> Directory {
7935        let mut query = self.selection.select("directory");
7936        query = query.arg("path", path.into());
7937        if let Some(exclude) = opts.exclude {
7938            query = query.arg("exclude", exclude);
7939        }
7940        if let Some(include) = opts.include {
7941            query = query.arg("include", include);
7942        }
7943        if let Some(no_cache) = opts.no_cache {
7944            query = query.arg("noCache", no_cache);
7945        }
7946        if let Some(no_git_auto_ignore) = opts.no_git_auto_ignore {
7947            query = query.arg("noGitAutoIgnore", no_git_auto_ignore);
7948        }
7949        Directory {
7950            proc: self.proc.clone(),
7951            selection: query,
7952            graphql_client: self.graphql_client.clone(),
7953        }
7954    }
7955    /// Accesses a file on the host.
7956    ///
7957    /// # Arguments
7958    ///
7959    /// * `path` - Location of the file to retrieve (e.g., "README.md").
7960    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7961    pub fn file(&self, path: impl Into<String>) -> File {
7962        let mut query = self.selection.select("file");
7963        query = query.arg("path", path.into());
7964        File {
7965            proc: self.proc.clone(),
7966            selection: query,
7967            graphql_client: self.graphql_client.clone(),
7968        }
7969    }
7970    /// Accesses a file on the host.
7971    ///
7972    /// # Arguments
7973    ///
7974    /// * `path` - Location of the file to retrieve (e.g., "README.md").
7975    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7976    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
7977        let mut query = self.selection.select("file");
7978        query = query.arg("path", path.into());
7979        if let Some(no_cache) = opts.no_cache {
7980            query = query.arg("noCache", no_cache);
7981        }
7982        File {
7983            proc: self.proc.clone(),
7984            selection: query,
7985            graphql_client: self.graphql_client.clone(),
7986        }
7987    }
7988    /// A unique identifier for this Host.
7989    pub async fn id(&self) -> Result<HostId, DaggerError> {
7990        let query = self.selection.select("id");
7991        query.execute(self.graphql_client.clone()).await
7992    }
7993    /// Creates a service that forwards traffic to a specified address via the host.
7994    ///
7995    /// # Arguments
7996    ///
7997    /// * `ports` - Ports to expose via the service, forwarding through the host network.
7998    ///
7999    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
8000    ///
8001    /// An empty set of ports is not valid; an error will be returned.
8002    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8003    pub fn service(&self, ports: Vec<PortForward>) -> Service {
8004        let mut query = self.selection.select("service");
8005        query = query.arg("ports", ports);
8006        Service {
8007            proc: self.proc.clone(),
8008            selection: query,
8009            graphql_client: self.graphql_client.clone(),
8010        }
8011    }
8012    /// Creates a service that forwards traffic to a specified address via the host.
8013    ///
8014    /// # Arguments
8015    ///
8016    /// * `ports` - Ports to expose via the service, forwarding through the host network.
8017    ///
8018    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
8019    ///
8020    /// An empty set of ports is not valid; an error will be returned.
8021    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8022    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
8023        let mut query = self.selection.select("service");
8024        query = query.arg("ports", ports);
8025        if let Some(host) = opts.host {
8026            query = query.arg("host", host);
8027        }
8028        Service {
8029            proc: self.proc.clone(),
8030            selection: query,
8031            graphql_client: self.graphql_client.clone(),
8032        }
8033    }
8034    /// Sets a secret given a user-defined name and the file path on the host, and returns the secret.
8035    /// The file is limited to a size of 512000 bytes.
8036    ///
8037    /// # Arguments
8038    ///
8039    /// * `name` - The user defined name for this secret.
8040    /// * `path` - Location of the file to set as a secret.
8041    pub fn set_secret_file(&self, name: impl Into<String>, path: impl Into<String>) -> Secret {
8042        let mut query = self.selection.select("setSecretFile");
8043        query = query.arg("name", name.into());
8044        query = query.arg("path", path.into());
8045        Secret {
8046            proc: self.proc.clone(),
8047            selection: query,
8048            graphql_client: self.graphql_client.clone(),
8049        }
8050    }
8051    /// Creates a tunnel that forwards traffic from the host to a service.
8052    ///
8053    /// # Arguments
8054    ///
8055    /// * `service` - Service to send traffic from the tunnel.
8056    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8057    pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
8058        let mut query = self.selection.select("tunnel");
8059        query = query.arg_lazy(
8060            "service",
8061            Box::new(move || {
8062                let service = service.clone();
8063                Box::pin(async move { service.into_id().await.unwrap().quote() })
8064            }),
8065        );
8066        Service {
8067            proc: self.proc.clone(),
8068            selection: query,
8069            graphql_client: self.graphql_client.clone(),
8070        }
8071    }
8072    /// Creates a tunnel that forwards traffic from the host to a service.
8073    ///
8074    /// # Arguments
8075    ///
8076    /// * `service` - Service to send traffic from the tunnel.
8077    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8078    pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
8079        let mut query = self.selection.select("tunnel");
8080        query = query.arg_lazy(
8081            "service",
8082            Box::new(move || {
8083                let service = service.clone();
8084                Box::pin(async move { service.into_id().await.unwrap().quote() })
8085            }),
8086        );
8087        if let Some(native) = opts.native {
8088            query = query.arg("native", native);
8089        }
8090        if let Some(ports) = opts.ports {
8091            query = query.arg("ports", ports);
8092        }
8093        Service {
8094            proc: self.proc.clone(),
8095            selection: query,
8096            graphql_client: self.graphql_client.clone(),
8097        }
8098    }
8099    /// Accesses a Unix socket on the host.
8100    ///
8101    /// # Arguments
8102    ///
8103    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
8104    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
8105        let mut query = self.selection.select("unixSocket");
8106        query = query.arg("path", path.into());
8107        Socket {
8108            proc: self.proc.clone(),
8109            selection: query,
8110            graphql_client: self.graphql_client.clone(),
8111        }
8112    }
8113}
8114#[derive(Clone)]
8115pub struct InputTypeDef {
8116    pub proc: Option<Arc<DaggerSessionProc>>,
8117    pub selection: Selection,
8118    pub graphql_client: DynGraphQLClient,
8119}
8120impl InputTypeDef {
8121    /// Static fields defined on this input object, if any.
8122    pub fn fields(&self) -> Vec<FieldTypeDef> {
8123        let query = self.selection.select("fields");
8124        vec![FieldTypeDef {
8125            proc: self.proc.clone(),
8126            selection: query,
8127            graphql_client: self.graphql_client.clone(),
8128        }]
8129    }
8130    /// A unique identifier for this InputTypeDef.
8131    pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
8132        let query = self.selection.select("id");
8133        query.execute(self.graphql_client.clone()).await
8134    }
8135    /// The name of the input object.
8136    pub async fn name(&self) -> Result<String, DaggerError> {
8137        let query = self.selection.select("name");
8138        query.execute(self.graphql_client.clone()).await
8139    }
8140}
8141#[derive(Clone)]
8142pub struct InterfaceTypeDef {
8143    pub proc: Option<Arc<DaggerSessionProc>>,
8144    pub selection: Selection,
8145    pub graphql_client: DynGraphQLClient,
8146}
8147impl InterfaceTypeDef {
8148    /// The doc string for the interface, if any.
8149    pub async fn description(&self) -> Result<String, DaggerError> {
8150        let query = self.selection.select("description");
8151        query.execute(self.graphql_client.clone()).await
8152    }
8153    /// Functions defined on this interface, if any.
8154    pub fn functions(&self) -> Vec<Function> {
8155        let query = self.selection.select("functions");
8156        vec![Function {
8157            proc: self.proc.clone(),
8158            selection: query,
8159            graphql_client: self.graphql_client.clone(),
8160        }]
8161    }
8162    /// A unique identifier for this InterfaceTypeDef.
8163    pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
8164        let query = self.selection.select("id");
8165        query.execute(self.graphql_client.clone()).await
8166    }
8167    /// The name of the interface.
8168    pub async fn name(&self) -> Result<String, DaggerError> {
8169        let query = self.selection.select("name");
8170        query.execute(self.graphql_client.clone()).await
8171    }
8172    /// The location of this interface declaration.
8173    pub fn source_map(&self) -> SourceMap {
8174        let query = self.selection.select("sourceMap");
8175        SourceMap {
8176            proc: self.proc.clone(),
8177            selection: query,
8178            graphql_client: self.graphql_client.clone(),
8179        }
8180    }
8181    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
8182    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8183        let query = self.selection.select("sourceModuleName");
8184        query.execute(self.graphql_client.clone()).await
8185    }
8186}
8187#[derive(Clone)]
8188pub struct JsonValue {
8189    pub proc: Option<Arc<DaggerSessionProc>>,
8190    pub selection: Selection,
8191    pub graphql_client: DynGraphQLClient,
8192}
8193#[derive(Builder, Debug, PartialEq)]
8194pub struct JsonValueContentsOpts<'a> {
8195    /// Optional line prefix
8196    #[builder(setter(into, strip_option), default)]
8197    pub indent: Option<&'a str>,
8198    /// Pretty-print
8199    #[builder(setter(into, strip_option), default)]
8200    pub pretty: Option<bool>,
8201}
8202impl JsonValue {
8203    /// Decode an array from json
8204    pub fn as_array(&self) -> Vec<JsonValue> {
8205        let query = self.selection.select("asArray");
8206        vec![JsonValue {
8207            proc: self.proc.clone(),
8208            selection: query,
8209            graphql_client: self.graphql_client.clone(),
8210        }]
8211    }
8212    /// Decode a boolean from json
8213    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
8214        let query = self.selection.select("asBoolean");
8215        query.execute(self.graphql_client.clone()).await
8216    }
8217    /// Decode an integer from json
8218    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
8219        let query = self.selection.select("asInteger");
8220        query.execute(self.graphql_client.clone()).await
8221    }
8222    /// Decode a string from json
8223    pub async fn as_string(&self) -> Result<String, DaggerError> {
8224        let query = self.selection.select("asString");
8225        query.execute(self.graphql_client.clone()).await
8226    }
8227    /// Return the value encoded as json
8228    ///
8229    /// # Arguments
8230    ///
8231    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8232    pub async fn contents(&self) -> Result<Json, DaggerError> {
8233        let query = self.selection.select("contents");
8234        query.execute(self.graphql_client.clone()).await
8235    }
8236    /// Return the value encoded as json
8237    ///
8238    /// # Arguments
8239    ///
8240    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8241    pub async fn contents_opts<'a>(
8242        &self,
8243        opts: JsonValueContentsOpts<'a>,
8244    ) -> Result<Json, DaggerError> {
8245        let mut query = self.selection.select("contents");
8246        if let Some(pretty) = opts.pretty {
8247            query = query.arg("pretty", pretty);
8248        }
8249        if let Some(indent) = opts.indent {
8250            query = query.arg("indent", indent);
8251        }
8252        query.execute(self.graphql_client.clone()).await
8253    }
8254    /// Lookup the field at the given path, and return its value.
8255    ///
8256    /// # Arguments
8257    ///
8258    /// * `path` - Path of the field to lookup, encoded as an array of field names
8259    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
8260        let mut query = self.selection.select("field");
8261        query = query.arg(
8262            "path",
8263            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8264        );
8265        JsonValue {
8266            proc: self.proc.clone(),
8267            selection: query,
8268            graphql_client: self.graphql_client.clone(),
8269        }
8270    }
8271    /// List fields of the encoded object
8272    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
8273        let query = self.selection.select("fields");
8274        query.execute(self.graphql_client.clone()).await
8275    }
8276    /// A unique identifier for this JSONValue.
8277    pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
8278        let query = self.selection.select("id");
8279        query.execute(self.graphql_client.clone()).await
8280    }
8281    /// Encode a boolean to json
8282    ///
8283    /// # Arguments
8284    ///
8285    /// * `value` - New boolean value
8286    pub fn new_boolean(&self, value: bool) -> JsonValue {
8287        let mut query = self.selection.select("newBoolean");
8288        query = query.arg("value", value);
8289        JsonValue {
8290            proc: self.proc.clone(),
8291            selection: query,
8292            graphql_client: self.graphql_client.clone(),
8293        }
8294    }
8295    /// Encode an integer to json
8296    ///
8297    /// # Arguments
8298    ///
8299    /// * `value` - New integer value
8300    pub fn new_integer(&self, value: isize) -> JsonValue {
8301        let mut query = self.selection.select("newInteger");
8302        query = query.arg("value", value);
8303        JsonValue {
8304            proc: self.proc.clone(),
8305            selection: query,
8306            graphql_client: self.graphql_client.clone(),
8307        }
8308    }
8309    /// Encode a string to json
8310    ///
8311    /// # Arguments
8312    ///
8313    /// * `value` - New string value
8314    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
8315        let mut query = self.selection.select("newString");
8316        query = query.arg("value", value.into());
8317        JsonValue {
8318            proc: self.proc.clone(),
8319            selection: query,
8320            graphql_client: self.graphql_client.clone(),
8321        }
8322    }
8323    /// Return a new json value, decoded from the given content
8324    ///
8325    /// # Arguments
8326    ///
8327    /// * `contents` - New JSON-encoded contents
8328    pub fn with_contents(&self, contents: Json) -> JsonValue {
8329        let mut query = self.selection.select("withContents");
8330        query = query.arg("contents", contents);
8331        JsonValue {
8332            proc: self.proc.clone(),
8333            selection: query,
8334            graphql_client: self.graphql_client.clone(),
8335        }
8336    }
8337    /// Set a new field at the given path
8338    ///
8339    /// # Arguments
8340    ///
8341    /// * `path` - Path of the field to set, encoded as an array of field names
8342    /// * `value` - The new value of the field
8343    pub fn with_field(
8344        &self,
8345        path: Vec<impl Into<String>>,
8346        value: impl IntoID<JsonValueId>,
8347    ) -> JsonValue {
8348        let mut query = self.selection.select("withField");
8349        query = query.arg(
8350            "path",
8351            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8352        );
8353        query = query.arg_lazy(
8354            "value",
8355            Box::new(move || {
8356                let value = value.clone();
8357                Box::pin(async move { value.into_id().await.unwrap().quote() })
8358            }),
8359        );
8360        JsonValue {
8361            proc: self.proc.clone(),
8362            selection: query,
8363            graphql_client: self.graphql_client.clone(),
8364        }
8365    }
8366}
8367#[derive(Clone)]
8368pub struct Llm {
8369    pub proc: Option<Arc<DaggerSessionProc>>,
8370    pub selection: Selection,
8371    pub graphql_client: DynGraphQLClient,
8372}
8373impl Llm {
8374    /// create a branch in the LLM's history
8375    pub fn attempt(&self, number: isize) -> Llm {
8376        let mut query = self.selection.select("attempt");
8377        query = query.arg("number", number);
8378        Llm {
8379            proc: self.proc.clone(),
8380            selection: query,
8381            graphql_client: self.graphql_client.clone(),
8382        }
8383    }
8384    /// returns the type of the current state
8385    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
8386        let mut query = self.selection.select("bindResult");
8387        query = query.arg("name", name.into());
8388        Binding {
8389            proc: self.proc.clone(),
8390            selection: query,
8391            graphql_client: self.graphql_client.clone(),
8392        }
8393    }
8394    /// return the LLM's current environment
8395    pub fn env(&self) -> Env {
8396        let query = self.selection.select("env");
8397        Env {
8398            proc: self.proc.clone(),
8399            selection: query,
8400            graphql_client: self.graphql_client.clone(),
8401        }
8402    }
8403    /// return the llm message history
8404    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
8405        let query = self.selection.select("history");
8406        query.execute(self.graphql_client.clone()).await
8407    }
8408    /// return the raw llm message history as json
8409    pub async fn history_json(&self) -> Result<Json, DaggerError> {
8410        let query = self.selection.select("historyJSON");
8411        query.execute(self.graphql_client.clone()).await
8412    }
8413    /// A unique identifier for this LLM.
8414    pub async fn id(&self) -> Result<Llmid, DaggerError> {
8415        let query = self.selection.select("id");
8416        query.execute(self.graphql_client.clone()).await
8417    }
8418    /// return the last llm reply from the history
8419    pub async fn last_reply(&self) -> Result<String, DaggerError> {
8420        let query = self.selection.select("lastReply");
8421        query.execute(self.graphql_client.clone()).await
8422    }
8423    /// synchronize LLM state
8424    pub fn r#loop(&self) -> Llm {
8425        let query = self.selection.select("loop");
8426        Llm {
8427            proc: self.proc.clone(),
8428            selection: query,
8429            graphql_client: self.graphql_client.clone(),
8430        }
8431    }
8432    /// return the model used by the llm
8433    pub async fn model(&self) -> Result<String, DaggerError> {
8434        let query = self.selection.select("model");
8435        query.execute(self.graphql_client.clone()).await
8436    }
8437    /// return the provider used by the llm
8438    pub async fn provider(&self) -> Result<String, DaggerError> {
8439        let query = self.selection.select("provider");
8440        query.execute(self.graphql_client.clone()).await
8441    }
8442    /// synchronize LLM state
8443    pub async fn sync(&self) -> Result<Llmid, DaggerError> {
8444        let query = self.selection.select("sync");
8445        query.execute(self.graphql_client.clone()).await
8446    }
8447    /// returns the token usage of the current state
8448    pub fn token_usage(&self) -> LlmTokenUsage {
8449        let query = self.selection.select("tokenUsage");
8450        LlmTokenUsage {
8451            proc: self.proc.clone(),
8452            selection: query,
8453            graphql_client: self.graphql_client.clone(),
8454        }
8455    }
8456    /// print documentation for available tools
8457    pub async fn tools(&self) -> Result<String, DaggerError> {
8458        let query = self.selection.select("tools");
8459        query.execute(self.graphql_client.clone()).await
8460    }
8461    /// allow the LLM to interact with an environment via MCP
8462    pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
8463        let mut query = self.selection.select("withEnv");
8464        query = query.arg_lazy(
8465            "env",
8466            Box::new(move || {
8467                let env = env.clone();
8468                Box::pin(async move { env.into_id().await.unwrap().quote() })
8469            }),
8470        );
8471        Llm {
8472            proc: self.proc.clone(),
8473            selection: query,
8474            graphql_client: self.graphql_client.clone(),
8475        }
8476    }
8477    /// swap out the llm model
8478    ///
8479    /// # Arguments
8480    ///
8481    /// * `model` - The model to use
8482    pub fn with_model(&self, model: impl Into<String>) -> Llm {
8483        let mut query = self.selection.select("withModel");
8484        query = query.arg("model", model.into());
8485        Llm {
8486            proc: self.proc.clone(),
8487            selection: query,
8488            graphql_client: self.graphql_client.clone(),
8489        }
8490    }
8491    /// append a prompt to the llm context
8492    ///
8493    /// # Arguments
8494    ///
8495    /// * `prompt` - The prompt to send
8496    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
8497        let mut query = self.selection.select("withPrompt");
8498        query = query.arg("prompt", prompt.into());
8499        Llm {
8500            proc: self.proc.clone(),
8501            selection: query,
8502            graphql_client: self.graphql_client.clone(),
8503        }
8504    }
8505    /// append the contents of a file to the llm context
8506    ///
8507    /// # Arguments
8508    ///
8509    /// * `file` - The file to read the prompt from
8510    pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
8511        let mut query = self.selection.select("withPromptFile");
8512        query = query.arg_lazy(
8513            "file",
8514            Box::new(move || {
8515                let file = file.clone();
8516                Box::pin(async move { file.into_id().await.unwrap().quote() })
8517            }),
8518        );
8519        Llm {
8520            proc: self.proc.clone(),
8521            selection: query,
8522            graphql_client: self.graphql_client.clone(),
8523        }
8524    }
8525    /// Add a system prompt to the LLM's environment
8526    ///
8527    /// # Arguments
8528    ///
8529    /// * `prompt` - The system prompt to send
8530    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
8531        let mut query = self.selection.select("withSystemPrompt");
8532        query = query.arg("prompt", prompt.into());
8533        Llm {
8534            proc: self.proc.clone(),
8535            selection: query,
8536            graphql_client: self.graphql_client.clone(),
8537        }
8538    }
8539    /// Disable the default system prompt
8540    pub fn without_default_system_prompt(&self) -> Llm {
8541        let query = self.selection.select("withoutDefaultSystemPrompt");
8542        Llm {
8543            proc: self.proc.clone(),
8544            selection: query,
8545            graphql_client: self.graphql_client.clone(),
8546        }
8547    }
8548}
8549#[derive(Clone)]
8550pub struct LlmTokenUsage {
8551    pub proc: Option<Arc<DaggerSessionProc>>,
8552    pub selection: Selection,
8553    pub graphql_client: DynGraphQLClient,
8554}
8555impl LlmTokenUsage {
8556    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
8557        let query = self.selection.select("cachedTokenReads");
8558        query.execute(self.graphql_client.clone()).await
8559    }
8560    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
8561        let query = self.selection.select("cachedTokenWrites");
8562        query.execute(self.graphql_client.clone()).await
8563    }
8564    /// A unique identifier for this LLMTokenUsage.
8565    pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
8566        let query = self.selection.select("id");
8567        query.execute(self.graphql_client.clone()).await
8568    }
8569    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
8570        let query = self.selection.select("inputTokens");
8571        query.execute(self.graphql_client.clone()).await
8572    }
8573    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
8574        let query = self.selection.select("outputTokens");
8575        query.execute(self.graphql_client.clone()).await
8576    }
8577    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
8578        let query = self.selection.select("totalTokens");
8579        query.execute(self.graphql_client.clone()).await
8580    }
8581}
8582#[derive(Clone)]
8583pub struct Label {
8584    pub proc: Option<Arc<DaggerSessionProc>>,
8585    pub selection: Selection,
8586    pub graphql_client: DynGraphQLClient,
8587}
8588impl Label {
8589    /// A unique identifier for this Label.
8590    pub async fn id(&self) -> Result<LabelId, DaggerError> {
8591        let query = self.selection.select("id");
8592        query.execute(self.graphql_client.clone()).await
8593    }
8594    /// The label name.
8595    pub async fn name(&self) -> Result<String, DaggerError> {
8596        let query = self.selection.select("name");
8597        query.execute(self.graphql_client.clone()).await
8598    }
8599    /// The label value.
8600    pub async fn value(&self) -> Result<String, DaggerError> {
8601        let query = self.selection.select("value");
8602        query.execute(self.graphql_client.clone()).await
8603    }
8604}
8605#[derive(Clone)]
8606pub struct ListTypeDef {
8607    pub proc: Option<Arc<DaggerSessionProc>>,
8608    pub selection: Selection,
8609    pub graphql_client: DynGraphQLClient,
8610}
8611impl ListTypeDef {
8612    /// The type of the elements in the list.
8613    pub fn element_type_def(&self) -> TypeDef {
8614        let query = self.selection.select("elementTypeDef");
8615        TypeDef {
8616            proc: self.proc.clone(),
8617            selection: query,
8618            graphql_client: self.graphql_client.clone(),
8619        }
8620    }
8621    /// A unique identifier for this ListTypeDef.
8622    pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
8623        let query = self.selection.select("id");
8624        query.execute(self.graphql_client.clone()).await
8625    }
8626}
8627#[derive(Clone)]
8628pub struct Module {
8629    pub proc: Option<Arc<DaggerSessionProc>>,
8630    pub selection: Selection,
8631    pub graphql_client: DynGraphQLClient,
8632}
8633#[derive(Builder, Debug, PartialEq)]
8634pub struct ModuleServeOpts {
8635    /// Expose the dependencies of this module to the client
8636    #[builder(setter(into, strip_option), default)]
8637    pub include_dependencies: Option<bool>,
8638}
8639impl Module {
8640    /// The dependencies of the module.
8641    pub fn dependencies(&self) -> Vec<Module> {
8642        let query = self.selection.select("dependencies");
8643        vec![Module {
8644            proc: self.proc.clone(),
8645            selection: query,
8646            graphql_client: self.graphql_client.clone(),
8647        }]
8648    }
8649    /// The doc string of the module, if any
8650    pub async fn description(&self) -> Result<String, DaggerError> {
8651        let query = self.selection.select("description");
8652        query.execute(self.graphql_client.clone()).await
8653    }
8654    /// Enumerations served by this module.
8655    pub fn enums(&self) -> Vec<TypeDef> {
8656        let query = self.selection.select("enums");
8657        vec![TypeDef {
8658            proc: self.proc.clone(),
8659            selection: query,
8660            graphql_client: self.graphql_client.clone(),
8661        }]
8662    }
8663    /// The generated files and directories made on top of the module source's context directory.
8664    pub fn generated_context_directory(&self) -> Directory {
8665        let query = self.selection.select("generatedContextDirectory");
8666        Directory {
8667            proc: self.proc.clone(),
8668            selection: query,
8669            graphql_client: self.graphql_client.clone(),
8670        }
8671    }
8672    /// A unique identifier for this Module.
8673    pub async fn id(&self) -> Result<ModuleId, DaggerError> {
8674        let query = self.selection.select("id");
8675        query.execute(self.graphql_client.clone()).await
8676    }
8677    /// Interfaces served by this module.
8678    pub fn interfaces(&self) -> Vec<TypeDef> {
8679        let query = self.selection.select("interfaces");
8680        vec![TypeDef {
8681            proc: self.proc.clone(),
8682            selection: query,
8683            graphql_client: self.graphql_client.clone(),
8684        }]
8685    }
8686    /// The name of the module
8687    pub async fn name(&self) -> Result<String, DaggerError> {
8688        let query = self.selection.select("name");
8689        query.execute(self.graphql_client.clone()).await
8690    }
8691    /// Objects served by this module.
8692    pub fn objects(&self) -> Vec<TypeDef> {
8693        let query = self.selection.select("objects");
8694        vec![TypeDef {
8695            proc: self.proc.clone(),
8696            selection: query,
8697            graphql_client: self.graphql_client.clone(),
8698        }]
8699    }
8700    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
8701    pub fn runtime(&self) -> Container {
8702        let query = self.selection.select("runtime");
8703        Container {
8704            proc: self.proc.clone(),
8705            selection: query,
8706            graphql_client: self.graphql_client.clone(),
8707        }
8708    }
8709    /// The SDK config used by this module.
8710    pub fn sdk(&self) -> SdkConfig {
8711        let query = self.selection.select("sdk");
8712        SdkConfig {
8713            proc: self.proc.clone(),
8714            selection: query,
8715            graphql_client: self.graphql_client.clone(),
8716        }
8717    }
8718    /// Serve a module's API in the current session.
8719    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
8720    ///
8721    /// # Arguments
8722    ///
8723    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8724    pub async fn serve(&self) -> Result<Void, DaggerError> {
8725        let query = self.selection.select("serve");
8726        query.execute(self.graphql_client.clone()).await
8727    }
8728    /// Serve a module's API in the current session.
8729    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
8730    ///
8731    /// # Arguments
8732    ///
8733    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8734    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
8735        let mut query = self.selection.select("serve");
8736        if let Some(include_dependencies) = opts.include_dependencies {
8737            query = query.arg("includeDependencies", include_dependencies);
8738        }
8739        query.execute(self.graphql_client.clone()).await
8740    }
8741    /// The source for the module.
8742    pub fn source(&self) -> ModuleSource {
8743        let query = self.selection.select("source");
8744        ModuleSource {
8745            proc: self.proc.clone(),
8746            selection: query,
8747            graphql_client: self.graphql_client.clone(),
8748        }
8749    }
8750    /// Forces evaluation of the module, including any loading into the engine and associated validation.
8751    pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
8752        let query = self.selection.select("sync");
8753        query.execute(self.graphql_client.clone()).await
8754    }
8755    /// Retrieves the module with the given description
8756    ///
8757    /// # Arguments
8758    ///
8759    /// * `description` - The description to set
8760    pub fn with_description(&self, description: impl Into<String>) -> Module {
8761        let mut query = self.selection.select("withDescription");
8762        query = query.arg("description", description.into());
8763        Module {
8764            proc: self.proc.clone(),
8765            selection: query,
8766            graphql_client: self.graphql_client.clone(),
8767        }
8768    }
8769    /// This module plus the given Enum type and associated values
8770    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
8771        let mut query = self.selection.select("withEnum");
8772        query = query.arg_lazy(
8773            "enum",
8774            Box::new(move || {
8775                let r#enum = r#enum.clone();
8776                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
8777            }),
8778        );
8779        Module {
8780            proc: self.proc.clone(),
8781            selection: query,
8782            graphql_client: self.graphql_client.clone(),
8783        }
8784    }
8785    /// This module plus the given Interface type and associated functions
8786    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
8787        let mut query = self.selection.select("withInterface");
8788        query = query.arg_lazy(
8789            "iface",
8790            Box::new(move || {
8791                let iface = iface.clone();
8792                Box::pin(async move { iface.into_id().await.unwrap().quote() })
8793            }),
8794        );
8795        Module {
8796            proc: self.proc.clone(),
8797            selection: query,
8798            graphql_client: self.graphql_client.clone(),
8799        }
8800    }
8801    /// This module plus the given Object type and associated functions.
8802    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
8803        let mut query = self.selection.select("withObject");
8804        query = query.arg_lazy(
8805            "object",
8806            Box::new(move || {
8807                let object = object.clone();
8808                Box::pin(async move { object.into_id().await.unwrap().quote() })
8809            }),
8810        );
8811        Module {
8812            proc: self.proc.clone(),
8813            selection: query,
8814            graphql_client: self.graphql_client.clone(),
8815        }
8816    }
8817}
8818#[derive(Clone)]
8819pub struct ModuleConfigClient {
8820    pub proc: Option<Arc<DaggerSessionProc>>,
8821    pub selection: Selection,
8822    pub graphql_client: DynGraphQLClient,
8823}
8824impl ModuleConfigClient {
8825    /// The directory the client is generated in.
8826    pub async fn directory(&self) -> Result<String, DaggerError> {
8827        let query = self.selection.select("directory");
8828        query.execute(self.graphql_client.clone()).await
8829    }
8830    /// The generator to use
8831    pub async fn generator(&self) -> Result<String, DaggerError> {
8832        let query = self.selection.select("generator");
8833        query.execute(self.graphql_client.clone()).await
8834    }
8835    /// A unique identifier for this ModuleConfigClient.
8836    pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
8837        let query = self.selection.select("id");
8838        query.execute(self.graphql_client.clone()).await
8839    }
8840}
8841#[derive(Clone)]
8842pub struct ModuleSource {
8843    pub proc: Option<Arc<DaggerSessionProc>>,
8844    pub selection: Selection,
8845    pub graphql_client: DynGraphQLClient,
8846}
8847impl ModuleSource {
8848    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
8849    pub fn as_module(&self) -> Module {
8850        let query = self.selection.select("asModule");
8851        Module {
8852            proc: self.proc.clone(),
8853            selection: query,
8854            graphql_client: self.graphql_client.clone(),
8855        }
8856    }
8857    /// A human readable ref string representation of this module source.
8858    pub async fn as_string(&self) -> Result<String, DaggerError> {
8859        let query = self.selection.select("asString");
8860        query.execute(self.graphql_client.clone()).await
8861    }
8862    /// The blueprint referenced by the module source.
8863    pub fn blueprint(&self) -> ModuleSource {
8864        let query = self.selection.select("blueprint");
8865        ModuleSource {
8866            proc: self.proc.clone(),
8867            selection: query,
8868            graphql_client: self.graphql_client.clone(),
8869        }
8870    }
8871    /// The ref to clone the root of the git repo from. Only valid for git sources.
8872    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
8873        let query = self.selection.select("cloneRef");
8874        query.execute(self.graphql_client.clone()).await
8875    }
8876    /// The resolved commit of the git repo this source points to.
8877    pub async fn commit(&self) -> Result<String, DaggerError> {
8878        let query = self.selection.select("commit");
8879        query.execute(self.graphql_client.clone()).await
8880    }
8881    /// The clients generated for the module.
8882    pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
8883        let query = self.selection.select("configClients");
8884        vec![ModuleConfigClient {
8885            proc: self.proc.clone(),
8886            selection: query,
8887            graphql_client: self.graphql_client.clone(),
8888        }]
8889    }
8890    /// Whether an existing dagger.json for the module was found.
8891    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
8892        let query = self.selection.select("configExists");
8893        query.execute(self.graphql_client.clone()).await
8894    }
8895    /// The full directory loaded for the module source, including the source code as a subdirectory.
8896    pub fn context_directory(&self) -> Directory {
8897        let query = self.selection.select("contextDirectory");
8898        Directory {
8899            proc: self.proc.clone(),
8900            selection: query,
8901            graphql_client: self.graphql_client.clone(),
8902        }
8903    }
8904    /// The dependencies of the module source.
8905    pub fn dependencies(&self) -> Vec<ModuleSource> {
8906        let query = self.selection.select("dependencies");
8907        vec![ModuleSource {
8908            proc: self.proc.clone(),
8909            selection: query,
8910            graphql_client: self.graphql_client.clone(),
8911        }]
8912    }
8913    /// 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.
8914    pub async fn digest(&self) -> Result<String, DaggerError> {
8915        let query = self.selection.select("digest");
8916        query.execute(self.graphql_client.clone()).await
8917    }
8918    /// The directory containing the module configuration and source code (source code may be in a subdir).
8919    ///
8920    /// # Arguments
8921    ///
8922    /// * `path` - A subpath from the source directory to select.
8923    pub fn directory(&self, path: impl Into<String>) -> Directory {
8924        let mut query = self.selection.select("directory");
8925        query = query.arg("path", path.into());
8926        Directory {
8927            proc: self.proc.clone(),
8928            selection: query,
8929            graphql_client: self.graphql_client.clone(),
8930        }
8931    }
8932    /// The engine version of the module.
8933    pub async fn engine_version(&self) -> Result<String, DaggerError> {
8934        let query = self.selection.select("engineVersion");
8935        query.execute(self.graphql_client.clone()).await
8936    }
8937    /// The generated files and directories made on top of the module source's context directory.
8938    pub fn generated_context_directory(&self) -> Directory {
8939        let query = self.selection.select("generatedContextDirectory");
8940        Directory {
8941            proc: self.proc.clone(),
8942            selection: query,
8943            graphql_client: self.graphql_client.clone(),
8944        }
8945    }
8946    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
8947    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
8948        let query = self.selection.select("htmlRepoURL");
8949        query.execute(self.graphql_client.clone()).await
8950    }
8951    /// The URL to the source's git repo in a web browser. Only valid for git sources.
8952    pub async fn html_url(&self) -> Result<String, DaggerError> {
8953        let query = self.selection.select("htmlURL");
8954        query.execute(self.graphql_client.clone()).await
8955    }
8956    /// A unique identifier for this ModuleSource.
8957    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
8958        let query = self.selection.select("id");
8959        query.execute(self.graphql_client.clone()).await
8960    }
8961    /// The kind of module source (currently local, git or dir).
8962    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
8963        let query = self.selection.select("kind");
8964        query.execute(self.graphql_client.clone()).await
8965    }
8966    /// 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.
8967    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
8968        let query = self.selection.select("localContextDirectoryPath");
8969        query.execute(self.graphql_client.clone()).await
8970    }
8971    /// The name of the module, including any setting via the withName API.
8972    pub async fn module_name(&self) -> Result<String, DaggerError> {
8973        let query = self.selection.select("moduleName");
8974        query.execute(self.graphql_client.clone()).await
8975    }
8976    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
8977    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
8978        let query = self.selection.select("moduleOriginalName");
8979        query.execute(self.graphql_client.clone()).await
8980    }
8981    /// The original subpath used when instantiating this module source, relative to the context directory.
8982    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
8983        let query = self.selection.select("originalSubpath");
8984        query.execute(self.graphql_client.clone()).await
8985    }
8986    /// The pinned version of this module source.
8987    pub async fn pin(&self) -> Result<String, DaggerError> {
8988        let query = self.selection.select("pin");
8989        query.execute(self.graphql_client.clone()).await
8990    }
8991    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
8992    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
8993        let query = self.selection.select("repoRootPath");
8994        query.execute(self.graphql_client.clone()).await
8995    }
8996    /// The SDK configuration of the module.
8997    pub fn sdk(&self) -> SdkConfig {
8998        let query = self.selection.select("sdk");
8999        SdkConfig {
9000            proc: self.proc.clone(),
9001            selection: query,
9002            graphql_client: self.graphql_client.clone(),
9003        }
9004    }
9005    /// The path, relative to the context directory, that contains the module's dagger.json.
9006    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
9007        let query = self.selection.select("sourceRootSubpath");
9008        query.execute(self.graphql_client.clone()).await
9009    }
9010    /// The path to the directory containing the module's source code, relative to the context directory.
9011    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
9012        let query = self.selection.select("sourceSubpath");
9013        query.execute(self.graphql_client.clone()).await
9014    }
9015    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
9016    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
9017        let query = self.selection.select("sync");
9018        query.execute(self.graphql_client.clone()).await
9019    }
9020    /// The specified version of the git repo this source points to.
9021    pub async fn version(&self) -> Result<String, DaggerError> {
9022        let query = self.selection.select("version");
9023        query.execute(self.graphql_client.clone()).await
9024    }
9025    /// Set a blueprint for the module source.
9026    ///
9027    /// # Arguments
9028    ///
9029    /// * `blueprint` - The blueprint module to set.
9030    pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
9031        let mut query = self.selection.select("withBlueprint");
9032        query = query.arg_lazy(
9033            "blueprint",
9034            Box::new(move || {
9035                let blueprint = blueprint.clone();
9036                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
9037            }),
9038        );
9039        ModuleSource {
9040            proc: self.proc.clone(),
9041            selection: query,
9042            graphql_client: self.graphql_client.clone(),
9043        }
9044    }
9045    /// Update the module source with a new client to generate.
9046    ///
9047    /// # Arguments
9048    ///
9049    /// * `generator` - The generator to use
9050    /// * `output_dir` - The output directory for the generated client.
9051    pub fn with_client(
9052        &self,
9053        generator: impl Into<String>,
9054        output_dir: impl Into<String>,
9055    ) -> ModuleSource {
9056        let mut query = self.selection.select("withClient");
9057        query = query.arg("generator", generator.into());
9058        query = query.arg("outputDir", output_dir.into());
9059        ModuleSource {
9060            proc: self.proc.clone(),
9061            selection: query,
9062            graphql_client: self.graphql_client.clone(),
9063        }
9064    }
9065    /// Append the provided dependencies to the module source's dependency list.
9066    ///
9067    /// # Arguments
9068    ///
9069    /// * `dependencies` - The dependencies to append.
9070    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
9071        let mut query = self.selection.select("withDependencies");
9072        query = query.arg("dependencies", dependencies);
9073        ModuleSource {
9074            proc: self.proc.clone(),
9075            selection: query,
9076            graphql_client: self.graphql_client.clone(),
9077        }
9078    }
9079    /// Upgrade the engine version of the module to the given value.
9080    ///
9081    /// # Arguments
9082    ///
9083    /// * `version` - The engine version to upgrade to.
9084    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
9085        let mut query = self.selection.select("withEngineVersion");
9086        query = query.arg("version", version.into());
9087        ModuleSource {
9088            proc: self.proc.clone(),
9089            selection: query,
9090            graphql_client: self.graphql_client.clone(),
9091        }
9092    }
9093    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
9094    ///
9095    /// # Arguments
9096    ///
9097    /// * `patterns` - The new additional include patterns.
9098    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
9099        let mut query = self.selection.select("withIncludes");
9100        query = query.arg(
9101            "patterns",
9102            patterns
9103                .into_iter()
9104                .map(|i| i.into())
9105                .collect::<Vec<String>>(),
9106        );
9107        ModuleSource {
9108            proc: self.proc.clone(),
9109            selection: query,
9110            graphql_client: self.graphql_client.clone(),
9111        }
9112    }
9113    /// Update the module source with a new name.
9114    ///
9115    /// # Arguments
9116    ///
9117    /// * `name` - The name to set.
9118    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
9119        let mut query = self.selection.select("withName");
9120        query = query.arg("name", name.into());
9121        ModuleSource {
9122            proc: self.proc.clone(),
9123            selection: query,
9124            graphql_client: self.graphql_client.clone(),
9125        }
9126    }
9127    /// Update the module source with a new SDK.
9128    ///
9129    /// # Arguments
9130    ///
9131    /// * `source` - The SDK source to set.
9132    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
9133        let mut query = self.selection.select("withSDK");
9134        query = query.arg("source", source.into());
9135        ModuleSource {
9136            proc: self.proc.clone(),
9137            selection: query,
9138            graphql_client: self.graphql_client.clone(),
9139        }
9140    }
9141    /// Update the module source with a new source subpath.
9142    ///
9143    /// # Arguments
9144    ///
9145    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
9146    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
9147        let mut query = self.selection.select("withSourceSubpath");
9148        query = query.arg("path", path.into());
9149        ModuleSource {
9150            proc: self.proc.clone(),
9151            selection: query,
9152            graphql_client: self.graphql_client.clone(),
9153        }
9154    }
9155    /// Update the blueprint module to the latest version.
9156    pub fn with_update_blueprint(&self) -> ModuleSource {
9157        let query = self.selection.select("withUpdateBlueprint");
9158        ModuleSource {
9159            proc: self.proc.clone(),
9160            selection: query,
9161            graphql_client: self.graphql_client.clone(),
9162        }
9163    }
9164    /// Update one or more module dependencies.
9165    ///
9166    /// # Arguments
9167    ///
9168    /// * `dependencies` - The dependencies to update.
9169    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
9170        let mut query = self.selection.select("withUpdateDependencies");
9171        query = query.arg(
9172            "dependencies",
9173            dependencies
9174                .into_iter()
9175                .map(|i| i.into())
9176                .collect::<Vec<String>>(),
9177        );
9178        ModuleSource {
9179            proc: self.proc.clone(),
9180            selection: query,
9181            graphql_client: self.graphql_client.clone(),
9182        }
9183    }
9184    /// Remove the current blueprint from the module source.
9185    pub fn without_blueprint(&self) -> ModuleSource {
9186        let query = self.selection.select("withoutBlueprint");
9187        ModuleSource {
9188            proc: self.proc.clone(),
9189            selection: query,
9190            graphql_client: self.graphql_client.clone(),
9191        }
9192    }
9193    /// Remove a client from the module source.
9194    ///
9195    /// # Arguments
9196    ///
9197    /// * `path` - The path of the client to remove.
9198    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
9199        let mut query = self.selection.select("withoutClient");
9200        query = query.arg("path", path.into());
9201        ModuleSource {
9202            proc: self.proc.clone(),
9203            selection: query,
9204            graphql_client: self.graphql_client.clone(),
9205        }
9206    }
9207    /// Remove the provided dependencies from the module source's dependency list.
9208    ///
9209    /// # Arguments
9210    ///
9211    /// * `dependencies` - The dependencies to remove.
9212    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
9213        let mut query = self.selection.select("withoutDependencies");
9214        query = query.arg(
9215            "dependencies",
9216            dependencies
9217                .into_iter()
9218                .map(|i| i.into())
9219                .collect::<Vec<String>>(),
9220        );
9221        ModuleSource {
9222            proc: self.proc.clone(),
9223            selection: query,
9224            graphql_client: self.graphql_client.clone(),
9225        }
9226    }
9227}
9228#[derive(Clone)]
9229pub struct ObjectTypeDef {
9230    pub proc: Option<Arc<DaggerSessionProc>>,
9231    pub selection: Selection,
9232    pub graphql_client: DynGraphQLClient,
9233}
9234impl ObjectTypeDef {
9235    /// The function used to construct new instances of this object, if any
9236    pub fn constructor(&self) -> Function {
9237        let query = self.selection.select("constructor");
9238        Function {
9239            proc: self.proc.clone(),
9240            selection: query,
9241            graphql_client: self.graphql_client.clone(),
9242        }
9243    }
9244    /// The doc string for the object, if any.
9245    pub async fn description(&self) -> Result<String, DaggerError> {
9246        let query = self.selection.select("description");
9247        query.execute(self.graphql_client.clone()).await
9248    }
9249    /// Static fields defined on this object, if any.
9250    pub fn fields(&self) -> Vec<FieldTypeDef> {
9251        let query = self.selection.select("fields");
9252        vec![FieldTypeDef {
9253            proc: self.proc.clone(),
9254            selection: query,
9255            graphql_client: self.graphql_client.clone(),
9256        }]
9257    }
9258    /// Functions defined on this object, if any.
9259    pub fn functions(&self) -> Vec<Function> {
9260        let query = self.selection.select("functions");
9261        vec![Function {
9262            proc: self.proc.clone(),
9263            selection: query,
9264            graphql_client: self.graphql_client.clone(),
9265        }]
9266    }
9267    /// A unique identifier for this ObjectTypeDef.
9268    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
9269        let query = self.selection.select("id");
9270        query.execute(self.graphql_client.clone()).await
9271    }
9272    /// The name of the object.
9273    pub async fn name(&self) -> Result<String, DaggerError> {
9274        let query = self.selection.select("name");
9275        query.execute(self.graphql_client.clone()).await
9276    }
9277    /// The location of this object declaration.
9278    pub fn source_map(&self) -> SourceMap {
9279        let query = self.selection.select("sourceMap");
9280        SourceMap {
9281            proc: self.proc.clone(),
9282            selection: query,
9283            graphql_client: self.graphql_client.clone(),
9284        }
9285    }
9286    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
9287    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9288        let query = self.selection.select("sourceModuleName");
9289        query.execute(self.graphql_client.clone()).await
9290    }
9291}
9292#[derive(Clone)]
9293pub struct Port {
9294    pub proc: Option<Arc<DaggerSessionProc>>,
9295    pub selection: Selection,
9296    pub graphql_client: DynGraphQLClient,
9297}
9298impl Port {
9299    /// The port description.
9300    pub async fn description(&self) -> Result<String, DaggerError> {
9301        let query = self.selection.select("description");
9302        query.execute(self.graphql_client.clone()).await
9303    }
9304    /// Skip the health check when run as a service.
9305    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
9306        let query = self.selection.select("experimentalSkipHealthcheck");
9307        query.execute(self.graphql_client.clone()).await
9308    }
9309    /// A unique identifier for this Port.
9310    pub async fn id(&self) -> Result<PortId, DaggerError> {
9311        let query = self.selection.select("id");
9312        query.execute(self.graphql_client.clone()).await
9313    }
9314    /// The port number.
9315    pub async fn port(&self) -> Result<isize, DaggerError> {
9316        let query = self.selection.select("port");
9317        query.execute(self.graphql_client.clone()).await
9318    }
9319    /// The transport layer protocol.
9320    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
9321        let query = self.selection.select("protocol");
9322        query.execute(self.graphql_client.clone()).await
9323    }
9324}
9325#[derive(Clone)]
9326pub struct Query {
9327    pub proc: Option<Arc<DaggerSessionProc>>,
9328    pub selection: Selection,
9329    pub graphql_client: DynGraphQLClient,
9330}
9331#[derive(Builder, Debug, PartialEq)]
9332pub struct QueryContainerOpts {
9333    /// Platform to initialize the container with. Defaults to the native platform of the current engine
9334    #[builder(setter(into, strip_option), default)]
9335    pub platform: Option<Platform>,
9336}
9337#[derive(Builder, Debug, PartialEq)]
9338pub struct QueryEnvOpts {
9339    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
9340    #[builder(setter(into, strip_option), default)]
9341    pub privileged: Option<bool>,
9342    /// Allow new outputs to be declared and saved in the environment
9343    #[builder(setter(into, strip_option), default)]
9344    pub writable: Option<bool>,
9345}
9346#[derive(Builder, Debug, PartialEq)]
9347pub struct QueryFileOpts {
9348    /// Permissions of the new file. Example: 0600
9349    #[builder(setter(into, strip_option), default)]
9350    pub permissions: Option<isize>,
9351}
9352#[derive(Builder, Debug, PartialEq)]
9353pub struct QueryGitOpts<'a> {
9354    /// A service which must be started before the repo is fetched.
9355    #[builder(setter(into, strip_option), default)]
9356    pub experimental_service_host: Option<ServiceId>,
9357    /// Secret used to populate the Authorization HTTP header
9358    #[builder(setter(into, strip_option), default)]
9359    pub http_auth_header: Option<SecretId>,
9360    /// Secret used to populate the password during basic HTTP Authorization
9361    #[builder(setter(into, strip_option), default)]
9362    pub http_auth_token: Option<SecretId>,
9363    /// Username used to populate the password during basic HTTP Authorization
9364    #[builder(setter(into, strip_option), default)]
9365    pub http_auth_username: Option<&'a str>,
9366    /// DEPRECATED: Set to true to keep .git directory.
9367    #[builder(setter(into, strip_option), default)]
9368    pub keep_git_dir: Option<bool>,
9369    /// Set SSH auth socket
9370    #[builder(setter(into, strip_option), default)]
9371    pub ssh_auth_socket: Option<SocketId>,
9372    /// Set SSH known hosts
9373    #[builder(setter(into, strip_option), default)]
9374    pub ssh_known_hosts: Option<&'a str>,
9375}
9376#[derive(Builder, Debug, PartialEq)]
9377pub struct QueryHttpOpts<'a> {
9378    /// Secret used to populate the Authorization HTTP header
9379    #[builder(setter(into, strip_option), default)]
9380    pub auth_header: Option<SecretId>,
9381    /// A service which must be started before the URL is fetched.
9382    #[builder(setter(into, strip_option), default)]
9383    pub experimental_service_host: Option<ServiceId>,
9384    /// File name to use for the file. Defaults to the last part of the URL.
9385    #[builder(setter(into, strip_option), default)]
9386    pub name: Option<&'a str>,
9387    /// Permissions to set on the file.
9388    #[builder(setter(into, strip_option), default)]
9389    pub permissions: Option<isize>,
9390}
9391#[derive(Builder, Debug, PartialEq)]
9392pub struct QueryLlmOpts<'a> {
9393    /// Cap the number of API calls for this LLM
9394    #[builder(setter(into, strip_option), default)]
9395    pub max_api_calls: Option<isize>,
9396    /// Model to use
9397    #[builder(setter(into, strip_option), default)]
9398    pub model: Option<&'a str>,
9399}
9400#[derive(Builder, Debug, PartialEq)]
9401pub struct QueryModuleSourceOpts<'a> {
9402    /// 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.
9403    #[builder(setter(into, strip_option), default)]
9404    pub allow_not_exists: Option<bool>,
9405    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
9406    #[builder(setter(into, strip_option), default)]
9407    pub disable_find_up: Option<bool>,
9408    /// The pinned version of the module source
9409    #[builder(setter(into, strip_option), default)]
9410    pub ref_pin: Option<&'a str>,
9411    /// If set, error out if the ref string is not of the provided requireKind.
9412    #[builder(setter(into, strip_option), default)]
9413    pub require_kind: Option<ModuleSourceKind>,
9414}
9415#[derive(Builder, Debug, PartialEq)]
9416pub struct QuerySecretOpts<'a> {
9417    /// 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.
9418    /// 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.
9419    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
9420    #[builder(setter(into, strip_option), default)]
9421    pub cache_key: Option<&'a str>,
9422}
9423impl Query {
9424    /// Constructs a cache volume for a given cache key.
9425    ///
9426    /// # Arguments
9427    ///
9428    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
9429    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
9430        let mut query = self.selection.select("cacheVolume");
9431        query = query.arg("key", key.into());
9432        CacheVolume {
9433            proc: self.proc.clone(),
9434            selection: query,
9435            graphql_client: self.graphql_client.clone(),
9436        }
9437    }
9438    /// Dagger Cloud configuration and state
9439    pub fn cloud(&self) -> Cloud {
9440        let query = self.selection.select("cloud");
9441        Cloud {
9442            proc: self.proc.clone(),
9443            selection: query,
9444            graphql_client: self.graphql_client.clone(),
9445        }
9446    }
9447    /// Creates a scratch container, with no image or metadata.
9448    /// To pull an image, follow up with the "from" function.
9449    ///
9450    /// # Arguments
9451    ///
9452    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9453    pub fn container(&self) -> Container {
9454        let query = self.selection.select("container");
9455        Container {
9456            proc: self.proc.clone(),
9457            selection: query,
9458            graphql_client: self.graphql_client.clone(),
9459        }
9460    }
9461    /// Creates a scratch container, with no image or metadata.
9462    /// To pull an image, follow up with the "from" function.
9463    ///
9464    /// # Arguments
9465    ///
9466    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9467    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
9468        let mut query = self.selection.select("container");
9469        if let Some(platform) = opts.platform {
9470            query = query.arg("platform", platform);
9471        }
9472        Container {
9473            proc: self.proc.clone(),
9474            selection: query,
9475            graphql_client: self.graphql_client.clone(),
9476        }
9477    }
9478    /// The FunctionCall context that the SDK caller is currently executing in.
9479    /// If the caller is not currently executing in a function, this will return an error.
9480    pub fn current_function_call(&self) -> FunctionCall {
9481        let query = self.selection.select("currentFunctionCall");
9482        FunctionCall {
9483            proc: self.proc.clone(),
9484            selection: query,
9485            graphql_client: self.graphql_client.clone(),
9486        }
9487    }
9488    /// The module currently being served in the session, if any.
9489    pub fn current_module(&self) -> CurrentModule {
9490        let query = self.selection.select("currentModule");
9491        CurrentModule {
9492            proc: self.proc.clone(),
9493            selection: query,
9494            graphql_client: self.graphql_client.clone(),
9495        }
9496    }
9497    /// The TypeDef representations of the objects currently being served in the session.
9498    pub fn current_type_defs(&self) -> Vec<TypeDef> {
9499        let query = self.selection.select("currentTypeDefs");
9500        vec![TypeDef {
9501            proc: self.proc.clone(),
9502            selection: query,
9503            graphql_client: self.graphql_client.clone(),
9504        }]
9505    }
9506    /// The default platform of the engine.
9507    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
9508        let query = self.selection.select("defaultPlatform");
9509        query.execute(self.graphql_client.clone()).await
9510    }
9511    /// Creates an empty directory.
9512    pub fn directory(&self) -> Directory {
9513        let query = self.selection.select("directory");
9514        Directory {
9515            proc: self.proc.clone(),
9516            selection: query,
9517            graphql_client: self.graphql_client.clone(),
9518        }
9519    }
9520    /// The Dagger engine container configuration and state
9521    pub fn engine(&self) -> Engine {
9522        let query = self.selection.select("engine");
9523        Engine {
9524            proc: self.proc.clone(),
9525            selection: query,
9526            graphql_client: self.graphql_client.clone(),
9527        }
9528    }
9529    /// Initialize a new environment
9530    ///
9531    /// # Arguments
9532    ///
9533    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9534    pub fn env(&self) -> Env {
9535        let query = self.selection.select("env");
9536        Env {
9537            proc: self.proc.clone(),
9538            selection: query,
9539            graphql_client: self.graphql_client.clone(),
9540        }
9541    }
9542    /// Initialize a new environment
9543    ///
9544    /// # Arguments
9545    ///
9546    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9547    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
9548        let mut query = self.selection.select("env");
9549        if let Some(privileged) = opts.privileged {
9550            query = query.arg("privileged", privileged);
9551        }
9552        if let Some(writable) = opts.writable {
9553            query = query.arg("writable", writable);
9554        }
9555        Env {
9556            proc: self.proc.clone(),
9557            selection: query,
9558            graphql_client: self.graphql_client.clone(),
9559        }
9560    }
9561    /// Create a new error.
9562    ///
9563    /// # Arguments
9564    ///
9565    /// * `message` - A brief description of the error.
9566    pub fn error(&self, message: impl Into<String>) -> Error {
9567        let mut query = self.selection.select("error");
9568        query = query.arg("message", message.into());
9569        Error {
9570            proc: self.proc.clone(),
9571            selection: query,
9572            graphql_client: self.graphql_client.clone(),
9573        }
9574    }
9575    /// Creates a file with the specified contents.
9576    ///
9577    /// # Arguments
9578    ///
9579    /// * `name` - Name of the new file. Example: "foo.txt"
9580    /// * `contents` - Contents of the new file. Example: "Hello world!"
9581    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9582    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
9583        let mut query = self.selection.select("file");
9584        query = query.arg("name", name.into());
9585        query = query.arg("contents", contents.into());
9586        File {
9587            proc: self.proc.clone(),
9588            selection: query,
9589            graphql_client: self.graphql_client.clone(),
9590        }
9591    }
9592    /// Creates a file with the specified contents.
9593    ///
9594    /// # Arguments
9595    ///
9596    /// * `name` - Name of the new file. Example: "foo.txt"
9597    /// * `contents` - Contents of the new file. Example: "Hello world!"
9598    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9599    pub fn file_opts(
9600        &self,
9601        name: impl Into<String>,
9602        contents: impl Into<String>,
9603        opts: QueryFileOpts,
9604    ) -> File {
9605        let mut query = self.selection.select("file");
9606        query = query.arg("name", name.into());
9607        query = query.arg("contents", contents.into());
9608        if let Some(permissions) = opts.permissions {
9609            query = query.arg("permissions", permissions);
9610        }
9611        File {
9612            proc: self.proc.clone(),
9613            selection: query,
9614            graphql_client: self.graphql_client.clone(),
9615        }
9616    }
9617    /// Creates a function.
9618    ///
9619    /// # Arguments
9620    ///
9621    /// * `name` - Name of the function, in its original format from the implementation language.
9622    /// * `return_type` - Return type of the function.
9623    pub fn function(
9624        &self,
9625        name: impl Into<String>,
9626        return_type: impl IntoID<TypeDefId>,
9627    ) -> Function {
9628        let mut query = self.selection.select("function");
9629        query = query.arg("name", name.into());
9630        query = query.arg_lazy(
9631            "returnType",
9632            Box::new(move || {
9633                let return_type = return_type.clone();
9634                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
9635            }),
9636        );
9637        Function {
9638            proc: self.proc.clone(),
9639            selection: query,
9640            graphql_client: self.graphql_client.clone(),
9641        }
9642    }
9643    /// Create a code generation result, given a directory containing the generated code.
9644    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
9645        let mut query = self.selection.select("generatedCode");
9646        query = query.arg_lazy(
9647            "code",
9648            Box::new(move || {
9649                let code = code.clone();
9650                Box::pin(async move { code.into_id().await.unwrap().quote() })
9651            }),
9652        );
9653        GeneratedCode {
9654            proc: self.proc.clone(),
9655            selection: query,
9656            graphql_client: self.graphql_client.clone(),
9657        }
9658    }
9659    /// Queries a Git repository.
9660    ///
9661    /// # Arguments
9662    ///
9663    /// * `url` - URL of the git repository.
9664    ///
9665    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
9666    ///
9667    /// Suffix ".git" is optional.
9668    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9669    pub fn git(&self, url: impl Into<String>) -> GitRepository {
9670        let mut query = self.selection.select("git");
9671        query = query.arg("url", url.into());
9672        GitRepository {
9673            proc: self.proc.clone(),
9674            selection: query,
9675            graphql_client: self.graphql_client.clone(),
9676        }
9677    }
9678    /// Queries a Git repository.
9679    ///
9680    /// # Arguments
9681    ///
9682    /// * `url` - URL of the git repository.
9683    ///
9684    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
9685    ///
9686    /// Suffix ".git" is optional.
9687    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9688    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
9689        let mut query = self.selection.select("git");
9690        query = query.arg("url", url.into());
9691        if let Some(keep_git_dir) = opts.keep_git_dir {
9692            query = query.arg("keepGitDir", keep_git_dir);
9693        }
9694        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
9695            query = query.arg("sshKnownHosts", ssh_known_hosts);
9696        }
9697        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
9698            query = query.arg("sshAuthSocket", ssh_auth_socket);
9699        }
9700        if let Some(http_auth_username) = opts.http_auth_username {
9701            query = query.arg("httpAuthUsername", http_auth_username);
9702        }
9703        if let Some(http_auth_token) = opts.http_auth_token {
9704            query = query.arg("httpAuthToken", http_auth_token);
9705        }
9706        if let Some(http_auth_header) = opts.http_auth_header {
9707            query = query.arg("httpAuthHeader", http_auth_header);
9708        }
9709        if let Some(experimental_service_host) = opts.experimental_service_host {
9710            query = query.arg("experimentalServiceHost", experimental_service_host);
9711        }
9712        GitRepository {
9713            proc: self.proc.clone(),
9714            selection: query,
9715            graphql_client: self.graphql_client.clone(),
9716        }
9717    }
9718    /// Queries the host environment.
9719    pub fn host(&self) -> Host {
9720        let query = self.selection.select("host");
9721        Host {
9722            proc: self.proc.clone(),
9723            selection: query,
9724            graphql_client: self.graphql_client.clone(),
9725        }
9726    }
9727    /// Returns a file containing an http remote url content.
9728    ///
9729    /// # Arguments
9730    ///
9731    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
9732    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9733    pub fn http(&self, url: impl Into<String>) -> File {
9734        let mut query = self.selection.select("http");
9735        query = query.arg("url", url.into());
9736        File {
9737            proc: self.proc.clone(),
9738            selection: query,
9739            graphql_client: self.graphql_client.clone(),
9740        }
9741    }
9742    /// Returns a file containing an http remote url content.
9743    ///
9744    /// # Arguments
9745    ///
9746    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
9747    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9748    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
9749        let mut query = self.selection.select("http");
9750        query = query.arg("url", url.into());
9751        if let Some(name) = opts.name {
9752            query = query.arg("name", name);
9753        }
9754        if let Some(permissions) = opts.permissions {
9755            query = query.arg("permissions", permissions);
9756        }
9757        if let Some(auth_header) = opts.auth_header {
9758            query = query.arg("authHeader", auth_header);
9759        }
9760        if let Some(experimental_service_host) = opts.experimental_service_host {
9761            query = query.arg("experimentalServiceHost", experimental_service_host);
9762        }
9763        File {
9764            proc: self.proc.clone(),
9765            selection: query,
9766            graphql_client: self.graphql_client.clone(),
9767        }
9768    }
9769    /// Initialize a JSON value
9770    pub fn json(&self) -> JsonValue {
9771        let query = self.selection.select("json");
9772        JsonValue {
9773            proc: self.proc.clone(),
9774            selection: query,
9775            graphql_client: self.graphql_client.clone(),
9776        }
9777    }
9778    /// Initialize a Large Language Model (LLM)
9779    ///
9780    /// # Arguments
9781    ///
9782    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9783    pub fn llm(&self) -> Llm {
9784        let query = self.selection.select("llm");
9785        Llm {
9786            proc: self.proc.clone(),
9787            selection: query,
9788            graphql_client: self.graphql_client.clone(),
9789        }
9790    }
9791    /// Initialize a Large Language Model (LLM)
9792    ///
9793    /// # Arguments
9794    ///
9795    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9796    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
9797        let mut query = self.selection.select("llm");
9798        if let Some(model) = opts.model {
9799            query = query.arg("model", model);
9800        }
9801        if let Some(max_api_calls) = opts.max_api_calls {
9802            query = query.arg("maxAPICalls", max_api_calls);
9803        }
9804        Llm {
9805            proc: self.proc.clone(),
9806            selection: query,
9807            graphql_client: self.graphql_client.clone(),
9808        }
9809    }
9810    /// Load a Binding from its ID.
9811    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
9812        let mut query = self.selection.select("loadBindingFromID");
9813        query = query.arg_lazy(
9814            "id",
9815            Box::new(move || {
9816                let id = id.clone();
9817                Box::pin(async move { id.into_id().await.unwrap().quote() })
9818            }),
9819        );
9820        Binding {
9821            proc: self.proc.clone(),
9822            selection: query,
9823            graphql_client: self.graphql_client.clone(),
9824        }
9825    }
9826    /// Load a CacheVolume from its ID.
9827    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
9828        let mut query = self.selection.select("loadCacheVolumeFromID");
9829        query = query.arg_lazy(
9830            "id",
9831            Box::new(move || {
9832                let id = id.clone();
9833                Box::pin(async move { id.into_id().await.unwrap().quote() })
9834            }),
9835        );
9836        CacheVolume {
9837            proc: self.proc.clone(),
9838            selection: query,
9839            graphql_client: self.graphql_client.clone(),
9840        }
9841    }
9842    /// Load a Cloud from its ID.
9843    pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
9844        let mut query = self.selection.select("loadCloudFromID");
9845        query = query.arg_lazy(
9846            "id",
9847            Box::new(move || {
9848                let id = id.clone();
9849                Box::pin(async move { id.into_id().await.unwrap().quote() })
9850            }),
9851        );
9852        Cloud {
9853            proc: self.proc.clone(),
9854            selection: query,
9855            graphql_client: self.graphql_client.clone(),
9856        }
9857    }
9858    /// Load a Container from its ID.
9859    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
9860        let mut query = self.selection.select("loadContainerFromID");
9861        query = query.arg_lazy(
9862            "id",
9863            Box::new(move || {
9864                let id = id.clone();
9865                Box::pin(async move { id.into_id().await.unwrap().quote() })
9866            }),
9867        );
9868        Container {
9869            proc: self.proc.clone(),
9870            selection: query,
9871            graphql_client: self.graphql_client.clone(),
9872        }
9873    }
9874    /// Load a CurrentModule from its ID.
9875    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
9876        let mut query = self.selection.select("loadCurrentModuleFromID");
9877        query = query.arg_lazy(
9878            "id",
9879            Box::new(move || {
9880                let id = id.clone();
9881                Box::pin(async move { id.into_id().await.unwrap().quote() })
9882            }),
9883        );
9884        CurrentModule {
9885            proc: self.proc.clone(),
9886            selection: query,
9887            graphql_client: self.graphql_client.clone(),
9888        }
9889    }
9890    /// Load a Directory from its ID.
9891    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
9892        let mut query = self.selection.select("loadDirectoryFromID");
9893        query = query.arg_lazy(
9894            "id",
9895            Box::new(move || {
9896                let id = id.clone();
9897                Box::pin(async move { id.into_id().await.unwrap().quote() })
9898            }),
9899        );
9900        Directory {
9901            proc: self.proc.clone(),
9902            selection: query,
9903            graphql_client: self.graphql_client.clone(),
9904        }
9905    }
9906    /// Load a EngineCacheEntry from its ID.
9907    pub fn load_engine_cache_entry_from_id(
9908        &self,
9909        id: impl IntoID<EngineCacheEntryId>,
9910    ) -> EngineCacheEntry {
9911        let mut query = self.selection.select("loadEngineCacheEntryFromID");
9912        query = query.arg_lazy(
9913            "id",
9914            Box::new(move || {
9915                let id = id.clone();
9916                Box::pin(async move { id.into_id().await.unwrap().quote() })
9917            }),
9918        );
9919        EngineCacheEntry {
9920            proc: self.proc.clone(),
9921            selection: query,
9922            graphql_client: self.graphql_client.clone(),
9923        }
9924    }
9925    /// Load a EngineCacheEntrySet from its ID.
9926    pub fn load_engine_cache_entry_set_from_id(
9927        &self,
9928        id: impl IntoID<EngineCacheEntrySetId>,
9929    ) -> EngineCacheEntrySet {
9930        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
9931        query = query.arg_lazy(
9932            "id",
9933            Box::new(move || {
9934                let id = id.clone();
9935                Box::pin(async move { id.into_id().await.unwrap().quote() })
9936            }),
9937        );
9938        EngineCacheEntrySet {
9939            proc: self.proc.clone(),
9940            selection: query,
9941            graphql_client: self.graphql_client.clone(),
9942        }
9943    }
9944    /// Load a EngineCache from its ID.
9945    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
9946        let mut query = self.selection.select("loadEngineCacheFromID");
9947        query = query.arg_lazy(
9948            "id",
9949            Box::new(move || {
9950                let id = id.clone();
9951                Box::pin(async move { id.into_id().await.unwrap().quote() })
9952            }),
9953        );
9954        EngineCache {
9955            proc: self.proc.clone(),
9956            selection: query,
9957            graphql_client: self.graphql_client.clone(),
9958        }
9959    }
9960    /// Load a Engine from its ID.
9961    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
9962        let mut query = self.selection.select("loadEngineFromID");
9963        query = query.arg_lazy(
9964            "id",
9965            Box::new(move || {
9966                let id = id.clone();
9967                Box::pin(async move { id.into_id().await.unwrap().quote() })
9968            }),
9969        );
9970        Engine {
9971            proc: self.proc.clone(),
9972            selection: query,
9973            graphql_client: self.graphql_client.clone(),
9974        }
9975    }
9976    /// Load a EnumTypeDef from its ID.
9977    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
9978        let mut query = self.selection.select("loadEnumTypeDefFromID");
9979        query = query.arg_lazy(
9980            "id",
9981            Box::new(move || {
9982                let id = id.clone();
9983                Box::pin(async move { id.into_id().await.unwrap().quote() })
9984            }),
9985        );
9986        EnumTypeDef {
9987            proc: self.proc.clone(),
9988            selection: query,
9989            graphql_client: self.graphql_client.clone(),
9990        }
9991    }
9992    /// Load a EnumValueTypeDef from its ID.
9993    pub fn load_enum_value_type_def_from_id(
9994        &self,
9995        id: impl IntoID<EnumValueTypeDefId>,
9996    ) -> EnumValueTypeDef {
9997        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
9998        query = query.arg_lazy(
9999            "id",
10000            Box::new(move || {
10001                let id = id.clone();
10002                Box::pin(async move { id.into_id().await.unwrap().quote() })
10003            }),
10004        );
10005        EnumValueTypeDef {
10006            proc: self.proc.clone(),
10007            selection: query,
10008            graphql_client: self.graphql_client.clone(),
10009        }
10010    }
10011    /// Load a Env from its ID.
10012    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
10013        let mut query = self.selection.select("loadEnvFromID");
10014        query = query.arg_lazy(
10015            "id",
10016            Box::new(move || {
10017                let id = id.clone();
10018                Box::pin(async move { id.into_id().await.unwrap().quote() })
10019            }),
10020        );
10021        Env {
10022            proc: self.proc.clone(),
10023            selection: query,
10024            graphql_client: self.graphql_client.clone(),
10025        }
10026    }
10027    /// Load a EnvVariable from its ID.
10028    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
10029        let mut query = self.selection.select("loadEnvVariableFromID");
10030        query = query.arg_lazy(
10031            "id",
10032            Box::new(move || {
10033                let id = id.clone();
10034                Box::pin(async move { id.into_id().await.unwrap().quote() })
10035            }),
10036        );
10037        EnvVariable {
10038            proc: self.proc.clone(),
10039            selection: query,
10040            graphql_client: self.graphql_client.clone(),
10041        }
10042    }
10043    /// Load a Error from its ID.
10044    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
10045        let mut query = self.selection.select("loadErrorFromID");
10046        query = query.arg_lazy(
10047            "id",
10048            Box::new(move || {
10049                let id = id.clone();
10050                Box::pin(async move { id.into_id().await.unwrap().quote() })
10051            }),
10052        );
10053        Error {
10054            proc: self.proc.clone(),
10055            selection: query,
10056            graphql_client: self.graphql_client.clone(),
10057        }
10058    }
10059    /// Load a ErrorValue from its ID.
10060    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
10061        let mut query = self.selection.select("loadErrorValueFromID");
10062        query = query.arg_lazy(
10063            "id",
10064            Box::new(move || {
10065                let id = id.clone();
10066                Box::pin(async move { id.into_id().await.unwrap().quote() })
10067            }),
10068        );
10069        ErrorValue {
10070            proc: self.proc.clone(),
10071            selection: query,
10072            graphql_client: self.graphql_client.clone(),
10073        }
10074    }
10075    /// Load a FieldTypeDef from its ID.
10076    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
10077        let mut query = self.selection.select("loadFieldTypeDefFromID");
10078        query = query.arg_lazy(
10079            "id",
10080            Box::new(move || {
10081                let id = id.clone();
10082                Box::pin(async move { id.into_id().await.unwrap().quote() })
10083            }),
10084        );
10085        FieldTypeDef {
10086            proc: self.proc.clone(),
10087            selection: query,
10088            graphql_client: self.graphql_client.clone(),
10089        }
10090    }
10091    /// Load a File from its ID.
10092    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
10093        let mut query = self.selection.select("loadFileFromID");
10094        query = query.arg_lazy(
10095            "id",
10096            Box::new(move || {
10097                let id = id.clone();
10098                Box::pin(async move { id.into_id().await.unwrap().quote() })
10099            }),
10100        );
10101        File {
10102            proc: self.proc.clone(),
10103            selection: query,
10104            graphql_client: self.graphql_client.clone(),
10105        }
10106    }
10107    /// Load a FunctionArg from its ID.
10108    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
10109        let mut query = self.selection.select("loadFunctionArgFromID");
10110        query = query.arg_lazy(
10111            "id",
10112            Box::new(move || {
10113                let id = id.clone();
10114                Box::pin(async move { id.into_id().await.unwrap().quote() })
10115            }),
10116        );
10117        FunctionArg {
10118            proc: self.proc.clone(),
10119            selection: query,
10120            graphql_client: self.graphql_client.clone(),
10121        }
10122    }
10123    /// Load a FunctionCallArgValue from its ID.
10124    pub fn load_function_call_arg_value_from_id(
10125        &self,
10126        id: impl IntoID<FunctionCallArgValueId>,
10127    ) -> FunctionCallArgValue {
10128        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
10129        query = query.arg_lazy(
10130            "id",
10131            Box::new(move || {
10132                let id = id.clone();
10133                Box::pin(async move { id.into_id().await.unwrap().quote() })
10134            }),
10135        );
10136        FunctionCallArgValue {
10137            proc: self.proc.clone(),
10138            selection: query,
10139            graphql_client: self.graphql_client.clone(),
10140        }
10141    }
10142    /// Load a FunctionCall from its ID.
10143    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
10144        let mut query = self.selection.select("loadFunctionCallFromID");
10145        query = query.arg_lazy(
10146            "id",
10147            Box::new(move || {
10148                let id = id.clone();
10149                Box::pin(async move { id.into_id().await.unwrap().quote() })
10150            }),
10151        );
10152        FunctionCall {
10153            proc: self.proc.clone(),
10154            selection: query,
10155            graphql_client: self.graphql_client.clone(),
10156        }
10157    }
10158    /// Load a Function from its ID.
10159    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
10160        let mut query = self.selection.select("loadFunctionFromID");
10161        query = query.arg_lazy(
10162            "id",
10163            Box::new(move || {
10164                let id = id.clone();
10165                Box::pin(async move { id.into_id().await.unwrap().quote() })
10166            }),
10167        );
10168        Function {
10169            proc: self.proc.clone(),
10170            selection: query,
10171            graphql_client: self.graphql_client.clone(),
10172        }
10173    }
10174    /// Load a GeneratedCode from its ID.
10175    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
10176        let mut query = self.selection.select("loadGeneratedCodeFromID");
10177        query = query.arg_lazy(
10178            "id",
10179            Box::new(move || {
10180                let id = id.clone();
10181                Box::pin(async move { id.into_id().await.unwrap().quote() })
10182            }),
10183        );
10184        GeneratedCode {
10185            proc: self.proc.clone(),
10186            selection: query,
10187            graphql_client: self.graphql_client.clone(),
10188        }
10189    }
10190    /// Load a GitRef from its ID.
10191    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
10192        let mut query = self.selection.select("loadGitRefFromID");
10193        query = query.arg_lazy(
10194            "id",
10195            Box::new(move || {
10196                let id = id.clone();
10197                Box::pin(async move { id.into_id().await.unwrap().quote() })
10198            }),
10199        );
10200        GitRef {
10201            proc: self.proc.clone(),
10202            selection: query,
10203            graphql_client: self.graphql_client.clone(),
10204        }
10205    }
10206    /// Load a GitRepository from its ID.
10207    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
10208        let mut query = self.selection.select("loadGitRepositoryFromID");
10209        query = query.arg_lazy(
10210            "id",
10211            Box::new(move || {
10212                let id = id.clone();
10213                Box::pin(async move { id.into_id().await.unwrap().quote() })
10214            }),
10215        );
10216        GitRepository {
10217            proc: self.proc.clone(),
10218            selection: query,
10219            graphql_client: self.graphql_client.clone(),
10220        }
10221    }
10222    /// Load a Host from its ID.
10223    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
10224        let mut query = self.selection.select("loadHostFromID");
10225        query = query.arg_lazy(
10226            "id",
10227            Box::new(move || {
10228                let id = id.clone();
10229                Box::pin(async move { id.into_id().await.unwrap().quote() })
10230            }),
10231        );
10232        Host {
10233            proc: self.proc.clone(),
10234            selection: query,
10235            graphql_client: self.graphql_client.clone(),
10236        }
10237    }
10238    /// Load a InputTypeDef from its ID.
10239    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
10240        let mut query = self.selection.select("loadInputTypeDefFromID");
10241        query = query.arg_lazy(
10242            "id",
10243            Box::new(move || {
10244                let id = id.clone();
10245                Box::pin(async move { id.into_id().await.unwrap().quote() })
10246            }),
10247        );
10248        InputTypeDef {
10249            proc: self.proc.clone(),
10250            selection: query,
10251            graphql_client: self.graphql_client.clone(),
10252        }
10253    }
10254    /// Load a InterfaceTypeDef from its ID.
10255    pub fn load_interface_type_def_from_id(
10256        &self,
10257        id: impl IntoID<InterfaceTypeDefId>,
10258    ) -> InterfaceTypeDef {
10259        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
10260        query = query.arg_lazy(
10261            "id",
10262            Box::new(move || {
10263                let id = id.clone();
10264                Box::pin(async move { id.into_id().await.unwrap().quote() })
10265            }),
10266        );
10267        InterfaceTypeDef {
10268            proc: self.proc.clone(),
10269            selection: query,
10270            graphql_client: self.graphql_client.clone(),
10271        }
10272    }
10273    /// Load a JSONValue from its ID.
10274    pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
10275        let mut query = self.selection.select("loadJSONValueFromID");
10276        query = query.arg_lazy(
10277            "id",
10278            Box::new(move || {
10279                let id = id.clone();
10280                Box::pin(async move { id.into_id().await.unwrap().quote() })
10281            }),
10282        );
10283        JsonValue {
10284            proc: self.proc.clone(),
10285            selection: query,
10286            graphql_client: self.graphql_client.clone(),
10287        }
10288    }
10289    /// Load a LLM from its ID.
10290    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
10291        let mut query = self.selection.select("loadLLMFromID");
10292        query = query.arg_lazy(
10293            "id",
10294            Box::new(move || {
10295                let id = id.clone();
10296                Box::pin(async move { id.into_id().await.unwrap().quote() })
10297            }),
10298        );
10299        Llm {
10300            proc: self.proc.clone(),
10301            selection: query,
10302            graphql_client: self.graphql_client.clone(),
10303        }
10304    }
10305    /// Load a LLMTokenUsage from its ID.
10306    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
10307        let mut query = self.selection.select("loadLLMTokenUsageFromID");
10308        query = query.arg_lazy(
10309            "id",
10310            Box::new(move || {
10311                let id = id.clone();
10312                Box::pin(async move { id.into_id().await.unwrap().quote() })
10313            }),
10314        );
10315        LlmTokenUsage {
10316            proc: self.proc.clone(),
10317            selection: query,
10318            graphql_client: self.graphql_client.clone(),
10319        }
10320    }
10321    /// Load a Label from its ID.
10322    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
10323        let mut query = self.selection.select("loadLabelFromID");
10324        query = query.arg_lazy(
10325            "id",
10326            Box::new(move || {
10327                let id = id.clone();
10328                Box::pin(async move { id.into_id().await.unwrap().quote() })
10329            }),
10330        );
10331        Label {
10332            proc: self.proc.clone(),
10333            selection: query,
10334            graphql_client: self.graphql_client.clone(),
10335        }
10336    }
10337    /// Load a ListTypeDef from its ID.
10338    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
10339        let mut query = self.selection.select("loadListTypeDefFromID");
10340        query = query.arg_lazy(
10341            "id",
10342            Box::new(move || {
10343                let id = id.clone();
10344                Box::pin(async move { id.into_id().await.unwrap().quote() })
10345            }),
10346        );
10347        ListTypeDef {
10348            proc: self.proc.clone(),
10349            selection: query,
10350            graphql_client: self.graphql_client.clone(),
10351        }
10352    }
10353    /// Load a ModuleConfigClient from its ID.
10354    pub fn load_module_config_client_from_id(
10355        &self,
10356        id: impl IntoID<ModuleConfigClientId>,
10357    ) -> ModuleConfigClient {
10358        let mut query = self.selection.select("loadModuleConfigClientFromID");
10359        query = query.arg_lazy(
10360            "id",
10361            Box::new(move || {
10362                let id = id.clone();
10363                Box::pin(async move { id.into_id().await.unwrap().quote() })
10364            }),
10365        );
10366        ModuleConfigClient {
10367            proc: self.proc.clone(),
10368            selection: query,
10369            graphql_client: self.graphql_client.clone(),
10370        }
10371    }
10372    /// Load a Module from its ID.
10373    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
10374        let mut query = self.selection.select("loadModuleFromID");
10375        query = query.arg_lazy(
10376            "id",
10377            Box::new(move || {
10378                let id = id.clone();
10379                Box::pin(async move { id.into_id().await.unwrap().quote() })
10380            }),
10381        );
10382        Module {
10383            proc: self.proc.clone(),
10384            selection: query,
10385            graphql_client: self.graphql_client.clone(),
10386        }
10387    }
10388    /// Load a ModuleSource from its ID.
10389    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
10390        let mut query = self.selection.select("loadModuleSourceFromID");
10391        query = query.arg_lazy(
10392            "id",
10393            Box::new(move || {
10394                let id = id.clone();
10395                Box::pin(async move { id.into_id().await.unwrap().quote() })
10396            }),
10397        );
10398        ModuleSource {
10399            proc: self.proc.clone(),
10400            selection: query,
10401            graphql_client: self.graphql_client.clone(),
10402        }
10403    }
10404    /// Load a ObjectTypeDef from its ID.
10405    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
10406        let mut query = self.selection.select("loadObjectTypeDefFromID");
10407        query = query.arg_lazy(
10408            "id",
10409            Box::new(move || {
10410                let id = id.clone();
10411                Box::pin(async move { id.into_id().await.unwrap().quote() })
10412            }),
10413        );
10414        ObjectTypeDef {
10415            proc: self.proc.clone(),
10416            selection: query,
10417            graphql_client: self.graphql_client.clone(),
10418        }
10419    }
10420    /// Load a Port from its ID.
10421    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
10422        let mut query = self.selection.select("loadPortFromID");
10423        query = query.arg_lazy(
10424            "id",
10425            Box::new(move || {
10426                let id = id.clone();
10427                Box::pin(async move { id.into_id().await.unwrap().quote() })
10428            }),
10429        );
10430        Port {
10431            proc: self.proc.clone(),
10432            selection: query,
10433            graphql_client: self.graphql_client.clone(),
10434        }
10435    }
10436    /// Load a SDKConfig from its ID.
10437    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
10438        let mut query = self.selection.select("loadSDKConfigFromID");
10439        query = query.arg_lazy(
10440            "id",
10441            Box::new(move || {
10442                let id = id.clone();
10443                Box::pin(async move { id.into_id().await.unwrap().quote() })
10444            }),
10445        );
10446        SdkConfig {
10447            proc: self.proc.clone(),
10448            selection: query,
10449            graphql_client: self.graphql_client.clone(),
10450        }
10451    }
10452    /// Load a ScalarTypeDef from its ID.
10453    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
10454        let mut query = self.selection.select("loadScalarTypeDefFromID");
10455        query = query.arg_lazy(
10456            "id",
10457            Box::new(move || {
10458                let id = id.clone();
10459                Box::pin(async move { id.into_id().await.unwrap().quote() })
10460            }),
10461        );
10462        ScalarTypeDef {
10463            proc: self.proc.clone(),
10464            selection: query,
10465            graphql_client: self.graphql_client.clone(),
10466        }
10467    }
10468    /// Load a SearchResult from its ID.
10469    pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
10470        let mut query = self.selection.select("loadSearchResultFromID");
10471        query = query.arg_lazy(
10472            "id",
10473            Box::new(move || {
10474                let id = id.clone();
10475                Box::pin(async move { id.into_id().await.unwrap().quote() })
10476            }),
10477        );
10478        SearchResult {
10479            proc: self.proc.clone(),
10480            selection: query,
10481            graphql_client: self.graphql_client.clone(),
10482        }
10483    }
10484    /// Load a SearchSubmatch from its ID.
10485    pub fn load_search_submatch_from_id(
10486        &self,
10487        id: impl IntoID<SearchSubmatchId>,
10488    ) -> SearchSubmatch {
10489        let mut query = self.selection.select("loadSearchSubmatchFromID");
10490        query = query.arg_lazy(
10491            "id",
10492            Box::new(move || {
10493                let id = id.clone();
10494                Box::pin(async move { id.into_id().await.unwrap().quote() })
10495            }),
10496        );
10497        SearchSubmatch {
10498            proc: self.proc.clone(),
10499            selection: query,
10500            graphql_client: self.graphql_client.clone(),
10501        }
10502    }
10503    /// Load a Secret from its ID.
10504    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
10505        let mut query = self.selection.select("loadSecretFromID");
10506        query = query.arg_lazy(
10507            "id",
10508            Box::new(move || {
10509                let id = id.clone();
10510                Box::pin(async move { id.into_id().await.unwrap().quote() })
10511            }),
10512        );
10513        Secret {
10514            proc: self.proc.clone(),
10515            selection: query,
10516            graphql_client: self.graphql_client.clone(),
10517        }
10518    }
10519    /// Load a Service from its ID.
10520    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
10521        let mut query = self.selection.select("loadServiceFromID");
10522        query = query.arg_lazy(
10523            "id",
10524            Box::new(move || {
10525                let id = id.clone();
10526                Box::pin(async move { id.into_id().await.unwrap().quote() })
10527            }),
10528        );
10529        Service {
10530            proc: self.proc.clone(),
10531            selection: query,
10532            graphql_client: self.graphql_client.clone(),
10533        }
10534    }
10535    /// Load a Socket from its ID.
10536    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
10537        let mut query = self.selection.select("loadSocketFromID");
10538        query = query.arg_lazy(
10539            "id",
10540            Box::new(move || {
10541                let id = id.clone();
10542                Box::pin(async move { id.into_id().await.unwrap().quote() })
10543            }),
10544        );
10545        Socket {
10546            proc: self.proc.clone(),
10547            selection: query,
10548            graphql_client: self.graphql_client.clone(),
10549        }
10550    }
10551    /// Load a SourceMap from its ID.
10552    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
10553        let mut query = self.selection.select("loadSourceMapFromID");
10554        query = query.arg_lazy(
10555            "id",
10556            Box::new(move || {
10557                let id = id.clone();
10558                Box::pin(async move { id.into_id().await.unwrap().quote() })
10559            }),
10560        );
10561        SourceMap {
10562            proc: self.proc.clone(),
10563            selection: query,
10564            graphql_client: self.graphql_client.clone(),
10565        }
10566    }
10567    /// Load a Terminal from its ID.
10568    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
10569        let mut query = self.selection.select("loadTerminalFromID");
10570        query = query.arg_lazy(
10571            "id",
10572            Box::new(move || {
10573                let id = id.clone();
10574                Box::pin(async move { id.into_id().await.unwrap().quote() })
10575            }),
10576        );
10577        Terminal {
10578            proc: self.proc.clone(),
10579            selection: query,
10580            graphql_client: self.graphql_client.clone(),
10581        }
10582    }
10583    /// Load a TypeDef from its ID.
10584    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
10585        let mut query = self.selection.select("loadTypeDefFromID");
10586        query = query.arg_lazy(
10587            "id",
10588            Box::new(move || {
10589                let id = id.clone();
10590                Box::pin(async move { id.into_id().await.unwrap().quote() })
10591            }),
10592        );
10593        TypeDef {
10594            proc: self.proc.clone(),
10595            selection: query,
10596            graphql_client: self.graphql_client.clone(),
10597        }
10598    }
10599    /// Create a new module.
10600    pub fn module(&self) -> Module {
10601        let query = self.selection.select("module");
10602        Module {
10603            proc: self.proc.clone(),
10604            selection: query,
10605            graphql_client: self.graphql_client.clone(),
10606        }
10607    }
10608    /// Create a new module source instance from a source ref string
10609    ///
10610    /// # Arguments
10611    ///
10612    /// * `ref_string` - The string ref representation of the module source
10613    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10614    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
10615        let mut query = self.selection.select("moduleSource");
10616        query = query.arg("refString", ref_string.into());
10617        ModuleSource {
10618            proc: self.proc.clone(),
10619            selection: query,
10620            graphql_client: self.graphql_client.clone(),
10621        }
10622    }
10623    /// Create a new module source instance from a source ref string
10624    ///
10625    /// # Arguments
10626    ///
10627    /// * `ref_string` - The string ref representation of the module source
10628    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10629    pub fn module_source_opts<'a>(
10630        &self,
10631        ref_string: impl Into<String>,
10632        opts: QueryModuleSourceOpts<'a>,
10633    ) -> ModuleSource {
10634        let mut query = self.selection.select("moduleSource");
10635        query = query.arg("refString", ref_string.into());
10636        if let Some(ref_pin) = opts.ref_pin {
10637            query = query.arg("refPin", ref_pin);
10638        }
10639        if let Some(disable_find_up) = opts.disable_find_up {
10640            query = query.arg("disableFindUp", disable_find_up);
10641        }
10642        if let Some(allow_not_exists) = opts.allow_not_exists {
10643            query = query.arg("allowNotExists", allow_not_exists);
10644        }
10645        if let Some(require_kind) = opts.require_kind {
10646            query = query.arg("requireKind", require_kind);
10647        }
10648        ModuleSource {
10649            proc: self.proc.clone(),
10650            selection: query,
10651            graphql_client: self.graphql_client.clone(),
10652        }
10653    }
10654    /// Creates a new secret.
10655    ///
10656    /// # Arguments
10657    ///
10658    /// * `uri` - The URI of the secret store
10659    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10660    pub fn secret(&self, uri: impl Into<String>) -> Secret {
10661        let mut query = self.selection.select("secret");
10662        query = query.arg("uri", uri.into());
10663        Secret {
10664            proc: self.proc.clone(),
10665            selection: query,
10666            graphql_client: self.graphql_client.clone(),
10667        }
10668    }
10669    /// Creates a new secret.
10670    ///
10671    /// # Arguments
10672    ///
10673    /// * `uri` - The URI of the secret store
10674    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10675    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
10676        let mut query = self.selection.select("secret");
10677        query = query.arg("uri", uri.into());
10678        if let Some(cache_key) = opts.cache_key {
10679            query = query.arg("cacheKey", cache_key);
10680        }
10681        Secret {
10682            proc: self.proc.clone(),
10683            selection: query,
10684            graphql_client: self.graphql_client.clone(),
10685        }
10686    }
10687    /// Sets a secret given a user defined name to its plaintext and returns the secret.
10688    /// The plaintext value is limited to a size of 128000 bytes.
10689    ///
10690    /// # Arguments
10691    ///
10692    /// * `name` - The user defined name for this secret
10693    /// * `plaintext` - The plaintext of the secret
10694    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
10695        let mut query = self.selection.select("setSecret");
10696        query = query.arg("name", name.into());
10697        query = query.arg("plaintext", plaintext.into());
10698        Secret {
10699            proc: self.proc.clone(),
10700            selection: query,
10701            graphql_client: self.graphql_client.clone(),
10702        }
10703    }
10704    /// Creates source map metadata.
10705    ///
10706    /// # Arguments
10707    ///
10708    /// * `filename` - The filename from the module source.
10709    /// * `line` - The line number within the filename.
10710    /// * `column` - The column number within the line.
10711    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
10712        let mut query = self.selection.select("sourceMap");
10713        query = query.arg("filename", filename.into());
10714        query = query.arg("line", line);
10715        query = query.arg("column", column);
10716        SourceMap {
10717            proc: self.proc.clone(),
10718            selection: query,
10719            graphql_client: self.graphql_client.clone(),
10720        }
10721    }
10722    /// Create a new TypeDef.
10723    pub fn type_def(&self) -> TypeDef {
10724        let query = self.selection.select("typeDef");
10725        TypeDef {
10726            proc: self.proc.clone(),
10727            selection: query,
10728            graphql_client: self.graphql_client.clone(),
10729        }
10730    }
10731    /// Get the current Dagger Engine version.
10732    pub async fn version(&self) -> Result<String, DaggerError> {
10733        let query = self.selection.select("version");
10734        query.execute(self.graphql_client.clone()).await
10735    }
10736}
10737#[derive(Clone)]
10738pub struct SdkConfig {
10739    pub proc: Option<Arc<DaggerSessionProc>>,
10740    pub selection: Selection,
10741    pub graphql_client: DynGraphQLClient,
10742}
10743impl SdkConfig {
10744    /// A unique identifier for this SDKConfig.
10745    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
10746        let query = self.selection.select("id");
10747        query.execute(self.graphql_client.clone()).await
10748    }
10749    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
10750    pub async fn source(&self) -> Result<String, DaggerError> {
10751        let query = self.selection.select("source");
10752        query.execute(self.graphql_client.clone()).await
10753    }
10754}
10755#[derive(Clone)]
10756pub struct ScalarTypeDef {
10757    pub proc: Option<Arc<DaggerSessionProc>>,
10758    pub selection: Selection,
10759    pub graphql_client: DynGraphQLClient,
10760}
10761impl ScalarTypeDef {
10762    /// A doc string for the scalar, if any.
10763    pub async fn description(&self) -> Result<String, DaggerError> {
10764        let query = self.selection.select("description");
10765        query.execute(self.graphql_client.clone()).await
10766    }
10767    /// A unique identifier for this ScalarTypeDef.
10768    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
10769        let query = self.selection.select("id");
10770        query.execute(self.graphql_client.clone()).await
10771    }
10772    /// The name of the scalar.
10773    pub async fn name(&self) -> Result<String, DaggerError> {
10774        let query = self.selection.select("name");
10775        query.execute(self.graphql_client.clone()).await
10776    }
10777    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
10778    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10779        let query = self.selection.select("sourceModuleName");
10780        query.execute(self.graphql_client.clone()).await
10781    }
10782}
10783#[derive(Clone)]
10784pub struct SearchResult {
10785    pub proc: Option<Arc<DaggerSessionProc>>,
10786    pub selection: Selection,
10787    pub graphql_client: DynGraphQLClient,
10788}
10789impl SearchResult {
10790    /// The byte offset of this line within the file.
10791    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
10792        let query = self.selection.select("absoluteOffset");
10793        query.execute(self.graphql_client.clone()).await
10794    }
10795    /// The path to the file that matched.
10796    pub async fn file_path(&self) -> Result<String, DaggerError> {
10797        let query = self.selection.select("filePath");
10798        query.execute(self.graphql_client.clone()).await
10799    }
10800    /// A unique identifier for this SearchResult.
10801    pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
10802        let query = self.selection.select("id");
10803        query.execute(self.graphql_client.clone()).await
10804    }
10805    /// The first line that matched.
10806    pub async fn line_number(&self) -> Result<isize, DaggerError> {
10807        let query = self.selection.select("lineNumber");
10808        query.execute(self.graphql_client.clone()).await
10809    }
10810    /// The line content that matched.
10811    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
10812        let query = self.selection.select("matchedLines");
10813        query.execute(self.graphql_client.clone()).await
10814    }
10815    /// Sub-match positions and content within the matched lines.
10816    pub fn submatches(&self) -> Vec<SearchSubmatch> {
10817        let query = self.selection.select("submatches");
10818        vec![SearchSubmatch {
10819            proc: self.proc.clone(),
10820            selection: query,
10821            graphql_client: self.graphql_client.clone(),
10822        }]
10823    }
10824}
10825#[derive(Clone)]
10826pub struct SearchSubmatch {
10827    pub proc: Option<Arc<DaggerSessionProc>>,
10828    pub selection: Selection,
10829    pub graphql_client: DynGraphQLClient,
10830}
10831impl SearchSubmatch {
10832    /// The match's end offset within the matched lines.
10833    pub async fn end(&self) -> Result<isize, DaggerError> {
10834        let query = self.selection.select("end");
10835        query.execute(self.graphql_client.clone()).await
10836    }
10837    /// A unique identifier for this SearchSubmatch.
10838    pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
10839        let query = self.selection.select("id");
10840        query.execute(self.graphql_client.clone()).await
10841    }
10842    /// The match's start offset within the matched lines.
10843    pub async fn start(&self) -> Result<isize, DaggerError> {
10844        let query = self.selection.select("start");
10845        query.execute(self.graphql_client.clone()).await
10846    }
10847    /// The matched text.
10848    pub async fn text(&self) -> Result<String, DaggerError> {
10849        let query = self.selection.select("text");
10850        query.execute(self.graphql_client.clone()).await
10851    }
10852}
10853#[derive(Clone)]
10854pub struct Secret {
10855    pub proc: Option<Arc<DaggerSessionProc>>,
10856    pub selection: Selection,
10857    pub graphql_client: DynGraphQLClient,
10858}
10859impl Secret {
10860    /// A unique identifier for this Secret.
10861    pub async fn id(&self) -> Result<SecretId, DaggerError> {
10862        let query = self.selection.select("id");
10863        query.execute(self.graphql_client.clone()).await
10864    }
10865    /// The name of this secret.
10866    pub async fn name(&self) -> Result<String, DaggerError> {
10867        let query = self.selection.select("name");
10868        query.execute(self.graphql_client.clone()).await
10869    }
10870    /// The value of this secret.
10871    pub async fn plaintext(&self) -> Result<String, DaggerError> {
10872        let query = self.selection.select("plaintext");
10873        query.execute(self.graphql_client.clone()).await
10874    }
10875    /// The URI of this secret.
10876    pub async fn uri(&self) -> Result<String, DaggerError> {
10877        let query = self.selection.select("uri");
10878        query.execute(self.graphql_client.clone()).await
10879    }
10880}
10881#[derive(Clone)]
10882pub struct Service {
10883    pub proc: Option<Arc<DaggerSessionProc>>,
10884    pub selection: Selection,
10885    pub graphql_client: DynGraphQLClient,
10886}
10887#[derive(Builder, Debug, PartialEq)]
10888pub struct ServiceEndpointOpts<'a> {
10889    /// The exposed port number for the endpoint
10890    #[builder(setter(into, strip_option), default)]
10891    pub port: Option<isize>,
10892    /// Return a URL with the given scheme, eg. http for http://
10893    #[builder(setter(into, strip_option), default)]
10894    pub scheme: Option<&'a str>,
10895}
10896#[derive(Builder, Debug, PartialEq)]
10897pub struct ServiceStopOpts {
10898    /// Immediately kill the service without waiting for a graceful exit
10899    #[builder(setter(into, strip_option), default)]
10900    pub kill: Option<bool>,
10901}
10902#[derive(Builder, Debug, PartialEq)]
10903pub struct ServiceTerminalOpts<'a> {
10904    #[builder(setter(into, strip_option), default)]
10905    pub cmd: Option<Vec<&'a str>>,
10906}
10907#[derive(Builder, Debug, PartialEq)]
10908pub struct ServiceUpOpts {
10909    /// List of frontend/backend port mappings to forward.
10910    /// Frontend is the port accepting traffic on the host, backend is the service port.
10911    #[builder(setter(into, strip_option), default)]
10912    pub ports: Option<Vec<PortForward>>,
10913    /// Bind each tunnel port to a random port on the host.
10914    #[builder(setter(into, strip_option), default)]
10915    pub random: Option<bool>,
10916}
10917impl Service {
10918    /// Retrieves an endpoint that clients can use to reach this container.
10919    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
10920    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
10921    ///
10922    /// # Arguments
10923    ///
10924    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10925    pub async fn endpoint(&self) -> Result<String, DaggerError> {
10926        let query = self.selection.select("endpoint");
10927        query.execute(self.graphql_client.clone()).await
10928    }
10929    /// Retrieves an endpoint that clients can use to reach this container.
10930    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
10931    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
10932    ///
10933    /// # Arguments
10934    ///
10935    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10936    pub async fn endpoint_opts<'a>(
10937        &self,
10938        opts: ServiceEndpointOpts<'a>,
10939    ) -> Result<String, DaggerError> {
10940        let mut query = self.selection.select("endpoint");
10941        if let Some(port) = opts.port {
10942            query = query.arg("port", port);
10943        }
10944        if let Some(scheme) = opts.scheme {
10945            query = query.arg("scheme", scheme);
10946        }
10947        query.execute(self.graphql_client.clone()).await
10948    }
10949    /// Retrieves a hostname which can be used by clients to reach this container.
10950    pub async fn hostname(&self) -> Result<String, DaggerError> {
10951        let query = self.selection.select("hostname");
10952        query.execute(self.graphql_client.clone()).await
10953    }
10954    /// A unique identifier for this Service.
10955    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
10956        let query = self.selection.select("id");
10957        query.execute(self.graphql_client.clone()).await
10958    }
10959    /// Retrieves the list of ports provided by the service.
10960    pub fn ports(&self) -> Vec<Port> {
10961        let query = self.selection.select("ports");
10962        vec![Port {
10963            proc: self.proc.clone(),
10964            selection: query,
10965            graphql_client: self.graphql_client.clone(),
10966        }]
10967    }
10968    /// Start the service and wait for its health checks to succeed.
10969    /// Services bound to a Container do not need to be manually started.
10970    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
10971        let query = self.selection.select("start");
10972        query.execute(self.graphql_client.clone()).await
10973    }
10974    /// Stop the service.
10975    ///
10976    /// # Arguments
10977    ///
10978    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10979    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
10980        let query = self.selection.select("stop");
10981        query.execute(self.graphql_client.clone()).await
10982    }
10983    /// Stop the service.
10984    ///
10985    /// # Arguments
10986    ///
10987    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10988    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
10989        let mut query = self.selection.select("stop");
10990        if let Some(kill) = opts.kill {
10991            query = query.arg("kill", kill);
10992        }
10993        query.execute(self.graphql_client.clone()).await
10994    }
10995    /// Forces evaluation of the pipeline in the engine.
10996    pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
10997        let query = self.selection.select("sync");
10998        query.execute(self.graphql_client.clone()).await
10999    }
11000    ///
11001    /// # Arguments
11002    ///
11003    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11004    pub fn terminal(&self) -> Service {
11005        let query = self.selection.select("terminal");
11006        Service {
11007            proc: self.proc.clone(),
11008            selection: query,
11009            graphql_client: self.graphql_client.clone(),
11010        }
11011    }
11012    ///
11013    /// # Arguments
11014    ///
11015    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11016    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
11017        let mut query = self.selection.select("terminal");
11018        if let Some(cmd) = opts.cmd {
11019            query = query.arg("cmd", cmd);
11020        }
11021        Service {
11022            proc: self.proc.clone(),
11023            selection: query,
11024            graphql_client: self.graphql_client.clone(),
11025        }
11026    }
11027    /// Creates a tunnel that forwards traffic from the caller's network to this service.
11028    ///
11029    /// # Arguments
11030    ///
11031    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11032    pub async fn up(&self) -> Result<Void, DaggerError> {
11033        let query = self.selection.select("up");
11034        query.execute(self.graphql_client.clone()).await
11035    }
11036    /// Creates a tunnel that forwards traffic from the caller's network to this service.
11037    ///
11038    /// # Arguments
11039    ///
11040    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11041    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
11042        let mut query = self.selection.select("up");
11043        if let Some(ports) = opts.ports {
11044            query = query.arg("ports", ports);
11045        }
11046        if let Some(random) = opts.random {
11047            query = query.arg("random", random);
11048        }
11049        query.execute(self.graphql_client.clone()).await
11050    }
11051    /// Configures a hostname which can be used by clients within the session to reach this container.
11052    ///
11053    /// # Arguments
11054    ///
11055    /// * `hostname` - The hostname to use.
11056    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
11057        let mut query = self.selection.select("withHostname");
11058        query = query.arg("hostname", hostname.into());
11059        Service {
11060            proc: self.proc.clone(),
11061            selection: query,
11062            graphql_client: self.graphql_client.clone(),
11063        }
11064    }
11065}
11066#[derive(Clone)]
11067pub struct Socket {
11068    pub proc: Option<Arc<DaggerSessionProc>>,
11069    pub selection: Selection,
11070    pub graphql_client: DynGraphQLClient,
11071}
11072impl Socket {
11073    /// A unique identifier for this Socket.
11074    pub async fn id(&self) -> Result<SocketId, DaggerError> {
11075        let query = self.selection.select("id");
11076        query.execute(self.graphql_client.clone()).await
11077    }
11078}
11079#[derive(Clone)]
11080pub struct SourceMap {
11081    pub proc: Option<Arc<DaggerSessionProc>>,
11082    pub selection: Selection,
11083    pub graphql_client: DynGraphQLClient,
11084}
11085impl SourceMap {
11086    /// The column number within the line.
11087    pub async fn column(&self) -> Result<isize, DaggerError> {
11088        let query = self.selection.select("column");
11089        query.execute(self.graphql_client.clone()).await
11090    }
11091    /// The filename from the module source.
11092    pub async fn filename(&self) -> Result<String, DaggerError> {
11093        let query = self.selection.select("filename");
11094        query.execute(self.graphql_client.clone()).await
11095    }
11096    /// A unique identifier for this SourceMap.
11097    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
11098        let query = self.selection.select("id");
11099        query.execute(self.graphql_client.clone()).await
11100    }
11101    /// The line number within the filename.
11102    pub async fn line(&self) -> Result<isize, DaggerError> {
11103        let query = self.selection.select("line");
11104        query.execute(self.graphql_client.clone()).await
11105    }
11106    /// The module dependency this was declared in.
11107    pub async fn module(&self) -> Result<String, DaggerError> {
11108        let query = self.selection.select("module");
11109        query.execute(self.graphql_client.clone()).await
11110    }
11111    /// The URL to the file, if any. This can be used to link to the source map in the browser.
11112    pub async fn url(&self) -> Result<String, DaggerError> {
11113        let query = self.selection.select("url");
11114        query.execute(self.graphql_client.clone()).await
11115    }
11116}
11117#[derive(Clone)]
11118pub struct Terminal {
11119    pub proc: Option<Arc<DaggerSessionProc>>,
11120    pub selection: Selection,
11121    pub graphql_client: DynGraphQLClient,
11122}
11123impl Terminal {
11124    /// A unique identifier for this Terminal.
11125    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
11126        let query = self.selection.select("id");
11127        query.execute(self.graphql_client.clone()).await
11128    }
11129    /// Forces evaluation of the pipeline in the engine.
11130    /// It doesn't run the default command if no exec has been set.
11131    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
11132        let query = self.selection.select("sync");
11133        query.execute(self.graphql_client.clone()).await
11134    }
11135}
11136#[derive(Clone)]
11137pub struct TypeDef {
11138    pub proc: Option<Arc<DaggerSessionProc>>,
11139    pub selection: Selection,
11140    pub graphql_client: DynGraphQLClient,
11141}
11142#[derive(Builder, Debug, PartialEq)]
11143pub struct TypeDefWithEnumOpts<'a> {
11144    /// A doc string for the enum, if any
11145    #[builder(setter(into, strip_option), default)]
11146    pub description: Option<&'a str>,
11147    /// The source map for the enum definition.
11148    #[builder(setter(into, strip_option), default)]
11149    pub source_map: Option<SourceMapId>,
11150}
11151#[derive(Builder, Debug, PartialEq)]
11152pub struct TypeDefWithEnumMemberOpts<'a> {
11153    /// A doc string for the member, if any
11154    #[builder(setter(into, strip_option), default)]
11155    pub description: Option<&'a str>,
11156    /// The source map for the enum member definition.
11157    #[builder(setter(into, strip_option), default)]
11158    pub source_map: Option<SourceMapId>,
11159    /// The value of the member in the enum
11160    #[builder(setter(into, strip_option), default)]
11161    pub value: Option<&'a str>,
11162}
11163#[derive(Builder, Debug, PartialEq)]
11164pub struct TypeDefWithEnumValueOpts<'a> {
11165    /// A doc string for the value, if any
11166    #[builder(setter(into, strip_option), default)]
11167    pub description: Option<&'a str>,
11168    /// The source map for the enum value definition.
11169    #[builder(setter(into, strip_option), default)]
11170    pub source_map: Option<SourceMapId>,
11171}
11172#[derive(Builder, Debug, PartialEq)]
11173pub struct TypeDefWithFieldOpts<'a> {
11174    /// A doc string for the field, if any
11175    #[builder(setter(into, strip_option), default)]
11176    pub description: Option<&'a str>,
11177    /// The source map for the field definition.
11178    #[builder(setter(into, strip_option), default)]
11179    pub source_map: Option<SourceMapId>,
11180}
11181#[derive(Builder, Debug, PartialEq)]
11182pub struct TypeDefWithInterfaceOpts<'a> {
11183    #[builder(setter(into, strip_option), default)]
11184    pub description: Option<&'a str>,
11185    #[builder(setter(into, strip_option), default)]
11186    pub source_map: Option<SourceMapId>,
11187}
11188#[derive(Builder, Debug, PartialEq)]
11189pub struct TypeDefWithObjectOpts<'a> {
11190    #[builder(setter(into, strip_option), default)]
11191    pub description: Option<&'a str>,
11192    #[builder(setter(into, strip_option), default)]
11193    pub source_map: Option<SourceMapId>,
11194}
11195#[derive(Builder, Debug, PartialEq)]
11196pub struct TypeDefWithScalarOpts<'a> {
11197    #[builder(setter(into, strip_option), default)]
11198    pub description: Option<&'a str>,
11199}
11200impl TypeDef {
11201    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
11202    pub fn as_enum(&self) -> EnumTypeDef {
11203        let query = self.selection.select("asEnum");
11204        EnumTypeDef {
11205            proc: self.proc.clone(),
11206            selection: query,
11207            graphql_client: self.graphql_client.clone(),
11208        }
11209    }
11210    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
11211    pub fn as_input(&self) -> InputTypeDef {
11212        let query = self.selection.select("asInput");
11213        InputTypeDef {
11214            proc: self.proc.clone(),
11215            selection: query,
11216            graphql_client: self.graphql_client.clone(),
11217        }
11218    }
11219    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
11220    pub fn as_interface(&self) -> InterfaceTypeDef {
11221        let query = self.selection.select("asInterface");
11222        InterfaceTypeDef {
11223            proc: self.proc.clone(),
11224            selection: query,
11225            graphql_client: self.graphql_client.clone(),
11226        }
11227    }
11228    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
11229    pub fn as_list(&self) -> ListTypeDef {
11230        let query = self.selection.select("asList");
11231        ListTypeDef {
11232            proc: self.proc.clone(),
11233            selection: query,
11234            graphql_client: self.graphql_client.clone(),
11235        }
11236    }
11237    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
11238    pub fn as_object(&self) -> ObjectTypeDef {
11239        let query = self.selection.select("asObject");
11240        ObjectTypeDef {
11241            proc: self.proc.clone(),
11242            selection: query,
11243            graphql_client: self.graphql_client.clone(),
11244        }
11245    }
11246    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
11247    pub fn as_scalar(&self) -> ScalarTypeDef {
11248        let query = self.selection.select("asScalar");
11249        ScalarTypeDef {
11250            proc: self.proc.clone(),
11251            selection: query,
11252            graphql_client: self.graphql_client.clone(),
11253        }
11254    }
11255    /// A unique identifier for this TypeDef.
11256    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
11257        let query = self.selection.select("id");
11258        query.execute(self.graphql_client.clone()).await
11259    }
11260    /// The kind of type this is (e.g. primitive, list, object).
11261    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
11262        let query = self.selection.select("kind");
11263        query.execute(self.graphql_client.clone()).await
11264    }
11265    /// Whether this type can be set to null. Defaults to false.
11266    pub async fn optional(&self) -> Result<bool, DaggerError> {
11267        let query = self.selection.select("optional");
11268        query.execute(self.graphql_client.clone()).await
11269    }
11270    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
11271    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
11272        let mut query = self.selection.select("withConstructor");
11273        query = query.arg_lazy(
11274            "function",
11275            Box::new(move || {
11276                let function = function.clone();
11277                Box::pin(async move { function.into_id().await.unwrap().quote() })
11278            }),
11279        );
11280        TypeDef {
11281            proc: self.proc.clone(),
11282            selection: query,
11283            graphql_client: self.graphql_client.clone(),
11284        }
11285    }
11286    /// Returns a TypeDef of kind Enum with the provided name.
11287    /// 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.
11288    ///
11289    /// # Arguments
11290    ///
11291    /// * `name` - The name of the enum
11292    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11293    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
11294        let mut query = self.selection.select("withEnum");
11295        query = query.arg("name", name.into());
11296        TypeDef {
11297            proc: self.proc.clone(),
11298            selection: query,
11299            graphql_client: self.graphql_client.clone(),
11300        }
11301    }
11302    /// Returns a TypeDef of kind Enum with the provided name.
11303    /// 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.
11304    ///
11305    /// # Arguments
11306    ///
11307    /// * `name` - The name of the enum
11308    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11309    pub fn with_enum_opts<'a>(
11310        &self,
11311        name: impl Into<String>,
11312        opts: TypeDefWithEnumOpts<'a>,
11313    ) -> TypeDef {
11314        let mut query = self.selection.select("withEnum");
11315        query = query.arg("name", name.into());
11316        if let Some(description) = opts.description {
11317            query = query.arg("description", description);
11318        }
11319        if let Some(source_map) = opts.source_map {
11320            query = query.arg("sourceMap", source_map);
11321        }
11322        TypeDef {
11323            proc: self.proc.clone(),
11324            selection: query,
11325            graphql_client: self.graphql_client.clone(),
11326        }
11327    }
11328    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
11329    ///
11330    /// # Arguments
11331    ///
11332    /// * `name` - The name of the member in the enum
11333    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11334    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
11335        let mut query = self.selection.select("withEnumMember");
11336        query = query.arg("name", name.into());
11337        TypeDef {
11338            proc: self.proc.clone(),
11339            selection: query,
11340            graphql_client: self.graphql_client.clone(),
11341        }
11342    }
11343    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
11344    ///
11345    /// # Arguments
11346    ///
11347    /// * `name` - The name of the member in the enum
11348    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11349    pub fn with_enum_member_opts<'a>(
11350        &self,
11351        name: impl Into<String>,
11352        opts: TypeDefWithEnumMemberOpts<'a>,
11353    ) -> TypeDef {
11354        let mut query = self.selection.select("withEnumMember");
11355        query = query.arg("name", name.into());
11356        if let Some(value) = opts.value {
11357            query = query.arg("value", value);
11358        }
11359        if let Some(description) = opts.description {
11360            query = query.arg("description", description);
11361        }
11362        if let Some(source_map) = opts.source_map {
11363            query = query.arg("sourceMap", source_map);
11364        }
11365        TypeDef {
11366            proc: self.proc.clone(),
11367            selection: query,
11368            graphql_client: self.graphql_client.clone(),
11369        }
11370    }
11371    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
11372    ///
11373    /// # Arguments
11374    ///
11375    /// * `value` - The name of the value in the enum
11376    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11377    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
11378        let mut query = self.selection.select("withEnumValue");
11379        query = query.arg("value", value.into());
11380        TypeDef {
11381            proc: self.proc.clone(),
11382            selection: query,
11383            graphql_client: self.graphql_client.clone(),
11384        }
11385    }
11386    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
11387    ///
11388    /// # Arguments
11389    ///
11390    /// * `value` - The name of the value in the enum
11391    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11392    pub fn with_enum_value_opts<'a>(
11393        &self,
11394        value: impl Into<String>,
11395        opts: TypeDefWithEnumValueOpts<'a>,
11396    ) -> TypeDef {
11397        let mut query = self.selection.select("withEnumValue");
11398        query = query.arg("value", value.into());
11399        if let Some(description) = opts.description {
11400            query = query.arg("description", description);
11401        }
11402        if let Some(source_map) = opts.source_map {
11403            query = query.arg("sourceMap", source_map);
11404        }
11405        TypeDef {
11406            proc: self.proc.clone(),
11407            selection: query,
11408            graphql_client: self.graphql_client.clone(),
11409        }
11410    }
11411    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
11412    ///
11413    /// # Arguments
11414    ///
11415    /// * `name` - The name of the field in the object
11416    /// * `type_def` - The type of the field
11417    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11418    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
11419        let mut query = self.selection.select("withField");
11420        query = query.arg("name", name.into());
11421        query = query.arg_lazy(
11422            "typeDef",
11423            Box::new(move || {
11424                let type_def = type_def.clone();
11425                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
11426            }),
11427        );
11428        TypeDef {
11429            proc: self.proc.clone(),
11430            selection: query,
11431            graphql_client: self.graphql_client.clone(),
11432        }
11433    }
11434    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
11435    ///
11436    /// # Arguments
11437    ///
11438    /// * `name` - The name of the field in the object
11439    /// * `type_def` - The type of the field
11440    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11441    pub fn with_field_opts<'a>(
11442        &self,
11443        name: impl Into<String>,
11444        type_def: impl IntoID<TypeDefId>,
11445        opts: TypeDefWithFieldOpts<'a>,
11446    ) -> TypeDef {
11447        let mut query = self.selection.select("withField");
11448        query = query.arg("name", name.into());
11449        query = query.arg_lazy(
11450            "typeDef",
11451            Box::new(move || {
11452                let type_def = type_def.clone();
11453                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
11454            }),
11455        );
11456        if let Some(description) = opts.description {
11457            query = query.arg("description", description);
11458        }
11459        if let Some(source_map) = opts.source_map {
11460            query = query.arg("sourceMap", source_map);
11461        }
11462        TypeDef {
11463            proc: self.proc.clone(),
11464            selection: query,
11465            graphql_client: self.graphql_client.clone(),
11466        }
11467    }
11468    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
11469    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
11470        let mut query = self.selection.select("withFunction");
11471        query = query.arg_lazy(
11472            "function",
11473            Box::new(move || {
11474                let function = function.clone();
11475                Box::pin(async move { function.into_id().await.unwrap().quote() })
11476            }),
11477        );
11478        TypeDef {
11479            proc: self.proc.clone(),
11480            selection: query,
11481            graphql_client: self.graphql_client.clone(),
11482        }
11483    }
11484    /// Returns a TypeDef of kind Interface with the provided name.
11485    ///
11486    /// # Arguments
11487    ///
11488    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11489    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
11490        let mut query = self.selection.select("withInterface");
11491        query = query.arg("name", name.into());
11492        TypeDef {
11493            proc: self.proc.clone(),
11494            selection: query,
11495            graphql_client: self.graphql_client.clone(),
11496        }
11497    }
11498    /// Returns a TypeDef of kind Interface with the provided name.
11499    ///
11500    /// # Arguments
11501    ///
11502    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11503    pub fn with_interface_opts<'a>(
11504        &self,
11505        name: impl Into<String>,
11506        opts: TypeDefWithInterfaceOpts<'a>,
11507    ) -> TypeDef {
11508        let mut query = self.selection.select("withInterface");
11509        query = query.arg("name", name.into());
11510        if let Some(description) = opts.description {
11511            query = query.arg("description", description);
11512        }
11513        if let Some(source_map) = opts.source_map {
11514            query = query.arg("sourceMap", source_map);
11515        }
11516        TypeDef {
11517            proc: self.proc.clone(),
11518            selection: query,
11519            graphql_client: self.graphql_client.clone(),
11520        }
11521    }
11522    /// Sets the kind of the type.
11523    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
11524        let mut query = self.selection.select("withKind");
11525        query = query.arg("kind", kind);
11526        TypeDef {
11527            proc: self.proc.clone(),
11528            selection: query,
11529            graphql_client: self.graphql_client.clone(),
11530        }
11531    }
11532    /// Returns a TypeDef of kind List with the provided type for its elements.
11533    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
11534        let mut query = self.selection.select("withListOf");
11535        query = query.arg_lazy(
11536            "elementType",
11537            Box::new(move || {
11538                let element_type = element_type.clone();
11539                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
11540            }),
11541        );
11542        TypeDef {
11543            proc: self.proc.clone(),
11544            selection: query,
11545            graphql_client: self.graphql_client.clone(),
11546        }
11547    }
11548    /// Returns a TypeDef of kind Object with the provided name.
11549    /// 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.
11550    ///
11551    /// # Arguments
11552    ///
11553    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11554    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
11555        let mut query = self.selection.select("withObject");
11556        query = query.arg("name", name.into());
11557        TypeDef {
11558            proc: self.proc.clone(),
11559            selection: query,
11560            graphql_client: self.graphql_client.clone(),
11561        }
11562    }
11563    /// Returns a TypeDef of kind Object with the provided name.
11564    /// 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.
11565    ///
11566    /// # Arguments
11567    ///
11568    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11569    pub fn with_object_opts<'a>(
11570        &self,
11571        name: impl Into<String>,
11572        opts: TypeDefWithObjectOpts<'a>,
11573    ) -> TypeDef {
11574        let mut query = self.selection.select("withObject");
11575        query = query.arg("name", name.into());
11576        if let Some(description) = opts.description {
11577            query = query.arg("description", description);
11578        }
11579        if let Some(source_map) = opts.source_map {
11580            query = query.arg("sourceMap", source_map);
11581        }
11582        TypeDef {
11583            proc: self.proc.clone(),
11584            selection: query,
11585            graphql_client: self.graphql_client.clone(),
11586        }
11587    }
11588    /// Sets whether this type can be set to null.
11589    pub fn with_optional(&self, optional: bool) -> TypeDef {
11590        let mut query = self.selection.select("withOptional");
11591        query = query.arg("optional", optional);
11592        TypeDef {
11593            proc: self.proc.clone(),
11594            selection: query,
11595            graphql_client: self.graphql_client.clone(),
11596        }
11597    }
11598    /// Returns a TypeDef of kind Scalar with the provided name.
11599    ///
11600    /// # Arguments
11601    ///
11602    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11603    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
11604        let mut query = self.selection.select("withScalar");
11605        query = query.arg("name", name.into());
11606        TypeDef {
11607            proc: self.proc.clone(),
11608            selection: query,
11609            graphql_client: self.graphql_client.clone(),
11610        }
11611    }
11612    /// Returns a TypeDef of kind Scalar with the provided name.
11613    ///
11614    /// # Arguments
11615    ///
11616    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11617    pub fn with_scalar_opts<'a>(
11618        &self,
11619        name: impl Into<String>,
11620        opts: TypeDefWithScalarOpts<'a>,
11621    ) -> TypeDef {
11622        let mut query = self.selection.select("withScalar");
11623        query = query.arg("name", name.into());
11624        if let Some(description) = opts.description {
11625            query = query.arg("description", description);
11626        }
11627        TypeDef {
11628            proc: self.proc.clone(),
11629            selection: query,
11630            graphql_client: self.graphql_client.clone(),
11631        }
11632    }
11633}
11634#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11635pub enum CacheSharingMode {
11636    #[serde(rename = "LOCKED")]
11637    Locked,
11638    #[serde(rename = "PRIVATE")]
11639    Private,
11640    #[serde(rename = "SHARED")]
11641    Shared,
11642}
11643#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11644pub enum ExistsType {
11645    #[serde(rename = "DIRECTORY_TYPE")]
11646    DirectoryType,
11647    #[serde(rename = "REGULAR_TYPE")]
11648    RegularType,
11649    #[serde(rename = "SYMLINK_TYPE")]
11650    SymlinkType,
11651}
11652#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11653pub enum ImageLayerCompression {
11654    #[serde(rename = "EStarGZ")]
11655    EStarGz,
11656    #[serde(rename = "ESTARGZ")]
11657    Estargz,
11658    #[serde(rename = "Gzip")]
11659    Gzip,
11660    #[serde(rename = "Uncompressed")]
11661    Uncompressed,
11662    #[serde(rename = "Zstd")]
11663    Zstd,
11664}
11665#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11666pub enum ImageMediaTypes {
11667    #[serde(rename = "DOCKER")]
11668    Docker,
11669    #[serde(rename = "DockerMediaTypes")]
11670    DockerMediaTypes,
11671    #[serde(rename = "OCI")]
11672    Oci,
11673    #[serde(rename = "OCIMediaTypes")]
11674    OciMediaTypes,
11675}
11676#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11677pub enum ModuleSourceKind {
11678    #[serde(rename = "DIR")]
11679    Dir,
11680    #[serde(rename = "DIR_SOURCE")]
11681    DirSource,
11682    #[serde(rename = "GIT")]
11683    Git,
11684    #[serde(rename = "GIT_SOURCE")]
11685    GitSource,
11686    #[serde(rename = "LOCAL")]
11687    Local,
11688    #[serde(rename = "LOCAL_SOURCE")]
11689    LocalSource,
11690}
11691#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11692pub enum NetworkProtocol {
11693    #[serde(rename = "TCP")]
11694    Tcp,
11695    #[serde(rename = "UDP")]
11696    Udp,
11697}
11698#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11699pub enum ReturnType {
11700    #[serde(rename = "ANY")]
11701    Any,
11702    #[serde(rename = "FAILURE")]
11703    Failure,
11704    #[serde(rename = "SUCCESS")]
11705    Success,
11706}
11707#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
11708pub enum TypeDefKind {
11709    #[serde(rename = "BOOLEAN")]
11710    Boolean,
11711    #[serde(rename = "BOOLEAN_KIND")]
11712    BooleanKind,
11713    #[serde(rename = "ENUM")]
11714    Enum,
11715    #[serde(rename = "ENUM_KIND")]
11716    EnumKind,
11717    #[serde(rename = "FLOAT")]
11718    Float,
11719    #[serde(rename = "FLOAT_KIND")]
11720    FloatKind,
11721    #[serde(rename = "INPUT")]
11722    Input,
11723    #[serde(rename = "INPUT_KIND")]
11724    InputKind,
11725    #[serde(rename = "INTEGER")]
11726    Integer,
11727    #[serde(rename = "INTEGER_KIND")]
11728    IntegerKind,
11729    #[serde(rename = "INTERFACE")]
11730    Interface,
11731    #[serde(rename = "INTERFACE_KIND")]
11732    InterfaceKind,
11733    #[serde(rename = "LIST")]
11734    List,
11735    #[serde(rename = "LIST_KIND")]
11736    ListKind,
11737    #[serde(rename = "OBJECT")]
11738    Object,
11739    #[serde(rename = "OBJECT_KIND")]
11740    ObjectKind,
11741    #[serde(rename = "SCALAR")]
11742    Scalar,
11743    #[serde(rename = "SCALAR_KIND")]
11744    ScalarKind,
11745    #[serde(rename = "STRING")]
11746    String,
11747    #[serde(rename = "STRING_KIND")]
11748    StringKind,
11749    #[serde(rename = "VOID")]
11750    Void,
11751    #[serde(rename = "VOID_KIND")]
11752    VoidKind,
11753}