Skip to main content

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 AddressId(pub String);
14impl From<&str> for AddressId {
15    fn from(value: &str) -> Self {
16        Self(value.to_string())
17    }
18}
19impl From<String> for AddressId {
20    fn from(value: String) -> Self {
21        Self(value)
22    }
23}
24impl IntoID<AddressId> for Address {
25    fn into_id(
26        self,
27    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<AddressId, DaggerError>> + Send>>
28    {
29        Box::pin(async move { self.id().await })
30    }
31}
32impl IntoID<AddressId> for AddressId {
33    fn into_id(
34        self,
35    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<AddressId, DaggerError>> + Send>>
36    {
37        Box::pin(async move { Ok::<AddressId, DaggerError>(self) })
38    }
39}
40impl AddressId {
41    fn quote(&self) -> String {
42        format!("\"{}\"", self.0.clone())
43    }
44}
45#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
46pub struct BindingId(pub String);
47impl From<&str> for BindingId {
48    fn from(value: &str) -> Self {
49        Self(value.to_string())
50    }
51}
52impl From<String> for BindingId {
53    fn from(value: String) -> Self {
54        Self(value)
55    }
56}
57impl IntoID<BindingId> for Binding {
58    fn into_id(
59        self,
60    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
61    {
62        Box::pin(async move { self.id().await })
63    }
64}
65impl IntoID<BindingId> for BindingId {
66    fn into_id(
67        self,
68    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
69    {
70        Box::pin(async move { Ok::<BindingId, DaggerError>(self) })
71    }
72}
73impl BindingId {
74    fn quote(&self) -> String {
75        format!("\"{}\"", self.0.clone())
76    }
77}
78#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
79pub struct CacheVolumeId(pub String);
80impl From<&str> for CacheVolumeId {
81    fn from(value: &str) -> Self {
82        Self(value.to_string())
83    }
84}
85impl From<String> for CacheVolumeId {
86    fn from(value: String) -> Self {
87        Self(value)
88    }
89}
90impl IntoID<CacheVolumeId> for CacheVolume {
91    fn into_id(
92        self,
93    ) -> std::pin::Pin<
94        Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
95    > {
96        Box::pin(async move { self.id().await })
97    }
98}
99impl IntoID<CacheVolumeId> for CacheVolumeId {
100    fn into_id(
101        self,
102    ) -> std::pin::Pin<
103        Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
104    > {
105        Box::pin(async move { Ok::<CacheVolumeId, DaggerError>(self) })
106    }
107}
108impl CacheVolumeId {
109    fn quote(&self) -> String {
110        format!("\"{}\"", self.0.clone())
111    }
112}
113#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
114pub struct ChangesetId(pub String);
115impl From<&str> for ChangesetId {
116    fn from(value: &str) -> Self {
117        Self(value.to_string())
118    }
119}
120impl From<String> for ChangesetId {
121    fn from(value: String) -> Self {
122        Self(value)
123    }
124}
125impl IntoID<ChangesetId> for Changeset {
126    fn into_id(
127        self,
128    ) -> std::pin::Pin<
129        Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
130    > {
131        Box::pin(async move { self.id().await })
132    }
133}
134impl IntoID<ChangesetId> for ChangesetId {
135    fn into_id(
136        self,
137    ) -> std::pin::Pin<
138        Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
139    > {
140        Box::pin(async move { Ok::<ChangesetId, DaggerError>(self) })
141    }
142}
143impl ChangesetId {
144    fn quote(&self) -> String {
145        format!("\"{}\"", self.0.clone())
146    }
147}
148#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
149pub struct CheckGroupId(pub String);
150impl From<&str> for CheckGroupId {
151    fn from(value: &str) -> Self {
152        Self(value.to_string())
153    }
154}
155impl From<String> for CheckGroupId {
156    fn from(value: String) -> Self {
157        Self(value)
158    }
159}
160impl IntoID<CheckGroupId> for CheckGroup {
161    fn into_id(
162        self,
163    ) -> std::pin::Pin<
164        Box<dyn core::future::Future<Output = Result<CheckGroupId, DaggerError>> + Send>,
165    > {
166        Box::pin(async move { self.id().await })
167    }
168}
169impl IntoID<CheckGroupId> for CheckGroupId {
170    fn into_id(
171        self,
172    ) -> std::pin::Pin<
173        Box<dyn core::future::Future<Output = Result<CheckGroupId, DaggerError>> + Send>,
174    > {
175        Box::pin(async move { Ok::<CheckGroupId, DaggerError>(self) })
176    }
177}
178impl CheckGroupId {
179    fn quote(&self) -> String {
180        format!("\"{}\"", self.0.clone())
181    }
182}
183#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
184pub struct CheckId(pub String);
185impl From<&str> for CheckId {
186    fn from(value: &str) -> Self {
187        Self(value.to_string())
188    }
189}
190impl From<String> for CheckId {
191    fn from(value: String) -> Self {
192        Self(value)
193    }
194}
195impl IntoID<CheckId> for Check {
196    fn into_id(
197        self,
198    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CheckId, DaggerError>> + Send>>
199    {
200        Box::pin(async move { self.id().await })
201    }
202}
203impl IntoID<CheckId> for CheckId {
204    fn into_id(
205        self,
206    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CheckId, DaggerError>> + Send>>
207    {
208        Box::pin(async move { Ok::<CheckId, DaggerError>(self) })
209    }
210}
211impl CheckId {
212    fn quote(&self) -> String {
213        format!("\"{}\"", self.0.clone())
214    }
215}
216#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
217pub struct CloudId(pub String);
218impl From<&str> for CloudId {
219    fn from(value: &str) -> Self {
220        Self(value.to_string())
221    }
222}
223impl From<String> for CloudId {
224    fn from(value: String) -> Self {
225        Self(value)
226    }
227}
228impl IntoID<CloudId> for Cloud {
229    fn into_id(
230        self,
231    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
232    {
233        Box::pin(async move { self.id().await })
234    }
235}
236impl IntoID<CloudId> for CloudId {
237    fn into_id(
238        self,
239    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
240    {
241        Box::pin(async move { Ok::<CloudId, DaggerError>(self) })
242    }
243}
244impl CloudId {
245    fn quote(&self) -> String {
246        format!("\"{}\"", self.0.clone())
247    }
248}
249#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
250pub struct ContainerId(pub String);
251impl From<&str> for ContainerId {
252    fn from(value: &str) -> Self {
253        Self(value.to_string())
254    }
255}
256impl From<String> for ContainerId {
257    fn from(value: String) -> Self {
258        Self(value)
259    }
260}
261impl IntoID<ContainerId> for Container {
262    fn into_id(
263        self,
264    ) -> std::pin::Pin<
265        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
266    > {
267        Box::pin(async move { self.id().await })
268    }
269}
270impl IntoID<ContainerId> for ContainerId {
271    fn into_id(
272        self,
273    ) -> std::pin::Pin<
274        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
275    > {
276        Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
277    }
278}
279impl ContainerId {
280    fn quote(&self) -> String {
281        format!("\"{}\"", self.0.clone())
282    }
283}
284#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
285pub struct CurrentModuleId(pub String);
286impl From<&str> for CurrentModuleId {
287    fn from(value: &str) -> Self {
288        Self(value.to_string())
289    }
290}
291impl From<String> for CurrentModuleId {
292    fn from(value: String) -> Self {
293        Self(value)
294    }
295}
296impl IntoID<CurrentModuleId> for CurrentModule {
297    fn into_id(
298        self,
299    ) -> std::pin::Pin<
300        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
301    > {
302        Box::pin(async move { self.id().await })
303    }
304}
305impl IntoID<CurrentModuleId> for CurrentModuleId {
306    fn into_id(
307        self,
308    ) -> std::pin::Pin<
309        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
310    > {
311        Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
312    }
313}
314impl CurrentModuleId {
315    fn quote(&self) -> String {
316        format!("\"{}\"", self.0.clone())
317    }
318}
319#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
320pub struct DirectoryId(pub String);
321impl From<&str> for DirectoryId {
322    fn from(value: &str) -> Self {
323        Self(value.to_string())
324    }
325}
326impl From<String> for DirectoryId {
327    fn from(value: String) -> Self {
328        Self(value)
329    }
330}
331impl IntoID<DirectoryId> for Directory {
332    fn into_id(
333        self,
334    ) -> std::pin::Pin<
335        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
336    > {
337        Box::pin(async move { self.id().await })
338    }
339}
340impl IntoID<DirectoryId> for DirectoryId {
341    fn into_id(
342        self,
343    ) -> std::pin::Pin<
344        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
345    > {
346        Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
347    }
348}
349impl DirectoryId {
350    fn quote(&self) -> String {
351        format!("\"{}\"", self.0.clone())
352    }
353}
354#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
355pub struct EngineCacheEntryId(pub String);
356impl From<&str> for EngineCacheEntryId {
357    fn from(value: &str) -> Self {
358        Self(value.to_string())
359    }
360}
361impl From<String> for EngineCacheEntryId {
362    fn from(value: String) -> Self {
363        Self(value)
364    }
365}
366impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
367    fn into_id(
368        self,
369    ) -> std::pin::Pin<
370        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
371    > {
372        Box::pin(async move { self.id().await })
373    }
374}
375impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
376    fn into_id(
377        self,
378    ) -> std::pin::Pin<
379        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
380    > {
381        Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
382    }
383}
384impl EngineCacheEntryId {
385    fn quote(&self) -> String {
386        format!("\"{}\"", self.0.clone())
387    }
388}
389#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
390pub struct EngineCacheEntrySetId(pub String);
391impl From<&str> for EngineCacheEntrySetId {
392    fn from(value: &str) -> Self {
393        Self(value.to_string())
394    }
395}
396impl From<String> for EngineCacheEntrySetId {
397    fn from(value: String) -> Self {
398        Self(value)
399    }
400}
401impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
402    fn into_id(
403        self,
404    ) -> std::pin::Pin<
405        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
406    > {
407        Box::pin(async move { self.id().await })
408    }
409}
410impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
411    fn into_id(
412        self,
413    ) -> std::pin::Pin<
414        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
415    > {
416        Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
417    }
418}
419impl EngineCacheEntrySetId {
420    fn quote(&self) -> String {
421        format!("\"{}\"", self.0.clone())
422    }
423}
424#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
425pub struct EngineCacheId(pub String);
426impl From<&str> for EngineCacheId {
427    fn from(value: &str) -> Self {
428        Self(value.to_string())
429    }
430}
431impl From<String> for EngineCacheId {
432    fn from(value: String) -> Self {
433        Self(value)
434    }
435}
436impl IntoID<EngineCacheId> for EngineCache {
437    fn into_id(
438        self,
439    ) -> std::pin::Pin<
440        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
441    > {
442        Box::pin(async move { self.id().await })
443    }
444}
445impl IntoID<EngineCacheId> for EngineCacheId {
446    fn into_id(
447        self,
448    ) -> std::pin::Pin<
449        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
450    > {
451        Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
452    }
453}
454impl EngineCacheId {
455    fn quote(&self) -> String {
456        format!("\"{}\"", self.0.clone())
457    }
458}
459#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
460pub struct EngineId(pub String);
461impl From<&str> for EngineId {
462    fn from(value: &str) -> Self {
463        Self(value.to_string())
464    }
465}
466impl From<String> for EngineId {
467    fn from(value: String) -> Self {
468        Self(value)
469    }
470}
471impl IntoID<EngineId> for Engine {
472    fn into_id(
473        self,
474    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
475    {
476        Box::pin(async move { self.id().await })
477    }
478}
479impl IntoID<EngineId> for EngineId {
480    fn into_id(
481        self,
482    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
483    {
484        Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
485    }
486}
487impl EngineId {
488    fn quote(&self) -> String {
489        format!("\"{}\"", self.0.clone())
490    }
491}
492#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
493pub struct EnumTypeDefId(pub String);
494impl From<&str> for EnumTypeDefId {
495    fn from(value: &str) -> Self {
496        Self(value.to_string())
497    }
498}
499impl From<String> for EnumTypeDefId {
500    fn from(value: String) -> Self {
501        Self(value)
502    }
503}
504impl IntoID<EnumTypeDefId> for EnumTypeDef {
505    fn into_id(
506        self,
507    ) -> std::pin::Pin<
508        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
509    > {
510        Box::pin(async move { self.id().await })
511    }
512}
513impl IntoID<EnumTypeDefId> for EnumTypeDefId {
514    fn into_id(
515        self,
516    ) -> std::pin::Pin<
517        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
518    > {
519        Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
520    }
521}
522impl EnumTypeDefId {
523    fn quote(&self) -> String {
524        format!("\"{}\"", self.0.clone())
525    }
526}
527#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
528pub struct EnumValueTypeDefId(pub String);
529impl From<&str> for EnumValueTypeDefId {
530    fn from(value: &str) -> Self {
531        Self(value.to_string())
532    }
533}
534impl From<String> for EnumValueTypeDefId {
535    fn from(value: String) -> Self {
536        Self(value)
537    }
538}
539impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
540    fn into_id(
541        self,
542    ) -> std::pin::Pin<
543        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
544    > {
545        Box::pin(async move { self.id().await })
546    }
547}
548impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
549    fn into_id(
550        self,
551    ) -> std::pin::Pin<
552        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
553    > {
554        Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
555    }
556}
557impl EnumValueTypeDefId {
558    fn quote(&self) -> String {
559        format!("\"{}\"", self.0.clone())
560    }
561}
562#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
563pub struct EnvFileId(pub String);
564impl From<&str> for EnvFileId {
565    fn from(value: &str) -> Self {
566        Self(value.to_string())
567    }
568}
569impl From<String> for EnvFileId {
570    fn from(value: String) -> Self {
571        Self(value)
572    }
573}
574impl IntoID<EnvFileId> for EnvFile {
575    fn into_id(
576        self,
577    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
578    {
579        Box::pin(async move { self.id().await })
580    }
581}
582impl IntoID<EnvFileId> for EnvFileId {
583    fn into_id(
584        self,
585    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
586    {
587        Box::pin(async move { Ok::<EnvFileId, DaggerError>(self) })
588    }
589}
590impl EnvFileId {
591    fn quote(&self) -> String {
592        format!("\"{}\"", self.0.clone())
593    }
594}
595#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
596pub struct EnvId(pub String);
597impl From<&str> for EnvId {
598    fn from(value: &str) -> Self {
599        Self(value.to_string())
600    }
601}
602impl From<String> for EnvId {
603    fn from(value: String) -> Self {
604        Self(value)
605    }
606}
607impl IntoID<EnvId> for Env {
608    fn into_id(
609        self,
610    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
611    {
612        Box::pin(async move { self.id().await })
613    }
614}
615impl IntoID<EnvId> for EnvId {
616    fn into_id(
617        self,
618    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
619    {
620        Box::pin(async move { Ok::<EnvId, DaggerError>(self) })
621    }
622}
623impl EnvId {
624    fn quote(&self) -> String {
625        format!("\"{}\"", self.0.clone())
626    }
627}
628#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
629pub struct EnvVariableId(pub String);
630impl From<&str> for EnvVariableId {
631    fn from(value: &str) -> Self {
632        Self(value.to_string())
633    }
634}
635impl From<String> for EnvVariableId {
636    fn from(value: String) -> Self {
637        Self(value)
638    }
639}
640impl IntoID<EnvVariableId> for EnvVariable {
641    fn into_id(
642        self,
643    ) -> std::pin::Pin<
644        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
645    > {
646        Box::pin(async move { self.id().await })
647    }
648}
649impl IntoID<EnvVariableId> for EnvVariableId {
650    fn into_id(
651        self,
652    ) -> std::pin::Pin<
653        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
654    > {
655        Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
656    }
657}
658impl EnvVariableId {
659    fn quote(&self) -> String {
660        format!("\"{}\"", self.0.clone())
661    }
662}
663#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
664pub struct ErrorId(pub String);
665impl From<&str> for ErrorId {
666    fn from(value: &str) -> Self {
667        Self(value.to_string())
668    }
669}
670impl From<String> for ErrorId {
671    fn from(value: String) -> Self {
672        Self(value)
673    }
674}
675impl IntoID<ErrorId> for Error {
676    fn into_id(
677        self,
678    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
679    {
680        Box::pin(async move { self.id().await })
681    }
682}
683impl IntoID<ErrorId> for ErrorId {
684    fn into_id(
685        self,
686    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
687    {
688        Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
689    }
690}
691impl ErrorId {
692    fn quote(&self) -> String {
693        format!("\"{}\"", self.0.clone())
694    }
695}
696#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
697pub struct ErrorValueId(pub String);
698impl From<&str> for ErrorValueId {
699    fn from(value: &str) -> Self {
700        Self(value.to_string())
701    }
702}
703impl From<String> for ErrorValueId {
704    fn from(value: String) -> Self {
705        Self(value)
706    }
707}
708impl IntoID<ErrorValueId> for ErrorValue {
709    fn into_id(
710        self,
711    ) -> std::pin::Pin<
712        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
713    > {
714        Box::pin(async move { self.id().await })
715    }
716}
717impl IntoID<ErrorValueId> for ErrorValueId {
718    fn into_id(
719        self,
720    ) -> std::pin::Pin<
721        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
722    > {
723        Box::pin(async move { Ok::<ErrorValueId, DaggerError>(self) })
724    }
725}
726impl ErrorValueId {
727    fn quote(&self) -> String {
728        format!("\"{}\"", self.0.clone())
729    }
730}
731#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
732pub struct FieldTypeDefId(pub String);
733impl From<&str> for FieldTypeDefId {
734    fn from(value: &str) -> Self {
735        Self(value.to_string())
736    }
737}
738impl From<String> for FieldTypeDefId {
739    fn from(value: String) -> Self {
740        Self(value)
741    }
742}
743impl IntoID<FieldTypeDefId> for FieldTypeDef {
744    fn into_id(
745        self,
746    ) -> std::pin::Pin<
747        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
748    > {
749        Box::pin(async move { self.id().await })
750    }
751}
752impl IntoID<FieldTypeDefId> for FieldTypeDefId {
753    fn into_id(
754        self,
755    ) -> std::pin::Pin<
756        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
757    > {
758        Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
759    }
760}
761impl FieldTypeDefId {
762    fn quote(&self) -> String {
763        format!("\"{}\"", self.0.clone())
764    }
765}
766#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
767pub struct FileId(pub String);
768impl From<&str> for FileId {
769    fn from(value: &str) -> Self {
770        Self(value.to_string())
771    }
772}
773impl From<String> for FileId {
774    fn from(value: String) -> Self {
775        Self(value)
776    }
777}
778impl IntoID<FileId> for File {
779    fn into_id(
780        self,
781    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
782    {
783        Box::pin(async move { self.id().await })
784    }
785}
786impl IntoID<FileId> for FileId {
787    fn into_id(
788        self,
789    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
790    {
791        Box::pin(async move { Ok::<FileId, DaggerError>(self) })
792    }
793}
794impl FileId {
795    fn quote(&self) -> String {
796        format!("\"{}\"", self.0.clone())
797    }
798}
799#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
800pub struct FunctionArgId(pub String);
801impl From<&str> for FunctionArgId {
802    fn from(value: &str) -> Self {
803        Self(value.to_string())
804    }
805}
806impl From<String> for FunctionArgId {
807    fn from(value: String) -> Self {
808        Self(value)
809    }
810}
811impl IntoID<FunctionArgId> for FunctionArg {
812    fn into_id(
813        self,
814    ) -> std::pin::Pin<
815        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
816    > {
817        Box::pin(async move { self.id().await })
818    }
819}
820impl IntoID<FunctionArgId> for FunctionArgId {
821    fn into_id(
822        self,
823    ) -> std::pin::Pin<
824        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
825    > {
826        Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
827    }
828}
829impl FunctionArgId {
830    fn quote(&self) -> String {
831        format!("\"{}\"", self.0.clone())
832    }
833}
834#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
835pub struct FunctionCallArgValueId(pub String);
836impl From<&str> for FunctionCallArgValueId {
837    fn from(value: &str) -> Self {
838        Self(value.to_string())
839    }
840}
841impl From<String> for FunctionCallArgValueId {
842    fn from(value: String) -> Self {
843        Self(value)
844    }
845}
846impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
847    fn into_id(
848        self,
849    ) -> std::pin::Pin<
850        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
851    > {
852        Box::pin(async move { self.id().await })
853    }
854}
855impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
856    fn into_id(
857        self,
858    ) -> std::pin::Pin<
859        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
860    > {
861        Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
862    }
863}
864impl FunctionCallArgValueId {
865    fn quote(&self) -> String {
866        format!("\"{}\"", self.0.clone())
867    }
868}
869#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
870pub struct FunctionCallId(pub String);
871impl From<&str> for FunctionCallId {
872    fn from(value: &str) -> Self {
873        Self(value.to_string())
874    }
875}
876impl From<String> for FunctionCallId {
877    fn from(value: String) -> Self {
878        Self(value)
879    }
880}
881impl IntoID<FunctionCallId> for FunctionCall {
882    fn into_id(
883        self,
884    ) -> std::pin::Pin<
885        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
886    > {
887        Box::pin(async move { self.id().await })
888    }
889}
890impl IntoID<FunctionCallId> for FunctionCallId {
891    fn into_id(
892        self,
893    ) -> std::pin::Pin<
894        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
895    > {
896        Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
897    }
898}
899impl FunctionCallId {
900    fn quote(&self) -> String {
901        format!("\"{}\"", self.0.clone())
902    }
903}
904#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
905pub struct FunctionId(pub String);
906impl From<&str> for FunctionId {
907    fn from(value: &str) -> Self {
908        Self(value.to_string())
909    }
910}
911impl From<String> for FunctionId {
912    fn from(value: String) -> Self {
913        Self(value)
914    }
915}
916impl IntoID<FunctionId> for Function {
917    fn into_id(
918        self,
919    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
920    {
921        Box::pin(async move { self.id().await })
922    }
923}
924impl IntoID<FunctionId> for FunctionId {
925    fn into_id(
926        self,
927    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
928    {
929        Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
930    }
931}
932impl FunctionId {
933    fn quote(&self) -> String {
934        format!("\"{}\"", self.0.clone())
935    }
936}
937#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
938pub struct GeneratedCodeId(pub String);
939impl From<&str> for GeneratedCodeId {
940    fn from(value: &str) -> Self {
941        Self(value.to_string())
942    }
943}
944impl From<String> for GeneratedCodeId {
945    fn from(value: String) -> Self {
946        Self(value)
947    }
948}
949impl IntoID<GeneratedCodeId> for GeneratedCode {
950    fn into_id(
951        self,
952    ) -> std::pin::Pin<
953        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
954    > {
955        Box::pin(async move { self.id().await })
956    }
957}
958impl IntoID<GeneratedCodeId> for GeneratedCodeId {
959    fn into_id(
960        self,
961    ) -> std::pin::Pin<
962        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
963    > {
964        Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
965    }
966}
967impl GeneratedCodeId {
968    fn quote(&self) -> String {
969        format!("\"{}\"", self.0.clone())
970    }
971}
972#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
973pub struct GeneratorGroupId(pub String);
974impl From<&str> for GeneratorGroupId {
975    fn from(value: &str) -> Self {
976        Self(value.to_string())
977    }
978}
979impl From<String> for GeneratorGroupId {
980    fn from(value: String) -> Self {
981        Self(value)
982    }
983}
984impl IntoID<GeneratorGroupId> for GeneratorGroup {
985    fn into_id(
986        self,
987    ) -> std::pin::Pin<
988        Box<dyn core::future::Future<Output = Result<GeneratorGroupId, DaggerError>> + Send>,
989    > {
990        Box::pin(async move { self.id().await })
991    }
992}
993impl IntoID<GeneratorGroupId> for GeneratorGroupId {
994    fn into_id(
995        self,
996    ) -> std::pin::Pin<
997        Box<dyn core::future::Future<Output = Result<GeneratorGroupId, DaggerError>> + Send>,
998    > {
999        Box::pin(async move { Ok::<GeneratorGroupId, DaggerError>(self) })
1000    }
1001}
1002impl GeneratorGroupId {
1003    fn quote(&self) -> String {
1004        format!("\"{}\"", self.0.clone())
1005    }
1006}
1007#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1008pub struct GeneratorId(pub String);
1009impl From<&str> for GeneratorId {
1010    fn from(value: &str) -> Self {
1011        Self(value.to_string())
1012    }
1013}
1014impl From<String> for GeneratorId {
1015    fn from(value: String) -> Self {
1016        Self(value)
1017    }
1018}
1019impl IntoID<GeneratorId> for Generator {
1020    fn into_id(
1021        self,
1022    ) -> std::pin::Pin<
1023        Box<dyn core::future::Future<Output = Result<GeneratorId, DaggerError>> + Send>,
1024    > {
1025        Box::pin(async move { self.id().await })
1026    }
1027}
1028impl IntoID<GeneratorId> for GeneratorId {
1029    fn into_id(
1030        self,
1031    ) -> std::pin::Pin<
1032        Box<dyn core::future::Future<Output = Result<GeneratorId, DaggerError>> + Send>,
1033    > {
1034        Box::pin(async move { Ok::<GeneratorId, DaggerError>(self) })
1035    }
1036}
1037impl GeneratorId {
1038    fn quote(&self) -> String {
1039        format!("\"{}\"", self.0.clone())
1040    }
1041}
1042#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1043pub struct GitRefId(pub String);
1044impl From<&str> for GitRefId {
1045    fn from(value: &str) -> Self {
1046        Self(value.to_string())
1047    }
1048}
1049impl From<String> for GitRefId {
1050    fn from(value: String) -> Self {
1051        Self(value)
1052    }
1053}
1054impl IntoID<GitRefId> for GitRef {
1055    fn into_id(
1056        self,
1057    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
1058    {
1059        Box::pin(async move { self.id().await })
1060    }
1061}
1062impl IntoID<GitRefId> for GitRefId {
1063    fn into_id(
1064        self,
1065    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
1066    {
1067        Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
1068    }
1069}
1070impl GitRefId {
1071    fn quote(&self) -> String {
1072        format!("\"{}\"", self.0.clone())
1073    }
1074}
1075#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1076pub struct GitRepositoryId(pub String);
1077impl From<&str> for GitRepositoryId {
1078    fn from(value: &str) -> Self {
1079        Self(value.to_string())
1080    }
1081}
1082impl From<String> for GitRepositoryId {
1083    fn from(value: String) -> Self {
1084        Self(value)
1085    }
1086}
1087impl IntoID<GitRepositoryId> for GitRepository {
1088    fn into_id(
1089        self,
1090    ) -> std::pin::Pin<
1091        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
1092    > {
1093        Box::pin(async move { self.id().await })
1094    }
1095}
1096impl IntoID<GitRepositoryId> for GitRepositoryId {
1097    fn into_id(
1098        self,
1099    ) -> std::pin::Pin<
1100        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
1101    > {
1102        Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
1103    }
1104}
1105impl GitRepositoryId {
1106    fn quote(&self) -> String {
1107        format!("\"{}\"", self.0.clone())
1108    }
1109}
1110#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1111pub struct HealthcheckConfigId(pub String);
1112impl From<&str> for HealthcheckConfigId {
1113    fn from(value: &str) -> Self {
1114        Self(value.to_string())
1115    }
1116}
1117impl From<String> for HealthcheckConfigId {
1118    fn from(value: String) -> Self {
1119        Self(value)
1120    }
1121}
1122impl IntoID<HealthcheckConfigId> for HealthcheckConfig {
1123    fn into_id(
1124        self,
1125    ) -> std::pin::Pin<
1126        Box<dyn core::future::Future<Output = Result<HealthcheckConfigId, DaggerError>> + Send>,
1127    > {
1128        Box::pin(async move { self.id().await })
1129    }
1130}
1131impl IntoID<HealthcheckConfigId> for HealthcheckConfigId {
1132    fn into_id(
1133        self,
1134    ) -> std::pin::Pin<
1135        Box<dyn core::future::Future<Output = Result<HealthcheckConfigId, DaggerError>> + Send>,
1136    > {
1137        Box::pin(async move { Ok::<HealthcheckConfigId, DaggerError>(self) })
1138    }
1139}
1140impl HealthcheckConfigId {
1141    fn quote(&self) -> String {
1142        format!("\"{}\"", self.0.clone())
1143    }
1144}
1145#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1146pub struct HostId(pub String);
1147impl From<&str> for HostId {
1148    fn from(value: &str) -> Self {
1149        Self(value.to_string())
1150    }
1151}
1152impl From<String> for HostId {
1153    fn from(value: String) -> Self {
1154        Self(value)
1155    }
1156}
1157impl IntoID<HostId> for Host {
1158    fn into_id(
1159        self,
1160    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
1161    {
1162        Box::pin(async move { self.id().await })
1163    }
1164}
1165impl IntoID<HostId> for HostId {
1166    fn into_id(
1167        self,
1168    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
1169    {
1170        Box::pin(async move { Ok::<HostId, DaggerError>(self) })
1171    }
1172}
1173impl HostId {
1174    fn quote(&self) -> String {
1175        format!("\"{}\"", self.0.clone())
1176    }
1177}
1178#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1179pub struct InputTypeDefId(pub String);
1180impl From<&str> for InputTypeDefId {
1181    fn from(value: &str) -> Self {
1182        Self(value.to_string())
1183    }
1184}
1185impl From<String> for InputTypeDefId {
1186    fn from(value: String) -> Self {
1187        Self(value)
1188    }
1189}
1190impl IntoID<InputTypeDefId> for InputTypeDef {
1191    fn into_id(
1192        self,
1193    ) -> std::pin::Pin<
1194        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1195    > {
1196        Box::pin(async move { self.id().await })
1197    }
1198}
1199impl IntoID<InputTypeDefId> for InputTypeDefId {
1200    fn into_id(
1201        self,
1202    ) -> std::pin::Pin<
1203        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1204    > {
1205        Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
1206    }
1207}
1208impl InputTypeDefId {
1209    fn quote(&self) -> String {
1210        format!("\"{}\"", self.0.clone())
1211    }
1212}
1213#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1214pub struct InterfaceTypeDefId(pub String);
1215impl From<&str> for InterfaceTypeDefId {
1216    fn from(value: &str) -> Self {
1217        Self(value.to_string())
1218    }
1219}
1220impl From<String> for InterfaceTypeDefId {
1221    fn from(value: String) -> Self {
1222        Self(value)
1223    }
1224}
1225impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
1226    fn into_id(
1227        self,
1228    ) -> std::pin::Pin<
1229        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1230    > {
1231        Box::pin(async move { self.id().await })
1232    }
1233}
1234impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
1235    fn into_id(
1236        self,
1237    ) -> std::pin::Pin<
1238        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1239    > {
1240        Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
1241    }
1242}
1243impl InterfaceTypeDefId {
1244    fn quote(&self) -> String {
1245        format!("\"{}\"", self.0.clone())
1246    }
1247}
1248#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1249pub struct Json(pub String);
1250impl From<&str> for Json {
1251    fn from(value: &str) -> Self {
1252        Self(value.to_string())
1253    }
1254}
1255impl From<String> for Json {
1256    fn from(value: String) -> Self {
1257        Self(value)
1258    }
1259}
1260impl Json {
1261    fn quote(&self) -> String {
1262        format!("\"{}\"", self.0.clone())
1263    }
1264}
1265#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1266pub struct JsonValueId(pub String);
1267impl From<&str> for JsonValueId {
1268    fn from(value: &str) -> Self {
1269        Self(value.to_string())
1270    }
1271}
1272impl From<String> for JsonValueId {
1273    fn from(value: String) -> Self {
1274        Self(value)
1275    }
1276}
1277impl IntoID<JsonValueId> for JsonValue {
1278    fn into_id(
1279        self,
1280    ) -> std::pin::Pin<
1281        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1282    > {
1283        Box::pin(async move { self.id().await })
1284    }
1285}
1286impl IntoID<JsonValueId> for JsonValueId {
1287    fn into_id(
1288        self,
1289    ) -> std::pin::Pin<
1290        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1291    > {
1292        Box::pin(async move { Ok::<JsonValueId, DaggerError>(self) })
1293    }
1294}
1295impl JsonValueId {
1296    fn quote(&self) -> String {
1297        format!("\"{}\"", self.0.clone())
1298    }
1299}
1300#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1301pub struct Llmid(pub String);
1302impl From<&str> for Llmid {
1303    fn from(value: &str) -> Self {
1304        Self(value.to_string())
1305    }
1306}
1307impl From<String> for Llmid {
1308    fn from(value: String) -> Self {
1309        Self(value)
1310    }
1311}
1312impl IntoID<Llmid> for Llm {
1313    fn into_id(
1314        self,
1315    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1316    {
1317        Box::pin(async move { self.id().await })
1318    }
1319}
1320impl IntoID<Llmid> for Llmid {
1321    fn into_id(
1322        self,
1323    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1324    {
1325        Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
1326    }
1327}
1328impl Llmid {
1329    fn quote(&self) -> String {
1330        format!("\"{}\"", self.0.clone())
1331    }
1332}
1333#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1334pub struct LlmTokenUsageId(pub String);
1335impl From<&str> for LlmTokenUsageId {
1336    fn from(value: &str) -> Self {
1337        Self(value.to_string())
1338    }
1339}
1340impl From<String> for LlmTokenUsageId {
1341    fn from(value: String) -> Self {
1342        Self(value)
1343    }
1344}
1345impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
1346    fn into_id(
1347        self,
1348    ) -> std::pin::Pin<
1349        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1350    > {
1351        Box::pin(async move { self.id().await })
1352    }
1353}
1354impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
1355    fn into_id(
1356        self,
1357    ) -> std::pin::Pin<
1358        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1359    > {
1360        Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
1361    }
1362}
1363impl LlmTokenUsageId {
1364    fn quote(&self) -> String {
1365        format!("\"{}\"", self.0.clone())
1366    }
1367}
1368#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1369pub struct LabelId(pub String);
1370impl From<&str> for LabelId {
1371    fn from(value: &str) -> Self {
1372        Self(value.to_string())
1373    }
1374}
1375impl From<String> for LabelId {
1376    fn from(value: String) -> Self {
1377        Self(value)
1378    }
1379}
1380impl IntoID<LabelId> for Label {
1381    fn into_id(
1382        self,
1383    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1384    {
1385        Box::pin(async move { self.id().await })
1386    }
1387}
1388impl IntoID<LabelId> for LabelId {
1389    fn into_id(
1390        self,
1391    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1392    {
1393        Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
1394    }
1395}
1396impl LabelId {
1397    fn quote(&self) -> String {
1398        format!("\"{}\"", self.0.clone())
1399    }
1400}
1401#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1402pub struct ListTypeDefId(pub String);
1403impl From<&str> for ListTypeDefId {
1404    fn from(value: &str) -> Self {
1405        Self(value.to_string())
1406    }
1407}
1408impl From<String> for ListTypeDefId {
1409    fn from(value: String) -> Self {
1410        Self(value)
1411    }
1412}
1413impl IntoID<ListTypeDefId> for ListTypeDef {
1414    fn into_id(
1415        self,
1416    ) -> std::pin::Pin<
1417        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1418    > {
1419        Box::pin(async move { self.id().await })
1420    }
1421}
1422impl IntoID<ListTypeDefId> for ListTypeDefId {
1423    fn into_id(
1424        self,
1425    ) -> std::pin::Pin<
1426        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1427    > {
1428        Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
1429    }
1430}
1431impl ListTypeDefId {
1432    fn quote(&self) -> String {
1433        format!("\"{}\"", self.0.clone())
1434    }
1435}
1436#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1437pub struct ModuleConfigClientId(pub String);
1438impl From<&str> for ModuleConfigClientId {
1439    fn from(value: &str) -> Self {
1440        Self(value.to_string())
1441    }
1442}
1443impl From<String> for ModuleConfigClientId {
1444    fn from(value: String) -> Self {
1445        Self(value)
1446    }
1447}
1448impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
1449    fn into_id(
1450        self,
1451    ) -> std::pin::Pin<
1452        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1453    > {
1454        Box::pin(async move { self.id().await })
1455    }
1456}
1457impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
1458    fn into_id(
1459        self,
1460    ) -> std::pin::Pin<
1461        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1462    > {
1463        Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
1464    }
1465}
1466impl ModuleConfigClientId {
1467    fn quote(&self) -> String {
1468        format!("\"{}\"", self.0.clone())
1469    }
1470}
1471#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1472pub struct ModuleId(pub String);
1473impl From<&str> for ModuleId {
1474    fn from(value: &str) -> Self {
1475        Self(value.to_string())
1476    }
1477}
1478impl From<String> for ModuleId {
1479    fn from(value: String) -> Self {
1480        Self(value)
1481    }
1482}
1483impl IntoID<ModuleId> for Module {
1484    fn into_id(
1485        self,
1486    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1487    {
1488        Box::pin(async move { self.id().await })
1489    }
1490}
1491impl IntoID<ModuleId> for ModuleId {
1492    fn into_id(
1493        self,
1494    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1495    {
1496        Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
1497    }
1498}
1499impl ModuleId {
1500    fn quote(&self) -> String {
1501        format!("\"{}\"", self.0.clone())
1502    }
1503}
1504#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1505pub struct ModuleSourceId(pub String);
1506impl From<&str> for ModuleSourceId {
1507    fn from(value: &str) -> Self {
1508        Self(value.to_string())
1509    }
1510}
1511impl From<String> for ModuleSourceId {
1512    fn from(value: String) -> Self {
1513        Self(value)
1514    }
1515}
1516impl IntoID<ModuleSourceId> for ModuleSource {
1517    fn into_id(
1518        self,
1519    ) -> std::pin::Pin<
1520        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1521    > {
1522        Box::pin(async move { self.id().await })
1523    }
1524}
1525impl IntoID<ModuleSourceId> for ModuleSourceId {
1526    fn into_id(
1527        self,
1528    ) -> std::pin::Pin<
1529        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1530    > {
1531        Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1532    }
1533}
1534impl ModuleSourceId {
1535    fn quote(&self) -> String {
1536        format!("\"{}\"", self.0.clone())
1537    }
1538}
1539#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1540pub struct ObjectTypeDefId(pub String);
1541impl From<&str> for ObjectTypeDefId {
1542    fn from(value: &str) -> Self {
1543        Self(value.to_string())
1544    }
1545}
1546impl From<String> for ObjectTypeDefId {
1547    fn from(value: String) -> Self {
1548        Self(value)
1549    }
1550}
1551impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1552    fn into_id(
1553        self,
1554    ) -> std::pin::Pin<
1555        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1556    > {
1557        Box::pin(async move { self.id().await })
1558    }
1559}
1560impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1561    fn into_id(
1562        self,
1563    ) -> std::pin::Pin<
1564        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1565    > {
1566        Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1567    }
1568}
1569impl ObjectTypeDefId {
1570    fn quote(&self) -> String {
1571        format!("\"{}\"", self.0.clone())
1572    }
1573}
1574#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1575pub struct Platform(pub String);
1576impl From<&str> for Platform {
1577    fn from(value: &str) -> Self {
1578        Self(value.to_string())
1579    }
1580}
1581impl From<String> for Platform {
1582    fn from(value: String) -> Self {
1583        Self(value)
1584    }
1585}
1586impl Platform {
1587    fn quote(&self) -> String {
1588        format!("\"{}\"", self.0.clone())
1589    }
1590}
1591#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1592pub struct PortId(pub String);
1593impl From<&str> for PortId {
1594    fn from(value: &str) -> Self {
1595        Self(value.to_string())
1596    }
1597}
1598impl From<String> for PortId {
1599    fn from(value: String) -> Self {
1600        Self(value)
1601    }
1602}
1603impl IntoID<PortId> for Port {
1604    fn into_id(
1605        self,
1606    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1607    {
1608        Box::pin(async move { self.id().await })
1609    }
1610}
1611impl IntoID<PortId> for PortId {
1612    fn into_id(
1613        self,
1614    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1615    {
1616        Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1617    }
1618}
1619impl PortId {
1620    fn quote(&self) -> String {
1621        format!("\"{}\"", self.0.clone())
1622    }
1623}
1624#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1625pub struct SdkConfigId(pub String);
1626impl From<&str> for SdkConfigId {
1627    fn from(value: &str) -> Self {
1628        Self(value.to_string())
1629    }
1630}
1631impl From<String> for SdkConfigId {
1632    fn from(value: String) -> Self {
1633        Self(value)
1634    }
1635}
1636impl IntoID<SdkConfigId> for SdkConfig {
1637    fn into_id(
1638        self,
1639    ) -> std::pin::Pin<
1640        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1641    > {
1642        Box::pin(async move { self.id().await })
1643    }
1644}
1645impl IntoID<SdkConfigId> for SdkConfigId {
1646    fn into_id(
1647        self,
1648    ) -> std::pin::Pin<
1649        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1650    > {
1651        Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1652    }
1653}
1654impl SdkConfigId {
1655    fn quote(&self) -> String {
1656        format!("\"{}\"", self.0.clone())
1657    }
1658}
1659#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1660pub struct ScalarTypeDefId(pub String);
1661impl From<&str> for ScalarTypeDefId {
1662    fn from(value: &str) -> Self {
1663        Self(value.to_string())
1664    }
1665}
1666impl From<String> for ScalarTypeDefId {
1667    fn from(value: String) -> Self {
1668        Self(value)
1669    }
1670}
1671impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1672    fn into_id(
1673        self,
1674    ) -> std::pin::Pin<
1675        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1676    > {
1677        Box::pin(async move { self.id().await })
1678    }
1679}
1680impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1681    fn into_id(
1682        self,
1683    ) -> std::pin::Pin<
1684        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1685    > {
1686        Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1687    }
1688}
1689impl ScalarTypeDefId {
1690    fn quote(&self) -> String {
1691        format!("\"{}\"", self.0.clone())
1692    }
1693}
1694#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1695pub struct SearchResultId(pub String);
1696impl From<&str> for SearchResultId {
1697    fn from(value: &str) -> Self {
1698        Self(value.to_string())
1699    }
1700}
1701impl From<String> for SearchResultId {
1702    fn from(value: String) -> Self {
1703        Self(value)
1704    }
1705}
1706impl IntoID<SearchResultId> for SearchResult {
1707    fn into_id(
1708        self,
1709    ) -> std::pin::Pin<
1710        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1711    > {
1712        Box::pin(async move { self.id().await })
1713    }
1714}
1715impl IntoID<SearchResultId> for SearchResultId {
1716    fn into_id(
1717        self,
1718    ) -> std::pin::Pin<
1719        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1720    > {
1721        Box::pin(async move { Ok::<SearchResultId, DaggerError>(self) })
1722    }
1723}
1724impl SearchResultId {
1725    fn quote(&self) -> String {
1726        format!("\"{}\"", self.0.clone())
1727    }
1728}
1729#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1730pub struct SearchSubmatchId(pub String);
1731impl From<&str> for SearchSubmatchId {
1732    fn from(value: &str) -> Self {
1733        Self(value.to_string())
1734    }
1735}
1736impl From<String> for SearchSubmatchId {
1737    fn from(value: String) -> Self {
1738        Self(value)
1739    }
1740}
1741impl IntoID<SearchSubmatchId> for SearchSubmatch {
1742    fn into_id(
1743        self,
1744    ) -> std::pin::Pin<
1745        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1746    > {
1747        Box::pin(async move { self.id().await })
1748    }
1749}
1750impl IntoID<SearchSubmatchId> for SearchSubmatchId {
1751    fn into_id(
1752        self,
1753    ) -> std::pin::Pin<
1754        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1755    > {
1756        Box::pin(async move { Ok::<SearchSubmatchId, DaggerError>(self) })
1757    }
1758}
1759impl SearchSubmatchId {
1760    fn quote(&self) -> String {
1761        format!("\"{}\"", self.0.clone())
1762    }
1763}
1764#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1765pub struct SecretId(pub String);
1766impl From<&str> for SecretId {
1767    fn from(value: &str) -> Self {
1768        Self(value.to_string())
1769    }
1770}
1771impl From<String> for SecretId {
1772    fn from(value: String) -> Self {
1773        Self(value)
1774    }
1775}
1776impl IntoID<SecretId> for Secret {
1777    fn into_id(
1778        self,
1779    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1780    {
1781        Box::pin(async move { self.id().await })
1782    }
1783}
1784impl IntoID<SecretId> for SecretId {
1785    fn into_id(
1786        self,
1787    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1788    {
1789        Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1790    }
1791}
1792impl SecretId {
1793    fn quote(&self) -> String {
1794        format!("\"{}\"", self.0.clone())
1795    }
1796}
1797#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1798pub struct ServiceId(pub String);
1799impl From<&str> for ServiceId {
1800    fn from(value: &str) -> Self {
1801        Self(value.to_string())
1802    }
1803}
1804impl From<String> for ServiceId {
1805    fn from(value: String) -> Self {
1806        Self(value)
1807    }
1808}
1809impl IntoID<ServiceId> for Service {
1810    fn into_id(
1811        self,
1812    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1813    {
1814        Box::pin(async move { self.id().await })
1815    }
1816}
1817impl IntoID<ServiceId> for ServiceId {
1818    fn into_id(
1819        self,
1820    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1821    {
1822        Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1823    }
1824}
1825impl ServiceId {
1826    fn quote(&self) -> String {
1827        format!("\"{}\"", self.0.clone())
1828    }
1829}
1830#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1831pub struct SocketId(pub String);
1832impl From<&str> for SocketId {
1833    fn from(value: &str) -> Self {
1834        Self(value.to_string())
1835    }
1836}
1837impl From<String> for SocketId {
1838    fn from(value: String) -> Self {
1839        Self(value)
1840    }
1841}
1842impl IntoID<SocketId> for Socket {
1843    fn into_id(
1844        self,
1845    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1846    {
1847        Box::pin(async move { self.id().await })
1848    }
1849}
1850impl IntoID<SocketId> for SocketId {
1851    fn into_id(
1852        self,
1853    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1854    {
1855        Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1856    }
1857}
1858impl SocketId {
1859    fn quote(&self) -> String {
1860        format!("\"{}\"", self.0.clone())
1861    }
1862}
1863#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1864pub struct SourceMapId(pub String);
1865impl From<&str> for SourceMapId {
1866    fn from(value: &str) -> Self {
1867        Self(value.to_string())
1868    }
1869}
1870impl From<String> for SourceMapId {
1871    fn from(value: String) -> Self {
1872        Self(value)
1873    }
1874}
1875impl IntoID<SourceMapId> for SourceMap {
1876    fn into_id(
1877        self,
1878    ) -> std::pin::Pin<
1879        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1880    > {
1881        Box::pin(async move { self.id().await })
1882    }
1883}
1884impl IntoID<SourceMapId> for SourceMapId {
1885    fn into_id(
1886        self,
1887    ) -> std::pin::Pin<
1888        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1889    > {
1890        Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1891    }
1892}
1893impl SourceMapId {
1894    fn quote(&self) -> String {
1895        format!("\"{}\"", self.0.clone())
1896    }
1897}
1898#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1899pub struct StatId(pub String);
1900impl From<&str> for StatId {
1901    fn from(value: &str) -> Self {
1902        Self(value.to_string())
1903    }
1904}
1905impl From<String> for StatId {
1906    fn from(value: String) -> Self {
1907        Self(value)
1908    }
1909}
1910impl IntoID<StatId> for Stat {
1911    fn into_id(
1912        self,
1913    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<StatId, DaggerError>> + Send>>
1914    {
1915        Box::pin(async move { self.id().await })
1916    }
1917}
1918impl IntoID<StatId> for StatId {
1919    fn into_id(
1920        self,
1921    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<StatId, DaggerError>> + Send>>
1922    {
1923        Box::pin(async move { Ok::<StatId, DaggerError>(self) })
1924    }
1925}
1926impl StatId {
1927    fn quote(&self) -> String {
1928        format!("\"{}\"", self.0.clone())
1929    }
1930}
1931#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1932pub struct TerminalId(pub String);
1933impl From<&str> for TerminalId {
1934    fn from(value: &str) -> Self {
1935        Self(value.to_string())
1936    }
1937}
1938impl From<String> for TerminalId {
1939    fn from(value: String) -> Self {
1940        Self(value)
1941    }
1942}
1943impl IntoID<TerminalId> for Terminal {
1944    fn into_id(
1945        self,
1946    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1947    {
1948        Box::pin(async move { self.id().await })
1949    }
1950}
1951impl IntoID<TerminalId> for TerminalId {
1952    fn into_id(
1953        self,
1954    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1955    {
1956        Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
1957    }
1958}
1959impl TerminalId {
1960    fn quote(&self) -> String {
1961        format!("\"{}\"", self.0.clone())
1962    }
1963}
1964#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1965pub struct TypeDefId(pub String);
1966impl From<&str> for TypeDefId {
1967    fn from(value: &str) -> Self {
1968        Self(value.to_string())
1969    }
1970}
1971impl From<String> for TypeDefId {
1972    fn from(value: String) -> Self {
1973        Self(value)
1974    }
1975}
1976impl IntoID<TypeDefId> for TypeDef {
1977    fn into_id(
1978        self,
1979    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1980    {
1981        Box::pin(async move { self.id().await })
1982    }
1983}
1984impl IntoID<TypeDefId> for TypeDefId {
1985    fn into_id(
1986        self,
1987    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1988    {
1989        Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
1990    }
1991}
1992impl TypeDefId {
1993    fn quote(&self) -> String {
1994        format!("\"{}\"", self.0.clone())
1995    }
1996}
1997#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1998pub struct Void(pub String);
1999impl From<&str> for Void {
2000    fn from(value: &str) -> Self {
2001        Self(value.to_string())
2002    }
2003}
2004impl From<String> for Void {
2005    fn from(value: String) -> Self {
2006        Self(value)
2007    }
2008}
2009impl Void {
2010    fn quote(&self) -> String {
2011        format!("\"{}\"", self.0.clone())
2012    }
2013}
2014#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2015pub struct WorkspaceId(pub String);
2016impl From<&str> for WorkspaceId {
2017    fn from(value: &str) -> Self {
2018        Self(value.to_string())
2019    }
2020}
2021impl From<String> for WorkspaceId {
2022    fn from(value: String) -> Self {
2023        Self(value)
2024    }
2025}
2026impl IntoID<WorkspaceId> for Workspace {
2027    fn into_id(
2028        self,
2029    ) -> std::pin::Pin<
2030        Box<dyn core::future::Future<Output = Result<WorkspaceId, DaggerError>> + Send>,
2031    > {
2032        Box::pin(async move { self.id().await })
2033    }
2034}
2035impl IntoID<WorkspaceId> for WorkspaceId {
2036    fn into_id(
2037        self,
2038    ) -> std::pin::Pin<
2039        Box<dyn core::future::Future<Output = Result<WorkspaceId, DaggerError>> + Send>,
2040    > {
2041        Box::pin(async move { Ok::<WorkspaceId, DaggerError>(self) })
2042    }
2043}
2044impl WorkspaceId {
2045    fn quote(&self) -> String {
2046        format!("\"{}\"", self.0.clone())
2047    }
2048}
2049#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
2050pub struct BuildArg {
2051    pub name: String,
2052    pub value: String,
2053}
2054#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
2055pub struct PipelineLabel {
2056    pub name: String,
2057    pub value: String,
2058}
2059#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
2060pub struct PortForward {
2061    pub backend: isize,
2062    pub frontend: isize,
2063    pub protocol: NetworkProtocol,
2064}
2065#[derive(Clone)]
2066pub struct Address {
2067    pub proc: Option<Arc<DaggerSessionProc>>,
2068    pub selection: Selection,
2069    pub graphql_client: DynGraphQLClient,
2070}
2071#[derive(Builder, Debug, PartialEq)]
2072pub struct AddressDirectoryOpts<'a> {
2073    #[builder(setter(into, strip_option), default)]
2074    pub exclude: Option<Vec<&'a str>>,
2075    #[builder(setter(into, strip_option), default)]
2076    pub gitignore: Option<bool>,
2077    #[builder(setter(into, strip_option), default)]
2078    pub include: Option<Vec<&'a str>>,
2079    #[builder(setter(into, strip_option), default)]
2080    pub no_cache: Option<bool>,
2081}
2082#[derive(Builder, Debug, PartialEq)]
2083pub struct AddressFileOpts<'a> {
2084    #[builder(setter(into, strip_option), default)]
2085    pub exclude: Option<Vec<&'a str>>,
2086    #[builder(setter(into, strip_option), default)]
2087    pub gitignore: Option<bool>,
2088    #[builder(setter(into, strip_option), default)]
2089    pub include: Option<Vec<&'a str>>,
2090    #[builder(setter(into, strip_option), default)]
2091    pub no_cache: Option<bool>,
2092}
2093impl Address {
2094    /// Load a container from the address.
2095    pub fn container(&self) -> Container {
2096        let query = self.selection.select("container");
2097        Container {
2098            proc: self.proc.clone(),
2099            selection: query,
2100            graphql_client: self.graphql_client.clone(),
2101        }
2102    }
2103    /// Load a directory from the address.
2104    ///
2105    /// # Arguments
2106    ///
2107    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2108    pub fn directory(&self) -> Directory {
2109        let query = self.selection.select("directory");
2110        Directory {
2111            proc: self.proc.clone(),
2112            selection: query,
2113            graphql_client: self.graphql_client.clone(),
2114        }
2115    }
2116    /// Load a directory from the address.
2117    ///
2118    /// # Arguments
2119    ///
2120    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2121    pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
2122        let mut query = self.selection.select("directory");
2123        if let Some(exclude) = opts.exclude {
2124            query = query.arg("exclude", exclude);
2125        }
2126        if let Some(include) = opts.include {
2127            query = query.arg("include", include);
2128        }
2129        if let Some(gitignore) = opts.gitignore {
2130            query = query.arg("gitignore", gitignore);
2131        }
2132        if let Some(no_cache) = opts.no_cache {
2133            query = query.arg("noCache", no_cache);
2134        }
2135        Directory {
2136            proc: self.proc.clone(),
2137            selection: query,
2138            graphql_client: self.graphql_client.clone(),
2139        }
2140    }
2141    /// Load a file from the address.
2142    ///
2143    /// # Arguments
2144    ///
2145    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2146    pub fn file(&self) -> File {
2147        let query = self.selection.select("file");
2148        File {
2149            proc: self.proc.clone(),
2150            selection: query,
2151            graphql_client: self.graphql_client.clone(),
2152        }
2153    }
2154    /// Load a file from the address.
2155    ///
2156    /// # Arguments
2157    ///
2158    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2159    pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
2160        let mut query = self.selection.select("file");
2161        if let Some(exclude) = opts.exclude {
2162            query = query.arg("exclude", exclude);
2163        }
2164        if let Some(include) = opts.include {
2165            query = query.arg("include", include);
2166        }
2167        if let Some(gitignore) = opts.gitignore {
2168            query = query.arg("gitignore", gitignore);
2169        }
2170        if let Some(no_cache) = opts.no_cache {
2171            query = query.arg("noCache", no_cache);
2172        }
2173        File {
2174            proc: self.proc.clone(),
2175            selection: query,
2176            graphql_client: self.graphql_client.clone(),
2177        }
2178    }
2179    /// Load a git ref (branch, tag or commit) from the address.
2180    pub fn git_ref(&self) -> GitRef {
2181        let query = self.selection.select("gitRef");
2182        GitRef {
2183            proc: self.proc.clone(),
2184            selection: query,
2185            graphql_client: self.graphql_client.clone(),
2186        }
2187    }
2188    /// Load a git repository from the address.
2189    pub fn git_repository(&self) -> GitRepository {
2190        let query = self.selection.select("gitRepository");
2191        GitRepository {
2192            proc: self.proc.clone(),
2193            selection: query,
2194            graphql_client: self.graphql_client.clone(),
2195        }
2196    }
2197    /// A unique identifier for this Address.
2198    pub async fn id(&self) -> Result<AddressId, DaggerError> {
2199        let query = self.selection.select("id");
2200        query.execute(self.graphql_client.clone()).await
2201    }
2202    /// Load a secret from the address.
2203    pub fn secret(&self) -> Secret {
2204        let query = self.selection.select("secret");
2205        Secret {
2206            proc: self.proc.clone(),
2207            selection: query,
2208            graphql_client: self.graphql_client.clone(),
2209        }
2210    }
2211    /// Load a service from the address.
2212    pub fn service(&self) -> Service {
2213        let query = self.selection.select("service");
2214        Service {
2215            proc: self.proc.clone(),
2216            selection: query,
2217            graphql_client: self.graphql_client.clone(),
2218        }
2219    }
2220    /// Load a local socket from the address.
2221    pub fn socket(&self) -> Socket {
2222        let query = self.selection.select("socket");
2223        Socket {
2224            proc: self.proc.clone(),
2225            selection: query,
2226            graphql_client: self.graphql_client.clone(),
2227        }
2228    }
2229    /// The address value
2230    pub async fn value(&self) -> Result<String, DaggerError> {
2231        let query = self.selection.select("value");
2232        query.execute(self.graphql_client.clone()).await
2233    }
2234}
2235#[derive(Clone)]
2236pub struct Binding {
2237    pub proc: Option<Arc<DaggerSessionProc>>,
2238    pub selection: Selection,
2239    pub graphql_client: DynGraphQLClient,
2240}
2241impl Binding {
2242    /// Retrieve the binding value, as type Address
2243    pub fn as_address(&self) -> Address {
2244        let query = self.selection.select("asAddress");
2245        Address {
2246            proc: self.proc.clone(),
2247            selection: query,
2248            graphql_client: self.graphql_client.clone(),
2249        }
2250    }
2251    /// Retrieve the binding value, as type CacheVolume
2252    pub fn as_cache_volume(&self) -> CacheVolume {
2253        let query = self.selection.select("asCacheVolume");
2254        CacheVolume {
2255            proc: self.proc.clone(),
2256            selection: query,
2257            graphql_client: self.graphql_client.clone(),
2258        }
2259    }
2260    /// Retrieve the binding value, as type Changeset
2261    pub fn as_changeset(&self) -> Changeset {
2262        let query = self.selection.select("asChangeset");
2263        Changeset {
2264            proc: self.proc.clone(),
2265            selection: query,
2266            graphql_client: self.graphql_client.clone(),
2267        }
2268    }
2269    /// Retrieve the binding value, as type Check
2270    pub fn as_check(&self) -> Check {
2271        let query = self.selection.select("asCheck");
2272        Check {
2273            proc: self.proc.clone(),
2274            selection: query,
2275            graphql_client: self.graphql_client.clone(),
2276        }
2277    }
2278    /// Retrieve the binding value, as type CheckGroup
2279    pub fn as_check_group(&self) -> CheckGroup {
2280        let query = self.selection.select("asCheckGroup");
2281        CheckGroup {
2282            proc: self.proc.clone(),
2283            selection: query,
2284            graphql_client: self.graphql_client.clone(),
2285        }
2286    }
2287    /// Retrieve the binding value, as type Cloud
2288    pub fn as_cloud(&self) -> Cloud {
2289        let query = self.selection.select("asCloud");
2290        Cloud {
2291            proc: self.proc.clone(),
2292            selection: query,
2293            graphql_client: self.graphql_client.clone(),
2294        }
2295    }
2296    /// Retrieve the binding value, as type Container
2297    pub fn as_container(&self) -> Container {
2298        let query = self.selection.select("asContainer");
2299        Container {
2300            proc: self.proc.clone(),
2301            selection: query,
2302            graphql_client: self.graphql_client.clone(),
2303        }
2304    }
2305    /// Retrieve the binding value, as type Directory
2306    pub fn as_directory(&self) -> Directory {
2307        let query = self.selection.select("asDirectory");
2308        Directory {
2309            proc: self.proc.clone(),
2310            selection: query,
2311            graphql_client: self.graphql_client.clone(),
2312        }
2313    }
2314    /// Retrieve the binding value, as type Env
2315    pub fn as_env(&self) -> Env {
2316        let query = self.selection.select("asEnv");
2317        Env {
2318            proc: self.proc.clone(),
2319            selection: query,
2320            graphql_client: self.graphql_client.clone(),
2321        }
2322    }
2323    /// Retrieve the binding value, as type EnvFile
2324    pub fn as_env_file(&self) -> EnvFile {
2325        let query = self.selection.select("asEnvFile");
2326        EnvFile {
2327            proc: self.proc.clone(),
2328            selection: query,
2329            graphql_client: self.graphql_client.clone(),
2330        }
2331    }
2332    /// Retrieve the binding value, as type File
2333    pub fn as_file(&self) -> File {
2334        let query = self.selection.select("asFile");
2335        File {
2336            proc: self.proc.clone(),
2337            selection: query,
2338            graphql_client: self.graphql_client.clone(),
2339        }
2340    }
2341    /// Retrieve the binding value, as type Generator
2342    pub fn as_generator(&self) -> Generator {
2343        let query = self.selection.select("asGenerator");
2344        Generator {
2345            proc: self.proc.clone(),
2346            selection: query,
2347            graphql_client: self.graphql_client.clone(),
2348        }
2349    }
2350    /// Retrieve the binding value, as type GeneratorGroup
2351    pub fn as_generator_group(&self) -> GeneratorGroup {
2352        let query = self.selection.select("asGeneratorGroup");
2353        GeneratorGroup {
2354            proc: self.proc.clone(),
2355            selection: query,
2356            graphql_client: self.graphql_client.clone(),
2357        }
2358    }
2359    /// Retrieve the binding value, as type GitRef
2360    pub fn as_git_ref(&self) -> GitRef {
2361        let query = self.selection.select("asGitRef");
2362        GitRef {
2363            proc: self.proc.clone(),
2364            selection: query,
2365            graphql_client: self.graphql_client.clone(),
2366        }
2367    }
2368    /// Retrieve the binding value, as type GitRepository
2369    pub fn as_git_repository(&self) -> GitRepository {
2370        let query = self.selection.select("asGitRepository");
2371        GitRepository {
2372            proc: self.proc.clone(),
2373            selection: query,
2374            graphql_client: self.graphql_client.clone(),
2375        }
2376    }
2377    /// Retrieve the binding value, as type JSONValue
2378    pub fn as_json_value(&self) -> JsonValue {
2379        let query = self.selection.select("asJSONValue");
2380        JsonValue {
2381            proc: self.proc.clone(),
2382            selection: query,
2383            graphql_client: self.graphql_client.clone(),
2384        }
2385    }
2386    /// Retrieve the binding value, as type Module
2387    pub fn as_module(&self) -> Module {
2388        let query = self.selection.select("asModule");
2389        Module {
2390            proc: self.proc.clone(),
2391            selection: query,
2392            graphql_client: self.graphql_client.clone(),
2393        }
2394    }
2395    /// Retrieve the binding value, as type ModuleConfigClient
2396    pub fn as_module_config_client(&self) -> ModuleConfigClient {
2397        let query = self.selection.select("asModuleConfigClient");
2398        ModuleConfigClient {
2399            proc: self.proc.clone(),
2400            selection: query,
2401            graphql_client: self.graphql_client.clone(),
2402        }
2403    }
2404    /// Retrieve the binding value, as type ModuleSource
2405    pub fn as_module_source(&self) -> ModuleSource {
2406        let query = self.selection.select("asModuleSource");
2407        ModuleSource {
2408            proc: self.proc.clone(),
2409            selection: query,
2410            graphql_client: self.graphql_client.clone(),
2411        }
2412    }
2413    /// Retrieve the binding value, as type SearchResult
2414    pub fn as_search_result(&self) -> SearchResult {
2415        let query = self.selection.select("asSearchResult");
2416        SearchResult {
2417            proc: self.proc.clone(),
2418            selection: query,
2419            graphql_client: self.graphql_client.clone(),
2420        }
2421    }
2422    /// Retrieve the binding value, as type SearchSubmatch
2423    pub fn as_search_submatch(&self) -> SearchSubmatch {
2424        let query = self.selection.select("asSearchSubmatch");
2425        SearchSubmatch {
2426            proc: self.proc.clone(),
2427            selection: query,
2428            graphql_client: self.graphql_client.clone(),
2429        }
2430    }
2431    /// Retrieve the binding value, as type Secret
2432    pub fn as_secret(&self) -> Secret {
2433        let query = self.selection.select("asSecret");
2434        Secret {
2435            proc: self.proc.clone(),
2436            selection: query,
2437            graphql_client: self.graphql_client.clone(),
2438        }
2439    }
2440    /// Retrieve the binding value, as type Service
2441    pub fn as_service(&self) -> Service {
2442        let query = self.selection.select("asService");
2443        Service {
2444            proc: self.proc.clone(),
2445            selection: query,
2446            graphql_client: self.graphql_client.clone(),
2447        }
2448    }
2449    /// Retrieve the binding value, as type Socket
2450    pub fn as_socket(&self) -> Socket {
2451        let query = self.selection.select("asSocket");
2452        Socket {
2453            proc: self.proc.clone(),
2454            selection: query,
2455            graphql_client: self.graphql_client.clone(),
2456        }
2457    }
2458    /// Retrieve the binding value, as type Stat
2459    pub fn as_stat(&self) -> Stat {
2460        let query = self.selection.select("asStat");
2461        Stat {
2462            proc: self.proc.clone(),
2463            selection: query,
2464            graphql_client: self.graphql_client.clone(),
2465        }
2466    }
2467    /// Returns the binding's string value
2468    pub async fn as_string(&self) -> Result<String, DaggerError> {
2469        let query = self.selection.select("asString");
2470        query.execute(self.graphql_client.clone()).await
2471    }
2472    /// Retrieve the binding value, as type Workspace
2473    pub fn as_workspace(&self) -> Workspace {
2474        let query = self.selection.select("asWorkspace");
2475        Workspace {
2476            proc: self.proc.clone(),
2477            selection: query,
2478            graphql_client: self.graphql_client.clone(),
2479        }
2480    }
2481    /// Returns the digest of the binding value
2482    pub async fn digest(&self) -> Result<String, DaggerError> {
2483        let query = self.selection.select("digest");
2484        query.execute(self.graphql_client.clone()).await
2485    }
2486    /// A unique identifier for this Binding.
2487    pub async fn id(&self) -> Result<BindingId, DaggerError> {
2488        let query = self.selection.select("id");
2489        query.execute(self.graphql_client.clone()).await
2490    }
2491    /// Returns true if the binding is null
2492    pub async fn is_null(&self) -> Result<bool, DaggerError> {
2493        let query = self.selection.select("isNull");
2494        query.execute(self.graphql_client.clone()).await
2495    }
2496    /// Returns the binding name
2497    pub async fn name(&self) -> Result<String, DaggerError> {
2498        let query = self.selection.select("name");
2499        query.execute(self.graphql_client.clone()).await
2500    }
2501    /// Returns the binding type
2502    pub async fn type_name(&self) -> Result<String, DaggerError> {
2503        let query = self.selection.select("typeName");
2504        query.execute(self.graphql_client.clone()).await
2505    }
2506}
2507#[derive(Clone)]
2508pub struct CacheVolume {
2509    pub proc: Option<Arc<DaggerSessionProc>>,
2510    pub selection: Selection,
2511    pub graphql_client: DynGraphQLClient,
2512}
2513impl CacheVolume {
2514    /// A unique identifier for this CacheVolume.
2515    pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
2516        let query = self.selection.select("id");
2517        query.execute(self.graphql_client.clone()).await
2518    }
2519}
2520#[derive(Clone)]
2521pub struct Changeset {
2522    pub proc: Option<Arc<DaggerSessionProc>>,
2523    pub selection: Selection,
2524    pub graphql_client: DynGraphQLClient,
2525}
2526#[derive(Builder, Debug, PartialEq)]
2527pub struct ChangesetWithChangesetOpts {
2528    /// What to do on a merge conflict
2529    #[builder(setter(into, strip_option), default)]
2530    pub on_conflict: Option<ChangesetMergeConflict>,
2531}
2532#[derive(Builder, Debug, PartialEq)]
2533pub struct ChangesetWithChangesetsOpts {
2534    /// What to do on a merge conflict
2535    #[builder(setter(into, strip_option), default)]
2536    pub on_conflict: Option<ChangesetsMergeConflict>,
2537}
2538impl Changeset {
2539    /// Files and directories that were added in the newer directory.
2540    pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2541        let query = self.selection.select("addedPaths");
2542        query.execute(self.graphql_client.clone()).await
2543    }
2544    /// The newer/upper snapshot.
2545    pub fn after(&self) -> Directory {
2546        let query = self.selection.select("after");
2547        Directory {
2548            proc: self.proc.clone(),
2549            selection: query,
2550            graphql_client: self.graphql_client.clone(),
2551        }
2552    }
2553    /// Return a Git-compatible patch of the changes
2554    pub fn as_patch(&self) -> File {
2555        let query = self.selection.select("asPatch");
2556        File {
2557            proc: self.proc.clone(),
2558            selection: query,
2559            graphql_client: self.graphql_client.clone(),
2560        }
2561    }
2562    /// The older/lower snapshot to compare against.
2563    pub fn before(&self) -> Directory {
2564        let query = self.selection.select("before");
2565        Directory {
2566            proc: self.proc.clone(),
2567            selection: query,
2568            graphql_client: self.graphql_client.clone(),
2569        }
2570    }
2571    /// Applies the diff represented by this changeset to a path on the host.
2572    ///
2573    /// # Arguments
2574    ///
2575    /// * `path` - Location of the copied directory (e.g., "logs/").
2576    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2577        let mut query = self.selection.select("export");
2578        query = query.arg("path", path.into());
2579        query.execute(self.graphql_client.clone()).await
2580    }
2581    /// A unique identifier for this Changeset.
2582    pub async fn id(&self) -> Result<ChangesetId, DaggerError> {
2583        let query = self.selection.select("id");
2584        query.execute(self.graphql_client.clone()).await
2585    }
2586    /// Returns true if the changeset is empty (i.e. there are no changes).
2587    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
2588        let query = self.selection.select("isEmpty");
2589        query.execute(self.graphql_client.clone()).await
2590    }
2591    /// Return a snapshot containing only the created and modified files
2592    pub fn layer(&self) -> Directory {
2593        let query = self.selection.select("layer");
2594        Directory {
2595            proc: self.proc.clone(),
2596            selection: query,
2597            graphql_client: self.graphql_client.clone(),
2598        }
2599    }
2600    /// Files and directories that existed before and were updated in the newer directory.
2601    pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2602        let query = self.selection.select("modifiedPaths");
2603        query.execute(self.graphql_client.clone()).await
2604    }
2605    /// Files and directories that were removed. Directories are indicated by a trailing slash, and their child paths are not included.
2606    pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2607        let query = self.selection.select("removedPaths");
2608        query.execute(self.graphql_client.clone()).await
2609    }
2610    /// Force evaluation in the engine.
2611    pub async fn sync(&self) -> Result<ChangesetId, DaggerError> {
2612        let query = self.selection.select("sync");
2613        query.execute(self.graphql_client.clone()).await
2614    }
2615    /// Add changes to an existing changeset
2616    /// By default the operation will fail in case of conflicts, for instance a file modified in both changesets. The behavior can be adjusted using onConflict argument
2617    ///
2618    /// # Arguments
2619    ///
2620    /// * `changes` - Changes to merge into the actual changeset
2621    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2622    pub fn with_changeset(&self, changes: impl IntoID<ChangesetId>) -> Changeset {
2623        let mut query = self.selection.select("withChangeset");
2624        query = query.arg_lazy(
2625            "changes",
2626            Box::new(move || {
2627                let changes = changes.clone();
2628                Box::pin(async move { changes.into_id().await.unwrap().quote() })
2629            }),
2630        );
2631        Changeset {
2632            proc: self.proc.clone(),
2633            selection: query,
2634            graphql_client: self.graphql_client.clone(),
2635        }
2636    }
2637    /// Add changes to an existing changeset
2638    /// By default the operation will fail in case of conflicts, for instance a file modified in both changesets. The behavior can be adjusted using onConflict argument
2639    ///
2640    /// # Arguments
2641    ///
2642    /// * `changes` - Changes to merge into the actual changeset
2643    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2644    pub fn with_changeset_opts(
2645        &self,
2646        changes: impl IntoID<ChangesetId>,
2647        opts: ChangesetWithChangesetOpts,
2648    ) -> Changeset {
2649        let mut query = self.selection.select("withChangeset");
2650        query = query.arg_lazy(
2651            "changes",
2652            Box::new(move || {
2653                let changes = changes.clone();
2654                Box::pin(async move { changes.into_id().await.unwrap().quote() })
2655            }),
2656        );
2657        if let Some(on_conflict) = opts.on_conflict {
2658            query = query.arg("onConflict", on_conflict);
2659        }
2660        Changeset {
2661            proc: self.proc.clone(),
2662            selection: query,
2663            graphql_client: self.graphql_client.clone(),
2664        }
2665    }
2666    /// Add changes from multiple changesets using git octopus merge strategy
2667    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
2668    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
2669    ///
2670    /// # Arguments
2671    ///
2672    /// * `changes` - List of changesets to merge into the actual changeset
2673    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2674    pub fn with_changesets(&self, changes: Vec<ChangesetId>) -> Changeset {
2675        let mut query = self.selection.select("withChangesets");
2676        query = query.arg("changes", changes);
2677        Changeset {
2678            proc: self.proc.clone(),
2679            selection: query,
2680            graphql_client: self.graphql_client.clone(),
2681        }
2682    }
2683    /// Add changes from multiple changesets using git octopus merge strategy
2684    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
2685    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
2686    ///
2687    /// # Arguments
2688    ///
2689    /// * `changes` - List of changesets to merge into the actual changeset
2690    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2691    pub fn with_changesets_opts(
2692        &self,
2693        changes: Vec<ChangesetId>,
2694        opts: ChangesetWithChangesetsOpts,
2695    ) -> Changeset {
2696        let mut query = self.selection.select("withChangesets");
2697        query = query.arg("changes", changes);
2698        if let Some(on_conflict) = opts.on_conflict {
2699            query = query.arg("onConflict", on_conflict);
2700        }
2701        Changeset {
2702            proc: self.proc.clone(),
2703            selection: query,
2704            graphql_client: self.graphql_client.clone(),
2705        }
2706    }
2707}
2708#[derive(Clone)]
2709pub struct Check {
2710    pub proc: Option<Arc<DaggerSessionProc>>,
2711    pub selection: Selection,
2712    pub graphql_client: DynGraphQLClient,
2713}
2714impl Check {
2715    /// Whether the check completed
2716    pub async fn completed(&self) -> Result<bool, DaggerError> {
2717        let query = self.selection.select("completed");
2718        query.execute(self.graphql_client.clone()).await
2719    }
2720    /// The description of the check
2721    pub async fn description(&self) -> Result<String, DaggerError> {
2722        let query = self.selection.select("description");
2723        query.execute(self.graphql_client.clone()).await
2724    }
2725    /// If the check failed, this is the error
2726    pub fn error(&self) -> Error {
2727        let query = self.selection.select("error");
2728        Error {
2729            proc: self.proc.clone(),
2730            selection: query,
2731            graphql_client: self.graphql_client.clone(),
2732        }
2733    }
2734    /// A unique identifier for this Check.
2735    pub async fn id(&self) -> Result<CheckId, DaggerError> {
2736        let query = self.selection.select("id");
2737        query.execute(self.graphql_client.clone()).await
2738    }
2739    /// Return the fully qualified name of the check
2740    pub async fn name(&self) -> Result<String, DaggerError> {
2741        let query = self.selection.select("name");
2742        query.execute(self.graphql_client.clone()).await
2743    }
2744    /// The original module in which the check has been defined
2745    pub fn original_module(&self) -> Module {
2746        let query = self.selection.select("originalModule");
2747        Module {
2748            proc: self.proc.clone(),
2749            selection: query,
2750            graphql_client: self.graphql_client.clone(),
2751        }
2752    }
2753    /// Whether the check passed
2754    pub async fn passed(&self) -> Result<bool, DaggerError> {
2755        let query = self.selection.select("passed");
2756        query.execute(self.graphql_client.clone()).await
2757    }
2758    /// The path of the check within its module
2759    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
2760        let query = self.selection.select("path");
2761        query.execute(self.graphql_client.clone()).await
2762    }
2763    /// An emoji representing the result of the check
2764    pub async fn result_emoji(&self) -> Result<String, DaggerError> {
2765        let query = self.selection.select("resultEmoji");
2766        query.execute(self.graphql_client.clone()).await
2767    }
2768    /// Execute the check
2769    pub fn run(&self) -> Check {
2770        let query = self.selection.select("run");
2771        Check {
2772            proc: self.proc.clone(),
2773            selection: query,
2774            graphql_client: self.graphql_client.clone(),
2775        }
2776    }
2777}
2778#[derive(Clone)]
2779pub struct CheckGroup {
2780    pub proc: Option<Arc<DaggerSessionProc>>,
2781    pub selection: Selection,
2782    pub graphql_client: DynGraphQLClient,
2783}
2784impl CheckGroup {
2785    /// A unique identifier for this CheckGroup.
2786    pub async fn id(&self) -> Result<CheckGroupId, DaggerError> {
2787        let query = self.selection.select("id");
2788        query.execute(self.graphql_client.clone()).await
2789    }
2790    /// Return a list of individual checks and their details
2791    pub fn list(&self) -> Vec<Check> {
2792        let query = self.selection.select("list");
2793        vec![Check {
2794            proc: self.proc.clone(),
2795            selection: query,
2796            graphql_client: self.graphql_client.clone(),
2797        }]
2798    }
2799    /// Generate a markdown report
2800    pub fn report(&self) -> File {
2801        let query = self.selection.select("report");
2802        File {
2803            proc: self.proc.clone(),
2804            selection: query,
2805            graphql_client: self.graphql_client.clone(),
2806        }
2807    }
2808    /// Execute all selected checks
2809    pub fn run(&self) -> CheckGroup {
2810        let query = self.selection.select("run");
2811        CheckGroup {
2812            proc: self.proc.clone(),
2813            selection: query,
2814            graphql_client: self.graphql_client.clone(),
2815        }
2816    }
2817}
2818#[derive(Clone)]
2819pub struct Cloud {
2820    pub proc: Option<Arc<DaggerSessionProc>>,
2821    pub selection: Selection,
2822    pub graphql_client: DynGraphQLClient,
2823}
2824impl Cloud {
2825    /// A unique identifier for this Cloud.
2826    pub async fn id(&self) -> Result<CloudId, DaggerError> {
2827        let query = self.selection.select("id");
2828        query.execute(self.graphql_client.clone()).await
2829    }
2830    /// The trace URL for the current session
2831    pub async fn trace_url(&self) -> Result<String, DaggerError> {
2832        let query = self.selection.select("traceURL");
2833        query.execute(self.graphql_client.clone()).await
2834    }
2835}
2836#[derive(Clone)]
2837pub struct Container {
2838    pub proc: Option<Arc<DaggerSessionProc>>,
2839    pub selection: Selection,
2840    pub graphql_client: DynGraphQLClient,
2841}
2842#[derive(Builder, Debug, PartialEq)]
2843pub struct ContainerAsServiceOpts<'a> {
2844    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2845    /// If empty, the container's default command is used.
2846    #[builder(setter(into, strip_option), default)]
2847    pub args: Option<Vec<&'a str>>,
2848    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2849    #[builder(setter(into, strip_option), default)]
2850    pub expand: Option<bool>,
2851    /// Provides Dagger access to the executed command.
2852    #[builder(setter(into, strip_option), default)]
2853    pub experimental_privileged_nesting: Option<bool>,
2854    /// 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.
2855    #[builder(setter(into, strip_option), default)]
2856    pub insecure_root_capabilities: Option<bool>,
2857    /// If set, skip the automatic init process injected into containers by default.
2858    /// 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.
2859    #[builder(setter(into, strip_option), default)]
2860    pub no_init: Option<bool>,
2861    /// If the container has an entrypoint, prepend it to the args.
2862    #[builder(setter(into, strip_option), default)]
2863    pub use_entrypoint: Option<bool>,
2864}
2865#[derive(Builder, Debug, PartialEq)]
2866pub struct ContainerAsTarballOpts {
2867    /// Force each layer of the image to use the specified compression algorithm.
2868    /// 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.
2869    #[builder(setter(into, strip_option), default)]
2870    pub forced_compression: Option<ImageLayerCompression>,
2871    /// Use the specified media types for the image's layers.
2872    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2873    #[builder(setter(into, strip_option), default)]
2874    pub media_types: Option<ImageMediaTypes>,
2875    /// Identifiers for other platform specific containers.
2876    /// Used for multi-platform images.
2877    #[builder(setter(into, strip_option), default)]
2878    pub platform_variants: Option<Vec<ContainerId>>,
2879}
2880#[derive(Builder, Debug, PartialEq)]
2881pub struct ContainerDirectoryOpts {
2882    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2883    #[builder(setter(into, strip_option), default)]
2884    pub expand: Option<bool>,
2885}
2886#[derive(Builder, Debug, PartialEq)]
2887pub struct ContainerExistsOpts {
2888    /// If specified, do not follow symlinks.
2889    #[builder(setter(into, strip_option), default)]
2890    pub do_not_follow_symlinks: Option<bool>,
2891    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
2892    #[builder(setter(into, strip_option), default)]
2893    pub expected_type: Option<ExistsType>,
2894}
2895#[derive(Builder, Debug, PartialEq)]
2896pub struct ContainerExportOpts {
2897    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2898    #[builder(setter(into, strip_option), default)]
2899    pub expand: Option<bool>,
2900    /// Force each layer of the exported image to use the specified compression algorithm.
2901    /// 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.
2902    #[builder(setter(into, strip_option), default)]
2903    pub forced_compression: Option<ImageLayerCompression>,
2904    /// Use the specified media types for the exported image's layers.
2905    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2906    #[builder(setter(into, strip_option), default)]
2907    pub media_types: Option<ImageMediaTypes>,
2908    /// Identifiers for other platform specific containers.
2909    /// Used for multi-platform image.
2910    #[builder(setter(into, strip_option), default)]
2911    pub platform_variants: Option<Vec<ContainerId>>,
2912}
2913#[derive(Builder, Debug, PartialEq)]
2914pub struct ContainerExportImageOpts {
2915    /// Force each layer of the exported image to use the specified compression algorithm.
2916    /// 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.
2917    #[builder(setter(into, strip_option), default)]
2918    pub forced_compression: Option<ImageLayerCompression>,
2919    /// Use the specified media types for the exported image's layers.
2920    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2921    #[builder(setter(into, strip_option), default)]
2922    pub media_types: Option<ImageMediaTypes>,
2923    /// Identifiers for other platform specific containers.
2924    /// Used for multi-platform image.
2925    #[builder(setter(into, strip_option), default)]
2926    pub platform_variants: Option<Vec<ContainerId>>,
2927}
2928#[derive(Builder, Debug, PartialEq)]
2929pub struct ContainerFileOpts {
2930    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2931    #[builder(setter(into, strip_option), default)]
2932    pub expand: Option<bool>,
2933}
2934#[derive(Builder, Debug, PartialEq)]
2935pub struct ContainerImportOpts<'a> {
2936    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
2937    #[builder(setter(into, strip_option), default)]
2938    pub tag: Option<&'a str>,
2939}
2940#[derive(Builder, Debug, PartialEq)]
2941pub struct ContainerPublishOpts {
2942    /// Force each layer of the published image to use the specified compression algorithm.
2943    /// 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.
2944    #[builder(setter(into, strip_option), default)]
2945    pub forced_compression: Option<ImageLayerCompression>,
2946    /// Use the specified media types for the published image's layers.
2947    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
2948    #[builder(setter(into, strip_option), default)]
2949    pub media_types: Option<ImageMediaTypes>,
2950    /// Identifiers for other platform specific containers.
2951    /// Used for multi-platform image.
2952    #[builder(setter(into, strip_option), default)]
2953    pub platform_variants: Option<Vec<ContainerId>>,
2954}
2955#[derive(Builder, Debug, PartialEq)]
2956pub struct ContainerStatOpts {
2957    /// If specified, do not follow symlinks.
2958    #[builder(setter(into, strip_option), default)]
2959    pub do_not_follow_symlinks: Option<bool>,
2960}
2961#[derive(Builder, Debug, PartialEq)]
2962pub struct ContainerTerminalOpts<'a> {
2963    /// If set, override the container's default terminal command and invoke these command arguments instead.
2964    #[builder(setter(into, strip_option), default)]
2965    pub cmd: Option<Vec<&'a str>>,
2966    /// Provides Dagger access to the executed command.
2967    #[builder(setter(into, strip_option), default)]
2968    pub experimental_privileged_nesting: Option<bool>,
2969    /// 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.
2970    #[builder(setter(into, strip_option), default)]
2971    pub insecure_root_capabilities: Option<bool>,
2972}
2973#[derive(Builder, Debug, PartialEq)]
2974pub struct ContainerUpOpts<'a> {
2975    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2976    /// If empty, the container's default command is used.
2977    #[builder(setter(into, strip_option), default)]
2978    pub args: Option<Vec<&'a str>>,
2979    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2980    #[builder(setter(into, strip_option), default)]
2981    pub expand: Option<bool>,
2982    /// Provides Dagger access to the executed command.
2983    #[builder(setter(into, strip_option), default)]
2984    pub experimental_privileged_nesting: Option<bool>,
2985    /// 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.
2986    #[builder(setter(into, strip_option), default)]
2987    pub insecure_root_capabilities: Option<bool>,
2988    /// If set, skip the automatic init process injected into containers by default.
2989    /// 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.
2990    #[builder(setter(into, strip_option), default)]
2991    pub no_init: Option<bool>,
2992    /// List of frontend/backend port mappings to forward.
2993    /// Frontend is the port accepting traffic on the host, backend is the service port.
2994    #[builder(setter(into, strip_option), default)]
2995    pub ports: Option<Vec<PortForward>>,
2996    /// Bind each tunnel port to a random port on the host.
2997    #[builder(setter(into, strip_option), default)]
2998    pub random: Option<bool>,
2999    /// If the container has an entrypoint, prepend it to the args.
3000    #[builder(setter(into, strip_option), default)]
3001    pub use_entrypoint: Option<bool>,
3002}
3003#[derive(Builder, Debug, PartialEq)]
3004pub struct ContainerWithDefaultTerminalCmdOpts {
3005    /// Provides Dagger access to the executed command.
3006    #[builder(setter(into, strip_option), default)]
3007    pub experimental_privileged_nesting: Option<bool>,
3008    /// 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.
3009    #[builder(setter(into, strip_option), default)]
3010    pub insecure_root_capabilities: Option<bool>,
3011}
3012#[derive(Builder, Debug, PartialEq)]
3013pub struct ContainerWithDirectoryOpts<'a> {
3014    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
3015    #[builder(setter(into, strip_option), default)]
3016    pub exclude: Option<Vec<&'a str>>,
3017    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3018    #[builder(setter(into, strip_option), default)]
3019    pub expand: Option<bool>,
3020    /// Apply .gitignore rules when writing the directory.
3021    #[builder(setter(into, strip_option), default)]
3022    pub gitignore: Option<bool>,
3023    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
3024    #[builder(setter(into, strip_option), default)]
3025    pub include: Option<Vec<&'a str>>,
3026    /// A user:group to set for the directory and its contents.
3027    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3028    /// If the group is omitted, it defaults to the same as the user.
3029    #[builder(setter(into, strip_option), default)]
3030    pub owner: Option<&'a str>,
3031}
3032#[derive(Builder, Debug, PartialEq)]
3033pub struct ContainerWithDockerHealthcheckOpts<'a> {
3034    /// Interval between running healthcheck. Example: "30s"
3035    #[builder(setter(into, strip_option), default)]
3036    pub interval: Option<&'a str>,
3037    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example: "3"
3038    #[builder(setter(into, strip_option), default)]
3039    pub retries: Option<isize>,
3040    /// When true, command must be a single element, which is run using the container's shell
3041    #[builder(setter(into, strip_option), default)]
3042    pub shell: Option<bool>,
3043    /// StartInterval configures the duration between checks during the startup phase. Example: "5s"
3044    #[builder(setter(into, strip_option), default)]
3045    pub start_interval: Option<&'a str>,
3046    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example: "0s"
3047    #[builder(setter(into, strip_option), default)]
3048    pub start_period: Option<&'a str>,
3049    /// Healthcheck timeout. Example: "3s"
3050    #[builder(setter(into, strip_option), default)]
3051    pub timeout: Option<&'a str>,
3052}
3053#[derive(Builder, Debug, PartialEq)]
3054pub struct ContainerWithEntrypointOpts {
3055    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
3056    #[builder(setter(into, strip_option), default)]
3057    pub keep_default_args: Option<bool>,
3058}
3059#[derive(Builder, Debug, PartialEq)]
3060pub struct ContainerWithEnvVariableOpts {
3061    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
3062    #[builder(setter(into, strip_option), default)]
3063    pub expand: Option<bool>,
3064}
3065#[derive(Builder, Debug, PartialEq)]
3066pub struct ContainerWithExecOpts<'a> {
3067    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3068    #[builder(setter(into, strip_option), default)]
3069    pub expand: Option<bool>,
3070    /// Exit codes this command is allowed to exit with without error
3071    #[builder(setter(into, strip_option), default)]
3072    pub expect: Option<ReturnType>,
3073    /// Provides Dagger access to the executed command.
3074    #[builder(setter(into, strip_option), default)]
3075    pub experimental_privileged_nesting: Option<bool>,
3076    /// Execute the command with all root capabilities. Like --privileged in Docker
3077    /// 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.
3078    #[builder(setter(into, strip_option), default)]
3079    pub insecure_root_capabilities: Option<bool>,
3080    /// Skip the automatic init process injected into containers by default.
3081    /// 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.
3082    #[builder(setter(into, strip_option), default)]
3083    pub no_init: Option<bool>,
3084    /// Redirect the command's standard error to a file in the container. Example: "./stderr.txt"
3085    #[builder(setter(into, strip_option), default)]
3086    pub redirect_stderr: Option<&'a str>,
3087    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
3088    #[builder(setter(into, strip_option), default)]
3089    pub redirect_stdin: Option<&'a str>,
3090    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
3091    #[builder(setter(into, strip_option), default)]
3092    pub redirect_stdout: Option<&'a str>,
3093    /// Content to write to the command's standard input. Example: "Hello world")
3094    #[builder(setter(into, strip_option), default)]
3095    pub stdin: Option<&'a str>,
3096    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
3097    #[builder(setter(into, strip_option), default)]
3098    pub use_entrypoint: Option<bool>,
3099}
3100#[derive(Builder, Debug, PartialEq)]
3101pub struct ContainerWithExposedPortOpts<'a> {
3102    /// Port description. Example: "payment API endpoint"
3103    #[builder(setter(into, strip_option), default)]
3104    pub description: Option<&'a str>,
3105    /// Skip the health check when run as a service.
3106    #[builder(setter(into, strip_option), default)]
3107    pub experimental_skip_healthcheck: Option<bool>,
3108    /// Network protocol. Example: "tcp"
3109    #[builder(setter(into, strip_option), default)]
3110    pub protocol: Option<NetworkProtocol>,
3111}
3112#[derive(Builder, Debug, PartialEq)]
3113pub struct ContainerWithFileOpts<'a> {
3114    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3115    #[builder(setter(into, strip_option), default)]
3116    pub expand: Option<bool>,
3117    /// A user:group to set for the file.
3118    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3119    /// If the group is omitted, it defaults to the same as the user.
3120    #[builder(setter(into, strip_option), default)]
3121    pub owner: Option<&'a str>,
3122    /// Permissions of the new file. Example: 0600
3123    #[builder(setter(into, strip_option), default)]
3124    pub permissions: Option<isize>,
3125}
3126#[derive(Builder, Debug, PartialEq)]
3127pub struct ContainerWithFilesOpts<'a> {
3128    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3129    #[builder(setter(into, strip_option), default)]
3130    pub expand: Option<bool>,
3131    /// A user:group to set for the files.
3132    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3133    /// If the group is omitted, it defaults to the same as the user.
3134    #[builder(setter(into, strip_option), default)]
3135    pub owner: Option<&'a str>,
3136    /// Permission given to the copied files (e.g., 0600).
3137    #[builder(setter(into, strip_option), default)]
3138    pub permissions: Option<isize>,
3139}
3140#[derive(Builder, Debug, PartialEq)]
3141pub struct ContainerWithMountedCacheOpts<'a> {
3142    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3143    #[builder(setter(into, strip_option), default)]
3144    pub expand: Option<bool>,
3145    /// A user:group to set for the mounted cache directory.
3146    /// 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.
3147    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3148    /// If the group is omitted, it defaults to the same as the user.
3149    #[builder(setter(into, strip_option), default)]
3150    pub owner: Option<&'a str>,
3151    /// Sharing mode of the cache volume.
3152    #[builder(setter(into, strip_option), default)]
3153    pub sharing: Option<CacheSharingMode>,
3154    /// Identifier of the directory to use as the cache volume's root.
3155    #[builder(setter(into, strip_option), default)]
3156    pub source: Option<DirectoryId>,
3157}
3158#[derive(Builder, Debug, PartialEq)]
3159pub struct ContainerWithMountedDirectoryOpts<'a> {
3160    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3161    #[builder(setter(into, strip_option), default)]
3162    pub expand: Option<bool>,
3163    /// A user:group to set for the mounted directory and its contents.
3164    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3165    /// If the group is omitted, it defaults to the same as the user.
3166    #[builder(setter(into, strip_option), default)]
3167    pub owner: Option<&'a str>,
3168}
3169#[derive(Builder, Debug, PartialEq)]
3170pub struct ContainerWithMountedFileOpts<'a> {
3171    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3172    #[builder(setter(into, strip_option), default)]
3173    pub expand: Option<bool>,
3174    /// A user or user:group to set for the mounted file.
3175    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3176    /// If the group is omitted, it defaults to the same as the user.
3177    #[builder(setter(into, strip_option), default)]
3178    pub owner: Option<&'a str>,
3179}
3180#[derive(Builder, Debug, PartialEq)]
3181pub struct ContainerWithMountedSecretOpts<'a> {
3182    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3183    #[builder(setter(into, strip_option), default)]
3184    pub expand: Option<bool>,
3185    /// Permission given to the mounted secret (e.g., 0600).
3186    /// This option requires an owner to be set to be active.
3187    #[builder(setter(into, strip_option), default)]
3188    pub mode: Option<isize>,
3189    /// A user:group to set for the mounted secret.
3190    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3191    /// If the group is omitted, it defaults to the same as the user.
3192    #[builder(setter(into, strip_option), default)]
3193    pub owner: Option<&'a str>,
3194}
3195#[derive(Builder, Debug, PartialEq)]
3196pub struct ContainerWithMountedTempOpts {
3197    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3198    #[builder(setter(into, strip_option), default)]
3199    pub expand: Option<bool>,
3200    /// Size of the temporary directory in bytes.
3201    #[builder(setter(into, strip_option), default)]
3202    pub size: Option<isize>,
3203}
3204#[derive(Builder, Debug, PartialEq)]
3205pub struct ContainerWithNewFileOpts<'a> {
3206    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3207    #[builder(setter(into, strip_option), default)]
3208    pub expand: Option<bool>,
3209    /// A user:group to set for the file.
3210    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3211    /// If the group is omitted, it defaults to the same as the user.
3212    #[builder(setter(into, strip_option), default)]
3213    pub owner: Option<&'a str>,
3214    /// Permissions of the new file. Example: 0600
3215    #[builder(setter(into, strip_option), default)]
3216    pub permissions: Option<isize>,
3217}
3218#[derive(Builder, Debug, PartialEq)]
3219pub struct ContainerWithSymlinkOpts {
3220    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3221    #[builder(setter(into, strip_option), default)]
3222    pub expand: Option<bool>,
3223}
3224#[derive(Builder, Debug, PartialEq)]
3225pub struct ContainerWithUnixSocketOpts<'a> {
3226    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3227    #[builder(setter(into, strip_option), default)]
3228    pub expand: Option<bool>,
3229    /// A user:group to set for the mounted socket.
3230    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3231    /// If the group is omitted, it defaults to the same as the user.
3232    #[builder(setter(into, strip_option), default)]
3233    pub owner: Option<&'a str>,
3234}
3235#[derive(Builder, Debug, PartialEq)]
3236pub struct ContainerWithWorkdirOpts {
3237    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3238    #[builder(setter(into, strip_option), default)]
3239    pub expand: Option<bool>,
3240}
3241#[derive(Builder, Debug, PartialEq)]
3242pub struct ContainerWithoutDirectoryOpts {
3243    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3244    #[builder(setter(into, strip_option), default)]
3245    pub expand: Option<bool>,
3246}
3247#[derive(Builder, Debug, PartialEq)]
3248pub struct ContainerWithoutEntrypointOpts {
3249    /// Don't remove the default arguments when unsetting the entrypoint.
3250    #[builder(setter(into, strip_option), default)]
3251    pub keep_default_args: Option<bool>,
3252}
3253#[derive(Builder, Debug, PartialEq)]
3254pub struct ContainerWithoutExposedPortOpts {
3255    /// Port protocol to unexpose
3256    #[builder(setter(into, strip_option), default)]
3257    pub protocol: Option<NetworkProtocol>,
3258}
3259#[derive(Builder, Debug, PartialEq)]
3260pub struct ContainerWithoutFileOpts {
3261    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3262    #[builder(setter(into, strip_option), default)]
3263    pub expand: Option<bool>,
3264}
3265#[derive(Builder, Debug, PartialEq)]
3266pub struct ContainerWithoutFilesOpts {
3267    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3268    #[builder(setter(into, strip_option), default)]
3269    pub expand: Option<bool>,
3270}
3271#[derive(Builder, Debug, PartialEq)]
3272pub struct ContainerWithoutMountOpts {
3273    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3274    #[builder(setter(into, strip_option), default)]
3275    pub expand: Option<bool>,
3276}
3277#[derive(Builder, Debug, PartialEq)]
3278pub struct ContainerWithoutUnixSocketOpts {
3279    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3280    #[builder(setter(into, strip_option), default)]
3281    pub expand: Option<bool>,
3282}
3283impl Container {
3284    /// Turn the container into a Service.
3285    /// Be sure to set any exposed ports before this conversion.
3286    ///
3287    /// # Arguments
3288    ///
3289    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3290    pub fn as_service(&self) -> Service {
3291        let query = self.selection.select("asService");
3292        Service {
3293            proc: self.proc.clone(),
3294            selection: query,
3295            graphql_client: self.graphql_client.clone(),
3296        }
3297    }
3298    /// Turn the container into a Service.
3299    /// Be sure to set any exposed ports before this conversion.
3300    ///
3301    /// # Arguments
3302    ///
3303    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3304    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
3305        let mut query = self.selection.select("asService");
3306        if let Some(args) = opts.args {
3307            query = query.arg("args", args);
3308        }
3309        if let Some(use_entrypoint) = opts.use_entrypoint {
3310            query = query.arg("useEntrypoint", use_entrypoint);
3311        }
3312        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3313            query = query.arg(
3314                "experimentalPrivilegedNesting",
3315                experimental_privileged_nesting,
3316            );
3317        }
3318        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3319            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3320        }
3321        if let Some(expand) = opts.expand {
3322            query = query.arg("expand", expand);
3323        }
3324        if let Some(no_init) = opts.no_init {
3325            query = query.arg("noInit", no_init);
3326        }
3327        Service {
3328            proc: self.proc.clone(),
3329            selection: query,
3330            graphql_client: self.graphql_client.clone(),
3331        }
3332    }
3333    /// Package the container state as an OCI image, and return it as a tar archive
3334    ///
3335    /// # Arguments
3336    ///
3337    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3338    pub fn as_tarball(&self) -> File {
3339        let query = self.selection.select("asTarball");
3340        File {
3341            proc: self.proc.clone(),
3342            selection: query,
3343            graphql_client: self.graphql_client.clone(),
3344        }
3345    }
3346    /// Package the container state as an OCI image, and return it as a tar archive
3347    ///
3348    /// # Arguments
3349    ///
3350    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3351    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
3352        let mut query = self.selection.select("asTarball");
3353        if let Some(platform_variants) = opts.platform_variants {
3354            query = query.arg("platformVariants", platform_variants);
3355        }
3356        if let Some(forced_compression) = opts.forced_compression {
3357            query = query.arg("forcedCompression", forced_compression);
3358        }
3359        if let Some(media_types) = opts.media_types {
3360            query = query.arg("mediaTypes", media_types);
3361        }
3362        File {
3363            proc: self.proc.clone(),
3364            selection: query,
3365            graphql_client: self.graphql_client.clone(),
3366        }
3367    }
3368    /// The combined buffered standard output and standard error stream of the last executed command
3369    /// Returns an error if no command was executed
3370    pub async fn combined_output(&self) -> Result<String, DaggerError> {
3371        let query = self.selection.select("combinedOutput");
3372        query.execute(self.graphql_client.clone()).await
3373    }
3374    /// Return the container's default arguments.
3375    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
3376        let query = self.selection.select("defaultArgs");
3377        query.execute(self.graphql_client.clone()).await
3378    }
3379    /// Retrieve a directory from the container's root filesystem
3380    /// Mounts are included.
3381    ///
3382    /// # Arguments
3383    ///
3384    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3385    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3386    pub fn directory(&self, path: impl Into<String>) -> Directory {
3387        let mut query = self.selection.select("directory");
3388        query = query.arg("path", path.into());
3389        Directory {
3390            proc: self.proc.clone(),
3391            selection: query,
3392            graphql_client: self.graphql_client.clone(),
3393        }
3394    }
3395    /// Retrieve a directory from the container's root filesystem
3396    /// Mounts are included.
3397    ///
3398    /// # Arguments
3399    ///
3400    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3401    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3402    pub fn directory_opts(
3403        &self,
3404        path: impl Into<String>,
3405        opts: ContainerDirectoryOpts,
3406    ) -> Directory {
3407        let mut query = self.selection.select("directory");
3408        query = query.arg("path", path.into());
3409        if let Some(expand) = opts.expand {
3410            query = query.arg("expand", expand);
3411        }
3412        Directory {
3413            proc: self.proc.clone(),
3414            selection: query,
3415            graphql_client: self.graphql_client.clone(),
3416        }
3417    }
3418    /// Retrieves this container's configured docker healthcheck.
3419    pub fn docker_healthcheck(&self) -> HealthcheckConfig {
3420        let query = self.selection.select("dockerHealthcheck");
3421        HealthcheckConfig {
3422            proc: self.proc.clone(),
3423            selection: query,
3424            graphql_client: self.graphql_client.clone(),
3425        }
3426    }
3427    /// Return the container's OCI entrypoint.
3428    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
3429        let query = self.selection.select("entrypoint");
3430        query.execute(self.graphql_client.clone()).await
3431    }
3432    /// Retrieves the value of the specified environment variable.
3433    ///
3434    /// # Arguments
3435    ///
3436    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
3437    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3438        let mut query = self.selection.select("envVariable");
3439        query = query.arg("name", name.into());
3440        query.execute(self.graphql_client.clone()).await
3441    }
3442    /// Retrieves the list of environment variables passed to commands.
3443    pub fn env_variables(&self) -> Vec<EnvVariable> {
3444        let query = self.selection.select("envVariables");
3445        vec![EnvVariable {
3446            proc: self.proc.clone(),
3447            selection: query,
3448            graphql_client: self.graphql_client.clone(),
3449        }]
3450    }
3451    /// check if a file or directory exists
3452    ///
3453    /// # Arguments
3454    ///
3455    /// * `path` - Path to check (e.g., "/file.txt").
3456    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3457    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
3458        let mut query = self.selection.select("exists");
3459        query = query.arg("path", path.into());
3460        query.execute(self.graphql_client.clone()).await
3461    }
3462    /// check if a file or directory exists
3463    ///
3464    /// # Arguments
3465    ///
3466    /// * `path` - Path to check (e.g., "/file.txt").
3467    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3468    pub async fn exists_opts(
3469        &self,
3470        path: impl Into<String>,
3471        opts: ContainerExistsOpts,
3472    ) -> Result<bool, DaggerError> {
3473        let mut query = self.selection.select("exists");
3474        query = query.arg("path", path.into());
3475        if let Some(expected_type) = opts.expected_type {
3476            query = query.arg("expectedType", expected_type);
3477        }
3478        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
3479            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
3480        }
3481        query.execute(self.graphql_client.clone()).await
3482    }
3483    /// The exit code of the last executed command
3484    /// Returns an error if no command was executed
3485    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
3486        let query = self.selection.select("exitCode");
3487        query.execute(self.graphql_client.clone()).await
3488    }
3489    /// EXPERIMENTAL API! Subject to change/removal at any time.
3490    /// Configures all available GPUs on the host to be accessible to this container.
3491    /// This currently works for Nvidia devices only.
3492    pub fn experimental_with_all_gp_us(&self) -> Container {
3493        let query = self.selection.select("experimentalWithAllGPUs");
3494        Container {
3495            proc: self.proc.clone(),
3496            selection: query,
3497            graphql_client: self.graphql_client.clone(),
3498        }
3499    }
3500    /// EXPERIMENTAL API! Subject to change/removal at any time.
3501    /// Configures the provided list of devices to be accessible to this container.
3502    /// This currently works for Nvidia devices only.
3503    ///
3504    /// # Arguments
3505    ///
3506    /// * `devices` - List of devices to be accessible to this container.
3507    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
3508        let mut query = self.selection.select("experimentalWithGPU");
3509        query = query.arg(
3510            "devices",
3511            devices
3512                .into_iter()
3513                .map(|i| i.into())
3514                .collect::<Vec<String>>(),
3515        );
3516        Container {
3517            proc: self.proc.clone(),
3518            selection: query,
3519            graphql_client: self.graphql_client.clone(),
3520        }
3521    }
3522    /// Writes the container as an OCI tarball to the destination file path on the host.
3523    /// It can also export platform variants.
3524    ///
3525    /// # Arguments
3526    ///
3527    /// * `path` - Host's destination path (e.g., "./tarball").
3528    ///
3529    /// Path can be relative to the engine's workdir or absolute.
3530    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3531    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
3532        let mut query = self.selection.select("export");
3533        query = query.arg("path", path.into());
3534        query.execute(self.graphql_client.clone()).await
3535    }
3536    /// Writes the container as an OCI tarball to the destination file path on the host.
3537    /// It can also export platform variants.
3538    ///
3539    /// # Arguments
3540    ///
3541    /// * `path` - Host's destination path (e.g., "./tarball").
3542    ///
3543    /// Path can be relative to the engine's workdir or absolute.
3544    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3545    pub async fn export_opts(
3546        &self,
3547        path: impl Into<String>,
3548        opts: ContainerExportOpts,
3549    ) -> Result<String, DaggerError> {
3550        let mut query = self.selection.select("export");
3551        query = query.arg("path", path.into());
3552        if let Some(platform_variants) = opts.platform_variants {
3553            query = query.arg("platformVariants", platform_variants);
3554        }
3555        if let Some(forced_compression) = opts.forced_compression {
3556            query = query.arg("forcedCompression", forced_compression);
3557        }
3558        if let Some(media_types) = opts.media_types {
3559            query = query.arg("mediaTypes", media_types);
3560        }
3561        if let Some(expand) = opts.expand {
3562            query = query.arg("expand", expand);
3563        }
3564        query.execute(self.graphql_client.clone()).await
3565    }
3566    /// Exports the container as an image to the host's container image store.
3567    ///
3568    /// # Arguments
3569    ///
3570    /// * `name` - Name of image to export to in the host's store
3571    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3572    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
3573        let mut query = self.selection.select("exportImage");
3574        query = query.arg("name", name.into());
3575        query.execute(self.graphql_client.clone()).await
3576    }
3577    /// Exports the container as an image to the host's container image store.
3578    ///
3579    /// # Arguments
3580    ///
3581    /// * `name` - Name of image to export to in the host's store
3582    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3583    pub async fn export_image_opts(
3584        &self,
3585        name: impl Into<String>,
3586        opts: ContainerExportImageOpts,
3587    ) -> Result<Void, DaggerError> {
3588        let mut query = self.selection.select("exportImage");
3589        query = query.arg("name", name.into());
3590        if let Some(platform_variants) = opts.platform_variants {
3591            query = query.arg("platformVariants", platform_variants);
3592        }
3593        if let Some(forced_compression) = opts.forced_compression {
3594            query = query.arg("forcedCompression", forced_compression);
3595        }
3596        if let Some(media_types) = opts.media_types {
3597            query = query.arg("mediaTypes", media_types);
3598        }
3599        query.execute(self.graphql_client.clone()).await
3600    }
3601    /// Retrieves the list of exposed ports.
3602    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
3603    pub fn exposed_ports(&self) -> Vec<Port> {
3604        let query = self.selection.select("exposedPorts");
3605        vec![Port {
3606            proc: self.proc.clone(),
3607            selection: query,
3608            graphql_client: self.graphql_client.clone(),
3609        }]
3610    }
3611    /// Retrieves a file at the given path.
3612    /// Mounts are included.
3613    ///
3614    /// # Arguments
3615    ///
3616    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3617    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3618    pub fn file(&self, path: impl Into<String>) -> File {
3619        let mut query = self.selection.select("file");
3620        query = query.arg("path", path.into());
3621        File {
3622            proc: self.proc.clone(),
3623            selection: query,
3624            graphql_client: self.graphql_client.clone(),
3625        }
3626    }
3627    /// Retrieves a file at the given path.
3628    /// Mounts are included.
3629    ///
3630    /// # Arguments
3631    ///
3632    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3633    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3634    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3635        let mut query = self.selection.select("file");
3636        query = query.arg("path", path.into());
3637        if let Some(expand) = opts.expand {
3638            query = query.arg("expand", expand);
3639        }
3640        File {
3641            proc: self.proc.clone(),
3642            selection: query,
3643            graphql_client: self.graphql_client.clone(),
3644        }
3645    }
3646    /// Download a container image, and apply it to the container state. All previous state will be lost.
3647    ///
3648    /// # Arguments
3649    ///
3650    /// * `address` - Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
3651    pub fn from(&self, address: impl Into<String>) -> Container {
3652        let mut query = self.selection.select("from");
3653        query = query.arg("address", address.into());
3654        Container {
3655            proc: self.proc.clone(),
3656            selection: query,
3657            graphql_client: self.graphql_client.clone(),
3658        }
3659    }
3660    /// A unique identifier for this Container.
3661    pub async fn id(&self) -> Result<ContainerId, DaggerError> {
3662        let query = self.selection.select("id");
3663        query.execute(self.graphql_client.clone()).await
3664    }
3665    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
3666    pub async fn image_ref(&self) -> Result<String, DaggerError> {
3667        let query = self.selection.select("imageRef");
3668        query.execute(self.graphql_client.clone()).await
3669    }
3670    /// Reads the container from an OCI tarball.
3671    ///
3672    /// # Arguments
3673    ///
3674    /// * `source` - File to read the container from.
3675    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3676    pub fn import(&self, source: impl IntoID<FileId>) -> Container {
3677        let mut query = self.selection.select("import");
3678        query = query.arg_lazy(
3679            "source",
3680            Box::new(move || {
3681                let source = source.clone();
3682                Box::pin(async move { source.into_id().await.unwrap().quote() })
3683            }),
3684        );
3685        Container {
3686            proc: self.proc.clone(),
3687            selection: query,
3688            graphql_client: self.graphql_client.clone(),
3689        }
3690    }
3691    /// Reads the container from an OCI tarball.
3692    ///
3693    /// # Arguments
3694    ///
3695    /// * `source` - File to read the container from.
3696    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3697    pub fn import_opts<'a>(
3698        &self,
3699        source: impl IntoID<FileId>,
3700        opts: ContainerImportOpts<'a>,
3701    ) -> Container {
3702        let mut query = self.selection.select("import");
3703        query = query.arg_lazy(
3704            "source",
3705            Box::new(move || {
3706                let source = source.clone();
3707                Box::pin(async move { source.into_id().await.unwrap().quote() })
3708            }),
3709        );
3710        if let Some(tag) = opts.tag {
3711            query = query.arg("tag", tag);
3712        }
3713        Container {
3714            proc: self.proc.clone(),
3715            selection: query,
3716            graphql_client: self.graphql_client.clone(),
3717        }
3718    }
3719    /// Retrieves the value of the specified label.
3720    ///
3721    /// # Arguments
3722    ///
3723    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3724    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3725        let mut query = self.selection.select("label");
3726        query = query.arg("name", name.into());
3727        query.execute(self.graphql_client.clone()).await
3728    }
3729    /// Retrieves the list of labels passed to container.
3730    pub fn labels(&self) -> Vec<Label> {
3731        let query = self.selection.select("labels");
3732        vec![Label {
3733            proc: self.proc.clone(),
3734            selection: query,
3735            graphql_client: self.graphql_client.clone(),
3736        }]
3737    }
3738    /// Retrieves the list of paths where a directory is mounted.
3739    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
3740        let query = self.selection.select("mounts");
3741        query.execute(self.graphql_client.clone()).await
3742    }
3743    /// The platform this container executes and publishes as.
3744    pub async fn platform(&self) -> Result<Platform, DaggerError> {
3745        let query = self.selection.select("platform");
3746        query.execute(self.graphql_client.clone()).await
3747    }
3748    /// Package the container state as an OCI image, and publish it to a registry
3749    /// Returns the fully qualified address of the published image, with digest
3750    ///
3751    /// # Arguments
3752    ///
3753    /// * `address` - The OCI address to publish to
3754    ///
3755    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
3756    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3757    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
3758        let mut query = self.selection.select("publish");
3759        query = query.arg("address", address.into());
3760        query.execute(self.graphql_client.clone()).await
3761    }
3762    /// Package the container state as an OCI image, and publish it to a registry
3763    /// Returns the fully qualified address of the published image, with digest
3764    ///
3765    /// # Arguments
3766    ///
3767    /// * `address` - The OCI address to publish to
3768    ///
3769    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
3770    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3771    pub async fn publish_opts(
3772        &self,
3773        address: impl Into<String>,
3774        opts: ContainerPublishOpts,
3775    ) -> Result<String, DaggerError> {
3776        let mut query = self.selection.select("publish");
3777        query = query.arg("address", address.into());
3778        if let Some(platform_variants) = opts.platform_variants {
3779            query = query.arg("platformVariants", platform_variants);
3780        }
3781        if let Some(forced_compression) = opts.forced_compression {
3782            query = query.arg("forcedCompression", forced_compression);
3783        }
3784        if let Some(media_types) = opts.media_types {
3785            query = query.arg("mediaTypes", media_types);
3786        }
3787        query.execute(self.graphql_client.clone()).await
3788    }
3789    /// 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.
3790    pub fn rootfs(&self) -> Directory {
3791        let query = self.selection.select("rootfs");
3792        Directory {
3793            proc: self.proc.clone(),
3794            selection: query,
3795            graphql_client: self.graphql_client.clone(),
3796        }
3797    }
3798    /// Return file status
3799    ///
3800    /// # Arguments
3801    ///
3802    /// * `path` - Path to check (e.g., "/file.txt").
3803    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3804    pub fn stat(&self, path: impl Into<String>) -> Stat {
3805        let mut query = self.selection.select("stat");
3806        query = query.arg("path", path.into());
3807        Stat {
3808            proc: self.proc.clone(),
3809            selection: query,
3810            graphql_client: self.graphql_client.clone(),
3811        }
3812    }
3813    /// Return file status
3814    ///
3815    /// # Arguments
3816    ///
3817    /// * `path` - Path to check (e.g., "/file.txt").
3818    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3819    pub fn stat_opts(&self, path: impl Into<String>, opts: ContainerStatOpts) -> Stat {
3820        let mut query = self.selection.select("stat");
3821        query = query.arg("path", path.into());
3822        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
3823            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
3824        }
3825        Stat {
3826            proc: self.proc.clone(),
3827            selection: query,
3828            graphql_client: self.graphql_client.clone(),
3829        }
3830    }
3831    /// The buffered standard error stream of the last executed command
3832    /// Returns an error if no command was executed
3833    pub async fn stderr(&self) -> Result<String, DaggerError> {
3834        let query = self.selection.select("stderr");
3835        query.execute(self.graphql_client.clone()).await
3836    }
3837    /// The buffered standard output stream of the last executed command
3838    /// Returns an error if no command was executed
3839    pub async fn stdout(&self) -> Result<String, DaggerError> {
3840        let query = self.selection.select("stdout");
3841        query.execute(self.graphql_client.clone()).await
3842    }
3843    /// Forces evaluation of the pipeline in the engine.
3844    /// It doesn't run the default command if no exec has been set.
3845    pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
3846        let query = self.selection.select("sync");
3847        query.execute(self.graphql_client.clone()).await
3848    }
3849    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
3850    ///
3851    /// # Arguments
3852    ///
3853    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3854    pub fn terminal(&self) -> Container {
3855        let query = self.selection.select("terminal");
3856        Container {
3857            proc: self.proc.clone(),
3858            selection: query,
3859            graphql_client: self.graphql_client.clone(),
3860        }
3861    }
3862    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
3863    ///
3864    /// # Arguments
3865    ///
3866    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3867    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
3868        let mut query = self.selection.select("terminal");
3869        if let Some(cmd) = opts.cmd {
3870            query = query.arg("cmd", cmd);
3871        }
3872        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3873            query = query.arg(
3874                "experimentalPrivilegedNesting",
3875                experimental_privileged_nesting,
3876            );
3877        }
3878        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3879            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3880        }
3881        Container {
3882            proc: self.proc.clone(),
3883            selection: query,
3884            graphql_client: self.graphql_client.clone(),
3885        }
3886    }
3887    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3888    /// Be sure to set any exposed ports before calling this api.
3889    ///
3890    /// # Arguments
3891    ///
3892    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3893    pub async fn up(&self) -> Result<Void, DaggerError> {
3894        let query = self.selection.select("up");
3895        query.execute(self.graphql_client.clone()).await
3896    }
3897    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3898    /// Be sure to set any exposed ports before calling this api.
3899    ///
3900    /// # Arguments
3901    ///
3902    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3903    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
3904        let mut query = self.selection.select("up");
3905        if let Some(random) = opts.random {
3906            query = query.arg("random", random);
3907        }
3908        if let Some(ports) = opts.ports {
3909            query = query.arg("ports", ports);
3910        }
3911        if let Some(args) = opts.args {
3912            query = query.arg("args", args);
3913        }
3914        if let Some(use_entrypoint) = opts.use_entrypoint {
3915            query = query.arg("useEntrypoint", use_entrypoint);
3916        }
3917        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3918            query = query.arg(
3919                "experimentalPrivilegedNesting",
3920                experimental_privileged_nesting,
3921            );
3922        }
3923        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3924            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3925        }
3926        if let Some(expand) = opts.expand {
3927            query = query.arg("expand", expand);
3928        }
3929        if let Some(no_init) = opts.no_init {
3930            query = query.arg("noInit", no_init);
3931        }
3932        query.execute(self.graphql_client.clone()).await
3933    }
3934    /// Retrieves the user to be set for all commands.
3935    pub async fn user(&self) -> Result<String, DaggerError> {
3936        let query = self.selection.select("user");
3937        query.execute(self.graphql_client.clone()).await
3938    }
3939    /// Retrieves this container plus the given OCI annotation.
3940    ///
3941    /// # Arguments
3942    ///
3943    /// * `name` - The name of the annotation.
3944    /// * `value` - The value of the annotation.
3945    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3946        let mut query = self.selection.select("withAnnotation");
3947        query = query.arg("name", name.into());
3948        query = query.arg("value", value.into());
3949        Container {
3950            proc: self.proc.clone(),
3951            selection: query,
3952            graphql_client: self.graphql_client.clone(),
3953        }
3954    }
3955    /// Configures default arguments for future commands. Like CMD in Dockerfile.
3956    ///
3957    /// # Arguments
3958    ///
3959    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
3960    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
3961        let mut query = self.selection.select("withDefaultArgs");
3962        query = query.arg(
3963            "args",
3964            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3965        );
3966        Container {
3967            proc: self.proc.clone(),
3968            selection: query,
3969            graphql_client: self.graphql_client.clone(),
3970        }
3971    }
3972    /// Set the default command to invoke for the container's terminal API.
3973    ///
3974    /// # Arguments
3975    ///
3976    /// * `args` - The args of the command.
3977    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3978    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
3979        let mut query = self.selection.select("withDefaultTerminalCmd");
3980        query = query.arg(
3981            "args",
3982            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3983        );
3984        Container {
3985            proc: self.proc.clone(),
3986            selection: query,
3987            graphql_client: self.graphql_client.clone(),
3988        }
3989    }
3990    /// Set the default command to invoke for the container's terminal API.
3991    ///
3992    /// # Arguments
3993    ///
3994    /// * `args` - The args of the command.
3995    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3996    pub fn with_default_terminal_cmd_opts(
3997        &self,
3998        args: Vec<impl Into<String>>,
3999        opts: ContainerWithDefaultTerminalCmdOpts,
4000    ) -> Container {
4001        let mut query = self.selection.select("withDefaultTerminalCmd");
4002        query = query.arg(
4003            "args",
4004            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4005        );
4006        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4007            query = query.arg(
4008                "experimentalPrivilegedNesting",
4009                experimental_privileged_nesting,
4010            );
4011        }
4012        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4013            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4014        }
4015        Container {
4016            proc: self.proc.clone(),
4017            selection: query,
4018            graphql_client: self.graphql_client.clone(),
4019        }
4020    }
4021    /// Return a new container snapshot, with a directory added to its filesystem
4022    ///
4023    /// # Arguments
4024    ///
4025    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
4026    /// * `source` - Identifier of the directory to write
4027    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4028    pub fn with_directory(
4029        &self,
4030        path: impl Into<String>,
4031        source: impl IntoID<DirectoryId>,
4032    ) -> Container {
4033        let mut query = self.selection.select("withDirectory");
4034        query = query.arg("path", path.into());
4035        query = query.arg_lazy(
4036            "source",
4037            Box::new(move || {
4038                let source = source.clone();
4039                Box::pin(async move { source.into_id().await.unwrap().quote() })
4040            }),
4041        );
4042        Container {
4043            proc: self.proc.clone(),
4044            selection: query,
4045            graphql_client: self.graphql_client.clone(),
4046        }
4047    }
4048    /// Return a new container snapshot, with a directory added to its filesystem
4049    ///
4050    /// # Arguments
4051    ///
4052    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
4053    /// * `source` - Identifier of the directory to write
4054    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4055    pub fn with_directory_opts<'a>(
4056        &self,
4057        path: impl Into<String>,
4058        source: impl IntoID<DirectoryId>,
4059        opts: ContainerWithDirectoryOpts<'a>,
4060    ) -> Container {
4061        let mut query = self.selection.select("withDirectory");
4062        query = query.arg("path", path.into());
4063        query = query.arg_lazy(
4064            "source",
4065            Box::new(move || {
4066                let source = source.clone();
4067                Box::pin(async move { source.into_id().await.unwrap().quote() })
4068            }),
4069        );
4070        if let Some(exclude) = opts.exclude {
4071            query = query.arg("exclude", exclude);
4072        }
4073        if let Some(include) = opts.include {
4074            query = query.arg("include", include);
4075        }
4076        if let Some(gitignore) = opts.gitignore {
4077            query = query.arg("gitignore", gitignore);
4078        }
4079        if let Some(owner) = opts.owner {
4080            query = query.arg("owner", owner);
4081        }
4082        if let Some(expand) = opts.expand {
4083            query = query.arg("expand", expand);
4084        }
4085        Container {
4086            proc: self.proc.clone(),
4087            selection: query,
4088            graphql_client: self.graphql_client.clone(),
4089        }
4090    }
4091    /// Retrieves this container with the specificed docker healtcheck command set.
4092    ///
4093    /// # Arguments
4094    ///
4095    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
4096    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4097    pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
4098        let mut query = self.selection.select("withDockerHealthcheck");
4099        query = query.arg(
4100            "args",
4101            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4102        );
4103        Container {
4104            proc: self.proc.clone(),
4105            selection: query,
4106            graphql_client: self.graphql_client.clone(),
4107        }
4108    }
4109    /// Retrieves this container with the specificed docker healtcheck command set.
4110    ///
4111    /// # Arguments
4112    ///
4113    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
4114    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4115    pub fn with_docker_healthcheck_opts<'a>(
4116        &self,
4117        args: Vec<impl Into<String>>,
4118        opts: ContainerWithDockerHealthcheckOpts<'a>,
4119    ) -> Container {
4120        let mut query = self.selection.select("withDockerHealthcheck");
4121        query = query.arg(
4122            "args",
4123            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4124        );
4125        if let Some(shell) = opts.shell {
4126            query = query.arg("shell", shell);
4127        }
4128        if let Some(interval) = opts.interval {
4129            query = query.arg("interval", interval);
4130        }
4131        if let Some(timeout) = opts.timeout {
4132            query = query.arg("timeout", timeout);
4133        }
4134        if let Some(start_period) = opts.start_period {
4135            query = query.arg("startPeriod", start_period);
4136        }
4137        if let Some(start_interval) = opts.start_interval {
4138            query = query.arg("startInterval", start_interval);
4139        }
4140        if let Some(retries) = opts.retries {
4141            query = query.arg("retries", retries);
4142        }
4143        Container {
4144            proc: self.proc.clone(),
4145            selection: query,
4146            graphql_client: self.graphql_client.clone(),
4147        }
4148    }
4149    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
4150    ///
4151    /// # Arguments
4152    ///
4153    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
4154    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4155    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
4156        let mut query = self.selection.select("withEntrypoint");
4157        query = query.arg(
4158            "args",
4159            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4160        );
4161        Container {
4162            proc: self.proc.clone(),
4163            selection: query,
4164            graphql_client: self.graphql_client.clone(),
4165        }
4166    }
4167    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
4168    ///
4169    /// # Arguments
4170    ///
4171    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
4172    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4173    pub fn with_entrypoint_opts(
4174        &self,
4175        args: Vec<impl Into<String>>,
4176        opts: ContainerWithEntrypointOpts,
4177    ) -> Container {
4178        let mut query = self.selection.select("withEntrypoint");
4179        query = query.arg(
4180            "args",
4181            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4182        );
4183        if let Some(keep_default_args) = opts.keep_default_args {
4184            query = query.arg("keepDefaultArgs", keep_default_args);
4185        }
4186        Container {
4187            proc: self.proc.clone(),
4188            selection: query,
4189            graphql_client: self.graphql_client.clone(),
4190        }
4191    }
4192    /// Export environment variables from an env-file to the container.
4193    ///
4194    /// # Arguments
4195    ///
4196    /// * `source` - Identifier of the envfile
4197    pub fn with_env_file_variables(&self, source: impl IntoID<EnvFileId>) -> Container {
4198        let mut query = self.selection.select("withEnvFileVariables");
4199        query = query.arg_lazy(
4200            "source",
4201            Box::new(move || {
4202                let source = source.clone();
4203                Box::pin(async move { source.into_id().await.unwrap().quote() })
4204            }),
4205        );
4206        Container {
4207            proc: self.proc.clone(),
4208            selection: query,
4209            graphql_client: self.graphql_client.clone(),
4210        }
4211    }
4212    /// Set a new environment variable in the container.
4213    ///
4214    /// # Arguments
4215    ///
4216    /// * `name` - Name of the environment variable (e.g., "HOST").
4217    /// * `value` - Value of the environment variable. (e.g., "localhost").
4218    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4219    pub fn with_env_variable(
4220        &self,
4221        name: impl Into<String>,
4222        value: impl Into<String>,
4223    ) -> Container {
4224        let mut query = self.selection.select("withEnvVariable");
4225        query = query.arg("name", name.into());
4226        query = query.arg("value", value.into());
4227        Container {
4228            proc: self.proc.clone(),
4229            selection: query,
4230            graphql_client: self.graphql_client.clone(),
4231        }
4232    }
4233    /// Set a new environment variable in the container.
4234    ///
4235    /// # Arguments
4236    ///
4237    /// * `name` - Name of the environment variable (e.g., "HOST").
4238    /// * `value` - Value of the environment variable. (e.g., "localhost").
4239    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4240    pub fn with_env_variable_opts(
4241        &self,
4242        name: impl Into<String>,
4243        value: impl Into<String>,
4244        opts: ContainerWithEnvVariableOpts,
4245    ) -> Container {
4246        let mut query = self.selection.select("withEnvVariable");
4247        query = query.arg("name", name.into());
4248        query = query.arg("value", value.into());
4249        if let Some(expand) = opts.expand {
4250            query = query.arg("expand", expand);
4251        }
4252        Container {
4253            proc: self.proc.clone(),
4254            selection: query,
4255            graphql_client: self.graphql_client.clone(),
4256        }
4257    }
4258    /// Raise an error.
4259    ///
4260    /// # Arguments
4261    ///
4262    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
4263    pub fn with_error(&self, err: impl Into<String>) -> Container {
4264        let mut query = self.selection.select("withError");
4265        query = query.arg("err", err.into());
4266        Container {
4267            proc: self.proc.clone(),
4268            selection: query,
4269            graphql_client: self.graphql_client.clone(),
4270        }
4271    }
4272    /// Execute a command in the container, and return a new snapshot of the container state after execution.
4273    ///
4274    /// # Arguments
4275    ///
4276    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
4277    ///
4278    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
4279    ///
4280    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
4281    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4282    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
4283        let mut query = self.selection.select("withExec");
4284        query = query.arg(
4285            "args",
4286            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4287        );
4288        Container {
4289            proc: self.proc.clone(),
4290            selection: query,
4291            graphql_client: self.graphql_client.clone(),
4292        }
4293    }
4294    /// Execute a command in the container, and return a new snapshot of the container state after execution.
4295    ///
4296    /// # Arguments
4297    ///
4298    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
4299    ///
4300    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
4301    ///
4302    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
4303    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4304    pub fn with_exec_opts<'a>(
4305        &self,
4306        args: Vec<impl Into<String>>,
4307        opts: ContainerWithExecOpts<'a>,
4308    ) -> Container {
4309        let mut query = self.selection.select("withExec");
4310        query = query.arg(
4311            "args",
4312            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4313        );
4314        if let Some(use_entrypoint) = opts.use_entrypoint {
4315            query = query.arg("useEntrypoint", use_entrypoint);
4316        }
4317        if let Some(stdin) = opts.stdin {
4318            query = query.arg("stdin", stdin);
4319        }
4320        if let Some(redirect_stdin) = opts.redirect_stdin {
4321            query = query.arg("redirectStdin", redirect_stdin);
4322        }
4323        if let Some(redirect_stdout) = opts.redirect_stdout {
4324            query = query.arg("redirectStdout", redirect_stdout);
4325        }
4326        if let Some(redirect_stderr) = opts.redirect_stderr {
4327            query = query.arg("redirectStderr", redirect_stderr);
4328        }
4329        if let Some(expect) = opts.expect {
4330            query = query.arg("expect", expect);
4331        }
4332        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4333            query = query.arg(
4334                "experimentalPrivilegedNesting",
4335                experimental_privileged_nesting,
4336            );
4337        }
4338        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4339            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4340        }
4341        if let Some(expand) = opts.expand {
4342            query = query.arg("expand", expand);
4343        }
4344        if let Some(no_init) = opts.no_init {
4345            query = query.arg("noInit", no_init);
4346        }
4347        Container {
4348            proc: self.proc.clone(),
4349            selection: query,
4350            graphql_client: self.graphql_client.clone(),
4351        }
4352    }
4353    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
4354    /// Exposed ports serve two purposes:
4355    /// - For health checks and introspection, when running services
4356    /// - For setting the EXPOSE OCI field when publishing the container
4357    ///
4358    /// # Arguments
4359    ///
4360    /// * `port` - Port number to expose. Example: 8080
4361    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4362    pub fn with_exposed_port(&self, port: isize) -> Container {
4363        let mut query = self.selection.select("withExposedPort");
4364        query = query.arg("port", port);
4365        Container {
4366            proc: self.proc.clone(),
4367            selection: query,
4368            graphql_client: self.graphql_client.clone(),
4369        }
4370    }
4371    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
4372    /// Exposed ports serve two purposes:
4373    /// - For health checks and introspection, when running services
4374    /// - For setting the EXPOSE OCI field when publishing the container
4375    ///
4376    /// # Arguments
4377    ///
4378    /// * `port` - Port number to expose. Example: 8080
4379    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4380    pub fn with_exposed_port_opts<'a>(
4381        &self,
4382        port: isize,
4383        opts: ContainerWithExposedPortOpts<'a>,
4384    ) -> Container {
4385        let mut query = self.selection.select("withExposedPort");
4386        query = query.arg("port", port);
4387        if let Some(protocol) = opts.protocol {
4388            query = query.arg("protocol", protocol);
4389        }
4390        if let Some(description) = opts.description {
4391            query = query.arg("description", description);
4392        }
4393        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
4394            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
4395        }
4396        Container {
4397            proc: self.proc.clone(),
4398            selection: query,
4399            graphql_client: self.graphql_client.clone(),
4400        }
4401    }
4402    /// Return a container snapshot with a file added
4403    ///
4404    /// # Arguments
4405    ///
4406    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4407    /// * `source` - File to add
4408    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4409    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
4410        let mut query = self.selection.select("withFile");
4411        query = query.arg("path", path.into());
4412        query = query.arg_lazy(
4413            "source",
4414            Box::new(move || {
4415                let source = source.clone();
4416                Box::pin(async move { source.into_id().await.unwrap().quote() })
4417            }),
4418        );
4419        Container {
4420            proc: self.proc.clone(),
4421            selection: query,
4422            graphql_client: self.graphql_client.clone(),
4423        }
4424    }
4425    /// Return a container snapshot with a file added
4426    ///
4427    /// # Arguments
4428    ///
4429    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4430    /// * `source` - File to add
4431    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4432    pub fn with_file_opts<'a>(
4433        &self,
4434        path: impl Into<String>,
4435        source: impl IntoID<FileId>,
4436        opts: ContainerWithFileOpts<'a>,
4437    ) -> Container {
4438        let mut query = self.selection.select("withFile");
4439        query = query.arg("path", path.into());
4440        query = query.arg_lazy(
4441            "source",
4442            Box::new(move || {
4443                let source = source.clone();
4444                Box::pin(async move { source.into_id().await.unwrap().quote() })
4445            }),
4446        );
4447        if let Some(permissions) = opts.permissions {
4448            query = query.arg("permissions", permissions);
4449        }
4450        if let Some(owner) = opts.owner {
4451            query = query.arg("owner", owner);
4452        }
4453        if let Some(expand) = opts.expand {
4454            query = query.arg("expand", expand);
4455        }
4456        Container {
4457            proc: self.proc.clone(),
4458            selection: query,
4459            graphql_client: self.graphql_client.clone(),
4460        }
4461    }
4462    /// Retrieves this container plus the contents of the given files copied to the given path.
4463    ///
4464    /// # Arguments
4465    ///
4466    /// * `path` - Location where copied files should be placed (e.g., "/src").
4467    /// * `sources` - Identifiers of the files to copy.
4468    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4469    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
4470        let mut query = self.selection.select("withFiles");
4471        query = query.arg("path", path.into());
4472        query = query.arg("sources", sources);
4473        Container {
4474            proc: self.proc.clone(),
4475            selection: query,
4476            graphql_client: self.graphql_client.clone(),
4477        }
4478    }
4479    /// Retrieves this container plus the contents of the given files copied to the given path.
4480    ///
4481    /// # Arguments
4482    ///
4483    /// * `path` - Location where copied files should be placed (e.g., "/src").
4484    /// * `sources` - Identifiers of the files to copy.
4485    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4486    pub fn with_files_opts<'a>(
4487        &self,
4488        path: impl Into<String>,
4489        sources: Vec<FileId>,
4490        opts: ContainerWithFilesOpts<'a>,
4491    ) -> Container {
4492        let mut query = self.selection.select("withFiles");
4493        query = query.arg("path", path.into());
4494        query = query.arg("sources", sources);
4495        if let Some(permissions) = opts.permissions {
4496            query = query.arg("permissions", permissions);
4497        }
4498        if let Some(owner) = opts.owner {
4499            query = query.arg("owner", owner);
4500        }
4501        if let Some(expand) = opts.expand {
4502            query = query.arg("expand", expand);
4503        }
4504        Container {
4505            proc: self.proc.clone(),
4506            selection: query,
4507            graphql_client: self.graphql_client.clone(),
4508        }
4509    }
4510    /// Retrieves this container plus the given label.
4511    ///
4512    /// # Arguments
4513    ///
4514    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
4515    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
4516    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
4517        let mut query = self.selection.select("withLabel");
4518        query = query.arg("name", name.into());
4519        query = query.arg("value", value.into());
4520        Container {
4521            proc: self.proc.clone(),
4522            selection: query,
4523            graphql_client: self.graphql_client.clone(),
4524        }
4525    }
4526    /// Retrieves this container plus a cache volume mounted at the given path.
4527    ///
4528    /// # Arguments
4529    ///
4530    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4531    /// * `cache` - Identifier of the cache volume to mount.
4532    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4533    pub fn with_mounted_cache(
4534        &self,
4535        path: impl Into<String>,
4536        cache: impl IntoID<CacheVolumeId>,
4537    ) -> Container {
4538        let mut query = self.selection.select("withMountedCache");
4539        query = query.arg("path", path.into());
4540        query = query.arg_lazy(
4541            "cache",
4542            Box::new(move || {
4543                let cache = cache.clone();
4544                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4545            }),
4546        );
4547        Container {
4548            proc: self.proc.clone(),
4549            selection: query,
4550            graphql_client: self.graphql_client.clone(),
4551        }
4552    }
4553    /// Retrieves this container plus a cache volume mounted at the given path.
4554    ///
4555    /// # Arguments
4556    ///
4557    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4558    /// * `cache` - Identifier of the cache volume to mount.
4559    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4560    pub fn with_mounted_cache_opts<'a>(
4561        &self,
4562        path: impl Into<String>,
4563        cache: impl IntoID<CacheVolumeId>,
4564        opts: ContainerWithMountedCacheOpts<'a>,
4565    ) -> Container {
4566        let mut query = self.selection.select("withMountedCache");
4567        query = query.arg("path", path.into());
4568        query = query.arg_lazy(
4569            "cache",
4570            Box::new(move || {
4571                let cache = cache.clone();
4572                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4573            }),
4574        );
4575        if let Some(source) = opts.source {
4576            query = query.arg("source", source);
4577        }
4578        if let Some(sharing) = opts.sharing {
4579            query = query.arg("sharing", sharing);
4580        }
4581        if let Some(owner) = opts.owner {
4582            query = query.arg("owner", owner);
4583        }
4584        if let Some(expand) = opts.expand {
4585            query = query.arg("expand", expand);
4586        }
4587        Container {
4588            proc: self.proc.clone(),
4589            selection: query,
4590            graphql_client: self.graphql_client.clone(),
4591        }
4592    }
4593    /// Retrieves this container plus a directory mounted at the given path.
4594    ///
4595    /// # Arguments
4596    ///
4597    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4598    /// * `source` - Identifier of the mounted directory.
4599    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4600    pub fn with_mounted_directory(
4601        &self,
4602        path: impl Into<String>,
4603        source: impl IntoID<DirectoryId>,
4604    ) -> Container {
4605        let mut query = self.selection.select("withMountedDirectory");
4606        query = query.arg("path", path.into());
4607        query = query.arg_lazy(
4608            "source",
4609            Box::new(move || {
4610                let source = source.clone();
4611                Box::pin(async move { source.into_id().await.unwrap().quote() })
4612            }),
4613        );
4614        Container {
4615            proc: self.proc.clone(),
4616            selection: query,
4617            graphql_client: self.graphql_client.clone(),
4618        }
4619    }
4620    /// Retrieves this container plus a directory mounted at the given path.
4621    ///
4622    /// # Arguments
4623    ///
4624    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4625    /// * `source` - Identifier of the mounted directory.
4626    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4627    pub fn with_mounted_directory_opts<'a>(
4628        &self,
4629        path: impl Into<String>,
4630        source: impl IntoID<DirectoryId>,
4631        opts: ContainerWithMountedDirectoryOpts<'a>,
4632    ) -> Container {
4633        let mut query = self.selection.select("withMountedDirectory");
4634        query = query.arg("path", path.into());
4635        query = query.arg_lazy(
4636            "source",
4637            Box::new(move || {
4638                let source = source.clone();
4639                Box::pin(async move { source.into_id().await.unwrap().quote() })
4640            }),
4641        );
4642        if let Some(owner) = opts.owner {
4643            query = query.arg("owner", owner);
4644        }
4645        if let Some(expand) = opts.expand {
4646            query = query.arg("expand", expand);
4647        }
4648        Container {
4649            proc: self.proc.clone(),
4650            selection: query,
4651            graphql_client: self.graphql_client.clone(),
4652        }
4653    }
4654    /// Retrieves this container plus a file mounted at the given path.
4655    ///
4656    /// # Arguments
4657    ///
4658    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4659    /// * `source` - Identifier of the mounted file.
4660    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4661    pub fn with_mounted_file(
4662        &self,
4663        path: impl Into<String>,
4664        source: impl IntoID<FileId>,
4665    ) -> Container {
4666        let mut query = self.selection.select("withMountedFile");
4667        query = query.arg("path", path.into());
4668        query = query.arg_lazy(
4669            "source",
4670            Box::new(move || {
4671                let source = source.clone();
4672                Box::pin(async move { source.into_id().await.unwrap().quote() })
4673            }),
4674        );
4675        Container {
4676            proc: self.proc.clone(),
4677            selection: query,
4678            graphql_client: self.graphql_client.clone(),
4679        }
4680    }
4681    /// Retrieves this container plus a file mounted at the given path.
4682    ///
4683    /// # Arguments
4684    ///
4685    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4686    /// * `source` - Identifier of the mounted file.
4687    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4688    pub fn with_mounted_file_opts<'a>(
4689        &self,
4690        path: impl Into<String>,
4691        source: impl IntoID<FileId>,
4692        opts: ContainerWithMountedFileOpts<'a>,
4693    ) -> Container {
4694        let mut query = self.selection.select("withMountedFile");
4695        query = query.arg("path", path.into());
4696        query = query.arg_lazy(
4697            "source",
4698            Box::new(move || {
4699                let source = source.clone();
4700                Box::pin(async move { source.into_id().await.unwrap().quote() })
4701            }),
4702        );
4703        if let Some(owner) = opts.owner {
4704            query = query.arg("owner", owner);
4705        }
4706        if let Some(expand) = opts.expand {
4707            query = query.arg("expand", expand);
4708        }
4709        Container {
4710            proc: self.proc.clone(),
4711            selection: query,
4712            graphql_client: self.graphql_client.clone(),
4713        }
4714    }
4715    /// Retrieves this container plus a secret mounted into a file at the given path.
4716    ///
4717    /// # Arguments
4718    ///
4719    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4720    /// * `source` - Identifier of the secret to mount.
4721    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4722    pub fn with_mounted_secret(
4723        &self,
4724        path: impl Into<String>,
4725        source: impl IntoID<SecretId>,
4726    ) -> Container {
4727        let mut query = self.selection.select("withMountedSecret");
4728        query = query.arg("path", path.into());
4729        query = query.arg_lazy(
4730            "source",
4731            Box::new(move || {
4732                let source = source.clone();
4733                Box::pin(async move { source.into_id().await.unwrap().quote() })
4734            }),
4735        );
4736        Container {
4737            proc: self.proc.clone(),
4738            selection: query,
4739            graphql_client: self.graphql_client.clone(),
4740        }
4741    }
4742    /// Retrieves this container plus a secret mounted into a file at the given path.
4743    ///
4744    /// # Arguments
4745    ///
4746    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4747    /// * `source` - Identifier of the secret to mount.
4748    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4749    pub fn with_mounted_secret_opts<'a>(
4750        &self,
4751        path: impl Into<String>,
4752        source: impl IntoID<SecretId>,
4753        opts: ContainerWithMountedSecretOpts<'a>,
4754    ) -> Container {
4755        let mut query = self.selection.select("withMountedSecret");
4756        query = query.arg("path", path.into());
4757        query = query.arg_lazy(
4758            "source",
4759            Box::new(move || {
4760                let source = source.clone();
4761                Box::pin(async move { source.into_id().await.unwrap().quote() })
4762            }),
4763        );
4764        if let Some(owner) = opts.owner {
4765            query = query.arg("owner", owner);
4766        }
4767        if let Some(mode) = opts.mode {
4768            query = query.arg("mode", mode);
4769        }
4770        if let Some(expand) = opts.expand {
4771            query = query.arg("expand", expand);
4772        }
4773        Container {
4774            proc: self.proc.clone(),
4775            selection: query,
4776            graphql_client: self.graphql_client.clone(),
4777        }
4778    }
4779    /// 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.
4780    ///
4781    /// # Arguments
4782    ///
4783    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4784    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4785    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4786        let mut query = self.selection.select("withMountedTemp");
4787        query = query.arg("path", path.into());
4788        Container {
4789            proc: self.proc.clone(),
4790            selection: query,
4791            graphql_client: self.graphql_client.clone(),
4792        }
4793    }
4794    /// 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.
4795    ///
4796    /// # Arguments
4797    ///
4798    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4799    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4800    pub fn with_mounted_temp_opts(
4801        &self,
4802        path: impl Into<String>,
4803        opts: ContainerWithMountedTempOpts,
4804    ) -> Container {
4805        let mut query = self.selection.select("withMountedTemp");
4806        query = query.arg("path", path.into());
4807        if let Some(size) = opts.size {
4808            query = query.arg("size", size);
4809        }
4810        if let Some(expand) = opts.expand {
4811            query = query.arg("expand", expand);
4812        }
4813        Container {
4814            proc: self.proc.clone(),
4815            selection: query,
4816            graphql_client: self.graphql_client.clone(),
4817        }
4818    }
4819    /// Return a new container snapshot, with a file added to its filesystem with text content
4820    ///
4821    /// # Arguments
4822    ///
4823    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4824    /// * `contents` - Contents of the new file. Example: "Hello world!"
4825    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4826    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
4827        let mut query = self.selection.select("withNewFile");
4828        query = query.arg("path", path.into());
4829        query = query.arg("contents", contents.into());
4830        Container {
4831            proc: self.proc.clone(),
4832            selection: query,
4833            graphql_client: self.graphql_client.clone(),
4834        }
4835    }
4836    /// Return a new container snapshot, with a file added to its filesystem with text content
4837    ///
4838    /// # Arguments
4839    ///
4840    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4841    /// * `contents` - Contents of the new file. Example: "Hello world!"
4842    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4843    pub fn with_new_file_opts<'a>(
4844        &self,
4845        path: impl Into<String>,
4846        contents: impl Into<String>,
4847        opts: ContainerWithNewFileOpts<'a>,
4848    ) -> Container {
4849        let mut query = self.selection.select("withNewFile");
4850        query = query.arg("path", path.into());
4851        query = query.arg("contents", contents.into());
4852        if let Some(permissions) = opts.permissions {
4853            query = query.arg("permissions", permissions);
4854        }
4855        if let Some(owner) = opts.owner {
4856            query = query.arg("owner", owner);
4857        }
4858        if let Some(expand) = opts.expand {
4859            query = query.arg("expand", expand);
4860        }
4861        Container {
4862            proc: self.proc.clone(),
4863            selection: query,
4864            graphql_client: self.graphql_client.clone(),
4865        }
4866    }
4867    /// Attach credentials for future publishing to a registry. Use in combination with publish
4868    ///
4869    /// # Arguments
4870    ///
4871    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
4872    /// * `username` - The username to authenticate with. Example: "alice"
4873    /// * `secret` - The API key, password or token to authenticate to this registry
4874    pub fn with_registry_auth(
4875        &self,
4876        address: impl Into<String>,
4877        username: impl Into<String>,
4878        secret: impl IntoID<SecretId>,
4879    ) -> Container {
4880        let mut query = self.selection.select("withRegistryAuth");
4881        query = query.arg("address", address.into());
4882        query = query.arg("username", username.into());
4883        query = query.arg_lazy(
4884            "secret",
4885            Box::new(move || {
4886                let secret = secret.clone();
4887                Box::pin(async move { secret.into_id().await.unwrap().quote() })
4888            }),
4889        );
4890        Container {
4891            proc: self.proc.clone(),
4892            selection: query,
4893            graphql_client: self.graphql_client.clone(),
4894        }
4895    }
4896    /// Change the container's root filesystem. The previous root filesystem will be lost.
4897    ///
4898    /// # Arguments
4899    ///
4900    /// * `directory` - The new root filesystem.
4901    pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
4902        let mut query = self.selection.select("withRootfs");
4903        query = query.arg_lazy(
4904            "directory",
4905            Box::new(move || {
4906                let directory = directory.clone();
4907                Box::pin(async move { directory.into_id().await.unwrap().quote() })
4908            }),
4909        );
4910        Container {
4911            proc: self.proc.clone(),
4912            selection: query,
4913            graphql_client: self.graphql_client.clone(),
4914        }
4915    }
4916    /// Set a new environment variable, using a secret value
4917    ///
4918    /// # Arguments
4919    ///
4920    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
4921    /// * `secret` - Identifier of the secret value.
4922    pub fn with_secret_variable(
4923        &self,
4924        name: impl Into<String>,
4925        secret: impl IntoID<SecretId>,
4926    ) -> Container {
4927        let mut query = self.selection.select("withSecretVariable");
4928        query = query.arg("name", name.into());
4929        query = query.arg_lazy(
4930            "secret",
4931            Box::new(move || {
4932                let secret = secret.clone();
4933                Box::pin(async move { secret.into_id().await.unwrap().quote() })
4934            }),
4935        );
4936        Container {
4937            proc: self.proc.clone(),
4938            selection: query,
4939            graphql_client: self.graphql_client.clone(),
4940        }
4941    }
4942    /// Establish a runtime dependency from a container to a network service.
4943    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
4944    /// The service will be reachable from the container via the provided hostname alias.
4945    /// The service dependency will also convey to any files or directories produced by the container.
4946    ///
4947    /// # Arguments
4948    ///
4949    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
4950    /// * `service` - The target service
4951    pub fn with_service_binding(
4952        &self,
4953        alias: impl Into<String>,
4954        service: impl IntoID<ServiceId>,
4955    ) -> Container {
4956        let mut query = self.selection.select("withServiceBinding");
4957        query = query.arg("alias", alias.into());
4958        query = query.arg_lazy(
4959            "service",
4960            Box::new(move || {
4961                let service = service.clone();
4962                Box::pin(async move { service.into_id().await.unwrap().quote() })
4963            }),
4964        );
4965        Container {
4966            proc: self.proc.clone(),
4967            selection: query,
4968            graphql_client: self.graphql_client.clone(),
4969        }
4970    }
4971    /// Return a snapshot with a symlink
4972    ///
4973    /// # Arguments
4974    ///
4975    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4976    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4977    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4978    pub fn with_symlink(
4979        &self,
4980        target: impl Into<String>,
4981        link_name: impl Into<String>,
4982    ) -> Container {
4983        let mut query = self.selection.select("withSymlink");
4984        query = query.arg("target", target.into());
4985        query = query.arg("linkName", link_name.into());
4986        Container {
4987            proc: self.proc.clone(),
4988            selection: query,
4989            graphql_client: self.graphql_client.clone(),
4990        }
4991    }
4992    /// Return a snapshot with a symlink
4993    ///
4994    /// # Arguments
4995    ///
4996    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4997    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4998    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4999    pub fn with_symlink_opts(
5000        &self,
5001        target: impl Into<String>,
5002        link_name: impl Into<String>,
5003        opts: ContainerWithSymlinkOpts,
5004    ) -> Container {
5005        let mut query = self.selection.select("withSymlink");
5006        query = query.arg("target", target.into());
5007        query = query.arg("linkName", link_name.into());
5008        if let Some(expand) = opts.expand {
5009            query = query.arg("expand", expand);
5010        }
5011        Container {
5012            proc: self.proc.clone(),
5013            selection: query,
5014            graphql_client: self.graphql_client.clone(),
5015        }
5016    }
5017    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
5018    ///
5019    /// # Arguments
5020    ///
5021    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
5022    /// * `source` - Identifier of the socket to forward.
5023    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5024    pub fn with_unix_socket(
5025        &self,
5026        path: impl Into<String>,
5027        source: impl IntoID<SocketId>,
5028    ) -> Container {
5029        let mut query = self.selection.select("withUnixSocket");
5030        query = query.arg("path", path.into());
5031        query = query.arg_lazy(
5032            "source",
5033            Box::new(move || {
5034                let source = source.clone();
5035                Box::pin(async move { source.into_id().await.unwrap().quote() })
5036            }),
5037        );
5038        Container {
5039            proc: self.proc.clone(),
5040            selection: query,
5041            graphql_client: self.graphql_client.clone(),
5042        }
5043    }
5044    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
5045    ///
5046    /// # Arguments
5047    ///
5048    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
5049    /// * `source` - Identifier of the socket to forward.
5050    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5051    pub fn with_unix_socket_opts<'a>(
5052        &self,
5053        path: impl Into<String>,
5054        source: impl IntoID<SocketId>,
5055        opts: ContainerWithUnixSocketOpts<'a>,
5056    ) -> Container {
5057        let mut query = self.selection.select("withUnixSocket");
5058        query = query.arg("path", path.into());
5059        query = query.arg_lazy(
5060            "source",
5061            Box::new(move || {
5062                let source = source.clone();
5063                Box::pin(async move { source.into_id().await.unwrap().quote() })
5064            }),
5065        );
5066        if let Some(owner) = opts.owner {
5067            query = query.arg("owner", owner);
5068        }
5069        if let Some(expand) = opts.expand {
5070            query = query.arg("expand", expand);
5071        }
5072        Container {
5073            proc: self.proc.clone(),
5074            selection: query,
5075            graphql_client: self.graphql_client.clone(),
5076        }
5077    }
5078    /// Retrieves this container with a different command user.
5079    ///
5080    /// # Arguments
5081    ///
5082    /// * `name` - The user to set (e.g., "root").
5083    pub fn with_user(&self, name: impl Into<String>) -> Container {
5084        let mut query = self.selection.select("withUser");
5085        query = query.arg("name", name.into());
5086        Container {
5087            proc: self.proc.clone(),
5088            selection: query,
5089            graphql_client: self.graphql_client.clone(),
5090        }
5091    }
5092    /// Change the container's working directory. Like WORKDIR in Dockerfile.
5093    ///
5094    /// # Arguments
5095    ///
5096    /// * `path` - The path to set as the working directory (e.g., "/app").
5097    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5098    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
5099        let mut query = self.selection.select("withWorkdir");
5100        query = query.arg("path", path.into());
5101        Container {
5102            proc: self.proc.clone(),
5103            selection: query,
5104            graphql_client: self.graphql_client.clone(),
5105        }
5106    }
5107    /// Change the container's working directory. Like WORKDIR in Dockerfile.
5108    ///
5109    /// # Arguments
5110    ///
5111    /// * `path` - The path to set as the working directory (e.g., "/app").
5112    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5113    pub fn with_workdir_opts(
5114        &self,
5115        path: impl Into<String>,
5116        opts: ContainerWithWorkdirOpts,
5117    ) -> Container {
5118        let mut query = self.selection.select("withWorkdir");
5119        query = query.arg("path", path.into());
5120        if let Some(expand) = opts.expand {
5121            query = query.arg("expand", expand);
5122        }
5123        Container {
5124            proc: self.proc.clone(),
5125            selection: query,
5126            graphql_client: self.graphql_client.clone(),
5127        }
5128    }
5129    /// Retrieves this container minus the given OCI annotation.
5130    ///
5131    /// # Arguments
5132    ///
5133    /// * `name` - The name of the annotation.
5134    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
5135        let mut query = self.selection.select("withoutAnnotation");
5136        query = query.arg("name", name.into());
5137        Container {
5138            proc: self.proc.clone(),
5139            selection: query,
5140            graphql_client: self.graphql_client.clone(),
5141        }
5142    }
5143    /// Remove the container's default arguments.
5144    pub fn without_default_args(&self) -> Container {
5145        let query = self.selection.select("withoutDefaultArgs");
5146        Container {
5147            proc: self.proc.clone(),
5148            selection: query,
5149            graphql_client: self.graphql_client.clone(),
5150        }
5151    }
5152    /// Return a new container snapshot, with a directory removed from its filesystem
5153    ///
5154    /// # Arguments
5155    ///
5156    /// * `path` - Location of the directory to remove (e.g., ".github/").
5157    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5158    pub fn without_directory(&self, path: impl Into<String>) -> Container {
5159        let mut query = self.selection.select("withoutDirectory");
5160        query = query.arg("path", path.into());
5161        Container {
5162            proc: self.proc.clone(),
5163            selection: query,
5164            graphql_client: self.graphql_client.clone(),
5165        }
5166    }
5167    /// Return a new container snapshot, with a directory removed from its filesystem
5168    ///
5169    /// # Arguments
5170    ///
5171    /// * `path` - Location of the directory to remove (e.g., ".github/").
5172    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5173    pub fn without_directory_opts(
5174        &self,
5175        path: impl Into<String>,
5176        opts: ContainerWithoutDirectoryOpts,
5177    ) -> Container {
5178        let mut query = self.selection.select("withoutDirectory");
5179        query = query.arg("path", path.into());
5180        if let Some(expand) = opts.expand {
5181            query = query.arg("expand", expand);
5182        }
5183        Container {
5184            proc: self.proc.clone(),
5185            selection: query,
5186            graphql_client: self.graphql_client.clone(),
5187        }
5188    }
5189    /// Retrieves this container without a configured docker healtcheck command.
5190    pub fn without_docker_healthcheck(&self) -> Container {
5191        let query = self.selection.select("withoutDockerHealthcheck");
5192        Container {
5193            proc: self.proc.clone(),
5194            selection: query,
5195            graphql_client: self.graphql_client.clone(),
5196        }
5197    }
5198    /// Reset the container's OCI entrypoint.
5199    ///
5200    /// # Arguments
5201    ///
5202    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5203    pub fn without_entrypoint(&self) -> Container {
5204        let query = self.selection.select("withoutEntrypoint");
5205        Container {
5206            proc: self.proc.clone(),
5207            selection: query,
5208            graphql_client: self.graphql_client.clone(),
5209        }
5210    }
5211    /// Reset the container's OCI entrypoint.
5212    ///
5213    /// # Arguments
5214    ///
5215    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5216    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
5217        let mut query = self.selection.select("withoutEntrypoint");
5218        if let Some(keep_default_args) = opts.keep_default_args {
5219            query = query.arg("keepDefaultArgs", keep_default_args);
5220        }
5221        Container {
5222            proc: self.proc.clone(),
5223            selection: query,
5224            graphql_client: self.graphql_client.clone(),
5225        }
5226    }
5227    /// Retrieves this container minus the given environment variable.
5228    ///
5229    /// # Arguments
5230    ///
5231    /// * `name` - The name of the environment variable (e.g., "HOST").
5232    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
5233        let mut query = self.selection.select("withoutEnvVariable");
5234        query = query.arg("name", name.into());
5235        Container {
5236            proc: self.proc.clone(),
5237            selection: query,
5238            graphql_client: self.graphql_client.clone(),
5239        }
5240    }
5241    /// Unexpose a previously exposed port.
5242    ///
5243    /// # Arguments
5244    ///
5245    /// * `port` - Port number to unexpose
5246    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5247    pub fn without_exposed_port(&self, port: isize) -> Container {
5248        let mut query = self.selection.select("withoutExposedPort");
5249        query = query.arg("port", port);
5250        Container {
5251            proc: self.proc.clone(),
5252            selection: query,
5253            graphql_client: self.graphql_client.clone(),
5254        }
5255    }
5256    /// Unexpose a previously exposed port.
5257    ///
5258    /// # Arguments
5259    ///
5260    /// * `port` - Port number to unexpose
5261    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5262    pub fn without_exposed_port_opts(
5263        &self,
5264        port: isize,
5265        opts: ContainerWithoutExposedPortOpts,
5266    ) -> Container {
5267        let mut query = self.selection.select("withoutExposedPort");
5268        query = query.arg("port", port);
5269        if let Some(protocol) = opts.protocol {
5270            query = query.arg("protocol", protocol);
5271        }
5272        Container {
5273            proc: self.proc.clone(),
5274            selection: query,
5275            graphql_client: self.graphql_client.clone(),
5276        }
5277    }
5278    /// Retrieves this container with the file at the given path removed.
5279    ///
5280    /// # Arguments
5281    ///
5282    /// * `path` - Location of the file to remove (e.g., "/file.txt").
5283    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5284    pub fn without_file(&self, path: impl Into<String>) -> Container {
5285        let mut query = self.selection.select("withoutFile");
5286        query = query.arg("path", path.into());
5287        Container {
5288            proc: self.proc.clone(),
5289            selection: query,
5290            graphql_client: self.graphql_client.clone(),
5291        }
5292    }
5293    /// Retrieves this container with the file at the given path removed.
5294    ///
5295    /// # Arguments
5296    ///
5297    /// * `path` - Location of the file to remove (e.g., "/file.txt").
5298    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5299    pub fn without_file_opts(
5300        &self,
5301        path: impl Into<String>,
5302        opts: ContainerWithoutFileOpts,
5303    ) -> Container {
5304        let mut query = self.selection.select("withoutFile");
5305        query = query.arg("path", path.into());
5306        if let Some(expand) = opts.expand {
5307            query = query.arg("expand", expand);
5308        }
5309        Container {
5310            proc: self.proc.clone(),
5311            selection: query,
5312            graphql_client: self.graphql_client.clone(),
5313        }
5314    }
5315    /// Return a new container spanshot with specified files removed
5316    ///
5317    /// # Arguments
5318    ///
5319    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
5320    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5321    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
5322        let mut query = self.selection.select("withoutFiles");
5323        query = query.arg(
5324            "paths",
5325            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5326        );
5327        Container {
5328            proc: self.proc.clone(),
5329            selection: query,
5330            graphql_client: self.graphql_client.clone(),
5331        }
5332    }
5333    /// Return a new container spanshot with specified files removed
5334    ///
5335    /// # Arguments
5336    ///
5337    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
5338    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5339    pub fn without_files_opts(
5340        &self,
5341        paths: Vec<impl Into<String>>,
5342        opts: ContainerWithoutFilesOpts,
5343    ) -> Container {
5344        let mut query = self.selection.select("withoutFiles");
5345        query = query.arg(
5346            "paths",
5347            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5348        );
5349        if let Some(expand) = opts.expand {
5350            query = query.arg("expand", expand);
5351        }
5352        Container {
5353            proc: self.proc.clone(),
5354            selection: query,
5355            graphql_client: self.graphql_client.clone(),
5356        }
5357    }
5358    /// Retrieves this container minus the given environment label.
5359    ///
5360    /// # Arguments
5361    ///
5362    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
5363    pub fn without_label(&self, name: impl Into<String>) -> Container {
5364        let mut query = self.selection.select("withoutLabel");
5365        query = query.arg("name", name.into());
5366        Container {
5367            proc: self.proc.clone(),
5368            selection: query,
5369            graphql_client: self.graphql_client.clone(),
5370        }
5371    }
5372    /// Retrieves this container after unmounting everything at the given path.
5373    ///
5374    /// # Arguments
5375    ///
5376    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
5377    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5378    pub fn without_mount(&self, path: impl Into<String>) -> Container {
5379        let mut query = self.selection.select("withoutMount");
5380        query = query.arg("path", path.into());
5381        Container {
5382            proc: self.proc.clone(),
5383            selection: query,
5384            graphql_client: self.graphql_client.clone(),
5385        }
5386    }
5387    /// Retrieves this container after unmounting everything at the given path.
5388    ///
5389    /// # Arguments
5390    ///
5391    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
5392    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5393    pub fn without_mount_opts(
5394        &self,
5395        path: impl Into<String>,
5396        opts: ContainerWithoutMountOpts,
5397    ) -> Container {
5398        let mut query = self.selection.select("withoutMount");
5399        query = query.arg("path", path.into());
5400        if let Some(expand) = opts.expand {
5401            query = query.arg("expand", expand);
5402        }
5403        Container {
5404            proc: self.proc.clone(),
5405            selection: query,
5406            graphql_client: self.graphql_client.clone(),
5407        }
5408    }
5409    /// Retrieves this container without the registry authentication of a given address.
5410    ///
5411    /// # Arguments
5412    ///
5413    /// * `address` - Registry's address to remove the authentication from.
5414    ///
5415    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
5416    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
5417        let mut query = self.selection.select("withoutRegistryAuth");
5418        query = query.arg("address", address.into());
5419        Container {
5420            proc: self.proc.clone(),
5421            selection: query,
5422            graphql_client: self.graphql_client.clone(),
5423        }
5424    }
5425    /// Retrieves this container minus the given environment variable containing the secret.
5426    ///
5427    /// # Arguments
5428    ///
5429    /// * `name` - The name of the environment variable (e.g., "HOST").
5430    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
5431        let mut query = self.selection.select("withoutSecretVariable");
5432        query = query.arg("name", name.into());
5433        Container {
5434            proc: self.proc.clone(),
5435            selection: query,
5436            graphql_client: self.graphql_client.clone(),
5437        }
5438    }
5439    /// Retrieves this container with a previously added Unix socket removed.
5440    ///
5441    /// # Arguments
5442    ///
5443    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
5444    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5445    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
5446        let mut query = self.selection.select("withoutUnixSocket");
5447        query = query.arg("path", path.into());
5448        Container {
5449            proc: self.proc.clone(),
5450            selection: query,
5451            graphql_client: self.graphql_client.clone(),
5452        }
5453    }
5454    /// Retrieves this container with a previously added Unix socket removed.
5455    ///
5456    /// # Arguments
5457    ///
5458    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
5459    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5460    pub fn without_unix_socket_opts(
5461        &self,
5462        path: impl Into<String>,
5463        opts: ContainerWithoutUnixSocketOpts,
5464    ) -> Container {
5465        let mut query = self.selection.select("withoutUnixSocket");
5466        query = query.arg("path", path.into());
5467        if let Some(expand) = opts.expand {
5468            query = query.arg("expand", expand);
5469        }
5470        Container {
5471            proc: self.proc.clone(),
5472            selection: query,
5473            graphql_client: self.graphql_client.clone(),
5474        }
5475    }
5476    /// Retrieves this container with an unset command user.
5477    /// Should default to root.
5478    pub fn without_user(&self) -> Container {
5479        let query = self.selection.select("withoutUser");
5480        Container {
5481            proc: self.proc.clone(),
5482            selection: query,
5483            graphql_client: self.graphql_client.clone(),
5484        }
5485    }
5486    /// Unset the container's working directory.
5487    /// Should default to "/".
5488    pub fn without_workdir(&self) -> Container {
5489        let query = self.selection.select("withoutWorkdir");
5490        Container {
5491            proc: self.proc.clone(),
5492            selection: query,
5493            graphql_client: self.graphql_client.clone(),
5494        }
5495    }
5496    /// Retrieves the working directory for all commands.
5497    pub async fn workdir(&self) -> Result<String, DaggerError> {
5498        let query = self.selection.select("workdir");
5499        query.execute(self.graphql_client.clone()).await
5500    }
5501}
5502#[derive(Clone)]
5503pub struct CurrentModule {
5504    pub proc: Option<Arc<DaggerSessionProc>>,
5505    pub selection: Selection,
5506    pub graphql_client: DynGraphQLClient,
5507}
5508#[derive(Builder, Debug, PartialEq)]
5509pub struct CurrentModuleGeneratorsOpts<'a> {
5510    /// Only include generators matching the specified patterns
5511    #[builder(setter(into, strip_option), default)]
5512    pub include: Option<Vec<&'a str>>,
5513}
5514#[derive(Builder, Debug, PartialEq)]
5515pub struct CurrentModuleWorkdirOpts<'a> {
5516    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
5517    #[builder(setter(into, strip_option), default)]
5518    pub exclude: Option<Vec<&'a str>>,
5519    /// Apply .gitignore filter rules inside the directory
5520    #[builder(setter(into, strip_option), default)]
5521    pub gitignore: Option<bool>,
5522    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
5523    #[builder(setter(into, strip_option), default)]
5524    pub include: Option<Vec<&'a str>>,
5525}
5526impl CurrentModule {
5527    /// The dependencies of the module.
5528    pub fn dependencies(&self) -> Vec<Module> {
5529        let query = self.selection.select("dependencies");
5530        vec![Module {
5531            proc: self.proc.clone(),
5532            selection: query,
5533            graphql_client: self.graphql_client.clone(),
5534        }]
5535    }
5536    /// The generated files and directories made on top of the module source's context directory.
5537    pub fn generated_context_directory(&self) -> Directory {
5538        let query = self.selection.select("generatedContextDirectory");
5539        Directory {
5540            proc: self.proc.clone(),
5541            selection: query,
5542            graphql_client: self.graphql_client.clone(),
5543        }
5544    }
5545    /// Return all generators defined by the module
5546    ///
5547    /// # Arguments
5548    ///
5549    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5550    pub fn generators(&self) -> GeneratorGroup {
5551        let query = self.selection.select("generators");
5552        GeneratorGroup {
5553            proc: self.proc.clone(),
5554            selection: query,
5555            graphql_client: self.graphql_client.clone(),
5556        }
5557    }
5558    /// Return all generators defined by the module
5559    ///
5560    /// # Arguments
5561    ///
5562    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5563    pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
5564        let mut query = self.selection.select("generators");
5565        if let Some(include) = opts.include {
5566            query = query.arg("include", include);
5567        }
5568        GeneratorGroup {
5569            proc: self.proc.clone(),
5570            selection: query,
5571            graphql_client: self.graphql_client.clone(),
5572        }
5573    }
5574    /// A unique identifier for this CurrentModule.
5575    pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
5576        let query = self.selection.select("id");
5577        query.execute(self.graphql_client.clone()).await
5578    }
5579    /// The name of the module being executed in
5580    pub async fn name(&self) -> Result<String, DaggerError> {
5581        let query = self.selection.select("name");
5582        query.execute(self.graphql_client.clone()).await
5583    }
5584    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
5585    pub fn source(&self) -> Directory {
5586        let query = self.selection.select("source");
5587        Directory {
5588            proc: self.proc.clone(),
5589            selection: query,
5590            graphql_client: self.graphql_client.clone(),
5591        }
5592    }
5593    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
5594    ///
5595    /// # Arguments
5596    ///
5597    /// * `path` - Location of the directory to access (e.g., ".").
5598    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5599    pub fn workdir(&self, path: impl Into<String>) -> Directory {
5600        let mut query = self.selection.select("workdir");
5601        query = query.arg("path", path.into());
5602        Directory {
5603            proc: self.proc.clone(),
5604            selection: query,
5605            graphql_client: self.graphql_client.clone(),
5606        }
5607    }
5608    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
5609    ///
5610    /// # Arguments
5611    ///
5612    /// * `path` - Location of the directory to access (e.g., ".").
5613    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5614    pub fn workdir_opts<'a>(
5615        &self,
5616        path: impl Into<String>,
5617        opts: CurrentModuleWorkdirOpts<'a>,
5618    ) -> Directory {
5619        let mut query = self.selection.select("workdir");
5620        query = query.arg("path", path.into());
5621        if let Some(exclude) = opts.exclude {
5622            query = query.arg("exclude", exclude);
5623        }
5624        if let Some(include) = opts.include {
5625            query = query.arg("include", include);
5626        }
5627        if let Some(gitignore) = opts.gitignore {
5628            query = query.arg("gitignore", gitignore);
5629        }
5630        Directory {
5631            proc: self.proc.clone(),
5632            selection: query,
5633            graphql_client: self.graphql_client.clone(),
5634        }
5635    }
5636    /// 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.
5637    ///
5638    /// # Arguments
5639    ///
5640    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5641    pub fn workdir_file(&self, path: impl Into<String>) -> File {
5642        let mut query = self.selection.select("workdirFile");
5643        query = query.arg("path", path.into());
5644        File {
5645            proc: self.proc.clone(),
5646            selection: query,
5647            graphql_client: self.graphql_client.clone(),
5648        }
5649    }
5650}
5651#[derive(Clone)]
5652pub struct Directory {
5653    pub proc: Option<Arc<DaggerSessionProc>>,
5654    pub selection: Selection,
5655    pub graphql_client: DynGraphQLClient,
5656}
5657#[derive(Builder, Debug, PartialEq)]
5658pub struct DirectoryAsModuleOpts<'a> {
5659    /// An optional subpath of the directory which contains the module's configuration file.
5660    /// If not set, the module source code is loaded from the root of the directory.
5661    #[builder(setter(into, strip_option), default)]
5662    pub source_root_path: Option<&'a str>,
5663}
5664#[derive(Builder, Debug, PartialEq)]
5665pub struct DirectoryAsModuleSourceOpts<'a> {
5666    /// An optional subpath of the directory which contains the module's configuration file.
5667    /// If not set, the module source code is loaded from the root of the directory.
5668    #[builder(setter(into, strip_option), default)]
5669    pub source_root_path: Option<&'a str>,
5670}
5671#[derive(Builder, Debug, PartialEq)]
5672pub struct DirectoryDockerBuildOpts<'a> {
5673    /// Build arguments to use in the build.
5674    #[builder(setter(into, strip_option), default)]
5675    pub build_args: Option<Vec<BuildArg>>,
5676    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
5677    #[builder(setter(into, strip_option), default)]
5678    pub dockerfile: Option<&'a str>,
5679    /// If set, skip the automatic init process injected into containers created by RUN statements.
5680    /// 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.
5681    #[builder(setter(into, strip_option), default)]
5682    pub no_init: Option<bool>,
5683    /// The platform to build.
5684    #[builder(setter(into, strip_option), default)]
5685    pub platform: Option<Platform>,
5686    /// Secrets to pass to the build.
5687    /// They will be mounted at /run/secrets/[secret-name].
5688    #[builder(setter(into, strip_option), default)]
5689    pub secrets: Option<Vec<SecretId>>,
5690    /// A socket to use for SSH authentication during the build
5691    /// (e.g., for Dockerfile RUN --mount=type=ssh instructions).
5692    /// Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
5693    #[builder(setter(into, strip_option), default)]
5694    pub ssh: Option<SocketId>,
5695    /// Target build stage to build.
5696    #[builder(setter(into, strip_option), default)]
5697    pub target: Option<&'a str>,
5698}
5699#[derive(Builder, Debug, PartialEq)]
5700pub struct DirectoryEntriesOpts<'a> {
5701    /// Location of the directory to look at (e.g., "/src").
5702    #[builder(setter(into, strip_option), default)]
5703    pub path: Option<&'a str>,
5704}
5705#[derive(Builder, Debug, PartialEq)]
5706pub struct DirectoryExistsOpts {
5707    /// If specified, do not follow symlinks.
5708    #[builder(setter(into, strip_option), default)]
5709    pub do_not_follow_symlinks: Option<bool>,
5710    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
5711    #[builder(setter(into, strip_option), default)]
5712    pub expected_type: Option<ExistsType>,
5713}
5714#[derive(Builder, Debug, PartialEq)]
5715pub struct DirectoryExportOpts {
5716    /// 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.
5717    #[builder(setter(into, strip_option), default)]
5718    pub wipe: Option<bool>,
5719}
5720#[derive(Builder, Debug, PartialEq)]
5721pub struct DirectoryFilterOpts<'a> {
5722    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
5723    #[builder(setter(into, strip_option), default)]
5724    pub exclude: Option<Vec<&'a str>>,
5725    /// If set, apply .gitignore rules when filtering the directory.
5726    #[builder(setter(into, strip_option), default)]
5727    pub gitignore: Option<bool>,
5728    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
5729    #[builder(setter(into, strip_option), default)]
5730    pub include: Option<Vec<&'a str>>,
5731}
5732#[derive(Builder, Debug, PartialEq)]
5733pub struct DirectorySearchOpts<'a> {
5734    /// Allow the . pattern to match newlines in multiline mode.
5735    #[builder(setter(into, strip_option), default)]
5736    pub dotall: Option<bool>,
5737    /// Only return matching files, not lines and content
5738    #[builder(setter(into, strip_option), default)]
5739    pub files_only: Option<bool>,
5740    /// Glob patterns to match (e.g., "*.md")
5741    #[builder(setter(into, strip_option), default)]
5742    pub globs: Option<Vec<&'a str>>,
5743    /// Enable case-insensitive matching.
5744    #[builder(setter(into, strip_option), default)]
5745    pub insensitive: Option<bool>,
5746    /// Limit the number of results to return
5747    #[builder(setter(into, strip_option), default)]
5748    pub limit: Option<isize>,
5749    /// Interpret the pattern as a literal string instead of a regular expression.
5750    #[builder(setter(into, strip_option), default)]
5751    pub literal: Option<bool>,
5752    /// Enable searching across multiple lines.
5753    #[builder(setter(into, strip_option), default)]
5754    pub multiline: Option<bool>,
5755    /// Directory or file paths to search
5756    #[builder(setter(into, strip_option), default)]
5757    pub paths: Option<Vec<&'a str>>,
5758    /// Skip hidden files (files starting with .).
5759    #[builder(setter(into, strip_option), default)]
5760    pub skip_hidden: Option<bool>,
5761    /// Honor .gitignore, .ignore, and .rgignore files.
5762    #[builder(setter(into, strip_option), default)]
5763    pub skip_ignored: Option<bool>,
5764}
5765#[derive(Builder, Debug, PartialEq)]
5766pub struct DirectoryStatOpts {
5767    /// If specified, do not follow symlinks.
5768    #[builder(setter(into, strip_option), default)]
5769    pub do_not_follow_symlinks: Option<bool>,
5770}
5771#[derive(Builder, Debug, PartialEq)]
5772pub struct DirectoryTerminalOpts<'a> {
5773    /// If set, override the container's default terminal command and invoke these command arguments instead.
5774    #[builder(setter(into, strip_option), default)]
5775    pub cmd: Option<Vec<&'a str>>,
5776    /// If set, override the default container used for the terminal.
5777    #[builder(setter(into, strip_option), default)]
5778    pub container: Option<ContainerId>,
5779    /// Provides Dagger access to the executed command.
5780    #[builder(setter(into, strip_option), default)]
5781    pub experimental_privileged_nesting: Option<bool>,
5782    /// 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.
5783    #[builder(setter(into, strip_option), default)]
5784    pub insecure_root_capabilities: Option<bool>,
5785}
5786#[derive(Builder, Debug, PartialEq)]
5787pub struct DirectoryWithDirectoryOpts<'a> {
5788    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
5789    #[builder(setter(into, strip_option), default)]
5790    pub exclude: Option<Vec<&'a str>>,
5791    /// Apply .gitignore filter rules inside the directory
5792    #[builder(setter(into, strip_option), default)]
5793    pub gitignore: Option<bool>,
5794    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
5795    #[builder(setter(into, strip_option), default)]
5796    pub include: Option<Vec<&'a str>>,
5797    /// A user:group to set for the copied directory and its contents.
5798    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5799    /// If the group is omitted, it defaults to the same as the user.
5800    #[builder(setter(into, strip_option), default)]
5801    pub owner: Option<&'a str>,
5802}
5803#[derive(Builder, Debug, PartialEq)]
5804pub struct DirectoryWithFileOpts<'a> {
5805    /// A user:group to set for the copied directory and its contents.
5806    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5807    /// If the group is omitted, it defaults to the same as the user.
5808    #[builder(setter(into, strip_option), default)]
5809    pub owner: Option<&'a str>,
5810    /// Permission given to the copied file (e.g., 0600).
5811    #[builder(setter(into, strip_option), default)]
5812    pub permissions: Option<isize>,
5813}
5814#[derive(Builder, Debug, PartialEq)]
5815pub struct DirectoryWithFilesOpts {
5816    /// Permission given to the copied files (e.g., 0600).
5817    #[builder(setter(into, strip_option), default)]
5818    pub permissions: Option<isize>,
5819}
5820#[derive(Builder, Debug, PartialEq)]
5821pub struct DirectoryWithNewDirectoryOpts {
5822    /// Permission granted to the created directory (e.g., 0777).
5823    #[builder(setter(into, strip_option), default)]
5824    pub permissions: Option<isize>,
5825}
5826#[derive(Builder, Debug, PartialEq)]
5827pub struct DirectoryWithNewFileOpts {
5828    /// Permissions of the new file. Example: 0600
5829    #[builder(setter(into, strip_option), default)]
5830    pub permissions: Option<isize>,
5831}
5832impl Directory {
5833    /// Converts this directory to a local git repository
5834    pub fn as_git(&self) -> GitRepository {
5835        let query = self.selection.select("asGit");
5836        GitRepository {
5837            proc: self.proc.clone(),
5838            selection: query,
5839            graphql_client: self.graphql_client.clone(),
5840        }
5841    }
5842    /// Load the directory as a Dagger module source
5843    ///
5844    /// # Arguments
5845    ///
5846    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5847    pub fn as_module(&self) -> Module {
5848        let query = self.selection.select("asModule");
5849        Module {
5850            proc: self.proc.clone(),
5851            selection: query,
5852            graphql_client: self.graphql_client.clone(),
5853        }
5854    }
5855    /// Load the directory as a Dagger module source
5856    ///
5857    /// # Arguments
5858    ///
5859    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5860    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
5861        let mut query = self.selection.select("asModule");
5862        if let Some(source_root_path) = opts.source_root_path {
5863            query = query.arg("sourceRootPath", source_root_path);
5864        }
5865        Module {
5866            proc: self.proc.clone(),
5867            selection: query,
5868            graphql_client: self.graphql_client.clone(),
5869        }
5870    }
5871    /// Load the directory as a Dagger module source
5872    ///
5873    /// # Arguments
5874    ///
5875    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5876    pub fn as_module_source(&self) -> ModuleSource {
5877        let query = self.selection.select("asModuleSource");
5878        ModuleSource {
5879            proc: self.proc.clone(),
5880            selection: query,
5881            graphql_client: self.graphql_client.clone(),
5882        }
5883    }
5884    /// Load the directory as a Dagger module source
5885    ///
5886    /// # Arguments
5887    ///
5888    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5889    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
5890        let mut query = self.selection.select("asModuleSource");
5891        if let Some(source_root_path) = opts.source_root_path {
5892            query = query.arg("sourceRootPath", source_root_path);
5893        }
5894        ModuleSource {
5895            proc: self.proc.clone(),
5896            selection: query,
5897            graphql_client: self.graphql_client.clone(),
5898        }
5899    }
5900    /// Return the difference between this directory and another directory, typically an older snapshot.
5901    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
5902    ///
5903    /// # Arguments
5904    ///
5905    /// * `from` - The base directory snapshot to compare against
5906    pub fn changes(&self, from: impl IntoID<DirectoryId>) -> Changeset {
5907        let mut query = self.selection.select("changes");
5908        query = query.arg_lazy(
5909            "from",
5910            Box::new(move || {
5911                let from = from.clone();
5912                Box::pin(async move { from.into_id().await.unwrap().quote() })
5913            }),
5914        );
5915        Changeset {
5916            proc: self.proc.clone(),
5917            selection: query,
5918            graphql_client: self.graphql_client.clone(),
5919        }
5920    }
5921    /// Change the owner of the directory contents recursively.
5922    ///
5923    /// # Arguments
5924    ///
5925    /// * `path` - Path of the directory to change ownership of (e.g., "/").
5926    /// * `owner` - A user:group to set for the mounted directory and its contents.
5927    ///
5928    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5929    ///
5930    /// If the group is omitted, it defaults to the same as the user.
5931    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
5932        let mut query = self.selection.select("chown");
5933        query = query.arg("path", path.into());
5934        query = query.arg("owner", owner.into());
5935        Directory {
5936            proc: self.proc.clone(),
5937            selection: query,
5938            graphql_client: self.graphql_client.clone(),
5939        }
5940    }
5941    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
5942    ///
5943    /// # Arguments
5944    ///
5945    /// * `other` - The directory to compare against
5946    pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
5947        let mut query = self.selection.select("diff");
5948        query = query.arg_lazy(
5949            "other",
5950            Box::new(move || {
5951                let other = other.clone();
5952                Box::pin(async move { other.into_id().await.unwrap().quote() })
5953            }),
5954        );
5955        Directory {
5956            proc: self.proc.clone(),
5957            selection: query,
5958            graphql_client: self.graphql_client.clone(),
5959        }
5960    }
5961    /// 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.
5962    pub async fn digest(&self) -> Result<String, DaggerError> {
5963        let query = self.selection.select("digest");
5964        query.execute(self.graphql_client.clone()).await
5965    }
5966    /// Retrieves a directory at the given path.
5967    ///
5968    /// # Arguments
5969    ///
5970    /// * `path` - Location of the directory to retrieve. Example: "/src"
5971    pub fn directory(&self, path: impl Into<String>) -> Directory {
5972        let mut query = self.selection.select("directory");
5973        query = query.arg("path", path.into());
5974        Directory {
5975            proc: self.proc.clone(),
5976            selection: query,
5977            graphql_client: self.graphql_client.clone(),
5978        }
5979    }
5980    /// 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.
5981    ///
5982    /// # Arguments
5983    ///
5984    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5985    pub fn docker_build(&self) -> Container {
5986        let query = self.selection.select("dockerBuild");
5987        Container {
5988            proc: self.proc.clone(),
5989            selection: query,
5990            graphql_client: self.graphql_client.clone(),
5991        }
5992    }
5993    /// 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.
5994    ///
5995    /// # Arguments
5996    ///
5997    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5998    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5999        let mut query = self.selection.select("dockerBuild");
6000        if let Some(dockerfile) = opts.dockerfile {
6001            query = query.arg("dockerfile", dockerfile);
6002        }
6003        if let Some(platform) = opts.platform {
6004            query = query.arg("platform", platform);
6005        }
6006        if let Some(build_args) = opts.build_args {
6007            query = query.arg("buildArgs", build_args);
6008        }
6009        if let Some(target) = opts.target {
6010            query = query.arg("target", target);
6011        }
6012        if let Some(secrets) = opts.secrets {
6013            query = query.arg("secrets", secrets);
6014        }
6015        if let Some(no_init) = opts.no_init {
6016            query = query.arg("noInit", no_init);
6017        }
6018        if let Some(ssh) = opts.ssh {
6019            query = query.arg("ssh", ssh);
6020        }
6021        Container {
6022            proc: self.proc.clone(),
6023            selection: query,
6024            graphql_client: self.graphql_client.clone(),
6025        }
6026    }
6027    /// Returns a list of files and directories at the given path.
6028    ///
6029    /// # Arguments
6030    ///
6031    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6032    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
6033        let query = self.selection.select("entries");
6034        query.execute(self.graphql_client.clone()).await
6035    }
6036    /// Returns a list of files and directories at the given path.
6037    ///
6038    /// # Arguments
6039    ///
6040    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6041    pub async fn entries_opts<'a>(
6042        &self,
6043        opts: DirectoryEntriesOpts<'a>,
6044    ) -> Result<Vec<String>, DaggerError> {
6045        let mut query = self.selection.select("entries");
6046        if let Some(path) = opts.path {
6047            query = query.arg("path", path);
6048        }
6049        query.execute(self.graphql_client.clone()).await
6050    }
6051    /// check if a file or directory exists
6052    ///
6053    /// # Arguments
6054    ///
6055    /// * `path` - Path to check (e.g., "/file.txt").
6056    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6057    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
6058        let mut query = self.selection.select("exists");
6059        query = query.arg("path", path.into());
6060        query.execute(self.graphql_client.clone()).await
6061    }
6062    /// check if a file or directory exists
6063    ///
6064    /// # Arguments
6065    ///
6066    /// * `path` - Path to check (e.g., "/file.txt").
6067    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6068    pub async fn exists_opts(
6069        &self,
6070        path: impl Into<String>,
6071        opts: DirectoryExistsOpts,
6072    ) -> Result<bool, DaggerError> {
6073        let mut query = self.selection.select("exists");
6074        query = query.arg("path", path.into());
6075        if let Some(expected_type) = opts.expected_type {
6076            query = query.arg("expectedType", expected_type);
6077        }
6078        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
6079            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
6080        }
6081        query.execute(self.graphql_client.clone()).await
6082    }
6083    /// Writes the contents of the directory to a path on the host.
6084    ///
6085    /// # Arguments
6086    ///
6087    /// * `path` - Location of the copied directory (e.g., "logs/").
6088    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6089    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
6090        let mut query = self.selection.select("export");
6091        query = query.arg("path", path.into());
6092        query.execute(self.graphql_client.clone()).await
6093    }
6094    /// Writes the contents of the directory to a path on the host.
6095    ///
6096    /// # Arguments
6097    ///
6098    /// * `path` - Location of the copied directory (e.g., "logs/").
6099    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6100    pub async fn export_opts(
6101        &self,
6102        path: impl Into<String>,
6103        opts: DirectoryExportOpts,
6104    ) -> Result<String, DaggerError> {
6105        let mut query = self.selection.select("export");
6106        query = query.arg("path", path.into());
6107        if let Some(wipe) = opts.wipe {
6108            query = query.arg("wipe", wipe);
6109        }
6110        query.execute(self.graphql_client.clone()).await
6111    }
6112    /// Retrieve a file at the given path.
6113    ///
6114    /// # Arguments
6115    ///
6116    /// * `path` - Location of the file to retrieve (e.g., "README.md").
6117    pub fn file(&self, path: impl Into<String>) -> File {
6118        let mut query = self.selection.select("file");
6119        query = query.arg("path", path.into());
6120        File {
6121            proc: self.proc.clone(),
6122            selection: query,
6123            graphql_client: self.graphql_client.clone(),
6124        }
6125    }
6126    /// Return a snapshot with some paths included or excluded
6127    ///
6128    /// # Arguments
6129    ///
6130    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6131    pub fn filter(&self) -> Directory {
6132        let query = self.selection.select("filter");
6133        Directory {
6134            proc: self.proc.clone(),
6135            selection: query,
6136            graphql_client: self.graphql_client.clone(),
6137        }
6138    }
6139    /// Return a snapshot with some paths included or excluded
6140    ///
6141    /// # Arguments
6142    ///
6143    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6144    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
6145        let mut query = self.selection.select("filter");
6146        if let Some(exclude) = opts.exclude {
6147            query = query.arg("exclude", exclude);
6148        }
6149        if let Some(include) = opts.include {
6150            query = query.arg("include", include);
6151        }
6152        if let Some(gitignore) = opts.gitignore {
6153            query = query.arg("gitignore", gitignore);
6154        }
6155        Directory {
6156            proc: self.proc.clone(),
6157            selection: query,
6158            graphql_client: self.graphql_client.clone(),
6159        }
6160    }
6161    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
6162    ///
6163    /// # Arguments
6164    ///
6165    /// * `name` - The name of the file or directory to search for
6166    /// * `start` - The path to start the search from
6167    pub async fn find_up(
6168        &self,
6169        name: impl Into<String>,
6170        start: impl Into<String>,
6171    ) -> Result<String, DaggerError> {
6172        let mut query = self.selection.select("findUp");
6173        query = query.arg("name", name.into());
6174        query = query.arg("start", start.into());
6175        query.execute(self.graphql_client.clone()).await
6176    }
6177    /// Returns a list of files and directories that matche the given pattern.
6178    ///
6179    /// # Arguments
6180    ///
6181    /// * `pattern` - Pattern to match (e.g., "*.md").
6182    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
6183        let mut query = self.selection.select("glob");
6184        query = query.arg("pattern", pattern.into());
6185        query.execute(self.graphql_client.clone()).await
6186    }
6187    /// A unique identifier for this Directory.
6188    pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
6189        let query = self.selection.select("id");
6190        query.execute(self.graphql_client.clone()).await
6191    }
6192    /// Returns the name of the directory.
6193    pub async fn name(&self) -> Result<String, DaggerError> {
6194        let query = self.selection.select("name");
6195        query.execute(self.graphql_client.clone()).await
6196    }
6197    /// Searches for content matching the given regular expression or literal string.
6198    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6199    ///
6200    /// # Arguments
6201    ///
6202    /// * `pattern` - The text to match.
6203    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6204    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
6205        let mut query = self.selection.select("search");
6206        query = query.arg("pattern", pattern.into());
6207        vec![SearchResult {
6208            proc: self.proc.clone(),
6209            selection: query,
6210            graphql_client: self.graphql_client.clone(),
6211        }]
6212    }
6213    /// Searches for content matching the given regular expression or literal string.
6214    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6215    ///
6216    /// # Arguments
6217    ///
6218    /// * `pattern` - The text to match.
6219    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6220    pub fn search_opts<'a>(
6221        &self,
6222        pattern: impl Into<String>,
6223        opts: DirectorySearchOpts<'a>,
6224    ) -> Vec<SearchResult> {
6225        let mut query = self.selection.select("search");
6226        query = query.arg("pattern", pattern.into());
6227        if let Some(paths) = opts.paths {
6228            query = query.arg("paths", paths);
6229        }
6230        if let Some(globs) = opts.globs {
6231            query = query.arg("globs", globs);
6232        }
6233        if let Some(literal) = opts.literal {
6234            query = query.arg("literal", literal);
6235        }
6236        if let Some(multiline) = opts.multiline {
6237            query = query.arg("multiline", multiline);
6238        }
6239        if let Some(dotall) = opts.dotall {
6240            query = query.arg("dotall", dotall);
6241        }
6242        if let Some(insensitive) = opts.insensitive {
6243            query = query.arg("insensitive", insensitive);
6244        }
6245        if let Some(skip_ignored) = opts.skip_ignored {
6246            query = query.arg("skipIgnored", skip_ignored);
6247        }
6248        if let Some(skip_hidden) = opts.skip_hidden {
6249            query = query.arg("skipHidden", skip_hidden);
6250        }
6251        if let Some(files_only) = opts.files_only {
6252            query = query.arg("filesOnly", files_only);
6253        }
6254        if let Some(limit) = opts.limit {
6255            query = query.arg("limit", limit);
6256        }
6257        vec![SearchResult {
6258            proc: self.proc.clone(),
6259            selection: query,
6260            graphql_client: self.graphql_client.clone(),
6261        }]
6262    }
6263    /// Return file status
6264    ///
6265    /// # Arguments
6266    ///
6267    /// * `path` - Path to stat (e.g., "/file.txt").
6268    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6269    pub fn stat(&self, path: impl Into<String>) -> Stat {
6270        let mut query = self.selection.select("stat");
6271        query = query.arg("path", path.into());
6272        Stat {
6273            proc: self.proc.clone(),
6274            selection: query,
6275            graphql_client: self.graphql_client.clone(),
6276        }
6277    }
6278    /// Return file status
6279    ///
6280    /// # Arguments
6281    ///
6282    /// * `path` - Path to stat (e.g., "/file.txt").
6283    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6284    pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
6285        let mut query = self.selection.select("stat");
6286        query = query.arg("path", path.into());
6287        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
6288            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
6289        }
6290        Stat {
6291            proc: self.proc.clone(),
6292            selection: query,
6293            graphql_client: self.graphql_client.clone(),
6294        }
6295    }
6296    /// Force evaluation in the engine.
6297    pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
6298        let query = self.selection.select("sync");
6299        query.execute(self.graphql_client.clone()).await
6300    }
6301    /// Opens an interactive terminal in new container with this directory mounted inside.
6302    ///
6303    /// # Arguments
6304    ///
6305    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6306    pub fn terminal(&self) -> Directory {
6307        let query = self.selection.select("terminal");
6308        Directory {
6309            proc: self.proc.clone(),
6310            selection: query,
6311            graphql_client: self.graphql_client.clone(),
6312        }
6313    }
6314    /// Opens an interactive terminal in new container with this directory mounted inside.
6315    ///
6316    /// # Arguments
6317    ///
6318    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6319    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
6320        let mut query = self.selection.select("terminal");
6321        if let Some(container) = opts.container {
6322            query = query.arg("container", container);
6323        }
6324        if let Some(cmd) = opts.cmd {
6325            query = query.arg("cmd", cmd);
6326        }
6327        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6328            query = query.arg(
6329                "experimentalPrivilegedNesting",
6330                experimental_privileged_nesting,
6331            );
6332        }
6333        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6334            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6335        }
6336        Directory {
6337            proc: self.proc.clone(),
6338            selection: query,
6339            graphql_client: self.graphql_client.clone(),
6340        }
6341    }
6342    /// Return a directory with changes from another directory applied to it.
6343    ///
6344    /// # Arguments
6345    ///
6346    /// * `changes` - Changes to apply to the directory
6347    pub fn with_changes(&self, changes: impl IntoID<ChangesetId>) -> Directory {
6348        let mut query = self.selection.select("withChanges");
6349        query = query.arg_lazy(
6350            "changes",
6351            Box::new(move || {
6352                let changes = changes.clone();
6353                Box::pin(async move { changes.into_id().await.unwrap().quote() })
6354            }),
6355        );
6356        Directory {
6357            proc: self.proc.clone(),
6358            selection: query,
6359            graphql_client: self.graphql_client.clone(),
6360        }
6361    }
6362    /// Return a snapshot with a directory added
6363    ///
6364    /// # Arguments
6365    ///
6366    /// * `path` - Location of the written directory (e.g., "/src/").
6367    /// * `source` - Identifier of the directory to copy.
6368    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6369    pub fn with_directory(
6370        &self,
6371        path: impl Into<String>,
6372        source: impl IntoID<DirectoryId>,
6373    ) -> Directory {
6374        let mut query = self.selection.select("withDirectory");
6375        query = query.arg("path", path.into());
6376        query = query.arg_lazy(
6377            "source",
6378            Box::new(move || {
6379                let source = source.clone();
6380                Box::pin(async move { source.into_id().await.unwrap().quote() })
6381            }),
6382        );
6383        Directory {
6384            proc: self.proc.clone(),
6385            selection: query,
6386            graphql_client: self.graphql_client.clone(),
6387        }
6388    }
6389    /// Return a snapshot with a directory added
6390    ///
6391    /// # Arguments
6392    ///
6393    /// * `path` - Location of the written directory (e.g., "/src/").
6394    /// * `source` - Identifier of the directory to copy.
6395    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6396    pub fn with_directory_opts<'a>(
6397        &self,
6398        path: impl Into<String>,
6399        source: impl IntoID<DirectoryId>,
6400        opts: DirectoryWithDirectoryOpts<'a>,
6401    ) -> Directory {
6402        let mut query = self.selection.select("withDirectory");
6403        query = query.arg("path", path.into());
6404        query = query.arg_lazy(
6405            "source",
6406            Box::new(move || {
6407                let source = source.clone();
6408                Box::pin(async move { source.into_id().await.unwrap().quote() })
6409            }),
6410        );
6411        if let Some(exclude) = opts.exclude {
6412            query = query.arg("exclude", exclude);
6413        }
6414        if let Some(include) = opts.include {
6415            query = query.arg("include", include);
6416        }
6417        if let Some(gitignore) = opts.gitignore {
6418            query = query.arg("gitignore", gitignore);
6419        }
6420        if let Some(owner) = opts.owner {
6421            query = query.arg("owner", owner);
6422        }
6423        Directory {
6424            proc: self.proc.clone(),
6425            selection: query,
6426            graphql_client: self.graphql_client.clone(),
6427        }
6428    }
6429    /// Raise an error.
6430    ///
6431    /// # Arguments
6432    ///
6433    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
6434    pub fn with_error(&self, err: impl Into<String>) -> Directory {
6435        let mut query = self.selection.select("withError");
6436        query = query.arg("err", err.into());
6437        Directory {
6438            proc: self.proc.clone(),
6439            selection: query,
6440            graphql_client: self.graphql_client.clone(),
6441        }
6442    }
6443    /// Retrieves this directory plus the contents of the given file copied to the given path.
6444    ///
6445    /// # Arguments
6446    ///
6447    /// * `path` - Location of the copied file (e.g., "/file.txt").
6448    /// * `source` - Identifier of the file to copy.
6449    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6450    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
6451        let mut query = self.selection.select("withFile");
6452        query = query.arg("path", path.into());
6453        query = query.arg_lazy(
6454            "source",
6455            Box::new(move || {
6456                let source = source.clone();
6457                Box::pin(async move { source.into_id().await.unwrap().quote() })
6458            }),
6459        );
6460        Directory {
6461            proc: self.proc.clone(),
6462            selection: query,
6463            graphql_client: self.graphql_client.clone(),
6464        }
6465    }
6466    /// Retrieves this directory plus the contents of the given file copied to the given path.
6467    ///
6468    /// # Arguments
6469    ///
6470    /// * `path` - Location of the copied file (e.g., "/file.txt").
6471    /// * `source` - Identifier of the file to copy.
6472    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6473    pub fn with_file_opts<'a>(
6474        &self,
6475        path: impl Into<String>,
6476        source: impl IntoID<FileId>,
6477        opts: DirectoryWithFileOpts<'a>,
6478    ) -> Directory {
6479        let mut query = self.selection.select("withFile");
6480        query = query.arg("path", path.into());
6481        query = query.arg_lazy(
6482            "source",
6483            Box::new(move || {
6484                let source = source.clone();
6485                Box::pin(async move { source.into_id().await.unwrap().quote() })
6486            }),
6487        );
6488        if let Some(permissions) = opts.permissions {
6489            query = query.arg("permissions", permissions);
6490        }
6491        if let Some(owner) = opts.owner {
6492            query = query.arg("owner", owner);
6493        }
6494        Directory {
6495            proc: self.proc.clone(),
6496            selection: query,
6497            graphql_client: self.graphql_client.clone(),
6498        }
6499    }
6500    /// Retrieves this directory plus the contents of the given files copied to the given path.
6501    ///
6502    /// # Arguments
6503    ///
6504    /// * `path` - Location where copied files should be placed (e.g., "/src").
6505    /// * `sources` - Identifiers of the files to copy.
6506    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6507    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
6508        let mut query = self.selection.select("withFiles");
6509        query = query.arg("path", path.into());
6510        query = query.arg("sources", sources);
6511        Directory {
6512            proc: self.proc.clone(),
6513            selection: query,
6514            graphql_client: self.graphql_client.clone(),
6515        }
6516    }
6517    /// Retrieves this directory plus the contents of the given files copied to the given path.
6518    ///
6519    /// # Arguments
6520    ///
6521    /// * `path` - Location where copied files should be placed (e.g., "/src").
6522    /// * `sources` - Identifiers of the files to copy.
6523    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6524    pub fn with_files_opts(
6525        &self,
6526        path: impl Into<String>,
6527        sources: Vec<FileId>,
6528        opts: DirectoryWithFilesOpts,
6529    ) -> Directory {
6530        let mut query = self.selection.select("withFiles");
6531        query = query.arg("path", path.into());
6532        query = query.arg("sources", sources);
6533        if let Some(permissions) = opts.permissions {
6534            query = query.arg("permissions", permissions);
6535        }
6536        Directory {
6537            proc: self.proc.clone(),
6538            selection: query,
6539            graphql_client: self.graphql_client.clone(),
6540        }
6541    }
6542    /// Retrieves this directory plus a new directory created at the given path.
6543    ///
6544    /// # Arguments
6545    ///
6546    /// * `path` - Location of the directory created (e.g., "/logs").
6547    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6548    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
6549        let mut query = self.selection.select("withNewDirectory");
6550        query = query.arg("path", path.into());
6551        Directory {
6552            proc: self.proc.clone(),
6553            selection: query,
6554            graphql_client: self.graphql_client.clone(),
6555        }
6556    }
6557    /// Retrieves this directory plus a new directory created at the given path.
6558    ///
6559    /// # Arguments
6560    ///
6561    /// * `path` - Location of the directory created (e.g., "/logs").
6562    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6563    pub fn with_new_directory_opts(
6564        &self,
6565        path: impl Into<String>,
6566        opts: DirectoryWithNewDirectoryOpts,
6567    ) -> Directory {
6568        let mut query = self.selection.select("withNewDirectory");
6569        query = query.arg("path", path.into());
6570        if let Some(permissions) = opts.permissions {
6571            query = query.arg("permissions", permissions);
6572        }
6573        Directory {
6574            proc: self.proc.clone(),
6575            selection: query,
6576            graphql_client: self.graphql_client.clone(),
6577        }
6578    }
6579    /// Return a snapshot with a new file added
6580    ///
6581    /// # Arguments
6582    ///
6583    /// * `path` - Path of the new file. Example: "foo/bar.txt"
6584    /// * `contents` - Contents of the new file. Example: "Hello world!"
6585    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6586    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
6587        let mut query = self.selection.select("withNewFile");
6588        query = query.arg("path", path.into());
6589        query = query.arg("contents", contents.into());
6590        Directory {
6591            proc: self.proc.clone(),
6592            selection: query,
6593            graphql_client: self.graphql_client.clone(),
6594        }
6595    }
6596    /// Return a snapshot with a new file added
6597    ///
6598    /// # Arguments
6599    ///
6600    /// * `path` - Path of the new file. Example: "foo/bar.txt"
6601    /// * `contents` - Contents of the new file. Example: "Hello world!"
6602    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6603    pub fn with_new_file_opts(
6604        &self,
6605        path: impl Into<String>,
6606        contents: impl Into<String>,
6607        opts: DirectoryWithNewFileOpts,
6608    ) -> Directory {
6609        let mut query = self.selection.select("withNewFile");
6610        query = query.arg("path", path.into());
6611        query = query.arg("contents", contents.into());
6612        if let Some(permissions) = opts.permissions {
6613            query = query.arg("permissions", permissions);
6614        }
6615        Directory {
6616            proc: self.proc.clone(),
6617            selection: query,
6618            graphql_client: self.graphql_client.clone(),
6619        }
6620    }
6621    /// Retrieves this directory with the given Git-compatible patch applied.
6622    ///
6623    /// # Arguments
6624    ///
6625    /// * `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").
6626    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
6627        let mut query = self.selection.select("withPatch");
6628        query = query.arg("patch", patch.into());
6629        Directory {
6630            proc: self.proc.clone(),
6631            selection: query,
6632            graphql_client: self.graphql_client.clone(),
6633        }
6634    }
6635    /// Retrieves this directory with the given Git-compatible patch file applied.
6636    ///
6637    /// # Arguments
6638    ///
6639    /// * `patch` - File containing the patch to apply
6640    pub fn with_patch_file(&self, patch: impl IntoID<FileId>) -> Directory {
6641        let mut query = self.selection.select("withPatchFile");
6642        query = query.arg_lazy(
6643            "patch",
6644            Box::new(move || {
6645                let patch = patch.clone();
6646                Box::pin(async move { patch.into_id().await.unwrap().quote() })
6647            }),
6648        );
6649        Directory {
6650            proc: self.proc.clone(),
6651            selection: query,
6652            graphql_client: self.graphql_client.clone(),
6653        }
6654    }
6655    /// Return a snapshot with a symlink
6656    ///
6657    /// # Arguments
6658    ///
6659    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
6660    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
6661    pub fn with_symlink(
6662        &self,
6663        target: impl Into<String>,
6664        link_name: impl Into<String>,
6665    ) -> Directory {
6666        let mut query = self.selection.select("withSymlink");
6667        query = query.arg("target", target.into());
6668        query = query.arg("linkName", link_name.into());
6669        Directory {
6670            proc: self.proc.clone(),
6671            selection: query,
6672            graphql_client: self.graphql_client.clone(),
6673        }
6674    }
6675    /// Retrieves this directory with all file/dir timestamps set to the given time.
6676    ///
6677    /// # Arguments
6678    ///
6679    /// * `timestamp` - Timestamp to set dir/files in.
6680    ///
6681    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
6682    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
6683        let mut query = self.selection.select("withTimestamps");
6684        query = query.arg("timestamp", timestamp);
6685        Directory {
6686            proc: self.proc.clone(),
6687            selection: query,
6688            graphql_client: self.graphql_client.clone(),
6689        }
6690    }
6691    /// Return a snapshot with a subdirectory removed
6692    ///
6693    /// # Arguments
6694    ///
6695    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
6696    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
6697        let mut query = self.selection.select("withoutDirectory");
6698        query = query.arg("path", path.into());
6699        Directory {
6700            proc: self.proc.clone(),
6701            selection: query,
6702            graphql_client: self.graphql_client.clone(),
6703        }
6704    }
6705    /// Return a snapshot with a file removed
6706    ///
6707    /// # Arguments
6708    ///
6709    /// * `path` - Path of the file to remove (e.g., "/file.txt").
6710    pub fn without_file(&self, path: impl Into<String>) -> Directory {
6711        let mut query = self.selection.select("withoutFile");
6712        query = query.arg("path", path.into());
6713        Directory {
6714            proc: self.proc.clone(),
6715            selection: query,
6716            graphql_client: self.graphql_client.clone(),
6717        }
6718    }
6719    /// Return a snapshot with files removed
6720    ///
6721    /// # Arguments
6722    ///
6723    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
6724    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
6725        let mut query = self.selection.select("withoutFiles");
6726        query = query.arg(
6727            "paths",
6728            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
6729        );
6730        Directory {
6731            proc: self.proc.clone(),
6732            selection: query,
6733            graphql_client: self.graphql_client.clone(),
6734        }
6735    }
6736}
6737#[derive(Clone)]
6738pub struct Engine {
6739    pub proc: Option<Arc<DaggerSessionProc>>,
6740    pub selection: Selection,
6741    pub graphql_client: DynGraphQLClient,
6742}
6743impl Engine {
6744    /// The list of connected client IDs
6745    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
6746        let query = self.selection.select("clients");
6747        query.execute(self.graphql_client.clone()).await
6748    }
6749    /// A unique identifier for this Engine.
6750    pub async fn id(&self) -> Result<EngineId, DaggerError> {
6751        let query = self.selection.select("id");
6752        query.execute(self.graphql_client.clone()).await
6753    }
6754    /// The local (on-disk) cache for the Dagger engine
6755    pub fn local_cache(&self) -> EngineCache {
6756        let query = self.selection.select("localCache");
6757        EngineCache {
6758            proc: self.proc.clone(),
6759            selection: query,
6760            graphql_client: self.graphql_client.clone(),
6761        }
6762    }
6763    /// The name of the engine instance.
6764    pub async fn name(&self) -> Result<String, DaggerError> {
6765        let query = self.selection.select("name");
6766        query.execute(self.graphql_client.clone()).await
6767    }
6768}
6769#[derive(Clone)]
6770pub struct EngineCache {
6771    pub proc: Option<Arc<DaggerSessionProc>>,
6772    pub selection: Selection,
6773    pub graphql_client: DynGraphQLClient,
6774}
6775#[derive(Builder, Debug, PartialEq)]
6776pub struct EngineCacheEntrySetOpts<'a> {
6777    #[builder(setter(into, strip_option), default)]
6778    pub key: Option<&'a str>,
6779}
6780#[derive(Builder, Debug, PartialEq)]
6781pub struct EngineCachePruneOpts<'a> {
6782    /// Override the maximum disk space to keep before pruning (e.g. "200GB" or "80%").
6783    #[builder(setter(into, strip_option), default)]
6784    pub max_used_space: Option<&'a str>,
6785    /// Override the minimum free disk space target during pruning (e.g. "20GB" or "20%").
6786    #[builder(setter(into, strip_option), default)]
6787    pub min_free_space: Option<&'a str>,
6788    /// Override the minimum disk space to retain during pruning (e.g. "500GB" or "10%").
6789    #[builder(setter(into, strip_option), default)]
6790    pub reserved_space: Option<&'a str>,
6791    /// Override the target disk space to keep after pruning (e.g. "200GB" or "50%").
6792    #[builder(setter(into, strip_option), default)]
6793    pub target_space: Option<&'a str>,
6794    /// Use the engine-wide default pruning policy if true, otherwise prune the whole cache of any releasable entries.
6795    #[builder(setter(into, strip_option), default)]
6796    pub use_default_policy: Option<bool>,
6797}
6798impl EngineCache {
6799    /// The current set of entries in the cache
6800    ///
6801    /// # Arguments
6802    ///
6803    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6804    pub fn entry_set(&self) -> EngineCacheEntrySet {
6805        let query = self.selection.select("entrySet");
6806        EngineCacheEntrySet {
6807            proc: self.proc.clone(),
6808            selection: query,
6809            graphql_client: self.graphql_client.clone(),
6810        }
6811    }
6812    /// The current set of entries in the cache
6813    ///
6814    /// # Arguments
6815    ///
6816    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6817    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
6818        let mut query = self.selection.select("entrySet");
6819        if let Some(key) = opts.key {
6820            query = query.arg("key", key);
6821        }
6822        EngineCacheEntrySet {
6823            proc: self.proc.clone(),
6824            selection: query,
6825            graphql_client: self.graphql_client.clone(),
6826        }
6827    }
6828    /// A unique identifier for this EngineCache.
6829    pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
6830        let query = self.selection.select("id");
6831        query.execute(self.graphql_client.clone()).await
6832    }
6833    /// The maximum bytes to keep in the cache without pruning.
6834    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
6835        let query = self.selection.select("maxUsedSpace");
6836        query.execute(self.graphql_client.clone()).await
6837    }
6838    /// The target amount of free disk space the garbage collector will attempt to leave.
6839    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
6840        let query = self.selection.select("minFreeSpace");
6841        query.execute(self.graphql_client.clone()).await
6842    }
6843    /// Prune the cache of releaseable entries
6844    ///
6845    /// # Arguments
6846    ///
6847    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6848    pub async fn prune(&self) -> Result<Void, DaggerError> {
6849        let query = self.selection.select("prune");
6850        query.execute(self.graphql_client.clone()).await
6851    }
6852    /// Prune the cache of releaseable entries
6853    ///
6854    /// # Arguments
6855    ///
6856    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6857    pub async fn prune_opts<'a>(
6858        &self,
6859        opts: EngineCachePruneOpts<'a>,
6860    ) -> Result<Void, DaggerError> {
6861        let mut query = self.selection.select("prune");
6862        if let Some(use_default_policy) = opts.use_default_policy {
6863            query = query.arg("useDefaultPolicy", use_default_policy);
6864        }
6865        if let Some(max_used_space) = opts.max_used_space {
6866            query = query.arg("maxUsedSpace", max_used_space);
6867        }
6868        if let Some(reserved_space) = opts.reserved_space {
6869            query = query.arg("reservedSpace", reserved_space);
6870        }
6871        if let Some(min_free_space) = opts.min_free_space {
6872            query = query.arg("minFreeSpace", min_free_space);
6873        }
6874        if let Some(target_space) = opts.target_space {
6875            query = query.arg("targetSpace", target_space);
6876        }
6877        query.execute(self.graphql_client.clone()).await
6878    }
6879    /// The minimum amount of disk space this policy is guaranteed to retain.
6880    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
6881        let query = self.selection.select("reservedSpace");
6882        query.execute(self.graphql_client.clone()).await
6883    }
6884    /// The target number of bytes to keep when pruning.
6885    pub async fn target_space(&self) -> Result<isize, DaggerError> {
6886        let query = self.selection.select("targetSpace");
6887        query.execute(self.graphql_client.clone()).await
6888    }
6889}
6890#[derive(Clone)]
6891pub struct EngineCacheEntry {
6892    pub proc: Option<Arc<DaggerSessionProc>>,
6893    pub selection: Selection,
6894    pub graphql_client: DynGraphQLClient,
6895}
6896impl EngineCacheEntry {
6897    /// Whether the cache entry is actively being used.
6898    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
6899        let query = self.selection.select("activelyUsed");
6900        query.execute(self.graphql_client.clone()).await
6901    }
6902    /// The time the cache entry was created, in Unix nanoseconds.
6903    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
6904        let query = self.selection.select("createdTimeUnixNano");
6905        query.execute(self.graphql_client.clone()).await
6906    }
6907    /// The description of the cache entry.
6908    pub async fn description(&self) -> Result<String, DaggerError> {
6909        let query = self.selection.select("description");
6910        query.execute(self.graphql_client.clone()).await
6911    }
6912    /// The disk space used by the cache entry.
6913    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6914        let query = self.selection.select("diskSpaceBytes");
6915        query.execute(self.graphql_client.clone()).await
6916    }
6917    /// A unique identifier for this EngineCacheEntry.
6918    pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
6919        let query = self.selection.select("id");
6920        query.execute(self.graphql_client.clone()).await
6921    }
6922    /// The most recent time the cache entry was used, in Unix nanoseconds.
6923    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
6924        let query = self.selection.select("mostRecentUseTimeUnixNano");
6925        query.execute(self.graphql_client.clone()).await
6926    }
6927    /// The type of the cache record (e.g. regular, internal, frontend, source.local, source.git.checkout, exec.cachemount).
6928    pub async fn record_type(&self) -> Result<String, DaggerError> {
6929        let query = self.selection.select("recordType");
6930        query.execute(self.graphql_client.clone()).await
6931    }
6932}
6933#[derive(Clone)]
6934pub struct EngineCacheEntrySet {
6935    pub proc: Option<Arc<DaggerSessionProc>>,
6936    pub selection: Selection,
6937    pub graphql_client: DynGraphQLClient,
6938}
6939impl EngineCacheEntrySet {
6940    /// The total disk space used by the cache entries in this set.
6941    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6942        let query = self.selection.select("diskSpaceBytes");
6943        query.execute(self.graphql_client.clone()).await
6944    }
6945    /// The list of individual cache entries in the set
6946    pub fn entries(&self) -> Vec<EngineCacheEntry> {
6947        let query = self.selection.select("entries");
6948        vec![EngineCacheEntry {
6949            proc: self.proc.clone(),
6950            selection: query,
6951            graphql_client: self.graphql_client.clone(),
6952        }]
6953    }
6954    /// The number of cache entries in this set.
6955    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6956        let query = self.selection.select("entryCount");
6957        query.execute(self.graphql_client.clone()).await
6958    }
6959    /// A unique identifier for this EngineCacheEntrySet.
6960    pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
6961        let query = self.selection.select("id");
6962        query.execute(self.graphql_client.clone()).await
6963    }
6964}
6965#[derive(Clone)]
6966pub struct EnumTypeDef {
6967    pub proc: Option<Arc<DaggerSessionProc>>,
6968    pub selection: Selection,
6969    pub graphql_client: DynGraphQLClient,
6970}
6971impl EnumTypeDef {
6972    /// A doc string for the enum, if any.
6973    pub async fn description(&self) -> Result<String, DaggerError> {
6974        let query = self.selection.select("description");
6975        query.execute(self.graphql_client.clone()).await
6976    }
6977    /// A unique identifier for this EnumTypeDef.
6978    pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
6979        let query = self.selection.select("id");
6980        query.execute(self.graphql_client.clone()).await
6981    }
6982    /// The members of the enum.
6983    pub fn members(&self) -> Vec<EnumValueTypeDef> {
6984        let query = self.selection.select("members");
6985        vec![EnumValueTypeDef {
6986            proc: self.proc.clone(),
6987            selection: query,
6988            graphql_client: self.graphql_client.clone(),
6989        }]
6990    }
6991    /// The name of the enum.
6992    pub async fn name(&self) -> Result<String, DaggerError> {
6993        let query = self.selection.select("name");
6994        query.execute(self.graphql_client.clone()).await
6995    }
6996    /// The location of this enum declaration.
6997    pub fn source_map(&self) -> SourceMap {
6998        let query = self.selection.select("sourceMap");
6999        SourceMap {
7000            proc: self.proc.clone(),
7001            selection: query,
7002            graphql_client: self.graphql_client.clone(),
7003        }
7004    }
7005    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
7006    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
7007        let query = self.selection.select("sourceModuleName");
7008        query.execute(self.graphql_client.clone()).await
7009    }
7010    pub fn values(&self) -> Vec<EnumValueTypeDef> {
7011        let query = self.selection.select("values");
7012        vec![EnumValueTypeDef {
7013            proc: self.proc.clone(),
7014            selection: query,
7015            graphql_client: self.graphql_client.clone(),
7016        }]
7017    }
7018}
7019#[derive(Clone)]
7020pub struct EnumValueTypeDef {
7021    pub proc: Option<Arc<DaggerSessionProc>>,
7022    pub selection: Selection,
7023    pub graphql_client: DynGraphQLClient,
7024}
7025impl EnumValueTypeDef {
7026    /// The reason this enum member is deprecated, if any.
7027    pub async fn deprecated(&self) -> Result<String, DaggerError> {
7028        let query = self.selection.select("deprecated");
7029        query.execute(self.graphql_client.clone()).await
7030    }
7031    /// A doc string for the enum member, if any.
7032    pub async fn description(&self) -> Result<String, DaggerError> {
7033        let query = self.selection.select("description");
7034        query.execute(self.graphql_client.clone()).await
7035    }
7036    /// A unique identifier for this EnumValueTypeDef.
7037    pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
7038        let query = self.selection.select("id");
7039        query.execute(self.graphql_client.clone()).await
7040    }
7041    /// The name of the enum member.
7042    pub async fn name(&self) -> Result<String, DaggerError> {
7043        let query = self.selection.select("name");
7044        query.execute(self.graphql_client.clone()).await
7045    }
7046    /// The location of this enum member declaration.
7047    pub fn source_map(&self) -> SourceMap {
7048        let query = self.selection.select("sourceMap");
7049        SourceMap {
7050            proc: self.proc.clone(),
7051            selection: query,
7052            graphql_client: self.graphql_client.clone(),
7053        }
7054    }
7055    /// The value of the enum member
7056    pub async fn value(&self) -> Result<String, DaggerError> {
7057        let query = self.selection.select("value");
7058        query.execute(self.graphql_client.clone()).await
7059    }
7060}
7061#[derive(Clone)]
7062pub struct Env {
7063    pub proc: Option<Arc<DaggerSessionProc>>,
7064    pub selection: Selection,
7065    pub graphql_client: DynGraphQLClient,
7066}
7067#[derive(Builder, Debug, PartialEq)]
7068pub struct EnvChecksOpts<'a> {
7069    /// Only include checks matching the specified patterns
7070    #[builder(setter(into, strip_option), default)]
7071    pub include: Option<Vec<&'a str>>,
7072}
7073impl Env {
7074    /// Return the check with the given name from the installed modules. Must match exactly one check.
7075    ///
7076    /// # Arguments
7077    ///
7078    /// * `name` - The name of the check to retrieve
7079    pub fn check(&self, name: impl Into<String>) -> Check {
7080        let mut query = self.selection.select("check");
7081        query = query.arg("name", name.into());
7082        Check {
7083            proc: self.proc.clone(),
7084            selection: query,
7085            graphql_client: self.graphql_client.clone(),
7086        }
7087    }
7088    /// Return all checks defined by the installed modules
7089    ///
7090    /// # Arguments
7091    ///
7092    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7093    pub fn checks(&self) -> CheckGroup {
7094        let query = self.selection.select("checks");
7095        CheckGroup {
7096            proc: self.proc.clone(),
7097            selection: query,
7098            graphql_client: self.graphql_client.clone(),
7099        }
7100    }
7101    /// Return all checks defined by the installed modules
7102    ///
7103    /// # Arguments
7104    ///
7105    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7106    pub fn checks_opts<'a>(&self, opts: EnvChecksOpts<'a>) -> CheckGroup {
7107        let mut query = self.selection.select("checks");
7108        if let Some(include) = opts.include {
7109            query = query.arg("include", include);
7110        }
7111        CheckGroup {
7112            proc: self.proc.clone(),
7113            selection: query,
7114            graphql_client: self.graphql_client.clone(),
7115        }
7116    }
7117    /// A unique identifier for this Env.
7118    pub async fn id(&self) -> Result<EnvId, DaggerError> {
7119        let query = self.selection.select("id");
7120        query.execute(self.graphql_client.clone()).await
7121    }
7122    /// Retrieves an input binding by name
7123    pub fn input(&self, name: impl Into<String>) -> Binding {
7124        let mut query = self.selection.select("input");
7125        query = query.arg("name", name.into());
7126        Binding {
7127            proc: self.proc.clone(),
7128            selection: query,
7129            graphql_client: self.graphql_client.clone(),
7130        }
7131    }
7132    /// Returns all input bindings provided to the environment
7133    pub fn inputs(&self) -> Vec<Binding> {
7134        let query = self.selection.select("inputs");
7135        vec![Binding {
7136            proc: self.proc.clone(),
7137            selection: query,
7138            graphql_client: self.graphql_client.clone(),
7139        }]
7140    }
7141    /// Retrieves an output binding by name
7142    pub fn output(&self, name: impl Into<String>) -> Binding {
7143        let mut query = self.selection.select("output");
7144        query = query.arg("name", name.into());
7145        Binding {
7146            proc: self.proc.clone(),
7147            selection: query,
7148            graphql_client: self.graphql_client.clone(),
7149        }
7150    }
7151    /// Returns all declared output bindings for the environment
7152    pub fn outputs(&self) -> Vec<Binding> {
7153        let query = self.selection.select("outputs");
7154        vec![Binding {
7155            proc: self.proc.clone(),
7156            selection: query,
7157            graphql_client: self.graphql_client.clone(),
7158        }]
7159    }
7160    /// Create or update a binding of type Address in the environment
7161    ///
7162    /// # Arguments
7163    ///
7164    /// * `name` - The name of the binding
7165    /// * `value` - The Address value to assign to the binding
7166    /// * `description` - The purpose of the input
7167    pub fn with_address_input(
7168        &self,
7169        name: impl Into<String>,
7170        value: impl IntoID<AddressId>,
7171        description: impl Into<String>,
7172    ) -> Env {
7173        let mut query = self.selection.select("withAddressInput");
7174        query = query.arg("name", name.into());
7175        query = query.arg_lazy(
7176            "value",
7177            Box::new(move || {
7178                let value = value.clone();
7179                Box::pin(async move { value.into_id().await.unwrap().quote() })
7180            }),
7181        );
7182        query = query.arg("description", description.into());
7183        Env {
7184            proc: self.proc.clone(),
7185            selection: query,
7186            graphql_client: self.graphql_client.clone(),
7187        }
7188    }
7189    /// Declare a desired Address output to be assigned in the environment
7190    ///
7191    /// # Arguments
7192    ///
7193    /// * `name` - The name of the binding
7194    /// * `description` - A description of the desired value of the binding
7195    pub fn with_address_output(
7196        &self,
7197        name: impl Into<String>,
7198        description: impl Into<String>,
7199    ) -> Env {
7200        let mut query = self.selection.select("withAddressOutput");
7201        query = query.arg("name", name.into());
7202        query = query.arg("description", description.into());
7203        Env {
7204            proc: self.proc.clone(),
7205            selection: query,
7206            graphql_client: self.graphql_client.clone(),
7207        }
7208    }
7209    /// Create or update a binding of type CacheVolume in the environment
7210    ///
7211    /// # Arguments
7212    ///
7213    /// * `name` - The name of the binding
7214    /// * `value` - The CacheVolume value to assign to the binding
7215    /// * `description` - The purpose of the input
7216    pub fn with_cache_volume_input(
7217        &self,
7218        name: impl Into<String>,
7219        value: impl IntoID<CacheVolumeId>,
7220        description: impl Into<String>,
7221    ) -> Env {
7222        let mut query = self.selection.select("withCacheVolumeInput");
7223        query = query.arg("name", name.into());
7224        query = query.arg_lazy(
7225            "value",
7226            Box::new(move || {
7227                let value = value.clone();
7228                Box::pin(async move { value.into_id().await.unwrap().quote() })
7229            }),
7230        );
7231        query = query.arg("description", description.into());
7232        Env {
7233            proc: self.proc.clone(),
7234            selection: query,
7235            graphql_client: self.graphql_client.clone(),
7236        }
7237    }
7238    /// Declare a desired CacheVolume output to be assigned in the environment
7239    ///
7240    /// # Arguments
7241    ///
7242    /// * `name` - The name of the binding
7243    /// * `description` - A description of the desired value of the binding
7244    pub fn with_cache_volume_output(
7245        &self,
7246        name: impl Into<String>,
7247        description: impl Into<String>,
7248    ) -> Env {
7249        let mut query = self.selection.select("withCacheVolumeOutput");
7250        query = query.arg("name", name.into());
7251        query = query.arg("description", description.into());
7252        Env {
7253            proc: self.proc.clone(),
7254            selection: query,
7255            graphql_client: self.graphql_client.clone(),
7256        }
7257    }
7258    /// Create or update a binding of type Changeset in the environment
7259    ///
7260    /// # Arguments
7261    ///
7262    /// * `name` - The name of the binding
7263    /// * `value` - The Changeset value to assign to the binding
7264    /// * `description` - The purpose of the input
7265    pub fn with_changeset_input(
7266        &self,
7267        name: impl Into<String>,
7268        value: impl IntoID<ChangesetId>,
7269        description: impl Into<String>,
7270    ) -> Env {
7271        let mut query = self.selection.select("withChangesetInput");
7272        query = query.arg("name", name.into());
7273        query = query.arg_lazy(
7274            "value",
7275            Box::new(move || {
7276                let value = value.clone();
7277                Box::pin(async move { value.into_id().await.unwrap().quote() })
7278            }),
7279        );
7280        query = query.arg("description", description.into());
7281        Env {
7282            proc: self.proc.clone(),
7283            selection: query,
7284            graphql_client: self.graphql_client.clone(),
7285        }
7286    }
7287    /// Declare a desired Changeset output to be assigned in the environment
7288    ///
7289    /// # Arguments
7290    ///
7291    /// * `name` - The name of the binding
7292    /// * `description` - A description of the desired value of the binding
7293    pub fn with_changeset_output(
7294        &self,
7295        name: impl Into<String>,
7296        description: impl Into<String>,
7297    ) -> Env {
7298        let mut query = self.selection.select("withChangesetOutput");
7299        query = query.arg("name", name.into());
7300        query = query.arg("description", description.into());
7301        Env {
7302            proc: self.proc.clone(),
7303            selection: query,
7304            graphql_client: self.graphql_client.clone(),
7305        }
7306    }
7307    /// Create or update a binding of type CheckGroup in the environment
7308    ///
7309    /// # Arguments
7310    ///
7311    /// * `name` - The name of the binding
7312    /// * `value` - The CheckGroup value to assign to the binding
7313    /// * `description` - The purpose of the input
7314    pub fn with_check_group_input(
7315        &self,
7316        name: impl Into<String>,
7317        value: impl IntoID<CheckGroupId>,
7318        description: impl Into<String>,
7319    ) -> Env {
7320        let mut query = self.selection.select("withCheckGroupInput");
7321        query = query.arg("name", name.into());
7322        query = query.arg_lazy(
7323            "value",
7324            Box::new(move || {
7325                let value = value.clone();
7326                Box::pin(async move { value.into_id().await.unwrap().quote() })
7327            }),
7328        );
7329        query = query.arg("description", description.into());
7330        Env {
7331            proc: self.proc.clone(),
7332            selection: query,
7333            graphql_client: self.graphql_client.clone(),
7334        }
7335    }
7336    /// Declare a desired CheckGroup output to be assigned in the environment
7337    ///
7338    /// # Arguments
7339    ///
7340    /// * `name` - The name of the binding
7341    /// * `description` - A description of the desired value of the binding
7342    pub fn with_check_group_output(
7343        &self,
7344        name: impl Into<String>,
7345        description: impl Into<String>,
7346    ) -> Env {
7347        let mut query = self.selection.select("withCheckGroupOutput");
7348        query = query.arg("name", name.into());
7349        query = query.arg("description", description.into());
7350        Env {
7351            proc: self.proc.clone(),
7352            selection: query,
7353            graphql_client: self.graphql_client.clone(),
7354        }
7355    }
7356    /// Create or update a binding of type Check in the environment
7357    ///
7358    /// # Arguments
7359    ///
7360    /// * `name` - The name of the binding
7361    /// * `value` - The Check value to assign to the binding
7362    /// * `description` - The purpose of the input
7363    pub fn with_check_input(
7364        &self,
7365        name: impl Into<String>,
7366        value: impl IntoID<CheckId>,
7367        description: impl Into<String>,
7368    ) -> Env {
7369        let mut query = self.selection.select("withCheckInput");
7370        query = query.arg("name", name.into());
7371        query = query.arg_lazy(
7372            "value",
7373            Box::new(move || {
7374                let value = value.clone();
7375                Box::pin(async move { value.into_id().await.unwrap().quote() })
7376            }),
7377        );
7378        query = query.arg("description", description.into());
7379        Env {
7380            proc: self.proc.clone(),
7381            selection: query,
7382            graphql_client: self.graphql_client.clone(),
7383        }
7384    }
7385    /// Declare a desired Check output to be assigned in the environment
7386    ///
7387    /// # Arguments
7388    ///
7389    /// * `name` - The name of the binding
7390    /// * `description` - A description of the desired value of the binding
7391    pub fn with_check_output(
7392        &self,
7393        name: impl Into<String>,
7394        description: impl Into<String>,
7395    ) -> Env {
7396        let mut query = self.selection.select("withCheckOutput");
7397        query = query.arg("name", name.into());
7398        query = query.arg("description", description.into());
7399        Env {
7400            proc: self.proc.clone(),
7401            selection: query,
7402            graphql_client: self.graphql_client.clone(),
7403        }
7404    }
7405    /// Create or update a binding of type Cloud in the environment
7406    ///
7407    /// # Arguments
7408    ///
7409    /// * `name` - The name of the binding
7410    /// * `value` - The Cloud value to assign to the binding
7411    /// * `description` - The purpose of the input
7412    pub fn with_cloud_input(
7413        &self,
7414        name: impl Into<String>,
7415        value: impl IntoID<CloudId>,
7416        description: impl Into<String>,
7417    ) -> Env {
7418        let mut query = self.selection.select("withCloudInput");
7419        query = query.arg("name", name.into());
7420        query = query.arg_lazy(
7421            "value",
7422            Box::new(move || {
7423                let value = value.clone();
7424                Box::pin(async move { value.into_id().await.unwrap().quote() })
7425            }),
7426        );
7427        query = query.arg("description", description.into());
7428        Env {
7429            proc: self.proc.clone(),
7430            selection: query,
7431            graphql_client: self.graphql_client.clone(),
7432        }
7433    }
7434    /// Declare a desired Cloud output to be assigned in the environment
7435    ///
7436    /// # Arguments
7437    ///
7438    /// * `name` - The name of the binding
7439    /// * `description` - A description of the desired value of the binding
7440    pub fn with_cloud_output(
7441        &self,
7442        name: impl Into<String>,
7443        description: impl Into<String>,
7444    ) -> Env {
7445        let mut query = self.selection.select("withCloudOutput");
7446        query = query.arg("name", name.into());
7447        query = query.arg("description", description.into());
7448        Env {
7449            proc: self.proc.clone(),
7450            selection: query,
7451            graphql_client: self.graphql_client.clone(),
7452        }
7453    }
7454    /// Create or update a binding of type Container in the environment
7455    ///
7456    /// # Arguments
7457    ///
7458    /// * `name` - The name of the binding
7459    /// * `value` - The Container value to assign to the binding
7460    /// * `description` - The purpose of the input
7461    pub fn with_container_input(
7462        &self,
7463        name: impl Into<String>,
7464        value: impl IntoID<ContainerId>,
7465        description: impl Into<String>,
7466    ) -> Env {
7467        let mut query = self.selection.select("withContainerInput");
7468        query = query.arg("name", name.into());
7469        query = query.arg_lazy(
7470            "value",
7471            Box::new(move || {
7472                let value = value.clone();
7473                Box::pin(async move { value.into_id().await.unwrap().quote() })
7474            }),
7475        );
7476        query = query.arg("description", description.into());
7477        Env {
7478            proc: self.proc.clone(),
7479            selection: query,
7480            graphql_client: self.graphql_client.clone(),
7481        }
7482    }
7483    /// Declare a desired Container output to be assigned in the environment
7484    ///
7485    /// # Arguments
7486    ///
7487    /// * `name` - The name of the binding
7488    /// * `description` - A description of the desired value of the binding
7489    pub fn with_container_output(
7490        &self,
7491        name: impl Into<String>,
7492        description: impl Into<String>,
7493    ) -> Env {
7494        let mut query = self.selection.select("withContainerOutput");
7495        query = query.arg("name", name.into());
7496        query = query.arg("description", description.into());
7497        Env {
7498            proc: self.proc.clone(),
7499            selection: query,
7500            graphql_client: self.graphql_client.clone(),
7501        }
7502    }
7503    /// Installs the current module into the environment, exposing its functions to the model
7504    /// Contextual path arguments will be populated using the environment's workspace.
7505    pub fn with_current_module(&self) -> Env {
7506        let query = self.selection.select("withCurrentModule");
7507        Env {
7508            proc: self.proc.clone(),
7509            selection: query,
7510            graphql_client: self.graphql_client.clone(),
7511        }
7512    }
7513    /// Create or update a binding of type Directory in the environment
7514    ///
7515    /// # Arguments
7516    ///
7517    /// * `name` - The name of the binding
7518    /// * `value` - The Directory value to assign to the binding
7519    /// * `description` - The purpose of the input
7520    pub fn with_directory_input(
7521        &self,
7522        name: impl Into<String>,
7523        value: impl IntoID<DirectoryId>,
7524        description: impl Into<String>,
7525    ) -> Env {
7526        let mut query = self.selection.select("withDirectoryInput");
7527        query = query.arg("name", name.into());
7528        query = query.arg_lazy(
7529            "value",
7530            Box::new(move || {
7531                let value = value.clone();
7532                Box::pin(async move { value.into_id().await.unwrap().quote() })
7533            }),
7534        );
7535        query = query.arg("description", description.into());
7536        Env {
7537            proc: self.proc.clone(),
7538            selection: query,
7539            graphql_client: self.graphql_client.clone(),
7540        }
7541    }
7542    /// Declare a desired Directory output to be assigned in the environment
7543    ///
7544    /// # Arguments
7545    ///
7546    /// * `name` - The name of the binding
7547    /// * `description` - A description of the desired value of the binding
7548    pub fn with_directory_output(
7549        &self,
7550        name: impl Into<String>,
7551        description: impl Into<String>,
7552    ) -> Env {
7553        let mut query = self.selection.select("withDirectoryOutput");
7554        query = query.arg("name", name.into());
7555        query = query.arg("description", description.into());
7556        Env {
7557            proc: self.proc.clone(),
7558            selection: query,
7559            graphql_client: self.graphql_client.clone(),
7560        }
7561    }
7562    /// Create or update a binding of type EnvFile in the environment
7563    ///
7564    /// # Arguments
7565    ///
7566    /// * `name` - The name of the binding
7567    /// * `value` - The EnvFile value to assign to the binding
7568    /// * `description` - The purpose of the input
7569    pub fn with_env_file_input(
7570        &self,
7571        name: impl Into<String>,
7572        value: impl IntoID<EnvFileId>,
7573        description: impl Into<String>,
7574    ) -> Env {
7575        let mut query = self.selection.select("withEnvFileInput");
7576        query = query.arg("name", name.into());
7577        query = query.arg_lazy(
7578            "value",
7579            Box::new(move || {
7580                let value = value.clone();
7581                Box::pin(async move { value.into_id().await.unwrap().quote() })
7582            }),
7583        );
7584        query = query.arg("description", description.into());
7585        Env {
7586            proc: self.proc.clone(),
7587            selection: query,
7588            graphql_client: self.graphql_client.clone(),
7589        }
7590    }
7591    /// Declare a desired EnvFile output to be assigned in the environment
7592    ///
7593    /// # Arguments
7594    ///
7595    /// * `name` - The name of the binding
7596    /// * `description` - A description of the desired value of the binding
7597    pub fn with_env_file_output(
7598        &self,
7599        name: impl Into<String>,
7600        description: impl Into<String>,
7601    ) -> Env {
7602        let mut query = self.selection.select("withEnvFileOutput");
7603        query = query.arg("name", name.into());
7604        query = query.arg("description", description.into());
7605        Env {
7606            proc: self.proc.clone(),
7607            selection: query,
7608            graphql_client: self.graphql_client.clone(),
7609        }
7610    }
7611    /// Create or update a binding of type Env in the environment
7612    ///
7613    /// # Arguments
7614    ///
7615    /// * `name` - The name of the binding
7616    /// * `value` - The Env value to assign to the binding
7617    /// * `description` - The purpose of the input
7618    pub fn with_env_input(
7619        &self,
7620        name: impl Into<String>,
7621        value: impl IntoID<EnvId>,
7622        description: impl Into<String>,
7623    ) -> Env {
7624        let mut query = self.selection.select("withEnvInput");
7625        query = query.arg("name", name.into());
7626        query = query.arg_lazy(
7627            "value",
7628            Box::new(move || {
7629                let value = value.clone();
7630                Box::pin(async move { value.into_id().await.unwrap().quote() })
7631            }),
7632        );
7633        query = query.arg("description", description.into());
7634        Env {
7635            proc: self.proc.clone(),
7636            selection: query,
7637            graphql_client: self.graphql_client.clone(),
7638        }
7639    }
7640    /// Declare a desired Env output to be assigned in the environment
7641    ///
7642    /// # Arguments
7643    ///
7644    /// * `name` - The name of the binding
7645    /// * `description` - A description of the desired value of the binding
7646    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7647        let mut query = self.selection.select("withEnvOutput");
7648        query = query.arg("name", name.into());
7649        query = query.arg("description", description.into());
7650        Env {
7651            proc: self.proc.clone(),
7652            selection: query,
7653            graphql_client: self.graphql_client.clone(),
7654        }
7655    }
7656    /// Create or update a binding of type File in the environment
7657    ///
7658    /// # Arguments
7659    ///
7660    /// * `name` - The name of the binding
7661    /// * `value` - The File value to assign to the binding
7662    /// * `description` - The purpose of the input
7663    pub fn with_file_input(
7664        &self,
7665        name: impl Into<String>,
7666        value: impl IntoID<FileId>,
7667        description: impl Into<String>,
7668    ) -> Env {
7669        let mut query = self.selection.select("withFileInput");
7670        query = query.arg("name", name.into());
7671        query = query.arg_lazy(
7672            "value",
7673            Box::new(move || {
7674                let value = value.clone();
7675                Box::pin(async move { value.into_id().await.unwrap().quote() })
7676            }),
7677        );
7678        query = query.arg("description", description.into());
7679        Env {
7680            proc: self.proc.clone(),
7681            selection: query,
7682            graphql_client: self.graphql_client.clone(),
7683        }
7684    }
7685    /// Declare a desired File output to be assigned in the environment
7686    ///
7687    /// # Arguments
7688    ///
7689    /// * `name` - The name of the binding
7690    /// * `description` - A description of the desired value of the binding
7691    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7692        let mut query = self.selection.select("withFileOutput");
7693        query = query.arg("name", name.into());
7694        query = query.arg("description", description.into());
7695        Env {
7696            proc: self.proc.clone(),
7697            selection: query,
7698            graphql_client: self.graphql_client.clone(),
7699        }
7700    }
7701    /// Create or update a binding of type GeneratorGroup in the environment
7702    ///
7703    /// # Arguments
7704    ///
7705    /// * `name` - The name of the binding
7706    /// * `value` - The GeneratorGroup value to assign to the binding
7707    /// * `description` - The purpose of the input
7708    pub fn with_generator_group_input(
7709        &self,
7710        name: impl Into<String>,
7711        value: impl IntoID<GeneratorGroupId>,
7712        description: impl Into<String>,
7713    ) -> Env {
7714        let mut query = self.selection.select("withGeneratorGroupInput");
7715        query = query.arg("name", name.into());
7716        query = query.arg_lazy(
7717            "value",
7718            Box::new(move || {
7719                let value = value.clone();
7720                Box::pin(async move { value.into_id().await.unwrap().quote() })
7721            }),
7722        );
7723        query = query.arg("description", description.into());
7724        Env {
7725            proc: self.proc.clone(),
7726            selection: query,
7727            graphql_client: self.graphql_client.clone(),
7728        }
7729    }
7730    /// Declare a desired GeneratorGroup output to be assigned in the environment
7731    ///
7732    /// # Arguments
7733    ///
7734    /// * `name` - The name of the binding
7735    /// * `description` - A description of the desired value of the binding
7736    pub fn with_generator_group_output(
7737        &self,
7738        name: impl Into<String>,
7739        description: impl Into<String>,
7740    ) -> Env {
7741        let mut query = self.selection.select("withGeneratorGroupOutput");
7742        query = query.arg("name", name.into());
7743        query = query.arg("description", description.into());
7744        Env {
7745            proc: self.proc.clone(),
7746            selection: query,
7747            graphql_client: self.graphql_client.clone(),
7748        }
7749    }
7750    /// Create or update a binding of type Generator in the environment
7751    ///
7752    /// # Arguments
7753    ///
7754    /// * `name` - The name of the binding
7755    /// * `value` - The Generator value to assign to the binding
7756    /// * `description` - The purpose of the input
7757    pub fn with_generator_input(
7758        &self,
7759        name: impl Into<String>,
7760        value: impl IntoID<GeneratorId>,
7761        description: impl Into<String>,
7762    ) -> Env {
7763        let mut query = self.selection.select("withGeneratorInput");
7764        query = query.arg("name", name.into());
7765        query = query.arg_lazy(
7766            "value",
7767            Box::new(move || {
7768                let value = value.clone();
7769                Box::pin(async move { value.into_id().await.unwrap().quote() })
7770            }),
7771        );
7772        query = query.arg("description", description.into());
7773        Env {
7774            proc: self.proc.clone(),
7775            selection: query,
7776            graphql_client: self.graphql_client.clone(),
7777        }
7778    }
7779    /// Declare a desired Generator output to be assigned in the environment
7780    ///
7781    /// # Arguments
7782    ///
7783    /// * `name` - The name of the binding
7784    /// * `description` - A description of the desired value of the binding
7785    pub fn with_generator_output(
7786        &self,
7787        name: impl Into<String>,
7788        description: impl Into<String>,
7789    ) -> Env {
7790        let mut query = self.selection.select("withGeneratorOutput");
7791        query = query.arg("name", name.into());
7792        query = query.arg("description", description.into());
7793        Env {
7794            proc: self.proc.clone(),
7795            selection: query,
7796            graphql_client: self.graphql_client.clone(),
7797        }
7798    }
7799    /// Create or update a binding of type GitRef in the environment
7800    ///
7801    /// # Arguments
7802    ///
7803    /// * `name` - The name of the binding
7804    /// * `value` - The GitRef value to assign to the binding
7805    /// * `description` - The purpose of the input
7806    pub fn with_git_ref_input(
7807        &self,
7808        name: impl Into<String>,
7809        value: impl IntoID<GitRefId>,
7810        description: impl Into<String>,
7811    ) -> Env {
7812        let mut query = self.selection.select("withGitRefInput");
7813        query = query.arg("name", name.into());
7814        query = query.arg_lazy(
7815            "value",
7816            Box::new(move || {
7817                let value = value.clone();
7818                Box::pin(async move { value.into_id().await.unwrap().quote() })
7819            }),
7820        );
7821        query = query.arg("description", description.into());
7822        Env {
7823            proc: self.proc.clone(),
7824            selection: query,
7825            graphql_client: self.graphql_client.clone(),
7826        }
7827    }
7828    /// Declare a desired GitRef output to be assigned in the environment
7829    ///
7830    /// # Arguments
7831    ///
7832    /// * `name` - The name of the binding
7833    /// * `description` - A description of the desired value of the binding
7834    pub fn with_git_ref_output(
7835        &self,
7836        name: impl Into<String>,
7837        description: impl Into<String>,
7838    ) -> Env {
7839        let mut query = self.selection.select("withGitRefOutput");
7840        query = query.arg("name", name.into());
7841        query = query.arg("description", description.into());
7842        Env {
7843            proc: self.proc.clone(),
7844            selection: query,
7845            graphql_client: self.graphql_client.clone(),
7846        }
7847    }
7848    /// Create or update a binding of type GitRepository in the environment
7849    ///
7850    /// # Arguments
7851    ///
7852    /// * `name` - The name of the binding
7853    /// * `value` - The GitRepository value to assign to the binding
7854    /// * `description` - The purpose of the input
7855    pub fn with_git_repository_input(
7856        &self,
7857        name: impl Into<String>,
7858        value: impl IntoID<GitRepositoryId>,
7859        description: impl Into<String>,
7860    ) -> Env {
7861        let mut query = self.selection.select("withGitRepositoryInput");
7862        query = query.arg("name", name.into());
7863        query = query.arg_lazy(
7864            "value",
7865            Box::new(move || {
7866                let value = value.clone();
7867                Box::pin(async move { value.into_id().await.unwrap().quote() })
7868            }),
7869        );
7870        query = query.arg("description", description.into());
7871        Env {
7872            proc: self.proc.clone(),
7873            selection: query,
7874            graphql_client: self.graphql_client.clone(),
7875        }
7876    }
7877    /// Declare a desired GitRepository output to be assigned in the environment
7878    ///
7879    /// # Arguments
7880    ///
7881    /// * `name` - The name of the binding
7882    /// * `description` - A description of the desired value of the binding
7883    pub fn with_git_repository_output(
7884        &self,
7885        name: impl Into<String>,
7886        description: impl Into<String>,
7887    ) -> Env {
7888        let mut query = self.selection.select("withGitRepositoryOutput");
7889        query = query.arg("name", name.into());
7890        query = query.arg("description", description.into());
7891        Env {
7892            proc: self.proc.clone(),
7893            selection: query,
7894            graphql_client: self.graphql_client.clone(),
7895        }
7896    }
7897    /// Create or update a binding of type JSONValue in the environment
7898    ///
7899    /// # Arguments
7900    ///
7901    /// * `name` - The name of the binding
7902    /// * `value` - The JSONValue value to assign to the binding
7903    /// * `description` - The purpose of the input
7904    pub fn with_json_value_input(
7905        &self,
7906        name: impl Into<String>,
7907        value: impl IntoID<JsonValueId>,
7908        description: impl Into<String>,
7909    ) -> Env {
7910        let mut query = self.selection.select("withJSONValueInput");
7911        query = query.arg("name", name.into());
7912        query = query.arg_lazy(
7913            "value",
7914            Box::new(move || {
7915                let value = value.clone();
7916                Box::pin(async move { value.into_id().await.unwrap().quote() })
7917            }),
7918        );
7919        query = query.arg("description", description.into());
7920        Env {
7921            proc: self.proc.clone(),
7922            selection: query,
7923            graphql_client: self.graphql_client.clone(),
7924        }
7925    }
7926    /// Declare a desired JSONValue output to be assigned in the environment
7927    ///
7928    /// # Arguments
7929    ///
7930    /// * `name` - The name of the binding
7931    /// * `description` - A description of the desired value of the binding
7932    pub fn with_json_value_output(
7933        &self,
7934        name: impl Into<String>,
7935        description: impl Into<String>,
7936    ) -> Env {
7937        let mut query = self.selection.select("withJSONValueOutput");
7938        query = query.arg("name", name.into());
7939        query = query.arg("description", description.into());
7940        Env {
7941            proc: self.proc.clone(),
7942            selection: query,
7943            graphql_client: self.graphql_client.clone(),
7944        }
7945    }
7946    /// Sets the main module for this environment (the project being worked on)
7947    /// Contextual path arguments will be populated using the environment's workspace.
7948    pub fn with_main_module(&self, module: impl IntoID<ModuleId>) -> Env {
7949        let mut query = self.selection.select("withMainModule");
7950        query = query.arg_lazy(
7951            "module",
7952            Box::new(move || {
7953                let module = module.clone();
7954                Box::pin(async move { module.into_id().await.unwrap().quote() })
7955            }),
7956        );
7957        Env {
7958            proc: self.proc.clone(),
7959            selection: query,
7960            graphql_client: self.graphql_client.clone(),
7961        }
7962    }
7963    /// Installs a module into the environment, exposing its functions to the model
7964    /// Contextual path arguments will be populated using the environment's workspace.
7965    pub fn with_module(&self, module: impl IntoID<ModuleId>) -> Env {
7966        let mut query = self.selection.select("withModule");
7967        query = query.arg_lazy(
7968            "module",
7969            Box::new(move || {
7970                let module = module.clone();
7971                Box::pin(async move { module.into_id().await.unwrap().quote() })
7972            }),
7973        );
7974        Env {
7975            proc: self.proc.clone(),
7976            selection: query,
7977            graphql_client: self.graphql_client.clone(),
7978        }
7979    }
7980    /// Create or update a binding of type ModuleConfigClient in the environment
7981    ///
7982    /// # Arguments
7983    ///
7984    /// * `name` - The name of the binding
7985    /// * `value` - The ModuleConfigClient value to assign to the binding
7986    /// * `description` - The purpose of the input
7987    pub fn with_module_config_client_input(
7988        &self,
7989        name: impl Into<String>,
7990        value: impl IntoID<ModuleConfigClientId>,
7991        description: impl Into<String>,
7992    ) -> Env {
7993        let mut query = self.selection.select("withModuleConfigClientInput");
7994        query = query.arg("name", name.into());
7995        query = query.arg_lazy(
7996            "value",
7997            Box::new(move || {
7998                let value = value.clone();
7999                Box::pin(async move { value.into_id().await.unwrap().quote() })
8000            }),
8001        );
8002        query = query.arg("description", description.into());
8003        Env {
8004            proc: self.proc.clone(),
8005            selection: query,
8006            graphql_client: self.graphql_client.clone(),
8007        }
8008    }
8009    /// Declare a desired ModuleConfigClient output to be assigned in the environment
8010    ///
8011    /// # Arguments
8012    ///
8013    /// * `name` - The name of the binding
8014    /// * `description` - A description of the desired value of the binding
8015    pub fn with_module_config_client_output(
8016        &self,
8017        name: impl Into<String>,
8018        description: impl Into<String>,
8019    ) -> Env {
8020        let mut query = self.selection.select("withModuleConfigClientOutput");
8021        query = query.arg("name", name.into());
8022        query = query.arg("description", description.into());
8023        Env {
8024            proc: self.proc.clone(),
8025            selection: query,
8026            graphql_client: self.graphql_client.clone(),
8027        }
8028    }
8029    /// Create or update a binding of type Module in the environment
8030    ///
8031    /// # Arguments
8032    ///
8033    /// * `name` - The name of the binding
8034    /// * `value` - The Module value to assign to the binding
8035    /// * `description` - The purpose of the input
8036    pub fn with_module_input(
8037        &self,
8038        name: impl Into<String>,
8039        value: impl IntoID<ModuleId>,
8040        description: impl Into<String>,
8041    ) -> Env {
8042        let mut query = self.selection.select("withModuleInput");
8043        query = query.arg("name", name.into());
8044        query = query.arg_lazy(
8045            "value",
8046            Box::new(move || {
8047                let value = value.clone();
8048                Box::pin(async move { value.into_id().await.unwrap().quote() })
8049            }),
8050        );
8051        query = query.arg("description", description.into());
8052        Env {
8053            proc: self.proc.clone(),
8054            selection: query,
8055            graphql_client: self.graphql_client.clone(),
8056        }
8057    }
8058    /// Declare a desired Module output to be assigned in the environment
8059    ///
8060    /// # Arguments
8061    ///
8062    /// * `name` - The name of the binding
8063    /// * `description` - A description of the desired value of the binding
8064    pub fn with_module_output(
8065        &self,
8066        name: impl Into<String>,
8067        description: impl Into<String>,
8068    ) -> Env {
8069        let mut query = self.selection.select("withModuleOutput");
8070        query = query.arg("name", name.into());
8071        query = query.arg("description", description.into());
8072        Env {
8073            proc: self.proc.clone(),
8074            selection: query,
8075            graphql_client: self.graphql_client.clone(),
8076        }
8077    }
8078    /// Create or update a binding of type ModuleSource in the environment
8079    ///
8080    /// # Arguments
8081    ///
8082    /// * `name` - The name of the binding
8083    /// * `value` - The ModuleSource value to assign to the binding
8084    /// * `description` - The purpose of the input
8085    pub fn with_module_source_input(
8086        &self,
8087        name: impl Into<String>,
8088        value: impl IntoID<ModuleSourceId>,
8089        description: impl Into<String>,
8090    ) -> Env {
8091        let mut query = self.selection.select("withModuleSourceInput");
8092        query = query.arg("name", name.into());
8093        query = query.arg_lazy(
8094            "value",
8095            Box::new(move || {
8096                let value = value.clone();
8097                Box::pin(async move { value.into_id().await.unwrap().quote() })
8098            }),
8099        );
8100        query = query.arg("description", description.into());
8101        Env {
8102            proc: self.proc.clone(),
8103            selection: query,
8104            graphql_client: self.graphql_client.clone(),
8105        }
8106    }
8107    /// Declare a desired ModuleSource output to be assigned in the environment
8108    ///
8109    /// # Arguments
8110    ///
8111    /// * `name` - The name of the binding
8112    /// * `description` - A description of the desired value of the binding
8113    pub fn with_module_source_output(
8114        &self,
8115        name: impl Into<String>,
8116        description: impl Into<String>,
8117    ) -> Env {
8118        let mut query = self.selection.select("withModuleSourceOutput");
8119        query = query.arg("name", name.into());
8120        query = query.arg("description", description.into());
8121        Env {
8122            proc: self.proc.clone(),
8123            selection: query,
8124            graphql_client: self.graphql_client.clone(),
8125        }
8126    }
8127    /// Create or update a binding of type SearchResult in the environment
8128    ///
8129    /// # Arguments
8130    ///
8131    /// * `name` - The name of the binding
8132    /// * `value` - The SearchResult value to assign to the binding
8133    /// * `description` - The purpose of the input
8134    pub fn with_search_result_input(
8135        &self,
8136        name: impl Into<String>,
8137        value: impl IntoID<SearchResultId>,
8138        description: impl Into<String>,
8139    ) -> Env {
8140        let mut query = self.selection.select("withSearchResultInput");
8141        query = query.arg("name", name.into());
8142        query = query.arg_lazy(
8143            "value",
8144            Box::new(move || {
8145                let value = value.clone();
8146                Box::pin(async move { value.into_id().await.unwrap().quote() })
8147            }),
8148        );
8149        query = query.arg("description", description.into());
8150        Env {
8151            proc: self.proc.clone(),
8152            selection: query,
8153            graphql_client: self.graphql_client.clone(),
8154        }
8155    }
8156    /// Declare a desired SearchResult output to be assigned in the environment
8157    ///
8158    /// # Arguments
8159    ///
8160    /// * `name` - The name of the binding
8161    /// * `description` - A description of the desired value of the binding
8162    pub fn with_search_result_output(
8163        &self,
8164        name: impl Into<String>,
8165        description: impl Into<String>,
8166    ) -> Env {
8167        let mut query = self.selection.select("withSearchResultOutput");
8168        query = query.arg("name", name.into());
8169        query = query.arg("description", description.into());
8170        Env {
8171            proc: self.proc.clone(),
8172            selection: query,
8173            graphql_client: self.graphql_client.clone(),
8174        }
8175    }
8176    /// Create or update a binding of type SearchSubmatch in the environment
8177    ///
8178    /// # Arguments
8179    ///
8180    /// * `name` - The name of the binding
8181    /// * `value` - The SearchSubmatch value to assign to the binding
8182    /// * `description` - The purpose of the input
8183    pub fn with_search_submatch_input(
8184        &self,
8185        name: impl Into<String>,
8186        value: impl IntoID<SearchSubmatchId>,
8187        description: impl Into<String>,
8188    ) -> Env {
8189        let mut query = self.selection.select("withSearchSubmatchInput");
8190        query = query.arg("name", name.into());
8191        query = query.arg_lazy(
8192            "value",
8193            Box::new(move || {
8194                let value = value.clone();
8195                Box::pin(async move { value.into_id().await.unwrap().quote() })
8196            }),
8197        );
8198        query = query.arg("description", description.into());
8199        Env {
8200            proc: self.proc.clone(),
8201            selection: query,
8202            graphql_client: self.graphql_client.clone(),
8203        }
8204    }
8205    /// Declare a desired SearchSubmatch output to be assigned in the environment
8206    ///
8207    /// # Arguments
8208    ///
8209    /// * `name` - The name of the binding
8210    /// * `description` - A description of the desired value of the binding
8211    pub fn with_search_submatch_output(
8212        &self,
8213        name: impl Into<String>,
8214        description: impl Into<String>,
8215    ) -> Env {
8216        let mut query = self.selection.select("withSearchSubmatchOutput");
8217        query = query.arg("name", name.into());
8218        query = query.arg("description", description.into());
8219        Env {
8220            proc: self.proc.clone(),
8221            selection: query,
8222            graphql_client: self.graphql_client.clone(),
8223        }
8224    }
8225    /// Create or update a binding of type Secret in the environment
8226    ///
8227    /// # Arguments
8228    ///
8229    /// * `name` - The name of the binding
8230    /// * `value` - The Secret value to assign to the binding
8231    /// * `description` - The purpose of the input
8232    pub fn with_secret_input(
8233        &self,
8234        name: impl Into<String>,
8235        value: impl IntoID<SecretId>,
8236        description: impl Into<String>,
8237    ) -> Env {
8238        let mut query = self.selection.select("withSecretInput");
8239        query = query.arg("name", name.into());
8240        query = query.arg_lazy(
8241            "value",
8242            Box::new(move || {
8243                let value = value.clone();
8244                Box::pin(async move { value.into_id().await.unwrap().quote() })
8245            }),
8246        );
8247        query = query.arg("description", description.into());
8248        Env {
8249            proc: self.proc.clone(),
8250            selection: query,
8251            graphql_client: self.graphql_client.clone(),
8252        }
8253    }
8254    /// Declare a desired Secret output to be assigned in the environment
8255    ///
8256    /// # Arguments
8257    ///
8258    /// * `name` - The name of the binding
8259    /// * `description` - A description of the desired value of the binding
8260    pub fn with_secret_output(
8261        &self,
8262        name: impl Into<String>,
8263        description: impl Into<String>,
8264    ) -> Env {
8265        let mut query = self.selection.select("withSecretOutput");
8266        query = query.arg("name", name.into());
8267        query = query.arg("description", description.into());
8268        Env {
8269            proc: self.proc.clone(),
8270            selection: query,
8271            graphql_client: self.graphql_client.clone(),
8272        }
8273    }
8274    /// Create or update a binding of type Service in the environment
8275    ///
8276    /// # Arguments
8277    ///
8278    /// * `name` - The name of the binding
8279    /// * `value` - The Service value to assign to the binding
8280    /// * `description` - The purpose of the input
8281    pub fn with_service_input(
8282        &self,
8283        name: impl Into<String>,
8284        value: impl IntoID<ServiceId>,
8285        description: impl Into<String>,
8286    ) -> Env {
8287        let mut query = self.selection.select("withServiceInput");
8288        query = query.arg("name", name.into());
8289        query = query.arg_lazy(
8290            "value",
8291            Box::new(move || {
8292                let value = value.clone();
8293                Box::pin(async move { value.into_id().await.unwrap().quote() })
8294            }),
8295        );
8296        query = query.arg("description", description.into());
8297        Env {
8298            proc: self.proc.clone(),
8299            selection: query,
8300            graphql_client: self.graphql_client.clone(),
8301        }
8302    }
8303    /// Declare a desired Service output to be assigned in the environment
8304    ///
8305    /// # Arguments
8306    ///
8307    /// * `name` - The name of the binding
8308    /// * `description` - A description of the desired value of the binding
8309    pub fn with_service_output(
8310        &self,
8311        name: impl Into<String>,
8312        description: impl Into<String>,
8313    ) -> Env {
8314        let mut query = self.selection.select("withServiceOutput");
8315        query = query.arg("name", name.into());
8316        query = query.arg("description", description.into());
8317        Env {
8318            proc: self.proc.clone(),
8319            selection: query,
8320            graphql_client: self.graphql_client.clone(),
8321        }
8322    }
8323    /// Create or update a binding of type Socket in the environment
8324    ///
8325    /// # Arguments
8326    ///
8327    /// * `name` - The name of the binding
8328    /// * `value` - The Socket value to assign to the binding
8329    /// * `description` - The purpose of the input
8330    pub fn with_socket_input(
8331        &self,
8332        name: impl Into<String>,
8333        value: impl IntoID<SocketId>,
8334        description: impl Into<String>,
8335    ) -> Env {
8336        let mut query = self.selection.select("withSocketInput");
8337        query = query.arg("name", name.into());
8338        query = query.arg_lazy(
8339            "value",
8340            Box::new(move || {
8341                let value = value.clone();
8342                Box::pin(async move { value.into_id().await.unwrap().quote() })
8343            }),
8344        );
8345        query = query.arg("description", description.into());
8346        Env {
8347            proc: self.proc.clone(),
8348            selection: query,
8349            graphql_client: self.graphql_client.clone(),
8350        }
8351    }
8352    /// Declare a desired Socket output to be assigned in the environment
8353    ///
8354    /// # Arguments
8355    ///
8356    /// * `name` - The name of the binding
8357    /// * `description` - A description of the desired value of the binding
8358    pub fn with_socket_output(
8359        &self,
8360        name: impl Into<String>,
8361        description: impl Into<String>,
8362    ) -> Env {
8363        let mut query = self.selection.select("withSocketOutput");
8364        query = query.arg("name", name.into());
8365        query = query.arg("description", description.into());
8366        Env {
8367            proc: self.proc.clone(),
8368            selection: query,
8369            graphql_client: self.graphql_client.clone(),
8370        }
8371    }
8372    /// Create or update a binding of type Stat in the environment
8373    ///
8374    /// # Arguments
8375    ///
8376    /// * `name` - The name of the binding
8377    /// * `value` - The Stat value to assign to the binding
8378    /// * `description` - The purpose of the input
8379    pub fn with_stat_input(
8380        &self,
8381        name: impl Into<String>,
8382        value: impl IntoID<StatId>,
8383        description: impl Into<String>,
8384    ) -> Env {
8385        let mut query = self.selection.select("withStatInput");
8386        query = query.arg("name", name.into());
8387        query = query.arg_lazy(
8388            "value",
8389            Box::new(move || {
8390                let value = value.clone();
8391                Box::pin(async move { value.into_id().await.unwrap().quote() })
8392            }),
8393        );
8394        query = query.arg("description", description.into());
8395        Env {
8396            proc: self.proc.clone(),
8397            selection: query,
8398            graphql_client: self.graphql_client.clone(),
8399        }
8400    }
8401    /// Declare a desired Stat output to be assigned in the environment
8402    ///
8403    /// # Arguments
8404    ///
8405    /// * `name` - The name of the binding
8406    /// * `description` - A description of the desired value of the binding
8407    pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
8408        let mut query = self.selection.select("withStatOutput");
8409        query = query.arg("name", name.into());
8410        query = query.arg("description", description.into());
8411        Env {
8412            proc: self.proc.clone(),
8413            selection: query,
8414            graphql_client: self.graphql_client.clone(),
8415        }
8416    }
8417    /// Provides a string input binding to the environment
8418    ///
8419    /// # Arguments
8420    ///
8421    /// * `name` - The name of the binding
8422    /// * `value` - The string value to assign to the binding
8423    /// * `description` - The description of the input
8424    pub fn with_string_input(
8425        &self,
8426        name: impl Into<String>,
8427        value: impl Into<String>,
8428        description: impl Into<String>,
8429    ) -> Env {
8430        let mut query = self.selection.select("withStringInput");
8431        query = query.arg("name", name.into());
8432        query = query.arg("value", value.into());
8433        query = query.arg("description", description.into());
8434        Env {
8435            proc: self.proc.clone(),
8436            selection: query,
8437            graphql_client: self.graphql_client.clone(),
8438        }
8439    }
8440    /// Declares a desired string output binding
8441    ///
8442    /// # Arguments
8443    ///
8444    /// * `name` - The name of the binding
8445    /// * `description` - The description of the output
8446    pub fn with_string_output(
8447        &self,
8448        name: impl Into<String>,
8449        description: impl Into<String>,
8450    ) -> Env {
8451        let mut query = self.selection.select("withStringOutput");
8452        query = query.arg("name", name.into());
8453        query = query.arg("description", description.into());
8454        Env {
8455            proc: self.proc.clone(),
8456            selection: query,
8457            graphql_client: self.graphql_client.clone(),
8458        }
8459    }
8460    /// Returns a new environment with the provided workspace
8461    ///
8462    /// # Arguments
8463    ///
8464    /// * `workspace` - The directory to set as the host filesystem
8465    pub fn with_workspace(&self, workspace: impl IntoID<DirectoryId>) -> Env {
8466        let mut query = self.selection.select("withWorkspace");
8467        query = query.arg_lazy(
8468            "workspace",
8469            Box::new(move || {
8470                let workspace = workspace.clone();
8471                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
8472            }),
8473        );
8474        Env {
8475            proc: self.proc.clone(),
8476            selection: query,
8477            graphql_client: self.graphql_client.clone(),
8478        }
8479    }
8480    /// Create or update a binding of type Workspace in the environment
8481    ///
8482    /// # Arguments
8483    ///
8484    /// * `name` - The name of the binding
8485    /// * `value` - The Workspace value to assign to the binding
8486    /// * `description` - The purpose of the input
8487    pub fn with_workspace_input(
8488        &self,
8489        name: impl Into<String>,
8490        value: impl IntoID<WorkspaceId>,
8491        description: impl Into<String>,
8492    ) -> Env {
8493        let mut query = self.selection.select("withWorkspaceInput");
8494        query = query.arg("name", name.into());
8495        query = query.arg_lazy(
8496            "value",
8497            Box::new(move || {
8498                let value = value.clone();
8499                Box::pin(async move { value.into_id().await.unwrap().quote() })
8500            }),
8501        );
8502        query = query.arg("description", description.into());
8503        Env {
8504            proc: self.proc.clone(),
8505            selection: query,
8506            graphql_client: self.graphql_client.clone(),
8507        }
8508    }
8509    /// Declare a desired Workspace output to be assigned in the environment
8510    ///
8511    /// # Arguments
8512    ///
8513    /// * `name` - The name of the binding
8514    /// * `description` - A description of the desired value of the binding
8515    pub fn with_workspace_output(
8516        &self,
8517        name: impl Into<String>,
8518        description: impl Into<String>,
8519    ) -> Env {
8520        let mut query = self.selection.select("withWorkspaceOutput");
8521        query = query.arg("name", name.into());
8522        query = query.arg("description", description.into());
8523        Env {
8524            proc: self.proc.clone(),
8525            selection: query,
8526            graphql_client: self.graphql_client.clone(),
8527        }
8528    }
8529    /// Returns a new environment without any outputs
8530    pub fn without_outputs(&self) -> Env {
8531        let query = self.selection.select("withoutOutputs");
8532        Env {
8533            proc: self.proc.clone(),
8534            selection: query,
8535            graphql_client: self.graphql_client.clone(),
8536        }
8537    }
8538    pub fn workspace(&self) -> Directory {
8539        let query = self.selection.select("workspace");
8540        Directory {
8541            proc: self.proc.clone(),
8542            selection: query,
8543            graphql_client: self.graphql_client.clone(),
8544        }
8545    }
8546}
8547#[derive(Clone)]
8548pub struct EnvFile {
8549    pub proc: Option<Arc<DaggerSessionProc>>,
8550    pub selection: Selection,
8551    pub graphql_client: DynGraphQLClient,
8552}
8553#[derive(Builder, Debug, PartialEq)]
8554pub struct EnvFileGetOpts {
8555    /// Return the value exactly as written to the file. No quote removal or variable expansion
8556    #[builder(setter(into, strip_option), default)]
8557    pub raw: Option<bool>,
8558}
8559#[derive(Builder, Debug, PartialEq)]
8560pub struct EnvFileVariablesOpts {
8561    /// Return values exactly as written to the file. No quote removal or variable expansion
8562    #[builder(setter(into, strip_option), default)]
8563    pub raw: Option<bool>,
8564}
8565impl EnvFile {
8566    /// Return as a file
8567    pub fn as_file(&self) -> File {
8568        let query = self.selection.select("asFile");
8569        File {
8570            proc: self.proc.clone(),
8571            selection: query,
8572            graphql_client: self.graphql_client.clone(),
8573        }
8574    }
8575    /// Check if a variable exists
8576    ///
8577    /// # Arguments
8578    ///
8579    /// * `name` - Variable name
8580    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8581        let mut query = self.selection.select("exists");
8582        query = query.arg("name", name.into());
8583        query.execute(self.graphql_client.clone()).await
8584    }
8585    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8586    ///
8587    /// # Arguments
8588    ///
8589    /// * `name` - Variable name
8590    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8591    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8592        let mut query = self.selection.select("get");
8593        query = query.arg("name", name.into());
8594        query.execute(self.graphql_client.clone()).await
8595    }
8596    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8597    ///
8598    /// # Arguments
8599    ///
8600    /// * `name` - Variable name
8601    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8602    pub async fn get_opts(
8603        &self,
8604        name: impl Into<String>,
8605        opts: EnvFileGetOpts,
8606    ) -> Result<String, DaggerError> {
8607        let mut query = self.selection.select("get");
8608        query = query.arg("name", name.into());
8609        if let Some(raw) = opts.raw {
8610            query = query.arg("raw", raw);
8611        }
8612        query.execute(self.graphql_client.clone()).await
8613    }
8614    /// A unique identifier for this EnvFile.
8615    pub async fn id(&self) -> Result<EnvFileId, DaggerError> {
8616        let query = self.selection.select("id");
8617        query.execute(self.graphql_client.clone()).await
8618    }
8619    /// Filters variables by prefix and removes the pref from keys. Variables without the prefix are excluded. For example, with the prefix "MY_APP_" and variables: MY_APP_TOKEN=topsecret MY_APP_NAME=hello FOO=bar the resulting environment will contain: TOKEN=topsecret NAME=hello
8620    ///
8621    /// # Arguments
8622    ///
8623    /// * `prefix` - The prefix to filter by
8624    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8625        let mut query = self.selection.select("namespace");
8626        query = query.arg("prefix", prefix.into());
8627        EnvFile {
8628            proc: self.proc.clone(),
8629            selection: query,
8630            graphql_client: self.graphql_client.clone(),
8631        }
8632    }
8633    /// Return all variables
8634    ///
8635    /// # Arguments
8636    ///
8637    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8638    pub fn variables(&self) -> Vec<EnvVariable> {
8639        let query = self.selection.select("variables");
8640        vec![EnvVariable {
8641            proc: self.proc.clone(),
8642            selection: query,
8643            graphql_client: self.graphql_client.clone(),
8644        }]
8645    }
8646    /// Return all variables
8647    ///
8648    /// # Arguments
8649    ///
8650    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8651    pub fn variables_opts(&self, opts: EnvFileVariablesOpts) -> Vec<EnvVariable> {
8652        let mut query = self.selection.select("variables");
8653        if let Some(raw) = opts.raw {
8654            query = query.arg("raw", raw);
8655        }
8656        vec![EnvVariable {
8657            proc: self.proc.clone(),
8658            selection: query,
8659            graphql_client: self.graphql_client.clone(),
8660        }]
8661    }
8662    /// Add a variable
8663    ///
8664    /// # Arguments
8665    ///
8666    /// * `name` - Variable name
8667    /// * `value` - Variable value
8668    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8669        let mut query = self.selection.select("withVariable");
8670        query = query.arg("name", name.into());
8671        query = query.arg("value", value.into());
8672        EnvFile {
8673            proc: self.proc.clone(),
8674            selection: query,
8675            graphql_client: self.graphql_client.clone(),
8676        }
8677    }
8678    /// Remove all occurrences of the named variable
8679    ///
8680    /// # Arguments
8681    ///
8682    /// * `name` - Variable name
8683    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8684        let mut query = self.selection.select("withoutVariable");
8685        query = query.arg("name", name.into());
8686        EnvFile {
8687            proc: self.proc.clone(),
8688            selection: query,
8689            graphql_client: self.graphql_client.clone(),
8690        }
8691    }
8692}
8693#[derive(Clone)]
8694pub struct EnvVariable {
8695    pub proc: Option<Arc<DaggerSessionProc>>,
8696    pub selection: Selection,
8697    pub graphql_client: DynGraphQLClient,
8698}
8699impl EnvVariable {
8700    /// A unique identifier for this EnvVariable.
8701    pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
8702        let query = self.selection.select("id");
8703        query.execute(self.graphql_client.clone()).await
8704    }
8705    /// The environment variable name.
8706    pub async fn name(&self) -> Result<String, DaggerError> {
8707        let query = self.selection.select("name");
8708        query.execute(self.graphql_client.clone()).await
8709    }
8710    /// The environment variable value.
8711    pub async fn value(&self) -> Result<String, DaggerError> {
8712        let query = self.selection.select("value");
8713        query.execute(self.graphql_client.clone()).await
8714    }
8715}
8716#[derive(Clone)]
8717pub struct Error {
8718    pub proc: Option<Arc<DaggerSessionProc>>,
8719    pub selection: Selection,
8720    pub graphql_client: DynGraphQLClient,
8721}
8722impl Error {
8723    /// A unique identifier for this Error.
8724    pub async fn id(&self) -> Result<ErrorId, DaggerError> {
8725        let query = self.selection.select("id");
8726        query.execute(self.graphql_client.clone()).await
8727    }
8728    /// A description of the error.
8729    pub async fn message(&self) -> Result<String, DaggerError> {
8730        let query = self.selection.select("message");
8731        query.execute(self.graphql_client.clone()).await
8732    }
8733    /// The extensions of the error.
8734    pub fn values(&self) -> Vec<ErrorValue> {
8735        let query = self.selection.select("values");
8736        vec![ErrorValue {
8737            proc: self.proc.clone(),
8738            selection: query,
8739            graphql_client: self.graphql_client.clone(),
8740        }]
8741    }
8742    /// Add a value to the error.
8743    ///
8744    /// # Arguments
8745    ///
8746    /// * `name` - The name of the value.
8747    /// * `value` - The value to store on the error.
8748    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8749        let mut query = self.selection.select("withValue");
8750        query = query.arg("name", name.into());
8751        query = query.arg("value", value);
8752        Error {
8753            proc: self.proc.clone(),
8754            selection: query,
8755            graphql_client: self.graphql_client.clone(),
8756        }
8757    }
8758}
8759#[derive(Clone)]
8760pub struct ErrorValue {
8761    pub proc: Option<Arc<DaggerSessionProc>>,
8762    pub selection: Selection,
8763    pub graphql_client: DynGraphQLClient,
8764}
8765impl ErrorValue {
8766    /// A unique identifier for this ErrorValue.
8767    pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
8768        let query = self.selection.select("id");
8769        query.execute(self.graphql_client.clone()).await
8770    }
8771    /// The name of the value.
8772    pub async fn name(&self) -> Result<String, DaggerError> {
8773        let query = self.selection.select("name");
8774        query.execute(self.graphql_client.clone()).await
8775    }
8776    /// The value.
8777    pub async fn value(&self) -> Result<Json, DaggerError> {
8778        let query = self.selection.select("value");
8779        query.execute(self.graphql_client.clone()).await
8780    }
8781}
8782#[derive(Clone)]
8783pub struct FieldTypeDef {
8784    pub proc: Option<Arc<DaggerSessionProc>>,
8785    pub selection: Selection,
8786    pub graphql_client: DynGraphQLClient,
8787}
8788impl FieldTypeDef {
8789    /// The reason this enum member is deprecated, if any.
8790    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8791        let query = self.selection.select("deprecated");
8792        query.execute(self.graphql_client.clone()).await
8793    }
8794    /// A doc string for the field, if any.
8795    pub async fn description(&self) -> Result<String, DaggerError> {
8796        let query = self.selection.select("description");
8797        query.execute(self.graphql_client.clone()).await
8798    }
8799    /// A unique identifier for this FieldTypeDef.
8800    pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
8801        let query = self.selection.select("id");
8802        query.execute(self.graphql_client.clone()).await
8803    }
8804    /// The name of the field in lowerCamelCase format.
8805    pub async fn name(&self) -> Result<String, DaggerError> {
8806        let query = self.selection.select("name");
8807        query.execute(self.graphql_client.clone()).await
8808    }
8809    /// The location of this field declaration.
8810    pub fn source_map(&self) -> SourceMap {
8811        let query = self.selection.select("sourceMap");
8812        SourceMap {
8813            proc: self.proc.clone(),
8814            selection: query,
8815            graphql_client: self.graphql_client.clone(),
8816        }
8817    }
8818    /// The type of the field.
8819    pub fn type_def(&self) -> TypeDef {
8820        let query = self.selection.select("typeDef");
8821        TypeDef {
8822            proc: self.proc.clone(),
8823            selection: query,
8824            graphql_client: self.graphql_client.clone(),
8825        }
8826    }
8827}
8828#[derive(Clone)]
8829pub struct File {
8830    pub proc: Option<Arc<DaggerSessionProc>>,
8831    pub selection: Selection,
8832    pub graphql_client: DynGraphQLClient,
8833}
8834#[derive(Builder, Debug, PartialEq)]
8835pub struct FileAsEnvFileOpts {
8836    /// Replace "${VAR}" or "$VAR" with the value of other vars
8837    #[builder(setter(into, strip_option), default)]
8838    pub expand: Option<bool>,
8839}
8840#[derive(Builder, Debug, PartialEq)]
8841pub struct FileContentsOpts {
8842    /// Maximum number of lines to read
8843    #[builder(setter(into, strip_option), default)]
8844    pub limit_lines: Option<isize>,
8845    /// Start reading after this line
8846    #[builder(setter(into, strip_option), default)]
8847    pub offset_lines: Option<isize>,
8848}
8849#[derive(Builder, Debug, PartialEq)]
8850pub struct FileDigestOpts {
8851    /// If true, exclude metadata from the digest.
8852    #[builder(setter(into, strip_option), default)]
8853    pub exclude_metadata: Option<bool>,
8854}
8855#[derive(Builder, Debug, PartialEq)]
8856pub struct FileExportOpts {
8857    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
8858    #[builder(setter(into, strip_option), default)]
8859    pub allow_parent_dir_path: Option<bool>,
8860}
8861#[derive(Builder, Debug, PartialEq)]
8862pub struct FileSearchOpts<'a> {
8863    /// Allow the . pattern to match newlines in multiline mode.
8864    #[builder(setter(into, strip_option), default)]
8865    pub dotall: Option<bool>,
8866    /// Only return matching files, not lines and content
8867    #[builder(setter(into, strip_option), default)]
8868    pub files_only: Option<bool>,
8869    #[builder(setter(into, strip_option), default)]
8870    pub globs: Option<Vec<&'a str>>,
8871    /// Enable case-insensitive matching.
8872    #[builder(setter(into, strip_option), default)]
8873    pub insensitive: Option<bool>,
8874    /// Limit the number of results to return
8875    #[builder(setter(into, strip_option), default)]
8876    pub limit: Option<isize>,
8877    /// Interpret the pattern as a literal string instead of a regular expression.
8878    #[builder(setter(into, strip_option), default)]
8879    pub literal: Option<bool>,
8880    /// Enable searching across multiple lines.
8881    #[builder(setter(into, strip_option), default)]
8882    pub multiline: Option<bool>,
8883    #[builder(setter(into, strip_option), default)]
8884    pub paths: Option<Vec<&'a str>>,
8885    /// Skip hidden files (files starting with .).
8886    #[builder(setter(into, strip_option), default)]
8887    pub skip_hidden: Option<bool>,
8888    /// Honor .gitignore, .ignore, and .rgignore files.
8889    #[builder(setter(into, strip_option), default)]
8890    pub skip_ignored: Option<bool>,
8891}
8892#[derive(Builder, Debug, PartialEq)]
8893pub struct FileWithReplacedOpts {
8894    /// Replace all occurrences of the pattern.
8895    #[builder(setter(into, strip_option), default)]
8896    pub all: Option<bool>,
8897    /// Replace the first match starting from the specified line.
8898    #[builder(setter(into, strip_option), default)]
8899    pub first_from: Option<isize>,
8900}
8901impl File {
8902    /// Parse as an env file
8903    ///
8904    /// # Arguments
8905    ///
8906    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8907    pub fn as_env_file(&self) -> EnvFile {
8908        let query = self.selection.select("asEnvFile");
8909        EnvFile {
8910            proc: self.proc.clone(),
8911            selection: query,
8912            graphql_client: self.graphql_client.clone(),
8913        }
8914    }
8915    /// Parse as an env file
8916    ///
8917    /// # Arguments
8918    ///
8919    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8920    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
8921        let mut query = self.selection.select("asEnvFile");
8922        if let Some(expand) = opts.expand {
8923            query = query.arg("expand", expand);
8924        }
8925        EnvFile {
8926            proc: self.proc.clone(),
8927            selection: query,
8928            graphql_client: self.graphql_client.clone(),
8929        }
8930    }
8931    /// Parse the file contents as JSON.
8932    pub fn as_json(&self) -> JsonValue {
8933        let query = self.selection.select("asJSON");
8934        JsonValue {
8935            proc: self.proc.clone(),
8936            selection: query,
8937            graphql_client: self.graphql_client.clone(),
8938        }
8939    }
8940    /// Change the owner of the file recursively.
8941    ///
8942    /// # Arguments
8943    ///
8944    /// * `owner` - A user:group to set for the file.
8945    ///
8946    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
8947    ///
8948    /// If the group is omitted, it defaults to the same as the user.
8949    pub fn chown(&self, owner: impl Into<String>) -> File {
8950        let mut query = self.selection.select("chown");
8951        query = query.arg("owner", owner.into());
8952        File {
8953            proc: self.proc.clone(),
8954            selection: query,
8955            graphql_client: self.graphql_client.clone(),
8956        }
8957    }
8958    /// Retrieves the contents of the file.
8959    ///
8960    /// # Arguments
8961    ///
8962    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8963    pub async fn contents(&self) -> Result<String, DaggerError> {
8964        let query = self.selection.select("contents");
8965        query.execute(self.graphql_client.clone()).await
8966    }
8967    /// Retrieves the contents of the file.
8968    ///
8969    /// # Arguments
8970    ///
8971    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8972    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
8973        let mut query = self.selection.select("contents");
8974        if let Some(offset_lines) = opts.offset_lines {
8975            query = query.arg("offsetLines", offset_lines);
8976        }
8977        if let Some(limit_lines) = opts.limit_lines {
8978            query = query.arg("limitLines", limit_lines);
8979        }
8980        query.execute(self.graphql_client.clone()).await
8981    }
8982    /// 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.
8983    ///
8984    /// # Arguments
8985    ///
8986    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8987    pub async fn digest(&self) -> Result<String, DaggerError> {
8988        let query = self.selection.select("digest");
8989        query.execute(self.graphql_client.clone()).await
8990    }
8991    /// 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.
8992    ///
8993    /// # Arguments
8994    ///
8995    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8996    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
8997        let mut query = self.selection.select("digest");
8998        if let Some(exclude_metadata) = opts.exclude_metadata {
8999            query = query.arg("excludeMetadata", exclude_metadata);
9000        }
9001        query.execute(self.graphql_client.clone()).await
9002    }
9003    /// Writes the file to a file path on the host.
9004    ///
9005    /// # Arguments
9006    ///
9007    /// * `path` - Location of the written directory (e.g., "output.txt").
9008    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9009    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
9010        let mut query = self.selection.select("export");
9011        query = query.arg("path", path.into());
9012        query.execute(self.graphql_client.clone()).await
9013    }
9014    /// Writes the file to a file path on the host.
9015    ///
9016    /// # Arguments
9017    ///
9018    /// * `path` - Location of the written directory (e.g., "output.txt").
9019    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9020    pub async fn export_opts(
9021        &self,
9022        path: impl Into<String>,
9023        opts: FileExportOpts,
9024    ) -> Result<String, DaggerError> {
9025        let mut query = self.selection.select("export");
9026        query = query.arg("path", path.into());
9027        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
9028            query = query.arg("allowParentDirPath", allow_parent_dir_path);
9029        }
9030        query.execute(self.graphql_client.clone()).await
9031    }
9032    /// A unique identifier for this File.
9033    pub async fn id(&self) -> Result<FileId, DaggerError> {
9034        let query = self.selection.select("id");
9035        query.execute(self.graphql_client.clone()).await
9036    }
9037    /// Retrieves the name of the file.
9038    pub async fn name(&self) -> Result<String, DaggerError> {
9039        let query = self.selection.select("name");
9040        query.execute(self.graphql_client.clone()).await
9041    }
9042    /// Searches for content matching the given regular expression or literal string.
9043    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
9044    ///
9045    /// # Arguments
9046    ///
9047    /// * `pattern` - The text to match.
9048    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9049    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
9050        let mut query = self.selection.select("search");
9051        query = query.arg("pattern", pattern.into());
9052        vec![SearchResult {
9053            proc: self.proc.clone(),
9054            selection: query,
9055            graphql_client: self.graphql_client.clone(),
9056        }]
9057    }
9058    /// Searches for content matching the given regular expression or literal string.
9059    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
9060    ///
9061    /// # Arguments
9062    ///
9063    /// * `pattern` - The text to match.
9064    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9065    pub fn search_opts<'a>(
9066        &self,
9067        pattern: impl Into<String>,
9068        opts: FileSearchOpts<'a>,
9069    ) -> Vec<SearchResult> {
9070        let mut query = self.selection.select("search");
9071        query = query.arg("pattern", pattern.into());
9072        if let Some(literal) = opts.literal {
9073            query = query.arg("literal", literal);
9074        }
9075        if let Some(multiline) = opts.multiline {
9076            query = query.arg("multiline", multiline);
9077        }
9078        if let Some(dotall) = opts.dotall {
9079            query = query.arg("dotall", dotall);
9080        }
9081        if let Some(insensitive) = opts.insensitive {
9082            query = query.arg("insensitive", insensitive);
9083        }
9084        if let Some(skip_ignored) = opts.skip_ignored {
9085            query = query.arg("skipIgnored", skip_ignored);
9086        }
9087        if let Some(skip_hidden) = opts.skip_hidden {
9088            query = query.arg("skipHidden", skip_hidden);
9089        }
9090        if let Some(files_only) = opts.files_only {
9091            query = query.arg("filesOnly", files_only);
9092        }
9093        if let Some(limit) = opts.limit {
9094            query = query.arg("limit", limit);
9095        }
9096        if let Some(paths) = opts.paths {
9097            query = query.arg("paths", paths);
9098        }
9099        if let Some(globs) = opts.globs {
9100            query = query.arg("globs", globs);
9101        }
9102        vec![SearchResult {
9103            proc: self.proc.clone(),
9104            selection: query,
9105            graphql_client: self.graphql_client.clone(),
9106        }]
9107    }
9108    /// Retrieves the size of the file, in bytes.
9109    pub async fn size(&self) -> Result<isize, DaggerError> {
9110        let query = self.selection.select("size");
9111        query.execute(self.graphql_client.clone()).await
9112    }
9113    /// Return file status
9114    pub fn stat(&self) -> Stat {
9115        let query = self.selection.select("stat");
9116        Stat {
9117            proc: self.proc.clone(),
9118            selection: query,
9119            graphql_client: self.graphql_client.clone(),
9120        }
9121    }
9122    /// Force evaluation in the engine.
9123    pub async fn sync(&self) -> Result<FileId, DaggerError> {
9124        let query = self.selection.select("sync");
9125        query.execute(self.graphql_client.clone()).await
9126    }
9127    /// Retrieves this file with its name set to the given name.
9128    ///
9129    /// # Arguments
9130    ///
9131    /// * `name` - Name to set file to.
9132    pub fn with_name(&self, name: impl Into<String>) -> File {
9133        let mut query = self.selection.select("withName");
9134        query = query.arg("name", name.into());
9135        File {
9136            proc: self.proc.clone(),
9137            selection: query,
9138            graphql_client: self.graphql_client.clone(),
9139        }
9140    }
9141    /// Retrieves the file with content replaced with the given text.
9142    /// If 'all' is true, all occurrences of the pattern will be replaced.
9143    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9144    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9145    /// If there are no matches for the pattern, this will error.
9146    ///
9147    /// # Arguments
9148    ///
9149    /// * `search` - The text to match.
9150    /// * `replacement` - The text to match.
9151    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9152    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
9153        let mut query = self.selection.select("withReplaced");
9154        query = query.arg("search", search.into());
9155        query = query.arg("replacement", replacement.into());
9156        File {
9157            proc: self.proc.clone(),
9158            selection: query,
9159            graphql_client: self.graphql_client.clone(),
9160        }
9161    }
9162    /// Retrieves the file with content replaced with the given text.
9163    /// If 'all' is true, all occurrences of the pattern will be replaced.
9164    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9165    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9166    /// If there are no matches for the pattern, this will error.
9167    ///
9168    /// # Arguments
9169    ///
9170    /// * `search` - The text to match.
9171    /// * `replacement` - The text to match.
9172    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9173    pub fn with_replaced_opts(
9174        &self,
9175        search: impl Into<String>,
9176        replacement: impl Into<String>,
9177        opts: FileWithReplacedOpts,
9178    ) -> File {
9179        let mut query = self.selection.select("withReplaced");
9180        query = query.arg("search", search.into());
9181        query = query.arg("replacement", replacement.into());
9182        if let Some(all) = opts.all {
9183            query = query.arg("all", all);
9184        }
9185        if let Some(first_from) = opts.first_from {
9186            query = query.arg("firstFrom", first_from);
9187        }
9188        File {
9189            proc: self.proc.clone(),
9190            selection: query,
9191            graphql_client: self.graphql_client.clone(),
9192        }
9193    }
9194    /// Retrieves this file with its created/modified timestamps set to the given time.
9195    ///
9196    /// # Arguments
9197    ///
9198    /// * `timestamp` - Timestamp to set dir/files in.
9199    ///
9200    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
9201    pub fn with_timestamps(&self, timestamp: isize) -> File {
9202        let mut query = self.selection.select("withTimestamps");
9203        query = query.arg("timestamp", timestamp);
9204        File {
9205            proc: self.proc.clone(),
9206            selection: query,
9207            graphql_client: self.graphql_client.clone(),
9208        }
9209    }
9210}
9211#[derive(Clone)]
9212pub struct Function {
9213    pub proc: Option<Arc<DaggerSessionProc>>,
9214    pub selection: Selection,
9215    pub graphql_client: DynGraphQLClient,
9216}
9217#[derive(Builder, Debug, PartialEq)]
9218pub struct FunctionWithArgOpts<'a> {
9219    #[builder(setter(into, strip_option), default)]
9220    pub default_address: Option<&'a str>,
9221    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
9222    #[builder(setter(into, strip_option), default)]
9223    pub default_path: Option<&'a str>,
9224    /// A default value to use for this argument if not explicitly set by the caller, if any
9225    #[builder(setter(into, strip_option), default)]
9226    pub default_value: Option<Json>,
9227    /// If deprecated, the reason or migration path.
9228    #[builder(setter(into, strip_option), default)]
9229    pub deprecated: Option<&'a str>,
9230    /// A doc string for the argument, if any
9231    #[builder(setter(into, strip_option), default)]
9232    pub description: Option<&'a str>,
9233    /// Patterns to ignore when loading the contextual argument value.
9234    #[builder(setter(into, strip_option), default)]
9235    pub ignore: Option<Vec<&'a str>>,
9236    /// The source map for the argument definition.
9237    #[builder(setter(into, strip_option), default)]
9238    pub source_map: Option<SourceMapId>,
9239}
9240#[derive(Builder, Debug, PartialEq)]
9241pub struct FunctionWithCachePolicyOpts<'a> {
9242    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
9243    #[builder(setter(into, strip_option), default)]
9244    pub time_to_live: Option<&'a str>,
9245}
9246#[derive(Builder, Debug, PartialEq)]
9247pub struct FunctionWithDeprecatedOpts<'a> {
9248    /// Reason or migration path describing the deprecation.
9249    #[builder(setter(into, strip_option), default)]
9250    pub reason: Option<&'a str>,
9251}
9252impl Function {
9253    /// Arguments accepted by the function, if any.
9254    pub fn args(&self) -> Vec<FunctionArg> {
9255        let query = self.selection.select("args");
9256        vec![FunctionArg {
9257            proc: self.proc.clone(),
9258            selection: query,
9259            graphql_client: self.graphql_client.clone(),
9260        }]
9261    }
9262    /// The reason this function is deprecated, if any.
9263    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9264        let query = self.selection.select("deprecated");
9265        query.execute(self.graphql_client.clone()).await
9266    }
9267    /// A doc string for the function, if any.
9268    pub async fn description(&self) -> Result<String, DaggerError> {
9269        let query = self.selection.select("description");
9270        query.execute(self.graphql_client.clone()).await
9271    }
9272    /// A unique identifier for this Function.
9273    pub async fn id(&self) -> Result<FunctionId, DaggerError> {
9274        let query = self.selection.select("id");
9275        query.execute(self.graphql_client.clone()).await
9276    }
9277    /// The name of the function.
9278    pub async fn name(&self) -> Result<String, DaggerError> {
9279        let query = self.selection.select("name");
9280        query.execute(self.graphql_client.clone()).await
9281    }
9282    /// The type returned by the function.
9283    pub fn return_type(&self) -> TypeDef {
9284        let query = self.selection.select("returnType");
9285        TypeDef {
9286            proc: self.proc.clone(),
9287            selection: query,
9288            graphql_client: self.graphql_client.clone(),
9289        }
9290    }
9291    /// The location of this function declaration.
9292    pub fn source_map(&self) -> SourceMap {
9293        let query = self.selection.select("sourceMap");
9294        SourceMap {
9295            proc: self.proc.clone(),
9296            selection: query,
9297            graphql_client: self.graphql_client.clone(),
9298        }
9299    }
9300    /// Returns the function with the provided argument
9301    ///
9302    /// # Arguments
9303    ///
9304    /// * `name` - The name of the argument
9305    /// * `type_def` - The type of the argument
9306    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9307    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
9308        let mut query = self.selection.select("withArg");
9309        query = query.arg("name", name.into());
9310        query = query.arg_lazy(
9311            "typeDef",
9312            Box::new(move || {
9313                let type_def = type_def.clone();
9314                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9315            }),
9316        );
9317        Function {
9318            proc: self.proc.clone(),
9319            selection: query,
9320            graphql_client: self.graphql_client.clone(),
9321        }
9322    }
9323    /// Returns the function with the provided argument
9324    ///
9325    /// # Arguments
9326    ///
9327    /// * `name` - The name of the argument
9328    /// * `type_def` - The type of the argument
9329    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9330    pub fn with_arg_opts<'a>(
9331        &self,
9332        name: impl Into<String>,
9333        type_def: impl IntoID<TypeDefId>,
9334        opts: FunctionWithArgOpts<'a>,
9335    ) -> Function {
9336        let mut query = self.selection.select("withArg");
9337        query = query.arg("name", name.into());
9338        query = query.arg_lazy(
9339            "typeDef",
9340            Box::new(move || {
9341                let type_def = type_def.clone();
9342                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9343            }),
9344        );
9345        if let Some(description) = opts.description {
9346            query = query.arg("description", description);
9347        }
9348        if let Some(default_value) = opts.default_value {
9349            query = query.arg("defaultValue", default_value);
9350        }
9351        if let Some(default_path) = opts.default_path {
9352            query = query.arg("defaultPath", default_path);
9353        }
9354        if let Some(ignore) = opts.ignore {
9355            query = query.arg("ignore", ignore);
9356        }
9357        if let Some(source_map) = opts.source_map {
9358            query = query.arg("sourceMap", source_map);
9359        }
9360        if let Some(deprecated) = opts.deprecated {
9361            query = query.arg("deprecated", deprecated);
9362        }
9363        if let Some(default_address) = opts.default_address {
9364            query = query.arg("defaultAddress", default_address);
9365        }
9366        Function {
9367            proc: self.proc.clone(),
9368            selection: query,
9369            graphql_client: self.graphql_client.clone(),
9370        }
9371    }
9372    /// Returns the function updated to use the provided cache policy.
9373    ///
9374    /// # Arguments
9375    ///
9376    /// * `policy` - The cache policy to use.
9377    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9378    pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9379        let mut query = self.selection.select("withCachePolicy");
9380        query = query.arg("policy", policy);
9381        Function {
9382            proc: self.proc.clone(),
9383            selection: query,
9384            graphql_client: self.graphql_client.clone(),
9385        }
9386    }
9387    /// Returns the function updated to use the provided cache policy.
9388    ///
9389    /// # Arguments
9390    ///
9391    /// * `policy` - The cache policy to use.
9392    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9393    pub fn with_cache_policy_opts<'a>(
9394        &self,
9395        policy: FunctionCachePolicy,
9396        opts: FunctionWithCachePolicyOpts<'a>,
9397    ) -> Function {
9398        let mut query = self.selection.select("withCachePolicy");
9399        query = query.arg("policy", policy);
9400        if let Some(time_to_live) = opts.time_to_live {
9401            query = query.arg("timeToLive", time_to_live);
9402        }
9403        Function {
9404            proc: self.proc.clone(),
9405            selection: query,
9406            graphql_client: self.graphql_client.clone(),
9407        }
9408    }
9409    /// Returns the function with a flag indicating it's a check.
9410    pub fn with_check(&self) -> Function {
9411        let query = self.selection.select("withCheck");
9412        Function {
9413            proc: self.proc.clone(),
9414            selection: query,
9415            graphql_client: self.graphql_client.clone(),
9416        }
9417    }
9418    /// Returns the function with the provided deprecation reason.
9419    ///
9420    /// # Arguments
9421    ///
9422    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9423    pub fn with_deprecated(&self) -> Function {
9424        let query = self.selection.select("withDeprecated");
9425        Function {
9426            proc: self.proc.clone(),
9427            selection: query,
9428            graphql_client: self.graphql_client.clone(),
9429        }
9430    }
9431    /// Returns the function with the provided deprecation reason.
9432    ///
9433    /// # Arguments
9434    ///
9435    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9436    pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9437        let mut query = self.selection.select("withDeprecated");
9438        if let Some(reason) = opts.reason {
9439            query = query.arg("reason", reason);
9440        }
9441        Function {
9442            proc: self.proc.clone(),
9443            selection: query,
9444            graphql_client: self.graphql_client.clone(),
9445        }
9446    }
9447    /// Returns the function with the given doc string.
9448    ///
9449    /// # Arguments
9450    ///
9451    /// * `description` - The doc string to set.
9452    pub fn with_description(&self, description: impl Into<String>) -> Function {
9453        let mut query = self.selection.select("withDescription");
9454        query = query.arg("description", description.into());
9455        Function {
9456            proc: self.proc.clone(),
9457            selection: query,
9458            graphql_client: self.graphql_client.clone(),
9459        }
9460    }
9461    /// Returns the function with a flag indicating it's a generator.
9462    pub fn with_generator(&self) -> Function {
9463        let query = self.selection.select("withGenerator");
9464        Function {
9465            proc: self.proc.clone(),
9466            selection: query,
9467            graphql_client: self.graphql_client.clone(),
9468        }
9469    }
9470    /// Returns the function with the given source map.
9471    ///
9472    /// # Arguments
9473    ///
9474    /// * `source_map` - The source map for the function definition.
9475    pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
9476        let mut query = self.selection.select("withSourceMap");
9477        query = query.arg_lazy(
9478            "sourceMap",
9479            Box::new(move || {
9480                let source_map = source_map.clone();
9481                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9482            }),
9483        );
9484        Function {
9485            proc: self.proc.clone(),
9486            selection: query,
9487            graphql_client: self.graphql_client.clone(),
9488        }
9489    }
9490}
9491#[derive(Clone)]
9492pub struct FunctionArg {
9493    pub proc: Option<Arc<DaggerSessionProc>>,
9494    pub selection: Selection,
9495    pub graphql_client: DynGraphQLClient,
9496}
9497impl FunctionArg {
9498    /// Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
9499    pub async fn default_address(&self) -> Result<String, DaggerError> {
9500        let query = self.selection.select("defaultAddress");
9501        query.execute(self.graphql_client.clone()).await
9502    }
9503    /// 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
9504    pub async fn default_path(&self) -> Result<String, DaggerError> {
9505        let query = self.selection.select("defaultPath");
9506        query.execute(self.graphql_client.clone()).await
9507    }
9508    /// A default value to use for this argument when not explicitly set by the caller, if any.
9509    pub async fn default_value(&self) -> Result<Json, DaggerError> {
9510        let query = self.selection.select("defaultValue");
9511        query.execute(self.graphql_client.clone()).await
9512    }
9513    /// The reason this function is deprecated, if any.
9514    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9515        let query = self.selection.select("deprecated");
9516        query.execute(self.graphql_client.clone()).await
9517    }
9518    /// A doc string for the argument, if any.
9519    pub async fn description(&self) -> Result<String, DaggerError> {
9520        let query = self.selection.select("description");
9521        query.execute(self.graphql_client.clone()).await
9522    }
9523    /// A unique identifier for this FunctionArg.
9524    pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
9525        let query = self.selection.select("id");
9526        query.execute(self.graphql_client.clone()).await
9527    }
9528    /// 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.
9529    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9530        let query = self.selection.select("ignore");
9531        query.execute(self.graphql_client.clone()).await
9532    }
9533    /// The name of the argument in lowerCamelCase format.
9534    pub async fn name(&self) -> Result<String, DaggerError> {
9535        let query = self.selection.select("name");
9536        query.execute(self.graphql_client.clone()).await
9537    }
9538    /// The location of this arg declaration.
9539    pub fn source_map(&self) -> SourceMap {
9540        let query = self.selection.select("sourceMap");
9541        SourceMap {
9542            proc: self.proc.clone(),
9543            selection: query,
9544            graphql_client: self.graphql_client.clone(),
9545        }
9546    }
9547    /// The type of the argument.
9548    pub fn type_def(&self) -> TypeDef {
9549        let query = self.selection.select("typeDef");
9550        TypeDef {
9551            proc: self.proc.clone(),
9552            selection: query,
9553            graphql_client: self.graphql_client.clone(),
9554        }
9555    }
9556}
9557#[derive(Clone)]
9558pub struct FunctionCall {
9559    pub proc: Option<Arc<DaggerSessionProc>>,
9560    pub selection: Selection,
9561    pub graphql_client: DynGraphQLClient,
9562}
9563impl FunctionCall {
9564    /// A unique identifier for this FunctionCall.
9565    pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
9566        let query = self.selection.select("id");
9567        query.execute(self.graphql_client.clone()).await
9568    }
9569    /// The argument values the function is being invoked with.
9570    pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
9571        let query = self.selection.select("inputArgs");
9572        vec![FunctionCallArgValue {
9573            proc: self.proc.clone(),
9574            selection: query,
9575            graphql_client: self.graphql_client.clone(),
9576        }]
9577    }
9578    /// The name of the function being called.
9579    pub async fn name(&self) -> Result<String, DaggerError> {
9580        let query = self.selection.select("name");
9581        query.execute(self.graphql_client.clone()).await
9582    }
9583    /// 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.
9584    pub async fn parent(&self) -> Result<Json, DaggerError> {
9585        let query = self.selection.select("parent");
9586        query.execute(self.graphql_client.clone()).await
9587    }
9588    /// 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.
9589    pub async fn parent_name(&self) -> Result<String, DaggerError> {
9590        let query = self.selection.select("parentName");
9591        query.execute(self.graphql_client.clone()).await
9592    }
9593    /// Return an error from the function.
9594    ///
9595    /// # Arguments
9596    ///
9597    /// * `error` - The error to return.
9598    pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
9599        let mut query = self.selection.select("returnError");
9600        query = query.arg_lazy(
9601            "error",
9602            Box::new(move || {
9603                let error = error.clone();
9604                Box::pin(async move { error.into_id().await.unwrap().quote() })
9605            }),
9606        );
9607        query.execute(self.graphql_client.clone()).await
9608    }
9609    /// Set the return value of the function call to the provided value.
9610    ///
9611    /// # Arguments
9612    ///
9613    /// * `value` - JSON serialization of the return value.
9614    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9615        let mut query = self.selection.select("returnValue");
9616        query = query.arg("value", value);
9617        query.execute(self.graphql_client.clone()).await
9618    }
9619}
9620#[derive(Clone)]
9621pub struct FunctionCallArgValue {
9622    pub proc: Option<Arc<DaggerSessionProc>>,
9623    pub selection: Selection,
9624    pub graphql_client: DynGraphQLClient,
9625}
9626impl FunctionCallArgValue {
9627    /// A unique identifier for this FunctionCallArgValue.
9628    pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
9629        let query = self.selection.select("id");
9630        query.execute(self.graphql_client.clone()).await
9631    }
9632    /// The name of the argument.
9633    pub async fn name(&self) -> Result<String, DaggerError> {
9634        let query = self.selection.select("name");
9635        query.execute(self.graphql_client.clone()).await
9636    }
9637    /// The value of the argument represented as a JSON serialized string.
9638    pub async fn value(&self) -> Result<Json, DaggerError> {
9639        let query = self.selection.select("value");
9640        query.execute(self.graphql_client.clone()).await
9641    }
9642}
9643#[derive(Clone)]
9644pub struct GeneratedCode {
9645    pub proc: Option<Arc<DaggerSessionProc>>,
9646    pub selection: Selection,
9647    pub graphql_client: DynGraphQLClient,
9648}
9649impl GeneratedCode {
9650    /// The directory containing the generated code.
9651    pub fn code(&self) -> Directory {
9652        let query = self.selection.select("code");
9653        Directory {
9654            proc: self.proc.clone(),
9655            selection: query,
9656            graphql_client: self.graphql_client.clone(),
9657        }
9658    }
9659    /// A unique identifier for this GeneratedCode.
9660    pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
9661        let query = self.selection.select("id");
9662        query.execute(self.graphql_client.clone()).await
9663    }
9664    /// List of paths to mark generated in version control (i.e. .gitattributes).
9665    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
9666        let query = self.selection.select("vcsGeneratedPaths");
9667        query.execute(self.graphql_client.clone()).await
9668    }
9669    /// List of paths to ignore in version control (i.e. .gitignore).
9670    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
9671        let query = self.selection.select("vcsIgnoredPaths");
9672        query.execute(self.graphql_client.clone()).await
9673    }
9674    /// Set the list of paths to mark generated in version control.
9675    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9676        let mut query = self.selection.select("withVCSGeneratedPaths");
9677        query = query.arg(
9678            "paths",
9679            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9680        );
9681        GeneratedCode {
9682            proc: self.proc.clone(),
9683            selection: query,
9684            graphql_client: self.graphql_client.clone(),
9685        }
9686    }
9687    /// Set the list of paths to ignore in version control.
9688    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9689        let mut query = self.selection.select("withVCSIgnoredPaths");
9690        query = query.arg(
9691            "paths",
9692            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9693        );
9694        GeneratedCode {
9695            proc: self.proc.clone(),
9696            selection: query,
9697            graphql_client: self.graphql_client.clone(),
9698        }
9699    }
9700}
9701#[derive(Clone)]
9702pub struct Generator {
9703    pub proc: Option<Arc<DaggerSessionProc>>,
9704    pub selection: Selection,
9705    pub graphql_client: DynGraphQLClient,
9706}
9707impl Generator {
9708    /// The generated changeset
9709    pub fn changes(&self) -> Changeset {
9710        let query = self.selection.select("changes");
9711        Changeset {
9712            proc: self.proc.clone(),
9713            selection: query,
9714            graphql_client: self.graphql_client.clone(),
9715        }
9716    }
9717    /// Whether the generator complete
9718    pub async fn completed(&self) -> Result<bool, DaggerError> {
9719        let query = self.selection.select("completed");
9720        query.execute(self.graphql_client.clone()).await
9721    }
9722    /// Return the description of the generator
9723    pub async fn description(&self) -> Result<String, DaggerError> {
9724        let query = self.selection.select("description");
9725        query.execute(self.graphql_client.clone()).await
9726    }
9727    /// A unique identifier for this Generator.
9728    pub async fn id(&self) -> Result<GeneratorId, DaggerError> {
9729        let query = self.selection.select("id");
9730        query.execute(self.graphql_client.clone()).await
9731    }
9732    /// Wether changeset from the generator execution is empty or not
9733    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9734        let query = self.selection.select("isEmpty");
9735        query.execute(self.graphql_client.clone()).await
9736    }
9737    /// Return the fully qualified name of the generator
9738    pub async fn name(&self) -> Result<String, DaggerError> {
9739        let query = self.selection.select("name");
9740        query.execute(self.graphql_client.clone()).await
9741    }
9742    /// The original module in which the generator has been defined
9743    pub fn original_module(&self) -> Module {
9744        let query = self.selection.select("originalModule");
9745        Module {
9746            proc: self.proc.clone(),
9747            selection: query,
9748            graphql_client: self.graphql_client.clone(),
9749        }
9750    }
9751    /// The path of the generator within its module
9752    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
9753        let query = self.selection.select("path");
9754        query.execute(self.graphql_client.clone()).await
9755    }
9756    /// Execute the generator
9757    pub fn run(&self) -> Generator {
9758        let query = self.selection.select("run");
9759        Generator {
9760            proc: self.proc.clone(),
9761            selection: query,
9762            graphql_client: self.graphql_client.clone(),
9763        }
9764    }
9765}
9766#[derive(Clone)]
9767pub struct GeneratorGroup {
9768    pub proc: Option<Arc<DaggerSessionProc>>,
9769    pub selection: Selection,
9770    pub graphql_client: DynGraphQLClient,
9771}
9772#[derive(Builder, Debug, PartialEq)]
9773pub struct GeneratorGroupChangesOpts {
9774    /// Strategy to apply on conflicts between generators
9775    #[builder(setter(into, strip_option), default)]
9776    pub on_conflict: Option<ChangesetsMergeConflict>,
9777}
9778impl GeneratorGroup {
9779    /// The combined changes from the generators execution
9780    /// If any conflict occurs, for instance if the same file is modified by multiple generators, or if a file is both modified and deleted, an error is raised and the merge of the changesets will failed.
9781    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
9782    ///
9783    /// # Arguments
9784    ///
9785    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9786    pub fn changes(&self) -> Changeset {
9787        let query = self.selection.select("changes");
9788        Changeset {
9789            proc: self.proc.clone(),
9790            selection: query,
9791            graphql_client: self.graphql_client.clone(),
9792        }
9793    }
9794    /// The combined changes from the generators execution
9795    /// If any conflict occurs, for instance if the same file is modified by multiple generators, or if a file is both modified and deleted, an error is raised and the merge of the changesets will failed.
9796    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
9797    ///
9798    /// # Arguments
9799    ///
9800    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9801    pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
9802        let mut query = self.selection.select("changes");
9803        if let Some(on_conflict) = opts.on_conflict {
9804            query = query.arg("onConflict", on_conflict);
9805        }
9806        Changeset {
9807            proc: self.proc.clone(),
9808            selection: query,
9809            graphql_client: self.graphql_client.clone(),
9810        }
9811    }
9812    /// A unique identifier for this GeneratorGroup.
9813    pub async fn id(&self) -> Result<GeneratorGroupId, DaggerError> {
9814        let query = self.selection.select("id");
9815        query.execute(self.graphql_client.clone()).await
9816    }
9817    /// Whether the generated changeset is empty or not
9818    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9819        let query = self.selection.select("isEmpty");
9820        query.execute(self.graphql_client.clone()).await
9821    }
9822    /// Return a list of individual generators and their details
9823    pub fn list(&self) -> Vec<Generator> {
9824        let query = self.selection.select("list");
9825        vec![Generator {
9826            proc: self.proc.clone(),
9827            selection: query,
9828            graphql_client: self.graphql_client.clone(),
9829        }]
9830    }
9831    /// Execute all selected generators
9832    pub fn run(&self) -> GeneratorGroup {
9833        let query = self.selection.select("run");
9834        GeneratorGroup {
9835            proc: self.proc.clone(),
9836            selection: query,
9837            graphql_client: self.graphql_client.clone(),
9838        }
9839    }
9840}
9841#[derive(Clone)]
9842pub struct GitRef {
9843    pub proc: Option<Arc<DaggerSessionProc>>,
9844    pub selection: Selection,
9845    pub graphql_client: DynGraphQLClient,
9846}
9847#[derive(Builder, Debug, PartialEq)]
9848pub struct GitRefTreeOpts {
9849    /// The depth of the tree to fetch.
9850    #[builder(setter(into, strip_option), default)]
9851    pub depth: Option<isize>,
9852    /// Set to true to discard .git directory.
9853    #[builder(setter(into, strip_option), default)]
9854    pub discard_git_dir: Option<bool>,
9855    /// Set to true to populate tag refs in the local checkout .git.
9856    #[builder(setter(into, strip_option), default)]
9857    pub include_tags: Option<bool>,
9858}
9859impl GitRef {
9860    /// The resolved commit id at this ref.
9861    pub async fn commit(&self) -> Result<String, DaggerError> {
9862        let query = self.selection.select("commit");
9863        query.execute(self.graphql_client.clone()).await
9864    }
9865    /// Find the best common ancestor between this ref and another ref.
9866    ///
9867    /// # Arguments
9868    ///
9869    /// * `other` - The other ref to compare against.
9870    pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
9871        let mut query = self.selection.select("commonAncestor");
9872        query = query.arg_lazy(
9873            "other",
9874            Box::new(move || {
9875                let other = other.clone();
9876                Box::pin(async move { other.into_id().await.unwrap().quote() })
9877            }),
9878        );
9879        GitRef {
9880            proc: self.proc.clone(),
9881            selection: query,
9882            graphql_client: self.graphql_client.clone(),
9883        }
9884    }
9885    /// A unique identifier for this GitRef.
9886    pub async fn id(&self) -> Result<GitRefId, DaggerError> {
9887        let query = self.selection.select("id");
9888        query.execute(self.graphql_client.clone()).await
9889    }
9890    /// The resolved ref name at this ref.
9891    pub async fn r#ref(&self) -> Result<String, DaggerError> {
9892        let query = self.selection.select("ref");
9893        query.execute(self.graphql_client.clone()).await
9894    }
9895    /// The filesystem tree at this ref.
9896    ///
9897    /// # Arguments
9898    ///
9899    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9900    pub fn tree(&self) -> Directory {
9901        let query = self.selection.select("tree");
9902        Directory {
9903            proc: self.proc.clone(),
9904            selection: query,
9905            graphql_client: self.graphql_client.clone(),
9906        }
9907    }
9908    /// The filesystem tree at this ref.
9909    ///
9910    /// # Arguments
9911    ///
9912    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9913    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
9914        let mut query = self.selection.select("tree");
9915        if let Some(discard_git_dir) = opts.discard_git_dir {
9916            query = query.arg("discardGitDir", discard_git_dir);
9917        }
9918        if let Some(depth) = opts.depth {
9919            query = query.arg("depth", depth);
9920        }
9921        if let Some(include_tags) = opts.include_tags {
9922            query = query.arg("includeTags", include_tags);
9923        }
9924        Directory {
9925            proc: self.proc.clone(),
9926            selection: query,
9927            graphql_client: self.graphql_client.clone(),
9928        }
9929    }
9930}
9931#[derive(Clone)]
9932pub struct GitRepository {
9933    pub proc: Option<Arc<DaggerSessionProc>>,
9934    pub selection: Selection,
9935    pub graphql_client: DynGraphQLClient,
9936}
9937#[derive(Builder, Debug, PartialEq)]
9938pub struct GitRepositoryBranchesOpts<'a> {
9939    /// Glob patterns (e.g., "refs/tags/v*").
9940    #[builder(setter(into, strip_option), default)]
9941    pub patterns: Option<Vec<&'a str>>,
9942}
9943#[derive(Builder, Debug, PartialEq)]
9944pub struct GitRepositoryTagsOpts<'a> {
9945    /// Glob patterns (e.g., "refs/tags/v*").
9946    #[builder(setter(into, strip_option), default)]
9947    pub patterns: Option<Vec<&'a str>>,
9948}
9949impl GitRepository {
9950    /// Returns details of a branch.
9951    ///
9952    /// # Arguments
9953    ///
9954    /// * `name` - Branch's name (e.g., "main").
9955    pub fn branch(&self, name: impl Into<String>) -> GitRef {
9956        let mut query = self.selection.select("branch");
9957        query = query.arg("name", name.into());
9958        GitRef {
9959            proc: self.proc.clone(),
9960            selection: query,
9961            graphql_client: self.graphql_client.clone(),
9962        }
9963    }
9964    /// branches that match any of the given glob patterns.
9965    ///
9966    /// # Arguments
9967    ///
9968    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9969    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
9970        let query = self.selection.select("branches");
9971        query.execute(self.graphql_client.clone()).await
9972    }
9973    /// branches that match any of the given glob patterns.
9974    ///
9975    /// # Arguments
9976    ///
9977    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9978    pub async fn branches_opts<'a>(
9979        &self,
9980        opts: GitRepositoryBranchesOpts<'a>,
9981    ) -> Result<Vec<String>, DaggerError> {
9982        let mut query = self.selection.select("branches");
9983        if let Some(patterns) = opts.patterns {
9984            query = query.arg("patterns", patterns);
9985        }
9986        query.execute(self.graphql_client.clone()).await
9987    }
9988    /// Returns details of a commit.
9989    ///
9990    /// # Arguments
9991    ///
9992    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
9993    pub fn commit(&self, id: impl Into<String>) -> GitRef {
9994        let mut query = self.selection.select("commit");
9995        query = query.arg("id", id.into());
9996        GitRef {
9997            proc: self.proc.clone(),
9998            selection: query,
9999            graphql_client: self.graphql_client.clone(),
10000        }
10001    }
10002    /// Returns details for HEAD.
10003    pub fn head(&self) -> GitRef {
10004        let query = self.selection.select("head");
10005        GitRef {
10006            proc: self.proc.clone(),
10007            selection: query,
10008            graphql_client: self.graphql_client.clone(),
10009        }
10010    }
10011    /// A unique identifier for this GitRepository.
10012    pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
10013        let query = self.selection.select("id");
10014        query.execute(self.graphql_client.clone()).await
10015    }
10016    /// Returns details for the latest semver tag.
10017    pub fn latest_version(&self) -> GitRef {
10018        let query = self.selection.select("latestVersion");
10019        GitRef {
10020            proc: self.proc.clone(),
10021            selection: query,
10022            graphql_client: self.graphql_client.clone(),
10023        }
10024    }
10025    /// Returns details of a ref.
10026    ///
10027    /// # Arguments
10028    ///
10029    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
10030    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
10031        let mut query = self.selection.select("ref");
10032        query = query.arg("name", name.into());
10033        GitRef {
10034            proc: self.proc.clone(),
10035            selection: query,
10036            graphql_client: self.graphql_client.clone(),
10037        }
10038    }
10039    /// Returns details of a tag.
10040    ///
10041    /// # Arguments
10042    ///
10043    /// * `name` - Tag's name (e.g., "v0.3.9").
10044    pub fn tag(&self, name: impl Into<String>) -> GitRef {
10045        let mut query = self.selection.select("tag");
10046        query = query.arg("name", name.into());
10047        GitRef {
10048            proc: self.proc.clone(),
10049            selection: query,
10050            graphql_client: self.graphql_client.clone(),
10051        }
10052    }
10053    /// tags that match any of the given glob patterns.
10054    ///
10055    /// # Arguments
10056    ///
10057    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10058    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
10059        let query = self.selection.select("tags");
10060        query.execute(self.graphql_client.clone()).await
10061    }
10062    /// tags that match any of the given glob patterns.
10063    ///
10064    /// # Arguments
10065    ///
10066    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10067    pub async fn tags_opts<'a>(
10068        &self,
10069        opts: GitRepositoryTagsOpts<'a>,
10070    ) -> Result<Vec<String>, DaggerError> {
10071        let mut query = self.selection.select("tags");
10072        if let Some(patterns) = opts.patterns {
10073            query = query.arg("patterns", patterns);
10074        }
10075        query.execute(self.graphql_client.clone()).await
10076    }
10077    /// Returns the changeset of uncommitted changes in the git repository.
10078    pub fn uncommitted(&self) -> Changeset {
10079        let query = self.selection.select("uncommitted");
10080        Changeset {
10081            proc: self.proc.clone(),
10082            selection: query,
10083            graphql_client: self.graphql_client.clone(),
10084        }
10085    }
10086    /// The URL of the git repository.
10087    pub async fn url(&self) -> Result<String, DaggerError> {
10088        let query = self.selection.select("url");
10089        query.execute(self.graphql_client.clone()).await
10090    }
10091}
10092#[derive(Clone)]
10093pub struct HealthcheckConfig {
10094    pub proc: Option<Arc<DaggerSessionProc>>,
10095    pub selection: Selection,
10096    pub graphql_client: DynGraphQLClient,
10097}
10098impl HealthcheckConfig {
10099    /// Healthcheck command arguments.
10100    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
10101        let query = self.selection.select("args");
10102        query.execute(self.graphql_client.clone()).await
10103    }
10104    /// A unique identifier for this HealthcheckConfig.
10105    pub async fn id(&self) -> Result<HealthcheckConfigId, DaggerError> {
10106        let query = self.selection.select("id");
10107        query.execute(self.graphql_client.clone()).await
10108    }
10109    /// Interval between running healthcheck. Example:30s
10110    pub async fn interval(&self) -> Result<String, DaggerError> {
10111        let query = self.selection.select("interval");
10112        query.execute(self.graphql_client.clone()).await
10113    }
10114    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example:3
10115    pub async fn retries(&self) -> Result<isize, DaggerError> {
10116        let query = self.selection.select("retries");
10117        query.execute(self.graphql_client.clone()).await
10118    }
10119    /// Healthcheck command is a shell command.
10120    pub async fn shell(&self) -> Result<bool, DaggerError> {
10121        let query = self.selection.select("shell");
10122        query.execute(self.graphql_client.clone()).await
10123    }
10124    /// StartInterval configures the duration between checks during the startup phase. Example:5s
10125    pub async fn start_interval(&self) -> Result<String, DaggerError> {
10126        let query = self.selection.select("startInterval");
10127        query.execute(self.graphql_client.clone()).await
10128    }
10129    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example:0s
10130    pub async fn start_period(&self) -> Result<String, DaggerError> {
10131        let query = self.selection.select("startPeriod");
10132        query.execute(self.graphql_client.clone()).await
10133    }
10134    /// Healthcheck timeout. Example:3s
10135    pub async fn timeout(&self) -> Result<String, DaggerError> {
10136        let query = self.selection.select("timeout");
10137        query.execute(self.graphql_client.clone()).await
10138    }
10139}
10140#[derive(Clone)]
10141pub struct Host {
10142    pub proc: Option<Arc<DaggerSessionProc>>,
10143    pub selection: Selection,
10144    pub graphql_client: DynGraphQLClient,
10145}
10146#[derive(Builder, Debug, PartialEq)]
10147pub struct HostDirectoryOpts<'a> {
10148    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
10149    #[builder(setter(into, strip_option), default)]
10150    pub exclude: Option<Vec<&'a str>>,
10151    /// Apply .gitignore filter rules inside the directory
10152    #[builder(setter(into, strip_option), default)]
10153    pub gitignore: Option<bool>,
10154    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
10155    #[builder(setter(into, strip_option), default)]
10156    pub include: Option<Vec<&'a str>>,
10157    /// If true, the directory will always be reloaded from the host.
10158    #[builder(setter(into, strip_option), default)]
10159    pub no_cache: Option<bool>,
10160}
10161#[derive(Builder, Debug, PartialEq)]
10162pub struct HostFileOpts {
10163    /// If true, the file will always be reloaded from the host.
10164    #[builder(setter(into, strip_option), default)]
10165    pub no_cache: Option<bool>,
10166}
10167#[derive(Builder, Debug, PartialEq)]
10168pub struct HostFindUpOpts {
10169    #[builder(setter(into, strip_option), default)]
10170    pub no_cache: Option<bool>,
10171}
10172#[derive(Builder, Debug, PartialEq)]
10173pub struct HostServiceOpts<'a> {
10174    /// Upstream host to forward traffic to.
10175    #[builder(setter(into, strip_option), default)]
10176    pub host: Option<&'a str>,
10177}
10178#[derive(Builder, Debug, PartialEq)]
10179pub struct HostTunnelOpts {
10180    /// Map each service port to the same port on the host, as if the service were running natively.
10181    /// Note: enabling may result in port conflicts.
10182    #[builder(setter(into, strip_option), default)]
10183    pub native: Option<bool>,
10184    /// Configure explicit port forwarding rules for the tunnel.
10185    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
10186    /// 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.
10187    /// If ports are given and native is true, the ports are additive.
10188    #[builder(setter(into, strip_option), default)]
10189    pub ports: Option<Vec<PortForward>>,
10190}
10191impl Host {
10192    /// Accesses a container image on the host.
10193    ///
10194    /// # Arguments
10195    ///
10196    /// * `name` - Name of the image to access.
10197    pub fn container_image(&self, name: impl Into<String>) -> Container {
10198        let mut query = self.selection.select("containerImage");
10199        query = query.arg("name", name.into());
10200        Container {
10201            proc: self.proc.clone(),
10202            selection: query,
10203            graphql_client: self.graphql_client.clone(),
10204        }
10205    }
10206    /// Accesses a directory on the host.
10207    ///
10208    /// # Arguments
10209    ///
10210    /// * `path` - Location of the directory to access (e.g., ".").
10211    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10212    pub fn directory(&self, path: impl Into<String>) -> Directory {
10213        let mut query = self.selection.select("directory");
10214        query = query.arg("path", path.into());
10215        Directory {
10216            proc: self.proc.clone(),
10217            selection: query,
10218            graphql_client: self.graphql_client.clone(),
10219        }
10220    }
10221    /// Accesses a directory on the host.
10222    ///
10223    /// # Arguments
10224    ///
10225    /// * `path` - Location of the directory to access (e.g., ".").
10226    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10227    pub fn directory_opts<'a>(
10228        &self,
10229        path: impl Into<String>,
10230        opts: HostDirectoryOpts<'a>,
10231    ) -> Directory {
10232        let mut query = self.selection.select("directory");
10233        query = query.arg("path", path.into());
10234        if let Some(exclude) = opts.exclude {
10235            query = query.arg("exclude", exclude);
10236        }
10237        if let Some(include) = opts.include {
10238            query = query.arg("include", include);
10239        }
10240        if let Some(no_cache) = opts.no_cache {
10241            query = query.arg("noCache", no_cache);
10242        }
10243        if let Some(gitignore) = opts.gitignore {
10244            query = query.arg("gitignore", gitignore);
10245        }
10246        Directory {
10247            proc: self.proc.clone(),
10248            selection: query,
10249            graphql_client: self.graphql_client.clone(),
10250        }
10251    }
10252    /// Accesses a file on the host.
10253    ///
10254    /// # Arguments
10255    ///
10256    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10257    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10258    pub fn file(&self, path: impl Into<String>) -> File {
10259        let mut query = self.selection.select("file");
10260        query = query.arg("path", path.into());
10261        File {
10262            proc: self.proc.clone(),
10263            selection: query,
10264            graphql_client: self.graphql_client.clone(),
10265        }
10266    }
10267    /// Accesses a file on the host.
10268    ///
10269    /// # Arguments
10270    ///
10271    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10272    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10273    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
10274        let mut query = self.selection.select("file");
10275        query = query.arg("path", path.into());
10276        if let Some(no_cache) = opts.no_cache {
10277            query = query.arg("noCache", no_cache);
10278        }
10279        File {
10280            proc: self.proc.clone(),
10281            selection: query,
10282            graphql_client: self.graphql_client.clone(),
10283        }
10284    }
10285    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10286    ///
10287    /// # Arguments
10288    ///
10289    /// * `name` - name of the file or directory to search for
10290    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10291    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
10292        let mut query = self.selection.select("findUp");
10293        query = query.arg("name", name.into());
10294        query.execute(self.graphql_client.clone()).await
10295    }
10296    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10297    ///
10298    /// # Arguments
10299    ///
10300    /// * `name` - name of the file or directory to search for
10301    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10302    pub async fn find_up_opts(
10303        &self,
10304        name: impl Into<String>,
10305        opts: HostFindUpOpts,
10306    ) -> Result<String, DaggerError> {
10307        let mut query = self.selection.select("findUp");
10308        query = query.arg("name", name.into());
10309        if let Some(no_cache) = opts.no_cache {
10310            query = query.arg("noCache", no_cache);
10311        }
10312        query.execute(self.graphql_client.clone()).await
10313    }
10314    /// A unique identifier for this Host.
10315    pub async fn id(&self) -> Result<HostId, DaggerError> {
10316        let query = self.selection.select("id");
10317        query.execute(self.graphql_client.clone()).await
10318    }
10319    /// Creates a service that forwards traffic to a specified address via the host.
10320    ///
10321    /// # Arguments
10322    ///
10323    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10324    ///
10325    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10326    ///
10327    /// An empty set of ports is not valid; an error will be returned.
10328    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10329    pub fn service(&self, ports: Vec<PortForward>) -> Service {
10330        let mut query = self.selection.select("service");
10331        query = query.arg("ports", ports);
10332        Service {
10333            proc: self.proc.clone(),
10334            selection: query,
10335            graphql_client: self.graphql_client.clone(),
10336        }
10337    }
10338    /// Creates a service that forwards traffic to a specified address via the host.
10339    ///
10340    /// # Arguments
10341    ///
10342    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10343    ///
10344    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10345    ///
10346    /// An empty set of ports is not valid; an error will be returned.
10347    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10348    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
10349        let mut query = self.selection.select("service");
10350        query = query.arg("ports", ports);
10351        if let Some(host) = opts.host {
10352            query = query.arg("host", host);
10353        }
10354        Service {
10355            proc: self.proc.clone(),
10356            selection: query,
10357            graphql_client: self.graphql_client.clone(),
10358        }
10359    }
10360    /// Creates a tunnel that forwards traffic from the host to a service.
10361    ///
10362    /// # Arguments
10363    ///
10364    /// * `service` - Service to send traffic from the tunnel.
10365    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10366    pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
10367        let mut query = self.selection.select("tunnel");
10368        query = query.arg_lazy(
10369            "service",
10370            Box::new(move || {
10371                let service = service.clone();
10372                Box::pin(async move { service.into_id().await.unwrap().quote() })
10373            }),
10374        );
10375        Service {
10376            proc: self.proc.clone(),
10377            selection: query,
10378            graphql_client: self.graphql_client.clone(),
10379        }
10380    }
10381    /// Creates a tunnel that forwards traffic from the host to a service.
10382    ///
10383    /// # Arguments
10384    ///
10385    /// * `service` - Service to send traffic from the tunnel.
10386    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10387    pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
10388        let mut query = self.selection.select("tunnel");
10389        query = query.arg_lazy(
10390            "service",
10391            Box::new(move || {
10392                let service = service.clone();
10393                Box::pin(async move { service.into_id().await.unwrap().quote() })
10394            }),
10395        );
10396        if let Some(native) = opts.native {
10397            query = query.arg("native", native);
10398        }
10399        if let Some(ports) = opts.ports {
10400            query = query.arg("ports", ports);
10401        }
10402        Service {
10403            proc: self.proc.clone(),
10404            selection: query,
10405            graphql_client: self.graphql_client.clone(),
10406        }
10407    }
10408    /// Accesses a Unix socket on the host.
10409    ///
10410    /// # Arguments
10411    ///
10412    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
10413    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
10414        let mut query = self.selection.select("unixSocket");
10415        query = query.arg("path", path.into());
10416        Socket {
10417            proc: self.proc.clone(),
10418            selection: query,
10419            graphql_client: self.graphql_client.clone(),
10420        }
10421    }
10422}
10423#[derive(Clone)]
10424pub struct InputTypeDef {
10425    pub proc: Option<Arc<DaggerSessionProc>>,
10426    pub selection: Selection,
10427    pub graphql_client: DynGraphQLClient,
10428}
10429impl InputTypeDef {
10430    /// Static fields defined on this input object, if any.
10431    pub fn fields(&self) -> Vec<FieldTypeDef> {
10432        let query = self.selection.select("fields");
10433        vec![FieldTypeDef {
10434            proc: self.proc.clone(),
10435            selection: query,
10436            graphql_client: self.graphql_client.clone(),
10437        }]
10438    }
10439    /// A unique identifier for this InputTypeDef.
10440    pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
10441        let query = self.selection.select("id");
10442        query.execute(self.graphql_client.clone()).await
10443    }
10444    /// The name of the input object.
10445    pub async fn name(&self) -> Result<String, DaggerError> {
10446        let query = self.selection.select("name");
10447        query.execute(self.graphql_client.clone()).await
10448    }
10449}
10450#[derive(Clone)]
10451pub struct InterfaceTypeDef {
10452    pub proc: Option<Arc<DaggerSessionProc>>,
10453    pub selection: Selection,
10454    pub graphql_client: DynGraphQLClient,
10455}
10456impl InterfaceTypeDef {
10457    /// The doc string for the interface, if any.
10458    pub async fn description(&self) -> Result<String, DaggerError> {
10459        let query = self.selection.select("description");
10460        query.execute(self.graphql_client.clone()).await
10461    }
10462    /// Functions defined on this interface, if any.
10463    pub fn functions(&self) -> Vec<Function> {
10464        let query = self.selection.select("functions");
10465        vec![Function {
10466            proc: self.proc.clone(),
10467            selection: query,
10468            graphql_client: self.graphql_client.clone(),
10469        }]
10470    }
10471    /// A unique identifier for this InterfaceTypeDef.
10472    pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
10473        let query = self.selection.select("id");
10474        query.execute(self.graphql_client.clone()).await
10475    }
10476    /// The name of the interface.
10477    pub async fn name(&self) -> Result<String, DaggerError> {
10478        let query = self.selection.select("name");
10479        query.execute(self.graphql_client.clone()).await
10480    }
10481    /// The location of this interface declaration.
10482    pub fn source_map(&self) -> SourceMap {
10483        let query = self.selection.select("sourceMap");
10484        SourceMap {
10485            proc: self.proc.clone(),
10486            selection: query,
10487            graphql_client: self.graphql_client.clone(),
10488        }
10489    }
10490    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
10491    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10492        let query = self.selection.select("sourceModuleName");
10493        query.execute(self.graphql_client.clone()).await
10494    }
10495}
10496#[derive(Clone)]
10497pub struct JsonValue {
10498    pub proc: Option<Arc<DaggerSessionProc>>,
10499    pub selection: Selection,
10500    pub graphql_client: DynGraphQLClient,
10501}
10502#[derive(Builder, Debug, PartialEq)]
10503pub struct JsonValueContentsOpts<'a> {
10504    /// Optional line prefix
10505    #[builder(setter(into, strip_option), default)]
10506    pub indent: Option<&'a str>,
10507    /// Pretty-print
10508    #[builder(setter(into, strip_option), default)]
10509    pub pretty: Option<bool>,
10510}
10511impl JsonValue {
10512    /// Decode an array from json
10513    pub fn as_array(&self) -> Vec<JsonValue> {
10514        let query = self.selection.select("asArray");
10515        vec![JsonValue {
10516            proc: self.proc.clone(),
10517            selection: query,
10518            graphql_client: self.graphql_client.clone(),
10519        }]
10520    }
10521    /// Decode a boolean from json
10522    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10523        let query = self.selection.select("asBoolean");
10524        query.execute(self.graphql_client.clone()).await
10525    }
10526    /// Decode an integer from json
10527    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10528        let query = self.selection.select("asInteger");
10529        query.execute(self.graphql_client.clone()).await
10530    }
10531    /// Decode a string from json
10532    pub async fn as_string(&self) -> Result<String, DaggerError> {
10533        let query = self.selection.select("asString");
10534        query.execute(self.graphql_client.clone()).await
10535    }
10536    /// Return the value encoded as json
10537    ///
10538    /// # Arguments
10539    ///
10540    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10541    pub async fn contents(&self) -> Result<Json, DaggerError> {
10542        let query = self.selection.select("contents");
10543        query.execute(self.graphql_client.clone()).await
10544    }
10545    /// Return the value encoded as json
10546    ///
10547    /// # Arguments
10548    ///
10549    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10550    pub async fn contents_opts<'a>(
10551        &self,
10552        opts: JsonValueContentsOpts<'a>,
10553    ) -> Result<Json, DaggerError> {
10554        let mut query = self.selection.select("contents");
10555        if let Some(pretty) = opts.pretty {
10556            query = query.arg("pretty", pretty);
10557        }
10558        if let Some(indent) = opts.indent {
10559            query = query.arg("indent", indent);
10560        }
10561        query.execute(self.graphql_client.clone()).await
10562    }
10563    /// Lookup the field at the given path, and return its value.
10564    ///
10565    /// # Arguments
10566    ///
10567    /// * `path` - Path of the field to lookup, encoded as an array of field names
10568    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
10569        let mut query = self.selection.select("field");
10570        query = query.arg(
10571            "path",
10572            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10573        );
10574        JsonValue {
10575            proc: self.proc.clone(),
10576            selection: query,
10577            graphql_client: self.graphql_client.clone(),
10578        }
10579    }
10580    /// List fields of the encoded object
10581    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
10582        let query = self.selection.select("fields");
10583        query.execute(self.graphql_client.clone()).await
10584    }
10585    /// A unique identifier for this JSONValue.
10586    pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
10587        let query = self.selection.select("id");
10588        query.execute(self.graphql_client.clone()).await
10589    }
10590    /// Encode a boolean to json
10591    ///
10592    /// # Arguments
10593    ///
10594    /// * `value` - New boolean value
10595    pub fn new_boolean(&self, value: bool) -> JsonValue {
10596        let mut query = self.selection.select("newBoolean");
10597        query = query.arg("value", value);
10598        JsonValue {
10599            proc: self.proc.clone(),
10600            selection: query,
10601            graphql_client: self.graphql_client.clone(),
10602        }
10603    }
10604    /// Encode an integer to json
10605    ///
10606    /// # Arguments
10607    ///
10608    /// * `value` - New integer value
10609    pub fn new_integer(&self, value: isize) -> JsonValue {
10610        let mut query = self.selection.select("newInteger");
10611        query = query.arg("value", value);
10612        JsonValue {
10613            proc: self.proc.clone(),
10614            selection: query,
10615            graphql_client: self.graphql_client.clone(),
10616        }
10617    }
10618    /// Encode a string to json
10619    ///
10620    /// # Arguments
10621    ///
10622    /// * `value` - New string value
10623    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
10624        let mut query = self.selection.select("newString");
10625        query = query.arg("value", value.into());
10626        JsonValue {
10627            proc: self.proc.clone(),
10628            selection: query,
10629            graphql_client: self.graphql_client.clone(),
10630        }
10631    }
10632    /// Return a new json value, decoded from the given content
10633    ///
10634    /// # Arguments
10635    ///
10636    /// * `contents` - New JSON-encoded contents
10637    pub fn with_contents(&self, contents: Json) -> JsonValue {
10638        let mut query = self.selection.select("withContents");
10639        query = query.arg("contents", contents);
10640        JsonValue {
10641            proc: self.proc.clone(),
10642            selection: query,
10643            graphql_client: self.graphql_client.clone(),
10644        }
10645    }
10646    /// Set a new field at the given path
10647    ///
10648    /// # Arguments
10649    ///
10650    /// * `path` - Path of the field to set, encoded as an array of field names
10651    /// * `value` - The new value of the field
10652    pub fn with_field(
10653        &self,
10654        path: Vec<impl Into<String>>,
10655        value: impl IntoID<JsonValueId>,
10656    ) -> JsonValue {
10657        let mut query = self.selection.select("withField");
10658        query = query.arg(
10659            "path",
10660            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10661        );
10662        query = query.arg_lazy(
10663            "value",
10664            Box::new(move || {
10665                let value = value.clone();
10666                Box::pin(async move { value.into_id().await.unwrap().quote() })
10667            }),
10668        );
10669        JsonValue {
10670            proc: self.proc.clone(),
10671            selection: query,
10672            graphql_client: self.graphql_client.clone(),
10673        }
10674    }
10675}
10676#[derive(Clone)]
10677pub struct Llm {
10678    pub proc: Option<Arc<DaggerSessionProc>>,
10679    pub selection: Selection,
10680    pub graphql_client: DynGraphQLClient,
10681}
10682impl Llm {
10683    /// create a branch in the LLM's history
10684    pub fn attempt(&self, number: isize) -> Llm {
10685        let mut query = self.selection.select("attempt");
10686        query = query.arg("number", number);
10687        Llm {
10688            proc: self.proc.clone(),
10689            selection: query,
10690            graphql_client: self.graphql_client.clone(),
10691        }
10692    }
10693    /// returns the type of the current state
10694    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
10695        let mut query = self.selection.select("bindResult");
10696        query = query.arg("name", name.into());
10697        Binding {
10698            proc: self.proc.clone(),
10699            selection: query,
10700            graphql_client: self.graphql_client.clone(),
10701        }
10702    }
10703    /// return the LLM's current environment
10704    pub fn env(&self) -> Env {
10705        let query = self.selection.select("env");
10706        Env {
10707            proc: self.proc.clone(),
10708            selection: query,
10709            graphql_client: self.graphql_client.clone(),
10710        }
10711    }
10712    /// Indicates whether there are any queued prompts or tool results to send to the model
10713    pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
10714        let query = self.selection.select("hasPrompt");
10715        query.execute(self.graphql_client.clone()).await
10716    }
10717    /// return the llm message history
10718    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
10719        let query = self.selection.select("history");
10720        query.execute(self.graphql_client.clone()).await
10721    }
10722    /// return the raw llm message history as json
10723    pub async fn history_json(&self) -> Result<Json, DaggerError> {
10724        let query = self.selection.select("historyJSON");
10725        query.execute(self.graphql_client.clone()).await
10726    }
10727    /// A unique identifier for this LLM.
10728    pub async fn id(&self) -> Result<Llmid, DaggerError> {
10729        let query = self.selection.select("id");
10730        query.execute(self.graphql_client.clone()).await
10731    }
10732    /// return the last llm reply from the history
10733    pub async fn last_reply(&self) -> Result<String, DaggerError> {
10734        let query = self.selection.select("lastReply");
10735        query.execute(self.graphql_client.clone()).await
10736    }
10737    /// Submit the queued prompt, evaluate any tool calls, queue their results, and keep going until the model ends its turn
10738    pub fn r#loop(&self) -> Llm {
10739        let query = self.selection.select("loop");
10740        Llm {
10741            proc: self.proc.clone(),
10742            selection: query,
10743            graphql_client: self.graphql_client.clone(),
10744        }
10745    }
10746    /// return the model used by the llm
10747    pub async fn model(&self) -> Result<String, DaggerError> {
10748        let query = self.selection.select("model");
10749        query.execute(self.graphql_client.clone()).await
10750    }
10751    /// return the provider used by the llm
10752    pub async fn provider(&self) -> Result<String, DaggerError> {
10753        let query = self.selection.select("provider");
10754        query.execute(self.graphql_client.clone()).await
10755    }
10756    /// Submit the queued prompt or tool call results, evaluate any tool calls, and queue their results
10757    pub async fn step(&self) -> Result<Llmid, DaggerError> {
10758        let query = self.selection.select("step");
10759        query.execute(self.graphql_client.clone()).await
10760    }
10761    /// synchronize LLM state
10762    pub async fn sync(&self) -> Result<Llmid, DaggerError> {
10763        let query = self.selection.select("sync");
10764        query.execute(self.graphql_client.clone()).await
10765    }
10766    /// returns the token usage of the current state
10767    pub fn token_usage(&self) -> LlmTokenUsage {
10768        let query = self.selection.select("tokenUsage");
10769        LlmTokenUsage {
10770            proc: self.proc.clone(),
10771            selection: query,
10772            graphql_client: self.graphql_client.clone(),
10773        }
10774    }
10775    /// print documentation for available tools
10776    pub async fn tools(&self) -> Result<String, DaggerError> {
10777        let query = self.selection.select("tools");
10778        query.execute(self.graphql_client.clone()).await
10779    }
10780    /// Return a new LLM with the specified function no longer exposed as a tool
10781    ///
10782    /// # Arguments
10783    ///
10784    /// * `type_name` - The type name whose function will be blocked
10785    /// * `function` - The function to block
10786    ///
10787    /// Will be converted to lowerCamelCase if necessary.
10788    pub fn with_blocked_function(
10789        &self,
10790        type_name: impl Into<String>,
10791        function: impl Into<String>,
10792    ) -> Llm {
10793        let mut query = self.selection.select("withBlockedFunction");
10794        query = query.arg("typeName", type_name.into());
10795        query = query.arg("function", function.into());
10796        Llm {
10797            proc: self.proc.clone(),
10798            selection: query,
10799            graphql_client: self.graphql_client.clone(),
10800        }
10801    }
10802    /// allow the LLM to interact with an environment via MCP
10803    pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
10804        let mut query = self.selection.select("withEnv");
10805        query = query.arg_lazy(
10806            "env",
10807            Box::new(move || {
10808                let env = env.clone();
10809                Box::pin(async move { env.into_id().await.unwrap().quote() })
10810            }),
10811        );
10812        Llm {
10813            proc: self.proc.clone(),
10814            selection: query,
10815            graphql_client: self.graphql_client.clone(),
10816        }
10817    }
10818    /// Add an external MCP server to the LLM
10819    ///
10820    /// # Arguments
10821    ///
10822    /// * `name` - The name of the MCP server
10823    /// * `service` - The MCP service to run and communicate with over stdio
10824    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<ServiceId>) -> Llm {
10825        let mut query = self.selection.select("withMCPServer");
10826        query = query.arg("name", name.into());
10827        query = query.arg_lazy(
10828            "service",
10829            Box::new(move || {
10830                let service = service.clone();
10831                Box::pin(async move { service.into_id().await.unwrap().quote() })
10832            }),
10833        );
10834        Llm {
10835            proc: self.proc.clone(),
10836            selection: query,
10837            graphql_client: self.graphql_client.clone(),
10838        }
10839    }
10840    /// swap out the llm model
10841    ///
10842    /// # Arguments
10843    ///
10844    /// * `model` - The model to use
10845    pub fn with_model(&self, model: impl Into<String>) -> Llm {
10846        let mut query = self.selection.select("withModel");
10847        query = query.arg("model", model.into());
10848        Llm {
10849            proc: self.proc.clone(),
10850            selection: query,
10851            graphql_client: self.graphql_client.clone(),
10852        }
10853    }
10854    /// append a prompt to the llm context
10855    ///
10856    /// # Arguments
10857    ///
10858    /// * `prompt` - The prompt to send
10859    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
10860        let mut query = self.selection.select("withPrompt");
10861        query = query.arg("prompt", prompt.into());
10862        Llm {
10863            proc: self.proc.clone(),
10864            selection: query,
10865            graphql_client: self.graphql_client.clone(),
10866        }
10867    }
10868    /// append the contents of a file to the llm context
10869    ///
10870    /// # Arguments
10871    ///
10872    /// * `file` - The file to read the prompt from
10873    pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
10874        let mut query = self.selection.select("withPromptFile");
10875        query = query.arg_lazy(
10876            "file",
10877            Box::new(move || {
10878                let file = file.clone();
10879                Box::pin(async move { file.into_id().await.unwrap().quote() })
10880            }),
10881        );
10882        Llm {
10883            proc: self.proc.clone(),
10884            selection: query,
10885            graphql_client: self.graphql_client.clone(),
10886        }
10887    }
10888    /// Use a static set of tools for method calls, e.g. for MCP clients that do not support dynamic tool registration
10889    pub fn with_static_tools(&self) -> Llm {
10890        let query = self.selection.select("withStaticTools");
10891        Llm {
10892            proc: self.proc.clone(),
10893            selection: query,
10894            graphql_client: self.graphql_client.clone(),
10895        }
10896    }
10897    /// Add a system prompt to the LLM's environment
10898    ///
10899    /// # Arguments
10900    ///
10901    /// * `prompt` - The system prompt to send
10902    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
10903        let mut query = self.selection.select("withSystemPrompt");
10904        query = query.arg("prompt", prompt.into());
10905        Llm {
10906            proc: self.proc.clone(),
10907            selection: query,
10908            graphql_client: self.graphql_client.clone(),
10909        }
10910    }
10911    /// Disable the default system prompt
10912    pub fn without_default_system_prompt(&self) -> Llm {
10913        let query = self.selection.select("withoutDefaultSystemPrompt");
10914        Llm {
10915            proc: self.proc.clone(),
10916            selection: query,
10917            graphql_client: self.graphql_client.clone(),
10918        }
10919    }
10920    /// Clear the message history, leaving only the system prompts
10921    pub fn without_message_history(&self) -> Llm {
10922        let query = self.selection.select("withoutMessageHistory");
10923        Llm {
10924            proc: self.proc.clone(),
10925            selection: query,
10926            graphql_client: self.graphql_client.clone(),
10927        }
10928    }
10929    /// Clear the system prompts, leaving only the default system prompt
10930    pub fn without_system_prompts(&self) -> Llm {
10931        let query = self.selection.select("withoutSystemPrompts");
10932        Llm {
10933            proc: self.proc.clone(),
10934            selection: query,
10935            graphql_client: self.graphql_client.clone(),
10936        }
10937    }
10938}
10939#[derive(Clone)]
10940pub struct LlmTokenUsage {
10941    pub proc: Option<Arc<DaggerSessionProc>>,
10942    pub selection: Selection,
10943    pub graphql_client: DynGraphQLClient,
10944}
10945impl LlmTokenUsage {
10946    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
10947        let query = self.selection.select("cachedTokenReads");
10948        query.execute(self.graphql_client.clone()).await
10949    }
10950    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
10951        let query = self.selection.select("cachedTokenWrites");
10952        query.execute(self.graphql_client.clone()).await
10953    }
10954    /// A unique identifier for this LLMTokenUsage.
10955    pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
10956        let query = self.selection.select("id");
10957        query.execute(self.graphql_client.clone()).await
10958    }
10959    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
10960        let query = self.selection.select("inputTokens");
10961        query.execute(self.graphql_client.clone()).await
10962    }
10963    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
10964        let query = self.selection.select("outputTokens");
10965        query.execute(self.graphql_client.clone()).await
10966    }
10967    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
10968        let query = self.selection.select("totalTokens");
10969        query.execute(self.graphql_client.clone()).await
10970    }
10971}
10972#[derive(Clone)]
10973pub struct Label {
10974    pub proc: Option<Arc<DaggerSessionProc>>,
10975    pub selection: Selection,
10976    pub graphql_client: DynGraphQLClient,
10977}
10978impl Label {
10979    /// A unique identifier for this Label.
10980    pub async fn id(&self) -> Result<LabelId, DaggerError> {
10981        let query = self.selection.select("id");
10982        query.execute(self.graphql_client.clone()).await
10983    }
10984    /// The label name.
10985    pub async fn name(&self) -> Result<String, DaggerError> {
10986        let query = self.selection.select("name");
10987        query.execute(self.graphql_client.clone()).await
10988    }
10989    /// The label value.
10990    pub async fn value(&self) -> Result<String, DaggerError> {
10991        let query = self.selection.select("value");
10992        query.execute(self.graphql_client.clone()).await
10993    }
10994}
10995#[derive(Clone)]
10996pub struct ListTypeDef {
10997    pub proc: Option<Arc<DaggerSessionProc>>,
10998    pub selection: Selection,
10999    pub graphql_client: DynGraphQLClient,
11000}
11001impl ListTypeDef {
11002    /// The type of the elements in the list.
11003    pub fn element_type_def(&self) -> TypeDef {
11004        let query = self.selection.select("elementTypeDef");
11005        TypeDef {
11006            proc: self.proc.clone(),
11007            selection: query,
11008            graphql_client: self.graphql_client.clone(),
11009        }
11010    }
11011    /// A unique identifier for this ListTypeDef.
11012    pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
11013        let query = self.selection.select("id");
11014        query.execute(self.graphql_client.clone()).await
11015    }
11016}
11017#[derive(Clone)]
11018pub struct Module {
11019    pub proc: Option<Arc<DaggerSessionProc>>,
11020    pub selection: Selection,
11021    pub graphql_client: DynGraphQLClient,
11022}
11023#[derive(Builder, Debug, PartialEq)]
11024pub struct ModuleChecksOpts<'a> {
11025    /// Only include checks matching the specified patterns
11026    #[builder(setter(into, strip_option), default)]
11027    pub include: Option<Vec<&'a str>>,
11028}
11029#[derive(Builder, Debug, PartialEq)]
11030pub struct ModuleGeneratorsOpts<'a> {
11031    /// Only include generators matching the specified patterns
11032    #[builder(setter(into, strip_option), default)]
11033    pub include: Option<Vec<&'a str>>,
11034}
11035#[derive(Builder, Debug, PartialEq)]
11036pub struct ModuleServeOpts {
11037    /// Expose the dependencies of this module to the client
11038    #[builder(setter(into, strip_option), default)]
11039    pub include_dependencies: Option<bool>,
11040}
11041impl Module {
11042    /// Return the check defined by the module with the given name. Must match to exactly one check.
11043    ///
11044    /// # Arguments
11045    ///
11046    /// * `name` - The name of the check to retrieve
11047    pub fn check(&self, name: impl Into<String>) -> Check {
11048        let mut query = self.selection.select("check");
11049        query = query.arg("name", name.into());
11050        Check {
11051            proc: self.proc.clone(),
11052            selection: query,
11053            graphql_client: self.graphql_client.clone(),
11054        }
11055    }
11056    /// Return all checks defined by the module
11057    ///
11058    /// # Arguments
11059    ///
11060    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11061    pub fn checks(&self) -> CheckGroup {
11062        let query = self.selection.select("checks");
11063        CheckGroup {
11064            proc: self.proc.clone(),
11065            selection: query,
11066            graphql_client: self.graphql_client.clone(),
11067        }
11068    }
11069    /// Return all checks defined by the module
11070    ///
11071    /// # Arguments
11072    ///
11073    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11074    pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
11075        let mut query = self.selection.select("checks");
11076        if let Some(include) = opts.include {
11077            query = query.arg("include", include);
11078        }
11079        CheckGroup {
11080            proc: self.proc.clone(),
11081            selection: query,
11082            graphql_client: self.graphql_client.clone(),
11083        }
11084    }
11085    /// The dependencies of the module.
11086    pub fn dependencies(&self) -> Vec<Module> {
11087        let query = self.selection.select("dependencies");
11088        vec![Module {
11089            proc: self.proc.clone(),
11090            selection: query,
11091            graphql_client: self.graphql_client.clone(),
11092        }]
11093    }
11094    /// The doc string of the module, if any
11095    pub async fn description(&self) -> Result<String, DaggerError> {
11096        let query = self.selection.select("description");
11097        query.execute(self.graphql_client.clone()).await
11098    }
11099    /// Enumerations served by this module.
11100    pub fn enums(&self) -> Vec<TypeDef> {
11101        let query = self.selection.select("enums");
11102        vec![TypeDef {
11103            proc: self.proc.clone(),
11104            selection: query,
11105            graphql_client: self.graphql_client.clone(),
11106        }]
11107    }
11108    /// The generated files and directories made on top of the module source's context directory.
11109    pub fn generated_context_directory(&self) -> Directory {
11110        let query = self.selection.select("generatedContextDirectory");
11111        Directory {
11112            proc: self.proc.clone(),
11113            selection: query,
11114            graphql_client: self.graphql_client.clone(),
11115        }
11116    }
11117    /// Return the generator defined by the module with the given name. Must match to exactly one generator.
11118    ///
11119    /// # Arguments
11120    ///
11121    /// * `name` - The name of the generator to retrieve
11122    pub fn generator(&self, name: impl Into<String>) -> Generator {
11123        let mut query = self.selection.select("generator");
11124        query = query.arg("name", name.into());
11125        Generator {
11126            proc: self.proc.clone(),
11127            selection: query,
11128            graphql_client: self.graphql_client.clone(),
11129        }
11130    }
11131    /// Return all generators defined by the module
11132    ///
11133    /// # Arguments
11134    ///
11135    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11136    pub fn generators(&self) -> GeneratorGroup {
11137        let query = self.selection.select("generators");
11138        GeneratorGroup {
11139            proc: self.proc.clone(),
11140            selection: query,
11141            graphql_client: self.graphql_client.clone(),
11142        }
11143    }
11144    /// Return all generators defined by the module
11145    ///
11146    /// # Arguments
11147    ///
11148    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11149    pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
11150        let mut query = self.selection.select("generators");
11151        if let Some(include) = opts.include {
11152            query = query.arg("include", include);
11153        }
11154        GeneratorGroup {
11155            proc: self.proc.clone(),
11156            selection: query,
11157            graphql_client: self.graphql_client.clone(),
11158        }
11159    }
11160    /// A unique identifier for this Module.
11161    pub async fn id(&self) -> Result<ModuleId, DaggerError> {
11162        let query = self.selection.select("id");
11163        query.execute(self.graphql_client.clone()).await
11164    }
11165    /// Interfaces served by this module.
11166    pub fn interfaces(&self) -> Vec<TypeDef> {
11167        let query = self.selection.select("interfaces");
11168        vec![TypeDef {
11169            proc: self.proc.clone(),
11170            selection: query,
11171            graphql_client: self.graphql_client.clone(),
11172        }]
11173    }
11174    /// The introspection schema JSON file for this module.
11175    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
11176    /// Note: this is in the context of a module, so some core types may be hidden.
11177    pub fn introspection_schema_json(&self) -> File {
11178        let query = self.selection.select("introspectionSchemaJSON");
11179        File {
11180            proc: self.proc.clone(),
11181            selection: query,
11182            graphql_client: self.graphql_client.clone(),
11183        }
11184    }
11185    /// The name of the module
11186    pub async fn name(&self) -> Result<String, DaggerError> {
11187        let query = self.selection.select("name");
11188        query.execute(self.graphql_client.clone()).await
11189    }
11190    /// Objects served by this module.
11191    pub fn objects(&self) -> Vec<TypeDef> {
11192        let query = self.selection.select("objects");
11193        vec![TypeDef {
11194            proc: self.proc.clone(),
11195            selection: query,
11196            graphql_client: self.graphql_client.clone(),
11197        }]
11198    }
11199    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
11200    pub fn runtime(&self) -> Container {
11201        let query = self.selection.select("runtime");
11202        Container {
11203            proc: self.proc.clone(),
11204            selection: query,
11205            graphql_client: self.graphql_client.clone(),
11206        }
11207    }
11208    /// The SDK config used by this module.
11209    pub fn sdk(&self) -> SdkConfig {
11210        let query = self.selection.select("sdk");
11211        SdkConfig {
11212            proc: self.proc.clone(),
11213            selection: query,
11214            graphql_client: self.graphql_client.clone(),
11215        }
11216    }
11217    /// Serve a module's API in the current session.
11218    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11219    ///
11220    /// # Arguments
11221    ///
11222    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11223    pub async fn serve(&self) -> Result<Void, DaggerError> {
11224        let query = self.selection.select("serve");
11225        query.execute(self.graphql_client.clone()).await
11226    }
11227    /// Serve a module's API in the current session.
11228    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11229    ///
11230    /// # Arguments
11231    ///
11232    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11233    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
11234        let mut query = self.selection.select("serve");
11235        if let Some(include_dependencies) = opts.include_dependencies {
11236            query = query.arg("includeDependencies", include_dependencies);
11237        }
11238        query.execute(self.graphql_client.clone()).await
11239    }
11240    /// The source for the module.
11241    pub fn source(&self) -> ModuleSource {
11242        let query = self.selection.select("source");
11243        ModuleSource {
11244            proc: self.proc.clone(),
11245            selection: query,
11246            graphql_client: self.graphql_client.clone(),
11247        }
11248    }
11249    /// Forces evaluation of the module, including any loading into the engine and associated validation.
11250    pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
11251        let query = self.selection.select("sync");
11252        query.execute(self.graphql_client.clone()).await
11253    }
11254    /// User-defined default values, loaded from local .env files.
11255    pub fn user_defaults(&self) -> EnvFile {
11256        let query = self.selection.select("userDefaults");
11257        EnvFile {
11258            proc: self.proc.clone(),
11259            selection: query,
11260            graphql_client: self.graphql_client.clone(),
11261        }
11262    }
11263    /// Retrieves the module with the given description
11264    ///
11265    /// # Arguments
11266    ///
11267    /// * `description` - The description to set
11268    pub fn with_description(&self, description: impl Into<String>) -> Module {
11269        let mut query = self.selection.select("withDescription");
11270        query = query.arg("description", description.into());
11271        Module {
11272            proc: self.proc.clone(),
11273            selection: query,
11274            graphql_client: self.graphql_client.clone(),
11275        }
11276    }
11277    /// This module plus the given Enum type and associated values
11278    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
11279        let mut query = self.selection.select("withEnum");
11280        query = query.arg_lazy(
11281            "enum",
11282            Box::new(move || {
11283                let r#enum = r#enum.clone();
11284                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
11285            }),
11286        );
11287        Module {
11288            proc: self.proc.clone(),
11289            selection: query,
11290            graphql_client: self.graphql_client.clone(),
11291        }
11292    }
11293    /// This module plus the given Interface type and associated functions
11294    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
11295        let mut query = self.selection.select("withInterface");
11296        query = query.arg_lazy(
11297            "iface",
11298            Box::new(move || {
11299                let iface = iface.clone();
11300                Box::pin(async move { iface.into_id().await.unwrap().quote() })
11301            }),
11302        );
11303        Module {
11304            proc: self.proc.clone(),
11305            selection: query,
11306            graphql_client: self.graphql_client.clone(),
11307        }
11308    }
11309    /// This module plus the given Object type and associated functions.
11310    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
11311        let mut query = self.selection.select("withObject");
11312        query = query.arg_lazy(
11313            "object",
11314            Box::new(move || {
11315                let object = object.clone();
11316                Box::pin(async move { object.into_id().await.unwrap().quote() })
11317            }),
11318        );
11319        Module {
11320            proc: self.proc.clone(),
11321            selection: query,
11322            graphql_client: self.graphql_client.clone(),
11323        }
11324    }
11325}
11326#[derive(Clone)]
11327pub struct ModuleConfigClient {
11328    pub proc: Option<Arc<DaggerSessionProc>>,
11329    pub selection: Selection,
11330    pub graphql_client: DynGraphQLClient,
11331}
11332impl ModuleConfigClient {
11333    /// The directory the client is generated in.
11334    pub async fn directory(&self) -> Result<String, DaggerError> {
11335        let query = self.selection.select("directory");
11336        query.execute(self.graphql_client.clone()).await
11337    }
11338    /// The generator to use
11339    pub async fn generator(&self) -> Result<String, DaggerError> {
11340        let query = self.selection.select("generator");
11341        query.execute(self.graphql_client.clone()).await
11342    }
11343    /// A unique identifier for this ModuleConfigClient.
11344    pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
11345        let query = self.selection.select("id");
11346        query.execute(self.graphql_client.clone()).await
11347    }
11348}
11349#[derive(Clone)]
11350pub struct ModuleSource {
11351    pub proc: Option<Arc<DaggerSessionProc>>,
11352    pub selection: Selection,
11353    pub graphql_client: DynGraphQLClient,
11354}
11355impl ModuleSource {
11356    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
11357    pub fn as_module(&self) -> Module {
11358        let query = self.selection.select("asModule");
11359        Module {
11360            proc: self.proc.clone(),
11361            selection: query,
11362            graphql_client: self.graphql_client.clone(),
11363        }
11364    }
11365    /// A human readable ref string representation of this module source.
11366    pub async fn as_string(&self) -> Result<String, DaggerError> {
11367        let query = self.selection.select("asString");
11368        query.execute(self.graphql_client.clone()).await
11369    }
11370    /// The blueprint referenced by the module source.
11371    pub fn blueprint(&self) -> ModuleSource {
11372        let query = self.selection.select("blueprint");
11373        ModuleSource {
11374            proc: self.proc.clone(),
11375            selection: query,
11376            graphql_client: self.graphql_client.clone(),
11377        }
11378    }
11379    /// The ref to clone the root of the git repo from. Only valid for git sources.
11380    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
11381        let query = self.selection.select("cloneRef");
11382        query.execute(self.graphql_client.clone()).await
11383    }
11384    /// The resolved commit of the git repo this source points to.
11385    pub async fn commit(&self) -> Result<String, DaggerError> {
11386        let query = self.selection.select("commit");
11387        query.execute(self.graphql_client.clone()).await
11388    }
11389    /// The clients generated for the module.
11390    pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
11391        let query = self.selection.select("configClients");
11392        vec![ModuleConfigClient {
11393            proc: self.proc.clone(),
11394            selection: query,
11395            graphql_client: self.graphql_client.clone(),
11396        }]
11397    }
11398    /// Whether an existing dagger.json for the module was found.
11399    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
11400        let query = self.selection.select("configExists");
11401        query.execute(self.graphql_client.clone()).await
11402    }
11403    /// The full directory loaded for the module source, including the source code as a subdirectory.
11404    pub fn context_directory(&self) -> Directory {
11405        let query = self.selection.select("contextDirectory");
11406        Directory {
11407            proc: self.proc.clone(),
11408            selection: query,
11409            graphql_client: self.graphql_client.clone(),
11410        }
11411    }
11412    /// The dependencies of the module source.
11413    pub fn dependencies(&self) -> Vec<ModuleSource> {
11414        let query = self.selection.select("dependencies");
11415        vec![ModuleSource {
11416            proc: self.proc.clone(),
11417            selection: query,
11418            graphql_client: self.graphql_client.clone(),
11419        }]
11420    }
11421    /// 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.
11422    pub async fn digest(&self) -> Result<String, DaggerError> {
11423        let query = self.selection.select("digest");
11424        query.execute(self.graphql_client.clone()).await
11425    }
11426    /// The directory containing the module configuration and source code (source code may be in a subdir).
11427    ///
11428    /// # Arguments
11429    ///
11430    /// * `path` - A subpath from the source directory to select.
11431    pub fn directory(&self, path: impl Into<String>) -> Directory {
11432        let mut query = self.selection.select("directory");
11433        query = query.arg("path", path.into());
11434        Directory {
11435            proc: self.proc.clone(),
11436            selection: query,
11437            graphql_client: self.graphql_client.clone(),
11438        }
11439    }
11440    /// The engine version of the module.
11441    pub async fn engine_version(&self) -> Result<String, DaggerError> {
11442        let query = self.selection.select("engineVersion");
11443        query.execute(self.graphql_client.clone()).await
11444    }
11445    /// The generated files and directories made on top of the module source's context directory, returned as a Changeset.
11446    pub fn generated_context_changeset(&self) -> Changeset {
11447        let query = self.selection.select("generatedContextChangeset");
11448        Changeset {
11449            proc: self.proc.clone(),
11450            selection: query,
11451            graphql_client: self.graphql_client.clone(),
11452        }
11453    }
11454    /// The generated files and directories made on top of the module source's context directory.
11455    pub fn generated_context_directory(&self) -> Directory {
11456        let query = self.selection.select("generatedContextDirectory");
11457        Directory {
11458            proc: self.proc.clone(),
11459            selection: query,
11460            graphql_client: self.graphql_client.clone(),
11461        }
11462    }
11463    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
11464    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
11465        let query = self.selection.select("htmlRepoURL");
11466        query.execute(self.graphql_client.clone()).await
11467    }
11468    /// The URL to the source's git repo in a web browser. Only valid for git sources.
11469    pub async fn html_url(&self) -> Result<String, DaggerError> {
11470        let query = self.selection.select("htmlURL");
11471        query.execute(self.graphql_client.clone()).await
11472    }
11473    /// A unique identifier for this ModuleSource.
11474    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
11475        let query = self.selection.select("id");
11476        query.execute(self.graphql_client.clone()).await
11477    }
11478    /// The introspection schema JSON file for this module source.
11479    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
11480    /// Note: this is in the context of a module, so some core types may be hidden.
11481    pub fn introspection_schema_json(&self) -> File {
11482        let query = self.selection.select("introspectionSchemaJSON");
11483        File {
11484            proc: self.proc.clone(),
11485            selection: query,
11486            graphql_client: self.graphql_client.clone(),
11487        }
11488    }
11489    /// The kind of module source (currently local, git or dir).
11490    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
11491        let query = self.selection.select("kind");
11492        query.execute(self.graphql_client.clone()).await
11493    }
11494    /// 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.
11495    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
11496        let query = self.selection.select("localContextDirectoryPath");
11497        query.execute(self.graphql_client.clone()).await
11498    }
11499    /// The name of the module, including any setting via the withName API.
11500    pub async fn module_name(&self) -> Result<String, DaggerError> {
11501        let query = self.selection.select("moduleName");
11502        query.execute(self.graphql_client.clone()).await
11503    }
11504    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
11505    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
11506        let query = self.selection.select("moduleOriginalName");
11507        query.execute(self.graphql_client.clone()).await
11508    }
11509    /// The original subpath used when instantiating this module source, relative to the context directory.
11510    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
11511        let query = self.selection.select("originalSubpath");
11512        query.execute(self.graphql_client.clone()).await
11513    }
11514    /// The pinned version of this module source.
11515    pub async fn pin(&self) -> Result<String, DaggerError> {
11516        let query = self.selection.select("pin");
11517        query.execute(self.graphql_client.clone()).await
11518    }
11519    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
11520    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
11521        let query = self.selection.select("repoRootPath");
11522        query.execute(self.graphql_client.clone()).await
11523    }
11524    /// The SDK configuration of the module.
11525    pub fn sdk(&self) -> SdkConfig {
11526        let query = self.selection.select("sdk");
11527        SdkConfig {
11528            proc: self.proc.clone(),
11529            selection: query,
11530            graphql_client: self.graphql_client.clone(),
11531        }
11532    }
11533    /// The path, relative to the context directory, that contains the module's dagger.json.
11534    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
11535        let query = self.selection.select("sourceRootSubpath");
11536        query.execute(self.graphql_client.clone()).await
11537    }
11538    /// The path to the directory containing the module's source code, relative to the context directory.
11539    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
11540        let query = self.selection.select("sourceSubpath");
11541        query.execute(self.graphql_client.clone()).await
11542    }
11543    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
11544    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
11545        let query = self.selection.select("sync");
11546        query.execute(self.graphql_client.clone()).await
11547    }
11548    /// The toolchains referenced by the module source.
11549    pub fn toolchains(&self) -> Vec<ModuleSource> {
11550        let query = self.selection.select("toolchains");
11551        vec![ModuleSource {
11552            proc: self.proc.clone(),
11553            selection: query,
11554            graphql_client: self.graphql_client.clone(),
11555        }]
11556    }
11557    /// User-defined defaults read from local .env files
11558    pub fn user_defaults(&self) -> EnvFile {
11559        let query = self.selection.select("userDefaults");
11560        EnvFile {
11561            proc: self.proc.clone(),
11562            selection: query,
11563            graphql_client: self.graphql_client.clone(),
11564        }
11565    }
11566    /// The specified version of the git repo this source points to.
11567    pub async fn version(&self) -> Result<String, DaggerError> {
11568        let query = self.selection.select("version");
11569        query.execute(self.graphql_client.clone()).await
11570    }
11571    /// Set a blueprint for the module source.
11572    ///
11573    /// # Arguments
11574    ///
11575    /// * `blueprint` - The blueprint module to set.
11576    pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
11577        let mut query = self.selection.select("withBlueprint");
11578        query = query.arg_lazy(
11579            "blueprint",
11580            Box::new(move || {
11581                let blueprint = blueprint.clone();
11582                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
11583            }),
11584        );
11585        ModuleSource {
11586            proc: self.proc.clone(),
11587            selection: query,
11588            graphql_client: self.graphql_client.clone(),
11589        }
11590    }
11591    /// Update the module source with a new client to generate.
11592    ///
11593    /// # Arguments
11594    ///
11595    /// * `generator` - The generator to use
11596    /// * `output_dir` - The output directory for the generated client.
11597    pub fn with_client(
11598        &self,
11599        generator: impl Into<String>,
11600        output_dir: impl Into<String>,
11601    ) -> ModuleSource {
11602        let mut query = self.selection.select("withClient");
11603        query = query.arg("generator", generator.into());
11604        query = query.arg("outputDir", output_dir.into());
11605        ModuleSource {
11606            proc: self.proc.clone(),
11607            selection: query,
11608            graphql_client: self.graphql_client.clone(),
11609        }
11610    }
11611    /// Append the provided dependencies to the module source's dependency list.
11612    ///
11613    /// # Arguments
11614    ///
11615    /// * `dependencies` - The dependencies to append.
11616    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
11617        let mut query = self.selection.select("withDependencies");
11618        query = query.arg("dependencies", dependencies);
11619        ModuleSource {
11620            proc: self.proc.clone(),
11621            selection: query,
11622            graphql_client: self.graphql_client.clone(),
11623        }
11624    }
11625    /// Upgrade the engine version of the module to the given value.
11626    ///
11627    /// # Arguments
11628    ///
11629    /// * `version` - The engine version to upgrade to.
11630    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
11631        let mut query = self.selection.select("withEngineVersion");
11632        query = query.arg("version", version.into());
11633        ModuleSource {
11634            proc: self.proc.clone(),
11635            selection: query,
11636            graphql_client: self.graphql_client.clone(),
11637        }
11638    }
11639    /// Enable the experimental features for the module source.
11640    ///
11641    /// # Arguments
11642    ///
11643    /// * `features` - The experimental features to enable.
11644    pub fn with_experimental_features(
11645        &self,
11646        features: Vec<ModuleSourceExperimentalFeature>,
11647    ) -> ModuleSource {
11648        let mut query = self.selection.select("withExperimentalFeatures");
11649        query = query.arg("features", features);
11650        ModuleSource {
11651            proc: self.proc.clone(),
11652            selection: query,
11653            graphql_client: self.graphql_client.clone(),
11654        }
11655    }
11656    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
11657    ///
11658    /// # Arguments
11659    ///
11660    /// * `patterns` - The new additional include patterns.
11661    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
11662        let mut query = self.selection.select("withIncludes");
11663        query = query.arg(
11664            "patterns",
11665            patterns
11666                .into_iter()
11667                .map(|i| i.into())
11668                .collect::<Vec<String>>(),
11669        );
11670        ModuleSource {
11671            proc: self.proc.clone(),
11672            selection: query,
11673            graphql_client: self.graphql_client.clone(),
11674        }
11675    }
11676    /// Update the module source with a new name.
11677    ///
11678    /// # Arguments
11679    ///
11680    /// * `name` - The name to set.
11681    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
11682        let mut query = self.selection.select("withName");
11683        query = query.arg("name", name.into());
11684        ModuleSource {
11685            proc: self.proc.clone(),
11686            selection: query,
11687            graphql_client: self.graphql_client.clone(),
11688        }
11689    }
11690    /// Update the module source with a new SDK.
11691    ///
11692    /// # Arguments
11693    ///
11694    /// * `source` - The SDK source to set.
11695    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
11696        let mut query = self.selection.select("withSDK");
11697        query = query.arg("source", source.into());
11698        ModuleSource {
11699            proc: self.proc.clone(),
11700            selection: query,
11701            graphql_client: self.graphql_client.clone(),
11702        }
11703    }
11704    /// Update the module source with a new source subpath.
11705    ///
11706    /// # Arguments
11707    ///
11708    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
11709    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
11710        let mut query = self.selection.select("withSourceSubpath");
11711        query = query.arg("path", path.into());
11712        ModuleSource {
11713            proc: self.proc.clone(),
11714            selection: query,
11715            graphql_client: self.graphql_client.clone(),
11716        }
11717    }
11718    /// Add toolchains to the module source.
11719    ///
11720    /// # Arguments
11721    ///
11722    /// * `toolchains` - The toolchain modules to add.
11723    pub fn with_toolchains(&self, toolchains: Vec<ModuleSourceId>) -> ModuleSource {
11724        let mut query = self.selection.select("withToolchains");
11725        query = query.arg("toolchains", toolchains);
11726        ModuleSource {
11727            proc: self.proc.clone(),
11728            selection: query,
11729            graphql_client: self.graphql_client.clone(),
11730        }
11731    }
11732    /// Update the blueprint module to the latest version.
11733    pub fn with_update_blueprint(&self) -> ModuleSource {
11734        let query = self.selection.select("withUpdateBlueprint");
11735        ModuleSource {
11736            proc: self.proc.clone(),
11737            selection: query,
11738            graphql_client: self.graphql_client.clone(),
11739        }
11740    }
11741    /// Update one or more module dependencies.
11742    ///
11743    /// # Arguments
11744    ///
11745    /// * `dependencies` - The dependencies to update.
11746    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
11747        let mut query = self.selection.select("withUpdateDependencies");
11748        query = query.arg(
11749            "dependencies",
11750            dependencies
11751                .into_iter()
11752                .map(|i| i.into())
11753                .collect::<Vec<String>>(),
11754        );
11755        ModuleSource {
11756            proc: self.proc.clone(),
11757            selection: query,
11758            graphql_client: self.graphql_client.clone(),
11759        }
11760    }
11761    /// Update one or more toolchains.
11762    ///
11763    /// # Arguments
11764    ///
11765    /// * `toolchains` - The toolchains to update.
11766    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
11767        let mut query = self.selection.select("withUpdateToolchains");
11768        query = query.arg(
11769            "toolchains",
11770            toolchains
11771                .into_iter()
11772                .map(|i| i.into())
11773                .collect::<Vec<String>>(),
11774        );
11775        ModuleSource {
11776            proc: self.proc.clone(),
11777            selection: query,
11778            graphql_client: self.graphql_client.clone(),
11779        }
11780    }
11781    /// Update one or more clients.
11782    ///
11783    /// # Arguments
11784    ///
11785    /// * `clients` - The clients to update
11786    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
11787        let mut query = self.selection.select("withUpdatedClients");
11788        query = query.arg(
11789            "clients",
11790            clients
11791                .into_iter()
11792                .map(|i| i.into())
11793                .collect::<Vec<String>>(),
11794        );
11795        ModuleSource {
11796            proc: self.proc.clone(),
11797            selection: query,
11798            graphql_client: self.graphql_client.clone(),
11799        }
11800    }
11801    /// Remove the current blueprint from the module source.
11802    pub fn without_blueprint(&self) -> ModuleSource {
11803        let query = self.selection.select("withoutBlueprint");
11804        ModuleSource {
11805            proc: self.proc.clone(),
11806            selection: query,
11807            graphql_client: self.graphql_client.clone(),
11808        }
11809    }
11810    /// Remove a client from the module source.
11811    ///
11812    /// # Arguments
11813    ///
11814    /// * `path` - The path of the client to remove.
11815    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
11816        let mut query = self.selection.select("withoutClient");
11817        query = query.arg("path", path.into());
11818        ModuleSource {
11819            proc: self.proc.clone(),
11820            selection: query,
11821            graphql_client: self.graphql_client.clone(),
11822        }
11823    }
11824    /// Remove the provided dependencies from the module source's dependency list.
11825    ///
11826    /// # Arguments
11827    ///
11828    /// * `dependencies` - The dependencies to remove.
11829    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
11830        let mut query = self.selection.select("withoutDependencies");
11831        query = query.arg(
11832            "dependencies",
11833            dependencies
11834                .into_iter()
11835                .map(|i| i.into())
11836                .collect::<Vec<String>>(),
11837        );
11838        ModuleSource {
11839            proc: self.proc.clone(),
11840            selection: query,
11841            graphql_client: self.graphql_client.clone(),
11842        }
11843    }
11844    /// Disable experimental features for the module source.
11845    ///
11846    /// # Arguments
11847    ///
11848    /// * `features` - The experimental features to disable.
11849    pub fn without_experimental_features(
11850        &self,
11851        features: Vec<ModuleSourceExperimentalFeature>,
11852    ) -> ModuleSource {
11853        let mut query = self.selection.select("withoutExperimentalFeatures");
11854        query = query.arg("features", features);
11855        ModuleSource {
11856            proc: self.proc.clone(),
11857            selection: query,
11858            graphql_client: self.graphql_client.clone(),
11859        }
11860    }
11861    /// Remove the provided toolchains from the module source.
11862    ///
11863    /// # Arguments
11864    ///
11865    /// * `toolchains` - The toolchains to remove.
11866    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
11867        let mut query = self.selection.select("withoutToolchains");
11868        query = query.arg(
11869            "toolchains",
11870            toolchains
11871                .into_iter()
11872                .map(|i| i.into())
11873                .collect::<Vec<String>>(),
11874        );
11875        ModuleSource {
11876            proc: self.proc.clone(),
11877            selection: query,
11878            graphql_client: self.graphql_client.clone(),
11879        }
11880    }
11881}
11882#[derive(Clone)]
11883pub struct ObjectTypeDef {
11884    pub proc: Option<Arc<DaggerSessionProc>>,
11885    pub selection: Selection,
11886    pub graphql_client: DynGraphQLClient,
11887}
11888impl ObjectTypeDef {
11889    /// The function used to construct new instances of this object, if any
11890    pub fn constructor(&self) -> Function {
11891        let query = self.selection.select("constructor");
11892        Function {
11893            proc: self.proc.clone(),
11894            selection: query,
11895            graphql_client: self.graphql_client.clone(),
11896        }
11897    }
11898    /// The reason this enum member is deprecated, if any.
11899    pub async fn deprecated(&self) -> Result<String, DaggerError> {
11900        let query = self.selection.select("deprecated");
11901        query.execute(self.graphql_client.clone()).await
11902    }
11903    /// The doc string for the object, if any.
11904    pub async fn description(&self) -> Result<String, DaggerError> {
11905        let query = self.selection.select("description");
11906        query.execute(self.graphql_client.clone()).await
11907    }
11908    /// Static fields defined on this object, if any.
11909    pub fn fields(&self) -> Vec<FieldTypeDef> {
11910        let query = self.selection.select("fields");
11911        vec![FieldTypeDef {
11912            proc: self.proc.clone(),
11913            selection: query,
11914            graphql_client: self.graphql_client.clone(),
11915        }]
11916    }
11917    /// Functions defined on this object, if any.
11918    pub fn functions(&self) -> Vec<Function> {
11919        let query = self.selection.select("functions");
11920        vec![Function {
11921            proc: self.proc.clone(),
11922            selection: query,
11923            graphql_client: self.graphql_client.clone(),
11924        }]
11925    }
11926    /// A unique identifier for this ObjectTypeDef.
11927    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
11928        let query = self.selection.select("id");
11929        query.execute(self.graphql_client.clone()).await
11930    }
11931    /// The name of the object.
11932    pub async fn name(&self) -> Result<String, DaggerError> {
11933        let query = self.selection.select("name");
11934        query.execute(self.graphql_client.clone()).await
11935    }
11936    /// The location of this object declaration.
11937    pub fn source_map(&self) -> SourceMap {
11938        let query = self.selection.select("sourceMap");
11939        SourceMap {
11940            proc: self.proc.clone(),
11941            selection: query,
11942            graphql_client: self.graphql_client.clone(),
11943        }
11944    }
11945    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
11946    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
11947        let query = self.selection.select("sourceModuleName");
11948        query.execute(self.graphql_client.clone()).await
11949    }
11950}
11951#[derive(Clone)]
11952pub struct Port {
11953    pub proc: Option<Arc<DaggerSessionProc>>,
11954    pub selection: Selection,
11955    pub graphql_client: DynGraphQLClient,
11956}
11957impl Port {
11958    /// The port description.
11959    pub async fn description(&self) -> Result<String, DaggerError> {
11960        let query = self.selection.select("description");
11961        query.execute(self.graphql_client.clone()).await
11962    }
11963    /// Skip the health check when run as a service.
11964    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
11965        let query = self.selection.select("experimentalSkipHealthcheck");
11966        query.execute(self.graphql_client.clone()).await
11967    }
11968    /// A unique identifier for this Port.
11969    pub async fn id(&self) -> Result<PortId, DaggerError> {
11970        let query = self.selection.select("id");
11971        query.execute(self.graphql_client.clone()).await
11972    }
11973    /// The port number.
11974    pub async fn port(&self) -> Result<isize, DaggerError> {
11975        let query = self.selection.select("port");
11976        query.execute(self.graphql_client.clone()).await
11977    }
11978    /// The transport layer protocol.
11979    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
11980        let query = self.selection.select("protocol");
11981        query.execute(self.graphql_client.clone()).await
11982    }
11983}
11984#[derive(Clone)]
11985pub struct Query {
11986    pub proc: Option<Arc<DaggerSessionProc>>,
11987    pub selection: Selection,
11988    pub graphql_client: DynGraphQLClient,
11989}
11990#[derive(Builder, Debug, PartialEq)]
11991pub struct QueryContainerOpts {
11992    /// Platform to initialize the container with. Defaults to the native platform of the current engine
11993    #[builder(setter(into, strip_option), default)]
11994    pub platform: Option<Platform>,
11995}
11996#[derive(Builder, Debug, PartialEq)]
11997pub struct QueryCurrentWorkspaceOpts {
11998    /// If true, skip legacy dagger.json migration checks.
11999    #[builder(setter(into, strip_option), default)]
12000    pub skip_migration_check: Option<bool>,
12001}
12002#[derive(Builder, Debug, PartialEq)]
12003pub struct QueryEnvOpts {
12004    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
12005    #[builder(setter(into, strip_option), default)]
12006    pub privileged: Option<bool>,
12007    /// Allow new outputs to be declared and saved in the environment
12008    #[builder(setter(into, strip_option), default)]
12009    pub writable: Option<bool>,
12010}
12011#[derive(Builder, Debug, PartialEq)]
12012pub struct QueryEnvFileOpts {
12013    /// Replace "${VAR}" or "$VAR" with the value of other vars
12014    #[builder(setter(into, strip_option), default)]
12015    pub expand: Option<bool>,
12016}
12017#[derive(Builder, Debug, PartialEq)]
12018pub struct QueryFileOpts {
12019    /// Permissions of the new file. Example: 0600
12020    #[builder(setter(into, strip_option), default)]
12021    pub permissions: Option<isize>,
12022}
12023#[derive(Builder, Debug, PartialEq)]
12024pub struct QueryGitOpts<'a> {
12025    /// A service which must be started before the repo is fetched.
12026    #[builder(setter(into, strip_option), default)]
12027    pub experimental_service_host: Option<ServiceId>,
12028    /// Secret used to populate the Authorization HTTP header
12029    #[builder(setter(into, strip_option), default)]
12030    pub http_auth_header: Option<SecretId>,
12031    /// Secret used to populate the password during basic HTTP Authorization
12032    #[builder(setter(into, strip_option), default)]
12033    pub http_auth_token: Option<SecretId>,
12034    /// Username used to populate the password during basic HTTP Authorization
12035    #[builder(setter(into, strip_option), default)]
12036    pub http_auth_username: Option<&'a str>,
12037    /// DEPRECATED: Set to true to keep .git directory.
12038    #[builder(setter(into, strip_option), default)]
12039    pub keep_git_dir: Option<bool>,
12040    /// Set SSH auth socket
12041    #[builder(setter(into, strip_option), default)]
12042    pub ssh_auth_socket: Option<SocketId>,
12043    /// Set SSH known hosts
12044    #[builder(setter(into, strip_option), default)]
12045    pub ssh_known_hosts: Option<&'a str>,
12046}
12047#[derive(Builder, Debug, PartialEq)]
12048pub struct QueryHttpOpts<'a> {
12049    /// Secret used to populate the Authorization HTTP header
12050    #[builder(setter(into, strip_option), default)]
12051    pub auth_header: Option<SecretId>,
12052    /// A service which must be started before the URL is fetched.
12053    #[builder(setter(into, strip_option), default)]
12054    pub experimental_service_host: Option<ServiceId>,
12055    /// File name to use for the file. Defaults to the last part of the URL.
12056    #[builder(setter(into, strip_option), default)]
12057    pub name: Option<&'a str>,
12058    /// Permissions to set on the file.
12059    #[builder(setter(into, strip_option), default)]
12060    pub permissions: Option<isize>,
12061}
12062#[derive(Builder, Debug, PartialEq)]
12063pub struct QueryLlmOpts<'a> {
12064    /// Cap the number of API calls for this LLM
12065    #[builder(setter(into, strip_option), default)]
12066    pub max_api_calls: Option<isize>,
12067    /// Model to use
12068    #[builder(setter(into, strip_option), default)]
12069    pub model: Option<&'a str>,
12070}
12071#[derive(Builder, Debug, PartialEq)]
12072pub struct QueryModuleSourceOpts<'a> {
12073    /// 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.
12074    #[builder(setter(into, strip_option), default)]
12075    pub allow_not_exists: Option<bool>,
12076    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
12077    #[builder(setter(into, strip_option), default)]
12078    pub disable_find_up: Option<bool>,
12079    /// The pinned version of the module source
12080    #[builder(setter(into, strip_option), default)]
12081    pub ref_pin: Option<&'a str>,
12082    /// If set, error out if the ref string is not of the provided requireKind.
12083    #[builder(setter(into, strip_option), default)]
12084    pub require_kind: Option<ModuleSourceKind>,
12085}
12086#[derive(Builder, Debug, PartialEq)]
12087pub struct QuerySecretOpts<'a> {
12088    /// 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.
12089    /// 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.
12090    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
12091    #[builder(setter(into, strip_option), default)]
12092    pub cache_key: Option<&'a str>,
12093}
12094impl Query {
12095    /// initialize an address to load directories, containers, secrets or other object types.
12096    pub fn address(&self, value: impl Into<String>) -> Address {
12097        let mut query = self.selection.select("address");
12098        query = query.arg("value", value.into());
12099        Address {
12100            proc: self.proc.clone(),
12101            selection: query,
12102            graphql_client: self.graphql_client.clone(),
12103        }
12104    }
12105    /// Constructs a cache volume for a given cache key.
12106    ///
12107    /// # Arguments
12108    ///
12109    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
12110    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
12111        let mut query = self.selection.select("cacheVolume");
12112        query = query.arg("key", key.into());
12113        CacheVolume {
12114            proc: self.proc.clone(),
12115            selection: query,
12116            graphql_client: self.graphql_client.clone(),
12117        }
12118    }
12119    /// Creates an empty changeset
12120    pub fn changeset(&self) -> Changeset {
12121        let query = self.selection.select("changeset");
12122        Changeset {
12123            proc: self.proc.clone(),
12124            selection: query,
12125            graphql_client: self.graphql_client.clone(),
12126        }
12127    }
12128    /// Dagger Cloud configuration and state
12129    pub fn cloud(&self) -> Cloud {
12130        let query = self.selection.select("cloud");
12131        Cloud {
12132            proc: self.proc.clone(),
12133            selection: query,
12134            graphql_client: self.graphql_client.clone(),
12135        }
12136    }
12137    /// Creates a scratch container, with no image or metadata.
12138    /// To pull an image, follow up with the "from" function.
12139    ///
12140    /// # Arguments
12141    ///
12142    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12143    pub fn container(&self) -> Container {
12144        let query = self.selection.select("container");
12145        Container {
12146            proc: self.proc.clone(),
12147            selection: query,
12148            graphql_client: self.graphql_client.clone(),
12149        }
12150    }
12151    /// Creates a scratch container, with no image or metadata.
12152    /// To pull an image, follow up with the "from" function.
12153    ///
12154    /// # Arguments
12155    ///
12156    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12157    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
12158        let mut query = self.selection.select("container");
12159        if let Some(platform) = opts.platform {
12160            query = query.arg("platform", platform);
12161        }
12162        Container {
12163            proc: self.proc.clone(),
12164            selection: query,
12165            graphql_client: self.graphql_client.clone(),
12166        }
12167    }
12168    /// Returns the current environment
12169    /// When called from a function invoked via an LLM tool call, this will be the LLM's current environment, including any modifications made through calling tools. Env values returned by functions become the new environment for subsequent calls, and Changeset values returned by functions are applied to the environment's workspace.
12170    /// When called from a module function outside of an LLM, this returns an Env with the current module installed, and with the current module's source directory as its workspace.
12171    pub fn current_env(&self) -> Env {
12172        let query = self.selection.select("currentEnv");
12173        Env {
12174            proc: self.proc.clone(),
12175            selection: query,
12176            graphql_client: self.graphql_client.clone(),
12177        }
12178    }
12179    /// The FunctionCall context that the SDK caller is currently executing in.
12180    /// If the caller is not currently executing in a function, this will return an error.
12181    pub fn current_function_call(&self) -> FunctionCall {
12182        let query = self.selection.select("currentFunctionCall");
12183        FunctionCall {
12184            proc: self.proc.clone(),
12185            selection: query,
12186            graphql_client: self.graphql_client.clone(),
12187        }
12188    }
12189    /// The module currently being served in the session, if any.
12190    pub fn current_module(&self) -> CurrentModule {
12191        let query = self.selection.select("currentModule");
12192        CurrentModule {
12193            proc: self.proc.clone(),
12194            selection: query,
12195            graphql_client: self.graphql_client.clone(),
12196        }
12197    }
12198    /// The TypeDef representations of the objects currently being served in the session.
12199    pub fn current_type_defs(&self) -> Vec<TypeDef> {
12200        let query = self.selection.select("currentTypeDefs");
12201        vec![TypeDef {
12202            proc: self.proc.clone(),
12203            selection: query,
12204            graphql_client: self.graphql_client.clone(),
12205        }]
12206    }
12207    /// Detect and return the current workspace.
12208    ///
12209    /// # Arguments
12210    ///
12211    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12212    pub fn current_workspace(&self) -> Workspace {
12213        let query = self.selection.select("currentWorkspace");
12214        Workspace {
12215            proc: self.proc.clone(),
12216            selection: query,
12217            graphql_client: self.graphql_client.clone(),
12218        }
12219    }
12220    /// Detect and return the current workspace.
12221    ///
12222    /// # Arguments
12223    ///
12224    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12225    pub fn current_workspace_opts(&self, opts: QueryCurrentWorkspaceOpts) -> Workspace {
12226        let mut query = self.selection.select("currentWorkspace");
12227        if let Some(skip_migration_check) = opts.skip_migration_check {
12228            query = query.arg("skipMigrationCheck", skip_migration_check);
12229        }
12230        Workspace {
12231            proc: self.proc.clone(),
12232            selection: query,
12233            graphql_client: self.graphql_client.clone(),
12234        }
12235    }
12236    /// The default platform of the engine.
12237    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
12238        let query = self.selection.select("defaultPlatform");
12239        query.execute(self.graphql_client.clone()).await
12240    }
12241    /// Creates an empty directory.
12242    pub fn directory(&self) -> Directory {
12243        let query = self.selection.select("directory");
12244        Directory {
12245            proc: self.proc.clone(),
12246            selection: query,
12247            graphql_client: self.graphql_client.clone(),
12248        }
12249    }
12250    /// The Dagger engine container configuration and state
12251    pub fn engine(&self) -> Engine {
12252        let query = self.selection.select("engine");
12253        Engine {
12254            proc: self.proc.clone(),
12255            selection: query,
12256            graphql_client: self.graphql_client.clone(),
12257        }
12258    }
12259    /// Initializes a new environment
12260    ///
12261    /// # Arguments
12262    ///
12263    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12264    pub fn env(&self) -> Env {
12265        let query = self.selection.select("env");
12266        Env {
12267            proc: self.proc.clone(),
12268            selection: query,
12269            graphql_client: self.graphql_client.clone(),
12270        }
12271    }
12272    /// Initializes a new environment
12273    ///
12274    /// # Arguments
12275    ///
12276    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12277    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
12278        let mut query = self.selection.select("env");
12279        if let Some(privileged) = opts.privileged {
12280            query = query.arg("privileged", privileged);
12281        }
12282        if let Some(writable) = opts.writable {
12283            query = query.arg("writable", writable);
12284        }
12285        Env {
12286            proc: self.proc.clone(),
12287            selection: query,
12288            graphql_client: self.graphql_client.clone(),
12289        }
12290    }
12291    /// Initialize an environment file
12292    ///
12293    /// # Arguments
12294    ///
12295    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12296    pub fn env_file(&self) -> EnvFile {
12297        let query = self.selection.select("envFile");
12298        EnvFile {
12299            proc: self.proc.clone(),
12300            selection: query,
12301            graphql_client: self.graphql_client.clone(),
12302        }
12303    }
12304    /// Initialize an environment file
12305    ///
12306    /// # Arguments
12307    ///
12308    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12309    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
12310        let mut query = self.selection.select("envFile");
12311        if let Some(expand) = opts.expand {
12312            query = query.arg("expand", expand);
12313        }
12314        EnvFile {
12315            proc: self.proc.clone(),
12316            selection: query,
12317            graphql_client: self.graphql_client.clone(),
12318        }
12319    }
12320    /// Create a new error.
12321    ///
12322    /// # Arguments
12323    ///
12324    /// * `message` - A brief description of the error.
12325    pub fn error(&self, message: impl Into<String>) -> Error {
12326        let mut query = self.selection.select("error");
12327        query = query.arg("message", message.into());
12328        Error {
12329            proc: self.proc.clone(),
12330            selection: query,
12331            graphql_client: self.graphql_client.clone(),
12332        }
12333    }
12334    /// Creates a file with the specified contents.
12335    ///
12336    /// # Arguments
12337    ///
12338    /// * `name` - Name of the new file. Example: "foo.txt"
12339    /// * `contents` - Contents of the new file. Example: "Hello world!"
12340    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12341    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
12342        let mut query = self.selection.select("file");
12343        query = query.arg("name", name.into());
12344        query = query.arg("contents", contents.into());
12345        File {
12346            proc: self.proc.clone(),
12347            selection: query,
12348            graphql_client: self.graphql_client.clone(),
12349        }
12350    }
12351    /// Creates a file with the specified contents.
12352    ///
12353    /// # Arguments
12354    ///
12355    /// * `name` - Name of the new file. Example: "foo.txt"
12356    /// * `contents` - Contents of the new file. Example: "Hello world!"
12357    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12358    pub fn file_opts(
12359        &self,
12360        name: impl Into<String>,
12361        contents: impl Into<String>,
12362        opts: QueryFileOpts,
12363    ) -> File {
12364        let mut query = self.selection.select("file");
12365        query = query.arg("name", name.into());
12366        query = query.arg("contents", contents.into());
12367        if let Some(permissions) = opts.permissions {
12368            query = query.arg("permissions", permissions);
12369        }
12370        File {
12371            proc: self.proc.clone(),
12372            selection: query,
12373            graphql_client: self.graphql_client.clone(),
12374        }
12375    }
12376    /// Creates a function.
12377    ///
12378    /// # Arguments
12379    ///
12380    /// * `name` - Name of the function, in its original format from the implementation language.
12381    /// * `return_type` - Return type of the function.
12382    pub fn function(
12383        &self,
12384        name: impl Into<String>,
12385        return_type: impl IntoID<TypeDefId>,
12386    ) -> Function {
12387        let mut query = self.selection.select("function");
12388        query = query.arg("name", name.into());
12389        query = query.arg_lazy(
12390            "returnType",
12391            Box::new(move || {
12392                let return_type = return_type.clone();
12393                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
12394            }),
12395        );
12396        Function {
12397            proc: self.proc.clone(),
12398            selection: query,
12399            graphql_client: self.graphql_client.clone(),
12400        }
12401    }
12402    /// Create a code generation result, given a directory containing the generated code.
12403    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
12404        let mut query = self.selection.select("generatedCode");
12405        query = query.arg_lazy(
12406            "code",
12407            Box::new(move || {
12408                let code = code.clone();
12409                Box::pin(async move { code.into_id().await.unwrap().quote() })
12410            }),
12411        );
12412        GeneratedCode {
12413            proc: self.proc.clone(),
12414            selection: query,
12415            graphql_client: self.graphql_client.clone(),
12416        }
12417    }
12418    /// Queries a Git repository.
12419    ///
12420    /// # Arguments
12421    ///
12422    /// * `url` - URL of the git repository.
12423    ///
12424    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
12425    ///
12426    /// Suffix ".git" is optional.
12427    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12428    pub fn git(&self, url: impl Into<String>) -> GitRepository {
12429        let mut query = self.selection.select("git");
12430        query = query.arg("url", url.into());
12431        GitRepository {
12432            proc: self.proc.clone(),
12433            selection: query,
12434            graphql_client: self.graphql_client.clone(),
12435        }
12436    }
12437    /// Queries a Git repository.
12438    ///
12439    /// # Arguments
12440    ///
12441    /// * `url` - URL of the git repository.
12442    ///
12443    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
12444    ///
12445    /// Suffix ".git" is optional.
12446    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12447    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
12448        let mut query = self.selection.select("git");
12449        query = query.arg("url", url.into());
12450        if let Some(keep_git_dir) = opts.keep_git_dir {
12451            query = query.arg("keepGitDir", keep_git_dir);
12452        }
12453        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
12454            query = query.arg("sshKnownHosts", ssh_known_hosts);
12455        }
12456        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
12457            query = query.arg("sshAuthSocket", ssh_auth_socket);
12458        }
12459        if let Some(http_auth_username) = opts.http_auth_username {
12460            query = query.arg("httpAuthUsername", http_auth_username);
12461        }
12462        if let Some(http_auth_token) = opts.http_auth_token {
12463            query = query.arg("httpAuthToken", http_auth_token);
12464        }
12465        if let Some(http_auth_header) = opts.http_auth_header {
12466            query = query.arg("httpAuthHeader", http_auth_header);
12467        }
12468        if let Some(experimental_service_host) = opts.experimental_service_host {
12469            query = query.arg("experimentalServiceHost", experimental_service_host);
12470        }
12471        GitRepository {
12472            proc: self.proc.clone(),
12473            selection: query,
12474            graphql_client: self.graphql_client.clone(),
12475        }
12476    }
12477    /// Queries the host environment.
12478    pub fn host(&self) -> Host {
12479        let query = self.selection.select("host");
12480        Host {
12481            proc: self.proc.clone(),
12482            selection: query,
12483            graphql_client: self.graphql_client.clone(),
12484        }
12485    }
12486    /// Returns a file containing an http remote url content.
12487    ///
12488    /// # Arguments
12489    ///
12490    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
12491    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12492    pub fn http(&self, url: impl Into<String>) -> File {
12493        let mut query = self.selection.select("http");
12494        query = query.arg("url", url.into());
12495        File {
12496            proc: self.proc.clone(),
12497            selection: query,
12498            graphql_client: self.graphql_client.clone(),
12499        }
12500    }
12501    /// Returns a file containing an http remote url content.
12502    ///
12503    /// # Arguments
12504    ///
12505    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
12506    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12507    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
12508        let mut query = self.selection.select("http");
12509        query = query.arg("url", url.into());
12510        if let Some(name) = opts.name {
12511            query = query.arg("name", name);
12512        }
12513        if let Some(permissions) = opts.permissions {
12514            query = query.arg("permissions", permissions);
12515        }
12516        if let Some(auth_header) = opts.auth_header {
12517            query = query.arg("authHeader", auth_header);
12518        }
12519        if let Some(experimental_service_host) = opts.experimental_service_host {
12520            query = query.arg("experimentalServiceHost", experimental_service_host);
12521        }
12522        File {
12523            proc: self.proc.clone(),
12524            selection: query,
12525            graphql_client: self.graphql_client.clone(),
12526        }
12527    }
12528    /// Initialize a JSON value
12529    pub fn json(&self) -> JsonValue {
12530        let query = self.selection.select("json");
12531        JsonValue {
12532            proc: self.proc.clone(),
12533            selection: query,
12534            graphql_client: self.graphql_client.clone(),
12535        }
12536    }
12537    /// Initialize a Large Language Model (LLM)
12538    ///
12539    /// # Arguments
12540    ///
12541    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12542    pub fn llm(&self) -> Llm {
12543        let query = self.selection.select("llm");
12544        Llm {
12545            proc: self.proc.clone(),
12546            selection: query,
12547            graphql_client: self.graphql_client.clone(),
12548        }
12549    }
12550    /// Initialize a Large Language Model (LLM)
12551    ///
12552    /// # Arguments
12553    ///
12554    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12555    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
12556        let mut query = self.selection.select("llm");
12557        if let Some(model) = opts.model {
12558            query = query.arg("model", model);
12559        }
12560        if let Some(max_api_calls) = opts.max_api_calls {
12561            query = query.arg("maxAPICalls", max_api_calls);
12562        }
12563        Llm {
12564            proc: self.proc.clone(),
12565            selection: query,
12566            graphql_client: self.graphql_client.clone(),
12567        }
12568    }
12569    /// Load a Address from its ID.
12570    pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
12571        let mut query = self.selection.select("loadAddressFromID");
12572        query = query.arg_lazy(
12573            "id",
12574            Box::new(move || {
12575                let id = id.clone();
12576                Box::pin(async move { id.into_id().await.unwrap().quote() })
12577            }),
12578        );
12579        Address {
12580            proc: self.proc.clone(),
12581            selection: query,
12582            graphql_client: self.graphql_client.clone(),
12583        }
12584    }
12585    /// Load a Binding from its ID.
12586    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
12587        let mut query = self.selection.select("loadBindingFromID");
12588        query = query.arg_lazy(
12589            "id",
12590            Box::new(move || {
12591                let id = id.clone();
12592                Box::pin(async move { id.into_id().await.unwrap().quote() })
12593            }),
12594        );
12595        Binding {
12596            proc: self.proc.clone(),
12597            selection: query,
12598            graphql_client: self.graphql_client.clone(),
12599        }
12600    }
12601    /// Load a CacheVolume from its ID.
12602    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
12603        let mut query = self.selection.select("loadCacheVolumeFromID");
12604        query = query.arg_lazy(
12605            "id",
12606            Box::new(move || {
12607                let id = id.clone();
12608                Box::pin(async move { id.into_id().await.unwrap().quote() })
12609            }),
12610        );
12611        CacheVolume {
12612            proc: self.proc.clone(),
12613            selection: query,
12614            graphql_client: self.graphql_client.clone(),
12615        }
12616    }
12617    /// Load a Changeset from its ID.
12618    pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
12619        let mut query = self.selection.select("loadChangesetFromID");
12620        query = query.arg_lazy(
12621            "id",
12622            Box::new(move || {
12623                let id = id.clone();
12624                Box::pin(async move { id.into_id().await.unwrap().quote() })
12625            }),
12626        );
12627        Changeset {
12628            proc: self.proc.clone(),
12629            selection: query,
12630            graphql_client: self.graphql_client.clone(),
12631        }
12632    }
12633    /// Load a Check from its ID.
12634    pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
12635        let mut query = self.selection.select("loadCheckFromID");
12636        query = query.arg_lazy(
12637            "id",
12638            Box::new(move || {
12639                let id = id.clone();
12640                Box::pin(async move { id.into_id().await.unwrap().quote() })
12641            }),
12642        );
12643        Check {
12644            proc: self.proc.clone(),
12645            selection: query,
12646            graphql_client: self.graphql_client.clone(),
12647        }
12648    }
12649    /// Load a CheckGroup from its ID.
12650    pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
12651        let mut query = self.selection.select("loadCheckGroupFromID");
12652        query = query.arg_lazy(
12653            "id",
12654            Box::new(move || {
12655                let id = id.clone();
12656                Box::pin(async move { id.into_id().await.unwrap().quote() })
12657            }),
12658        );
12659        CheckGroup {
12660            proc: self.proc.clone(),
12661            selection: query,
12662            graphql_client: self.graphql_client.clone(),
12663        }
12664    }
12665    /// Load a Cloud from its ID.
12666    pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
12667        let mut query = self.selection.select("loadCloudFromID");
12668        query = query.arg_lazy(
12669            "id",
12670            Box::new(move || {
12671                let id = id.clone();
12672                Box::pin(async move { id.into_id().await.unwrap().quote() })
12673            }),
12674        );
12675        Cloud {
12676            proc: self.proc.clone(),
12677            selection: query,
12678            graphql_client: self.graphql_client.clone(),
12679        }
12680    }
12681    /// Load a Container from its ID.
12682    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
12683        let mut query = self.selection.select("loadContainerFromID");
12684        query = query.arg_lazy(
12685            "id",
12686            Box::new(move || {
12687                let id = id.clone();
12688                Box::pin(async move { id.into_id().await.unwrap().quote() })
12689            }),
12690        );
12691        Container {
12692            proc: self.proc.clone(),
12693            selection: query,
12694            graphql_client: self.graphql_client.clone(),
12695        }
12696    }
12697    /// Load a CurrentModule from its ID.
12698    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
12699        let mut query = self.selection.select("loadCurrentModuleFromID");
12700        query = query.arg_lazy(
12701            "id",
12702            Box::new(move || {
12703                let id = id.clone();
12704                Box::pin(async move { id.into_id().await.unwrap().quote() })
12705            }),
12706        );
12707        CurrentModule {
12708            proc: self.proc.clone(),
12709            selection: query,
12710            graphql_client: self.graphql_client.clone(),
12711        }
12712    }
12713    /// Load a Directory from its ID.
12714    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
12715        let mut query = self.selection.select("loadDirectoryFromID");
12716        query = query.arg_lazy(
12717            "id",
12718            Box::new(move || {
12719                let id = id.clone();
12720                Box::pin(async move { id.into_id().await.unwrap().quote() })
12721            }),
12722        );
12723        Directory {
12724            proc: self.proc.clone(),
12725            selection: query,
12726            graphql_client: self.graphql_client.clone(),
12727        }
12728    }
12729    /// Load a EngineCacheEntry from its ID.
12730    pub fn load_engine_cache_entry_from_id(
12731        &self,
12732        id: impl IntoID<EngineCacheEntryId>,
12733    ) -> EngineCacheEntry {
12734        let mut query = self.selection.select("loadEngineCacheEntryFromID");
12735        query = query.arg_lazy(
12736            "id",
12737            Box::new(move || {
12738                let id = id.clone();
12739                Box::pin(async move { id.into_id().await.unwrap().quote() })
12740            }),
12741        );
12742        EngineCacheEntry {
12743            proc: self.proc.clone(),
12744            selection: query,
12745            graphql_client: self.graphql_client.clone(),
12746        }
12747    }
12748    /// Load a EngineCacheEntrySet from its ID.
12749    pub fn load_engine_cache_entry_set_from_id(
12750        &self,
12751        id: impl IntoID<EngineCacheEntrySetId>,
12752    ) -> EngineCacheEntrySet {
12753        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
12754        query = query.arg_lazy(
12755            "id",
12756            Box::new(move || {
12757                let id = id.clone();
12758                Box::pin(async move { id.into_id().await.unwrap().quote() })
12759            }),
12760        );
12761        EngineCacheEntrySet {
12762            proc: self.proc.clone(),
12763            selection: query,
12764            graphql_client: self.graphql_client.clone(),
12765        }
12766    }
12767    /// Load a EngineCache from its ID.
12768    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
12769        let mut query = self.selection.select("loadEngineCacheFromID");
12770        query = query.arg_lazy(
12771            "id",
12772            Box::new(move || {
12773                let id = id.clone();
12774                Box::pin(async move { id.into_id().await.unwrap().quote() })
12775            }),
12776        );
12777        EngineCache {
12778            proc: self.proc.clone(),
12779            selection: query,
12780            graphql_client: self.graphql_client.clone(),
12781        }
12782    }
12783    /// Load a Engine from its ID.
12784    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
12785        let mut query = self.selection.select("loadEngineFromID");
12786        query = query.arg_lazy(
12787            "id",
12788            Box::new(move || {
12789                let id = id.clone();
12790                Box::pin(async move { id.into_id().await.unwrap().quote() })
12791            }),
12792        );
12793        Engine {
12794            proc: self.proc.clone(),
12795            selection: query,
12796            graphql_client: self.graphql_client.clone(),
12797        }
12798    }
12799    /// Load a EnumTypeDef from its ID.
12800    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
12801        let mut query = self.selection.select("loadEnumTypeDefFromID");
12802        query = query.arg_lazy(
12803            "id",
12804            Box::new(move || {
12805                let id = id.clone();
12806                Box::pin(async move { id.into_id().await.unwrap().quote() })
12807            }),
12808        );
12809        EnumTypeDef {
12810            proc: self.proc.clone(),
12811            selection: query,
12812            graphql_client: self.graphql_client.clone(),
12813        }
12814    }
12815    /// Load a EnumValueTypeDef from its ID.
12816    pub fn load_enum_value_type_def_from_id(
12817        &self,
12818        id: impl IntoID<EnumValueTypeDefId>,
12819    ) -> EnumValueTypeDef {
12820        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
12821        query = query.arg_lazy(
12822            "id",
12823            Box::new(move || {
12824                let id = id.clone();
12825                Box::pin(async move { id.into_id().await.unwrap().quote() })
12826            }),
12827        );
12828        EnumValueTypeDef {
12829            proc: self.proc.clone(),
12830            selection: query,
12831            graphql_client: self.graphql_client.clone(),
12832        }
12833    }
12834    /// Load a EnvFile from its ID.
12835    pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
12836        let mut query = self.selection.select("loadEnvFileFromID");
12837        query = query.arg_lazy(
12838            "id",
12839            Box::new(move || {
12840                let id = id.clone();
12841                Box::pin(async move { id.into_id().await.unwrap().quote() })
12842            }),
12843        );
12844        EnvFile {
12845            proc: self.proc.clone(),
12846            selection: query,
12847            graphql_client: self.graphql_client.clone(),
12848        }
12849    }
12850    /// Load a Env from its ID.
12851    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
12852        let mut query = self.selection.select("loadEnvFromID");
12853        query = query.arg_lazy(
12854            "id",
12855            Box::new(move || {
12856                let id = id.clone();
12857                Box::pin(async move { id.into_id().await.unwrap().quote() })
12858            }),
12859        );
12860        Env {
12861            proc: self.proc.clone(),
12862            selection: query,
12863            graphql_client: self.graphql_client.clone(),
12864        }
12865    }
12866    /// Load a EnvVariable from its ID.
12867    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
12868        let mut query = self.selection.select("loadEnvVariableFromID");
12869        query = query.arg_lazy(
12870            "id",
12871            Box::new(move || {
12872                let id = id.clone();
12873                Box::pin(async move { id.into_id().await.unwrap().quote() })
12874            }),
12875        );
12876        EnvVariable {
12877            proc: self.proc.clone(),
12878            selection: query,
12879            graphql_client: self.graphql_client.clone(),
12880        }
12881    }
12882    /// Load a Error from its ID.
12883    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
12884        let mut query = self.selection.select("loadErrorFromID");
12885        query = query.arg_lazy(
12886            "id",
12887            Box::new(move || {
12888                let id = id.clone();
12889                Box::pin(async move { id.into_id().await.unwrap().quote() })
12890            }),
12891        );
12892        Error {
12893            proc: self.proc.clone(),
12894            selection: query,
12895            graphql_client: self.graphql_client.clone(),
12896        }
12897    }
12898    /// Load a ErrorValue from its ID.
12899    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
12900        let mut query = self.selection.select("loadErrorValueFromID");
12901        query = query.arg_lazy(
12902            "id",
12903            Box::new(move || {
12904                let id = id.clone();
12905                Box::pin(async move { id.into_id().await.unwrap().quote() })
12906            }),
12907        );
12908        ErrorValue {
12909            proc: self.proc.clone(),
12910            selection: query,
12911            graphql_client: self.graphql_client.clone(),
12912        }
12913    }
12914    /// Load a FieldTypeDef from its ID.
12915    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
12916        let mut query = self.selection.select("loadFieldTypeDefFromID");
12917        query = query.arg_lazy(
12918            "id",
12919            Box::new(move || {
12920                let id = id.clone();
12921                Box::pin(async move { id.into_id().await.unwrap().quote() })
12922            }),
12923        );
12924        FieldTypeDef {
12925            proc: self.proc.clone(),
12926            selection: query,
12927            graphql_client: self.graphql_client.clone(),
12928        }
12929    }
12930    /// Load a File from its ID.
12931    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
12932        let mut query = self.selection.select("loadFileFromID");
12933        query = query.arg_lazy(
12934            "id",
12935            Box::new(move || {
12936                let id = id.clone();
12937                Box::pin(async move { id.into_id().await.unwrap().quote() })
12938            }),
12939        );
12940        File {
12941            proc: self.proc.clone(),
12942            selection: query,
12943            graphql_client: self.graphql_client.clone(),
12944        }
12945    }
12946    /// Load a FunctionArg from its ID.
12947    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
12948        let mut query = self.selection.select("loadFunctionArgFromID");
12949        query = query.arg_lazy(
12950            "id",
12951            Box::new(move || {
12952                let id = id.clone();
12953                Box::pin(async move { id.into_id().await.unwrap().quote() })
12954            }),
12955        );
12956        FunctionArg {
12957            proc: self.proc.clone(),
12958            selection: query,
12959            graphql_client: self.graphql_client.clone(),
12960        }
12961    }
12962    /// Load a FunctionCallArgValue from its ID.
12963    pub fn load_function_call_arg_value_from_id(
12964        &self,
12965        id: impl IntoID<FunctionCallArgValueId>,
12966    ) -> FunctionCallArgValue {
12967        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
12968        query = query.arg_lazy(
12969            "id",
12970            Box::new(move || {
12971                let id = id.clone();
12972                Box::pin(async move { id.into_id().await.unwrap().quote() })
12973            }),
12974        );
12975        FunctionCallArgValue {
12976            proc: self.proc.clone(),
12977            selection: query,
12978            graphql_client: self.graphql_client.clone(),
12979        }
12980    }
12981    /// Load a FunctionCall from its ID.
12982    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
12983        let mut query = self.selection.select("loadFunctionCallFromID");
12984        query = query.arg_lazy(
12985            "id",
12986            Box::new(move || {
12987                let id = id.clone();
12988                Box::pin(async move { id.into_id().await.unwrap().quote() })
12989            }),
12990        );
12991        FunctionCall {
12992            proc: self.proc.clone(),
12993            selection: query,
12994            graphql_client: self.graphql_client.clone(),
12995        }
12996    }
12997    /// Load a Function from its ID.
12998    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
12999        let mut query = self.selection.select("loadFunctionFromID");
13000        query = query.arg_lazy(
13001            "id",
13002            Box::new(move || {
13003                let id = id.clone();
13004                Box::pin(async move { id.into_id().await.unwrap().quote() })
13005            }),
13006        );
13007        Function {
13008            proc: self.proc.clone(),
13009            selection: query,
13010            graphql_client: self.graphql_client.clone(),
13011        }
13012    }
13013    /// Load a GeneratedCode from its ID.
13014    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
13015        let mut query = self.selection.select("loadGeneratedCodeFromID");
13016        query = query.arg_lazy(
13017            "id",
13018            Box::new(move || {
13019                let id = id.clone();
13020                Box::pin(async move { id.into_id().await.unwrap().quote() })
13021            }),
13022        );
13023        GeneratedCode {
13024            proc: self.proc.clone(),
13025            selection: query,
13026            graphql_client: self.graphql_client.clone(),
13027        }
13028    }
13029    /// Load a Generator from its ID.
13030    pub fn load_generator_from_id(&self, id: impl IntoID<GeneratorId>) -> Generator {
13031        let mut query = self.selection.select("loadGeneratorFromID");
13032        query = query.arg_lazy(
13033            "id",
13034            Box::new(move || {
13035                let id = id.clone();
13036                Box::pin(async move { id.into_id().await.unwrap().quote() })
13037            }),
13038        );
13039        Generator {
13040            proc: self.proc.clone(),
13041            selection: query,
13042            graphql_client: self.graphql_client.clone(),
13043        }
13044    }
13045    /// Load a GeneratorGroup from its ID.
13046    pub fn load_generator_group_from_id(
13047        &self,
13048        id: impl IntoID<GeneratorGroupId>,
13049    ) -> GeneratorGroup {
13050        let mut query = self.selection.select("loadGeneratorGroupFromID");
13051        query = query.arg_lazy(
13052            "id",
13053            Box::new(move || {
13054                let id = id.clone();
13055                Box::pin(async move { id.into_id().await.unwrap().quote() })
13056            }),
13057        );
13058        GeneratorGroup {
13059            proc: self.proc.clone(),
13060            selection: query,
13061            graphql_client: self.graphql_client.clone(),
13062        }
13063    }
13064    /// Load a GitRef from its ID.
13065    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
13066        let mut query = self.selection.select("loadGitRefFromID");
13067        query = query.arg_lazy(
13068            "id",
13069            Box::new(move || {
13070                let id = id.clone();
13071                Box::pin(async move { id.into_id().await.unwrap().quote() })
13072            }),
13073        );
13074        GitRef {
13075            proc: self.proc.clone(),
13076            selection: query,
13077            graphql_client: self.graphql_client.clone(),
13078        }
13079    }
13080    /// Load a GitRepository from its ID.
13081    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
13082        let mut query = self.selection.select("loadGitRepositoryFromID");
13083        query = query.arg_lazy(
13084            "id",
13085            Box::new(move || {
13086                let id = id.clone();
13087                Box::pin(async move { id.into_id().await.unwrap().quote() })
13088            }),
13089        );
13090        GitRepository {
13091            proc: self.proc.clone(),
13092            selection: query,
13093            graphql_client: self.graphql_client.clone(),
13094        }
13095    }
13096    /// Load a HealthcheckConfig from its ID.
13097    pub fn load_healthcheck_config_from_id(
13098        &self,
13099        id: impl IntoID<HealthcheckConfigId>,
13100    ) -> HealthcheckConfig {
13101        let mut query = self.selection.select("loadHealthcheckConfigFromID");
13102        query = query.arg_lazy(
13103            "id",
13104            Box::new(move || {
13105                let id = id.clone();
13106                Box::pin(async move { id.into_id().await.unwrap().quote() })
13107            }),
13108        );
13109        HealthcheckConfig {
13110            proc: self.proc.clone(),
13111            selection: query,
13112            graphql_client: self.graphql_client.clone(),
13113        }
13114    }
13115    /// Load a Host from its ID.
13116    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
13117        let mut query = self.selection.select("loadHostFromID");
13118        query = query.arg_lazy(
13119            "id",
13120            Box::new(move || {
13121                let id = id.clone();
13122                Box::pin(async move { id.into_id().await.unwrap().quote() })
13123            }),
13124        );
13125        Host {
13126            proc: self.proc.clone(),
13127            selection: query,
13128            graphql_client: self.graphql_client.clone(),
13129        }
13130    }
13131    /// Load a InputTypeDef from its ID.
13132    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
13133        let mut query = self.selection.select("loadInputTypeDefFromID");
13134        query = query.arg_lazy(
13135            "id",
13136            Box::new(move || {
13137                let id = id.clone();
13138                Box::pin(async move { id.into_id().await.unwrap().quote() })
13139            }),
13140        );
13141        InputTypeDef {
13142            proc: self.proc.clone(),
13143            selection: query,
13144            graphql_client: self.graphql_client.clone(),
13145        }
13146    }
13147    /// Load a InterfaceTypeDef from its ID.
13148    pub fn load_interface_type_def_from_id(
13149        &self,
13150        id: impl IntoID<InterfaceTypeDefId>,
13151    ) -> InterfaceTypeDef {
13152        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
13153        query = query.arg_lazy(
13154            "id",
13155            Box::new(move || {
13156                let id = id.clone();
13157                Box::pin(async move { id.into_id().await.unwrap().quote() })
13158            }),
13159        );
13160        InterfaceTypeDef {
13161            proc: self.proc.clone(),
13162            selection: query,
13163            graphql_client: self.graphql_client.clone(),
13164        }
13165    }
13166    /// Load a JSONValue from its ID.
13167    pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
13168        let mut query = self.selection.select("loadJSONValueFromID");
13169        query = query.arg_lazy(
13170            "id",
13171            Box::new(move || {
13172                let id = id.clone();
13173                Box::pin(async move { id.into_id().await.unwrap().quote() })
13174            }),
13175        );
13176        JsonValue {
13177            proc: self.proc.clone(),
13178            selection: query,
13179            graphql_client: self.graphql_client.clone(),
13180        }
13181    }
13182    /// Load a LLM from its ID.
13183    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
13184        let mut query = self.selection.select("loadLLMFromID");
13185        query = query.arg_lazy(
13186            "id",
13187            Box::new(move || {
13188                let id = id.clone();
13189                Box::pin(async move { id.into_id().await.unwrap().quote() })
13190            }),
13191        );
13192        Llm {
13193            proc: self.proc.clone(),
13194            selection: query,
13195            graphql_client: self.graphql_client.clone(),
13196        }
13197    }
13198    /// Load a LLMTokenUsage from its ID.
13199    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
13200        let mut query = self.selection.select("loadLLMTokenUsageFromID");
13201        query = query.arg_lazy(
13202            "id",
13203            Box::new(move || {
13204                let id = id.clone();
13205                Box::pin(async move { id.into_id().await.unwrap().quote() })
13206            }),
13207        );
13208        LlmTokenUsage {
13209            proc: self.proc.clone(),
13210            selection: query,
13211            graphql_client: self.graphql_client.clone(),
13212        }
13213    }
13214    /// Load a Label from its ID.
13215    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
13216        let mut query = self.selection.select("loadLabelFromID");
13217        query = query.arg_lazy(
13218            "id",
13219            Box::new(move || {
13220                let id = id.clone();
13221                Box::pin(async move { id.into_id().await.unwrap().quote() })
13222            }),
13223        );
13224        Label {
13225            proc: self.proc.clone(),
13226            selection: query,
13227            graphql_client: self.graphql_client.clone(),
13228        }
13229    }
13230    /// Load a ListTypeDef from its ID.
13231    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
13232        let mut query = self.selection.select("loadListTypeDefFromID");
13233        query = query.arg_lazy(
13234            "id",
13235            Box::new(move || {
13236                let id = id.clone();
13237                Box::pin(async move { id.into_id().await.unwrap().quote() })
13238            }),
13239        );
13240        ListTypeDef {
13241            proc: self.proc.clone(),
13242            selection: query,
13243            graphql_client: self.graphql_client.clone(),
13244        }
13245    }
13246    /// Load a ModuleConfigClient from its ID.
13247    pub fn load_module_config_client_from_id(
13248        &self,
13249        id: impl IntoID<ModuleConfigClientId>,
13250    ) -> ModuleConfigClient {
13251        let mut query = self.selection.select("loadModuleConfigClientFromID");
13252        query = query.arg_lazy(
13253            "id",
13254            Box::new(move || {
13255                let id = id.clone();
13256                Box::pin(async move { id.into_id().await.unwrap().quote() })
13257            }),
13258        );
13259        ModuleConfigClient {
13260            proc: self.proc.clone(),
13261            selection: query,
13262            graphql_client: self.graphql_client.clone(),
13263        }
13264    }
13265    /// Load a Module from its ID.
13266    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
13267        let mut query = self.selection.select("loadModuleFromID");
13268        query = query.arg_lazy(
13269            "id",
13270            Box::new(move || {
13271                let id = id.clone();
13272                Box::pin(async move { id.into_id().await.unwrap().quote() })
13273            }),
13274        );
13275        Module {
13276            proc: self.proc.clone(),
13277            selection: query,
13278            graphql_client: self.graphql_client.clone(),
13279        }
13280    }
13281    /// Load a ModuleSource from its ID.
13282    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
13283        let mut query = self.selection.select("loadModuleSourceFromID");
13284        query = query.arg_lazy(
13285            "id",
13286            Box::new(move || {
13287                let id = id.clone();
13288                Box::pin(async move { id.into_id().await.unwrap().quote() })
13289            }),
13290        );
13291        ModuleSource {
13292            proc: self.proc.clone(),
13293            selection: query,
13294            graphql_client: self.graphql_client.clone(),
13295        }
13296    }
13297    /// Load a ObjectTypeDef from its ID.
13298    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
13299        let mut query = self.selection.select("loadObjectTypeDefFromID");
13300        query = query.arg_lazy(
13301            "id",
13302            Box::new(move || {
13303                let id = id.clone();
13304                Box::pin(async move { id.into_id().await.unwrap().quote() })
13305            }),
13306        );
13307        ObjectTypeDef {
13308            proc: self.proc.clone(),
13309            selection: query,
13310            graphql_client: self.graphql_client.clone(),
13311        }
13312    }
13313    /// Load a Port from its ID.
13314    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
13315        let mut query = self.selection.select("loadPortFromID");
13316        query = query.arg_lazy(
13317            "id",
13318            Box::new(move || {
13319                let id = id.clone();
13320                Box::pin(async move { id.into_id().await.unwrap().quote() })
13321            }),
13322        );
13323        Port {
13324            proc: self.proc.clone(),
13325            selection: query,
13326            graphql_client: self.graphql_client.clone(),
13327        }
13328    }
13329    /// Load a SDKConfig from its ID.
13330    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
13331        let mut query = self.selection.select("loadSDKConfigFromID");
13332        query = query.arg_lazy(
13333            "id",
13334            Box::new(move || {
13335                let id = id.clone();
13336                Box::pin(async move { id.into_id().await.unwrap().quote() })
13337            }),
13338        );
13339        SdkConfig {
13340            proc: self.proc.clone(),
13341            selection: query,
13342            graphql_client: self.graphql_client.clone(),
13343        }
13344    }
13345    /// Load a ScalarTypeDef from its ID.
13346    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
13347        let mut query = self.selection.select("loadScalarTypeDefFromID");
13348        query = query.arg_lazy(
13349            "id",
13350            Box::new(move || {
13351                let id = id.clone();
13352                Box::pin(async move { id.into_id().await.unwrap().quote() })
13353            }),
13354        );
13355        ScalarTypeDef {
13356            proc: self.proc.clone(),
13357            selection: query,
13358            graphql_client: self.graphql_client.clone(),
13359        }
13360    }
13361    /// Load a SearchResult from its ID.
13362    pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
13363        let mut query = self.selection.select("loadSearchResultFromID");
13364        query = query.arg_lazy(
13365            "id",
13366            Box::new(move || {
13367                let id = id.clone();
13368                Box::pin(async move { id.into_id().await.unwrap().quote() })
13369            }),
13370        );
13371        SearchResult {
13372            proc: self.proc.clone(),
13373            selection: query,
13374            graphql_client: self.graphql_client.clone(),
13375        }
13376    }
13377    /// Load a SearchSubmatch from its ID.
13378    pub fn load_search_submatch_from_id(
13379        &self,
13380        id: impl IntoID<SearchSubmatchId>,
13381    ) -> SearchSubmatch {
13382        let mut query = self.selection.select("loadSearchSubmatchFromID");
13383        query = query.arg_lazy(
13384            "id",
13385            Box::new(move || {
13386                let id = id.clone();
13387                Box::pin(async move { id.into_id().await.unwrap().quote() })
13388            }),
13389        );
13390        SearchSubmatch {
13391            proc: self.proc.clone(),
13392            selection: query,
13393            graphql_client: self.graphql_client.clone(),
13394        }
13395    }
13396    /// Load a Secret from its ID.
13397    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
13398        let mut query = self.selection.select("loadSecretFromID");
13399        query = query.arg_lazy(
13400            "id",
13401            Box::new(move || {
13402                let id = id.clone();
13403                Box::pin(async move { id.into_id().await.unwrap().quote() })
13404            }),
13405        );
13406        Secret {
13407            proc: self.proc.clone(),
13408            selection: query,
13409            graphql_client: self.graphql_client.clone(),
13410        }
13411    }
13412    /// Load a Service from its ID.
13413    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
13414        let mut query = self.selection.select("loadServiceFromID");
13415        query = query.arg_lazy(
13416            "id",
13417            Box::new(move || {
13418                let id = id.clone();
13419                Box::pin(async move { id.into_id().await.unwrap().quote() })
13420            }),
13421        );
13422        Service {
13423            proc: self.proc.clone(),
13424            selection: query,
13425            graphql_client: self.graphql_client.clone(),
13426        }
13427    }
13428    /// Load a Socket from its ID.
13429    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
13430        let mut query = self.selection.select("loadSocketFromID");
13431        query = query.arg_lazy(
13432            "id",
13433            Box::new(move || {
13434                let id = id.clone();
13435                Box::pin(async move { id.into_id().await.unwrap().quote() })
13436            }),
13437        );
13438        Socket {
13439            proc: self.proc.clone(),
13440            selection: query,
13441            graphql_client: self.graphql_client.clone(),
13442        }
13443    }
13444    /// Load a SourceMap from its ID.
13445    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
13446        let mut query = self.selection.select("loadSourceMapFromID");
13447        query = query.arg_lazy(
13448            "id",
13449            Box::new(move || {
13450                let id = id.clone();
13451                Box::pin(async move { id.into_id().await.unwrap().quote() })
13452            }),
13453        );
13454        SourceMap {
13455            proc: self.proc.clone(),
13456            selection: query,
13457            graphql_client: self.graphql_client.clone(),
13458        }
13459    }
13460    /// Load a Stat from its ID.
13461    pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
13462        let mut query = self.selection.select("loadStatFromID");
13463        query = query.arg_lazy(
13464            "id",
13465            Box::new(move || {
13466                let id = id.clone();
13467                Box::pin(async move { id.into_id().await.unwrap().quote() })
13468            }),
13469        );
13470        Stat {
13471            proc: self.proc.clone(),
13472            selection: query,
13473            graphql_client: self.graphql_client.clone(),
13474        }
13475    }
13476    /// Load a Terminal from its ID.
13477    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
13478        let mut query = self.selection.select("loadTerminalFromID");
13479        query = query.arg_lazy(
13480            "id",
13481            Box::new(move || {
13482                let id = id.clone();
13483                Box::pin(async move { id.into_id().await.unwrap().quote() })
13484            }),
13485        );
13486        Terminal {
13487            proc: self.proc.clone(),
13488            selection: query,
13489            graphql_client: self.graphql_client.clone(),
13490        }
13491    }
13492    /// Load a TypeDef from its ID.
13493    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
13494        let mut query = self.selection.select("loadTypeDefFromID");
13495        query = query.arg_lazy(
13496            "id",
13497            Box::new(move || {
13498                let id = id.clone();
13499                Box::pin(async move { id.into_id().await.unwrap().quote() })
13500            }),
13501        );
13502        TypeDef {
13503            proc: self.proc.clone(),
13504            selection: query,
13505            graphql_client: self.graphql_client.clone(),
13506        }
13507    }
13508    /// Load a Workspace from its ID.
13509    pub fn load_workspace_from_id(&self, id: impl IntoID<WorkspaceId>) -> Workspace {
13510        let mut query = self.selection.select("loadWorkspaceFromID");
13511        query = query.arg_lazy(
13512            "id",
13513            Box::new(move || {
13514                let id = id.clone();
13515                Box::pin(async move { id.into_id().await.unwrap().quote() })
13516            }),
13517        );
13518        Workspace {
13519            proc: self.proc.clone(),
13520            selection: query,
13521            graphql_client: self.graphql_client.clone(),
13522        }
13523    }
13524    /// Create a new module.
13525    pub fn module(&self) -> Module {
13526        let query = self.selection.select("module");
13527        Module {
13528            proc: self.proc.clone(),
13529            selection: query,
13530            graphql_client: self.graphql_client.clone(),
13531        }
13532    }
13533    /// Create a new module source instance from a source ref string
13534    ///
13535    /// # Arguments
13536    ///
13537    /// * `ref_string` - The string ref representation of the module source
13538    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13539    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
13540        let mut query = self.selection.select("moduleSource");
13541        query = query.arg("refString", ref_string.into());
13542        ModuleSource {
13543            proc: self.proc.clone(),
13544            selection: query,
13545            graphql_client: self.graphql_client.clone(),
13546        }
13547    }
13548    /// Create a new module source instance from a source ref string
13549    ///
13550    /// # Arguments
13551    ///
13552    /// * `ref_string` - The string ref representation of the module source
13553    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13554    pub fn module_source_opts<'a>(
13555        &self,
13556        ref_string: impl Into<String>,
13557        opts: QueryModuleSourceOpts<'a>,
13558    ) -> ModuleSource {
13559        let mut query = self.selection.select("moduleSource");
13560        query = query.arg("refString", ref_string.into());
13561        if let Some(ref_pin) = opts.ref_pin {
13562            query = query.arg("refPin", ref_pin);
13563        }
13564        if let Some(disable_find_up) = opts.disable_find_up {
13565            query = query.arg("disableFindUp", disable_find_up);
13566        }
13567        if let Some(allow_not_exists) = opts.allow_not_exists {
13568            query = query.arg("allowNotExists", allow_not_exists);
13569        }
13570        if let Some(require_kind) = opts.require_kind {
13571            query = query.arg("requireKind", require_kind);
13572        }
13573        ModuleSource {
13574            proc: self.proc.clone(),
13575            selection: query,
13576            graphql_client: self.graphql_client.clone(),
13577        }
13578    }
13579    /// Creates a new secret.
13580    ///
13581    /// # Arguments
13582    ///
13583    /// * `uri` - The URI of the secret store
13584    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13585    pub fn secret(&self, uri: impl Into<String>) -> Secret {
13586        let mut query = self.selection.select("secret");
13587        query = query.arg("uri", uri.into());
13588        Secret {
13589            proc: self.proc.clone(),
13590            selection: query,
13591            graphql_client: self.graphql_client.clone(),
13592        }
13593    }
13594    /// Creates a new secret.
13595    ///
13596    /// # Arguments
13597    ///
13598    /// * `uri` - The URI of the secret store
13599    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13600    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
13601        let mut query = self.selection.select("secret");
13602        query = query.arg("uri", uri.into());
13603        if let Some(cache_key) = opts.cache_key {
13604            query = query.arg("cacheKey", cache_key);
13605        }
13606        Secret {
13607            proc: self.proc.clone(),
13608            selection: query,
13609            graphql_client: self.graphql_client.clone(),
13610        }
13611    }
13612    /// Sets a secret given a user defined name to its plaintext and returns the secret.
13613    /// The plaintext value is limited to a size of 128000 bytes.
13614    ///
13615    /// # Arguments
13616    ///
13617    /// * `name` - The user defined name for this secret
13618    /// * `plaintext` - The plaintext of the secret
13619    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
13620        let mut query = self.selection.select("setSecret");
13621        query = query.arg("name", name.into());
13622        query = query.arg("plaintext", plaintext.into());
13623        Secret {
13624            proc: self.proc.clone(),
13625            selection: query,
13626            graphql_client: self.graphql_client.clone(),
13627        }
13628    }
13629    /// Creates source map metadata.
13630    ///
13631    /// # Arguments
13632    ///
13633    /// * `filename` - The filename from the module source.
13634    /// * `line` - The line number within the filename.
13635    /// * `column` - The column number within the line.
13636    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
13637        let mut query = self.selection.select("sourceMap");
13638        query = query.arg("filename", filename.into());
13639        query = query.arg("line", line);
13640        query = query.arg("column", column);
13641        SourceMap {
13642            proc: self.proc.clone(),
13643            selection: query,
13644            graphql_client: self.graphql_client.clone(),
13645        }
13646    }
13647    /// Create a new TypeDef.
13648    pub fn type_def(&self) -> TypeDef {
13649        let query = self.selection.select("typeDef");
13650        TypeDef {
13651            proc: self.proc.clone(),
13652            selection: query,
13653            graphql_client: self.graphql_client.clone(),
13654        }
13655    }
13656    /// Get the current Dagger Engine version.
13657    pub async fn version(&self) -> Result<String, DaggerError> {
13658        let query = self.selection.select("version");
13659        query.execute(self.graphql_client.clone()).await
13660    }
13661}
13662#[derive(Clone)]
13663pub struct SdkConfig {
13664    pub proc: Option<Arc<DaggerSessionProc>>,
13665    pub selection: Selection,
13666    pub graphql_client: DynGraphQLClient,
13667}
13668impl SdkConfig {
13669    /// Whether to start the SDK runtime in debug mode with an interactive terminal.
13670    pub async fn debug(&self) -> Result<bool, DaggerError> {
13671        let query = self.selection.select("debug");
13672        query.execute(self.graphql_client.clone()).await
13673    }
13674    /// A unique identifier for this SDKConfig.
13675    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
13676        let query = self.selection.select("id");
13677        query.execute(self.graphql_client.clone()).await
13678    }
13679    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
13680    pub async fn source(&self) -> Result<String, DaggerError> {
13681        let query = self.selection.select("source");
13682        query.execute(self.graphql_client.clone()).await
13683    }
13684}
13685#[derive(Clone)]
13686pub struct ScalarTypeDef {
13687    pub proc: Option<Arc<DaggerSessionProc>>,
13688    pub selection: Selection,
13689    pub graphql_client: DynGraphQLClient,
13690}
13691impl ScalarTypeDef {
13692    /// A doc string for the scalar, if any.
13693    pub async fn description(&self) -> Result<String, DaggerError> {
13694        let query = self.selection.select("description");
13695        query.execute(self.graphql_client.clone()).await
13696    }
13697    /// A unique identifier for this ScalarTypeDef.
13698    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
13699        let query = self.selection.select("id");
13700        query.execute(self.graphql_client.clone()).await
13701    }
13702    /// The name of the scalar.
13703    pub async fn name(&self) -> Result<String, DaggerError> {
13704        let query = self.selection.select("name");
13705        query.execute(self.graphql_client.clone()).await
13706    }
13707    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
13708    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
13709        let query = self.selection.select("sourceModuleName");
13710        query.execute(self.graphql_client.clone()).await
13711    }
13712}
13713#[derive(Clone)]
13714pub struct SearchResult {
13715    pub proc: Option<Arc<DaggerSessionProc>>,
13716    pub selection: Selection,
13717    pub graphql_client: DynGraphQLClient,
13718}
13719impl SearchResult {
13720    /// The byte offset of this line within the file.
13721    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
13722        let query = self.selection.select("absoluteOffset");
13723        query.execute(self.graphql_client.clone()).await
13724    }
13725    /// The path to the file that matched.
13726    pub async fn file_path(&self) -> Result<String, DaggerError> {
13727        let query = self.selection.select("filePath");
13728        query.execute(self.graphql_client.clone()).await
13729    }
13730    /// A unique identifier for this SearchResult.
13731    pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
13732        let query = self.selection.select("id");
13733        query.execute(self.graphql_client.clone()).await
13734    }
13735    /// The first line that matched.
13736    pub async fn line_number(&self) -> Result<isize, DaggerError> {
13737        let query = self.selection.select("lineNumber");
13738        query.execute(self.graphql_client.clone()).await
13739    }
13740    /// The line content that matched.
13741    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
13742        let query = self.selection.select("matchedLines");
13743        query.execute(self.graphql_client.clone()).await
13744    }
13745    /// Sub-match positions and content within the matched lines.
13746    pub fn submatches(&self) -> Vec<SearchSubmatch> {
13747        let query = self.selection.select("submatches");
13748        vec![SearchSubmatch {
13749            proc: self.proc.clone(),
13750            selection: query,
13751            graphql_client: self.graphql_client.clone(),
13752        }]
13753    }
13754}
13755#[derive(Clone)]
13756pub struct SearchSubmatch {
13757    pub proc: Option<Arc<DaggerSessionProc>>,
13758    pub selection: Selection,
13759    pub graphql_client: DynGraphQLClient,
13760}
13761impl SearchSubmatch {
13762    /// The match's end offset within the matched lines.
13763    pub async fn end(&self) -> Result<isize, DaggerError> {
13764        let query = self.selection.select("end");
13765        query.execute(self.graphql_client.clone()).await
13766    }
13767    /// A unique identifier for this SearchSubmatch.
13768    pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
13769        let query = self.selection.select("id");
13770        query.execute(self.graphql_client.clone()).await
13771    }
13772    /// The match's start offset within the matched lines.
13773    pub async fn start(&self) -> Result<isize, DaggerError> {
13774        let query = self.selection.select("start");
13775        query.execute(self.graphql_client.clone()).await
13776    }
13777    /// The matched text.
13778    pub async fn text(&self) -> Result<String, DaggerError> {
13779        let query = self.selection.select("text");
13780        query.execute(self.graphql_client.clone()).await
13781    }
13782}
13783#[derive(Clone)]
13784pub struct Secret {
13785    pub proc: Option<Arc<DaggerSessionProc>>,
13786    pub selection: Selection,
13787    pub graphql_client: DynGraphQLClient,
13788}
13789impl Secret {
13790    /// A unique identifier for this Secret.
13791    pub async fn id(&self) -> Result<SecretId, DaggerError> {
13792        let query = self.selection.select("id");
13793        query.execute(self.graphql_client.clone()).await
13794    }
13795    /// The name of this secret.
13796    pub async fn name(&self) -> Result<String, DaggerError> {
13797        let query = self.selection.select("name");
13798        query.execute(self.graphql_client.clone()).await
13799    }
13800    /// The value of this secret.
13801    pub async fn plaintext(&self) -> Result<String, DaggerError> {
13802        let query = self.selection.select("plaintext");
13803        query.execute(self.graphql_client.clone()).await
13804    }
13805    /// The URI of this secret.
13806    pub async fn uri(&self) -> Result<String, DaggerError> {
13807        let query = self.selection.select("uri");
13808        query.execute(self.graphql_client.clone()).await
13809    }
13810}
13811#[derive(Clone)]
13812pub struct Service {
13813    pub proc: Option<Arc<DaggerSessionProc>>,
13814    pub selection: Selection,
13815    pub graphql_client: DynGraphQLClient,
13816}
13817#[derive(Builder, Debug, PartialEq)]
13818pub struct ServiceEndpointOpts<'a> {
13819    /// The exposed port number for the endpoint
13820    #[builder(setter(into, strip_option), default)]
13821    pub port: Option<isize>,
13822    /// Return a URL with the given scheme, eg. http for http://
13823    #[builder(setter(into, strip_option), default)]
13824    pub scheme: Option<&'a str>,
13825}
13826#[derive(Builder, Debug, PartialEq)]
13827pub struct ServiceStopOpts {
13828    /// Immediately kill the service without waiting for a graceful exit
13829    #[builder(setter(into, strip_option), default)]
13830    pub kill: Option<bool>,
13831}
13832#[derive(Builder, Debug, PartialEq)]
13833pub struct ServiceTerminalOpts<'a> {
13834    #[builder(setter(into, strip_option), default)]
13835    pub cmd: Option<Vec<&'a str>>,
13836}
13837#[derive(Builder, Debug, PartialEq)]
13838pub struct ServiceUpOpts {
13839    /// List of frontend/backend port mappings to forward.
13840    /// Frontend is the port accepting traffic on the host, backend is the service port.
13841    #[builder(setter(into, strip_option), default)]
13842    pub ports: Option<Vec<PortForward>>,
13843    /// Bind each tunnel port to a random port on the host.
13844    #[builder(setter(into, strip_option), default)]
13845    pub random: Option<bool>,
13846}
13847impl Service {
13848    /// Retrieves an endpoint that clients can use to reach this container.
13849    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
13850    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
13851    ///
13852    /// # Arguments
13853    ///
13854    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13855    pub async fn endpoint(&self) -> Result<String, DaggerError> {
13856        let query = self.selection.select("endpoint");
13857        query.execute(self.graphql_client.clone()).await
13858    }
13859    /// Retrieves an endpoint that clients can use to reach this container.
13860    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
13861    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
13862    ///
13863    /// # Arguments
13864    ///
13865    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13866    pub async fn endpoint_opts<'a>(
13867        &self,
13868        opts: ServiceEndpointOpts<'a>,
13869    ) -> Result<String, DaggerError> {
13870        let mut query = self.selection.select("endpoint");
13871        if let Some(port) = opts.port {
13872            query = query.arg("port", port);
13873        }
13874        if let Some(scheme) = opts.scheme {
13875            query = query.arg("scheme", scheme);
13876        }
13877        query.execute(self.graphql_client.clone()).await
13878    }
13879    /// Retrieves a hostname which can be used by clients to reach this container.
13880    pub async fn hostname(&self) -> Result<String, DaggerError> {
13881        let query = self.selection.select("hostname");
13882        query.execute(self.graphql_client.clone()).await
13883    }
13884    /// A unique identifier for this Service.
13885    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
13886        let query = self.selection.select("id");
13887        query.execute(self.graphql_client.clone()).await
13888    }
13889    /// Retrieves the list of ports provided by the service.
13890    pub fn ports(&self) -> Vec<Port> {
13891        let query = self.selection.select("ports");
13892        vec![Port {
13893            proc: self.proc.clone(),
13894            selection: query,
13895            graphql_client: self.graphql_client.clone(),
13896        }]
13897    }
13898    /// Start the service and wait for its health checks to succeed.
13899    /// Services bound to a Container do not need to be manually started.
13900    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
13901        let query = self.selection.select("start");
13902        query.execute(self.graphql_client.clone()).await
13903    }
13904    /// Stop the service.
13905    ///
13906    /// # Arguments
13907    ///
13908    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13909    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
13910        let query = self.selection.select("stop");
13911        query.execute(self.graphql_client.clone()).await
13912    }
13913    /// Stop the service.
13914    ///
13915    /// # Arguments
13916    ///
13917    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13918    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
13919        let mut query = self.selection.select("stop");
13920        if let Some(kill) = opts.kill {
13921            query = query.arg("kill", kill);
13922        }
13923        query.execute(self.graphql_client.clone()).await
13924    }
13925    /// Forces evaluation of the pipeline in the engine.
13926    pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
13927        let query = self.selection.select("sync");
13928        query.execute(self.graphql_client.clone()).await
13929    }
13930    ///
13931    /// # Arguments
13932    ///
13933    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13934    pub fn terminal(&self) -> Service {
13935        let query = self.selection.select("terminal");
13936        Service {
13937            proc: self.proc.clone(),
13938            selection: query,
13939            graphql_client: self.graphql_client.clone(),
13940        }
13941    }
13942    ///
13943    /// # Arguments
13944    ///
13945    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13946    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
13947        let mut query = self.selection.select("terminal");
13948        if let Some(cmd) = opts.cmd {
13949            query = query.arg("cmd", cmd);
13950        }
13951        Service {
13952            proc: self.proc.clone(),
13953            selection: query,
13954            graphql_client: self.graphql_client.clone(),
13955        }
13956    }
13957    /// Creates a tunnel that forwards traffic from the caller's network to this service.
13958    ///
13959    /// # Arguments
13960    ///
13961    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13962    pub async fn up(&self) -> Result<Void, DaggerError> {
13963        let query = self.selection.select("up");
13964        query.execute(self.graphql_client.clone()).await
13965    }
13966    /// Creates a tunnel that forwards traffic from the caller's network to this service.
13967    ///
13968    /// # Arguments
13969    ///
13970    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13971    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
13972        let mut query = self.selection.select("up");
13973        if let Some(ports) = opts.ports {
13974            query = query.arg("ports", ports);
13975        }
13976        if let Some(random) = opts.random {
13977            query = query.arg("random", random);
13978        }
13979        query.execute(self.graphql_client.clone()).await
13980    }
13981    /// Configures a hostname which can be used by clients within the session to reach this container.
13982    ///
13983    /// # Arguments
13984    ///
13985    /// * `hostname` - The hostname to use.
13986    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
13987        let mut query = self.selection.select("withHostname");
13988        query = query.arg("hostname", hostname.into());
13989        Service {
13990            proc: self.proc.clone(),
13991            selection: query,
13992            graphql_client: self.graphql_client.clone(),
13993        }
13994    }
13995}
13996#[derive(Clone)]
13997pub struct Socket {
13998    pub proc: Option<Arc<DaggerSessionProc>>,
13999    pub selection: Selection,
14000    pub graphql_client: DynGraphQLClient,
14001}
14002impl Socket {
14003    /// A unique identifier for this Socket.
14004    pub async fn id(&self) -> Result<SocketId, DaggerError> {
14005        let query = self.selection.select("id");
14006        query.execute(self.graphql_client.clone()).await
14007    }
14008}
14009#[derive(Clone)]
14010pub struct SourceMap {
14011    pub proc: Option<Arc<DaggerSessionProc>>,
14012    pub selection: Selection,
14013    pub graphql_client: DynGraphQLClient,
14014}
14015impl SourceMap {
14016    /// The column number within the line.
14017    pub async fn column(&self) -> Result<isize, DaggerError> {
14018        let query = self.selection.select("column");
14019        query.execute(self.graphql_client.clone()).await
14020    }
14021    /// The filename from the module source.
14022    pub async fn filename(&self) -> Result<String, DaggerError> {
14023        let query = self.selection.select("filename");
14024        query.execute(self.graphql_client.clone()).await
14025    }
14026    /// A unique identifier for this SourceMap.
14027    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
14028        let query = self.selection.select("id");
14029        query.execute(self.graphql_client.clone()).await
14030    }
14031    /// The line number within the filename.
14032    pub async fn line(&self) -> Result<isize, DaggerError> {
14033        let query = self.selection.select("line");
14034        query.execute(self.graphql_client.clone()).await
14035    }
14036    /// The module dependency this was declared in.
14037    pub async fn module(&self) -> Result<String, DaggerError> {
14038        let query = self.selection.select("module");
14039        query.execute(self.graphql_client.clone()).await
14040    }
14041    /// The URL to the file, if any. This can be used to link to the source map in the browser.
14042    pub async fn url(&self) -> Result<String, DaggerError> {
14043        let query = self.selection.select("url");
14044        query.execute(self.graphql_client.clone()).await
14045    }
14046}
14047#[derive(Clone)]
14048pub struct Stat {
14049    pub proc: Option<Arc<DaggerSessionProc>>,
14050    pub selection: Selection,
14051    pub graphql_client: DynGraphQLClient,
14052}
14053impl Stat {
14054    /// file type
14055    pub async fn file_type(&self) -> Result<FileType, DaggerError> {
14056        let query = self.selection.select("fileType");
14057        query.execute(self.graphql_client.clone()).await
14058    }
14059    /// A unique identifier for this Stat.
14060    pub async fn id(&self) -> Result<StatId, DaggerError> {
14061        let query = self.selection.select("id");
14062        query.execute(self.graphql_client.clone()).await
14063    }
14064    /// file name
14065    pub async fn name(&self) -> Result<String, DaggerError> {
14066        let query = self.selection.select("name");
14067        query.execute(self.graphql_client.clone()).await
14068    }
14069    /// permission bits
14070    pub async fn permissions(&self) -> Result<isize, DaggerError> {
14071        let query = self.selection.select("permissions");
14072        query.execute(self.graphql_client.clone()).await
14073    }
14074    /// file size
14075    pub async fn size(&self) -> Result<isize, DaggerError> {
14076        let query = self.selection.select("size");
14077        query.execute(self.graphql_client.clone()).await
14078    }
14079}
14080#[derive(Clone)]
14081pub struct Terminal {
14082    pub proc: Option<Arc<DaggerSessionProc>>,
14083    pub selection: Selection,
14084    pub graphql_client: DynGraphQLClient,
14085}
14086impl Terminal {
14087    /// A unique identifier for this Terminal.
14088    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
14089        let query = self.selection.select("id");
14090        query.execute(self.graphql_client.clone()).await
14091    }
14092    /// Forces evaluation of the pipeline in the engine.
14093    /// It doesn't run the default command if no exec has been set.
14094    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
14095        let query = self.selection.select("sync");
14096        query.execute(self.graphql_client.clone()).await
14097    }
14098}
14099#[derive(Clone)]
14100pub struct TypeDef {
14101    pub proc: Option<Arc<DaggerSessionProc>>,
14102    pub selection: Selection,
14103    pub graphql_client: DynGraphQLClient,
14104}
14105#[derive(Builder, Debug, PartialEq)]
14106pub struct TypeDefWithEnumOpts<'a> {
14107    /// A doc string for the enum, if any
14108    #[builder(setter(into, strip_option), default)]
14109    pub description: Option<&'a str>,
14110    /// The source map for the enum definition.
14111    #[builder(setter(into, strip_option), default)]
14112    pub source_map: Option<SourceMapId>,
14113}
14114#[derive(Builder, Debug, PartialEq)]
14115pub struct TypeDefWithEnumMemberOpts<'a> {
14116    /// If deprecated, the reason or migration path.
14117    #[builder(setter(into, strip_option), default)]
14118    pub deprecated: Option<&'a str>,
14119    /// A doc string for the member, if any
14120    #[builder(setter(into, strip_option), default)]
14121    pub description: Option<&'a str>,
14122    /// The source map for the enum member definition.
14123    #[builder(setter(into, strip_option), default)]
14124    pub source_map: Option<SourceMapId>,
14125    /// The value of the member in the enum
14126    #[builder(setter(into, strip_option), default)]
14127    pub value: Option<&'a str>,
14128}
14129#[derive(Builder, Debug, PartialEq)]
14130pub struct TypeDefWithEnumValueOpts<'a> {
14131    /// If deprecated, the reason or migration path.
14132    #[builder(setter(into, strip_option), default)]
14133    pub deprecated: Option<&'a str>,
14134    /// A doc string for the value, if any
14135    #[builder(setter(into, strip_option), default)]
14136    pub description: Option<&'a str>,
14137    /// The source map for the enum value definition.
14138    #[builder(setter(into, strip_option), default)]
14139    pub source_map: Option<SourceMapId>,
14140}
14141#[derive(Builder, Debug, PartialEq)]
14142pub struct TypeDefWithFieldOpts<'a> {
14143    /// If deprecated, the reason or migration path.
14144    #[builder(setter(into, strip_option), default)]
14145    pub deprecated: Option<&'a str>,
14146    /// A doc string for the field, if any
14147    #[builder(setter(into, strip_option), default)]
14148    pub description: Option<&'a str>,
14149    /// The source map for the field definition.
14150    #[builder(setter(into, strip_option), default)]
14151    pub source_map: Option<SourceMapId>,
14152}
14153#[derive(Builder, Debug, PartialEq)]
14154pub struct TypeDefWithInterfaceOpts<'a> {
14155    #[builder(setter(into, strip_option), default)]
14156    pub description: Option<&'a str>,
14157    #[builder(setter(into, strip_option), default)]
14158    pub source_map: Option<SourceMapId>,
14159}
14160#[derive(Builder, Debug, PartialEq)]
14161pub struct TypeDefWithObjectOpts<'a> {
14162    #[builder(setter(into, strip_option), default)]
14163    pub deprecated: Option<&'a str>,
14164    #[builder(setter(into, strip_option), default)]
14165    pub description: Option<&'a str>,
14166    #[builder(setter(into, strip_option), default)]
14167    pub source_map: Option<SourceMapId>,
14168}
14169#[derive(Builder, Debug, PartialEq)]
14170pub struct TypeDefWithScalarOpts<'a> {
14171    #[builder(setter(into, strip_option), default)]
14172    pub description: Option<&'a str>,
14173}
14174impl TypeDef {
14175    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
14176    pub fn as_enum(&self) -> EnumTypeDef {
14177        let query = self.selection.select("asEnum");
14178        EnumTypeDef {
14179            proc: self.proc.clone(),
14180            selection: query,
14181            graphql_client: self.graphql_client.clone(),
14182        }
14183    }
14184    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
14185    pub fn as_input(&self) -> InputTypeDef {
14186        let query = self.selection.select("asInput");
14187        InputTypeDef {
14188            proc: self.proc.clone(),
14189            selection: query,
14190            graphql_client: self.graphql_client.clone(),
14191        }
14192    }
14193    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
14194    pub fn as_interface(&self) -> InterfaceTypeDef {
14195        let query = self.selection.select("asInterface");
14196        InterfaceTypeDef {
14197            proc: self.proc.clone(),
14198            selection: query,
14199            graphql_client: self.graphql_client.clone(),
14200        }
14201    }
14202    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
14203    pub fn as_list(&self) -> ListTypeDef {
14204        let query = self.selection.select("asList");
14205        ListTypeDef {
14206            proc: self.proc.clone(),
14207            selection: query,
14208            graphql_client: self.graphql_client.clone(),
14209        }
14210    }
14211    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
14212    pub fn as_object(&self) -> ObjectTypeDef {
14213        let query = self.selection.select("asObject");
14214        ObjectTypeDef {
14215            proc: self.proc.clone(),
14216            selection: query,
14217            graphql_client: self.graphql_client.clone(),
14218        }
14219    }
14220    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
14221    pub fn as_scalar(&self) -> ScalarTypeDef {
14222        let query = self.selection.select("asScalar");
14223        ScalarTypeDef {
14224            proc: self.proc.clone(),
14225            selection: query,
14226            graphql_client: self.graphql_client.clone(),
14227        }
14228    }
14229    /// A unique identifier for this TypeDef.
14230    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
14231        let query = self.selection.select("id");
14232        query.execute(self.graphql_client.clone()).await
14233    }
14234    /// The kind of type this is (e.g. primitive, list, object).
14235    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
14236        let query = self.selection.select("kind");
14237        query.execute(self.graphql_client.clone()).await
14238    }
14239    /// Whether this type can be set to null. Defaults to false.
14240    pub async fn optional(&self) -> Result<bool, DaggerError> {
14241        let query = self.selection.select("optional");
14242        query.execute(self.graphql_client.clone()).await
14243    }
14244    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
14245    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
14246        let mut query = self.selection.select("withConstructor");
14247        query = query.arg_lazy(
14248            "function",
14249            Box::new(move || {
14250                let function = function.clone();
14251                Box::pin(async move { function.into_id().await.unwrap().quote() })
14252            }),
14253        );
14254        TypeDef {
14255            proc: self.proc.clone(),
14256            selection: query,
14257            graphql_client: self.graphql_client.clone(),
14258        }
14259    }
14260    /// Returns a TypeDef of kind Enum with the provided name.
14261    /// 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.
14262    ///
14263    /// # Arguments
14264    ///
14265    /// * `name` - The name of the enum
14266    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14267    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
14268        let mut query = self.selection.select("withEnum");
14269        query = query.arg("name", name.into());
14270        TypeDef {
14271            proc: self.proc.clone(),
14272            selection: query,
14273            graphql_client: self.graphql_client.clone(),
14274        }
14275    }
14276    /// Returns a TypeDef of kind Enum with the provided name.
14277    /// 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.
14278    ///
14279    /// # Arguments
14280    ///
14281    /// * `name` - The name of the enum
14282    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14283    pub fn with_enum_opts<'a>(
14284        &self,
14285        name: impl Into<String>,
14286        opts: TypeDefWithEnumOpts<'a>,
14287    ) -> TypeDef {
14288        let mut query = self.selection.select("withEnum");
14289        query = query.arg("name", name.into());
14290        if let Some(description) = opts.description {
14291            query = query.arg("description", description);
14292        }
14293        if let Some(source_map) = opts.source_map {
14294            query = query.arg("sourceMap", source_map);
14295        }
14296        TypeDef {
14297            proc: self.proc.clone(),
14298            selection: query,
14299            graphql_client: self.graphql_client.clone(),
14300        }
14301    }
14302    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14303    ///
14304    /// # Arguments
14305    ///
14306    /// * `name` - The name of the member in the enum
14307    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14308    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
14309        let mut query = self.selection.select("withEnumMember");
14310        query = query.arg("name", name.into());
14311        TypeDef {
14312            proc: self.proc.clone(),
14313            selection: query,
14314            graphql_client: self.graphql_client.clone(),
14315        }
14316    }
14317    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14318    ///
14319    /// # Arguments
14320    ///
14321    /// * `name` - The name of the member in the enum
14322    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14323    pub fn with_enum_member_opts<'a>(
14324        &self,
14325        name: impl Into<String>,
14326        opts: TypeDefWithEnumMemberOpts<'a>,
14327    ) -> TypeDef {
14328        let mut query = self.selection.select("withEnumMember");
14329        query = query.arg("name", name.into());
14330        if let Some(value) = opts.value {
14331            query = query.arg("value", value);
14332        }
14333        if let Some(description) = opts.description {
14334            query = query.arg("description", description);
14335        }
14336        if let Some(source_map) = opts.source_map {
14337            query = query.arg("sourceMap", source_map);
14338        }
14339        if let Some(deprecated) = opts.deprecated {
14340            query = query.arg("deprecated", deprecated);
14341        }
14342        TypeDef {
14343            proc: self.proc.clone(),
14344            selection: query,
14345            graphql_client: self.graphql_client.clone(),
14346        }
14347    }
14348    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14349    ///
14350    /// # Arguments
14351    ///
14352    /// * `value` - The name of the value in the enum
14353    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14354    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
14355        let mut query = self.selection.select("withEnumValue");
14356        query = query.arg("value", value.into());
14357        TypeDef {
14358            proc: self.proc.clone(),
14359            selection: query,
14360            graphql_client: self.graphql_client.clone(),
14361        }
14362    }
14363    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14364    ///
14365    /// # Arguments
14366    ///
14367    /// * `value` - The name of the value in the enum
14368    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14369    pub fn with_enum_value_opts<'a>(
14370        &self,
14371        value: impl Into<String>,
14372        opts: TypeDefWithEnumValueOpts<'a>,
14373    ) -> TypeDef {
14374        let mut query = self.selection.select("withEnumValue");
14375        query = query.arg("value", value.into());
14376        if let Some(description) = opts.description {
14377            query = query.arg("description", description);
14378        }
14379        if let Some(source_map) = opts.source_map {
14380            query = query.arg("sourceMap", source_map);
14381        }
14382        if let Some(deprecated) = opts.deprecated {
14383            query = query.arg("deprecated", deprecated);
14384        }
14385        TypeDef {
14386            proc: self.proc.clone(),
14387            selection: query,
14388            graphql_client: self.graphql_client.clone(),
14389        }
14390    }
14391    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
14392    ///
14393    /// # Arguments
14394    ///
14395    /// * `name` - The name of the field in the object
14396    /// * `type_def` - The type of the field
14397    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14398    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
14399        let mut query = self.selection.select("withField");
14400        query = query.arg("name", name.into());
14401        query = query.arg_lazy(
14402            "typeDef",
14403            Box::new(move || {
14404                let type_def = type_def.clone();
14405                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
14406            }),
14407        );
14408        TypeDef {
14409            proc: self.proc.clone(),
14410            selection: query,
14411            graphql_client: self.graphql_client.clone(),
14412        }
14413    }
14414    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
14415    ///
14416    /// # Arguments
14417    ///
14418    /// * `name` - The name of the field in the object
14419    /// * `type_def` - The type of the field
14420    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14421    pub fn with_field_opts<'a>(
14422        &self,
14423        name: impl Into<String>,
14424        type_def: impl IntoID<TypeDefId>,
14425        opts: TypeDefWithFieldOpts<'a>,
14426    ) -> TypeDef {
14427        let mut query = self.selection.select("withField");
14428        query = query.arg("name", name.into());
14429        query = query.arg_lazy(
14430            "typeDef",
14431            Box::new(move || {
14432                let type_def = type_def.clone();
14433                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
14434            }),
14435        );
14436        if let Some(description) = opts.description {
14437            query = query.arg("description", description);
14438        }
14439        if let Some(source_map) = opts.source_map {
14440            query = query.arg("sourceMap", source_map);
14441        }
14442        if let Some(deprecated) = opts.deprecated {
14443            query = query.arg("deprecated", deprecated);
14444        }
14445        TypeDef {
14446            proc: self.proc.clone(),
14447            selection: query,
14448            graphql_client: self.graphql_client.clone(),
14449        }
14450    }
14451    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
14452    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
14453        let mut query = self.selection.select("withFunction");
14454        query = query.arg_lazy(
14455            "function",
14456            Box::new(move || {
14457                let function = function.clone();
14458                Box::pin(async move { function.into_id().await.unwrap().quote() })
14459            }),
14460        );
14461        TypeDef {
14462            proc: self.proc.clone(),
14463            selection: query,
14464            graphql_client: self.graphql_client.clone(),
14465        }
14466    }
14467    /// Returns a TypeDef of kind Interface with the provided name.
14468    ///
14469    /// # Arguments
14470    ///
14471    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14472    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
14473        let mut query = self.selection.select("withInterface");
14474        query = query.arg("name", name.into());
14475        TypeDef {
14476            proc: self.proc.clone(),
14477            selection: query,
14478            graphql_client: self.graphql_client.clone(),
14479        }
14480    }
14481    /// Returns a TypeDef of kind Interface with the provided name.
14482    ///
14483    /// # Arguments
14484    ///
14485    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14486    pub fn with_interface_opts<'a>(
14487        &self,
14488        name: impl Into<String>,
14489        opts: TypeDefWithInterfaceOpts<'a>,
14490    ) -> TypeDef {
14491        let mut query = self.selection.select("withInterface");
14492        query = query.arg("name", name.into());
14493        if let Some(description) = opts.description {
14494            query = query.arg("description", description);
14495        }
14496        if let Some(source_map) = opts.source_map {
14497            query = query.arg("sourceMap", source_map);
14498        }
14499        TypeDef {
14500            proc: self.proc.clone(),
14501            selection: query,
14502            graphql_client: self.graphql_client.clone(),
14503        }
14504    }
14505    /// Sets the kind of the type.
14506    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
14507        let mut query = self.selection.select("withKind");
14508        query = query.arg("kind", kind);
14509        TypeDef {
14510            proc: self.proc.clone(),
14511            selection: query,
14512            graphql_client: self.graphql_client.clone(),
14513        }
14514    }
14515    /// Returns a TypeDef of kind List with the provided type for its elements.
14516    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
14517        let mut query = self.selection.select("withListOf");
14518        query = query.arg_lazy(
14519            "elementType",
14520            Box::new(move || {
14521                let element_type = element_type.clone();
14522                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
14523            }),
14524        );
14525        TypeDef {
14526            proc: self.proc.clone(),
14527            selection: query,
14528            graphql_client: self.graphql_client.clone(),
14529        }
14530    }
14531    /// Returns a TypeDef of kind Object with the provided name.
14532    /// 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.
14533    ///
14534    /// # Arguments
14535    ///
14536    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14537    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
14538        let mut query = self.selection.select("withObject");
14539        query = query.arg("name", name.into());
14540        TypeDef {
14541            proc: self.proc.clone(),
14542            selection: query,
14543            graphql_client: self.graphql_client.clone(),
14544        }
14545    }
14546    /// Returns a TypeDef of kind Object with the provided name.
14547    /// 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.
14548    ///
14549    /// # Arguments
14550    ///
14551    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14552    pub fn with_object_opts<'a>(
14553        &self,
14554        name: impl Into<String>,
14555        opts: TypeDefWithObjectOpts<'a>,
14556    ) -> TypeDef {
14557        let mut query = self.selection.select("withObject");
14558        query = query.arg("name", name.into());
14559        if let Some(description) = opts.description {
14560            query = query.arg("description", description);
14561        }
14562        if let Some(source_map) = opts.source_map {
14563            query = query.arg("sourceMap", source_map);
14564        }
14565        if let Some(deprecated) = opts.deprecated {
14566            query = query.arg("deprecated", deprecated);
14567        }
14568        TypeDef {
14569            proc: self.proc.clone(),
14570            selection: query,
14571            graphql_client: self.graphql_client.clone(),
14572        }
14573    }
14574    /// Sets whether this type can be set to null.
14575    pub fn with_optional(&self, optional: bool) -> TypeDef {
14576        let mut query = self.selection.select("withOptional");
14577        query = query.arg("optional", optional);
14578        TypeDef {
14579            proc: self.proc.clone(),
14580            selection: query,
14581            graphql_client: self.graphql_client.clone(),
14582        }
14583    }
14584    /// Returns a TypeDef of kind Scalar with the provided name.
14585    ///
14586    /// # Arguments
14587    ///
14588    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14589    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
14590        let mut query = self.selection.select("withScalar");
14591        query = query.arg("name", name.into());
14592        TypeDef {
14593            proc: self.proc.clone(),
14594            selection: query,
14595            graphql_client: self.graphql_client.clone(),
14596        }
14597    }
14598    /// Returns a TypeDef of kind Scalar with the provided name.
14599    ///
14600    /// # Arguments
14601    ///
14602    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14603    pub fn with_scalar_opts<'a>(
14604        &self,
14605        name: impl Into<String>,
14606        opts: TypeDefWithScalarOpts<'a>,
14607    ) -> TypeDef {
14608        let mut query = self.selection.select("withScalar");
14609        query = query.arg("name", name.into());
14610        if let Some(description) = opts.description {
14611            query = query.arg("description", description);
14612        }
14613        TypeDef {
14614            proc: self.proc.clone(),
14615            selection: query,
14616            graphql_client: self.graphql_client.clone(),
14617        }
14618    }
14619}
14620#[derive(Clone)]
14621pub struct Workspace {
14622    pub proc: Option<Arc<DaggerSessionProc>>,
14623    pub selection: Selection,
14624    pub graphql_client: DynGraphQLClient,
14625}
14626#[derive(Builder, Debug, PartialEq)]
14627pub struct WorkspaceDirectoryOpts<'a> {
14628    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
14629    #[builder(setter(into, strip_option), default)]
14630    pub exclude: Option<Vec<&'a str>>,
14631    /// Apply .gitignore filter rules inside the directory.
14632    #[builder(setter(into, strip_option), default)]
14633    pub gitignore: Option<bool>,
14634    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
14635    #[builder(setter(into, strip_option), default)]
14636    pub include: Option<Vec<&'a str>>,
14637}
14638#[derive(Builder, Debug, PartialEq)]
14639pub struct WorkspaceFindUpOpts<'a> {
14640    /// Path to start the search from, relative to the workspace root.
14641    #[builder(setter(into, strip_option), default)]
14642    pub from: Option<&'a str>,
14643}
14644impl Workspace {
14645    /// The client ID that owns this workspace's host filesystem.
14646    pub async fn client_id(&self) -> Result<String, DaggerError> {
14647        let query = self.selection.select("clientId");
14648        query.execute(self.graphql_client.clone()).await
14649    }
14650    /// Returns a Directory from the workspace.
14651    /// Path is relative to workspace root. Use "." for the root directory.
14652    ///
14653    /// # Arguments
14654    ///
14655    /// * `path` - Location of the directory to retrieve, relative to the workspace root (e.g., "src", ".").
14656    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14657    pub fn directory(&self, path: impl Into<String>) -> Directory {
14658        let mut query = self.selection.select("directory");
14659        query = query.arg("path", path.into());
14660        Directory {
14661            proc: self.proc.clone(),
14662            selection: query,
14663            graphql_client: self.graphql_client.clone(),
14664        }
14665    }
14666    /// Returns a Directory from the workspace.
14667    /// Path is relative to workspace root. Use "." for the root directory.
14668    ///
14669    /// # Arguments
14670    ///
14671    /// * `path` - Location of the directory to retrieve, relative to the workspace root (e.g., "src", ".").
14672    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14673    pub fn directory_opts<'a>(
14674        &self,
14675        path: impl Into<String>,
14676        opts: WorkspaceDirectoryOpts<'a>,
14677    ) -> Directory {
14678        let mut query = self.selection.select("directory");
14679        query = query.arg("path", path.into());
14680        if let Some(exclude) = opts.exclude {
14681            query = query.arg("exclude", exclude);
14682        }
14683        if let Some(include) = opts.include {
14684            query = query.arg("include", include);
14685        }
14686        if let Some(gitignore) = opts.gitignore {
14687            query = query.arg("gitignore", gitignore);
14688        }
14689        Directory {
14690            proc: self.proc.clone(),
14691            selection: query,
14692            graphql_client: self.graphql_client.clone(),
14693        }
14694    }
14695    /// Returns a File from the workspace.
14696    /// Path is relative to workspace root.
14697    ///
14698    /// # Arguments
14699    ///
14700    /// * `path` - Location of the file to retrieve, relative to the workspace root (e.g., "go.mod").
14701    pub fn file(&self, path: impl Into<String>) -> File {
14702        let mut query = self.selection.select("file");
14703        query = query.arg("path", path.into());
14704        File {
14705            proc: self.proc.clone(),
14706            selection: query,
14707            graphql_client: self.graphql_client.clone(),
14708        }
14709    }
14710    /// Search for a file or directory by walking up from the start path within the workspace.
14711    /// Returns the path relative to the workspace root if found, or null if not found.
14712    /// The search stops at the workspace root and will not traverse above it.
14713    ///
14714    /// # Arguments
14715    ///
14716    /// * `name` - The name of the file or directory to search for.
14717    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14718    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
14719        let mut query = self.selection.select("findUp");
14720        query = query.arg("name", name.into());
14721        query.execute(self.graphql_client.clone()).await
14722    }
14723    /// Search for a file or directory by walking up from the start path within the workspace.
14724    /// Returns the path relative to the workspace root if found, or null if not found.
14725    /// The search stops at the workspace root and will not traverse above it.
14726    ///
14727    /// # Arguments
14728    ///
14729    /// * `name` - The name of the file or directory to search for.
14730    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14731    pub async fn find_up_opts<'a>(
14732        &self,
14733        name: impl Into<String>,
14734        opts: WorkspaceFindUpOpts<'a>,
14735    ) -> Result<String, DaggerError> {
14736        let mut query = self.selection.select("findUp");
14737        query = query.arg("name", name.into());
14738        if let Some(from) = opts.from {
14739            query = query.arg("from", from);
14740        }
14741        query.execute(self.graphql_client.clone()).await
14742    }
14743    /// A unique identifier for this Workspace.
14744    pub async fn id(&self) -> Result<WorkspaceId, DaggerError> {
14745        let query = self.selection.select("id");
14746        query.execute(self.graphql_client.clone()).await
14747    }
14748    /// Absolute path to the workspace root directory.
14749    pub async fn root(&self) -> Result<String, DaggerError> {
14750        let query = self.selection.select("root");
14751        query.execute(self.graphql_client.clone()).await
14752    }
14753}
14754#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14755pub enum CacheSharingMode {
14756    #[serde(rename = "LOCKED")]
14757    Locked,
14758    #[serde(rename = "PRIVATE")]
14759    Private,
14760    #[serde(rename = "SHARED")]
14761    Shared,
14762}
14763#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14764pub enum ChangesetMergeConflict {
14765    #[serde(rename = "FAIL")]
14766    Fail,
14767    #[serde(rename = "FAIL_EARLY")]
14768    FailEarly,
14769    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
14770    LeaveConflictMarkers,
14771    #[serde(rename = "PREFER_OURS")]
14772    PreferOurs,
14773    #[serde(rename = "PREFER_THEIRS")]
14774    PreferTheirs,
14775}
14776#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14777pub enum ChangesetsMergeConflict {
14778    #[serde(rename = "FAIL")]
14779    Fail,
14780    #[serde(rename = "FAIL_EARLY")]
14781    FailEarly,
14782}
14783#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14784pub enum ExistsType {
14785    #[serde(rename = "DIRECTORY_TYPE")]
14786    DirectoryType,
14787    #[serde(rename = "REGULAR_TYPE")]
14788    RegularType,
14789    #[serde(rename = "SYMLINK_TYPE")]
14790    SymlinkType,
14791}
14792#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14793pub enum FileType {
14794    #[serde(rename = "DIRECTORY")]
14795    Directory,
14796    #[serde(rename = "DIRECTORY_TYPE")]
14797    DirectoryType,
14798    #[serde(rename = "REGULAR")]
14799    Regular,
14800    #[serde(rename = "REGULAR_TYPE")]
14801    RegularType,
14802    #[serde(rename = "SYMLINK")]
14803    Symlink,
14804    #[serde(rename = "SYMLINK_TYPE")]
14805    SymlinkType,
14806    #[serde(rename = "UNKNOWN")]
14807    Unknown,
14808}
14809#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14810pub enum FunctionCachePolicy {
14811    #[serde(rename = "Default")]
14812    Default,
14813    #[serde(rename = "Never")]
14814    Never,
14815    #[serde(rename = "PerSession")]
14816    PerSession,
14817}
14818#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14819pub enum ImageLayerCompression {
14820    #[serde(rename = "EStarGZ")]
14821    EStarGz,
14822    #[serde(rename = "ESTARGZ")]
14823    Estargz,
14824    #[serde(rename = "Gzip")]
14825    Gzip,
14826    #[serde(rename = "Uncompressed")]
14827    Uncompressed,
14828    #[serde(rename = "Zstd")]
14829    Zstd,
14830}
14831#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14832pub enum ImageMediaTypes {
14833    #[serde(rename = "DOCKER")]
14834    Docker,
14835    #[serde(rename = "DockerMediaTypes")]
14836    DockerMediaTypes,
14837    #[serde(rename = "OCI")]
14838    Oci,
14839    #[serde(rename = "OCIMediaTypes")]
14840    OciMediaTypes,
14841}
14842#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14843pub enum ModuleSourceExperimentalFeature {
14844    #[serde(rename = "SELF_CALLS")]
14845    SelfCalls,
14846}
14847#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14848pub enum ModuleSourceKind {
14849    #[serde(rename = "DIR")]
14850    Dir,
14851    #[serde(rename = "DIR_SOURCE")]
14852    DirSource,
14853    #[serde(rename = "GIT")]
14854    Git,
14855    #[serde(rename = "GIT_SOURCE")]
14856    GitSource,
14857    #[serde(rename = "LOCAL")]
14858    Local,
14859    #[serde(rename = "LOCAL_SOURCE")]
14860    LocalSource,
14861}
14862#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14863pub enum NetworkProtocol {
14864    #[serde(rename = "TCP")]
14865    Tcp,
14866    #[serde(rename = "UDP")]
14867    Udp,
14868}
14869#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14870pub enum ReturnType {
14871    #[serde(rename = "ANY")]
14872    Any,
14873    #[serde(rename = "FAILURE")]
14874    Failure,
14875    #[serde(rename = "SUCCESS")]
14876    Success,
14877}
14878#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14879pub enum TypeDefKind {
14880    #[serde(rename = "BOOLEAN")]
14881    Boolean,
14882    #[serde(rename = "BOOLEAN_KIND")]
14883    BooleanKind,
14884    #[serde(rename = "ENUM")]
14885    Enum,
14886    #[serde(rename = "ENUM_KIND")]
14887    EnumKind,
14888    #[serde(rename = "FLOAT")]
14889    Float,
14890    #[serde(rename = "FLOAT_KIND")]
14891    FloatKind,
14892    #[serde(rename = "INPUT")]
14893    Input,
14894    #[serde(rename = "INPUT_KIND")]
14895    InputKind,
14896    #[serde(rename = "INTEGER")]
14897    Integer,
14898    #[serde(rename = "INTEGER_KIND")]
14899    IntegerKind,
14900    #[serde(rename = "INTERFACE")]
14901    Interface,
14902    #[serde(rename = "INTERFACE_KIND")]
14903    InterfaceKind,
14904    #[serde(rename = "LIST")]
14905    List,
14906    #[serde(rename = "LIST_KIND")]
14907    ListKind,
14908    #[serde(rename = "OBJECT")]
14909    Object,
14910    #[serde(rename = "OBJECT_KIND")]
14911    ObjectKind,
14912    #[serde(rename = "SCALAR")]
14913    Scalar,
14914    #[serde(rename = "SCALAR_KIND")]
14915    ScalarKind,
14916    #[serde(rename = "STRING")]
14917    String,
14918    #[serde(rename = "STRING_KIND")]
14919    StringKind,
14920    #[serde(rename = "VOID")]
14921    Void,
14922    #[serde(rename = "VOID_KIND")]
14923    VoidKind,
14924}