Skip to main content

dagger_sdk/
gen.rs

1#![allow(clippy::needless_lifetimes)]
2
3use crate::core::cli_session::DaggerSessionProc;
4use crate::core::graphql_client::DynGraphQLClient;
5use crate::errors::DaggerError;
6use crate::id::IntoID;
7use crate::querybuilder::Selection;
8use derive_builder::Builder;
9use serde::{Deserialize, Serialize};
10use std::sync::Arc;
11
12#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
13pub struct AddressId(pub String);
14impl From<&str> for AddressId {
15    fn from(value: &str) -> Self {
16        Self(value.to_string())
17    }
18}
19impl From<String> for AddressId {
20    fn from(value: String) -> Self {
21        Self(value)
22    }
23}
24impl IntoID<AddressId> for Address {
25    fn into_id(
26        self,
27    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<AddressId, DaggerError>> + Send>>
28    {
29        Box::pin(async move { self.id().await })
30    }
31}
32impl IntoID<AddressId> for AddressId {
33    fn into_id(
34        self,
35    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<AddressId, DaggerError>> + Send>>
36    {
37        Box::pin(async move { Ok::<AddressId, DaggerError>(self) })
38    }
39}
40impl AddressId {
41    fn quote(&self) -> String {
42        format!("\"{}\"", self.0.clone())
43    }
44}
45#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
46pub struct BindingId(pub String);
47impl From<&str> for BindingId {
48    fn from(value: &str) -> Self {
49        Self(value.to_string())
50    }
51}
52impl From<String> for BindingId {
53    fn from(value: String) -> Self {
54        Self(value)
55    }
56}
57impl IntoID<BindingId> for Binding {
58    fn into_id(
59        self,
60    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
61    {
62        Box::pin(async move { self.id().await })
63    }
64}
65impl IntoID<BindingId> for BindingId {
66    fn into_id(
67        self,
68    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
69    {
70        Box::pin(async move { Ok::<BindingId, DaggerError>(self) })
71    }
72}
73impl BindingId {
74    fn quote(&self) -> String {
75        format!("\"{}\"", self.0.clone())
76    }
77}
78#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
79pub struct CacheVolumeId(pub String);
80impl From<&str> for CacheVolumeId {
81    fn from(value: &str) -> Self {
82        Self(value.to_string())
83    }
84}
85impl From<String> for CacheVolumeId {
86    fn from(value: String) -> Self {
87        Self(value)
88    }
89}
90impl IntoID<CacheVolumeId> for CacheVolume {
91    fn into_id(
92        self,
93    ) -> std::pin::Pin<
94        Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
95    > {
96        Box::pin(async move { self.id().await })
97    }
98}
99impl IntoID<CacheVolumeId> for CacheVolumeId {
100    fn into_id(
101        self,
102    ) -> std::pin::Pin<
103        Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
104    > {
105        Box::pin(async move { Ok::<CacheVolumeId, DaggerError>(self) })
106    }
107}
108impl CacheVolumeId {
109    fn quote(&self) -> String {
110        format!("\"{}\"", self.0.clone())
111    }
112}
113#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
114pub struct ChangesetId(pub String);
115impl From<&str> for ChangesetId {
116    fn from(value: &str) -> Self {
117        Self(value.to_string())
118    }
119}
120impl From<String> for ChangesetId {
121    fn from(value: String) -> Self {
122        Self(value)
123    }
124}
125impl IntoID<ChangesetId> for Changeset {
126    fn into_id(
127        self,
128    ) -> std::pin::Pin<
129        Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
130    > {
131        Box::pin(async move { self.id().await })
132    }
133}
134impl IntoID<ChangesetId> for ChangesetId {
135    fn into_id(
136        self,
137    ) -> std::pin::Pin<
138        Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
139    > {
140        Box::pin(async move { Ok::<ChangesetId, DaggerError>(self) })
141    }
142}
143impl ChangesetId {
144    fn quote(&self) -> String {
145        format!("\"{}\"", self.0.clone())
146    }
147}
148#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
149pub struct CheckGroupId(pub String);
150impl From<&str> for CheckGroupId {
151    fn from(value: &str) -> Self {
152        Self(value.to_string())
153    }
154}
155impl From<String> for CheckGroupId {
156    fn from(value: String) -> Self {
157        Self(value)
158    }
159}
160impl IntoID<CheckGroupId> for CheckGroup {
161    fn into_id(
162        self,
163    ) -> std::pin::Pin<
164        Box<dyn core::future::Future<Output = Result<CheckGroupId, DaggerError>> + Send>,
165    > {
166        Box::pin(async move { self.id().await })
167    }
168}
169impl IntoID<CheckGroupId> for CheckGroupId {
170    fn into_id(
171        self,
172    ) -> std::pin::Pin<
173        Box<dyn core::future::Future<Output = Result<CheckGroupId, DaggerError>> + Send>,
174    > {
175        Box::pin(async move { Ok::<CheckGroupId, DaggerError>(self) })
176    }
177}
178impl CheckGroupId {
179    fn quote(&self) -> String {
180        format!("\"{}\"", self.0.clone())
181    }
182}
183#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
184pub struct CheckId(pub String);
185impl From<&str> for CheckId {
186    fn from(value: &str) -> Self {
187        Self(value.to_string())
188    }
189}
190impl From<String> for CheckId {
191    fn from(value: String) -> Self {
192        Self(value)
193    }
194}
195impl IntoID<CheckId> for Check {
196    fn into_id(
197        self,
198    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CheckId, DaggerError>> + Send>>
199    {
200        Box::pin(async move { self.id().await })
201    }
202}
203impl IntoID<CheckId> for CheckId {
204    fn into_id(
205        self,
206    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CheckId, DaggerError>> + Send>>
207    {
208        Box::pin(async move { Ok::<CheckId, DaggerError>(self) })
209    }
210}
211impl CheckId {
212    fn quote(&self) -> String {
213        format!("\"{}\"", self.0.clone())
214    }
215}
216#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
217pub struct CloudId(pub String);
218impl From<&str> for CloudId {
219    fn from(value: &str) -> Self {
220        Self(value.to_string())
221    }
222}
223impl From<String> for CloudId {
224    fn from(value: String) -> Self {
225        Self(value)
226    }
227}
228impl IntoID<CloudId> for Cloud {
229    fn into_id(
230        self,
231    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
232    {
233        Box::pin(async move { self.id().await })
234    }
235}
236impl IntoID<CloudId> for CloudId {
237    fn into_id(
238        self,
239    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
240    {
241        Box::pin(async move { Ok::<CloudId, DaggerError>(self) })
242    }
243}
244impl CloudId {
245    fn quote(&self) -> String {
246        format!("\"{}\"", self.0.clone())
247    }
248}
249#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
250pub struct ContainerId(pub String);
251impl From<&str> for ContainerId {
252    fn from(value: &str) -> Self {
253        Self(value.to_string())
254    }
255}
256impl From<String> for ContainerId {
257    fn from(value: String) -> Self {
258        Self(value)
259    }
260}
261impl IntoID<ContainerId> for Container {
262    fn into_id(
263        self,
264    ) -> std::pin::Pin<
265        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
266    > {
267        Box::pin(async move { self.id().await })
268    }
269}
270impl IntoID<ContainerId> for ContainerId {
271    fn into_id(
272        self,
273    ) -> std::pin::Pin<
274        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
275    > {
276        Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
277    }
278}
279impl ContainerId {
280    fn quote(&self) -> String {
281        format!("\"{}\"", self.0.clone())
282    }
283}
284#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
285pub struct CurrentModuleId(pub String);
286impl From<&str> for CurrentModuleId {
287    fn from(value: &str) -> Self {
288        Self(value.to_string())
289    }
290}
291impl From<String> for CurrentModuleId {
292    fn from(value: String) -> Self {
293        Self(value)
294    }
295}
296impl IntoID<CurrentModuleId> for CurrentModule {
297    fn into_id(
298        self,
299    ) -> std::pin::Pin<
300        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
301    > {
302        Box::pin(async move { self.id().await })
303    }
304}
305impl IntoID<CurrentModuleId> for CurrentModuleId {
306    fn into_id(
307        self,
308    ) -> std::pin::Pin<
309        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
310    > {
311        Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
312    }
313}
314impl CurrentModuleId {
315    fn quote(&self) -> String {
316        format!("\"{}\"", self.0.clone())
317    }
318}
319#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
320pub struct DirectoryId(pub String);
321impl From<&str> for DirectoryId {
322    fn from(value: &str) -> Self {
323        Self(value.to_string())
324    }
325}
326impl From<String> for DirectoryId {
327    fn from(value: String) -> Self {
328        Self(value)
329    }
330}
331impl IntoID<DirectoryId> for Directory {
332    fn into_id(
333        self,
334    ) -> std::pin::Pin<
335        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
336    > {
337        Box::pin(async move { self.id().await })
338    }
339}
340impl IntoID<DirectoryId> for DirectoryId {
341    fn into_id(
342        self,
343    ) -> std::pin::Pin<
344        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
345    > {
346        Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
347    }
348}
349impl DirectoryId {
350    fn quote(&self) -> String {
351        format!("\"{}\"", self.0.clone())
352    }
353}
354#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
355pub struct EngineCacheEntryId(pub String);
356impl From<&str> for EngineCacheEntryId {
357    fn from(value: &str) -> Self {
358        Self(value.to_string())
359    }
360}
361impl From<String> for EngineCacheEntryId {
362    fn from(value: String) -> Self {
363        Self(value)
364    }
365}
366impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
367    fn into_id(
368        self,
369    ) -> std::pin::Pin<
370        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
371    > {
372        Box::pin(async move { self.id().await })
373    }
374}
375impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
376    fn into_id(
377        self,
378    ) -> std::pin::Pin<
379        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
380    > {
381        Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
382    }
383}
384impl EngineCacheEntryId {
385    fn quote(&self) -> String {
386        format!("\"{}\"", self.0.clone())
387    }
388}
389#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
390pub struct EngineCacheEntrySetId(pub String);
391impl From<&str> for EngineCacheEntrySetId {
392    fn from(value: &str) -> Self {
393        Self(value.to_string())
394    }
395}
396impl From<String> for EngineCacheEntrySetId {
397    fn from(value: String) -> Self {
398        Self(value)
399    }
400}
401impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
402    fn into_id(
403        self,
404    ) -> std::pin::Pin<
405        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
406    > {
407        Box::pin(async move { self.id().await })
408    }
409}
410impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
411    fn into_id(
412        self,
413    ) -> std::pin::Pin<
414        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
415    > {
416        Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
417    }
418}
419impl EngineCacheEntrySetId {
420    fn quote(&self) -> String {
421        format!("\"{}\"", self.0.clone())
422    }
423}
424#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
425pub struct EngineCacheId(pub String);
426impl From<&str> for EngineCacheId {
427    fn from(value: &str) -> Self {
428        Self(value.to_string())
429    }
430}
431impl From<String> for EngineCacheId {
432    fn from(value: String) -> Self {
433        Self(value)
434    }
435}
436impl IntoID<EngineCacheId> for EngineCache {
437    fn into_id(
438        self,
439    ) -> std::pin::Pin<
440        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
441    > {
442        Box::pin(async move { self.id().await })
443    }
444}
445impl IntoID<EngineCacheId> for EngineCacheId {
446    fn into_id(
447        self,
448    ) -> std::pin::Pin<
449        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
450    > {
451        Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
452    }
453}
454impl EngineCacheId {
455    fn quote(&self) -> String {
456        format!("\"{}\"", self.0.clone())
457    }
458}
459#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
460pub struct EngineId(pub String);
461impl From<&str> for EngineId {
462    fn from(value: &str) -> Self {
463        Self(value.to_string())
464    }
465}
466impl From<String> for EngineId {
467    fn from(value: String) -> Self {
468        Self(value)
469    }
470}
471impl IntoID<EngineId> for Engine {
472    fn into_id(
473        self,
474    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
475    {
476        Box::pin(async move { self.id().await })
477    }
478}
479impl IntoID<EngineId> for EngineId {
480    fn into_id(
481        self,
482    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
483    {
484        Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
485    }
486}
487impl EngineId {
488    fn quote(&self) -> String {
489        format!("\"{}\"", self.0.clone())
490    }
491}
492#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
493pub struct EnumTypeDefId(pub String);
494impl From<&str> for EnumTypeDefId {
495    fn from(value: &str) -> Self {
496        Self(value.to_string())
497    }
498}
499impl From<String> for EnumTypeDefId {
500    fn from(value: String) -> Self {
501        Self(value)
502    }
503}
504impl IntoID<EnumTypeDefId> for EnumTypeDef {
505    fn into_id(
506        self,
507    ) -> std::pin::Pin<
508        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
509    > {
510        Box::pin(async move { self.id().await })
511    }
512}
513impl IntoID<EnumTypeDefId> for EnumTypeDefId {
514    fn into_id(
515        self,
516    ) -> std::pin::Pin<
517        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
518    > {
519        Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
520    }
521}
522impl EnumTypeDefId {
523    fn quote(&self) -> String {
524        format!("\"{}\"", self.0.clone())
525    }
526}
527#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
528pub struct EnumValueTypeDefId(pub String);
529impl From<&str> for EnumValueTypeDefId {
530    fn from(value: &str) -> Self {
531        Self(value.to_string())
532    }
533}
534impl From<String> for EnumValueTypeDefId {
535    fn from(value: String) -> Self {
536        Self(value)
537    }
538}
539impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
540    fn into_id(
541        self,
542    ) -> std::pin::Pin<
543        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
544    > {
545        Box::pin(async move { self.id().await })
546    }
547}
548impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
549    fn into_id(
550        self,
551    ) -> std::pin::Pin<
552        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
553    > {
554        Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
555    }
556}
557impl EnumValueTypeDefId {
558    fn quote(&self) -> String {
559        format!("\"{}\"", self.0.clone())
560    }
561}
562#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
563pub struct EnvFileId(pub String);
564impl From<&str> for EnvFileId {
565    fn from(value: &str) -> Self {
566        Self(value.to_string())
567    }
568}
569impl From<String> for EnvFileId {
570    fn from(value: String) -> Self {
571        Self(value)
572    }
573}
574impl IntoID<EnvFileId> for EnvFile {
575    fn into_id(
576        self,
577    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
578    {
579        Box::pin(async move { self.id().await })
580    }
581}
582impl IntoID<EnvFileId> for EnvFileId {
583    fn into_id(
584        self,
585    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
586    {
587        Box::pin(async move { Ok::<EnvFileId, DaggerError>(self) })
588    }
589}
590impl EnvFileId {
591    fn quote(&self) -> String {
592        format!("\"{}\"", self.0.clone())
593    }
594}
595#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
596pub struct EnvId(pub String);
597impl From<&str> for EnvId {
598    fn from(value: &str) -> Self {
599        Self(value.to_string())
600    }
601}
602impl From<String> for EnvId {
603    fn from(value: String) -> Self {
604        Self(value)
605    }
606}
607impl IntoID<EnvId> for Env {
608    fn into_id(
609        self,
610    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
611    {
612        Box::pin(async move { self.id().await })
613    }
614}
615impl IntoID<EnvId> for EnvId {
616    fn into_id(
617        self,
618    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
619    {
620        Box::pin(async move { Ok::<EnvId, DaggerError>(self) })
621    }
622}
623impl EnvId {
624    fn quote(&self) -> String {
625        format!("\"{}\"", self.0.clone())
626    }
627}
628#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
629pub struct EnvVariableId(pub String);
630impl From<&str> for EnvVariableId {
631    fn from(value: &str) -> Self {
632        Self(value.to_string())
633    }
634}
635impl From<String> for EnvVariableId {
636    fn from(value: String) -> Self {
637        Self(value)
638    }
639}
640impl IntoID<EnvVariableId> for EnvVariable {
641    fn into_id(
642        self,
643    ) -> std::pin::Pin<
644        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
645    > {
646        Box::pin(async move { self.id().await })
647    }
648}
649impl IntoID<EnvVariableId> for EnvVariableId {
650    fn into_id(
651        self,
652    ) -> std::pin::Pin<
653        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
654    > {
655        Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
656    }
657}
658impl EnvVariableId {
659    fn quote(&self) -> String {
660        format!("\"{}\"", self.0.clone())
661    }
662}
663#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
664pub struct ErrorId(pub String);
665impl From<&str> for ErrorId {
666    fn from(value: &str) -> Self {
667        Self(value.to_string())
668    }
669}
670impl From<String> for ErrorId {
671    fn from(value: String) -> Self {
672        Self(value)
673    }
674}
675impl IntoID<ErrorId> for Error {
676    fn into_id(
677        self,
678    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
679    {
680        Box::pin(async move { self.id().await })
681    }
682}
683impl IntoID<ErrorId> for ErrorId {
684    fn into_id(
685        self,
686    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
687    {
688        Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
689    }
690}
691impl ErrorId {
692    fn quote(&self) -> String {
693        format!("\"{}\"", self.0.clone())
694    }
695}
696#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
697pub struct ErrorValueId(pub String);
698impl From<&str> for ErrorValueId {
699    fn from(value: &str) -> Self {
700        Self(value.to_string())
701    }
702}
703impl From<String> for ErrorValueId {
704    fn from(value: String) -> Self {
705        Self(value)
706    }
707}
708impl IntoID<ErrorValueId> for ErrorValue {
709    fn into_id(
710        self,
711    ) -> std::pin::Pin<
712        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
713    > {
714        Box::pin(async move { self.id().await })
715    }
716}
717impl IntoID<ErrorValueId> for ErrorValueId {
718    fn into_id(
719        self,
720    ) -> std::pin::Pin<
721        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
722    > {
723        Box::pin(async move { Ok::<ErrorValueId, DaggerError>(self) })
724    }
725}
726impl ErrorValueId {
727    fn quote(&self) -> String {
728        format!("\"{}\"", self.0.clone())
729    }
730}
731#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
732pub struct FieldTypeDefId(pub String);
733impl From<&str> for FieldTypeDefId {
734    fn from(value: &str) -> Self {
735        Self(value.to_string())
736    }
737}
738impl From<String> for FieldTypeDefId {
739    fn from(value: String) -> Self {
740        Self(value)
741    }
742}
743impl IntoID<FieldTypeDefId> for FieldTypeDef {
744    fn into_id(
745        self,
746    ) -> std::pin::Pin<
747        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
748    > {
749        Box::pin(async move { self.id().await })
750    }
751}
752impl IntoID<FieldTypeDefId> for FieldTypeDefId {
753    fn into_id(
754        self,
755    ) -> std::pin::Pin<
756        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
757    > {
758        Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
759    }
760}
761impl FieldTypeDefId {
762    fn quote(&self) -> String {
763        format!("\"{}\"", self.0.clone())
764    }
765}
766#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
767pub struct FileId(pub String);
768impl From<&str> for FileId {
769    fn from(value: &str) -> Self {
770        Self(value.to_string())
771    }
772}
773impl From<String> for FileId {
774    fn from(value: String) -> Self {
775        Self(value)
776    }
777}
778impl IntoID<FileId> for File {
779    fn into_id(
780        self,
781    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
782    {
783        Box::pin(async move { self.id().await })
784    }
785}
786impl IntoID<FileId> for FileId {
787    fn into_id(
788        self,
789    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
790    {
791        Box::pin(async move { Ok::<FileId, DaggerError>(self) })
792    }
793}
794impl FileId {
795    fn quote(&self) -> String {
796        format!("\"{}\"", self.0.clone())
797    }
798}
799#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
800pub struct FunctionArgId(pub String);
801impl From<&str> for FunctionArgId {
802    fn from(value: &str) -> Self {
803        Self(value.to_string())
804    }
805}
806impl From<String> for FunctionArgId {
807    fn from(value: String) -> Self {
808        Self(value)
809    }
810}
811impl IntoID<FunctionArgId> for FunctionArg {
812    fn into_id(
813        self,
814    ) -> std::pin::Pin<
815        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
816    > {
817        Box::pin(async move { self.id().await })
818    }
819}
820impl IntoID<FunctionArgId> for FunctionArgId {
821    fn into_id(
822        self,
823    ) -> std::pin::Pin<
824        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
825    > {
826        Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
827    }
828}
829impl FunctionArgId {
830    fn quote(&self) -> String {
831        format!("\"{}\"", self.0.clone())
832    }
833}
834#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
835pub struct FunctionCallArgValueId(pub String);
836impl From<&str> for FunctionCallArgValueId {
837    fn from(value: &str) -> Self {
838        Self(value.to_string())
839    }
840}
841impl From<String> for FunctionCallArgValueId {
842    fn from(value: String) -> Self {
843        Self(value)
844    }
845}
846impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
847    fn into_id(
848        self,
849    ) -> std::pin::Pin<
850        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
851    > {
852        Box::pin(async move { self.id().await })
853    }
854}
855impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
856    fn into_id(
857        self,
858    ) -> std::pin::Pin<
859        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
860    > {
861        Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
862    }
863}
864impl FunctionCallArgValueId {
865    fn quote(&self) -> String {
866        format!("\"{}\"", self.0.clone())
867    }
868}
869#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
870pub struct FunctionCallId(pub String);
871impl From<&str> for FunctionCallId {
872    fn from(value: &str) -> Self {
873        Self(value.to_string())
874    }
875}
876impl From<String> for FunctionCallId {
877    fn from(value: String) -> Self {
878        Self(value)
879    }
880}
881impl IntoID<FunctionCallId> for FunctionCall {
882    fn into_id(
883        self,
884    ) -> std::pin::Pin<
885        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
886    > {
887        Box::pin(async move { self.id().await })
888    }
889}
890impl IntoID<FunctionCallId> for FunctionCallId {
891    fn into_id(
892        self,
893    ) -> std::pin::Pin<
894        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
895    > {
896        Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
897    }
898}
899impl FunctionCallId {
900    fn quote(&self) -> String {
901        format!("\"{}\"", self.0.clone())
902    }
903}
904#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
905pub struct FunctionId(pub String);
906impl From<&str> for FunctionId {
907    fn from(value: &str) -> Self {
908        Self(value.to_string())
909    }
910}
911impl From<String> for FunctionId {
912    fn from(value: String) -> Self {
913        Self(value)
914    }
915}
916impl IntoID<FunctionId> for Function {
917    fn into_id(
918        self,
919    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
920    {
921        Box::pin(async move { self.id().await })
922    }
923}
924impl IntoID<FunctionId> for FunctionId {
925    fn into_id(
926        self,
927    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
928    {
929        Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
930    }
931}
932impl FunctionId {
933    fn quote(&self) -> String {
934        format!("\"{}\"", self.0.clone())
935    }
936}
937#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
938pub struct GeneratedCodeId(pub String);
939impl From<&str> for GeneratedCodeId {
940    fn from(value: &str) -> Self {
941        Self(value.to_string())
942    }
943}
944impl From<String> for GeneratedCodeId {
945    fn from(value: String) -> Self {
946        Self(value)
947    }
948}
949impl IntoID<GeneratedCodeId> for GeneratedCode {
950    fn into_id(
951        self,
952    ) -> std::pin::Pin<
953        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
954    > {
955        Box::pin(async move { self.id().await })
956    }
957}
958impl IntoID<GeneratedCodeId> for GeneratedCodeId {
959    fn into_id(
960        self,
961    ) -> std::pin::Pin<
962        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
963    > {
964        Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
965    }
966}
967impl GeneratedCodeId {
968    fn quote(&self) -> String {
969        format!("\"{}\"", self.0.clone())
970    }
971}
972#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
973pub struct GeneratorGroupId(pub String);
974impl From<&str> for GeneratorGroupId {
975    fn from(value: &str) -> Self {
976        Self(value.to_string())
977    }
978}
979impl From<String> for GeneratorGroupId {
980    fn from(value: String) -> Self {
981        Self(value)
982    }
983}
984impl IntoID<GeneratorGroupId> for GeneratorGroup {
985    fn into_id(
986        self,
987    ) -> std::pin::Pin<
988        Box<dyn core::future::Future<Output = Result<GeneratorGroupId, DaggerError>> + Send>,
989    > {
990        Box::pin(async move { self.id().await })
991    }
992}
993impl IntoID<GeneratorGroupId> for GeneratorGroupId {
994    fn into_id(
995        self,
996    ) -> std::pin::Pin<
997        Box<dyn core::future::Future<Output = Result<GeneratorGroupId, DaggerError>> + Send>,
998    > {
999        Box::pin(async move { Ok::<GeneratorGroupId, DaggerError>(self) })
1000    }
1001}
1002impl GeneratorGroupId {
1003    fn quote(&self) -> String {
1004        format!("\"{}\"", self.0.clone())
1005    }
1006}
1007#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1008pub struct GeneratorId(pub String);
1009impl From<&str> for GeneratorId {
1010    fn from(value: &str) -> Self {
1011        Self(value.to_string())
1012    }
1013}
1014impl From<String> for GeneratorId {
1015    fn from(value: String) -> Self {
1016        Self(value)
1017    }
1018}
1019impl IntoID<GeneratorId> for Generator {
1020    fn into_id(
1021        self,
1022    ) -> std::pin::Pin<
1023        Box<dyn core::future::Future<Output = Result<GeneratorId, DaggerError>> + Send>,
1024    > {
1025        Box::pin(async move { self.id().await })
1026    }
1027}
1028impl IntoID<GeneratorId> for GeneratorId {
1029    fn into_id(
1030        self,
1031    ) -> std::pin::Pin<
1032        Box<dyn core::future::Future<Output = Result<GeneratorId, DaggerError>> + Send>,
1033    > {
1034        Box::pin(async move { Ok::<GeneratorId, DaggerError>(self) })
1035    }
1036}
1037impl GeneratorId {
1038    fn quote(&self) -> String {
1039        format!("\"{}\"", self.0.clone())
1040    }
1041}
1042#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1043pub struct GitRefId(pub String);
1044impl From<&str> for GitRefId {
1045    fn from(value: &str) -> Self {
1046        Self(value.to_string())
1047    }
1048}
1049impl From<String> for GitRefId {
1050    fn from(value: String) -> Self {
1051        Self(value)
1052    }
1053}
1054impl IntoID<GitRefId> for GitRef {
1055    fn into_id(
1056        self,
1057    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
1058    {
1059        Box::pin(async move { self.id().await })
1060    }
1061}
1062impl IntoID<GitRefId> for GitRefId {
1063    fn into_id(
1064        self,
1065    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
1066    {
1067        Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
1068    }
1069}
1070impl GitRefId {
1071    fn quote(&self) -> String {
1072        format!("\"{}\"", self.0.clone())
1073    }
1074}
1075#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1076pub struct GitRepositoryId(pub String);
1077impl From<&str> for GitRepositoryId {
1078    fn from(value: &str) -> Self {
1079        Self(value.to_string())
1080    }
1081}
1082impl From<String> for GitRepositoryId {
1083    fn from(value: String) -> Self {
1084        Self(value)
1085    }
1086}
1087impl IntoID<GitRepositoryId> for GitRepository {
1088    fn into_id(
1089        self,
1090    ) -> std::pin::Pin<
1091        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
1092    > {
1093        Box::pin(async move { self.id().await })
1094    }
1095}
1096impl IntoID<GitRepositoryId> for GitRepositoryId {
1097    fn into_id(
1098        self,
1099    ) -> std::pin::Pin<
1100        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
1101    > {
1102        Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
1103    }
1104}
1105impl GitRepositoryId {
1106    fn quote(&self) -> String {
1107        format!("\"{}\"", self.0.clone())
1108    }
1109}
1110#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1111pub struct HostId(pub String);
1112impl From<&str> for HostId {
1113    fn from(value: &str) -> Self {
1114        Self(value.to_string())
1115    }
1116}
1117impl From<String> for HostId {
1118    fn from(value: String) -> Self {
1119        Self(value)
1120    }
1121}
1122impl IntoID<HostId> for Host {
1123    fn into_id(
1124        self,
1125    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
1126    {
1127        Box::pin(async move { self.id().await })
1128    }
1129}
1130impl IntoID<HostId> for HostId {
1131    fn into_id(
1132        self,
1133    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
1134    {
1135        Box::pin(async move { Ok::<HostId, DaggerError>(self) })
1136    }
1137}
1138impl HostId {
1139    fn quote(&self) -> String {
1140        format!("\"{}\"", self.0.clone())
1141    }
1142}
1143#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1144pub struct InputTypeDefId(pub String);
1145impl From<&str> for InputTypeDefId {
1146    fn from(value: &str) -> Self {
1147        Self(value.to_string())
1148    }
1149}
1150impl From<String> for InputTypeDefId {
1151    fn from(value: String) -> Self {
1152        Self(value)
1153    }
1154}
1155impl IntoID<InputTypeDefId> for InputTypeDef {
1156    fn into_id(
1157        self,
1158    ) -> std::pin::Pin<
1159        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1160    > {
1161        Box::pin(async move { self.id().await })
1162    }
1163}
1164impl IntoID<InputTypeDefId> for InputTypeDefId {
1165    fn into_id(
1166        self,
1167    ) -> std::pin::Pin<
1168        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1169    > {
1170        Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
1171    }
1172}
1173impl InputTypeDefId {
1174    fn quote(&self) -> String {
1175        format!("\"{}\"", self.0.clone())
1176    }
1177}
1178#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1179pub struct InterfaceTypeDefId(pub String);
1180impl From<&str> for InterfaceTypeDefId {
1181    fn from(value: &str) -> Self {
1182        Self(value.to_string())
1183    }
1184}
1185impl From<String> for InterfaceTypeDefId {
1186    fn from(value: String) -> Self {
1187        Self(value)
1188    }
1189}
1190impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
1191    fn into_id(
1192        self,
1193    ) -> std::pin::Pin<
1194        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1195    > {
1196        Box::pin(async move { self.id().await })
1197    }
1198}
1199impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
1200    fn into_id(
1201        self,
1202    ) -> std::pin::Pin<
1203        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1204    > {
1205        Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
1206    }
1207}
1208impl InterfaceTypeDefId {
1209    fn quote(&self) -> String {
1210        format!("\"{}\"", self.0.clone())
1211    }
1212}
1213#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1214pub struct Json(pub String);
1215impl From<&str> for Json {
1216    fn from(value: &str) -> Self {
1217        Self(value.to_string())
1218    }
1219}
1220impl From<String> for Json {
1221    fn from(value: String) -> Self {
1222        Self(value)
1223    }
1224}
1225impl Json {
1226    fn quote(&self) -> String {
1227        format!("\"{}\"", self.0.clone())
1228    }
1229}
1230#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1231pub struct JsonValueId(pub String);
1232impl From<&str> for JsonValueId {
1233    fn from(value: &str) -> Self {
1234        Self(value.to_string())
1235    }
1236}
1237impl From<String> for JsonValueId {
1238    fn from(value: String) -> Self {
1239        Self(value)
1240    }
1241}
1242impl IntoID<JsonValueId> for JsonValue {
1243    fn into_id(
1244        self,
1245    ) -> std::pin::Pin<
1246        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1247    > {
1248        Box::pin(async move { self.id().await })
1249    }
1250}
1251impl IntoID<JsonValueId> for JsonValueId {
1252    fn into_id(
1253        self,
1254    ) -> std::pin::Pin<
1255        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1256    > {
1257        Box::pin(async move { Ok::<JsonValueId, DaggerError>(self) })
1258    }
1259}
1260impl JsonValueId {
1261    fn quote(&self) -> String {
1262        format!("\"{}\"", self.0.clone())
1263    }
1264}
1265#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1266pub struct Llmid(pub String);
1267impl From<&str> for Llmid {
1268    fn from(value: &str) -> Self {
1269        Self(value.to_string())
1270    }
1271}
1272impl From<String> for Llmid {
1273    fn from(value: String) -> Self {
1274        Self(value)
1275    }
1276}
1277impl IntoID<Llmid> for Llm {
1278    fn into_id(
1279        self,
1280    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1281    {
1282        Box::pin(async move { self.id().await })
1283    }
1284}
1285impl IntoID<Llmid> for Llmid {
1286    fn into_id(
1287        self,
1288    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1289    {
1290        Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
1291    }
1292}
1293impl Llmid {
1294    fn quote(&self) -> String {
1295        format!("\"{}\"", self.0.clone())
1296    }
1297}
1298#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1299pub struct LlmTokenUsageId(pub String);
1300impl From<&str> for LlmTokenUsageId {
1301    fn from(value: &str) -> Self {
1302        Self(value.to_string())
1303    }
1304}
1305impl From<String> for LlmTokenUsageId {
1306    fn from(value: String) -> Self {
1307        Self(value)
1308    }
1309}
1310impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
1311    fn into_id(
1312        self,
1313    ) -> std::pin::Pin<
1314        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1315    > {
1316        Box::pin(async move { self.id().await })
1317    }
1318}
1319impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
1320    fn into_id(
1321        self,
1322    ) -> std::pin::Pin<
1323        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1324    > {
1325        Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
1326    }
1327}
1328impl LlmTokenUsageId {
1329    fn quote(&self) -> String {
1330        format!("\"{}\"", self.0.clone())
1331    }
1332}
1333#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1334pub struct LabelId(pub String);
1335impl From<&str> for LabelId {
1336    fn from(value: &str) -> Self {
1337        Self(value.to_string())
1338    }
1339}
1340impl From<String> for LabelId {
1341    fn from(value: String) -> Self {
1342        Self(value)
1343    }
1344}
1345impl IntoID<LabelId> for Label {
1346    fn into_id(
1347        self,
1348    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1349    {
1350        Box::pin(async move { self.id().await })
1351    }
1352}
1353impl IntoID<LabelId> for LabelId {
1354    fn into_id(
1355        self,
1356    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1357    {
1358        Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
1359    }
1360}
1361impl LabelId {
1362    fn quote(&self) -> String {
1363        format!("\"{}\"", self.0.clone())
1364    }
1365}
1366#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1367pub struct ListTypeDefId(pub String);
1368impl From<&str> for ListTypeDefId {
1369    fn from(value: &str) -> Self {
1370        Self(value.to_string())
1371    }
1372}
1373impl From<String> for ListTypeDefId {
1374    fn from(value: String) -> Self {
1375        Self(value)
1376    }
1377}
1378impl IntoID<ListTypeDefId> for ListTypeDef {
1379    fn into_id(
1380        self,
1381    ) -> std::pin::Pin<
1382        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1383    > {
1384        Box::pin(async move { self.id().await })
1385    }
1386}
1387impl IntoID<ListTypeDefId> for ListTypeDefId {
1388    fn into_id(
1389        self,
1390    ) -> std::pin::Pin<
1391        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1392    > {
1393        Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
1394    }
1395}
1396impl ListTypeDefId {
1397    fn quote(&self) -> String {
1398        format!("\"{}\"", self.0.clone())
1399    }
1400}
1401#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1402pub struct ModuleConfigClientId(pub String);
1403impl From<&str> for ModuleConfigClientId {
1404    fn from(value: &str) -> Self {
1405        Self(value.to_string())
1406    }
1407}
1408impl From<String> for ModuleConfigClientId {
1409    fn from(value: String) -> Self {
1410        Self(value)
1411    }
1412}
1413impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
1414    fn into_id(
1415        self,
1416    ) -> std::pin::Pin<
1417        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1418    > {
1419        Box::pin(async move { self.id().await })
1420    }
1421}
1422impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
1423    fn into_id(
1424        self,
1425    ) -> std::pin::Pin<
1426        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1427    > {
1428        Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
1429    }
1430}
1431impl ModuleConfigClientId {
1432    fn quote(&self) -> String {
1433        format!("\"{}\"", self.0.clone())
1434    }
1435}
1436#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1437pub struct ModuleId(pub String);
1438impl From<&str> for ModuleId {
1439    fn from(value: &str) -> Self {
1440        Self(value.to_string())
1441    }
1442}
1443impl From<String> for ModuleId {
1444    fn from(value: String) -> Self {
1445        Self(value)
1446    }
1447}
1448impl IntoID<ModuleId> for Module {
1449    fn into_id(
1450        self,
1451    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1452    {
1453        Box::pin(async move { self.id().await })
1454    }
1455}
1456impl IntoID<ModuleId> for ModuleId {
1457    fn into_id(
1458        self,
1459    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1460    {
1461        Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
1462    }
1463}
1464impl ModuleId {
1465    fn quote(&self) -> String {
1466        format!("\"{}\"", self.0.clone())
1467    }
1468}
1469#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1470pub struct ModuleSourceId(pub String);
1471impl From<&str> for ModuleSourceId {
1472    fn from(value: &str) -> Self {
1473        Self(value.to_string())
1474    }
1475}
1476impl From<String> for ModuleSourceId {
1477    fn from(value: String) -> Self {
1478        Self(value)
1479    }
1480}
1481impl IntoID<ModuleSourceId> for ModuleSource {
1482    fn into_id(
1483        self,
1484    ) -> std::pin::Pin<
1485        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1486    > {
1487        Box::pin(async move { self.id().await })
1488    }
1489}
1490impl IntoID<ModuleSourceId> for ModuleSourceId {
1491    fn into_id(
1492        self,
1493    ) -> std::pin::Pin<
1494        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1495    > {
1496        Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1497    }
1498}
1499impl ModuleSourceId {
1500    fn quote(&self) -> String {
1501        format!("\"{}\"", self.0.clone())
1502    }
1503}
1504#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1505pub struct ObjectTypeDefId(pub String);
1506impl From<&str> for ObjectTypeDefId {
1507    fn from(value: &str) -> Self {
1508        Self(value.to_string())
1509    }
1510}
1511impl From<String> for ObjectTypeDefId {
1512    fn from(value: String) -> Self {
1513        Self(value)
1514    }
1515}
1516impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1517    fn into_id(
1518        self,
1519    ) -> std::pin::Pin<
1520        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1521    > {
1522        Box::pin(async move { self.id().await })
1523    }
1524}
1525impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1526    fn into_id(
1527        self,
1528    ) -> std::pin::Pin<
1529        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1530    > {
1531        Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1532    }
1533}
1534impl ObjectTypeDefId {
1535    fn quote(&self) -> String {
1536        format!("\"{}\"", self.0.clone())
1537    }
1538}
1539#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1540pub struct Platform(pub String);
1541impl From<&str> for Platform {
1542    fn from(value: &str) -> Self {
1543        Self(value.to_string())
1544    }
1545}
1546impl From<String> for Platform {
1547    fn from(value: String) -> Self {
1548        Self(value)
1549    }
1550}
1551impl Platform {
1552    fn quote(&self) -> String {
1553        format!("\"{}\"", self.0.clone())
1554    }
1555}
1556#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1557pub struct PortId(pub String);
1558impl From<&str> for PortId {
1559    fn from(value: &str) -> Self {
1560        Self(value.to_string())
1561    }
1562}
1563impl From<String> for PortId {
1564    fn from(value: String) -> Self {
1565        Self(value)
1566    }
1567}
1568impl IntoID<PortId> for Port {
1569    fn into_id(
1570        self,
1571    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1572    {
1573        Box::pin(async move { self.id().await })
1574    }
1575}
1576impl IntoID<PortId> for PortId {
1577    fn into_id(
1578        self,
1579    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1580    {
1581        Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1582    }
1583}
1584impl PortId {
1585    fn quote(&self) -> String {
1586        format!("\"{}\"", self.0.clone())
1587    }
1588}
1589#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1590pub struct SdkConfigId(pub String);
1591impl From<&str> for SdkConfigId {
1592    fn from(value: &str) -> Self {
1593        Self(value.to_string())
1594    }
1595}
1596impl From<String> for SdkConfigId {
1597    fn from(value: String) -> Self {
1598        Self(value)
1599    }
1600}
1601impl IntoID<SdkConfigId> for SdkConfig {
1602    fn into_id(
1603        self,
1604    ) -> std::pin::Pin<
1605        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1606    > {
1607        Box::pin(async move { self.id().await })
1608    }
1609}
1610impl IntoID<SdkConfigId> for SdkConfigId {
1611    fn into_id(
1612        self,
1613    ) -> std::pin::Pin<
1614        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1615    > {
1616        Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1617    }
1618}
1619impl SdkConfigId {
1620    fn quote(&self) -> String {
1621        format!("\"{}\"", self.0.clone())
1622    }
1623}
1624#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1625pub struct ScalarTypeDefId(pub String);
1626impl From<&str> for ScalarTypeDefId {
1627    fn from(value: &str) -> Self {
1628        Self(value.to_string())
1629    }
1630}
1631impl From<String> for ScalarTypeDefId {
1632    fn from(value: String) -> Self {
1633        Self(value)
1634    }
1635}
1636impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1637    fn into_id(
1638        self,
1639    ) -> std::pin::Pin<
1640        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1641    > {
1642        Box::pin(async move { self.id().await })
1643    }
1644}
1645impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1646    fn into_id(
1647        self,
1648    ) -> std::pin::Pin<
1649        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1650    > {
1651        Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1652    }
1653}
1654impl ScalarTypeDefId {
1655    fn quote(&self) -> String {
1656        format!("\"{}\"", self.0.clone())
1657    }
1658}
1659#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1660pub struct SearchResultId(pub String);
1661impl From<&str> for SearchResultId {
1662    fn from(value: &str) -> Self {
1663        Self(value.to_string())
1664    }
1665}
1666impl From<String> for SearchResultId {
1667    fn from(value: String) -> Self {
1668        Self(value)
1669    }
1670}
1671impl IntoID<SearchResultId> for SearchResult {
1672    fn into_id(
1673        self,
1674    ) -> std::pin::Pin<
1675        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1676    > {
1677        Box::pin(async move { self.id().await })
1678    }
1679}
1680impl IntoID<SearchResultId> for SearchResultId {
1681    fn into_id(
1682        self,
1683    ) -> std::pin::Pin<
1684        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1685    > {
1686        Box::pin(async move { Ok::<SearchResultId, DaggerError>(self) })
1687    }
1688}
1689impl SearchResultId {
1690    fn quote(&self) -> String {
1691        format!("\"{}\"", self.0.clone())
1692    }
1693}
1694#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1695pub struct SearchSubmatchId(pub String);
1696impl From<&str> for SearchSubmatchId {
1697    fn from(value: &str) -> Self {
1698        Self(value.to_string())
1699    }
1700}
1701impl From<String> for SearchSubmatchId {
1702    fn from(value: String) -> Self {
1703        Self(value)
1704    }
1705}
1706impl IntoID<SearchSubmatchId> for SearchSubmatch {
1707    fn into_id(
1708        self,
1709    ) -> std::pin::Pin<
1710        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1711    > {
1712        Box::pin(async move { self.id().await })
1713    }
1714}
1715impl IntoID<SearchSubmatchId> for SearchSubmatchId {
1716    fn into_id(
1717        self,
1718    ) -> std::pin::Pin<
1719        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1720    > {
1721        Box::pin(async move { Ok::<SearchSubmatchId, DaggerError>(self) })
1722    }
1723}
1724impl SearchSubmatchId {
1725    fn quote(&self) -> String {
1726        format!("\"{}\"", self.0.clone())
1727    }
1728}
1729#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1730pub struct SecretId(pub String);
1731impl From<&str> for SecretId {
1732    fn from(value: &str) -> Self {
1733        Self(value.to_string())
1734    }
1735}
1736impl From<String> for SecretId {
1737    fn from(value: String) -> Self {
1738        Self(value)
1739    }
1740}
1741impl IntoID<SecretId> for Secret {
1742    fn into_id(
1743        self,
1744    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1745    {
1746        Box::pin(async move { self.id().await })
1747    }
1748}
1749impl IntoID<SecretId> for SecretId {
1750    fn into_id(
1751        self,
1752    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1753    {
1754        Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1755    }
1756}
1757impl SecretId {
1758    fn quote(&self) -> String {
1759        format!("\"{}\"", self.0.clone())
1760    }
1761}
1762#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1763pub struct ServiceId(pub String);
1764impl From<&str> for ServiceId {
1765    fn from(value: &str) -> Self {
1766        Self(value.to_string())
1767    }
1768}
1769impl From<String> for ServiceId {
1770    fn from(value: String) -> Self {
1771        Self(value)
1772    }
1773}
1774impl IntoID<ServiceId> for Service {
1775    fn into_id(
1776        self,
1777    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1778    {
1779        Box::pin(async move { self.id().await })
1780    }
1781}
1782impl IntoID<ServiceId> for ServiceId {
1783    fn into_id(
1784        self,
1785    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1786    {
1787        Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1788    }
1789}
1790impl ServiceId {
1791    fn quote(&self) -> String {
1792        format!("\"{}\"", self.0.clone())
1793    }
1794}
1795#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1796pub struct SocketId(pub String);
1797impl From<&str> for SocketId {
1798    fn from(value: &str) -> Self {
1799        Self(value.to_string())
1800    }
1801}
1802impl From<String> for SocketId {
1803    fn from(value: String) -> Self {
1804        Self(value)
1805    }
1806}
1807impl IntoID<SocketId> for Socket {
1808    fn into_id(
1809        self,
1810    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1811    {
1812        Box::pin(async move { self.id().await })
1813    }
1814}
1815impl IntoID<SocketId> for SocketId {
1816    fn into_id(
1817        self,
1818    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1819    {
1820        Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1821    }
1822}
1823impl SocketId {
1824    fn quote(&self) -> String {
1825        format!("\"{}\"", self.0.clone())
1826    }
1827}
1828#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1829pub struct SourceMapId(pub String);
1830impl From<&str> for SourceMapId {
1831    fn from(value: &str) -> Self {
1832        Self(value.to_string())
1833    }
1834}
1835impl From<String> for SourceMapId {
1836    fn from(value: String) -> Self {
1837        Self(value)
1838    }
1839}
1840impl IntoID<SourceMapId> for SourceMap {
1841    fn into_id(
1842        self,
1843    ) -> std::pin::Pin<
1844        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1845    > {
1846        Box::pin(async move { self.id().await })
1847    }
1848}
1849impl IntoID<SourceMapId> for SourceMapId {
1850    fn into_id(
1851        self,
1852    ) -> std::pin::Pin<
1853        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1854    > {
1855        Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1856    }
1857}
1858impl SourceMapId {
1859    fn quote(&self) -> String {
1860        format!("\"{}\"", self.0.clone())
1861    }
1862}
1863#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1864pub struct StatId(pub String);
1865impl From<&str> for StatId {
1866    fn from(value: &str) -> Self {
1867        Self(value.to_string())
1868    }
1869}
1870impl From<String> for StatId {
1871    fn from(value: String) -> Self {
1872        Self(value)
1873    }
1874}
1875impl IntoID<StatId> for Stat {
1876    fn into_id(
1877        self,
1878    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<StatId, DaggerError>> + Send>>
1879    {
1880        Box::pin(async move { self.id().await })
1881    }
1882}
1883impl IntoID<StatId> for StatId {
1884    fn into_id(
1885        self,
1886    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<StatId, DaggerError>> + Send>>
1887    {
1888        Box::pin(async move { Ok::<StatId, DaggerError>(self) })
1889    }
1890}
1891impl StatId {
1892    fn quote(&self) -> String {
1893        format!("\"{}\"", self.0.clone())
1894    }
1895}
1896#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1897pub struct TerminalId(pub String);
1898impl From<&str> for TerminalId {
1899    fn from(value: &str) -> Self {
1900        Self(value.to_string())
1901    }
1902}
1903impl From<String> for TerminalId {
1904    fn from(value: String) -> Self {
1905        Self(value)
1906    }
1907}
1908impl IntoID<TerminalId> for Terminal {
1909    fn into_id(
1910        self,
1911    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1912    {
1913        Box::pin(async move { self.id().await })
1914    }
1915}
1916impl IntoID<TerminalId> for TerminalId {
1917    fn into_id(
1918        self,
1919    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1920    {
1921        Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
1922    }
1923}
1924impl TerminalId {
1925    fn quote(&self) -> String {
1926        format!("\"{}\"", self.0.clone())
1927    }
1928}
1929#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1930pub struct TypeDefId(pub String);
1931impl From<&str> for TypeDefId {
1932    fn from(value: &str) -> Self {
1933        Self(value.to_string())
1934    }
1935}
1936impl From<String> for TypeDefId {
1937    fn from(value: String) -> Self {
1938        Self(value)
1939    }
1940}
1941impl IntoID<TypeDefId> for TypeDef {
1942    fn into_id(
1943        self,
1944    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1945    {
1946        Box::pin(async move { self.id().await })
1947    }
1948}
1949impl IntoID<TypeDefId> for TypeDefId {
1950    fn into_id(
1951        self,
1952    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1953    {
1954        Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
1955    }
1956}
1957impl TypeDefId {
1958    fn quote(&self) -> String {
1959        format!("\"{}\"", self.0.clone())
1960    }
1961}
1962#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1963pub struct Void(pub String);
1964impl From<&str> for Void {
1965    fn from(value: &str) -> Self {
1966        Self(value.to_string())
1967    }
1968}
1969impl From<String> for Void {
1970    fn from(value: String) -> Self {
1971        Self(value)
1972    }
1973}
1974impl Void {
1975    fn quote(&self) -> String {
1976        format!("\"{}\"", self.0.clone())
1977    }
1978}
1979#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1980pub struct WorkspaceId(pub String);
1981impl From<&str> for WorkspaceId {
1982    fn from(value: &str) -> Self {
1983        Self(value.to_string())
1984    }
1985}
1986impl From<String> for WorkspaceId {
1987    fn from(value: String) -> Self {
1988        Self(value)
1989    }
1990}
1991impl IntoID<WorkspaceId> for Workspace {
1992    fn into_id(
1993        self,
1994    ) -> std::pin::Pin<
1995        Box<dyn core::future::Future<Output = Result<WorkspaceId, DaggerError>> + Send>,
1996    > {
1997        Box::pin(async move { self.id().await })
1998    }
1999}
2000impl IntoID<WorkspaceId> for WorkspaceId {
2001    fn into_id(
2002        self,
2003    ) -> std::pin::Pin<
2004        Box<dyn core::future::Future<Output = Result<WorkspaceId, DaggerError>> + Send>,
2005    > {
2006        Box::pin(async move { Ok::<WorkspaceId, DaggerError>(self) })
2007    }
2008}
2009impl WorkspaceId {
2010    fn quote(&self) -> String {
2011        format!("\"{}\"", self.0.clone())
2012    }
2013}
2014#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
2015pub struct BuildArg {
2016    pub name: String,
2017    pub value: String,
2018}
2019#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
2020pub struct PipelineLabel {
2021    pub name: String,
2022    pub value: String,
2023}
2024#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
2025pub struct PortForward {
2026    pub backend: isize,
2027    pub frontend: isize,
2028    pub protocol: NetworkProtocol,
2029}
2030#[derive(Clone)]
2031pub struct Address {
2032    pub proc: Option<Arc<DaggerSessionProc>>,
2033    pub selection: Selection,
2034    pub graphql_client: DynGraphQLClient,
2035}
2036#[derive(Builder, Debug, PartialEq)]
2037pub struct AddressDirectoryOpts<'a> {
2038    #[builder(setter(into, strip_option), default)]
2039    pub exclude: Option<Vec<&'a str>>,
2040    #[builder(setter(into, strip_option), default)]
2041    pub gitignore: Option<bool>,
2042    #[builder(setter(into, strip_option), default)]
2043    pub include: Option<Vec<&'a str>>,
2044    #[builder(setter(into, strip_option), default)]
2045    pub no_cache: Option<bool>,
2046}
2047#[derive(Builder, Debug, PartialEq)]
2048pub struct AddressFileOpts<'a> {
2049    #[builder(setter(into, strip_option), default)]
2050    pub exclude: Option<Vec<&'a str>>,
2051    #[builder(setter(into, strip_option), default)]
2052    pub gitignore: Option<bool>,
2053    #[builder(setter(into, strip_option), default)]
2054    pub include: Option<Vec<&'a str>>,
2055    #[builder(setter(into, strip_option), default)]
2056    pub no_cache: Option<bool>,
2057}
2058impl Address {
2059    /// Load a container from the address.
2060    pub fn container(&self) -> Container {
2061        let query = self.selection.select("container");
2062        Container {
2063            proc: self.proc.clone(),
2064            selection: query,
2065            graphql_client: self.graphql_client.clone(),
2066        }
2067    }
2068    /// Load a directory from the address.
2069    ///
2070    /// # Arguments
2071    ///
2072    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2073    pub fn directory(&self) -> Directory {
2074        let query = self.selection.select("directory");
2075        Directory {
2076            proc: self.proc.clone(),
2077            selection: query,
2078            graphql_client: self.graphql_client.clone(),
2079        }
2080    }
2081    /// Load a directory from the address.
2082    ///
2083    /// # Arguments
2084    ///
2085    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2086    pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
2087        let mut query = self.selection.select("directory");
2088        if let Some(exclude) = opts.exclude {
2089            query = query.arg("exclude", exclude);
2090        }
2091        if let Some(include) = opts.include {
2092            query = query.arg("include", include);
2093        }
2094        if let Some(gitignore) = opts.gitignore {
2095            query = query.arg("gitignore", gitignore);
2096        }
2097        if let Some(no_cache) = opts.no_cache {
2098            query = query.arg("noCache", no_cache);
2099        }
2100        Directory {
2101            proc: self.proc.clone(),
2102            selection: query,
2103            graphql_client: self.graphql_client.clone(),
2104        }
2105    }
2106    /// Load a file from the address.
2107    ///
2108    /// # Arguments
2109    ///
2110    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2111    pub fn file(&self) -> File {
2112        let query = self.selection.select("file");
2113        File {
2114            proc: self.proc.clone(),
2115            selection: query,
2116            graphql_client: self.graphql_client.clone(),
2117        }
2118    }
2119    /// Load a file from the address.
2120    ///
2121    /// # Arguments
2122    ///
2123    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2124    pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
2125        let mut query = self.selection.select("file");
2126        if let Some(exclude) = opts.exclude {
2127            query = query.arg("exclude", exclude);
2128        }
2129        if let Some(include) = opts.include {
2130            query = query.arg("include", include);
2131        }
2132        if let Some(gitignore) = opts.gitignore {
2133            query = query.arg("gitignore", gitignore);
2134        }
2135        if let Some(no_cache) = opts.no_cache {
2136            query = query.arg("noCache", no_cache);
2137        }
2138        File {
2139            proc: self.proc.clone(),
2140            selection: query,
2141            graphql_client: self.graphql_client.clone(),
2142        }
2143    }
2144    /// Load a git ref (branch, tag or commit) from the address.
2145    pub fn git_ref(&self) -> GitRef {
2146        let query = self.selection.select("gitRef");
2147        GitRef {
2148            proc: self.proc.clone(),
2149            selection: query,
2150            graphql_client: self.graphql_client.clone(),
2151        }
2152    }
2153    /// Load a git repository from the address.
2154    pub fn git_repository(&self) -> GitRepository {
2155        let query = self.selection.select("gitRepository");
2156        GitRepository {
2157            proc: self.proc.clone(),
2158            selection: query,
2159            graphql_client: self.graphql_client.clone(),
2160        }
2161    }
2162    /// A unique identifier for this Address.
2163    pub async fn id(&self) -> Result<AddressId, DaggerError> {
2164        let query = self.selection.select("id");
2165        query.execute(self.graphql_client.clone()).await
2166    }
2167    /// Load a secret from the address.
2168    pub fn secret(&self) -> Secret {
2169        let query = self.selection.select("secret");
2170        Secret {
2171            proc: self.proc.clone(),
2172            selection: query,
2173            graphql_client: self.graphql_client.clone(),
2174        }
2175    }
2176    /// Load a service from the address.
2177    pub fn service(&self) -> Service {
2178        let query = self.selection.select("service");
2179        Service {
2180            proc: self.proc.clone(),
2181            selection: query,
2182            graphql_client: self.graphql_client.clone(),
2183        }
2184    }
2185    /// Load a local socket from the address.
2186    pub fn socket(&self) -> Socket {
2187        let query = self.selection.select("socket");
2188        Socket {
2189            proc: self.proc.clone(),
2190            selection: query,
2191            graphql_client: self.graphql_client.clone(),
2192        }
2193    }
2194    /// The address value
2195    pub async fn value(&self) -> Result<String, DaggerError> {
2196        let query = self.selection.select("value");
2197        query.execute(self.graphql_client.clone()).await
2198    }
2199}
2200#[derive(Clone)]
2201pub struct Binding {
2202    pub proc: Option<Arc<DaggerSessionProc>>,
2203    pub selection: Selection,
2204    pub graphql_client: DynGraphQLClient,
2205}
2206impl Binding {
2207    /// Retrieve the binding value, as type Address
2208    pub fn as_address(&self) -> Address {
2209        let query = self.selection.select("asAddress");
2210        Address {
2211            proc: self.proc.clone(),
2212            selection: query,
2213            graphql_client: self.graphql_client.clone(),
2214        }
2215    }
2216    /// Retrieve the binding value, as type CacheVolume
2217    pub fn as_cache_volume(&self) -> CacheVolume {
2218        let query = self.selection.select("asCacheVolume");
2219        CacheVolume {
2220            proc: self.proc.clone(),
2221            selection: query,
2222            graphql_client: self.graphql_client.clone(),
2223        }
2224    }
2225    /// Retrieve the binding value, as type Changeset
2226    pub fn as_changeset(&self) -> Changeset {
2227        let query = self.selection.select("asChangeset");
2228        Changeset {
2229            proc: self.proc.clone(),
2230            selection: query,
2231            graphql_client: self.graphql_client.clone(),
2232        }
2233    }
2234    /// Retrieve the binding value, as type Check
2235    pub fn as_check(&self) -> Check {
2236        let query = self.selection.select("asCheck");
2237        Check {
2238            proc: self.proc.clone(),
2239            selection: query,
2240            graphql_client: self.graphql_client.clone(),
2241        }
2242    }
2243    /// Retrieve the binding value, as type CheckGroup
2244    pub fn as_check_group(&self) -> CheckGroup {
2245        let query = self.selection.select("asCheckGroup");
2246        CheckGroup {
2247            proc: self.proc.clone(),
2248            selection: query,
2249            graphql_client: self.graphql_client.clone(),
2250        }
2251    }
2252    /// Retrieve the binding value, as type Cloud
2253    pub fn as_cloud(&self) -> Cloud {
2254        let query = self.selection.select("asCloud");
2255        Cloud {
2256            proc: self.proc.clone(),
2257            selection: query,
2258            graphql_client: self.graphql_client.clone(),
2259        }
2260    }
2261    /// Retrieve the binding value, as type Container
2262    pub fn as_container(&self) -> Container {
2263        let query = self.selection.select("asContainer");
2264        Container {
2265            proc: self.proc.clone(),
2266            selection: query,
2267            graphql_client: self.graphql_client.clone(),
2268        }
2269    }
2270    /// Retrieve the binding value, as type Directory
2271    pub fn as_directory(&self) -> Directory {
2272        let query = self.selection.select("asDirectory");
2273        Directory {
2274            proc: self.proc.clone(),
2275            selection: query,
2276            graphql_client: self.graphql_client.clone(),
2277        }
2278    }
2279    /// Retrieve the binding value, as type Env
2280    pub fn as_env(&self) -> Env {
2281        let query = self.selection.select("asEnv");
2282        Env {
2283            proc: self.proc.clone(),
2284            selection: query,
2285            graphql_client: self.graphql_client.clone(),
2286        }
2287    }
2288    /// Retrieve the binding value, as type EnvFile
2289    pub fn as_env_file(&self) -> EnvFile {
2290        let query = self.selection.select("asEnvFile");
2291        EnvFile {
2292            proc: self.proc.clone(),
2293            selection: query,
2294            graphql_client: self.graphql_client.clone(),
2295        }
2296    }
2297    /// Retrieve the binding value, as type File
2298    pub fn as_file(&self) -> File {
2299        let query = self.selection.select("asFile");
2300        File {
2301            proc: self.proc.clone(),
2302            selection: query,
2303            graphql_client: self.graphql_client.clone(),
2304        }
2305    }
2306    /// Retrieve the binding value, as type Generator
2307    pub fn as_generator(&self) -> Generator {
2308        let query = self.selection.select("asGenerator");
2309        Generator {
2310            proc: self.proc.clone(),
2311            selection: query,
2312            graphql_client: self.graphql_client.clone(),
2313        }
2314    }
2315    /// Retrieve the binding value, as type GeneratorGroup
2316    pub fn as_generator_group(&self) -> GeneratorGroup {
2317        let query = self.selection.select("asGeneratorGroup");
2318        GeneratorGroup {
2319            proc: self.proc.clone(),
2320            selection: query,
2321            graphql_client: self.graphql_client.clone(),
2322        }
2323    }
2324    /// Retrieve the binding value, as type GitRef
2325    pub fn as_git_ref(&self) -> GitRef {
2326        let query = self.selection.select("asGitRef");
2327        GitRef {
2328            proc: self.proc.clone(),
2329            selection: query,
2330            graphql_client: self.graphql_client.clone(),
2331        }
2332    }
2333    /// Retrieve the binding value, as type GitRepository
2334    pub fn as_git_repository(&self) -> GitRepository {
2335        let query = self.selection.select("asGitRepository");
2336        GitRepository {
2337            proc: self.proc.clone(),
2338            selection: query,
2339            graphql_client: self.graphql_client.clone(),
2340        }
2341    }
2342    /// Retrieve the binding value, as type JSONValue
2343    pub fn as_json_value(&self) -> JsonValue {
2344        let query = self.selection.select("asJSONValue");
2345        JsonValue {
2346            proc: self.proc.clone(),
2347            selection: query,
2348            graphql_client: self.graphql_client.clone(),
2349        }
2350    }
2351    /// Retrieve the binding value, as type Module
2352    pub fn as_module(&self) -> Module {
2353        let query = self.selection.select("asModule");
2354        Module {
2355            proc: self.proc.clone(),
2356            selection: query,
2357            graphql_client: self.graphql_client.clone(),
2358        }
2359    }
2360    /// Retrieve the binding value, as type ModuleConfigClient
2361    pub fn as_module_config_client(&self) -> ModuleConfigClient {
2362        let query = self.selection.select("asModuleConfigClient");
2363        ModuleConfigClient {
2364            proc: self.proc.clone(),
2365            selection: query,
2366            graphql_client: self.graphql_client.clone(),
2367        }
2368    }
2369    /// Retrieve the binding value, as type ModuleSource
2370    pub fn as_module_source(&self) -> ModuleSource {
2371        let query = self.selection.select("asModuleSource");
2372        ModuleSource {
2373            proc: self.proc.clone(),
2374            selection: query,
2375            graphql_client: self.graphql_client.clone(),
2376        }
2377    }
2378    /// Retrieve the binding value, as type SearchResult
2379    pub fn as_search_result(&self) -> SearchResult {
2380        let query = self.selection.select("asSearchResult");
2381        SearchResult {
2382            proc: self.proc.clone(),
2383            selection: query,
2384            graphql_client: self.graphql_client.clone(),
2385        }
2386    }
2387    /// Retrieve the binding value, as type SearchSubmatch
2388    pub fn as_search_submatch(&self) -> SearchSubmatch {
2389        let query = self.selection.select("asSearchSubmatch");
2390        SearchSubmatch {
2391            proc: self.proc.clone(),
2392            selection: query,
2393            graphql_client: self.graphql_client.clone(),
2394        }
2395    }
2396    /// Retrieve the binding value, as type Secret
2397    pub fn as_secret(&self) -> Secret {
2398        let query = self.selection.select("asSecret");
2399        Secret {
2400            proc: self.proc.clone(),
2401            selection: query,
2402            graphql_client: self.graphql_client.clone(),
2403        }
2404    }
2405    /// Retrieve the binding value, as type Service
2406    pub fn as_service(&self) -> Service {
2407        let query = self.selection.select("asService");
2408        Service {
2409            proc: self.proc.clone(),
2410            selection: query,
2411            graphql_client: self.graphql_client.clone(),
2412        }
2413    }
2414    /// Retrieve the binding value, as type Socket
2415    pub fn as_socket(&self) -> Socket {
2416        let query = self.selection.select("asSocket");
2417        Socket {
2418            proc: self.proc.clone(),
2419            selection: query,
2420            graphql_client: self.graphql_client.clone(),
2421        }
2422    }
2423    /// Retrieve the binding value, as type Stat
2424    pub fn as_stat(&self) -> Stat {
2425        let query = self.selection.select("asStat");
2426        Stat {
2427            proc: self.proc.clone(),
2428            selection: query,
2429            graphql_client: self.graphql_client.clone(),
2430        }
2431    }
2432    /// Returns the binding's string value
2433    pub async fn as_string(&self) -> Result<String, DaggerError> {
2434        let query = self.selection.select("asString");
2435        query.execute(self.graphql_client.clone()).await
2436    }
2437    /// Retrieve the binding value, as type Workspace
2438    pub fn as_workspace(&self) -> Workspace {
2439        let query = self.selection.select("asWorkspace");
2440        Workspace {
2441            proc: self.proc.clone(),
2442            selection: query,
2443            graphql_client: self.graphql_client.clone(),
2444        }
2445    }
2446    /// Returns the digest of the binding value
2447    pub async fn digest(&self) -> Result<String, DaggerError> {
2448        let query = self.selection.select("digest");
2449        query.execute(self.graphql_client.clone()).await
2450    }
2451    /// A unique identifier for this Binding.
2452    pub async fn id(&self) -> Result<BindingId, DaggerError> {
2453        let query = self.selection.select("id");
2454        query.execute(self.graphql_client.clone()).await
2455    }
2456    /// Returns true if the binding is null
2457    pub async fn is_null(&self) -> Result<bool, DaggerError> {
2458        let query = self.selection.select("isNull");
2459        query.execute(self.graphql_client.clone()).await
2460    }
2461    /// Returns the binding name
2462    pub async fn name(&self) -> Result<String, DaggerError> {
2463        let query = self.selection.select("name");
2464        query.execute(self.graphql_client.clone()).await
2465    }
2466    /// Returns the binding type
2467    pub async fn type_name(&self) -> Result<String, DaggerError> {
2468        let query = self.selection.select("typeName");
2469        query.execute(self.graphql_client.clone()).await
2470    }
2471}
2472#[derive(Clone)]
2473pub struct CacheVolume {
2474    pub proc: Option<Arc<DaggerSessionProc>>,
2475    pub selection: Selection,
2476    pub graphql_client: DynGraphQLClient,
2477}
2478impl CacheVolume {
2479    /// A unique identifier for this CacheVolume.
2480    pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
2481        let query = self.selection.select("id");
2482        query.execute(self.graphql_client.clone()).await
2483    }
2484}
2485#[derive(Clone)]
2486pub struct Changeset {
2487    pub proc: Option<Arc<DaggerSessionProc>>,
2488    pub selection: Selection,
2489    pub graphql_client: DynGraphQLClient,
2490}
2491#[derive(Builder, Debug, PartialEq)]
2492pub struct ChangesetWithChangesetOpts {
2493    /// What to do on a merge conflict
2494    #[builder(setter(into, strip_option), default)]
2495    pub on_conflict: Option<ChangesetMergeConflict>,
2496}
2497#[derive(Builder, Debug, PartialEq)]
2498pub struct ChangesetWithChangesetsOpts {
2499    /// What to do on a merge conflict
2500    #[builder(setter(into, strip_option), default)]
2501    pub on_conflict: Option<ChangesetsMergeConflict>,
2502}
2503impl Changeset {
2504    /// Files and directories that were added in the newer directory.
2505    pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2506        let query = self.selection.select("addedPaths");
2507        query.execute(self.graphql_client.clone()).await
2508    }
2509    /// The newer/upper snapshot.
2510    pub fn after(&self) -> Directory {
2511        let query = self.selection.select("after");
2512        Directory {
2513            proc: self.proc.clone(),
2514            selection: query,
2515            graphql_client: self.graphql_client.clone(),
2516        }
2517    }
2518    /// Return a Git-compatible patch of the changes
2519    pub fn as_patch(&self) -> File {
2520        let query = self.selection.select("asPatch");
2521        File {
2522            proc: self.proc.clone(),
2523            selection: query,
2524            graphql_client: self.graphql_client.clone(),
2525        }
2526    }
2527    /// The older/lower snapshot to compare against.
2528    pub fn before(&self) -> Directory {
2529        let query = self.selection.select("before");
2530        Directory {
2531            proc: self.proc.clone(),
2532            selection: query,
2533            graphql_client: self.graphql_client.clone(),
2534        }
2535    }
2536    /// Applies the diff represented by this changeset to a path on the host.
2537    ///
2538    /// # Arguments
2539    ///
2540    /// * `path` - Location of the copied directory (e.g., "logs/").
2541    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2542        let mut query = self.selection.select("export");
2543        query = query.arg("path", path.into());
2544        query.execute(self.graphql_client.clone()).await
2545    }
2546    /// A unique identifier for this Changeset.
2547    pub async fn id(&self) -> Result<ChangesetId, DaggerError> {
2548        let query = self.selection.select("id");
2549        query.execute(self.graphql_client.clone()).await
2550    }
2551    /// Returns true if the changeset is empty (i.e. there are no changes).
2552    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
2553        let query = self.selection.select("isEmpty");
2554        query.execute(self.graphql_client.clone()).await
2555    }
2556    /// Return a snapshot containing only the created and modified files
2557    pub fn layer(&self) -> Directory {
2558        let query = self.selection.select("layer");
2559        Directory {
2560            proc: self.proc.clone(),
2561            selection: query,
2562            graphql_client: self.graphql_client.clone(),
2563        }
2564    }
2565    /// Files and directories that existed before and were updated in the newer directory.
2566    pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2567        let query = self.selection.select("modifiedPaths");
2568        query.execute(self.graphql_client.clone()).await
2569    }
2570    /// Files and directories that were removed. Directories are indicated by a trailing slash, and their child paths are not included.
2571    pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2572        let query = self.selection.select("removedPaths");
2573        query.execute(self.graphql_client.clone()).await
2574    }
2575    /// Force evaluation in the engine.
2576    pub async fn sync(&self) -> Result<ChangesetId, DaggerError> {
2577        let query = self.selection.select("sync");
2578        query.execute(self.graphql_client.clone()).await
2579    }
2580    /// Add changes to an existing changeset
2581    /// By default the operation will fail in case of conflicts, for instance a file modified in both changesets. The behavior can be adjusted using onConflict argument
2582    ///
2583    /// # Arguments
2584    ///
2585    /// * `changes` - Changes to merge into the actual changeset
2586    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2587    pub fn with_changeset(&self, changes: impl IntoID<ChangesetId>) -> Changeset {
2588        let mut query = self.selection.select("withChangeset");
2589        query = query.arg_lazy(
2590            "changes",
2591            Box::new(move || {
2592                let changes = changes.clone();
2593                Box::pin(async move { changes.into_id().await.unwrap().quote() })
2594            }),
2595        );
2596        Changeset {
2597            proc: self.proc.clone(),
2598            selection: query,
2599            graphql_client: self.graphql_client.clone(),
2600        }
2601    }
2602    /// Add changes to an existing changeset
2603    /// By default the operation will fail in case of conflicts, for instance a file modified in both changesets. The behavior can be adjusted using onConflict argument
2604    ///
2605    /// # Arguments
2606    ///
2607    /// * `changes` - Changes to merge into the actual changeset
2608    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2609    pub fn with_changeset_opts(
2610        &self,
2611        changes: impl IntoID<ChangesetId>,
2612        opts: ChangesetWithChangesetOpts,
2613    ) -> Changeset {
2614        let mut query = self.selection.select("withChangeset");
2615        query = query.arg_lazy(
2616            "changes",
2617            Box::new(move || {
2618                let changes = changes.clone();
2619                Box::pin(async move { changes.into_id().await.unwrap().quote() })
2620            }),
2621        );
2622        if let Some(on_conflict) = opts.on_conflict {
2623            query = query.arg("onConflict", on_conflict);
2624        }
2625        Changeset {
2626            proc: self.proc.clone(),
2627            selection: query,
2628            graphql_client: self.graphql_client.clone(),
2629        }
2630    }
2631    /// Add changes from multiple changesets using git octopus merge strategy
2632    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
2633    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
2634    ///
2635    /// # Arguments
2636    ///
2637    /// * `changes` - List of changesets to merge into the actual changeset
2638    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2639    pub fn with_changesets(&self, changes: Vec<ChangesetId>) -> Changeset {
2640        let mut query = self.selection.select("withChangesets");
2641        query = query.arg("changes", changes);
2642        Changeset {
2643            proc: self.proc.clone(),
2644            selection: query,
2645            graphql_client: self.graphql_client.clone(),
2646        }
2647    }
2648    /// Add changes from multiple changesets using git octopus merge strategy
2649    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
2650    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
2651    ///
2652    /// # Arguments
2653    ///
2654    /// * `changes` - List of changesets to merge into the actual changeset
2655    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2656    pub fn with_changesets_opts(
2657        &self,
2658        changes: Vec<ChangesetId>,
2659        opts: ChangesetWithChangesetsOpts,
2660    ) -> Changeset {
2661        let mut query = self.selection.select("withChangesets");
2662        query = query.arg("changes", changes);
2663        if let Some(on_conflict) = opts.on_conflict {
2664            query = query.arg("onConflict", on_conflict);
2665        }
2666        Changeset {
2667            proc: self.proc.clone(),
2668            selection: query,
2669            graphql_client: self.graphql_client.clone(),
2670        }
2671    }
2672}
2673#[derive(Clone)]
2674pub struct Check {
2675    pub proc: Option<Arc<DaggerSessionProc>>,
2676    pub selection: Selection,
2677    pub graphql_client: DynGraphQLClient,
2678}
2679impl Check {
2680    /// Whether the check completed
2681    pub async fn completed(&self) -> Result<bool, DaggerError> {
2682        let query = self.selection.select("completed");
2683        query.execute(self.graphql_client.clone()).await
2684    }
2685    /// The description of the check
2686    pub async fn description(&self) -> Result<String, DaggerError> {
2687        let query = self.selection.select("description");
2688        query.execute(self.graphql_client.clone()).await
2689    }
2690    /// If the check failed, this is the error
2691    pub fn error(&self) -> Error {
2692        let query = self.selection.select("error");
2693        Error {
2694            proc: self.proc.clone(),
2695            selection: query,
2696            graphql_client: self.graphql_client.clone(),
2697        }
2698    }
2699    /// A unique identifier for this Check.
2700    pub async fn id(&self) -> Result<CheckId, DaggerError> {
2701        let query = self.selection.select("id");
2702        query.execute(self.graphql_client.clone()).await
2703    }
2704    /// Return the fully qualified name of the check
2705    pub async fn name(&self) -> Result<String, DaggerError> {
2706        let query = self.selection.select("name");
2707        query.execute(self.graphql_client.clone()).await
2708    }
2709    /// The original module in which the check has been defined
2710    pub fn original_module(&self) -> Module {
2711        let query = self.selection.select("originalModule");
2712        Module {
2713            proc: self.proc.clone(),
2714            selection: query,
2715            graphql_client: self.graphql_client.clone(),
2716        }
2717    }
2718    /// Whether the check passed
2719    pub async fn passed(&self) -> Result<bool, DaggerError> {
2720        let query = self.selection.select("passed");
2721        query.execute(self.graphql_client.clone()).await
2722    }
2723    /// The path of the check within its module
2724    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
2725        let query = self.selection.select("path");
2726        query.execute(self.graphql_client.clone()).await
2727    }
2728    /// An emoji representing the result of the check
2729    pub async fn result_emoji(&self) -> Result<String, DaggerError> {
2730        let query = self.selection.select("resultEmoji");
2731        query.execute(self.graphql_client.clone()).await
2732    }
2733    /// Execute the check
2734    pub fn run(&self) -> Check {
2735        let query = self.selection.select("run");
2736        Check {
2737            proc: self.proc.clone(),
2738            selection: query,
2739            graphql_client: self.graphql_client.clone(),
2740        }
2741    }
2742}
2743#[derive(Clone)]
2744pub struct CheckGroup {
2745    pub proc: Option<Arc<DaggerSessionProc>>,
2746    pub selection: Selection,
2747    pub graphql_client: DynGraphQLClient,
2748}
2749impl CheckGroup {
2750    /// A unique identifier for this CheckGroup.
2751    pub async fn id(&self) -> Result<CheckGroupId, DaggerError> {
2752        let query = self.selection.select("id");
2753        query.execute(self.graphql_client.clone()).await
2754    }
2755    /// Return a list of individual checks and their details
2756    pub fn list(&self) -> Vec<Check> {
2757        let query = self.selection.select("list");
2758        vec![Check {
2759            proc: self.proc.clone(),
2760            selection: query,
2761            graphql_client: self.graphql_client.clone(),
2762        }]
2763    }
2764    /// Generate a markdown report
2765    pub fn report(&self) -> File {
2766        let query = self.selection.select("report");
2767        File {
2768            proc: self.proc.clone(),
2769            selection: query,
2770            graphql_client: self.graphql_client.clone(),
2771        }
2772    }
2773    /// Execute all selected checks
2774    pub fn run(&self) -> CheckGroup {
2775        let query = self.selection.select("run");
2776        CheckGroup {
2777            proc: self.proc.clone(),
2778            selection: query,
2779            graphql_client: self.graphql_client.clone(),
2780        }
2781    }
2782}
2783#[derive(Clone)]
2784pub struct Cloud {
2785    pub proc: Option<Arc<DaggerSessionProc>>,
2786    pub selection: Selection,
2787    pub graphql_client: DynGraphQLClient,
2788}
2789impl Cloud {
2790    /// A unique identifier for this Cloud.
2791    pub async fn id(&self) -> Result<CloudId, DaggerError> {
2792        let query = self.selection.select("id");
2793        query.execute(self.graphql_client.clone()).await
2794    }
2795    /// The trace URL for the current session
2796    pub async fn trace_url(&self) -> Result<String, DaggerError> {
2797        let query = self.selection.select("traceURL");
2798        query.execute(self.graphql_client.clone()).await
2799    }
2800}
2801#[derive(Clone)]
2802pub struct Container {
2803    pub proc: Option<Arc<DaggerSessionProc>>,
2804    pub selection: Selection,
2805    pub graphql_client: DynGraphQLClient,
2806}
2807#[derive(Builder, Debug, PartialEq)]
2808pub struct ContainerAsServiceOpts<'a> {
2809    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2810    /// If empty, the container's default command is used.
2811    #[builder(setter(into, strip_option), default)]
2812    pub args: Option<Vec<&'a str>>,
2813    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2814    #[builder(setter(into, strip_option), default)]
2815    pub expand: Option<bool>,
2816    /// Provides Dagger access to the executed command.
2817    #[builder(setter(into, strip_option), default)]
2818    pub experimental_privileged_nesting: Option<bool>,
2819    /// 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.
2820    #[builder(setter(into, strip_option), default)]
2821    pub insecure_root_capabilities: Option<bool>,
2822    /// If set, skip the automatic init process injected into containers by default.
2823    /// 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.
2824    #[builder(setter(into, strip_option), default)]
2825    pub no_init: Option<bool>,
2826    /// If the container has an entrypoint, prepend it to the args.
2827    #[builder(setter(into, strip_option), default)]
2828    pub use_entrypoint: Option<bool>,
2829}
2830#[derive(Builder, Debug, PartialEq)]
2831pub struct ContainerAsTarballOpts {
2832    /// Force each layer of the image to use the specified compression algorithm.
2833    /// 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.
2834    #[builder(setter(into, strip_option), default)]
2835    pub forced_compression: Option<ImageLayerCompression>,
2836    /// Use the specified media types for the image's layers.
2837    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2838    #[builder(setter(into, strip_option), default)]
2839    pub media_types: Option<ImageMediaTypes>,
2840    /// Identifiers for other platform specific containers.
2841    /// Used for multi-platform images.
2842    #[builder(setter(into, strip_option), default)]
2843    pub platform_variants: Option<Vec<ContainerId>>,
2844}
2845#[derive(Builder, Debug, PartialEq)]
2846pub struct ContainerDirectoryOpts {
2847    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2848    #[builder(setter(into, strip_option), default)]
2849    pub expand: Option<bool>,
2850}
2851#[derive(Builder, Debug, PartialEq)]
2852pub struct ContainerExistsOpts {
2853    /// If specified, do not follow symlinks.
2854    #[builder(setter(into, strip_option), default)]
2855    pub do_not_follow_symlinks: Option<bool>,
2856    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
2857    #[builder(setter(into, strip_option), default)]
2858    pub expected_type: Option<ExistsType>,
2859}
2860#[derive(Builder, Debug, PartialEq)]
2861pub struct ContainerExportOpts {
2862    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2863    #[builder(setter(into, strip_option), default)]
2864    pub expand: Option<bool>,
2865    /// Force each layer of the exported image to use the specified compression algorithm.
2866    /// 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.
2867    #[builder(setter(into, strip_option), default)]
2868    pub forced_compression: Option<ImageLayerCompression>,
2869    /// Use the specified media types for the exported image's layers.
2870    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2871    #[builder(setter(into, strip_option), default)]
2872    pub media_types: Option<ImageMediaTypes>,
2873    /// Identifiers for other platform specific containers.
2874    /// Used for multi-platform image.
2875    #[builder(setter(into, strip_option), default)]
2876    pub platform_variants: Option<Vec<ContainerId>>,
2877}
2878#[derive(Builder, Debug, PartialEq)]
2879pub struct ContainerExportImageOpts {
2880    /// Force each layer of the exported image to use the specified compression algorithm.
2881    /// 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.
2882    #[builder(setter(into, strip_option), default)]
2883    pub forced_compression: Option<ImageLayerCompression>,
2884    /// Use the specified media types for the exported image's layers.
2885    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2886    #[builder(setter(into, strip_option), default)]
2887    pub media_types: Option<ImageMediaTypes>,
2888    /// Identifiers for other platform specific containers.
2889    /// Used for multi-platform image.
2890    #[builder(setter(into, strip_option), default)]
2891    pub platform_variants: Option<Vec<ContainerId>>,
2892}
2893#[derive(Builder, Debug, PartialEq)]
2894pub struct ContainerFileOpts {
2895    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2896    #[builder(setter(into, strip_option), default)]
2897    pub expand: Option<bool>,
2898}
2899#[derive(Builder, Debug, PartialEq)]
2900pub struct ContainerImportOpts<'a> {
2901    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
2902    #[builder(setter(into, strip_option), default)]
2903    pub tag: Option<&'a str>,
2904}
2905#[derive(Builder, Debug, PartialEq)]
2906pub struct ContainerPublishOpts {
2907    /// Force each layer of the published image to use the specified compression algorithm.
2908    /// 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.
2909    #[builder(setter(into, strip_option), default)]
2910    pub forced_compression: Option<ImageLayerCompression>,
2911    /// Use the specified media types for the published image's layers.
2912    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
2913    #[builder(setter(into, strip_option), default)]
2914    pub media_types: Option<ImageMediaTypes>,
2915    /// Identifiers for other platform specific containers.
2916    /// Used for multi-platform image.
2917    #[builder(setter(into, strip_option), default)]
2918    pub platform_variants: Option<Vec<ContainerId>>,
2919}
2920#[derive(Builder, Debug, PartialEq)]
2921pub struct ContainerStatOpts {
2922    /// If specified, do not follow symlinks.
2923    #[builder(setter(into, strip_option), default)]
2924    pub do_not_follow_symlinks: Option<bool>,
2925}
2926#[derive(Builder, Debug, PartialEq)]
2927pub struct ContainerTerminalOpts<'a> {
2928    /// If set, override the container's default terminal command and invoke these command arguments instead.
2929    #[builder(setter(into, strip_option), default)]
2930    pub cmd: Option<Vec<&'a str>>,
2931    /// Provides Dagger access to the executed command.
2932    #[builder(setter(into, strip_option), default)]
2933    pub experimental_privileged_nesting: Option<bool>,
2934    /// 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.
2935    #[builder(setter(into, strip_option), default)]
2936    pub insecure_root_capabilities: Option<bool>,
2937}
2938#[derive(Builder, Debug, PartialEq)]
2939pub struct ContainerUpOpts<'a> {
2940    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2941    /// If empty, the container's default command is used.
2942    #[builder(setter(into, strip_option), default)]
2943    pub args: Option<Vec<&'a str>>,
2944    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2945    #[builder(setter(into, strip_option), default)]
2946    pub expand: Option<bool>,
2947    /// Provides Dagger access to the executed command.
2948    #[builder(setter(into, strip_option), default)]
2949    pub experimental_privileged_nesting: Option<bool>,
2950    /// 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.
2951    #[builder(setter(into, strip_option), default)]
2952    pub insecure_root_capabilities: Option<bool>,
2953    /// If set, skip the automatic init process injected into containers by default.
2954    /// 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.
2955    #[builder(setter(into, strip_option), default)]
2956    pub no_init: Option<bool>,
2957    /// List of frontend/backend port mappings to forward.
2958    /// Frontend is the port accepting traffic on the host, backend is the service port.
2959    #[builder(setter(into, strip_option), default)]
2960    pub ports: Option<Vec<PortForward>>,
2961    /// Bind each tunnel port to a random port on the host.
2962    #[builder(setter(into, strip_option), default)]
2963    pub random: Option<bool>,
2964    /// If the container has an entrypoint, prepend it to the args.
2965    #[builder(setter(into, strip_option), default)]
2966    pub use_entrypoint: Option<bool>,
2967}
2968#[derive(Builder, Debug, PartialEq)]
2969pub struct ContainerWithDefaultTerminalCmdOpts {
2970    /// Provides Dagger access to the executed command.
2971    #[builder(setter(into, strip_option), default)]
2972    pub experimental_privileged_nesting: Option<bool>,
2973    /// 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.
2974    #[builder(setter(into, strip_option), default)]
2975    pub insecure_root_capabilities: Option<bool>,
2976}
2977#[derive(Builder, Debug, PartialEq)]
2978pub struct ContainerWithDirectoryOpts<'a> {
2979    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
2980    #[builder(setter(into, strip_option), default)]
2981    pub exclude: Option<Vec<&'a str>>,
2982    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2983    #[builder(setter(into, strip_option), default)]
2984    pub expand: Option<bool>,
2985    /// Apply .gitignore rules when writing the directory.
2986    #[builder(setter(into, strip_option), default)]
2987    pub gitignore: Option<bool>,
2988    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
2989    #[builder(setter(into, strip_option), default)]
2990    pub include: Option<Vec<&'a str>>,
2991    /// A user:group to set for the directory and its contents.
2992    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2993    /// If the group is omitted, it defaults to the same as the user.
2994    #[builder(setter(into, strip_option), default)]
2995    pub owner: Option<&'a str>,
2996}
2997#[derive(Builder, Debug, PartialEq)]
2998pub struct ContainerWithEntrypointOpts {
2999    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
3000    #[builder(setter(into, strip_option), default)]
3001    pub keep_default_args: Option<bool>,
3002}
3003#[derive(Builder, Debug, PartialEq)]
3004pub struct ContainerWithEnvVariableOpts {
3005    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
3006    #[builder(setter(into, strip_option), default)]
3007    pub expand: Option<bool>,
3008}
3009#[derive(Builder, Debug, PartialEq)]
3010pub struct ContainerWithExecOpts<'a> {
3011    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3012    #[builder(setter(into, strip_option), default)]
3013    pub expand: Option<bool>,
3014    /// Exit codes this command is allowed to exit with without error
3015    #[builder(setter(into, strip_option), default)]
3016    pub expect: Option<ReturnType>,
3017    /// Provides Dagger access to the executed command.
3018    #[builder(setter(into, strip_option), default)]
3019    pub experimental_privileged_nesting: Option<bool>,
3020    /// Execute the command with all root capabilities. Like --privileged in Docker
3021    /// 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.
3022    #[builder(setter(into, strip_option), default)]
3023    pub insecure_root_capabilities: Option<bool>,
3024    /// Skip the automatic init process injected into containers by default.
3025    /// 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.
3026    #[builder(setter(into, strip_option), default)]
3027    pub no_init: Option<bool>,
3028    /// Redirect the command's standard error to a file in the container. Example: "./stderr.txt"
3029    #[builder(setter(into, strip_option), default)]
3030    pub redirect_stderr: Option<&'a str>,
3031    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
3032    #[builder(setter(into, strip_option), default)]
3033    pub redirect_stdin: Option<&'a str>,
3034    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
3035    #[builder(setter(into, strip_option), default)]
3036    pub redirect_stdout: Option<&'a str>,
3037    /// Content to write to the command's standard input. Example: "Hello world")
3038    #[builder(setter(into, strip_option), default)]
3039    pub stdin: Option<&'a str>,
3040    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
3041    #[builder(setter(into, strip_option), default)]
3042    pub use_entrypoint: Option<bool>,
3043}
3044#[derive(Builder, Debug, PartialEq)]
3045pub struct ContainerWithExposedPortOpts<'a> {
3046    /// Port description. Example: "payment API endpoint"
3047    #[builder(setter(into, strip_option), default)]
3048    pub description: Option<&'a str>,
3049    /// Skip the health check when run as a service.
3050    #[builder(setter(into, strip_option), default)]
3051    pub experimental_skip_healthcheck: Option<bool>,
3052    /// Network protocol. Example: "tcp"
3053    #[builder(setter(into, strip_option), default)]
3054    pub protocol: Option<NetworkProtocol>,
3055}
3056#[derive(Builder, Debug, PartialEq)]
3057pub struct ContainerWithFileOpts<'a> {
3058    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3059    #[builder(setter(into, strip_option), default)]
3060    pub expand: Option<bool>,
3061    /// A user:group to set for the file.
3062    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3063    /// If the group is omitted, it defaults to the same as the user.
3064    #[builder(setter(into, strip_option), default)]
3065    pub owner: Option<&'a str>,
3066    /// Permissions of the new file. Example: 0600
3067    #[builder(setter(into, strip_option), default)]
3068    pub permissions: Option<isize>,
3069}
3070#[derive(Builder, Debug, PartialEq)]
3071pub struct ContainerWithFilesOpts<'a> {
3072    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3073    #[builder(setter(into, strip_option), default)]
3074    pub expand: Option<bool>,
3075    /// A user:group to set for the files.
3076    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3077    /// If the group is omitted, it defaults to the same as the user.
3078    #[builder(setter(into, strip_option), default)]
3079    pub owner: Option<&'a str>,
3080    /// Permission given to the copied files (e.g., 0600).
3081    #[builder(setter(into, strip_option), default)]
3082    pub permissions: Option<isize>,
3083}
3084#[derive(Builder, Debug, PartialEq)]
3085pub struct ContainerWithMountedCacheOpts<'a> {
3086    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3087    #[builder(setter(into, strip_option), default)]
3088    pub expand: Option<bool>,
3089    /// A user:group to set for the mounted cache directory.
3090    /// 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.
3091    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3092    /// If the group is omitted, it defaults to the same as the user.
3093    #[builder(setter(into, strip_option), default)]
3094    pub owner: Option<&'a str>,
3095    /// Sharing mode of the cache volume.
3096    #[builder(setter(into, strip_option), default)]
3097    pub sharing: Option<CacheSharingMode>,
3098    /// Identifier of the directory to use as the cache volume's root.
3099    #[builder(setter(into, strip_option), default)]
3100    pub source: Option<DirectoryId>,
3101}
3102#[derive(Builder, Debug, PartialEq)]
3103pub struct ContainerWithMountedDirectoryOpts<'a> {
3104    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3105    #[builder(setter(into, strip_option), default)]
3106    pub expand: Option<bool>,
3107    /// A user:group to set for the mounted directory and its contents.
3108    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3109    /// If the group is omitted, it defaults to the same as the user.
3110    #[builder(setter(into, strip_option), default)]
3111    pub owner: Option<&'a str>,
3112}
3113#[derive(Builder, Debug, PartialEq)]
3114pub struct ContainerWithMountedFileOpts<'a> {
3115    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3116    #[builder(setter(into, strip_option), default)]
3117    pub expand: Option<bool>,
3118    /// A user or user:group to set for the mounted file.
3119    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3120    /// If the group is omitted, it defaults to the same as the user.
3121    #[builder(setter(into, strip_option), default)]
3122    pub owner: Option<&'a str>,
3123}
3124#[derive(Builder, Debug, PartialEq)]
3125pub struct ContainerWithMountedSecretOpts<'a> {
3126    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3127    #[builder(setter(into, strip_option), default)]
3128    pub expand: Option<bool>,
3129    /// Permission given to the mounted secret (e.g., 0600).
3130    /// This option requires an owner to be set to be active.
3131    #[builder(setter(into, strip_option), default)]
3132    pub mode: Option<isize>,
3133    /// A user:group to set for the mounted secret.
3134    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3135    /// If the group is omitted, it defaults to the same as the user.
3136    #[builder(setter(into, strip_option), default)]
3137    pub owner: Option<&'a str>,
3138}
3139#[derive(Builder, Debug, PartialEq)]
3140pub struct ContainerWithMountedTempOpts {
3141    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3142    #[builder(setter(into, strip_option), default)]
3143    pub expand: Option<bool>,
3144    /// Size of the temporary directory in bytes.
3145    #[builder(setter(into, strip_option), default)]
3146    pub size: Option<isize>,
3147}
3148#[derive(Builder, Debug, PartialEq)]
3149pub struct ContainerWithNewFileOpts<'a> {
3150    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3151    #[builder(setter(into, strip_option), default)]
3152    pub expand: Option<bool>,
3153    /// A user:group to set for the file.
3154    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3155    /// If the group is omitted, it defaults to the same as the user.
3156    #[builder(setter(into, strip_option), default)]
3157    pub owner: Option<&'a str>,
3158    /// Permissions of the new file. Example: 0600
3159    #[builder(setter(into, strip_option), default)]
3160    pub permissions: Option<isize>,
3161}
3162#[derive(Builder, Debug, PartialEq)]
3163pub struct ContainerWithSymlinkOpts {
3164    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3165    #[builder(setter(into, strip_option), default)]
3166    pub expand: Option<bool>,
3167}
3168#[derive(Builder, Debug, PartialEq)]
3169pub struct ContainerWithUnixSocketOpts<'a> {
3170    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3171    #[builder(setter(into, strip_option), default)]
3172    pub expand: Option<bool>,
3173    /// A user:group to set for the mounted socket.
3174    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3175    /// If the group is omitted, it defaults to the same as the user.
3176    #[builder(setter(into, strip_option), default)]
3177    pub owner: Option<&'a str>,
3178}
3179#[derive(Builder, Debug, PartialEq)]
3180pub struct ContainerWithWorkdirOpts {
3181    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3182    #[builder(setter(into, strip_option), default)]
3183    pub expand: Option<bool>,
3184}
3185#[derive(Builder, Debug, PartialEq)]
3186pub struct ContainerWithoutDirectoryOpts {
3187    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3188    #[builder(setter(into, strip_option), default)]
3189    pub expand: Option<bool>,
3190}
3191#[derive(Builder, Debug, PartialEq)]
3192pub struct ContainerWithoutEntrypointOpts {
3193    /// Don't remove the default arguments when unsetting the entrypoint.
3194    #[builder(setter(into, strip_option), default)]
3195    pub keep_default_args: Option<bool>,
3196}
3197#[derive(Builder, Debug, PartialEq)]
3198pub struct ContainerWithoutExposedPortOpts {
3199    /// Port protocol to unexpose
3200    #[builder(setter(into, strip_option), default)]
3201    pub protocol: Option<NetworkProtocol>,
3202}
3203#[derive(Builder, Debug, PartialEq)]
3204pub struct ContainerWithoutFileOpts {
3205    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3206    #[builder(setter(into, strip_option), default)]
3207    pub expand: Option<bool>,
3208}
3209#[derive(Builder, Debug, PartialEq)]
3210pub struct ContainerWithoutFilesOpts {
3211    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3212    #[builder(setter(into, strip_option), default)]
3213    pub expand: Option<bool>,
3214}
3215#[derive(Builder, Debug, PartialEq)]
3216pub struct ContainerWithoutMountOpts {
3217    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3218    #[builder(setter(into, strip_option), default)]
3219    pub expand: Option<bool>,
3220}
3221#[derive(Builder, Debug, PartialEq)]
3222pub struct ContainerWithoutUnixSocketOpts {
3223    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3224    #[builder(setter(into, strip_option), default)]
3225    pub expand: Option<bool>,
3226}
3227impl Container {
3228    /// Turn the container into a Service.
3229    /// Be sure to set any exposed ports before this conversion.
3230    ///
3231    /// # Arguments
3232    ///
3233    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3234    pub fn as_service(&self) -> Service {
3235        let query = self.selection.select("asService");
3236        Service {
3237            proc: self.proc.clone(),
3238            selection: query,
3239            graphql_client: self.graphql_client.clone(),
3240        }
3241    }
3242    /// Turn the container into a Service.
3243    /// Be sure to set any exposed ports before this conversion.
3244    ///
3245    /// # Arguments
3246    ///
3247    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3248    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
3249        let mut query = self.selection.select("asService");
3250        if let Some(args) = opts.args {
3251            query = query.arg("args", args);
3252        }
3253        if let Some(use_entrypoint) = opts.use_entrypoint {
3254            query = query.arg("useEntrypoint", use_entrypoint);
3255        }
3256        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3257            query = query.arg(
3258                "experimentalPrivilegedNesting",
3259                experimental_privileged_nesting,
3260            );
3261        }
3262        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3263            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3264        }
3265        if let Some(expand) = opts.expand {
3266            query = query.arg("expand", expand);
3267        }
3268        if let Some(no_init) = opts.no_init {
3269            query = query.arg("noInit", no_init);
3270        }
3271        Service {
3272            proc: self.proc.clone(),
3273            selection: query,
3274            graphql_client: self.graphql_client.clone(),
3275        }
3276    }
3277    /// Package the container state as an OCI image, and return it as a tar archive
3278    ///
3279    /// # Arguments
3280    ///
3281    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3282    pub fn as_tarball(&self) -> File {
3283        let query = self.selection.select("asTarball");
3284        File {
3285            proc: self.proc.clone(),
3286            selection: query,
3287            graphql_client: self.graphql_client.clone(),
3288        }
3289    }
3290    /// Package the container state as an OCI image, and return it as a tar archive
3291    ///
3292    /// # Arguments
3293    ///
3294    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3295    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
3296        let mut query = self.selection.select("asTarball");
3297        if let Some(platform_variants) = opts.platform_variants {
3298            query = query.arg("platformVariants", platform_variants);
3299        }
3300        if let Some(forced_compression) = opts.forced_compression {
3301            query = query.arg("forcedCompression", forced_compression);
3302        }
3303        if let Some(media_types) = opts.media_types {
3304            query = query.arg("mediaTypes", media_types);
3305        }
3306        File {
3307            proc: self.proc.clone(),
3308            selection: query,
3309            graphql_client: self.graphql_client.clone(),
3310        }
3311    }
3312    /// The combined buffered standard output and standard error stream of the last executed command
3313    /// Returns an error if no command was executed
3314    pub async fn combined_output(&self) -> Result<String, DaggerError> {
3315        let query = self.selection.select("combinedOutput");
3316        query.execute(self.graphql_client.clone()).await
3317    }
3318    /// Return the container's default arguments.
3319    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
3320        let query = self.selection.select("defaultArgs");
3321        query.execute(self.graphql_client.clone()).await
3322    }
3323    /// Retrieve a directory from the container's root filesystem
3324    /// Mounts are included.
3325    ///
3326    /// # Arguments
3327    ///
3328    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3329    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3330    pub fn directory(&self, path: impl Into<String>) -> Directory {
3331        let mut query = self.selection.select("directory");
3332        query = query.arg("path", path.into());
3333        Directory {
3334            proc: self.proc.clone(),
3335            selection: query,
3336            graphql_client: self.graphql_client.clone(),
3337        }
3338    }
3339    /// Retrieve a directory from the container's root filesystem
3340    /// Mounts are included.
3341    ///
3342    /// # Arguments
3343    ///
3344    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3345    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3346    pub fn directory_opts(
3347        &self,
3348        path: impl Into<String>,
3349        opts: ContainerDirectoryOpts,
3350    ) -> Directory {
3351        let mut query = self.selection.select("directory");
3352        query = query.arg("path", path.into());
3353        if let Some(expand) = opts.expand {
3354            query = query.arg("expand", expand);
3355        }
3356        Directory {
3357            proc: self.proc.clone(),
3358            selection: query,
3359            graphql_client: self.graphql_client.clone(),
3360        }
3361    }
3362    /// Return the container's OCI entrypoint.
3363    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
3364        let query = self.selection.select("entrypoint");
3365        query.execute(self.graphql_client.clone()).await
3366    }
3367    /// Retrieves the value of the specified environment variable.
3368    ///
3369    /// # Arguments
3370    ///
3371    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
3372    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3373        let mut query = self.selection.select("envVariable");
3374        query = query.arg("name", name.into());
3375        query.execute(self.graphql_client.clone()).await
3376    }
3377    /// Retrieves the list of environment variables passed to commands.
3378    pub fn env_variables(&self) -> Vec<EnvVariable> {
3379        let query = self.selection.select("envVariables");
3380        vec![EnvVariable {
3381            proc: self.proc.clone(),
3382            selection: query,
3383            graphql_client: self.graphql_client.clone(),
3384        }]
3385    }
3386    /// check if a file or directory exists
3387    ///
3388    /// # Arguments
3389    ///
3390    /// * `path` - Path to check (e.g., "/file.txt").
3391    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3392    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
3393        let mut query = self.selection.select("exists");
3394        query = query.arg("path", path.into());
3395        query.execute(self.graphql_client.clone()).await
3396    }
3397    /// check if a file or directory exists
3398    ///
3399    /// # Arguments
3400    ///
3401    /// * `path` - Path to check (e.g., "/file.txt").
3402    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3403    pub async fn exists_opts(
3404        &self,
3405        path: impl Into<String>,
3406        opts: ContainerExistsOpts,
3407    ) -> Result<bool, DaggerError> {
3408        let mut query = self.selection.select("exists");
3409        query = query.arg("path", path.into());
3410        if let Some(expected_type) = opts.expected_type {
3411            query = query.arg("expectedType", expected_type);
3412        }
3413        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
3414            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
3415        }
3416        query.execute(self.graphql_client.clone()).await
3417    }
3418    /// The exit code of the last executed command
3419    /// Returns an error if no command was executed
3420    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
3421        let query = self.selection.select("exitCode");
3422        query.execute(self.graphql_client.clone()).await
3423    }
3424    /// EXPERIMENTAL API! Subject to change/removal at any time.
3425    /// Configures all available GPUs on the host to be accessible to this container.
3426    /// This currently works for Nvidia devices only.
3427    pub fn experimental_with_all_gp_us(&self) -> Container {
3428        let query = self.selection.select("experimentalWithAllGPUs");
3429        Container {
3430            proc: self.proc.clone(),
3431            selection: query,
3432            graphql_client: self.graphql_client.clone(),
3433        }
3434    }
3435    /// EXPERIMENTAL API! Subject to change/removal at any time.
3436    /// Configures the provided list of devices to be accessible to this container.
3437    /// This currently works for Nvidia devices only.
3438    ///
3439    /// # Arguments
3440    ///
3441    /// * `devices` - List of devices to be accessible to this container.
3442    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
3443        let mut query = self.selection.select("experimentalWithGPU");
3444        query = query.arg(
3445            "devices",
3446            devices
3447                .into_iter()
3448                .map(|i| i.into())
3449                .collect::<Vec<String>>(),
3450        );
3451        Container {
3452            proc: self.proc.clone(),
3453            selection: query,
3454            graphql_client: self.graphql_client.clone(),
3455        }
3456    }
3457    /// Writes the container as an OCI tarball to the destination file path on the host.
3458    /// It can also export platform variants.
3459    ///
3460    /// # Arguments
3461    ///
3462    /// * `path` - Host's destination path (e.g., "./tarball").
3463    ///
3464    /// Path can be relative to the engine's workdir or absolute.
3465    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3466    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
3467        let mut query = self.selection.select("export");
3468        query = query.arg("path", path.into());
3469        query.execute(self.graphql_client.clone()).await
3470    }
3471    /// Writes the container as an OCI tarball to the destination file path on the host.
3472    /// It can also export platform variants.
3473    ///
3474    /// # Arguments
3475    ///
3476    /// * `path` - Host's destination path (e.g., "./tarball").
3477    ///
3478    /// Path can be relative to the engine's workdir or absolute.
3479    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3480    pub async fn export_opts(
3481        &self,
3482        path: impl Into<String>,
3483        opts: ContainerExportOpts,
3484    ) -> Result<String, DaggerError> {
3485        let mut query = self.selection.select("export");
3486        query = query.arg("path", path.into());
3487        if let Some(platform_variants) = opts.platform_variants {
3488            query = query.arg("platformVariants", platform_variants);
3489        }
3490        if let Some(forced_compression) = opts.forced_compression {
3491            query = query.arg("forcedCompression", forced_compression);
3492        }
3493        if let Some(media_types) = opts.media_types {
3494            query = query.arg("mediaTypes", media_types);
3495        }
3496        if let Some(expand) = opts.expand {
3497            query = query.arg("expand", expand);
3498        }
3499        query.execute(self.graphql_client.clone()).await
3500    }
3501    /// Exports the container as an image to the host's container image store.
3502    ///
3503    /// # Arguments
3504    ///
3505    /// * `name` - Name of image to export to in the host's store
3506    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3507    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
3508        let mut query = self.selection.select("exportImage");
3509        query = query.arg("name", name.into());
3510        query.execute(self.graphql_client.clone()).await
3511    }
3512    /// Exports the container as an image to the host's container image store.
3513    ///
3514    /// # Arguments
3515    ///
3516    /// * `name` - Name of image to export to in the host's store
3517    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3518    pub async fn export_image_opts(
3519        &self,
3520        name: impl Into<String>,
3521        opts: ContainerExportImageOpts,
3522    ) -> Result<Void, DaggerError> {
3523        let mut query = self.selection.select("exportImage");
3524        query = query.arg("name", name.into());
3525        if let Some(platform_variants) = opts.platform_variants {
3526            query = query.arg("platformVariants", platform_variants);
3527        }
3528        if let Some(forced_compression) = opts.forced_compression {
3529            query = query.arg("forcedCompression", forced_compression);
3530        }
3531        if let Some(media_types) = opts.media_types {
3532            query = query.arg("mediaTypes", media_types);
3533        }
3534        query.execute(self.graphql_client.clone()).await
3535    }
3536    /// Retrieves the list of exposed ports.
3537    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
3538    pub fn exposed_ports(&self) -> Vec<Port> {
3539        let query = self.selection.select("exposedPorts");
3540        vec![Port {
3541            proc: self.proc.clone(),
3542            selection: query,
3543            graphql_client: self.graphql_client.clone(),
3544        }]
3545    }
3546    /// Retrieves a file at the given path.
3547    /// Mounts are included.
3548    ///
3549    /// # Arguments
3550    ///
3551    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3552    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3553    pub fn file(&self, path: impl Into<String>) -> File {
3554        let mut query = self.selection.select("file");
3555        query = query.arg("path", path.into());
3556        File {
3557            proc: self.proc.clone(),
3558            selection: query,
3559            graphql_client: self.graphql_client.clone(),
3560        }
3561    }
3562    /// Retrieves a file at the given path.
3563    /// Mounts are included.
3564    ///
3565    /// # Arguments
3566    ///
3567    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3568    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3569    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3570        let mut query = self.selection.select("file");
3571        query = query.arg("path", path.into());
3572        if let Some(expand) = opts.expand {
3573            query = query.arg("expand", expand);
3574        }
3575        File {
3576            proc: self.proc.clone(),
3577            selection: query,
3578            graphql_client: self.graphql_client.clone(),
3579        }
3580    }
3581    /// Download a container image, and apply it to the container state. All previous state will be lost.
3582    ///
3583    /// # Arguments
3584    ///
3585    /// * `address` - Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
3586    pub fn from(&self, address: impl Into<String>) -> Container {
3587        let mut query = self.selection.select("from");
3588        query = query.arg("address", address.into());
3589        Container {
3590            proc: self.proc.clone(),
3591            selection: query,
3592            graphql_client: self.graphql_client.clone(),
3593        }
3594    }
3595    /// A unique identifier for this Container.
3596    pub async fn id(&self) -> Result<ContainerId, DaggerError> {
3597        let query = self.selection.select("id");
3598        query.execute(self.graphql_client.clone()).await
3599    }
3600    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
3601    pub async fn image_ref(&self) -> Result<String, DaggerError> {
3602        let query = self.selection.select("imageRef");
3603        query.execute(self.graphql_client.clone()).await
3604    }
3605    /// Reads the container from an OCI tarball.
3606    ///
3607    /// # Arguments
3608    ///
3609    /// * `source` - File to read the container from.
3610    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3611    pub fn import(&self, source: impl IntoID<FileId>) -> Container {
3612        let mut query = self.selection.select("import");
3613        query = query.arg_lazy(
3614            "source",
3615            Box::new(move || {
3616                let source = source.clone();
3617                Box::pin(async move { source.into_id().await.unwrap().quote() })
3618            }),
3619        );
3620        Container {
3621            proc: self.proc.clone(),
3622            selection: query,
3623            graphql_client: self.graphql_client.clone(),
3624        }
3625    }
3626    /// Reads the container from an OCI tarball.
3627    ///
3628    /// # Arguments
3629    ///
3630    /// * `source` - File to read the container from.
3631    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3632    pub fn import_opts<'a>(
3633        &self,
3634        source: impl IntoID<FileId>,
3635        opts: ContainerImportOpts<'a>,
3636    ) -> Container {
3637        let mut query = self.selection.select("import");
3638        query = query.arg_lazy(
3639            "source",
3640            Box::new(move || {
3641                let source = source.clone();
3642                Box::pin(async move { source.into_id().await.unwrap().quote() })
3643            }),
3644        );
3645        if let Some(tag) = opts.tag {
3646            query = query.arg("tag", tag);
3647        }
3648        Container {
3649            proc: self.proc.clone(),
3650            selection: query,
3651            graphql_client: self.graphql_client.clone(),
3652        }
3653    }
3654    /// Retrieves the value of the specified label.
3655    ///
3656    /// # Arguments
3657    ///
3658    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3659    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3660        let mut query = self.selection.select("label");
3661        query = query.arg("name", name.into());
3662        query.execute(self.graphql_client.clone()).await
3663    }
3664    /// Retrieves the list of labels passed to container.
3665    pub fn labels(&self) -> Vec<Label> {
3666        let query = self.selection.select("labels");
3667        vec![Label {
3668            proc: self.proc.clone(),
3669            selection: query,
3670            graphql_client: self.graphql_client.clone(),
3671        }]
3672    }
3673    /// Retrieves the list of paths where a directory is mounted.
3674    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
3675        let query = self.selection.select("mounts");
3676        query.execute(self.graphql_client.clone()).await
3677    }
3678    /// The platform this container executes and publishes as.
3679    pub async fn platform(&self) -> Result<Platform, DaggerError> {
3680        let query = self.selection.select("platform");
3681        query.execute(self.graphql_client.clone()).await
3682    }
3683    /// Package the container state as an OCI image, and publish it to a registry
3684    /// Returns the fully qualified address of the published image, with digest
3685    ///
3686    /// # Arguments
3687    ///
3688    /// * `address` - The OCI address to publish to
3689    ///
3690    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
3691    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3692    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
3693        let mut query = self.selection.select("publish");
3694        query = query.arg("address", address.into());
3695        query.execute(self.graphql_client.clone()).await
3696    }
3697    /// Package the container state as an OCI image, and publish it to a registry
3698    /// Returns the fully qualified address of the published image, with digest
3699    ///
3700    /// # Arguments
3701    ///
3702    /// * `address` - The OCI address to publish to
3703    ///
3704    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
3705    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3706    pub async fn publish_opts(
3707        &self,
3708        address: impl Into<String>,
3709        opts: ContainerPublishOpts,
3710    ) -> Result<String, DaggerError> {
3711        let mut query = self.selection.select("publish");
3712        query = query.arg("address", address.into());
3713        if let Some(platform_variants) = opts.platform_variants {
3714            query = query.arg("platformVariants", platform_variants);
3715        }
3716        if let Some(forced_compression) = opts.forced_compression {
3717            query = query.arg("forcedCompression", forced_compression);
3718        }
3719        if let Some(media_types) = opts.media_types {
3720            query = query.arg("mediaTypes", media_types);
3721        }
3722        query.execute(self.graphql_client.clone()).await
3723    }
3724    /// 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.
3725    pub fn rootfs(&self) -> Directory {
3726        let query = self.selection.select("rootfs");
3727        Directory {
3728            proc: self.proc.clone(),
3729            selection: query,
3730            graphql_client: self.graphql_client.clone(),
3731        }
3732    }
3733    /// Return file status
3734    ///
3735    /// # Arguments
3736    ///
3737    /// * `path` - Path to check (e.g., "/file.txt").
3738    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3739    pub fn stat(&self, path: impl Into<String>) -> Stat {
3740        let mut query = self.selection.select("stat");
3741        query = query.arg("path", path.into());
3742        Stat {
3743            proc: self.proc.clone(),
3744            selection: query,
3745            graphql_client: self.graphql_client.clone(),
3746        }
3747    }
3748    /// Return file status
3749    ///
3750    /// # Arguments
3751    ///
3752    /// * `path` - Path to check (e.g., "/file.txt").
3753    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3754    pub fn stat_opts(&self, path: impl Into<String>, opts: ContainerStatOpts) -> Stat {
3755        let mut query = self.selection.select("stat");
3756        query = query.arg("path", path.into());
3757        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
3758            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
3759        }
3760        Stat {
3761            proc: self.proc.clone(),
3762            selection: query,
3763            graphql_client: self.graphql_client.clone(),
3764        }
3765    }
3766    /// The buffered standard error stream of the last executed command
3767    /// Returns an error if no command was executed
3768    pub async fn stderr(&self) -> Result<String, DaggerError> {
3769        let query = self.selection.select("stderr");
3770        query.execute(self.graphql_client.clone()).await
3771    }
3772    /// The buffered standard output stream of the last executed command
3773    /// Returns an error if no command was executed
3774    pub async fn stdout(&self) -> Result<String, DaggerError> {
3775        let query = self.selection.select("stdout");
3776        query.execute(self.graphql_client.clone()).await
3777    }
3778    /// Forces evaluation of the pipeline in the engine.
3779    /// It doesn't run the default command if no exec has been set.
3780    pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
3781        let query = self.selection.select("sync");
3782        query.execute(self.graphql_client.clone()).await
3783    }
3784    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
3785    ///
3786    /// # Arguments
3787    ///
3788    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3789    pub fn terminal(&self) -> Container {
3790        let query = self.selection.select("terminal");
3791        Container {
3792            proc: self.proc.clone(),
3793            selection: query,
3794            graphql_client: self.graphql_client.clone(),
3795        }
3796    }
3797    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
3798    ///
3799    /// # Arguments
3800    ///
3801    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3802    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
3803        let mut query = self.selection.select("terminal");
3804        if let Some(cmd) = opts.cmd {
3805            query = query.arg("cmd", cmd);
3806        }
3807        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3808            query = query.arg(
3809                "experimentalPrivilegedNesting",
3810                experimental_privileged_nesting,
3811            );
3812        }
3813        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3814            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3815        }
3816        Container {
3817            proc: self.proc.clone(),
3818            selection: query,
3819            graphql_client: self.graphql_client.clone(),
3820        }
3821    }
3822    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3823    /// Be sure to set any exposed ports before calling this api.
3824    ///
3825    /// # Arguments
3826    ///
3827    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3828    pub async fn up(&self) -> Result<Void, DaggerError> {
3829        let query = self.selection.select("up");
3830        query.execute(self.graphql_client.clone()).await
3831    }
3832    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3833    /// Be sure to set any exposed ports before calling this api.
3834    ///
3835    /// # Arguments
3836    ///
3837    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3838    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
3839        let mut query = self.selection.select("up");
3840        if let Some(random) = opts.random {
3841            query = query.arg("random", random);
3842        }
3843        if let Some(ports) = opts.ports {
3844            query = query.arg("ports", ports);
3845        }
3846        if let Some(args) = opts.args {
3847            query = query.arg("args", args);
3848        }
3849        if let Some(use_entrypoint) = opts.use_entrypoint {
3850            query = query.arg("useEntrypoint", use_entrypoint);
3851        }
3852        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3853            query = query.arg(
3854                "experimentalPrivilegedNesting",
3855                experimental_privileged_nesting,
3856            );
3857        }
3858        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3859            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3860        }
3861        if let Some(expand) = opts.expand {
3862            query = query.arg("expand", expand);
3863        }
3864        if let Some(no_init) = opts.no_init {
3865            query = query.arg("noInit", no_init);
3866        }
3867        query.execute(self.graphql_client.clone()).await
3868    }
3869    /// Retrieves the user to be set for all commands.
3870    pub async fn user(&self) -> Result<String, DaggerError> {
3871        let query = self.selection.select("user");
3872        query.execute(self.graphql_client.clone()).await
3873    }
3874    /// Retrieves this container plus the given OCI annotation.
3875    ///
3876    /// # Arguments
3877    ///
3878    /// * `name` - The name of the annotation.
3879    /// * `value` - The value of the annotation.
3880    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3881        let mut query = self.selection.select("withAnnotation");
3882        query = query.arg("name", name.into());
3883        query = query.arg("value", value.into());
3884        Container {
3885            proc: self.proc.clone(),
3886            selection: query,
3887            graphql_client: self.graphql_client.clone(),
3888        }
3889    }
3890    /// Configures default arguments for future commands. Like CMD in Dockerfile.
3891    ///
3892    /// # Arguments
3893    ///
3894    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
3895    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
3896        let mut query = self.selection.select("withDefaultArgs");
3897        query = query.arg(
3898            "args",
3899            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3900        );
3901        Container {
3902            proc: self.proc.clone(),
3903            selection: query,
3904            graphql_client: self.graphql_client.clone(),
3905        }
3906    }
3907    /// Set the default command to invoke for the container's terminal API.
3908    ///
3909    /// # Arguments
3910    ///
3911    /// * `args` - The args of the command.
3912    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3913    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
3914        let mut query = self.selection.select("withDefaultTerminalCmd");
3915        query = query.arg(
3916            "args",
3917            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3918        );
3919        Container {
3920            proc: self.proc.clone(),
3921            selection: query,
3922            graphql_client: self.graphql_client.clone(),
3923        }
3924    }
3925    /// Set the default command to invoke for the container's terminal API.
3926    ///
3927    /// # Arguments
3928    ///
3929    /// * `args` - The args of the command.
3930    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3931    pub fn with_default_terminal_cmd_opts(
3932        &self,
3933        args: Vec<impl Into<String>>,
3934        opts: ContainerWithDefaultTerminalCmdOpts,
3935    ) -> Container {
3936        let mut query = self.selection.select("withDefaultTerminalCmd");
3937        query = query.arg(
3938            "args",
3939            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3940        );
3941        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3942            query = query.arg(
3943                "experimentalPrivilegedNesting",
3944                experimental_privileged_nesting,
3945            );
3946        }
3947        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3948            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3949        }
3950        Container {
3951            proc: self.proc.clone(),
3952            selection: query,
3953            graphql_client: self.graphql_client.clone(),
3954        }
3955    }
3956    /// Return a new container snapshot, with a directory added to its filesystem
3957    ///
3958    /// # Arguments
3959    ///
3960    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
3961    /// * `source` - Identifier of the directory to write
3962    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3963    pub fn with_directory(
3964        &self,
3965        path: impl Into<String>,
3966        source: impl IntoID<DirectoryId>,
3967    ) -> Container {
3968        let mut query = self.selection.select("withDirectory");
3969        query = query.arg("path", path.into());
3970        query = query.arg_lazy(
3971            "source",
3972            Box::new(move || {
3973                let source = source.clone();
3974                Box::pin(async move { source.into_id().await.unwrap().quote() })
3975            }),
3976        );
3977        Container {
3978            proc: self.proc.clone(),
3979            selection: query,
3980            graphql_client: self.graphql_client.clone(),
3981        }
3982    }
3983    /// Return a new container snapshot, with a directory added to its filesystem
3984    ///
3985    /// # Arguments
3986    ///
3987    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
3988    /// * `source` - Identifier of the directory to write
3989    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3990    pub fn with_directory_opts<'a>(
3991        &self,
3992        path: impl Into<String>,
3993        source: impl IntoID<DirectoryId>,
3994        opts: ContainerWithDirectoryOpts<'a>,
3995    ) -> Container {
3996        let mut query = self.selection.select("withDirectory");
3997        query = query.arg("path", path.into());
3998        query = query.arg_lazy(
3999            "source",
4000            Box::new(move || {
4001                let source = source.clone();
4002                Box::pin(async move { source.into_id().await.unwrap().quote() })
4003            }),
4004        );
4005        if let Some(exclude) = opts.exclude {
4006            query = query.arg("exclude", exclude);
4007        }
4008        if let Some(include) = opts.include {
4009            query = query.arg("include", include);
4010        }
4011        if let Some(gitignore) = opts.gitignore {
4012            query = query.arg("gitignore", gitignore);
4013        }
4014        if let Some(owner) = opts.owner {
4015            query = query.arg("owner", owner);
4016        }
4017        if let Some(expand) = opts.expand {
4018            query = query.arg("expand", expand);
4019        }
4020        Container {
4021            proc: self.proc.clone(),
4022            selection: query,
4023            graphql_client: self.graphql_client.clone(),
4024        }
4025    }
4026    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
4027    ///
4028    /// # Arguments
4029    ///
4030    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
4031    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4032    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
4033        let mut query = self.selection.select("withEntrypoint");
4034        query = query.arg(
4035            "args",
4036            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4037        );
4038        Container {
4039            proc: self.proc.clone(),
4040            selection: query,
4041            graphql_client: self.graphql_client.clone(),
4042        }
4043    }
4044    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
4045    ///
4046    /// # Arguments
4047    ///
4048    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
4049    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4050    pub fn with_entrypoint_opts(
4051        &self,
4052        args: Vec<impl Into<String>>,
4053        opts: ContainerWithEntrypointOpts,
4054    ) -> Container {
4055        let mut query = self.selection.select("withEntrypoint");
4056        query = query.arg(
4057            "args",
4058            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4059        );
4060        if let Some(keep_default_args) = opts.keep_default_args {
4061            query = query.arg("keepDefaultArgs", keep_default_args);
4062        }
4063        Container {
4064            proc: self.proc.clone(),
4065            selection: query,
4066            graphql_client: self.graphql_client.clone(),
4067        }
4068    }
4069    /// Export environment variables from an env-file to the container.
4070    ///
4071    /// # Arguments
4072    ///
4073    /// * `source` - Identifier of the envfile
4074    pub fn with_env_file_variables(&self, source: impl IntoID<EnvFileId>) -> Container {
4075        let mut query = self.selection.select("withEnvFileVariables");
4076        query = query.arg_lazy(
4077            "source",
4078            Box::new(move || {
4079                let source = source.clone();
4080                Box::pin(async move { source.into_id().await.unwrap().quote() })
4081            }),
4082        );
4083        Container {
4084            proc: self.proc.clone(),
4085            selection: query,
4086            graphql_client: self.graphql_client.clone(),
4087        }
4088    }
4089    /// Set a new environment variable in the container.
4090    ///
4091    /// # Arguments
4092    ///
4093    /// * `name` - Name of the environment variable (e.g., "HOST").
4094    /// * `value` - Value of the environment variable. (e.g., "localhost").
4095    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4096    pub fn with_env_variable(
4097        &self,
4098        name: impl Into<String>,
4099        value: impl Into<String>,
4100    ) -> Container {
4101        let mut query = self.selection.select("withEnvVariable");
4102        query = query.arg("name", name.into());
4103        query = query.arg("value", value.into());
4104        Container {
4105            proc: self.proc.clone(),
4106            selection: query,
4107            graphql_client: self.graphql_client.clone(),
4108        }
4109    }
4110    /// Set a new environment variable in the container.
4111    ///
4112    /// # Arguments
4113    ///
4114    /// * `name` - Name of the environment variable (e.g., "HOST").
4115    /// * `value` - Value of the environment variable. (e.g., "localhost").
4116    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4117    pub fn with_env_variable_opts(
4118        &self,
4119        name: impl Into<String>,
4120        value: impl Into<String>,
4121        opts: ContainerWithEnvVariableOpts,
4122    ) -> Container {
4123        let mut query = self.selection.select("withEnvVariable");
4124        query = query.arg("name", name.into());
4125        query = query.arg("value", value.into());
4126        if let Some(expand) = opts.expand {
4127            query = query.arg("expand", expand);
4128        }
4129        Container {
4130            proc: self.proc.clone(),
4131            selection: query,
4132            graphql_client: self.graphql_client.clone(),
4133        }
4134    }
4135    /// Raise an error.
4136    ///
4137    /// # Arguments
4138    ///
4139    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
4140    pub fn with_error(&self, err: impl Into<String>) -> Container {
4141        let mut query = self.selection.select("withError");
4142        query = query.arg("err", err.into());
4143        Container {
4144            proc: self.proc.clone(),
4145            selection: query,
4146            graphql_client: self.graphql_client.clone(),
4147        }
4148    }
4149    /// Execute a command in the container, and return a new snapshot of the container state after execution.
4150    ///
4151    /// # Arguments
4152    ///
4153    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
4154    ///
4155    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
4156    ///
4157    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
4158    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4159    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
4160        let mut query = self.selection.select("withExec");
4161        query = query.arg(
4162            "args",
4163            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4164        );
4165        Container {
4166            proc: self.proc.clone(),
4167            selection: query,
4168            graphql_client: self.graphql_client.clone(),
4169        }
4170    }
4171    /// Execute a command in the container, and return a new snapshot of the container state after execution.
4172    ///
4173    /// # Arguments
4174    ///
4175    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
4176    ///
4177    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
4178    ///
4179    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
4180    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4181    pub fn with_exec_opts<'a>(
4182        &self,
4183        args: Vec<impl Into<String>>,
4184        opts: ContainerWithExecOpts<'a>,
4185    ) -> Container {
4186        let mut query = self.selection.select("withExec");
4187        query = query.arg(
4188            "args",
4189            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4190        );
4191        if let Some(use_entrypoint) = opts.use_entrypoint {
4192            query = query.arg("useEntrypoint", use_entrypoint);
4193        }
4194        if let Some(stdin) = opts.stdin {
4195            query = query.arg("stdin", stdin);
4196        }
4197        if let Some(redirect_stdin) = opts.redirect_stdin {
4198            query = query.arg("redirectStdin", redirect_stdin);
4199        }
4200        if let Some(redirect_stdout) = opts.redirect_stdout {
4201            query = query.arg("redirectStdout", redirect_stdout);
4202        }
4203        if let Some(redirect_stderr) = opts.redirect_stderr {
4204            query = query.arg("redirectStderr", redirect_stderr);
4205        }
4206        if let Some(expect) = opts.expect {
4207            query = query.arg("expect", expect);
4208        }
4209        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4210            query = query.arg(
4211                "experimentalPrivilegedNesting",
4212                experimental_privileged_nesting,
4213            );
4214        }
4215        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4216            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4217        }
4218        if let Some(expand) = opts.expand {
4219            query = query.arg("expand", expand);
4220        }
4221        if let Some(no_init) = opts.no_init {
4222            query = query.arg("noInit", no_init);
4223        }
4224        Container {
4225            proc: self.proc.clone(),
4226            selection: query,
4227            graphql_client: self.graphql_client.clone(),
4228        }
4229    }
4230    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
4231    /// Exposed ports serve two purposes:
4232    /// - For health checks and introspection, when running services
4233    /// - For setting the EXPOSE OCI field when publishing the container
4234    ///
4235    /// # Arguments
4236    ///
4237    /// * `port` - Port number to expose. Example: 8080
4238    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4239    pub fn with_exposed_port(&self, port: isize) -> Container {
4240        let mut query = self.selection.select("withExposedPort");
4241        query = query.arg("port", port);
4242        Container {
4243            proc: self.proc.clone(),
4244            selection: query,
4245            graphql_client: self.graphql_client.clone(),
4246        }
4247    }
4248    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
4249    /// Exposed ports serve two purposes:
4250    /// - For health checks and introspection, when running services
4251    /// - For setting the EXPOSE OCI field when publishing the container
4252    ///
4253    /// # Arguments
4254    ///
4255    /// * `port` - Port number to expose. Example: 8080
4256    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4257    pub fn with_exposed_port_opts<'a>(
4258        &self,
4259        port: isize,
4260        opts: ContainerWithExposedPortOpts<'a>,
4261    ) -> Container {
4262        let mut query = self.selection.select("withExposedPort");
4263        query = query.arg("port", port);
4264        if let Some(protocol) = opts.protocol {
4265            query = query.arg("protocol", protocol);
4266        }
4267        if let Some(description) = opts.description {
4268            query = query.arg("description", description);
4269        }
4270        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
4271            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
4272        }
4273        Container {
4274            proc: self.proc.clone(),
4275            selection: query,
4276            graphql_client: self.graphql_client.clone(),
4277        }
4278    }
4279    /// Return a container snapshot with a file added
4280    ///
4281    /// # Arguments
4282    ///
4283    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4284    /// * `source` - File to add
4285    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4286    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
4287        let mut query = self.selection.select("withFile");
4288        query = query.arg("path", path.into());
4289        query = query.arg_lazy(
4290            "source",
4291            Box::new(move || {
4292                let source = source.clone();
4293                Box::pin(async move { source.into_id().await.unwrap().quote() })
4294            }),
4295        );
4296        Container {
4297            proc: self.proc.clone(),
4298            selection: query,
4299            graphql_client: self.graphql_client.clone(),
4300        }
4301    }
4302    /// Return a container snapshot with a file added
4303    ///
4304    /// # Arguments
4305    ///
4306    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4307    /// * `source` - File to add
4308    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4309    pub fn with_file_opts<'a>(
4310        &self,
4311        path: impl Into<String>,
4312        source: impl IntoID<FileId>,
4313        opts: ContainerWithFileOpts<'a>,
4314    ) -> Container {
4315        let mut query = self.selection.select("withFile");
4316        query = query.arg("path", path.into());
4317        query = query.arg_lazy(
4318            "source",
4319            Box::new(move || {
4320                let source = source.clone();
4321                Box::pin(async move { source.into_id().await.unwrap().quote() })
4322            }),
4323        );
4324        if let Some(permissions) = opts.permissions {
4325            query = query.arg("permissions", permissions);
4326        }
4327        if let Some(owner) = opts.owner {
4328            query = query.arg("owner", owner);
4329        }
4330        if let Some(expand) = opts.expand {
4331            query = query.arg("expand", expand);
4332        }
4333        Container {
4334            proc: self.proc.clone(),
4335            selection: query,
4336            graphql_client: self.graphql_client.clone(),
4337        }
4338    }
4339    /// Retrieves this container plus the contents of the given files copied to the given path.
4340    ///
4341    /// # Arguments
4342    ///
4343    /// * `path` - Location where copied files should be placed (e.g., "/src").
4344    /// * `sources` - Identifiers of the files to copy.
4345    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4346    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
4347        let mut query = self.selection.select("withFiles");
4348        query = query.arg("path", path.into());
4349        query = query.arg("sources", sources);
4350        Container {
4351            proc: self.proc.clone(),
4352            selection: query,
4353            graphql_client: self.graphql_client.clone(),
4354        }
4355    }
4356    /// Retrieves this container plus the contents of the given files copied to the given path.
4357    ///
4358    /// # Arguments
4359    ///
4360    /// * `path` - Location where copied files should be placed (e.g., "/src").
4361    /// * `sources` - Identifiers of the files to copy.
4362    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4363    pub fn with_files_opts<'a>(
4364        &self,
4365        path: impl Into<String>,
4366        sources: Vec<FileId>,
4367        opts: ContainerWithFilesOpts<'a>,
4368    ) -> Container {
4369        let mut query = self.selection.select("withFiles");
4370        query = query.arg("path", path.into());
4371        query = query.arg("sources", sources);
4372        if let Some(permissions) = opts.permissions {
4373            query = query.arg("permissions", permissions);
4374        }
4375        if let Some(owner) = opts.owner {
4376            query = query.arg("owner", owner);
4377        }
4378        if let Some(expand) = opts.expand {
4379            query = query.arg("expand", expand);
4380        }
4381        Container {
4382            proc: self.proc.clone(),
4383            selection: query,
4384            graphql_client: self.graphql_client.clone(),
4385        }
4386    }
4387    /// Retrieves this container plus the given label.
4388    ///
4389    /// # Arguments
4390    ///
4391    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
4392    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
4393    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
4394        let mut query = self.selection.select("withLabel");
4395        query = query.arg("name", name.into());
4396        query = query.arg("value", value.into());
4397        Container {
4398            proc: self.proc.clone(),
4399            selection: query,
4400            graphql_client: self.graphql_client.clone(),
4401        }
4402    }
4403    /// Retrieves this container plus a cache volume mounted at the given path.
4404    ///
4405    /// # Arguments
4406    ///
4407    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4408    /// * `cache` - Identifier of the cache volume to mount.
4409    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4410    pub fn with_mounted_cache(
4411        &self,
4412        path: impl Into<String>,
4413        cache: impl IntoID<CacheVolumeId>,
4414    ) -> Container {
4415        let mut query = self.selection.select("withMountedCache");
4416        query = query.arg("path", path.into());
4417        query = query.arg_lazy(
4418            "cache",
4419            Box::new(move || {
4420                let cache = cache.clone();
4421                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4422            }),
4423        );
4424        Container {
4425            proc: self.proc.clone(),
4426            selection: query,
4427            graphql_client: self.graphql_client.clone(),
4428        }
4429    }
4430    /// Retrieves this container plus a cache volume mounted at the given path.
4431    ///
4432    /// # Arguments
4433    ///
4434    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4435    /// * `cache` - Identifier of the cache volume to mount.
4436    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4437    pub fn with_mounted_cache_opts<'a>(
4438        &self,
4439        path: impl Into<String>,
4440        cache: impl IntoID<CacheVolumeId>,
4441        opts: ContainerWithMountedCacheOpts<'a>,
4442    ) -> Container {
4443        let mut query = self.selection.select("withMountedCache");
4444        query = query.arg("path", path.into());
4445        query = query.arg_lazy(
4446            "cache",
4447            Box::new(move || {
4448                let cache = cache.clone();
4449                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4450            }),
4451        );
4452        if let Some(source) = opts.source {
4453            query = query.arg("source", source);
4454        }
4455        if let Some(sharing) = opts.sharing {
4456            query = query.arg("sharing", sharing);
4457        }
4458        if let Some(owner) = opts.owner {
4459            query = query.arg("owner", owner);
4460        }
4461        if let Some(expand) = opts.expand {
4462            query = query.arg("expand", expand);
4463        }
4464        Container {
4465            proc: self.proc.clone(),
4466            selection: query,
4467            graphql_client: self.graphql_client.clone(),
4468        }
4469    }
4470    /// Retrieves this container plus a directory mounted at the given path.
4471    ///
4472    /// # Arguments
4473    ///
4474    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4475    /// * `source` - Identifier of the mounted directory.
4476    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4477    pub fn with_mounted_directory(
4478        &self,
4479        path: impl Into<String>,
4480        source: impl IntoID<DirectoryId>,
4481    ) -> Container {
4482        let mut query = self.selection.select("withMountedDirectory");
4483        query = query.arg("path", path.into());
4484        query = query.arg_lazy(
4485            "source",
4486            Box::new(move || {
4487                let source = source.clone();
4488                Box::pin(async move { source.into_id().await.unwrap().quote() })
4489            }),
4490        );
4491        Container {
4492            proc: self.proc.clone(),
4493            selection: query,
4494            graphql_client: self.graphql_client.clone(),
4495        }
4496    }
4497    /// Retrieves this container plus a directory mounted at the given path.
4498    ///
4499    /// # Arguments
4500    ///
4501    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4502    /// * `source` - Identifier of the mounted directory.
4503    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4504    pub fn with_mounted_directory_opts<'a>(
4505        &self,
4506        path: impl Into<String>,
4507        source: impl IntoID<DirectoryId>,
4508        opts: ContainerWithMountedDirectoryOpts<'a>,
4509    ) -> Container {
4510        let mut query = self.selection.select("withMountedDirectory");
4511        query = query.arg("path", path.into());
4512        query = query.arg_lazy(
4513            "source",
4514            Box::new(move || {
4515                let source = source.clone();
4516                Box::pin(async move { source.into_id().await.unwrap().quote() })
4517            }),
4518        );
4519        if let Some(owner) = opts.owner {
4520            query = query.arg("owner", owner);
4521        }
4522        if let Some(expand) = opts.expand {
4523            query = query.arg("expand", expand);
4524        }
4525        Container {
4526            proc: self.proc.clone(),
4527            selection: query,
4528            graphql_client: self.graphql_client.clone(),
4529        }
4530    }
4531    /// Retrieves this container plus a file mounted at the given path.
4532    ///
4533    /// # Arguments
4534    ///
4535    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4536    /// * `source` - Identifier of the mounted file.
4537    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4538    pub fn with_mounted_file(
4539        &self,
4540        path: impl Into<String>,
4541        source: impl IntoID<FileId>,
4542    ) -> Container {
4543        let mut query = self.selection.select("withMountedFile");
4544        query = query.arg("path", path.into());
4545        query = query.arg_lazy(
4546            "source",
4547            Box::new(move || {
4548                let source = source.clone();
4549                Box::pin(async move { source.into_id().await.unwrap().quote() })
4550            }),
4551        );
4552        Container {
4553            proc: self.proc.clone(),
4554            selection: query,
4555            graphql_client: self.graphql_client.clone(),
4556        }
4557    }
4558    /// Retrieves this container plus a file mounted at the given path.
4559    ///
4560    /// # Arguments
4561    ///
4562    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4563    /// * `source` - Identifier of the mounted file.
4564    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4565    pub fn with_mounted_file_opts<'a>(
4566        &self,
4567        path: impl Into<String>,
4568        source: impl IntoID<FileId>,
4569        opts: ContainerWithMountedFileOpts<'a>,
4570    ) -> Container {
4571        let mut query = self.selection.select("withMountedFile");
4572        query = query.arg("path", path.into());
4573        query = query.arg_lazy(
4574            "source",
4575            Box::new(move || {
4576                let source = source.clone();
4577                Box::pin(async move { source.into_id().await.unwrap().quote() })
4578            }),
4579        );
4580        if let Some(owner) = opts.owner {
4581            query = query.arg("owner", owner);
4582        }
4583        if let Some(expand) = opts.expand {
4584            query = query.arg("expand", expand);
4585        }
4586        Container {
4587            proc: self.proc.clone(),
4588            selection: query,
4589            graphql_client: self.graphql_client.clone(),
4590        }
4591    }
4592    /// Retrieves this container plus a secret mounted into a file at the given path.
4593    ///
4594    /// # Arguments
4595    ///
4596    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4597    /// * `source` - Identifier of the secret to mount.
4598    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4599    pub fn with_mounted_secret(
4600        &self,
4601        path: impl Into<String>,
4602        source: impl IntoID<SecretId>,
4603    ) -> Container {
4604        let mut query = self.selection.select("withMountedSecret");
4605        query = query.arg("path", path.into());
4606        query = query.arg_lazy(
4607            "source",
4608            Box::new(move || {
4609                let source = source.clone();
4610                Box::pin(async move { source.into_id().await.unwrap().quote() })
4611            }),
4612        );
4613        Container {
4614            proc: self.proc.clone(),
4615            selection: query,
4616            graphql_client: self.graphql_client.clone(),
4617        }
4618    }
4619    /// Retrieves this container plus a secret mounted into a file at the given path.
4620    ///
4621    /// # Arguments
4622    ///
4623    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4624    /// * `source` - Identifier of the secret to mount.
4625    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4626    pub fn with_mounted_secret_opts<'a>(
4627        &self,
4628        path: impl Into<String>,
4629        source: impl IntoID<SecretId>,
4630        opts: ContainerWithMountedSecretOpts<'a>,
4631    ) -> Container {
4632        let mut query = self.selection.select("withMountedSecret");
4633        query = query.arg("path", path.into());
4634        query = query.arg_lazy(
4635            "source",
4636            Box::new(move || {
4637                let source = source.clone();
4638                Box::pin(async move { source.into_id().await.unwrap().quote() })
4639            }),
4640        );
4641        if let Some(owner) = opts.owner {
4642            query = query.arg("owner", owner);
4643        }
4644        if let Some(mode) = opts.mode {
4645            query = query.arg("mode", mode);
4646        }
4647        if let Some(expand) = opts.expand {
4648            query = query.arg("expand", expand);
4649        }
4650        Container {
4651            proc: self.proc.clone(),
4652            selection: query,
4653            graphql_client: self.graphql_client.clone(),
4654        }
4655    }
4656    /// 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.
4657    ///
4658    /// # Arguments
4659    ///
4660    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4661    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4662    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4663        let mut query = self.selection.select("withMountedTemp");
4664        query = query.arg("path", path.into());
4665        Container {
4666            proc: self.proc.clone(),
4667            selection: query,
4668            graphql_client: self.graphql_client.clone(),
4669        }
4670    }
4671    /// 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.
4672    ///
4673    /// # Arguments
4674    ///
4675    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4676    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4677    pub fn with_mounted_temp_opts(
4678        &self,
4679        path: impl Into<String>,
4680        opts: ContainerWithMountedTempOpts,
4681    ) -> Container {
4682        let mut query = self.selection.select("withMountedTemp");
4683        query = query.arg("path", path.into());
4684        if let Some(size) = opts.size {
4685            query = query.arg("size", size);
4686        }
4687        if let Some(expand) = opts.expand {
4688            query = query.arg("expand", expand);
4689        }
4690        Container {
4691            proc: self.proc.clone(),
4692            selection: query,
4693            graphql_client: self.graphql_client.clone(),
4694        }
4695    }
4696    /// Return a new container snapshot, with a file added to its filesystem with text content
4697    ///
4698    /// # Arguments
4699    ///
4700    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4701    /// * `contents` - Contents of the new file. Example: "Hello world!"
4702    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4703    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
4704        let mut query = self.selection.select("withNewFile");
4705        query = query.arg("path", path.into());
4706        query = query.arg("contents", contents.into());
4707        Container {
4708            proc: self.proc.clone(),
4709            selection: query,
4710            graphql_client: self.graphql_client.clone(),
4711        }
4712    }
4713    /// Return a new container snapshot, with a file added to its filesystem with text content
4714    ///
4715    /// # Arguments
4716    ///
4717    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4718    /// * `contents` - Contents of the new file. Example: "Hello world!"
4719    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4720    pub fn with_new_file_opts<'a>(
4721        &self,
4722        path: impl Into<String>,
4723        contents: impl Into<String>,
4724        opts: ContainerWithNewFileOpts<'a>,
4725    ) -> Container {
4726        let mut query = self.selection.select("withNewFile");
4727        query = query.arg("path", path.into());
4728        query = query.arg("contents", contents.into());
4729        if let Some(permissions) = opts.permissions {
4730            query = query.arg("permissions", permissions);
4731        }
4732        if let Some(owner) = opts.owner {
4733            query = query.arg("owner", owner);
4734        }
4735        if let Some(expand) = opts.expand {
4736            query = query.arg("expand", expand);
4737        }
4738        Container {
4739            proc: self.proc.clone(),
4740            selection: query,
4741            graphql_client: self.graphql_client.clone(),
4742        }
4743    }
4744    /// Attach credentials for future publishing to a registry. Use in combination with publish
4745    ///
4746    /// # Arguments
4747    ///
4748    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
4749    /// * `username` - The username to authenticate with. Example: "alice"
4750    /// * `secret` - The API key, password or token to authenticate to this registry
4751    pub fn with_registry_auth(
4752        &self,
4753        address: impl Into<String>,
4754        username: impl Into<String>,
4755        secret: impl IntoID<SecretId>,
4756    ) -> Container {
4757        let mut query = self.selection.select("withRegistryAuth");
4758        query = query.arg("address", address.into());
4759        query = query.arg("username", username.into());
4760        query = query.arg_lazy(
4761            "secret",
4762            Box::new(move || {
4763                let secret = secret.clone();
4764                Box::pin(async move { secret.into_id().await.unwrap().quote() })
4765            }),
4766        );
4767        Container {
4768            proc: self.proc.clone(),
4769            selection: query,
4770            graphql_client: self.graphql_client.clone(),
4771        }
4772    }
4773    /// Change the container's root filesystem. The previous root filesystem will be lost.
4774    ///
4775    /// # Arguments
4776    ///
4777    /// * `directory` - The new root filesystem.
4778    pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
4779        let mut query = self.selection.select("withRootfs");
4780        query = query.arg_lazy(
4781            "directory",
4782            Box::new(move || {
4783                let directory = directory.clone();
4784                Box::pin(async move { directory.into_id().await.unwrap().quote() })
4785            }),
4786        );
4787        Container {
4788            proc: self.proc.clone(),
4789            selection: query,
4790            graphql_client: self.graphql_client.clone(),
4791        }
4792    }
4793    /// Set a new environment variable, using a secret value
4794    ///
4795    /// # Arguments
4796    ///
4797    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
4798    /// * `secret` - Identifier of the secret value.
4799    pub fn with_secret_variable(
4800        &self,
4801        name: impl Into<String>,
4802        secret: impl IntoID<SecretId>,
4803    ) -> Container {
4804        let mut query = self.selection.select("withSecretVariable");
4805        query = query.arg("name", name.into());
4806        query = query.arg_lazy(
4807            "secret",
4808            Box::new(move || {
4809                let secret = secret.clone();
4810                Box::pin(async move { secret.into_id().await.unwrap().quote() })
4811            }),
4812        );
4813        Container {
4814            proc: self.proc.clone(),
4815            selection: query,
4816            graphql_client: self.graphql_client.clone(),
4817        }
4818    }
4819    /// Establish a runtime dependency from a container to a network service.
4820    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
4821    /// The service will be reachable from the container via the provided hostname alias.
4822    /// The service dependency will also convey to any files or directories produced by the container.
4823    ///
4824    /// # Arguments
4825    ///
4826    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
4827    /// * `service` - The target service
4828    pub fn with_service_binding(
4829        &self,
4830        alias: impl Into<String>,
4831        service: impl IntoID<ServiceId>,
4832    ) -> Container {
4833        let mut query = self.selection.select("withServiceBinding");
4834        query = query.arg("alias", alias.into());
4835        query = query.arg_lazy(
4836            "service",
4837            Box::new(move || {
4838                let service = service.clone();
4839                Box::pin(async move { service.into_id().await.unwrap().quote() })
4840            }),
4841        );
4842        Container {
4843            proc: self.proc.clone(),
4844            selection: query,
4845            graphql_client: self.graphql_client.clone(),
4846        }
4847    }
4848    /// Return a snapshot with a symlink
4849    ///
4850    /// # Arguments
4851    ///
4852    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4853    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4854    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4855    pub fn with_symlink(
4856        &self,
4857        target: impl Into<String>,
4858        link_name: impl Into<String>,
4859    ) -> Container {
4860        let mut query = self.selection.select("withSymlink");
4861        query = query.arg("target", target.into());
4862        query = query.arg("linkName", link_name.into());
4863        Container {
4864            proc: self.proc.clone(),
4865            selection: query,
4866            graphql_client: self.graphql_client.clone(),
4867        }
4868    }
4869    /// Return a snapshot with a symlink
4870    ///
4871    /// # Arguments
4872    ///
4873    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4874    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4875    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4876    pub fn with_symlink_opts(
4877        &self,
4878        target: impl Into<String>,
4879        link_name: impl Into<String>,
4880        opts: ContainerWithSymlinkOpts,
4881    ) -> Container {
4882        let mut query = self.selection.select("withSymlink");
4883        query = query.arg("target", target.into());
4884        query = query.arg("linkName", link_name.into());
4885        if let Some(expand) = opts.expand {
4886            query = query.arg("expand", expand);
4887        }
4888        Container {
4889            proc: self.proc.clone(),
4890            selection: query,
4891            graphql_client: self.graphql_client.clone(),
4892        }
4893    }
4894    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4895    ///
4896    /// # Arguments
4897    ///
4898    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4899    /// * `source` - Identifier of the socket to forward.
4900    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4901    pub fn with_unix_socket(
4902        &self,
4903        path: impl Into<String>,
4904        source: impl IntoID<SocketId>,
4905    ) -> Container {
4906        let mut query = self.selection.select("withUnixSocket");
4907        query = query.arg("path", path.into());
4908        query = query.arg_lazy(
4909            "source",
4910            Box::new(move || {
4911                let source = source.clone();
4912                Box::pin(async move { source.into_id().await.unwrap().quote() })
4913            }),
4914        );
4915        Container {
4916            proc: self.proc.clone(),
4917            selection: query,
4918            graphql_client: self.graphql_client.clone(),
4919        }
4920    }
4921    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4922    ///
4923    /// # Arguments
4924    ///
4925    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4926    /// * `source` - Identifier of the socket to forward.
4927    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4928    pub fn with_unix_socket_opts<'a>(
4929        &self,
4930        path: impl Into<String>,
4931        source: impl IntoID<SocketId>,
4932        opts: ContainerWithUnixSocketOpts<'a>,
4933    ) -> Container {
4934        let mut query = self.selection.select("withUnixSocket");
4935        query = query.arg("path", path.into());
4936        query = query.arg_lazy(
4937            "source",
4938            Box::new(move || {
4939                let source = source.clone();
4940                Box::pin(async move { source.into_id().await.unwrap().quote() })
4941            }),
4942        );
4943        if let Some(owner) = opts.owner {
4944            query = query.arg("owner", owner);
4945        }
4946        if let Some(expand) = opts.expand {
4947            query = query.arg("expand", expand);
4948        }
4949        Container {
4950            proc: self.proc.clone(),
4951            selection: query,
4952            graphql_client: self.graphql_client.clone(),
4953        }
4954    }
4955    /// Retrieves this container with a different command user.
4956    ///
4957    /// # Arguments
4958    ///
4959    /// * `name` - The user to set (e.g., "root").
4960    pub fn with_user(&self, name: impl Into<String>) -> Container {
4961        let mut query = self.selection.select("withUser");
4962        query = query.arg("name", name.into());
4963        Container {
4964            proc: self.proc.clone(),
4965            selection: query,
4966            graphql_client: self.graphql_client.clone(),
4967        }
4968    }
4969    /// Change the container's working directory. Like WORKDIR in Dockerfile.
4970    ///
4971    /// # Arguments
4972    ///
4973    /// * `path` - The path to set as the working directory (e.g., "/app").
4974    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4975    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
4976        let mut query = self.selection.select("withWorkdir");
4977        query = query.arg("path", path.into());
4978        Container {
4979            proc: self.proc.clone(),
4980            selection: query,
4981            graphql_client: self.graphql_client.clone(),
4982        }
4983    }
4984    /// Change the container's working directory. Like WORKDIR in Dockerfile.
4985    ///
4986    /// # Arguments
4987    ///
4988    /// * `path` - The path to set as the working directory (e.g., "/app").
4989    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4990    pub fn with_workdir_opts(
4991        &self,
4992        path: impl Into<String>,
4993        opts: ContainerWithWorkdirOpts,
4994    ) -> Container {
4995        let mut query = self.selection.select("withWorkdir");
4996        query = query.arg("path", path.into());
4997        if let Some(expand) = opts.expand {
4998            query = query.arg("expand", expand);
4999        }
5000        Container {
5001            proc: self.proc.clone(),
5002            selection: query,
5003            graphql_client: self.graphql_client.clone(),
5004        }
5005    }
5006    /// Retrieves this container minus the given OCI annotation.
5007    ///
5008    /// # Arguments
5009    ///
5010    /// * `name` - The name of the annotation.
5011    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
5012        let mut query = self.selection.select("withoutAnnotation");
5013        query = query.arg("name", name.into());
5014        Container {
5015            proc: self.proc.clone(),
5016            selection: query,
5017            graphql_client: self.graphql_client.clone(),
5018        }
5019    }
5020    /// Remove the container's default arguments.
5021    pub fn without_default_args(&self) -> Container {
5022        let query = self.selection.select("withoutDefaultArgs");
5023        Container {
5024            proc: self.proc.clone(),
5025            selection: query,
5026            graphql_client: self.graphql_client.clone(),
5027        }
5028    }
5029    /// Return a new container snapshot, with a directory removed from its filesystem
5030    ///
5031    /// # Arguments
5032    ///
5033    /// * `path` - Location of the directory to remove (e.g., ".github/").
5034    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5035    pub fn without_directory(&self, path: impl Into<String>) -> Container {
5036        let mut query = self.selection.select("withoutDirectory");
5037        query = query.arg("path", path.into());
5038        Container {
5039            proc: self.proc.clone(),
5040            selection: query,
5041            graphql_client: self.graphql_client.clone(),
5042        }
5043    }
5044    /// Return a new container snapshot, with a directory removed from its filesystem
5045    ///
5046    /// # Arguments
5047    ///
5048    /// * `path` - Location of the directory to remove (e.g., ".github/").
5049    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5050    pub fn without_directory_opts(
5051        &self,
5052        path: impl Into<String>,
5053        opts: ContainerWithoutDirectoryOpts,
5054    ) -> Container {
5055        let mut query = self.selection.select("withoutDirectory");
5056        query = query.arg("path", path.into());
5057        if let Some(expand) = opts.expand {
5058            query = query.arg("expand", expand);
5059        }
5060        Container {
5061            proc: self.proc.clone(),
5062            selection: query,
5063            graphql_client: self.graphql_client.clone(),
5064        }
5065    }
5066    /// Reset the container's OCI entrypoint.
5067    ///
5068    /// # Arguments
5069    ///
5070    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5071    pub fn without_entrypoint(&self) -> Container {
5072        let query = self.selection.select("withoutEntrypoint");
5073        Container {
5074            proc: self.proc.clone(),
5075            selection: query,
5076            graphql_client: self.graphql_client.clone(),
5077        }
5078    }
5079    /// Reset the container's OCI entrypoint.
5080    ///
5081    /// # Arguments
5082    ///
5083    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5084    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
5085        let mut query = self.selection.select("withoutEntrypoint");
5086        if let Some(keep_default_args) = opts.keep_default_args {
5087            query = query.arg("keepDefaultArgs", keep_default_args);
5088        }
5089        Container {
5090            proc: self.proc.clone(),
5091            selection: query,
5092            graphql_client: self.graphql_client.clone(),
5093        }
5094    }
5095    /// Retrieves this container minus the given environment variable.
5096    ///
5097    /// # Arguments
5098    ///
5099    /// * `name` - The name of the environment variable (e.g., "HOST").
5100    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
5101        let mut query = self.selection.select("withoutEnvVariable");
5102        query = query.arg("name", name.into());
5103        Container {
5104            proc: self.proc.clone(),
5105            selection: query,
5106            graphql_client: self.graphql_client.clone(),
5107        }
5108    }
5109    /// Unexpose a previously exposed port.
5110    ///
5111    /// # Arguments
5112    ///
5113    /// * `port` - Port number to unexpose
5114    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5115    pub fn without_exposed_port(&self, port: isize) -> Container {
5116        let mut query = self.selection.select("withoutExposedPort");
5117        query = query.arg("port", port);
5118        Container {
5119            proc: self.proc.clone(),
5120            selection: query,
5121            graphql_client: self.graphql_client.clone(),
5122        }
5123    }
5124    /// Unexpose a previously exposed port.
5125    ///
5126    /// # Arguments
5127    ///
5128    /// * `port` - Port number to unexpose
5129    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5130    pub fn without_exposed_port_opts(
5131        &self,
5132        port: isize,
5133        opts: ContainerWithoutExposedPortOpts,
5134    ) -> Container {
5135        let mut query = self.selection.select("withoutExposedPort");
5136        query = query.arg("port", port);
5137        if let Some(protocol) = opts.protocol {
5138            query = query.arg("protocol", protocol);
5139        }
5140        Container {
5141            proc: self.proc.clone(),
5142            selection: query,
5143            graphql_client: self.graphql_client.clone(),
5144        }
5145    }
5146    /// Retrieves this container with the file at the given path removed.
5147    ///
5148    /// # Arguments
5149    ///
5150    /// * `path` - Location of the file to remove (e.g., "/file.txt").
5151    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5152    pub fn without_file(&self, path: impl Into<String>) -> Container {
5153        let mut query = self.selection.select("withoutFile");
5154        query = query.arg("path", path.into());
5155        Container {
5156            proc: self.proc.clone(),
5157            selection: query,
5158            graphql_client: self.graphql_client.clone(),
5159        }
5160    }
5161    /// Retrieves this container with the file at the given path removed.
5162    ///
5163    /// # Arguments
5164    ///
5165    /// * `path` - Location of the file to remove (e.g., "/file.txt").
5166    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5167    pub fn without_file_opts(
5168        &self,
5169        path: impl Into<String>,
5170        opts: ContainerWithoutFileOpts,
5171    ) -> Container {
5172        let mut query = self.selection.select("withoutFile");
5173        query = query.arg("path", path.into());
5174        if let Some(expand) = opts.expand {
5175            query = query.arg("expand", expand);
5176        }
5177        Container {
5178            proc: self.proc.clone(),
5179            selection: query,
5180            graphql_client: self.graphql_client.clone(),
5181        }
5182    }
5183    /// Return a new container spanshot with specified files removed
5184    ///
5185    /// # Arguments
5186    ///
5187    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
5188    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5189    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
5190        let mut query = self.selection.select("withoutFiles");
5191        query = query.arg(
5192            "paths",
5193            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5194        );
5195        Container {
5196            proc: self.proc.clone(),
5197            selection: query,
5198            graphql_client: self.graphql_client.clone(),
5199        }
5200    }
5201    /// Return a new container spanshot with specified files removed
5202    ///
5203    /// # Arguments
5204    ///
5205    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
5206    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5207    pub fn without_files_opts(
5208        &self,
5209        paths: Vec<impl Into<String>>,
5210        opts: ContainerWithoutFilesOpts,
5211    ) -> Container {
5212        let mut query = self.selection.select("withoutFiles");
5213        query = query.arg(
5214            "paths",
5215            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5216        );
5217        if let Some(expand) = opts.expand {
5218            query = query.arg("expand", expand);
5219        }
5220        Container {
5221            proc: self.proc.clone(),
5222            selection: query,
5223            graphql_client: self.graphql_client.clone(),
5224        }
5225    }
5226    /// Retrieves this container minus the given environment label.
5227    ///
5228    /// # Arguments
5229    ///
5230    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
5231    pub fn without_label(&self, name: impl Into<String>) -> Container {
5232        let mut query = self.selection.select("withoutLabel");
5233        query = query.arg("name", name.into());
5234        Container {
5235            proc: self.proc.clone(),
5236            selection: query,
5237            graphql_client: self.graphql_client.clone(),
5238        }
5239    }
5240    /// Retrieves this container after unmounting everything at the given path.
5241    ///
5242    /// # Arguments
5243    ///
5244    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
5245    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5246    pub fn without_mount(&self, path: impl Into<String>) -> Container {
5247        let mut query = self.selection.select("withoutMount");
5248        query = query.arg("path", path.into());
5249        Container {
5250            proc: self.proc.clone(),
5251            selection: query,
5252            graphql_client: self.graphql_client.clone(),
5253        }
5254    }
5255    /// Retrieves this container after unmounting everything at the given path.
5256    ///
5257    /// # Arguments
5258    ///
5259    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
5260    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5261    pub fn without_mount_opts(
5262        &self,
5263        path: impl Into<String>,
5264        opts: ContainerWithoutMountOpts,
5265    ) -> Container {
5266        let mut query = self.selection.select("withoutMount");
5267        query = query.arg("path", path.into());
5268        if let Some(expand) = opts.expand {
5269            query = query.arg("expand", expand);
5270        }
5271        Container {
5272            proc: self.proc.clone(),
5273            selection: query,
5274            graphql_client: self.graphql_client.clone(),
5275        }
5276    }
5277    /// Retrieves this container without the registry authentication of a given address.
5278    ///
5279    /// # Arguments
5280    ///
5281    /// * `address` - Registry's address to remove the authentication from.
5282    ///
5283    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
5284    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
5285        let mut query = self.selection.select("withoutRegistryAuth");
5286        query = query.arg("address", address.into());
5287        Container {
5288            proc: self.proc.clone(),
5289            selection: query,
5290            graphql_client: self.graphql_client.clone(),
5291        }
5292    }
5293    /// Retrieves this container minus the given environment variable containing the secret.
5294    ///
5295    /// # Arguments
5296    ///
5297    /// * `name` - The name of the environment variable (e.g., "HOST").
5298    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
5299        let mut query = self.selection.select("withoutSecretVariable");
5300        query = query.arg("name", name.into());
5301        Container {
5302            proc: self.proc.clone(),
5303            selection: query,
5304            graphql_client: self.graphql_client.clone(),
5305        }
5306    }
5307    /// Retrieves this container with a previously added Unix socket removed.
5308    ///
5309    /// # Arguments
5310    ///
5311    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
5312    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5313    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
5314        let mut query = self.selection.select("withoutUnixSocket");
5315        query = query.arg("path", path.into());
5316        Container {
5317            proc: self.proc.clone(),
5318            selection: query,
5319            graphql_client: self.graphql_client.clone(),
5320        }
5321    }
5322    /// Retrieves this container with a previously added Unix socket removed.
5323    ///
5324    /// # Arguments
5325    ///
5326    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
5327    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5328    pub fn without_unix_socket_opts(
5329        &self,
5330        path: impl Into<String>,
5331        opts: ContainerWithoutUnixSocketOpts,
5332    ) -> Container {
5333        let mut query = self.selection.select("withoutUnixSocket");
5334        query = query.arg("path", path.into());
5335        if let Some(expand) = opts.expand {
5336            query = query.arg("expand", expand);
5337        }
5338        Container {
5339            proc: self.proc.clone(),
5340            selection: query,
5341            graphql_client: self.graphql_client.clone(),
5342        }
5343    }
5344    /// Retrieves this container with an unset command user.
5345    /// Should default to root.
5346    pub fn without_user(&self) -> Container {
5347        let query = self.selection.select("withoutUser");
5348        Container {
5349            proc: self.proc.clone(),
5350            selection: query,
5351            graphql_client: self.graphql_client.clone(),
5352        }
5353    }
5354    /// Unset the container's working directory.
5355    /// Should default to "/".
5356    pub fn without_workdir(&self) -> Container {
5357        let query = self.selection.select("withoutWorkdir");
5358        Container {
5359            proc: self.proc.clone(),
5360            selection: query,
5361            graphql_client: self.graphql_client.clone(),
5362        }
5363    }
5364    /// Retrieves the working directory for all commands.
5365    pub async fn workdir(&self) -> Result<String, DaggerError> {
5366        let query = self.selection.select("workdir");
5367        query.execute(self.graphql_client.clone()).await
5368    }
5369}
5370#[derive(Clone)]
5371pub struct CurrentModule {
5372    pub proc: Option<Arc<DaggerSessionProc>>,
5373    pub selection: Selection,
5374    pub graphql_client: DynGraphQLClient,
5375}
5376#[derive(Builder, Debug, PartialEq)]
5377pub struct CurrentModuleGeneratorsOpts<'a> {
5378    /// Only include generators matching the specified patterns
5379    #[builder(setter(into, strip_option), default)]
5380    pub include: Option<Vec<&'a str>>,
5381}
5382#[derive(Builder, Debug, PartialEq)]
5383pub struct CurrentModuleWorkdirOpts<'a> {
5384    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
5385    #[builder(setter(into, strip_option), default)]
5386    pub exclude: Option<Vec<&'a str>>,
5387    /// Apply .gitignore filter rules inside the directory
5388    #[builder(setter(into, strip_option), default)]
5389    pub gitignore: Option<bool>,
5390    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
5391    #[builder(setter(into, strip_option), default)]
5392    pub include: Option<Vec<&'a str>>,
5393}
5394impl CurrentModule {
5395    /// The dependencies of the module.
5396    pub fn dependencies(&self) -> Vec<Module> {
5397        let query = self.selection.select("dependencies");
5398        vec![Module {
5399            proc: self.proc.clone(),
5400            selection: query,
5401            graphql_client: self.graphql_client.clone(),
5402        }]
5403    }
5404    /// The generated files and directories made on top of the module source's context directory.
5405    pub fn generated_context_directory(&self) -> Directory {
5406        let query = self.selection.select("generatedContextDirectory");
5407        Directory {
5408            proc: self.proc.clone(),
5409            selection: query,
5410            graphql_client: self.graphql_client.clone(),
5411        }
5412    }
5413    /// Return all generators defined by the module
5414    ///
5415    /// # Arguments
5416    ///
5417    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5418    pub fn generators(&self) -> GeneratorGroup {
5419        let query = self.selection.select("generators");
5420        GeneratorGroup {
5421            proc: self.proc.clone(),
5422            selection: query,
5423            graphql_client: self.graphql_client.clone(),
5424        }
5425    }
5426    /// Return all generators defined by the module
5427    ///
5428    /// # Arguments
5429    ///
5430    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5431    pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
5432        let mut query = self.selection.select("generators");
5433        if let Some(include) = opts.include {
5434            query = query.arg("include", include);
5435        }
5436        GeneratorGroup {
5437            proc: self.proc.clone(),
5438            selection: query,
5439            graphql_client: self.graphql_client.clone(),
5440        }
5441    }
5442    /// A unique identifier for this CurrentModule.
5443    pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
5444        let query = self.selection.select("id");
5445        query.execute(self.graphql_client.clone()).await
5446    }
5447    /// The name of the module being executed in
5448    pub async fn name(&self) -> Result<String, DaggerError> {
5449        let query = self.selection.select("name");
5450        query.execute(self.graphql_client.clone()).await
5451    }
5452    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
5453    pub fn source(&self) -> Directory {
5454        let query = self.selection.select("source");
5455        Directory {
5456            proc: self.proc.clone(),
5457            selection: query,
5458            graphql_client: self.graphql_client.clone(),
5459        }
5460    }
5461    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
5462    ///
5463    /// # Arguments
5464    ///
5465    /// * `path` - Location of the directory to access (e.g., ".").
5466    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5467    pub fn workdir(&self, path: impl Into<String>) -> Directory {
5468        let mut query = self.selection.select("workdir");
5469        query = query.arg("path", path.into());
5470        Directory {
5471            proc: self.proc.clone(),
5472            selection: query,
5473            graphql_client: self.graphql_client.clone(),
5474        }
5475    }
5476    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
5477    ///
5478    /// # Arguments
5479    ///
5480    /// * `path` - Location of the directory to access (e.g., ".").
5481    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5482    pub fn workdir_opts<'a>(
5483        &self,
5484        path: impl Into<String>,
5485        opts: CurrentModuleWorkdirOpts<'a>,
5486    ) -> Directory {
5487        let mut query = self.selection.select("workdir");
5488        query = query.arg("path", path.into());
5489        if let Some(exclude) = opts.exclude {
5490            query = query.arg("exclude", exclude);
5491        }
5492        if let Some(include) = opts.include {
5493            query = query.arg("include", include);
5494        }
5495        if let Some(gitignore) = opts.gitignore {
5496            query = query.arg("gitignore", gitignore);
5497        }
5498        Directory {
5499            proc: self.proc.clone(),
5500            selection: query,
5501            graphql_client: self.graphql_client.clone(),
5502        }
5503    }
5504    /// 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.
5505    ///
5506    /// # Arguments
5507    ///
5508    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5509    pub fn workdir_file(&self, path: impl Into<String>) -> File {
5510        let mut query = self.selection.select("workdirFile");
5511        query = query.arg("path", path.into());
5512        File {
5513            proc: self.proc.clone(),
5514            selection: query,
5515            graphql_client: self.graphql_client.clone(),
5516        }
5517    }
5518}
5519#[derive(Clone)]
5520pub struct Directory {
5521    pub proc: Option<Arc<DaggerSessionProc>>,
5522    pub selection: Selection,
5523    pub graphql_client: DynGraphQLClient,
5524}
5525#[derive(Builder, Debug, PartialEq)]
5526pub struct DirectoryAsModuleOpts<'a> {
5527    /// An optional subpath of the directory which contains the module's configuration file.
5528    /// If not set, the module source code is loaded from the root of the directory.
5529    #[builder(setter(into, strip_option), default)]
5530    pub source_root_path: Option<&'a str>,
5531}
5532#[derive(Builder, Debug, PartialEq)]
5533pub struct DirectoryAsModuleSourceOpts<'a> {
5534    /// An optional subpath of the directory which contains the module's configuration file.
5535    /// If not set, the module source code is loaded from the root of the directory.
5536    #[builder(setter(into, strip_option), default)]
5537    pub source_root_path: Option<&'a str>,
5538}
5539#[derive(Builder, Debug, PartialEq)]
5540pub struct DirectoryDockerBuildOpts<'a> {
5541    /// Build arguments to use in the build.
5542    #[builder(setter(into, strip_option), default)]
5543    pub build_args: Option<Vec<BuildArg>>,
5544    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
5545    #[builder(setter(into, strip_option), default)]
5546    pub dockerfile: Option<&'a str>,
5547    /// If set, skip the automatic init process injected into containers created by RUN statements.
5548    /// 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.
5549    #[builder(setter(into, strip_option), default)]
5550    pub no_init: Option<bool>,
5551    /// The platform to build.
5552    #[builder(setter(into, strip_option), default)]
5553    pub platform: Option<Platform>,
5554    /// Secrets to pass to the build.
5555    /// They will be mounted at /run/secrets/[secret-name].
5556    #[builder(setter(into, strip_option), default)]
5557    pub secrets: Option<Vec<SecretId>>,
5558    /// A socket to use for SSH authentication during the build
5559    /// (e.g., for Dockerfile RUN --mount=type=ssh instructions).
5560    /// Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
5561    #[builder(setter(into, strip_option), default)]
5562    pub ssh: Option<SocketId>,
5563    /// Target build stage to build.
5564    #[builder(setter(into, strip_option), default)]
5565    pub target: Option<&'a str>,
5566}
5567#[derive(Builder, Debug, PartialEq)]
5568pub struct DirectoryEntriesOpts<'a> {
5569    /// Location of the directory to look at (e.g., "/src").
5570    #[builder(setter(into, strip_option), default)]
5571    pub path: Option<&'a str>,
5572}
5573#[derive(Builder, Debug, PartialEq)]
5574pub struct DirectoryExistsOpts {
5575    /// If specified, do not follow symlinks.
5576    #[builder(setter(into, strip_option), default)]
5577    pub do_not_follow_symlinks: Option<bool>,
5578    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
5579    #[builder(setter(into, strip_option), default)]
5580    pub expected_type: Option<ExistsType>,
5581}
5582#[derive(Builder, Debug, PartialEq)]
5583pub struct DirectoryExportOpts {
5584    /// 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.
5585    #[builder(setter(into, strip_option), default)]
5586    pub wipe: Option<bool>,
5587}
5588#[derive(Builder, Debug, PartialEq)]
5589pub struct DirectoryFilterOpts<'a> {
5590    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
5591    #[builder(setter(into, strip_option), default)]
5592    pub exclude: Option<Vec<&'a str>>,
5593    /// If set, apply .gitignore rules when filtering the directory.
5594    #[builder(setter(into, strip_option), default)]
5595    pub gitignore: Option<bool>,
5596    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
5597    #[builder(setter(into, strip_option), default)]
5598    pub include: Option<Vec<&'a str>>,
5599}
5600#[derive(Builder, Debug, PartialEq)]
5601pub struct DirectorySearchOpts<'a> {
5602    /// Allow the . pattern to match newlines in multiline mode.
5603    #[builder(setter(into, strip_option), default)]
5604    pub dotall: Option<bool>,
5605    /// Only return matching files, not lines and content
5606    #[builder(setter(into, strip_option), default)]
5607    pub files_only: Option<bool>,
5608    /// Glob patterns to match (e.g., "*.md")
5609    #[builder(setter(into, strip_option), default)]
5610    pub globs: Option<Vec<&'a str>>,
5611    /// Enable case-insensitive matching.
5612    #[builder(setter(into, strip_option), default)]
5613    pub insensitive: Option<bool>,
5614    /// Limit the number of results to return
5615    #[builder(setter(into, strip_option), default)]
5616    pub limit: Option<isize>,
5617    /// Interpret the pattern as a literal string instead of a regular expression.
5618    #[builder(setter(into, strip_option), default)]
5619    pub literal: Option<bool>,
5620    /// Enable searching across multiple lines.
5621    #[builder(setter(into, strip_option), default)]
5622    pub multiline: Option<bool>,
5623    /// Directory or file paths to search
5624    #[builder(setter(into, strip_option), default)]
5625    pub paths: Option<Vec<&'a str>>,
5626    /// Skip hidden files (files starting with .).
5627    #[builder(setter(into, strip_option), default)]
5628    pub skip_hidden: Option<bool>,
5629    /// Honor .gitignore, .ignore, and .rgignore files.
5630    #[builder(setter(into, strip_option), default)]
5631    pub skip_ignored: Option<bool>,
5632}
5633#[derive(Builder, Debug, PartialEq)]
5634pub struct DirectoryStatOpts {
5635    /// If specified, do not follow symlinks.
5636    #[builder(setter(into, strip_option), default)]
5637    pub do_not_follow_symlinks: Option<bool>,
5638}
5639#[derive(Builder, Debug, PartialEq)]
5640pub struct DirectoryTerminalOpts<'a> {
5641    /// If set, override the container's default terminal command and invoke these command arguments instead.
5642    #[builder(setter(into, strip_option), default)]
5643    pub cmd: Option<Vec<&'a str>>,
5644    /// If set, override the default container used for the terminal.
5645    #[builder(setter(into, strip_option), default)]
5646    pub container: Option<ContainerId>,
5647    /// Provides Dagger access to the executed command.
5648    #[builder(setter(into, strip_option), default)]
5649    pub experimental_privileged_nesting: Option<bool>,
5650    /// 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.
5651    #[builder(setter(into, strip_option), default)]
5652    pub insecure_root_capabilities: Option<bool>,
5653}
5654#[derive(Builder, Debug, PartialEq)]
5655pub struct DirectoryWithDirectoryOpts<'a> {
5656    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
5657    #[builder(setter(into, strip_option), default)]
5658    pub exclude: Option<Vec<&'a str>>,
5659    /// Apply .gitignore filter rules inside the directory
5660    #[builder(setter(into, strip_option), default)]
5661    pub gitignore: Option<bool>,
5662    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
5663    #[builder(setter(into, strip_option), default)]
5664    pub include: Option<Vec<&'a str>>,
5665    /// A user:group to set for the copied directory and its contents.
5666    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5667    /// If the group is omitted, it defaults to the same as the user.
5668    #[builder(setter(into, strip_option), default)]
5669    pub owner: Option<&'a str>,
5670}
5671#[derive(Builder, Debug, PartialEq)]
5672pub struct DirectoryWithFileOpts<'a> {
5673    /// A user:group to set for the copied directory and its contents.
5674    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5675    /// If the group is omitted, it defaults to the same as the user.
5676    #[builder(setter(into, strip_option), default)]
5677    pub owner: Option<&'a str>,
5678    /// Permission given to the copied file (e.g., 0600).
5679    #[builder(setter(into, strip_option), default)]
5680    pub permissions: Option<isize>,
5681}
5682#[derive(Builder, Debug, PartialEq)]
5683pub struct DirectoryWithFilesOpts {
5684    /// Permission given to the copied files (e.g., 0600).
5685    #[builder(setter(into, strip_option), default)]
5686    pub permissions: Option<isize>,
5687}
5688#[derive(Builder, Debug, PartialEq)]
5689pub struct DirectoryWithNewDirectoryOpts {
5690    /// Permission granted to the created directory (e.g., 0777).
5691    #[builder(setter(into, strip_option), default)]
5692    pub permissions: Option<isize>,
5693}
5694#[derive(Builder, Debug, PartialEq)]
5695pub struct DirectoryWithNewFileOpts {
5696    /// Permissions of the new file. Example: 0600
5697    #[builder(setter(into, strip_option), default)]
5698    pub permissions: Option<isize>,
5699}
5700impl Directory {
5701    /// Converts this directory to a local git repository
5702    pub fn as_git(&self) -> GitRepository {
5703        let query = self.selection.select("asGit");
5704        GitRepository {
5705            proc: self.proc.clone(),
5706            selection: query,
5707            graphql_client: self.graphql_client.clone(),
5708        }
5709    }
5710    /// Load the directory as a Dagger module source
5711    ///
5712    /// # Arguments
5713    ///
5714    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5715    pub fn as_module(&self) -> Module {
5716        let query = self.selection.select("asModule");
5717        Module {
5718            proc: self.proc.clone(),
5719            selection: query,
5720            graphql_client: self.graphql_client.clone(),
5721        }
5722    }
5723    /// Load the directory as a Dagger module source
5724    ///
5725    /// # Arguments
5726    ///
5727    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5728    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
5729        let mut query = self.selection.select("asModule");
5730        if let Some(source_root_path) = opts.source_root_path {
5731            query = query.arg("sourceRootPath", source_root_path);
5732        }
5733        Module {
5734            proc: self.proc.clone(),
5735            selection: query,
5736            graphql_client: self.graphql_client.clone(),
5737        }
5738    }
5739    /// Load the directory as a Dagger module source
5740    ///
5741    /// # Arguments
5742    ///
5743    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5744    pub fn as_module_source(&self) -> ModuleSource {
5745        let query = self.selection.select("asModuleSource");
5746        ModuleSource {
5747            proc: self.proc.clone(),
5748            selection: query,
5749            graphql_client: self.graphql_client.clone(),
5750        }
5751    }
5752    /// Load the directory as a Dagger module source
5753    ///
5754    /// # Arguments
5755    ///
5756    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5757    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
5758        let mut query = self.selection.select("asModuleSource");
5759        if let Some(source_root_path) = opts.source_root_path {
5760            query = query.arg("sourceRootPath", source_root_path);
5761        }
5762        ModuleSource {
5763            proc: self.proc.clone(),
5764            selection: query,
5765            graphql_client: self.graphql_client.clone(),
5766        }
5767    }
5768    /// Return the difference between this directory and another directory, typically an older snapshot.
5769    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
5770    ///
5771    /// # Arguments
5772    ///
5773    /// * `from` - The base directory snapshot to compare against
5774    pub fn changes(&self, from: impl IntoID<DirectoryId>) -> Changeset {
5775        let mut query = self.selection.select("changes");
5776        query = query.arg_lazy(
5777            "from",
5778            Box::new(move || {
5779                let from = from.clone();
5780                Box::pin(async move { from.into_id().await.unwrap().quote() })
5781            }),
5782        );
5783        Changeset {
5784            proc: self.proc.clone(),
5785            selection: query,
5786            graphql_client: self.graphql_client.clone(),
5787        }
5788    }
5789    /// Change the owner of the directory contents recursively.
5790    ///
5791    /// # Arguments
5792    ///
5793    /// * `path` - Path of the directory to change ownership of (e.g., "/").
5794    /// * `owner` - A user:group to set for the mounted directory and its contents.
5795    ///
5796    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5797    ///
5798    /// If the group is omitted, it defaults to the same as the user.
5799    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
5800        let mut query = self.selection.select("chown");
5801        query = query.arg("path", path.into());
5802        query = query.arg("owner", owner.into());
5803        Directory {
5804            proc: self.proc.clone(),
5805            selection: query,
5806            graphql_client: self.graphql_client.clone(),
5807        }
5808    }
5809    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
5810    ///
5811    /// # Arguments
5812    ///
5813    /// * `other` - The directory to compare against
5814    pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
5815        let mut query = self.selection.select("diff");
5816        query = query.arg_lazy(
5817            "other",
5818            Box::new(move || {
5819                let other = other.clone();
5820                Box::pin(async move { other.into_id().await.unwrap().quote() })
5821            }),
5822        );
5823        Directory {
5824            proc: self.proc.clone(),
5825            selection: query,
5826            graphql_client: self.graphql_client.clone(),
5827        }
5828    }
5829    /// 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.
5830    pub async fn digest(&self) -> Result<String, DaggerError> {
5831        let query = self.selection.select("digest");
5832        query.execute(self.graphql_client.clone()).await
5833    }
5834    /// Retrieves a directory at the given path.
5835    ///
5836    /// # Arguments
5837    ///
5838    /// * `path` - Location of the directory to retrieve. Example: "/src"
5839    pub fn directory(&self, path: impl Into<String>) -> Directory {
5840        let mut query = self.selection.select("directory");
5841        query = query.arg("path", path.into());
5842        Directory {
5843            proc: self.proc.clone(),
5844            selection: query,
5845            graphql_client: self.graphql_client.clone(),
5846        }
5847    }
5848    /// 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.
5849    ///
5850    /// # Arguments
5851    ///
5852    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5853    pub fn docker_build(&self) -> Container {
5854        let query = self.selection.select("dockerBuild");
5855        Container {
5856            proc: self.proc.clone(),
5857            selection: query,
5858            graphql_client: self.graphql_client.clone(),
5859        }
5860    }
5861    /// 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.
5862    ///
5863    /// # Arguments
5864    ///
5865    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5866    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5867        let mut query = self.selection.select("dockerBuild");
5868        if let Some(dockerfile) = opts.dockerfile {
5869            query = query.arg("dockerfile", dockerfile);
5870        }
5871        if let Some(platform) = opts.platform {
5872            query = query.arg("platform", platform);
5873        }
5874        if let Some(build_args) = opts.build_args {
5875            query = query.arg("buildArgs", build_args);
5876        }
5877        if let Some(target) = opts.target {
5878            query = query.arg("target", target);
5879        }
5880        if let Some(secrets) = opts.secrets {
5881            query = query.arg("secrets", secrets);
5882        }
5883        if let Some(no_init) = opts.no_init {
5884            query = query.arg("noInit", no_init);
5885        }
5886        if let Some(ssh) = opts.ssh {
5887            query = query.arg("ssh", ssh);
5888        }
5889        Container {
5890            proc: self.proc.clone(),
5891            selection: query,
5892            graphql_client: self.graphql_client.clone(),
5893        }
5894    }
5895    /// Returns a list of files and directories at the given path.
5896    ///
5897    /// # Arguments
5898    ///
5899    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5900    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
5901        let query = self.selection.select("entries");
5902        query.execute(self.graphql_client.clone()).await
5903    }
5904    /// Returns a list of files and directories at the given path.
5905    ///
5906    /// # Arguments
5907    ///
5908    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5909    pub async fn entries_opts<'a>(
5910        &self,
5911        opts: DirectoryEntriesOpts<'a>,
5912    ) -> Result<Vec<String>, DaggerError> {
5913        let mut query = self.selection.select("entries");
5914        if let Some(path) = opts.path {
5915            query = query.arg("path", path);
5916        }
5917        query.execute(self.graphql_client.clone()).await
5918    }
5919    /// check if a file or directory exists
5920    ///
5921    /// # Arguments
5922    ///
5923    /// * `path` - Path to check (e.g., "/file.txt").
5924    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5925    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5926        let mut query = self.selection.select("exists");
5927        query = query.arg("path", path.into());
5928        query.execute(self.graphql_client.clone()).await
5929    }
5930    /// check if a file or directory exists
5931    ///
5932    /// # Arguments
5933    ///
5934    /// * `path` - Path to check (e.g., "/file.txt").
5935    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5936    pub async fn exists_opts(
5937        &self,
5938        path: impl Into<String>,
5939        opts: DirectoryExistsOpts,
5940    ) -> Result<bool, DaggerError> {
5941        let mut query = self.selection.select("exists");
5942        query = query.arg("path", path.into());
5943        if let Some(expected_type) = opts.expected_type {
5944            query = query.arg("expectedType", expected_type);
5945        }
5946        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5947            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5948        }
5949        query.execute(self.graphql_client.clone()).await
5950    }
5951    /// Writes the contents of the directory to a path on the host.
5952    ///
5953    /// # Arguments
5954    ///
5955    /// * `path` - Location of the copied directory (e.g., "logs/").
5956    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5957    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5958        let mut query = self.selection.select("export");
5959        query = query.arg("path", path.into());
5960        query.execute(self.graphql_client.clone()).await
5961    }
5962    /// Writes the contents of the directory to a path on the host.
5963    ///
5964    /// # Arguments
5965    ///
5966    /// * `path` - Location of the copied directory (e.g., "logs/").
5967    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5968    pub async fn export_opts(
5969        &self,
5970        path: impl Into<String>,
5971        opts: DirectoryExportOpts,
5972    ) -> Result<String, DaggerError> {
5973        let mut query = self.selection.select("export");
5974        query = query.arg("path", path.into());
5975        if let Some(wipe) = opts.wipe {
5976            query = query.arg("wipe", wipe);
5977        }
5978        query.execute(self.graphql_client.clone()).await
5979    }
5980    /// Retrieve a file at the given path.
5981    ///
5982    /// # Arguments
5983    ///
5984    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5985    pub fn file(&self, path: impl Into<String>) -> File {
5986        let mut query = self.selection.select("file");
5987        query = query.arg("path", path.into());
5988        File {
5989            proc: self.proc.clone(),
5990            selection: query,
5991            graphql_client: self.graphql_client.clone(),
5992        }
5993    }
5994    /// Return a snapshot with some paths included or excluded
5995    ///
5996    /// # Arguments
5997    ///
5998    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5999    pub fn filter(&self) -> Directory {
6000        let query = self.selection.select("filter");
6001        Directory {
6002            proc: self.proc.clone(),
6003            selection: query,
6004            graphql_client: self.graphql_client.clone(),
6005        }
6006    }
6007    /// Return a snapshot with some paths included or excluded
6008    ///
6009    /// # Arguments
6010    ///
6011    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6012    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
6013        let mut query = self.selection.select("filter");
6014        if let Some(exclude) = opts.exclude {
6015            query = query.arg("exclude", exclude);
6016        }
6017        if let Some(include) = opts.include {
6018            query = query.arg("include", include);
6019        }
6020        if let Some(gitignore) = opts.gitignore {
6021            query = query.arg("gitignore", gitignore);
6022        }
6023        Directory {
6024            proc: self.proc.clone(),
6025            selection: query,
6026            graphql_client: self.graphql_client.clone(),
6027        }
6028    }
6029    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
6030    ///
6031    /// # Arguments
6032    ///
6033    /// * `name` - The name of the file or directory to search for
6034    /// * `start` - The path to start the search from
6035    pub async fn find_up(
6036        &self,
6037        name: impl Into<String>,
6038        start: impl Into<String>,
6039    ) -> Result<String, DaggerError> {
6040        let mut query = self.selection.select("findUp");
6041        query = query.arg("name", name.into());
6042        query = query.arg("start", start.into());
6043        query.execute(self.graphql_client.clone()).await
6044    }
6045    /// Returns a list of files and directories that matche the given pattern.
6046    ///
6047    /// # Arguments
6048    ///
6049    /// * `pattern` - Pattern to match (e.g., "*.md").
6050    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
6051        let mut query = self.selection.select("glob");
6052        query = query.arg("pattern", pattern.into());
6053        query.execute(self.graphql_client.clone()).await
6054    }
6055    /// A unique identifier for this Directory.
6056    pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
6057        let query = self.selection.select("id");
6058        query.execute(self.graphql_client.clone()).await
6059    }
6060    /// Returns the name of the directory.
6061    pub async fn name(&self) -> Result<String, DaggerError> {
6062        let query = self.selection.select("name");
6063        query.execute(self.graphql_client.clone()).await
6064    }
6065    /// Searches for content matching the given regular expression or literal string.
6066    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6067    ///
6068    /// # Arguments
6069    ///
6070    /// * `pattern` - The text to match.
6071    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6072    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
6073        let mut query = self.selection.select("search");
6074        query = query.arg("pattern", pattern.into());
6075        vec![SearchResult {
6076            proc: self.proc.clone(),
6077            selection: query,
6078            graphql_client: self.graphql_client.clone(),
6079        }]
6080    }
6081    /// Searches for content matching the given regular expression or literal string.
6082    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6083    ///
6084    /// # Arguments
6085    ///
6086    /// * `pattern` - The text to match.
6087    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6088    pub fn search_opts<'a>(
6089        &self,
6090        pattern: impl Into<String>,
6091        opts: DirectorySearchOpts<'a>,
6092    ) -> Vec<SearchResult> {
6093        let mut query = self.selection.select("search");
6094        query = query.arg("pattern", pattern.into());
6095        if let Some(paths) = opts.paths {
6096            query = query.arg("paths", paths);
6097        }
6098        if let Some(globs) = opts.globs {
6099            query = query.arg("globs", globs);
6100        }
6101        if let Some(literal) = opts.literal {
6102            query = query.arg("literal", literal);
6103        }
6104        if let Some(multiline) = opts.multiline {
6105            query = query.arg("multiline", multiline);
6106        }
6107        if let Some(dotall) = opts.dotall {
6108            query = query.arg("dotall", dotall);
6109        }
6110        if let Some(insensitive) = opts.insensitive {
6111            query = query.arg("insensitive", insensitive);
6112        }
6113        if let Some(skip_ignored) = opts.skip_ignored {
6114            query = query.arg("skipIgnored", skip_ignored);
6115        }
6116        if let Some(skip_hidden) = opts.skip_hidden {
6117            query = query.arg("skipHidden", skip_hidden);
6118        }
6119        if let Some(files_only) = opts.files_only {
6120            query = query.arg("filesOnly", files_only);
6121        }
6122        if let Some(limit) = opts.limit {
6123            query = query.arg("limit", limit);
6124        }
6125        vec![SearchResult {
6126            proc: self.proc.clone(),
6127            selection: query,
6128            graphql_client: self.graphql_client.clone(),
6129        }]
6130    }
6131    /// Return file status
6132    ///
6133    /// # Arguments
6134    ///
6135    /// * `path` - Path to stat (e.g., "/file.txt").
6136    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6137    pub fn stat(&self, path: impl Into<String>) -> Stat {
6138        let mut query = self.selection.select("stat");
6139        query = query.arg("path", path.into());
6140        Stat {
6141            proc: self.proc.clone(),
6142            selection: query,
6143            graphql_client: self.graphql_client.clone(),
6144        }
6145    }
6146    /// Return file status
6147    ///
6148    /// # Arguments
6149    ///
6150    /// * `path` - Path to stat (e.g., "/file.txt").
6151    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6152    pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
6153        let mut query = self.selection.select("stat");
6154        query = query.arg("path", path.into());
6155        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
6156            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
6157        }
6158        Stat {
6159            proc: self.proc.clone(),
6160            selection: query,
6161            graphql_client: self.graphql_client.clone(),
6162        }
6163    }
6164    /// Force evaluation in the engine.
6165    pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
6166        let query = self.selection.select("sync");
6167        query.execute(self.graphql_client.clone()).await
6168    }
6169    /// Opens an interactive terminal in new container with this directory mounted inside.
6170    ///
6171    /// # Arguments
6172    ///
6173    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6174    pub fn terminal(&self) -> Directory {
6175        let query = self.selection.select("terminal");
6176        Directory {
6177            proc: self.proc.clone(),
6178            selection: query,
6179            graphql_client: self.graphql_client.clone(),
6180        }
6181    }
6182    /// Opens an interactive terminal in new container with this directory mounted inside.
6183    ///
6184    /// # Arguments
6185    ///
6186    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6187    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
6188        let mut query = self.selection.select("terminal");
6189        if let Some(container) = opts.container {
6190            query = query.arg("container", container);
6191        }
6192        if let Some(cmd) = opts.cmd {
6193            query = query.arg("cmd", cmd);
6194        }
6195        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6196            query = query.arg(
6197                "experimentalPrivilegedNesting",
6198                experimental_privileged_nesting,
6199            );
6200        }
6201        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6202            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6203        }
6204        Directory {
6205            proc: self.proc.clone(),
6206            selection: query,
6207            graphql_client: self.graphql_client.clone(),
6208        }
6209    }
6210    /// Return a directory with changes from another directory applied to it.
6211    ///
6212    /// # Arguments
6213    ///
6214    /// * `changes` - Changes to apply to the directory
6215    pub fn with_changes(&self, changes: impl IntoID<ChangesetId>) -> Directory {
6216        let mut query = self.selection.select("withChanges");
6217        query = query.arg_lazy(
6218            "changes",
6219            Box::new(move || {
6220                let changes = changes.clone();
6221                Box::pin(async move { changes.into_id().await.unwrap().quote() })
6222            }),
6223        );
6224        Directory {
6225            proc: self.proc.clone(),
6226            selection: query,
6227            graphql_client: self.graphql_client.clone(),
6228        }
6229    }
6230    /// Return a snapshot with a directory added
6231    ///
6232    /// # Arguments
6233    ///
6234    /// * `path` - Location of the written directory (e.g., "/src/").
6235    /// * `source` - Identifier of the directory to copy.
6236    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6237    pub fn with_directory(
6238        &self,
6239        path: impl Into<String>,
6240        source: impl IntoID<DirectoryId>,
6241    ) -> Directory {
6242        let mut query = self.selection.select("withDirectory");
6243        query = query.arg("path", path.into());
6244        query = query.arg_lazy(
6245            "source",
6246            Box::new(move || {
6247                let source = source.clone();
6248                Box::pin(async move { source.into_id().await.unwrap().quote() })
6249            }),
6250        );
6251        Directory {
6252            proc: self.proc.clone(),
6253            selection: query,
6254            graphql_client: self.graphql_client.clone(),
6255        }
6256    }
6257    /// Return a snapshot with a directory added
6258    ///
6259    /// # Arguments
6260    ///
6261    /// * `path` - Location of the written directory (e.g., "/src/").
6262    /// * `source` - Identifier of the directory to copy.
6263    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6264    pub fn with_directory_opts<'a>(
6265        &self,
6266        path: impl Into<String>,
6267        source: impl IntoID<DirectoryId>,
6268        opts: DirectoryWithDirectoryOpts<'a>,
6269    ) -> Directory {
6270        let mut query = self.selection.select("withDirectory");
6271        query = query.arg("path", path.into());
6272        query = query.arg_lazy(
6273            "source",
6274            Box::new(move || {
6275                let source = source.clone();
6276                Box::pin(async move { source.into_id().await.unwrap().quote() })
6277            }),
6278        );
6279        if let Some(exclude) = opts.exclude {
6280            query = query.arg("exclude", exclude);
6281        }
6282        if let Some(include) = opts.include {
6283            query = query.arg("include", include);
6284        }
6285        if let Some(gitignore) = opts.gitignore {
6286            query = query.arg("gitignore", gitignore);
6287        }
6288        if let Some(owner) = opts.owner {
6289            query = query.arg("owner", owner);
6290        }
6291        Directory {
6292            proc: self.proc.clone(),
6293            selection: query,
6294            graphql_client: self.graphql_client.clone(),
6295        }
6296    }
6297    /// Raise an error.
6298    ///
6299    /// # Arguments
6300    ///
6301    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
6302    pub fn with_error(&self, err: impl Into<String>) -> Directory {
6303        let mut query = self.selection.select("withError");
6304        query = query.arg("err", err.into());
6305        Directory {
6306            proc: self.proc.clone(),
6307            selection: query,
6308            graphql_client: self.graphql_client.clone(),
6309        }
6310    }
6311    /// Retrieves this directory plus the contents of the given file copied to the given path.
6312    ///
6313    /// # Arguments
6314    ///
6315    /// * `path` - Location of the copied file (e.g., "/file.txt").
6316    /// * `source` - Identifier of the file to copy.
6317    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6318    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
6319        let mut query = self.selection.select("withFile");
6320        query = query.arg("path", path.into());
6321        query = query.arg_lazy(
6322            "source",
6323            Box::new(move || {
6324                let source = source.clone();
6325                Box::pin(async move { source.into_id().await.unwrap().quote() })
6326            }),
6327        );
6328        Directory {
6329            proc: self.proc.clone(),
6330            selection: query,
6331            graphql_client: self.graphql_client.clone(),
6332        }
6333    }
6334    /// Retrieves this directory plus the contents of the given file copied to the given path.
6335    ///
6336    /// # Arguments
6337    ///
6338    /// * `path` - Location of the copied file (e.g., "/file.txt").
6339    /// * `source` - Identifier of the file to copy.
6340    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6341    pub fn with_file_opts<'a>(
6342        &self,
6343        path: impl Into<String>,
6344        source: impl IntoID<FileId>,
6345        opts: DirectoryWithFileOpts<'a>,
6346    ) -> Directory {
6347        let mut query = self.selection.select("withFile");
6348        query = query.arg("path", path.into());
6349        query = query.arg_lazy(
6350            "source",
6351            Box::new(move || {
6352                let source = source.clone();
6353                Box::pin(async move { source.into_id().await.unwrap().quote() })
6354            }),
6355        );
6356        if let Some(permissions) = opts.permissions {
6357            query = query.arg("permissions", permissions);
6358        }
6359        if let Some(owner) = opts.owner {
6360            query = query.arg("owner", owner);
6361        }
6362        Directory {
6363            proc: self.proc.clone(),
6364            selection: query,
6365            graphql_client: self.graphql_client.clone(),
6366        }
6367    }
6368    /// Retrieves this directory plus the contents of the given files copied to the given path.
6369    ///
6370    /// # Arguments
6371    ///
6372    /// * `path` - Location where copied files should be placed (e.g., "/src").
6373    /// * `sources` - Identifiers of the files to copy.
6374    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6375    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
6376        let mut query = self.selection.select("withFiles");
6377        query = query.arg("path", path.into());
6378        query = query.arg("sources", sources);
6379        Directory {
6380            proc: self.proc.clone(),
6381            selection: query,
6382            graphql_client: self.graphql_client.clone(),
6383        }
6384    }
6385    /// Retrieves this directory plus the contents of the given files copied to the given path.
6386    ///
6387    /// # Arguments
6388    ///
6389    /// * `path` - Location where copied files should be placed (e.g., "/src").
6390    /// * `sources` - Identifiers of the files to copy.
6391    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6392    pub fn with_files_opts(
6393        &self,
6394        path: impl Into<String>,
6395        sources: Vec<FileId>,
6396        opts: DirectoryWithFilesOpts,
6397    ) -> Directory {
6398        let mut query = self.selection.select("withFiles");
6399        query = query.arg("path", path.into());
6400        query = query.arg("sources", sources);
6401        if let Some(permissions) = opts.permissions {
6402            query = query.arg("permissions", permissions);
6403        }
6404        Directory {
6405            proc: self.proc.clone(),
6406            selection: query,
6407            graphql_client: self.graphql_client.clone(),
6408        }
6409    }
6410    /// Retrieves this directory plus a new directory created at the given path.
6411    ///
6412    /// # Arguments
6413    ///
6414    /// * `path` - Location of the directory created (e.g., "/logs").
6415    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6416    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
6417        let mut query = self.selection.select("withNewDirectory");
6418        query = query.arg("path", path.into());
6419        Directory {
6420            proc: self.proc.clone(),
6421            selection: query,
6422            graphql_client: self.graphql_client.clone(),
6423        }
6424    }
6425    /// Retrieves this directory plus a new directory created at the given path.
6426    ///
6427    /// # Arguments
6428    ///
6429    /// * `path` - Location of the directory created (e.g., "/logs").
6430    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6431    pub fn with_new_directory_opts(
6432        &self,
6433        path: impl Into<String>,
6434        opts: DirectoryWithNewDirectoryOpts,
6435    ) -> Directory {
6436        let mut query = self.selection.select("withNewDirectory");
6437        query = query.arg("path", path.into());
6438        if let Some(permissions) = opts.permissions {
6439            query = query.arg("permissions", permissions);
6440        }
6441        Directory {
6442            proc: self.proc.clone(),
6443            selection: query,
6444            graphql_client: self.graphql_client.clone(),
6445        }
6446    }
6447    /// Return a snapshot with a new file added
6448    ///
6449    /// # Arguments
6450    ///
6451    /// * `path` - Path of the new file. Example: "foo/bar.txt"
6452    /// * `contents` - Contents of the new file. Example: "Hello world!"
6453    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6454    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
6455        let mut query = self.selection.select("withNewFile");
6456        query = query.arg("path", path.into());
6457        query = query.arg("contents", contents.into());
6458        Directory {
6459            proc: self.proc.clone(),
6460            selection: query,
6461            graphql_client: self.graphql_client.clone(),
6462        }
6463    }
6464    /// Return a snapshot with a new file added
6465    ///
6466    /// # Arguments
6467    ///
6468    /// * `path` - Path of the new file. Example: "foo/bar.txt"
6469    /// * `contents` - Contents of the new file. Example: "Hello world!"
6470    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6471    pub fn with_new_file_opts(
6472        &self,
6473        path: impl Into<String>,
6474        contents: impl Into<String>,
6475        opts: DirectoryWithNewFileOpts,
6476    ) -> Directory {
6477        let mut query = self.selection.select("withNewFile");
6478        query = query.arg("path", path.into());
6479        query = query.arg("contents", contents.into());
6480        if let Some(permissions) = opts.permissions {
6481            query = query.arg("permissions", permissions);
6482        }
6483        Directory {
6484            proc: self.proc.clone(),
6485            selection: query,
6486            graphql_client: self.graphql_client.clone(),
6487        }
6488    }
6489    /// Retrieves this directory with the given Git-compatible patch applied.
6490    ///
6491    /// # Arguments
6492    ///
6493    /// * `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").
6494    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
6495        let mut query = self.selection.select("withPatch");
6496        query = query.arg("patch", patch.into());
6497        Directory {
6498            proc: self.proc.clone(),
6499            selection: query,
6500            graphql_client: self.graphql_client.clone(),
6501        }
6502    }
6503    /// Retrieves this directory with the given Git-compatible patch file applied.
6504    ///
6505    /// # Arguments
6506    ///
6507    /// * `patch` - File containing the patch to apply
6508    pub fn with_patch_file(&self, patch: impl IntoID<FileId>) -> Directory {
6509        let mut query = self.selection.select("withPatchFile");
6510        query = query.arg_lazy(
6511            "patch",
6512            Box::new(move || {
6513                let patch = patch.clone();
6514                Box::pin(async move { patch.into_id().await.unwrap().quote() })
6515            }),
6516        );
6517        Directory {
6518            proc: self.proc.clone(),
6519            selection: query,
6520            graphql_client: self.graphql_client.clone(),
6521        }
6522    }
6523    /// Return a snapshot with a symlink
6524    ///
6525    /// # Arguments
6526    ///
6527    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
6528    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
6529    pub fn with_symlink(
6530        &self,
6531        target: impl Into<String>,
6532        link_name: impl Into<String>,
6533    ) -> Directory {
6534        let mut query = self.selection.select("withSymlink");
6535        query = query.arg("target", target.into());
6536        query = query.arg("linkName", link_name.into());
6537        Directory {
6538            proc: self.proc.clone(),
6539            selection: query,
6540            graphql_client: self.graphql_client.clone(),
6541        }
6542    }
6543    /// Retrieves this directory with all file/dir timestamps set to the given time.
6544    ///
6545    /// # Arguments
6546    ///
6547    /// * `timestamp` - Timestamp to set dir/files in.
6548    ///
6549    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
6550    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
6551        let mut query = self.selection.select("withTimestamps");
6552        query = query.arg("timestamp", timestamp);
6553        Directory {
6554            proc: self.proc.clone(),
6555            selection: query,
6556            graphql_client: self.graphql_client.clone(),
6557        }
6558    }
6559    /// Return a snapshot with a subdirectory removed
6560    ///
6561    /// # Arguments
6562    ///
6563    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
6564    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
6565        let mut query = self.selection.select("withoutDirectory");
6566        query = query.arg("path", path.into());
6567        Directory {
6568            proc: self.proc.clone(),
6569            selection: query,
6570            graphql_client: self.graphql_client.clone(),
6571        }
6572    }
6573    /// Return a snapshot with a file removed
6574    ///
6575    /// # Arguments
6576    ///
6577    /// * `path` - Path of the file to remove (e.g., "/file.txt").
6578    pub fn without_file(&self, path: impl Into<String>) -> Directory {
6579        let mut query = self.selection.select("withoutFile");
6580        query = query.arg("path", path.into());
6581        Directory {
6582            proc: self.proc.clone(),
6583            selection: query,
6584            graphql_client: self.graphql_client.clone(),
6585        }
6586    }
6587    /// Return a snapshot with files removed
6588    ///
6589    /// # Arguments
6590    ///
6591    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
6592    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
6593        let mut query = self.selection.select("withoutFiles");
6594        query = query.arg(
6595            "paths",
6596            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
6597        );
6598        Directory {
6599            proc: self.proc.clone(),
6600            selection: query,
6601            graphql_client: self.graphql_client.clone(),
6602        }
6603    }
6604}
6605#[derive(Clone)]
6606pub struct Engine {
6607    pub proc: Option<Arc<DaggerSessionProc>>,
6608    pub selection: Selection,
6609    pub graphql_client: DynGraphQLClient,
6610}
6611impl Engine {
6612    /// The list of connected client IDs
6613    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
6614        let query = self.selection.select("clients");
6615        query.execute(self.graphql_client.clone()).await
6616    }
6617    /// A unique identifier for this Engine.
6618    pub async fn id(&self) -> Result<EngineId, DaggerError> {
6619        let query = self.selection.select("id");
6620        query.execute(self.graphql_client.clone()).await
6621    }
6622    /// The local (on-disk) cache for the Dagger engine
6623    pub fn local_cache(&self) -> EngineCache {
6624        let query = self.selection.select("localCache");
6625        EngineCache {
6626            proc: self.proc.clone(),
6627            selection: query,
6628            graphql_client: self.graphql_client.clone(),
6629        }
6630    }
6631    /// The name of the engine instance.
6632    pub async fn name(&self) -> Result<String, DaggerError> {
6633        let query = self.selection.select("name");
6634        query.execute(self.graphql_client.clone()).await
6635    }
6636}
6637#[derive(Clone)]
6638pub struct EngineCache {
6639    pub proc: Option<Arc<DaggerSessionProc>>,
6640    pub selection: Selection,
6641    pub graphql_client: DynGraphQLClient,
6642}
6643#[derive(Builder, Debug, PartialEq)]
6644pub struct EngineCacheEntrySetOpts<'a> {
6645    #[builder(setter(into, strip_option), default)]
6646    pub key: Option<&'a str>,
6647}
6648#[derive(Builder, Debug, PartialEq)]
6649pub struct EngineCachePruneOpts<'a> {
6650    /// Override the maximum disk space to keep before pruning (e.g. "200GB" or "80%").
6651    #[builder(setter(into, strip_option), default)]
6652    pub max_used_space: Option<&'a str>,
6653    /// Override the minimum free disk space target during pruning (e.g. "20GB" or "20%").
6654    #[builder(setter(into, strip_option), default)]
6655    pub min_free_space: Option<&'a str>,
6656    /// Override the minimum disk space to retain during pruning (e.g. "500GB" or "10%").
6657    #[builder(setter(into, strip_option), default)]
6658    pub reserved_space: Option<&'a str>,
6659    /// Override the target disk space to keep after pruning (e.g. "200GB" or "50%").
6660    #[builder(setter(into, strip_option), default)]
6661    pub target_space: Option<&'a str>,
6662    /// Use the engine-wide default pruning policy if true, otherwise prune the whole cache of any releasable entries.
6663    #[builder(setter(into, strip_option), default)]
6664    pub use_default_policy: Option<bool>,
6665}
6666impl EngineCache {
6667    /// The current set of entries in the cache
6668    ///
6669    /// # Arguments
6670    ///
6671    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6672    pub fn entry_set(&self) -> EngineCacheEntrySet {
6673        let query = self.selection.select("entrySet");
6674        EngineCacheEntrySet {
6675            proc: self.proc.clone(),
6676            selection: query,
6677            graphql_client: self.graphql_client.clone(),
6678        }
6679    }
6680    /// The current set of entries in the cache
6681    ///
6682    /// # Arguments
6683    ///
6684    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6685    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
6686        let mut query = self.selection.select("entrySet");
6687        if let Some(key) = opts.key {
6688            query = query.arg("key", key);
6689        }
6690        EngineCacheEntrySet {
6691            proc: self.proc.clone(),
6692            selection: query,
6693            graphql_client: self.graphql_client.clone(),
6694        }
6695    }
6696    /// A unique identifier for this EngineCache.
6697    pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
6698        let query = self.selection.select("id");
6699        query.execute(self.graphql_client.clone()).await
6700    }
6701    /// The maximum bytes to keep in the cache without pruning.
6702    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
6703        let query = self.selection.select("maxUsedSpace");
6704        query.execute(self.graphql_client.clone()).await
6705    }
6706    /// The target amount of free disk space the garbage collector will attempt to leave.
6707    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
6708        let query = self.selection.select("minFreeSpace");
6709        query.execute(self.graphql_client.clone()).await
6710    }
6711    /// Prune the cache of releaseable entries
6712    ///
6713    /// # Arguments
6714    ///
6715    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6716    pub async fn prune(&self) -> Result<Void, DaggerError> {
6717        let query = self.selection.select("prune");
6718        query.execute(self.graphql_client.clone()).await
6719    }
6720    /// Prune the cache of releaseable entries
6721    ///
6722    /// # Arguments
6723    ///
6724    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6725    pub async fn prune_opts<'a>(
6726        &self,
6727        opts: EngineCachePruneOpts<'a>,
6728    ) -> Result<Void, DaggerError> {
6729        let mut query = self.selection.select("prune");
6730        if let Some(use_default_policy) = opts.use_default_policy {
6731            query = query.arg("useDefaultPolicy", use_default_policy);
6732        }
6733        if let Some(max_used_space) = opts.max_used_space {
6734            query = query.arg("maxUsedSpace", max_used_space);
6735        }
6736        if let Some(reserved_space) = opts.reserved_space {
6737            query = query.arg("reservedSpace", reserved_space);
6738        }
6739        if let Some(min_free_space) = opts.min_free_space {
6740            query = query.arg("minFreeSpace", min_free_space);
6741        }
6742        if let Some(target_space) = opts.target_space {
6743            query = query.arg("targetSpace", target_space);
6744        }
6745        query.execute(self.graphql_client.clone()).await
6746    }
6747    /// The minimum amount of disk space this policy is guaranteed to retain.
6748    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
6749        let query = self.selection.select("reservedSpace");
6750        query.execute(self.graphql_client.clone()).await
6751    }
6752    /// The target number of bytes to keep when pruning.
6753    pub async fn target_space(&self) -> Result<isize, DaggerError> {
6754        let query = self.selection.select("targetSpace");
6755        query.execute(self.graphql_client.clone()).await
6756    }
6757}
6758#[derive(Clone)]
6759pub struct EngineCacheEntry {
6760    pub proc: Option<Arc<DaggerSessionProc>>,
6761    pub selection: Selection,
6762    pub graphql_client: DynGraphQLClient,
6763}
6764impl EngineCacheEntry {
6765    /// Whether the cache entry is actively being used.
6766    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
6767        let query = self.selection.select("activelyUsed");
6768        query.execute(self.graphql_client.clone()).await
6769    }
6770    /// The time the cache entry was created, in Unix nanoseconds.
6771    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
6772        let query = self.selection.select("createdTimeUnixNano");
6773        query.execute(self.graphql_client.clone()).await
6774    }
6775    /// The description of the cache entry.
6776    pub async fn description(&self) -> Result<String, DaggerError> {
6777        let query = self.selection.select("description");
6778        query.execute(self.graphql_client.clone()).await
6779    }
6780    /// The disk space used by the cache entry.
6781    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6782        let query = self.selection.select("diskSpaceBytes");
6783        query.execute(self.graphql_client.clone()).await
6784    }
6785    /// A unique identifier for this EngineCacheEntry.
6786    pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
6787        let query = self.selection.select("id");
6788        query.execute(self.graphql_client.clone()).await
6789    }
6790    /// The most recent time the cache entry was used, in Unix nanoseconds.
6791    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
6792        let query = self.selection.select("mostRecentUseTimeUnixNano");
6793        query.execute(self.graphql_client.clone()).await
6794    }
6795    /// The type of the cache record (e.g. regular, internal, frontend, source.local, source.git.checkout, exec.cachemount).
6796    pub async fn record_type(&self) -> Result<String, DaggerError> {
6797        let query = self.selection.select("recordType");
6798        query.execute(self.graphql_client.clone()).await
6799    }
6800}
6801#[derive(Clone)]
6802pub struct EngineCacheEntrySet {
6803    pub proc: Option<Arc<DaggerSessionProc>>,
6804    pub selection: Selection,
6805    pub graphql_client: DynGraphQLClient,
6806}
6807impl EngineCacheEntrySet {
6808    /// The total disk space used by the cache entries in this set.
6809    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6810        let query = self.selection.select("diskSpaceBytes");
6811        query.execute(self.graphql_client.clone()).await
6812    }
6813    /// The list of individual cache entries in the set
6814    pub fn entries(&self) -> Vec<EngineCacheEntry> {
6815        let query = self.selection.select("entries");
6816        vec![EngineCacheEntry {
6817            proc: self.proc.clone(),
6818            selection: query,
6819            graphql_client: self.graphql_client.clone(),
6820        }]
6821    }
6822    /// The number of cache entries in this set.
6823    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6824        let query = self.selection.select("entryCount");
6825        query.execute(self.graphql_client.clone()).await
6826    }
6827    /// A unique identifier for this EngineCacheEntrySet.
6828    pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
6829        let query = self.selection.select("id");
6830        query.execute(self.graphql_client.clone()).await
6831    }
6832}
6833#[derive(Clone)]
6834pub struct EnumTypeDef {
6835    pub proc: Option<Arc<DaggerSessionProc>>,
6836    pub selection: Selection,
6837    pub graphql_client: DynGraphQLClient,
6838}
6839impl EnumTypeDef {
6840    /// A doc string for the enum, if any.
6841    pub async fn description(&self) -> Result<String, DaggerError> {
6842        let query = self.selection.select("description");
6843        query.execute(self.graphql_client.clone()).await
6844    }
6845    /// A unique identifier for this EnumTypeDef.
6846    pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
6847        let query = self.selection.select("id");
6848        query.execute(self.graphql_client.clone()).await
6849    }
6850    /// The members of the enum.
6851    pub fn members(&self) -> Vec<EnumValueTypeDef> {
6852        let query = self.selection.select("members");
6853        vec![EnumValueTypeDef {
6854            proc: self.proc.clone(),
6855            selection: query,
6856            graphql_client: self.graphql_client.clone(),
6857        }]
6858    }
6859    /// The name of the enum.
6860    pub async fn name(&self) -> Result<String, DaggerError> {
6861        let query = self.selection.select("name");
6862        query.execute(self.graphql_client.clone()).await
6863    }
6864    /// The location of this enum declaration.
6865    pub fn source_map(&self) -> SourceMap {
6866        let query = self.selection.select("sourceMap");
6867        SourceMap {
6868            proc: self.proc.clone(),
6869            selection: query,
6870            graphql_client: self.graphql_client.clone(),
6871        }
6872    }
6873    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
6874    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6875        let query = self.selection.select("sourceModuleName");
6876        query.execute(self.graphql_client.clone()).await
6877    }
6878    pub fn values(&self) -> Vec<EnumValueTypeDef> {
6879        let query = self.selection.select("values");
6880        vec![EnumValueTypeDef {
6881            proc: self.proc.clone(),
6882            selection: query,
6883            graphql_client: self.graphql_client.clone(),
6884        }]
6885    }
6886}
6887#[derive(Clone)]
6888pub struct EnumValueTypeDef {
6889    pub proc: Option<Arc<DaggerSessionProc>>,
6890    pub selection: Selection,
6891    pub graphql_client: DynGraphQLClient,
6892}
6893impl EnumValueTypeDef {
6894    /// The reason this enum member is deprecated, if any.
6895    pub async fn deprecated(&self) -> Result<String, DaggerError> {
6896        let query = self.selection.select("deprecated");
6897        query.execute(self.graphql_client.clone()).await
6898    }
6899    /// A doc string for the enum member, if any.
6900    pub async fn description(&self) -> Result<String, DaggerError> {
6901        let query = self.selection.select("description");
6902        query.execute(self.graphql_client.clone()).await
6903    }
6904    /// A unique identifier for this EnumValueTypeDef.
6905    pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
6906        let query = self.selection.select("id");
6907        query.execute(self.graphql_client.clone()).await
6908    }
6909    /// The name of the enum member.
6910    pub async fn name(&self) -> Result<String, DaggerError> {
6911        let query = self.selection.select("name");
6912        query.execute(self.graphql_client.clone()).await
6913    }
6914    /// The location of this enum member declaration.
6915    pub fn source_map(&self) -> SourceMap {
6916        let query = self.selection.select("sourceMap");
6917        SourceMap {
6918            proc: self.proc.clone(),
6919            selection: query,
6920            graphql_client: self.graphql_client.clone(),
6921        }
6922    }
6923    /// The value of the enum member
6924    pub async fn value(&self) -> Result<String, DaggerError> {
6925        let query = self.selection.select("value");
6926        query.execute(self.graphql_client.clone()).await
6927    }
6928}
6929#[derive(Clone)]
6930pub struct Env {
6931    pub proc: Option<Arc<DaggerSessionProc>>,
6932    pub selection: Selection,
6933    pub graphql_client: DynGraphQLClient,
6934}
6935#[derive(Builder, Debug, PartialEq)]
6936pub struct EnvChecksOpts<'a> {
6937    /// Only include checks matching the specified patterns
6938    #[builder(setter(into, strip_option), default)]
6939    pub include: Option<Vec<&'a str>>,
6940}
6941impl Env {
6942    /// Return the check with the given name from the installed modules. Must match exactly one check.
6943    ///
6944    /// # Arguments
6945    ///
6946    /// * `name` - The name of the check to retrieve
6947    pub fn check(&self, name: impl Into<String>) -> Check {
6948        let mut query = self.selection.select("check");
6949        query = query.arg("name", name.into());
6950        Check {
6951            proc: self.proc.clone(),
6952            selection: query,
6953            graphql_client: self.graphql_client.clone(),
6954        }
6955    }
6956    /// Return all checks defined by the installed modules
6957    ///
6958    /// # Arguments
6959    ///
6960    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6961    pub fn checks(&self) -> CheckGroup {
6962        let query = self.selection.select("checks");
6963        CheckGroup {
6964            proc: self.proc.clone(),
6965            selection: query,
6966            graphql_client: self.graphql_client.clone(),
6967        }
6968    }
6969    /// Return all checks defined by the installed modules
6970    ///
6971    /// # Arguments
6972    ///
6973    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6974    pub fn checks_opts<'a>(&self, opts: EnvChecksOpts<'a>) -> CheckGroup {
6975        let mut query = self.selection.select("checks");
6976        if let Some(include) = opts.include {
6977            query = query.arg("include", include);
6978        }
6979        CheckGroup {
6980            proc: self.proc.clone(),
6981            selection: query,
6982            graphql_client: self.graphql_client.clone(),
6983        }
6984    }
6985    /// A unique identifier for this Env.
6986    pub async fn id(&self) -> Result<EnvId, DaggerError> {
6987        let query = self.selection.select("id");
6988        query.execute(self.graphql_client.clone()).await
6989    }
6990    /// Retrieves an input binding by name
6991    pub fn input(&self, name: impl Into<String>) -> Binding {
6992        let mut query = self.selection.select("input");
6993        query = query.arg("name", name.into());
6994        Binding {
6995            proc: self.proc.clone(),
6996            selection: query,
6997            graphql_client: self.graphql_client.clone(),
6998        }
6999    }
7000    /// Returns all input bindings provided to the environment
7001    pub fn inputs(&self) -> Vec<Binding> {
7002        let query = self.selection.select("inputs");
7003        vec![Binding {
7004            proc: self.proc.clone(),
7005            selection: query,
7006            graphql_client: self.graphql_client.clone(),
7007        }]
7008    }
7009    /// Retrieves an output binding by name
7010    pub fn output(&self, name: impl Into<String>) -> Binding {
7011        let mut query = self.selection.select("output");
7012        query = query.arg("name", name.into());
7013        Binding {
7014            proc: self.proc.clone(),
7015            selection: query,
7016            graphql_client: self.graphql_client.clone(),
7017        }
7018    }
7019    /// Returns all declared output bindings for the environment
7020    pub fn outputs(&self) -> Vec<Binding> {
7021        let query = self.selection.select("outputs");
7022        vec![Binding {
7023            proc: self.proc.clone(),
7024            selection: query,
7025            graphql_client: self.graphql_client.clone(),
7026        }]
7027    }
7028    /// Create or update a binding of type Address in the environment
7029    ///
7030    /// # Arguments
7031    ///
7032    /// * `name` - The name of the binding
7033    /// * `value` - The Address value to assign to the binding
7034    /// * `description` - The purpose of the input
7035    pub fn with_address_input(
7036        &self,
7037        name: impl Into<String>,
7038        value: impl IntoID<AddressId>,
7039        description: impl Into<String>,
7040    ) -> Env {
7041        let mut query = self.selection.select("withAddressInput");
7042        query = query.arg("name", name.into());
7043        query = query.arg_lazy(
7044            "value",
7045            Box::new(move || {
7046                let value = value.clone();
7047                Box::pin(async move { value.into_id().await.unwrap().quote() })
7048            }),
7049        );
7050        query = query.arg("description", description.into());
7051        Env {
7052            proc: self.proc.clone(),
7053            selection: query,
7054            graphql_client: self.graphql_client.clone(),
7055        }
7056    }
7057    /// Declare a desired Address output to be assigned in the environment
7058    ///
7059    /// # Arguments
7060    ///
7061    /// * `name` - The name of the binding
7062    /// * `description` - A description of the desired value of the binding
7063    pub fn with_address_output(
7064        &self,
7065        name: impl Into<String>,
7066        description: impl Into<String>,
7067    ) -> Env {
7068        let mut query = self.selection.select("withAddressOutput");
7069        query = query.arg("name", name.into());
7070        query = query.arg("description", description.into());
7071        Env {
7072            proc: self.proc.clone(),
7073            selection: query,
7074            graphql_client: self.graphql_client.clone(),
7075        }
7076    }
7077    /// Create or update a binding of type CacheVolume in the environment
7078    ///
7079    /// # Arguments
7080    ///
7081    /// * `name` - The name of the binding
7082    /// * `value` - The CacheVolume value to assign to the binding
7083    /// * `description` - The purpose of the input
7084    pub fn with_cache_volume_input(
7085        &self,
7086        name: impl Into<String>,
7087        value: impl IntoID<CacheVolumeId>,
7088        description: impl Into<String>,
7089    ) -> Env {
7090        let mut query = self.selection.select("withCacheVolumeInput");
7091        query = query.arg("name", name.into());
7092        query = query.arg_lazy(
7093            "value",
7094            Box::new(move || {
7095                let value = value.clone();
7096                Box::pin(async move { value.into_id().await.unwrap().quote() })
7097            }),
7098        );
7099        query = query.arg("description", description.into());
7100        Env {
7101            proc: self.proc.clone(),
7102            selection: query,
7103            graphql_client: self.graphql_client.clone(),
7104        }
7105    }
7106    /// Declare a desired CacheVolume output to be assigned in the environment
7107    ///
7108    /// # Arguments
7109    ///
7110    /// * `name` - The name of the binding
7111    /// * `description` - A description of the desired value of the binding
7112    pub fn with_cache_volume_output(
7113        &self,
7114        name: impl Into<String>,
7115        description: impl Into<String>,
7116    ) -> Env {
7117        let mut query = self.selection.select("withCacheVolumeOutput");
7118        query = query.arg("name", name.into());
7119        query = query.arg("description", description.into());
7120        Env {
7121            proc: self.proc.clone(),
7122            selection: query,
7123            graphql_client: self.graphql_client.clone(),
7124        }
7125    }
7126    /// Create or update a binding of type Changeset in the environment
7127    ///
7128    /// # Arguments
7129    ///
7130    /// * `name` - The name of the binding
7131    /// * `value` - The Changeset value to assign to the binding
7132    /// * `description` - The purpose of the input
7133    pub fn with_changeset_input(
7134        &self,
7135        name: impl Into<String>,
7136        value: impl IntoID<ChangesetId>,
7137        description: impl Into<String>,
7138    ) -> Env {
7139        let mut query = self.selection.select("withChangesetInput");
7140        query = query.arg("name", name.into());
7141        query = query.arg_lazy(
7142            "value",
7143            Box::new(move || {
7144                let value = value.clone();
7145                Box::pin(async move { value.into_id().await.unwrap().quote() })
7146            }),
7147        );
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    /// Declare a desired Changeset output to be assigned in the environment
7156    ///
7157    /// # Arguments
7158    ///
7159    /// * `name` - The name of the binding
7160    /// * `description` - A description of the desired value of the binding
7161    pub fn with_changeset_output(
7162        &self,
7163        name: impl Into<String>,
7164        description: impl Into<String>,
7165    ) -> Env {
7166        let mut query = self.selection.select("withChangesetOutput");
7167        query = query.arg("name", name.into());
7168        query = query.arg("description", description.into());
7169        Env {
7170            proc: self.proc.clone(),
7171            selection: query,
7172            graphql_client: self.graphql_client.clone(),
7173        }
7174    }
7175    /// Create or update a binding of type CheckGroup in the environment
7176    ///
7177    /// # Arguments
7178    ///
7179    /// * `name` - The name of the binding
7180    /// * `value` - The CheckGroup value to assign to the binding
7181    /// * `description` - The purpose of the input
7182    pub fn with_check_group_input(
7183        &self,
7184        name: impl Into<String>,
7185        value: impl IntoID<CheckGroupId>,
7186        description: impl Into<String>,
7187    ) -> Env {
7188        let mut query = self.selection.select("withCheckGroupInput");
7189        query = query.arg("name", name.into());
7190        query = query.arg_lazy(
7191            "value",
7192            Box::new(move || {
7193                let value = value.clone();
7194                Box::pin(async move { value.into_id().await.unwrap().quote() })
7195            }),
7196        );
7197        query = query.arg("description", description.into());
7198        Env {
7199            proc: self.proc.clone(),
7200            selection: query,
7201            graphql_client: self.graphql_client.clone(),
7202        }
7203    }
7204    /// Declare a desired CheckGroup output to be assigned in the environment
7205    ///
7206    /// # Arguments
7207    ///
7208    /// * `name` - The name of the binding
7209    /// * `description` - A description of the desired value of the binding
7210    pub fn with_check_group_output(
7211        &self,
7212        name: impl Into<String>,
7213        description: impl Into<String>,
7214    ) -> Env {
7215        let mut query = self.selection.select("withCheckGroupOutput");
7216        query = query.arg("name", name.into());
7217        query = query.arg("description", description.into());
7218        Env {
7219            proc: self.proc.clone(),
7220            selection: query,
7221            graphql_client: self.graphql_client.clone(),
7222        }
7223    }
7224    /// Create or update a binding of type Check in the environment
7225    ///
7226    /// # Arguments
7227    ///
7228    /// * `name` - The name of the binding
7229    /// * `value` - The Check value to assign to the binding
7230    /// * `description` - The purpose of the input
7231    pub fn with_check_input(
7232        &self,
7233        name: impl Into<String>,
7234        value: impl IntoID<CheckId>,
7235        description: impl Into<String>,
7236    ) -> Env {
7237        let mut query = self.selection.select("withCheckInput");
7238        query = query.arg("name", name.into());
7239        query = query.arg_lazy(
7240            "value",
7241            Box::new(move || {
7242                let value = value.clone();
7243                Box::pin(async move { value.into_id().await.unwrap().quote() })
7244            }),
7245        );
7246        query = query.arg("description", description.into());
7247        Env {
7248            proc: self.proc.clone(),
7249            selection: query,
7250            graphql_client: self.graphql_client.clone(),
7251        }
7252    }
7253    /// Declare a desired Check output to be assigned in the environment
7254    ///
7255    /// # Arguments
7256    ///
7257    /// * `name` - The name of the binding
7258    /// * `description` - A description of the desired value of the binding
7259    pub fn with_check_output(
7260        &self,
7261        name: impl Into<String>,
7262        description: impl Into<String>,
7263    ) -> Env {
7264        let mut query = self.selection.select("withCheckOutput");
7265        query = query.arg("name", name.into());
7266        query = query.arg("description", description.into());
7267        Env {
7268            proc: self.proc.clone(),
7269            selection: query,
7270            graphql_client: self.graphql_client.clone(),
7271        }
7272    }
7273    /// Create or update a binding of type Cloud in the environment
7274    ///
7275    /// # Arguments
7276    ///
7277    /// * `name` - The name of the binding
7278    /// * `value` - The Cloud value to assign to the binding
7279    /// * `description` - The purpose of the input
7280    pub fn with_cloud_input(
7281        &self,
7282        name: impl Into<String>,
7283        value: impl IntoID<CloudId>,
7284        description: impl Into<String>,
7285    ) -> Env {
7286        let mut query = self.selection.select("withCloudInput");
7287        query = query.arg("name", name.into());
7288        query = query.arg_lazy(
7289            "value",
7290            Box::new(move || {
7291                let value = value.clone();
7292                Box::pin(async move { value.into_id().await.unwrap().quote() })
7293            }),
7294        );
7295        query = query.arg("description", description.into());
7296        Env {
7297            proc: self.proc.clone(),
7298            selection: query,
7299            graphql_client: self.graphql_client.clone(),
7300        }
7301    }
7302    /// Declare a desired Cloud output to be assigned in the environment
7303    ///
7304    /// # Arguments
7305    ///
7306    /// * `name` - The name of the binding
7307    /// * `description` - A description of the desired value of the binding
7308    pub fn with_cloud_output(
7309        &self,
7310        name: impl Into<String>,
7311        description: impl Into<String>,
7312    ) -> Env {
7313        let mut query = self.selection.select("withCloudOutput");
7314        query = query.arg("name", name.into());
7315        query = query.arg("description", description.into());
7316        Env {
7317            proc: self.proc.clone(),
7318            selection: query,
7319            graphql_client: self.graphql_client.clone(),
7320        }
7321    }
7322    /// Create or update a binding of type Container in the environment
7323    ///
7324    /// # Arguments
7325    ///
7326    /// * `name` - The name of the binding
7327    /// * `value` - The Container value to assign to the binding
7328    /// * `description` - The purpose of the input
7329    pub fn with_container_input(
7330        &self,
7331        name: impl Into<String>,
7332        value: impl IntoID<ContainerId>,
7333        description: impl Into<String>,
7334    ) -> Env {
7335        let mut query = self.selection.select("withContainerInput");
7336        query = query.arg("name", name.into());
7337        query = query.arg_lazy(
7338            "value",
7339            Box::new(move || {
7340                let value = value.clone();
7341                Box::pin(async move { value.into_id().await.unwrap().quote() })
7342            }),
7343        );
7344        query = query.arg("description", description.into());
7345        Env {
7346            proc: self.proc.clone(),
7347            selection: query,
7348            graphql_client: self.graphql_client.clone(),
7349        }
7350    }
7351    /// Declare a desired Container output to be assigned in the environment
7352    ///
7353    /// # Arguments
7354    ///
7355    /// * `name` - The name of the binding
7356    /// * `description` - A description of the desired value of the binding
7357    pub fn with_container_output(
7358        &self,
7359        name: impl Into<String>,
7360        description: impl Into<String>,
7361    ) -> Env {
7362        let mut query = self.selection.select("withContainerOutput");
7363        query = query.arg("name", name.into());
7364        query = query.arg("description", description.into());
7365        Env {
7366            proc: self.proc.clone(),
7367            selection: query,
7368            graphql_client: self.graphql_client.clone(),
7369        }
7370    }
7371    /// Installs the current module into the environment, exposing its functions to the model
7372    /// Contextual path arguments will be populated using the environment's workspace.
7373    pub fn with_current_module(&self) -> Env {
7374        let query = self.selection.select("withCurrentModule");
7375        Env {
7376            proc: self.proc.clone(),
7377            selection: query,
7378            graphql_client: self.graphql_client.clone(),
7379        }
7380    }
7381    /// Create or update a binding of type Directory in the environment
7382    ///
7383    /// # Arguments
7384    ///
7385    /// * `name` - The name of the binding
7386    /// * `value` - The Directory value to assign to the binding
7387    /// * `description` - The purpose of the input
7388    pub fn with_directory_input(
7389        &self,
7390        name: impl Into<String>,
7391        value: impl IntoID<DirectoryId>,
7392        description: impl Into<String>,
7393    ) -> Env {
7394        let mut query = self.selection.select("withDirectoryInput");
7395        query = query.arg("name", name.into());
7396        query = query.arg_lazy(
7397            "value",
7398            Box::new(move || {
7399                let value = value.clone();
7400                Box::pin(async move { value.into_id().await.unwrap().quote() })
7401            }),
7402        );
7403        query = query.arg("description", description.into());
7404        Env {
7405            proc: self.proc.clone(),
7406            selection: query,
7407            graphql_client: self.graphql_client.clone(),
7408        }
7409    }
7410    /// Declare a desired Directory output to be assigned in the environment
7411    ///
7412    /// # Arguments
7413    ///
7414    /// * `name` - The name of the binding
7415    /// * `description` - A description of the desired value of the binding
7416    pub fn with_directory_output(
7417        &self,
7418        name: impl Into<String>,
7419        description: impl Into<String>,
7420    ) -> Env {
7421        let mut query = self.selection.select("withDirectoryOutput");
7422        query = query.arg("name", name.into());
7423        query = query.arg("description", description.into());
7424        Env {
7425            proc: self.proc.clone(),
7426            selection: query,
7427            graphql_client: self.graphql_client.clone(),
7428        }
7429    }
7430    /// Create or update a binding of type EnvFile in the environment
7431    ///
7432    /// # Arguments
7433    ///
7434    /// * `name` - The name of the binding
7435    /// * `value` - The EnvFile value to assign to the binding
7436    /// * `description` - The purpose of the input
7437    pub fn with_env_file_input(
7438        &self,
7439        name: impl Into<String>,
7440        value: impl IntoID<EnvFileId>,
7441        description: impl Into<String>,
7442    ) -> Env {
7443        let mut query = self.selection.select("withEnvFileInput");
7444        query = query.arg("name", name.into());
7445        query = query.arg_lazy(
7446            "value",
7447            Box::new(move || {
7448                let value = value.clone();
7449                Box::pin(async move { value.into_id().await.unwrap().quote() })
7450            }),
7451        );
7452        query = query.arg("description", description.into());
7453        Env {
7454            proc: self.proc.clone(),
7455            selection: query,
7456            graphql_client: self.graphql_client.clone(),
7457        }
7458    }
7459    /// Declare a desired EnvFile output to be assigned in the environment
7460    ///
7461    /// # Arguments
7462    ///
7463    /// * `name` - The name of the binding
7464    /// * `description` - A description of the desired value of the binding
7465    pub fn with_env_file_output(
7466        &self,
7467        name: impl Into<String>,
7468        description: impl Into<String>,
7469    ) -> Env {
7470        let mut query = self.selection.select("withEnvFileOutput");
7471        query = query.arg("name", name.into());
7472        query = query.arg("description", description.into());
7473        Env {
7474            proc: self.proc.clone(),
7475            selection: query,
7476            graphql_client: self.graphql_client.clone(),
7477        }
7478    }
7479    /// Create or update a binding of type Env in the environment
7480    ///
7481    /// # Arguments
7482    ///
7483    /// * `name` - The name of the binding
7484    /// * `value` - The Env value to assign to the binding
7485    /// * `description` - The purpose of the input
7486    pub fn with_env_input(
7487        &self,
7488        name: impl Into<String>,
7489        value: impl IntoID<EnvId>,
7490        description: impl Into<String>,
7491    ) -> Env {
7492        let mut query = self.selection.select("withEnvInput");
7493        query = query.arg("name", name.into());
7494        query = query.arg_lazy(
7495            "value",
7496            Box::new(move || {
7497                let value = value.clone();
7498                Box::pin(async move { value.into_id().await.unwrap().quote() })
7499            }),
7500        );
7501        query = query.arg("description", description.into());
7502        Env {
7503            proc: self.proc.clone(),
7504            selection: query,
7505            graphql_client: self.graphql_client.clone(),
7506        }
7507    }
7508    /// Declare a desired Env output to be assigned in the environment
7509    ///
7510    /// # Arguments
7511    ///
7512    /// * `name` - The name of the binding
7513    /// * `description` - A description of the desired value of the binding
7514    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7515        let mut query = self.selection.select("withEnvOutput");
7516        query = query.arg("name", name.into());
7517        query = query.arg("description", description.into());
7518        Env {
7519            proc: self.proc.clone(),
7520            selection: query,
7521            graphql_client: self.graphql_client.clone(),
7522        }
7523    }
7524    /// Create or update a binding of type File in the environment
7525    ///
7526    /// # Arguments
7527    ///
7528    /// * `name` - The name of the binding
7529    /// * `value` - The File value to assign to the binding
7530    /// * `description` - The purpose of the input
7531    pub fn with_file_input(
7532        &self,
7533        name: impl Into<String>,
7534        value: impl IntoID<FileId>,
7535        description: impl Into<String>,
7536    ) -> Env {
7537        let mut query = self.selection.select("withFileInput");
7538        query = query.arg("name", name.into());
7539        query = query.arg_lazy(
7540            "value",
7541            Box::new(move || {
7542                let value = value.clone();
7543                Box::pin(async move { value.into_id().await.unwrap().quote() })
7544            }),
7545        );
7546        query = query.arg("description", description.into());
7547        Env {
7548            proc: self.proc.clone(),
7549            selection: query,
7550            graphql_client: self.graphql_client.clone(),
7551        }
7552    }
7553    /// Declare a desired File output to be assigned in the environment
7554    ///
7555    /// # Arguments
7556    ///
7557    /// * `name` - The name of the binding
7558    /// * `description` - A description of the desired value of the binding
7559    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7560        let mut query = self.selection.select("withFileOutput");
7561        query = query.arg("name", name.into());
7562        query = query.arg("description", description.into());
7563        Env {
7564            proc: self.proc.clone(),
7565            selection: query,
7566            graphql_client: self.graphql_client.clone(),
7567        }
7568    }
7569    /// Create or update a binding of type GeneratorGroup in the environment
7570    ///
7571    /// # Arguments
7572    ///
7573    /// * `name` - The name of the binding
7574    /// * `value` - The GeneratorGroup value to assign to the binding
7575    /// * `description` - The purpose of the input
7576    pub fn with_generator_group_input(
7577        &self,
7578        name: impl Into<String>,
7579        value: impl IntoID<GeneratorGroupId>,
7580        description: impl Into<String>,
7581    ) -> Env {
7582        let mut query = self.selection.select("withGeneratorGroupInput");
7583        query = query.arg("name", name.into());
7584        query = query.arg_lazy(
7585            "value",
7586            Box::new(move || {
7587                let value = value.clone();
7588                Box::pin(async move { value.into_id().await.unwrap().quote() })
7589            }),
7590        );
7591        query = query.arg("description", description.into());
7592        Env {
7593            proc: self.proc.clone(),
7594            selection: query,
7595            graphql_client: self.graphql_client.clone(),
7596        }
7597    }
7598    /// Declare a desired GeneratorGroup output to be assigned in the environment
7599    ///
7600    /// # Arguments
7601    ///
7602    /// * `name` - The name of the binding
7603    /// * `description` - A description of the desired value of the binding
7604    pub fn with_generator_group_output(
7605        &self,
7606        name: impl Into<String>,
7607        description: impl Into<String>,
7608    ) -> Env {
7609        let mut query = self.selection.select("withGeneratorGroupOutput");
7610        query = query.arg("name", name.into());
7611        query = query.arg("description", description.into());
7612        Env {
7613            proc: self.proc.clone(),
7614            selection: query,
7615            graphql_client: self.graphql_client.clone(),
7616        }
7617    }
7618    /// Create or update a binding of type Generator in the environment
7619    ///
7620    /// # Arguments
7621    ///
7622    /// * `name` - The name of the binding
7623    /// * `value` - The Generator value to assign to the binding
7624    /// * `description` - The purpose of the input
7625    pub fn with_generator_input(
7626        &self,
7627        name: impl Into<String>,
7628        value: impl IntoID<GeneratorId>,
7629        description: impl Into<String>,
7630    ) -> Env {
7631        let mut query = self.selection.select("withGeneratorInput");
7632        query = query.arg("name", name.into());
7633        query = query.arg_lazy(
7634            "value",
7635            Box::new(move || {
7636                let value = value.clone();
7637                Box::pin(async move { value.into_id().await.unwrap().quote() })
7638            }),
7639        );
7640        query = query.arg("description", description.into());
7641        Env {
7642            proc: self.proc.clone(),
7643            selection: query,
7644            graphql_client: self.graphql_client.clone(),
7645        }
7646    }
7647    /// Declare a desired Generator output to be assigned in the environment
7648    ///
7649    /// # Arguments
7650    ///
7651    /// * `name` - The name of the binding
7652    /// * `description` - A description of the desired value of the binding
7653    pub fn with_generator_output(
7654        &self,
7655        name: impl Into<String>,
7656        description: impl Into<String>,
7657    ) -> Env {
7658        let mut query = self.selection.select("withGeneratorOutput");
7659        query = query.arg("name", name.into());
7660        query = query.arg("description", description.into());
7661        Env {
7662            proc: self.proc.clone(),
7663            selection: query,
7664            graphql_client: self.graphql_client.clone(),
7665        }
7666    }
7667    /// Create or update a binding of type GitRef in the environment
7668    ///
7669    /// # Arguments
7670    ///
7671    /// * `name` - The name of the binding
7672    /// * `value` - The GitRef value to assign to the binding
7673    /// * `description` - The purpose of the input
7674    pub fn with_git_ref_input(
7675        &self,
7676        name: impl Into<String>,
7677        value: impl IntoID<GitRefId>,
7678        description: impl Into<String>,
7679    ) -> Env {
7680        let mut query = self.selection.select("withGitRefInput");
7681        query = query.arg("name", name.into());
7682        query = query.arg_lazy(
7683            "value",
7684            Box::new(move || {
7685                let value = value.clone();
7686                Box::pin(async move { value.into_id().await.unwrap().quote() })
7687            }),
7688        );
7689        query = query.arg("description", description.into());
7690        Env {
7691            proc: self.proc.clone(),
7692            selection: query,
7693            graphql_client: self.graphql_client.clone(),
7694        }
7695    }
7696    /// Declare a desired GitRef output to be assigned in the environment
7697    ///
7698    /// # Arguments
7699    ///
7700    /// * `name` - The name of the binding
7701    /// * `description` - A description of the desired value of the binding
7702    pub fn with_git_ref_output(
7703        &self,
7704        name: impl Into<String>,
7705        description: impl Into<String>,
7706    ) -> Env {
7707        let mut query = self.selection.select("withGitRefOutput");
7708        query = query.arg("name", name.into());
7709        query = query.arg("description", description.into());
7710        Env {
7711            proc: self.proc.clone(),
7712            selection: query,
7713            graphql_client: self.graphql_client.clone(),
7714        }
7715    }
7716    /// Create or update a binding of type GitRepository in the environment
7717    ///
7718    /// # Arguments
7719    ///
7720    /// * `name` - The name of the binding
7721    /// * `value` - The GitRepository value to assign to the binding
7722    /// * `description` - The purpose of the input
7723    pub fn with_git_repository_input(
7724        &self,
7725        name: impl Into<String>,
7726        value: impl IntoID<GitRepositoryId>,
7727        description: impl Into<String>,
7728    ) -> Env {
7729        let mut query = self.selection.select("withGitRepositoryInput");
7730        query = query.arg("name", name.into());
7731        query = query.arg_lazy(
7732            "value",
7733            Box::new(move || {
7734                let value = value.clone();
7735                Box::pin(async move { value.into_id().await.unwrap().quote() })
7736            }),
7737        );
7738        query = query.arg("description", description.into());
7739        Env {
7740            proc: self.proc.clone(),
7741            selection: query,
7742            graphql_client: self.graphql_client.clone(),
7743        }
7744    }
7745    /// Declare a desired GitRepository output to be assigned in the environment
7746    ///
7747    /// # Arguments
7748    ///
7749    /// * `name` - The name of the binding
7750    /// * `description` - A description of the desired value of the binding
7751    pub fn with_git_repository_output(
7752        &self,
7753        name: impl Into<String>,
7754        description: impl Into<String>,
7755    ) -> Env {
7756        let mut query = self.selection.select("withGitRepositoryOutput");
7757        query = query.arg("name", name.into());
7758        query = query.arg("description", description.into());
7759        Env {
7760            proc: self.proc.clone(),
7761            selection: query,
7762            graphql_client: self.graphql_client.clone(),
7763        }
7764    }
7765    /// Create or update a binding of type JSONValue in the environment
7766    ///
7767    /// # Arguments
7768    ///
7769    /// * `name` - The name of the binding
7770    /// * `value` - The JSONValue value to assign to the binding
7771    /// * `description` - The purpose of the input
7772    pub fn with_json_value_input(
7773        &self,
7774        name: impl Into<String>,
7775        value: impl IntoID<JsonValueId>,
7776        description: impl Into<String>,
7777    ) -> Env {
7778        let mut query = self.selection.select("withJSONValueInput");
7779        query = query.arg("name", name.into());
7780        query = query.arg_lazy(
7781            "value",
7782            Box::new(move || {
7783                let value = value.clone();
7784                Box::pin(async move { value.into_id().await.unwrap().quote() })
7785            }),
7786        );
7787        query = query.arg("description", description.into());
7788        Env {
7789            proc: self.proc.clone(),
7790            selection: query,
7791            graphql_client: self.graphql_client.clone(),
7792        }
7793    }
7794    /// Declare a desired JSONValue output to be assigned in the environment
7795    ///
7796    /// # Arguments
7797    ///
7798    /// * `name` - The name of the binding
7799    /// * `description` - A description of the desired value of the binding
7800    pub fn with_json_value_output(
7801        &self,
7802        name: impl Into<String>,
7803        description: impl Into<String>,
7804    ) -> Env {
7805        let mut query = self.selection.select("withJSONValueOutput");
7806        query = query.arg("name", name.into());
7807        query = query.arg("description", description.into());
7808        Env {
7809            proc: self.proc.clone(),
7810            selection: query,
7811            graphql_client: self.graphql_client.clone(),
7812        }
7813    }
7814    /// Sets the main module for this environment (the project being worked on)
7815    /// Contextual path arguments will be populated using the environment's workspace.
7816    pub fn with_main_module(&self, module: impl IntoID<ModuleId>) -> Env {
7817        let mut query = self.selection.select("withMainModule");
7818        query = query.arg_lazy(
7819            "module",
7820            Box::new(move || {
7821                let module = module.clone();
7822                Box::pin(async move { module.into_id().await.unwrap().quote() })
7823            }),
7824        );
7825        Env {
7826            proc: self.proc.clone(),
7827            selection: query,
7828            graphql_client: self.graphql_client.clone(),
7829        }
7830    }
7831    /// Installs a module into the environment, exposing its functions to the model
7832    /// Contextual path arguments will be populated using the environment's workspace.
7833    pub fn with_module(&self, module: impl IntoID<ModuleId>) -> Env {
7834        let mut query = self.selection.select("withModule");
7835        query = query.arg_lazy(
7836            "module",
7837            Box::new(move || {
7838                let module = module.clone();
7839                Box::pin(async move { module.into_id().await.unwrap().quote() })
7840            }),
7841        );
7842        Env {
7843            proc: self.proc.clone(),
7844            selection: query,
7845            graphql_client: self.graphql_client.clone(),
7846        }
7847    }
7848    /// Create or update a binding of type ModuleConfigClient in the environment
7849    ///
7850    /// # Arguments
7851    ///
7852    /// * `name` - The name of the binding
7853    /// * `value` - The ModuleConfigClient value to assign to the binding
7854    /// * `description` - The purpose of the input
7855    pub fn with_module_config_client_input(
7856        &self,
7857        name: impl Into<String>,
7858        value: impl IntoID<ModuleConfigClientId>,
7859        description: impl Into<String>,
7860    ) -> Env {
7861        let mut query = self.selection.select("withModuleConfigClientInput");
7862        query = query.arg("name", name.into());
7863        query = query.arg_lazy(
7864            "value",
7865            Box::new(move || {
7866                let value = value.clone();
7867                Box::pin(async move { value.into_id().await.unwrap().quote() })
7868            }),
7869        );
7870        query = query.arg("description", description.into());
7871        Env {
7872            proc: self.proc.clone(),
7873            selection: query,
7874            graphql_client: self.graphql_client.clone(),
7875        }
7876    }
7877    /// Declare a desired ModuleConfigClient output to be assigned in the environment
7878    ///
7879    /// # Arguments
7880    ///
7881    /// * `name` - The name of the binding
7882    /// * `description` - A description of the desired value of the binding
7883    pub fn with_module_config_client_output(
7884        &self,
7885        name: impl Into<String>,
7886        description: impl Into<String>,
7887    ) -> Env {
7888        let mut query = self.selection.select("withModuleConfigClientOutput");
7889        query = query.arg("name", name.into());
7890        query = query.arg("description", description.into());
7891        Env {
7892            proc: self.proc.clone(),
7893            selection: query,
7894            graphql_client: self.graphql_client.clone(),
7895        }
7896    }
7897    /// Create or update a binding of type Module in the environment
7898    ///
7899    /// # Arguments
7900    ///
7901    /// * `name` - The name of the binding
7902    /// * `value` - The Module value to assign to the binding
7903    /// * `description` - The purpose of the input
7904    pub fn with_module_input(
7905        &self,
7906        name: impl Into<String>,
7907        value: impl IntoID<ModuleId>,
7908        description: impl Into<String>,
7909    ) -> Env {
7910        let mut query = self.selection.select("withModuleInput");
7911        query = query.arg("name", name.into());
7912        query = query.arg_lazy(
7913            "value",
7914            Box::new(move || {
7915                let value = value.clone();
7916                Box::pin(async move { value.into_id().await.unwrap().quote() })
7917            }),
7918        );
7919        query = query.arg("description", description.into());
7920        Env {
7921            proc: self.proc.clone(),
7922            selection: query,
7923            graphql_client: self.graphql_client.clone(),
7924        }
7925    }
7926    /// Declare a desired Module output to be assigned in the environment
7927    ///
7928    /// # Arguments
7929    ///
7930    /// * `name` - The name of the binding
7931    /// * `description` - A description of the desired value of the binding
7932    pub fn with_module_output(
7933        &self,
7934        name: impl Into<String>,
7935        description: impl Into<String>,
7936    ) -> Env {
7937        let mut query = self.selection.select("withModuleOutput");
7938        query = query.arg("name", name.into());
7939        query = query.arg("description", description.into());
7940        Env {
7941            proc: self.proc.clone(),
7942            selection: query,
7943            graphql_client: self.graphql_client.clone(),
7944        }
7945    }
7946    /// Create or update a binding of type ModuleSource in the environment
7947    ///
7948    /// # Arguments
7949    ///
7950    /// * `name` - The name of the binding
7951    /// * `value` - The ModuleSource value to assign to the binding
7952    /// * `description` - The purpose of the input
7953    pub fn with_module_source_input(
7954        &self,
7955        name: impl Into<String>,
7956        value: impl IntoID<ModuleSourceId>,
7957        description: impl Into<String>,
7958    ) -> Env {
7959        let mut query = self.selection.select("withModuleSourceInput");
7960        query = query.arg("name", name.into());
7961        query = query.arg_lazy(
7962            "value",
7963            Box::new(move || {
7964                let value = value.clone();
7965                Box::pin(async move { value.into_id().await.unwrap().quote() })
7966            }),
7967        );
7968        query = query.arg("description", description.into());
7969        Env {
7970            proc: self.proc.clone(),
7971            selection: query,
7972            graphql_client: self.graphql_client.clone(),
7973        }
7974    }
7975    /// Declare a desired ModuleSource output to be assigned in the environment
7976    ///
7977    /// # Arguments
7978    ///
7979    /// * `name` - The name of the binding
7980    /// * `description` - A description of the desired value of the binding
7981    pub fn with_module_source_output(
7982        &self,
7983        name: impl Into<String>,
7984        description: impl Into<String>,
7985    ) -> Env {
7986        let mut query = self.selection.select("withModuleSourceOutput");
7987        query = query.arg("name", name.into());
7988        query = query.arg("description", description.into());
7989        Env {
7990            proc: self.proc.clone(),
7991            selection: query,
7992            graphql_client: self.graphql_client.clone(),
7993        }
7994    }
7995    /// Create or update a binding of type SearchResult in the environment
7996    ///
7997    /// # Arguments
7998    ///
7999    /// * `name` - The name of the binding
8000    /// * `value` - The SearchResult value to assign to the binding
8001    /// * `description` - The purpose of the input
8002    pub fn with_search_result_input(
8003        &self,
8004        name: impl Into<String>,
8005        value: impl IntoID<SearchResultId>,
8006        description: impl Into<String>,
8007    ) -> Env {
8008        let mut query = self.selection.select("withSearchResultInput");
8009        query = query.arg("name", name.into());
8010        query = query.arg_lazy(
8011            "value",
8012            Box::new(move || {
8013                let value = value.clone();
8014                Box::pin(async move { value.into_id().await.unwrap().quote() })
8015            }),
8016        );
8017        query = query.arg("description", description.into());
8018        Env {
8019            proc: self.proc.clone(),
8020            selection: query,
8021            graphql_client: self.graphql_client.clone(),
8022        }
8023    }
8024    /// Declare a desired SearchResult output to be assigned in the environment
8025    ///
8026    /// # Arguments
8027    ///
8028    /// * `name` - The name of the binding
8029    /// * `description` - A description of the desired value of the binding
8030    pub fn with_search_result_output(
8031        &self,
8032        name: impl Into<String>,
8033        description: impl Into<String>,
8034    ) -> Env {
8035        let mut query = self.selection.select("withSearchResultOutput");
8036        query = query.arg("name", name.into());
8037        query = query.arg("description", description.into());
8038        Env {
8039            proc: self.proc.clone(),
8040            selection: query,
8041            graphql_client: self.graphql_client.clone(),
8042        }
8043    }
8044    /// Create or update a binding of type SearchSubmatch in the environment
8045    ///
8046    /// # Arguments
8047    ///
8048    /// * `name` - The name of the binding
8049    /// * `value` - The SearchSubmatch value to assign to the binding
8050    /// * `description` - The purpose of the input
8051    pub fn with_search_submatch_input(
8052        &self,
8053        name: impl Into<String>,
8054        value: impl IntoID<SearchSubmatchId>,
8055        description: impl Into<String>,
8056    ) -> Env {
8057        let mut query = self.selection.select("withSearchSubmatchInput");
8058        query = query.arg("name", name.into());
8059        query = query.arg_lazy(
8060            "value",
8061            Box::new(move || {
8062                let value = value.clone();
8063                Box::pin(async move { value.into_id().await.unwrap().quote() })
8064            }),
8065        );
8066        query = query.arg("description", description.into());
8067        Env {
8068            proc: self.proc.clone(),
8069            selection: query,
8070            graphql_client: self.graphql_client.clone(),
8071        }
8072    }
8073    /// Declare a desired SearchSubmatch output to be assigned in the environment
8074    ///
8075    /// # Arguments
8076    ///
8077    /// * `name` - The name of the binding
8078    /// * `description` - A description of the desired value of the binding
8079    pub fn with_search_submatch_output(
8080        &self,
8081        name: impl Into<String>,
8082        description: impl Into<String>,
8083    ) -> Env {
8084        let mut query = self.selection.select("withSearchSubmatchOutput");
8085        query = query.arg("name", name.into());
8086        query = query.arg("description", description.into());
8087        Env {
8088            proc: self.proc.clone(),
8089            selection: query,
8090            graphql_client: self.graphql_client.clone(),
8091        }
8092    }
8093    /// Create or update a binding of type Secret in the environment
8094    ///
8095    /// # Arguments
8096    ///
8097    /// * `name` - The name of the binding
8098    /// * `value` - The Secret value to assign to the binding
8099    /// * `description` - The purpose of the input
8100    pub fn with_secret_input(
8101        &self,
8102        name: impl Into<String>,
8103        value: impl IntoID<SecretId>,
8104        description: impl Into<String>,
8105    ) -> Env {
8106        let mut query = self.selection.select("withSecretInput");
8107        query = query.arg("name", name.into());
8108        query = query.arg_lazy(
8109            "value",
8110            Box::new(move || {
8111                let value = value.clone();
8112                Box::pin(async move { value.into_id().await.unwrap().quote() })
8113            }),
8114        );
8115        query = query.arg("description", description.into());
8116        Env {
8117            proc: self.proc.clone(),
8118            selection: query,
8119            graphql_client: self.graphql_client.clone(),
8120        }
8121    }
8122    /// Declare a desired Secret output to be assigned in the environment
8123    ///
8124    /// # Arguments
8125    ///
8126    /// * `name` - The name of the binding
8127    /// * `description` - A description of the desired value of the binding
8128    pub fn with_secret_output(
8129        &self,
8130        name: impl Into<String>,
8131        description: impl Into<String>,
8132    ) -> Env {
8133        let mut query = self.selection.select("withSecretOutput");
8134        query = query.arg("name", name.into());
8135        query = query.arg("description", description.into());
8136        Env {
8137            proc: self.proc.clone(),
8138            selection: query,
8139            graphql_client: self.graphql_client.clone(),
8140        }
8141    }
8142    /// Create or update a binding of type Service in the environment
8143    ///
8144    /// # Arguments
8145    ///
8146    /// * `name` - The name of the binding
8147    /// * `value` - The Service value to assign to the binding
8148    /// * `description` - The purpose of the input
8149    pub fn with_service_input(
8150        &self,
8151        name: impl Into<String>,
8152        value: impl IntoID<ServiceId>,
8153        description: impl Into<String>,
8154    ) -> Env {
8155        let mut query = self.selection.select("withServiceInput");
8156        query = query.arg("name", name.into());
8157        query = query.arg_lazy(
8158            "value",
8159            Box::new(move || {
8160                let value = value.clone();
8161                Box::pin(async move { value.into_id().await.unwrap().quote() })
8162            }),
8163        );
8164        query = query.arg("description", description.into());
8165        Env {
8166            proc: self.proc.clone(),
8167            selection: query,
8168            graphql_client: self.graphql_client.clone(),
8169        }
8170    }
8171    /// Declare a desired Service output to be assigned in the environment
8172    ///
8173    /// # Arguments
8174    ///
8175    /// * `name` - The name of the binding
8176    /// * `description` - A description of the desired value of the binding
8177    pub fn with_service_output(
8178        &self,
8179        name: impl Into<String>,
8180        description: impl Into<String>,
8181    ) -> Env {
8182        let mut query = self.selection.select("withServiceOutput");
8183        query = query.arg("name", name.into());
8184        query = query.arg("description", description.into());
8185        Env {
8186            proc: self.proc.clone(),
8187            selection: query,
8188            graphql_client: self.graphql_client.clone(),
8189        }
8190    }
8191    /// Create or update a binding of type Socket in the environment
8192    ///
8193    /// # Arguments
8194    ///
8195    /// * `name` - The name of the binding
8196    /// * `value` - The Socket value to assign to the binding
8197    /// * `description` - The purpose of the input
8198    pub fn with_socket_input(
8199        &self,
8200        name: impl Into<String>,
8201        value: impl IntoID<SocketId>,
8202        description: impl Into<String>,
8203    ) -> Env {
8204        let mut query = self.selection.select("withSocketInput");
8205        query = query.arg("name", name.into());
8206        query = query.arg_lazy(
8207            "value",
8208            Box::new(move || {
8209                let value = value.clone();
8210                Box::pin(async move { value.into_id().await.unwrap().quote() })
8211            }),
8212        );
8213        query = query.arg("description", description.into());
8214        Env {
8215            proc: self.proc.clone(),
8216            selection: query,
8217            graphql_client: self.graphql_client.clone(),
8218        }
8219    }
8220    /// Declare a desired Socket output to be assigned in the environment
8221    ///
8222    /// # Arguments
8223    ///
8224    /// * `name` - The name of the binding
8225    /// * `description` - A description of the desired value of the binding
8226    pub fn with_socket_output(
8227        &self,
8228        name: impl Into<String>,
8229        description: impl Into<String>,
8230    ) -> Env {
8231        let mut query = self.selection.select("withSocketOutput");
8232        query = query.arg("name", name.into());
8233        query = query.arg("description", description.into());
8234        Env {
8235            proc: self.proc.clone(),
8236            selection: query,
8237            graphql_client: self.graphql_client.clone(),
8238        }
8239    }
8240    /// Create or update a binding of type Stat in the environment
8241    ///
8242    /// # Arguments
8243    ///
8244    /// * `name` - The name of the binding
8245    /// * `value` - The Stat value to assign to the binding
8246    /// * `description` - The purpose of the input
8247    pub fn with_stat_input(
8248        &self,
8249        name: impl Into<String>,
8250        value: impl IntoID<StatId>,
8251        description: impl Into<String>,
8252    ) -> Env {
8253        let mut query = self.selection.select("withStatInput");
8254        query = query.arg("name", name.into());
8255        query = query.arg_lazy(
8256            "value",
8257            Box::new(move || {
8258                let value = value.clone();
8259                Box::pin(async move { value.into_id().await.unwrap().quote() })
8260            }),
8261        );
8262        query = query.arg("description", description.into());
8263        Env {
8264            proc: self.proc.clone(),
8265            selection: query,
8266            graphql_client: self.graphql_client.clone(),
8267        }
8268    }
8269    /// Declare a desired Stat output to be assigned in the environment
8270    ///
8271    /// # Arguments
8272    ///
8273    /// * `name` - The name of the binding
8274    /// * `description` - A description of the desired value of the binding
8275    pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
8276        let mut query = self.selection.select("withStatOutput");
8277        query = query.arg("name", name.into());
8278        query = query.arg("description", description.into());
8279        Env {
8280            proc: self.proc.clone(),
8281            selection: query,
8282            graphql_client: self.graphql_client.clone(),
8283        }
8284    }
8285    /// Provides a string input binding to the environment
8286    ///
8287    /// # Arguments
8288    ///
8289    /// * `name` - The name of the binding
8290    /// * `value` - The string value to assign to the binding
8291    /// * `description` - The description of the input
8292    pub fn with_string_input(
8293        &self,
8294        name: impl Into<String>,
8295        value: impl Into<String>,
8296        description: impl Into<String>,
8297    ) -> Env {
8298        let mut query = self.selection.select("withStringInput");
8299        query = query.arg("name", name.into());
8300        query = query.arg("value", value.into());
8301        query = query.arg("description", description.into());
8302        Env {
8303            proc: self.proc.clone(),
8304            selection: query,
8305            graphql_client: self.graphql_client.clone(),
8306        }
8307    }
8308    /// Declares a desired string output binding
8309    ///
8310    /// # Arguments
8311    ///
8312    /// * `name` - The name of the binding
8313    /// * `description` - The description of the output
8314    pub fn with_string_output(
8315        &self,
8316        name: impl Into<String>,
8317        description: impl Into<String>,
8318    ) -> Env {
8319        let mut query = self.selection.select("withStringOutput");
8320        query = query.arg("name", name.into());
8321        query = query.arg("description", description.into());
8322        Env {
8323            proc: self.proc.clone(),
8324            selection: query,
8325            graphql_client: self.graphql_client.clone(),
8326        }
8327    }
8328    /// Returns a new environment with the provided workspace
8329    ///
8330    /// # Arguments
8331    ///
8332    /// * `workspace` - The directory to set as the host filesystem
8333    pub fn with_workspace(&self, workspace: impl IntoID<DirectoryId>) -> Env {
8334        let mut query = self.selection.select("withWorkspace");
8335        query = query.arg_lazy(
8336            "workspace",
8337            Box::new(move || {
8338                let workspace = workspace.clone();
8339                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
8340            }),
8341        );
8342        Env {
8343            proc: self.proc.clone(),
8344            selection: query,
8345            graphql_client: self.graphql_client.clone(),
8346        }
8347    }
8348    /// Create or update a binding of type Workspace in the environment
8349    ///
8350    /// # Arguments
8351    ///
8352    /// * `name` - The name of the binding
8353    /// * `value` - The Workspace value to assign to the binding
8354    /// * `description` - The purpose of the input
8355    pub fn with_workspace_input(
8356        &self,
8357        name: impl Into<String>,
8358        value: impl IntoID<WorkspaceId>,
8359        description: impl Into<String>,
8360    ) -> Env {
8361        let mut query = self.selection.select("withWorkspaceInput");
8362        query = query.arg("name", name.into());
8363        query = query.arg_lazy(
8364            "value",
8365            Box::new(move || {
8366                let value = value.clone();
8367                Box::pin(async move { value.into_id().await.unwrap().quote() })
8368            }),
8369        );
8370        query = query.arg("description", description.into());
8371        Env {
8372            proc: self.proc.clone(),
8373            selection: query,
8374            graphql_client: self.graphql_client.clone(),
8375        }
8376    }
8377    /// Declare a desired Workspace output to be assigned in the environment
8378    ///
8379    /// # Arguments
8380    ///
8381    /// * `name` - The name of the binding
8382    /// * `description` - A description of the desired value of the binding
8383    pub fn with_workspace_output(
8384        &self,
8385        name: impl Into<String>,
8386        description: impl Into<String>,
8387    ) -> Env {
8388        let mut query = self.selection.select("withWorkspaceOutput");
8389        query = query.arg("name", name.into());
8390        query = query.arg("description", description.into());
8391        Env {
8392            proc: self.proc.clone(),
8393            selection: query,
8394            graphql_client: self.graphql_client.clone(),
8395        }
8396    }
8397    /// Returns a new environment without any outputs
8398    pub fn without_outputs(&self) -> Env {
8399        let query = self.selection.select("withoutOutputs");
8400        Env {
8401            proc: self.proc.clone(),
8402            selection: query,
8403            graphql_client: self.graphql_client.clone(),
8404        }
8405    }
8406    pub fn workspace(&self) -> Directory {
8407        let query = self.selection.select("workspace");
8408        Directory {
8409            proc: self.proc.clone(),
8410            selection: query,
8411            graphql_client: self.graphql_client.clone(),
8412        }
8413    }
8414}
8415#[derive(Clone)]
8416pub struct EnvFile {
8417    pub proc: Option<Arc<DaggerSessionProc>>,
8418    pub selection: Selection,
8419    pub graphql_client: DynGraphQLClient,
8420}
8421#[derive(Builder, Debug, PartialEq)]
8422pub struct EnvFileGetOpts {
8423    /// Return the value exactly as written to the file. No quote removal or variable expansion
8424    #[builder(setter(into, strip_option), default)]
8425    pub raw: Option<bool>,
8426}
8427#[derive(Builder, Debug, PartialEq)]
8428pub struct EnvFileVariablesOpts {
8429    /// Return values exactly as written to the file. No quote removal or variable expansion
8430    #[builder(setter(into, strip_option), default)]
8431    pub raw: Option<bool>,
8432}
8433impl EnvFile {
8434    /// Return as a file
8435    pub fn as_file(&self) -> File {
8436        let query = self.selection.select("asFile");
8437        File {
8438            proc: self.proc.clone(),
8439            selection: query,
8440            graphql_client: self.graphql_client.clone(),
8441        }
8442    }
8443    /// Check if a variable exists
8444    ///
8445    /// # Arguments
8446    ///
8447    /// * `name` - Variable name
8448    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8449        let mut query = self.selection.select("exists");
8450        query = query.arg("name", name.into());
8451        query.execute(self.graphql_client.clone()).await
8452    }
8453    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8454    ///
8455    /// # Arguments
8456    ///
8457    /// * `name` - Variable name
8458    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8459    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8460        let mut query = self.selection.select("get");
8461        query = query.arg("name", name.into());
8462        query.execute(self.graphql_client.clone()).await
8463    }
8464    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8465    ///
8466    /// # Arguments
8467    ///
8468    /// * `name` - Variable name
8469    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8470    pub async fn get_opts(
8471        &self,
8472        name: impl Into<String>,
8473        opts: EnvFileGetOpts,
8474    ) -> Result<String, DaggerError> {
8475        let mut query = self.selection.select("get");
8476        query = query.arg("name", name.into());
8477        if let Some(raw) = opts.raw {
8478            query = query.arg("raw", raw);
8479        }
8480        query.execute(self.graphql_client.clone()).await
8481    }
8482    /// A unique identifier for this EnvFile.
8483    pub async fn id(&self) -> Result<EnvFileId, DaggerError> {
8484        let query = self.selection.select("id");
8485        query.execute(self.graphql_client.clone()).await
8486    }
8487    /// 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
8488    ///
8489    /// # Arguments
8490    ///
8491    /// * `prefix` - The prefix to filter by
8492    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8493        let mut query = self.selection.select("namespace");
8494        query = query.arg("prefix", prefix.into());
8495        EnvFile {
8496            proc: self.proc.clone(),
8497            selection: query,
8498            graphql_client: self.graphql_client.clone(),
8499        }
8500    }
8501    /// Return all variables
8502    ///
8503    /// # Arguments
8504    ///
8505    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8506    pub fn variables(&self) -> Vec<EnvVariable> {
8507        let query = self.selection.select("variables");
8508        vec![EnvVariable {
8509            proc: self.proc.clone(),
8510            selection: query,
8511            graphql_client: self.graphql_client.clone(),
8512        }]
8513    }
8514    /// Return all variables
8515    ///
8516    /// # Arguments
8517    ///
8518    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8519    pub fn variables_opts(&self, opts: EnvFileVariablesOpts) -> Vec<EnvVariable> {
8520        let mut query = self.selection.select("variables");
8521        if let Some(raw) = opts.raw {
8522            query = query.arg("raw", raw);
8523        }
8524        vec![EnvVariable {
8525            proc: self.proc.clone(),
8526            selection: query,
8527            graphql_client: self.graphql_client.clone(),
8528        }]
8529    }
8530    /// Add a variable
8531    ///
8532    /// # Arguments
8533    ///
8534    /// * `name` - Variable name
8535    /// * `value` - Variable value
8536    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8537        let mut query = self.selection.select("withVariable");
8538        query = query.arg("name", name.into());
8539        query = query.arg("value", value.into());
8540        EnvFile {
8541            proc: self.proc.clone(),
8542            selection: query,
8543            graphql_client: self.graphql_client.clone(),
8544        }
8545    }
8546    /// Remove all occurrences of the named variable
8547    ///
8548    /// # Arguments
8549    ///
8550    /// * `name` - Variable name
8551    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8552        let mut query = self.selection.select("withoutVariable");
8553        query = query.arg("name", name.into());
8554        EnvFile {
8555            proc: self.proc.clone(),
8556            selection: query,
8557            graphql_client: self.graphql_client.clone(),
8558        }
8559    }
8560}
8561#[derive(Clone)]
8562pub struct EnvVariable {
8563    pub proc: Option<Arc<DaggerSessionProc>>,
8564    pub selection: Selection,
8565    pub graphql_client: DynGraphQLClient,
8566}
8567impl EnvVariable {
8568    /// A unique identifier for this EnvVariable.
8569    pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
8570        let query = self.selection.select("id");
8571        query.execute(self.graphql_client.clone()).await
8572    }
8573    /// The environment variable name.
8574    pub async fn name(&self) -> Result<String, DaggerError> {
8575        let query = self.selection.select("name");
8576        query.execute(self.graphql_client.clone()).await
8577    }
8578    /// The environment variable value.
8579    pub async fn value(&self) -> Result<String, DaggerError> {
8580        let query = self.selection.select("value");
8581        query.execute(self.graphql_client.clone()).await
8582    }
8583}
8584#[derive(Clone)]
8585pub struct Error {
8586    pub proc: Option<Arc<DaggerSessionProc>>,
8587    pub selection: Selection,
8588    pub graphql_client: DynGraphQLClient,
8589}
8590impl Error {
8591    /// A unique identifier for this Error.
8592    pub async fn id(&self) -> Result<ErrorId, DaggerError> {
8593        let query = self.selection.select("id");
8594        query.execute(self.graphql_client.clone()).await
8595    }
8596    /// A description of the error.
8597    pub async fn message(&self) -> Result<String, DaggerError> {
8598        let query = self.selection.select("message");
8599        query.execute(self.graphql_client.clone()).await
8600    }
8601    /// The extensions of the error.
8602    pub fn values(&self) -> Vec<ErrorValue> {
8603        let query = self.selection.select("values");
8604        vec![ErrorValue {
8605            proc: self.proc.clone(),
8606            selection: query,
8607            graphql_client: self.graphql_client.clone(),
8608        }]
8609    }
8610    /// Add a value to the error.
8611    ///
8612    /// # Arguments
8613    ///
8614    /// * `name` - The name of the value.
8615    /// * `value` - The value to store on the error.
8616    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8617        let mut query = self.selection.select("withValue");
8618        query = query.arg("name", name.into());
8619        query = query.arg("value", value);
8620        Error {
8621            proc: self.proc.clone(),
8622            selection: query,
8623            graphql_client: self.graphql_client.clone(),
8624        }
8625    }
8626}
8627#[derive(Clone)]
8628pub struct ErrorValue {
8629    pub proc: Option<Arc<DaggerSessionProc>>,
8630    pub selection: Selection,
8631    pub graphql_client: DynGraphQLClient,
8632}
8633impl ErrorValue {
8634    /// A unique identifier for this ErrorValue.
8635    pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
8636        let query = self.selection.select("id");
8637        query.execute(self.graphql_client.clone()).await
8638    }
8639    /// The name of the value.
8640    pub async fn name(&self) -> Result<String, DaggerError> {
8641        let query = self.selection.select("name");
8642        query.execute(self.graphql_client.clone()).await
8643    }
8644    /// The value.
8645    pub async fn value(&self) -> Result<Json, DaggerError> {
8646        let query = self.selection.select("value");
8647        query.execute(self.graphql_client.clone()).await
8648    }
8649}
8650#[derive(Clone)]
8651pub struct FieldTypeDef {
8652    pub proc: Option<Arc<DaggerSessionProc>>,
8653    pub selection: Selection,
8654    pub graphql_client: DynGraphQLClient,
8655}
8656impl FieldTypeDef {
8657    /// The reason this enum member is deprecated, if any.
8658    pub async fn deprecated(&self) -> Result<String, DaggerError> {
8659        let query = self.selection.select("deprecated");
8660        query.execute(self.graphql_client.clone()).await
8661    }
8662    /// A doc string for the field, if any.
8663    pub async fn description(&self) -> Result<String, DaggerError> {
8664        let query = self.selection.select("description");
8665        query.execute(self.graphql_client.clone()).await
8666    }
8667    /// A unique identifier for this FieldTypeDef.
8668    pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
8669        let query = self.selection.select("id");
8670        query.execute(self.graphql_client.clone()).await
8671    }
8672    /// The name of the field in lowerCamelCase format.
8673    pub async fn name(&self) -> Result<String, DaggerError> {
8674        let query = self.selection.select("name");
8675        query.execute(self.graphql_client.clone()).await
8676    }
8677    /// The location of this field declaration.
8678    pub fn source_map(&self) -> SourceMap {
8679        let query = self.selection.select("sourceMap");
8680        SourceMap {
8681            proc: self.proc.clone(),
8682            selection: query,
8683            graphql_client: self.graphql_client.clone(),
8684        }
8685    }
8686    /// The type of the field.
8687    pub fn type_def(&self) -> TypeDef {
8688        let query = self.selection.select("typeDef");
8689        TypeDef {
8690            proc: self.proc.clone(),
8691            selection: query,
8692            graphql_client: self.graphql_client.clone(),
8693        }
8694    }
8695}
8696#[derive(Clone)]
8697pub struct File {
8698    pub proc: Option<Arc<DaggerSessionProc>>,
8699    pub selection: Selection,
8700    pub graphql_client: DynGraphQLClient,
8701}
8702#[derive(Builder, Debug, PartialEq)]
8703pub struct FileAsEnvFileOpts {
8704    /// Replace "${VAR}" or "$VAR" with the value of other vars
8705    #[builder(setter(into, strip_option), default)]
8706    pub expand: Option<bool>,
8707}
8708#[derive(Builder, Debug, PartialEq)]
8709pub struct FileContentsOpts {
8710    /// Maximum number of lines to read
8711    #[builder(setter(into, strip_option), default)]
8712    pub limit_lines: Option<isize>,
8713    /// Start reading after this line
8714    #[builder(setter(into, strip_option), default)]
8715    pub offset_lines: Option<isize>,
8716}
8717#[derive(Builder, Debug, PartialEq)]
8718pub struct FileDigestOpts {
8719    /// If true, exclude metadata from the digest.
8720    #[builder(setter(into, strip_option), default)]
8721    pub exclude_metadata: Option<bool>,
8722}
8723#[derive(Builder, Debug, PartialEq)]
8724pub struct FileExportOpts {
8725    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
8726    #[builder(setter(into, strip_option), default)]
8727    pub allow_parent_dir_path: Option<bool>,
8728}
8729#[derive(Builder, Debug, PartialEq)]
8730pub struct FileSearchOpts<'a> {
8731    /// Allow the . pattern to match newlines in multiline mode.
8732    #[builder(setter(into, strip_option), default)]
8733    pub dotall: Option<bool>,
8734    /// Only return matching files, not lines and content
8735    #[builder(setter(into, strip_option), default)]
8736    pub files_only: Option<bool>,
8737    #[builder(setter(into, strip_option), default)]
8738    pub globs: Option<Vec<&'a str>>,
8739    /// Enable case-insensitive matching.
8740    #[builder(setter(into, strip_option), default)]
8741    pub insensitive: Option<bool>,
8742    /// Limit the number of results to return
8743    #[builder(setter(into, strip_option), default)]
8744    pub limit: Option<isize>,
8745    /// Interpret the pattern as a literal string instead of a regular expression.
8746    #[builder(setter(into, strip_option), default)]
8747    pub literal: Option<bool>,
8748    /// Enable searching across multiple lines.
8749    #[builder(setter(into, strip_option), default)]
8750    pub multiline: Option<bool>,
8751    #[builder(setter(into, strip_option), default)]
8752    pub paths: Option<Vec<&'a str>>,
8753    /// Skip hidden files (files starting with .).
8754    #[builder(setter(into, strip_option), default)]
8755    pub skip_hidden: Option<bool>,
8756    /// Honor .gitignore, .ignore, and .rgignore files.
8757    #[builder(setter(into, strip_option), default)]
8758    pub skip_ignored: Option<bool>,
8759}
8760#[derive(Builder, Debug, PartialEq)]
8761pub struct FileWithReplacedOpts {
8762    /// Replace all occurrences of the pattern.
8763    #[builder(setter(into, strip_option), default)]
8764    pub all: Option<bool>,
8765    /// Replace the first match starting from the specified line.
8766    #[builder(setter(into, strip_option), default)]
8767    pub first_from: Option<isize>,
8768}
8769impl File {
8770    /// Parse as an env file
8771    ///
8772    /// # Arguments
8773    ///
8774    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8775    pub fn as_env_file(&self) -> EnvFile {
8776        let query = self.selection.select("asEnvFile");
8777        EnvFile {
8778            proc: self.proc.clone(),
8779            selection: query,
8780            graphql_client: self.graphql_client.clone(),
8781        }
8782    }
8783    /// Parse as an env file
8784    ///
8785    /// # Arguments
8786    ///
8787    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8788    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
8789        let mut query = self.selection.select("asEnvFile");
8790        if let Some(expand) = opts.expand {
8791            query = query.arg("expand", expand);
8792        }
8793        EnvFile {
8794            proc: self.proc.clone(),
8795            selection: query,
8796            graphql_client: self.graphql_client.clone(),
8797        }
8798    }
8799    /// Parse the file contents as JSON.
8800    pub fn as_json(&self) -> JsonValue {
8801        let query = self.selection.select("asJSON");
8802        JsonValue {
8803            proc: self.proc.clone(),
8804            selection: query,
8805            graphql_client: self.graphql_client.clone(),
8806        }
8807    }
8808    /// Change the owner of the file recursively.
8809    ///
8810    /// # Arguments
8811    ///
8812    /// * `owner` - A user:group to set for the file.
8813    ///
8814    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
8815    ///
8816    /// If the group is omitted, it defaults to the same as the user.
8817    pub fn chown(&self, owner: impl Into<String>) -> File {
8818        let mut query = self.selection.select("chown");
8819        query = query.arg("owner", owner.into());
8820        File {
8821            proc: self.proc.clone(),
8822            selection: query,
8823            graphql_client: self.graphql_client.clone(),
8824        }
8825    }
8826    /// Retrieves the contents of the file.
8827    ///
8828    /// # Arguments
8829    ///
8830    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8831    pub async fn contents(&self) -> Result<String, DaggerError> {
8832        let query = self.selection.select("contents");
8833        query.execute(self.graphql_client.clone()).await
8834    }
8835    /// Retrieves the contents of the file.
8836    ///
8837    /// # Arguments
8838    ///
8839    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8840    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
8841        let mut query = self.selection.select("contents");
8842        if let Some(offset_lines) = opts.offset_lines {
8843            query = query.arg("offsetLines", offset_lines);
8844        }
8845        if let Some(limit_lines) = opts.limit_lines {
8846            query = query.arg("limitLines", limit_lines);
8847        }
8848        query.execute(self.graphql_client.clone()).await
8849    }
8850    /// 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.
8851    ///
8852    /// # Arguments
8853    ///
8854    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8855    pub async fn digest(&self) -> Result<String, DaggerError> {
8856        let query = self.selection.select("digest");
8857        query.execute(self.graphql_client.clone()).await
8858    }
8859    /// 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.
8860    ///
8861    /// # Arguments
8862    ///
8863    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8864    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
8865        let mut query = self.selection.select("digest");
8866        if let Some(exclude_metadata) = opts.exclude_metadata {
8867            query = query.arg("excludeMetadata", exclude_metadata);
8868        }
8869        query.execute(self.graphql_client.clone()).await
8870    }
8871    /// Writes the file to a file path on the host.
8872    ///
8873    /// # Arguments
8874    ///
8875    /// * `path` - Location of the written directory (e.g., "output.txt").
8876    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8877    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
8878        let mut query = self.selection.select("export");
8879        query = query.arg("path", path.into());
8880        query.execute(self.graphql_client.clone()).await
8881    }
8882    /// Writes the file to a file path on the host.
8883    ///
8884    /// # Arguments
8885    ///
8886    /// * `path` - Location of the written directory (e.g., "output.txt").
8887    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8888    pub async fn export_opts(
8889        &self,
8890        path: impl Into<String>,
8891        opts: FileExportOpts,
8892    ) -> Result<String, DaggerError> {
8893        let mut query = self.selection.select("export");
8894        query = query.arg("path", path.into());
8895        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
8896            query = query.arg("allowParentDirPath", allow_parent_dir_path);
8897        }
8898        query.execute(self.graphql_client.clone()).await
8899    }
8900    /// A unique identifier for this File.
8901    pub async fn id(&self) -> Result<FileId, DaggerError> {
8902        let query = self.selection.select("id");
8903        query.execute(self.graphql_client.clone()).await
8904    }
8905    /// Retrieves the name of the file.
8906    pub async fn name(&self) -> Result<String, DaggerError> {
8907        let query = self.selection.select("name");
8908        query.execute(self.graphql_client.clone()).await
8909    }
8910    /// Searches for content matching the given regular expression or literal string.
8911    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
8912    ///
8913    /// # Arguments
8914    ///
8915    /// * `pattern` - The text to match.
8916    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8917    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
8918        let mut query = self.selection.select("search");
8919        query = query.arg("pattern", pattern.into());
8920        vec![SearchResult {
8921            proc: self.proc.clone(),
8922            selection: query,
8923            graphql_client: self.graphql_client.clone(),
8924        }]
8925    }
8926    /// Searches for content matching the given regular expression or literal string.
8927    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
8928    ///
8929    /// # Arguments
8930    ///
8931    /// * `pattern` - The text to match.
8932    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8933    pub fn search_opts<'a>(
8934        &self,
8935        pattern: impl Into<String>,
8936        opts: FileSearchOpts<'a>,
8937    ) -> Vec<SearchResult> {
8938        let mut query = self.selection.select("search");
8939        query = query.arg("pattern", pattern.into());
8940        if let Some(literal) = opts.literal {
8941            query = query.arg("literal", literal);
8942        }
8943        if let Some(multiline) = opts.multiline {
8944            query = query.arg("multiline", multiline);
8945        }
8946        if let Some(dotall) = opts.dotall {
8947            query = query.arg("dotall", dotall);
8948        }
8949        if let Some(insensitive) = opts.insensitive {
8950            query = query.arg("insensitive", insensitive);
8951        }
8952        if let Some(skip_ignored) = opts.skip_ignored {
8953            query = query.arg("skipIgnored", skip_ignored);
8954        }
8955        if let Some(skip_hidden) = opts.skip_hidden {
8956            query = query.arg("skipHidden", skip_hidden);
8957        }
8958        if let Some(files_only) = opts.files_only {
8959            query = query.arg("filesOnly", files_only);
8960        }
8961        if let Some(limit) = opts.limit {
8962            query = query.arg("limit", limit);
8963        }
8964        if let Some(paths) = opts.paths {
8965            query = query.arg("paths", paths);
8966        }
8967        if let Some(globs) = opts.globs {
8968            query = query.arg("globs", globs);
8969        }
8970        vec![SearchResult {
8971            proc: self.proc.clone(),
8972            selection: query,
8973            graphql_client: self.graphql_client.clone(),
8974        }]
8975    }
8976    /// Retrieves the size of the file, in bytes.
8977    pub async fn size(&self) -> Result<isize, DaggerError> {
8978        let query = self.selection.select("size");
8979        query.execute(self.graphql_client.clone()).await
8980    }
8981    /// Return file status
8982    pub fn stat(&self) -> Stat {
8983        let query = self.selection.select("stat");
8984        Stat {
8985            proc: self.proc.clone(),
8986            selection: query,
8987            graphql_client: self.graphql_client.clone(),
8988        }
8989    }
8990    /// Force evaluation in the engine.
8991    pub async fn sync(&self) -> Result<FileId, DaggerError> {
8992        let query = self.selection.select("sync");
8993        query.execute(self.graphql_client.clone()).await
8994    }
8995    /// Retrieves this file with its name set to the given name.
8996    ///
8997    /// # Arguments
8998    ///
8999    /// * `name` - Name to set file to.
9000    pub fn with_name(&self, name: impl Into<String>) -> File {
9001        let mut query = self.selection.select("withName");
9002        query = query.arg("name", name.into());
9003        File {
9004            proc: self.proc.clone(),
9005            selection: query,
9006            graphql_client: self.graphql_client.clone(),
9007        }
9008    }
9009    /// Retrieves the file with content replaced with the given text.
9010    /// If 'all' is true, all occurrences of the pattern will be replaced.
9011    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9012    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9013    /// If there are no matches for the pattern, this will error.
9014    ///
9015    /// # Arguments
9016    ///
9017    /// * `search` - The text to match.
9018    /// * `replacement` - The text to match.
9019    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9020    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
9021        let mut query = self.selection.select("withReplaced");
9022        query = query.arg("search", search.into());
9023        query = query.arg("replacement", replacement.into());
9024        File {
9025            proc: self.proc.clone(),
9026            selection: query,
9027            graphql_client: self.graphql_client.clone(),
9028        }
9029    }
9030    /// Retrieves the file with content replaced with the given text.
9031    /// If 'all' is true, all occurrences of the pattern will be replaced.
9032    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9033    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9034    /// If there are no matches for the pattern, this will error.
9035    ///
9036    /// # Arguments
9037    ///
9038    /// * `search` - The text to match.
9039    /// * `replacement` - The text to match.
9040    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9041    pub fn with_replaced_opts(
9042        &self,
9043        search: impl Into<String>,
9044        replacement: impl Into<String>,
9045        opts: FileWithReplacedOpts,
9046    ) -> File {
9047        let mut query = self.selection.select("withReplaced");
9048        query = query.arg("search", search.into());
9049        query = query.arg("replacement", replacement.into());
9050        if let Some(all) = opts.all {
9051            query = query.arg("all", all);
9052        }
9053        if let Some(first_from) = opts.first_from {
9054            query = query.arg("firstFrom", first_from);
9055        }
9056        File {
9057            proc: self.proc.clone(),
9058            selection: query,
9059            graphql_client: self.graphql_client.clone(),
9060        }
9061    }
9062    /// Retrieves this file with its created/modified timestamps set to the given time.
9063    ///
9064    /// # Arguments
9065    ///
9066    /// * `timestamp` - Timestamp to set dir/files in.
9067    ///
9068    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
9069    pub fn with_timestamps(&self, timestamp: isize) -> File {
9070        let mut query = self.selection.select("withTimestamps");
9071        query = query.arg("timestamp", timestamp);
9072        File {
9073            proc: self.proc.clone(),
9074            selection: query,
9075            graphql_client: self.graphql_client.clone(),
9076        }
9077    }
9078}
9079#[derive(Clone)]
9080pub struct Function {
9081    pub proc: Option<Arc<DaggerSessionProc>>,
9082    pub selection: Selection,
9083    pub graphql_client: DynGraphQLClient,
9084}
9085#[derive(Builder, Debug, PartialEq)]
9086pub struct FunctionWithArgOpts<'a> {
9087    #[builder(setter(into, strip_option), default)]
9088    pub default_address: Option<&'a str>,
9089    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
9090    #[builder(setter(into, strip_option), default)]
9091    pub default_path: Option<&'a str>,
9092    /// A default value to use for this argument if not explicitly set by the caller, if any
9093    #[builder(setter(into, strip_option), default)]
9094    pub default_value: Option<Json>,
9095    /// If deprecated, the reason or migration path.
9096    #[builder(setter(into, strip_option), default)]
9097    pub deprecated: Option<&'a str>,
9098    /// A doc string for the argument, if any
9099    #[builder(setter(into, strip_option), default)]
9100    pub description: Option<&'a str>,
9101    /// Patterns to ignore when loading the contextual argument value.
9102    #[builder(setter(into, strip_option), default)]
9103    pub ignore: Option<Vec<&'a str>>,
9104    /// The source map for the argument definition.
9105    #[builder(setter(into, strip_option), default)]
9106    pub source_map: Option<SourceMapId>,
9107}
9108#[derive(Builder, Debug, PartialEq)]
9109pub struct FunctionWithCachePolicyOpts<'a> {
9110    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
9111    #[builder(setter(into, strip_option), default)]
9112    pub time_to_live: Option<&'a str>,
9113}
9114#[derive(Builder, Debug, PartialEq)]
9115pub struct FunctionWithDeprecatedOpts<'a> {
9116    /// Reason or migration path describing the deprecation.
9117    #[builder(setter(into, strip_option), default)]
9118    pub reason: Option<&'a str>,
9119}
9120impl Function {
9121    /// Arguments accepted by the function, if any.
9122    pub fn args(&self) -> Vec<FunctionArg> {
9123        let query = self.selection.select("args");
9124        vec![FunctionArg {
9125            proc: self.proc.clone(),
9126            selection: query,
9127            graphql_client: self.graphql_client.clone(),
9128        }]
9129    }
9130    /// The reason this function is deprecated, if any.
9131    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9132        let query = self.selection.select("deprecated");
9133        query.execute(self.graphql_client.clone()).await
9134    }
9135    /// A doc string for the function, if any.
9136    pub async fn description(&self) -> Result<String, DaggerError> {
9137        let query = self.selection.select("description");
9138        query.execute(self.graphql_client.clone()).await
9139    }
9140    /// A unique identifier for this Function.
9141    pub async fn id(&self) -> Result<FunctionId, DaggerError> {
9142        let query = self.selection.select("id");
9143        query.execute(self.graphql_client.clone()).await
9144    }
9145    /// The name of the function.
9146    pub async fn name(&self) -> Result<String, DaggerError> {
9147        let query = self.selection.select("name");
9148        query.execute(self.graphql_client.clone()).await
9149    }
9150    /// The type returned by the function.
9151    pub fn return_type(&self) -> TypeDef {
9152        let query = self.selection.select("returnType");
9153        TypeDef {
9154            proc: self.proc.clone(),
9155            selection: query,
9156            graphql_client: self.graphql_client.clone(),
9157        }
9158    }
9159    /// The location of this function declaration.
9160    pub fn source_map(&self) -> SourceMap {
9161        let query = self.selection.select("sourceMap");
9162        SourceMap {
9163            proc: self.proc.clone(),
9164            selection: query,
9165            graphql_client: self.graphql_client.clone(),
9166        }
9167    }
9168    /// Returns the function with the provided argument
9169    ///
9170    /// # Arguments
9171    ///
9172    /// * `name` - The name of the argument
9173    /// * `type_def` - The type of the argument
9174    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9175    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
9176        let mut query = self.selection.select("withArg");
9177        query = query.arg("name", name.into());
9178        query = query.arg_lazy(
9179            "typeDef",
9180            Box::new(move || {
9181                let type_def = type_def.clone();
9182                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9183            }),
9184        );
9185        Function {
9186            proc: self.proc.clone(),
9187            selection: query,
9188            graphql_client: self.graphql_client.clone(),
9189        }
9190    }
9191    /// Returns the function with the provided argument
9192    ///
9193    /// # Arguments
9194    ///
9195    /// * `name` - The name of the argument
9196    /// * `type_def` - The type of the argument
9197    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9198    pub fn with_arg_opts<'a>(
9199        &self,
9200        name: impl Into<String>,
9201        type_def: impl IntoID<TypeDefId>,
9202        opts: FunctionWithArgOpts<'a>,
9203    ) -> Function {
9204        let mut query = self.selection.select("withArg");
9205        query = query.arg("name", name.into());
9206        query = query.arg_lazy(
9207            "typeDef",
9208            Box::new(move || {
9209                let type_def = type_def.clone();
9210                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9211            }),
9212        );
9213        if let Some(description) = opts.description {
9214            query = query.arg("description", description);
9215        }
9216        if let Some(default_value) = opts.default_value {
9217            query = query.arg("defaultValue", default_value);
9218        }
9219        if let Some(default_path) = opts.default_path {
9220            query = query.arg("defaultPath", default_path);
9221        }
9222        if let Some(ignore) = opts.ignore {
9223            query = query.arg("ignore", ignore);
9224        }
9225        if let Some(source_map) = opts.source_map {
9226            query = query.arg("sourceMap", source_map);
9227        }
9228        if let Some(deprecated) = opts.deprecated {
9229            query = query.arg("deprecated", deprecated);
9230        }
9231        if let Some(default_address) = opts.default_address {
9232            query = query.arg("defaultAddress", default_address);
9233        }
9234        Function {
9235            proc: self.proc.clone(),
9236            selection: query,
9237            graphql_client: self.graphql_client.clone(),
9238        }
9239    }
9240    /// Returns the function updated to use the provided cache policy.
9241    ///
9242    /// # Arguments
9243    ///
9244    /// * `policy` - The cache policy to use.
9245    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9246    pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9247        let mut query = self.selection.select("withCachePolicy");
9248        query = query.arg("policy", policy);
9249        Function {
9250            proc: self.proc.clone(),
9251            selection: query,
9252            graphql_client: self.graphql_client.clone(),
9253        }
9254    }
9255    /// Returns the function updated to use the provided cache policy.
9256    ///
9257    /// # Arguments
9258    ///
9259    /// * `policy` - The cache policy to use.
9260    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9261    pub fn with_cache_policy_opts<'a>(
9262        &self,
9263        policy: FunctionCachePolicy,
9264        opts: FunctionWithCachePolicyOpts<'a>,
9265    ) -> Function {
9266        let mut query = self.selection.select("withCachePolicy");
9267        query = query.arg("policy", policy);
9268        if let Some(time_to_live) = opts.time_to_live {
9269            query = query.arg("timeToLive", time_to_live);
9270        }
9271        Function {
9272            proc: self.proc.clone(),
9273            selection: query,
9274            graphql_client: self.graphql_client.clone(),
9275        }
9276    }
9277    /// Returns the function with a flag indicating it's a check.
9278    pub fn with_check(&self) -> Function {
9279        let query = self.selection.select("withCheck");
9280        Function {
9281            proc: self.proc.clone(),
9282            selection: query,
9283            graphql_client: self.graphql_client.clone(),
9284        }
9285    }
9286    /// Returns the function with the provided deprecation reason.
9287    ///
9288    /// # Arguments
9289    ///
9290    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9291    pub fn with_deprecated(&self) -> Function {
9292        let query = self.selection.select("withDeprecated");
9293        Function {
9294            proc: self.proc.clone(),
9295            selection: query,
9296            graphql_client: self.graphql_client.clone(),
9297        }
9298    }
9299    /// Returns the function with the provided deprecation reason.
9300    ///
9301    /// # Arguments
9302    ///
9303    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9304    pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9305        let mut query = self.selection.select("withDeprecated");
9306        if let Some(reason) = opts.reason {
9307            query = query.arg("reason", reason);
9308        }
9309        Function {
9310            proc: self.proc.clone(),
9311            selection: query,
9312            graphql_client: self.graphql_client.clone(),
9313        }
9314    }
9315    /// Returns the function with the given doc string.
9316    ///
9317    /// # Arguments
9318    ///
9319    /// * `description` - The doc string to set.
9320    pub fn with_description(&self, description: impl Into<String>) -> Function {
9321        let mut query = self.selection.select("withDescription");
9322        query = query.arg("description", description.into());
9323        Function {
9324            proc: self.proc.clone(),
9325            selection: query,
9326            graphql_client: self.graphql_client.clone(),
9327        }
9328    }
9329    /// Returns the function with a flag indicating it's a generator.
9330    pub fn with_generator(&self) -> Function {
9331        let query = self.selection.select("withGenerator");
9332        Function {
9333            proc: self.proc.clone(),
9334            selection: query,
9335            graphql_client: self.graphql_client.clone(),
9336        }
9337    }
9338    /// Returns the function with the given source map.
9339    ///
9340    /// # Arguments
9341    ///
9342    /// * `source_map` - The source map for the function definition.
9343    pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
9344        let mut query = self.selection.select("withSourceMap");
9345        query = query.arg_lazy(
9346            "sourceMap",
9347            Box::new(move || {
9348                let source_map = source_map.clone();
9349                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9350            }),
9351        );
9352        Function {
9353            proc: self.proc.clone(),
9354            selection: query,
9355            graphql_client: self.graphql_client.clone(),
9356        }
9357    }
9358}
9359#[derive(Clone)]
9360pub struct FunctionArg {
9361    pub proc: Option<Arc<DaggerSessionProc>>,
9362    pub selection: Selection,
9363    pub graphql_client: DynGraphQLClient,
9364}
9365impl FunctionArg {
9366    /// Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
9367    pub async fn default_address(&self) -> Result<String, DaggerError> {
9368        let query = self.selection.select("defaultAddress");
9369        query.execute(self.graphql_client.clone()).await
9370    }
9371    /// 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
9372    pub async fn default_path(&self) -> Result<String, DaggerError> {
9373        let query = self.selection.select("defaultPath");
9374        query.execute(self.graphql_client.clone()).await
9375    }
9376    /// A default value to use for this argument when not explicitly set by the caller, if any.
9377    pub async fn default_value(&self) -> Result<Json, DaggerError> {
9378        let query = self.selection.select("defaultValue");
9379        query.execute(self.graphql_client.clone()).await
9380    }
9381    /// The reason this function is deprecated, if any.
9382    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9383        let query = self.selection.select("deprecated");
9384        query.execute(self.graphql_client.clone()).await
9385    }
9386    /// A doc string for the argument, if any.
9387    pub async fn description(&self) -> Result<String, DaggerError> {
9388        let query = self.selection.select("description");
9389        query.execute(self.graphql_client.clone()).await
9390    }
9391    /// A unique identifier for this FunctionArg.
9392    pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
9393        let query = self.selection.select("id");
9394        query.execute(self.graphql_client.clone()).await
9395    }
9396    /// 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.
9397    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9398        let query = self.selection.select("ignore");
9399        query.execute(self.graphql_client.clone()).await
9400    }
9401    /// The name of the argument in lowerCamelCase format.
9402    pub async fn name(&self) -> Result<String, DaggerError> {
9403        let query = self.selection.select("name");
9404        query.execute(self.graphql_client.clone()).await
9405    }
9406    /// The location of this arg declaration.
9407    pub fn source_map(&self) -> SourceMap {
9408        let query = self.selection.select("sourceMap");
9409        SourceMap {
9410            proc: self.proc.clone(),
9411            selection: query,
9412            graphql_client: self.graphql_client.clone(),
9413        }
9414    }
9415    /// The type of the argument.
9416    pub fn type_def(&self) -> TypeDef {
9417        let query = self.selection.select("typeDef");
9418        TypeDef {
9419            proc: self.proc.clone(),
9420            selection: query,
9421            graphql_client: self.graphql_client.clone(),
9422        }
9423    }
9424}
9425#[derive(Clone)]
9426pub struct FunctionCall {
9427    pub proc: Option<Arc<DaggerSessionProc>>,
9428    pub selection: Selection,
9429    pub graphql_client: DynGraphQLClient,
9430}
9431impl FunctionCall {
9432    /// A unique identifier for this FunctionCall.
9433    pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
9434        let query = self.selection.select("id");
9435        query.execute(self.graphql_client.clone()).await
9436    }
9437    /// The argument values the function is being invoked with.
9438    pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
9439        let query = self.selection.select("inputArgs");
9440        vec![FunctionCallArgValue {
9441            proc: self.proc.clone(),
9442            selection: query,
9443            graphql_client: self.graphql_client.clone(),
9444        }]
9445    }
9446    /// The name of the function being called.
9447    pub async fn name(&self) -> Result<String, DaggerError> {
9448        let query = self.selection.select("name");
9449        query.execute(self.graphql_client.clone()).await
9450    }
9451    /// 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.
9452    pub async fn parent(&self) -> Result<Json, DaggerError> {
9453        let query = self.selection.select("parent");
9454        query.execute(self.graphql_client.clone()).await
9455    }
9456    /// 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.
9457    pub async fn parent_name(&self) -> Result<String, DaggerError> {
9458        let query = self.selection.select("parentName");
9459        query.execute(self.graphql_client.clone()).await
9460    }
9461    /// Return an error from the function.
9462    ///
9463    /// # Arguments
9464    ///
9465    /// * `error` - The error to return.
9466    pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
9467        let mut query = self.selection.select("returnError");
9468        query = query.arg_lazy(
9469            "error",
9470            Box::new(move || {
9471                let error = error.clone();
9472                Box::pin(async move { error.into_id().await.unwrap().quote() })
9473            }),
9474        );
9475        query.execute(self.graphql_client.clone()).await
9476    }
9477    /// Set the return value of the function call to the provided value.
9478    ///
9479    /// # Arguments
9480    ///
9481    /// * `value` - JSON serialization of the return value.
9482    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9483        let mut query = self.selection.select("returnValue");
9484        query = query.arg("value", value);
9485        query.execute(self.graphql_client.clone()).await
9486    }
9487}
9488#[derive(Clone)]
9489pub struct FunctionCallArgValue {
9490    pub proc: Option<Arc<DaggerSessionProc>>,
9491    pub selection: Selection,
9492    pub graphql_client: DynGraphQLClient,
9493}
9494impl FunctionCallArgValue {
9495    /// A unique identifier for this FunctionCallArgValue.
9496    pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
9497        let query = self.selection.select("id");
9498        query.execute(self.graphql_client.clone()).await
9499    }
9500    /// The name of the argument.
9501    pub async fn name(&self) -> Result<String, DaggerError> {
9502        let query = self.selection.select("name");
9503        query.execute(self.graphql_client.clone()).await
9504    }
9505    /// The value of the argument represented as a JSON serialized string.
9506    pub async fn value(&self) -> Result<Json, DaggerError> {
9507        let query = self.selection.select("value");
9508        query.execute(self.graphql_client.clone()).await
9509    }
9510}
9511#[derive(Clone)]
9512pub struct GeneratedCode {
9513    pub proc: Option<Arc<DaggerSessionProc>>,
9514    pub selection: Selection,
9515    pub graphql_client: DynGraphQLClient,
9516}
9517impl GeneratedCode {
9518    /// The directory containing the generated code.
9519    pub fn code(&self) -> Directory {
9520        let query = self.selection.select("code");
9521        Directory {
9522            proc: self.proc.clone(),
9523            selection: query,
9524            graphql_client: self.graphql_client.clone(),
9525        }
9526    }
9527    /// A unique identifier for this GeneratedCode.
9528    pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
9529        let query = self.selection.select("id");
9530        query.execute(self.graphql_client.clone()).await
9531    }
9532    /// List of paths to mark generated in version control (i.e. .gitattributes).
9533    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
9534        let query = self.selection.select("vcsGeneratedPaths");
9535        query.execute(self.graphql_client.clone()).await
9536    }
9537    /// List of paths to ignore in version control (i.e. .gitignore).
9538    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
9539        let query = self.selection.select("vcsIgnoredPaths");
9540        query.execute(self.graphql_client.clone()).await
9541    }
9542    /// Set the list of paths to mark generated in version control.
9543    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9544        let mut query = self.selection.select("withVCSGeneratedPaths");
9545        query = query.arg(
9546            "paths",
9547            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9548        );
9549        GeneratedCode {
9550            proc: self.proc.clone(),
9551            selection: query,
9552            graphql_client: self.graphql_client.clone(),
9553        }
9554    }
9555    /// Set the list of paths to ignore in version control.
9556    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9557        let mut query = self.selection.select("withVCSIgnoredPaths");
9558        query = query.arg(
9559            "paths",
9560            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9561        );
9562        GeneratedCode {
9563            proc: self.proc.clone(),
9564            selection: query,
9565            graphql_client: self.graphql_client.clone(),
9566        }
9567    }
9568}
9569#[derive(Clone)]
9570pub struct Generator {
9571    pub proc: Option<Arc<DaggerSessionProc>>,
9572    pub selection: Selection,
9573    pub graphql_client: DynGraphQLClient,
9574}
9575impl Generator {
9576    /// The generated changeset
9577    pub fn changes(&self) -> Changeset {
9578        let query = self.selection.select("changes");
9579        Changeset {
9580            proc: self.proc.clone(),
9581            selection: query,
9582            graphql_client: self.graphql_client.clone(),
9583        }
9584    }
9585    /// Whether the generator complete
9586    pub async fn completed(&self) -> Result<bool, DaggerError> {
9587        let query = self.selection.select("completed");
9588        query.execute(self.graphql_client.clone()).await
9589    }
9590    /// Return the description of the generator
9591    pub async fn description(&self) -> Result<String, DaggerError> {
9592        let query = self.selection.select("description");
9593        query.execute(self.graphql_client.clone()).await
9594    }
9595    /// A unique identifier for this Generator.
9596    pub async fn id(&self) -> Result<GeneratorId, DaggerError> {
9597        let query = self.selection.select("id");
9598        query.execute(self.graphql_client.clone()).await
9599    }
9600    /// Wether changeset from the generator execution is empty or not
9601    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9602        let query = self.selection.select("isEmpty");
9603        query.execute(self.graphql_client.clone()).await
9604    }
9605    /// Return the fully qualified name of the generator
9606    pub async fn name(&self) -> Result<String, DaggerError> {
9607        let query = self.selection.select("name");
9608        query.execute(self.graphql_client.clone()).await
9609    }
9610    /// The original module in which the generator has been defined
9611    pub fn original_module(&self) -> Module {
9612        let query = self.selection.select("originalModule");
9613        Module {
9614            proc: self.proc.clone(),
9615            selection: query,
9616            graphql_client: self.graphql_client.clone(),
9617        }
9618    }
9619    /// The path of the generator within its module
9620    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
9621        let query = self.selection.select("path");
9622        query.execute(self.graphql_client.clone()).await
9623    }
9624    /// Execute the generator
9625    pub fn run(&self) -> Generator {
9626        let query = self.selection.select("run");
9627        Generator {
9628            proc: self.proc.clone(),
9629            selection: query,
9630            graphql_client: self.graphql_client.clone(),
9631        }
9632    }
9633}
9634#[derive(Clone)]
9635pub struct GeneratorGroup {
9636    pub proc: Option<Arc<DaggerSessionProc>>,
9637    pub selection: Selection,
9638    pub graphql_client: DynGraphQLClient,
9639}
9640#[derive(Builder, Debug, PartialEq)]
9641pub struct GeneratorGroupChangesOpts {
9642    /// Strategy to apply on conflicts between generators
9643    #[builder(setter(into, strip_option), default)]
9644    pub on_conflict: Option<ChangesetsMergeConflict>,
9645}
9646impl GeneratorGroup {
9647    /// The combined changes from the generators execution
9648    /// If any conflict occurs, for instance if the same file is modified by multiple generators, or if a file is both modified and deleted, an error is raised and the merge of the changesets will failed.
9649    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
9650    ///
9651    /// # Arguments
9652    ///
9653    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9654    pub fn changes(&self) -> Changeset {
9655        let query = self.selection.select("changes");
9656        Changeset {
9657            proc: self.proc.clone(),
9658            selection: query,
9659            graphql_client: self.graphql_client.clone(),
9660        }
9661    }
9662    /// The combined changes from the generators execution
9663    /// If any conflict occurs, for instance if the same file is modified by multiple generators, or if a file is both modified and deleted, an error is raised and the merge of the changesets will failed.
9664    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
9665    ///
9666    /// # Arguments
9667    ///
9668    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9669    pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
9670        let mut query = self.selection.select("changes");
9671        if let Some(on_conflict) = opts.on_conflict {
9672            query = query.arg("onConflict", on_conflict);
9673        }
9674        Changeset {
9675            proc: self.proc.clone(),
9676            selection: query,
9677            graphql_client: self.graphql_client.clone(),
9678        }
9679    }
9680    /// A unique identifier for this GeneratorGroup.
9681    pub async fn id(&self) -> Result<GeneratorGroupId, DaggerError> {
9682        let query = self.selection.select("id");
9683        query.execute(self.graphql_client.clone()).await
9684    }
9685    /// Whether the generated changeset is empty or not
9686    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9687        let query = self.selection.select("isEmpty");
9688        query.execute(self.graphql_client.clone()).await
9689    }
9690    /// Return a list of individual generators and their details
9691    pub fn list(&self) -> Vec<Generator> {
9692        let query = self.selection.select("list");
9693        vec![Generator {
9694            proc: self.proc.clone(),
9695            selection: query,
9696            graphql_client: self.graphql_client.clone(),
9697        }]
9698    }
9699    /// Execute all selected generators
9700    pub fn run(&self) -> GeneratorGroup {
9701        let query = self.selection.select("run");
9702        GeneratorGroup {
9703            proc: self.proc.clone(),
9704            selection: query,
9705            graphql_client: self.graphql_client.clone(),
9706        }
9707    }
9708}
9709#[derive(Clone)]
9710pub struct GitRef {
9711    pub proc: Option<Arc<DaggerSessionProc>>,
9712    pub selection: Selection,
9713    pub graphql_client: DynGraphQLClient,
9714}
9715#[derive(Builder, Debug, PartialEq)]
9716pub struct GitRefTreeOpts {
9717    /// The depth of the tree to fetch.
9718    #[builder(setter(into, strip_option), default)]
9719    pub depth: Option<isize>,
9720    /// Set to true to discard .git directory.
9721    #[builder(setter(into, strip_option), default)]
9722    pub discard_git_dir: Option<bool>,
9723}
9724impl GitRef {
9725    /// The resolved commit id at this ref.
9726    pub async fn commit(&self) -> Result<String, DaggerError> {
9727        let query = self.selection.select("commit");
9728        query.execute(self.graphql_client.clone()).await
9729    }
9730    /// Find the best common ancestor between this ref and another ref.
9731    ///
9732    /// # Arguments
9733    ///
9734    /// * `other` - The other ref to compare against.
9735    pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
9736        let mut query = self.selection.select("commonAncestor");
9737        query = query.arg_lazy(
9738            "other",
9739            Box::new(move || {
9740                let other = other.clone();
9741                Box::pin(async move { other.into_id().await.unwrap().quote() })
9742            }),
9743        );
9744        GitRef {
9745            proc: self.proc.clone(),
9746            selection: query,
9747            graphql_client: self.graphql_client.clone(),
9748        }
9749    }
9750    /// A unique identifier for this GitRef.
9751    pub async fn id(&self) -> Result<GitRefId, DaggerError> {
9752        let query = self.selection.select("id");
9753        query.execute(self.graphql_client.clone()).await
9754    }
9755    /// The resolved ref name at this ref.
9756    pub async fn r#ref(&self) -> Result<String, DaggerError> {
9757        let query = self.selection.select("ref");
9758        query.execute(self.graphql_client.clone()).await
9759    }
9760    /// The filesystem tree at this ref.
9761    ///
9762    /// # Arguments
9763    ///
9764    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9765    pub fn tree(&self) -> Directory {
9766        let query = self.selection.select("tree");
9767        Directory {
9768            proc: self.proc.clone(),
9769            selection: query,
9770            graphql_client: self.graphql_client.clone(),
9771        }
9772    }
9773    /// The filesystem tree at this ref.
9774    ///
9775    /// # Arguments
9776    ///
9777    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9778    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
9779        let mut query = self.selection.select("tree");
9780        if let Some(discard_git_dir) = opts.discard_git_dir {
9781            query = query.arg("discardGitDir", discard_git_dir);
9782        }
9783        if let Some(depth) = opts.depth {
9784            query = query.arg("depth", depth);
9785        }
9786        Directory {
9787            proc: self.proc.clone(),
9788            selection: query,
9789            graphql_client: self.graphql_client.clone(),
9790        }
9791    }
9792}
9793#[derive(Clone)]
9794pub struct GitRepository {
9795    pub proc: Option<Arc<DaggerSessionProc>>,
9796    pub selection: Selection,
9797    pub graphql_client: DynGraphQLClient,
9798}
9799#[derive(Builder, Debug, PartialEq)]
9800pub struct GitRepositoryBranchesOpts<'a> {
9801    /// Glob patterns (e.g., "refs/tags/v*").
9802    #[builder(setter(into, strip_option), default)]
9803    pub patterns: Option<Vec<&'a str>>,
9804}
9805#[derive(Builder, Debug, PartialEq)]
9806pub struct GitRepositoryTagsOpts<'a> {
9807    /// Glob patterns (e.g., "refs/tags/v*").
9808    #[builder(setter(into, strip_option), default)]
9809    pub patterns: Option<Vec<&'a str>>,
9810}
9811impl GitRepository {
9812    /// Returns details of a branch.
9813    ///
9814    /// # Arguments
9815    ///
9816    /// * `name` - Branch's name (e.g., "main").
9817    pub fn branch(&self, name: impl Into<String>) -> GitRef {
9818        let mut query = self.selection.select("branch");
9819        query = query.arg("name", name.into());
9820        GitRef {
9821            proc: self.proc.clone(),
9822            selection: query,
9823            graphql_client: self.graphql_client.clone(),
9824        }
9825    }
9826    /// branches that match any of the given glob patterns.
9827    ///
9828    /// # Arguments
9829    ///
9830    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9831    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
9832        let query = self.selection.select("branches");
9833        query.execute(self.graphql_client.clone()).await
9834    }
9835    /// branches that match any of the given glob patterns.
9836    ///
9837    /// # Arguments
9838    ///
9839    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9840    pub async fn branches_opts<'a>(
9841        &self,
9842        opts: GitRepositoryBranchesOpts<'a>,
9843    ) -> Result<Vec<String>, DaggerError> {
9844        let mut query = self.selection.select("branches");
9845        if let Some(patterns) = opts.patterns {
9846            query = query.arg("patterns", patterns);
9847        }
9848        query.execute(self.graphql_client.clone()).await
9849    }
9850    /// Returns details of a commit.
9851    ///
9852    /// # Arguments
9853    ///
9854    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
9855    pub fn commit(&self, id: impl Into<String>) -> GitRef {
9856        let mut query = self.selection.select("commit");
9857        query = query.arg("id", id.into());
9858        GitRef {
9859            proc: self.proc.clone(),
9860            selection: query,
9861            graphql_client: self.graphql_client.clone(),
9862        }
9863    }
9864    /// Returns details for HEAD.
9865    pub fn head(&self) -> GitRef {
9866        let query = self.selection.select("head");
9867        GitRef {
9868            proc: self.proc.clone(),
9869            selection: query,
9870            graphql_client: self.graphql_client.clone(),
9871        }
9872    }
9873    /// A unique identifier for this GitRepository.
9874    pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
9875        let query = self.selection.select("id");
9876        query.execute(self.graphql_client.clone()).await
9877    }
9878    /// Returns details for the latest semver tag.
9879    pub fn latest_version(&self) -> GitRef {
9880        let query = self.selection.select("latestVersion");
9881        GitRef {
9882            proc: self.proc.clone(),
9883            selection: query,
9884            graphql_client: self.graphql_client.clone(),
9885        }
9886    }
9887    /// Returns details of a ref.
9888    ///
9889    /// # Arguments
9890    ///
9891    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
9892    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
9893        let mut query = self.selection.select("ref");
9894        query = query.arg("name", name.into());
9895        GitRef {
9896            proc: self.proc.clone(),
9897            selection: query,
9898            graphql_client: self.graphql_client.clone(),
9899        }
9900    }
9901    /// Returns details of a tag.
9902    ///
9903    /// # Arguments
9904    ///
9905    /// * `name` - Tag's name (e.g., "v0.3.9").
9906    pub fn tag(&self, name: impl Into<String>) -> GitRef {
9907        let mut query = self.selection.select("tag");
9908        query = query.arg("name", name.into());
9909        GitRef {
9910            proc: self.proc.clone(),
9911            selection: query,
9912            graphql_client: self.graphql_client.clone(),
9913        }
9914    }
9915    /// tags that match any of the given glob patterns.
9916    ///
9917    /// # Arguments
9918    ///
9919    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9920    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
9921        let query = self.selection.select("tags");
9922        query.execute(self.graphql_client.clone()).await
9923    }
9924    /// tags that match any of the given glob patterns.
9925    ///
9926    /// # Arguments
9927    ///
9928    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9929    pub async fn tags_opts<'a>(
9930        &self,
9931        opts: GitRepositoryTagsOpts<'a>,
9932    ) -> Result<Vec<String>, DaggerError> {
9933        let mut query = self.selection.select("tags");
9934        if let Some(patterns) = opts.patterns {
9935            query = query.arg("patterns", patterns);
9936        }
9937        query.execute(self.graphql_client.clone()).await
9938    }
9939    /// Returns the changeset of uncommitted changes in the git repository.
9940    pub fn uncommitted(&self) -> Changeset {
9941        let query = self.selection.select("uncommitted");
9942        Changeset {
9943            proc: self.proc.clone(),
9944            selection: query,
9945            graphql_client: self.graphql_client.clone(),
9946        }
9947    }
9948    /// The URL of the git repository.
9949    pub async fn url(&self) -> Result<String, DaggerError> {
9950        let query = self.selection.select("url");
9951        query.execute(self.graphql_client.clone()).await
9952    }
9953}
9954#[derive(Clone)]
9955pub struct Host {
9956    pub proc: Option<Arc<DaggerSessionProc>>,
9957    pub selection: Selection,
9958    pub graphql_client: DynGraphQLClient,
9959}
9960#[derive(Builder, Debug, PartialEq)]
9961pub struct HostDirectoryOpts<'a> {
9962    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
9963    #[builder(setter(into, strip_option), default)]
9964    pub exclude: Option<Vec<&'a str>>,
9965    /// Apply .gitignore filter rules inside the directory
9966    #[builder(setter(into, strip_option), default)]
9967    pub gitignore: Option<bool>,
9968    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
9969    #[builder(setter(into, strip_option), default)]
9970    pub include: Option<Vec<&'a str>>,
9971    /// If true, the directory will always be reloaded from the host.
9972    #[builder(setter(into, strip_option), default)]
9973    pub no_cache: Option<bool>,
9974}
9975#[derive(Builder, Debug, PartialEq)]
9976pub struct HostFileOpts {
9977    /// If true, the file will always be reloaded from the host.
9978    #[builder(setter(into, strip_option), default)]
9979    pub no_cache: Option<bool>,
9980}
9981#[derive(Builder, Debug, PartialEq)]
9982pub struct HostFindUpOpts {
9983    #[builder(setter(into, strip_option), default)]
9984    pub no_cache: Option<bool>,
9985}
9986#[derive(Builder, Debug, PartialEq)]
9987pub struct HostServiceOpts<'a> {
9988    /// Upstream host to forward traffic to.
9989    #[builder(setter(into, strip_option), default)]
9990    pub host: Option<&'a str>,
9991}
9992#[derive(Builder, Debug, PartialEq)]
9993pub struct HostTunnelOpts {
9994    /// Map each service port to the same port on the host, as if the service were running natively.
9995    /// Note: enabling may result in port conflicts.
9996    #[builder(setter(into, strip_option), default)]
9997    pub native: Option<bool>,
9998    /// Configure explicit port forwarding rules for the tunnel.
9999    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
10000    /// 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.
10001    /// If ports are given and native is true, the ports are additive.
10002    #[builder(setter(into, strip_option), default)]
10003    pub ports: Option<Vec<PortForward>>,
10004}
10005impl Host {
10006    /// Accesses a container image on the host.
10007    ///
10008    /// # Arguments
10009    ///
10010    /// * `name` - Name of the image to access.
10011    pub fn container_image(&self, name: impl Into<String>) -> Container {
10012        let mut query = self.selection.select("containerImage");
10013        query = query.arg("name", name.into());
10014        Container {
10015            proc: self.proc.clone(),
10016            selection: query,
10017            graphql_client: self.graphql_client.clone(),
10018        }
10019    }
10020    /// Accesses a directory on the host.
10021    ///
10022    /// # Arguments
10023    ///
10024    /// * `path` - Location of the directory to access (e.g., ".").
10025    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10026    pub fn directory(&self, path: impl Into<String>) -> Directory {
10027        let mut query = self.selection.select("directory");
10028        query = query.arg("path", path.into());
10029        Directory {
10030            proc: self.proc.clone(),
10031            selection: query,
10032            graphql_client: self.graphql_client.clone(),
10033        }
10034    }
10035    /// Accesses a directory on the host.
10036    ///
10037    /// # Arguments
10038    ///
10039    /// * `path` - Location of the directory to access (e.g., ".").
10040    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10041    pub fn directory_opts<'a>(
10042        &self,
10043        path: impl Into<String>,
10044        opts: HostDirectoryOpts<'a>,
10045    ) -> Directory {
10046        let mut query = self.selection.select("directory");
10047        query = query.arg("path", path.into());
10048        if let Some(exclude) = opts.exclude {
10049            query = query.arg("exclude", exclude);
10050        }
10051        if let Some(include) = opts.include {
10052            query = query.arg("include", include);
10053        }
10054        if let Some(no_cache) = opts.no_cache {
10055            query = query.arg("noCache", no_cache);
10056        }
10057        if let Some(gitignore) = opts.gitignore {
10058            query = query.arg("gitignore", gitignore);
10059        }
10060        Directory {
10061            proc: self.proc.clone(),
10062            selection: query,
10063            graphql_client: self.graphql_client.clone(),
10064        }
10065    }
10066    /// Accesses a file on the host.
10067    ///
10068    /// # Arguments
10069    ///
10070    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10071    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10072    pub fn file(&self, path: impl Into<String>) -> File {
10073        let mut query = self.selection.select("file");
10074        query = query.arg("path", path.into());
10075        File {
10076            proc: self.proc.clone(),
10077            selection: query,
10078            graphql_client: self.graphql_client.clone(),
10079        }
10080    }
10081    /// Accesses a file on the host.
10082    ///
10083    /// # Arguments
10084    ///
10085    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10086    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10087    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
10088        let mut query = self.selection.select("file");
10089        query = query.arg("path", path.into());
10090        if let Some(no_cache) = opts.no_cache {
10091            query = query.arg("noCache", no_cache);
10092        }
10093        File {
10094            proc: self.proc.clone(),
10095            selection: query,
10096            graphql_client: self.graphql_client.clone(),
10097        }
10098    }
10099    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10100    ///
10101    /// # Arguments
10102    ///
10103    /// * `name` - name of the file or directory to search for
10104    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10105    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
10106        let mut query = self.selection.select("findUp");
10107        query = query.arg("name", name.into());
10108        query.execute(self.graphql_client.clone()).await
10109    }
10110    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10111    ///
10112    /// # Arguments
10113    ///
10114    /// * `name` - name of the file or directory to search for
10115    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10116    pub async fn find_up_opts(
10117        &self,
10118        name: impl Into<String>,
10119        opts: HostFindUpOpts,
10120    ) -> Result<String, DaggerError> {
10121        let mut query = self.selection.select("findUp");
10122        query = query.arg("name", name.into());
10123        if let Some(no_cache) = opts.no_cache {
10124            query = query.arg("noCache", no_cache);
10125        }
10126        query.execute(self.graphql_client.clone()).await
10127    }
10128    /// A unique identifier for this Host.
10129    pub async fn id(&self) -> Result<HostId, DaggerError> {
10130        let query = self.selection.select("id");
10131        query.execute(self.graphql_client.clone()).await
10132    }
10133    /// Creates a service that forwards traffic to a specified address via the host.
10134    ///
10135    /// # Arguments
10136    ///
10137    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10138    ///
10139    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10140    ///
10141    /// An empty set of ports is not valid; an error will be returned.
10142    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10143    pub fn service(&self, ports: Vec<PortForward>) -> Service {
10144        let mut query = self.selection.select("service");
10145        query = query.arg("ports", ports);
10146        Service {
10147            proc: self.proc.clone(),
10148            selection: query,
10149            graphql_client: self.graphql_client.clone(),
10150        }
10151    }
10152    /// Creates a service that forwards traffic to a specified address via the host.
10153    ///
10154    /// # Arguments
10155    ///
10156    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10157    ///
10158    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10159    ///
10160    /// An empty set of ports is not valid; an error will be returned.
10161    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10162    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
10163        let mut query = self.selection.select("service");
10164        query = query.arg("ports", ports);
10165        if let Some(host) = opts.host {
10166            query = query.arg("host", host);
10167        }
10168        Service {
10169            proc: self.proc.clone(),
10170            selection: query,
10171            graphql_client: self.graphql_client.clone(),
10172        }
10173    }
10174    /// Creates a tunnel that forwards traffic from the host to a service.
10175    ///
10176    /// # Arguments
10177    ///
10178    /// * `service` - Service to send traffic from the tunnel.
10179    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10180    pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
10181        let mut query = self.selection.select("tunnel");
10182        query = query.arg_lazy(
10183            "service",
10184            Box::new(move || {
10185                let service = service.clone();
10186                Box::pin(async move { service.into_id().await.unwrap().quote() })
10187            }),
10188        );
10189        Service {
10190            proc: self.proc.clone(),
10191            selection: query,
10192            graphql_client: self.graphql_client.clone(),
10193        }
10194    }
10195    /// Creates a tunnel that forwards traffic from the host to a service.
10196    ///
10197    /// # Arguments
10198    ///
10199    /// * `service` - Service to send traffic from the tunnel.
10200    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10201    pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
10202        let mut query = self.selection.select("tunnel");
10203        query = query.arg_lazy(
10204            "service",
10205            Box::new(move || {
10206                let service = service.clone();
10207                Box::pin(async move { service.into_id().await.unwrap().quote() })
10208            }),
10209        );
10210        if let Some(native) = opts.native {
10211            query = query.arg("native", native);
10212        }
10213        if let Some(ports) = opts.ports {
10214            query = query.arg("ports", ports);
10215        }
10216        Service {
10217            proc: self.proc.clone(),
10218            selection: query,
10219            graphql_client: self.graphql_client.clone(),
10220        }
10221    }
10222    /// Accesses a Unix socket on the host.
10223    ///
10224    /// # Arguments
10225    ///
10226    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
10227    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
10228        let mut query = self.selection.select("unixSocket");
10229        query = query.arg("path", path.into());
10230        Socket {
10231            proc: self.proc.clone(),
10232            selection: query,
10233            graphql_client: self.graphql_client.clone(),
10234        }
10235    }
10236}
10237#[derive(Clone)]
10238pub struct InputTypeDef {
10239    pub proc: Option<Arc<DaggerSessionProc>>,
10240    pub selection: Selection,
10241    pub graphql_client: DynGraphQLClient,
10242}
10243impl InputTypeDef {
10244    /// Static fields defined on this input object, if any.
10245    pub fn fields(&self) -> Vec<FieldTypeDef> {
10246        let query = self.selection.select("fields");
10247        vec![FieldTypeDef {
10248            proc: self.proc.clone(),
10249            selection: query,
10250            graphql_client: self.graphql_client.clone(),
10251        }]
10252    }
10253    /// A unique identifier for this InputTypeDef.
10254    pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
10255        let query = self.selection.select("id");
10256        query.execute(self.graphql_client.clone()).await
10257    }
10258    /// The name of the input object.
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}
10264#[derive(Clone)]
10265pub struct InterfaceTypeDef {
10266    pub proc: Option<Arc<DaggerSessionProc>>,
10267    pub selection: Selection,
10268    pub graphql_client: DynGraphQLClient,
10269}
10270impl InterfaceTypeDef {
10271    /// The doc string for the interface, if any.
10272    pub async fn description(&self) -> Result<String, DaggerError> {
10273        let query = self.selection.select("description");
10274        query.execute(self.graphql_client.clone()).await
10275    }
10276    /// Functions defined on this interface, if any.
10277    pub fn functions(&self) -> Vec<Function> {
10278        let query = self.selection.select("functions");
10279        vec![Function {
10280            proc: self.proc.clone(),
10281            selection: query,
10282            graphql_client: self.graphql_client.clone(),
10283        }]
10284    }
10285    /// A unique identifier for this InterfaceTypeDef.
10286    pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
10287        let query = self.selection.select("id");
10288        query.execute(self.graphql_client.clone()).await
10289    }
10290    /// The name of the interface.
10291    pub async fn name(&self) -> Result<String, DaggerError> {
10292        let query = self.selection.select("name");
10293        query.execute(self.graphql_client.clone()).await
10294    }
10295    /// The location of this interface declaration.
10296    pub fn source_map(&self) -> SourceMap {
10297        let query = self.selection.select("sourceMap");
10298        SourceMap {
10299            proc: self.proc.clone(),
10300            selection: query,
10301            graphql_client: self.graphql_client.clone(),
10302        }
10303    }
10304    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
10305    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10306        let query = self.selection.select("sourceModuleName");
10307        query.execute(self.graphql_client.clone()).await
10308    }
10309}
10310#[derive(Clone)]
10311pub struct JsonValue {
10312    pub proc: Option<Arc<DaggerSessionProc>>,
10313    pub selection: Selection,
10314    pub graphql_client: DynGraphQLClient,
10315}
10316#[derive(Builder, Debug, PartialEq)]
10317pub struct JsonValueContentsOpts<'a> {
10318    /// Optional line prefix
10319    #[builder(setter(into, strip_option), default)]
10320    pub indent: Option<&'a str>,
10321    /// Pretty-print
10322    #[builder(setter(into, strip_option), default)]
10323    pub pretty: Option<bool>,
10324}
10325impl JsonValue {
10326    /// Decode an array from json
10327    pub fn as_array(&self) -> Vec<JsonValue> {
10328        let query = self.selection.select("asArray");
10329        vec![JsonValue {
10330            proc: self.proc.clone(),
10331            selection: query,
10332            graphql_client: self.graphql_client.clone(),
10333        }]
10334    }
10335    /// Decode a boolean from json
10336    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10337        let query = self.selection.select("asBoolean");
10338        query.execute(self.graphql_client.clone()).await
10339    }
10340    /// Decode an integer from json
10341    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10342        let query = self.selection.select("asInteger");
10343        query.execute(self.graphql_client.clone()).await
10344    }
10345    /// Decode a string from json
10346    pub async fn as_string(&self) -> Result<String, DaggerError> {
10347        let query = self.selection.select("asString");
10348        query.execute(self.graphql_client.clone()).await
10349    }
10350    /// Return the value encoded as json
10351    ///
10352    /// # Arguments
10353    ///
10354    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10355    pub async fn contents(&self) -> Result<Json, DaggerError> {
10356        let query = self.selection.select("contents");
10357        query.execute(self.graphql_client.clone()).await
10358    }
10359    /// Return the value encoded as json
10360    ///
10361    /// # Arguments
10362    ///
10363    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10364    pub async fn contents_opts<'a>(
10365        &self,
10366        opts: JsonValueContentsOpts<'a>,
10367    ) -> Result<Json, DaggerError> {
10368        let mut query = self.selection.select("contents");
10369        if let Some(pretty) = opts.pretty {
10370            query = query.arg("pretty", pretty);
10371        }
10372        if let Some(indent) = opts.indent {
10373            query = query.arg("indent", indent);
10374        }
10375        query.execute(self.graphql_client.clone()).await
10376    }
10377    /// Lookup the field at the given path, and return its value.
10378    ///
10379    /// # Arguments
10380    ///
10381    /// * `path` - Path of the field to lookup, encoded as an array of field names
10382    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
10383        let mut query = self.selection.select("field");
10384        query = query.arg(
10385            "path",
10386            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10387        );
10388        JsonValue {
10389            proc: self.proc.clone(),
10390            selection: query,
10391            graphql_client: self.graphql_client.clone(),
10392        }
10393    }
10394    /// List fields of the encoded object
10395    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
10396        let query = self.selection.select("fields");
10397        query.execute(self.graphql_client.clone()).await
10398    }
10399    /// A unique identifier for this JSONValue.
10400    pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
10401        let query = self.selection.select("id");
10402        query.execute(self.graphql_client.clone()).await
10403    }
10404    /// Encode a boolean to json
10405    ///
10406    /// # Arguments
10407    ///
10408    /// * `value` - New boolean value
10409    pub fn new_boolean(&self, value: bool) -> JsonValue {
10410        let mut query = self.selection.select("newBoolean");
10411        query = query.arg("value", value);
10412        JsonValue {
10413            proc: self.proc.clone(),
10414            selection: query,
10415            graphql_client: self.graphql_client.clone(),
10416        }
10417    }
10418    /// Encode an integer to json
10419    ///
10420    /// # Arguments
10421    ///
10422    /// * `value` - New integer value
10423    pub fn new_integer(&self, value: isize) -> JsonValue {
10424        let mut query = self.selection.select("newInteger");
10425        query = query.arg("value", value);
10426        JsonValue {
10427            proc: self.proc.clone(),
10428            selection: query,
10429            graphql_client: self.graphql_client.clone(),
10430        }
10431    }
10432    /// Encode a string to json
10433    ///
10434    /// # Arguments
10435    ///
10436    /// * `value` - New string value
10437    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
10438        let mut query = self.selection.select("newString");
10439        query = query.arg("value", value.into());
10440        JsonValue {
10441            proc: self.proc.clone(),
10442            selection: query,
10443            graphql_client: self.graphql_client.clone(),
10444        }
10445    }
10446    /// Return a new json value, decoded from the given content
10447    ///
10448    /// # Arguments
10449    ///
10450    /// * `contents` - New JSON-encoded contents
10451    pub fn with_contents(&self, contents: Json) -> JsonValue {
10452        let mut query = self.selection.select("withContents");
10453        query = query.arg("contents", contents);
10454        JsonValue {
10455            proc: self.proc.clone(),
10456            selection: query,
10457            graphql_client: self.graphql_client.clone(),
10458        }
10459    }
10460    /// Set a new field at the given path
10461    ///
10462    /// # Arguments
10463    ///
10464    /// * `path` - Path of the field to set, encoded as an array of field names
10465    /// * `value` - The new value of the field
10466    pub fn with_field(
10467        &self,
10468        path: Vec<impl Into<String>>,
10469        value: impl IntoID<JsonValueId>,
10470    ) -> JsonValue {
10471        let mut query = self.selection.select("withField");
10472        query = query.arg(
10473            "path",
10474            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10475        );
10476        query = query.arg_lazy(
10477            "value",
10478            Box::new(move || {
10479                let value = value.clone();
10480                Box::pin(async move { value.into_id().await.unwrap().quote() })
10481            }),
10482        );
10483        JsonValue {
10484            proc: self.proc.clone(),
10485            selection: query,
10486            graphql_client: self.graphql_client.clone(),
10487        }
10488    }
10489}
10490#[derive(Clone)]
10491pub struct Llm {
10492    pub proc: Option<Arc<DaggerSessionProc>>,
10493    pub selection: Selection,
10494    pub graphql_client: DynGraphQLClient,
10495}
10496impl Llm {
10497    /// create a branch in the LLM's history
10498    pub fn attempt(&self, number: isize) -> Llm {
10499        let mut query = self.selection.select("attempt");
10500        query = query.arg("number", number);
10501        Llm {
10502            proc: self.proc.clone(),
10503            selection: query,
10504            graphql_client: self.graphql_client.clone(),
10505        }
10506    }
10507    /// returns the type of the current state
10508    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
10509        let mut query = self.selection.select("bindResult");
10510        query = query.arg("name", name.into());
10511        Binding {
10512            proc: self.proc.clone(),
10513            selection: query,
10514            graphql_client: self.graphql_client.clone(),
10515        }
10516    }
10517    /// return the LLM's current environment
10518    pub fn env(&self) -> Env {
10519        let query = self.selection.select("env");
10520        Env {
10521            proc: self.proc.clone(),
10522            selection: query,
10523            graphql_client: self.graphql_client.clone(),
10524        }
10525    }
10526    /// Indicates whether there are any queued prompts or tool results to send to the model
10527    pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
10528        let query = self.selection.select("hasPrompt");
10529        query.execute(self.graphql_client.clone()).await
10530    }
10531    /// return the llm message history
10532    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
10533        let query = self.selection.select("history");
10534        query.execute(self.graphql_client.clone()).await
10535    }
10536    /// return the raw llm message history as json
10537    pub async fn history_json(&self) -> Result<Json, DaggerError> {
10538        let query = self.selection.select("historyJSON");
10539        query.execute(self.graphql_client.clone()).await
10540    }
10541    /// A unique identifier for this LLM.
10542    pub async fn id(&self) -> Result<Llmid, DaggerError> {
10543        let query = self.selection.select("id");
10544        query.execute(self.graphql_client.clone()).await
10545    }
10546    /// return the last llm reply from the history
10547    pub async fn last_reply(&self) -> Result<String, DaggerError> {
10548        let query = self.selection.select("lastReply");
10549        query.execute(self.graphql_client.clone()).await
10550    }
10551    /// Submit the queued prompt, evaluate any tool calls, queue their results, and keep going until the model ends its turn
10552    pub fn r#loop(&self) -> Llm {
10553        let query = self.selection.select("loop");
10554        Llm {
10555            proc: self.proc.clone(),
10556            selection: query,
10557            graphql_client: self.graphql_client.clone(),
10558        }
10559    }
10560    /// return the model used by the llm
10561    pub async fn model(&self) -> Result<String, DaggerError> {
10562        let query = self.selection.select("model");
10563        query.execute(self.graphql_client.clone()).await
10564    }
10565    /// return the provider used by the llm
10566    pub async fn provider(&self) -> Result<String, DaggerError> {
10567        let query = self.selection.select("provider");
10568        query.execute(self.graphql_client.clone()).await
10569    }
10570    /// Submit the queued prompt or tool call results, evaluate any tool calls, and queue their results
10571    pub async fn step(&self) -> Result<Llmid, DaggerError> {
10572        let query = self.selection.select("step");
10573        query.execute(self.graphql_client.clone()).await
10574    }
10575    /// synchronize LLM state
10576    pub async fn sync(&self) -> Result<Llmid, DaggerError> {
10577        let query = self.selection.select("sync");
10578        query.execute(self.graphql_client.clone()).await
10579    }
10580    /// returns the token usage of the current state
10581    pub fn token_usage(&self) -> LlmTokenUsage {
10582        let query = self.selection.select("tokenUsage");
10583        LlmTokenUsage {
10584            proc: self.proc.clone(),
10585            selection: query,
10586            graphql_client: self.graphql_client.clone(),
10587        }
10588    }
10589    /// print documentation for available tools
10590    pub async fn tools(&self) -> Result<String, DaggerError> {
10591        let query = self.selection.select("tools");
10592        query.execute(self.graphql_client.clone()).await
10593    }
10594    /// Return a new LLM with the specified function no longer exposed as a tool
10595    ///
10596    /// # Arguments
10597    ///
10598    /// * `type_name` - The type name whose function will be blocked
10599    /// * `function` - The function to block
10600    ///
10601    /// Will be converted to lowerCamelCase if necessary.
10602    pub fn with_blocked_function(
10603        &self,
10604        type_name: impl Into<String>,
10605        function: impl Into<String>,
10606    ) -> Llm {
10607        let mut query = self.selection.select("withBlockedFunction");
10608        query = query.arg("typeName", type_name.into());
10609        query = query.arg("function", function.into());
10610        Llm {
10611            proc: self.proc.clone(),
10612            selection: query,
10613            graphql_client: self.graphql_client.clone(),
10614        }
10615    }
10616    /// allow the LLM to interact with an environment via MCP
10617    pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
10618        let mut query = self.selection.select("withEnv");
10619        query = query.arg_lazy(
10620            "env",
10621            Box::new(move || {
10622                let env = env.clone();
10623                Box::pin(async move { env.into_id().await.unwrap().quote() })
10624            }),
10625        );
10626        Llm {
10627            proc: self.proc.clone(),
10628            selection: query,
10629            graphql_client: self.graphql_client.clone(),
10630        }
10631    }
10632    /// Add an external MCP server to the LLM
10633    ///
10634    /// # Arguments
10635    ///
10636    /// * `name` - The name of the MCP server
10637    /// * `service` - The MCP service to run and communicate with over stdio
10638    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<ServiceId>) -> Llm {
10639        let mut query = self.selection.select("withMCPServer");
10640        query = query.arg("name", name.into());
10641        query = query.arg_lazy(
10642            "service",
10643            Box::new(move || {
10644                let service = service.clone();
10645                Box::pin(async move { service.into_id().await.unwrap().quote() })
10646            }),
10647        );
10648        Llm {
10649            proc: self.proc.clone(),
10650            selection: query,
10651            graphql_client: self.graphql_client.clone(),
10652        }
10653    }
10654    /// swap out the llm model
10655    ///
10656    /// # Arguments
10657    ///
10658    /// * `model` - The model to use
10659    pub fn with_model(&self, model: impl Into<String>) -> Llm {
10660        let mut query = self.selection.select("withModel");
10661        query = query.arg("model", model.into());
10662        Llm {
10663            proc: self.proc.clone(),
10664            selection: query,
10665            graphql_client: self.graphql_client.clone(),
10666        }
10667    }
10668    /// append a prompt to the llm context
10669    ///
10670    /// # Arguments
10671    ///
10672    /// * `prompt` - The prompt to send
10673    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
10674        let mut query = self.selection.select("withPrompt");
10675        query = query.arg("prompt", prompt.into());
10676        Llm {
10677            proc: self.proc.clone(),
10678            selection: query,
10679            graphql_client: self.graphql_client.clone(),
10680        }
10681    }
10682    /// append the contents of a file to the llm context
10683    ///
10684    /// # Arguments
10685    ///
10686    /// * `file` - The file to read the prompt from
10687    pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
10688        let mut query = self.selection.select("withPromptFile");
10689        query = query.arg_lazy(
10690            "file",
10691            Box::new(move || {
10692                let file = file.clone();
10693                Box::pin(async move { file.into_id().await.unwrap().quote() })
10694            }),
10695        );
10696        Llm {
10697            proc: self.proc.clone(),
10698            selection: query,
10699            graphql_client: self.graphql_client.clone(),
10700        }
10701    }
10702    /// Use a static set of tools for method calls, e.g. for MCP clients that do not support dynamic tool registration
10703    pub fn with_static_tools(&self) -> Llm {
10704        let query = self.selection.select("withStaticTools");
10705        Llm {
10706            proc: self.proc.clone(),
10707            selection: query,
10708            graphql_client: self.graphql_client.clone(),
10709        }
10710    }
10711    /// Add a system prompt to the LLM's environment
10712    ///
10713    /// # Arguments
10714    ///
10715    /// * `prompt` - The system prompt to send
10716    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
10717        let mut query = self.selection.select("withSystemPrompt");
10718        query = query.arg("prompt", prompt.into());
10719        Llm {
10720            proc: self.proc.clone(),
10721            selection: query,
10722            graphql_client: self.graphql_client.clone(),
10723        }
10724    }
10725    /// Disable the default system prompt
10726    pub fn without_default_system_prompt(&self) -> Llm {
10727        let query = self.selection.select("withoutDefaultSystemPrompt");
10728        Llm {
10729            proc: self.proc.clone(),
10730            selection: query,
10731            graphql_client: self.graphql_client.clone(),
10732        }
10733    }
10734    /// Clear the message history, leaving only the system prompts
10735    pub fn without_message_history(&self) -> Llm {
10736        let query = self.selection.select("withoutMessageHistory");
10737        Llm {
10738            proc: self.proc.clone(),
10739            selection: query,
10740            graphql_client: self.graphql_client.clone(),
10741        }
10742    }
10743    /// Clear the system prompts, leaving only the default system prompt
10744    pub fn without_system_prompts(&self) -> Llm {
10745        let query = self.selection.select("withoutSystemPrompts");
10746        Llm {
10747            proc: self.proc.clone(),
10748            selection: query,
10749            graphql_client: self.graphql_client.clone(),
10750        }
10751    }
10752}
10753#[derive(Clone)]
10754pub struct LlmTokenUsage {
10755    pub proc: Option<Arc<DaggerSessionProc>>,
10756    pub selection: Selection,
10757    pub graphql_client: DynGraphQLClient,
10758}
10759impl LlmTokenUsage {
10760    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
10761        let query = self.selection.select("cachedTokenReads");
10762        query.execute(self.graphql_client.clone()).await
10763    }
10764    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
10765        let query = self.selection.select("cachedTokenWrites");
10766        query.execute(self.graphql_client.clone()).await
10767    }
10768    /// A unique identifier for this LLMTokenUsage.
10769    pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
10770        let query = self.selection.select("id");
10771        query.execute(self.graphql_client.clone()).await
10772    }
10773    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
10774        let query = self.selection.select("inputTokens");
10775        query.execute(self.graphql_client.clone()).await
10776    }
10777    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
10778        let query = self.selection.select("outputTokens");
10779        query.execute(self.graphql_client.clone()).await
10780    }
10781    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
10782        let query = self.selection.select("totalTokens");
10783        query.execute(self.graphql_client.clone()).await
10784    }
10785}
10786#[derive(Clone)]
10787pub struct Label {
10788    pub proc: Option<Arc<DaggerSessionProc>>,
10789    pub selection: Selection,
10790    pub graphql_client: DynGraphQLClient,
10791}
10792impl Label {
10793    /// A unique identifier for this Label.
10794    pub async fn id(&self) -> Result<LabelId, DaggerError> {
10795        let query = self.selection.select("id");
10796        query.execute(self.graphql_client.clone()).await
10797    }
10798    /// The label name.
10799    pub async fn name(&self) -> Result<String, DaggerError> {
10800        let query = self.selection.select("name");
10801        query.execute(self.graphql_client.clone()).await
10802    }
10803    /// The label value.
10804    pub async fn value(&self) -> Result<String, DaggerError> {
10805        let query = self.selection.select("value");
10806        query.execute(self.graphql_client.clone()).await
10807    }
10808}
10809#[derive(Clone)]
10810pub struct ListTypeDef {
10811    pub proc: Option<Arc<DaggerSessionProc>>,
10812    pub selection: Selection,
10813    pub graphql_client: DynGraphQLClient,
10814}
10815impl ListTypeDef {
10816    /// The type of the elements in the list.
10817    pub fn element_type_def(&self) -> TypeDef {
10818        let query = self.selection.select("elementTypeDef");
10819        TypeDef {
10820            proc: self.proc.clone(),
10821            selection: query,
10822            graphql_client: self.graphql_client.clone(),
10823        }
10824    }
10825    /// A unique identifier for this ListTypeDef.
10826    pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
10827        let query = self.selection.select("id");
10828        query.execute(self.graphql_client.clone()).await
10829    }
10830}
10831#[derive(Clone)]
10832pub struct Module {
10833    pub proc: Option<Arc<DaggerSessionProc>>,
10834    pub selection: Selection,
10835    pub graphql_client: DynGraphQLClient,
10836}
10837#[derive(Builder, Debug, PartialEq)]
10838pub struct ModuleChecksOpts<'a> {
10839    /// Only include checks matching the specified patterns
10840    #[builder(setter(into, strip_option), default)]
10841    pub include: Option<Vec<&'a str>>,
10842}
10843#[derive(Builder, Debug, PartialEq)]
10844pub struct ModuleGeneratorsOpts<'a> {
10845    /// Only include generators matching the specified patterns
10846    #[builder(setter(into, strip_option), default)]
10847    pub include: Option<Vec<&'a str>>,
10848}
10849#[derive(Builder, Debug, PartialEq)]
10850pub struct ModuleServeOpts {
10851    /// Expose the dependencies of this module to the client
10852    #[builder(setter(into, strip_option), default)]
10853    pub include_dependencies: Option<bool>,
10854}
10855impl Module {
10856    /// Return the check defined by the module with the given name. Must match to exactly one check.
10857    ///
10858    /// # Arguments
10859    ///
10860    /// * `name` - The name of the check to retrieve
10861    pub fn check(&self, name: impl Into<String>) -> Check {
10862        let mut query = self.selection.select("check");
10863        query = query.arg("name", name.into());
10864        Check {
10865            proc: self.proc.clone(),
10866            selection: query,
10867            graphql_client: self.graphql_client.clone(),
10868        }
10869    }
10870    /// Return all checks defined by the module
10871    ///
10872    /// # Arguments
10873    ///
10874    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10875    pub fn checks(&self) -> CheckGroup {
10876        let query = self.selection.select("checks");
10877        CheckGroup {
10878            proc: self.proc.clone(),
10879            selection: query,
10880            graphql_client: self.graphql_client.clone(),
10881        }
10882    }
10883    /// Return all checks defined by the module
10884    ///
10885    /// # Arguments
10886    ///
10887    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10888    pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
10889        let mut query = self.selection.select("checks");
10890        if let Some(include) = opts.include {
10891            query = query.arg("include", include);
10892        }
10893        CheckGroup {
10894            proc: self.proc.clone(),
10895            selection: query,
10896            graphql_client: self.graphql_client.clone(),
10897        }
10898    }
10899    /// The dependencies of the module.
10900    pub fn dependencies(&self) -> Vec<Module> {
10901        let query = self.selection.select("dependencies");
10902        vec![Module {
10903            proc: self.proc.clone(),
10904            selection: query,
10905            graphql_client: self.graphql_client.clone(),
10906        }]
10907    }
10908    /// The doc string of the module, if any
10909    pub async fn description(&self) -> Result<String, DaggerError> {
10910        let query = self.selection.select("description");
10911        query.execute(self.graphql_client.clone()).await
10912    }
10913    /// Enumerations served by this module.
10914    pub fn enums(&self) -> Vec<TypeDef> {
10915        let query = self.selection.select("enums");
10916        vec![TypeDef {
10917            proc: self.proc.clone(),
10918            selection: query,
10919            graphql_client: self.graphql_client.clone(),
10920        }]
10921    }
10922    /// The generated files and directories made on top of the module source's context directory.
10923    pub fn generated_context_directory(&self) -> Directory {
10924        let query = self.selection.select("generatedContextDirectory");
10925        Directory {
10926            proc: self.proc.clone(),
10927            selection: query,
10928            graphql_client: self.graphql_client.clone(),
10929        }
10930    }
10931    /// Return the generator defined by the module with the given name. Must match to exactly one generator.
10932    ///
10933    /// # Arguments
10934    ///
10935    /// * `name` - The name of the generator to retrieve
10936    pub fn generator(&self, name: impl Into<String>) -> Generator {
10937        let mut query = self.selection.select("generator");
10938        query = query.arg("name", name.into());
10939        Generator {
10940            proc: self.proc.clone(),
10941            selection: query,
10942            graphql_client: self.graphql_client.clone(),
10943        }
10944    }
10945    /// Return all generators defined by the module
10946    ///
10947    /// # Arguments
10948    ///
10949    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10950    pub fn generators(&self) -> GeneratorGroup {
10951        let query = self.selection.select("generators");
10952        GeneratorGroup {
10953            proc: self.proc.clone(),
10954            selection: query,
10955            graphql_client: self.graphql_client.clone(),
10956        }
10957    }
10958    /// Return all generators defined by the module
10959    ///
10960    /// # Arguments
10961    ///
10962    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10963    pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
10964        let mut query = self.selection.select("generators");
10965        if let Some(include) = opts.include {
10966            query = query.arg("include", include);
10967        }
10968        GeneratorGroup {
10969            proc: self.proc.clone(),
10970            selection: query,
10971            graphql_client: self.graphql_client.clone(),
10972        }
10973    }
10974    /// A unique identifier for this Module.
10975    pub async fn id(&self) -> Result<ModuleId, DaggerError> {
10976        let query = self.selection.select("id");
10977        query.execute(self.graphql_client.clone()).await
10978    }
10979    /// Interfaces served by this module.
10980    pub fn interfaces(&self) -> Vec<TypeDef> {
10981        let query = self.selection.select("interfaces");
10982        vec![TypeDef {
10983            proc: self.proc.clone(),
10984            selection: query,
10985            graphql_client: self.graphql_client.clone(),
10986        }]
10987    }
10988    /// The introspection schema JSON file for this module.
10989    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
10990    /// Note: this is in the context of a module, so some core types may be hidden.
10991    pub fn introspection_schema_json(&self) -> File {
10992        let query = self.selection.select("introspectionSchemaJSON");
10993        File {
10994            proc: self.proc.clone(),
10995            selection: query,
10996            graphql_client: self.graphql_client.clone(),
10997        }
10998    }
10999    /// The name of the module
11000    pub async fn name(&self) -> Result<String, DaggerError> {
11001        let query = self.selection.select("name");
11002        query.execute(self.graphql_client.clone()).await
11003    }
11004    /// Objects served by this module.
11005    pub fn objects(&self) -> Vec<TypeDef> {
11006        let query = self.selection.select("objects");
11007        vec![TypeDef {
11008            proc: self.proc.clone(),
11009            selection: query,
11010            graphql_client: self.graphql_client.clone(),
11011        }]
11012    }
11013    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
11014    pub fn runtime(&self) -> Container {
11015        let query = self.selection.select("runtime");
11016        Container {
11017            proc: self.proc.clone(),
11018            selection: query,
11019            graphql_client: self.graphql_client.clone(),
11020        }
11021    }
11022    /// The SDK config used by this module.
11023    pub fn sdk(&self) -> SdkConfig {
11024        let query = self.selection.select("sdk");
11025        SdkConfig {
11026            proc: self.proc.clone(),
11027            selection: query,
11028            graphql_client: self.graphql_client.clone(),
11029        }
11030    }
11031    /// Serve a module's API in the current session.
11032    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11033    ///
11034    /// # Arguments
11035    ///
11036    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11037    pub async fn serve(&self) -> Result<Void, DaggerError> {
11038        let query = self.selection.select("serve");
11039        query.execute(self.graphql_client.clone()).await
11040    }
11041    /// Serve a module's API in the current session.
11042    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11043    ///
11044    /// # Arguments
11045    ///
11046    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11047    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
11048        let mut query = self.selection.select("serve");
11049        if let Some(include_dependencies) = opts.include_dependencies {
11050            query = query.arg("includeDependencies", include_dependencies);
11051        }
11052        query.execute(self.graphql_client.clone()).await
11053    }
11054    /// The source for the module.
11055    pub fn source(&self) -> ModuleSource {
11056        let query = self.selection.select("source");
11057        ModuleSource {
11058            proc: self.proc.clone(),
11059            selection: query,
11060            graphql_client: self.graphql_client.clone(),
11061        }
11062    }
11063    /// Forces evaluation of the module, including any loading into the engine and associated validation.
11064    pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
11065        let query = self.selection.select("sync");
11066        query.execute(self.graphql_client.clone()).await
11067    }
11068    /// User-defined default values, loaded from local .env files.
11069    pub fn user_defaults(&self) -> EnvFile {
11070        let query = self.selection.select("userDefaults");
11071        EnvFile {
11072            proc: self.proc.clone(),
11073            selection: query,
11074            graphql_client: self.graphql_client.clone(),
11075        }
11076    }
11077    /// Retrieves the module with the given description
11078    ///
11079    /// # Arguments
11080    ///
11081    /// * `description` - The description to set
11082    pub fn with_description(&self, description: impl Into<String>) -> Module {
11083        let mut query = self.selection.select("withDescription");
11084        query = query.arg("description", description.into());
11085        Module {
11086            proc: self.proc.clone(),
11087            selection: query,
11088            graphql_client: self.graphql_client.clone(),
11089        }
11090    }
11091    /// This module plus the given Enum type and associated values
11092    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
11093        let mut query = self.selection.select("withEnum");
11094        query = query.arg_lazy(
11095            "enum",
11096            Box::new(move || {
11097                let r#enum = r#enum.clone();
11098                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
11099            }),
11100        );
11101        Module {
11102            proc: self.proc.clone(),
11103            selection: query,
11104            graphql_client: self.graphql_client.clone(),
11105        }
11106    }
11107    /// This module plus the given Interface type and associated functions
11108    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
11109        let mut query = self.selection.select("withInterface");
11110        query = query.arg_lazy(
11111            "iface",
11112            Box::new(move || {
11113                let iface = iface.clone();
11114                Box::pin(async move { iface.into_id().await.unwrap().quote() })
11115            }),
11116        );
11117        Module {
11118            proc: self.proc.clone(),
11119            selection: query,
11120            graphql_client: self.graphql_client.clone(),
11121        }
11122    }
11123    /// This module plus the given Object type and associated functions.
11124    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
11125        let mut query = self.selection.select("withObject");
11126        query = query.arg_lazy(
11127            "object",
11128            Box::new(move || {
11129                let object = object.clone();
11130                Box::pin(async move { object.into_id().await.unwrap().quote() })
11131            }),
11132        );
11133        Module {
11134            proc: self.proc.clone(),
11135            selection: query,
11136            graphql_client: self.graphql_client.clone(),
11137        }
11138    }
11139}
11140#[derive(Clone)]
11141pub struct ModuleConfigClient {
11142    pub proc: Option<Arc<DaggerSessionProc>>,
11143    pub selection: Selection,
11144    pub graphql_client: DynGraphQLClient,
11145}
11146impl ModuleConfigClient {
11147    /// The directory the client is generated in.
11148    pub async fn directory(&self) -> Result<String, DaggerError> {
11149        let query = self.selection.select("directory");
11150        query.execute(self.graphql_client.clone()).await
11151    }
11152    /// The generator to use
11153    pub async fn generator(&self) -> Result<String, DaggerError> {
11154        let query = self.selection.select("generator");
11155        query.execute(self.graphql_client.clone()).await
11156    }
11157    /// A unique identifier for this ModuleConfigClient.
11158    pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
11159        let query = self.selection.select("id");
11160        query.execute(self.graphql_client.clone()).await
11161    }
11162}
11163#[derive(Clone)]
11164pub struct ModuleSource {
11165    pub proc: Option<Arc<DaggerSessionProc>>,
11166    pub selection: Selection,
11167    pub graphql_client: DynGraphQLClient,
11168}
11169impl ModuleSource {
11170    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
11171    pub fn as_module(&self) -> Module {
11172        let query = self.selection.select("asModule");
11173        Module {
11174            proc: self.proc.clone(),
11175            selection: query,
11176            graphql_client: self.graphql_client.clone(),
11177        }
11178    }
11179    /// A human readable ref string representation of this module source.
11180    pub async fn as_string(&self) -> Result<String, DaggerError> {
11181        let query = self.selection.select("asString");
11182        query.execute(self.graphql_client.clone()).await
11183    }
11184    /// The blueprint referenced by the module source.
11185    pub fn blueprint(&self) -> ModuleSource {
11186        let query = self.selection.select("blueprint");
11187        ModuleSource {
11188            proc: self.proc.clone(),
11189            selection: query,
11190            graphql_client: self.graphql_client.clone(),
11191        }
11192    }
11193    /// The ref to clone the root of the git repo from. Only valid for git sources.
11194    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
11195        let query = self.selection.select("cloneRef");
11196        query.execute(self.graphql_client.clone()).await
11197    }
11198    /// The resolved commit of the git repo this source points to.
11199    pub async fn commit(&self) -> Result<String, DaggerError> {
11200        let query = self.selection.select("commit");
11201        query.execute(self.graphql_client.clone()).await
11202    }
11203    /// The clients generated for the module.
11204    pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
11205        let query = self.selection.select("configClients");
11206        vec![ModuleConfigClient {
11207            proc: self.proc.clone(),
11208            selection: query,
11209            graphql_client: self.graphql_client.clone(),
11210        }]
11211    }
11212    /// Whether an existing dagger.json for the module was found.
11213    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
11214        let query = self.selection.select("configExists");
11215        query.execute(self.graphql_client.clone()).await
11216    }
11217    /// The full directory loaded for the module source, including the source code as a subdirectory.
11218    pub fn context_directory(&self) -> Directory {
11219        let query = self.selection.select("contextDirectory");
11220        Directory {
11221            proc: self.proc.clone(),
11222            selection: query,
11223            graphql_client: self.graphql_client.clone(),
11224        }
11225    }
11226    /// The dependencies of the module source.
11227    pub fn dependencies(&self) -> Vec<ModuleSource> {
11228        let query = self.selection.select("dependencies");
11229        vec![ModuleSource {
11230            proc: self.proc.clone(),
11231            selection: query,
11232            graphql_client: self.graphql_client.clone(),
11233        }]
11234    }
11235    /// 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.
11236    pub async fn digest(&self) -> Result<String, DaggerError> {
11237        let query = self.selection.select("digest");
11238        query.execute(self.graphql_client.clone()).await
11239    }
11240    /// The directory containing the module configuration and source code (source code may be in a subdir).
11241    ///
11242    /// # Arguments
11243    ///
11244    /// * `path` - A subpath from the source directory to select.
11245    pub fn directory(&self, path: impl Into<String>) -> Directory {
11246        let mut query = self.selection.select("directory");
11247        query = query.arg("path", path.into());
11248        Directory {
11249            proc: self.proc.clone(),
11250            selection: query,
11251            graphql_client: self.graphql_client.clone(),
11252        }
11253    }
11254    /// The engine version of the module.
11255    pub async fn engine_version(&self) -> Result<String, DaggerError> {
11256        let query = self.selection.select("engineVersion");
11257        query.execute(self.graphql_client.clone()).await
11258    }
11259    /// The generated files and directories made on top of the module source's context directory.
11260    pub fn generated_context_directory(&self) -> Directory {
11261        let query = self.selection.select("generatedContextDirectory");
11262        Directory {
11263            proc: self.proc.clone(),
11264            selection: query,
11265            graphql_client: self.graphql_client.clone(),
11266        }
11267    }
11268    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
11269    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
11270        let query = self.selection.select("htmlRepoURL");
11271        query.execute(self.graphql_client.clone()).await
11272    }
11273    /// The URL to the source's git repo in a web browser. Only valid for git sources.
11274    pub async fn html_url(&self) -> Result<String, DaggerError> {
11275        let query = self.selection.select("htmlURL");
11276        query.execute(self.graphql_client.clone()).await
11277    }
11278    /// A unique identifier for this ModuleSource.
11279    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
11280        let query = self.selection.select("id");
11281        query.execute(self.graphql_client.clone()).await
11282    }
11283    /// The introspection schema JSON file for this module source.
11284    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
11285    /// Note: this is in the context of a module, so some core types may be hidden.
11286    pub fn introspection_schema_json(&self) -> File {
11287        let query = self.selection.select("introspectionSchemaJSON");
11288        File {
11289            proc: self.proc.clone(),
11290            selection: query,
11291            graphql_client: self.graphql_client.clone(),
11292        }
11293    }
11294    /// The kind of module source (currently local, git or dir).
11295    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
11296        let query = self.selection.select("kind");
11297        query.execute(self.graphql_client.clone()).await
11298    }
11299    /// 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.
11300    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
11301        let query = self.selection.select("localContextDirectoryPath");
11302        query.execute(self.graphql_client.clone()).await
11303    }
11304    /// The name of the module, including any setting via the withName API.
11305    pub async fn module_name(&self) -> Result<String, DaggerError> {
11306        let query = self.selection.select("moduleName");
11307        query.execute(self.graphql_client.clone()).await
11308    }
11309    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
11310    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
11311        let query = self.selection.select("moduleOriginalName");
11312        query.execute(self.graphql_client.clone()).await
11313    }
11314    /// The original subpath used when instantiating this module source, relative to the context directory.
11315    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
11316        let query = self.selection.select("originalSubpath");
11317        query.execute(self.graphql_client.clone()).await
11318    }
11319    /// The pinned version of this module source.
11320    pub async fn pin(&self) -> Result<String, DaggerError> {
11321        let query = self.selection.select("pin");
11322        query.execute(self.graphql_client.clone()).await
11323    }
11324    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
11325    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
11326        let query = self.selection.select("repoRootPath");
11327        query.execute(self.graphql_client.clone()).await
11328    }
11329    /// The SDK configuration of the module.
11330    pub fn sdk(&self) -> SdkConfig {
11331        let query = self.selection.select("sdk");
11332        SdkConfig {
11333            proc: self.proc.clone(),
11334            selection: query,
11335            graphql_client: self.graphql_client.clone(),
11336        }
11337    }
11338    /// The path, relative to the context directory, that contains the module's dagger.json.
11339    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
11340        let query = self.selection.select("sourceRootSubpath");
11341        query.execute(self.graphql_client.clone()).await
11342    }
11343    /// The path to the directory containing the module's source code, relative to the context directory.
11344    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
11345        let query = self.selection.select("sourceSubpath");
11346        query.execute(self.graphql_client.clone()).await
11347    }
11348    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
11349    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
11350        let query = self.selection.select("sync");
11351        query.execute(self.graphql_client.clone()).await
11352    }
11353    /// The toolchains referenced by the module source.
11354    pub fn toolchains(&self) -> Vec<ModuleSource> {
11355        let query = self.selection.select("toolchains");
11356        vec![ModuleSource {
11357            proc: self.proc.clone(),
11358            selection: query,
11359            graphql_client: self.graphql_client.clone(),
11360        }]
11361    }
11362    /// User-defined defaults read from local .env files
11363    pub fn user_defaults(&self) -> EnvFile {
11364        let query = self.selection.select("userDefaults");
11365        EnvFile {
11366            proc: self.proc.clone(),
11367            selection: query,
11368            graphql_client: self.graphql_client.clone(),
11369        }
11370    }
11371    /// The specified version of the git repo this source points to.
11372    pub async fn version(&self) -> Result<String, DaggerError> {
11373        let query = self.selection.select("version");
11374        query.execute(self.graphql_client.clone()).await
11375    }
11376    /// Set a blueprint for the module source.
11377    ///
11378    /// # Arguments
11379    ///
11380    /// * `blueprint` - The blueprint module to set.
11381    pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
11382        let mut query = self.selection.select("withBlueprint");
11383        query = query.arg_lazy(
11384            "blueprint",
11385            Box::new(move || {
11386                let blueprint = blueprint.clone();
11387                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
11388            }),
11389        );
11390        ModuleSource {
11391            proc: self.proc.clone(),
11392            selection: query,
11393            graphql_client: self.graphql_client.clone(),
11394        }
11395    }
11396    /// Update the module source with a new client to generate.
11397    ///
11398    /// # Arguments
11399    ///
11400    /// * `generator` - The generator to use
11401    /// * `output_dir` - The output directory for the generated client.
11402    pub fn with_client(
11403        &self,
11404        generator: impl Into<String>,
11405        output_dir: impl Into<String>,
11406    ) -> ModuleSource {
11407        let mut query = self.selection.select("withClient");
11408        query = query.arg("generator", generator.into());
11409        query = query.arg("outputDir", output_dir.into());
11410        ModuleSource {
11411            proc: self.proc.clone(),
11412            selection: query,
11413            graphql_client: self.graphql_client.clone(),
11414        }
11415    }
11416    /// Append the provided dependencies to the module source's dependency list.
11417    ///
11418    /// # Arguments
11419    ///
11420    /// * `dependencies` - The dependencies to append.
11421    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
11422        let mut query = self.selection.select("withDependencies");
11423        query = query.arg("dependencies", dependencies);
11424        ModuleSource {
11425            proc: self.proc.clone(),
11426            selection: query,
11427            graphql_client: self.graphql_client.clone(),
11428        }
11429    }
11430    /// Upgrade the engine version of the module to the given value.
11431    ///
11432    /// # Arguments
11433    ///
11434    /// * `version` - The engine version to upgrade to.
11435    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
11436        let mut query = self.selection.select("withEngineVersion");
11437        query = query.arg("version", version.into());
11438        ModuleSource {
11439            proc: self.proc.clone(),
11440            selection: query,
11441            graphql_client: self.graphql_client.clone(),
11442        }
11443    }
11444    /// Enable the experimental features for the module source.
11445    ///
11446    /// # Arguments
11447    ///
11448    /// * `features` - The experimental features to enable.
11449    pub fn with_experimental_features(
11450        &self,
11451        features: Vec<ModuleSourceExperimentalFeature>,
11452    ) -> ModuleSource {
11453        let mut query = self.selection.select("withExperimentalFeatures");
11454        query = query.arg("features", features);
11455        ModuleSource {
11456            proc: self.proc.clone(),
11457            selection: query,
11458            graphql_client: self.graphql_client.clone(),
11459        }
11460    }
11461    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
11462    ///
11463    /// # Arguments
11464    ///
11465    /// * `patterns` - The new additional include patterns.
11466    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
11467        let mut query = self.selection.select("withIncludes");
11468        query = query.arg(
11469            "patterns",
11470            patterns
11471                .into_iter()
11472                .map(|i| i.into())
11473                .collect::<Vec<String>>(),
11474        );
11475        ModuleSource {
11476            proc: self.proc.clone(),
11477            selection: query,
11478            graphql_client: self.graphql_client.clone(),
11479        }
11480    }
11481    /// Update the module source with a new name.
11482    ///
11483    /// # Arguments
11484    ///
11485    /// * `name` - The name to set.
11486    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
11487        let mut query = self.selection.select("withName");
11488        query = query.arg("name", name.into());
11489        ModuleSource {
11490            proc: self.proc.clone(),
11491            selection: query,
11492            graphql_client: self.graphql_client.clone(),
11493        }
11494    }
11495    /// Update the module source with a new SDK.
11496    ///
11497    /// # Arguments
11498    ///
11499    /// * `source` - The SDK source to set.
11500    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
11501        let mut query = self.selection.select("withSDK");
11502        query = query.arg("source", source.into());
11503        ModuleSource {
11504            proc: self.proc.clone(),
11505            selection: query,
11506            graphql_client: self.graphql_client.clone(),
11507        }
11508    }
11509    /// Update the module source with a new source subpath.
11510    ///
11511    /// # Arguments
11512    ///
11513    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
11514    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
11515        let mut query = self.selection.select("withSourceSubpath");
11516        query = query.arg("path", path.into());
11517        ModuleSource {
11518            proc: self.proc.clone(),
11519            selection: query,
11520            graphql_client: self.graphql_client.clone(),
11521        }
11522    }
11523    /// Add toolchains to the module source.
11524    ///
11525    /// # Arguments
11526    ///
11527    /// * `toolchains` - The toolchain modules to add.
11528    pub fn with_toolchains(&self, toolchains: Vec<ModuleSourceId>) -> ModuleSource {
11529        let mut query = self.selection.select("withToolchains");
11530        query = query.arg("toolchains", toolchains);
11531        ModuleSource {
11532            proc: self.proc.clone(),
11533            selection: query,
11534            graphql_client: self.graphql_client.clone(),
11535        }
11536    }
11537    /// Update the blueprint module to the latest version.
11538    pub fn with_update_blueprint(&self) -> ModuleSource {
11539        let query = self.selection.select("withUpdateBlueprint");
11540        ModuleSource {
11541            proc: self.proc.clone(),
11542            selection: query,
11543            graphql_client: self.graphql_client.clone(),
11544        }
11545    }
11546    /// Update one or more module dependencies.
11547    ///
11548    /// # Arguments
11549    ///
11550    /// * `dependencies` - The dependencies to update.
11551    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
11552        let mut query = self.selection.select("withUpdateDependencies");
11553        query = query.arg(
11554            "dependencies",
11555            dependencies
11556                .into_iter()
11557                .map(|i| i.into())
11558                .collect::<Vec<String>>(),
11559        );
11560        ModuleSource {
11561            proc: self.proc.clone(),
11562            selection: query,
11563            graphql_client: self.graphql_client.clone(),
11564        }
11565    }
11566    /// Update one or more toolchains.
11567    ///
11568    /// # Arguments
11569    ///
11570    /// * `toolchains` - The toolchains to update.
11571    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
11572        let mut query = self.selection.select("withUpdateToolchains");
11573        query = query.arg(
11574            "toolchains",
11575            toolchains
11576                .into_iter()
11577                .map(|i| i.into())
11578                .collect::<Vec<String>>(),
11579        );
11580        ModuleSource {
11581            proc: self.proc.clone(),
11582            selection: query,
11583            graphql_client: self.graphql_client.clone(),
11584        }
11585    }
11586    /// Update one or more clients.
11587    ///
11588    /// # Arguments
11589    ///
11590    /// * `clients` - The clients to update
11591    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
11592        let mut query = self.selection.select("withUpdatedClients");
11593        query = query.arg(
11594            "clients",
11595            clients
11596                .into_iter()
11597                .map(|i| i.into())
11598                .collect::<Vec<String>>(),
11599        );
11600        ModuleSource {
11601            proc: self.proc.clone(),
11602            selection: query,
11603            graphql_client: self.graphql_client.clone(),
11604        }
11605    }
11606    /// Remove the current blueprint from the module source.
11607    pub fn without_blueprint(&self) -> ModuleSource {
11608        let query = self.selection.select("withoutBlueprint");
11609        ModuleSource {
11610            proc: self.proc.clone(),
11611            selection: query,
11612            graphql_client: self.graphql_client.clone(),
11613        }
11614    }
11615    /// Remove a client from the module source.
11616    ///
11617    /// # Arguments
11618    ///
11619    /// * `path` - The path of the client to remove.
11620    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
11621        let mut query = self.selection.select("withoutClient");
11622        query = query.arg("path", path.into());
11623        ModuleSource {
11624            proc: self.proc.clone(),
11625            selection: query,
11626            graphql_client: self.graphql_client.clone(),
11627        }
11628    }
11629    /// Remove the provided dependencies from the module source's dependency list.
11630    ///
11631    /// # Arguments
11632    ///
11633    /// * `dependencies` - The dependencies to remove.
11634    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
11635        let mut query = self.selection.select("withoutDependencies");
11636        query = query.arg(
11637            "dependencies",
11638            dependencies
11639                .into_iter()
11640                .map(|i| i.into())
11641                .collect::<Vec<String>>(),
11642        );
11643        ModuleSource {
11644            proc: self.proc.clone(),
11645            selection: query,
11646            graphql_client: self.graphql_client.clone(),
11647        }
11648    }
11649    /// Disable experimental features for the module source.
11650    ///
11651    /// # Arguments
11652    ///
11653    /// * `features` - The experimental features to disable.
11654    pub fn without_experimental_features(
11655        &self,
11656        features: Vec<ModuleSourceExperimentalFeature>,
11657    ) -> ModuleSource {
11658        let mut query = self.selection.select("withoutExperimentalFeatures");
11659        query = query.arg("features", features);
11660        ModuleSource {
11661            proc: self.proc.clone(),
11662            selection: query,
11663            graphql_client: self.graphql_client.clone(),
11664        }
11665    }
11666    /// Remove the provided toolchains from the module source.
11667    ///
11668    /// # Arguments
11669    ///
11670    /// * `toolchains` - The toolchains to remove.
11671    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
11672        let mut query = self.selection.select("withoutToolchains");
11673        query = query.arg(
11674            "toolchains",
11675            toolchains
11676                .into_iter()
11677                .map(|i| i.into())
11678                .collect::<Vec<String>>(),
11679        );
11680        ModuleSource {
11681            proc: self.proc.clone(),
11682            selection: query,
11683            graphql_client: self.graphql_client.clone(),
11684        }
11685    }
11686}
11687#[derive(Clone)]
11688pub struct ObjectTypeDef {
11689    pub proc: Option<Arc<DaggerSessionProc>>,
11690    pub selection: Selection,
11691    pub graphql_client: DynGraphQLClient,
11692}
11693impl ObjectTypeDef {
11694    /// The function used to construct new instances of this object, if any
11695    pub fn constructor(&self) -> Function {
11696        let query = self.selection.select("constructor");
11697        Function {
11698            proc: self.proc.clone(),
11699            selection: query,
11700            graphql_client: self.graphql_client.clone(),
11701        }
11702    }
11703    /// The reason this enum member is deprecated, if any.
11704    pub async fn deprecated(&self) -> Result<String, DaggerError> {
11705        let query = self.selection.select("deprecated");
11706        query.execute(self.graphql_client.clone()).await
11707    }
11708    /// The doc string for the object, if any.
11709    pub async fn description(&self) -> Result<String, DaggerError> {
11710        let query = self.selection.select("description");
11711        query.execute(self.graphql_client.clone()).await
11712    }
11713    /// Static fields defined on this object, if any.
11714    pub fn fields(&self) -> Vec<FieldTypeDef> {
11715        let query = self.selection.select("fields");
11716        vec![FieldTypeDef {
11717            proc: self.proc.clone(),
11718            selection: query,
11719            graphql_client: self.graphql_client.clone(),
11720        }]
11721    }
11722    /// Functions defined on this object, if any.
11723    pub fn functions(&self) -> Vec<Function> {
11724        let query = self.selection.select("functions");
11725        vec![Function {
11726            proc: self.proc.clone(),
11727            selection: query,
11728            graphql_client: self.graphql_client.clone(),
11729        }]
11730    }
11731    /// A unique identifier for this ObjectTypeDef.
11732    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
11733        let query = self.selection.select("id");
11734        query.execute(self.graphql_client.clone()).await
11735    }
11736    /// The name of the object.
11737    pub async fn name(&self) -> Result<String, DaggerError> {
11738        let query = self.selection.select("name");
11739        query.execute(self.graphql_client.clone()).await
11740    }
11741    /// The location of this object declaration.
11742    pub fn source_map(&self) -> SourceMap {
11743        let query = self.selection.select("sourceMap");
11744        SourceMap {
11745            proc: self.proc.clone(),
11746            selection: query,
11747            graphql_client: self.graphql_client.clone(),
11748        }
11749    }
11750    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
11751    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
11752        let query = self.selection.select("sourceModuleName");
11753        query.execute(self.graphql_client.clone()).await
11754    }
11755}
11756#[derive(Clone)]
11757pub struct Port {
11758    pub proc: Option<Arc<DaggerSessionProc>>,
11759    pub selection: Selection,
11760    pub graphql_client: DynGraphQLClient,
11761}
11762impl Port {
11763    /// The port description.
11764    pub async fn description(&self) -> Result<String, DaggerError> {
11765        let query = self.selection.select("description");
11766        query.execute(self.graphql_client.clone()).await
11767    }
11768    /// Skip the health check when run as a service.
11769    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
11770        let query = self.selection.select("experimentalSkipHealthcheck");
11771        query.execute(self.graphql_client.clone()).await
11772    }
11773    /// A unique identifier for this Port.
11774    pub async fn id(&self) -> Result<PortId, DaggerError> {
11775        let query = self.selection.select("id");
11776        query.execute(self.graphql_client.clone()).await
11777    }
11778    /// The port number.
11779    pub async fn port(&self) -> Result<isize, DaggerError> {
11780        let query = self.selection.select("port");
11781        query.execute(self.graphql_client.clone()).await
11782    }
11783    /// The transport layer protocol.
11784    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
11785        let query = self.selection.select("protocol");
11786        query.execute(self.graphql_client.clone()).await
11787    }
11788}
11789#[derive(Clone)]
11790pub struct Query {
11791    pub proc: Option<Arc<DaggerSessionProc>>,
11792    pub selection: Selection,
11793    pub graphql_client: DynGraphQLClient,
11794}
11795#[derive(Builder, Debug, PartialEq)]
11796pub struct QueryContainerOpts {
11797    /// Platform to initialize the container with. Defaults to the native platform of the current engine
11798    #[builder(setter(into, strip_option), default)]
11799    pub platform: Option<Platform>,
11800}
11801#[derive(Builder, Debug, PartialEq)]
11802pub struct QueryCurrentWorkspaceOpts {
11803    /// If true, skip legacy dagger.json migration checks.
11804    #[builder(setter(into, strip_option), default)]
11805    pub skip_migration_check: Option<bool>,
11806}
11807#[derive(Builder, Debug, PartialEq)]
11808pub struct QueryEnvOpts {
11809    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
11810    #[builder(setter(into, strip_option), default)]
11811    pub privileged: Option<bool>,
11812    /// Allow new outputs to be declared and saved in the environment
11813    #[builder(setter(into, strip_option), default)]
11814    pub writable: Option<bool>,
11815}
11816#[derive(Builder, Debug, PartialEq)]
11817pub struct QueryEnvFileOpts {
11818    /// Replace "${VAR}" or "$VAR" with the value of other vars
11819    #[builder(setter(into, strip_option), default)]
11820    pub expand: Option<bool>,
11821}
11822#[derive(Builder, Debug, PartialEq)]
11823pub struct QueryFileOpts {
11824    /// Permissions of the new file. Example: 0600
11825    #[builder(setter(into, strip_option), default)]
11826    pub permissions: Option<isize>,
11827}
11828#[derive(Builder, Debug, PartialEq)]
11829pub struct QueryGitOpts<'a> {
11830    /// A service which must be started before the repo is fetched.
11831    #[builder(setter(into, strip_option), default)]
11832    pub experimental_service_host: Option<ServiceId>,
11833    /// Secret used to populate the Authorization HTTP header
11834    #[builder(setter(into, strip_option), default)]
11835    pub http_auth_header: Option<SecretId>,
11836    /// Secret used to populate the password during basic HTTP Authorization
11837    #[builder(setter(into, strip_option), default)]
11838    pub http_auth_token: Option<SecretId>,
11839    /// Username used to populate the password during basic HTTP Authorization
11840    #[builder(setter(into, strip_option), default)]
11841    pub http_auth_username: Option<&'a str>,
11842    /// DEPRECATED: Set to true to keep .git directory.
11843    #[builder(setter(into, strip_option), default)]
11844    pub keep_git_dir: Option<bool>,
11845    /// Set SSH auth socket
11846    #[builder(setter(into, strip_option), default)]
11847    pub ssh_auth_socket: Option<SocketId>,
11848    /// Set SSH known hosts
11849    #[builder(setter(into, strip_option), default)]
11850    pub ssh_known_hosts: Option<&'a str>,
11851}
11852#[derive(Builder, Debug, PartialEq)]
11853pub struct QueryHttpOpts<'a> {
11854    /// Secret used to populate the Authorization HTTP header
11855    #[builder(setter(into, strip_option), default)]
11856    pub auth_header: Option<SecretId>,
11857    /// A service which must be started before the URL is fetched.
11858    #[builder(setter(into, strip_option), default)]
11859    pub experimental_service_host: Option<ServiceId>,
11860    /// File name to use for the file. Defaults to the last part of the URL.
11861    #[builder(setter(into, strip_option), default)]
11862    pub name: Option<&'a str>,
11863    /// Permissions to set on the file.
11864    #[builder(setter(into, strip_option), default)]
11865    pub permissions: Option<isize>,
11866}
11867#[derive(Builder, Debug, PartialEq)]
11868pub struct QueryLlmOpts<'a> {
11869    /// Cap the number of API calls for this LLM
11870    #[builder(setter(into, strip_option), default)]
11871    pub max_api_calls: Option<isize>,
11872    /// Model to use
11873    #[builder(setter(into, strip_option), default)]
11874    pub model: Option<&'a str>,
11875}
11876#[derive(Builder, Debug, PartialEq)]
11877pub struct QueryModuleSourceOpts<'a> {
11878    /// 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.
11879    #[builder(setter(into, strip_option), default)]
11880    pub allow_not_exists: Option<bool>,
11881    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
11882    #[builder(setter(into, strip_option), default)]
11883    pub disable_find_up: Option<bool>,
11884    /// The pinned version of the module source
11885    #[builder(setter(into, strip_option), default)]
11886    pub ref_pin: Option<&'a str>,
11887    /// If set, error out if the ref string is not of the provided requireKind.
11888    #[builder(setter(into, strip_option), default)]
11889    pub require_kind: Option<ModuleSourceKind>,
11890}
11891#[derive(Builder, Debug, PartialEq)]
11892pub struct QuerySecretOpts<'a> {
11893    /// 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.
11894    /// 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.
11895    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
11896    #[builder(setter(into, strip_option), default)]
11897    pub cache_key: Option<&'a str>,
11898}
11899impl Query {
11900    /// initialize an address to load directories, containers, secrets or other object types.
11901    pub fn address(&self, value: impl Into<String>) -> Address {
11902        let mut query = self.selection.select("address");
11903        query = query.arg("value", value.into());
11904        Address {
11905            proc: self.proc.clone(),
11906            selection: query,
11907            graphql_client: self.graphql_client.clone(),
11908        }
11909    }
11910    /// Constructs a cache volume for a given cache key.
11911    ///
11912    /// # Arguments
11913    ///
11914    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
11915    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
11916        let mut query = self.selection.select("cacheVolume");
11917        query = query.arg("key", key.into());
11918        CacheVolume {
11919            proc: self.proc.clone(),
11920            selection: query,
11921            graphql_client: self.graphql_client.clone(),
11922        }
11923    }
11924    /// Dagger Cloud configuration and state
11925    pub fn cloud(&self) -> Cloud {
11926        let query = self.selection.select("cloud");
11927        Cloud {
11928            proc: self.proc.clone(),
11929            selection: query,
11930            graphql_client: self.graphql_client.clone(),
11931        }
11932    }
11933    /// Creates a scratch container, with no image or metadata.
11934    /// To pull an image, follow up with the "from" function.
11935    ///
11936    /// # Arguments
11937    ///
11938    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11939    pub fn container(&self) -> Container {
11940        let query = self.selection.select("container");
11941        Container {
11942            proc: self.proc.clone(),
11943            selection: query,
11944            graphql_client: self.graphql_client.clone(),
11945        }
11946    }
11947    /// Creates a scratch container, with no image or metadata.
11948    /// To pull an image, follow up with the "from" function.
11949    ///
11950    /// # Arguments
11951    ///
11952    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11953    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
11954        let mut query = self.selection.select("container");
11955        if let Some(platform) = opts.platform {
11956            query = query.arg("platform", platform);
11957        }
11958        Container {
11959            proc: self.proc.clone(),
11960            selection: query,
11961            graphql_client: self.graphql_client.clone(),
11962        }
11963    }
11964    /// Returns the current environment
11965    /// 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.
11966    /// 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.
11967    pub fn current_env(&self) -> Env {
11968        let query = self.selection.select("currentEnv");
11969        Env {
11970            proc: self.proc.clone(),
11971            selection: query,
11972            graphql_client: self.graphql_client.clone(),
11973        }
11974    }
11975    /// The FunctionCall context that the SDK caller is currently executing in.
11976    /// If the caller is not currently executing in a function, this will return an error.
11977    pub fn current_function_call(&self) -> FunctionCall {
11978        let query = self.selection.select("currentFunctionCall");
11979        FunctionCall {
11980            proc: self.proc.clone(),
11981            selection: query,
11982            graphql_client: self.graphql_client.clone(),
11983        }
11984    }
11985    /// The module currently being served in the session, if any.
11986    pub fn current_module(&self) -> CurrentModule {
11987        let query = self.selection.select("currentModule");
11988        CurrentModule {
11989            proc: self.proc.clone(),
11990            selection: query,
11991            graphql_client: self.graphql_client.clone(),
11992        }
11993    }
11994    /// The TypeDef representations of the objects currently being served in the session.
11995    pub fn current_type_defs(&self) -> Vec<TypeDef> {
11996        let query = self.selection.select("currentTypeDefs");
11997        vec![TypeDef {
11998            proc: self.proc.clone(),
11999            selection: query,
12000            graphql_client: self.graphql_client.clone(),
12001        }]
12002    }
12003    /// Detect and return the current workspace.
12004    ///
12005    /// # Arguments
12006    ///
12007    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12008    pub fn current_workspace(&self) -> Workspace {
12009        let query = self.selection.select("currentWorkspace");
12010        Workspace {
12011            proc: self.proc.clone(),
12012            selection: query,
12013            graphql_client: self.graphql_client.clone(),
12014        }
12015    }
12016    /// Detect and return the current workspace.
12017    ///
12018    /// # Arguments
12019    ///
12020    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12021    pub fn current_workspace_opts(&self, opts: QueryCurrentWorkspaceOpts) -> Workspace {
12022        let mut query = self.selection.select("currentWorkspace");
12023        if let Some(skip_migration_check) = opts.skip_migration_check {
12024            query = query.arg("skipMigrationCheck", skip_migration_check);
12025        }
12026        Workspace {
12027            proc: self.proc.clone(),
12028            selection: query,
12029            graphql_client: self.graphql_client.clone(),
12030        }
12031    }
12032    /// The default platform of the engine.
12033    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
12034        let query = self.selection.select("defaultPlatform");
12035        query.execute(self.graphql_client.clone()).await
12036    }
12037    /// Creates an empty directory.
12038    pub fn directory(&self) -> Directory {
12039        let query = self.selection.select("directory");
12040        Directory {
12041            proc: self.proc.clone(),
12042            selection: query,
12043            graphql_client: self.graphql_client.clone(),
12044        }
12045    }
12046    /// The Dagger engine container configuration and state
12047    pub fn engine(&self) -> Engine {
12048        let query = self.selection.select("engine");
12049        Engine {
12050            proc: self.proc.clone(),
12051            selection: query,
12052            graphql_client: self.graphql_client.clone(),
12053        }
12054    }
12055    /// Initializes a new environment
12056    ///
12057    /// # Arguments
12058    ///
12059    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12060    pub fn env(&self) -> Env {
12061        let query = self.selection.select("env");
12062        Env {
12063            proc: self.proc.clone(),
12064            selection: query,
12065            graphql_client: self.graphql_client.clone(),
12066        }
12067    }
12068    /// Initializes a new environment
12069    ///
12070    /// # Arguments
12071    ///
12072    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12073    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
12074        let mut query = self.selection.select("env");
12075        if let Some(privileged) = opts.privileged {
12076            query = query.arg("privileged", privileged);
12077        }
12078        if let Some(writable) = opts.writable {
12079            query = query.arg("writable", writable);
12080        }
12081        Env {
12082            proc: self.proc.clone(),
12083            selection: query,
12084            graphql_client: self.graphql_client.clone(),
12085        }
12086    }
12087    /// Initialize an environment file
12088    ///
12089    /// # Arguments
12090    ///
12091    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12092    pub fn env_file(&self) -> EnvFile {
12093        let query = self.selection.select("envFile");
12094        EnvFile {
12095            proc: self.proc.clone(),
12096            selection: query,
12097            graphql_client: self.graphql_client.clone(),
12098        }
12099    }
12100    /// Initialize an environment file
12101    ///
12102    /// # Arguments
12103    ///
12104    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12105    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
12106        let mut query = self.selection.select("envFile");
12107        if let Some(expand) = opts.expand {
12108            query = query.arg("expand", expand);
12109        }
12110        EnvFile {
12111            proc: self.proc.clone(),
12112            selection: query,
12113            graphql_client: self.graphql_client.clone(),
12114        }
12115    }
12116    /// Create a new error.
12117    ///
12118    /// # Arguments
12119    ///
12120    /// * `message` - A brief description of the error.
12121    pub fn error(&self, message: impl Into<String>) -> Error {
12122        let mut query = self.selection.select("error");
12123        query = query.arg("message", message.into());
12124        Error {
12125            proc: self.proc.clone(),
12126            selection: query,
12127            graphql_client: self.graphql_client.clone(),
12128        }
12129    }
12130    /// Creates a file with the specified contents.
12131    ///
12132    /// # Arguments
12133    ///
12134    /// * `name` - Name of the new file. Example: "foo.txt"
12135    /// * `contents` - Contents of the new file. Example: "Hello world!"
12136    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12137    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
12138        let mut query = self.selection.select("file");
12139        query = query.arg("name", name.into());
12140        query = query.arg("contents", contents.into());
12141        File {
12142            proc: self.proc.clone(),
12143            selection: query,
12144            graphql_client: self.graphql_client.clone(),
12145        }
12146    }
12147    /// Creates a file with the specified contents.
12148    ///
12149    /// # Arguments
12150    ///
12151    /// * `name` - Name of the new file. Example: "foo.txt"
12152    /// * `contents` - Contents of the new file. Example: "Hello world!"
12153    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12154    pub fn file_opts(
12155        &self,
12156        name: impl Into<String>,
12157        contents: impl Into<String>,
12158        opts: QueryFileOpts,
12159    ) -> File {
12160        let mut query = self.selection.select("file");
12161        query = query.arg("name", name.into());
12162        query = query.arg("contents", contents.into());
12163        if let Some(permissions) = opts.permissions {
12164            query = query.arg("permissions", permissions);
12165        }
12166        File {
12167            proc: self.proc.clone(),
12168            selection: query,
12169            graphql_client: self.graphql_client.clone(),
12170        }
12171    }
12172    /// Creates a function.
12173    ///
12174    /// # Arguments
12175    ///
12176    /// * `name` - Name of the function, in its original format from the implementation language.
12177    /// * `return_type` - Return type of the function.
12178    pub fn function(
12179        &self,
12180        name: impl Into<String>,
12181        return_type: impl IntoID<TypeDefId>,
12182    ) -> Function {
12183        let mut query = self.selection.select("function");
12184        query = query.arg("name", name.into());
12185        query = query.arg_lazy(
12186            "returnType",
12187            Box::new(move || {
12188                let return_type = return_type.clone();
12189                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
12190            }),
12191        );
12192        Function {
12193            proc: self.proc.clone(),
12194            selection: query,
12195            graphql_client: self.graphql_client.clone(),
12196        }
12197    }
12198    /// Create a code generation result, given a directory containing the generated code.
12199    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
12200        let mut query = self.selection.select("generatedCode");
12201        query = query.arg_lazy(
12202            "code",
12203            Box::new(move || {
12204                let code = code.clone();
12205                Box::pin(async move { code.into_id().await.unwrap().quote() })
12206            }),
12207        );
12208        GeneratedCode {
12209            proc: self.proc.clone(),
12210            selection: query,
12211            graphql_client: self.graphql_client.clone(),
12212        }
12213    }
12214    /// Queries a Git repository.
12215    ///
12216    /// # Arguments
12217    ///
12218    /// * `url` - URL of the git repository.
12219    ///
12220    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
12221    ///
12222    /// Suffix ".git" is optional.
12223    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12224    pub fn git(&self, url: impl Into<String>) -> GitRepository {
12225        let mut query = self.selection.select("git");
12226        query = query.arg("url", url.into());
12227        GitRepository {
12228            proc: self.proc.clone(),
12229            selection: query,
12230            graphql_client: self.graphql_client.clone(),
12231        }
12232    }
12233    /// Queries a Git repository.
12234    ///
12235    /// # Arguments
12236    ///
12237    /// * `url` - URL of the git repository.
12238    ///
12239    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
12240    ///
12241    /// Suffix ".git" is optional.
12242    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12243    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
12244        let mut query = self.selection.select("git");
12245        query = query.arg("url", url.into());
12246        if let Some(keep_git_dir) = opts.keep_git_dir {
12247            query = query.arg("keepGitDir", keep_git_dir);
12248        }
12249        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
12250            query = query.arg("sshKnownHosts", ssh_known_hosts);
12251        }
12252        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
12253            query = query.arg("sshAuthSocket", ssh_auth_socket);
12254        }
12255        if let Some(http_auth_username) = opts.http_auth_username {
12256            query = query.arg("httpAuthUsername", http_auth_username);
12257        }
12258        if let Some(http_auth_token) = opts.http_auth_token {
12259            query = query.arg("httpAuthToken", http_auth_token);
12260        }
12261        if let Some(http_auth_header) = opts.http_auth_header {
12262            query = query.arg("httpAuthHeader", http_auth_header);
12263        }
12264        if let Some(experimental_service_host) = opts.experimental_service_host {
12265            query = query.arg("experimentalServiceHost", experimental_service_host);
12266        }
12267        GitRepository {
12268            proc: self.proc.clone(),
12269            selection: query,
12270            graphql_client: self.graphql_client.clone(),
12271        }
12272    }
12273    /// Queries the host environment.
12274    pub fn host(&self) -> Host {
12275        let query = self.selection.select("host");
12276        Host {
12277            proc: self.proc.clone(),
12278            selection: query,
12279            graphql_client: self.graphql_client.clone(),
12280        }
12281    }
12282    /// Returns a file containing an http remote url content.
12283    ///
12284    /// # Arguments
12285    ///
12286    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
12287    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12288    pub fn http(&self, url: impl Into<String>) -> File {
12289        let mut query = self.selection.select("http");
12290        query = query.arg("url", url.into());
12291        File {
12292            proc: self.proc.clone(),
12293            selection: query,
12294            graphql_client: self.graphql_client.clone(),
12295        }
12296    }
12297    /// Returns a file containing an http remote url content.
12298    ///
12299    /// # Arguments
12300    ///
12301    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
12302    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12303    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
12304        let mut query = self.selection.select("http");
12305        query = query.arg("url", url.into());
12306        if let Some(name) = opts.name {
12307            query = query.arg("name", name);
12308        }
12309        if let Some(permissions) = opts.permissions {
12310            query = query.arg("permissions", permissions);
12311        }
12312        if let Some(auth_header) = opts.auth_header {
12313            query = query.arg("authHeader", auth_header);
12314        }
12315        if let Some(experimental_service_host) = opts.experimental_service_host {
12316            query = query.arg("experimentalServiceHost", experimental_service_host);
12317        }
12318        File {
12319            proc: self.proc.clone(),
12320            selection: query,
12321            graphql_client: self.graphql_client.clone(),
12322        }
12323    }
12324    /// Initialize a JSON value
12325    pub fn json(&self) -> JsonValue {
12326        let query = self.selection.select("json");
12327        JsonValue {
12328            proc: self.proc.clone(),
12329            selection: query,
12330            graphql_client: self.graphql_client.clone(),
12331        }
12332    }
12333    /// Initialize a Large Language Model (LLM)
12334    ///
12335    /// # Arguments
12336    ///
12337    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12338    pub fn llm(&self) -> Llm {
12339        let query = self.selection.select("llm");
12340        Llm {
12341            proc: self.proc.clone(),
12342            selection: query,
12343            graphql_client: self.graphql_client.clone(),
12344        }
12345    }
12346    /// Initialize a Large Language Model (LLM)
12347    ///
12348    /// # Arguments
12349    ///
12350    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12351    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
12352        let mut query = self.selection.select("llm");
12353        if let Some(model) = opts.model {
12354            query = query.arg("model", model);
12355        }
12356        if let Some(max_api_calls) = opts.max_api_calls {
12357            query = query.arg("maxAPICalls", max_api_calls);
12358        }
12359        Llm {
12360            proc: self.proc.clone(),
12361            selection: query,
12362            graphql_client: self.graphql_client.clone(),
12363        }
12364    }
12365    /// Load a Address from its ID.
12366    pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
12367        let mut query = self.selection.select("loadAddressFromID");
12368        query = query.arg_lazy(
12369            "id",
12370            Box::new(move || {
12371                let id = id.clone();
12372                Box::pin(async move { id.into_id().await.unwrap().quote() })
12373            }),
12374        );
12375        Address {
12376            proc: self.proc.clone(),
12377            selection: query,
12378            graphql_client: self.graphql_client.clone(),
12379        }
12380    }
12381    /// Load a Binding from its ID.
12382    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
12383        let mut query = self.selection.select("loadBindingFromID");
12384        query = query.arg_lazy(
12385            "id",
12386            Box::new(move || {
12387                let id = id.clone();
12388                Box::pin(async move { id.into_id().await.unwrap().quote() })
12389            }),
12390        );
12391        Binding {
12392            proc: self.proc.clone(),
12393            selection: query,
12394            graphql_client: self.graphql_client.clone(),
12395        }
12396    }
12397    /// Load a CacheVolume from its ID.
12398    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
12399        let mut query = self.selection.select("loadCacheVolumeFromID");
12400        query = query.arg_lazy(
12401            "id",
12402            Box::new(move || {
12403                let id = id.clone();
12404                Box::pin(async move { id.into_id().await.unwrap().quote() })
12405            }),
12406        );
12407        CacheVolume {
12408            proc: self.proc.clone(),
12409            selection: query,
12410            graphql_client: self.graphql_client.clone(),
12411        }
12412    }
12413    /// Load a Changeset from its ID.
12414    pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
12415        let mut query = self.selection.select("loadChangesetFromID");
12416        query = query.arg_lazy(
12417            "id",
12418            Box::new(move || {
12419                let id = id.clone();
12420                Box::pin(async move { id.into_id().await.unwrap().quote() })
12421            }),
12422        );
12423        Changeset {
12424            proc: self.proc.clone(),
12425            selection: query,
12426            graphql_client: self.graphql_client.clone(),
12427        }
12428    }
12429    /// Load a Check from its ID.
12430    pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
12431        let mut query = self.selection.select("loadCheckFromID");
12432        query = query.arg_lazy(
12433            "id",
12434            Box::new(move || {
12435                let id = id.clone();
12436                Box::pin(async move { id.into_id().await.unwrap().quote() })
12437            }),
12438        );
12439        Check {
12440            proc: self.proc.clone(),
12441            selection: query,
12442            graphql_client: self.graphql_client.clone(),
12443        }
12444    }
12445    /// Load a CheckGroup from its ID.
12446    pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
12447        let mut query = self.selection.select("loadCheckGroupFromID");
12448        query = query.arg_lazy(
12449            "id",
12450            Box::new(move || {
12451                let id = id.clone();
12452                Box::pin(async move { id.into_id().await.unwrap().quote() })
12453            }),
12454        );
12455        CheckGroup {
12456            proc: self.proc.clone(),
12457            selection: query,
12458            graphql_client: self.graphql_client.clone(),
12459        }
12460    }
12461    /// Load a Cloud from its ID.
12462    pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
12463        let mut query = self.selection.select("loadCloudFromID");
12464        query = query.arg_lazy(
12465            "id",
12466            Box::new(move || {
12467                let id = id.clone();
12468                Box::pin(async move { id.into_id().await.unwrap().quote() })
12469            }),
12470        );
12471        Cloud {
12472            proc: self.proc.clone(),
12473            selection: query,
12474            graphql_client: self.graphql_client.clone(),
12475        }
12476    }
12477    /// Load a Container from its ID.
12478    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
12479        let mut query = self.selection.select("loadContainerFromID");
12480        query = query.arg_lazy(
12481            "id",
12482            Box::new(move || {
12483                let id = id.clone();
12484                Box::pin(async move { id.into_id().await.unwrap().quote() })
12485            }),
12486        );
12487        Container {
12488            proc: self.proc.clone(),
12489            selection: query,
12490            graphql_client: self.graphql_client.clone(),
12491        }
12492    }
12493    /// Load a CurrentModule from its ID.
12494    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
12495        let mut query = self.selection.select("loadCurrentModuleFromID");
12496        query = query.arg_lazy(
12497            "id",
12498            Box::new(move || {
12499                let id = id.clone();
12500                Box::pin(async move { id.into_id().await.unwrap().quote() })
12501            }),
12502        );
12503        CurrentModule {
12504            proc: self.proc.clone(),
12505            selection: query,
12506            graphql_client: self.graphql_client.clone(),
12507        }
12508    }
12509    /// Load a Directory from its ID.
12510    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
12511        let mut query = self.selection.select("loadDirectoryFromID");
12512        query = query.arg_lazy(
12513            "id",
12514            Box::new(move || {
12515                let id = id.clone();
12516                Box::pin(async move { id.into_id().await.unwrap().quote() })
12517            }),
12518        );
12519        Directory {
12520            proc: self.proc.clone(),
12521            selection: query,
12522            graphql_client: self.graphql_client.clone(),
12523        }
12524    }
12525    /// Load a EngineCacheEntry from its ID.
12526    pub fn load_engine_cache_entry_from_id(
12527        &self,
12528        id: impl IntoID<EngineCacheEntryId>,
12529    ) -> EngineCacheEntry {
12530        let mut query = self.selection.select("loadEngineCacheEntryFromID");
12531        query = query.arg_lazy(
12532            "id",
12533            Box::new(move || {
12534                let id = id.clone();
12535                Box::pin(async move { id.into_id().await.unwrap().quote() })
12536            }),
12537        );
12538        EngineCacheEntry {
12539            proc: self.proc.clone(),
12540            selection: query,
12541            graphql_client: self.graphql_client.clone(),
12542        }
12543    }
12544    /// Load a EngineCacheEntrySet from its ID.
12545    pub fn load_engine_cache_entry_set_from_id(
12546        &self,
12547        id: impl IntoID<EngineCacheEntrySetId>,
12548    ) -> EngineCacheEntrySet {
12549        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
12550        query = query.arg_lazy(
12551            "id",
12552            Box::new(move || {
12553                let id = id.clone();
12554                Box::pin(async move { id.into_id().await.unwrap().quote() })
12555            }),
12556        );
12557        EngineCacheEntrySet {
12558            proc: self.proc.clone(),
12559            selection: query,
12560            graphql_client: self.graphql_client.clone(),
12561        }
12562    }
12563    /// Load a EngineCache from its ID.
12564    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
12565        let mut query = self.selection.select("loadEngineCacheFromID");
12566        query = query.arg_lazy(
12567            "id",
12568            Box::new(move || {
12569                let id = id.clone();
12570                Box::pin(async move { id.into_id().await.unwrap().quote() })
12571            }),
12572        );
12573        EngineCache {
12574            proc: self.proc.clone(),
12575            selection: query,
12576            graphql_client: self.graphql_client.clone(),
12577        }
12578    }
12579    /// Load a Engine from its ID.
12580    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
12581        let mut query = self.selection.select("loadEngineFromID");
12582        query = query.arg_lazy(
12583            "id",
12584            Box::new(move || {
12585                let id = id.clone();
12586                Box::pin(async move { id.into_id().await.unwrap().quote() })
12587            }),
12588        );
12589        Engine {
12590            proc: self.proc.clone(),
12591            selection: query,
12592            graphql_client: self.graphql_client.clone(),
12593        }
12594    }
12595    /// Load a EnumTypeDef from its ID.
12596    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
12597        let mut query = self.selection.select("loadEnumTypeDefFromID");
12598        query = query.arg_lazy(
12599            "id",
12600            Box::new(move || {
12601                let id = id.clone();
12602                Box::pin(async move { id.into_id().await.unwrap().quote() })
12603            }),
12604        );
12605        EnumTypeDef {
12606            proc: self.proc.clone(),
12607            selection: query,
12608            graphql_client: self.graphql_client.clone(),
12609        }
12610    }
12611    /// Load a EnumValueTypeDef from its ID.
12612    pub fn load_enum_value_type_def_from_id(
12613        &self,
12614        id: impl IntoID<EnumValueTypeDefId>,
12615    ) -> EnumValueTypeDef {
12616        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
12617        query = query.arg_lazy(
12618            "id",
12619            Box::new(move || {
12620                let id = id.clone();
12621                Box::pin(async move { id.into_id().await.unwrap().quote() })
12622            }),
12623        );
12624        EnumValueTypeDef {
12625            proc: self.proc.clone(),
12626            selection: query,
12627            graphql_client: self.graphql_client.clone(),
12628        }
12629    }
12630    /// Load a EnvFile from its ID.
12631    pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
12632        let mut query = self.selection.select("loadEnvFileFromID");
12633        query = query.arg_lazy(
12634            "id",
12635            Box::new(move || {
12636                let id = id.clone();
12637                Box::pin(async move { id.into_id().await.unwrap().quote() })
12638            }),
12639        );
12640        EnvFile {
12641            proc: self.proc.clone(),
12642            selection: query,
12643            graphql_client: self.graphql_client.clone(),
12644        }
12645    }
12646    /// Load a Env from its ID.
12647    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
12648        let mut query = self.selection.select("loadEnvFromID");
12649        query = query.arg_lazy(
12650            "id",
12651            Box::new(move || {
12652                let id = id.clone();
12653                Box::pin(async move { id.into_id().await.unwrap().quote() })
12654            }),
12655        );
12656        Env {
12657            proc: self.proc.clone(),
12658            selection: query,
12659            graphql_client: self.graphql_client.clone(),
12660        }
12661    }
12662    /// Load a EnvVariable from its ID.
12663    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
12664        let mut query = self.selection.select("loadEnvVariableFromID");
12665        query = query.arg_lazy(
12666            "id",
12667            Box::new(move || {
12668                let id = id.clone();
12669                Box::pin(async move { id.into_id().await.unwrap().quote() })
12670            }),
12671        );
12672        EnvVariable {
12673            proc: self.proc.clone(),
12674            selection: query,
12675            graphql_client: self.graphql_client.clone(),
12676        }
12677    }
12678    /// Load a Error from its ID.
12679    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
12680        let mut query = self.selection.select("loadErrorFromID");
12681        query = query.arg_lazy(
12682            "id",
12683            Box::new(move || {
12684                let id = id.clone();
12685                Box::pin(async move { id.into_id().await.unwrap().quote() })
12686            }),
12687        );
12688        Error {
12689            proc: self.proc.clone(),
12690            selection: query,
12691            graphql_client: self.graphql_client.clone(),
12692        }
12693    }
12694    /// Load a ErrorValue from its ID.
12695    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
12696        let mut query = self.selection.select("loadErrorValueFromID");
12697        query = query.arg_lazy(
12698            "id",
12699            Box::new(move || {
12700                let id = id.clone();
12701                Box::pin(async move { id.into_id().await.unwrap().quote() })
12702            }),
12703        );
12704        ErrorValue {
12705            proc: self.proc.clone(),
12706            selection: query,
12707            graphql_client: self.graphql_client.clone(),
12708        }
12709    }
12710    /// Load a FieldTypeDef from its ID.
12711    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
12712        let mut query = self.selection.select("loadFieldTypeDefFromID");
12713        query = query.arg_lazy(
12714            "id",
12715            Box::new(move || {
12716                let id = id.clone();
12717                Box::pin(async move { id.into_id().await.unwrap().quote() })
12718            }),
12719        );
12720        FieldTypeDef {
12721            proc: self.proc.clone(),
12722            selection: query,
12723            graphql_client: self.graphql_client.clone(),
12724        }
12725    }
12726    /// Load a File from its ID.
12727    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
12728        let mut query = self.selection.select("loadFileFromID");
12729        query = query.arg_lazy(
12730            "id",
12731            Box::new(move || {
12732                let id = id.clone();
12733                Box::pin(async move { id.into_id().await.unwrap().quote() })
12734            }),
12735        );
12736        File {
12737            proc: self.proc.clone(),
12738            selection: query,
12739            graphql_client: self.graphql_client.clone(),
12740        }
12741    }
12742    /// Load a FunctionArg from its ID.
12743    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
12744        let mut query = self.selection.select("loadFunctionArgFromID");
12745        query = query.arg_lazy(
12746            "id",
12747            Box::new(move || {
12748                let id = id.clone();
12749                Box::pin(async move { id.into_id().await.unwrap().quote() })
12750            }),
12751        );
12752        FunctionArg {
12753            proc: self.proc.clone(),
12754            selection: query,
12755            graphql_client: self.graphql_client.clone(),
12756        }
12757    }
12758    /// Load a FunctionCallArgValue from its ID.
12759    pub fn load_function_call_arg_value_from_id(
12760        &self,
12761        id: impl IntoID<FunctionCallArgValueId>,
12762    ) -> FunctionCallArgValue {
12763        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
12764        query = query.arg_lazy(
12765            "id",
12766            Box::new(move || {
12767                let id = id.clone();
12768                Box::pin(async move { id.into_id().await.unwrap().quote() })
12769            }),
12770        );
12771        FunctionCallArgValue {
12772            proc: self.proc.clone(),
12773            selection: query,
12774            graphql_client: self.graphql_client.clone(),
12775        }
12776    }
12777    /// Load a FunctionCall from its ID.
12778    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
12779        let mut query = self.selection.select("loadFunctionCallFromID");
12780        query = query.arg_lazy(
12781            "id",
12782            Box::new(move || {
12783                let id = id.clone();
12784                Box::pin(async move { id.into_id().await.unwrap().quote() })
12785            }),
12786        );
12787        FunctionCall {
12788            proc: self.proc.clone(),
12789            selection: query,
12790            graphql_client: self.graphql_client.clone(),
12791        }
12792    }
12793    /// Load a Function from its ID.
12794    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
12795        let mut query = self.selection.select("loadFunctionFromID");
12796        query = query.arg_lazy(
12797            "id",
12798            Box::new(move || {
12799                let id = id.clone();
12800                Box::pin(async move { id.into_id().await.unwrap().quote() })
12801            }),
12802        );
12803        Function {
12804            proc: self.proc.clone(),
12805            selection: query,
12806            graphql_client: self.graphql_client.clone(),
12807        }
12808    }
12809    /// Load a GeneratedCode from its ID.
12810    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
12811        let mut query = self.selection.select("loadGeneratedCodeFromID");
12812        query = query.arg_lazy(
12813            "id",
12814            Box::new(move || {
12815                let id = id.clone();
12816                Box::pin(async move { id.into_id().await.unwrap().quote() })
12817            }),
12818        );
12819        GeneratedCode {
12820            proc: self.proc.clone(),
12821            selection: query,
12822            graphql_client: self.graphql_client.clone(),
12823        }
12824    }
12825    /// Load a Generator from its ID.
12826    pub fn load_generator_from_id(&self, id: impl IntoID<GeneratorId>) -> Generator {
12827        let mut query = self.selection.select("loadGeneratorFromID");
12828        query = query.arg_lazy(
12829            "id",
12830            Box::new(move || {
12831                let id = id.clone();
12832                Box::pin(async move { id.into_id().await.unwrap().quote() })
12833            }),
12834        );
12835        Generator {
12836            proc: self.proc.clone(),
12837            selection: query,
12838            graphql_client: self.graphql_client.clone(),
12839        }
12840    }
12841    /// Load a GeneratorGroup from its ID.
12842    pub fn load_generator_group_from_id(
12843        &self,
12844        id: impl IntoID<GeneratorGroupId>,
12845    ) -> GeneratorGroup {
12846        let mut query = self.selection.select("loadGeneratorGroupFromID");
12847        query = query.arg_lazy(
12848            "id",
12849            Box::new(move || {
12850                let id = id.clone();
12851                Box::pin(async move { id.into_id().await.unwrap().quote() })
12852            }),
12853        );
12854        GeneratorGroup {
12855            proc: self.proc.clone(),
12856            selection: query,
12857            graphql_client: self.graphql_client.clone(),
12858        }
12859    }
12860    /// Load a GitRef from its ID.
12861    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
12862        let mut query = self.selection.select("loadGitRefFromID");
12863        query = query.arg_lazy(
12864            "id",
12865            Box::new(move || {
12866                let id = id.clone();
12867                Box::pin(async move { id.into_id().await.unwrap().quote() })
12868            }),
12869        );
12870        GitRef {
12871            proc: self.proc.clone(),
12872            selection: query,
12873            graphql_client: self.graphql_client.clone(),
12874        }
12875    }
12876    /// Load a GitRepository from its ID.
12877    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
12878        let mut query = self.selection.select("loadGitRepositoryFromID");
12879        query = query.arg_lazy(
12880            "id",
12881            Box::new(move || {
12882                let id = id.clone();
12883                Box::pin(async move { id.into_id().await.unwrap().quote() })
12884            }),
12885        );
12886        GitRepository {
12887            proc: self.proc.clone(),
12888            selection: query,
12889            graphql_client: self.graphql_client.clone(),
12890        }
12891    }
12892    /// Load a Host from its ID.
12893    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
12894        let mut query = self.selection.select("loadHostFromID");
12895        query = query.arg_lazy(
12896            "id",
12897            Box::new(move || {
12898                let id = id.clone();
12899                Box::pin(async move { id.into_id().await.unwrap().quote() })
12900            }),
12901        );
12902        Host {
12903            proc: self.proc.clone(),
12904            selection: query,
12905            graphql_client: self.graphql_client.clone(),
12906        }
12907    }
12908    /// Load a InputTypeDef from its ID.
12909    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
12910        let mut query = self.selection.select("loadInputTypeDefFromID");
12911        query = query.arg_lazy(
12912            "id",
12913            Box::new(move || {
12914                let id = id.clone();
12915                Box::pin(async move { id.into_id().await.unwrap().quote() })
12916            }),
12917        );
12918        InputTypeDef {
12919            proc: self.proc.clone(),
12920            selection: query,
12921            graphql_client: self.graphql_client.clone(),
12922        }
12923    }
12924    /// Load a InterfaceTypeDef from its ID.
12925    pub fn load_interface_type_def_from_id(
12926        &self,
12927        id: impl IntoID<InterfaceTypeDefId>,
12928    ) -> InterfaceTypeDef {
12929        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
12930        query = query.arg_lazy(
12931            "id",
12932            Box::new(move || {
12933                let id = id.clone();
12934                Box::pin(async move { id.into_id().await.unwrap().quote() })
12935            }),
12936        );
12937        InterfaceTypeDef {
12938            proc: self.proc.clone(),
12939            selection: query,
12940            graphql_client: self.graphql_client.clone(),
12941        }
12942    }
12943    /// Load a JSONValue from its ID.
12944    pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
12945        let mut query = self.selection.select("loadJSONValueFromID");
12946        query = query.arg_lazy(
12947            "id",
12948            Box::new(move || {
12949                let id = id.clone();
12950                Box::pin(async move { id.into_id().await.unwrap().quote() })
12951            }),
12952        );
12953        JsonValue {
12954            proc: self.proc.clone(),
12955            selection: query,
12956            graphql_client: self.graphql_client.clone(),
12957        }
12958    }
12959    /// Load a LLM from its ID.
12960    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
12961        let mut query = self.selection.select("loadLLMFromID");
12962        query = query.arg_lazy(
12963            "id",
12964            Box::new(move || {
12965                let id = id.clone();
12966                Box::pin(async move { id.into_id().await.unwrap().quote() })
12967            }),
12968        );
12969        Llm {
12970            proc: self.proc.clone(),
12971            selection: query,
12972            graphql_client: self.graphql_client.clone(),
12973        }
12974    }
12975    /// Load a LLMTokenUsage from its ID.
12976    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
12977        let mut query = self.selection.select("loadLLMTokenUsageFromID");
12978        query = query.arg_lazy(
12979            "id",
12980            Box::new(move || {
12981                let id = id.clone();
12982                Box::pin(async move { id.into_id().await.unwrap().quote() })
12983            }),
12984        );
12985        LlmTokenUsage {
12986            proc: self.proc.clone(),
12987            selection: query,
12988            graphql_client: self.graphql_client.clone(),
12989        }
12990    }
12991    /// Load a Label from its ID.
12992    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
12993        let mut query = self.selection.select("loadLabelFromID");
12994        query = query.arg_lazy(
12995            "id",
12996            Box::new(move || {
12997                let id = id.clone();
12998                Box::pin(async move { id.into_id().await.unwrap().quote() })
12999            }),
13000        );
13001        Label {
13002            proc: self.proc.clone(),
13003            selection: query,
13004            graphql_client: self.graphql_client.clone(),
13005        }
13006    }
13007    /// Load a ListTypeDef from its ID.
13008    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
13009        let mut query = self.selection.select("loadListTypeDefFromID");
13010        query = query.arg_lazy(
13011            "id",
13012            Box::new(move || {
13013                let id = id.clone();
13014                Box::pin(async move { id.into_id().await.unwrap().quote() })
13015            }),
13016        );
13017        ListTypeDef {
13018            proc: self.proc.clone(),
13019            selection: query,
13020            graphql_client: self.graphql_client.clone(),
13021        }
13022    }
13023    /// Load a ModuleConfigClient from its ID.
13024    pub fn load_module_config_client_from_id(
13025        &self,
13026        id: impl IntoID<ModuleConfigClientId>,
13027    ) -> ModuleConfigClient {
13028        let mut query = self.selection.select("loadModuleConfigClientFromID");
13029        query = query.arg_lazy(
13030            "id",
13031            Box::new(move || {
13032                let id = id.clone();
13033                Box::pin(async move { id.into_id().await.unwrap().quote() })
13034            }),
13035        );
13036        ModuleConfigClient {
13037            proc: self.proc.clone(),
13038            selection: query,
13039            graphql_client: self.graphql_client.clone(),
13040        }
13041    }
13042    /// Load a Module from its ID.
13043    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
13044        let mut query = self.selection.select("loadModuleFromID");
13045        query = query.arg_lazy(
13046            "id",
13047            Box::new(move || {
13048                let id = id.clone();
13049                Box::pin(async move { id.into_id().await.unwrap().quote() })
13050            }),
13051        );
13052        Module {
13053            proc: self.proc.clone(),
13054            selection: query,
13055            graphql_client: self.graphql_client.clone(),
13056        }
13057    }
13058    /// Load a ModuleSource from its ID.
13059    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
13060        let mut query = self.selection.select("loadModuleSourceFromID");
13061        query = query.arg_lazy(
13062            "id",
13063            Box::new(move || {
13064                let id = id.clone();
13065                Box::pin(async move { id.into_id().await.unwrap().quote() })
13066            }),
13067        );
13068        ModuleSource {
13069            proc: self.proc.clone(),
13070            selection: query,
13071            graphql_client: self.graphql_client.clone(),
13072        }
13073    }
13074    /// Load a ObjectTypeDef from its ID.
13075    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
13076        let mut query = self.selection.select("loadObjectTypeDefFromID");
13077        query = query.arg_lazy(
13078            "id",
13079            Box::new(move || {
13080                let id = id.clone();
13081                Box::pin(async move { id.into_id().await.unwrap().quote() })
13082            }),
13083        );
13084        ObjectTypeDef {
13085            proc: self.proc.clone(),
13086            selection: query,
13087            graphql_client: self.graphql_client.clone(),
13088        }
13089    }
13090    /// Load a Port from its ID.
13091    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
13092        let mut query = self.selection.select("loadPortFromID");
13093        query = query.arg_lazy(
13094            "id",
13095            Box::new(move || {
13096                let id = id.clone();
13097                Box::pin(async move { id.into_id().await.unwrap().quote() })
13098            }),
13099        );
13100        Port {
13101            proc: self.proc.clone(),
13102            selection: query,
13103            graphql_client: self.graphql_client.clone(),
13104        }
13105    }
13106    /// Load a SDKConfig from its ID.
13107    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
13108        let mut query = self.selection.select("loadSDKConfigFromID");
13109        query = query.arg_lazy(
13110            "id",
13111            Box::new(move || {
13112                let id = id.clone();
13113                Box::pin(async move { id.into_id().await.unwrap().quote() })
13114            }),
13115        );
13116        SdkConfig {
13117            proc: self.proc.clone(),
13118            selection: query,
13119            graphql_client: self.graphql_client.clone(),
13120        }
13121    }
13122    /// Load a ScalarTypeDef from its ID.
13123    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
13124        let mut query = self.selection.select("loadScalarTypeDefFromID");
13125        query = query.arg_lazy(
13126            "id",
13127            Box::new(move || {
13128                let id = id.clone();
13129                Box::pin(async move { id.into_id().await.unwrap().quote() })
13130            }),
13131        );
13132        ScalarTypeDef {
13133            proc: self.proc.clone(),
13134            selection: query,
13135            graphql_client: self.graphql_client.clone(),
13136        }
13137    }
13138    /// Load a SearchResult from its ID.
13139    pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
13140        let mut query = self.selection.select("loadSearchResultFromID");
13141        query = query.arg_lazy(
13142            "id",
13143            Box::new(move || {
13144                let id = id.clone();
13145                Box::pin(async move { id.into_id().await.unwrap().quote() })
13146            }),
13147        );
13148        SearchResult {
13149            proc: self.proc.clone(),
13150            selection: query,
13151            graphql_client: self.graphql_client.clone(),
13152        }
13153    }
13154    /// Load a SearchSubmatch from its ID.
13155    pub fn load_search_submatch_from_id(
13156        &self,
13157        id: impl IntoID<SearchSubmatchId>,
13158    ) -> SearchSubmatch {
13159        let mut query = self.selection.select("loadSearchSubmatchFromID");
13160        query = query.arg_lazy(
13161            "id",
13162            Box::new(move || {
13163                let id = id.clone();
13164                Box::pin(async move { id.into_id().await.unwrap().quote() })
13165            }),
13166        );
13167        SearchSubmatch {
13168            proc: self.proc.clone(),
13169            selection: query,
13170            graphql_client: self.graphql_client.clone(),
13171        }
13172    }
13173    /// Load a Secret from its ID.
13174    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
13175        let mut query = self.selection.select("loadSecretFromID");
13176        query = query.arg_lazy(
13177            "id",
13178            Box::new(move || {
13179                let id = id.clone();
13180                Box::pin(async move { id.into_id().await.unwrap().quote() })
13181            }),
13182        );
13183        Secret {
13184            proc: self.proc.clone(),
13185            selection: query,
13186            graphql_client: self.graphql_client.clone(),
13187        }
13188    }
13189    /// Load a Service from its ID.
13190    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
13191        let mut query = self.selection.select("loadServiceFromID");
13192        query = query.arg_lazy(
13193            "id",
13194            Box::new(move || {
13195                let id = id.clone();
13196                Box::pin(async move { id.into_id().await.unwrap().quote() })
13197            }),
13198        );
13199        Service {
13200            proc: self.proc.clone(),
13201            selection: query,
13202            graphql_client: self.graphql_client.clone(),
13203        }
13204    }
13205    /// Load a Socket from its ID.
13206    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
13207        let mut query = self.selection.select("loadSocketFromID");
13208        query = query.arg_lazy(
13209            "id",
13210            Box::new(move || {
13211                let id = id.clone();
13212                Box::pin(async move { id.into_id().await.unwrap().quote() })
13213            }),
13214        );
13215        Socket {
13216            proc: self.proc.clone(),
13217            selection: query,
13218            graphql_client: self.graphql_client.clone(),
13219        }
13220    }
13221    /// Load a SourceMap from its ID.
13222    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
13223        let mut query = self.selection.select("loadSourceMapFromID");
13224        query = query.arg_lazy(
13225            "id",
13226            Box::new(move || {
13227                let id = id.clone();
13228                Box::pin(async move { id.into_id().await.unwrap().quote() })
13229            }),
13230        );
13231        SourceMap {
13232            proc: self.proc.clone(),
13233            selection: query,
13234            graphql_client: self.graphql_client.clone(),
13235        }
13236    }
13237    /// Load a Stat from its ID.
13238    pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
13239        let mut query = self.selection.select("loadStatFromID");
13240        query = query.arg_lazy(
13241            "id",
13242            Box::new(move || {
13243                let id = id.clone();
13244                Box::pin(async move { id.into_id().await.unwrap().quote() })
13245            }),
13246        );
13247        Stat {
13248            proc: self.proc.clone(),
13249            selection: query,
13250            graphql_client: self.graphql_client.clone(),
13251        }
13252    }
13253    /// Load a Terminal from its ID.
13254    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
13255        let mut query = self.selection.select("loadTerminalFromID");
13256        query = query.arg_lazy(
13257            "id",
13258            Box::new(move || {
13259                let id = id.clone();
13260                Box::pin(async move { id.into_id().await.unwrap().quote() })
13261            }),
13262        );
13263        Terminal {
13264            proc: self.proc.clone(),
13265            selection: query,
13266            graphql_client: self.graphql_client.clone(),
13267        }
13268    }
13269    /// Load a TypeDef from its ID.
13270    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
13271        let mut query = self.selection.select("loadTypeDefFromID");
13272        query = query.arg_lazy(
13273            "id",
13274            Box::new(move || {
13275                let id = id.clone();
13276                Box::pin(async move { id.into_id().await.unwrap().quote() })
13277            }),
13278        );
13279        TypeDef {
13280            proc: self.proc.clone(),
13281            selection: query,
13282            graphql_client: self.graphql_client.clone(),
13283        }
13284    }
13285    /// Load a Workspace from its ID.
13286    pub fn load_workspace_from_id(&self, id: impl IntoID<WorkspaceId>) -> Workspace {
13287        let mut query = self.selection.select("loadWorkspaceFromID");
13288        query = query.arg_lazy(
13289            "id",
13290            Box::new(move || {
13291                let id = id.clone();
13292                Box::pin(async move { id.into_id().await.unwrap().quote() })
13293            }),
13294        );
13295        Workspace {
13296            proc: self.proc.clone(),
13297            selection: query,
13298            graphql_client: self.graphql_client.clone(),
13299        }
13300    }
13301    /// Create a new module.
13302    pub fn module(&self) -> Module {
13303        let query = self.selection.select("module");
13304        Module {
13305            proc: self.proc.clone(),
13306            selection: query,
13307            graphql_client: self.graphql_client.clone(),
13308        }
13309    }
13310    /// Create a new module source instance from a source ref string
13311    ///
13312    /// # Arguments
13313    ///
13314    /// * `ref_string` - The string ref representation of the module source
13315    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13316    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
13317        let mut query = self.selection.select("moduleSource");
13318        query = query.arg("refString", ref_string.into());
13319        ModuleSource {
13320            proc: self.proc.clone(),
13321            selection: query,
13322            graphql_client: self.graphql_client.clone(),
13323        }
13324    }
13325    /// Create a new module source instance from a source ref string
13326    ///
13327    /// # Arguments
13328    ///
13329    /// * `ref_string` - The string ref representation of the module source
13330    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13331    pub fn module_source_opts<'a>(
13332        &self,
13333        ref_string: impl Into<String>,
13334        opts: QueryModuleSourceOpts<'a>,
13335    ) -> ModuleSource {
13336        let mut query = self.selection.select("moduleSource");
13337        query = query.arg("refString", ref_string.into());
13338        if let Some(ref_pin) = opts.ref_pin {
13339            query = query.arg("refPin", ref_pin);
13340        }
13341        if let Some(disable_find_up) = opts.disable_find_up {
13342            query = query.arg("disableFindUp", disable_find_up);
13343        }
13344        if let Some(allow_not_exists) = opts.allow_not_exists {
13345            query = query.arg("allowNotExists", allow_not_exists);
13346        }
13347        if let Some(require_kind) = opts.require_kind {
13348            query = query.arg("requireKind", require_kind);
13349        }
13350        ModuleSource {
13351            proc: self.proc.clone(),
13352            selection: query,
13353            graphql_client: self.graphql_client.clone(),
13354        }
13355    }
13356    /// Creates a new secret.
13357    ///
13358    /// # Arguments
13359    ///
13360    /// * `uri` - The URI of the secret store
13361    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13362    pub fn secret(&self, uri: impl Into<String>) -> Secret {
13363        let mut query = self.selection.select("secret");
13364        query = query.arg("uri", uri.into());
13365        Secret {
13366            proc: self.proc.clone(),
13367            selection: query,
13368            graphql_client: self.graphql_client.clone(),
13369        }
13370    }
13371    /// Creates a new secret.
13372    ///
13373    /// # Arguments
13374    ///
13375    /// * `uri` - The URI of the secret store
13376    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13377    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
13378        let mut query = self.selection.select("secret");
13379        query = query.arg("uri", uri.into());
13380        if let Some(cache_key) = opts.cache_key {
13381            query = query.arg("cacheKey", cache_key);
13382        }
13383        Secret {
13384            proc: self.proc.clone(),
13385            selection: query,
13386            graphql_client: self.graphql_client.clone(),
13387        }
13388    }
13389    /// Sets a secret given a user defined name to its plaintext and returns the secret.
13390    /// The plaintext value is limited to a size of 128000 bytes.
13391    ///
13392    /// # Arguments
13393    ///
13394    /// * `name` - The user defined name for this secret
13395    /// * `plaintext` - The plaintext of the secret
13396    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
13397        let mut query = self.selection.select("setSecret");
13398        query = query.arg("name", name.into());
13399        query = query.arg("plaintext", plaintext.into());
13400        Secret {
13401            proc: self.proc.clone(),
13402            selection: query,
13403            graphql_client: self.graphql_client.clone(),
13404        }
13405    }
13406    /// Creates source map metadata.
13407    ///
13408    /// # Arguments
13409    ///
13410    /// * `filename` - The filename from the module source.
13411    /// * `line` - The line number within the filename.
13412    /// * `column` - The column number within the line.
13413    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
13414        let mut query = self.selection.select("sourceMap");
13415        query = query.arg("filename", filename.into());
13416        query = query.arg("line", line);
13417        query = query.arg("column", column);
13418        SourceMap {
13419            proc: self.proc.clone(),
13420            selection: query,
13421            graphql_client: self.graphql_client.clone(),
13422        }
13423    }
13424    /// Create a new TypeDef.
13425    pub fn type_def(&self) -> TypeDef {
13426        let query = self.selection.select("typeDef");
13427        TypeDef {
13428            proc: self.proc.clone(),
13429            selection: query,
13430            graphql_client: self.graphql_client.clone(),
13431        }
13432    }
13433    /// Get the current Dagger Engine version.
13434    pub async fn version(&self) -> Result<String, DaggerError> {
13435        let query = self.selection.select("version");
13436        query.execute(self.graphql_client.clone()).await
13437    }
13438}
13439#[derive(Clone)]
13440pub struct SdkConfig {
13441    pub proc: Option<Arc<DaggerSessionProc>>,
13442    pub selection: Selection,
13443    pub graphql_client: DynGraphQLClient,
13444}
13445impl SdkConfig {
13446    /// Whether to start the SDK runtime in debug mode with an interactive terminal.
13447    pub async fn debug(&self) -> Result<bool, DaggerError> {
13448        let query = self.selection.select("debug");
13449        query.execute(self.graphql_client.clone()).await
13450    }
13451    /// A unique identifier for this SDKConfig.
13452    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
13453        let query = self.selection.select("id");
13454        query.execute(self.graphql_client.clone()).await
13455    }
13456    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
13457    pub async fn source(&self) -> Result<String, DaggerError> {
13458        let query = self.selection.select("source");
13459        query.execute(self.graphql_client.clone()).await
13460    }
13461}
13462#[derive(Clone)]
13463pub struct ScalarTypeDef {
13464    pub proc: Option<Arc<DaggerSessionProc>>,
13465    pub selection: Selection,
13466    pub graphql_client: DynGraphQLClient,
13467}
13468impl ScalarTypeDef {
13469    /// A doc string for the scalar, if any.
13470    pub async fn description(&self) -> Result<String, DaggerError> {
13471        let query = self.selection.select("description");
13472        query.execute(self.graphql_client.clone()).await
13473    }
13474    /// A unique identifier for this ScalarTypeDef.
13475    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
13476        let query = self.selection.select("id");
13477        query.execute(self.graphql_client.clone()).await
13478    }
13479    /// The name of the scalar.
13480    pub async fn name(&self) -> Result<String, DaggerError> {
13481        let query = self.selection.select("name");
13482        query.execute(self.graphql_client.clone()).await
13483    }
13484    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
13485    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
13486        let query = self.selection.select("sourceModuleName");
13487        query.execute(self.graphql_client.clone()).await
13488    }
13489}
13490#[derive(Clone)]
13491pub struct SearchResult {
13492    pub proc: Option<Arc<DaggerSessionProc>>,
13493    pub selection: Selection,
13494    pub graphql_client: DynGraphQLClient,
13495}
13496impl SearchResult {
13497    /// The byte offset of this line within the file.
13498    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
13499        let query = self.selection.select("absoluteOffset");
13500        query.execute(self.graphql_client.clone()).await
13501    }
13502    /// The path to the file that matched.
13503    pub async fn file_path(&self) -> Result<String, DaggerError> {
13504        let query = self.selection.select("filePath");
13505        query.execute(self.graphql_client.clone()).await
13506    }
13507    /// A unique identifier for this SearchResult.
13508    pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
13509        let query = self.selection.select("id");
13510        query.execute(self.graphql_client.clone()).await
13511    }
13512    /// The first line that matched.
13513    pub async fn line_number(&self) -> Result<isize, DaggerError> {
13514        let query = self.selection.select("lineNumber");
13515        query.execute(self.graphql_client.clone()).await
13516    }
13517    /// The line content that matched.
13518    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
13519        let query = self.selection.select("matchedLines");
13520        query.execute(self.graphql_client.clone()).await
13521    }
13522    /// Sub-match positions and content within the matched lines.
13523    pub fn submatches(&self) -> Vec<SearchSubmatch> {
13524        let query = self.selection.select("submatches");
13525        vec![SearchSubmatch {
13526            proc: self.proc.clone(),
13527            selection: query,
13528            graphql_client: self.graphql_client.clone(),
13529        }]
13530    }
13531}
13532#[derive(Clone)]
13533pub struct SearchSubmatch {
13534    pub proc: Option<Arc<DaggerSessionProc>>,
13535    pub selection: Selection,
13536    pub graphql_client: DynGraphQLClient,
13537}
13538impl SearchSubmatch {
13539    /// The match's end offset within the matched lines.
13540    pub async fn end(&self) -> Result<isize, DaggerError> {
13541        let query = self.selection.select("end");
13542        query.execute(self.graphql_client.clone()).await
13543    }
13544    /// A unique identifier for this SearchSubmatch.
13545    pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
13546        let query = self.selection.select("id");
13547        query.execute(self.graphql_client.clone()).await
13548    }
13549    /// The match's start offset within the matched lines.
13550    pub async fn start(&self) -> Result<isize, DaggerError> {
13551        let query = self.selection.select("start");
13552        query.execute(self.graphql_client.clone()).await
13553    }
13554    /// The matched text.
13555    pub async fn text(&self) -> Result<String, DaggerError> {
13556        let query = self.selection.select("text");
13557        query.execute(self.graphql_client.clone()).await
13558    }
13559}
13560#[derive(Clone)]
13561pub struct Secret {
13562    pub proc: Option<Arc<DaggerSessionProc>>,
13563    pub selection: Selection,
13564    pub graphql_client: DynGraphQLClient,
13565}
13566impl Secret {
13567    /// A unique identifier for this Secret.
13568    pub async fn id(&self) -> Result<SecretId, DaggerError> {
13569        let query = self.selection.select("id");
13570        query.execute(self.graphql_client.clone()).await
13571    }
13572    /// The name of this secret.
13573    pub async fn name(&self) -> Result<String, DaggerError> {
13574        let query = self.selection.select("name");
13575        query.execute(self.graphql_client.clone()).await
13576    }
13577    /// The value of this secret.
13578    pub async fn plaintext(&self) -> Result<String, DaggerError> {
13579        let query = self.selection.select("plaintext");
13580        query.execute(self.graphql_client.clone()).await
13581    }
13582    /// The URI of this secret.
13583    pub async fn uri(&self) -> Result<String, DaggerError> {
13584        let query = self.selection.select("uri");
13585        query.execute(self.graphql_client.clone()).await
13586    }
13587}
13588#[derive(Clone)]
13589pub struct Service {
13590    pub proc: Option<Arc<DaggerSessionProc>>,
13591    pub selection: Selection,
13592    pub graphql_client: DynGraphQLClient,
13593}
13594#[derive(Builder, Debug, PartialEq)]
13595pub struct ServiceEndpointOpts<'a> {
13596    /// The exposed port number for the endpoint
13597    #[builder(setter(into, strip_option), default)]
13598    pub port: Option<isize>,
13599    /// Return a URL with the given scheme, eg. http for http://
13600    #[builder(setter(into, strip_option), default)]
13601    pub scheme: Option<&'a str>,
13602}
13603#[derive(Builder, Debug, PartialEq)]
13604pub struct ServiceStopOpts {
13605    /// Immediately kill the service without waiting for a graceful exit
13606    #[builder(setter(into, strip_option), default)]
13607    pub kill: Option<bool>,
13608}
13609#[derive(Builder, Debug, PartialEq)]
13610pub struct ServiceTerminalOpts<'a> {
13611    #[builder(setter(into, strip_option), default)]
13612    pub cmd: Option<Vec<&'a str>>,
13613}
13614#[derive(Builder, Debug, PartialEq)]
13615pub struct ServiceUpOpts {
13616    /// List of frontend/backend port mappings to forward.
13617    /// Frontend is the port accepting traffic on the host, backend is the service port.
13618    #[builder(setter(into, strip_option), default)]
13619    pub ports: Option<Vec<PortForward>>,
13620    /// Bind each tunnel port to a random port on the host.
13621    #[builder(setter(into, strip_option), default)]
13622    pub random: Option<bool>,
13623}
13624impl Service {
13625    /// Retrieves an endpoint that clients can use to reach this container.
13626    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
13627    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
13628    ///
13629    /// # Arguments
13630    ///
13631    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13632    pub async fn endpoint(&self) -> Result<String, DaggerError> {
13633        let query = self.selection.select("endpoint");
13634        query.execute(self.graphql_client.clone()).await
13635    }
13636    /// Retrieves an endpoint that clients can use to reach this container.
13637    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
13638    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
13639    ///
13640    /// # Arguments
13641    ///
13642    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13643    pub async fn endpoint_opts<'a>(
13644        &self,
13645        opts: ServiceEndpointOpts<'a>,
13646    ) -> Result<String, DaggerError> {
13647        let mut query = self.selection.select("endpoint");
13648        if let Some(port) = opts.port {
13649            query = query.arg("port", port);
13650        }
13651        if let Some(scheme) = opts.scheme {
13652            query = query.arg("scheme", scheme);
13653        }
13654        query.execute(self.graphql_client.clone()).await
13655    }
13656    /// Retrieves a hostname which can be used by clients to reach this container.
13657    pub async fn hostname(&self) -> Result<String, DaggerError> {
13658        let query = self.selection.select("hostname");
13659        query.execute(self.graphql_client.clone()).await
13660    }
13661    /// A unique identifier for this Service.
13662    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
13663        let query = self.selection.select("id");
13664        query.execute(self.graphql_client.clone()).await
13665    }
13666    /// Retrieves the list of ports provided by the service.
13667    pub fn ports(&self) -> Vec<Port> {
13668        let query = self.selection.select("ports");
13669        vec![Port {
13670            proc: self.proc.clone(),
13671            selection: query,
13672            graphql_client: self.graphql_client.clone(),
13673        }]
13674    }
13675    /// Start the service and wait for its health checks to succeed.
13676    /// Services bound to a Container do not need to be manually started.
13677    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
13678        let query = self.selection.select("start");
13679        query.execute(self.graphql_client.clone()).await
13680    }
13681    /// Stop the service.
13682    ///
13683    /// # Arguments
13684    ///
13685    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13686    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
13687        let query = self.selection.select("stop");
13688        query.execute(self.graphql_client.clone()).await
13689    }
13690    /// Stop the service.
13691    ///
13692    /// # Arguments
13693    ///
13694    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13695    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
13696        let mut query = self.selection.select("stop");
13697        if let Some(kill) = opts.kill {
13698            query = query.arg("kill", kill);
13699        }
13700        query.execute(self.graphql_client.clone()).await
13701    }
13702    /// Forces evaluation of the pipeline in the engine.
13703    pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
13704        let query = self.selection.select("sync");
13705        query.execute(self.graphql_client.clone()).await
13706    }
13707    ///
13708    /// # Arguments
13709    ///
13710    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13711    pub fn terminal(&self) -> Service {
13712        let query = self.selection.select("terminal");
13713        Service {
13714            proc: self.proc.clone(),
13715            selection: query,
13716            graphql_client: self.graphql_client.clone(),
13717        }
13718    }
13719    ///
13720    /// # Arguments
13721    ///
13722    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13723    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
13724        let mut query = self.selection.select("terminal");
13725        if let Some(cmd) = opts.cmd {
13726            query = query.arg("cmd", cmd);
13727        }
13728        Service {
13729            proc: self.proc.clone(),
13730            selection: query,
13731            graphql_client: self.graphql_client.clone(),
13732        }
13733    }
13734    /// Creates a tunnel that forwards traffic from the caller's network to this service.
13735    ///
13736    /// # Arguments
13737    ///
13738    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13739    pub async fn up(&self) -> Result<Void, DaggerError> {
13740        let query = self.selection.select("up");
13741        query.execute(self.graphql_client.clone()).await
13742    }
13743    /// Creates a tunnel that forwards traffic from the caller's network to this service.
13744    ///
13745    /// # Arguments
13746    ///
13747    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13748    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
13749        let mut query = self.selection.select("up");
13750        if let Some(ports) = opts.ports {
13751            query = query.arg("ports", ports);
13752        }
13753        if let Some(random) = opts.random {
13754            query = query.arg("random", random);
13755        }
13756        query.execute(self.graphql_client.clone()).await
13757    }
13758    /// Configures a hostname which can be used by clients within the session to reach this container.
13759    ///
13760    /// # Arguments
13761    ///
13762    /// * `hostname` - The hostname to use.
13763    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
13764        let mut query = self.selection.select("withHostname");
13765        query = query.arg("hostname", hostname.into());
13766        Service {
13767            proc: self.proc.clone(),
13768            selection: query,
13769            graphql_client: self.graphql_client.clone(),
13770        }
13771    }
13772}
13773#[derive(Clone)]
13774pub struct Socket {
13775    pub proc: Option<Arc<DaggerSessionProc>>,
13776    pub selection: Selection,
13777    pub graphql_client: DynGraphQLClient,
13778}
13779impl Socket {
13780    /// A unique identifier for this Socket.
13781    pub async fn id(&self) -> Result<SocketId, DaggerError> {
13782        let query = self.selection.select("id");
13783        query.execute(self.graphql_client.clone()).await
13784    }
13785}
13786#[derive(Clone)]
13787pub struct SourceMap {
13788    pub proc: Option<Arc<DaggerSessionProc>>,
13789    pub selection: Selection,
13790    pub graphql_client: DynGraphQLClient,
13791}
13792impl SourceMap {
13793    /// The column number within the line.
13794    pub async fn column(&self) -> Result<isize, DaggerError> {
13795        let query = self.selection.select("column");
13796        query.execute(self.graphql_client.clone()).await
13797    }
13798    /// The filename from the module source.
13799    pub async fn filename(&self) -> Result<String, DaggerError> {
13800        let query = self.selection.select("filename");
13801        query.execute(self.graphql_client.clone()).await
13802    }
13803    /// A unique identifier for this SourceMap.
13804    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
13805        let query = self.selection.select("id");
13806        query.execute(self.graphql_client.clone()).await
13807    }
13808    /// The line number within the filename.
13809    pub async fn line(&self) -> Result<isize, DaggerError> {
13810        let query = self.selection.select("line");
13811        query.execute(self.graphql_client.clone()).await
13812    }
13813    /// The module dependency this was declared in.
13814    pub async fn module(&self) -> Result<String, DaggerError> {
13815        let query = self.selection.select("module");
13816        query.execute(self.graphql_client.clone()).await
13817    }
13818    /// The URL to the file, if any. This can be used to link to the source map in the browser.
13819    pub async fn url(&self) -> Result<String, DaggerError> {
13820        let query = self.selection.select("url");
13821        query.execute(self.graphql_client.clone()).await
13822    }
13823}
13824#[derive(Clone)]
13825pub struct Stat {
13826    pub proc: Option<Arc<DaggerSessionProc>>,
13827    pub selection: Selection,
13828    pub graphql_client: DynGraphQLClient,
13829}
13830impl Stat {
13831    /// file type
13832    pub async fn file_type(&self) -> Result<FileType, DaggerError> {
13833        let query = self.selection.select("fileType");
13834        query.execute(self.graphql_client.clone()).await
13835    }
13836    /// A unique identifier for this Stat.
13837    pub async fn id(&self) -> Result<StatId, DaggerError> {
13838        let query = self.selection.select("id");
13839        query.execute(self.graphql_client.clone()).await
13840    }
13841    /// file name
13842    pub async fn name(&self) -> Result<String, DaggerError> {
13843        let query = self.selection.select("name");
13844        query.execute(self.graphql_client.clone()).await
13845    }
13846    /// permission bits
13847    pub async fn permissions(&self) -> Result<isize, DaggerError> {
13848        let query = self.selection.select("permissions");
13849        query.execute(self.graphql_client.clone()).await
13850    }
13851    /// file size
13852    pub async fn size(&self) -> Result<isize, DaggerError> {
13853        let query = self.selection.select("size");
13854        query.execute(self.graphql_client.clone()).await
13855    }
13856}
13857#[derive(Clone)]
13858pub struct Terminal {
13859    pub proc: Option<Arc<DaggerSessionProc>>,
13860    pub selection: Selection,
13861    pub graphql_client: DynGraphQLClient,
13862}
13863impl Terminal {
13864    /// A unique identifier for this Terminal.
13865    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
13866        let query = self.selection.select("id");
13867        query.execute(self.graphql_client.clone()).await
13868    }
13869    /// Forces evaluation of the pipeline in the engine.
13870    /// It doesn't run the default command if no exec has been set.
13871    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
13872        let query = self.selection.select("sync");
13873        query.execute(self.graphql_client.clone()).await
13874    }
13875}
13876#[derive(Clone)]
13877pub struct TypeDef {
13878    pub proc: Option<Arc<DaggerSessionProc>>,
13879    pub selection: Selection,
13880    pub graphql_client: DynGraphQLClient,
13881}
13882#[derive(Builder, Debug, PartialEq)]
13883pub struct TypeDefWithEnumOpts<'a> {
13884    /// A doc string for the enum, if any
13885    #[builder(setter(into, strip_option), default)]
13886    pub description: Option<&'a str>,
13887    /// The source map for the enum definition.
13888    #[builder(setter(into, strip_option), default)]
13889    pub source_map: Option<SourceMapId>,
13890}
13891#[derive(Builder, Debug, PartialEq)]
13892pub struct TypeDefWithEnumMemberOpts<'a> {
13893    /// If deprecated, the reason or migration path.
13894    #[builder(setter(into, strip_option), default)]
13895    pub deprecated: Option<&'a str>,
13896    /// A doc string for the member, if any
13897    #[builder(setter(into, strip_option), default)]
13898    pub description: Option<&'a str>,
13899    /// The source map for the enum member definition.
13900    #[builder(setter(into, strip_option), default)]
13901    pub source_map: Option<SourceMapId>,
13902    /// The value of the member in the enum
13903    #[builder(setter(into, strip_option), default)]
13904    pub value: Option<&'a str>,
13905}
13906#[derive(Builder, Debug, PartialEq)]
13907pub struct TypeDefWithEnumValueOpts<'a> {
13908    /// If deprecated, the reason or migration path.
13909    #[builder(setter(into, strip_option), default)]
13910    pub deprecated: Option<&'a str>,
13911    /// A doc string for the value, if any
13912    #[builder(setter(into, strip_option), default)]
13913    pub description: Option<&'a str>,
13914    /// The source map for the enum value definition.
13915    #[builder(setter(into, strip_option), default)]
13916    pub source_map: Option<SourceMapId>,
13917}
13918#[derive(Builder, Debug, PartialEq)]
13919pub struct TypeDefWithFieldOpts<'a> {
13920    /// If deprecated, the reason or migration path.
13921    #[builder(setter(into, strip_option), default)]
13922    pub deprecated: Option<&'a str>,
13923    /// A doc string for the field, if any
13924    #[builder(setter(into, strip_option), default)]
13925    pub description: Option<&'a str>,
13926    /// The source map for the field definition.
13927    #[builder(setter(into, strip_option), default)]
13928    pub source_map: Option<SourceMapId>,
13929}
13930#[derive(Builder, Debug, PartialEq)]
13931pub struct TypeDefWithInterfaceOpts<'a> {
13932    #[builder(setter(into, strip_option), default)]
13933    pub description: Option<&'a str>,
13934    #[builder(setter(into, strip_option), default)]
13935    pub source_map: Option<SourceMapId>,
13936}
13937#[derive(Builder, Debug, PartialEq)]
13938pub struct TypeDefWithObjectOpts<'a> {
13939    #[builder(setter(into, strip_option), default)]
13940    pub deprecated: Option<&'a str>,
13941    #[builder(setter(into, strip_option), default)]
13942    pub description: Option<&'a str>,
13943    #[builder(setter(into, strip_option), default)]
13944    pub source_map: Option<SourceMapId>,
13945}
13946#[derive(Builder, Debug, PartialEq)]
13947pub struct TypeDefWithScalarOpts<'a> {
13948    #[builder(setter(into, strip_option), default)]
13949    pub description: Option<&'a str>,
13950}
13951impl TypeDef {
13952    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
13953    pub fn as_enum(&self) -> EnumTypeDef {
13954        let query = self.selection.select("asEnum");
13955        EnumTypeDef {
13956            proc: self.proc.clone(),
13957            selection: query,
13958            graphql_client: self.graphql_client.clone(),
13959        }
13960    }
13961    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
13962    pub fn as_input(&self) -> InputTypeDef {
13963        let query = self.selection.select("asInput");
13964        InputTypeDef {
13965            proc: self.proc.clone(),
13966            selection: query,
13967            graphql_client: self.graphql_client.clone(),
13968        }
13969    }
13970    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
13971    pub fn as_interface(&self) -> InterfaceTypeDef {
13972        let query = self.selection.select("asInterface");
13973        InterfaceTypeDef {
13974            proc: self.proc.clone(),
13975            selection: query,
13976            graphql_client: self.graphql_client.clone(),
13977        }
13978    }
13979    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
13980    pub fn as_list(&self) -> ListTypeDef {
13981        let query = self.selection.select("asList");
13982        ListTypeDef {
13983            proc: self.proc.clone(),
13984            selection: query,
13985            graphql_client: self.graphql_client.clone(),
13986        }
13987    }
13988    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
13989    pub fn as_object(&self) -> ObjectTypeDef {
13990        let query = self.selection.select("asObject");
13991        ObjectTypeDef {
13992            proc: self.proc.clone(),
13993            selection: query,
13994            graphql_client: self.graphql_client.clone(),
13995        }
13996    }
13997    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
13998    pub fn as_scalar(&self) -> ScalarTypeDef {
13999        let query = self.selection.select("asScalar");
14000        ScalarTypeDef {
14001            proc: self.proc.clone(),
14002            selection: query,
14003            graphql_client: self.graphql_client.clone(),
14004        }
14005    }
14006    /// A unique identifier for this TypeDef.
14007    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
14008        let query = self.selection.select("id");
14009        query.execute(self.graphql_client.clone()).await
14010    }
14011    /// The kind of type this is (e.g. primitive, list, object).
14012    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
14013        let query = self.selection.select("kind");
14014        query.execute(self.graphql_client.clone()).await
14015    }
14016    /// Whether this type can be set to null. Defaults to false.
14017    pub async fn optional(&self) -> Result<bool, DaggerError> {
14018        let query = self.selection.select("optional");
14019        query.execute(self.graphql_client.clone()).await
14020    }
14021    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
14022    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
14023        let mut query = self.selection.select("withConstructor");
14024        query = query.arg_lazy(
14025            "function",
14026            Box::new(move || {
14027                let function = function.clone();
14028                Box::pin(async move { function.into_id().await.unwrap().quote() })
14029            }),
14030        );
14031        TypeDef {
14032            proc: self.proc.clone(),
14033            selection: query,
14034            graphql_client: self.graphql_client.clone(),
14035        }
14036    }
14037    /// Returns a TypeDef of kind Enum with the provided name.
14038    /// 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.
14039    ///
14040    /// # Arguments
14041    ///
14042    /// * `name` - The name of the enum
14043    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14044    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
14045        let mut query = self.selection.select("withEnum");
14046        query = query.arg("name", name.into());
14047        TypeDef {
14048            proc: self.proc.clone(),
14049            selection: query,
14050            graphql_client: self.graphql_client.clone(),
14051        }
14052    }
14053    /// Returns a TypeDef of kind Enum with the provided name.
14054    /// 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.
14055    ///
14056    /// # Arguments
14057    ///
14058    /// * `name` - The name of the enum
14059    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14060    pub fn with_enum_opts<'a>(
14061        &self,
14062        name: impl Into<String>,
14063        opts: TypeDefWithEnumOpts<'a>,
14064    ) -> TypeDef {
14065        let mut query = self.selection.select("withEnum");
14066        query = query.arg("name", name.into());
14067        if let Some(description) = opts.description {
14068            query = query.arg("description", description);
14069        }
14070        if let Some(source_map) = opts.source_map {
14071            query = query.arg("sourceMap", source_map);
14072        }
14073        TypeDef {
14074            proc: self.proc.clone(),
14075            selection: query,
14076            graphql_client: self.graphql_client.clone(),
14077        }
14078    }
14079    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14080    ///
14081    /// # Arguments
14082    ///
14083    /// * `name` - The name of the member in the enum
14084    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14085    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
14086        let mut query = self.selection.select("withEnumMember");
14087        query = query.arg("name", name.into());
14088        TypeDef {
14089            proc: self.proc.clone(),
14090            selection: query,
14091            graphql_client: self.graphql_client.clone(),
14092        }
14093    }
14094    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14095    ///
14096    /// # Arguments
14097    ///
14098    /// * `name` - The name of the member in the enum
14099    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14100    pub fn with_enum_member_opts<'a>(
14101        &self,
14102        name: impl Into<String>,
14103        opts: TypeDefWithEnumMemberOpts<'a>,
14104    ) -> TypeDef {
14105        let mut query = self.selection.select("withEnumMember");
14106        query = query.arg("name", name.into());
14107        if let Some(value) = opts.value {
14108            query = query.arg("value", value);
14109        }
14110        if let Some(description) = opts.description {
14111            query = query.arg("description", description);
14112        }
14113        if let Some(source_map) = opts.source_map {
14114            query = query.arg("sourceMap", source_map);
14115        }
14116        if let Some(deprecated) = opts.deprecated {
14117            query = query.arg("deprecated", deprecated);
14118        }
14119        TypeDef {
14120            proc: self.proc.clone(),
14121            selection: query,
14122            graphql_client: self.graphql_client.clone(),
14123        }
14124    }
14125    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14126    ///
14127    /// # Arguments
14128    ///
14129    /// * `value` - The name of the value in the enum
14130    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14131    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
14132        let mut query = self.selection.select("withEnumValue");
14133        query = query.arg("value", value.into());
14134        TypeDef {
14135            proc: self.proc.clone(),
14136            selection: query,
14137            graphql_client: self.graphql_client.clone(),
14138        }
14139    }
14140    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14141    ///
14142    /// # Arguments
14143    ///
14144    /// * `value` - The name of the value in the enum
14145    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14146    pub fn with_enum_value_opts<'a>(
14147        &self,
14148        value: impl Into<String>,
14149        opts: TypeDefWithEnumValueOpts<'a>,
14150    ) -> TypeDef {
14151        let mut query = self.selection.select("withEnumValue");
14152        query = query.arg("value", value.into());
14153        if let Some(description) = opts.description {
14154            query = query.arg("description", description);
14155        }
14156        if let Some(source_map) = opts.source_map {
14157            query = query.arg("sourceMap", source_map);
14158        }
14159        if let Some(deprecated) = opts.deprecated {
14160            query = query.arg("deprecated", deprecated);
14161        }
14162        TypeDef {
14163            proc: self.proc.clone(),
14164            selection: query,
14165            graphql_client: self.graphql_client.clone(),
14166        }
14167    }
14168    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
14169    ///
14170    /// # Arguments
14171    ///
14172    /// * `name` - The name of the field in the object
14173    /// * `type_def` - The type of the field
14174    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14175    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
14176        let mut query = self.selection.select("withField");
14177        query = query.arg("name", name.into());
14178        query = query.arg_lazy(
14179            "typeDef",
14180            Box::new(move || {
14181                let type_def = type_def.clone();
14182                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
14183            }),
14184        );
14185        TypeDef {
14186            proc: self.proc.clone(),
14187            selection: query,
14188            graphql_client: self.graphql_client.clone(),
14189        }
14190    }
14191    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
14192    ///
14193    /// # Arguments
14194    ///
14195    /// * `name` - The name of the field in the object
14196    /// * `type_def` - The type of the field
14197    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14198    pub fn with_field_opts<'a>(
14199        &self,
14200        name: impl Into<String>,
14201        type_def: impl IntoID<TypeDefId>,
14202        opts: TypeDefWithFieldOpts<'a>,
14203    ) -> TypeDef {
14204        let mut query = self.selection.select("withField");
14205        query = query.arg("name", name.into());
14206        query = query.arg_lazy(
14207            "typeDef",
14208            Box::new(move || {
14209                let type_def = type_def.clone();
14210                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
14211            }),
14212        );
14213        if let Some(description) = opts.description {
14214            query = query.arg("description", description);
14215        }
14216        if let Some(source_map) = opts.source_map {
14217            query = query.arg("sourceMap", source_map);
14218        }
14219        if let Some(deprecated) = opts.deprecated {
14220            query = query.arg("deprecated", deprecated);
14221        }
14222        TypeDef {
14223            proc: self.proc.clone(),
14224            selection: query,
14225            graphql_client: self.graphql_client.clone(),
14226        }
14227    }
14228    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
14229    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
14230        let mut query = self.selection.select("withFunction");
14231        query = query.arg_lazy(
14232            "function",
14233            Box::new(move || {
14234                let function = function.clone();
14235                Box::pin(async move { function.into_id().await.unwrap().quote() })
14236            }),
14237        );
14238        TypeDef {
14239            proc: self.proc.clone(),
14240            selection: query,
14241            graphql_client: self.graphql_client.clone(),
14242        }
14243    }
14244    /// Returns a TypeDef of kind Interface with the provided name.
14245    ///
14246    /// # Arguments
14247    ///
14248    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14249    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
14250        let mut query = self.selection.select("withInterface");
14251        query = query.arg("name", name.into());
14252        TypeDef {
14253            proc: self.proc.clone(),
14254            selection: query,
14255            graphql_client: self.graphql_client.clone(),
14256        }
14257    }
14258    /// Returns a TypeDef of kind Interface with the provided name.
14259    ///
14260    /// # Arguments
14261    ///
14262    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14263    pub fn with_interface_opts<'a>(
14264        &self,
14265        name: impl Into<String>,
14266        opts: TypeDefWithInterfaceOpts<'a>,
14267    ) -> TypeDef {
14268        let mut query = self.selection.select("withInterface");
14269        query = query.arg("name", name.into());
14270        if let Some(description) = opts.description {
14271            query = query.arg("description", description);
14272        }
14273        if let Some(source_map) = opts.source_map {
14274            query = query.arg("sourceMap", source_map);
14275        }
14276        TypeDef {
14277            proc: self.proc.clone(),
14278            selection: query,
14279            graphql_client: self.graphql_client.clone(),
14280        }
14281    }
14282    /// Sets the kind of the type.
14283    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
14284        let mut query = self.selection.select("withKind");
14285        query = query.arg("kind", kind);
14286        TypeDef {
14287            proc: self.proc.clone(),
14288            selection: query,
14289            graphql_client: self.graphql_client.clone(),
14290        }
14291    }
14292    /// Returns a TypeDef of kind List with the provided type for its elements.
14293    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
14294        let mut query = self.selection.select("withListOf");
14295        query = query.arg_lazy(
14296            "elementType",
14297            Box::new(move || {
14298                let element_type = element_type.clone();
14299                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
14300            }),
14301        );
14302        TypeDef {
14303            proc: self.proc.clone(),
14304            selection: query,
14305            graphql_client: self.graphql_client.clone(),
14306        }
14307    }
14308    /// Returns a TypeDef of kind Object with the provided name.
14309    /// 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.
14310    ///
14311    /// # Arguments
14312    ///
14313    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14314    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
14315        let mut query = self.selection.select("withObject");
14316        query = query.arg("name", name.into());
14317        TypeDef {
14318            proc: self.proc.clone(),
14319            selection: query,
14320            graphql_client: self.graphql_client.clone(),
14321        }
14322    }
14323    /// Returns a TypeDef of kind Object with the provided name.
14324    /// 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.
14325    ///
14326    /// # Arguments
14327    ///
14328    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14329    pub fn with_object_opts<'a>(
14330        &self,
14331        name: impl Into<String>,
14332        opts: TypeDefWithObjectOpts<'a>,
14333    ) -> TypeDef {
14334        let mut query = self.selection.select("withObject");
14335        query = query.arg("name", name.into());
14336        if let Some(description) = opts.description {
14337            query = query.arg("description", description);
14338        }
14339        if let Some(source_map) = opts.source_map {
14340            query = query.arg("sourceMap", source_map);
14341        }
14342        if let Some(deprecated) = opts.deprecated {
14343            query = query.arg("deprecated", deprecated);
14344        }
14345        TypeDef {
14346            proc: self.proc.clone(),
14347            selection: query,
14348            graphql_client: self.graphql_client.clone(),
14349        }
14350    }
14351    /// Sets whether this type can be set to null.
14352    pub fn with_optional(&self, optional: bool) -> TypeDef {
14353        let mut query = self.selection.select("withOptional");
14354        query = query.arg("optional", optional);
14355        TypeDef {
14356            proc: self.proc.clone(),
14357            selection: query,
14358            graphql_client: self.graphql_client.clone(),
14359        }
14360    }
14361    /// Returns a TypeDef of kind Scalar with the provided name.
14362    ///
14363    /// # Arguments
14364    ///
14365    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14366    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
14367        let mut query = self.selection.select("withScalar");
14368        query = query.arg("name", name.into());
14369        TypeDef {
14370            proc: self.proc.clone(),
14371            selection: query,
14372            graphql_client: self.graphql_client.clone(),
14373        }
14374    }
14375    /// Returns a TypeDef of kind Scalar with the provided name.
14376    ///
14377    /// # Arguments
14378    ///
14379    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14380    pub fn with_scalar_opts<'a>(
14381        &self,
14382        name: impl Into<String>,
14383        opts: TypeDefWithScalarOpts<'a>,
14384    ) -> TypeDef {
14385        let mut query = self.selection.select("withScalar");
14386        query = query.arg("name", name.into());
14387        if let Some(description) = opts.description {
14388            query = query.arg("description", description);
14389        }
14390        TypeDef {
14391            proc: self.proc.clone(),
14392            selection: query,
14393            graphql_client: self.graphql_client.clone(),
14394        }
14395    }
14396}
14397#[derive(Clone)]
14398pub struct Workspace {
14399    pub proc: Option<Arc<DaggerSessionProc>>,
14400    pub selection: Selection,
14401    pub graphql_client: DynGraphQLClient,
14402}
14403#[derive(Builder, Debug, PartialEq)]
14404pub struct WorkspaceDirectoryOpts<'a> {
14405    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
14406    #[builder(setter(into, strip_option), default)]
14407    pub exclude: Option<Vec<&'a str>>,
14408    /// Apply .gitignore filter rules inside the directory.
14409    #[builder(setter(into, strip_option), default)]
14410    pub gitignore: Option<bool>,
14411    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
14412    #[builder(setter(into, strip_option), default)]
14413    pub include: Option<Vec<&'a str>>,
14414}
14415#[derive(Builder, Debug, PartialEq)]
14416pub struct WorkspaceFindUpOpts<'a> {
14417    /// Path to start the search from, relative to the workspace root.
14418    #[builder(setter(into, strip_option), default)]
14419    pub from: Option<&'a str>,
14420}
14421impl Workspace {
14422    /// The client ID that owns this workspace's host filesystem.
14423    pub async fn client_id(&self) -> Result<String, DaggerError> {
14424        let query = self.selection.select("clientId");
14425        query.execute(self.graphql_client.clone()).await
14426    }
14427    /// Returns a Directory from the workspace.
14428    /// Path is relative to workspace root. Use "." for the root directory.
14429    ///
14430    /// # Arguments
14431    ///
14432    /// * `path` - Location of the directory to retrieve, relative to the workspace root (e.g., "src", ".").
14433    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14434    pub fn directory(&self, path: impl Into<String>) -> Directory {
14435        let mut query = self.selection.select("directory");
14436        query = query.arg("path", path.into());
14437        Directory {
14438            proc: self.proc.clone(),
14439            selection: query,
14440            graphql_client: self.graphql_client.clone(),
14441        }
14442    }
14443    /// Returns a Directory from the workspace.
14444    /// Path is relative to workspace root. Use "." for the root directory.
14445    ///
14446    /// # Arguments
14447    ///
14448    /// * `path` - Location of the directory to retrieve, relative to the workspace root (e.g., "src", ".").
14449    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14450    pub fn directory_opts<'a>(
14451        &self,
14452        path: impl Into<String>,
14453        opts: WorkspaceDirectoryOpts<'a>,
14454    ) -> Directory {
14455        let mut query = self.selection.select("directory");
14456        query = query.arg("path", path.into());
14457        if let Some(exclude) = opts.exclude {
14458            query = query.arg("exclude", exclude);
14459        }
14460        if let Some(include) = opts.include {
14461            query = query.arg("include", include);
14462        }
14463        if let Some(gitignore) = opts.gitignore {
14464            query = query.arg("gitignore", gitignore);
14465        }
14466        Directory {
14467            proc: self.proc.clone(),
14468            selection: query,
14469            graphql_client: self.graphql_client.clone(),
14470        }
14471    }
14472    /// Returns a File from the workspace.
14473    /// Path is relative to workspace root.
14474    ///
14475    /// # Arguments
14476    ///
14477    /// * `path` - Location of the file to retrieve, relative to the workspace root (e.g., "go.mod").
14478    pub fn file(&self, path: impl Into<String>) -> File {
14479        let mut query = self.selection.select("file");
14480        query = query.arg("path", path.into());
14481        File {
14482            proc: self.proc.clone(),
14483            selection: query,
14484            graphql_client: self.graphql_client.clone(),
14485        }
14486    }
14487    /// Search for a file or directory by walking up from the start path within the workspace.
14488    /// Returns the path relative to the workspace root if found, or null if not found.
14489    /// The search stops at the workspace root and will not traverse above it.
14490    ///
14491    /// # Arguments
14492    ///
14493    /// * `name` - The name of the file or directory to search for.
14494    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14495    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
14496        let mut query = self.selection.select("findUp");
14497        query = query.arg("name", name.into());
14498        query.execute(self.graphql_client.clone()).await
14499    }
14500    /// Search for a file or directory by walking up from the start path within the workspace.
14501    /// Returns the path relative to the workspace root if found, or null if not found.
14502    /// The search stops at the workspace root and will not traverse above it.
14503    ///
14504    /// # Arguments
14505    ///
14506    /// * `name` - The name of the file or directory to search for.
14507    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14508    pub async fn find_up_opts<'a>(
14509        &self,
14510        name: impl Into<String>,
14511        opts: WorkspaceFindUpOpts<'a>,
14512    ) -> Result<String, DaggerError> {
14513        let mut query = self.selection.select("findUp");
14514        query = query.arg("name", name.into());
14515        if let Some(from) = opts.from {
14516            query = query.arg("from", from);
14517        }
14518        query.execute(self.graphql_client.clone()).await
14519    }
14520    /// A unique identifier for this Workspace.
14521    pub async fn id(&self) -> Result<WorkspaceId, DaggerError> {
14522        let query = self.selection.select("id");
14523        query.execute(self.graphql_client.clone()).await
14524    }
14525    /// Absolute path to the workspace root directory.
14526    pub async fn root(&self) -> Result<String, DaggerError> {
14527        let query = self.selection.select("root");
14528        query.execute(self.graphql_client.clone()).await
14529    }
14530}
14531#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14532pub enum CacheSharingMode {
14533    #[serde(rename = "LOCKED")]
14534    Locked,
14535    #[serde(rename = "PRIVATE")]
14536    Private,
14537    #[serde(rename = "SHARED")]
14538    Shared,
14539}
14540#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14541pub enum ChangesetMergeConflict {
14542    #[serde(rename = "FAIL")]
14543    Fail,
14544    #[serde(rename = "FAIL_EARLY")]
14545    FailEarly,
14546    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
14547    LeaveConflictMarkers,
14548    #[serde(rename = "PREFER_OURS")]
14549    PreferOurs,
14550    #[serde(rename = "PREFER_THEIRS")]
14551    PreferTheirs,
14552}
14553#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14554pub enum ChangesetsMergeConflict {
14555    #[serde(rename = "FAIL")]
14556    Fail,
14557    #[serde(rename = "FAIL_EARLY")]
14558    FailEarly,
14559}
14560#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14561pub enum ExistsType {
14562    #[serde(rename = "DIRECTORY_TYPE")]
14563    DirectoryType,
14564    #[serde(rename = "REGULAR_TYPE")]
14565    RegularType,
14566    #[serde(rename = "SYMLINK_TYPE")]
14567    SymlinkType,
14568}
14569#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14570pub enum FileType {
14571    #[serde(rename = "DIRECTORY")]
14572    Directory,
14573    #[serde(rename = "DIRECTORY_TYPE")]
14574    DirectoryType,
14575    #[serde(rename = "REGULAR")]
14576    Regular,
14577    #[serde(rename = "REGULAR_TYPE")]
14578    RegularType,
14579    #[serde(rename = "SYMLINK")]
14580    Symlink,
14581    #[serde(rename = "SYMLINK_TYPE")]
14582    SymlinkType,
14583    #[serde(rename = "UNKNOWN")]
14584    Unknown,
14585}
14586#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14587pub enum FunctionCachePolicy {
14588    #[serde(rename = "Default")]
14589    Default,
14590    #[serde(rename = "Never")]
14591    Never,
14592    #[serde(rename = "PerSession")]
14593    PerSession,
14594}
14595#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14596pub enum ImageLayerCompression {
14597    #[serde(rename = "EStarGZ")]
14598    EStarGz,
14599    #[serde(rename = "ESTARGZ")]
14600    Estargz,
14601    #[serde(rename = "Gzip")]
14602    Gzip,
14603    #[serde(rename = "Uncompressed")]
14604    Uncompressed,
14605    #[serde(rename = "Zstd")]
14606    Zstd,
14607}
14608#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14609pub enum ImageMediaTypes {
14610    #[serde(rename = "DOCKER")]
14611    Docker,
14612    #[serde(rename = "DockerMediaTypes")]
14613    DockerMediaTypes,
14614    #[serde(rename = "OCI")]
14615    Oci,
14616    #[serde(rename = "OCIMediaTypes")]
14617    OciMediaTypes,
14618}
14619#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14620pub enum ModuleSourceExperimentalFeature {
14621    #[serde(rename = "SELF_CALLS")]
14622    SelfCalls,
14623}
14624#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14625pub enum ModuleSourceKind {
14626    #[serde(rename = "DIR")]
14627    Dir,
14628    #[serde(rename = "DIR_SOURCE")]
14629    DirSource,
14630    #[serde(rename = "GIT")]
14631    Git,
14632    #[serde(rename = "GIT_SOURCE")]
14633    GitSource,
14634    #[serde(rename = "LOCAL")]
14635    Local,
14636    #[serde(rename = "LOCAL_SOURCE")]
14637    LocalSource,
14638}
14639#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14640pub enum NetworkProtocol {
14641    #[serde(rename = "TCP")]
14642    Tcp,
14643    #[serde(rename = "UDP")]
14644    Udp,
14645}
14646#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14647pub enum ReturnType {
14648    #[serde(rename = "ANY")]
14649    Any,
14650    #[serde(rename = "FAILURE")]
14651    Failure,
14652    #[serde(rename = "SUCCESS")]
14653    Success,
14654}
14655#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
14656pub enum TypeDefKind {
14657    #[serde(rename = "BOOLEAN")]
14658    Boolean,
14659    #[serde(rename = "BOOLEAN_KIND")]
14660    BooleanKind,
14661    #[serde(rename = "ENUM")]
14662    Enum,
14663    #[serde(rename = "ENUM_KIND")]
14664    EnumKind,
14665    #[serde(rename = "FLOAT")]
14666    Float,
14667    #[serde(rename = "FLOAT_KIND")]
14668    FloatKind,
14669    #[serde(rename = "INPUT")]
14670    Input,
14671    #[serde(rename = "INPUT_KIND")]
14672    InputKind,
14673    #[serde(rename = "INTEGER")]
14674    Integer,
14675    #[serde(rename = "INTEGER_KIND")]
14676    IntegerKind,
14677    #[serde(rename = "INTERFACE")]
14678    Interface,
14679    #[serde(rename = "INTERFACE_KIND")]
14680    InterfaceKind,
14681    #[serde(rename = "LIST")]
14682    List,
14683    #[serde(rename = "LIST_KIND")]
14684    ListKind,
14685    #[serde(rename = "OBJECT")]
14686    Object,
14687    #[serde(rename = "OBJECT_KIND")]
14688    ObjectKind,
14689    #[serde(rename = "SCALAR")]
14690    Scalar,
14691    #[serde(rename = "SCALAR_KIND")]
14692    ScalarKind,
14693    #[serde(rename = "STRING")]
14694    String,
14695    #[serde(rename = "STRING_KIND")]
14696    StringKind,
14697    #[serde(rename = "VOID")]
14698    Void,
14699    #[serde(rename = "VOID_KIND")]
14700    VoidKind,
14701}