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 GitRefId(pub String);
974impl From<&str> for GitRefId {
975    fn from(value: &str) -> Self {
976        Self(value.to_string())
977    }
978}
979impl From<String> for GitRefId {
980    fn from(value: String) -> Self {
981        Self(value)
982    }
983}
984impl IntoID<GitRefId> for GitRef {
985    fn into_id(
986        self,
987    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
988    {
989        Box::pin(async move { self.id().await })
990    }
991}
992impl IntoID<GitRefId> for GitRefId {
993    fn into_id(
994        self,
995    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
996    {
997        Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
998    }
999}
1000impl GitRefId {
1001    fn quote(&self) -> String {
1002        format!("\"{}\"", self.0.clone())
1003    }
1004}
1005#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1006pub struct GitRepositoryId(pub String);
1007impl From<&str> for GitRepositoryId {
1008    fn from(value: &str) -> Self {
1009        Self(value.to_string())
1010    }
1011}
1012impl From<String> for GitRepositoryId {
1013    fn from(value: String) -> Self {
1014        Self(value)
1015    }
1016}
1017impl IntoID<GitRepositoryId> for GitRepository {
1018    fn into_id(
1019        self,
1020    ) -> std::pin::Pin<
1021        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
1022    > {
1023        Box::pin(async move { self.id().await })
1024    }
1025}
1026impl IntoID<GitRepositoryId> for GitRepositoryId {
1027    fn into_id(
1028        self,
1029    ) -> std::pin::Pin<
1030        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
1031    > {
1032        Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
1033    }
1034}
1035impl GitRepositoryId {
1036    fn quote(&self) -> String {
1037        format!("\"{}\"", self.0.clone())
1038    }
1039}
1040#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1041pub struct HostId(pub String);
1042impl From<&str> for HostId {
1043    fn from(value: &str) -> Self {
1044        Self(value.to_string())
1045    }
1046}
1047impl From<String> for HostId {
1048    fn from(value: String) -> Self {
1049        Self(value)
1050    }
1051}
1052impl IntoID<HostId> for Host {
1053    fn into_id(
1054        self,
1055    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
1056    {
1057        Box::pin(async move { self.id().await })
1058    }
1059}
1060impl IntoID<HostId> for HostId {
1061    fn into_id(
1062        self,
1063    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
1064    {
1065        Box::pin(async move { Ok::<HostId, DaggerError>(self) })
1066    }
1067}
1068impl HostId {
1069    fn quote(&self) -> String {
1070        format!("\"{}\"", self.0.clone())
1071    }
1072}
1073#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1074pub struct InputTypeDefId(pub String);
1075impl From<&str> for InputTypeDefId {
1076    fn from(value: &str) -> Self {
1077        Self(value.to_string())
1078    }
1079}
1080impl From<String> for InputTypeDefId {
1081    fn from(value: String) -> Self {
1082        Self(value)
1083    }
1084}
1085impl IntoID<InputTypeDefId> for InputTypeDef {
1086    fn into_id(
1087        self,
1088    ) -> std::pin::Pin<
1089        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1090    > {
1091        Box::pin(async move { self.id().await })
1092    }
1093}
1094impl IntoID<InputTypeDefId> for InputTypeDefId {
1095    fn into_id(
1096        self,
1097    ) -> std::pin::Pin<
1098        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1099    > {
1100        Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
1101    }
1102}
1103impl InputTypeDefId {
1104    fn quote(&self) -> String {
1105        format!("\"{}\"", self.0.clone())
1106    }
1107}
1108#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1109pub struct InterfaceTypeDefId(pub String);
1110impl From<&str> for InterfaceTypeDefId {
1111    fn from(value: &str) -> Self {
1112        Self(value.to_string())
1113    }
1114}
1115impl From<String> for InterfaceTypeDefId {
1116    fn from(value: String) -> Self {
1117        Self(value)
1118    }
1119}
1120impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
1121    fn into_id(
1122        self,
1123    ) -> std::pin::Pin<
1124        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1125    > {
1126        Box::pin(async move { self.id().await })
1127    }
1128}
1129impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
1130    fn into_id(
1131        self,
1132    ) -> std::pin::Pin<
1133        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1134    > {
1135        Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
1136    }
1137}
1138impl InterfaceTypeDefId {
1139    fn quote(&self) -> String {
1140        format!("\"{}\"", self.0.clone())
1141    }
1142}
1143#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1144pub struct Json(pub String);
1145impl From<&str> for Json {
1146    fn from(value: &str) -> Self {
1147        Self(value.to_string())
1148    }
1149}
1150impl From<String> for Json {
1151    fn from(value: String) -> Self {
1152        Self(value)
1153    }
1154}
1155impl Json {
1156    fn quote(&self) -> String {
1157        format!("\"{}\"", self.0.clone())
1158    }
1159}
1160#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1161pub struct JsonValueId(pub String);
1162impl From<&str> for JsonValueId {
1163    fn from(value: &str) -> Self {
1164        Self(value.to_string())
1165    }
1166}
1167impl From<String> for JsonValueId {
1168    fn from(value: String) -> Self {
1169        Self(value)
1170    }
1171}
1172impl IntoID<JsonValueId> for JsonValue {
1173    fn into_id(
1174        self,
1175    ) -> std::pin::Pin<
1176        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1177    > {
1178        Box::pin(async move { self.id().await })
1179    }
1180}
1181impl IntoID<JsonValueId> for JsonValueId {
1182    fn into_id(
1183        self,
1184    ) -> std::pin::Pin<
1185        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1186    > {
1187        Box::pin(async move { Ok::<JsonValueId, DaggerError>(self) })
1188    }
1189}
1190impl JsonValueId {
1191    fn quote(&self) -> String {
1192        format!("\"{}\"", self.0.clone())
1193    }
1194}
1195#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1196pub struct Llmid(pub String);
1197impl From<&str> for Llmid {
1198    fn from(value: &str) -> Self {
1199        Self(value.to_string())
1200    }
1201}
1202impl From<String> for Llmid {
1203    fn from(value: String) -> Self {
1204        Self(value)
1205    }
1206}
1207impl IntoID<Llmid> for Llm {
1208    fn into_id(
1209        self,
1210    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1211    {
1212        Box::pin(async move { self.id().await })
1213    }
1214}
1215impl IntoID<Llmid> for Llmid {
1216    fn into_id(
1217        self,
1218    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1219    {
1220        Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
1221    }
1222}
1223impl Llmid {
1224    fn quote(&self) -> String {
1225        format!("\"{}\"", self.0.clone())
1226    }
1227}
1228#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1229pub struct LlmTokenUsageId(pub String);
1230impl From<&str> for LlmTokenUsageId {
1231    fn from(value: &str) -> Self {
1232        Self(value.to_string())
1233    }
1234}
1235impl From<String> for LlmTokenUsageId {
1236    fn from(value: String) -> Self {
1237        Self(value)
1238    }
1239}
1240impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
1241    fn into_id(
1242        self,
1243    ) -> std::pin::Pin<
1244        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1245    > {
1246        Box::pin(async move { self.id().await })
1247    }
1248}
1249impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
1250    fn into_id(
1251        self,
1252    ) -> std::pin::Pin<
1253        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1254    > {
1255        Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
1256    }
1257}
1258impl LlmTokenUsageId {
1259    fn quote(&self) -> String {
1260        format!("\"{}\"", self.0.clone())
1261    }
1262}
1263#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1264pub struct LabelId(pub String);
1265impl From<&str> for LabelId {
1266    fn from(value: &str) -> Self {
1267        Self(value.to_string())
1268    }
1269}
1270impl From<String> for LabelId {
1271    fn from(value: String) -> Self {
1272        Self(value)
1273    }
1274}
1275impl IntoID<LabelId> for Label {
1276    fn into_id(
1277        self,
1278    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1279    {
1280        Box::pin(async move { self.id().await })
1281    }
1282}
1283impl IntoID<LabelId> for LabelId {
1284    fn into_id(
1285        self,
1286    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1287    {
1288        Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
1289    }
1290}
1291impl LabelId {
1292    fn quote(&self) -> String {
1293        format!("\"{}\"", self.0.clone())
1294    }
1295}
1296#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1297pub struct ListTypeDefId(pub String);
1298impl From<&str> for ListTypeDefId {
1299    fn from(value: &str) -> Self {
1300        Self(value.to_string())
1301    }
1302}
1303impl From<String> for ListTypeDefId {
1304    fn from(value: String) -> Self {
1305        Self(value)
1306    }
1307}
1308impl IntoID<ListTypeDefId> for ListTypeDef {
1309    fn into_id(
1310        self,
1311    ) -> std::pin::Pin<
1312        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1313    > {
1314        Box::pin(async move { self.id().await })
1315    }
1316}
1317impl IntoID<ListTypeDefId> for ListTypeDefId {
1318    fn into_id(
1319        self,
1320    ) -> std::pin::Pin<
1321        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1322    > {
1323        Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
1324    }
1325}
1326impl ListTypeDefId {
1327    fn quote(&self) -> String {
1328        format!("\"{}\"", self.0.clone())
1329    }
1330}
1331#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1332pub struct ModuleConfigClientId(pub String);
1333impl From<&str> for ModuleConfigClientId {
1334    fn from(value: &str) -> Self {
1335        Self(value.to_string())
1336    }
1337}
1338impl From<String> for ModuleConfigClientId {
1339    fn from(value: String) -> Self {
1340        Self(value)
1341    }
1342}
1343impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
1344    fn into_id(
1345        self,
1346    ) -> std::pin::Pin<
1347        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1348    > {
1349        Box::pin(async move { self.id().await })
1350    }
1351}
1352impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
1353    fn into_id(
1354        self,
1355    ) -> std::pin::Pin<
1356        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1357    > {
1358        Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
1359    }
1360}
1361impl ModuleConfigClientId {
1362    fn quote(&self) -> String {
1363        format!("\"{}\"", self.0.clone())
1364    }
1365}
1366#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1367pub struct ModuleId(pub String);
1368impl From<&str> for ModuleId {
1369    fn from(value: &str) -> Self {
1370        Self(value.to_string())
1371    }
1372}
1373impl From<String> for ModuleId {
1374    fn from(value: String) -> Self {
1375        Self(value)
1376    }
1377}
1378impl IntoID<ModuleId> for Module {
1379    fn into_id(
1380        self,
1381    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1382    {
1383        Box::pin(async move { self.id().await })
1384    }
1385}
1386impl IntoID<ModuleId> for ModuleId {
1387    fn into_id(
1388        self,
1389    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1390    {
1391        Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
1392    }
1393}
1394impl ModuleId {
1395    fn quote(&self) -> String {
1396        format!("\"{}\"", self.0.clone())
1397    }
1398}
1399#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1400pub struct ModuleSourceId(pub String);
1401impl From<&str> for ModuleSourceId {
1402    fn from(value: &str) -> Self {
1403        Self(value.to_string())
1404    }
1405}
1406impl From<String> for ModuleSourceId {
1407    fn from(value: String) -> Self {
1408        Self(value)
1409    }
1410}
1411impl IntoID<ModuleSourceId> for ModuleSource {
1412    fn into_id(
1413        self,
1414    ) -> std::pin::Pin<
1415        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1416    > {
1417        Box::pin(async move { self.id().await })
1418    }
1419}
1420impl IntoID<ModuleSourceId> for ModuleSourceId {
1421    fn into_id(
1422        self,
1423    ) -> std::pin::Pin<
1424        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1425    > {
1426        Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1427    }
1428}
1429impl ModuleSourceId {
1430    fn quote(&self) -> String {
1431        format!("\"{}\"", self.0.clone())
1432    }
1433}
1434#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1435pub struct ObjectTypeDefId(pub String);
1436impl From<&str> for ObjectTypeDefId {
1437    fn from(value: &str) -> Self {
1438        Self(value.to_string())
1439    }
1440}
1441impl From<String> for ObjectTypeDefId {
1442    fn from(value: String) -> Self {
1443        Self(value)
1444    }
1445}
1446impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1447    fn into_id(
1448        self,
1449    ) -> std::pin::Pin<
1450        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1451    > {
1452        Box::pin(async move { self.id().await })
1453    }
1454}
1455impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1456    fn into_id(
1457        self,
1458    ) -> std::pin::Pin<
1459        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1460    > {
1461        Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1462    }
1463}
1464impl ObjectTypeDefId {
1465    fn quote(&self) -> String {
1466        format!("\"{}\"", self.0.clone())
1467    }
1468}
1469#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1470pub struct Platform(pub String);
1471impl From<&str> for Platform {
1472    fn from(value: &str) -> Self {
1473        Self(value.to_string())
1474    }
1475}
1476impl From<String> for Platform {
1477    fn from(value: String) -> Self {
1478        Self(value)
1479    }
1480}
1481impl Platform {
1482    fn quote(&self) -> String {
1483        format!("\"{}\"", self.0.clone())
1484    }
1485}
1486#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1487pub struct PortId(pub String);
1488impl From<&str> for PortId {
1489    fn from(value: &str) -> Self {
1490        Self(value.to_string())
1491    }
1492}
1493impl From<String> for PortId {
1494    fn from(value: String) -> Self {
1495        Self(value)
1496    }
1497}
1498impl IntoID<PortId> for Port {
1499    fn into_id(
1500        self,
1501    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1502    {
1503        Box::pin(async move { self.id().await })
1504    }
1505}
1506impl IntoID<PortId> for PortId {
1507    fn into_id(
1508        self,
1509    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1510    {
1511        Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1512    }
1513}
1514impl PortId {
1515    fn quote(&self) -> String {
1516        format!("\"{}\"", self.0.clone())
1517    }
1518}
1519#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1520pub struct SdkConfigId(pub String);
1521impl From<&str> for SdkConfigId {
1522    fn from(value: &str) -> Self {
1523        Self(value.to_string())
1524    }
1525}
1526impl From<String> for SdkConfigId {
1527    fn from(value: String) -> Self {
1528        Self(value)
1529    }
1530}
1531impl IntoID<SdkConfigId> for SdkConfig {
1532    fn into_id(
1533        self,
1534    ) -> std::pin::Pin<
1535        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1536    > {
1537        Box::pin(async move { self.id().await })
1538    }
1539}
1540impl IntoID<SdkConfigId> for SdkConfigId {
1541    fn into_id(
1542        self,
1543    ) -> std::pin::Pin<
1544        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1545    > {
1546        Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1547    }
1548}
1549impl SdkConfigId {
1550    fn quote(&self) -> String {
1551        format!("\"{}\"", self.0.clone())
1552    }
1553}
1554#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1555pub struct ScalarTypeDefId(pub String);
1556impl From<&str> for ScalarTypeDefId {
1557    fn from(value: &str) -> Self {
1558        Self(value.to_string())
1559    }
1560}
1561impl From<String> for ScalarTypeDefId {
1562    fn from(value: String) -> Self {
1563        Self(value)
1564    }
1565}
1566impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1567    fn into_id(
1568        self,
1569    ) -> std::pin::Pin<
1570        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1571    > {
1572        Box::pin(async move { self.id().await })
1573    }
1574}
1575impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1576    fn into_id(
1577        self,
1578    ) -> std::pin::Pin<
1579        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1580    > {
1581        Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1582    }
1583}
1584impl ScalarTypeDefId {
1585    fn quote(&self) -> String {
1586        format!("\"{}\"", self.0.clone())
1587    }
1588}
1589#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1590pub struct SearchResultId(pub String);
1591impl From<&str> for SearchResultId {
1592    fn from(value: &str) -> Self {
1593        Self(value.to_string())
1594    }
1595}
1596impl From<String> for SearchResultId {
1597    fn from(value: String) -> Self {
1598        Self(value)
1599    }
1600}
1601impl IntoID<SearchResultId> for SearchResult {
1602    fn into_id(
1603        self,
1604    ) -> std::pin::Pin<
1605        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1606    > {
1607        Box::pin(async move { self.id().await })
1608    }
1609}
1610impl IntoID<SearchResultId> for SearchResultId {
1611    fn into_id(
1612        self,
1613    ) -> std::pin::Pin<
1614        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1615    > {
1616        Box::pin(async move { Ok::<SearchResultId, DaggerError>(self) })
1617    }
1618}
1619impl SearchResultId {
1620    fn quote(&self) -> String {
1621        format!("\"{}\"", self.0.clone())
1622    }
1623}
1624#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1625pub struct SearchSubmatchId(pub String);
1626impl From<&str> for SearchSubmatchId {
1627    fn from(value: &str) -> Self {
1628        Self(value.to_string())
1629    }
1630}
1631impl From<String> for SearchSubmatchId {
1632    fn from(value: String) -> Self {
1633        Self(value)
1634    }
1635}
1636impl IntoID<SearchSubmatchId> for SearchSubmatch {
1637    fn into_id(
1638        self,
1639    ) -> std::pin::Pin<
1640        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1641    > {
1642        Box::pin(async move { self.id().await })
1643    }
1644}
1645impl IntoID<SearchSubmatchId> for SearchSubmatchId {
1646    fn into_id(
1647        self,
1648    ) -> std::pin::Pin<
1649        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1650    > {
1651        Box::pin(async move { Ok::<SearchSubmatchId, DaggerError>(self) })
1652    }
1653}
1654impl SearchSubmatchId {
1655    fn quote(&self) -> String {
1656        format!("\"{}\"", self.0.clone())
1657    }
1658}
1659#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1660pub struct SecretId(pub String);
1661impl From<&str> for SecretId {
1662    fn from(value: &str) -> Self {
1663        Self(value.to_string())
1664    }
1665}
1666impl From<String> for SecretId {
1667    fn from(value: String) -> Self {
1668        Self(value)
1669    }
1670}
1671impl IntoID<SecretId> for Secret {
1672    fn into_id(
1673        self,
1674    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1675    {
1676        Box::pin(async move { self.id().await })
1677    }
1678}
1679impl IntoID<SecretId> for SecretId {
1680    fn into_id(
1681        self,
1682    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1683    {
1684        Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1685    }
1686}
1687impl SecretId {
1688    fn quote(&self) -> String {
1689        format!("\"{}\"", self.0.clone())
1690    }
1691}
1692#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1693pub struct ServiceId(pub String);
1694impl From<&str> for ServiceId {
1695    fn from(value: &str) -> Self {
1696        Self(value.to_string())
1697    }
1698}
1699impl From<String> for ServiceId {
1700    fn from(value: String) -> Self {
1701        Self(value)
1702    }
1703}
1704impl IntoID<ServiceId> for Service {
1705    fn into_id(
1706        self,
1707    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1708    {
1709        Box::pin(async move { self.id().await })
1710    }
1711}
1712impl IntoID<ServiceId> for ServiceId {
1713    fn into_id(
1714        self,
1715    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1716    {
1717        Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1718    }
1719}
1720impl ServiceId {
1721    fn quote(&self) -> String {
1722        format!("\"{}\"", self.0.clone())
1723    }
1724}
1725#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1726pub struct SocketId(pub String);
1727impl From<&str> for SocketId {
1728    fn from(value: &str) -> Self {
1729        Self(value.to_string())
1730    }
1731}
1732impl From<String> for SocketId {
1733    fn from(value: String) -> Self {
1734        Self(value)
1735    }
1736}
1737impl IntoID<SocketId> for Socket {
1738    fn into_id(
1739        self,
1740    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1741    {
1742        Box::pin(async move { self.id().await })
1743    }
1744}
1745impl IntoID<SocketId> for SocketId {
1746    fn into_id(
1747        self,
1748    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1749    {
1750        Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1751    }
1752}
1753impl SocketId {
1754    fn quote(&self) -> String {
1755        format!("\"{}\"", self.0.clone())
1756    }
1757}
1758#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1759pub struct SourceMapId(pub String);
1760impl From<&str> for SourceMapId {
1761    fn from(value: &str) -> Self {
1762        Self(value.to_string())
1763    }
1764}
1765impl From<String> for SourceMapId {
1766    fn from(value: String) -> Self {
1767        Self(value)
1768    }
1769}
1770impl IntoID<SourceMapId> for SourceMap {
1771    fn into_id(
1772        self,
1773    ) -> std::pin::Pin<
1774        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1775    > {
1776        Box::pin(async move { self.id().await })
1777    }
1778}
1779impl IntoID<SourceMapId> for SourceMapId {
1780    fn into_id(
1781        self,
1782    ) -> std::pin::Pin<
1783        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1784    > {
1785        Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1786    }
1787}
1788impl SourceMapId {
1789    fn quote(&self) -> String {
1790        format!("\"{}\"", self.0.clone())
1791    }
1792}
1793#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1794pub struct StatId(pub String);
1795impl From<&str> for StatId {
1796    fn from(value: &str) -> Self {
1797        Self(value.to_string())
1798    }
1799}
1800impl From<String> for StatId {
1801    fn from(value: String) -> Self {
1802        Self(value)
1803    }
1804}
1805impl IntoID<StatId> for Stat {
1806    fn into_id(
1807        self,
1808    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<StatId, DaggerError>> + Send>>
1809    {
1810        Box::pin(async move { self.id().await })
1811    }
1812}
1813impl IntoID<StatId> for StatId {
1814    fn into_id(
1815        self,
1816    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<StatId, DaggerError>> + Send>>
1817    {
1818        Box::pin(async move { Ok::<StatId, DaggerError>(self) })
1819    }
1820}
1821impl StatId {
1822    fn quote(&self) -> String {
1823        format!("\"{}\"", self.0.clone())
1824    }
1825}
1826#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1827pub struct TerminalId(pub String);
1828impl From<&str> for TerminalId {
1829    fn from(value: &str) -> Self {
1830        Self(value.to_string())
1831    }
1832}
1833impl From<String> for TerminalId {
1834    fn from(value: String) -> Self {
1835        Self(value)
1836    }
1837}
1838impl IntoID<TerminalId> for Terminal {
1839    fn into_id(
1840        self,
1841    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1842    {
1843        Box::pin(async move { self.id().await })
1844    }
1845}
1846impl IntoID<TerminalId> for TerminalId {
1847    fn into_id(
1848        self,
1849    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1850    {
1851        Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
1852    }
1853}
1854impl TerminalId {
1855    fn quote(&self) -> String {
1856        format!("\"{}\"", self.0.clone())
1857    }
1858}
1859#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1860pub struct TypeDefId(pub String);
1861impl From<&str> for TypeDefId {
1862    fn from(value: &str) -> Self {
1863        Self(value.to_string())
1864    }
1865}
1866impl From<String> for TypeDefId {
1867    fn from(value: String) -> Self {
1868        Self(value)
1869    }
1870}
1871impl IntoID<TypeDefId> for TypeDef {
1872    fn into_id(
1873        self,
1874    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1875    {
1876        Box::pin(async move { self.id().await })
1877    }
1878}
1879impl IntoID<TypeDefId> for TypeDefId {
1880    fn into_id(
1881        self,
1882    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1883    {
1884        Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
1885    }
1886}
1887impl TypeDefId {
1888    fn quote(&self) -> String {
1889        format!("\"{}\"", self.0.clone())
1890    }
1891}
1892#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1893pub struct Void(pub String);
1894impl From<&str> for Void {
1895    fn from(value: &str) -> Self {
1896        Self(value.to_string())
1897    }
1898}
1899impl From<String> for Void {
1900    fn from(value: String) -> Self {
1901        Self(value)
1902    }
1903}
1904impl Void {
1905    fn quote(&self) -> String {
1906        format!("\"{}\"", self.0.clone())
1907    }
1908}
1909#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1910pub struct BuildArg {
1911    pub name: String,
1912    pub value: String,
1913}
1914#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1915pub struct PipelineLabel {
1916    pub name: String,
1917    pub value: String,
1918}
1919#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1920pub struct PortForward {
1921    pub backend: isize,
1922    pub frontend: isize,
1923    pub protocol: NetworkProtocol,
1924}
1925#[derive(Clone)]
1926pub struct Address {
1927    pub proc: Option<Arc<DaggerSessionProc>>,
1928    pub selection: Selection,
1929    pub graphql_client: DynGraphQLClient,
1930}
1931#[derive(Builder, Debug, PartialEq)]
1932pub struct AddressDirectoryOpts<'a> {
1933    #[builder(setter(into, strip_option), default)]
1934    pub exclude: Option<Vec<&'a str>>,
1935    #[builder(setter(into, strip_option), default)]
1936    pub gitignore: Option<bool>,
1937    #[builder(setter(into, strip_option), default)]
1938    pub include: Option<Vec<&'a str>>,
1939    #[builder(setter(into, strip_option), default)]
1940    pub no_cache: Option<bool>,
1941}
1942#[derive(Builder, Debug, PartialEq)]
1943pub struct AddressFileOpts<'a> {
1944    #[builder(setter(into, strip_option), default)]
1945    pub exclude: Option<Vec<&'a str>>,
1946    #[builder(setter(into, strip_option), default)]
1947    pub gitignore: Option<bool>,
1948    #[builder(setter(into, strip_option), default)]
1949    pub include: Option<Vec<&'a str>>,
1950    #[builder(setter(into, strip_option), default)]
1951    pub no_cache: Option<bool>,
1952}
1953impl Address {
1954    /// Load a container from the address.
1955    pub fn container(&self) -> Container {
1956        let query = self.selection.select("container");
1957        Container {
1958            proc: self.proc.clone(),
1959            selection: query,
1960            graphql_client: self.graphql_client.clone(),
1961        }
1962    }
1963    /// Load a directory from the address.
1964    ///
1965    /// # Arguments
1966    ///
1967    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1968    pub fn directory(&self) -> Directory {
1969        let query = self.selection.select("directory");
1970        Directory {
1971            proc: self.proc.clone(),
1972            selection: query,
1973            graphql_client: self.graphql_client.clone(),
1974        }
1975    }
1976    /// Load a directory from the address.
1977    ///
1978    /// # Arguments
1979    ///
1980    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1981    pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
1982        let mut query = self.selection.select("directory");
1983        if let Some(exclude) = opts.exclude {
1984            query = query.arg("exclude", exclude);
1985        }
1986        if let Some(include) = opts.include {
1987            query = query.arg("include", include);
1988        }
1989        if let Some(gitignore) = opts.gitignore {
1990            query = query.arg("gitignore", gitignore);
1991        }
1992        if let Some(no_cache) = opts.no_cache {
1993            query = query.arg("noCache", no_cache);
1994        }
1995        Directory {
1996            proc: self.proc.clone(),
1997            selection: query,
1998            graphql_client: self.graphql_client.clone(),
1999        }
2000    }
2001    /// Load a file from the address.
2002    ///
2003    /// # Arguments
2004    ///
2005    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2006    pub fn file(&self) -> File {
2007        let query = self.selection.select("file");
2008        File {
2009            proc: self.proc.clone(),
2010            selection: query,
2011            graphql_client: self.graphql_client.clone(),
2012        }
2013    }
2014    /// Load a file from the address.
2015    ///
2016    /// # Arguments
2017    ///
2018    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2019    pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
2020        let mut query = self.selection.select("file");
2021        if let Some(exclude) = opts.exclude {
2022            query = query.arg("exclude", exclude);
2023        }
2024        if let Some(include) = opts.include {
2025            query = query.arg("include", include);
2026        }
2027        if let Some(gitignore) = opts.gitignore {
2028            query = query.arg("gitignore", gitignore);
2029        }
2030        if let Some(no_cache) = opts.no_cache {
2031            query = query.arg("noCache", no_cache);
2032        }
2033        File {
2034            proc: self.proc.clone(),
2035            selection: query,
2036            graphql_client: self.graphql_client.clone(),
2037        }
2038    }
2039    /// Load a git ref (branch, tag or commit) from the address.
2040    pub fn git_ref(&self) -> GitRef {
2041        let query = self.selection.select("gitRef");
2042        GitRef {
2043            proc: self.proc.clone(),
2044            selection: query,
2045            graphql_client: self.graphql_client.clone(),
2046        }
2047    }
2048    /// Load a git repository from the address.
2049    pub fn git_repository(&self) -> GitRepository {
2050        let query = self.selection.select("gitRepository");
2051        GitRepository {
2052            proc: self.proc.clone(),
2053            selection: query,
2054            graphql_client: self.graphql_client.clone(),
2055        }
2056    }
2057    /// A unique identifier for this Address.
2058    pub async fn id(&self) -> Result<AddressId, DaggerError> {
2059        let query = self.selection.select("id");
2060        query.execute(self.graphql_client.clone()).await
2061    }
2062    /// Load a secret from the address.
2063    pub fn secret(&self) -> Secret {
2064        let query = self.selection.select("secret");
2065        Secret {
2066            proc: self.proc.clone(),
2067            selection: query,
2068            graphql_client: self.graphql_client.clone(),
2069        }
2070    }
2071    /// Load a service from the address.
2072    pub fn service(&self) -> Service {
2073        let query = self.selection.select("service");
2074        Service {
2075            proc: self.proc.clone(),
2076            selection: query,
2077            graphql_client: self.graphql_client.clone(),
2078        }
2079    }
2080    /// Load a local socket from the address.
2081    pub fn socket(&self) -> Socket {
2082        let query = self.selection.select("socket");
2083        Socket {
2084            proc: self.proc.clone(),
2085            selection: query,
2086            graphql_client: self.graphql_client.clone(),
2087        }
2088    }
2089    /// The address value
2090    pub async fn value(&self) -> Result<String, DaggerError> {
2091        let query = self.selection.select("value");
2092        query.execute(self.graphql_client.clone()).await
2093    }
2094}
2095#[derive(Clone)]
2096pub struct Binding {
2097    pub proc: Option<Arc<DaggerSessionProc>>,
2098    pub selection: Selection,
2099    pub graphql_client: DynGraphQLClient,
2100}
2101impl Binding {
2102    /// Retrieve the binding value, as type Address
2103    pub fn as_address(&self) -> Address {
2104        let query = self.selection.select("asAddress");
2105        Address {
2106            proc: self.proc.clone(),
2107            selection: query,
2108            graphql_client: self.graphql_client.clone(),
2109        }
2110    }
2111    /// Retrieve the binding value, as type CacheVolume
2112    pub fn as_cache_volume(&self) -> CacheVolume {
2113        let query = self.selection.select("asCacheVolume");
2114        CacheVolume {
2115            proc: self.proc.clone(),
2116            selection: query,
2117            graphql_client: self.graphql_client.clone(),
2118        }
2119    }
2120    /// Retrieve the binding value, as type Changeset
2121    pub fn as_changeset(&self) -> Changeset {
2122        let query = self.selection.select("asChangeset");
2123        Changeset {
2124            proc: self.proc.clone(),
2125            selection: query,
2126            graphql_client: self.graphql_client.clone(),
2127        }
2128    }
2129    /// Retrieve the binding value, as type Check
2130    pub fn as_check(&self) -> Check {
2131        let query = self.selection.select("asCheck");
2132        Check {
2133            proc: self.proc.clone(),
2134            selection: query,
2135            graphql_client: self.graphql_client.clone(),
2136        }
2137    }
2138    /// Retrieve the binding value, as type CheckGroup
2139    pub fn as_check_group(&self) -> CheckGroup {
2140        let query = self.selection.select("asCheckGroup");
2141        CheckGroup {
2142            proc: self.proc.clone(),
2143            selection: query,
2144            graphql_client: self.graphql_client.clone(),
2145        }
2146    }
2147    /// Retrieve the binding value, as type Cloud
2148    pub fn as_cloud(&self) -> Cloud {
2149        let query = self.selection.select("asCloud");
2150        Cloud {
2151            proc: self.proc.clone(),
2152            selection: query,
2153            graphql_client: self.graphql_client.clone(),
2154        }
2155    }
2156    /// Retrieve the binding value, as type Container
2157    pub fn as_container(&self) -> Container {
2158        let query = self.selection.select("asContainer");
2159        Container {
2160            proc: self.proc.clone(),
2161            selection: query,
2162            graphql_client: self.graphql_client.clone(),
2163        }
2164    }
2165    /// Retrieve the binding value, as type Directory
2166    pub fn as_directory(&self) -> Directory {
2167        let query = self.selection.select("asDirectory");
2168        Directory {
2169            proc: self.proc.clone(),
2170            selection: query,
2171            graphql_client: self.graphql_client.clone(),
2172        }
2173    }
2174    /// Retrieve the binding value, as type Env
2175    pub fn as_env(&self) -> Env {
2176        let query = self.selection.select("asEnv");
2177        Env {
2178            proc: self.proc.clone(),
2179            selection: query,
2180            graphql_client: self.graphql_client.clone(),
2181        }
2182    }
2183    /// Retrieve the binding value, as type EnvFile
2184    pub fn as_env_file(&self) -> EnvFile {
2185        let query = self.selection.select("asEnvFile");
2186        EnvFile {
2187            proc: self.proc.clone(),
2188            selection: query,
2189            graphql_client: self.graphql_client.clone(),
2190        }
2191    }
2192    /// Retrieve the binding value, as type File
2193    pub fn as_file(&self) -> File {
2194        let query = self.selection.select("asFile");
2195        File {
2196            proc: self.proc.clone(),
2197            selection: query,
2198            graphql_client: self.graphql_client.clone(),
2199        }
2200    }
2201    /// Retrieve the binding value, as type GitRef
2202    pub fn as_git_ref(&self) -> GitRef {
2203        let query = self.selection.select("asGitRef");
2204        GitRef {
2205            proc: self.proc.clone(),
2206            selection: query,
2207            graphql_client: self.graphql_client.clone(),
2208        }
2209    }
2210    /// Retrieve the binding value, as type GitRepository
2211    pub fn as_git_repository(&self) -> GitRepository {
2212        let query = self.selection.select("asGitRepository");
2213        GitRepository {
2214            proc: self.proc.clone(),
2215            selection: query,
2216            graphql_client: self.graphql_client.clone(),
2217        }
2218    }
2219    /// Retrieve the binding value, as type JSONValue
2220    pub fn as_json_value(&self) -> JsonValue {
2221        let query = self.selection.select("asJSONValue");
2222        JsonValue {
2223            proc: self.proc.clone(),
2224            selection: query,
2225            graphql_client: self.graphql_client.clone(),
2226        }
2227    }
2228    /// Retrieve the binding value, as type Module
2229    pub fn as_module(&self) -> Module {
2230        let query = self.selection.select("asModule");
2231        Module {
2232            proc: self.proc.clone(),
2233            selection: query,
2234            graphql_client: self.graphql_client.clone(),
2235        }
2236    }
2237    /// Retrieve the binding value, as type ModuleConfigClient
2238    pub fn as_module_config_client(&self) -> ModuleConfigClient {
2239        let query = self.selection.select("asModuleConfigClient");
2240        ModuleConfigClient {
2241            proc: self.proc.clone(),
2242            selection: query,
2243            graphql_client: self.graphql_client.clone(),
2244        }
2245    }
2246    /// Retrieve the binding value, as type ModuleSource
2247    pub fn as_module_source(&self) -> ModuleSource {
2248        let query = self.selection.select("asModuleSource");
2249        ModuleSource {
2250            proc: self.proc.clone(),
2251            selection: query,
2252            graphql_client: self.graphql_client.clone(),
2253        }
2254    }
2255    /// Retrieve the binding value, as type SearchResult
2256    pub fn as_search_result(&self) -> SearchResult {
2257        let query = self.selection.select("asSearchResult");
2258        SearchResult {
2259            proc: self.proc.clone(),
2260            selection: query,
2261            graphql_client: self.graphql_client.clone(),
2262        }
2263    }
2264    /// Retrieve the binding value, as type SearchSubmatch
2265    pub fn as_search_submatch(&self) -> SearchSubmatch {
2266        let query = self.selection.select("asSearchSubmatch");
2267        SearchSubmatch {
2268            proc: self.proc.clone(),
2269            selection: query,
2270            graphql_client: self.graphql_client.clone(),
2271        }
2272    }
2273    /// Retrieve the binding value, as type Secret
2274    pub fn as_secret(&self) -> Secret {
2275        let query = self.selection.select("asSecret");
2276        Secret {
2277            proc: self.proc.clone(),
2278            selection: query,
2279            graphql_client: self.graphql_client.clone(),
2280        }
2281    }
2282    /// Retrieve the binding value, as type Service
2283    pub fn as_service(&self) -> Service {
2284        let query = self.selection.select("asService");
2285        Service {
2286            proc: self.proc.clone(),
2287            selection: query,
2288            graphql_client: self.graphql_client.clone(),
2289        }
2290    }
2291    /// Retrieve the binding value, as type Socket
2292    pub fn as_socket(&self) -> Socket {
2293        let query = self.selection.select("asSocket");
2294        Socket {
2295            proc: self.proc.clone(),
2296            selection: query,
2297            graphql_client: self.graphql_client.clone(),
2298        }
2299    }
2300    /// Retrieve the binding value, as type Stat
2301    pub fn as_stat(&self) -> Stat {
2302        let query = self.selection.select("asStat");
2303        Stat {
2304            proc: self.proc.clone(),
2305            selection: query,
2306            graphql_client: self.graphql_client.clone(),
2307        }
2308    }
2309    /// Returns the binding's string value
2310    pub async fn as_string(&self) -> Result<String, DaggerError> {
2311        let query = self.selection.select("asString");
2312        query.execute(self.graphql_client.clone()).await
2313    }
2314    /// Returns the digest of the binding value
2315    pub async fn digest(&self) -> Result<String, DaggerError> {
2316        let query = self.selection.select("digest");
2317        query.execute(self.graphql_client.clone()).await
2318    }
2319    /// A unique identifier for this Binding.
2320    pub async fn id(&self) -> Result<BindingId, DaggerError> {
2321        let query = self.selection.select("id");
2322        query.execute(self.graphql_client.clone()).await
2323    }
2324    /// Returns true if the binding is null
2325    pub async fn is_null(&self) -> Result<bool, DaggerError> {
2326        let query = self.selection.select("isNull");
2327        query.execute(self.graphql_client.clone()).await
2328    }
2329    /// Returns the binding name
2330    pub async fn name(&self) -> Result<String, DaggerError> {
2331        let query = self.selection.select("name");
2332        query.execute(self.graphql_client.clone()).await
2333    }
2334    /// Returns the binding type
2335    pub async fn type_name(&self) -> Result<String, DaggerError> {
2336        let query = self.selection.select("typeName");
2337        query.execute(self.graphql_client.clone()).await
2338    }
2339}
2340#[derive(Clone)]
2341pub struct CacheVolume {
2342    pub proc: Option<Arc<DaggerSessionProc>>,
2343    pub selection: Selection,
2344    pub graphql_client: DynGraphQLClient,
2345}
2346impl CacheVolume {
2347    /// A unique identifier for this CacheVolume.
2348    pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
2349        let query = self.selection.select("id");
2350        query.execute(self.graphql_client.clone()).await
2351    }
2352}
2353#[derive(Clone)]
2354pub struct Changeset {
2355    pub proc: Option<Arc<DaggerSessionProc>>,
2356    pub selection: Selection,
2357    pub graphql_client: DynGraphQLClient,
2358}
2359impl Changeset {
2360    /// Files and directories that were added in the newer directory.
2361    pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2362        let query = self.selection.select("addedPaths");
2363        query.execute(self.graphql_client.clone()).await
2364    }
2365    /// The newer/upper snapshot.
2366    pub fn after(&self) -> Directory {
2367        let query = self.selection.select("after");
2368        Directory {
2369            proc: self.proc.clone(),
2370            selection: query,
2371            graphql_client: self.graphql_client.clone(),
2372        }
2373    }
2374    /// Return a Git-compatible patch of the changes
2375    pub fn as_patch(&self) -> File {
2376        let query = self.selection.select("asPatch");
2377        File {
2378            proc: self.proc.clone(),
2379            selection: query,
2380            graphql_client: self.graphql_client.clone(),
2381        }
2382    }
2383    /// The older/lower snapshot to compare against.
2384    pub fn before(&self) -> Directory {
2385        let query = self.selection.select("before");
2386        Directory {
2387            proc: self.proc.clone(),
2388            selection: query,
2389            graphql_client: self.graphql_client.clone(),
2390        }
2391    }
2392    /// Applies the diff represented by this changeset to a path on the host.
2393    ///
2394    /// # Arguments
2395    ///
2396    /// * `path` - Location of the copied directory (e.g., "logs/").
2397    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2398        let mut query = self.selection.select("export");
2399        query = query.arg("path", path.into());
2400        query.execute(self.graphql_client.clone()).await
2401    }
2402    /// A unique identifier for this Changeset.
2403    pub async fn id(&self) -> Result<ChangesetId, DaggerError> {
2404        let query = self.selection.select("id");
2405        query.execute(self.graphql_client.clone()).await
2406    }
2407    /// Returns true if the changeset is empty (i.e. there are no changes).
2408    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
2409        let query = self.selection.select("isEmpty");
2410        query.execute(self.graphql_client.clone()).await
2411    }
2412    /// Return a snapshot containing only the created and modified files
2413    pub fn layer(&self) -> Directory {
2414        let query = self.selection.select("layer");
2415        Directory {
2416            proc: self.proc.clone(),
2417            selection: query,
2418            graphql_client: self.graphql_client.clone(),
2419        }
2420    }
2421    /// Files and directories that existed before and were updated in the newer directory.
2422    pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2423        let query = self.selection.select("modifiedPaths");
2424        query.execute(self.graphql_client.clone()).await
2425    }
2426    /// Files and directories that were removed. Directories are indicated by a trailing slash, and their child paths are not included.
2427    pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2428        let query = self.selection.select("removedPaths");
2429        query.execute(self.graphql_client.clone()).await
2430    }
2431    /// Force evaluation in the engine.
2432    pub async fn sync(&self) -> Result<ChangesetId, DaggerError> {
2433        let query = self.selection.select("sync");
2434        query.execute(self.graphql_client.clone()).await
2435    }
2436}
2437#[derive(Clone)]
2438pub struct Check {
2439    pub proc: Option<Arc<DaggerSessionProc>>,
2440    pub selection: Selection,
2441    pub graphql_client: DynGraphQLClient,
2442}
2443impl Check {
2444    /// Whether the check completed
2445    pub async fn completed(&self) -> Result<bool, DaggerError> {
2446        let query = self.selection.select("completed");
2447        query.execute(self.graphql_client.clone()).await
2448    }
2449    /// The description of the check
2450    pub async fn description(&self) -> Result<String, DaggerError> {
2451        let query = self.selection.select("description");
2452        query.execute(self.graphql_client.clone()).await
2453    }
2454    /// A unique identifier for this Check.
2455    pub async fn id(&self) -> Result<CheckId, DaggerError> {
2456        let query = self.selection.select("id");
2457        query.execute(self.graphql_client.clone()).await
2458    }
2459    /// Return the fully qualified name of the check
2460    pub async fn name(&self) -> Result<String, DaggerError> {
2461        let query = self.selection.select("name");
2462        query.execute(self.graphql_client.clone()).await
2463    }
2464    /// Whether the check passed
2465    pub async fn passed(&self) -> Result<bool, DaggerError> {
2466        let query = self.selection.select("passed");
2467        query.execute(self.graphql_client.clone()).await
2468    }
2469    /// The path of the check within its module
2470    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
2471        let query = self.selection.select("path");
2472        query.execute(self.graphql_client.clone()).await
2473    }
2474    /// An emoji representing the result of the check
2475    pub async fn result_emoji(&self) -> Result<String, DaggerError> {
2476        let query = self.selection.select("resultEmoji");
2477        query.execute(self.graphql_client.clone()).await
2478    }
2479    /// Execute the check
2480    pub fn run(&self) -> Check {
2481        let query = self.selection.select("run");
2482        Check {
2483            proc: self.proc.clone(),
2484            selection: query,
2485            graphql_client: self.graphql_client.clone(),
2486        }
2487    }
2488    /// The module source where the check is defined (i.e., toolchains)
2489    pub fn source(&self) -> ModuleSource {
2490        let query = self.selection.select("source");
2491        ModuleSource {
2492            proc: self.proc.clone(),
2493            selection: query,
2494            graphql_client: self.graphql_client.clone(),
2495        }
2496    }
2497}
2498#[derive(Clone)]
2499pub struct CheckGroup {
2500    pub proc: Option<Arc<DaggerSessionProc>>,
2501    pub selection: Selection,
2502    pub graphql_client: DynGraphQLClient,
2503}
2504impl CheckGroup {
2505    /// A unique identifier for this CheckGroup.
2506    pub async fn id(&self) -> Result<CheckGroupId, DaggerError> {
2507        let query = self.selection.select("id");
2508        query.execute(self.graphql_client.clone()).await
2509    }
2510    /// Return a list of individual checks and their details
2511    pub fn list(&self) -> Vec<Check> {
2512        let query = self.selection.select("list");
2513        vec![Check {
2514            proc: self.proc.clone(),
2515            selection: query,
2516            graphql_client: self.graphql_client.clone(),
2517        }]
2518    }
2519    /// Generate a markdown report
2520    pub fn report(&self) -> File {
2521        let query = self.selection.select("report");
2522        File {
2523            proc: self.proc.clone(),
2524            selection: query,
2525            graphql_client: self.graphql_client.clone(),
2526        }
2527    }
2528    /// Execute all selected checks
2529    pub fn run(&self) -> CheckGroup {
2530        let query = self.selection.select("run");
2531        CheckGroup {
2532            proc: self.proc.clone(),
2533            selection: query,
2534            graphql_client: self.graphql_client.clone(),
2535        }
2536    }
2537}
2538#[derive(Clone)]
2539pub struct Cloud {
2540    pub proc: Option<Arc<DaggerSessionProc>>,
2541    pub selection: Selection,
2542    pub graphql_client: DynGraphQLClient,
2543}
2544impl Cloud {
2545    /// A unique identifier for this Cloud.
2546    pub async fn id(&self) -> Result<CloudId, DaggerError> {
2547        let query = self.selection.select("id");
2548        query.execute(self.graphql_client.clone()).await
2549    }
2550    /// The trace URL for the current session
2551    pub async fn trace_url(&self) -> Result<String, DaggerError> {
2552        let query = self.selection.select("traceURL");
2553        query.execute(self.graphql_client.clone()).await
2554    }
2555}
2556#[derive(Clone)]
2557pub struct Container {
2558    pub proc: Option<Arc<DaggerSessionProc>>,
2559    pub selection: Selection,
2560    pub graphql_client: DynGraphQLClient,
2561}
2562#[derive(Builder, Debug, PartialEq)]
2563pub struct ContainerAsServiceOpts<'a> {
2564    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2565    /// If empty, the container's default command is used.
2566    #[builder(setter(into, strip_option), default)]
2567    pub args: Option<Vec<&'a str>>,
2568    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2569    #[builder(setter(into, strip_option), default)]
2570    pub expand: Option<bool>,
2571    /// Provides Dagger access to the executed command.
2572    #[builder(setter(into, strip_option), default)]
2573    pub experimental_privileged_nesting: Option<bool>,
2574    /// 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.
2575    #[builder(setter(into, strip_option), default)]
2576    pub insecure_root_capabilities: Option<bool>,
2577    /// If set, skip the automatic init process injected into containers by default.
2578    /// 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.
2579    #[builder(setter(into, strip_option), default)]
2580    pub no_init: Option<bool>,
2581    /// If the container has an entrypoint, prepend it to the args.
2582    #[builder(setter(into, strip_option), default)]
2583    pub use_entrypoint: Option<bool>,
2584}
2585#[derive(Builder, Debug, PartialEq)]
2586pub struct ContainerAsTarballOpts {
2587    /// Force each layer of the image to use the specified compression algorithm.
2588    /// 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.
2589    #[builder(setter(into, strip_option), default)]
2590    pub forced_compression: Option<ImageLayerCompression>,
2591    /// Use the specified media types for the image's layers.
2592    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2593    #[builder(setter(into, strip_option), default)]
2594    pub media_types: Option<ImageMediaTypes>,
2595    /// Identifiers for other platform specific containers.
2596    /// Used for multi-platform images.
2597    #[builder(setter(into, strip_option), default)]
2598    pub platform_variants: Option<Vec<ContainerId>>,
2599}
2600#[derive(Builder, Debug, PartialEq)]
2601pub struct ContainerDirectoryOpts {
2602    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2603    #[builder(setter(into, strip_option), default)]
2604    pub expand: Option<bool>,
2605}
2606#[derive(Builder, Debug, PartialEq)]
2607pub struct ContainerExistsOpts {
2608    /// If specified, do not follow symlinks.
2609    #[builder(setter(into, strip_option), default)]
2610    pub do_not_follow_symlinks: Option<bool>,
2611    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
2612    #[builder(setter(into, strip_option), default)]
2613    pub expected_type: Option<ExistsType>,
2614}
2615#[derive(Builder, Debug, PartialEq)]
2616pub struct ContainerExportOpts {
2617    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2618    #[builder(setter(into, strip_option), default)]
2619    pub expand: Option<bool>,
2620    /// Force each layer of the exported image to use the specified compression algorithm.
2621    /// 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.
2622    #[builder(setter(into, strip_option), default)]
2623    pub forced_compression: Option<ImageLayerCompression>,
2624    /// Use the specified media types for the exported image's layers.
2625    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2626    #[builder(setter(into, strip_option), default)]
2627    pub media_types: Option<ImageMediaTypes>,
2628    /// Identifiers for other platform specific containers.
2629    /// Used for multi-platform image.
2630    #[builder(setter(into, strip_option), default)]
2631    pub platform_variants: Option<Vec<ContainerId>>,
2632}
2633#[derive(Builder, Debug, PartialEq)]
2634pub struct ContainerExportImageOpts {
2635    /// Force each layer of the exported image to use the specified compression algorithm.
2636    /// 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.
2637    #[builder(setter(into, strip_option), default)]
2638    pub forced_compression: Option<ImageLayerCompression>,
2639    /// Use the specified media types for the exported image's layers.
2640    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2641    #[builder(setter(into, strip_option), default)]
2642    pub media_types: Option<ImageMediaTypes>,
2643    /// Identifiers for other platform specific containers.
2644    /// Used for multi-platform image.
2645    #[builder(setter(into, strip_option), default)]
2646    pub platform_variants: Option<Vec<ContainerId>>,
2647}
2648#[derive(Builder, Debug, PartialEq)]
2649pub struct ContainerFileOpts {
2650    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2651    #[builder(setter(into, strip_option), default)]
2652    pub expand: Option<bool>,
2653}
2654#[derive(Builder, Debug, PartialEq)]
2655pub struct ContainerImportOpts<'a> {
2656    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
2657    #[builder(setter(into, strip_option), default)]
2658    pub tag: Option<&'a str>,
2659}
2660#[derive(Builder, Debug, PartialEq)]
2661pub struct ContainerPublishOpts {
2662    /// Force each layer of the published image to use the specified compression algorithm.
2663    /// 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.
2664    #[builder(setter(into, strip_option), default)]
2665    pub forced_compression: Option<ImageLayerCompression>,
2666    /// Use the specified media types for the published image's layers.
2667    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
2668    #[builder(setter(into, strip_option), default)]
2669    pub media_types: Option<ImageMediaTypes>,
2670    /// Identifiers for other platform specific containers.
2671    /// Used for multi-platform image.
2672    #[builder(setter(into, strip_option), default)]
2673    pub platform_variants: Option<Vec<ContainerId>>,
2674}
2675#[derive(Builder, Debug, PartialEq)]
2676pub struct ContainerStatOpts {
2677    /// If specified, do not follow symlinks.
2678    #[builder(setter(into, strip_option), default)]
2679    pub do_not_follow_symlinks: Option<bool>,
2680}
2681#[derive(Builder, Debug, PartialEq)]
2682pub struct ContainerTerminalOpts<'a> {
2683    /// If set, override the container's default terminal command and invoke these command arguments instead.
2684    #[builder(setter(into, strip_option), default)]
2685    pub cmd: Option<Vec<&'a str>>,
2686    /// Provides Dagger access to the executed command.
2687    #[builder(setter(into, strip_option), default)]
2688    pub experimental_privileged_nesting: Option<bool>,
2689    /// 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.
2690    #[builder(setter(into, strip_option), default)]
2691    pub insecure_root_capabilities: Option<bool>,
2692}
2693#[derive(Builder, Debug, PartialEq)]
2694pub struct ContainerUpOpts<'a> {
2695    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2696    /// If empty, the container's default command is used.
2697    #[builder(setter(into, strip_option), default)]
2698    pub args: Option<Vec<&'a str>>,
2699    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2700    #[builder(setter(into, strip_option), default)]
2701    pub expand: Option<bool>,
2702    /// Provides Dagger access to the executed command.
2703    #[builder(setter(into, strip_option), default)]
2704    pub experimental_privileged_nesting: Option<bool>,
2705    /// 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.
2706    #[builder(setter(into, strip_option), default)]
2707    pub insecure_root_capabilities: Option<bool>,
2708    /// If set, skip the automatic init process injected into containers by default.
2709    /// 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.
2710    #[builder(setter(into, strip_option), default)]
2711    pub no_init: Option<bool>,
2712    /// List of frontend/backend port mappings to forward.
2713    /// Frontend is the port accepting traffic on the host, backend is the service port.
2714    #[builder(setter(into, strip_option), default)]
2715    pub ports: Option<Vec<PortForward>>,
2716    /// Bind each tunnel port to a random port on the host.
2717    #[builder(setter(into, strip_option), default)]
2718    pub random: Option<bool>,
2719    /// If the container has an entrypoint, prepend it to the args.
2720    #[builder(setter(into, strip_option), default)]
2721    pub use_entrypoint: Option<bool>,
2722}
2723#[derive(Builder, Debug, PartialEq)]
2724pub struct ContainerWithDefaultTerminalCmdOpts {
2725    /// Provides Dagger access to the executed command.
2726    #[builder(setter(into, strip_option), default)]
2727    pub experimental_privileged_nesting: Option<bool>,
2728    /// 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.
2729    #[builder(setter(into, strip_option), default)]
2730    pub insecure_root_capabilities: Option<bool>,
2731}
2732#[derive(Builder, Debug, PartialEq)]
2733pub struct ContainerWithDirectoryOpts<'a> {
2734    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
2735    #[builder(setter(into, strip_option), default)]
2736    pub exclude: Option<Vec<&'a str>>,
2737    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2738    #[builder(setter(into, strip_option), default)]
2739    pub expand: Option<bool>,
2740    /// Apply .gitignore rules when writing the directory.
2741    #[builder(setter(into, strip_option), default)]
2742    pub gitignore: Option<bool>,
2743    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
2744    #[builder(setter(into, strip_option), default)]
2745    pub include: Option<Vec<&'a str>>,
2746    /// A user:group to set for the directory and its contents.
2747    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2748    /// If the group is omitted, it defaults to the same as the user.
2749    #[builder(setter(into, strip_option), default)]
2750    pub owner: Option<&'a str>,
2751}
2752#[derive(Builder, Debug, PartialEq)]
2753pub struct ContainerWithEntrypointOpts {
2754    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
2755    #[builder(setter(into, strip_option), default)]
2756    pub keep_default_args: Option<bool>,
2757}
2758#[derive(Builder, Debug, PartialEq)]
2759pub struct ContainerWithEnvVariableOpts {
2760    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
2761    #[builder(setter(into, strip_option), default)]
2762    pub expand: Option<bool>,
2763}
2764#[derive(Builder, Debug, PartialEq)]
2765pub struct ContainerWithExecOpts<'a> {
2766    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2767    #[builder(setter(into, strip_option), default)]
2768    pub expand: Option<bool>,
2769    /// Exit codes this command is allowed to exit with without error
2770    #[builder(setter(into, strip_option), default)]
2771    pub expect: Option<ReturnType>,
2772    /// Provides Dagger access to the executed command.
2773    #[builder(setter(into, strip_option), default)]
2774    pub experimental_privileged_nesting: Option<bool>,
2775    /// Execute the command with all root capabilities. Like --privileged in Docker
2776    /// 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.
2777    #[builder(setter(into, strip_option), default)]
2778    pub insecure_root_capabilities: Option<bool>,
2779    /// Skip the automatic init process injected into containers by default.
2780    /// 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.
2781    #[builder(setter(into, strip_option), default)]
2782    pub no_init: Option<bool>,
2783    /// Redirect the command's standard error to a file in the container. Example: "./stderr.txt"
2784    #[builder(setter(into, strip_option), default)]
2785    pub redirect_stderr: Option<&'a str>,
2786    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
2787    #[builder(setter(into, strip_option), default)]
2788    pub redirect_stdin: Option<&'a str>,
2789    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
2790    #[builder(setter(into, strip_option), default)]
2791    pub redirect_stdout: Option<&'a str>,
2792    /// Content to write to the command's standard input. Example: "Hello world")
2793    #[builder(setter(into, strip_option), default)]
2794    pub stdin: Option<&'a str>,
2795    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
2796    #[builder(setter(into, strip_option), default)]
2797    pub use_entrypoint: Option<bool>,
2798}
2799#[derive(Builder, Debug, PartialEq)]
2800pub struct ContainerWithExposedPortOpts<'a> {
2801    /// Port description. Example: "payment API endpoint"
2802    #[builder(setter(into, strip_option), default)]
2803    pub description: Option<&'a str>,
2804    /// Skip the health check when run as a service.
2805    #[builder(setter(into, strip_option), default)]
2806    pub experimental_skip_healthcheck: Option<bool>,
2807    /// Network protocol. Example: "tcp"
2808    #[builder(setter(into, strip_option), default)]
2809    pub protocol: Option<NetworkProtocol>,
2810}
2811#[derive(Builder, Debug, PartialEq)]
2812pub struct ContainerWithFileOpts<'a> {
2813    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2814    #[builder(setter(into, strip_option), default)]
2815    pub expand: Option<bool>,
2816    /// A user:group to set for the file.
2817    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2818    /// If the group is omitted, it defaults to the same as the user.
2819    #[builder(setter(into, strip_option), default)]
2820    pub owner: Option<&'a str>,
2821    /// Permissions of the new file. Example: 0600
2822    #[builder(setter(into, strip_option), default)]
2823    pub permissions: Option<isize>,
2824}
2825#[derive(Builder, Debug, PartialEq)]
2826pub struct ContainerWithFilesOpts<'a> {
2827    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2828    #[builder(setter(into, strip_option), default)]
2829    pub expand: Option<bool>,
2830    /// A user:group to set for the files.
2831    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2832    /// If the group is omitted, it defaults to the same as the user.
2833    #[builder(setter(into, strip_option), default)]
2834    pub owner: Option<&'a str>,
2835    /// Permission given to the copied files (e.g., 0600).
2836    #[builder(setter(into, strip_option), default)]
2837    pub permissions: Option<isize>,
2838}
2839#[derive(Builder, Debug, PartialEq)]
2840pub struct ContainerWithMountedCacheOpts<'a> {
2841    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2842    #[builder(setter(into, strip_option), default)]
2843    pub expand: Option<bool>,
2844    /// A user:group to set for the mounted cache directory.
2845    /// 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.
2846    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2847    /// If the group is omitted, it defaults to the same as the user.
2848    #[builder(setter(into, strip_option), default)]
2849    pub owner: Option<&'a str>,
2850    /// Sharing mode of the cache volume.
2851    #[builder(setter(into, strip_option), default)]
2852    pub sharing: Option<CacheSharingMode>,
2853    /// Identifier of the directory to use as the cache volume's root.
2854    #[builder(setter(into, strip_option), default)]
2855    pub source: Option<DirectoryId>,
2856}
2857#[derive(Builder, Debug, PartialEq)]
2858pub struct ContainerWithMountedDirectoryOpts<'a> {
2859    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2860    #[builder(setter(into, strip_option), default)]
2861    pub expand: Option<bool>,
2862    /// A user:group to set for the mounted directory and its contents.
2863    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2864    /// If the group is omitted, it defaults to the same as the user.
2865    #[builder(setter(into, strip_option), default)]
2866    pub owner: Option<&'a str>,
2867}
2868#[derive(Builder, Debug, PartialEq)]
2869pub struct ContainerWithMountedFileOpts<'a> {
2870    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2871    #[builder(setter(into, strip_option), default)]
2872    pub expand: Option<bool>,
2873    /// A user or user:group to set for the mounted file.
2874    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2875    /// If the group is omitted, it defaults to the same as the user.
2876    #[builder(setter(into, strip_option), default)]
2877    pub owner: Option<&'a str>,
2878}
2879#[derive(Builder, Debug, PartialEq)]
2880pub struct ContainerWithMountedSecretOpts<'a> {
2881    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2882    #[builder(setter(into, strip_option), default)]
2883    pub expand: Option<bool>,
2884    /// Permission given to the mounted secret (e.g., 0600).
2885    /// This option requires an owner to be set to be active.
2886    #[builder(setter(into, strip_option), default)]
2887    pub mode: Option<isize>,
2888    /// A user:group to set for the mounted secret.
2889    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2890    /// If the group is omitted, it defaults to the same as the user.
2891    #[builder(setter(into, strip_option), default)]
2892    pub owner: Option<&'a str>,
2893}
2894#[derive(Builder, Debug, PartialEq)]
2895pub struct ContainerWithMountedTempOpts {
2896    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2897    #[builder(setter(into, strip_option), default)]
2898    pub expand: Option<bool>,
2899    /// Size of the temporary directory in bytes.
2900    #[builder(setter(into, strip_option), default)]
2901    pub size: Option<isize>,
2902}
2903#[derive(Builder, Debug, PartialEq)]
2904pub struct ContainerWithNewFileOpts<'a> {
2905    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2906    #[builder(setter(into, strip_option), default)]
2907    pub expand: Option<bool>,
2908    /// A user:group to set for the file.
2909    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2910    /// If the group is omitted, it defaults to the same as the user.
2911    #[builder(setter(into, strip_option), default)]
2912    pub owner: Option<&'a str>,
2913    /// Permissions of the new file. Example: 0600
2914    #[builder(setter(into, strip_option), default)]
2915    pub permissions: Option<isize>,
2916}
2917#[derive(Builder, Debug, PartialEq)]
2918pub struct ContainerWithSymlinkOpts {
2919    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2920    #[builder(setter(into, strip_option), default)]
2921    pub expand: Option<bool>,
2922}
2923#[derive(Builder, Debug, PartialEq)]
2924pub struct ContainerWithUnixSocketOpts<'a> {
2925    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2926    #[builder(setter(into, strip_option), default)]
2927    pub expand: Option<bool>,
2928    /// A user:group to set for the mounted socket.
2929    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2930    /// If the group is omitted, it defaults to the same as the user.
2931    #[builder(setter(into, strip_option), default)]
2932    pub owner: Option<&'a str>,
2933}
2934#[derive(Builder, Debug, PartialEq)]
2935pub struct ContainerWithWorkdirOpts {
2936    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2937    #[builder(setter(into, strip_option), default)]
2938    pub expand: Option<bool>,
2939}
2940#[derive(Builder, Debug, PartialEq)]
2941pub struct ContainerWithoutDirectoryOpts {
2942    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2943    #[builder(setter(into, strip_option), default)]
2944    pub expand: Option<bool>,
2945}
2946#[derive(Builder, Debug, PartialEq)]
2947pub struct ContainerWithoutEntrypointOpts {
2948    /// Don't remove the default arguments when unsetting the entrypoint.
2949    #[builder(setter(into, strip_option), default)]
2950    pub keep_default_args: Option<bool>,
2951}
2952#[derive(Builder, Debug, PartialEq)]
2953pub struct ContainerWithoutExposedPortOpts {
2954    /// Port protocol to unexpose
2955    #[builder(setter(into, strip_option), default)]
2956    pub protocol: Option<NetworkProtocol>,
2957}
2958#[derive(Builder, Debug, PartialEq)]
2959pub struct ContainerWithoutFileOpts {
2960    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2961    #[builder(setter(into, strip_option), default)]
2962    pub expand: Option<bool>,
2963}
2964#[derive(Builder, Debug, PartialEq)]
2965pub struct ContainerWithoutFilesOpts {
2966    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2967    #[builder(setter(into, strip_option), default)]
2968    pub expand: Option<bool>,
2969}
2970#[derive(Builder, Debug, PartialEq)]
2971pub struct ContainerWithoutMountOpts {
2972    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2973    #[builder(setter(into, strip_option), default)]
2974    pub expand: Option<bool>,
2975}
2976#[derive(Builder, Debug, PartialEq)]
2977pub struct ContainerWithoutUnixSocketOpts {
2978    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2979    #[builder(setter(into, strip_option), default)]
2980    pub expand: Option<bool>,
2981}
2982impl Container {
2983    /// Turn the container into a Service.
2984    /// Be sure to set any exposed ports before this conversion.
2985    ///
2986    /// # Arguments
2987    ///
2988    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2989    pub fn as_service(&self) -> Service {
2990        let query = self.selection.select("asService");
2991        Service {
2992            proc: self.proc.clone(),
2993            selection: query,
2994            graphql_client: self.graphql_client.clone(),
2995        }
2996    }
2997    /// Turn the container into a Service.
2998    /// Be sure to set any exposed ports before this conversion.
2999    ///
3000    /// # Arguments
3001    ///
3002    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3003    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
3004        let mut query = self.selection.select("asService");
3005        if let Some(args) = opts.args {
3006            query = query.arg("args", args);
3007        }
3008        if let Some(use_entrypoint) = opts.use_entrypoint {
3009            query = query.arg("useEntrypoint", use_entrypoint);
3010        }
3011        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3012            query = query.arg(
3013                "experimentalPrivilegedNesting",
3014                experimental_privileged_nesting,
3015            );
3016        }
3017        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3018            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3019        }
3020        if let Some(expand) = opts.expand {
3021            query = query.arg("expand", expand);
3022        }
3023        if let Some(no_init) = opts.no_init {
3024            query = query.arg("noInit", no_init);
3025        }
3026        Service {
3027            proc: self.proc.clone(),
3028            selection: query,
3029            graphql_client: self.graphql_client.clone(),
3030        }
3031    }
3032    /// Package the container state as an OCI image, and return it as a tar archive
3033    ///
3034    /// # Arguments
3035    ///
3036    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3037    pub fn as_tarball(&self) -> File {
3038        let query = self.selection.select("asTarball");
3039        File {
3040            proc: self.proc.clone(),
3041            selection: query,
3042            graphql_client: self.graphql_client.clone(),
3043        }
3044    }
3045    /// Package the container state as an OCI image, and return it as a tar archive
3046    ///
3047    /// # Arguments
3048    ///
3049    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3050    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
3051        let mut query = self.selection.select("asTarball");
3052        if let Some(platform_variants) = opts.platform_variants {
3053            query = query.arg("platformVariants", platform_variants);
3054        }
3055        if let Some(forced_compression) = opts.forced_compression {
3056            query = query.arg("forcedCompression", forced_compression);
3057        }
3058        if let Some(media_types) = opts.media_types {
3059            query = query.arg("mediaTypes", media_types);
3060        }
3061        File {
3062            proc: self.proc.clone(),
3063            selection: query,
3064            graphql_client: self.graphql_client.clone(),
3065        }
3066    }
3067    /// The combined buffered standard output and standard error stream of the last executed command
3068    /// Returns an error if no command was executed
3069    pub async fn combined_output(&self) -> Result<String, DaggerError> {
3070        let query = self.selection.select("combinedOutput");
3071        query.execute(self.graphql_client.clone()).await
3072    }
3073    /// Return the container's default arguments.
3074    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
3075        let query = self.selection.select("defaultArgs");
3076        query.execute(self.graphql_client.clone()).await
3077    }
3078    /// Retrieve a directory from the container's root filesystem
3079    /// Mounts are included.
3080    ///
3081    /// # Arguments
3082    ///
3083    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3084    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3085    pub fn directory(&self, path: impl Into<String>) -> Directory {
3086        let mut query = self.selection.select("directory");
3087        query = query.arg("path", path.into());
3088        Directory {
3089            proc: self.proc.clone(),
3090            selection: query,
3091            graphql_client: self.graphql_client.clone(),
3092        }
3093    }
3094    /// Retrieve a directory from the container's root filesystem
3095    /// Mounts are included.
3096    ///
3097    /// # Arguments
3098    ///
3099    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3100    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3101    pub fn directory_opts(
3102        &self,
3103        path: impl Into<String>,
3104        opts: ContainerDirectoryOpts,
3105    ) -> Directory {
3106        let mut query = self.selection.select("directory");
3107        query = query.arg("path", path.into());
3108        if let Some(expand) = opts.expand {
3109            query = query.arg("expand", expand);
3110        }
3111        Directory {
3112            proc: self.proc.clone(),
3113            selection: query,
3114            graphql_client: self.graphql_client.clone(),
3115        }
3116    }
3117    /// Return the container's OCI entrypoint.
3118    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
3119        let query = self.selection.select("entrypoint");
3120        query.execute(self.graphql_client.clone()).await
3121    }
3122    /// Retrieves the value of the specified environment variable.
3123    ///
3124    /// # Arguments
3125    ///
3126    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
3127    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3128        let mut query = self.selection.select("envVariable");
3129        query = query.arg("name", name.into());
3130        query.execute(self.graphql_client.clone()).await
3131    }
3132    /// Retrieves the list of environment variables passed to commands.
3133    pub fn env_variables(&self) -> Vec<EnvVariable> {
3134        let query = self.selection.select("envVariables");
3135        vec![EnvVariable {
3136            proc: self.proc.clone(),
3137            selection: query,
3138            graphql_client: self.graphql_client.clone(),
3139        }]
3140    }
3141    /// check if a file or directory exists
3142    ///
3143    /// # Arguments
3144    ///
3145    /// * `path` - Path to check (e.g., "/file.txt").
3146    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3147    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
3148        let mut query = self.selection.select("exists");
3149        query = query.arg("path", path.into());
3150        query.execute(self.graphql_client.clone()).await
3151    }
3152    /// check if a file or directory exists
3153    ///
3154    /// # Arguments
3155    ///
3156    /// * `path` - Path to check (e.g., "/file.txt").
3157    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3158    pub async fn exists_opts(
3159        &self,
3160        path: impl Into<String>,
3161        opts: ContainerExistsOpts,
3162    ) -> Result<bool, DaggerError> {
3163        let mut query = self.selection.select("exists");
3164        query = query.arg("path", path.into());
3165        if let Some(expected_type) = opts.expected_type {
3166            query = query.arg("expectedType", expected_type);
3167        }
3168        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
3169            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
3170        }
3171        query.execute(self.graphql_client.clone()).await
3172    }
3173    /// The exit code of the last executed command
3174    /// Returns an error if no command was executed
3175    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
3176        let query = self.selection.select("exitCode");
3177        query.execute(self.graphql_client.clone()).await
3178    }
3179    /// EXPERIMENTAL API! Subject to change/removal at any time.
3180    /// Configures all available GPUs on the host to be accessible to this container.
3181    /// This currently works for Nvidia devices only.
3182    pub fn experimental_with_all_gp_us(&self) -> Container {
3183        let query = self.selection.select("experimentalWithAllGPUs");
3184        Container {
3185            proc: self.proc.clone(),
3186            selection: query,
3187            graphql_client: self.graphql_client.clone(),
3188        }
3189    }
3190    /// EXPERIMENTAL API! Subject to change/removal at any time.
3191    /// Configures the provided list of devices to be accessible to this container.
3192    /// This currently works for Nvidia devices only.
3193    ///
3194    /// # Arguments
3195    ///
3196    /// * `devices` - List of devices to be accessible to this container.
3197    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
3198        let mut query = self.selection.select("experimentalWithGPU");
3199        query = query.arg(
3200            "devices",
3201            devices
3202                .into_iter()
3203                .map(|i| i.into())
3204                .collect::<Vec<String>>(),
3205        );
3206        Container {
3207            proc: self.proc.clone(),
3208            selection: query,
3209            graphql_client: self.graphql_client.clone(),
3210        }
3211    }
3212    /// Writes the container as an OCI tarball to the destination file path on the host.
3213    /// It can also export platform variants.
3214    ///
3215    /// # Arguments
3216    ///
3217    /// * `path` - Host's destination path (e.g., "./tarball").
3218    ///
3219    /// Path can be relative to the engine's workdir or absolute.
3220    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3221    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
3222        let mut query = self.selection.select("export");
3223        query = query.arg("path", path.into());
3224        query.execute(self.graphql_client.clone()).await
3225    }
3226    /// Writes the container as an OCI tarball to the destination file path on the host.
3227    /// It can also export platform variants.
3228    ///
3229    /// # Arguments
3230    ///
3231    /// * `path` - Host's destination path (e.g., "./tarball").
3232    ///
3233    /// Path can be relative to the engine's workdir or absolute.
3234    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3235    pub async fn export_opts(
3236        &self,
3237        path: impl Into<String>,
3238        opts: ContainerExportOpts,
3239    ) -> Result<String, DaggerError> {
3240        let mut query = self.selection.select("export");
3241        query = query.arg("path", path.into());
3242        if let Some(platform_variants) = opts.platform_variants {
3243            query = query.arg("platformVariants", platform_variants);
3244        }
3245        if let Some(forced_compression) = opts.forced_compression {
3246            query = query.arg("forcedCompression", forced_compression);
3247        }
3248        if let Some(media_types) = opts.media_types {
3249            query = query.arg("mediaTypes", media_types);
3250        }
3251        if let Some(expand) = opts.expand {
3252            query = query.arg("expand", expand);
3253        }
3254        query.execute(self.graphql_client.clone()).await
3255    }
3256    /// Exports the container as an image to the host's container image store.
3257    ///
3258    /// # Arguments
3259    ///
3260    /// * `name` - Name of image to export to in the host's store
3261    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3262    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
3263        let mut query = self.selection.select("exportImage");
3264        query = query.arg("name", name.into());
3265        query.execute(self.graphql_client.clone()).await
3266    }
3267    /// Exports the container as an image to the host's container image store.
3268    ///
3269    /// # Arguments
3270    ///
3271    /// * `name` - Name of image to export to in the host's store
3272    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3273    pub async fn export_image_opts(
3274        &self,
3275        name: impl Into<String>,
3276        opts: ContainerExportImageOpts,
3277    ) -> Result<Void, DaggerError> {
3278        let mut query = self.selection.select("exportImage");
3279        query = query.arg("name", name.into());
3280        if let Some(platform_variants) = opts.platform_variants {
3281            query = query.arg("platformVariants", platform_variants);
3282        }
3283        if let Some(forced_compression) = opts.forced_compression {
3284            query = query.arg("forcedCompression", forced_compression);
3285        }
3286        if let Some(media_types) = opts.media_types {
3287            query = query.arg("mediaTypes", media_types);
3288        }
3289        query.execute(self.graphql_client.clone()).await
3290    }
3291    /// Retrieves the list of exposed ports.
3292    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
3293    pub fn exposed_ports(&self) -> Vec<Port> {
3294        let query = self.selection.select("exposedPorts");
3295        vec![Port {
3296            proc: self.proc.clone(),
3297            selection: query,
3298            graphql_client: self.graphql_client.clone(),
3299        }]
3300    }
3301    /// Retrieves a file at the given path.
3302    /// Mounts are included.
3303    ///
3304    /// # Arguments
3305    ///
3306    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3307    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3308    pub fn file(&self, path: impl Into<String>) -> File {
3309        let mut query = self.selection.select("file");
3310        query = query.arg("path", path.into());
3311        File {
3312            proc: self.proc.clone(),
3313            selection: query,
3314            graphql_client: self.graphql_client.clone(),
3315        }
3316    }
3317    /// Retrieves a file at the given path.
3318    /// Mounts are included.
3319    ///
3320    /// # Arguments
3321    ///
3322    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3323    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3324    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3325        let mut query = self.selection.select("file");
3326        query = query.arg("path", path.into());
3327        if let Some(expand) = opts.expand {
3328            query = query.arg("expand", expand);
3329        }
3330        File {
3331            proc: self.proc.clone(),
3332            selection: query,
3333            graphql_client: self.graphql_client.clone(),
3334        }
3335    }
3336    /// Download a container image, and apply it to the container state. All previous state will be lost.
3337    ///
3338    /// # Arguments
3339    ///
3340    /// * `address` - Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
3341    pub fn from(&self, address: impl Into<String>) -> Container {
3342        let mut query = self.selection.select("from");
3343        query = query.arg("address", address.into());
3344        Container {
3345            proc: self.proc.clone(),
3346            selection: query,
3347            graphql_client: self.graphql_client.clone(),
3348        }
3349    }
3350    /// A unique identifier for this Container.
3351    pub async fn id(&self) -> Result<ContainerId, DaggerError> {
3352        let query = self.selection.select("id");
3353        query.execute(self.graphql_client.clone()).await
3354    }
3355    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
3356    pub async fn image_ref(&self) -> Result<String, DaggerError> {
3357        let query = self.selection.select("imageRef");
3358        query.execute(self.graphql_client.clone()).await
3359    }
3360    /// Reads the container from an OCI tarball.
3361    ///
3362    /// # Arguments
3363    ///
3364    /// * `source` - File to read the container from.
3365    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3366    pub fn import(&self, source: impl IntoID<FileId>) -> Container {
3367        let mut query = self.selection.select("import");
3368        query = query.arg_lazy(
3369            "source",
3370            Box::new(move || {
3371                let source = source.clone();
3372                Box::pin(async move { source.into_id().await.unwrap().quote() })
3373            }),
3374        );
3375        Container {
3376            proc: self.proc.clone(),
3377            selection: query,
3378            graphql_client: self.graphql_client.clone(),
3379        }
3380    }
3381    /// Reads the container from an OCI tarball.
3382    ///
3383    /// # Arguments
3384    ///
3385    /// * `source` - File to read the container from.
3386    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3387    pub fn import_opts<'a>(
3388        &self,
3389        source: impl IntoID<FileId>,
3390        opts: ContainerImportOpts<'a>,
3391    ) -> Container {
3392        let mut query = self.selection.select("import");
3393        query = query.arg_lazy(
3394            "source",
3395            Box::new(move || {
3396                let source = source.clone();
3397                Box::pin(async move { source.into_id().await.unwrap().quote() })
3398            }),
3399        );
3400        if let Some(tag) = opts.tag {
3401            query = query.arg("tag", tag);
3402        }
3403        Container {
3404            proc: self.proc.clone(),
3405            selection: query,
3406            graphql_client: self.graphql_client.clone(),
3407        }
3408    }
3409    /// Retrieves the value of the specified label.
3410    ///
3411    /// # Arguments
3412    ///
3413    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3414    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3415        let mut query = self.selection.select("label");
3416        query = query.arg("name", name.into());
3417        query.execute(self.graphql_client.clone()).await
3418    }
3419    /// Retrieves the list of labels passed to container.
3420    pub fn labels(&self) -> Vec<Label> {
3421        let query = self.selection.select("labels");
3422        vec![Label {
3423            proc: self.proc.clone(),
3424            selection: query,
3425            graphql_client: self.graphql_client.clone(),
3426        }]
3427    }
3428    /// Retrieves the list of paths where a directory is mounted.
3429    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
3430        let query = self.selection.select("mounts");
3431        query.execute(self.graphql_client.clone()).await
3432    }
3433    /// The platform this container executes and publishes as.
3434    pub async fn platform(&self) -> Result<Platform, DaggerError> {
3435        let query = self.selection.select("platform");
3436        query.execute(self.graphql_client.clone()).await
3437    }
3438    /// Package the container state as an OCI image, and publish it to a registry
3439    /// Returns the fully qualified address of the published image, with digest
3440    ///
3441    /// # Arguments
3442    ///
3443    /// * `address` - The OCI address to publish to
3444    ///
3445    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
3446    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3447    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
3448        let mut query = self.selection.select("publish");
3449        query = query.arg("address", address.into());
3450        query.execute(self.graphql_client.clone()).await
3451    }
3452    /// Package the container state as an OCI image, and publish it to a registry
3453    /// Returns the fully qualified address of the published image, with digest
3454    ///
3455    /// # Arguments
3456    ///
3457    /// * `address` - The OCI address to publish to
3458    ///
3459    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
3460    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3461    pub async fn publish_opts(
3462        &self,
3463        address: impl Into<String>,
3464        opts: ContainerPublishOpts,
3465    ) -> Result<String, DaggerError> {
3466        let mut query = self.selection.select("publish");
3467        query = query.arg("address", address.into());
3468        if let Some(platform_variants) = opts.platform_variants {
3469            query = query.arg("platformVariants", platform_variants);
3470        }
3471        if let Some(forced_compression) = opts.forced_compression {
3472            query = query.arg("forcedCompression", forced_compression);
3473        }
3474        if let Some(media_types) = opts.media_types {
3475            query = query.arg("mediaTypes", media_types);
3476        }
3477        query.execute(self.graphql_client.clone()).await
3478    }
3479    /// 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.
3480    pub fn rootfs(&self) -> Directory {
3481        let query = self.selection.select("rootfs");
3482        Directory {
3483            proc: self.proc.clone(),
3484            selection: query,
3485            graphql_client: self.graphql_client.clone(),
3486        }
3487    }
3488    /// Return file status
3489    ///
3490    /// # Arguments
3491    ///
3492    /// * `path` - Path to check (e.g., "/file.txt").
3493    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3494    pub fn stat(&self, path: impl Into<String>) -> Stat {
3495        let mut query = self.selection.select("stat");
3496        query = query.arg("path", path.into());
3497        Stat {
3498            proc: self.proc.clone(),
3499            selection: query,
3500            graphql_client: self.graphql_client.clone(),
3501        }
3502    }
3503    /// Return file status
3504    ///
3505    /// # Arguments
3506    ///
3507    /// * `path` - Path to check (e.g., "/file.txt").
3508    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3509    pub fn stat_opts(&self, path: impl Into<String>, opts: ContainerStatOpts) -> Stat {
3510        let mut query = self.selection.select("stat");
3511        query = query.arg("path", path.into());
3512        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
3513            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
3514        }
3515        Stat {
3516            proc: self.proc.clone(),
3517            selection: query,
3518            graphql_client: self.graphql_client.clone(),
3519        }
3520    }
3521    /// The buffered standard error stream of the last executed command
3522    /// Returns an error if no command was executed
3523    pub async fn stderr(&self) -> Result<String, DaggerError> {
3524        let query = self.selection.select("stderr");
3525        query.execute(self.graphql_client.clone()).await
3526    }
3527    /// The buffered standard output stream of the last executed command
3528    /// Returns an error if no command was executed
3529    pub async fn stdout(&self) -> Result<String, DaggerError> {
3530        let query = self.selection.select("stdout");
3531        query.execute(self.graphql_client.clone()).await
3532    }
3533    /// Forces evaluation of the pipeline in the engine.
3534    /// It doesn't run the default command if no exec has been set.
3535    pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
3536        let query = self.selection.select("sync");
3537        query.execute(self.graphql_client.clone()).await
3538    }
3539    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
3540    ///
3541    /// # Arguments
3542    ///
3543    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3544    pub fn terminal(&self) -> Container {
3545        let query = self.selection.select("terminal");
3546        Container {
3547            proc: self.proc.clone(),
3548            selection: query,
3549            graphql_client: self.graphql_client.clone(),
3550        }
3551    }
3552    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
3553    ///
3554    /// # Arguments
3555    ///
3556    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3557    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
3558        let mut query = self.selection.select("terminal");
3559        if let Some(cmd) = opts.cmd {
3560            query = query.arg("cmd", cmd);
3561        }
3562        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3563            query = query.arg(
3564                "experimentalPrivilegedNesting",
3565                experimental_privileged_nesting,
3566            );
3567        }
3568        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3569            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3570        }
3571        Container {
3572            proc: self.proc.clone(),
3573            selection: query,
3574            graphql_client: self.graphql_client.clone(),
3575        }
3576    }
3577    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3578    /// Be sure to set any exposed ports before calling this api.
3579    ///
3580    /// # Arguments
3581    ///
3582    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3583    pub async fn up(&self) -> Result<Void, DaggerError> {
3584        let query = self.selection.select("up");
3585        query.execute(self.graphql_client.clone()).await
3586    }
3587    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3588    /// Be sure to set any exposed ports before calling this api.
3589    ///
3590    /// # Arguments
3591    ///
3592    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3593    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
3594        let mut query = self.selection.select("up");
3595        if let Some(random) = opts.random {
3596            query = query.arg("random", random);
3597        }
3598        if let Some(ports) = opts.ports {
3599            query = query.arg("ports", ports);
3600        }
3601        if let Some(args) = opts.args {
3602            query = query.arg("args", args);
3603        }
3604        if let Some(use_entrypoint) = opts.use_entrypoint {
3605            query = query.arg("useEntrypoint", use_entrypoint);
3606        }
3607        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3608            query = query.arg(
3609                "experimentalPrivilegedNesting",
3610                experimental_privileged_nesting,
3611            );
3612        }
3613        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3614            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3615        }
3616        if let Some(expand) = opts.expand {
3617            query = query.arg("expand", expand);
3618        }
3619        if let Some(no_init) = opts.no_init {
3620            query = query.arg("noInit", no_init);
3621        }
3622        query.execute(self.graphql_client.clone()).await
3623    }
3624    /// Retrieves the user to be set for all commands.
3625    pub async fn user(&self) -> Result<String, DaggerError> {
3626        let query = self.selection.select("user");
3627        query.execute(self.graphql_client.clone()).await
3628    }
3629    /// Retrieves this container plus the given OCI annotation.
3630    ///
3631    /// # Arguments
3632    ///
3633    /// * `name` - The name of the annotation.
3634    /// * `value` - The value of the annotation.
3635    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3636        let mut query = self.selection.select("withAnnotation");
3637        query = query.arg("name", name.into());
3638        query = query.arg("value", value.into());
3639        Container {
3640            proc: self.proc.clone(),
3641            selection: query,
3642            graphql_client: self.graphql_client.clone(),
3643        }
3644    }
3645    /// Configures default arguments for future commands. Like CMD in Dockerfile.
3646    ///
3647    /// # Arguments
3648    ///
3649    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
3650    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
3651        let mut query = self.selection.select("withDefaultArgs");
3652        query = query.arg(
3653            "args",
3654            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3655        );
3656        Container {
3657            proc: self.proc.clone(),
3658            selection: query,
3659            graphql_client: self.graphql_client.clone(),
3660        }
3661    }
3662    /// Set the default command to invoke for the container's terminal API.
3663    ///
3664    /// # Arguments
3665    ///
3666    /// * `args` - The args of the command.
3667    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3668    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
3669        let mut query = self.selection.select("withDefaultTerminalCmd");
3670        query = query.arg(
3671            "args",
3672            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3673        );
3674        Container {
3675            proc: self.proc.clone(),
3676            selection: query,
3677            graphql_client: self.graphql_client.clone(),
3678        }
3679    }
3680    /// Set the default command to invoke for the container's terminal API.
3681    ///
3682    /// # Arguments
3683    ///
3684    /// * `args` - The args of the command.
3685    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3686    pub fn with_default_terminal_cmd_opts(
3687        &self,
3688        args: Vec<impl Into<String>>,
3689        opts: ContainerWithDefaultTerminalCmdOpts,
3690    ) -> Container {
3691        let mut query = self.selection.select("withDefaultTerminalCmd");
3692        query = query.arg(
3693            "args",
3694            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3695        );
3696        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3697            query = query.arg(
3698                "experimentalPrivilegedNesting",
3699                experimental_privileged_nesting,
3700            );
3701        }
3702        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3703            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3704        }
3705        Container {
3706            proc: self.proc.clone(),
3707            selection: query,
3708            graphql_client: self.graphql_client.clone(),
3709        }
3710    }
3711    /// Return a new container snapshot, with a directory added to its filesystem
3712    ///
3713    /// # Arguments
3714    ///
3715    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
3716    /// * `source` - Identifier of the directory to write
3717    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3718    pub fn with_directory(
3719        &self,
3720        path: impl Into<String>,
3721        source: impl IntoID<DirectoryId>,
3722    ) -> Container {
3723        let mut query = self.selection.select("withDirectory");
3724        query = query.arg("path", path.into());
3725        query = query.arg_lazy(
3726            "source",
3727            Box::new(move || {
3728                let source = source.clone();
3729                Box::pin(async move { source.into_id().await.unwrap().quote() })
3730            }),
3731        );
3732        Container {
3733            proc: self.proc.clone(),
3734            selection: query,
3735            graphql_client: self.graphql_client.clone(),
3736        }
3737    }
3738    /// Return a new container snapshot, with a directory added to its filesystem
3739    ///
3740    /// # Arguments
3741    ///
3742    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
3743    /// * `source` - Identifier of the directory to write
3744    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3745    pub fn with_directory_opts<'a>(
3746        &self,
3747        path: impl Into<String>,
3748        source: impl IntoID<DirectoryId>,
3749        opts: ContainerWithDirectoryOpts<'a>,
3750    ) -> Container {
3751        let mut query = self.selection.select("withDirectory");
3752        query = query.arg("path", path.into());
3753        query = query.arg_lazy(
3754            "source",
3755            Box::new(move || {
3756                let source = source.clone();
3757                Box::pin(async move { source.into_id().await.unwrap().quote() })
3758            }),
3759        );
3760        if let Some(exclude) = opts.exclude {
3761            query = query.arg("exclude", exclude);
3762        }
3763        if let Some(include) = opts.include {
3764            query = query.arg("include", include);
3765        }
3766        if let Some(gitignore) = opts.gitignore {
3767            query = query.arg("gitignore", gitignore);
3768        }
3769        if let Some(owner) = opts.owner {
3770            query = query.arg("owner", owner);
3771        }
3772        if let Some(expand) = opts.expand {
3773            query = query.arg("expand", expand);
3774        }
3775        Container {
3776            proc: self.proc.clone(),
3777            selection: query,
3778            graphql_client: self.graphql_client.clone(),
3779        }
3780    }
3781    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
3782    ///
3783    /// # Arguments
3784    ///
3785    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
3786    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3787    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
3788        let mut query = self.selection.select("withEntrypoint");
3789        query = query.arg(
3790            "args",
3791            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3792        );
3793        Container {
3794            proc: self.proc.clone(),
3795            selection: query,
3796            graphql_client: self.graphql_client.clone(),
3797        }
3798    }
3799    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
3800    ///
3801    /// # Arguments
3802    ///
3803    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
3804    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3805    pub fn with_entrypoint_opts(
3806        &self,
3807        args: Vec<impl Into<String>>,
3808        opts: ContainerWithEntrypointOpts,
3809    ) -> Container {
3810        let mut query = self.selection.select("withEntrypoint");
3811        query = query.arg(
3812            "args",
3813            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3814        );
3815        if let Some(keep_default_args) = opts.keep_default_args {
3816            query = query.arg("keepDefaultArgs", keep_default_args);
3817        }
3818        Container {
3819            proc: self.proc.clone(),
3820            selection: query,
3821            graphql_client: self.graphql_client.clone(),
3822        }
3823    }
3824    /// Export environment variables from an env-file to the container.
3825    ///
3826    /// # Arguments
3827    ///
3828    /// * `source` - Identifier of the envfile
3829    pub fn with_env_file_variables(&self, source: impl IntoID<EnvFileId>) -> Container {
3830        let mut query = self.selection.select("withEnvFileVariables");
3831        query = query.arg_lazy(
3832            "source",
3833            Box::new(move || {
3834                let source = source.clone();
3835                Box::pin(async move { source.into_id().await.unwrap().quote() })
3836            }),
3837        );
3838        Container {
3839            proc: self.proc.clone(),
3840            selection: query,
3841            graphql_client: self.graphql_client.clone(),
3842        }
3843    }
3844    /// Set a new environment variable in the container.
3845    ///
3846    /// # Arguments
3847    ///
3848    /// * `name` - Name of the environment variable (e.g., "HOST").
3849    /// * `value` - Value of the environment variable. (e.g., "localhost").
3850    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3851    pub fn with_env_variable(
3852        &self,
3853        name: impl Into<String>,
3854        value: impl Into<String>,
3855    ) -> Container {
3856        let mut query = self.selection.select("withEnvVariable");
3857        query = query.arg("name", name.into());
3858        query = query.arg("value", value.into());
3859        Container {
3860            proc: self.proc.clone(),
3861            selection: query,
3862            graphql_client: self.graphql_client.clone(),
3863        }
3864    }
3865    /// Set a new environment variable in the container.
3866    ///
3867    /// # Arguments
3868    ///
3869    /// * `name` - Name of the environment variable (e.g., "HOST").
3870    /// * `value` - Value of the environment variable. (e.g., "localhost").
3871    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3872    pub fn with_env_variable_opts(
3873        &self,
3874        name: impl Into<String>,
3875        value: impl Into<String>,
3876        opts: ContainerWithEnvVariableOpts,
3877    ) -> Container {
3878        let mut query = self.selection.select("withEnvVariable");
3879        query = query.arg("name", name.into());
3880        query = query.arg("value", value.into());
3881        if let Some(expand) = opts.expand {
3882            query = query.arg("expand", expand);
3883        }
3884        Container {
3885            proc: self.proc.clone(),
3886            selection: query,
3887            graphql_client: self.graphql_client.clone(),
3888        }
3889    }
3890    /// Raise an error.
3891    ///
3892    /// # Arguments
3893    ///
3894    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
3895    pub fn with_error(&self, err: impl Into<String>) -> Container {
3896        let mut query = self.selection.select("withError");
3897        query = query.arg("err", err.into());
3898        Container {
3899            proc: self.proc.clone(),
3900            selection: query,
3901            graphql_client: self.graphql_client.clone(),
3902        }
3903    }
3904    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3905    ///
3906    /// # Arguments
3907    ///
3908    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3909    ///
3910    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3911    ///
3912    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3913    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3914    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3915        let mut query = self.selection.select("withExec");
3916        query = query.arg(
3917            "args",
3918            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3919        );
3920        Container {
3921            proc: self.proc.clone(),
3922            selection: query,
3923            graphql_client: self.graphql_client.clone(),
3924        }
3925    }
3926    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3927    ///
3928    /// # Arguments
3929    ///
3930    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3931    ///
3932    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3933    ///
3934    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3935    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3936    pub fn with_exec_opts<'a>(
3937        &self,
3938        args: Vec<impl Into<String>>,
3939        opts: ContainerWithExecOpts<'a>,
3940    ) -> Container {
3941        let mut query = self.selection.select("withExec");
3942        query = query.arg(
3943            "args",
3944            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3945        );
3946        if let Some(use_entrypoint) = opts.use_entrypoint {
3947            query = query.arg("useEntrypoint", use_entrypoint);
3948        }
3949        if let Some(stdin) = opts.stdin {
3950            query = query.arg("stdin", stdin);
3951        }
3952        if let Some(redirect_stdin) = opts.redirect_stdin {
3953            query = query.arg("redirectStdin", redirect_stdin);
3954        }
3955        if let Some(redirect_stdout) = opts.redirect_stdout {
3956            query = query.arg("redirectStdout", redirect_stdout);
3957        }
3958        if let Some(redirect_stderr) = opts.redirect_stderr {
3959            query = query.arg("redirectStderr", redirect_stderr);
3960        }
3961        if let Some(expect) = opts.expect {
3962            query = query.arg("expect", expect);
3963        }
3964        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3965            query = query.arg(
3966                "experimentalPrivilegedNesting",
3967                experimental_privileged_nesting,
3968            );
3969        }
3970        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3971            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3972        }
3973        if let Some(expand) = opts.expand {
3974            query = query.arg("expand", expand);
3975        }
3976        if let Some(no_init) = opts.no_init {
3977            query = query.arg("noInit", no_init);
3978        }
3979        Container {
3980            proc: self.proc.clone(),
3981            selection: query,
3982            graphql_client: self.graphql_client.clone(),
3983        }
3984    }
3985    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3986    /// Exposed ports serve two purposes:
3987    /// - For health checks and introspection, when running services
3988    /// - For setting the EXPOSE OCI field when publishing the container
3989    ///
3990    /// # Arguments
3991    ///
3992    /// * `port` - Port number to expose. Example: 8080
3993    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3994    pub fn with_exposed_port(&self, port: isize) -> Container {
3995        let mut query = self.selection.select("withExposedPort");
3996        query = query.arg("port", port);
3997        Container {
3998            proc: self.proc.clone(),
3999            selection: query,
4000            graphql_client: self.graphql_client.clone(),
4001        }
4002    }
4003    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
4004    /// Exposed ports serve two purposes:
4005    /// - For health checks and introspection, when running services
4006    /// - For setting the EXPOSE OCI field when publishing the container
4007    ///
4008    /// # Arguments
4009    ///
4010    /// * `port` - Port number to expose. Example: 8080
4011    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4012    pub fn with_exposed_port_opts<'a>(
4013        &self,
4014        port: isize,
4015        opts: ContainerWithExposedPortOpts<'a>,
4016    ) -> Container {
4017        let mut query = self.selection.select("withExposedPort");
4018        query = query.arg("port", port);
4019        if let Some(protocol) = opts.protocol {
4020            query = query.arg("protocol", protocol);
4021        }
4022        if let Some(description) = opts.description {
4023            query = query.arg("description", description);
4024        }
4025        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
4026            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
4027        }
4028        Container {
4029            proc: self.proc.clone(),
4030            selection: query,
4031            graphql_client: self.graphql_client.clone(),
4032        }
4033    }
4034    /// Return a container snapshot with a file added
4035    ///
4036    /// # Arguments
4037    ///
4038    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4039    /// * `source` - File to add
4040    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4041    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
4042        let mut query = self.selection.select("withFile");
4043        query = query.arg("path", path.into());
4044        query = query.arg_lazy(
4045            "source",
4046            Box::new(move || {
4047                let source = source.clone();
4048                Box::pin(async move { source.into_id().await.unwrap().quote() })
4049            }),
4050        );
4051        Container {
4052            proc: self.proc.clone(),
4053            selection: query,
4054            graphql_client: self.graphql_client.clone(),
4055        }
4056    }
4057    /// Return a container snapshot with a file added
4058    ///
4059    /// # Arguments
4060    ///
4061    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4062    /// * `source` - File to add
4063    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4064    pub fn with_file_opts<'a>(
4065        &self,
4066        path: impl Into<String>,
4067        source: impl IntoID<FileId>,
4068        opts: ContainerWithFileOpts<'a>,
4069    ) -> Container {
4070        let mut query = self.selection.select("withFile");
4071        query = query.arg("path", path.into());
4072        query = query.arg_lazy(
4073            "source",
4074            Box::new(move || {
4075                let source = source.clone();
4076                Box::pin(async move { source.into_id().await.unwrap().quote() })
4077            }),
4078        );
4079        if let Some(permissions) = opts.permissions {
4080            query = query.arg("permissions", permissions);
4081        }
4082        if let Some(owner) = opts.owner {
4083            query = query.arg("owner", owner);
4084        }
4085        if let Some(expand) = opts.expand {
4086            query = query.arg("expand", expand);
4087        }
4088        Container {
4089            proc: self.proc.clone(),
4090            selection: query,
4091            graphql_client: self.graphql_client.clone(),
4092        }
4093    }
4094    /// Retrieves this container plus the contents of the given files copied to the given path.
4095    ///
4096    /// # Arguments
4097    ///
4098    /// * `path` - Location where copied files should be placed (e.g., "/src").
4099    /// * `sources` - Identifiers of the files to copy.
4100    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4101    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
4102        let mut query = self.selection.select("withFiles");
4103        query = query.arg("path", path.into());
4104        query = query.arg("sources", sources);
4105        Container {
4106            proc: self.proc.clone(),
4107            selection: query,
4108            graphql_client: self.graphql_client.clone(),
4109        }
4110    }
4111    /// Retrieves this container plus the contents of the given files copied to the given path.
4112    ///
4113    /// # Arguments
4114    ///
4115    /// * `path` - Location where copied files should be placed (e.g., "/src").
4116    /// * `sources` - Identifiers of the files to copy.
4117    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4118    pub fn with_files_opts<'a>(
4119        &self,
4120        path: impl Into<String>,
4121        sources: Vec<FileId>,
4122        opts: ContainerWithFilesOpts<'a>,
4123    ) -> Container {
4124        let mut query = self.selection.select("withFiles");
4125        query = query.arg("path", path.into());
4126        query = query.arg("sources", sources);
4127        if let Some(permissions) = opts.permissions {
4128            query = query.arg("permissions", permissions);
4129        }
4130        if let Some(owner) = opts.owner {
4131            query = query.arg("owner", owner);
4132        }
4133        if let Some(expand) = opts.expand {
4134            query = query.arg("expand", expand);
4135        }
4136        Container {
4137            proc: self.proc.clone(),
4138            selection: query,
4139            graphql_client: self.graphql_client.clone(),
4140        }
4141    }
4142    /// Retrieves this container plus the given label.
4143    ///
4144    /// # Arguments
4145    ///
4146    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
4147    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
4148    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
4149        let mut query = self.selection.select("withLabel");
4150        query = query.arg("name", name.into());
4151        query = query.arg("value", value.into());
4152        Container {
4153            proc: self.proc.clone(),
4154            selection: query,
4155            graphql_client: self.graphql_client.clone(),
4156        }
4157    }
4158    /// Retrieves this container plus a cache volume mounted at the given path.
4159    ///
4160    /// # Arguments
4161    ///
4162    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4163    /// * `cache` - Identifier of the cache volume to mount.
4164    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4165    pub fn with_mounted_cache(
4166        &self,
4167        path: impl Into<String>,
4168        cache: impl IntoID<CacheVolumeId>,
4169    ) -> Container {
4170        let mut query = self.selection.select("withMountedCache");
4171        query = query.arg("path", path.into());
4172        query = query.arg_lazy(
4173            "cache",
4174            Box::new(move || {
4175                let cache = cache.clone();
4176                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4177            }),
4178        );
4179        Container {
4180            proc: self.proc.clone(),
4181            selection: query,
4182            graphql_client: self.graphql_client.clone(),
4183        }
4184    }
4185    /// Retrieves this container plus a cache volume mounted at the given path.
4186    ///
4187    /// # Arguments
4188    ///
4189    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4190    /// * `cache` - Identifier of the cache volume to mount.
4191    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4192    pub fn with_mounted_cache_opts<'a>(
4193        &self,
4194        path: impl Into<String>,
4195        cache: impl IntoID<CacheVolumeId>,
4196        opts: ContainerWithMountedCacheOpts<'a>,
4197    ) -> Container {
4198        let mut query = self.selection.select("withMountedCache");
4199        query = query.arg("path", path.into());
4200        query = query.arg_lazy(
4201            "cache",
4202            Box::new(move || {
4203                let cache = cache.clone();
4204                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4205            }),
4206        );
4207        if let Some(source) = opts.source {
4208            query = query.arg("source", source);
4209        }
4210        if let Some(sharing) = opts.sharing {
4211            query = query.arg("sharing", sharing);
4212        }
4213        if let Some(owner) = opts.owner {
4214            query = query.arg("owner", owner);
4215        }
4216        if let Some(expand) = opts.expand {
4217            query = query.arg("expand", expand);
4218        }
4219        Container {
4220            proc: self.proc.clone(),
4221            selection: query,
4222            graphql_client: self.graphql_client.clone(),
4223        }
4224    }
4225    /// Retrieves this container plus a directory mounted at the given path.
4226    ///
4227    /// # Arguments
4228    ///
4229    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4230    /// * `source` - Identifier of the mounted directory.
4231    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4232    pub fn with_mounted_directory(
4233        &self,
4234        path: impl Into<String>,
4235        source: impl IntoID<DirectoryId>,
4236    ) -> Container {
4237        let mut query = self.selection.select("withMountedDirectory");
4238        query = query.arg("path", path.into());
4239        query = query.arg_lazy(
4240            "source",
4241            Box::new(move || {
4242                let source = source.clone();
4243                Box::pin(async move { source.into_id().await.unwrap().quote() })
4244            }),
4245        );
4246        Container {
4247            proc: self.proc.clone(),
4248            selection: query,
4249            graphql_client: self.graphql_client.clone(),
4250        }
4251    }
4252    /// Retrieves this container plus a directory mounted at the given path.
4253    ///
4254    /// # Arguments
4255    ///
4256    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4257    /// * `source` - Identifier of the mounted directory.
4258    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4259    pub fn with_mounted_directory_opts<'a>(
4260        &self,
4261        path: impl Into<String>,
4262        source: impl IntoID<DirectoryId>,
4263        opts: ContainerWithMountedDirectoryOpts<'a>,
4264    ) -> Container {
4265        let mut query = self.selection.select("withMountedDirectory");
4266        query = query.arg("path", path.into());
4267        query = query.arg_lazy(
4268            "source",
4269            Box::new(move || {
4270                let source = source.clone();
4271                Box::pin(async move { source.into_id().await.unwrap().quote() })
4272            }),
4273        );
4274        if let Some(owner) = opts.owner {
4275            query = query.arg("owner", owner);
4276        }
4277        if let Some(expand) = opts.expand {
4278            query = query.arg("expand", expand);
4279        }
4280        Container {
4281            proc: self.proc.clone(),
4282            selection: query,
4283            graphql_client: self.graphql_client.clone(),
4284        }
4285    }
4286    /// Retrieves this container plus a file mounted at the given path.
4287    ///
4288    /// # Arguments
4289    ///
4290    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4291    /// * `source` - Identifier of the mounted file.
4292    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4293    pub fn with_mounted_file(
4294        &self,
4295        path: impl Into<String>,
4296        source: impl IntoID<FileId>,
4297    ) -> Container {
4298        let mut query = self.selection.select("withMountedFile");
4299        query = query.arg("path", path.into());
4300        query = query.arg_lazy(
4301            "source",
4302            Box::new(move || {
4303                let source = source.clone();
4304                Box::pin(async move { source.into_id().await.unwrap().quote() })
4305            }),
4306        );
4307        Container {
4308            proc: self.proc.clone(),
4309            selection: query,
4310            graphql_client: self.graphql_client.clone(),
4311        }
4312    }
4313    /// Retrieves this container plus a file mounted at the given path.
4314    ///
4315    /// # Arguments
4316    ///
4317    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4318    /// * `source` - Identifier of the mounted file.
4319    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4320    pub fn with_mounted_file_opts<'a>(
4321        &self,
4322        path: impl Into<String>,
4323        source: impl IntoID<FileId>,
4324        opts: ContainerWithMountedFileOpts<'a>,
4325    ) -> Container {
4326        let mut query = self.selection.select("withMountedFile");
4327        query = query.arg("path", path.into());
4328        query = query.arg_lazy(
4329            "source",
4330            Box::new(move || {
4331                let source = source.clone();
4332                Box::pin(async move { source.into_id().await.unwrap().quote() })
4333            }),
4334        );
4335        if let Some(owner) = opts.owner {
4336            query = query.arg("owner", owner);
4337        }
4338        if let Some(expand) = opts.expand {
4339            query = query.arg("expand", expand);
4340        }
4341        Container {
4342            proc: self.proc.clone(),
4343            selection: query,
4344            graphql_client: self.graphql_client.clone(),
4345        }
4346    }
4347    /// Retrieves this container plus a secret mounted into a file at the given path.
4348    ///
4349    /// # Arguments
4350    ///
4351    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4352    /// * `source` - Identifier of the secret to mount.
4353    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4354    pub fn with_mounted_secret(
4355        &self,
4356        path: impl Into<String>,
4357        source: impl IntoID<SecretId>,
4358    ) -> Container {
4359        let mut query = self.selection.select("withMountedSecret");
4360        query = query.arg("path", path.into());
4361        query = query.arg_lazy(
4362            "source",
4363            Box::new(move || {
4364                let source = source.clone();
4365                Box::pin(async move { source.into_id().await.unwrap().quote() })
4366            }),
4367        );
4368        Container {
4369            proc: self.proc.clone(),
4370            selection: query,
4371            graphql_client: self.graphql_client.clone(),
4372        }
4373    }
4374    /// Retrieves this container plus a secret mounted into a file at the given path.
4375    ///
4376    /// # Arguments
4377    ///
4378    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4379    /// * `source` - Identifier of the secret to mount.
4380    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4381    pub fn with_mounted_secret_opts<'a>(
4382        &self,
4383        path: impl Into<String>,
4384        source: impl IntoID<SecretId>,
4385        opts: ContainerWithMountedSecretOpts<'a>,
4386    ) -> Container {
4387        let mut query = self.selection.select("withMountedSecret");
4388        query = query.arg("path", path.into());
4389        query = query.arg_lazy(
4390            "source",
4391            Box::new(move || {
4392                let source = source.clone();
4393                Box::pin(async move { source.into_id().await.unwrap().quote() })
4394            }),
4395        );
4396        if let Some(owner) = opts.owner {
4397            query = query.arg("owner", owner);
4398        }
4399        if let Some(mode) = opts.mode {
4400            query = query.arg("mode", mode);
4401        }
4402        if let Some(expand) = opts.expand {
4403            query = query.arg("expand", expand);
4404        }
4405        Container {
4406            proc: self.proc.clone(),
4407            selection: query,
4408            graphql_client: self.graphql_client.clone(),
4409        }
4410    }
4411    /// 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.
4412    ///
4413    /// # Arguments
4414    ///
4415    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4416    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4417    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4418        let mut query = self.selection.select("withMountedTemp");
4419        query = query.arg("path", path.into());
4420        Container {
4421            proc: self.proc.clone(),
4422            selection: query,
4423            graphql_client: self.graphql_client.clone(),
4424        }
4425    }
4426    /// 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.
4427    ///
4428    /// # Arguments
4429    ///
4430    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4431    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4432    pub fn with_mounted_temp_opts(
4433        &self,
4434        path: impl Into<String>,
4435        opts: ContainerWithMountedTempOpts,
4436    ) -> Container {
4437        let mut query = self.selection.select("withMountedTemp");
4438        query = query.arg("path", path.into());
4439        if let Some(size) = opts.size {
4440            query = query.arg("size", size);
4441        }
4442        if let Some(expand) = opts.expand {
4443            query = query.arg("expand", expand);
4444        }
4445        Container {
4446            proc: self.proc.clone(),
4447            selection: query,
4448            graphql_client: self.graphql_client.clone(),
4449        }
4450    }
4451    /// Return a new container snapshot, with a file added to its filesystem with text content
4452    ///
4453    /// # Arguments
4454    ///
4455    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4456    /// * `contents` - Contents of the new file. Example: "Hello world!"
4457    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4458    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
4459        let mut query = self.selection.select("withNewFile");
4460        query = query.arg("path", path.into());
4461        query = query.arg("contents", contents.into());
4462        Container {
4463            proc: self.proc.clone(),
4464            selection: query,
4465            graphql_client: self.graphql_client.clone(),
4466        }
4467    }
4468    /// Return a new container snapshot, with a file added to its filesystem with text content
4469    ///
4470    /// # Arguments
4471    ///
4472    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4473    /// * `contents` - Contents of the new file. Example: "Hello world!"
4474    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4475    pub fn with_new_file_opts<'a>(
4476        &self,
4477        path: impl Into<String>,
4478        contents: impl Into<String>,
4479        opts: ContainerWithNewFileOpts<'a>,
4480    ) -> Container {
4481        let mut query = self.selection.select("withNewFile");
4482        query = query.arg("path", path.into());
4483        query = query.arg("contents", contents.into());
4484        if let Some(permissions) = opts.permissions {
4485            query = query.arg("permissions", permissions);
4486        }
4487        if let Some(owner) = opts.owner {
4488            query = query.arg("owner", owner);
4489        }
4490        if let Some(expand) = opts.expand {
4491            query = query.arg("expand", expand);
4492        }
4493        Container {
4494            proc: self.proc.clone(),
4495            selection: query,
4496            graphql_client: self.graphql_client.clone(),
4497        }
4498    }
4499    /// Attach credentials for future publishing to a registry. Use in combination with publish
4500    ///
4501    /// # Arguments
4502    ///
4503    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
4504    /// * `username` - The username to authenticate with. Example: "alice"
4505    /// * `secret` - The API key, password or token to authenticate to this registry
4506    pub fn with_registry_auth(
4507        &self,
4508        address: impl Into<String>,
4509        username: impl Into<String>,
4510        secret: impl IntoID<SecretId>,
4511    ) -> Container {
4512        let mut query = self.selection.select("withRegistryAuth");
4513        query = query.arg("address", address.into());
4514        query = query.arg("username", username.into());
4515        query = query.arg_lazy(
4516            "secret",
4517            Box::new(move || {
4518                let secret = secret.clone();
4519                Box::pin(async move { secret.into_id().await.unwrap().quote() })
4520            }),
4521        );
4522        Container {
4523            proc: self.proc.clone(),
4524            selection: query,
4525            graphql_client: self.graphql_client.clone(),
4526        }
4527    }
4528    /// Change the container's root filesystem. The previous root filesystem will be lost.
4529    ///
4530    /// # Arguments
4531    ///
4532    /// * `directory` - The new root filesystem.
4533    pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
4534        let mut query = self.selection.select("withRootfs");
4535        query = query.arg_lazy(
4536            "directory",
4537            Box::new(move || {
4538                let directory = directory.clone();
4539                Box::pin(async move { directory.into_id().await.unwrap().quote() })
4540            }),
4541        );
4542        Container {
4543            proc: self.proc.clone(),
4544            selection: query,
4545            graphql_client: self.graphql_client.clone(),
4546        }
4547    }
4548    /// Set a new environment variable, using a secret value
4549    ///
4550    /// # Arguments
4551    ///
4552    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
4553    /// * `secret` - Identifier of the secret value.
4554    pub fn with_secret_variable(
4555        &self,
4556        name: impl Into<String>,
4557        secret: impl IntoID<SecretId>,
4558    ) -> Container {
4559        let mut query = self.selection.select("withSecretVariable");
4560        query = query.arg("name", name.into());
4561        query = query.arg_lazy(
4562            "secret",
4563            Box::new(move || {
4564                let secret = secret.clone();
4565                Box::pin(async move { secret.into_id().await.unwrap().quote() })
4566            }),
4567        );
4568        Container {
4569            proc: self.proc.clone(),
4570            selection: query,
4571            graphql_client: self.graphql_client.clone(),
4572        }
4573    }
4574    /// Establish a runtime dependency from a container to a network service.
4575    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
4576    /// The service will be reachable from the container via the provided hostname alias.
4577    /// The service dependency will also convey to any files or directories produced by the container.
4578    ///
4579    /// # Arguments
4580    ///
4581    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
4582    /// * `service` - The target service
4583    pub fn with_service_binding(
4584        &self,
4585        alias: impl Into<String>,
4586        service: impl IntoID<ServiceId>,
4587    ) -> Container {
4588        let mut query = self.selection.select("withServiceBinding");
4589        query = query.arg("alias", alias.into());
4590        query = query.arg_lazy(
4591            "service",
4592            Box::new(move || {
4593                let service = service.clone();
4594                Box::pin(async move { service.into_id().await.unwrap().quote() })
4595            }),
4596        );
4597        Container {
4598            proc: self.proc.clone(),
4599            selection: query,
4600            graphql_client: self.graphql_client.clone(),
4601        }
4602    }
4603    /// Return a snapshot with a symlink
4604    ///
4605    /// # Arguments
4606    ///
4607    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4608    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4609    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4610    pub fn with_symlink(
4611        &self,
4612        target: impl Into<String>,
4613        link_name: impl Into<String>,
4614    ) -> Container {
4615        let mut query = self.selection.select("withSymlink");
4616        query = query.arg("target", target.into());
4617        query = query.arg("linkName", link_name.into());
4618        Container {
4619            proc: self.proc.clone(),
4620            selection: query,
4621            graphql_client: self.graphql_client.clone(),
4622        }
4623    }
4624    /// Return a snapshot with a symlink
4625    ///
4626    /// # Arguments
4627    ///
4628    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4629    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4630    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4631    pub fn with_symlink_opts(
4632        &self,
4633        target: impl Into<String>,
4634        link_name: impl Into<String>,
4635        opts: ContainerWithSymlinkOpts,
4636    ) -> Container {
4637        let mut query = self.selection.select("withSymlink");
4638        query = query.arg("target", target.into());
4639        query = query.arg("linkName", link_name.into());
4640        if let Some(expand) = opts.expand {
4641            query = query.arg("expand", expand);
4642        }
4643        Container {
4644            proc: self.proc.clone(),
4645            selection: query,
4646            graphql_client: self.graphql_client.clone(),
4647        }
4648    }
4649    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4650    ///
4651    /// # Arguments
4652    ///
4653    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4654    /// * `source` - Identifier of the socket to forward.
4655    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4656    pub fn with_unix_socket(
4657        &self,
4658        path: impl Into<String>,
4659        source: impl IntoID<SocketId>,
4660    ) -> Container {
4661        let mut query = self.selection.select("withUnixSocket");
4662        query = query.arg("path", path.into());
4663        query = query.arg_lazy(
4664            "source",
4665            Box::new(move || {
4666                let source = source.clone();
4667                Box::pin(async move { source.into_id().await.unwrap().quote() })
4668            }),
4669        );
4670        Container {
4671            proc: self.proc.clone(),
4672            selection: query,
4673            graphql_client: self.graphql_client.clone(),
4674        }
4675    }
4676    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4677    ///
4678    /// # Arguments
4679    ///
4680    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4681    /// * `source` - Identifier of the socket to forward.
4682    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4683    pub fn with_unix_socket_opts<'a>(
4684        &self,
4685        path: impl Into<String>,
4686        source: impl IntoID<SocketId>,
4687        opts: ContainerWithUnixSocketOpts<'a>,
4688    ) -> Container {
4689        let mut query = self.selection.select("withUnixSocket");
4690        query = query.arg("path", path.into());
4691        query = query.arg_lazy(
4692            "source",
4693            Box::new(move || {
4694                let source = source.clone();
4695                Box::pin(async move { source.into_id().await.unwrap().quote() })
4696            }),
4697        );
4698        if let Some(owner) = opts.owner {
4699            query = query.arg("owner", owner);
4700        }
4701        if let Some(expand) = opts.expand {
4702            query = query.arg("expand", expand);
4703        }
4704        Container {
4705            proc: self.proc.clone(),
4706            selection: query,
4707            graphql_client: self.graphql_client.clone(),
4708        }
4709    }
4710    /// Retrieves this container with a different command user.
4711    ///
4712    /// # Arguments
4713    ///
4714    /// * `name` - The user to set (e.g., "root").
4715    pub fn with_user(&self, name: impl Into<String>) -> Container {
4716        let mut query = self.selection.select("withUser");
4717        query = query.arg("name", name.into());
4718        Container {
4719            proc: self.proc.clone(),
4720            selection: query,
4721            graphql_client: self.graphql_client.clone(),
4722        }
4723    }
4724    /// Change the container's working directory. Like WORKDIR in Dockerfile.
4725    ///
4726    /// # Arguments
4727    ///
4728    /// * `path` - The path to set as the working directory (e.g., "/app").
4729    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4730    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
4731        let mut query = self.selection.select("withWorkdir");
4732        query = query.arg("path", path.into());
4733        Container {
4734            proc: self.proc.clone(),
4735            selection: query,
4736            graphql_client: self.graphql_client.clone(),
4737        }
4738    }
4739    /// Change the container's working directory. Like WORKDIR in Dockerfile.
4740    ///
4741    /// # Arguments
4742    ///
4743    /// * `path` - The path to set as the working directory (e.g., "/app").
4744    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4745    pub fn with_workdir_opts(
4746        &self,
4747        path: impl Into<String>,
4748        opts: ContainerWithWorkdirOpts,
4749    ) -> Container {
4750        let mut query = self.selection.select("withWorkdir");
4751        query = query.arg("path", path.into());
4752        if let Some(expand) = opts.expand {
4753            query = query.arg("expand", expand);
4754        }
4755        Container {
4756            proc: self.proc.clone(),
4757            selection: query,
4758            graphql_client: self.graphql_client.clone(),
4759        }
4760    }
4761    /// Retrieves this container minus the given OCI annotation.
4762    ///
4763    /// # Arguments
4764    ///
4765    /// * `name` - The name of the annotation.
4766    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
4767        let mut query = self.selection.select("withoutAnnotation");
4768        query = query.arg("name", name.into());
4769        Container {
4770            proc: self.proc.clone(),
4771            selection: query,
4772            graphql_client: self.graphql_client.clone(),
4773        }
4774    }
4775    /// Remove the container's default arguments.
4776    pub fn without_default_args(&self) -> Container {
4777        let query = self.selection.select("withoutDefaultArgs");
4778        Container {
4779            proc: self.proc.clone(),
4780            selection: query,
4781            graphql_client: self.graphql_client.clone(),
4782        }
4783    }
4784    /// Return a new container snapshot, with a directory removed from its filesystem
4785    ///
4786    /// # Arguments
4787    ///
4788    /// * `path` - Location of the directory to remove (e.g., ".github/").
4789    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4790    pub fn without_directory(&self, path: impl Into<String>) -> Container {
4791        let mut query = self.selection.select("withoutDirectory");
4792        query = query.arg("path", path.into());
4793        Container {
4794            proc: self.proc.clone(),
4795            selection: query,
4796            graphql_client: self.graphql_client.clone(),
4797        }
4798    }
4799    /// Return a new container snapshot, with a directory removed from its filesystem
4800    ///
4801    /// # Arguments
4802    ///
4803    /// * `path` - Location of the directory to remove (e.g., ".github/").
4804    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4805    pub fn without_directory_opts(
4806        &self,
4807        path: impl Into<String>,
4808        opts: ContainerWithoutDirectoryOpts,
4809    ) -> Container {
4810        let mut query = self.selection.select("withoutDirectory");
4811        query = query.arg("path", path.into());
4812        if let Some(expand) = opts.expand {
4813            query = query.arg("expand", expand);
4814        }
4815        Container {
4816            proc: self.proc.clone(),
4817            selection: query,
4818            graphql_client: self.graphql_client.clone(),
4819        }
4820    }
4821    /// Reset the container's OCI entrypoint.
4822    ///
4823    /// # Arguments
4824    ///
4825    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4826    pub fn without_entrypoint(&self) -> Container {
4827        let query = self.selection.select("withoutEntrypoint");
4828        Container {
4829            proc: self.proc.clone(),
4830            selection: query,
4831            graphql_client: self.graphql_client.clone(),
4832        }
4833    }
4834    /// Reset the container's OCI entrypoint.
4835    ///
4836    /// # Arguments
4837    ///
4838    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4839    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4840        let mut query = self.selection.select("withoutEntrypoint");
4841        if let Some(keep_default_args) = opts.keep_default_args {
4842            query = query.arg("keepDefaultArgs", keep_default_args);
4843        }
4844        Container {
4845            proc: self.proc.clone(),
4846            selection: query,
4847            graphql_client: self.graphql_client.clone(),
4848        }
4849    }
4850    /// Retrieves this container minus the given environment variable.
4851    ///
4852    /// # Arguments
4853    ///
4854    /// * `name` - The name of the environment variable (e.g., "HOST").
4855    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4856        let mut query = self.selection.select("withoutEnvVariable");
4857        query = query.arg("name", name.into());
4858        Container {
4859            proc: self.proc.clone(),
4860            selection: query,
4861            graphql_client: self.graphql_client.clone(),
4862        }
4863    }
4864    /// Unexpose a previously exposed port.
4865    ///
4866    /// # Arguments
4867    ///
4868    /// * `port` - Port number to unexpose
4869    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4870    pub fn without_exposed_port(&self, port: isize) -> Container {
4871        let mut query = self.selection.select("withoutExposedPort");
4872        query = query.arg("port", port);
4873        Container {
4874            proc: self.proc.clone(),
4875            selection: query,
4876            graphql_client: self.graphql_client.clone(),
4877        }
4878    }
4879    /// Unexpose a previously exposed port.
4880    ///
4881    /// # Arguments
4882    ///
4883    /// * `port` - Port number to unexpose
4884    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4885    pub fn without_exposed_port_opts(
4886        &self,
4887        port: isize,
4888        opts: ContainerWithoutExposedPortOpts,
4889    ) -> Container {
4890        let mut query = self.selection.select("withoutExposedPort");
4891        query = query.arg("port", port);
4892        if let Some(protocol) = opts.protocol {
4893            query = query.arg("protocol", protocol);
4894        }
4895        Container {
4896            proc: self.proc.clone(),
4897            selection: query,
4898            graphql_client: self.graphql_client.clone(),
4899        }
4900    }
4901    /// Retrieves this container with the file at the given path removed.
4902    ///
4903    /// # Arguments
4904    ///
4905    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4906    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4907    pub fn without_file(&self, path: impl Into<String>) -> Container {
4908        let mut query = self.selection.select("withoutFile");
4909        query = query.arg("path", path.into());
4910        Container {
4911            proc: self.proc.clone(),
4912            selection: query,
4913            graphql_client: self.graphql_client.clone(),
4914        }
4915    }
4916    /// Retrieves this container with the file at the given path removed.
4917    ///
4918    /// # Arguments
4919    ///
4920    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4921    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4922    pub fn without_file_opts(
4923        &self,
4924        path: impl Into<String>,
4925        opts: ContainerWithoutFileOpts,
4926    ) -> Container {
4927        let mut query = self.selection.select("withoutFile");
4928        query = query.arg("path", path.into());
4929        if let Some(expand) = opts.expand {
4930            query = query.arg("expand", expand);
4931        }
4932        Container {
4933            proc: self.proc.clone(),
4934            selection: query,
4935            graphql_client: self.graphql_client.clone(),
4936        }
4937    }
4938    /// Return a new container spanshot with specified files removed
4939    ///
4940    /// # Arguments
4941    ///
4942    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4943    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4944    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4945        let mut query = self.selection.select("withoutFiles");
4946        query = query.arg(
4947            "paths",
4948            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4949        );
4950        Container {
4951            proc: self.proc.clone(),
4952            selection: query,
4953            graphql_client: self.graphql_client.clone(),
4954        }
4955    }
4956    /// Return a new container spanshot with specified files removed
4957    ///
4958    /// # Arguments
4959    ///
4960    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4961    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4962    pub fn without_files_opts(
4963        &self,
4964        paths: Vec<impl Into<String>>,
4965        opts: ContainerWithoutFilesOpts,
4966    ) -> Container {
4967        let mut query = self.selection.select("withoutFiles");
4968        query = query.arg(
4969            "paths",
4970            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4971        );
4972        if let Some(expand) = opts.expand {
4973            query = query.arg("expand", expand);
4974        }
4975        Container {
4976            proc: self.proc.clone(),
4977            selection: query,
4978            graphql_client: self.graphql_client.clone(),
4979        }
4980    }
4981    /// Retrieves this container minus the given environment label.
4982    ///
4983    /// # Arguments
4984    ///
4985    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4986    pub fn without_label(&self, name: impl Into<String>) -> Container {
4987        let mut query = self.selection.select("withoutLabel");
4988        query = query.arg("name", name.into());
4989        Container {
4990            proc: self.proc.clone(),
4991            selection: query,
4992            graphql_client: self.graphql_client.clone(),
4993        }
4994    }
4995    /// Retrieves this container after unmounting everything at the given path.
4996    ///
4997    /// # Arguments
4998    ///
4999    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
5000    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5001    pub fn without_mount(&self, path: impl Into<String>) -> Container {
5002        let mut query = self.selection.select("withoutMount");
5003        query = query.arg("path", path.into());
5004        Container {
5005            proc: self.proc.clone(),
5006            selection: query,
5007            graphql_client: self.graphql_client.clone(),
5008        }
5009    }
5010    /// Retrieves this container after unmounting everything at the given path.
5011    ///
5012    /// # Arguments
5013    ///
5014    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
5015    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5016    pub fn without_mount_opts(
5017        &self,
5018        path: impl Into<String>,
5019        opts: ContainerWithoutMountOpts,
5020    ) -> Container {
5021        let mut query = self.selection.select("withoutMount");
5022        query = query.arg("path", path.into());
5023        if let Some(expand) = opts.expand {
5024            query = query.arg("expand", expand);
5025        }
5026        Container {
5027            proc: self.proc.clone(),
5028            selection: query,
5029            graphql_client: self.graphql_client.clone(),
5030        }
5031    }
5032    /// Retrieves this container without the registry authentication of a given address.
5033    ///
5034    /// # Arguments
5035    ///
5036    /// * `address` - Registry's address to remove the authentication from.
5037    ///
5038    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
5039    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
5040        let mut query = self.selection.select("withoutRegistryAuth");
5041        query = query.arg("address", address.into());
5042        Container {
5043            proc: self.proc.clone(),
5044            selection: query,
5045            graphql_client: self.graphql_client.clone(),
5046        }
5047    }
5048    /// Retrieves this container minus the given environment variable containing the secret.
5049    ///
5050    /// # Arguments
5051    ///
5052    /// * `name` - The name of the environment variable (e.g., "HOST").
5053    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
5054        let mut query = self.selection.select("withoutSecretVariable");
5055        query = query.arg("name", name.into());
5056        Container {
5057            proc: self.proc.clone(),
5058            selection: query,
5059            graphql_client: self.graphql_client.clone(),
5060        }
5061    }
5062    /// Retrieves this container with a previously added Unix socket removed.
5063    ///
5064    /// # Arguments
5065    ///
5066    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
5067    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5068    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
5069        let mut query = self.selection.select("withoutUnixSocket");
5070        query = query.arg("path", path.into());
5071        Container {
5072            proc: self.proc.clone(),
5073            selection: query,
5074            graphql_client: self.graphql_client.clone(),
5075        }
5076    }
5077    /// Retrieves this container with a previously added Unix socket removed.
5078    ///
5079    /// # Arguments
5080    ///
5081    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
5082    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5083    pub fn without_unix_socket_opts(
5084        &self,
5085        path: impl Into<String>,
5086        opts: ContainerWithoutUnixSocketOpts,
5087    ) -> Container {
5088        let mut query = self.selection.select("withoutUnixSocket");
5089        query = query.arg("path", path.into());
5090        if let Some(expand) = opts.expand {
5091            query = query.arg("expand", expand);
5092        }
5093        Container {
5094            proc: self.proc.clone(),
5095            selection: query,
5096            graphql_client: self.graphql_client.clone(),
5097        }
5098    }
5099    /// Retrieves this container with an unset command user.
5100    /// Should default to root.
5101    pub fn without_user(&self) -> Container {
5102        let query = self.selection.select("withoutUser");
5103        Container {
5104            proc: self.proc.clone(),
5105            selection: query,
5106            graphql_client: self.graphql_client.clone(),
5107        }
5108    }
5109    /// Unset the container's working directory.
5110    /// Should default to "/".
5111    pub fn without_workdir(&self) -> Container {
5112        let query = self.selection.select("withoutWorkdir");
5113        Container {
5114            proc: self.proc.clone(),
5115            selection: query,
5116            graphql_client: self.graphql_client.clone(),
5117        }
5118    }
5119    /// Retrieves the working directory for all commands.
5120    pub async fn workdir(&self) -> Result<String, DaggerError> {
5121        let query = self.selection.select("workdir");
5122        query.execute(self.graphql_client.clone()).await
5123    }
5124}
5125#[derive(Clone)]
5126pub struct CurrentModule {
5127    pub proc: Option<Arc<DaggerSessionProc>>,
5128    pub selection: Selection,
5129    pub graphql_client: DynGraphQLClient,
5130}
5131#[derive(Builder, Debug, PartialEq)]
5132pub struct CurrentModuleWorkdirOpts<'a> {
5133    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
5134    #[builder(setter(into, strip_option), default)]
5135    pub exclude: Option<Vec<&'a str>>,
5136    /// Apply .gitignore filter rules inside the directory
5137    #[builder(setter(into, strip_option), default)]
5138    pub gitignore: Option<bool>,
5139    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
5140    #[builder(setter(into, strip_option), default)]
5141    pub include: Option<Vec<&'a str>>,
5142}
5143impl CurrentModule {
5144    /// The dependencies of the module.
5145    pub fn dependencies(&self) -> Vec<Module> {
5146        let query = self.selection.select("dependencies");
5147        vec![Module {
5148            proc: self.proc.clone(),
5149            selection: query,
5150            graphql_client: self.graphql_client.clone(),
5151        }]
5152    }
5153    /// The generated files and directories made on top of the module source's context directory.
5154    pub fn generated_context_directory(&self) -> Directory {
5155        let query = self.selection.select("generatedContextDirectory");
5156        Directory {
5157            proc: self.proc.clone(),
5158            selection: query,
5159            graphql_client: self.graphql_client.clone(),
5160        }
5161    }
5162    /// A unique identifier for this CurrentModule.
5163    pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
5164        let query = self.selection.select("id");
5165        query.execute(self.graphql_client.clone()).await
5166    }
5167    /// The name of the module being executed in
5168    pub async fn name(&self) -> Result<String, DaggerError> {
5169        let query = self.selection.select("name");
5170        query.execute(self.graphql_client.clone()).await
5171    }
5172    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
5173    pub fn source(&self) -> Directory {
5174        let query = self.selection.select("source");
5175        Directory {
5176            proc: self.proc.clone(),
5177            selection: query,
5178            graphql_client: self.graphql_client.clone(),
5179        }
5180    }
5181    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
5182    ///
5183    /// # Arguments
5184    ///
5185    /// * `path` - Location of the directory to access (e.g., ".").
5186    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5187    pub fn workdir(&self, path: impl Into<String>) -> Directory {
5188        let mut query = self.selection.select("workdir");
5189        query = query.arg("path", path.into());
5190        Directory {
5191            proc: self.proc.clone(),
5192            selection: query,
5193            graphql_client: self.graphql_client.clone(),
5194        }
5195    }
5196    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
5197    ///
5198    /// # Arguments
5199    ///
5200    /// * `path` - Location of the directory to access (e.g., ".").
5201    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5202    pub fn workdir_opts<'a>(
5203        &self,
5204        path: impl Into<String>,
5205        opts: CurrentModuleWorkdirOpts<'a>,
5206    ) -> Directory {
5207        let mut query = self.selection.select("workdir");
5208        query = query.arg("path", path.into());
5209        if let Some(exclude) = opts.exclude {
5210            query = query.arg("exclude", exclude);
5211        }
5212        if let Some(include) = opts.include {
5213            query = query.arg("include", include);
5214        }
5215        if let Some(gitignore) = opts.gitignore {
5216            query = query.arg("gitignore", gitignore);
5217        }
5218        Directory {
5219            proc: self.proc.clone(),
5220            selection: query,
5221            graphql_client: self.graphql_client.clone(),
5222        }
5223    }
5224    /// 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.
5225    ///
5226    /// # Arguments
5227    ///
5228    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5229    pub fn workdir_file(&self, path: impl Into<String>) -> File {
5230        let mut query = self.selection.select("workdirFile");
5231        query = query.arg("path", path.into());
5232        File {
5233            proc: self.proc.clone(),
5234            selection: query,
5235            graphql_client: self.graphql_client.clone(),
5236        }
5237    }
5238}
5239#[derive(Clone)]
5240pub struct Directory {
5241    pub proc: Option<Arc<DaggerSessionProc>>,
5242    pub selection: Selection,
5243    pub graphql_client: DynGraphQLClient,
5244}
5245#[derive(Builder, Debug, PartialEq)]
5246pub struct DirectoryAsModuleOpts<'a> {
5247    /// An optional subpath of the directory which contains the module's configuration file.
5248    /// If not set, the module source code is loaded from the root of the directory.
5249    #[builder(setter(into, strip_option), default)]
5250    pub source_root_path: Option<&'a str>,
5251}
5252#[derive(Builder, Debug, PartialEq)]
5253pub struct DirectoryAsModuleSourceOpts<'a> {
5254    /// An optional subpath of the directory which contains the module's configuration file.
5255    /// If not set, the module source code is loaded from the root of the directory.
5256    #[builder(setter(into, strip_option), default)]
5257    pub source_root_path: Option<&'a str>,
5258}
5259#[derive(Builder, Debug, PartialEq)]
5260pub struct DirectoryDockerBuildOpts<'a> {
5261    /// Build arguments to use in the build.
5262    #[builder(setter(into, strip_option), default)]
5263    pub build_args: Option<Vec<BuildArg>>,
5264    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
5265    #[builder(setter(into, strip_option), default)]
5266    pub dockerfile: Option<&'a str>,
5267    /// If set, skip the automatic init process injected into containers created by RUN statements.
5268    /// 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.
5269    #[builder(setter(into, strip_option), default)]
5270    pub no_init: Option<bool>,
5271    /// The platform to build.
5272    #[builder(setter(into, strip_option), default)]
5273    pub platform: Option<Platform>,
5274    /// Secrets to pass to the build.
5275    /// They will be mounted at /run/secrets/[secret-name].
5276    #[builder(setter(into, strip_option), default)]
5277    pub secrets: Option<Vec<SecretId>>,
5278    /// Target build stage to build.
5279    #[builder(setter(into, strip_option), default)]
5280    pub target: Option<&'a str>,
5281}
5282#[derive(Builder, Debug, PartialEq)]
5283pub struct DirectoryEntriesOpts<'a> {
5284    /// Location of the directory to look at (e.g., "/src").
5285    #[builder(setter(into, strip_option), default)]
5286    pub path: Option<&'a str>,
5287}
5288#[derive(Builder, Debug, PartialEq)]
5289pub struct DirectoryExistsOpts {
5290    /// If specified, do not follow symlinks.
5291    #[builder(setter(into, strip_option), default)]
5292    pub do_not_follow_symlinks: Option<bool>,
5293    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
5294    #[builder(setter(into, strip_option), default)]
5295    pub expected_type: Option<ExistsType>,
5296}
5297#[derive(Builder, Debug, PartialEq)]
5298pub struct DirectoryExportOpts {
5299    /// 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.
5300    #[builder(setter(into, strip_option), default)]
5301    pub wipe: Option<bool>,
5302}
5303#[derive(Builder, Debug, PartialEq)]
5304pub struct DirectoryFilterOpts<'a> {
5305    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
5306    #[builder(setter(into, strip_option), default)]
5307    pub exclude: Option<Vec<&'a str>>,
5308    /// If set, apply .gitignore rules when filtering the directory.
5309    #[builder(setter(into, strip_option), default)]
5310    pub gitignore: Option<bool>,
5311    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
5312    #[builder(setter(into, strip_option), default)]
5313    pub include: Option<Vec<&'a str>>,
5314}
5315#[derive(Builder, Debug, PartialEq)]
5316pub struct DirectorySearchOpts<'a> {
5317    /// Allow the . pattern to match newlines in multiline mode.
5318    #[builder(setter(into, strip_option), default)]
5319    pub dotall: Option<bool>,
5320    /// Only return matching files, not lines and content
5321    #[builder(setter(into, strip_option), default)]
5322    pub files_only: Option<bool>,
5323    /// Glob patterns to match (e.g., "*.md")
5324    #[builder(setter(into, strip_option), default)]
5325    pub globs: Option<Vec<&'a str>>,
5326    /// Enable case-insensitive matching.
5327    #[builder(setter(into, strip_option), default)]
5328    pub insensitive: Option<bool>,
5329    /// Limit the number of results to return
5330    #[builder(setter(into, strip_option), default)]
5331    pub limit: Option<isize>,
5332    /// Interpret the pattern as a literal string instead of a regular expression.
5333    #[builder(setter(into, strip_option), default)]
5334    pub literal: Option<bool>,
5335    /// Enable searching across multiple lines.
5336    #[builder(setter(into, strip_option), default)]
5337    pub multiline: Option<bool>,
5338    /// Directory or file paths to search
5339    #[builder(setter(into, strip_option), default)]
5340    pub paths: Option<Vec<&'a str>>,
5341    /// Skip hidden files (files starting with .).
5342    #[builder(setter(into, strip_option), default)]
5343    pub skip_hidden: Option<bool>,
5344    /// Honor .gitignore, .ignore, and .rgignore files.
5345    #[builder(setter(into, strip_option), default)]
5346    pub skip_ignored: Option<bool>,
5347}
5348#[derive(Builder, Debug, PartialEq)]
5349pub struct DirectoryStatOpts {
5350    /// If specified, do not follow symlinks.
5351    #[builder(setter(into, strip_option), default)]
5352    pub do_not_follow_symlinks: Option<bool>,
5353}
5354#[derive(Builder, Debug, PartialEq)]
5355pub struct DirectoryTerminalOpts<'a> {
5356    /// If set, override the container's default terminal command and invoke these command arguments instead.
5357    #[builder(setter(into, strip_option), default)]
5358    pub cmd: Option<Vec<&'a str>>,
5359    /// If set, override the default container used for the terminal.
5360    #[builder(setter(into, strip_option), default)]
5361    pub container: Option<ContainerId>,
5362    /// Provides Dagger access to the executed command.
5363    #[builder(setter(into, strip_option), default)]
5364    pub experimental_privileged_nesting: Option<bool>,
5365    /// 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.
5366    #[builder(setter(into, strip_option), default)]
5367    pub insecure_root_capabilities: Option<bool>,
5368}
5369#[derive(Builder, Debug, PartialEq)]
5370pub struct DirectoryWithDirectoryOpts<'a> {
5371    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
5372    #[builder(setter(into, strip_option), default)]
5373    pub exclude: Option<Vec<&'a str>>,
5374    /// Apply .gitignore filter rules inside the directory
5375    #[builder(setter(into, strip_option), default)]
5376    pub gitignore: Option<bool>,
5377    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
5378    #[builder(setter(into, strip_option), default)]
5379    pub include: Option<Vec<&'a str>>,
5380    /// A user:group to set for the copied directory and its contents.
5381    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5382    /// If the group is omitted, it defaults to the same as the user.
5383    #[builder(setter(into, strip_option), default)]
5384    pub owner: Option<&'a str>,
5385}
5386#[derive(Builder, Debug, PartialEq)]
5387pub struct DirectoryWithFileOpts<'a> {
5388    /// A user:group to set for the copied directory and its contents.
5389    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5390    /// If the group is omitted, it defaults to the same as the user.
5391    #[builder(setter(into, strip_option), default)]
5392    pub owner: Option<&'a str>,
5393    /// Permission given to the copied file (e.g., 0600).
5394    #[builder(setter(into, strip_option), default)]
5395    pub permissions: Option<isize>,
5396}
5397#[derive(Builder, Debug, PartialEq)]
5398pub struct DirectoryWithFilesOpts {
5399    /// Permission given to the copied files (e.g., 0600).
5400    #[builder(setter(into, strip_option), default)]
5401    pub permissions: Option<isize>,
5402}
5403#[derive(Builder, Debug, PartialEq)]
5404pub struct DirectoryWithNewDirectoryOpts {
5405    /// Permission granted to the created directory (e.g., 0777).
5406    #[builder(setter(into, strip_option), default)]
5407    pub permissions: Option<isize>,
5408}
5409#[derive(Builder, Debug, PartialEq)]
5410pub struct DirectoryWithNewFileOpts {
5411    /// Permissions of the new file. Example: 0600
5412    #[builder(setter(into, strip_option), default)]
5413    pub permissions: Option<isize>,
5414}
5415impl Directory {
5416    /// Converts this directory to a local git repository
5417    pub fn as_git(&self) -> GitRepository {
5418        let query = self.selection.select("asGit");
5419        GitRepository {
5420            proc: self.proc.clone(),
5421            selection: query,
5422            graphql_client: self.graphql_client.clone(),
5423        }
5424    }
5425    /// Load the directory as a Dagger module source
5426    ///
5427    /// # Arguments
5428    ///
5429    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5430    pub fn as_module(&self) -> Module {
5431        let query = self.selection.select("asModule");
5432        Module {
5433            proc: self.proc.clone(),
5434            selection: query,
5435            graphql_client: self.graphql_client.clone(),
5436        }
5437    }
5438    /// Load the directory as a Dagger module source
5439    ///
5440    /// # Arguments
5441    ///
5442    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5443    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
5444        let mut query = self.selection.select("asModule");
5445        if let Some(source_root_path) = opts.source_root_path {
5446            query = query.arg("sourceRootPath", source_root_path);
5447        }
5448        Module {
5449            proc: self.proc.clone(),
5450            selection: query,
5451            graphql_client: self.graphql_client.clone(),
5452        }
5453    }
5454    /// Load the directory as a Dagger module source
5455    ///
5456    /// # Arguments
5457    ///
5458    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5459    pub fn as_module_source(&self) -> ModuleSource {
5460        let query = self.selection.select("asModuleSource");
5461        ModuleSource {
5462            proc: self.proc.clone(),
5463            selection: query,
5464            graphql_client: self.graphql_client.clone(),
5465        }
5466    }
5467    /// Load the directory as a Dagger module source
5468    ///
5469    /// # Arguments
5470    ///
5471    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5472    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
5473        let mut query = self.selection.select("asModuleSource");
5474        if let Some(source_root_path) = opts.source_root_path {
5475            query = query.arg("sourceRootPath", source_root_path);
5476        }
5477        ModuleSource {
5478            proc: self.proc.clone(),
5479            selection: query,
5480            graphql_client: self.graphql_client.clone(),
5481        }
5482    }
5483    /// Return the difference between this directory and another directory, typically an older snapshot.
5484    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
5485    ///
5486    /// # Arguments
5487    ///
5488    /// * `from` - The base directory snapshot to compare against
5489    pub fn changes(&self, from: impl IntoID<DirectoryId>) -> Changeset {
5490        let mut query = self.selection.select("changes");
5491        query = query.arg_lazy(
5492            "from",
5493            Box::new(move || {
5494                let from = from.clone();
5495                Box::pin(async move { from.into_id().await.unwrap().quote() })
5496            }),
5497        );
5498        Changeset {
5499            proc: self.proc.clone(),
5500            selection: query,
5501            graphql_client: self.graphql_client.clone(),
5502        }
5503    }
5504    /// Change the owner of the directory contents recursively.
5505    ///
5506    /// # Arguments
5507    ///
5508    /// * `path` - Path of the directory to change ownership of (e.g., "/").
5509    /// * `owner` - A user:group to set for the mounted directory and its contents.
5510    ///
5511    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5512    ///
5513    /// If the group is omitted, it defaults to the same as the user.
5514    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
5515        let mut query = self.selection.select("chown");
5516        query = query.arg("path", path.into());
5517        query = query.arg("owner", owner.into());
5518        Directory {
5519            proc: self.proc.clone(),
5520            selection: query,
5521            graphql_client: self.graphql_client.clone(),
5522        }
5523    }
5524    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
5525    ///
5526    /// # Arguments
5527    ///
5528    /// * `other` - The directory to compare against
5529    pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
5530        let mut query = self.selection.select("diff");
5531        query = query.arg_lazy(
5532            "other",
5533            Box::new(move || {
5534                let other = other.clone();
5535                Box::pin(async move { other.into_id().await.unwrap().quote() })
5536            }),
5537        );
5538        Directory {
5539            proc: self.proc.clone(),
5540            selection: query,
5541            graphql_client: self.graphql_client.clone(),
5542        }
5543    }
5544    /// 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.
5545    pub async fn digest(&self) -> Result<String, DaggerError> {
5546        let query = self.selection.select("digest");
5547        query.execute(self.graphql_client.clone()).await
5548    }
5549    /// Retrieves a directory at the given path.
5550    ///
5551    /// # Arguments
5552    ///
5553    /// * `path` - Location of the directory to retrieve. Example: "/src"
5554    pub fn directory(&self, path: impl Into<String>) -> Directory {
5555        let mut query = self.selection.select("directory");
5556        query = query.arg("path", path.into());
5557        Directory {
5558            proc: self.proc.clone(),
5559            selection: query,
5560            graphql_client: self.graphql_client.clone(),
5561        }
5562    }
5563    /// 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.
5564    ///
5565    /// # Arguments
5566    ///
5567    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5568    pub fn docker_build(&self) -> Container {
5569        let query = self.selection.select("dockerBuild");
5570        Container {
5571            proc: self.proc.clone(),
5572            selection: query,
5573            graphql_client: self.graphql_client.clone(),
5574        }
5575    }
5576    /// 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.
5577    ///
5578    /// # Arguments
5579    ///
5580    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5581    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5582        let mut query = self.selection.select("dockerBuild");
5583        if let Some(dockerfile) = opts.dockerfile {
5584            query = query.arg("dockerfile", dockerfile);
5585        }
5586        if let Some(platform) = opts.platform {
5587            query = query.arg("platform", platform);
5588        }
5589        if let Some(build_args) = opts.build_args {
5590            query = query.arg("buildArgs", build_args);
5591        }
5592        if let Some(target) = opts.target {
5593            query = query.arg("target", target);
5594        }
5595        if let Some(secrets) = opts.secrets {
5596            query = query.arg("secrets", secrets);
5597        }
5598        if let Some(no_init) = opts.no_init {
5599            query = query.arg("noInit", no_init);
5600        }
5601        Container {
5602            proc: self.proc.clone(),
5603            selection: query,
5604            graphql_client: self.graphql_client.clone(),
5605        }
5606    }
5607    /// Returns a list of files and directories at the given path.
5608    ///
5609    /// # Arguments
5610    ///
5611    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5612    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
5613        let query = self.selection.select("entries");
5614        query.execute(self.graphql_client.clone()).await
5615    }
5616    /// Returns a list of files and directories at the given path.
5617    ///
5618    /// # Arguments
5619    ///
5620    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5621    pub async fn entries_opts<'a>(
5622        &self,
5623        opts: DirectoryEntriesOpts<'a>,
5624    ) -> Result<Vec<String>, DaggerError> {
5625        let mut query = self.selection.select("entries");
5626        if let Some(path) = opts.path {
5627            query = query.arg("path", path);
5628        }
5629        query.execute(self.graphql_client.clone()).await
5630    }
5631    /// check if a file or directory exists
5632    ///
5633    /// # Arguments
5634    ///
5635    /// * `path` - Path to check (e.g., "/file.txt").
5636    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5637    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5638        let mut query = self.selection.select("exists");
5639        query = query.arg("path", path.into());
5640        query.execute(self.graphql_client.clone()).await
5641    }
5642    /// check if a file or directory exists
5643    ///
5644    /// # Arguments
5645    ///
5646    /// * `path` - Path to check (e.g., "/file.txt").
5647    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5648    pub async fn exists_opts(
5649        &self,
5650        path: impl Into<String>,
5651        opts: DirectoryExistsOpts,
5652    ) -> Result<bool, DaggerError> {
5653        let mut query = self.selection.select("exists");
5654        query = query.arg("path", path.into());
5655        if let Some(expected_type) = opts.expected_type {
5656            query = query.arg("expectedType", expected_type);
5657        }
5658        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5659            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5660        }
5661        query.execute(self.graphql_client.clone()).await
5662    }
5663    /// Writes the contents of the directory to a path on the host.
5664    ///
5665    /// # Arguments
5666    ///
5667    /// * `path` - Location of the copied directory (e.g., "logs/").
5668    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5669    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5670        let mut query = self.selection.select("export");
5671        query = query.arg("path", path.into());
5672        query.execute(self.graphql_client.clone()).await
5673    }
5674    /// Writes the contents of the directory to a path on the host.
5675    ///
5676    /// # Arguments
5677    ///
5678    /// * `path` - Location of the copied directory (e.g., "logs/").
5679    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5680    pub async fn export_opts(
5681        &self,
5682        path: impl Into<String>,
5683        opts: DirectoryExportOpts,
5684    ) -> Result<String, DaggerError> {
5685        let mut query = self.selection.select("export");
5686        query = query.arg("path", path.into());
5687        if let Some(wipe) = opts.wipe {
5688            query = query.arg("wipe", wipe);
5689        }
5690        query.execute(self.graphql_client.clone()).await
5691    }
5692    /// Retrieve a file at the given path.
5693    ///
5694    /// # Arguments
5695    ///
5696    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5697    pub fn file(&self, path: impl Into<String>) -> File {
5698        let mut query = self.selection.select("file");
5699        query = query.arg("path", path.into());
5700        File {
5701            proc: self.proc.clone(),
5702            selection: query,
5703            graphql_client: self.graphql_client.clone(),
5704        }
5705    }
5706    /// Return a snapshot with some paths included or excluded
5707    ///
5708    /// # Arguments
5709    ///
5710    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5711    pub fn filter(&self) -> Directory {
5712        let query = self.selection.select("filter");
5713        Directory {
5714            proc: self.proc.clone(),
5715            selection: query,
5716            graphql_client: self.graphql_client.clone(),
5717        }
5718    }
5719    /// Return a snapshot with some paths included or excluded
5720    ///
5721    /// # Arguments
5722    ///
5723    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5724    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5725        let mut query = self.selection.select("filter");
5726        if let Some(exclude) = opts.exclude {
5727            query = query.arg("exclude", exclude);
5728        }
5729        if let Some(include) = opts.include {
5730            query = query.arg("include", include);
5731        }
5732        if let Some(gitignore) = opts.gitignore {
5733            query = query.arg("gitignore", gitignore);
5734        }
5735        Directory {
5736            proc: self.proc.clone(),
5737            selection: query,
5738            graphql_client: self.graphql_client.clone(),
5739        }
5740    }
5741    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
5742    ///
5743    /// # Arguments
5744    ///
5745    /// * `name` - The name of the file or directory to search for
5746    /// * `start` - The path to start the search from
5747    pub async fn find_up(
5748        &self,
5749        name: impl Into<String>,
5750        start: impl Into<String>,
5751    ) -> Result<String, DaggerError> {
5752        let mut query = self.selection.select("findUp");
5753        query = query.arg("name", name.into());
5754        query = query.arg("start", start.into());
5755        query.execute(self.graphql_client.clone()).await
5756    }
5757    /// Returns a list of files and directories that matche the given pattern.
5758    ///
5759    /// # Arguments
5760    ///
5761    /// * `pattern` - Pattern to match (e.g., "*.md").
5762    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5763        let mut query = self.selection.select("glob");
5764        query = query.arg("pattern", pattern.into());
5765        query.execute(self.graphql_client.clone()).await
5766    }
5767    /// A unique identifier for this Directory.
5768    pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
5769        let query = self.selection.select("id");
5770        query.execute(self.graphql_client.clone()).await
5771    }
5772    /// Returns the name of the directory.
5773    pub async fn name(&self) -> Result<String, DaggerError> {
5774        let query = self.selection.select("name");
5775        query.execute(self.graphql_client.clone()).await
5776    }
5777    /// Searches for content matching the given regular expression or literal string.
5778    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5779    ///
5780    /// # Arguments
5781    ///
5782    /// * `pattern` - The text to match.
5783    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5784    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
5785        let mut query = self.selection.select("search");
5786        query = query.arg("pattern", pattern.into());
5787        vec![SearchResult {
5788            proc: self.proc.clone(),
5789            selection: query,
5790            graphql_client: self.graphql_client.clone(),
5791        }]
5792    }
5793    /// Searches for content matching the given regular expression or literal string.
5794    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5795    ///
5796    /// # Arguments
5797    ///
5798    /// * `pattern` - The text to match.
5799    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5800    pub fn search_opts<'a>(
5801        &self,
5802        pattern: impl Into<String>,
5803        opts: DirectorySearchOpts<'a>,
5804    ) -> Vec<SearchResult> {
5805        let mut query = self.selection.select("search");
5806        query = query.arg("pattern", pattern.into());
5807        if let Some(paths) = opts.paths {
5808            query = query.arg("paths", paths);
5809        }
5810        if let Some(globs) = opts.globs {
5811            query = query.arg("globs", globs);
5812        }
5813        if let Some(literal) = opts.literal {
5814            query = query.arg("literal", literal);
5815        }
5816        if let Some(multiline) = opts.multiline {
5817            query = query.arg("multiline", multiline);
5818        }
5819        if let Some(dotall) = opts.dotall {
5820            query = query.arg("dotall", dotall);
5821        }
5822        if let Some(insensitive) = opts.insensitive {
5823            query = query.arg("insensitive", insensitive);
5824        }
5825        if let Some(skip_ignored) = opts.skip_ignored {
5826            query = query.arg("skipIgnored", skip_ignored);
5827        }
5828        if let Some(skip_hidden) = opts.skip_hidden {
5829            query = query.arg("skipHidden", skip_hidden);
5830        }
5831        if let Some(files_only) = opts.files_only {
5832            query = query.arg("filesOnly", files_only);
5833        }
5834        if let Some(limit) = opts.limit {
5835            query = query.arg("limit", limit);
5836        }
5837        vec![SearchResult {
5838            proc: self.proc.clone(),
5839            selection: query,
5840            graphql_client: self.graphql_client.clone(),
5841        }]
5842    }
5843    /// Return file status
5844    ///
5845    /// # Arguments
5846    ///
5847    /// * `path` - Path to stat (e.g., "/file.txt").
5848    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5849    pub fn stat(&self, path: impl Into<String>) -> Stat {
5850        let mut query = self.selection.select("stat");
5851        query = query.arg("path", path.into());
5852        Stat {
5853            proc: self.proc.clone(),
5854            selection: query,
5855            graphql_client: self.graphql_client.clone(),
5856        }
5857    }
5858    /// Return file status
5859    ///
5860    /// # Arguments
5861    ///
5862    /// * `path` - Path to stat (e.g., "/file.txt").
5863    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5864    pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
5865        let mut query = self.selection.select("stat");
5866        query = query.arg("path", path.into());
5867        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5868            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5869        }
5870        Stat {
5871            proc: self.proc.clone(),
5872            selection: query,
5873            graphql_client: self.graphql_client.clone(),
5874        }
5875    }
5876    /// Force evaluation in the engine.
5877    pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
5878        let query = self.selection.select("sync");
5879        query.execute(self.graphql_client.clone()).await
5880    }
5881    /// Opens an interactive terminal in new container with this directory mounted inside.
5882    ///
5883    /// # Arguments
5884    ///
5885    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5886    pub fn terminal(&self) -> Directory {
5887        let query = self.selection.select("terminal");
5888        Directory {
5889            proc: self.proc.clone(),
5890            selection: query,
5891            graphql_client: self.graphql_client.clone(),
5892        }
5893    }
5894    /// Opens an interactive terminal in new container with this directory mounted inside.
5895    ///
5896    /// # Arguments
5897    ///
5898    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5899    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5900        let mut query = self.selection.select("terminal");
5901        if let Some(container) = opts.container {
5902            query = query.arg("container", container);
5903        }
5904        if let Some(cmd) = opts.cmd {
5905            query = query.arg("cmd", cmd);
5906        }
5907        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5908            query = query.arg(
5909                "experimentalPrivilegedNesting",
5910                experimental_privileged_nesting,
5911            );
5912        }
5913        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5914            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5915        }
5916        Directory {
5917            proc: self.proc.clone(),
5918            selection: query,
5919            graphql_client: self.graphql_client.clone(),
5920        }
5921    }
5922    /// Return a directory with changes from another directory applied to it.
5923    ///
5924    /// # Arguments
5925    ///
5926    /// * `changes` - Changes to apply to the directory
5927    pub fn with_changes(&self, changes: impl IntoID<ChangesetId>) -> Directory {
5928        let mut query = self.selection.select("withChanges");
5929        query = query.arg_lazy(
5930            "changes",
5931            Box::new(move || {
5932                let changes = changes.clone();
5933                Box::pin(async move { changes.into_id().await.unwrap().quote() })
5934            }),
5935        );
5936        Directory {
5937            proc: self.proc.clone(),
5938            selection: query,
5939            graphql_client: self.graphql_client.clone(),
5940        }
5941    }
5942    /// Return a snapshot with a directory added
5943    ///
5944    /// # Arguments
5945    ///
5946    /// * `path` - Location of the written directory (e.g., "/src/").
5947    /// * `source` - Identifier of the directory to copy.
5948    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5949    pub fn with_directory(
5950        &self,
5951        path: impl Into<String>,
5952        source: impl IntoID<DirectoryId>,
5953    ) -> Directory {
5954        let mut query = self.selection.select("withDirectory");
5955        query = query.arg("path", path.into());
5956        query = query.arg_lazy(
5957            "source",
5958            Box::new(move || {
5959                let source = source.clone();
5960                Box::pin(async move { source.into_id().await.unwrap().quote() })
5961            }),
5962        );
5963        Directory {
5964            proc: self.proc.clone(),
5965            selection: query,
5966            graphql_client: self.graphql_client.clone(),
5967        }
5968    }
5969    /// Return a snapshot with a directory added
5970    ///
5971    /// # Arguments
5972    ///
5973    /// * `path` - Location of the written directory (e.g., "/src/").
5974    /// * `source` - Identifier of the directory to copy.
5975    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5976    pub fn with_directory_opts<'a>(
5977        &self,
5978        path: impl Into<String>,
5979        source: impl IntoID<DirectoryId>,
5980        opts: DirectoryWithDirectoryOpts<'a>,
5981    ) -> Directory {
5982        let mut query = self.selection.select("withDirectory");
5983        query = query.arg("path", path.into());
5984        query = query.arg_lazy(
5985            "source",
5986            Box::new(move || {
5987                let source = source.clone();
5988                Box::pin(async move { source.into_id().await.unwrap().quote() })
5989            }),
5990        );
5991        if let Some(exclude) = opts.exclude {
5992            query = query.arg("exclude", exclude);
5993        }
5994        if let Some(include) = opts.include {
5995            query = query.arg("include", include);
5996        }
5997        if let Some(gitignore) = opts.gitignore {
5998            query = query.arg("gitignore", gitignore);
5999        }
6000        if let Some(owner) = opts.owner {
6001            query = query.arg("owner", owner);
6002        }
6003        Directory {
6004            proc: self.proc.clone(),
6005            selection: query,
6006            graphql_client: self.graphql_client.clone(),
6007        }
6008    }
6009    /// Raise an error.
6010    ///
6011    /// # Arguments
6012    ///
6013    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
6014    pub fn with_error(&self, err: impl Into<String>) -> Directory {
6015        let mut query = self.selection.select("withError");
6016        query = query.arg("err", err.into());
6017        Directory {
6018            proc: self.proc.clone(),
6019            selection: query,
6020            graphql_client: self.graphql_client.clone(),
6021        }
6022    }
6023    /// Retrieves this directory plus the contents of the given file copied to the given path.
6024    ///
6025    /// # Arguments
6026    ///
6027    /// * `path` - Location of the copied file (e.g., "/file.txt").
6028    /// * `source` - Identifier of the file to copy.
6029    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6030    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
6031        let mut query = self.selection.select("withFile");
6032        query = query.arg("path", path.into());
6033        query = query.arg_lazy(
6034            "source",
6035            Box::new(move || {
6036                let source = source.clone();
6037                Box::pin(async move { source.into_id().await.unwrap().quote() })
6038            }),
6039        );
6040        Directory {
6041            proc: self.proc.clone(),
6042            selection: query,
6043            graphql_client: self.graphql_client.clone(),
6044        }
6045    }
6046    /// Retrieves this directory plus the contents of the given file copied to the given path.
6047    ///
6048    /// # Arguments
6049    ///
6050    /// * `path` - Location of the copied file (e.g., "/file.txt").
6051    /// * `source` - Identifier of the file to copy.
6052    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6053    pub fn with_file_opts<'a>(
6054        &self,
6055        path: impl Into<String>,
6056        source: impl IntoID<FileId>,
6057        opts: DirectoryWithFileOpts<'a>,
6058    ) -> Directory {
6059        let mut query = self.selection.select("withFile");
6060        query = query.arg("path", path.into());
6061        query = query.arg_lazy(
6062            "source",
6063            Box::new(move || {
6064                let source = source.clone();
6065                Box::pin(async move { source.into_id().await.unwrap().quote() })
6066            }),
6067        );
6068        if let Some(permissions) = opts.permissions {
6069            query = query.arg("permissions", permissions);
6070        }
6071        if let Some(owner) = opts.owner {
6072            query = query.arg("owner", owner);
6073        }
6074        Directory {
6075            proc: self.proc.clone(),
6076            selection: query,
6077            graphql_client: self.graphql_client.clone(),
6078        }
6079    }
6080    /// Retrieves this directory plus the contents of the given files copied to the given path.
6081    ///
6082    /// # Arguments
6083    ///
6084    /// * `path` - Location where copied files should be placed (e.g., "/src").
6085    /// * `sources` - Identifiers of the files to copy.
6086    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6087    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
6088        let mut query = self.selection.select("withFiles");
6089        query = query.arg("path", path.into());
6090        query = query.arg("sources", sources);
6091        Directory {
6092            proc: self.proc.clone(),
6093            selection: query,
6094            graphql_client: self.graphql_client.clone(),
6095        }
6096    }
6097    /// Retrieves this directory plus the contents of the given files copied to the given path.
6098    ///
6099    /// # Arguments
6100    ///
6101    /// * `path` - Location where copied files should be placed (e.g., "/src").
6102    /// * `sources` - Identifiers of the files to copy.
6103    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6104    pub fn with_files_opts(
6105        &self,
6106        path: impl Into<String>,
6107        sources: Vec<FileId>,
6108        opts: DirectoryWithFilesOpts,
6109    ) -> Directory {
6110        let mut query = self.selection.select("withFiles");
6111        query = query.arg("path", path.into());
6112        query = query.arg("sources", sources);
6113        if let Some(permissions) = opts.permissions {
6114            query = query.arg("permissions", permissions);
6115        }
6116        Directory {
6117            proc: self.proc.clone(),
6118            selection: query,
6119            graphql_client: self.graphql_client.clone(),
6120        }
6121    }
6122    /// Retrieves this directory plus a new directory created at the given path.
6123    ///
6124    /// # Arguments
6125    ///
6126    /// * `path` - Location of the directory created (e.g., "/logs").
6127    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6128    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
6129        let mut query = self.selection.select("withNewDirectory");
6130        query = query.arg("path", path.into());
6131        Directory {
6132            proc: self.proc.clone(),
6133            selection: query,
6134            graphql_client: self.graphql_client.clone(),
6135        }
6136    }
6137    /// Retrieves this directory plus a new directory created at the given path.
6138    ///
6139    /// # Arguments
6140    ///
6141    /// * `path` - Location of the directory created (e.g., "/logs").
6142    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6143    pub fn with_new_directory_opts(
6144        &self,
6145        path: impl Into<String>,
6146        opts: DirectoryWithNewDirectoryOpts,
6147    ) -> Directory {
6148        let mut query = self.selection.select("withNewDirectory");
6149        query = query.arg("path", path.into());
6150        if let Some(permissions) = opts.permissions {
6151            query = query.arg("permissions", permissions);
6152        }
6153        Directory {
6154            proc: self.proc.clone(),
6155            selection: query,
6156            graphql_client: self.graphql_client.clone(),
6157        }
6158    }
6159    /// Return a snapshot with a new file added
6160    ///
6161    /// # Arguments
6162    ///
6163    /// * `path` - Path of the new file. Example: "foo/bar.txt"
6164    /// * `contents` - Contents of the new file. Example: "Hello world!"
6165    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6166    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
6167        let mut query = self.selection.select("withNewFile");
6168        query = query.arg("path", path.into());
6169        query = query.arg("contents", contents.into());
6170        Directory {
6171            proc: self.proc.clone(),
6172            selection: query,
6173            graphql_client: self.graphql_client.clone(),
6174        }
6175    }
6176    /// Return a snapshot with a new file added
6177    ///
6178    /// # Arguments
6179    ///
6180    /// * `path` - Path of the new file. Example: "foo/bar.txt"
6181    /// * `contents` - Contents of the new file. Example: "Hello world!"
6182    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6183    pub fn with_new_file_opts(
6184        &self,
6185        path: impl Into<String>,
6186        contents: impl Into<String>,
6187        opts: DirectoryWithNewFileOpts,
6188    ) -> Directory {
6189        let mut query = self.selection.select("withNewFile");
6190        query = query.arg("path", path.into());
6191        query = query.arg("contents", contents.into());
6192        if let Some(permissions) = opts.permissions {
6193            query = query.arg("permissions", permissions);
6194        }
6195        Directory {
6196            proc: self.proc.clone(),
6197            selection: query,
6198            graphql_client: self.graphql_client.clone(),
6199        }
6200    }
6201    /// Retrieves this directory with the given Git-compatible patch applied.
6202    ///
6203    /// # Arguments
6204    ///
6205    /// * `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").
6206    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
6207        let mut query = self.selection.select("withPatch");
6208        query = query.arg("patch", patch.into());
6209        Directory {
6210            proc: self.proc.clone(),
6211            selection: query,
6212            graphql_client: self.graphql_client.clone(),
6213        }
6214    }
6215    /// Retrieves this directory with the given Git-compatible patch file applied.
6216    ///
6217    /// # Arguments
6218    ///
6219    /// * `patch` - File containing the patch to apply
6220    pub fn with_patch_file(&self, patch: impl IntoID<FileId>) -> Directory {
6221        let mut query = self.selection.select("withPatchFile");
6222        query = query.arg_lazy(
6223            "patch",
6224            Box::new(move || {
6225                let patch = patch.clone();
6226                Box::pin(async move { patch.into_id().await.unwrap().quote() })
6227            }),
6228        );
6229        Directory {
6230            proc: self.proc.clone(),
6231            selection: query,
6232            graphql_client: self.graphql_client.clone(),
6233        }
6234    }
6235    /// Return a snapshot with a symlink
6236    ///
6237    /// # Arguments
6238    ///
6239    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
6240    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
6241    pub fn with_symlink(
6242        &self,
6243        target: impl Into<String>,
6244        link_name: impl Into<String>,
6245    ) -> Directory {
6246        let mut query = self.selection.select("withSymlink");
6247        query = query.arg("target", target.into());
6248        query = query.arg("linkName", link_name.into());
6249        Directory {
6250            proc: self.proc.clone(),
6251            selection: query,
6252            graphql_client: self.graphql_client.clone(),
6253        }
6254    }
6255    /// Retrieves this directory with all file/dir timestamps set to the given time.
6256    ///
6257    /// # Arguments
6258    ///
6259    /// * `timestamp` - Timestamp to set dir/files in.
6260    ///
6261    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
6262    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
6263        let mut query = self.selection.select("withTimestamps");
6264        query = query.arg("timestamp", timestamp);
6265        Directory {
6266            proc: self.proc.clone(),
6267            selection: query,
6268            graphql_client: self.graphql_client.clone(),
6269        }
6270    }
6271    /// Return a snapshot with a subdirectory removed
6272    ///
6273    /// # Arguments
6274    ///
6275    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
6276    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
6277        let mut query = self.selection.select("withoutDirectory");
6278        query = query.arg("path", path.into());
6279        Directory {
6280            proc: self.proc.clone(),
6281            selection: query,
6282            graphql_client: self.graphql_client.clone(),
6283        }
6284    }
6285    /// Return a snapshot with a file removed
6286    ///
6287    /// # Arguments
6288    ///
6289    /// * `path` - Path of the file to remove (e.g., "/file.txt").
6290    pub fn without_file(&self, path: impl Into<String>) -> Directory {
6291        let mut query = self.selection.select("withoutFile");
6292        query = query.arg("path", path.into());
6293        Directory {
6294            proc: self.proc.clone(),
6295            selection: query,
6296            graphql_client: self.graphql_client.clone(),
6297        }
6298    }
6299    /// Return a snapshot with files removed
6300    ///
6301    /// # Arguments
6302    ///
6303    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
6304    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
6305        let mut query = self.selection.select("withoutFiles");
6306        query = query.arg(
6307            "paths",
6308            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
6309        );
6310        Directory {
6311            proc: self.proc.clone(),
6312            selection: query,
6313            graphql_client: self.graphql_client.clone(),
6314        }
6315    }
6316}
6317#[derive(Clone)]
6318pub struct Engine {
6319    pub proc: Option<Arc<DaggerSessionProc>>,
6320    pub selection: Selection,
6321    pub graphql_client: DynGraphQLClient,
6322}
6323impl Engine {
6324    /// The list of connected client IDs
6325    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
6326        let query = self.selection.select("clients");
6327        query.execute(self.graphql_client.clone()).await
6328    }
6329    /// A unique identifier for this Engine.
6330    pub async fn id(&self) -> Result<EngineId, DaggerError> {
6331        let query = self.selection.select("id");
6332        query.execute(self.graphql_client.clone()).await
6333    }
6334    /// The local (on-disk) cache for the Dagger engine
6335    pub fn local_cache(&self) -> EngineCache {
6336        let query = self.selection.select("localCache");
6337        EngineCache {
6338            proc: self.proc.clone(),
6339            selection: query,
6340            graphql_client: self.graphql_client.clone(),
6341        }
6342    }
6343    /// The name of the engine instance.
6344    pub async fn name(&self) -> Result<String, DaggerError> {
6345        let query = self.selection.select("name");
6346        query.execute(self.graphql_client.clone()).await
6347    }
6348}
6349#[derive(Clone)]
6350pub struct EngineCache {
6351    pub proc: Option<Arc<DaggerSessionProc>>,
6352    pub selection: Selection,
6353    pub graphql_client: DynGraphQLClient,
6354}
6355#[derive(Builder, Debug, PartialEq)]
6356pub struct EngineCacheEntrySetOpts<'a> {
6357    #[builder(setter(into, strip_option), default)]
6358    pub key: Option<&'a str>,
6359}
6360#[derive(Builder, Debug, PartialEq)]
6361pub struct EngineCachePruneOpts {
6362    /// Use the engine-wide default pruning policy if true, otherwise prune the whole cache of any releasable entries.
6363    #[builder(setter(into, strip_option), default)]
6364    pub use_default_policy: Option<bool>,
6365}
6366impl EngineCache {
6367    /// The current set of entries in the cache
6368    ///
6369    /// # Arguments
6370    ///
6371    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6372    pub fn entry_set(&self) -> EngineCacheEntrySet {
6373        let query = self.selection.select("entrySet");
6374        EngineCacheEntrySet {
6375            proc: self.proc.clone(),
6376            selection: query,
6377            graphql_client: self.graphql_client.clone(),
6378        }
6379    }
6380    /// The current set of entries in the cache
6381    ///
6382    /// # Arguments
6383    ///
6384    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6385    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
6386        let mut query = self.selection.select("entrySet");
6387        if let Some(key) = opts.key {
6388            query = query.arg("key", key);
6389        }
6390        EngineCacheEntrySet {
6391            proc: self.proc.clone(),
6392            selection: query,
6393            graphql_client: self.graphql_client.clone(),
6394        }
6395    }
6396    /// A unique identifier for this EngineCache.
6397    pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
6398        let query = self.selection.select("id");
6399        query.execute(self.graphql_client.clone()).await
6400    }
6401    /// The maximum bytes to keep in the cache without pruning.
6402    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
6403        let query = self.selection.select("maxUsedSpace");
6404        query.execute(self.graphql_client.clone()).await
6405    }
6406    /// The target amount of free disk space the garbage collector will attempt to leave.
6407    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
6408        let query = self.selection.select("minFreeSpace");
6409        query.execute(self.graphql_client.clone()).await
6410    }
6411    /// Prune the cache of releaseable entries
6412    ///
6413    /// # Arguments
6414    ///
6415    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6416    pub async fn prune(&self) -> Result<Void, DaggerError> {
6417        let query = self.selection.select("prune");
6418        query.execute(self.graphql_client.clone()).await
6419    }
6420    /// Prune the cache of releaseable entries
6421    ///
6422    /// # Arguments
6423    ///
6424    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6425    pub async fn prune_opts(&self, opts: EngineCachePruneOpts) -> Result<Void, DaggerError> {
6426        let mut query = self.selection.select("prune");
6427        if let Some(use_default_policy) = opts.use_default_policy {
6428            query = query.arg("useDefaultPolicy", use_default_policy);
6429        }
6430        query.execute(self.graphql_client.clone()).await
6431    }
6432    /// The minimum amount of disk space this policy is guaranteed to retain.
6433    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
6434        let query = self.selection.select("reservedSpace");
6435        query.execute(self.graphql_client.clone()).await
6436    }
6437    /// The target number of bytes to keep when pruning.
6438    pub async fn target_space(&self) -> Result<isize, DaggerError> {
6439        let query = self.selection.select("targetSpace");
6440        query.execute(self.graphql_client.clone()).await
6441    }
6442}
6443#[derive(Clone)]
6444pub struct EngineCacheEntry {
6445    pub proc: Option<Arc<DaggerSessionProc>>,
6446    pub selection: Selection,
6447    pub graphql_client: DynGraphQLClient,
6448}
6449impl EngineCacheEntry {
6450    /// Whether the cache entry is actively being used.
6451    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
6452        let query = self.selection.select("activelyUsed");
6453        query.execute(self.graphql_client.clone()).await
6454    }
6455    /// The time the cache entry was created, in Unix nanoseconds.
6456    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
6457        let query = self.selection.select("createdTimeUnixNano");
6458        query.execute(self.graphql_client.clone()).await
6459    }
6460    /// The description of the cache entry.
6461    pub async fn description(&self) -> Result<String, DaggerError> {
6462        let query = self.selection.select("description");
6463        query.execute(self.graphql_client.clone()).await
6464    }
6465    /// The disk space used by the cache entry.
6466    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6467        let query = self.selection.select("diskSpaceBytes");
6468        query.execute(self.graphql_client.clone()).await
6469    }
6470    /// A unique identifier for this EngineCacheEntry.
6471    pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
6472        let query = self.selection.select("id");
6473        query.execute(self.graphql_client.clone()).await
6474    }
6475    /// The most recent time the cache entry was used, in Unix nanoseconds.
6476    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
6477        let query = self.selection.select("mostRecentUseTimeUnixNano");
6478        query.execute(self.graphql_client.clone()).await
6479    }
6480}
6481#[derive(Clone)]
6482pub struct EngineCacheEntrySet {
6483    pub proc: Option<Arc<DaggerSessionProc>>,
6484    pub selection: Selection,
6485    pub graphql_client: DynGraphQLClient,
6486}
6487impl EngineCacheEntrySet {
6488    /// The total disk space used by the cache entries in this set.
6489    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6490        let query = self.selection.select("diskSpaceBytes");
6491        query.execute(self.graphql_client.clone()).await
6492    }
6493    /// The list of individual cache entries in the set
6494    pub fn entries(&self) -> Vec<EngineCacheEntry> {
6495        let query = self.selection.select("entries");
6496        vec![EngineCacheEntry {
6497            proc: self.proc.clone(),
6498            selection: query,
6499            graphql_client: self.graphql_client.clone(),
6500        }]
6501    }
6502    /// The number of cache entries in this set.
6503    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6504        let query = self.selection.select("entryCount");
6505        query.execute(self.graphql_client.clone()).await
6506    }
6507    /// A unique identifier for this EngineCacheEntrySet.
6508    pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
6509        let query = self.selection.select("id");
6510        query.execute(self.graphql_client.clone()).await
6511    }
6512}
6513#[derive(Clone)]
6514pub struct EnumTypeDef {
6515    pub proc: Option<Arc<DaggerSessionProc>>,
6516    pub selection: Selection,
6517    pub graphql_client: DynGraphQLClient,
6518}
6519impl EnumTypeDef {
6520    /// A doc string for the enum, if any.
6521    pub async fn description(&self) -> Result<String, DaggerError> {
6522        let query = self.selection.select("description");
6523        query.execute(self.graphql_client.clone()).await
6524    }
6525    /// A unique identifier for this EnumTypeDef.
6526    pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
6527        let query = self.selection.select("id");
6528        query.execute(self.graphql_client.clone()).await
6529    }
6530    /// The members of the enum.
6531    pub fn members(&self) -> Vec<EnumValueTypeDef> {
6532        let query = self.selection.select("members");
6533        vec![EnumValueTypeDef {
6534            proc: self.proc.clone(),
6535            selection: query,
6536            graphql_client: self.graphql_client.clone(),
6537        }]
6538    }
6539    /// The name of the enum.
6540    pub async fn name(&self) -> Result<String, DaggerError> {
6541        let query = self.selection.select("name");
6542        query.execute(self.graphql_client.clone()).await
6543    }
6544    /// The location of this enum declaration.
6545    pub fn source_map(&self) -> SourceMap {
6546        let query = self.selection.select("sourceMap");
6547        SourceMap {
6548            proc: self.proc.clone(),
6549            selection: query,
6550            graphql_client: self.graphql_client.clone(),
6551        }
6552    }
6553    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
6554    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6555        let query = self.selection.select("sourceModuleName");
6556        query.execute(self.graphql_client.clone()).await
6557    }
6558    pub fn values(&self) -> Vec<EnumValueTypeDef> {
6559        let query = self.selection.select("values");
6560        vec![EnumValueTypeDef {
6561            proc: self.proc.clone(),
6562            selection: query,
6563            graphql_client: self.graphql_client.clone(),
6564        }]
6565    }
6566}
6567#[derive(Clone)]
6568pub struct EnumValueTypeDef {
6569    pub proc: Option<Arc<DaggerSessionProc>>,
6570    pub selection: Selection,
6571    pub graphql_client: DynGraphQLClient,
6572}
6573impl EnumValueTypeDef {
6574    /// The reason this enum member is deprecated, if any.
6575    pub async fn deprecated(&self) -> Result<String, DaggerError> {
6576        let query = self.selection.select("deprecated");
6577        query.execute(self.graphql_client.clone()).await
6578    }
6579    /// A doc string for the enum member, if any.
6580    pub async fn description(&self) -> Result<String, DaggerError> {
6581        let query = self.selection.select("description");
6582        query.execute(self.graphql_client.clone()).await
6583    }
6584    /// A unique identifier for this EnumValueTypeDef.
6585    pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
6586        let query = self.selection.select("id");
6587        query.execute(self.graphql_client.clone()).await
6588    }
6589    /// The name of the enum member.
6590    pub async fn name(&self) -> Result<String, DaggerError> {
6591        let query = self.selection.select("name");
6592        query.execute(self.graphql_client.clone()).await
6593    }
6594    /// The location of this enum member declaration.
6595    pub fn source_map(&self) -> SourceMap {
6596        let query = self.selection.select("sourceMap");
6597        SourceMap {
6598            proc: self.proc.clone(),
6599            selection: query,
6600            graphql_client: self.graphql_client.clone(),
6601        }
6602    }
6603    /// The value of the enum member
6604    pub async fn value(&self) -> Result<String, DaggerError> {
6605        let query = self.selection.select("value");
6606        query.execute(self.graphql_client.clone()).await
6607    }
6608}
6609#[derive(Clone)]
6610pub struct Env {
6611    pub proc: Option<Arc<DaggerSessionProc>>,
6612    pub selection: Selection,
6613    pub graphql_client: DynGraphQLClient,
6614}
6615impl Env {
6616    /// A unique identifier for this Env.
6617    pub async fn id(&self) -> Result<EnvId, DaggerError> {
6618        let query = self.selection.select("id");
6619        query.execute(self.graphql_client.clone()).await
6620    }
6621    /// Retrieves an input binding by name
6622    pub fn input(&self, name: impl Into<String>) -> Binding {
6623        let mut query = self.selection.select("input");
6624        query = query.arg("name", name.into());
6625        Binding {
6626            proc: self.proc.clone(),
6627            selection: query,
6628            graphql_client: self.graphql_client.clone(),
6629        }
6630    }
6631    /// Returns all input bindings provided to the environment
6632    pub fn inputs(&self) -> Vec<Binding> {
6633        let query = self.selection.select("inputs");
6634        vec![Binding {
6635            proc: self.proc.clone(),
6636            selection: query,
6637            graphql_client: self.graphql_client.clone(),
6638        }]
6639    }
6640    /// Retrieves an output binding by name
6641    pub fn output(&self, name: impl Into<String>) -> Binding {
6642        let mut query = self.selection.select("output");
6643        query = query.arg("name", name.into());
6644        Binding {
6645            proc: self.proc.clone(),
6646            selection: query,
6647            graphql_client: self.graphql_client.clone(),
6648        }
6649    }
6650    /// Returns all declared output bindings for the environment
6651    pub fn outputs(&self) -> Vec<Binding> {
6652        let query = self.selection.select("outputs");
6653        vec![Binding {
6654            proc: self.proc.clone(),
6655            selection: query,
6656            graphql_client: self.graphql_client.clone(),
6657        }]
6658    }
6659    /// Create or update a binding of type Address in the environment
6660    ///
6661    /// # Arguments
6662    ///
6663    /// * `name` - The name of the binding
6664    /// * `value` - The Address value to assign to the binding
6665    /// * `description` - The purpose of the input
6666    pub fn with_address_input(
6667        &self,
6668        name: impl Into<String>,
6669        value: impl IntoID<AddressId>,
6670        description: impl Into<String>,
6671    ) -> Env {
6672        let mut query = self.selection.select("withAddressInput");
6673        query = query.arg("name", name.into());
6674        query = query.arg_lazy(
6675            "value",
6676            Box::new(move || {
6677                let value = value.clone();
6678                Box::pin(async move { value.into_id().await.unwrap().quote() })
6679            }),
6680        );
6681        query = query.arg("description", description.into());
6682        Env {
6683            proc: self.proc.clone(),
6684            selection: query,
6685            graphql_client: self.graphql_client.clone(),
6686        }
6687    }
6688    /// Declare a desired Address output to be assigned in the environment
6689    ///
6690    /// # Arguments
6691    ///
6692    /// * `name` - The name of the binding
6693    /// * `description` - A description of the desired value of the binding
6694    pub fn with_address_output(
6695        &self,
6696        name: impl Into<String>,
6697        description: impl Into<String>,
6698    ) -> Env {
6699        let mut query = self.selection.select("withAddressOutput");
6700        query = query.arg("name", name.into());
6701        query = query.arg("description", description.into());
6702        Env {
6703            proc: self.proc.clone(),
6704            selection: query,
6705            graphql_client: self.graphql_client.clone(),
6706        }
6707    }
6708    /// Create or update a binding of type CacheVolume in the environment
6709    ///
6710    /// # Arguments
6711    ///
6712    /// * `name` - The name of the binding
6713    /// * `value` - The CacheVolume value to assign to the binding
6714    /// * `description` - The purpose of the input
6715    pub fn with_cache_volume_input(
6716        &self,
6717        name: impl Into<String>,
6718        value: impl IntoID<CacheVolumeId>,
6719        description: impl Into<String>,
6720    ) -> Env {
6721        let mut query = self.selection.select("withCacheVolumeInput");
6722        query = query.arg("name", name.into());
6723        query = query.arg_lazy(
6724            "value",
6725            Box::new(move || {
6726                let value = value.clone();
6727                Box::pin(async move { value.into_id().await.unwrap().quote() })
6728            }),
6729        );
6730        query = query.arg("description", description.into());
6731        Env {
6732            proc: self.proc.clone(),
6733            selection: query,
6734            graphql_client: self.graphql_client.clone(),
6735        }
6736    }
6737    /// Declare a desired CacheVolume output to be assigned in the environment
6738    ///
6739    /// # Arguments
6740    ///
6741    /// * `name` - The name of the binding
6742    /// * `description` - A description of the desired value of the binding
6743    pub fn with_cache_volume_output(
6744        &self,
6745        name: impl Into<String>,
6746        description: impl Into<String>,
6747    ) -> Env {
6748        let mut query = self.selection.select("withCacheVolumeOutput");
6749        query = query.arg("name", name.into());
6750        query = query.arg("description", description.into());
6751        Env {
6752            proc: self.proc.clone(),
6753            selection: query,
6754            graphql_client: self.graphql_client.clone(),
6755        }
6756    }
6757    /// Create or update a binding of type Changeset in the environment
6758    ///
6759    /// # Arguments
6760    ///
6761    /// * `name` - The name of the binding
6762    /// * `value` - The Changeset value to assign to the binding
6763    /// * `description` - The purpose of the input
6764    pub fn with_changeset_input(
6765        &self,
6766        name: impl Into<String>,
6767        value: impl IntoID<ChangesetId>,
6768        description: impl Into<String>,
6769    ) -> Env {
6770        let mut query = self.selection.select("withChangesetInput");
6771        query = query.arg("name", name.into());
6772        query = query.arg_lazy(
6773            "value",
6774            Box::new(move || {
6775                let value = value.clone();
6776                Box::pin(async move { value.into_id().await.unwrap().quote() })
6777            }),
6778        );
6779        query = query.arg("description", description.into());
6780        Env {
6781            proc: self.proc.clone(),
6782            selection: query,
6783            graphql_client: self.graphql_client.clone(),
6784        }
6785    }
6786    /// Declare a desired Changeset output to be assigned in the environment
6787    ///
6788    /// # Arguments
6789    ///
6790    /// * `name` - The name of the binding
6791    /// * `description` - A description of the desired value of the binding
6792    pub fn with_changeset_output(
6793        &self,
6794        name: impl Into<String>,
6795        description: impl Into<String>,
6796    ) -> Env {
6797        let mut query = self.selection.select("withChangesetOutput");
6798        query = query.arg("name", name.into());
6799        query = query.arg("description", description.into());
6800        Env {
6801            proc: self.proc.clone(),
6802            selection: query,
6803            graphql_client: self.graphql_client.clone(),
6804        }
6805    }
6806    /// Create or update a binding of type CheckGroup in the environment
6807    ///
6808    /// # Arguments
6809    ///
6810    /// * `name` - The name of the binding
6811    /// * `value` - The CheckGroup value to assign to the binding
6812    /// * `description` - The purpose of the input
6813    pub fn with_check_group_input(
6814        &self,
6815        name: impl Into<String>,
6816        value: impl IntoID<CheckGroupId>,
6817        description: impl Into<String>,
6818    ) -> Env {
6819        let mut query = self.selection.select("withCheckGroupInput");
6820        query = query.arg("name", name.into());
6821        query = query.arg_lazy(
6822            "value",
6823            Box::new(move || {
6824                let value = value.clone();
6825                Box::pin(async move { value.into_id().await.unwrap().quote() })
6826            }),
6827        );
6828        query = query.arg("description", description.into());
6829        Env {
6830            proc: self.proc.clone(),
6831            selection: query,
6832            graphql_client: self.graphql_client.clone(),
6833        }
6834    }
6835    /// Declare a desired CheckGroup output to be assigned in the environment
6836    ///
6837    /// # Arguments
6838    ///
6839    /// * `name` - The name of the binding
6840    /// * `description` - A description of the desired value of the binding
6841    pub fn with_check_group_output(
6842        &self,
6843        name: impl Into<String>,
6844        description: impl Into<String>,
6845    ) -> Env {
6846        let mut query = self.selection.select("withCheckGroupOutput");
6847        query = query.arg("name", name.into());
6848        query = query.arg("description", description.into());
6849        Env {
6850            proc: self.proc.clone(),
6851            selection: query,
6852            graphql_client: self.graphql_client.clone(),
6853        }
6854    }
6855    /// Create or update a binding of type Check in the environment
6856    ///
6857    /// # Arguments
6858    ///
6859    /// * `name` - The name of the binding
6860    /// * `value` - The Check value to assign to the binding
6861    /// * `description` - The purpose of the input
6862    pub fn with_check_input(
6863        &self,
6864        name: impl Into<String>,
6865        value: impl IntoID<CheckId>,
6866        description: impl Into<String>,
6867    ) -> Env {
6868        let mut query = self.selection.select("withCheckInput");
6869        query = query.arg("name", name.into());
6870        query = query.arg_lazy(
6871            "value",
6872            Box::new(move || {
6873                let value = value.clone();
6874                Box::pin(async move { value.into_id().await.unwrap().quote() })
6875            }),
6876        );
6877        query = query.arg("description", description.into());
6878        Env {
6879            proc: self.proc.clone(),
6880            selection: query,
6881            graphql_client: self.graphql_client.clone(),
6882        }
6883    }
6884    /// Declare a desired Check output to be assigned in the environment
6885    ///
6886    /// # Arguments
6887    ///
6888    /// * `name` - The name of the binding
6889    /// * `description` - A description of the desired value of the binding
6890    pub fn with_check_output(
6891        &self,
6892        name: impl Into<String>,
6893        description: impl Into<String>,
6894    ) -> Env {
6895        let mut query = self.selection.select("withCheckOutput");
6896        query = query.arg("name", name.into());
6897        query = query.arg("description", description.into());
6898        Env {
6899            proc: self.proc.clone(),
6900            selection: query,
6901            graphql_client: self.graphql_client.clone(),
6902        }
6903    }
6904    /// Create or update a binding of type Cloud in the environment
6905    ///
6906    /// # Arguments
6907    ///
6908    /// * `name` - The name of the binding
6909    /// * `value` - The Cloud value to assign to the binding
6910    /// * `description` - The purpose of the input
6911    pub fn with_cloud_input(
6912        &self,
6913        name: impl Into<String>,
6914        value: impl IntoID<CloudId>,
6915        description: impl Into<String>,
6916    ) -> Env {
6917        let mut query = self.selection.select("withCloudInput");
6918        query = query.arg("name", name.into());
6919        query = query.arg_lazy(
6920            "value",
6921            Box::new(move || {
6922                let value = value.clone();
6923                Box::pin(async move { value.into_id().await.unwrap().quote() })
6924            }),
6925        );
6926        query = query.arg("description", description.into());
6927        Env {
6928            proc: self.proc.clone(),
6929            selection: query,
6930            graphql_client: self.graphql_client.clone(),
6931        }
6932    }
6933    /// Declare a desired Cloud output to be assigned in the environment
6934    ///
6935    /// # Arguments
6936    ///
6937    /// * `name` - The name of the binding
6938    /// * `description` - A description of the desired value of the binding
6939    pub fn with_cloud_output(
6940        &self,
6941        name: impl Into<String>,
6942        description: impl Into<String>,
6943    ) -> Env {
6944        let mut query = self.selection.select("withCloudOutput");
6945        query = query.arg("name", name.into());
6946        query = query.arg("description", description.into());
6947        Env {
6948            proc: self.proc.clone(),
6949            selection: query,
6950            graphql_client: self.graphql_client.clone(),
6951        }
6952    }
6953    /// Create or update a binding of type Container in the environment
6954    ///
6955    /// # Arguments
6956    ///
6957    /// * `name` - The name of the binding
6958    /// * `value` - The Container value to assign to the binding
6959    /// * `description` - The purpose of the input
6960    pub fn with_container_input(
6961        &self,
6962        name: impl Into<String>,
6963        value: impl IntoID<ContainerId>,
6964        description: impl Into<String>,
6965    ) -> Env {
6966        let mut query = self.selection.select("withContainerInput");
6967        query = query.arg("name", name.into());
6968        query = query.arg_lazy(
6969            "value",
6970            Box::new(move || {
6971                let value = value.clone();
6972                Box::pin(async move { value.into_id().await.unwrap().quote() })
6973            }),
6974        );
6975        query = query.arg("description", description.into());
6976        Env {
6977            proc: self.proc.clone(),
6978            selection: query,
6979            graphql_client: self.graphql_client.clone(),
6980        }
6981    }
6982    /// Declare a desired Container output to be assigned in the environment
6983    ///
6984    /// # Arguments
6985    ///
6986    /// * `name` - The name of the binding
6987    /// * `description` - A description of the desired value of the binding
6988    pub fn with_container_output(
6989        &self,
6990        name: impl Into<String>,
6991        description: impl Into<String>,
6992    ) -> Env {
6993        let mut query = self.selection.select("withContainerOutput");
6994        query = query.arg("name", name.into());
6995        query = query.arg("description", description.into());
6996        Env {
6997            proc: self.proc.clone(),
6998            selection: query,
6999            graphql_client: self.graphql_client.clone(),
7000        }
7001    }
7002    /// Installs the current module into the environment, exposing its functions to the model
7003    /// Contextual path arguments will be populated using the environment's workspace.
7004    pub fn with_current_module(&self) -> Env {
7005        let query = self.selection.select("withCurrentModule");
7006        Env {
7007            proc: self.proc.clone(),
7008            selection: query,
7009            graphql_client: self.graphql_client.clone(),
7010        }
7011    }
7012    /// Create or update a binding of type Directory in the environment
7013    ///
7014    /// # Arguments
7015    ///
7016    /// * `name` - The name of the binding
7017    /// * `value` - The Directory value to assign to the binding
7018    /// * `description` - The purpose of the input
7019    pub fn with_directory_input(
7020        &self,
7021        name: impl Into<String>,
7022        value: impl IntoID<DirectoryId>,
7023        description: impl Into<String>,
7024    ) -> Env {
7025        let mut query = self.selection.select("withDirectoryInput");
7026        query = query.arg("name", name.into());
7027        query = query.arg_lazy(
7028            "value",
7029            Box::new(move || {
7030                let value = value.clone();
7031                Box::pin(async move { value.into_id().await.unwrap().quote() })
7032            }),
7033        );
7034        query = query.arg("description", description.into());
7035        Env {
7036            proc: self.proc.clone(),
7037            selection: query,
7038            graphql_client: self.graphql_client.clone(),
7039        }
7040    }
7041    /// Declare a desired Directory output to be assigned in the environment
7042    ///
7043    /// # Arguments
7044    ///
7045    /// * `name` - The name of the binding
7046    /// * `description` - A description of the desired value of the binding
7047    pub fn with_directory_output(
7048        &self,
7049        name: impl Into<String>,
7050        description: impl Into<String>,
7051    ) -> Env {
7052        let mut query = self.selection.select("withDirectoryOutput");
7053        query = query.arg("name", name.into());
7054        query = query.arg("description", description.into());
7055        Env {
7056            proc: self.proc.clone(),
7057            selection: query,
7058            graphql_client: self.graphql_client.clone(),
7059        }
7060    }
7061    /// Create or update a binding of type EnvFile in the environment
7062    ///
7063    /// # Arguments
7064    ///
7065    /// * `name` - The name of the binding
7066    /// * `value` - The EnvFile value to assign to the binding
7067    /// * `description` - The purpose of the input
7068    pub fn with_env_file_input(
7069        &self,
7070        name: impl Into<String>,
7071        value: impl IntoID<EnvFileId>,
7072        description: impl Into<String>,
7073    ) -> Env {
7074        let mut query = self.selection.select("withEnvFileInput");
7075        query = query.arg("name", name.into());
7076        query = query.arg_lazy(
7077            "value",
7078            Box::new(move || {
7079                let value = value.clone();
7080                Box::pin(async move { value.into_id().await.unwrap().quote() })
7081            }),
7082        );
7083        query = query.arg("description", description.into());
7084        Env {
7085            proc: self.proc.clone(),
7086            selection: query,
7087            graphql_client: self.graphql_client.clone(),
7088        }
7089    }
7090    /// Declare a desired EnvFile output to be assigned in the environment
7091    ///
7092    /// # Arguments
7093    ///
7094    /// * `name` - The name of the binding
7095    /// * `description` - A description of the desired value of the binding
7096    pub fn with_env_file_output(
7097        &self,
7098        name: impl Into<String>,
7099        description: impl Into<String>,
7100    ) -> Env {
7101        let mut query = self.selection.select("withEnvFileOutput");
7102        query = query.arg("name", name.into());
7103        query = query.arg("description", description.into());
7104        Env {
7105            proc: self.proc.clone(),
7106            selection: query,
7107            graphql_client: self.graphql_client.clone(),
7108        }
7109    }
7110    /// Create or update a binding of type Env in the environment
7111    ///
7112    /// # Arguments
7113    ///
7114    /// * `name` - The name of the binding
7115    /// * `value` - The Env value to assign to the binding
7116    /// * `description` - The purpose of the input
7117    pub fn with_env_input(
7118        &self,
7119        name: impl Into<String>,
7120        value: impl IntoID<EnvId>,
7121        description: impl Into<String>,
7122    ) -> Env {
7123        let mut query = self.selection.select("withEnvInput");
7124        query = query.arg("name", name.into());
7125        query = query.arg_lazy(
7126            "value",
7127            Box::new(move || {
7128                let value = value.clone();
7129                Box::pin(async move { value.into_id().await.unwrap().quote() })
7130            }),
7131        );
7132        query = query.arg("description", description.into());
7133        Env {
7134            proc: self.proc.clone(),
7135            selection: query,
7136            graphql_client: self.graphql_client.clone(),
7137        }
7138    }
7139    /// Declare a desired Env output to be assigned in the environment
7140    ///
7141    /// # Arguments
7142    ///
7143    /// * `name` - The name of the binding
7144    /// * `description` - A description of the desired value of the binding
7145    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7146        let mut query = self.selection.select("withEnvOutput");
7147        query = query.arg("name", name.into());
7148        query = query.arg("description", description.into());
7149        Env {
7150            proc: self.proc.clone(),
7151            selection: query,
7152            graphql_client: self.graphql_client.clone(),
7153        }
7154    }
7155    /// Create or update a binding of type File in the environment
7156    ///
7157    /// # Arguments
7158    ///
7159    /// * `name` - The name of the binding
7160    /// * `value` - The File value to assign to the binding
7161    /// * `description` - The purpose of the input
7162    pub fn with_file_input(
7163        &self,
7164        name: impl Into<String>,
7165        value: impl IntoID<FileId>,
7166        description: impl Into<String>,
7167    ) -> Env {
7168        let mut query = self.selection.select("withFileInput");
7169        query = query.arg("name", name.into());
7170        query = query.arg_lazy(
7171            "value",
7172            Box::new(move || {
7173                let value = value.clone();
7174                Box::pin(async move { value.into_id().await.unwrap().quote() })
7175            }),
7176        );
7177        query = query.arg("description", description.into());
7178        Env {
7179            proc: self.proc.clone(),
7180            selection: query,
7181            graphql_client: self.graphql_client.clone(),
7182        }
7183    }
7184    /// Declare a desired File output to be assigned in the environment
7185    ///
7186    /// # Arguments
7187    ///
7188    /// * `name` - The name of the binding
7189    /// * `description` - A description of the desired value of the binding
7190    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7191        let mut query = self.selection.select("withFileOutput");
7192        query = query.arg("name", name.into());
7193        query = query.arg("description", description.into());
7194        Env {
7195            proc: self.proc.clone(),
7196            selection: query,
7197            graphql_client: self.graphql_client.clone(),
7198        }
7199    }
7200    /// Create or update a binding of type GitRef in the environment
7201    ///
7202    /// # Arguments
7203    ///
7204    /// * `name` - The name of the binding
7205    /// * `value` - The GitRef value to assign to the binding
7206    /// * `description` - The purpose of the input
7207    pub fn with_git_ref_input(
7208        &self,
7209        name: impl Into<String>,
7210        value: impl IntoID<GitRefId>,
7211        description: impl Into<String>,
7212    ) -> Env {
7213        let mut query = self.selection.select("withGitRefInput");
7214        query = query.arg("name", name.into());
7215        query = query.arg_lazy(
7216            "value",
7217            Box::new(move || {
7218                let value = value.clone();
7219                Box::pin(async move { value.into_id().await.unwrap().quote() })
7220            }),
7221        );
7222        query = query.arg("description", description.into());
7223        Env {
7224            proc: self.proc.clone(),
7225            selection: query,
7226            graphql_client: self.graphql_client.clone(),
7227        }
7228    }
7229    /// Declare a desired GitRef output to be assigned in the environment
7230    ///
7231    /// # Arguments
7232    ///
7233    /// * `name` - The name of the binding
7234    /// * `description` - A description of the desired value of the binding
7235    pub fn with_git_ref_output(
7236        &self,
7237        name: impl Into<String>,
7238        description: impl Into<String>,
7239    ) -> Env {
7240        let mut query = self.selection.select("withGitRefOutput");
7241        query = query.arg("name", name.into());
7242        query = query.arg("description", description.into());
7243        Env {
7244            proc: self.proc.clone(),
7245            selection: query,
7246            graphql_client: self.graphql_client.clone(),
7247        }
7248    }
7249    /// Create or update a binding of type GitRepository in the environment
7250    ///
7251    /// # Arguments
7252    ///
7253    /// * `name` - The name of the binding
7254    /// * `value` - The GitRepository value to assign to the binding
7255    /// * `description` - The purpose of the input
7256    pub fn with_git_repository_input(
7257        &self,
7258        name: impl Into<String>,
7259        value: impl IntoID<GitRepositoryId>,
7260        description: impl Into<String>,
7261    ) -> Env {
7262        let mut query = self.selection.select("withGitRepositoryInput");
7263        query = query.arg("name", name.into());
7264        query = query.arg_lazy(
7265            "value",
7266            Box::new(move || {
7267                let value = value.clone();
7268                Box::pin(async move { value.into_id().await.unwrap().quote() })
7269            }),
7270        );
7271        query = query.arg("description", description.into());
7272        Env {
7273            proc: self.proc.clone(),
7274            selection: query,
7275            graphql_client: self.graphql_client.clone(),
7276        }
7277    }
7278    /// Declare a desired GitRepository output to be assigned in the environment
7279    ///
7280    /// # Arguments
7281    ///
7282    /// * `name` - The name of the binding
7283    /// * `description` - A description of the desired value of the binding
7284    pub fn with_git_repository_output(
7285        &self,
7286        name: impl Into<String>,
7287        description: impl Into<String>,
7288    ) -> Env {
7289        let mut query = self.selection.select("withGitRepositoryOutput");
7290        query = query.arg("name", name.into());
7291        query = query.arg("description", description.into());
7292        Env {
7293            proc: self.proc.clone(),
7294            selection: query,
7295            graphql_client: self.graphql_client.clone(),
7296        }
7297    }
7298    /// Create or update a binding of type JSONValue in the environment
7299    ///
7300    /// # Arguments
7301    ///
7302    /// * `name` - The name of the binding
7303    /// * `value` - The JSONValue value to assign to the binding
7304    /// * `description` - The purpose of the input
7305    pub fn with_json_value_input(
7306        &self,
7307        name: impl Into<String>,
7308        value: impl IntoID<JsonValueId>,
7309        description: impl Into<String>,
7310    ) -> Env {
7311        let mut query = self.selection.select("withJSONValueInput");
7312        query = query.arg("name", name.into());
7313        query = query.arg_lazy(
7314            "value",
7315            Box::new(move || {
7316                let value = value.clone();
7317                Box::pin(async move { value.into_id().await.unwrap().quote() })
7318            }),
7319        );
7320        query = query.arg("description", description.into());
7321        Env {
7322            proc: self.proc.clone(),
7323            selection: query,
7324            graphql_client: self.graphql_client.clone(),
7325        }
7326    }
7327    /// Declare a desired JSONValue output to be assigned in the environment
7328    ///
7329    /// # Arguments
7330    ///
7331    /// * `name` - The name of the binding
7332    /// * `description` - A description of the desired value of the binding
7333    pub fn with_json_value_output(
7334        &self,
7335        name: impl Into<String>,
7336        description: impl Into<String>,
7337    ) -> Env {
7338        let mut query = self.selection.select("withJSONValueOutput");
7339        query = query.arg("name", name.into());
7340        query = query.arg("description", description.into());
7341        Env {
7342            proc: self.proc.clone(),
7343            selection: query,
7344            graphql_client: self.graphql_client.clone(),
7345        }
7346    }
7347    /// Installs a module into the environment, exposing its functions to the model
7348    /// Contextual path arguments will be populated using the environment's workspace.
7349    pub fn with_module(&self, module: impl IntoID<ModuleId>) -> Env {
7350        let mut query = self.selection.select("withModule");
7351        query = query.arg_lazy(
7352            "module",
7353            Box::new(move || {
7354                let module = module.clone();
7355                Box::pin(async move { module.into_id().await.unwrap().quote() })
7356            }),
7357        );
7358        Env {
7359            proc: self.proc.clone(),
7360            selection: query,
7361            graphql_client: self.graphql_client.clone(),
7362        }
7363    }
7364    /// Create or update a binding of type ModuleConfigClient in the environment
7365    ///
7366    /// # Arguments
7367    ///
7368    /// * `name` - The name of the binding
7369    /// * `value` - The ModuleConfigClient value to assign to the binding
7370    /// * `description` - The purpose of the input
7371    pub fn with_module_config_client_input(
7372        &self,
7373        name: impl Into<String>,
7374        value: impl IntoID<ModuleConfigClientId>,
7375        description: impl Into<String>,
7376    ) -> Env {
7377        let mut query = self.selection.select("withModuleConfigClientInput");
7378        query = query.arg("name", name.into());
7379        query = query.arg_lazy(
7380            "value",
7381            Box::new(move || {
7382                let value = value.clone();
7383                Box::pin(async move { value.into_id().await.unwrap().quote() })
7384            }),
7385        );
7386        query = query.arg("description", description.into());
7387        Env {
7388            proc: self.proc.clone(),
7389            selection: query,
7390            graphql_client: self.graphql_client.clone(),
7391        }
7392    }
7393    /// Declare a desired ModuleConfigClient output to be assigned in the environment
7394    ///
7395    /// # Arguments
7396    ///
7397    /// * `name` - The name of the binding
7398    /// * `description` - A description of the desired value of the binding
7399    pub fn with_module_config_client_output(
7400        &self,
7401        name: impl Into<String>,
7402        description: impl Into<String>,
7403    ) -> Env {
7404        let mut query = self.selection.select("withModuleConfigClientOutput");
7405        query = query.arg("name", name.into());
7406        query = query.arg("description", description.into());
7407        Env {
7408            proc: self.proc.clone(),
7409            selection: query,
7410            graphql_client: self.graphql_client.clone(),
7411        }
7412    }
7413    /// Create or update a binding of type Module in the environment
7414    ///
7415    /// # Arguments
7416    ///
7417    /// * `name` - The name of the binding
7418    /// * `value` - The Module value to assign to the binding
7419    /// * `description` - The purpose of the input
7420    pub fn with_module_input(
7421        &self,
7422        name: impl Into<String>,
7423        value: impl IntoID<ModuleId>,
7424        description: impl Into<String>,
7425    ) -> Env {
7426        let mut query = self.selection.select("withModuleInput");
7427        query = query.arg("name", name.into());
7428        query = query.arg_lazy(
7429            "value",
7430            Box::new(move || {
7431                let value = value.clone();
7432                Box::pin(async move { value.into_id().await.unwrap().quote() })
7433            }),
7434        );
7435        query = query.arg("description", description.into());
7436        Env {
7437            proc: self.proc.clone(),
7438            selection: query,
7439            graphql_client: self.graphql_client.clone(),
7440        }
7441    }
7442    /// Declare a desired Module output to be assigned in the environment
7443    ///
7444    /// # Arguments
7445    ///
7446    /// * `name` - The name of the binding
7447    /// * `description` - A description of the desired value of the binding
7448    pub fn with_module_output(
7449        &self,
7450        name: impl Into<String>,
7451        description: impl Into<String>,
7452    ) -> Env {
7453        let mut query = self.selection.select("withModuleOutput");
7454        query = query.arg("name", name.into());
7455        query = query.arg("description", description.into());
7456        Env {
7457            proc: self.proc.clone(),
7458            selection: query,
7459            graphql_client: self.graphql_client.clone(),
7460        }
7461    }
7462    /// Create or update a binding of type ModuleSource in the environment
7463    ///
7464    /// # Arguments
7465    ///
7466    /// * `name` - The name of the binding
7467    /// * `value` - The ModuleSource value to assign to the binding
7468    /// * `description` - The purpose of the input
7469    pub fn with_module_source_input(
7470        &self,
7471        name: impl Into<String>,
7472        value: impl IntoID<ModuleSourceId>,
7473        description: impl Into<String>,
7474    ) -> Env {
7475        let mut query = self.selection.select("withModuleSourceInput");
7476        query = query.arg("name", name.into());
7477        query = query.arg_lazy(
7478            "value",
7479            Box::new(move || {
7480                let value = value.clone();
7481                Box::pin(async move { value.into_id().await.unwrap().quote() })
7482            }),
7483        );
7484        query = query.arg("description", description.into());
7485        Env {
7486            proc: self.proc.clone(),
7487            selection: query,
7488            graphql_client: self.graphql_client.clone(),
7489        }
7490    }
7491    /// Declare a desired ModuleSource output to be assigned in the environment
7492    ///
7493    /// # Arguments
7494    ///
7495    /// * `name` - The name of the binding
7496    /// * `description` - A description of the desired value of the binding
7497    pub fn with_module_source_output(
7498        &self,
7499        name: impl Into<String>,
7500        description: impl Into<String>,
7501    ) -> Env {
7502        let mut query = self.selection.select("withModuleSourceOutput");
7503        query = query.arg("name", name.into());
7504        query = query.arg("description", description.into());
7505        Env {
7506            proc: self.proc.clone(),
7507            selection: query,
7508            graphql_client: self.graphql_client.clone(),
7509        }
7510    }
7511    /// Create or update a binding of type SearchResult in the environment
7512    ///
7513    /// # Arguments
7514    ///
7515    /// * `name` - The name of the binding
7516    /// * `value` - The SearchResult value to assign to the binding
7517    /// * `description` - The purpose of the input
7518    pub fn with_search_result_input(
7519        &self,
7520        name: impl Into<String>,
7521        value: impl IntoID<SearchResultId>,
7522        description: impl Into<String>,
7523    ) -> Env {
7524        let mut query = self.selection.select("withSearchResultInput");
7525        query = query.arg("name", name.into());
7526        query = query.arg_lazy(
7527            "value",
7528            Box::new(move || {
7529                let value = value.clone();
7530                Box::pin(async move { value.into_id().await.unwrap().quote() })
7531            }),
7532        );
7533        query = query.arg("description", description.into());
7534        Env {
7535            proc: self.proc.clone(),
7536            selection: query,
7537            graphql_client: self.graphql_client.clone(),
7538        }
7539    }
7540    /// Declare a desired SearchResult output to be assigned in the environment
7541    ///
7542    /// # Arguments
7543    ///
7544    /// * `name` - The name of the binding
7545    /// * `description` - A description of the desired value of the binding
7546    pub fn with_search_result_output(
7547        &self,
7548        name: impl Into<String>,
7549        description: impl Into<String>,
7550    ) -> Env {
7551        let mut query = self.selection.select("withSearchResultOutput");
7552        query = query.arg("name", name.into());
7553        query = query.arg("description", description.into());
7554        Env {
7555            proc: self.proc.clone(),
7556            selection: query,
7557            graphql_client: self.graphql_client.clone(),
7558        }
7559    }
7560    /// Create or update a binding of type SearchSubmatch in the environment
7561    ///
7562    /// # Arguments
7563    ///
7564    /// * `name` - The name of the binding
7565    /// * `value` - The SearchSubmatch value to assign to the binding
7566    /// * `description` - The purpose of the input
7567    pub fn with_search_submatch_input(
7568        &self,
7569        name: impl Into<String>,
7570        value: impl IntoID<SearchSubmatchId>,
7571        description: impl Into<String>,
7572    ) -> Env {
7573        let mut query = self.selection.select("withSearchSubmatchInput");
7574        query = query.arg("name", name.into());
7575        query = query.arg_lazy(
7576            "value",
7577            Box::new(move || {
7578                let value = value.clone();
7579                Box::pin(async move { value.into_id().await.unwrap().quote() })
7580            }),
7581        );
7582        query = query.arg("description", description.into());
7583        Env {
7584            proc: self.proc.clone(),
7585            selection: query,
7586            graphql_client: self.graphql_client.clone(),
7587        }
7588    }
7589    /// Declare a desired SearchSubmatch output to be assigned in the environment
7590    ///
7591    /// # Arguments
7592    ///
7593    /// * `name` - The name of the binding
7594    /// * `description` - A description of the desired value of the binding
7595    pub fn with_search_submatch_output(
7596        &self,
7597        name: impl Into<String>,
7598        description: impl Into<String>,
7599    ) -> Env {
7600        let mut query = self.selection.select("withSearchSubmatchOutput");
7601        query = query.arg("name", name.into());
7602        query = query.arg("description", description.into());
7603        Env {
7604            proc: self.proc.clone(),
7605            selection: query,
7606            graphql_client: self.graphql_client.clone(),
7607        }
7608    }
7609    /// Create or update a binding of type Secret in the environment
7610    ///
7611    /// # Arguments
7612    ///
7613    /// * `name` - The name of the binding
7614    /// * `value` - The Secret value to assign to the binding
7615    /// * `description` - The purpose of the input
7616    pub fn with_secret_input(
7617        &self,
7618        name: impl Into<String>,
7619        value: impl IntoID<SecretId>,
7620        description: impl Into<String>,
7621    ) -> Env {
7622        let mut query = self.selection.select("withSecretInput");
7623        query = query.arg("name", name.into());
7624        query = query.arg_lazy(
7625            "value",
7626            Box::new(move || {
7627                let value = value.clone();
7628                Box::pin(async move { value.into_id().await.unwrap().quote() })
7629            }),
7630        );
7631        query = query.arg("description", description.into());
7632        Env {
7633            proc: self.proc.clone(),
7634            selection: query,
7635            graphql_client: self.graphql_client.clone(),
7636        }
7637    }
7638    /// Declare a desired Secret output to be assigned in the environment
7639    ///
7640    /// # Arguments
7641    ///
7642    /// * `name` - The name of the binding
7643    /// * `description` - A description of the desired value of the binding
7644    pub fn with_secret_output(
7645        &self,
7646        name: impl Into<String>,
7647        description: impl Into<String>,
7648    ) -> Env {
7649        let mut query = self.selection.select("withSecretOutput");
7650        query = query.arg("name", name.into());
7651        query = query.arg("description", description.into());
7652        Env {
7653            proc: self.proc.clone(),
7654            selection: query,
7655            graphql_client: self.graphql_client.clone(),
7656        }
7657    }
7658    /// Create or update a binding of type Service in the environment
7659    ///
7660    /// # Arguments
7661    ///
7662    /// * `name` - The name of the binding
7663    /// * `value` - The Service value to assign to the binding
7664    /// * `description` - The purpose of the input
7665    pub fn with_service_input(
7666        &self,
7667        name: impl Into<String>,
7668        value: impl IntoID<ServiceId>,
7669        description: impl Into<String>,
7670    ) -> Env {
7671        let mut query = self.selection.select("withServiceInput");
7672        query = query.arg("name", name.into());
7673        query = query.arg_lazy(
7674            "value",
7675            Box::new(move || {
7676                let value = value.clone();
7677                Box::pin(async move { value.into_id().await.unwrap().quote() })
7678            }),
7679        );
7680        query = query.arg("description", description.into());
7681        Env {
7682            proc: self.proc.clone(),
7683            selection: query,
7684            graphql_client: self.graphql_client.clone(),
7685        }
7686    }
7687    /// Declare a desired Service output to be assigned in the environment
7688    ///
7689    /// # Arguments
7690    ///
7691    /// * `name` - The name of the binding
7692    /// * `description` - A description of the desired value of the binding
7693    pub fn with_service_output(
7694        &self,
7695        name: impl Into<String>,
7696        description: impl Into<String>,
7697    ) -> Env {
7698        let mut query = self.selection.select("withServiceOutput");
7699        query = query.arg("name", name.into());
7700        query = query.arg("description", description.into());
7701        Env {
7702            proc: self.proc.clone(),
7703            selection: query,
7704            graphql_client: self.graphql_client.clone(),
7705        }
7706    }
7707    /// Create or update a binding of type Socket in the environment
7708    ///
7709    /// # Arguments
7710    ///
7711    /// * `name` - The name of the binding
7712    /// * `value` - The Socket value to assign to the binding
7713    /// * `description` - The purpose of the input
7714    pub fn with_socket_input(
7715        &self,
7716        name: impl Into<String>,
7717        value: impl IntoID<SocketId>,
7718        description: impl Into<String>,
7719    ) -> Env {
7720        let mut query = self.selection.select("withSocketInput");
7721        query = query.arg("name", name.into());
7722        query = query.arg_lazy(
7723            "value",
7724            Box::new(move || {
7725                let value = value.clone();
7726                Box::pin(async move { value.into_id().await.unwrap().quote() })
7727            }),
7728        );
7729        query = query.arg("description", description.into());
7730        Env {
7731            proc: self.proc.clone(),
7732            selection: query,
7733            graphql_client: self.graphql_client.clone(),
7734        }
7735    }
7736    /// Declare a desired Socket output to be assigned in the environment
7737    ///
7738    /// # Arguments
7739    ///
7740    /// * `name` - The name of the binding
7741    /// * `description` - A description of the desired value of the binding
7742    pub fn with_socket_output(
7743        &self,
7744        name: impl Into<String>,
7745        description: impl Into<String>,
7746    ) -> Env {
7747        let mut query = self.selection.select("withSocketOutput");
7748        query = query.arg("name", name.into());
7749        query = query.arg("description", description.into());
7750        Env {
7751            proc: self.proc.clone(),
7752            selection: query,
7753            graphql_client: self.graphql_client.clone(),
7754        }
7755    }
7756    /// Create or update a binding of type Stat in the environment
7757    ///
7758    /// # Arguments
7759    ///
7760    /// * `name` - The name of the binding
7761    /// * `value` - The Stat value to assign to the binding
7762    /// * `description` - The purpose of the input
7763    pub fn with_stat_input(
7764        &self,
7765        name: impl Into<String>,
7766        value: impl IntoID<StatId>,
7767        description: impl Into<String>,
7768    ) -> Env {
7769        let mut query = self.selection.select("withStatInput");
7770        query = query.arg("name", name.into());
7771        query = query.arg_lazy(
7772            "value",
7773            Box::new(move || {
7774                let value = value.clone();
7775                Box::pin(async move { value.into_id().await.unwrap().quote() })
7776            }),
7777        );
7778        query = query.arg("description", description.into());
7779        Env {
7780            proc: self.proc.clone(),
7781            selection: query,
7782            graphql_client: self.graphql_client.clone(),
7783        }
7784    }
7785    /// Declare a desired Stat output to be assigned in the environment
7786    ///
7787    /// # Arguments
7788    ///
7789    /// * `name` - The name of the binding
7790    /// * `description` - A description of the desired value of the binding
7791    pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7792        let mut query = self.selection.select("withStatOutput");
7793        query = query.arg("name", name.into());
7794        query = query.arg("description", description.into());
7795        Env {
7796            proc: self.proc.clone(),
7797            selection: query,
7798            graphql_client: self.graphql_client.clone(),
7799        }
7800    }
7801    /// Provides a string input binding to the environment
7802    ///
7803    /// # Arguments
7804    ///
7805    /// * `name` - The name of the binding
7806    /// * `value` - The string value to assign to the binding
7807    /// * `description` - The description of the input
7808    pub fn with_string_input(
7809        &self,
7810        name: impl Into<String>,
7811        value: impl Into<String>,
7812        description: impl Into<String>,
7813    ) -> Env {
7814        let mut query = self.selection.select("withStringInput");
7815        query = query.arg("name", name.into());
7816        query = query.arg("value", value.into());
7817        query = query.arg("description", description.into());
7818        Env {
7819            proc: self.proc.clone(),
7820            selection: query,
7821            graphql_client: self.graphql_client.clone(),
7822        }
7823    }
7824    /// Declares a desired string output binding
7825    ///
7826    /// # Arguments
7827    ///
7828    /// * `name` - The name of the binding
7829    /// * `description` - The description of the output
7830    pub fn with_string_output(
7831        &self,
7832        name: impl Into<String>,
7833        description: impl Into<String>,
7834    ) -> Env {
7835        let mut query = self.selection.select("withStringOutput");
7836        query = query.arg("name", name.into());
7837        query = query.arg("description", description.into());
7838        Env {
7839            proc: self.proc.clone(),
7840            selection: query,
7841            graphql_client: self.graphql_client.clone(),
7842        }
7843    }
7844    /// Returns a new environment with the provided workspace
7845    ///
7846    /// # Arguments
7847    ///
7848    /// * `workspace` - The directory to set as the host filesystem
7849    pub fn with_workspace(&self, workspace: impl IntoID<DirectoryId>) -> Env {
7850        let mut query = self.selection.select("withWorkspace");
7851        query = query.arg_lazy(
7852            "workspace",
7853            Box::new(move || {
7854                let workspace = workspace.clone();
7855                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
7856            }),
7857        );
7858        Env {
7859            proc: self.proc.clone(),
7860            selection: query,
7861            graphql_client: self.graphql_client.clone(),
7862        }
7863    }
7864    /// Returns a new environment without any outputs
7865    pub fn without_outputs(&self) -> Env {
7866        let query = self.selection.select("withoutOutputs");
7867        Env {
7868            proc: self.proc.clone(),
7869            selection: query,
7870            graphql_client: self.graphql_client.clone(),
7871        }
7872    }
7873    pub fn workspace(&self) -> Directory {
7874        let query = self.selection.select("workspace");
7875        Directory {
7876            proc: self.proc.clone(),
7877            selection: query,
7878            graphql_client: self.graphql_client.clone(),
7879        }
7880    }
7881}
7882#[derive(Clone)]
7883pub struct EnvFile {
7884    pub proc: Option<Arc<DaggerSessionProc>>,
7885    pub selection: Selection,
7886    pub graphql_client: DynGraphQLClient,
7887}
7888#[derive(Builder, Debug, PartialEq)]
7889pub struct EnvFileGetOpts {
7890    /// Return the value exactly as written to the file. No quote removal or variable expansion
7891    #[builder(setter(into, strip_option), default)]
7892    pub raw: Option<bool>,
7893}
7894#[derive(Builder, Debug, PartialEq)]
7895pub struct EnvFileVariablesOpts {
7896    /// Return values exactly as written to the file. No quote removal or variable expansion
7897    #[builder(setter(into, strip_option), default)]
7898    pub raw: Option<bool>,
7899}
7900impl EnvFile {
7901    /// Return as a file
7902    pub fn as_file(&self) -> File {
7903        let query = self.selection.select("asFile");
7904        File {
7905            proc: self.proc.clone(),
7906            selection: query,
7907            graphql_client: self.graphql_client.clone(),
7908        }
7909    }
7910    /// Check if a variable exists
7911    ///
7912    /// # Arguments
7913    ///
7914    /// * `name` - Variable name
7915    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
7916        let mut query = self.selection.select("exists");
7917        query = query.arg("name", name.into());
7918        query.execute(self.graphql_client.clone()).await
7919    }
7920    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
7921    ///
7922    /// # Arguments
7923    ///
7924    /// * `name` - Variable name
7925    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7926    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
7927        let mut query = self.selection.select("get");
7928        query = query.arg("name", name.into());
7929        query.execute(self.graphql_client.clone()).await
7930    }
7931    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
7932    ///
7933    /// # Arguments
7934    ///
7935    /// * `name` - Variable name
7936    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7937    pub async fn get_opts(
7938        &self,
7939        name: impl Into<String>,
7940        opts: EnvFileGetOpts,
7941    ) -> Result<String, DaggerError> {
7942        let mut query = self.selection.select("get");
7943        query = query.arg("name", name.into());
7944        if let Some(raw) = opts.raw {
7945            query = query.arg("raw", raw);
7946        }
7947        query.execute(self.graphql_client.clone()).await
7948    }
7949    /// A unique identifier for this EnvFile.
7950    pub async fn id(&self) -> Result<EnvFileId, DaggerError> {
7951        let query = self.selection.select("id");
7952        query.execute(self.graphql_client.clone()).await
7953    }
7954    /// 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
7955    ///
7956    /// # Arguments
7957    ///
7958    /// * `prefix` - The prefix to filter by
7959    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
7960        let mut query = self.selection.select("namespace");
7961        query = query.arg("prefix", prefix.into());
7962        EnvFile {
7963            proc: self.proc.clone(),
7964            selection: query,
7965            graphql_client: self.graphql_client.clone(),
7966        }
7967    }
7968    /// Return all variables
7969    ///
7970    /// # Arguments
7971    ///
7972    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7973    pub fn variables(&self) -> Vec<EnvVariable> {
7974        let query = self.selection.select("variables");
7975        vec![EnvVariable {
7976            proc: self.proc.clone(),
7977            selection: query,
7978            graphql_client: self.graphql_client.clone(),
7979        }]
7980    }
7981    /// Return all variables
7982    ///
7983    /// # Arguments
7984    ///
7985    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7986    pub fn variables_opts(&self, opts: EnvFileVariablesOpts) -> Vec<EnvVariable> {
7987        let mut query = self.selection.select("variables");
7988        if let Some(raw) = opts.raw {
7989            query = query.arg("raw", raw);
7990        }
7991        vec![EnvVariable {
7992            proc: self.proc.clone(),
7993            selection: query,
7994            graphql_client: self.graphql_client.clone(),
7995        }]
7996    }
7997    /// Add a variable
7998    ///
7999    /// # Arguments
8000    ///
8001    /// * `name` - Variable name
8002    /// * `value` - Variable value
8003    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8004        let mut query = self.selection.select("withVariable");
8005        query = query.arg("name", name.into());
8006        query = query.arg("value", value.into());
8007        EnvFile {
8008            proc: self.proc.clone(),
8009            selection: query,
8010            graphql_client: self.graphql_client.clone(),
8011        }
8012    }
8013    /// Remove all occurrences of the named variable
8014    ///
8015    /// # Arguments
8016    ///
8017    /// * `name` - Variable name
8018    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8019        let mut query = self.selection.select("withoutVariable");
8020        query = query.arg("name", name.into());
8021        EnvFile {
8022            proc: self.proc.clone(),
8023            selection: query,
8024            graphql_client: self.graphql_client.clone(),
8025        }
8026    }
8027}
8028#[derive(Clone)]
8029pub struct EnvVariable {
8030    pub proc: Option<Arc<DaggerSessionProc>>,
8031    pub selection: Selection,
8032    pub graphql_client: DynGraphQLClient,
8033}
8034impl EnvVariable {
8035    /// A unique identifier for this EnvVariable.
8036    pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
8037        let query = self.selection.select("id");
8038        query.execute(self.graphql_client.clone()).await
8039    }
8040    /// The environment variable name.
8041    pub async fn name(&self) -> Result<String, DaggerError> {
8042        let query = self.selection.select("name");
8043        query.execute(self.graphql_client.clone()).await
8044    }
8045    /// The environment variable value.
8046    pub async fn value(&self) -> Result<String, DaggerError> {
8047        let query = self.selection.select("value");
8048        query.execute(self.graphql_client.clone()).await
8049    }
8050}
8051#[derive(Clone)]
8052pub struct Error {
8053    pub proc: Option<Arc<DaggerSessionProc>>,
8054    pub selection: Selection,
8055    pub graphql_client: DynGraphQLClient,
8056}
8057impl Error {
8058    /// A unique identifier for this Error.
8059    pub async fn id(&self) -> Result<ErrorId, DaggerError> {
8060        let query = self.selection.select("id");
8061        query.execute(self.graphql_client.clone()).await
8062    }
8063    /// A description of the error.
8064    pub async fn message(&self) -> Result<String, DaggerError> {
8065        let query = self.selection.select("message");
8066        query.execute(self.graphql_client.clone()).await
8067    }
8068    /// The extensions of the error.
8069    pub fn values(&self) -> Vec<ErrorValue> {
8070        let query = self.selection.select("values");
8071        vec![ErrorValue {
8072            proc: self.proc.clone(),
8073            selection: query,
8074            graphql_client: self.graphql_client.clone(),
8075        }]
8076    }
8077    /// Add a value to the error.
8078    ///
8079    /// # Arguments
8080    ///
8081    /// * `name` - The name of the value.
8082    /// * `value` - The value to store on the error.
8083    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8084        let mut query = self.selection.select("withValue");
8085        query = query.arg("name", name.into());
8086        query = query.arg("value", value);
8087        Error {
8088            proc: self.proc.clone(),
8089            selection: query,
8090            graphql_client: self.graphql_client.clone(),
8091        }
8092    }
8093}
8094#[derive(Clone)]
8095pub struct ErrorValue {
8096    pub proc: Option<Arc<DaggerSessionProc>>,
8097    pub selection: Selection,
8098    pub graphql_client: DynGraphQLClient,
8099}
8100impl ErrorValue {
8101    /// A unique identifier for this ErrorValue.
8102    pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
8103        let query = self.selection.select("id");
8104        query.execute(self.graphql_client.clone()).await
8105    }
8106    /// The name of the value.
8107    pub async fn name(&self) -> Result<String, DaggerError> {
8108        let query = self.selection.select("name");
8109        query.execute(self.graphql_client.clone()).await
8110    }
8111    /// The value.
8112    pub async fn value(&self) -> Result<Json, DaggerError> {
8113        let query = self.selection.select("value");
8114        query.execute(self.graphql_client.clone()).await
8115    }
8116}
8117#[derive(Clone)]
8118pub struct FieldTypeDef {
8119    pub proc: Option<Arc<DaggerSessionProc>>,
8120    pub selection: Selection,
8121    pub graphql_client: DynGraphQLClient,
8122}
8123impl FieldTypeDef {
8124    /// The reason this enum member is deprecated, if any.
8125    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8126        let query = self.selection.select("deprecated");
8127        query.execute(self.graphql_client.clone()).await
8128    }
8129    /// A doc string for the field, if any.
8130    pub async fn description(&self) -> Result<String, DaggerError> {
8131        let query = self.selection.select("description");
8132        query.execute(self.graphql_client.clone()).await
8133    }
8134    /// A unique identifier for this FieldTypeDef.
8135    pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
8136        let query = self.selection.select("id");
8137        query.execute(self.graphql_client.clone()).await
8138    }
8139    /// The name of the field in lowerCamelCase format.
8140    pub async fn name(&self) -> Result<String, DaggerError> {
8141        let query = self.selection.select("name");
8142        query.execute(self.graphql_client.clone()).await
8143    }
8144    /// The location of this field declaration.
8145    pub fn source_map(&self) -> SourceMap {
8146        let query = self.selection.select("sourceMap");
8147        SourceMap {
8148            proc: self.proc.clone(),
8149            selection: query,
8150            graphql_client: self.graphql_client.clone(),
8151        }
8152    }
8153    /// The type of the field.
8154    pub fn type_def(&self) -> TypeDef {
8155        let query = self.selection.select("typeDef");
8156        TypeDef {
8157            proc: self.proc.clone(),
8158            selection: query,
8159            graphql_client: self.graphql_client.clone(),
8160        }
8161    }
8162}
8163#[derive(Clone)]
8164pub struct File {
8165    pub proc: Option<Arc<DaggerSessionProc>>,
8166    pub selection: Selection,
8167    pub graphql_client: DynGraphQLClient,
8168}
8169#[derive(Builder, Debug, PartialEq)]
8170pub struct FileAsEnvFileOpts {
8171    /// Replace "${VAR}" or "$VAR" with the value of other vars
8172    #[builder(setter(into, strip_option), default)]
8173    pub expand: Option<bool>,
8174}
8175#[derive(Builder, Debug, PartialEq)]
8176pub struct FileContentsOpts {
8177    /// Maximum number of lines to read
8178    #[builder(setter(into, strip_option), default)]
8179    pub limit_lines: Option<isize>,
8180    /// Start reading after this line
8181    #[builder(setter(into, strip_option), default)]
8182    pub offset_lines: Option<isize>,
8183}
8184#[derive(Builder, Debug, PartialEq)]
8185pub struct FileDigestOpts {
8186    /// If true, exclude metadata from the digest.
8187    #[builder(setter(into, strip_option), default)]
8188    pub exclude_metadata: Option<bool>,
8189}
8190#[derive(Builder, Debug, PartialEq)]
8191pub struct FileExportOpts {
8192    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
8193    #[builder(setter(into, strip_option), default)]
8194    pub allow_parent_dir_path: Option<bool>,
8195}
8196#[derive(Builder, Debug, PartialEq)]
8197pub struct FileSearchOpts<'a> {
8198    /// Allow the . pattern to match newlines in multiline mode.
8199    #[builder(setter(into, strip_option), default)]
8200    pub dotall: Option<bool>,
8201    /// Only return matching files, not lines and content
8202    #[builder(setter(into, strip_option), default)]
8203    pub files_only: Option<bool>,
8204    #[builder(setter(into, strip_option), default)]
8205    pub globs: Option<Vec<&'a str>>,
8206    /// Enable case-insensitive matching.
8207    #[builder(setter(into, strip_option), default)]
8208    pub insensitive: Option<bool>,
8209    /// Limit the number of results to return
8210    #[builder(setter(into, strip_option), default)]
8211    pub limit: Option<isize>,
8212    /// Interpret the pattern as a literal string instead of a regular expression.
8213    #[builder(setter(into, strip_option), default)]
8214    pub literal: Option<bool>,
8215    /// Enable searching across multiple lines.
8216    #[builder(setter(into, strip_option), default)]
8217    pub multiline: Option<bool>,
8218    #[builder(setter(into, strip_option), default)]
8219    pub paths: Option<Vec<&'a str>>,
8220    /// Skip hidden files (files starting with .).
8221    #[builder(setter(into, strip_option), default)]
8222    pub skip_hidden: Option<bool>,
8223    /// Honor .gitignore, .ignore, and .rgignore files.
8224    #[builder(setter(into, strip_option), default)]
8225    pub skip_ignored: Option<bool>,
8226}
8227#[derive(Builder, Debug, PartialEq)]
8228pub struct FileWithReplacedOpts {
8229    /// Replace all occurrences of the pattern.
8230    #[builder(setter(into, strip_option), default)]
8231    pub all: Option<bool>,
8232    /// Replace the first match starting from the specified line.
8233    #[builder(setter(into, strip_option), default)]
8234    pub first_from: Option<isize>,
8235}
8236impl File {
8237    /// Parse as an env file
8238    ///
8239    /// # Arguments
8240    ///
8241    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8242    pub fn as_env_file(&self) -> EnvFile {
8243        let query = self.selection.select("asEnvFile");
8244        EnvFile {
8245            proc: self.proc.clone(),
8246            selection: query,
8247            graphql_client: self.graphql_client.clone(),
8248        }
8249    }
8250    /// Parse as an env file
8251    ///
8252    /// # Arguments
8253    ///
8254    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8255    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
8256        let mut query = self.selection.select("asEnvFile");
8257        if let Some(expand) = opts.expand {
8258            query = query.arg("expand", expand);
8259        }
8260        EnvFile {
8261            proc: self.proc.clone(),
8262            selection: query,
8263            graphql_client: self.graphql_client.clone(),
8264        }
8265    }
8266    /// Parse the file contents as JSON.
8267    pub fn as_json(&self) -> JsonValue {
8268        let query = self.selection.select("asJSON");
8269        JsonValue {
8270            proc: self.proc.clone(),
8271            selection: query,
8272            graphql_client: self.graphql_client.clone(),
8273        }
8274    }
8275    /// Change the owner of the file recursively.
8276    ///
8277    /// # Arguments
8278    ///
8279    /// * `owner` - A user:group to set for the file.
8280    ///
8281    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
8282    ///
8283    /// If the group is omitted, it defaults to the same as the user.
8284    pub fn chown(&self, owner: impl Into<String>) -> File {
8285        let mut query = self.selection.select("chown");
8286        query = query.arg("owner", owner.into());
8287        File {
8288            proc: self.proc.clone(),
8289            selection: query,
8290            graphql_client: self.graphql_client.clone(),
8291        }
8292    }
8293    /// Retrieves the contents of the file.
8294    ///
8295    /// # Arguments
8296    ///
8297    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8298    pub async fn contents(&self) -> Result<String, DaggerError> {
8299        let query = self.selection.select("contents");
8300        query.execute(self.graphql_client.clone()).await
8301    }
8302    /// Retrieves the contents of the file.
8303    ///
8304    /// # Arguments
8305    ///
8306    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8307    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
8308        let mut query = self.selection.select("contents");
8309        if let Some(offset_lines) = opts.offset_lines {
8310            query = query.arg("offsetLines", offset_lines);
8311        }
8312        if let Some(limit_lines) = opts.limit_lines {
8313            query = query.arg("limitLines", limit_lines);
8314        }
8315        query.execute(self.graphql_client.clone()).await
8316    }
8317    /// 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.
8318    ///
8319    /// # Arguments
8320    ///
8321    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8322    pub async fn digest(&self) -> Result<String, DaggerError> {
8323        let query = self.selection.select("digest");
8324        query.execute(self.graphql_client.clone()).await
8325    }
8326    /// 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.
8327    ///
8328    /// # Arguments
8329    ///
8330    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8331    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
8332        let mut query = self.selection.select("digest");
8333        if let Some(exclude_metadata) = opts.exclude_metadata {
8334            query = query.arg("excludeMetadata", exclude_metadata);
8335        }
8336        query.execute(self.graphql_client.clone()).await
8337    }
8338    /// Writes the file to a file path on the host.
8339    ///
8340    /// # Arguments
8341    ///
8342    /// * `path` - Location of the written directory (e.g., "output.txt").
8343    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8344    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
8345        let mut query = self.selection.select("export");
8346        query = query.arg("path", path.into());
8347        query.execute(self.graphql_client.clone()).await
8348    }
8349    /// Writes the file to a file path on the host.
8350    ///
8351    /// # Arguments
8352    ///
8353    /// * `path` - Location of the written directory (e.g., "output.txt").
8354    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8355    pub async fn export_opts(
8356        &self,
8357        path: impl Into<String>,
8358        opts: FileExportOpts,
8359    ) -> Result<String, DaggerError> {
8360        let mut query = self.selection.select("export");
8361        query = query.arg("path", path.into());
8362        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
8363            query = query.arg("allowParentDirPath", allow_parent_dir_path);
8364        }
8365        query.execute(self.graphql_client.clone()).await
8366    }
8367    /// A unique identifier for this File.
8368    pub async fn id(&self) -> Result<FileId, DaggerError> {
8369        let query = self.selection.select("id");
8370        query.execute(self.graphql_client.clone()).await
8371    }
8372    /// Retrieves the name of the file.
8373    pub async fn name(&self) -> Result<String, DaggerError> {
8374        let query = self.selection.select("name");
8375        query.execute(self.graphql_client.clone()).await
8376    }
8377    /// Searches for content matching the given regular expression or literal string.
8378    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
8379    ///
8380    /// # Arguments
8381    ///
8382    /// * `pattern` - The text to match.
8383    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8384    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
8385        let mut query = self.selection.select("search");
8386        query = query.arg("pattern", pattern.into());
8387        vec![SearchResult {
8388            proc: self.proc.clone(),
8389            selection: query,
8390            graphql_client: self.graphql_client.clone(),
8391        }]
8392    }
8393    /// Searches for content matching the given regular expression or literal string.
8394    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
8395    ///
8396    /// # Arguments
8397    ///
8398    /// * `pattern` - The text to match.
8399    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8400    pub fn search_opts<'a>(
8401        &self,
8402        pattern: impl Into<String>,
8403        opts: FileSearchOpts<'a>,
8404    ) -> Vec<SearchResult> {
8405        let mut query = self.selection.select("search");
8406        query = query.arg("pattern", pattern.into());
8407        if let Some(literal) = opts.literal {
8408            query = query.arg("literal", literal);
8409        }
8410        if let Some(multiline) = opts.multiline {
8411            query = query.arg("multiline", multiline);
8412        }
8413        if let Some(dotall) = opts.dotall {
8414            query = query.arg("dotall", dotall);
8415        }
8416        if let Some(insensitive) = opts.insensitive {
8417            query = query.arg("insensitive", insensitive);
8418        }
8419        if let Some(skip_ignored) = opts.skip_ignored {
8420            query = query.arg("skipIgnored", skip_ignored);
8421        }
8422        if let Some(skip_hidden) = opts.skip_hidden {
8423            query = query.arg("skipHidden", skip_hidden);
8424        }
8425        if let Some(files_only) = opts.files_only {
8426            query = query.arg("filesOnly", files_only);
8427        }
8428        if let Some(limit) = opts.limit {
8429            query = query.arg("limit", limit);
8430        }
8431        if let Some(paths) = opts.paths {
8432            query = query.arg("paths", paths);
8433        }
8434        if let Some(globs) = opts.globs {
8435            query = query.arg("globs", globs);
8436        }
8437        vec![SearchResult {
8438            proc: self.proc.clone(),
8439            selection: query,
8440            graphql_client: self.graphql_client.clone(),
8441        }]
8442    }
8443    /// Retrieves the size of the file, in bytes.
8444    pub async fn size(&self) -> Result<isize, DaggerError> {
8445        let query = self.selection.select("size");
8446        query.execute(self.graphql_client.clone()).await
8447    }
8448    /// Return file status
8449    pub fn stat(&self) -> Stat {
8450        let query = self.selection.select("stat");
8451        Stat {
8452            proc: self.proc.clone(),
8453            selection: query,
8454            graphql_client: self.graphql_client.clone(),
8455        }
8456    }
8457    /// Force evaluation in the engine.
8458    pub async fn sync(&self) -> Result<FileId, DaggerError> {
8459        let query = self.selection.select("sync");
8460        query.execute(self.graphql_client.clone()).await
8461    }
8462    /// Retrieves this file with its name set to the given name.
8463    ///
8464    /// # Arguments
8465    ///
8466    /// * `name` - Name to set file to.
8467    pub fn with_name(&self, name: impl Into<String>) -> File {
8468        let mut query = self.selection.select("withName");
8469        query = query.arg("name", name.into());
8470        File {
8471            proc: self.proc.clone(),
8472            selection: query,
8473            graphql_client: self.graphql_client.clone(),
8474        }
8475    }
8476    /// Retrieves the file with content replaced with the given text.
8477    /// If 'all' is true, all occurrences of the pattern will be replaced.
8478    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
8479    /// If neither are specified, and there are multiple matches for the pattern, this will error.
8480    /// If there are no matches for the pattern, this will error.
8481    ///
8482    /// # Arguments
8483    ///
8484    /// * `search` - The text to match.
8485    /// * `replacement` - The text to match.
8486    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8487    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
8488        let mut query = self.selection.select("withReplaced");
8489        query = query.arg("search", search.into());
8490        query = query.arg("replacement", replacement.into());
8491        File {
8492            proc: self.proc.clone(),
8493            selection: query,
8494            graphql_client: self.graphql_client.clone(),
8495        }
8496    }
8497    /// Retrieves the file with content replaced with the given text.
8498    /// If 'all' is true, all occurrences of the pattern will be replaced.
8499    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
8500    /// If neither are specified, and there are multiple matches for the pattern, this will error.
8501    /// If there are no matches for the pattern, this will error.
8502    ///
8503    /// # Arguments
8504    ///
8505    /// * `search` - The text to match.
8506    /// * `replacement` - The text to match.
8507    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8508    pub fn with_replaced_opts(
8509        &self,
8510        search: impl Into<String>,
8511        replacement: impl Into<String>,
8512        opts: FileWithReplacedOpts,
8513    ) -> File {
8514        let mut query = self.selection.select("withReplaced");
8515        query = query.arg("search", search.into());
8516        query = query.arg("replacement", replacement.into());
8517        if let Some(all) = opts.all {
8518            query = query.arg("all", all);
8519        }
8520        if let Some(first_from) = opts.first_from {
8521            query = query.arg("firstFrom", first_from);
8522        }
8523        File {
8524            proc: self.proc.clone(),
8525            selection: query,
8526            graphql_client: self.graphql_client.clone(),
8527        }
8528    }
8529    /// Retrieves this file with its created/modified timestamps set to the given time.
8530    ///
8531    /// # Arguments
8532    ///
8533    /// * `timestamp` - Timestamp to set dir/files in.
8534    ///
8535    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
8536    pub fn with_timestamps(&self, timestamp: isize) -> File {
8537        let mut query = self.selection.select("withTimestamps");
8538        query = query.arg("timestamp", timestamp);
8539        File {
8540            proc: self.proc.clone(),
8541            selection: query,
8542            graphql_client: self.graphql_client.clone(),
8543        }
8544    }
8545}
8546#[derive(Clone)]
8547pub struct Function {
8548    pub proc: Option<Arc<DaggerSessionProc>>,
8549    pub selection: Selection,
8550    pub graphql_client: DynGraphQLClient,
8551}
8552#[derive(Builder, Debug, PartialEq)]
8553pub struct FunctionWithArgOpts<'a> {
8554    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
8555    #[builder(setter(into, strip_option), default)]
8556    pub default_path: Option<&'a str>,
8557    /// A default value to use for this argument if not explicitly set by the caller, if any
8558    #[builder(setter(into, strip_option), default)]
8559    pub default_value: Option<Json>,
8560    /// If deprecated, the reason or migration path.
8561    #[builder(setter(into, strip_option), default)]
8562    pub deprecated: Option<&'a str>,
8563    /// A doc string for the argument, if any
8564    #[builder(setter(into, strip_option), default)]
8565    pub description: Option<&'a str>,
8566    /// Patterns to ignore when loading the contextual argument value.
8567    #[builder(setter(into, strip_option), default)]
8568    pub ignore: Option<Vec<&'a str>>,
8569    /// The source map for the argument definition.
8570    #[builder(setter(into, strip_option), default)]
8571    pub source_map: Option<SourceMapId>,
8572}
8573#[derive(Builder, Debug, PartialEq)]
8574pub struct FunctionWithCachePolicyOpts<'a> {
8575    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
8576    #[builder(setter(into, strip_option), default)]
8577    pub time_to_live: Option<&'a str>,
8578}
8579#[derive(Builder, Debug, PartialEq)]
8580pub struct FunctionWithDeprecatedOpts<'a> {
8581    /// Reason or migration path describing the deprecation.
8582    #[builder(setter(into, strip_option), default)]
8583    pub reason: Option<&'a str>,
8584}
8585impl Function {
8586    /// Arguments accepted by the function, if any.
8587    pub fn args(&self) -> Vec<FunctionArg> {
8588        let query = self.selection.select("args");
8589        vec![FunctionArg {
8590            proc: self.proc.clone(),
8591            selection: query,
8592            graphql_client: self.graphql_client.clone(),
8593        }]
8594    }
8595    /// The reason this function is deprecated, if any.
8596    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8597        let query = self.selection.select("deprecated");
8598        query.execute(self.graphql_client.clone()).await
8599    }
8600    /// A doc string for the function, if any.
8601    pub async fn description(&self) -> Result<String, DaggerError> {
8602        let query = self.selection.select("description");
8603        query.execute(self.graphql_client.clone()).await
8604    }
8605    /// A unique identifier for this Function.
8606    pub async fn id(&self) -> Result<FunctionId, DaggerError> {
8607        let query = self.selection.select("id");
8608        query.execute(self.graphql_client.clone()).await
8609    }
8610    /// The name of the function.
8611    pub async fn name(&self) -> Result<String, DaggerError> {
8612        let query = self.selection.select("name");
8613        query.execute(self.graphql_client.clone()).await
8614    }
8615    /// The type returned by the function.
8616    pub fn return_type(&self) -> TypeDef {
8617        let query = self.selection.select("returnType");
8618        TypeDef {
8619            proc: self.proc.clone(),
8620            selection: query,
8621            graphql_client: self.graphql_client.clone(),
8622        }
8623    }
8624    /// The location of this function declaration.
8625    pub fn source_map(&self) -> SourceMap {
8626        let query = self.selection.select("sourceMap");
8627        SourceMap {
8628            proc: self.proc.clone(),
8629            selection: query,
8630            graphql_client: self.graphql_client.clone(),
8631        }
8632    }
8633    /// Returns the function with the provided argument
8634    ///
8635    /// # Arguments
8636    ///
8637    /// * `name` - The name of the argument
8638    /// * `type_def` - The type of the argument
8639    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8640    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
8641        let mut query = self.selection.select("withArg");
8642        query = query.arg("name", name.into());
8643        query = query.arg_lazy(
8644            "typeDef",
8645            Box::new(move || {
8646                let type_def = type_def.clone();
8647                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8648            }),
8649        );
8650        Function {
8651            proc: self.proc.clone(),
8652            selection: query,
8653            graphql_client: self.graphql_client.clone(),
8654        }
8655    }
8656    /// Returns the function with the provided argument
8657    ///
8658    /// # Arguments
8659    ///
8660    /// * `name` - The name of the argument
8661    /// * `type_def` - The type of the argument
8662    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8663    pub fn with_arg_opts<'a>(
8664        &self,
8665        name: impl Into<String>,
8666        type_def: impl IntoID<TypeDefId>,
8667        opts: FunctionWithArgOpts<'a>,
8668    ) -> Function {
8669        let mut query = self.selection.select("withArg");
8670        query = query.arg("name", name.into());
8671        query = query.arg_lazy(
8672            "typeDef",
8673            Box::new(move || {
8674                let type_def = type_def.clone();
8675                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8676            }),
8677        );
8678        if let Some(description) = opts.description {
8679            query = query.arg("description", description);
8680        }
8681        if let Some(default_value) = opts.default_value {
8682            query = query.arg("defaultValue", default_value);
8683        }
8684        if let Some(default_path) = opts.default_path {
8685            query = query.arg("defaultPath", default_path);
8686        }
8687        if let Some(ignore) = opts.ignore {
8688            query = query.arg("ignore", ignore);
8689        }
8690        if let Some(source_map) = opts.source_map {
8691            query = query.arg("sourceMap", source_map);
8692        }
8693        if let Some(deprecated) = opts.deprecated {
8694            query = query.arg("deprecated", deprecated);
8695        }
8696        Function {
8697            proc: self.proc.clone(),
8698            selection: query,
8699            graphql_client: self.graphql_client.clone(),
8700        }
8701    }
8702    /// Returns the function updated to use the provided cache policy.
8703    ///
8704    /// # Arguments
8705    ///
8706    /// * `policy` - The cache policy to use.
8707    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8708    pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
8709        let mut query = self.selection.select("withCachePolicy");
8710        query = query.arg("policy", policy);
8711        Function {
8712            proc: self.proc.clone(),
8713            selection: query,
8714            graphql_client: self.graphql_client.clone(),
8715        }
8716    }
8717    /// Returns the function updated to use the provided cache policy.
8718    ///
8719    /// # Arguments
8720    ///
8721    /// * `policy` - The cache policy to use.
8722    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8723    pub fn with_cache_policy_opts<'a>(
8724        &self,
8725        policy: FunctionCachePolicy,
8726        opts: FunctionWithCachePolicyOpts<'a>,
8727    ) -> Function {
8728        let mut query = self.selection.select("withCachePolicy");
8729        query = query.arg("policy", policy);
8730        if let Some(time_to_live) = opts.time_to_live {
8731            query = query.arg("timeToLive", time_to_live);
8732        }
8733        Function {
8734            proc: self.proc.clone(),
8735            selection: query,
8736            graphql_client: self.graphql_client.clone(),
8737        }
8738    }
8739    /// Returns the function with a flag indicating it's a check.
8740    pub fn with_check(&self) -> Function {
8741        let query = self.selection.select("withCheck");
8742        Function {
8743            proc: self.proc.clone(),
8744            selection: query,
8745            graphql_client: self.graphql_client.clone(),
8746        }
8747    }
8748    /// Returns the function with the provided deprecation reason.
8749    ///
8750    /// # Arguments
8751    ///
8752    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8753    pub fn with_deprecated(&self) -> Function {
8754        let query = self.selection.select("withDeprecated");
8755        Function {
8756            proc: self.proc.clone(),
8757            selection: query,
8758            graphql_client: self.graphql_client.clone(),
8759        }
8760    }
8761    /// Returns the function with the provided deprecation reason.
8762    ///
8763    /// # Arguments
8764    ///
8765    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8766    pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
8767        let mut query = self.selection.select("withDeprecated");
8768        if let Some(reason) = opts.reason {
8769            query = query.arg("reason", reason);
8770        }
8771        Function {
8772            proc: self.proc.clone(),
8773            selection: query,
8774            graphql_client: self.graphql_client.clone(),
8775        }
8776    }
8777    /// Returns the function with the given doc string.
8778    ///
8779    /// # Arguments
8780    ///
8781    /// * `description` - The doc string to set.
8782    pub fn with_description(&self, description: impl Into<String>) -> Function {
8783        let mut query = self.selection.select("withDescription");
8784        query = query.arg("description", description.into());
8785        Function {
8786            proc: self.proc.clone(),
8787            selection: query,
8788            graphql_client: self.graphql_client.clone(),
8789        }
8790    }
8791    /// Returns the function with the given source map.
8792    ///
8793    /// # Arguments
8794    ///
8795    /// * `source_map` - The source map for the function definition.
8796    pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
8797        let mut query = self.selection.select("withSourceMap");
8798        query = query.arg_lazy(
8799            "sourceMap",
8800            Box::new(move || {
8801                let source_map = source_map.clone();
8802                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
8803            }),
8804        );
8805        Function {
8806            proc: self.proc.clone(),
8807            selection: query,
8808            graphql_client: self.graphql_client.clone(),
8809        }
8810    }
8811}
8812#[derive(Clone)]
8813pub struct FunctionArg {
8814    pub proc: Option<Arc<DaggerSessionProc>>,
8815    pub selection: Selection,
8816    pub graphql_client: DynGraphQLClient,
8817}
8818impl FunctionArg {
8819    /// 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
8820    pub async fn default_path(&self) -> Result<String, DaggerError> {
8821        let query = self.selection.select("defaultPath");
8822        query.execute(self.graphql_client.clone()).await
8823    }
8824    /// A default value to use for this argument when not explicitly set by the caller, if any.
8825    pub async fn default_value(&self) -> Result<Json, DaggerError> {
8826        let query = self.selection.select("defaultValue");
8827        query.execute(self.graphql_client.clone()).await
8828    }
8829    /// The reason this function is deprecated, if any.
8830    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8831        let query = self.selection.select("deprecated");
8832        query.execute(self.graphql_client.clone()).await
8833    }
8834    /// A doc string for the argument, if any.
8835    pub async fn description(&self) -> Result<String, DaggerError> {
8836        let query = self.selection.select("description");
8837        query.execute(self.graphql_client.clone()).await
8838    }
8839    /// A unique identifier for this FunctionArg.
8840    pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
8841        let query = self.selection.select("id");
8842        query.execute(self.graphql_client.clone()).await
8843    }
8844    /// 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.
8845    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
8846        let query = self.selection.select("ignore");
8847        query.execute(self.graphql_client.clone()).await
8848    }
8849    /// The name of the argument in lowerCamelCase format.
8850    pub async fn name(&self) -> Result<String, DaggerError> {
8851        let query = self.selection.select("name");
8852        query.execute(self.graphql_client.clone()).await
8853    }
8854    /// The location of this arg declaration.
8855    pub fn source_map(&self) -> SourceMap {
8856        let query = self.selection.select("sourceMap");
8857        SourceMap {
8858            proc: self.proc.clone(),
8859            selection: query,
8860            graphql_client: self.graphql_client.clone(),
8861        }
8862    }
8863    /// The type of the argument.
8864    pub fn type_def(&self) -> TypeDef {
8865        let query = self.selection.select("typeDef");
8866        TypeDef {
8867            proc: self.proc.clone(),
8868            selection: query,
8869            graphql_client: self.graphql_client.clone(),
8870        }
8871    }
8872}
8873#[derive(Clone)]
8874pub struct FunctionCall {
8875    pub proc: Option<Arc<DaggerSessionProc>>,
8876    pub selection: Selection,
8877    pub graphql_client: DynGraphQLClient,
8878}
8879impl FunctionCall {
8880    /// A unique identifier for this FunctionCall.
8881    pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
8882        let query = self.selection.select("id");
8883        query.execute(self.graphql_client.clone()).await
8884    }
8885    /// The argument values the function is being invoked with.
8886    pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
8887        let query = self.selection.select("inputArgs");
8888        vec![FunctionCallArgValue {
8889            proc: self.proc.clone(),
8890            selection: query,
8891            graphql_client: self.graphql_client.clone(),
8892        }]
8893    }
8894    /// The name of the function being called.
8895    pub async fn name(&self) -> Result<String, DaggerError> {
8896        let query = self.selection.select("name");
8897        query.execute(self.graphql_client.clone()).await
8898    }
8899    /// 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.
8900    pub async fn parent(&self) -> Result<Json, DaggerError> {
8901        let query = self.selection.select("parent");
8902        query.execute(self.graphql_client.clone()).await
8903    }
8904    /// 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.
8905    pub async fn parent_name(&self) -> Result<String, DaggerError> {
8906        let query = self.selection.select("parentName");
8907        query.execute(self.graphql_client.clone()).await
8908    }
8909    /// Return an error from the function.
8910    ///
8911    /// # Arguments
8912    ///
8913    /// * `error` - The error to return.
8914    pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
8915        let mut query = self.selection.select("returnError");
8916        query = query.arg_lazy(
8917            "error",
8918            Box::new(move || {
8919                let error = error.clone();
8920                Box::pin(async move { error.into_id().await.unwrap().quote() })
8921            }),
8922        );
8923        query.execute(self.graphql_client.clone()).await
8924    }
8925    /// Set the return value of the function call to the provided value.
8926    ///
8927    /// # Arguments
8928    ///
8929    /// * `value` - JSON serialization of the return value.
8930    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
8931        let mut query = self.selection.select("returnValue");
8932        query = query.arg("value", value);
8933        query.execute(self.graphql_client.clone()).await
8934    }
8935}
8936#[derive(Clone)]
8937pub struct FunctionCallArgValue {
8938    pub proc: Option<Arc<DaggerSessionProc>>,
8939    pub selection: Selection,
8940    pub graphql_client: DynGraphQLClient,
8941}
8942impl FunctionCallArgValue {
8943    /// A unique identifier for this FunctionCallArgValue.
8944    pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
8945        let query = self.selection.select("id");
8946        query.execute(self.graphql_client.clone()).await
8947    }
8948    /// The name of the argument.
8949    pub async fn name(&self) -> Result<String, DaggerError> {
8950        let query = self.selection.select("name");
8951        query.execute(self.graphql_client.clone()).await
8952    }
8953    /// The value of the argument represented as a JSON serialized string.
8954    pub async fn value(&self) -> Result<Json, DaggerError> {
8955        let query = self.selection.select("value");
8956        query.execute(self.graphql_client.clone()).await
8957    }
8958}
8959#[derive(Clone)]
8960pub struct GeneratedCode {
8961    pub proc: Option<Arc<DaggerSessionProc>>,
8962    pub selection: Selection,
8963    pub graphql_client: DynGraphQLClient,
8964}
8965impl GeneratedCode {
8966    /// The directory containing the generated code.
8967    pub fn code(&self) -> Directory {
8968        let query = self.selection.select("code");
8969        Directory {
8970            proc: self.proc.clone(),
8971            selection: query,
8972            graphql_client: self.graphql_client.clone(),
8973        }
8974    }
8975    /// A unique identifier for this GeneratedCode.
8976    pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
8977        let query = self.selection.select("id");
8978        query.execute(self.graphql_client.clone()).await
8979    }
8980    /// List of paths to mark generated in version control (i.e. .gitattributes).
8981    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
8982        let query = self.selection.select("vcsGeneratedPaths");
8983        query.execute(self.graphql_client.clone()).await
8984    }
8985    /// List of paths to ignore in version control (i.e. .gitignore).
8986    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
8987        let query = self.selection.select("vcsIgnoredPaths");
8988        query.execute(self.graphql_client.clone()).await
8989    }
8990    /// Set the list of paths to mark generated in version control.
8991    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8992        let mut query = self.selection.select("withVCSGeneratedPaths");
8993        query = query.arg(
8994            "paths",
8995            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8996        );
8997        GeneratedCode {
8998            proc: self.proc.clone(),
8999            selection: query,
9000            graphql_client: self.graphql_client.clone(),
9001        }
9002    }
9003    /// Set the list of paths to ignore in version control.
9004    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9005        let mut query = self.selection.select("withVCSIgnoredPaths");
9006        query = query.arg(
9007            "paths",
9008            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9009        );
9010        GeneratedCode {
9011            proc: self.proc.clone(),
9012            selection: query,
9013            graphql_client: self.graphql_client.clone(),
9014        }
9015    }
9016}
9017#[derive(Clone)]
9018pub struct GitRef {
9019    pub proc: Option<Arc<DaggerSessionProc>>,
9020    pub selection: Selection,
9021    pub graphql_client: DynGraphQLClient,
9022}
9023#[derive(Builder, Debug, PartialEq)]
9024pub struct GitRefTreeOpts {
9025    /// The depth of the tree to fetch.
9026    #[builder(setter(into, strip_option), default)]
9027    pub depth: Option<isize>,
9028    /// Set to true to discard .git directory.
9029    #[builder(setter(into, strip_option), default)]
9030    pub discard_git_dir: Option<bool>,
9031}
9032impl GitRef {
9033    /// The resolved commit id at this ref.
9034    pub async fn commit(&self) -> Result<String, DaggerError> {
9035        let query = self.selection.select("commit");
9036        query.execute(self.graphql_client.clone()).await
9037    }
9038    /// Find the best common ancestor between this ref and another ref.
9039    ///
9040    /// # Arguments
9041    ///
9042    /// * `other` - The other ref to compare against.
9043    pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
9044        let mut query = self.selection.select("commonAncestor");
9045        query = query.arg_lazy(
9046            "other",
9047            Box::new(move || {
9048                let other = other.clone();
9049                Box::pin(async move { other.into_id().await.unwrap().quote() })
9050            }),
9051        );
9052        GitRef {
9053            proc: self.proc.clone(),
9054            selection: query,
9055            graphql_client: self.graphql_client.clone(),
9056        }
9057    }
9058    /// A unique identifier for this GitRef.
9059    pub async fn id(&self) -> Result<GitRefId, DaggerError> {
9060        let query = self.selection.select("id");
9061        query.execute(self.graphql_client.clone()).await
9062    }
9063    /// The resolved ref name at this ref.
9064    pub async fn r#ref(&self) -> Result<String, DaggerError> {
9065        let query = self.selection.select("ref");
9066        query.execute(self.graphql_client.clone()).await
9067    }
9068    /// The filesystem tree at this ref.
9069    ///
9070    /// # Arguments
9071    ///
9072    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9073    pub fn tree(&self) -> Directory {
9074        let query = self.selection.select("tree");
9075        Directory {
9076            proc: self.proc.clone(),
9077            selection: query,
9078            graphql_client: self.graphql_client.clone(),
9079        }
9080    }
9081    /// The filesystem tree at this ref.
9082    ///
9083    /// # Arguments
9084    ///
9085    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9086    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
9087        let mut query = self.selection.select("tree");
9088        if let Some(discard_git_dir) = opts.discard_git_dir {
9089            query = query.arg("discardGitDir", discard_git_dir);
9090        }
9091        if let Some(depth) = opts.depth {
9092            query = query.arg("depth", depth);
9093        }
9094        Directory {
9095            proc: self.proc.clone(),
9096            selection: query,
9097            graphql_client: self.graphql_client.clone(),
9098        }
9099    }
9100}
9101#[derive(Clone)]
9102pub struct GitRepository {
9103    pub proc: Option<Arc<DaggerSessionProc>>,
9104    pub selection: Selection,
9105    pub graphql_client: DynGraphQLClient,
9106}
9107#[derive(Builder, Debug, PartialEq)]
9108pub struct GitRepositoryBranchesOpts<'a> {
9109    /// Glob patterns (e.g., "refs/tags/v*").
9110    #[builder(setter(into, strip_option), default)]
9111    pub patterns: Option<Vec<&'a str>>,
9112}
9113#[derive(Builder, Debug, PartialEq)]
9114pub struct GitRepositoryTagsOpts<'a> {
9115    /// Glob patterns (e.g., "refs/tags/v*").
9116    #[builder(setter(into, strip_option), default)]
9117    pub patterns: Option<Vec<&'a str>>,
9118}
9119impl GitRepository {
9120    /// Returns details of a branch.
9121    ///
9122    /// # Arguments
9123    ///
9124    /// * `name` - Branch's name (e.g., "main").
9125    pub fn branch(&self, name: impl Into<String>) -> GitRef {
9126        let mut query = self.selection.select("branch");
9127        query = query.arg("name", name.into());
9128        GitRef {
9129            proc: self.proc.clone(),
9130            selection: query,
9131            graphql_client: self.graphql_client.clone(),
9132        }
9133    }
9134    /// branches that match any of the given glob patterns.
9135    ///
9136    /// # Arguments
9137    ///
9138    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9139    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
9140        let query = self.selection.select("branches");
9141        query.execute(self.graphql_client.clone()).await
9142    }
9143    /// branches that match any of the given glob patterns.
9144    ///
9145    /// # Arguments
9146    ///
9147    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9148    pub async fn branches_opts<'a>(
9149        &self,
9150        opts: GitRepositoryBranchesOpts<'a>,
9151    ) -> Result<Vec<String>, DaggerError> {
9152        let mut query = self.selection.select("branches");
9153        if let Some(patterns) = opts.patterns {
9154            query = query.arg("patterns", patterns);
9155        }
9156        query.execute(self.graphql_client.clone()).await
9157    }
9158    /// Returns details of a commit.
9159    ///
9160    /// # Arguments
9161    ///
9162    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
9163    pub fn commit(&self, id: impl Into<String>) -> GitRef {
9164        let mut query = self.selection.select("commit");
9165        query = query.arg("id", id.into());
9166        GitRef {
9167            proc: self.proc.clone(),
9168            selection: query,
9169            graphql_client: self.graphql_client.clone(),
9170        }
9171    }
9172    /// Returns details for HEAD.
9173    pub fn head(&self) -> GitRef {
9174        let query = self.selection.select("head");
9175        GitRef {
9176            proc: self.proc.clone(),
9177            selection: query,
9178            graphql_client: self.graphql_client.clone(),
9179        }
9180    }
9181    /// A unique identifier for this GitRepository.
9182    pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
9183        let query = self.selection.select("id");
9184        query.execute(self.graphql_client.clone()).await
9185    }
9186    /// Returns details for the latest semver tag.
9187    pub fn latest_version(&self) -> GitRef {
9188        let query = self.selection.select("latestVersion");
9189        GitRef {
9190            proc: self.proc.clone(),
9191            selection: query,
9192            graphql_client: self.graphql_client.clone(),
9193        }
9194    }
9195    /// Returns details of a ref.
9196    ///
9197    /// # Arguments
9198    ///
9199    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
9200    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
9201        let mut query = self.selection.select("ref");
9202        query = query.arg("name", name.into());
9203        GitRef {
9204            proc: self.proc.clone(),
9205            selection: query,
9206            graphql_client: self.graphql_client.clone(),
9207        }
9208    }
9209    /// Returns details of a tag.
9210    ///
9211    /// # Arguments
9212    ///
9213    /// * `name` - Tag's name (e.g., "v0.3.9").
9214    pub fn tag(&self, name: impl Into<String>) -> GitRef {
9215        let mut query = self.selection.select("tag");
9216        query = query.arg("name", name.into());
9217        GitRef {
9218            proc: self.proc.clone(),
9219            selection: query,
9220            graphql_client: self.graphql_client.clone(),
9221        }
9222    }
9223    /// tags that match any of the given glob patterns.
9224    ///
9225    /// # Arguments
9226    ///
9227    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9228    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
9229        let query = self.selection.select("tags");
9230        query.execute(self.graphql_client.clone()).await
9231    }
9232    /// tags that match any of the given glob patterns.
9233    ///
9234    /// # Arguments
9235    ///
9236    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9237    pub async fn tags_opts<'a>(
9238        &self,
9239        opts: GitRepositoryTagsOpts<'a>,
9240    ) -> Result<Vec<String>, DaggerError> {
9241        let mut query = self.selection.select("tags");
9242        if let Some(patterns) = opts.patterns {
9243            query = query.arg("patterns", patterns);
9244        }
9245        query.execute(self.graphql_client.clone()).await
9246    }
9247    /// Returns the changeset of uncommitted changes in the git repository.
9248    pub fn uncommitted(&self) -> Changeset {
9249        let query = self.selection.select("uncommitted");
9250        Changeset {
9251            proc: self.proc.clone(),
9252            selection: query,
9253            graphql_client: self.graphql_client.clone(),
9254        }
9255    }
9256    /// The URL of the git repository.
9257    pub async fn url(&self) -> Result<String, DaggerError> {
9258        let query = self.selection.select("url");
9259        query.execute(self.graphql_client.clone()).await
9260    }
9261}
9262#[derive(Clone)]
9263pub struct Host {
9264    pub proc: Option<Arc<DaggerSessionProc>>,
9265    pub selection: Selection,
9266    pub graphql_client: DynGraphQLClient,
9267}
9268#[derive(Builder, Debug, PartialEq)]
9269pub struct HostDirectoryOpts<'a> {
9270    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
9271    #[builder(setter(into, strip_option), default)]
9272    pub exclude: Option<Vec<&'a str>>,
9273    /// Apply .gitignore filter rules inside the directory
9274    #[builder(setter(into, strip_option), default)]
9275    pub gitignore: Option<bool>,
9276    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
9277    #[builder(setter(into, strip_option), default)]
9278    pub include: Option<Vec<&'a str>>,
9279    /// If true, the directory will always be reloaded from the host.
9280    #[builder(setter(into, strip_option), default)]
9281    pub no_cache: Option<bool>,
9282}
9283#[derive(Builder, Debug, PartialEq)]
9284pub struct HostFileOpts {
9285    /// If true, the file will always be reloaded from the host.
9286    #[builder(setter(into, strip_option), default)]
9287    pub no_cache: Option<bool>,
9288}
9289#[derive(Builder, Debug, PartialEq)]
9290pub struct HostFindUpOpts {
9291    #[builder(setter(into, strip_option), default)]
9292    pub no_cache: Option<bool>,
9293}
9294#[derive(Builder, Debug, PartialEq)]
9295pub struct HostServiceOpts<'a> {
9296    /// Upstream host to forward traffic to.
9297    #[builder(setter(into, strip_option), default)]
9298    pub host: Option<&'a str>,
9299}
9300#[derive(Builder, Debug, PartialEq)]
9301pub struct HostTunnelOpts {
9302    /// Map each service port to the same port on the host, as if the service were running natively.
9303    /// Note: enabling may result in port conflicts.
9304    #[builder(setter(into, strip_option), default)]
9305    pub native: Option<bool>,
9306    /// Configure explicit port forwarding rules for the tunnel.
9307    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
9308    /// 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.
9309    /// If ports are given and native is true, the ports are additive.
9310    #[builder(setter(into, strip_option), default)]
9311    pub ports: Option<Vec<PortForward>>,
9312}
9313impl Host {
9314    /// Accesses a container image on the host.
9315    ///
9316    /// # Arguments
9317    ///
9318    /// * `name` - Name of the image to access.
9319    pub fn container_image(&self, name: impl Into<String>) -> Container {
9320        let mut query = self.selection.select("containerImage");
9321        query = query.arg("name", name.into());
9322        Container {
9323            proc: self.proc.clone(),
9324            selection: query,
9325            graphql_client: self.graphql_client.clone(),
9326        }
9327    }
9328    /// Accesses a directory on the host.
9329    ///
9330    /// # Arguments
9331    ///
9332    /// * `path` - Location of the directory to access (e.g., ".").
9333    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9334    pub fn directory(&self, path: impl Into<String>) -> Directory {
9335        let mut query = self.selection.select("directory");
9336        query = query.arg("path", path.into());
9337        Directory {
9338            proc: self.proc.clone(),
9339            selection: query,
9340            graphql_client: self.graphql_client.clone(),
9341        }
9342    }
9343    /// Accesses a directory on the host.
9344    ///
9345    /// # Arguments
9346    ///
9347    /// * `path` - Location of the directory to access (e.g., ".").
9348    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9349    pub fn directory_opts<'a>(
9350        &self,
9351        path: impl Into<String>,
9352        opts: HostDirectoryOpts<'a>,
9353    ) -> Directory {
9354        let mut query = self.selection.select("directory");
9355        query = query.arg("path", path.into());
9356        if let Some(exclude) = opts.exclude {
9357            query = query.arg("exclude", exclude);
9358        }
9359        if let Some(include) = opts.include {
9360            query = query.arg("include", include);
9361        }
9362        if let Some(no_cache) = opts.no_cache {
9363            query = query.arg("noCache", no_cache);
9364        }
9365        if let Some(gitignore) = opts.gitignore {
9366            query = query.arg("gitignore", gitignore);
9367        }
9368        Directory {
9369            proc: self.proc.clone(),
9370            selection: query,
9371            graphql_client: self.graphql_client.clone(),
9372        }
9373    }
9374    /// Accesses a file on the host.
9375    ///
9376    /// # Arguments
9377    ///
9378    /// * `path` - Location of the file to retrieve (e.g., "README.md").
9379    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9380    pub fn file(&self, path: impl Into<String>) -> File {
9381        let mut query = self.selection.select("file");
9382        query = query.arg("path", path.into());
9383        File {
9384            proc: self.proc.clone(),
9385            selection: query,
9386            graphql_client: self.graphql_client.clone(),
9387        }
9388    }
9389    /// Accesses a file on the host.
9390    ///
9391    /// # Arguments
9392    ///
9393    /// * `path` - Location of the file to retrieve (e.g., "README.md").
9394    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9395    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
9396        let mut query = self.selection.select("file");
9397        query = query.arg("path", path.into());
9398        if let Some(no_cache) = opts.no_cache {
9399            query = query.arg("noCache", no_cache);
9400        }
9401        File {
9402            proc: self.proc.clone(),
9403            selection: query,
9404            graphql_client: self.graphql_client.clone(),
9405        }
9406    }
9407    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
9408    ///
9409    /// # Arguments
9410    ///
9411    /// * `name` - name of the file or directory to search for
9412    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9413    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
9414        let mut query = self.selection.select("findUp");
9415        query = query.arg("name", name.into());
9416        query.execute(self.graphql_client.clone()).await
9417    }
9418    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
9419    ///
9420    /// # Arguments
9421    ///
9422    /// * `name` - name of the file or directory to search for
9423    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9424    pub async fn find_up_opts(
9425        &self,
9426        name: impl Into<String>,
9427        opts: HostFindUpOpts,
9428    ) -> Result<String, DaggerError> {
9429        let mut query = self.selection.select("findUp");
9430        query = query.arg("name", name.into());
9431        if let Some(no_cache) = opts.no_cache {
9432            query = query.arg("noCache", no_cache);
9433        }
9434        query.execute(self.graphql_client.clone()).await
9435    }
9436    /// A unique identifier for this Host.
9437    pub async fn id(&self) -> Result<HostId, DaggerError> {
9438        let query = self.selection.select("id");
9439        query.execute(self.graphql_client.clone()).await
9440    }
9441    /// Creates a service that forwards traffic to a specified address via the host.
9442    ///
9443    /// # Arguments
9444    ///
9445    /// * `ports` - Ports to expose via the service, forwarding through the host network.
9446    ///
9447    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
9448    ///
9449    /// An empty set of ports is not valid; an error will be returned.
9450    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9451    pub fn service(&self, ports: Vec<PortForward>) -> Service {
9452        let mut query = self.selection.select("service");
9453        query = query.arg("ports", ports);
9454        Service {
9455            proc: self.proc.clone(),
9456            selection: query,
9457            graphql_client: self.graphql_client.clone(),
9458        }
9459    }
9460    /// Creates a service that forwards traffic to a specified address via the host.
9461    ///
9462    /// # Arguments
9463    ///
9464    /// * `ports` - Ports to expose via the service, forwarding through the host network.
9465    ///
9466    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
9467    ///
9468    /// An empty set of ports is not valid; an error will be returned.
9469    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9470    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
9471        let mut query = self.selection.select("service");
9472        query = query.arg("ports", ports);
9473        if let Some(host) = opts.host {
9474            query = query.arg("host", host);
9475        }
9476        Service {
9477            proc: self.proc.clone(),
9478            selection: query,
9479            graphql_client: self.graphql_client.clone(),
9480        }
9481    }
9482    /// Creates a tunnel that forwards traffic from the host to a service.
9483    ///
9484    /// # Arguments
9485    ///
9486    /// * `service` - Service to send traffic from the tunnel.
9487    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9488    pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
9489        let mut query = self.selection.select("tunnel");
9490        query = query.arg_lazy(
9491            "service",
9492            Box::new(move || {
9493                let service = service.clone();
9494                Box::pin(async move { service.into_id().await.unwrap().quote() })
9495            }),
9496        );
9497        Service {
9498            proc: self.proc.clone(),
9499            selection: query,
9500            graphql_client: self.graphql_client.clone(),
9501        }
9502    }
9503    /// Creates a tunnel that forwards traffic from the host to a service.
9504    ///
9505    /// # Arguments
9506    ///
9507    /// * `service` - Service to send traffic from the tunnel.
9508    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9509    pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
9510        let mut query = self.selection.select("tunnel");
9511        query = query.arg_lazy(
9512            "service",
9513            Box::new(move || {
9514                let service = service.clone();
9515                Box::pin(async move { service.into_id().await.unwrap().quote() })
9516            }),
9517        );
9518        if let Some(native) = opts.native {
9519            query = query.arg("native", native);
9520        }
9521        if let Some(ports) = opts.ports {
9522            query = query.arg("ports", ports);
9523        }
9524        Service {
9525            proc: self.proc.clone(),
9526            selection: query,
9527            graphql_client: self.graphql_client.clone(),
9528        }
9529    }
9530    /// Accesses a Unix socket on the host.
9531    ///
9532    /// # Arguments
9533    ///
9534    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
9535    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
9536        let mut query = self.selection.select("unixSocket");
9537        query = query.arg("path", path.into());
9538        Socket {
9539            proc: self.proc.clone(),
9540            selection: query,
9541            graphql_client: self.graphql_client.clone(),
9542        }
9543    }
9544}
9545#[derive(Clone)]
9546pub struct InputTypeDef {
9547    pub proc: Option<Arc<DaggerSessionProc>>,
9548    pub selection: Selection,
9549    pub graphql_client: DynGraphQLClient,
9550}
9551impl InputTypeDef {
9552    /// Static fields defined on this input object, if any.
9553    pub fn fields(&self) -> Vec<FieldTypeDef> {
9554        let query = self.selection.select("fields");
9555        vec![FieldTypeDef {
9556            proc: self.proc.clone(),
9557            selection: query,
9558            graphql_client: self.graphql_client.clone(),
9559        }]
9560    }
9561    /// A unique identifier for this InputTypeDef.
9562    pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
9563        let query = self.selection.select("id");
9564        query.execute(self.graphql_client.clone()).await
9565    }
9566    /// The name of the input object.
9567    pub async fn name(&self) -> Result<String, DaggerError> {
9568        let query = self.selection.select("name");
9569        query.execute(self.graphql_client.clone()).await
9570    }
9571}
9572#[derive(Clone)]
9573pub struct InterfaceTypeDef {
9574    pub proc: Option<Arc<DaggerSessionProc>>,
9575    pub selection: Selection,
9576    pub graphql_client: DynGraphQLClient,
9577}
9578impl InterfaceTypeDef {
9579    /// The doc string for the interface, if any.
9580    pub async fn description(&self) -> Result<String, DaggerError> {
9581        let query = self.selection.select("description");
9582        query.execute(self.graphql_client.clone()).await
9583    }
9584    /// Functions defined on this interface, if any.
9585    pub fn functions(&self) -> Vec<Function> {
9586        let query = self.selection.select("functions");
9587        vec![Function {
9588            proc: self.proc.clone(),
9589            selection: query,
9590            graphql_client: self.graphql_client.clone(),
9591        }]
9592    }
9593    /// A unique identifier for this InterfaceTypeDef.
9594    pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
9595        let query = self.selection.select("id");
9596        query.execute(self.graphql_client.clone()).await
9597    }
9598    /// The name of the interface.
9599    pub async fn name(&self) -> Result<String, DaggerError> {
9600        let query = self.selection.select("name");
9601        query.execute(self.graphql_client.clone()).await
9602    }
9603    /// The location of this interface declaration.
9604    pub fn source_map(&self) -> SourceMap {
9605        let query = self.selection.select("sourceMap");
9606        SourceMap {
9607            proc: self.proc.clone(),
9608            selection: query,
9609            graphql_client: self.graphql_client.clone(),
9610        }
9611    }
9612    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
9613    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9614        let query = self.selection.select("sourceModuleName");
9615        query.execute(self.graphql_client.clone()).await
9616    }
9617}
9618#[derive(Clone)]
9619pub struct JsonValue {
9620    pub proc: Option<Arc<DaggerSessionProc>>,
9621    pub selection: Selection,
9622    pub graphql_client: DynGraphQLClient,
9623}
9624#[derive(Builder, Debug, PartialEq)]
9625pub struct JsonValueContentsOpts<'a> {
9626    /// Optional line prefix
9627    #[builder(setter(into, strip_option), default)]
9628    pub indent: Option<&'a str>,
9629    /// Pretty-print
9630    #[builder(setter(into, strip_option), default)]
9631    pub pretty: Option<bool>,
9632}
9633impl JsonValue {
9634    /// Decode an array from json
9635    pub fn as_array(&self) -> Vec<JsonValue> {
9636        let query = self.selection.select("asArray");
9637        vec![JsonValue {
9638            proc: self.proc.clone(),
9639            selection: query,
9640            graphql_client: self.graphql_client.clone(),
9641        }]
9642    }
9643    /// Decode a boolean from json
9644    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
9645        let query = self.selection.select("asBoolean");
9646        query.execute(self.graphql_client.clone()).await
9647    }
9648    /// Decode an integer from json
9649    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
9650        let query = self.selection.select("asInteger");
9651        query.execute(self.graphql_client.clone()).await
9652    }
9653    /// Decode a string from json
9654    pub async fn as_string(&self) -> Result<String, DaggerError> {
9655        let query = self.selection.select("asString");
9656        query.execute(self.graphql_client.clone()).await
9657    }
9658    /// Return the value encoded as json
9659    ///
9660    /// # Arguments
9661    ///
9662    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9663    pub async fn contents(&self) -> Result<Json, DaggerError> {
9664        let query = self.selection.select("contents");
9665        query.execute(self.graphql_client.clone()).await
9666    }
9667    /// Return the value encoded as json
9668    ///
9669    /// # Arguments
9670    ///
9671    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9672    pub async fn contents_opts<'a>(
9673        &self,
9674        opts: JsonValueContentsOpts<'a>,
9675    ) -> Result<Json, DaggerError> {
9676        let mut query = self.selection.select("contents");
9677        if let Some(pretty) = opts.pretty {
9678            query = query.arg("pretty", pretty);
9679        }
9680        if let Some(indent) = opts.indent {
9681            query = query.arg("indent", indent);
9682        }
9683        query.execute(self.graphql_client.clone()).await
9684    }
9685    /// Lookup the field at the given path, and return its value.
9686    ///
9687    /// # Arguments
9688    ///
9689    /// * `path` - Path of the field to lookup, encoded as an array of field names
9690    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
9691        let mut query = self.selection.select("field");
9692        query = query.arg(
9693            "path",
9694            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9695        );
9696        JsonValue {
9697            proc: self.proc.clone(),
9698            selection: query,
9699            graphql_client: self.graphql_client.clone(),
9700        }
9701    }
9702    /// List fields of the encoded object
9703    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
9704        let query = self.selection.select("fields");
9705        query.execute(self.graphql_client.clone()).await
9706    }
9707    /// A unique identifier for this JSONValue.
9708    pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
9709        let query = self.selection.select("id");
9710        query.execute(self.graphql_client.clone()).await
9711    }
9712    /// Encode a boolean to json
9713    ///
9714    /// # Arguments
9715    ///
9716    /// * `value` - New boolean value
9717    pub fn new_boolean(&self, value: bool) -> JsonValue {
9718        let mut query = self.selection.select("newBoolean");
9719        query = query.arg("value", value);
9720        JsonValue {
9721            proc: self.proc.clone(),
9722            selection: query,
9723            graphql_client: self.graphql_client.clone(),
9724        }
9725    }
9726    /// Encode an integer to json
9727    ///
9728    /// # Arguments
9729    ///
9730    /// * `value` - New integer value
9731    pub fn new_integer(&self, value: isize) -> JsonValue {
9732        let mut query = self.selection.select("newInteger");
9733        query = query.arg("value", value);
9734        JsonValue {
9735            proc: self.proc.clone(),
9736            selection: query,
9737            graphql_client: self.graphql_client.clone(),
9738        }
9739    }
9740    /// Encode a string to json
9741    ///
9742    /// # Arguments
9743    ///
9744    /// * `value` - New string value
9745    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
9746        let mut query = self.selection.select("newString");
9747        query = query.arg("value", value.into());
9748        JsonValue {
9749            proc: self.proc.clone(),
9750            selection: query,
9751            graphql_client: self.graphql_client.clone(),
9752        }
9753    }
9754    /// Return a new json value, decoded from the given content
9755    ///
9756    /// # Arguments
9757    ///
9758    /// * `contents` - New JSON-encoded contents
9759    pub fn with_contents(&self, contents: Json) -> JsonValue {
9760        let mut query = self.selection.select("withContents");
9761        query = query.arg("contents", contents);
9762        JsonValue {
9763            proc: self.proc.clone(),
9764            selection: query,
9765            graphql_client: self.graphql_client.clone(),
9766        }
9767    }
9768    /// Set a new field at the given path
9769    ///
9770    /// # Arguments
9771    ///
9772    /// * `path` - Path of the field to set, encoded as an array of field names
9773    /// * `value` - The new value of the field
9774    pub fn with_field(
9775        &self,
9776        path: Vec<impl Into<String>>,
9777        value: impl IntoID<JsonValueId>,
9778    ) -> JsonValue {
9779        let mut query = self.selection.select("withField");
9780        query = query.arg(
9781            "path",
9782            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9783        );
9784        query = query.arg_lazy(
9785            "value",
9786            Box::new(move || {
9787                let value = value.clone();
9788                Box::pin(async move { value.into_id().await.unwrap().quote() })
9789            }),
9790        );
9791        JsonValue {
9792            proc: self.proc.clone(),
9793            selection: query,
9794            graphql_client: self.graphql_client.clone(),
9795        }
9796    }
9797}
9798#[derive(Clone)]
9799pub struct Llm {
9800    pub proc: Option<Arc<DaggerSessionProc>>,
9801    pub selection: Selection,
9802    pub graphql_client: DynGraphQLClient,
9803}
9804impl Llm {
9805    /// create a branch in the LLM's history
9806    pub fn attempt(&self, number: isize) -> Llm {
9807        let mut query = self.selection.select("attempt");
9808        query = query.arg("number", number);
9809        Llm {
9810            proc: self.proc.clone(),
9811            selection: query,
9812            graphql_client: self.graphql_client.clone(),
9813        }
9814    }
9815    /// returns the type of the current state
9816    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
9817        let mut query = self.selection.select("bindResult");
9818        query = query.arg("name", name.into());
9819        Binding {
9820            proc: self.proc.clone(),
9821            selection: query,
9822            graphql_client: self.graphql_client.clone(),
9823        }
9824    }
9825    /// return the LLM's current environment
9826    pub fn env(&self) -> Env {
9827        let query = self.selection.select("env");
9828        Env {
9829            proc: self.proc.clone(),
9830            selection: query,
9831            graphql_client: self.graphql_client.clone(),
9832        }
9833    }
9834    /// Indicates whether there are any queued prompts or tool results to send to the model
9835    pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
9836        let query = self.selection.select("hasPrompt");
9837        query.execute(self.graphql_client.clone()).await
9838    }
9839    /// return the llm message history
9840    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
9841        let query = self.selection.select("history");
9842        query.execute(self.graphql_client.clone()).await
9843    }
9844    /// return the raw llm message history as json
9845    pub async fn history_json(&self) -> Result<Json, DaggerError> {
9846        let query = self.selection.select("historyJSON");
9847        query.execute(self.graphql_client.clone()).await
9848    }
9849    /// A unique identifier for this LLM.
9850    pub async fn id(&self) -> Result<Llmid, DaggerError> {
9851        let query = self.selection.select("id");
9852        query.execute(self.graphql_client.clone()).await
9853    }
9854    /// return the last llm reply from the history
9855    pub async fn last_reply(&self) -> Result<String, DaggerError> {
9856        let query = self.selection.select("lastReply");
9857        query.execute(self.graphql_client.clone()).await
9858    }
9859    /// Submit the queued prompt, evaluate any tool calls, queue their results, and keep going until the model ends its turn
9860    pub fn r#loop(&self) -> Llm {
9861        let query = self.selection.select("loop");
9862        Llm {
9863            proc: self.proc.clone(),
9864            selection: query,
9865            graphql_client: self.graphql_client.clone(),
9866        }
9867    }
9868    /// return the model used by the llm
9869    pub async fn model(&self) -> Result<String, DaggerError> {
9870        let query = self.selection.select("model");
9871        query.execute(self.graphql_client.clone()).await
9872    }
9873    /// return the provider used by the llm
9874    pub async fn provider(&self) -> Result<String, DaggerError> {
9875        let query = self.selection.select("provider");
9876        query.execute(self.graphql_client.clone()).await
9877    }
9878    /// Submit the queued prompt or tool call results, evaluate any tool calls, and queue their results
9879    pub async fn step(&self) -> Result<Llmid, DaggerError> {
9880        let query = self.selection.select("step");
9881        query.execute(self.graphql_client.clone()).await
9882    }
9883    /// synchronize LLM state
9884    pub async fn sync(&self) -> Result<Llmid, DaggerError> {
9885        let query = self.selection.select("sync");
9886        query.execute(self.graphql_client.clone()).await
9887    }
9888    /// returns the token usage of the current state
9889    pub fn token_usage(&self) -> LlmTokenUsage {
9890        let query = self.selection.select("tokenUsage");
9891        LlmTokenUsage {
9892            proc: self.proc.clone(),
9893            selection: query,
9894            graphql_client: self.graphql_client.clone(),
9895        }
9896    }
9897    /// print documentation for available tools
9898    pub async fn tools(&self) -> Result<String, DaggerError> {
9899        let query = self.selection.select("tools");
9900        query.execute(self.graphql_client.clone()).await
9901    }
9902    /// Return a new LLM with the specified function no longer exposed as a tool
9903    ///
9904    /// # Arguments
9905    ///
9906    /// * `type_name` - The type name whose function will be blocked
9907    /// * `function` - The function to block
9908    ///
9909    /// Will be converted to lowerCamelCase if necessary.
9910    pub fn with_blocked_function(
9911        &self,
9912        type_name: impl Into<String>,
9913        function: impl Into<String>,
9914    ) -> Llm {
9915        let mut query = self.selection.select("withBlockedFunction");
9916        query = query.arg("typeName", type_name.into());
9917        query = query.arg("function", function.into());
9918        Llm {
9919            proc: self.proc.clone(),
9920            selection: query,
9921            graphql_client: self.graphql_client.clone(),
9922        }
9923    }
9924    /// allow the LLM to interact with an environment via MCP
9925    pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
9926        let mut query = self.selection.select("withEnv");
9927        query = query.arg_lazy(
9928            "env",
9929            Box::new(move || {
9930                let env = env.clone();
9931                Box::pin(async move { env.into_id().await.unwrap().quote() })
9932            }),
9933        );
9934        Llm {
9935            proc: self.proc.clone(),
9936            selection: query,
9937            graphql_client: self.graphql_client.clone(),
9938        }
9939    }
9940    /// Add an external MCP server to the LLM
9941    ///
9942    /// # Arguments
9943    ///
9944    /// * `name` - The name of the MCP server
9945    /// * `service` - The MCP service to run and communicate with over stdio
9946    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<ServiceId>) -> Llm {
9947        let mut query = self.selection.select("withMCPServer");
9948        query = query.arg("name", name.into());
9949        query = query.arg_lazy(
9950            "service",
9951            Box::new(move || {
9952                let service = service.clone();
9953                Box::pin(async move { service.into_id().await.unwrap().quote() })
9954            }),
9955        );
9956        Llm {
9957            proc: self.proc.clone(),
9958            selection: query,
9959            graphql_client: self.graphql_client.clone(),
9960        }
9961    }
9962    /// swap out the llm model
9963    ///
9964    /// # Arguments
9965    ///
9966    /// * `model` - The model to use
9967    pub fn with_model(&self, model: impl Into<String>) -> Llm {
9968        let mut query = self.selection.select("withModel");
9969        query = query.arg("model", model.into());
9970        Llm {
9971            proc: self.proc.clone(),
9972            selection: query,
9973            graphql_client: self.graphql_client.clone(),
9974        }
9975    }
9976    /// append a prompt to the llm context
9977    ///
9978    /// # Arguments
9979    ///
9980    /// * `prompt` - The prompt to send
9981    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
9982        let mut query = self.selection.select("withPrompt");
9983        query = query.arg("prompt", prompt.into());
9984        Llm {
9985            proc: self.proc.clone(),
9986            selection: query,
9987            graphql_client: self.graphql_client.clone(),
9988        }
9989    }
9990    /// append the contents of a file to the llm context
9991    ///
9992    /// # Arguments
9993    ///
9994    /// * `file` - The file to read the prompt from
9995    pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
9996        let mut query = self.selection.select("withPromptFile");
9997        query = query.arg_lazy(
9998            "file",
9999            Box::new(move || {
10000                let file = file.clone();
10001                Box::pin(async move { file.into_id().await.unwrap().quote() })
10002            }),
10003        );
10004        Llm {
10005            proc: self.proc.clone(),
10006            selection: query,
10007            graphql_client: self.graphql_client.clone(),
10008        }
10009    }
10010    /// Use a static set of tools for method calls, e.g. for MCP clients that do not support dynamic tool registration
10011    pub fn with_static_tools(&self) -> Llm {
10012        let query = self.selection.select("withStaticTools");
10013        Llm {
10014            proc: self.proc.clone(),
10015            selection: query,
10016            graphql_client: self.graphql_client.clone(),
10017        }
10018    }
10019    /// Add a system prompt to the LLM's environment
10020    ///
10021    /// # Arguments
10022    ///
10023    /// * `prompt` - The system prompt to send
10024    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
10025        let mut query = self.selection.select("withSystemPrompt");
10026        query = query.arg("prompt", prompt.into());
10027        Llm {
10028            proc: self.proc.clone(),
10029            selection: query,
10030            graphql_client: self.graphql_client.clone(),
10031        }
10032    }
10033    /// Disable the default system prompt
10034    pub fn without_default_system_prompt(&self) -> Llm {
10035        let query = self.selection.select("withoutDefaultSystemPrompt");
10036        Llm {
10037            proc: self.proc.clone(),
10038            selection: query,
10039            graphql_client: self.graphql_client.clone(),
10040        }
10041    }
10042    /// Clear the message history, leaving only the system prompts
10043    pub fn without_message_history(&self) -> Llm {
10044        let query = self.selection.select("withoutMessageHistory");
10045        Llm {
10046            proc: self.proc.clone(),
10047            selection: query,
10048            graphql_client: self.graphql_client.clone(),
10049        }
10050    }
10051    /// Clear the system prompts, leaving only the default system prompt
10052    pub fn without_system_prompts(&self) -> Llm {
10053        let query = self.selection.select("withoutSystemPrompts");
10054        Llm {
10055            proc: self.proc.clone(),
10056            selection: query,
10057            graphql_client: self.graphql_client.clone(),
10058        }
10059    }
10060}
10061#[derive(Clone)]
10062pub struct LlmTokenUsage {
10063    pub proc: Option<Arc<DaggerSessionProc>>,
10064    pub selection: Selection,
10065    pub graphql_client: DynGraphQLClient,
10066}
10067impl LlmTokenUsage {
10068    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
10069        let query = self.selection.select("cachedTokenReads");
10070        query.execute(self.graphql_client.clone()).await
10071    }
10072    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
10073        let query = self.selection.select("cachedTokenWrites");
10074        query.execute(self.graphql_client.clone()).await
10075    }
10076    /// A unique identifier for this LLMTokenUsage.
10077    pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
10078        let query = self.selection.select("id");
10079        query.execute(self.graphql_client.clone()).await
10080    }
10081    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
10082        let query = self.selection.select("inputTokens");
10083        query.execute(self.graphql_client.clone()).await
10084    }
10085    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
10086        let query = self.selection.select("outputTokens");
10087        query.execute(self.graphql_client.clone()).await
10088    }
10089    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
10090        let query = self.selection.select("totalTokens");
10091        query.execute(self.graphql_client.clone()).await
10092    }
10093}
10094#[derive(Clone)]
10095pub struct Label {
10096    pub proc: Option<Arc<DaggerSessionProc>>,
10097    pub selection: Selection,
10098    pub graphql_client: DynGraphQLClient,
10099}
10100impl Label {
10101    /// A unique identifier for this Label.
10102    pub async fn id(&self) -> Result<LabelId, DaggerError> {
10103        let query = self.selection.select("id");
10104        query.execute(self.graphql_client.clone()).await
10105    }
10106    /// The label name.
10107    pub async fn name(&self) -> Result<String, DaggerError> {
10108        let query = self.selection.select("name");
10109        query.execute(self.graphql_client.clone()).await
10110    }
10111    /// The label value.
10112    pub async fn value(&self) -> Result<String, DaggerError> {
10113        let query = self.selection.select("value");
10114        query.execute(self.graphql_client.clone()).await
10115    }
10116}
10117#[derive(Clone)]
10118pub struct ListTypeDef {
10119    pub proc: Option<Arc<DaggerSessionProc>>,
10120    pub selection: Selection,
10121    pub graphql_client: DynGraphQLClient,
10122}
10123impl ListTypeDef {
10124    /// The type of the elements in the list.
10125    pub fn element_type_def(&self) -> TypeDef {
10126        let query = self.selection.select("elementTypeDef");
10127        TypeDef {
10128            proc: self.proc.clone(),
10129            selection: query,
10130            graphql_client: self.graphql_client.clone(),
10131        }
10132    }
10133    /// A unique identifier for this ListTypeDef.
10134    pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
10135        let query = self.selection.select("id");
10136        query.execute(self.graphql_client.clone()).await
10137    }
10138}
10139#[derive(Clone)]
10140pub struct Module {
10141    pub proc: Option<Arc<DaggerSessionProc>>,
10142    pub selection: Selection,
10143    pub graphql_client: DynGraphQLClient,
10144}
10145#[derive(Builder, Debug, PartialEq)]
10146pub struct ModuleChecksOpts<'a> {
10147    /// Only include checks matching the specified patterns
10148    #[builder(setter(into, strip_option), default)]
10149    pub include: Option<Vec<&'a str>>,
10150}
10151#[derive(Builder, Debug, PartialEq)]
10152pub struct ModuleServeOpts {
10153    /// Expose the dependencies of this module to the client
10154    #[builder(setter(into, strip_option), default)]
10155    pub include_dependencies: Option<bool>,
10156}
10157impl Module {
10158    /// Return the check defined by the module with the given name. Must match to exactly one check.
10159    ///
10160    /// # Arguments
10161    ///
10162    /// * `name` - The name of the check to retrieve
10163    pub fn check(&self, name: impl Into<String>) -> Check {
10164        let mut query = self.selection.select("check");
10165        query = query.arg("name", name.into());
10166        Check {
10167            proc: self.proc.clone(),
10168            selection: query,
10169            graphql_client: self.graphql_client.clone(),
10170        }
10171    }
10172    /// Return all checks defined by the module
10173    ///
10174    /// # Arguments
10175    ///
10176    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10177    pub fn checks(&self) -> CheckGroup {
10178        let query = self.selection.select("checks");
10179        CheckGroup {
10180            proc: self.proc.clone(),
10181            selection: query,
10182            graphql_client: self.graphql_client.clone(),
10183        }
10184    }
10185    /// Return all checks defined by the module
10186    ///
10187    /// # Arguments
10188    ///
10189    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10190    pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
10191        let mut query = self.selection.select("checks");
10192        if let Some(include) = opts.include {
10193            query = query.arg("include", include);
10194        }
10195        CheckGroup {
10196            proc: self.proc.clone(),
10197            selection: query,
10198            graphql_client: self.graphql_client.clone(),
10199        }
10200    }
10201    /// The dependencies of the module.
10202    pub fn dependencies(&self) -> Vec<Module> {
10203        let query = self.selection.select("dependencies");
10204        vec![Module {
10205            proc: self.proc.clone(),
10206            selection: query,
10207            graphql_client: self.graphql_client.clone(),
10208        }]
10209    }
10210    /// The doc string of the module, if any
10211    pub async fn description(&self) -> Result<String, DaggerError> {
10212        let query = self.selection.select("description");
10213        query.execute(self.graphql_client.clone()).await
10214    }
10215    /// Enumerations served by this module.
10216    pub fn enums(&self) -> Vec<TypeDef> {
10217        let query = self.selection.select("enums");
10218        vec![TypeDef {
10219            proc: self.proc.clone(),
10220            selection: query,
10221            graphql_client: self.graphql_client.clone(),
10222        }]
10223    }
10224    /// The generated files and directories made on top of the module source's context directory.
10225    pub fn generated_context_directory(&self) -> Directory {
10226        let query = self.selection.select("generatedContextDirectory");
10227        Directory {
10228            proc: self.proc.clone(),
10229            selection: query,
10230            graphql_client: self.graphql_client.clone(),
10231        }
10232    }
10233    /// A unique identifier for this Module.
10234    pub async fn id(&self) -> Result<ModuleId, DaggerError> {
10235        let query = self.selection.select("id");
10236        query.execute(self.graphql_client.clone()).await
10237    }
10238    /// Interfaces served by this module.
10239    pub fn interfaces(&self) -> Vec<TypeDef> {
10240        let query = self.selection.select("interfaces");
10241        vec![TypeDef {
10242            proc: self.proc.clone(),
10243            selection: query,
10244            graphql_client: self.graphql_client.clone(),
10245        }]
10246    }
10247    /// The introspection schema JSON file for this module.
10248    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
10249    /// Note: this is in the context of a module, so some core types may be hidden.
10250    pub fn introspection_schema_json(&self) -> File {
10251        let query = self.selection.select("introspectionSchemaJSON");
10252        File {
10253            proc: self.proc.clone(),
10254            selection: query,
10255            graphql_client: self.graphql_client.clone(),
10256        }
10257    }
10258    /// The name of the module
10259    pub async fn name(&self) -> Result<String, DaggerError> {
10260        let query = self.selection.select("name");
10261        query.execute(self.graphql_client.clone()).await
10262    }
10263    /// Objects served by this module.
10264    pub fn objects(&self) -> Vec<TypeDef> {
10265        let query = self.selection.select("objects");
10266        vec![TypeDef {
10267            proc: self.proc.clone(),
10268            selection: query,
10269            graphql_client: self.graphql_client.clone(),
10270        }]
10271    }
10272    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
10273    pub fn runtime(&self) -> Container {
10274        let query = self.selection.select("runtime");
10275        Container {
10276            proc: self.proc.clone(),
10277            selection: query,
10278            graphql_client: self.graphql_client.clone(),
10279        }
10280    }
10281    /// The SDK config used by this module.
10282    pub fn sdk(&self) -> SdkConfig {
10283        let query = self.selection.select("sdk");
10284        SdkConfig {
10285            proc: self.proc.clone(),
10286            selection: query,
10287            graphql_client: self.graphql_client.clone(),
10288        }
10289    }
10290    /// Serve a module's API in the current session.
10291    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
10292    ///
10293    /// # Arguments
10294    ///
10295    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10296    pub async fn serve(&self) -> Result<Void, DaggerError> {
10297        let query = self.selection.select("serve");
10298        query.execute(self.graphql_client.clone()).await
10299    }
10300    /// Serve a module's API in the current session.
10301    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
10302    ///
10303    /// # Arguments
10304    ///
10305    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10306    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
10307        let mut query = self.selection.select("serve");
10308        if let Some(include_dependencies) = opts.include_dependencies {
10309            query = query.arg("includeDependencies", include_dependencies);
10310        }
10311        query.execute(self.graphql_client.clone()).await
10312    }
10313    /// The source for the module.
10314    pub fn source(&self) -> ModuleSource {
10315        let query = self.selection.select("source");
10316        ModuleSource {
10317            proc: self.proc.clone(),
10318            selection: query,
10319            graphql_client: self.graphql_client.clone(),
10320        }
10321    }
10322    /// Forces evaluation of the module, including any loading into the engine and associated validation.
10323    pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
10324        let query = self.selection.select("sync");
10325        query.execute(self.graphql_client.clone()).await
10326    }
10327    /// User-defined default values, loaded from local .env files.
10328    pub fn user_defaults(&self) -> EnvFile {
10329        let query = self.selection.select("userDefaults");
10330        EnvFile {
10331            proc: self.proc.clone(),
10332            selection: query,
10333            graphql_client: self.graphql_client.clone(),
10334        }
10335    }
10336    /// Retrieves the module with the given description
10337    ///
10338    /// # Arguments
10339    ///
10340    /// * `description` - The description to set
10341    pub fn with_description(&self, description: impl Into<String>) -> Module {
10342        let mut query = self.selection.select("withDescription");
10343        query = query.arg("description", description.into());
10344        Module {
10345            proc: self.proc.clone(),
10346            selection: query,
10347            graphql_client: self.graphql_client.clone(),
10348        }
10349    }
10350    /// This module plus the given Enum type and associated values
10351    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
10352        let mut query = self.selection.select("withEnum");
10353        query = query.arg_lazy(
10354            "enum",
10355            Box::new(move || {
10356                let r#enum = r#enum.clone();
10357                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
10358            }),
10359        );
10360        Module {
10361            proc: self.proc.clone(),
10362            selection: query,
10363            graphql_client: self.graphql_client.clone(),
10364        }
10365    }
10366    /// This module plus the given Interface type and associated functions
10367    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
10368        let mut query = self.selection.select("withInterface");
10369        query = query.arg_lazy(
10370            "iface",
10371            Box::new(move || {
10372                let iface = iface.clone();
10373                Box::pin(async move { iface.into_id().await.unwrap().quote() })
10374            }),
10375        );
10376        Module {
10377            proc: self.proc.clone(),
10378            selection: query,
10379            graphql_client: self.graphql_client.clone(),
10380        }
10381    }
10382    /// This module plus the given Object type and associated functions.
10383    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
10384        let mut query = self.selection.select("withObject");
10385        query = query.arg_lazy(
10386            "object",
10387            Box::new(move || {
10388                let object = object.clone();
10389                Box::pin(async move { object.into_id().await.unwrap().quote() })
10390            }),
10391        );
10392        Module {
10393            proc: self.proc.clone(),
10394            selection: query,
10395            graphql_client: self.graphql_client.clone(),
10396        }
10397    }
10398}
10399#[derive(Clone)]
10400pub struct ModuleConfigClient {
10401    pub proc: Option<Arc<DaggerSessionProc>>,
10402    pub selection: Selection,
10403    pub graphql_client: DynGraphQLClient,
10404}
10405impl ModuleConfigClient {
10406    /// The directory the client is generated in.
10407    pub async fn directory(&self) -> Result<String, DaggerError> {
10408        let query = self.selection.select("directory");
10409        query.execute(self.graphql_client.clone()).await
10410    }
10411    /// The generator to use
10412    pub async fn generator(&self) -> Result<String, DaggerError> {
10413        let query = self.selection.select("generator");
10414        query.execute(self.graphql_client.clone()).await
10415    }
10416    /// A unique identifier for this ModuleConfigClient.
10417    pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
10418        let query = self.selection.select("id");
10419        query.execute(self.graphql_client.clone()).await
10420    }
10421}
10422#[derive(Clone)]
10423pub struct ModuleSource {
10424    pub proc: Option<Arc<DaggerSessionProc>>,
10425    pub selection: Selection,
10426    pub graphql_client: DynGraphQLClient,
10427}
10428impl ModuleSource {
10429    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
10430    pub fn as_module(&self) -> Module {
10431        let query = self.selection.select("asModule");
10432        Module {
10433            proc: self.proc.clone(),
10434            selection: query,
10435            graphql_client: self.graphql_client.clone(),
10436        }
10437    }
10438    /// A human readable ref string representation of this module source.
10439    pub async fn as_string(&self) -> Result<String, DaggerError> {
10440        let query = self.selection.select("asString");
10441        query.execute(self.graphql_client.clone()).await
10442    }
10443    /// The blueprint referenced by the module source.
10444    pub fn blueprint(&self) -> ModuleSource {
10445        let query = self.selection.select("blueprint");
10446        ModuleSource {
10447            proc: self.proc.clone(),
10448            selection: query,
10449            graphql_client: self.graphql_client.clone(),
10450        }
10451    }
10452    /// The ref to clone the root of the git repo from. Only valid for git sources.
10453    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
10454        let query = self.selection.select("cloneRef");
10455        query.execute(self.graphql_client.clone()).await
10456    }
10457    /// The resolved commit of the git repo this source points to.
10458    pub async fn commit(&self) -> Result<String, DaggerError> {
10459        let query = self.selection.select("commit");
10460        query.execute(self.graphql_client.clone()).await
10461    }
10462    /// The clients generated for the module.
10463    pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
10464        let query = self.selection.select("configClients");
10465        vec![ModuleConfigClient {
10466            proc: self.proc.clone(),
10467            selection: query,
10468            graphql_client: self.graphql_client.clone(),
10469        }]
10470    }
10471    /// Whether an existing dagger.json for the module was found.
10472    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
10473        let query = self.selection.select("configExists");
10474        query.execute(self.graphql_client.clone()).await
10475    }
10476    /// The full directory loaded for the module source, including the source code as a subdirectory.
10477    pub fn context_directory(&self) -> Directory {
10478        let query = self.selection.select("contextDirectory");
10479        Directory {
10480            proc: self.proc.clone(),
10481            selection: query,
10482            graphql_client: self.graphql_client.clone(),
10483        }
10484    }
10485    /// The dependencies of the module source.
10486    pub fn dependencies(&self) -> Vec<ModuleSource> {
10487        let query = self.selection.select("dependencies");
10488        vec![ModuleSource {
10489            proc: self.proc.clone(),
10490            selection: query,
10491            graphql_client: self.graphql_client.clone(),
10492        }]
10493    }
10494    /// 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.
10495    pub async fn digest(&self) -> Result<String, DaggerError> {
10496        let query = self.selection.select("digest");
10497        query.execute(self.graphql_client.clone()).await
10498    }
10499    /// The directory containing the module configuration and source code (source code may be in a subdir).
10500    ///
10501    /// # Arguments
10502    ///
10503    /// * `path` - A subpath from the source directory to select.
10504    pub fn directory(&self, path: impl Into<String>) -> Directory {
10505        let mut query = self.selection.select("directory");
10506        query = query.arg("path", path.into());
10507        Directory {
10508            proc: self.proc.clone(),
10509            selection: query,
10510            graphql_client: self.graphql_client.clone(),
10511        }
10512    }
10513    /// The engine version of the module.
10514    pub async fn engine_version(&self) -> Result<String, DaggerError> {
10515        let query = self.selection.select("engineVersion");
10516        query.execute(self.graphql_client.clone()).await
10517    }
10518    /// The generated files and directories made on top of the module source's context directory.
10519    pub fn generated_context_directory(&self) -> Directory {
10520        let query = self.selection.select("generatedContextDirectory");
10521        Directory {
10522            proc: self.proc.clone(),
10523            selection: query,
10524            graphql_client: self.graphql_client.clone(),
10525        }
10526    }
10527    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
10528    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
10529        let query = self.selection.select("htmlRepoURL");
10530        query.execute(self.graphql_client.clone()).await
10531    }
10532    /// The URL to the source's git repo in a web browser. Only valid for git sources.
10533    pub async fn html_url(&self) -> Result<String, DaggerError> {
10534        let query = self.selection.select("htmlURL");
10535        query.execute(self.graphql_client.clone()).await
10536    }
10537    /// A unique identifier for this ModuleSource.
10538    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
10539        let query = self.selection.select("id");
10540        query.execute(self.graphql_client.clone()).await
10541    }
10542    /// The introspection schema JSON file for this module source.
10543    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
10544    /// Note: this is in the context of a module, so some core types may be hidden.
10545    pub fn introspection_schema_json(&self) -> File {
10546        let query = self.selection.select("introspectionSchemaJSON");
10547        File {
10548            proc: self.proc.clone(),
10549            selection: query,
10550            graphql_client: self.graphql_client.clone(),
10551        }
10552    }
10553    /// The kind of module source (currently local, git or dir).
10554    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
10555        let query = self.selection.select("kind");
10556        query.execute(self.graphql_client.clone()).await
10557    }
10558    /// 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.
10559    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
10560        let query = self.selection.select("localContextDirectoryPath");
10561        query.execute(self.graphql_client.clone()).await
10562    }
10563    /// The name of the module, including any setting via the withName API.
10564    pub async fn module_name(&self) -> Result<String, DaggerError> {
10565        let query = self.selection.select("moduleName");
10566        query.execute(self.graphql_client.clone()).await
10567    }
10568    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
10569    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
10570        let query = self.selection.select("moduleOriginalName");
10571        query.execute(self.graphql_client.clone()).await
10572    }
10573    /// The original subpath used when instantiating this module source, relative to the context directory.
10574    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
10575        let query = self.selection.select("originalSubpath");
10576        query.execute(self.graphql_client.clone()).await
10577    }
10578    /// The pinned version of this module source.
10579    pub async fn pin(&self) -> Result<String, DaggerError> {
10580        let query = self.selection.select("pin");
10581        query.execute(self.graphql_client.clone()).await
10582    }
10583    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
10584    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
10585        let query = self.selection.select("repoRootPath");
10586        query.execute(self.graphql_client.clone()).await
10587    }
10588    /// The SDK configuration of the module.
10589    pub fn sdk(&self) -> SdkConfig {
10590        let query = self.selection.select("sdk");
10591        SdkConfig {
10592            proc: self.proc.clone(),
10593            selection: query,
10594            graphql_client: self.graphql_client.clone(),
10595        }
10596    }
10597    /// The path, relative to the context directory, that contains the module's dagger.json.
10598    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
10599        let query = self.selection.select("sourceRootSubpath");
10600        query.execute(self.graphql_client.clone()).await
10601    }
10602    /// The path to the directory containing the module's source code, relative to the context directory.
10603    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
10604        let query = self.selection.select("sourceSubpath");
10605        query.execute(self.graphql_client.clone()).await
10606    }
10607    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
10608    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
10609        let query = self.selection.select("sync");
10610        query.execute(self.graphql_client.clone()).await
10611    }
10612    /// The toolchains referenced by the module source.
10613    pub fn toolchains(&self) -> Vec<ModuleSource> {
10614        let query = self.selection.select("toolchains");
10615        vec![ModuleSource {
10616            proc: self.proc.clone(),
10617            selection: query,
10618            graphql_client: self.graphql_client.clone(),
10619        }]
10620    }
10621    /// User-defined defaults read from local .env files
10622    pub fn user_defaults(&self) -> EnvFile {
10623        let query = self.selection.select("userDefaults");
10624        EnvFile {
10625            proc: self.proc.clone(),
10626            selection: query,
10627            graphql_client: self.graphql_client.clone(),
10628        }
10629    }
10630    /// The specified version of the git repo this source points to.
10631    pub async fn version(&self) -> Result<String, DaggerError> {
10632        let query = self.selection.select("version");
10633        query.execute(self.graphql_client.clone()).await
10634    }
10635    /// Set a blueprint for the module source.
10636    ///
10637    /// # Arguments
10638    ///
10639    /// * `blueprint` - The blueprint module to set.
10640    pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
10641        let mut query = self.selection.select("withBlueprint");
10642        query = query.arg_lazy(
10643            "blueprint",
10644            Box::new(move || {
10645                let blueprint = blueprint.clone();
10646                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
10647            }),
10648        );
10649        ModuleSource {
10650            proc: self.proc.clone(),
10651            selection: query,
10652            graphql_client: self.graphql_client.clone(),
10653        }
10654    }
10655    /// Update the module source with a new client to generate.
10656    ///
10657    /// # Arguments
10658    ///
10659    /// * `generator` - The generator to use
10660    /// * `output_dir` - The output directory for the generated client.
10661    pub fn with_client(
10662        &self,
10663        generator: impl Into<String>,
10664        output_dir: impl Into<String>,
10665    ) -> ModuleSource {
10666        let mut query = self.selection.select("withClient");
10667        query = query.arg("generator", generator.into());
10668        query = query.arg("outputDir", output_dir.into());
10669        ModuleSource {
10670            proc: self.proc.clone(),
10671            selection: query,
10672            graphql_client: self.graphql_client.clone(),
10673        }
10674    }
10675    /// Append the provided dependencies to the module source's dependency list.
10676    ///
10677    /// # Arguments
10678    ///
10679    /// * `dependencies` - The dependencies to append.
10680    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
10681        let mut query = self.selection.select("withDependencies");
10682        query = query.arg("dependencies", dependencies);
10683        ModuleSource {
10684            proc: self.proc.clone(),
10685            selection: query,
10686            graphql_client: self.graphql_client.clone(),
10687        }
10688    }
10689    /// Upgrade the engine version of the module to the given value.
10690    ///
10691    /// # Arguments
10692    ///
10693    /// * `version` - The engine version to upgrade to.
10694    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
10695        let mut query = self.selection.select("withEngineVersion");
10696        query = query.arg("version", version.into());
10697        ModuleSource {
10698            proc: self.proc.clone(),
10699            selection: query,
10700            graphql_client: self.graphql_client.clone(),
10701        }
10702    }
10703    /// Enable the experimental features for the module source.
10704    ///
10705    /// # Arguments
10706    ///
10707    /// * `features` - The experimental features to enable.
10708    pub fn with_experimental_features(
10709        &self,
10710        features: Vec<ModuleSourceExperimentalFeature>,
10711    ) -> ModuleSource {
10712        let mut query = self.selection.select("withExperimentalFeatures");
10713        query = query.arg("features", features);
10714        ModuleSource {
10715            proc: self.proc.clone(),
10716            selection: query,
10717            graphql_client: self.graphql_client.clone(),
10718        }
10719    }
10720    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
10721    ///
10722    /// # Arguments
10723    ///
10724    /// * `patterns` - The new additional include patterns.
10725    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
10726        let mut query = self.selection.select("withIncludes");
10727        query = query.arg(
10728            "patterns",
10729            patterns
10730                .into_iter()
10731                .map(|i| i.into())
10732                .collect::<Vec<String>>(),
10733        );
10734        ModuleSource {
10735            proc: self.proc.clone(),
10736            selection: query,
10737            graphql_client: self.graphql_client.clone(),
10738        }
10739    }
10740    /// Update the module source with a new name.
10741    ///
10742    /// # Arguments
10743    ///
10744    /// * `name` - The name to set.
10745    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
10746        let mut query = self.selection.select("withName");
10747        query = query.arg("name", name.into());
10748        ModuleSource {
10749            proc: self.proc.clone(),
10750            selection: query,
10751            graphql_client: self.graphql_client.clone(),
10752        }
10753    }
10754    /// Update the module source with a new SDK.
10755    ///
10756    /// # Arguments
10757    ///
10758    /// * `source` - The SDK source to set.
10759    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
10760        let mut query = self.selection.select("withSDK");
10761        query = query.arg("source", source.into());
10762        ModuleSource {
10763            proc: self.proc.clone(),
10764            selection: query,
10765            graphql_client: self.graphql_client.clone(),
10766        }
10767    }
10768    /// Update the module source with a new source subpath.
10769    ///
10770    /// # Arguments
10771    ///
10772    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
10773    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
10774        let mut query = self.selection.select("withSourceSubpath");
10775        query = query.arg("path", path.into());
10776        ModuleSource {
10777            proc: self.proc.clone(),
10778            selection: query,
10779            graphql_client: self.graphql_client.clone(),
10780        }
10781    }
10782    /// Add toolchains to the module source.
10783    ///
10784    /// # Arguments
10785    ///
10786    /// * `toolchains` - The toolchain modules to add.
10787    pub fn with_toolchains(&self, toolchains: Vec<ModuleSourceId>) -> ModuleSource {
10788        let mut query = self.selection.select("withToolchains");
10789        query = query.arg("toolchains", toolchains);
10790        ModuleSource {
10791            proc: self.proc.clone(),
10792            selection: query,
10793            graphql_client: self.graphql_client.clone(),
10794        }
10795    }
10796    /// Update the blueprint module to the latest version.
10797    pub fn with_update_blueprint(&self) -> ModuleSource {
10798        let query = self.selection.select("withUpdateBlueprint");
10799        ModuleSource {
10800            proc: self.proc.clone(),
10801            selection: query,
10802            graphql_client: self.graphql_client.clone(),
10803        }
10804    }
10805    /// Update one or more module dependencies.
10806    ///
10807    /// # Arguments
10808    ///
10809    /// * `dependencies` - The dependencies to update.
10810    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
10811        let mut query = self.selection.select("withUpdateDependencies");
10812        query = query.arg(
10813            "dependencies",
10814            dependencies
10815                .into_iter()
10816                .map(|i| i.into())
10817                .collect::<Vec<String>>(),
10818        );
10819        ModuleSource {
10820            proc: self.proc.clone(),
10821            selection: query,
10822            graphql_client: self.graphql_client.clone(),
10823        }
10824    }
10825    /// Update one or more toolchains.
10826    ///
10827    /// # Arguments
10828    ///
10829    /// * `toolchains` - The toolchains to update.
10830    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
10831        let mut query = self.selection.select("withUpdateToolchains");
10832        query = query.arg(
10833            "toolchains",
10834            toolchains
10835                .into_iter()
10836                .map(|i| i.into())
10837                .collect::<Vec<String>>(),
10838        );
10839        ModuleSource {
10840            proc: self.proc.clone(),
10841            selection: query,
10842            graphql_client: self.graphql_client.clone(),
10843        }
10844    }
10845    /// Update one or more clients.
10846    ///
10847    /// # Arguments
10848    ///
10849    /// * `clients` - The clients to update
10850    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
10851        let mut query = self.selection.select("withUpdatedClients");
10852        query = query.arg(
10853            "clients",
10854            clients
10855                .into_iter()
10856                .map(|i| i.into())
10857                .collect::<Vec<String>>(),
10858        );
10859        ModuleSource {
10860            proc: self.proc.clone(),
10861            selection: query,
10862            graphql_client: self.graphql_client.clone(),
10863        }
10864    }
10865    /// Remove the current blueprint from the module source.
10866    pub fn without_blueprint(&self) -> ModuleSource {
10867        let query = self.selection.select("withoutBlueprint");
10868        ModuleSource {
10869            proc: self.proc.clone(),
10870            selection: query,
10871            graphql_client: self.graphql_client.clone(),
10872        }
10873    }
10874    /// Remove a client from the module source.
10875    ///
10876    /// # Arguments
10877    ///
10878    /// * `path` - The path of the client to remove.
10879    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
10880        let mut query = self.selection.select("withoutClient");
10881        query = query.arg("path", path.into());
10882        ModuleSource {
10883            proc: self.proc.clone(),
10884            selection: query,
10885            graphql_client: self.graphql_client.clone(),
10886        }
10887    }
10888    /// Remove the provided dependencies from the module source's dependency list.
10889    ///
10890    /// # Arguments
10891    ///
10892    /// * `dependencies` - The dependencies to remove.
10893    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
10894        let mut query = self.selection.select("withoutDependencies");
10895        query = query.arg(
10896            "dependencies",
10897            dependencies
10898                .into_iter()
10899                .map(|i| i.into())
10900                .collect::<Vec<String>>(),
10901        );
10902        ModuleSource {
10903            proc: self.proc.clone(),
10904            selection: query,
10905            graphql_client: self.graphql_client.clone(),
10906        }
10907    }
10908    /// Disable experimental features for the module source.
10909    ///
10910    /// # Arguments
10911    ///
10912    /// * `features` - The experimental features to disable.
10913    pub fn without_experimental_features(
10914        &self,
10915        features: Vec<ModuleSourceExperimentalFeature>,
10916    ) -> ModuleSource {
10917        let mut query = self.selection.select("withoutExperimentalFeatures");
10918        query = query.arg("features", features);
10919        ModuleSource {
10920            proc: self.proc.clone(),
10921            selection: query,
10922            graphql_client: self.graphql_client.clone(),
10923        }
10924    }
10925    /// Remove the provided toolchains from the module source.
10926    ///
10927    /// # Arguments
10928    ///
10929    /// * `toolchains` - The toolchains to remove.
10930    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
10931        let mut query = self.selection.select("withoutToolchains");
10932        query = query.arg(
10933            "toolchains",
10934            toolchains
10935                .into_iter()
10936                .map(|i| i.into())
10937                .collect::<Vec<String>>(),
10938        );
10939        ModuleSource {
10940            proc: self.proc.clone(),
10941            selection: query,
10942            graphql_client: self.graphql_client.clone(),
10943        }
10944    }
10945}
10946#[derive(Clone)]
10947pub struct ObjectTypeDef {
10948    pub proc: Option<Arc<DaggerSessionProc>>,
10949    pub selection: Selection,
10950    pub graphql_client: DynGraphQLClient,
10951}
10952impl ObjectTypeDef {
10953    /// The function used to construct new instances of this object, if any
10954    pub fn constructor(&self) -> Function {
10955        let query = self.selection.select("constructor");
10956        Function {
10957            proc: self.proc.clone(),
10958            selection: query,
10959            graphql_client: self.graphql_client.clone(),
10960        }
10961    }
10962    /// The reason this enum member is deprecated, if any.
10963    pub async fn deprecated(&self) -> Result<String, DaggerError> {
10964        let query = self.selection.select("deprecated");
10965        query.execute(self.graphql_client.clone()).await
10966    }
10967    /// The doc string for the object, if any.
10968    pub async fn description(&self) -> Result<String, DaggerError> {
10969        let query = self.selection.select("description");
10970        query.execute(self.graphql_client.clone()).await
10971    }
10972    /// Static fields defined on this object, if any.
10973    pub fn fields(&self) -> Vec<FieldTypeDef> {
10974        let query = self.selection.select("fields");
10975        vec![FieldTypeDef {
10976            proc: self.proc.clone(),
10977            selection: query,
10978            graphql_client: self.graphql_client.clone(),
10979        }]
10980    }
10981    /// Functions defined on this object, if any.
10982    pub fn functions(&self) -> Vec<Function> {
10983        let query = self.selection.select("functions");
10984        vec![Function {
10985            proc: self.proc.clone(),
10986            selection: query,
10987            graphql_client: self.graphql_client.clone(),
10988        }]
10989    }
10990    /// A unique identifier for this ObjectTypeDef.
10991    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
10992        let query = self.selection.select("id");
10993        query.execute(self.graphql_client.clone()).await
10994    }
10995    /// The name of the object.
10996    pub async fn name(&self) -> Result<String, DaggerError> {
10997        let query = self.selection.select("name");
10998        query.execute(self.graphql_client.clone()).await
10999    }
11000    /// The location of this object declaration.
11001    pub fn source_map(&self) -> SourceMap {
11002        let query = self.selection.select("sourceMap");
11003        SourceMap {
11004            proc: self.proc.clone(),
11005            selection: query,
11006            graphql_client: self.graphql_client.clone(),
11007        }
11008    }
11009    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
11010    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
11011        let query = self.selection.select("sourceModuleName");
11012        query.execute(self.graphql_client.clone()).await
11013    }
11014}
11015#[derive(Clone)]
11016pub struct Port {
11017    pub proc: Option<Arc<DaggerSessionProc>>,
11018    pub selection: Selection,
11019    pub graphql_client: DynGraphQLClient,
11020}
11021impl Port {
11022    /// The port description.
11023    pub async fn description(&self) -> Result<String, DaggerError> {
11024        let query = self.selection.select("description");
11025        query.execute(self.graphql_client.clone()).await
11026    }
11027    /// Skip the health check when run as a service.
11028    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
11029        let query = self.selection.select("experimentalSkipHealthcheck");
11030        query.execute(self.graphql_client.clone()).await
11031    }
11032    /// A unique identifier for this Port.
11033    pub async fn id(&self) -> Result<PortId, DaggerError> {
11034        let query = self.selection.select("id");
11035        query.execute(self.graphql_client.clone()).await
11036    }
11037    /// The port number.
11038    pub async fn port(&self) -> Result<isize, DaggerError> {
11039        let query = self.selection.select("port");
11040        query.execute(self.graphql_client.clone()).await
11041    }
11042    /// The transport layer protocol.
11043    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
11044        let query = self.selection.select("protocol");
11045        query.execute(self.graphql_client.clone()).await
11046    }
11047}
11048#[derive(Clone)]
11049pub struct Query {
11050    pub proc: Option<Arc<DaggerSessionProc>>,
11051    pub selection: Selection,
11052    pub graphql_client: DynGraphQLClient,
11053}
11054#[derive(Builder, Debug, PartialEq)]
11055pub struct QueryContainerOpts {
11056    /// Platform to initialize the container with. Defaults to the native platform of the current engine
11057    #[builder(setter(into, strip_option), default)]
11058    pub platform: Option<Platform>,
11059}
11060#[derive(Builder, Debug, PartialEq)]
11061pub struct QueryEnvOpts {
11062    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
11063    #[builder(setter(into, strip_option), default)]
11064    pub privileged: Option<bool>,
11065    /// Allow new outputs to be declared and saved in the environment
11066    #[builder(setter(into, strip_option), default)]
11067    pub writable: Option<bool>,
11068}
11069#[derive(Builder, Debug, PartialEq)]
11070pub struct QueryEnvFileOpts {
11071    /// Replace "${VAR}" or "$VAR" with the value of other vars
11072    #[builder(setter(into, strip_option), default)]
11073    pub expand: Option<bool>,
11074}
11075#[derive(Builder, Debug, PartialEq)]
11076pub struct QueryFileOpts {
11077    /// Permissions of the new file. Example: 0600
11078    #[builder(setter(into, strip_option), default)]
11079    pub permissions: Option<isize>,
11080}
11081#[derive(Builder, Debug, PartialEq)]
11082pub struct QueryGitOpts<'a> {
11083    /// A service which must be started before the repo is fetched.
11084    #[builder(setter(into, strip_option), default)]
11085    pub experimental_service_host: Option<ServiceId>,
11086    /// Secret used to populate the Authorization HTTP header
11087    #[builder(setter(into, strip_option), default)]
11088    pub http_auth_header: Option<SecretId>,
11089    /// Secret used to populate the password during basic HTTP Authorization
11090    #[builder(setter(into, strip_option), default)]
11091    pub http_auth_token: Option<SecretId>,
11092    /// Username used to populate the password during basic HTTP Authorization
11093    #[builder(setter(into, strip_option), default)]
11094    pub http_auth_username: Option<&'a str>,
11095    /// DEPRECATED: Set to true to keep .git directory.
11096    #[builder(setter(into, strip_option), default)]
11097    pub keep_git_dir: Option<bool>,
11098    /// Set SSH auth socket
11099    #[builder(setter(into, strip_option), default)]
11100    pub ssh_auth_socket: Option<SocketId>,
11101    /// Set SSH known hosts
11102    #[builder(setter(into, strip_option), default)]
11103    pub ssh_known_hosts: Option<&'a str>,
11104}
11105#[derive(Builder, Debug, PartialEq)]
11106pub struct QueryHttpOpts<'a> {
11107    /// Secret used to populate the Authorization HTTP header
11108    #[builder(setter(into, strip_option), default)]
11109    pub auth_header: Option<SecretId>,
11110    /// A service which must be started before the URL is fetched.
11111    #[builder(setter(into, strip_option), default)]
11112    pub experimental_service_host: Option<ServiceId>,
11113    /// File name to use for the file. Defaults to the last part of the URL.
11114    #[builder(setter(into, strip_option), default)]
11115    pub name: Option<&'a str>,
11116    /// Permissions to set on the file.
11117    #[builder(setter(into, strip_option), default)]
11118    pub permissions: Option<isize>,
11119}
11120#[derive(Builder, Debug, PartialEq)]
11121pub struct QueryLlmOpts<'a> {
11122    /// Cap the number of API calls for this LLM
11123    #[builder(setter(into, strip_option), default)]
11124    pub max_api_calls: Option<isize>,
11125    /// Model to use
11126    #[builder(setter(into, strip_option), default)]
11127    pub model: Option<&'a str>,
11128}
11129#[derive(Builder, Debug, PartialEq)]
11130pub struct QueryModuleSourceOpts<'a> {
11131    /// 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.
11132    #[builder(setter(into, strip_option), default)]
11133    pub allow_not_exists: Option<bool>,
11134    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
11135    #[builder(setter(into, strip_option), default)]
11136    pub disable_find_up: Option<bool>,
11137    /// The pinned version of the module source
11138    #[builder(setter(into, strip_option), default)]
11139    pub ref_pin: Option<&'a str>,
11140    /// If set, error out if the ref string is not of the provided requireKind.
11141    #[builder(setter(into, strip_option), default)]
11142    pub require_kind: Option<ModuleSourceKind>,
11143}
11144#[derive(Builder, Debug, PartialEq)]
11145pub struct QuerySecretOpts<'a> {
11146    /// 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.
11147    /// 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.
11148    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
11149    #[builder(setter(into, strip_option), default)]
11150    pub cache_key: Option<&'a str>,
11151}
11152impl Query {
11153    /// initialize an address to load directories, containers, secrets or other object types.
11154    pub fn address(&self, value: impl Into<String>) -> Address {
11155        let mut query = self.selection.select("address");
11156        query = query.arg("value", value.into());
11157        Address {
11158            proc: self.proc.clone(),
11159            selection: query,
11160            graphql_client: self.graphql_client.clone(),
11161        }
11162    }
11163    /// Constructs a cache volume for a given cache key.
11164    ///
11165    /// # Arguments
11166    ///
11167    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
11168    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
11169        let mut query = self.selection.select("cacheVolume");
11170        query = query.arg("key", key.into());
11171        CacheVolume {
11172            proc: self.proc.clone(),
11173            selection: query,
11174            graphql_client: self.graphql_client.clone(),
11175        }
11176    }
11177    /// Dagger Cloud configuration and state
11178    pub fn cloud(&self) -> Cloud {
11179        let query = self.selection.select("cloud");
11180        Cloud {
11181            proc: self.proc.clone(),
11182            selection: query,
11183            graphql_client: self.graphql_client.clone(),
11184        }
11185    }
11186    /// Creates a scratch container, with no image or metadata.
11187    /// To pull an image, follow up with the "from" function.
11188    ///
11189    /// # Arguments
11190    ///
11191    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11192    pub fn container(&self) -> Container {
11193        let query = self.selection.select("container");
11194        Container {
11195            proc: self.proc.clone(),
11196            selection: query,
11197            graphql_client: self.graphql_client.clone(),
11198        }
11199    }
11200    /// Creates a scratch container, with no image or metadata.
11201    /// To pull an image, follow up with the "from" function.
11202    ///
11203    /// # Arguments
11204    ///
11205    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11206    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
11207        let mut query = self.selection.select("container");
11208        if let Some(platform) = opts.platform {
11209            query = query.arg("platform", platform);
11210        }
11211        Container {
11212            proc: self.proc.clone(),
11213            selection: query,
11214            graphql_client: self.graphql_client.clone(),
11215        }
11216    }
11217    /// Returns the current environment
11218    /// 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.
11219    /// 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.
11220    pub fn current_env(&self) -> Env {
11221        let query = self.selection.select("currentEnv");
11222        Env {
11223            proc: self.proc.clone(),
11224            selection: query,
11225            graphql_client: self.graphql_client.clone(),
11226        }
11227    }
11228    /// The FunctionCall context that the SDK caller is currently executing in.
11229    /// If the caller is not currently executing in a function, this will return an error.
11230    pub fn current_function_call(&self) -> FunctionCall {
11231        let query = self.selection.select("currentFunctionCall");
11232        FunctionCall {
11233            proc: self.proc.clone(),
11234            selection: query,
11235            graphql_client: self.graphql_client.clone(),
11236        }
11237    }
11238    /// The module currently being served in the session, if any.
11239    pub fn current_module(&self) -> CurrentModule {
11240        let query = self.selection.select("currentModule");
11241        CurrentModule {
11242            proc: self.proc.clone(),
11243            selection: query,
11244            graphql_client: self.graphql_client.clone(),
11245        }
11246    }
11247    /// The TypeDef representations of the objects currently being served in the session.
11248    pub fn current_type_defs(&self) -> Vec<TypeDef> {
11249        let query = self.selection.select("currentTypeDefs");
11250        vec![TypeDef {
11251            proc: self.proc.clone(),
11252            selection: query,
11253            graphql_client: self.graphql_client.clone(),
11254        }]
11255    }
11256    /// The default platform of the engine.
11257    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
11258        let query = self.selection.select("defaultPlatform");
11259        query.execute(self.graphql_client.clone()).await
11260    }
11261    /// Creates an empty directory.
11262    pub fn directory(&self) -> Directory {
11263        let query = self.selection.select("directory");
11264        Directory {
11265            proc: self.proc.clone(),
11266            selection: query,
11267            graphql_client: self.graphql_client.clone(),
11268        }
11269    }
11270    /// The Dagger engine container configuration and state
11271    pub fn engine(&self) -> Engine {
11272        let query = self.selection.select("engine");
11273        Engine {
11274            proc: self.proc.clone(),
11275            selection: query,
11276            graphql_client: self.graphql_client.clone(),
11277        }
11278    }
11279    /// Initializes a new environment
11280    ///
11281    /// # Arguments
11282    ///
11283    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11284    pub fn env(&self) -> Env {
11285        let query = self.selection.select("env");
11286        Env {
11287            proc: self.proc.clone(),
11288            selection: query,
11289            graphql_client: self.graphql_client.clone(),
11290        }
11291    }
11292    /// Initializes a new environment
11293    ///
11294    /// # Arguments
11295    ///
11296    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11297    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
11298        let mut query = self.selection.select("env");
11299        if let Some(privileged) = opts.privileged {
11300            query = query.arg("privileged", privileged);
11301        }
11302        if let Some(writable) = opts.writable {
11303            query = query.arg("writable", writable);
11304        }
11305        Env {
11306            proc: self.proc.clone(),
11307            selection: query,
11308            graphql_client: self.graphql_client.clone(),
11309        }
11310    }
11311    /// Initialize an environment file
11312    ///
11313    /// # Arguments
11314    ///
11315    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11316    pub fn env_file(&self) -> EnvFile {
11317        let query = self.selection.select("envFile");
11318        EnvFile {
11319            proc: self.proc.clone(),
11320            selection: query,
11321            graphql_client: self.graphql_client.clone(),
11322        }
11323    }
11324    /// Initialize an environment file
11325    ///
11326    /// # Arguments
11327    ///
11328    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11329    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
11330        let mut query = self.selection.select("envFile");
11331        if let Some(expand) = opts.expand {
11332            query = query.arg("expand", expand);
11333        }
11334        EnvFile {
11335            proc: self.proc.clone(),
11336            selection: query,
11337            graphql_client: self.graphql_client.clone(),
11338        }
11339    }
11340    /// Create a new error.
11341    ///
11342    /// # Arguments
11343    ///
11344    /// * `message` - A brief description of the error.
11345    pub fn error(&self, message: impl Into<String>) -> Error {
11346        let mut query = self.selection.select("error");
11347        query = query.arg("message", message.into());
11348        Error {
11349            proc: self.proc.clone(),
11350            selection: query,
11351            graphql_client: self.graphql_client.clone(),
11352        }
11353    }
11354    /// Creates a file with the specified contents.
11355    ///
11356    /// # Arguments
11357    ///
11358    /// * `name` - Name of the new file. Example: "foo.txt"
11359    /// * `contents` - Contents of the new file. Example: "Hello world!"
11360    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11361    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
11362        let mut query = self.selection.select("file");
11363        query = query.arg("name", name.into());
11364        query = query.arg("contents", contents.into());
11365        File {
11366            proc: self.proc.clone(),
11367            selection: query,
11368            graphql_client: self.graphql_client.clone(),
11369        }
11370    }
11371    /// Creates a file with the specified contents.
11372    ///
11373    /// # Arguments
11374    ///
11375    /// * `name` - Name of the new file. Example: "foo.txt"
11376    /// * `contents` - Contents of the new file. Example: "Hello world!"
11377    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11378    pub fn file_opts(
11379        &self,
11380        name: impl Into<String>,
11381        contents: impl Into<String>,
11382        opts: QueryFileOpts,
11383    ) -> File {
11384        let mut query = self.selection.select("file");
11385        query = query.arg("name", name.into());
11386        query = query.arg("contents", contents.into());
11387        if let Some(permissions) = opts.permissions {
11388            query = query.arg("permissions", permissions);
11389        }
11390        File {
11391            proc: self.proc.clone(),
11392            selection: query,
11393            graphql_client: self.graphql_client.clone(),
11394        }
11395    }
11396    /// Creates a function.
11397    ///
11398    /// # Arguments
11399    ///
11400    /// * `name` - Name of the function, in its original format from the implementation language.
11401    /// * `return_type` - Return type of the function.
11402    pub fn function(
11403        &self,
11404        name: impl Into<String>,
11405        return_type: impl IntoID<TypeDefId>,
11406    ) -> Function {
11407        let mut query = self.selection.select("function");
11408        query = query.arg("name", name.into());
11409        query = query.arg_lazy(
11410            "returnType",
11411            Box::new(move || {
11412                let return_type = return_type.clone();
11413                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
11414            }),
11415        );
11416        Function {
11417            proc: self.proc.clone(),
11418            selection: query,
11419            graphql_client: self.graphql_client.clone(),
11420        }
11421    }
11422    /// Create a code generation result, given a directory containing the generated code.
11423    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
11424        let mut query = self.selection.select("generatedCode");
11425        query = query.arg_lazy(
11426            "code",
11427            Box::new(move || {
11428                let code = code.clone();
11429                Box::pin(async move { code.into_id().await.unwrap().quote() })
11430            }),
11431        );
11432        GeneratedCode {
11433            proc: self.proc.clone(),
11434            selection: query,
11435            graphql_client: self.graphql_client.clone(),
11436        }
11437    }
11438    /// Queries a Git repository.
11439    ///
11440    /// # Arguments
11441    ///
11442    /// * `url` - URL of the git repository.
11443    ///
11444    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
11445    ///
11446    /// Suffix ".git" is optional.
11447    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11448    pub fn git(&self, url: impl Into<String>) -> GitRepository {
11449        let mut query = self.selection.select("git");
11450        query = query.arg("url", url.into());
11451        GitRepository {
11452            proc: self.proc.clone(),
11453            selection: query,
11454            graphql_client: self.graphql_client.clone(),
11455        }
11456    }
11457    /// Queries a Git repository.
11458    ///
11459    /// # Arguments
11460    ///
11461    /// * `url` - URL of the git repository.
11462    ///
11463    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
11464    ///
11465    /// Suffix ".git" is optional.
11466    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11467    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
11468        let mut query = self.selection.select("git");
11469        query = query.arg("url", url.into());
11470        if let Some(keep_git_dir) = opts.keep_git_dir {
11471            query = query.arg("keepGitDir", keep_git_dir);
11472        }
11473        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
11474            query = query.arg("sshKnownHosts", ssh_known_hosts);
11475        }
11476        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
11477            query = query.arg("sshAuthSocket", ssh_auth_socket);
11478        }
11479        if let Some(http_auth_username) = opts.http_auth_username {
11480            query = query.arg("httpAuthUsername", http_auth_username);
11481        }
11482        if let Some(http_auth_token) = opts.http_auth_token {
11483            query = query.arg("httpAuthToken", http_auth_token);
11484        }
11485        if let Some(http_auth_header) = opts.http_auth_header {
11486            query = query.arg("httpAuthHeader", http_auth_header);
11487        }
11488        if let Some(experimental_service_host) = opts.experimental_service_host {
11489            query = query.arg("experimentalServiceHost", experimental_service_host);
11490        }
11491        GitRepository {
11492            proc: self.proc.clone(),
11493            selection: query,
11494            graphql_client: self.graphql_client.clone(),
11495        }
11496    }
11497    /// Queries the host environment.
11498    pub fn host(&self) -> Host {
11499        let query = self.selection.select("host");
11500        Host {
11501            proc: self.proc.clone(),
11502            selection: query,
11503            graphql_client: self.graphql_client.clone(),
11504        }
11505    }
11506    /// Returns a file containing an http remote url content.
11507    ///
11508    /// # Arguments
11509    ///
11510    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
11511    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11512    pub fn http(&self, url: impl Into<String>) -> File {
11513        let mut query = self.selection.select("http");
11514        query = query.arg("url", url.into());
11515        File {
11516            proc: self.proc.clone(),
11517            selection: query,
11518            graphql_client: self.graphql_client.clone(),
11519        }
11520    }
11521    /// Returns a file containing an http remote url content.
11522    ///
11523    /// # Arguments
11524    ///
11525    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
11526    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11527    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
11528        let mut query = self.selection.select("http");
11529        query = query.arg("url", url.into());
11530        if let Some(name) = opts.name {
11531            query = query.arg("name", name);
11532        }
11533        if let Some(permissions) = opts.permissions {
11534            query = query.arg("permissions", permissions);
11535        }
11536        if let Some(auth_header) = opts.auth_header {
11537            query = query.arg("authHeader", auth_header);
11538        }
11539        if let Some(experimental_service_host) = opts.experimental_service_host {
11540            query = query.arg("experimentalServiceHost", experimental_service_host);
11541        }
11542        File {
11543            proc: self.proc.clone(),
11544            selection: query,
11545            graphql_client: self.graphql_client.clone(),
11546        }
11547    }
11548    /// Initialize a JSON value
11549    pub fn json(&self) -> JsonValue {
11550        let query = self.selection.select("json");
11551        JsonValue {
11552            proc: self.proc.clone(),
11553            selection: query,
11554            graphql_client: self.graphql_client.clone(),
11555        }
11556    }
11557    /// Initialize a Large Language Model (LLM)
11558    ///
11559    /// # Arguments
11560    ///
11561    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11562    pub fn llm(&self) -> Llm {
11563        let query = self.selection.select("llm");
11564        Llm {
11565            proc: self.proc.clone(),
11566            selection: query,
11567            graphql_client: self.graphql_client.clone(),
11568        }
11569    }
11570    /// Initialize a Large Language Model (LLM)
11571    ///
11572    /// # Arguments
11573    ///
11574    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11575    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
11576        let mut query = self.selection.select("llm");
11577        if let Some(model) = opts.model {
11578            query = query.arg("model", model);
11579        }
11580        if let Some(max_api_calls) = opts.max_api_calls {
11581            query = query.arg("maxAPICalls", max_api_calls);
11582        }
11583        Llm {
11584            proc: self.proc.clone(),
11585            selection: query,
11586            graphql_client: self.graphql_client.clone(),
11587        }
11588    }
11589    /// Load a Address from its ID.
11590    pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
11591        let mut query = self.selection.select("loadAddressFromID");
11592        query = query.arg_lazy(
11593            "id",
11594            Box::new(move || {
11595                let id = id.clone();
11596                Box::pin(async move { id.into_id().await.unwrap().quote() })
11597            }),
11598        );
11599        Address {
11600            proc: self.proc.clone(),
11601            selection: query,
11602            graphql_client: self.graphql_client.clone(),
11603        }
11604    }
11605    /// Load a Binding from its ID.
11606    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
11607        let mut query = self.selection.select("loadBindingFromID");
11608        query = query.arg_lazy(
11609            "id",
11610            Box::new(move || {
11611                let id = id.clone();
11612                Box::pin(async move { id.into_id().await.unwrap().quote() })
11613            }),
11614        );
11615        Binding {
11616            proc: self.proc.clone(),
11617            selection: query,
11618            graphql_client: self.graphql_client.clone(),
11619        }
11620    }
11621    /// Load a CacheVolume from its ID.
11622    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
11623        let mut query = self.selection.select("loadCacheVolumeFromID");
11624        query = query.arg_lazy(
11625            "id",
11626            Box::new(move || {
11627                let id = id.clone();
11628                Box::pin(async move { id.into_id().await.unwrap().quote() })
11629            }),
11630        );
11631        CacheVolume {
11632            proc: self.proc.clone(),
11633            selection: query,
11634            graphql_client: self.graphql_client.clone(),
11635        }
11636    }
11637    /// Load a Changeset from its ID.
11638    pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
11639        let mut query = self.selection.select("loadChangesetFromID");
11640        query = query.arg_lazy(
11641            "id",
11642            Box::new(move || {
11643                let id = id.clone();
11644                Box::pin(async move { id.into_id().await.unwrap().quote() })
11645            }),
11646        );
11647        Changeset {
11648            proc: self.proc.clone(),
11649            selection: query,
11650            graphql_client: self.graphql_client.clone(),
11651        }
11652    }
11653    /// Load a Check from its ID.
11654    pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
11655        let mut query = self.selection.select("loadCheckFromID");
11656        query = query.arg_lazy(
11657            "id",
11658            Box::new(move || {
11659                let id = id.clone();
11660                Box::pin(async move { id.into_id().await.unwrap().quote() })
11661            }),
11662        );
11663        Check {
11664            proc: self.proc.clone(),
11665            selection: query,
11666            graphql_client: self.graphql_client.clone(),
11667        }
11668    }
11669    /// Load a CheckGroup from its ID.
11670    pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
11671        let mut query = self.selection.select("loadCheckGroupFromID");
11672        query = query.arg_lazy(
11673            "id",
11674            Box::new(move || {
11675                let id = id.clone();
11676                Box::pin(async move { id.into_id().await.unwrap().quote() })
11677            }),
11678        );
11679        CheckGroup {
11680            proc: self.proc.clone(),
11681            selection: query,
11682            graphql_client: self.graphql_client.clone(),
11683        }
11684    }
11685    /// Load a Cloud from its ID.
11686    pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
11687        let mut query = self.selection.select("loadCloudFromID");
11688        query = query.arg_lazy(
11689            "id",
11690            Box::new(move || {
11691                let id = id.clone();
11692                Box::pin(async move { id.into_id().await.unwrap().quote() })
11693            }),
11694        );
11695        Cloud {
11696            proc: self.proc.clone(),
11697            selection: query,
11698            graphql_client: self.graphql_client.clone(),
11699        }
11700    }
11701    /// Load a Container from its ID.
11702    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
11703        let mut query = self.selection.select("loadContainerFromID");
11704        query = query.arg_lazy(
11705            "id",
11706            Box::new(move || {
11707                let id = id.clone();
11708                Box::pin(async move { id.into_id().await.unwrap().quote() })
11709            }),
11710        );
11711        Container {
11712            proc: self.proc.clone(),
11713            selection: query,
11714            graphql_client: self.graphql_client.clone(),
11715        }
11716    }
11717    /// Load a CurrentModule from its ID.
11718    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
11719        let mut query = self.selection.select("loadCurrentModuleFromID");
11720        query = query.arg_lazy(
11721            "id",
11722            Box::new(move || {
11723                let id = id.clone();
11724                Box::pin(async move { id.into_id().await.unwrap().quote() })
11725            }),
11726        );
11727        CurrentModule {
11728            proc: self.proc.clone(),
11729            selection: query,
11730            graphql_client: self.graphql_client.clone(),
11731        }
11732    }
11733    /// Load a Directory from its ID.
11734    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
11735        let mut query = self.selection.select("loadDirectoryFromID");
11736        query = query.arg_lazy(
11737            "id",
11738            Box::new(move || {
11739                let id = id.clone();
11740                Box::pin(async move { id.into_id().await.unwrap().quote() })
11741            }),
11742        );
11743        Directory {
11744            proc: self.proc.clone(),
11745            selection: query,
11746            graphql_client: self.graphql_client.clone(),
11747        }
11748    }
11749    /// Load a EngineCacheEntry from its ID.
11750    pub fn load_engine_cache_entry_from_id(
11751        &self,
11752        id: impl IntoID<EngineCacheEntryId>,
11753    ) -> EngineCacheEntry {
11754        let mut query = self.selection.select("loadEngineCacheEntryFromID");
11755        query = query.arg_lazy(
11756            "id",
11757            Box::new(move || {
11758                let id = id.clone();
11759                Box::pin(async move { id.into_id().await.unwrap().quote() })
11760            }),
11761        );
11762        EngineCacheEntry {
11763            proc: self.proc.clone(),
11764            selection: query,
11765            graphql_client: self.graphql_client.clone(),
11766        }
11767    }
11768    /// Load a EngineCacheEntrySet from its ID.
11769    pub fn load_engine_cache_entry_set_from_id(
11770        &self,
11771        id: impl IntoID<EngineCacheEntrySetId>,
11772    ) -> EngineCacheEntrySet {
11773        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
11774        query = query.arg_lazy(
11775            "id",
11776            Box::new(move || {
11777                let id = id.clone();
11778                Box::pin(async move { id.into_id().await.unwrap().quote() })
11779            }),
11780        );
11781        EngineCacheEntrySet {
11782            proc: self.proc.clone(),
11783            selection: query,
11784            graphql_client: self.graphql_client.clone(),
11785        }
11786    }
11787    /// Load a EngineCache from its ID.
11788    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
11789        let mut query = self.selection.select("loadEngineCacheFromID");
11790        query = query.arg_lazy(
11791            "id",
11792            Box::new(move || {
11793                let id = id.clone();
11794                Box::pin(async move { id.into_id().await.unwrap().quote() })
11795            }),
11796        );
11797        EngineCache {
11798            proc: self.proc.clone(),
11799            selection: query,
11800            graphql_client: self.graphql_client.clone(),
11801        }
11802    }
11803    /// Load a Engine from its ID.
11804    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
11805        let mut query = self.selection.select("loadEngineFromID");
11806        query = query.arg_lazy(
11807            "id",
11808            Box::new(move || {
11809                let id = id.clone();
11810                Box::pin(async move { id.into_id().await.unwrap().quote() })
11811            }),
11812        );
11813        Engine {
11814            proc: self.proc.clone(),
11815            selection: query,
11816            graphql_client: self.graphql_client.clone(),
11817        }
11818    }
11819    /// Load a EnumTypeDef from its ID.
11820    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
11821        let mut query = self.selection.select("loadEnumTypeDefFromID");
11822        query = query.arg_lazy(
11823            "id",
11824            Box::new(move || {
11825                let id = id.clone();
11826                Box::pin(async move { id.into_id().await.unwrap().quote() })
11827            }),
11828        );
11829        EnumTypeDef {
11830            proc: self.proc.clone(),
11831            selection: query,
11832            graphql_client: self.graphql_client.clone(),
11833        }
11834    }
11835    /// Load a EnumValueTypeDef from its ID.
11836    pub fn load_enum_value_type_def_from_id(
11837        &self,
11838        id: impl IntoID<EnumValueTypeDefId>,
11839    ) -> EnumValueTypeDef {
11840        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
11841        query = query.arg_lazy(
11842            "id",
11843            Box::new(move || {
11844                let id = id.clone();
11845                Box::pin(async move { id.into_id().await.unwrap().quote() })
11846            }),
11847        );
11848        EnumValueTypeDef {
11849            proc: self.proc.clone(),
11850            selection: query,
11851            graphql_client: self.graphql_client.clone(),
11852        }
11853    }
11854    /// Load a EnvFile from its ID.
11855    pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
11856        let mut query = self.selection.select("loadEnvFileFromID");
11857        query = query.arg_lazy(
11858            "id",
11859            Box::new(move || {
11860                let id = id.clone();
11861                Box::pin(async move { id.into_id().await.unwrap().quote() })
11862            }),
11863        );
11864        EnvFile {
11865            proc: self.proc.clone(),
11866            selection: query,
11867            graphql_client: self.graphql_client.clone(),
11868        }
11869    }
11870    /// Load a Env from its ID.
11871    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
11872        let mut query = self.selection.select("loadEnvFromID");
11873        query = query.arg_lazy(
11874            "id",
11875            Box::new(move || {
11876                let id = id.clone();
11877                Box::pin(async move { id.into_id().await.unwrap().quote() })
11878            }),
11879        );
11880        Env {
11881            proc: self.proc.clone(),
11882            selection: query,
11883            graphql_client: self.graphql_client.clone(),
11884        }
11885    }
11886    /// Load a EnvVariable from its ID.
11887    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
11888        let mut query = self.selection.select("loadEnvVariableFromID");
11889        query = query.arg_lazy(
11890            "id",
11891            Box::new(move || {
11892                let id = id.clone();
11893                Box::pin(async move { id.into_id().await.unwrap().quote() })
11894            }),
11895        );
11896        EnvVariable {
11897            proc: self.proc.clone(),
11898            selection: query,
11899            graphql_client: self.graphql_client.clone(),
11900        }
11901    }
11902    /// Load a Error from its ID.
11903    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
11904        let mut query = self.selection.select("loadErrorFromID");
11905        query = query.arg_lazy(
11906            "id",
11907            Box::new(move || {
11908                let id = id.clone();
11909                Box::pin(async move { id.into_id().await.unwrap().quote() })
11910            }),
11911        );
11912        Error {
11913            proc: self.proc.clone(),
11914            selection: query,
11915            graphql_client: self.graphql_client.clone(),
11916        }
11917    }
11918    /// Load a ErrorValue from its ID.
11919    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
11920        let mut query = self.selection.select("loadErrorValueFromID");
11921        query = query.arg_lazy(
11922            "id",
11923            Box::new(move || {
11924                let id = id.clone();
11925                Box::pin(async move { id.into_id().await.unwrap().quote() })
11926            }),
11927        );
11928        ErrorValue {
11929            proc: self.proc.clone(),
11930            selection: query,
11931            graphql_client: self.graphql_client.clone(),
11932        }
11933    }
11934    /// Load a FieldTypeDef from its ID.
11935    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
11936        let mut query = self.selection.select("loadFieldTypeDefFromID");
11937        query = query.arg_lazy(
11938            "id",
11939            Box::new(move || {
11940                let id = id.clone();
11941                Box::pin(async move { id.into_id().await.unwrap().quote() })
11942            }),
11943        );
11944        FieldTypeDef {
11945            proc: self.proc.clone(),
11946            selection: query,
11947            graphql_client: self.graphql_client.clone(),
11948        }
11949    }
11950    /// Load a File from its ID.
11951    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
11952        let mut query = self.selection.select("loadFileFromID");
11953        query = query.arg_lazy(
11954            "id",
11955            Box::new(move || {
11956                let id = id.clone();
11957                Box::pin(async move { id.into_id().await.unwrap().quote() })
11958            }),
11959        );
11960        File {
11961            proc: self.proc.clone(),
11962            selection: query,
11963            graphql_client: self.graphql_client.clone(),
11964        }
11965    }
11966    /// Load a FunctionArg from its ID.
11967    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
11968        let mut query = self.selection.select("loadFunctionArgFromID");
11969        query = query.arg_lazy(
11970            "id",
11971            Box::new(move || {
11972                let id = id.clone();
11973                Box::pin(async move { id.into_id().await.unwrap().quote() })
11974            }),
11975        );
11976        FunctionArg {
11977            proc: self.proc.clone(),
11978            selection: query,
11979            graphql_client: self.graphql_client.clone(),
11980        }
11981    }
11982    /// Load a FunctionCallArgValue from its ID.
11983    pub fn load_function_call_arg_value_from_id(
11984        &self,
11985        id: impl IntoID<FunctionCallArgValueId>,
11986    ) -> FunctionCallArgValue {
11987        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
11988        query = query.arg_lazy(
11989            "id",
11990            Box::new(move || {
11991                let id = id.clone();
11992                Box::pin(async move { id.into_id().await.unwrap().quote() })
11993            }),
11994        );
11995        FunctionCallArgValue {
11996            proc: self.proc.clone(),
11997            selection: query,
11998            graphql_client: self.graphql_client.clone(),
11999        }
12000    }
12001    /// Load a FunctionCall from its ID.
12002    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
12003        let mut query = self.selection.select("loadFunctionCallFromID");
12004        query = query.arg_lazy(
12005            "id",
12006            Box::new(move || {
12007                let id = id.clone();
12008                Box::pin(async move { id.into_id().await.unwrap().quote() })
12009            }),
12010        );
12011        FunctionCall {
12012            proc: self.proc.clone(),
12013            selection: query,
12014            graphql_client: self.graphql_client.clone(),
12015        }
12016    }
12017    /// Load a Function from its ID.
12018    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
12019        let mut query = self.selection.select("loadFunctionFromID");
12020        query = query.arg_lazy(
12021            "id",
12022            Box::new(move || {
12023                let id = id.clone();
12024                Box::pin(async move { id.into_id().await.unwrap().quote() })
12025            }),
12026        );
12027        Function {
12028            proc: self.proc.clone(),
12029            selection: query,
12030            graphql_client: self.graphql_client.clone(),
12031        }
12032    }
12033    /// Load a GeneratedCode from its ID.
12034    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
12035        let mut query = self.selection.select("loadGeneratedCodeFromID");
12036        query = query.arg_lazy(
12037            "id",
12038            Box::new(move || {
12039                let id = id.clone();
12040                Box::pin(async move { id.into_id().await.unwrap().quote() })
12041            }),
12042        );
12043        GeneratedCode {
12044            proc: self.proc.clone(),
12045            selection: query,
12046            graphql_client: self.graphql_client.clone(),
12047        }
12048    }
12049    /// Load a GitRef from its ID.
12050    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
12051        let mut query = self.selection.select("loadGitRefFromID");
12052        query = query.arg_lazy(
12053            "id",
12054            Box::new(move || {
12055                let id = id.clone();
12056                Box::pin(async move { id.into_id().await.unwrap().quote() })
12057            }),
12058        );
12059        GitRef {
12060            proc: self.proc.clone(),
12061            selection: query,
12062            graphql_client: self.graphql_client.clone(),
12063        }
12064    }
12065    /// Load a GitRepository from its ID.
12066    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
12067        let mut query = self.selection.select("loadGitRepositoryFromID");
12068        query = query.arg_lazy(
12069            "id",
12070            Box::new(move || {
12071                let id = id.clone();
12072                Box::pin(async move { id.into_id().await.unwrap().quote() })
12073            }),
12074        );
12075        GitRepository {
12076            proc: self.proc.clone(),
12077            selection: query,
12078            graphql_client: self.graphql_client.clone(),
12079        }
12080    }
12081    /// Load a Host from its ID.
12082    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
12083        let mut query = self.selection.select("loadHostFromID");
12084        query = query.arg_lazy(
12085            "id",
12086            Box::new(move || {
12087                let id = id.clone();
12088                Box::pin(async move { id.into_id().await.unwrap().quote() })
12089            }),
12090        );
12091        Host {
12092            proc: self.proc.clone(),
12093            selection: query,
12094            graphql_client: self.graphql_client.clone(),
12095        }
12096    }
12097    /// Load a InputTypeDef from its ID.
12098    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
12099        let mut query = self.selection.select("loadInputTypeDefFromID");
12100        query = query.arg_lazy(
12101            "id",
12102            Box::new(move || {
12103                let id = id.clone();
12104                Box::pin(async move { id.into_id().await.unwrap().quote() })
12105            }),
12106        );
12107        InputTypeDef {
12108            proc: self.proc.clone(),
12109            selection: query,
12110            graphql_client: self.graphql_client.clone(),
12111        }
12112    }
12113    /// Load a InterfaceTypeDef from its ID.
12114    pub fn load_interface_type_def_from_id(
12115        &self,
12116        id: impl IntoID<InterfaceTypeDefId>,
12117    ) -> InterfaceTypeDef {
12118        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
12119        query = query.arg_lazy(
12120            "id",
12121            Box::new(move || {
12122                let id = id.clone();
12123                Box::pin(async move { id.into_id().await.unwrap().quote() })
12124            }),
12125        );
12126        InterfaceTypeDef {
12127            proc: self.proc.clone(),
12128            selection: query,
12129            graphql_client: self.graphql_client.clone(),
12130        }
12131    }
12132    /// Load a JSONValue from its ID.
12133    pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
12134        let mut query = self.selection.select("loadJSONValueFromID");
12135        query = query.arg_lazy(
12136            "id",
12137            Box::new(move || {
12138                let id = id.clone();
12139                Box::pin(async move { id.into_id().await.unwrap().quote() })
12140            }),
12141        );
12142        JsonValue {
12143            proc: self.proc.clone(),
12144            selection: query,
12145            graphql_client: self.graphql_client.clone(),
12146        }
12147    }
12148    /// Load a LLM from its ID.
12149    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
12150        let mut query = self.selection.select("loadLLMFromID");
12151        query = query.arg_lazy(
12152            "id",
12153            Box::new(move || {
12154                let id = id.clone();
12155                Box::pin(async move { id.into_id().await.unwrap().quote() })
12156            }),
12157        );
12158        Llm {
12159            proc: self.proc.clone(),
12160            selection: query,
12161            graphql_client: self.graphql_client.clone(),
12162        }
12163    }
12164    /// Load a LLMTokenUsage from its ID.
12165    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
12166        let mut query = self.selection.select("loadLLMTokenUsageFromID");
12167        query = query.arg_lazy(
12168            "id",
12169            Box::new(move || {
12170                let id = id.clone();
12171                Box::pin(async move { id.into_id().await.unwrap().quote() })
12172            }),
12173        );
12174        LlmTokenUsage {
12175            proc: self.proc.clone(),
12176            selection: query,
12177            graphql_client: self.graphql_client.clone(),
12178        }
12179    }
12180    /// Load a Label from its ID.
12181    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
12182        let mut query = self.selection.select("loadLabelFromID");
12183        query = query.arg_lazy(
12184            "id",
12185            Box::new(move || {
12186                let id = id.clone();
12187                Box::pin(async move { id.into_id().await.unwrap().quote() })
12188            }),
12189        );
12190        Label {
12191            proc: self.proc.clone(),
12192            selection: query,
12193            graphql_client: self.graphql_client.clone(),
12194        }
12195    }
12196    /// Load a ListTypeDef from its ID.
12197    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
12198        let mut query = self.selection.select("loadListTypeDefFromID");
12199        query = query.arg_lazy(
12200            "id",
12201            Box::new(move || {
12202                let id = id.clone();
12203                Box::pin(async move { id.into_id().await.unwrap().quote() })
12204            }),
12205        );
12206        ListTypeDef {
12207            proc: self.proc.clone(),
12208            selection: query,
12209            graphql_client: self.graphql_client.clone(),
12210        }
12211    }
12212    /// Load a ModuleConfigClient from its ID.
12213    pub fn load_module_config_client_from_id(
12214        &self,
12215        id: impl IntoID<ModuleConfigClientId>,
12216    ) -> ModuleConfigClient {
12217        let mut query = self.selection.select("loadModuleConfigClientFromID");
12218        query = query.arg_lazy(
12219            "id",
12220            Box::new(move || {
12221                let id = id.clone();
12222                Box::pin(async move { id.into_id().await.unwrap().quote() })
12223            }),
12224        );
12225        ModuleConfigClient {
12226            proc: self.proc.clone(),
12227            selection: query,
12228            graphql_client: self.graphql_client.clone(),
12229        }
12230    }
12231    /// Load a Module from its ID.
12232    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
12233        let mut query = self.selection.select("loadModuleFromID");
12234        query = query.arg_lazy(
12235            "id",
12236            Box::new(move || {
12237                let id = id.clone();
12238                Box::pin(async move { id.into_id().await.unwrap().quote() })
12239            }),
12240        );
12241        Module {
12242            proc: self.proc.clone(),
12243            selection: query,
12244            graphql_client: self.graphql_client.clone(),
12245        }
12246    }
12247    /// Load a ModuleSource from its ID.
12248    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
12249        let mut query = self.selection.select("loadModuleSourceFromID");
12250        query = query.arg_lazy(
12251            "id",
12252            Box::new(move || {
12253                let id = id.clone();
12254                Box::pin(async move { id.into_id().await.unwrap().quote() })
12255            }),
12256        );
12257        ModuleSource {
12258            proc: self.proc.clone(),
12259            selection: query,
12260            graphql_client: self.graphql_client.clone(),
12261        }
12262    }
12263    /// Load a ObjectTypeDef from its ID.
12264    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
12265        let mut query = self.selection.select("loadObjectTypeDefFromID");
12266        query = query.arg_lazy(
12267            "id",
12268            Box::new(move || {
12269                let id = id.clone();
12270                Box::pin(async move { id.into_id().await.unwrap().quote() })
12271            }),
12272        );
12273        ObjectTypeDef {
12274            proc: self.proc.clone(),
12275            selection: query,
12276            graphql_client: self.graphql_client.clone(),
12277        }
12278    }
12279    /// Load a Port from its ID.
12280    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
12281        let mut query = self.selection.select("loadPortFromID");
12282        query = query.arg_lazy(
12283            "id",
12284            Box::new(move || {
12285                let id = id.clone();
12286                Box::pin(async move { id.into_id().await.unwrap().quote() })
12287            }),
12288        );
12289        Port {
12290            proc: self.proc.clone(),
12291            selection: query,
12292            graphql_client: self.graphql_client.clone(),
12293        }
12294    }
12295    /// Load a SDKConfig from its ID.
12296    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
12297        let mut query = self.selection.select("loadSDKConfigFromID");
12298        query = query.arg_lazy(
12299            "id",
12300            Box::new(move || {
12301                let id = id.clone();
12302                Box::pin(async move { id.into_id().await.unwrap().quote() })
12303            }),
12304        );
12305        SdkConfig {
12306            proc: self.proc.clone(),
12307            selection: query,
12308            graphql_client: self.graphql_client.clone(),
12309        }
12310    }
12311    /// Load a ScalarTypeDef from its ID.
12312    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
12313        let mut query = self.selection.select("loadScalarTypeDefFromID");
12314        query = query.arg_lazy(
12315            "id",
12316            Box::new(move || {
12317                let id = id.clone();
12318                Box::pin(async move { id.into_id().await.unwrap().quote() })
12319            }),
12320        );
12321        ScalarTypeDef {
12322            proc: self.proc.clone(),
12323            selection: query,
12324            graphql_client: self.graphql_client.clone(),
12325        }
12326    }
12327    /// Load a SearchResult from its ID.
12328    pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
12329        let mut query = self.selection.select("loadSearchResultFromID");
12330        query = query.arg_lazy(
12331            "id",
12332            Box::new(move || {
12333                let id = id.clone();
12334                Box::pin(async move { id.into_id().await.unwrap().quote() })
12335            }),
12336        );
12337        SearchResult {
12338            proc: self.proc.clone(),
12339            selection: query,
12340            graphql_client: self.graphql_client.clone(),
12341        }
12342    }
12343    /// Load a SearchSubmatch from its ID.
12344    pub fn load_search_submatch_from_id(
12345        &self,
12346        id: impl IntoID<SearchSubmatchId>,
12347    ) -> SearchSubmatch {
12348        let mut query = self.selection.select("loadSearchSubmatchFromID");
12349        query = query.arg_lazy(
12350            "id",
12351            Box::new(move || {
12352                let id = id.clone();
12353                Box::pin(async move { id.into_id().await.unwrap().quote() })
12354            }),
12355        );
12356        SearchSubmatch {
12357            proc: self.proc.clone(),
12358            selection: query,
12359            graphql_client: self.graphql_client.clone(),
12360        }
12361    }
12362    /// Load a Secret from its ID.
12363    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
12364        let mut query = self.selection.select("loadSecretFromID");
12365        query = query.arg_lazy(
12366            "id",
12367            Box::new(move || {
12368                let id = id.clone();
12369                Box::pin(async move { id.into_id().await.unwrap().quote() })
12370            }),
12371        );
12372        Secret {
12373            proc: self.proc.clone(),
12374            selection: query,
12375            graphql_client: self.graphql_client.clone(),
12376        }
12377    }
12378    /// Load a Service from its ID.
12379    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
12380        let mut query = self.selection.select("loadServiceFromID");
12381        query = query.arg_lazy(
12382            "id",
12383            Box::new(move || {
12384                let id = id.clone();
12385                Box::pin(async move { id.into_id().await.unwrap().quote() })
12386            }),
12387        );
12388        Service {
12389            proc: self.proc.clone(),
12390            selection: query,
12391            graphql_client: self.graphql_client.clone(),
12392        }
12393    }
12394    /// Load a Socket from its ID.
12395    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
12396        let mut query = self.selection.select("loadSocketFromID");
12397        query = query.arg_lazy(
12398            "id",
12399            Box::new(move || {
12400                let id = id.clone();
12401                Box::pin(async move { id.into_id().await.unwrap().quote() })
12402            }),
12403        );
12404        Socket {
12405            proc: self.proc.clone(),
12406            selection: query,
12407            graphql_client: self.graphql_client.clone(),
12408        }
12409    }
12410    /// Load a SourceMap from its ID.
12411    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
12412        let mut query = self.selection.select("loadSourceMapFromID");
12413        query = query.arg_lazy(
12414            "id",
12415            Box::new(move || {
12416                let id = id.clone();
12417                Box::pin(async move { id.into_id().await.unwrap().quote() })
12418            }),
12419        );
12420        SourceMap {
12421            proc: self.proc.clone(),
12422            selection: query,
12423            graphql_client: self.graphql_client.clone(),
12424        }
12425    }
12426    /// Load a Stat from its ID.
12427    pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
12428        let mut query = self.selection.select("loadStatFromID");
12429        query = query.arg_lazy(
12430            "id",
12431            Box::new(move || {
12432                let id = id.clone();
12433                Box::pin(async move { id.into_id().await.unwrap().quote() })
12434            }),
12435        );
12436        Stat {
12437            proc: self.proc.clone(),
12438            selection: query,
12439            graphql_client: self.graphql_client.clone(),
12440        }
12441    }
12442    /// Load a Terminal from its ID.
12443    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
12444        let mut query = self.selection.select("loadTerminalFromID");
12445        query = query.arg_lazy(
12446            "id",
12447            Box::new(move || {
12448                let id = id.clone();
12449                Box::pin(async move { id.into_id().await.unwrap().quote() })
12450            }),
12451        );
12452        Terminal {
12453            proc: self.proc.clone(),
12454            selection: query,
12455            graphql_client: self.graphql_client.clone(),
12456        }
12457    }
12458    /// Load a TypeDef from its ID.
12459    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
12460        let mut query = self.selection.select("loadTypeDefFromID");
12461        query = query.arg_lazy(
12462            "id",
12463            Box::new(move || {
12464                let id = id.clone();
12465                Box::pin(async move { id.into_id().await.unwrap().quote() })
12466            }),
12467        );
12468        TypeDef {
12469            proc: self.proc.clone(),
12470            selection: query,
12471            graphql_client: self.graphql_client.clone(),
12472        }
12473    }
12474    /// Create a new module.
12475    pub fn module(&self) -> Module {
12476        let query = self.selection.select("module");
12477        Module {
12478            proc: self.proc.clone(),
12479            selection: query,
12480            graphql_client: self.graphql_client.clone(),
12481        }
12482    }
12483    /// Create a new module source instance from a source ref string
12484    ///
12485    /// # Arguments
12486    ///
12487    /// * `ref_string` - The string ref representation of the module source
12488    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12489    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
12490        let mut query = self.selection.select("moduleSource");
12491        query = query.arg("refString", ref_string.into());
12492        ModuleSource {
12493            proc: self.proc.clone(),
12494            selection: query,
12495            graphql_client: self.graphql_client.clone(),
12496        }
12497    }
12498    /// Create a new module source instance from a source ref string
12499    ///
12500    /// # Arguments
12501    ///
12502    /// * `ref_string` - The string ref representation of the module source
12503    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12504    pub fn module_source_opts<'a>(
12505        &self,
12506        ref_string: impl Into<String>,
12507        opts: QueryModuleSourceOpts<'a>,
12508    ) -> ModuleSource {
12509        let mut query = self.selection.select("moduleSource");
12510        query = query.arg("refString", ref_string.into());
12511        if let Some(ref_pin) = opts.ref_pin {
12512            query = query.arg("refPin", ref_pin);
12513        }
12514        if let Some(disable_find_up) = opts.disable_find_up {
12515            query = query.arg("disableFindUp", disable_find_up);
12516        }
12517        if let Some(allow_not_exists) = opts.allow_not_exists {
12518            query = query.arg("allowNotExists", allow_not_exists);
12519        }
12520        if let Some(require_kind) = opts.require_kind {
12521            query = query.arg("requireKind", require_kind);
12522        }
12523        ModuleSource {
12524            proc: self.proc.clone(),
12525            selection: query,
12526            graphql_client: self.graphql_client.clone(),
12527        }
12528    }
12529    /// Creates a new secret.
12530    ///
12531    /// # Arguments
12532    ///
12533    /// * `uri` - The URI of the secret store
12534    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12535    pub fn secret(&self, uri: impl Into<String>) -> Secret {
12536        let mut query = self.selection.select("secret");
12537        query = query.arg("uri", uri.into());
12538        Secret {
12539            proc: self.proc.clone(),
12540            selection: query,
12541            graphql_client: self.graphql_client.clone(),
12542        }
12543    }
12544    /// Creates a new secret.
12545    ///
12546    /// # Arguments
12547    ///
12548    /// * `uri` - The URI of the secret store
12549    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12550    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
12551        let mut query = self.selection.select("secret");
12552        query = query.arg("uri", uri.into());
12553        if let Some(cache_key) = opts.cache_key {
12554            query = query.arg("cacheKey", cache_key);
12555        }
12556        Secret {
12557            proc: self.proc.clone(),
12558            selection: query,
12559            graphql_client: self.graphql_client.clone(),
12560        }
12561    }
12562    /// Sets a secret given a user defined name to its plaintext and returns the secret.
12563    /// The plaintext value is limited to a size of 128000 bytes.
12564    ///
12565    /// # Arguments
12566    ///
12567    /// * `name` - The user defined name for this secret
12568    /// * `plaintext` - The plaintext of the secret
12569    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
12570        let mut query = self.selection.select("setSecret");
12571        query = query.arg("name", name.into());
12572        query = query.arg("plaintext", plaintext.into());
12573        Secret {
12574            proc: self.proc.clone(),
12575            selection: query,
12576            graphql_client: self.graphql_client.clone(),
12577        }
12578    }
12579    /// Creates source map metadata.
12580    ///
12581    /// # Arguments
12582    ///
12583    /// * `filename` - The filename from the module source.
12584    /// * `line` - The line number within the filename.
12585    /// * `column` - The column number within the line.
12586    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
12587        let mut query = self.selection.select("sourceMap");
12588        query = query.arg("filename", filename.into());
12589        query = query.arg("line", line);
12590        query = query.arg("column", column);
12591        SourceMap {
12592            proc: self.proc.clone(),
12593            selection: query,
12594            graphql_client: self.graphql_client.clone(),
12595        }
12596    }
12597    /// Create a new TypeDef.
12598    pub fn type_def(&self) -> TypeDef {
12599        let query = self.selection.select("typeDef");
12600        TypeDef {
12601            proc: self.proc.clone(),
12602            selection: query,
12603            graphql_client: self.graphql_client.clone(),
12604        }
12605    }
12606    /// Get the current Dagger Engine version.
12607    pub async fn version(&self) -> Result<String, DaggerError> {
12608        let query = self.selection.select("version");
12609        query.execute(self.graphql_client.clone()).await
12610    }
12611}
12612#[derive(Clone)]
12613pub struct SdkConfig {
12614    pub proc: Option<Arc<DaggerSessionProc>>,
12615    pub selection: Selection,
12616    pub graphql_client: DynGraphQLClient,
12617}
12618impl SdkConfig {
12619    /// Whether to start the SDK runtime in debug mode with an interactive terminal.
12620    pub async fn debug(&self) -> Result<bool, DaggerError> {
12621        let query = self.selection.select("debug");
12622        query.execute(self.graphql_client.clone()).await
12623    }
12624    /// A unique identifier for this SDKConfig.
12625    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
12626        let query = self.selection.select("id");
12627        query.execute(self.graphql_client.clone()).await
12628    }
12629    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
12630    pub async fn source(&self) -> Result<String, DaggerError> {
12631        let query = self.selection.select("source");
12632        query.execute(self.graphql_client.clone()).await
12633    }
12634}
12635#[derive(Clone)]
12636pub struct ScalarTypeDef {
12637    pub proc: Option<Arc<DaggerSessionProc>>,
12638    pub selection: Selection,
12639    pub graphql_client: DynGraphQLClient,
12640}
12641impl ScalarTypeDef {
12642    /// A doc string for the scalar, if any.
12643    pub async fn description(&self) -> Result<String, DaggerError> {
12644        let query = self.selection.select("description");
12645        query.execute(self.graphql_client.clone()).await
12646    }
12647    /// A unique identifier for this ScalarTypeDef.
12648    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
12649        let query = self.selection.select("id");
12650        query.execute(self.graphql_client.clone()).await
12651    }
12652    /// The name of the scalar.
12653    pub async fn name(&self) -> Result<String, DaggerError> {
12654        let query = self.selection.select("name");
12655        query.execute(self.graphql_client.clone()).await
12656    }
12657    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
12658    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12659        let query = self.selection.select("sourceModuleName");
12660        query.execute(self.graphql_client.clone()).await
12661    }
12662}
12663#[derive(Clone)]
12664pub struct SearchResult {
12665    pub proc: Option<Arc<DaggerSessionProc>>,
12666    pub selection: Selection,
12667    pub graphql_client: DynGraphQLClient,
12668}
12669impl SearchResult {
12670    /// The byte offset of this line within the file.
12671    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
12672        let query = self.selection.select("absoluteOffset");
12673        query.execute(self.graphql_client.clone()).await
12674    }
12675    /// The path to the file that matched.
12676    pub async fn file_path(&self) -> Result<String, DaggerError> {
12677        let query = self.selection.select("filePath");
12678        query.execute(self.graphql_client.clone()).await
12679    }
12680    /// A unique identifier for this SearchResult.
12681    pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
12682        let query = self.selection.select("id");
12683        query.execute(self.graphql_client.clone()).await
12684    }
12685    /// The first line that matched.
12686    pub async fn line_number(&self) -> Result<isize, DaggerError> {
12687        let query = self.selection.select("lineNumber");
12688        query.execute(self.graphql_client.clone()).await
12689    }
12690    /// The line content that matched.
12691    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
12692        let query = self.selection.select("matchedLines");
12693        query.execute(self.graphql_client.clone()).await
12694    }
12695    /// Sub-match positions and content within the matched lines.
12696    pub fn submatches(&self) -> Vec<SearchSubmatch> {
12697        let query = self.selection.select("submatches");
12698        vec![SearchSubmatch {
12699            proc: self.proc.clone(),
12700            selection: query,
12701            graphql_client: self.graphql_client.clone(),
12702        }]
12703    }
12704}
12705#[derive(Clone)]
12706pub struct SearchSubmatch {
12707    pub proc: Option<Arc<DaggerSessionProc>>,
12708    pub selection: Selection,
12709    pub graphql_client: DynGraphQLClient,
12710}
12711impl SearchSubmatch {
12712    /// The match's end offset within the matched lines.
12713    pub async fn end(&self) -> Result<isize, DaggerError> {
12714        let query = self.selection.select("end");
12715        query.execute(self.graphql_client.clone()).await
12716    }
12717    /// A unique identifier for this SearchSubmatch.
12718    pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
12719        let query = self.selection.select("id");
12720        query.execute(self.graphql_client.clone()).await
12721    }
12722    /// The match's start offset within the matched lines.
12723    pub async fn start(&self) -> Result<isize, DaggerError> {
12724        let query = self.selection.select("start");
12725        query.execute(self.graphql_client.clone()).await
12726    }
12727    /// The matched text.
12728    pub async fn text(&self) -> Result<String, DaggerError> {
12729        let query = self.selection.select("text");
12730        query.execute(self.graphql_client.clone()).await
12731    }
12732}
12733#[derive(Clone)]
12734pub struct Secret {
12735    pub proc: Option<Arc<DaggerSessionProc>>,
12736    pub selection: Selection,
12737    pub graphql_client: DynGraphQLClient,
12738}
12739impl Secret {
12740    /// A unique identifier for this Secret.
12741    pub async fn id(&self) -> Result<SecretId, DaggerError> {
12742        let query = self.selection.select("id");
12743        query.execute(self.graphql_client.clone()).await
12744    }
12745    /// The name of this secret.
12746    pub async fn name(&self) -> Result<String, DaggerError> {
12747        let query = self.selection.select("name");
12748        query.execute(self.graphql_client.clone()).await
12749    }
12750    /// The value of this secret.
12751    pub async fn plaintext(&self) -> Result<String, DaggerError> {
12752        let query = self.selection.select("plaintext");
12753        query.execute(self.graphql_client.clone()).await
12754    }
12755    /// The URI of this secret.
12756    pub async fn uri(&self) -> Result<String, DaggerError> {
12757        let query = self.selection.select("uri");
12758        query.execute(self.graphql_client.clone()).await
12759    }
12760}
12761#[derive(Clone)]
12762pub struct Service {
12763    pub proc: Option<Arc<DaggerSessionProc>>,
12764    pub selection: Selection,
12765    pub graphql_client: DynGraphQLClient,
12766}
12767#[derive(Builder, Debug, PartialEq)]
12768pub struct ServiceEndpointOpts<'a> {
12769    /// The exposed port number for the endpoint
12770    #[builder(setter(into, strip_option), default)]
12771    pub port: Option<isize>,
12772    /// Return a URL with the given scheme, eg. http for http://
12773    #[builder(setter(into, strip_option), default)]
12774    pub scheme: Option<&'a str>,
12775}
12776#[derive(Builder, Debug, PartialEq)]
12777pub struct ServiceStopOpts {
12778    /// Immediately kill the service without waiting for a graceful exit
12779    #[builder(setter(into, strip_option), default)]
12780    pub kill: Option<bool>,
12781}
12782#[derive(Builder, Debug, PartialEq)]
12783pub struct ServiceTerminalOpts<'a> {
12784    #[builder(setter(into, strip_option), default)]
12785    pub cmd: Option<Vec<&'a str>>,
12786}
12787#[derive(Builder, Debug, PartialEq)]
12788pub struct ServiceUpOpts {
12789    /// List of frontend/backend port mappings to forward.
12790    /// Frontend is the port accepting traffic on the host, backend is the service port.
12791    #[builder(setter(into, strip_option), default)]
12792    pub ports: Option<Vec<PortForward>>,
12793    /// Bind each tunnel port to a random port on the host.
12794    #[builder(setter(into, strip_option), default)]
12795    pub random: Option<bool>,
12796}
12797impl Service {
12798    /// Retrieves an endpoint that clients can use to reach this container.
12799    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
12800    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
12801    ///
12802    /// # Arguments
12803    ///
12804    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12805    pub async fn endpoint(&self) -> Result<String, DaggerError> {
12806        let query = self.selection.select("endpoint");
12807        query.execute(self.graphql_client.clone()).await
12808    }
12809    /// Retrieves an endpoint that clients can use to reach this container.
12810    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
12811    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
12812    ///
12813    /// # Arguments
12814    ///
12815    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12816    pub async fn endpoint_opts<'a>(
12817        &self,
12818        opts: ServiceEndpointOpts<'a>,
12819    ) -> Result<String, DaggerError> {
12820        let mut query = self.selection.select("endpoint");
12821        if let Some(port) = opts.port {
12822            query = query.arg("port", port);
12823        }
12824        if let Some(scheme) = opts.scheme {
12825            query = query.arg("scheme", scheme);
12826        }
12827        query.execute(self.graphql_client.clone()).await
12828    }
12829    /// Retrieves a hostname which can be used by clients to reach this container.
12830    pub async fn hostname(&self) -> Result<String, DaggerError> {
12831        let query = self.selection.select("hostname");
12832        query.execute(self.graphql_client.clone()).await
12833    }
12834    /// A unique identifier for this Service.
12835    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
12836        let query = self.selection.select("id");
12837        query.execute(self.graphql_client.clone()).await
12838    }
12839    /// Retrieves the list of ports provided by the service.
12840    pub fn ports(&self) -> Vec<Port> {
12841        let query = self.selection.select("ports");
12842        vec![Port {
12843            proc: self.proc.clone(),
12844            selection: query,
12845            graphql_client: self.graphql_client.clone(),
12846        }]
12847    }
12848    /// Start the service and wait for its health checks to succeed.
12849    /// Services bound to a Container do not need to be manually started.
12850    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
12851        let query = self.selection.select("start");
12852        query.execute(self.graphql_client.clone()).await
12853    }
12854    /// Stop the service.
12855    ///
12856    /// # Arguments
12857    ///
12858    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12859    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
12860        let query = self.selection.select("stop");
12861        query.execute(self.graphql_client.clone()).await
12862    }
12863    /// Stop the service.
12864    ///
12865    /// # Arguments
12866    ///
12867    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12868    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
12869        let mut query = self.selection.select("stop");
12870        if let Some(kill) = opts.kill {
12871            query = query.arg("kill", kill);
12872        }
12873        query.execute(self.graphql_client.clone()).await
12874    }
12875    /// Forces evaluation of the pipeline in the engine.
12876    pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
12877        let query = self.selection.select("sync");
12878        query.execute(self.graphql_client.clone()).await
12879    }
12880    ///
12881    /// # Arguments
12882    ///
12883    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12884    pub fn terminal(&self) -> Service {
12885        let query = self.selection.select("terminal");
12886        Service {
12887            proc: self.proc.clone(),
12888            selection: query,
12889            graphql_client: self.graphql_client.clone(),
12890        }
12891    }
12892    ///
12893    /// # Arguments
12894    ///
12895    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12896    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
12897        let mut query = self.selection.select("terminal");
12898        if let Some(cmd) = opts.cmd {
12899            query = query.arg("cmd", cmd);
12900        }
12901        Service {
12902            proc: self.proc.clone(),
12903            selection: query,
12904            graphql_client: self.graphql_client.clone(),
12905        }
12906    }
12907    /// Creates a tunnel that forwards traffic from the caller's network to this service.
12908    ///
12909    /// # Arguments
12910    ///
12911    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12912    pub async fn up(&self) -> Result<Void, DaggerError> {
12913        let query = self.selection.select("up");
12914        query.execute(self.graphql_client.clone()).await
12915    }
12916    /// Creates a tunnel that forwards traffic from the caller's network to this service.
12917    ///
12918    /// # Arguments
12919    ///
12920    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12921    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
12922        let mut query = self.selection.select("up");
12923        if let Some(ports) = opts.ports {
12924            query = query.arg("ports", ports);
12925        }
12926        if let Some(random) = opts.random {
12927            query = query.arg("random", random);
12928        }
12929        query.execute(self.graphql_client.clone()).await
12930    }
12931    /// Configures a hostname which can be used by clients within the session to reach this container.
12932    ///
12933    /// # Arguments
12934    ///
12935    /// * `hostname` - The hostname to use.
12936    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
12937        let mut query = self.selection.select("withHostname");
12938        query = query.arg("hostname", hostname.into());
12939        Service {
12940            proc: self.proc.clone(),
12941            selection: query,
12942            graphql_client: self.graphql_client.clone(),
12943        }
12944    }
12945}
12946#[derive(Clone)]
12947pub struct Socket {
12948    pub proc: Option<Arc<DaggerSessionProc>>,
12949    pub selection: Selection,
12950    pub graphql_client: DynGraphQLClient,
12951}
12952impl Socket {
12953    /// A unique identifier for this Socket.
12954    pub async fn id(&self) -> Result<SocketId, DaggerError> {
12955        let query = self.selection.select("id");
12956        query.execute(self.graphql_client.clone()).await
12957    }
12958}
12959#[derive(Clone)]
12960pub struct SourceMap {
12961    pub proc: Option<Arc<DaggerSessionProc>>,
12962    pub selection: Selection,
12963    pub graphql_client: DynGraphQLClient,
12964}
12965impl SourceMap {
12966    /// The column number within the line.
12967    pub async fn column(&self) -> Result<isize, DaggerError> {
12968        let query = self.selection.select("column");
12969        query.execute(self.graphql_client.clone()).await
12970    }
12971    /// The filename from the module source.
12972    pub async fn filename(&self) -> Result<String, DaggerError> {
12973        let query = self.selection.select("filename");
12974        query.execute(self.graphql_client.clone()).await
12975    }
12976    /// A unique identifier for this SourceMap.
12977    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
12978        let query = self.selection.select("id");
12979        query.execute(self.graphql_client.clone()).await
12980    }
12981    /// The line number within the filename.
12982    pub async fn line(&self) -> Result<isize, DaggerError> {
12983        let query = self.selection.select("line");
12984        query.execute(self.graphql_client.clone()).await
12985    }
12986    /// The module dependency this was declared in.
12987    pub async fn module(&self) -> Result<String, DaggerError> {
12988        let query = self.selection.select("module");
12989        query.execute(self.graphql_client.clone()).await
12990    }
12991    /// The URL to the file, if any. This can be used to link to the source map in the browser.
12992    pub async fn url(&self) -> Result<String, DaggerError> {
12993        let query = self.selection.select("url");
12994        query.execute(self.graphql_client.clone()).await
12995    }
12996}
12997#[derive(Clone)]
12998pub struct Stat {
12999    pub proc: Option<Arc<DaggerSessionProc>>,
13000    pub selection: Selection,
13001    pub graphql_client: DynGraphQLClient,
13002}
13003impl Stat {
13004    /// file type
13005    pub async fn file_type(&self) -> Result<FileType, DaggerError> {
13006        let query = self.selection.select("fileType");
13007        query.execute(self.graphql_client.clone()).await
13008    }
13009    /// A unique identifier for this Stat.
13010    pub async fn id(&self) -> Result<StatId, DaggerError> {
13011        let query = self.selection.select("id");
13012        query.execute(self.graphql_client.clone()).await
13013    }
13014    /// file name
13015    pub async fn name(&self) -> Result<String, DaggerError> {
13016        let query = self.selection.select("name");
13017        query.execute(self.graphql_client.clone()).await
13018    }
13019    /// permission bits
13020    pub async fn permissions(&self) -> Result<isize, DaggerError> {
13021        let query = self.selection.select("permissions");
13022        query.execute(self.graphql_client.clone()).await
13023    }
13024    /// file size
13025    pub async fn size(&self) -> Result<isize, DaggerError> {
13026        let query = self.selection.select("size");
13027        query.execute(self.graphql_client.clone()).await
13028    }
13029}
13030#[derive(Clone)]
13031pub struct Terminal {
13032    pub proc: Option<Arc<DaggerSessionProc>>,
13033    pub selection: Selection,
13034    pub graphql_client: DynGraphQLClient,
13035}
13036impl Terminal {
13037    /// A unique identifier for this Terminal.
13038    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
13039        let query = self.selection.select("id");
13040        query.execute(self.graphql_client.clone()).await
13041    }
13042    /// Forces evaluation of the pipeline in the engine.
13043    /// It doesn't run the default command if no exec has been set.
13044    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
13045        let query = self.selection.select("sync");
13046        query.execute(self.graphql_client.clone()).await
13047    }
13048}
13049#[derive(Clone)]
13050pub struct TypeDef {
13051    pub proc: Option<Arc<DaggerSessionProc>>,
13052    pub selection: Selection,
13053    pub graphql_client: DynGraphQLClient,
13054}
13055#[derive(Builder, Debug, PartialEq)]
13056pub struct TypeDefWithEnumOpts<'a> {
13057    /// A doc string for the enum, if any
13058    #[builder(setter(into, strip_option), default)]
13059    pub description: Option<&'a str>,
13060    /// The source map for the enum definition.
13061    #[builder(setter(into, strip_option), default)]
13062    pub source_map: Option<SourceMapId>,
13063}
13064#[derive(Builder, Debug, PartialEq)]
13065pub struct TypeDefWithEnumMemberOpts<'a> {
13066    /// If deprecated, the reason or migration path.
13067    #[builder(setter(into, strip_option), default)]
13068    pub deprecated: Option<&'a str>,
13069    /// A doc string for the member, if any
13070    #[builder(setter(into, strip_option), default)]
13071    pub description: Option<&'a str>,
13072    /// The source map for the enum member definition.
13073    #[builder(setter(into, strip_option), default)]
13074    pub source_map: Option<SourceMapId>,
13075    /// The value of the member in the enum
13076    #[builder(setter(into, strip_option), default)]
13077    pub value: Option<&'a str>,
13078}
13079#[derive(Builder, Debug, PartialEq)]
13080pub struct TypeDefWithEnumValueOpts<'a> {
13081    /// If deprecated, the reason or migration path.
13082    #[builder(setter(into, strip_option), default)]
13083    pub deprecated: Option<&'a str>,
13084    /// A doc string for the value, if any
13085    #[builder(setter(into, strip_option), default)]
13086    pub description: Option<&'a str>,
13087    /// The source map for the enum value definition.
13088    #[builder(setter(into, strip_option), default)]
13089    pub source_map: Option<SourceMapId>,
13090}
13091#[derive(Builder, Debug, PartialEq)]
13092pub struct TypeDefWithFieldOpts<'a> {
13093    /// If deprecated, the reason or migration path.
13094    #[builder(setter(into, strip_option), default)]
13095    pub deprecated: Option<&'a str>,
13096    /// A doc string for the field, if any
13097    #[builder(setter(into, strip_option), default)]
13098    pub description: Option<&'a str>,
13099    /// The source map for the field definition.
13100    #[builder(setter(into, strip_option), default)]
13101    pub source_map: Option<SourceMapId>,
13102}
13103#[derive(Builder, Debug, PartialEq)]
13104pub struct TypeDefWithInterfaceOpts<'a> {
13105    #[builder(setter(into, strip_option), default)]
13106    pub description: Option<&'a str>,
13107    #[builder(setter(into, strip_option), default)]
13108    pub source_map: Option<SourceMapId>,
13109}
13110#[derive(Builder, Debug, PartialEq)]
13111pub struct TypeDefWithObjectOpts<'a> {
13112    #[builder(setter(into, strip_option), default)]
13113    pub deprecated: Option<&'a str>,
13114    #[builder(setter(into, strip_option), default)]
13115    pub description: Option<&'a str>,
13116    #[builder(setter(into, strip_option), default)]
13117    pub source_map: Option<SourceMapId>,
13118}
13119#[derive(Builder, Debug, PartialEq)]
13120pub struct TypeDefWithScalarOpts<'a> {
13121    #[builder(setter(into, strip_option), default)]
13122    pub description: Option<&'a str>,
13123}
13124impl TypeDef {
13125    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
13126    pub fn as_enum(&self) -> EnumTypeDef {
13127        let query = self.selection.select("asEnum");
13128        EnumTypeDef {
13129            proc: self.proc.clone(),
13130            selection: query,
13131            graphql_client: self.graphql_client.clone(),
13132        }
13133    }
13134    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
13135    pub fn as_input(&self) -> InputTypeDef {
13136        let query = self.selection.select("asInput");
13137        InputTypeDef {
13138            proc: self.proc.clone(),
13139            selection: query,
13140            graphql_client: self.graphql_client.clone(),
13141        }
13142    }
13143    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
13144    pub fn as_interface(&self) -> InterfaceTypeDef {
13145        let query = self.selection.select("asInterface");
13146        InterfaceTypeDef {
13147            proc: self.proc.clone(),
13148            selection: query,
13149            graphql_client: self.graphql_client.clone(),
13150        }
13151    }
13152    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
13153    pub fn as_list(&self) -> ListTypeDef {
13154        let query = self.selection.select("asList");
13155        ListTypeDef {
13156            proc: self.proc.clone(),
13157            selection: query,
13158            graphql_client: self.graphql_client.clone(),
13159        }
13160    }
13161    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
13162    pub fn as_object(&self) -> ObjectTypeDef {
13163        let query = self.selection.select("asObject");
13164        ObjectTypeDef {
13165            proc: self.proc.clone(),
13166            selection: query,
13167            graphql_client: self.graphql_client.clone(),
13168        }
13169    }
13170    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
13171    pub fn as_scalar(&self) -> ScalarTypeDef {
13172        let query = self.selection.select("asScalar");
13173        ScalarTypeDef {
13174            proc: self.proc.clone(),
13175            selection: query,
13176            graphql_client: self.graphql_client.clone(),
13177        }
13178    }
13179    /// A unique identifier for this TypeDef.
13180    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
13181        let query = self.selection.select("id");
13182        query.execute(self.graphql_client.clone()).await
13183    }
13184    /// The kind of type this is (e.g. primitive, list, object).
13185    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
13186        let query = self.selection.select("kind");
13187        query.execute(self.graphql_client.clone()).await
13188    }
13189    /// Whether this type can be set to null. Defaults to false.
13190    pub async fn optional(&self) -> Result<bool, DaggerError> {
13191        let query = self.selection.select("optional");
13192        query.execute(self.graphql_client.clone()).await
13193    }
13194    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
13195    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
13196        let mut query = self.selection.select("withConstructor");
13197        query = query.arg_lazy(
13198            "function",
13199            Box::new(move || {
13200                let function = function.clone();
13201                Box::pin(async move { function.into_id().await.unwrap().quote() })
13202            }),
13203        );
13204        TypeDef {
13205            proc: self.proc.clone(),
13206            selection: query,
13207            graphql_client: self.graphql_client.clone(),
13208        }
13209    }
13210    /// Returns a TypeDef of kind Enum with the provided name.
13211    /// 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.
13212    ///
13213    /// # Arguments
13214    ///
13215    /// * `name` - The name of the enum
13216    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13217    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
13218        let mut query = self.selection.select("withEnum");
13219        query = query.arg("name", name.into());
13220        TypeDef {
13221            proc: self.proc.clone(),
13222            selection: query,
13223            graphql_client: self.graphql_client.clone(),
13224        }
13225    }
13226    /// Returns a TypeDef of kind Enum with the provided name.
13227    /// 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.
13228    ///
13229    /// # Arguments
13230    ///
13231    /// * `name` - The name of the enum
13232    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13233    pub fn with_enum_opts<'a>(
13234        &self,
13235        name: impl Into<String>,
13236        opts: TypeDefWithEnumOpts<'a>,
13237    ) -> TypeDef {
13238        let mut query = self.selection.select("withEnum");
13239        query = query.arg("name", name.into());
13240        if let Some(description) = opts.description {
13241            query = query.arg("description", description);
13242        }
13243        if let Some(source_map) = opts.source_map {
13244            query = query.arg("sourceMap", source_map);
13245        }
13246        TypeDef {
13247            proc: self.proc.clone(),
13248            selection: query,
13249            graphql_client: self.graphql_client.clone(),
13250        }
13251    }
13252    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
13253    ///
13254    /// # Arguments
13255    ///
13256    /// * `name` - The name of the member in the enum
13257    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13258    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
13259        let mut query = self.selection.select("withEnumMember");
13260        query = query.arg("name", name.into());
13261        TypeDef {
13262            proc: self.proc.clone(),
13263            selection: query,
13264            graphql_client: self.graphql_client.clone(),
13265        }
13266    }
13267    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
13268    ///
13269    /// # Arguments
13270    ///
13271    /// * `name` - The name of the member in the enum
13272    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13273    pub fn with_enum_member_opts<'a>(
13274        &self,
13275        name: impl Into<String>,
13276        opts: TypeDefWithEnumMemberOpts<'a>,
13277    ) -> TypeDef {
13278        let mut query = self.selection.select("withEnumMember");
13279        query = query.arg("name", name.into());
13280        if let Some(value) = opts.value {
13281            query = query.arg("value", value);
13282        }
13283        if let Some(description) = opts.description {
13284            query = query.arg("description", description);
13285        }
13286        if let Some(source_map) = opts.source_map {
13287            query = query.arg("sourceMap", source_map);
13288        }
13289        if let Some(deprecated) = opts.deprecated {
13290            query = query.arg("deprecated", deprecated);
13291        }
13292        TypeDef {
13293            proc: self.proc.clone(),
13294            selection: query,
13295            graphql_client: self.graphql_client.clone(),
13296        }
13297    }
13298    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
13299    ///
13300    /// # Arguments
13301    ///
13302    /// * `value` - The name of the value in the enum
13303    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13304    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
13305        let mut query = self.selection.select("withEnumValue");
13306        query = query.arg("value", value.into());
13307        TypeDef {
13308            proc: self.proc.clone(),
13309            selection: query,
13310            graphql_client: self.graphql_client.clone(),
13311        }
13312    }
13313    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
13314    ///
13315    /// # Arguments
13316    ///
13317    /// * `value` - The name of the value in the enum
13318    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13319    pub fn with_enum_value_opts<'a>(
13320        &self,
13321        value: impl Into<String>,
13322        opts: TypeDefWithEnumValueOpts<'a>,
13323    ) -> TypeDef {
13324        let mut query = self.selection.select("withEnumValue");
13325        query = query.arg("value", value.into());
13326        if let Some(description) = opts.description {
13327            query = query.arg("description", description);
13328        }
13329        if let Some(source_map) = opts.source_map {
13330            query = query.arg("sourceMap", source_map);
13331        }
13332        if let Some(deprecated) = opts.deprecated {
13333            query = query.arg("deprecated", deprecated);
13334        }
13335        TypeDef {
13336            proc: self.proc.clone(),
13337            selection: query,
13338            graphql_client: self.graphql_client.clone(),
13339        }
13340    }
13341    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
13342    ///
13343    /// # Arguments
13344    ///
13345    /// * `name` - The name of the field in the object
13346    /// * `type_def` - The type of the field
13347    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13348    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
13349        let mut query = self.selection.select("withField");
13350        query = query.arg("name", name.into());
13351        query = query.arg_lazy(
13352            "typeDef",
13353            Box::new(move || {
13354                let type_def = type_def.clone();
13355                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
13356            }),
13357        );
13358        TypeDef {
13359            proc: self.proc.clone(),
13360            selection: query,
13361            graphql_client: self.graphql_client.clone(),
13362        }
13363    }
13364    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
13365    ///
13366    /// # Arguments
13367    ///
13368    /// * `name` - The name of the field in the object
13369    /// * `type_def` - The type of the field
13370    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13371    pub fn with_field_opts<'a>(
13372        &self,
13373        name: impl Into<String>,
13374        type_def: impl IntoID<TypeDefId>,
13375        opts: TypeDefWithFieldOpts<'a>,
13376    ) -> TypeDef {
13377        let mut query = self.selection.select("withField");
13378        query = query.arg("name", name.into());
13379        query = query.arg_lazy(
13380            "typeDef",
13381            Box::new(move || {
13382                let type_def = type_def.clone();
13383                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
13384            }),
13385        );
13386        if let Some(description) = opts.description {
13387            query = query.arg("description", description);
13388        }
13389        if let Some(source_map) = opts.source_map {
13390            query = query.arg("sourceMap", source_map);
13391        }
13392        if let Some(deprecated) = opts.deprecated {
13393            query = query.arg("deprecated", deprecated);
13394        }
13395        TypeDef {
13396            proc: self.proc.clone(),
13397            selection: query,
13398            graphql_client: self.graphql_client.clone(),
13399        }
13400    }
13401    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
13402    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
13403        let mut query = self.selection.select("withFunction");
13404        query = query.arg_lazy(
13405            "function",
13406            Box::new(move || {
13407                let function = function.clone();
13408                Box::pin(async move { function.into_id().await.unwrap().quote() })
13409            }),
13410        );
13411        TypeDef {
13412            proc: self.proc.clone(),
13413            selection: query,
13414            graphql_client: self.graphql_client.clone(),
13415        }
13416    }
13417    /// Returns a TypeDef of kind Interface with the provided name.
13418    ///
13419    /// # Arguments
13420    ///
13421    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13422    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
13423        let mut query = self.selection.select("withInterface");
13424        query = query.arg("name", name.into());
13425        TypeDef {
13426            proc: self.proc.clone(),
13427            selection: query,
13428            graphql_client: self.graphql_client.clone(),
13429        }
13430    }
13431    /// Returns a TypeDef of kind Interface with the provided name.
13432    ///
13433    /// # Arguments
13434    ///
13435    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13436    pub fn with_interface_opts<'a>(
13437        &self,
13438        name: impl Into<String>,
13439        opts: TypeDefWithInterfaceOpts<'a>,
13440    ) -> TypeDef {
13441        let mut query = self.selection.select("withInterface");
13442        query = query.arg("name", name.into());
13443        if let Some(description) = opts.description {
13444            query = query.arg("description", description);
13445        }
13446        if let Some(source_map) = opts.source_map {
13447            query = query.arg("sourceMap", source_map);
13448        }
13449        TypeDef {
13450            proc: self.proc.clone(),
13451            selection: query,
13452            graphql_client: self.graphql_client.clone(),
13453        }
13454    }
13455    /// Sets the kind of the type.
13456    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
13457        let mut query = self.selection.select("withKind");
13458        query = query.arg("kind", kind);
13459        TypeDef {
13460            proc: self.proc.clone(),
13461            selection: query,
13462            graphql_client: self.graphql_client.clone(),
13463        }
13464    }
13465    /// Returns a TypeDef of kind List with the provided type for its elements.
13466    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
13467        let mut query = self.selection.select("withListOf");
13468        query = query.arg_lazy(
13469            "elementType",
13470            Box::new(move || {
13471                let element_type = element_type.clone();
13472                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
13473            }),
13474        );
13475        TypeDef {
13476            proc: self.proc.clone(),
13477            selection: query,
13478            graphql_client: self.graphql_client.clone(),
13479        }
13480    }
13481    /// Returns a TypeDef of kind Object with the provided name.
13482    /// 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.
13483    ///
13484    /// # Arguments
13485    ///
13486    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13487    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
13488        let mut query = self.selection.select("withObject");
13489        query = query.arg("name", name.into());
13490        TypeDef {
13491            proc: self.proc.clone(),
13492            selection: query,
13493            graphql_client: self.graphql_client.clone(),
13494        }
13495    }
13496    /// Returns a TypeDef of kind Object with the provided name.
13497    /// 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.
13498    ///
13499    /// # Arguments
13500    ///
13501    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13502    pub fn with_object_opts<'a>(
13503        &self,
13504        name: impl Into<String>,
13505        opts: TypeDefWithObjectOpts<'a>,
13506    ) -> TypeDef {
13507        let mut query = self.selection.select("withObject");
13508        query = query.arg("name", name.into());
13509        if let Some(description) = opts.description {
13510            query = query.arg("description", description);
13511        }
13512        if let Some(source_map) = opts.source_map {
13513            query = query.arg("sourceMap", source_map);
13514        }
13515        if let Some(deprecated) = opts.deprecated {
13516            query = query.arg("deprecated", deprecated);
13517        }
13518        TypeDef {
13519            proc: self.proc.clone(),
13520            selection: query,
13521            graphql_client: self.graphql_client.clone(),
13522        }
13523    }
13524    /// Sets whether this type can be set to null.
13525    pub fn with_optional(&self, optional: bool) -> TypeDef {
13526        let mut query = self.selection.select("withOptional");
13527        query = query.arg("optional", optional);
13528        TypeDef {
13529            proc: self.proc.clone(),
13530            selection: query,
13531            graphql_client: self.graphql_client.clone(),
13532        }
13533    }
13534    /// Returns a TypeDef of kind Scalar with the provided name.
13535    ///
13536    /// # Arguments
13537    ///
13538    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13539    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
13540        let mut query = self.selection.select("withScalar");
13541        query = query.arg("name", name.into());
13542        TypeDef {
13543            proc: self.proc.clone(),
13544            selection: query,
13545            graphql_client: self.graphql_client.clone(),
13546        }
13547    }
13548    /// Returns a TypeDef of kind Scalar with the provided name.
13549    ///
13550    /// # Arguments
13551    ///
13552    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13553    pub fn with_scalar_opts<'a>(
13554        &self,
13555        name: impl Into<String>,
13556        opts: TypeDefWithScalarOpts<'a>,
13557    ) -> TypeDef {
13558        let mut query = self.selection.select("withScalar");
13559        query = query.arg("name", name.into());
13560        if let Some(description) = opts.description {
13561            query = query.arg("description", description);
13562        }
13563        TypeDef {
13564            proc: self.proc.clone(),
13565            selection: query,
13566            graphql_client: self.graphql_client.clone(),
13567        }
13568    }
13569}
13570#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13571pub enum CacheSharingMode {
13572    #[serde(rename = "LOCKED")]
13573    Locked,
13574    #[serde(rename = "PRIVATE")]
13575    Private,
13576    #[serde(rename = "SHARED")]
13577    Shared,
13578}
13579#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13580pub enum ExistsType {
13581    #[serde(rename = "DIRECTORY_TYPE")]
13582    DirectoryType,
13583    #[serde(rename = "REGULAR_TYPE")]
13584    RegularType,
13585    #[serde(rename = "SYMLINK_TYPE")]
13586    SymlinkType,
13587}
13588#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13589pub enum FileType {
13590    #[serde(rename = "DIRECTORY")]
13591    Directory,
13592    #[serde(rename = "DIRECTORY_TYPE")]
13593    DirectoryType,
13594    #[serde(rename = "REGULAR")]
13595    Regular,
13596    #[serde(rename = "REGULAR_TYPE")]
13597    RegularType,
13598    #[serde(rename = "SYMLINK")]
13599    Symlink,
13600    #[serde(rename = "SYMLINK_TYPE")]
13601    SymlinkType,
13602    #[serde(rename = "UNKNOWN")]
13603    Unknown,
13604}
13605#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13606pub enum FunctionCachePolicy {
13607    #[serde(rename = "Default")]
13608    Default,
13609    #[serde(rename = "Never")]
13610    Never,
13611    #[serde(rename = "PerSession")]
13612    PerSession,
13613}
13614#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13615pub enum ImageLayerCompression {
13616    #[serde(rename = "EStarGZ")]
13617    EStarGz,
13618    #[serde(rename = "ESTARGZ")]
13619    Estargz,
13620    #[serde(rename = "Gzip")]
13621    Gzip,
13622    #[serde(rename = "Uncompressed")]
13623    Uncompressed,
13624    #[serde(rename = "Zstd")]
13625    Zstd,
13626}
13627#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13628pub enum ImageMediaTypes {
13629    #[serde(rename = "DOCKER")]
13630    Docker,
13631    #[serde(rename = "DockerMediaTypes")]
13632    DockerMediaTypes,
13633    #[serde(rename = "OCI")]
13634    Oci,
13635    #[serde(rename = "OCIMediaTypes")]
13636    OciMediaTypes,
13637}
13638#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13639pub enum ModuleSourceExperimentalFeature {
13640    #[serde(rename = "SELF_CALLS")]
13641    SelfCalls,
13642}
13643#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13644pub enum ModuleSourceKind {
13645    #[serde(rename = "DIR")]
13646    Dir,
13647    #[serde(rename = "DIR_SOURCE")]
13648    DirSource,
13649    #[serde(rename = "GIT")]
13650    Git,
13651    #[serde(rename = "GIT_SOURCE")]
13652    GitSource,
13653    #[serde(rename = "LOCAL")]
13654    Local,
13655    #[serde(rename = "LOCAL_SOURCE")]
13656    LocalSource,
13657}
13658#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13659pub enum NetworkProtocol {
13660    #[serde(rename = "TCP")]
13661    Tcp,
13662    #[serde(rename = "UDP")]
13663    Udp,
13664}
13665#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13666pub enum ReturnType {
13667    #[serde(rename = "ANY")]
13668    Any,
13669    #[serde(rename = "FAILURE")]
13670    Failure,
13671    #[serde(rename = "SUCCESS")]
13672    Success,
13673}
13674#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13675pub enum TypeDefKind {
13676    #[serde(rename = "BOOLEAN")]
13677    Boolean,
13678    #[serde(rename = "BOOLEAN_KIND")]
13679    BooleanKind,
13680    #[serde(rename = "ENUM")]
13681    Enum,
13682    #[serde(rename = "ENUM_KIND")]
13683    EnumKind,
13684    #[serde(rename = "FLOAT")]
13685    Float,
13686    #[serde(rename = "FLOAT_KIND")]
13687    FloatKind,
13688    #[serde(rename = "INPUT")]
13689    Input,
13690    #[serde(rename = "INPUT_KIND")]
13691    InputKind,
13692    #[serde(rename = "INTEGER")]
13693    Integer,
13694    #[serde(rename = "INTEGER_KIND")]
13695    IntegerKind,
13696    #[serde(rename = "INTERFACE")]
13697    Interface,
13698    #[serde(rename = "INTERFACE_KIND")]
13699    InterfaceKind,
13700    #[serde(rename = "LIST")]
13701    List,
13702    #[serde(rename = "LIST_KIND")]
13703    ListKind,
13704    #[serde(rename = "OBJECT")]
13705    Object,
13706    #[serde(rename = "OBJECT_KIND")]
13707    ObjectKind,
13708    #[serde(rename = "SCALAR")]
13709    Scalar,
13710    #[serde(rename = "SCALAR_KIND")]
13711    ScalarKind,
13712    #[serde(rename = "STRING")]
13713    String,
13714    #[serde(rename = "STRING_KIND")]
13715    StringKind,
13716    #[serde(rename = "VOID")]
13717    Void,
13718    #[serde(rename = "VOID_KIND")]
13719    VoidKind,
13720}