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 ClientFilesyncMirrorId(pub String);
218impl From<&str> for ClientFilesyncMirrorId {
219    fn from(value: &str) -> Self {
220        Self(value.to_string())
221    }
222}
223impl From<String> for ClientFilesyncMirrorId {
224    fn from(value: String) -> Self {
225        Self(value)
226    }
227}
228impl IntoID<ClientFilesyncMirrorId> for ClientFilesyncMirror {
229    fn into_id(
230        self,
231    ) -> std::pin::Pin<
232        Box<dyn core::future::Future<Output = Result<ClientFilesyncMirrorId, DaggerError>> + Send>,
233    > {
234        Box::pin(async move { self.id().await })
235    }
236}
237impl IntoID<ClientFilesyncMirrorId> for ClientFilesyncMirrorId {
238    fn into_id(
239        self,
240    ) -> std::pin::Pin<
241        Box<dyn core::future::Future<Output = Result<ClientFilesyncMirrorId, DaggerError>> + Send>,
242    > {
243        Box::pin(async move { Ok::<ClientFilesyncMirrorId, DaggerError>(self) })
244    }
245}
246impl ClientFilesyncMirrorId {
247    fn quote(&self) -> String {
248        format!("\"{}\"", self.0.clone())
249    }
250}
251#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
252pub struct CloudId(pub String);
253impl From<&str> for CloudId {
254    fn from(value: &str) -> Self {
255        Self(value.to_string())
256    }
257}
258impl From<String> for CloudId {
259    fn from(value: String) -> Self {
260        Self(value)
261    }
262}
263impl IntoID<CloudId> for Cloud {
264    fn into_id(
265        self,
266    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
267    {
268        Box::pin(async move { self.id().await })
269    }
270}
271impl IntoID<CloudId> for CloudId {
272    fn into_id(
273        self,
274    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
275    {
276        Box::pin(async move { Ok::<CloudId, DaggerError>(self) })
277    }
278}
279impl CloudId {
280    fn quote(&self) -> String {
281        format!("\"{}\"", self.0.clone())
282    }
283}
284#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
285pub struct ContainerId(pub String);
286impl From<&str> for ContainerId {
287    fn from(value: &str) -> Self {
288        Self(value.to_string())
289    }
290}
291impl From<String> for ContainerId {
292    fn from(value: String) -> Self {
293        Self(value)
294    }
295}
296impl IntoID<ContainerId> for Container {
297    fn into_id(
298        self,
299    ) -> std::pin::Pin<
300        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
301    > {
302        Box::pin(async move { self.id().await })
303    }
304}
305impl IntoID<ContainerId> for ContainerId {
306    fn into_id(
307        self,
308    ) -> std::pin::Pin<
309        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
310    > {
311        Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
312    }
313}
314impl ContainerId {
315    fn quote(&self) -> String {
316        format!("\"{}\"", self.0.clone())
317    }
318}
319#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
320pub struct CurrentModuleId(pub String);
321impl From<&str> for CurrentModuleId {
322    fn from(value: &str) -> Self {
323        Self(value.to_string())
324    }
325}
326impl From<String> for CurrentModuleId {
327    fn from(value: String) -> Self {
328        Self(value)
329    }
330}
331impl IntoID<CurrentModuleId> for CurrentModule {
332    fn into_id(
333        self,
334    ) -> std::pin::Pin<
335        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
336    > {
337        Box::pin(async move { self.id().await })
338    }
339}
340impl IntoID<CurrentModuleId> for CurrentModuleId {
341    fn into_id(
342        self,
343    ) -> std::pin::Pin<
344        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
345    > {
346        Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
347    }
348}
349impl CurrentModuleId {
350    fn quote(&self) -> String {
351        format!("\"{}\"", self.0.clone())
352    }
353}
354#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
355pub struct DiffStatId(pub String);
356impl From<&str> for DiffStatId {
357    fn from(value: &str) -> Self {
358        Self(value.to_string())
359    }
360}
361impl From<String> for DiffStatId {
362    fn from(value: String) -> Self {
363        Self(value)
364    }
365}
366impl IntoID<DiffStatId> for DiffStat {
367    fn into_id(
368        self,
369    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<DiffStatId, DaggerError>> + Send>>
370    {
371        Box::pin(async move { self.id().await })
372    }
373}
374impl IntoID<DiffStatId> for DiffStatId {
375    fn into_id(
376        self,
377    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<DiffStatId, DaggerError>> + Send>>
378    {
379        Box::pin(async move { Ok::<DiffStatId, DaggerError>(self) })
380    }
381}
382impl DiffStatId {
383    fn quote(&self) -> String {
384        format!("\"{}\"", self.0.clone())
385    }
386}
387#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
388pub struct DirectoryId(pub String);
389impl From<&str> for DirectoryId {
390    fn from(value: &str) -> Self {
391        Self(value.to_string())
392    }
393}
394impl From<String> for DirectoryId {
395    fn from(value: String) -> Self {
396        Self(value)
397    }
398}
399impl IntoID<DirectoryId> for Directory {
400    fn into_id(
401        self,
402    ) -> std::pin::Pin<
403        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
404    > {
405        Box::pin(async move { self.id().await })
406    }
407}
408impl IntoID<DirectoryId> for DirectoryId {
409    fn into_id(
410        self,
411    ) -> std::pin::Pin<
412        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
413    > {
414        Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
415    }
416}
417impl DirectoryId {
418    fn quote(&self) -> String {
419        format!("\"{}\"", self.0.clone())
420    }
421}
422#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
423pub struct EngineCacheEntryId(pub String);
424impl From<&str> for EngineCacheEntryId {
425    fn from(value: &str) -> Self {
426        Self(value.to_string())
427    }
428}
429impl From<String> for EngineCacheEntryId {
430    fn from(value: String) -> Self {
431        Self(value)
432    }
433}
434impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
435    fn into_id(
436        self,
437    ) -> std::pin::Pin<
438        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
439    > {
440        Box::pin(async move { self.id().await })
441    }
442}
443impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
444    fn into_id(
445        self,
446    ) -> std::pin::Pin<
447        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
448    > {
449        Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
450    }
451}
452impl EngineCacheEntryId {
453    fn quote(&self) -> String {
454        format!("\"{}\"", self.0.clone())
455    }
456}
457#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
458pub struct EngineCacheEntrySetId(pub String);
459impl From<&str> for EngineCacheEntrySetId {
460    fn from(value: &str) -> Self {
461        Self(value.to_string())
462    }
463}
464impl From<String> for EngineCacheEntrySetId {
465    fn from(value: String) -> Self {
466        Self(value)
467    }
468}
469impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
470    fn into_id(
471        self,
472    ) -> std::pin::Pin<
473        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
474    > {
475        Box::pin(async move { self.id().await })
476    }
477}
478impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
479    fn into_id(
480        self,
481    ) -> std::pin::Pin<
482        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
483    > {
484        Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
485    }
486}
487impl EngineCacheEntrySetId {
488    fn quote(&self) -> String {
489        format!("\"{}\"", self.0.clone())
490    }
491}
492#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
493pub struct EngineCacheId(pub String);
494impl From<&str> for EngineCacheId {
495    fn from(value: &str) -> Self {
496        Self(value.to_string())
497    }
498}
499impl From<String> for EngineCacheId {
500    fn from(value: String) -> Self {
501        Self(value)
502    }
503}
504impl IntoID<EngineCacheId> for EngineCache {
505    fn into_id(
506        self,
507    ) -> std::pin::Pin<
508        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
509    > {
510        Box::pin(async move { self.id().await })
511    }
512}
513impl IntoID<EngineCacheId> for EngineCacheId {
514    fn into_id(
515        self,
516    ) -> std::pin::Pin<
517        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
518    > {
519        Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
520    }
521}
522impl EngineCacheId {
523    fn quote(&self) -> String {
524        format!("\"{}\"", self.0.clone())
525    }
526}
527#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
528pub struct EngineId(pub String);
529impl From<&str> for EngineId {
530    fn from(value: &str) -> Self {
531        Self(value.to_string())
532    }
533}
534impl From<String> for EngineId {
535    fn from(value: String) -> Self {
536        Self(value)
537    }
538}
539impl IntoID<EngineId> for Engine {
540    fn into_id(
541        self,
542    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
543    {
544        Box::pin(async move { self.id().await })
545    }
546}
547impl IntoID<EngineId> for EngineId {
548    fn into_id(
549        self,
550    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
551    {
552        Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
553    }
554}
555impl EngineId {
556    fn quote(&self) -> String {
557        format!("\"{}\"", self.0.clone())
558    }
559}
560#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
561pub struct EnumTypeDefId(pub String);
562impl From<&str> for EnumTypeDefId {
563    fn from(value: &str) -> Self {
564        Self(value.to_string())
565    }
566}
567impl From<String> for EnumTypeDefId {
568    fn from(value: String) -> Self {
569        Self(value)
570    }
571}
572impl IntoID<EnumTypeDefId> for EnumTypeDef {
573    fn into_id(
574        self,
575    ) -> std::pin::Pin<
576        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
577    > {
578        Box::pin(async move { self.id().await })
579    }
580}
581impl IntoID<EnumTypeDefId> for EnumTypeDefId {
582    fn into_id(
583        self,
584    ) -> std::pin::Pin<
585        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
586    > {
587        Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
588    }
589}
590impl EnumTypeDefId {
591    fn quote(&self) -> String {
592        format!("\"{}\"", self.0.clone())
593    }
594}
595#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
596pub struct EnumValueTypeDefId(pub String);
597impl From<&str> for EnumValueTypeDefId {
598    fn from(value: &str) -> Self {
599        Self(value.to_string())
600    }
601}
602impl From<String> for EnumValueTypeDefId {
603    fn from(value: String) -> Self {
604        Self(value)
605    }
606}
607impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
608    fn into_id(
609        self,
610    ) -> std::pin::Pin<
611        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
612    > {
613        Box::pin(async move { self.id().await })
614    }
615}
616impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
617    fn into_id(
618        self,
619    ) -> std::pin::Pin<
620        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
621    > {
622        Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
623    }
624}
625impl EnumValueTypeDefId {
626    fn quote(&self) -> String {
627        format!("\"{}\"", self.0.clone())
628    }
629}
630#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
631pub struct EnvFileId(pub String);
632impl From<&str> for EnvFileId {
633    fn from(value: &str) -> Self {
634        Self(value.to_string())
635    }
636}
637impl From<String> for EnvFileId {
638    fn from(value: String) -> Self {
639        Self(value)
640    }
641}
642impl IntoID<EnvFileId> for EnvFile {
643    fn into_id(
644        self,
645    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
646    {
647        Box::pin(async move { self.id().await })
648    }
649}
650impl IntoID<EnvFileId> for EnvFileId {
651    fn into_id(
652        self,
653    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
654    {
655        Box::pin(async move { Ok::<EnvFileId, DaggerError>(self) })
656    }
657}
658impl EnvFileId {
659    fn quote(&self) -> String {
660        format!("\"{}\"", self.0.clone())
661    }
662}
663#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
664pub struct EnvId(pub String);
665impl From<&str> for EnvId {
666    fn from(value: &str) -> Self {
667        Self(value.to_string())
668    }
669}
670impl From<String> for EnvId {
671    fn from(value: String) -> Self {
672        Self(value)
673    }
674}
675impl IntoID<EnvId> for Env {
676    fn into_id(
677        self,
678    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
679    {
680        Box::pin(async move { self.id().await })
681    }
682}
683impl IntoID<EnvId> for EnvId {
684    fn into_id(
685        self,
686    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
687    {
688        Box::pin(async move { Ok::<EnvId, DaggerError>(self) })
689    }
690}
691impl EnvId {
692    fn quote(&self) -> String {
693        format!("\"{}\"", self.0.clone())
694    }
695}
696#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
697pub struct EnvVariableId(pub String);
698impl From<&str> for EnvVariableId {
699    fn from(value: &str) -> Self {
700        Self(value.to_string())
701    }
702}
703impl From<String> for EnvVariableId {
704    fn from(value: String) -> Self {
705        Self(value)
706    }
707}
708impl IntoID<EnvVariableId> for EnvVariable {
709    fn into_id(
710        self,
711    ) -> std::pin::Pin<
712        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
713    > {
714        Box::pin(async move { self.id().await })
715    }
716}
717impl IntoID<EnvVariableId> for EnvVariableId {
718    fn into_id(
719        self,
720    ) -> std::pin::Pin<
721        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
722    > {
723        Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
724    }
725}
726impl EnvVariableId {
727    fn quote(&self) -> String {
728        format!("\"{}\"", self.0.clone())
729    }
730}
731#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
732pub struct ErrorId(pub String);
733impl From<&str> for ErrorId {
734    fn from(value: &str) -> Self {
735        Self(value.to_string())
736    }
737}
738impl From<String> for ErrorId {
739    fn from(value: String) -> Self {
740        Self(value)
741    }
742}
743impl IntoID<ErrorId> for Error {
744    fn into_id(
745        self,
746    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
747    {
748        Box::pin(async move { self.id().await })
749    }
750}
751impl IntoID<ErrorId> for ErrorId {
752    fn into_id(
753        self,
754    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
755    {
756        Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
757    }
758}
759impl ErrorId {
760    fn quote(&self) -> String {
761        format!("\"{}\"", self.0.clone())
762    }
763}
764#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
765pub struct ErrorValueId(pub String);
766impl From<&str> for ErrorValueId {
767    fn from(value: &str) -> Self {
768        Self(value.to_string())
769    }
770}
771impl From<String> for ErrorValueId {
772    fn from(value: String) -> Self {
773        Self(value)
774    }
775}
776impl IntoID<ErrorValueId> for ErrorValue {
777    fn into_id(
778        self,
779    ) -> std::pin::Pin<
780        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
781    > {
782        Box::pin(async move { self.id().await })
783    }
784}
785impl IntoID<ErrorValueId> for ErrorValueId {
786    fn into_id(
787        self,
788    ) -> std::pin::Pin<
789        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
790    > {
791        Box::pin(async move { Ok::<ErrorValueId, DaggerError>(self) })
792    }
793}
794impl ErrorValueId {
795    fn quote(&self) -> String {
796        format!("\"{}\"", self.0.clone())
797    }
798}
799#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
800pub struct FieldTypeDefId(pub String);
801impl From<&str> for FieldTypeDefId {
802    fn from(value: &str) -> Self {
803        Self(value.to_string())
804    }
805}
806impl From<String> for FieldTypeDefId {
807    fn from(value: String) -> Self {
808        Self(value)
809    }
810}
811impl IntoID<FieldTypeDefId> for FieldTypeDef {
812    fn into_id(
813        self,
814    ) -> std::pin::Pin<
815        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
816    > {
817        Box::pin(async move { self.id().await })
818    }
819}
820impl IntoID<FieldTypeDefId> for FieldTypeDefId {
821    fn into_id(
822        self,
823    ) -> std::pin::Pin<
824        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
825    > {
826        Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
827    }
828}
829impl FieldTypeDefId {
830    fn quote(&self) -> String {
831        format!("\"{}\"", self.0.clone())
832    }
833}
834#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
835pub struct FileId(pub String);
836impl From<&str> for FileId {
837    fn from(value: &str) -> Self {
838        Self(value.to_string())
839    }
840}
841impl From<String> for FileId {
842    fn from(value: String) -> Self {
843        Self(value)
844    }
845}
846impl IntoID<FileId> for File {
847    fn into_id(
848        self,
849    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
850    {
851        Box::pin(async move { self.id().await })
852    }
853}
854impl IntoID<FileId> for FileId {
855    fn into_id(
856        self,
857    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
858    {
859        Box::pin(async move { Ok::<FileId, DaggerError>(self) })
860    }
861}
862impl FileId {
863    fn quote(&self) -> String {
864        format!("\"{}\"", self.0.clone())
865    }
866}
867#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
868pub struct FunctionArgId(pub String);
869impl From<&str> for FunctionArgId {
870    fn from(value: &str) -> Self {
871        Self(value.to_string())
872    }
873}
874impl From<String> for FunctionArgId {
875    fn from(value: String) -> Self {
876        Self(value)
877    }
878}
879impl IntoID<FunctionArgId> for FunctionArg {
880    fn into_id(
881        self,
882    ) -> std::pin::Pin<
883        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
884    > {
885        Box::pin(async move { self.id().await })
886    }
887}
888impl IntoID<FunctionArgId> for FunctionArgId {
889    fn into_id(
890        self,
891    ) -> std::pin::Pin<
892        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
893    > {
894        Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
895    }
896}
897impl FunctionArgId {
898    fn quote(&self) -> String {
899        format!("\"{}\"", self.0.clone())
900    }
901}
902#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
903pub struct FunctionCallArgValueId(pub String);
904impl From<&str> for FunctionCallArgValueId {
905    fn from(value: &str) -> Self {
906        Self(value.to_string())
907    }
908}
909impl From<String> for FunctionCallArgValueId {
910    fn from(value: String) -> Self {
911        Self(value)
912    }
913}
914impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
915    fn into_id(
916        self,
917    ) -> std::pin::Pin<
918        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
919    > {
920        Box::pin(async move { self.id().await })
921    }
922}
923impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
924    fn into_id(
925        self,
926    ) -> std::pin::Pin<
927        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
928    > {
929        Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
930    }
931}
932impl FunctionCallArgValueId {
933    fn quote(&self) -> String {
934        format!("\"{}\"", self.0.clone())
935    }
936}
937#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
938pub struct FunctionCallId(pub String);
939impl From<&str> for FunctionCallId {
940    fn from(value: &str) -> Self {
941        Self(value.to_string())
942    }
943}
944impl From<String> for FunctionCallId {
945    fn from(value: String) -> Self {
946        Self(value)
947    }
948}
949impl IntoID<FunctionCallId> for FunctionCall {
950    fn into_id(
951        self,
952    ) -> std::pin::Pin<
953        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
954    > {
955        Box::pin(async move { self.id().await })
956    }
957}
958impl IntoID<FunctionCallId> for FunctionCallId {
959    fn into_id(
960        self,
961    ) -> std::pin::Pin<
962        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
963    > {
964        Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
965    }
966}
967impl FunctionCallId {
968    fn quote(&self) -> String {
969        format!("\"{}\"", self.0.clone())
970    }
971}
972#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
973pub struct FunctionId(pub String);
974impl From<&str> for FunctionId {
975    fn from(value: &str) -> Self {
976        Self(value.to_string())
977    }
978}
979impl From<String> for FunctionId {
980    fn from(value: String) -> Self {
981        Self(value)
982    }
983}
984impl IntoID<FunctionId> for Function {
985    fn into_id(
986        self,
987    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
988    {
989        Box::pin(async move { self.id().await })
990    }
991}
992impl IntoID<FunctionId> for FunctionId {
993    fn into_id(
994        self,
995    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
996    {
997        Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
998    }
999}
1000impl FunctionId {
1001    fn quote(&self) -> String {
1002        format!("\"{}\"", self.0.clone())
1003    }
1004}
1005#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1006pub struct GeneratedCodeId(pub String);
1007impl From<&str> for GeneratedCodeId {
1008    fn from(value: &str) -> Self {
1009        Self(value.to_string())
1010    }
1011}
1012impl From<String> for GeneratedCodeId {
1013    fn from(value: String) -> Self {
1014        Self(value)
1015    }
1016}
1017impl IntoID<GeneratedCodeId> for GeneratedCode {
1018    fn into_id(
1019        self,
1020    ) -> std::pin::Pin<
1021        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
1022    > {
1023        Box::pin(async move { self.id().await })
1024    }
1025}
1026impl IntoID<GeneratedCodeId> for GeneratedCodeId {
1027    fn into_id(
1028        self,
1029    ) -> std::pin::Pin<
1030        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
1031    > {
1032        Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
1033    }
1034}
1035impl GeneratedCodeId {
1036    fn quote(&self) -> String {
1037        format!("\"{}\"", self.0.clone())
1038    }
1039}
1040#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1041pub struct GeneratorGroupId(pub String);
1042impl From<&str> for GeneratorGroupId {
1043    fn from(value: &str) -> Self {
1044        Self(value.to_string())
1045    }
1046}
1047impl From<String> for GeneratorGroupId {
1048    fn from(value: String) -> Self {
1049        Self(value)
1050    }
1051}
1052impl IntoID<GeneratorGroupId> for GeneratorGroup {
1053    fn into_id(
1054        self,
1055    ) -> std::pin::Pin<
1056        Box<dyn core::future::Future<Output = Result<GeneratorGroupId, DaggerError>> + Send>,
1057    > {
1058        Box::pin(async move { self.id().await })
1059    }
1060}
1061impl IntoID<GeneratorGroupId> for GeneratorGroupId {
1062    fn into_id(
1063        self,
1064    ) -> std::pin::Pin<
1065        Box<dyn core::future::Future<Output = Result<GeneratorGroupId, DaggerError>> + Send>,
1066    > {
1067        Box::pin(async move { Ok::<GeneratorGroupId, DaggerError>(self) })
1068    }
1069}
1070impl GeneratorGroupId {
1071    fn quote(&self) -> String {
1072        format!("\"{}\"", self.0.clone())
1073    }
1074}
1075#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1076pub struct GeneratorId(pub String);
1077impl From<&str> for GeneratorId {
1078    fn from(value: &str) -> Self {
1079        Self(value.to_string())
1080    }
1081}
1082impl From<String> for GeneratorId {
1083    fn from(value: String) -> Self {
1084        Self(value)
1085    }
1086}
1087impl IntoID<GeneratorId> for Generator {
1088    fn into_id(
1089        self,
1090    ) -> std::pin::Pin<
1091        Box<dyn core::future::Future<Output = Result<GeneratorId, DaggerError>> + Send>,
1092    > {
1093        Box::pin(async move { self.id().await })
1094    }
1095}
1096impl IntoID<GeneratorId> for GeneratorId {
1097    fn into_id(
1098        self,
1099    ) -> std::pin::Pin<
1100        Box<dyn core::future::Future<Output = Result<GeneratorId, DaggerError>> + Send>,
1101    > {
1102        Box::pin(async move { Ok::<GeneratorId, DaggerError>(self) })
1103    }
1104}
1105impl GeneratorId {
1106    fn quote(&self) -> String {
1107        format!("\"{}\"", self.0.clone())
1108    }
1109}
1110#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1111pub struct GitRefId(pub String);
1112impl From<&str> for GitRefId {
1113    fn from(value: &str) -> Self {
1114        Self(value.to_string())
1115    }
1116}
1117impl From<String> for GitRefId {
1118    fn from(value: String) -> Self {
1119        Self(value)
1120    }
1121}
1122impl IntoID<GitRefId> for GitRef {
1123    fn into_id(
1124        self,
1125    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
1126    {
1127        Box::pin(async move { self.id().await })
1128    }
1129}
1130impl IntoID<GitRefId> for GitRefId {
1131    fn into_id(
1132        self,
1133    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
1134    {
1135        Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
1136    }
1137}
1138impl GitRefId {
1139    fn quote(&self) -> String {
1140        format!("\"{}\"", self.0.clone())
1141    }
1142}
1143#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1144pub struct GitRepositoryId(pub String);
1145impl From<&str> for GitRepositoryId {
1146    fn from(value: &str) -> Self {
1147        Self(value.to_string())
1148    }
1149}
1150impl From<String> for GitRepositoryId {
1151    fn from(value: String) -> Self {
1152        Self(value)
1153    }
1154}
1155impl IntoID<GitRepositoryId> for GitRepository {
1156    fn into_id(
1157        self,
1158    ) -> std::pin::Pin<
1159        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
1160    > {
1161        Box::pin(async move { self.id().await })
1162    }
1163}
1164impl IntoID<GitRepositoryId> for GitRepositoryId {
1165    fn into_id(
1166        self,
1167    ) -> std::pin::Pin<
1168        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
1169    > {
1170        Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
1171    }
1172}
1173impl GitRepositoryId {
1174    fn quote(&self) -> String {
1175        format!("\"{}\"", self.0.clone())
1176    }
1177}
1178#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1179pub struct HttpStateId(pub String);
1180impl From<&str> for HttpStateId {
1181    fn from(value: &str) -> Self {
1182        Self(value.to_string())
1183    }
1184}
1185impl From<String> for HttpStateId {
1186    fn from(value: String) -> Self {
1187        Self(value)
1188    }
1189}
1190impl IntoID<HttpStateId> for HttpState {
1191    fn into_id(
1192        self,
1193    ) -> std::pin::Pin<
1194        Box<dyn core::future::Future<Output = Result<HttpStateId, DaggerError>> + Send>,
1195    > {
1196        Box::pin(async move { self.id().await })
1197    }
1198}
1199impl IntoID<HttpStateId> for HttpStateId {
1200    fn into_id(
1201        self,
1202    ) -> std::pin::Pin<
1203        Box<dyn core::future::Future<Output = Result<HttpStateId, DaggerError>> + Send>,
1204    > {
1205        Box::pin(async move { Ok::<HttpStateId, DaggerError>(self) })
1206    }
1207}
1208impl HttpStateId {
1209    fn quote(&self) -> String {
1210        format!("\"{}\"", self.0.clone())
1211    }
1212}
1213#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1214pub struct HealthcheckConfigId(pub String);
1215impl From<&str> for HealthcheckConfigId {
1216    fn from(value: &str) -> Self {
1217        Self(value.to_string())
1218    }
1219}
1220impl From<String> for HealthcheckConfigId {
1221    fn from(value: String) -> Self {
1222        Self(value)
1223    }
1224}
1225impl IntoID<HealthcheckConfigId> for HealthcheckConfig {
1226    fn into_id(
1227        self,
1228    ) -> std::pin::Pin<
1229        Box<dyn core::future::Future<Output = Result<HealthcheckConfigId, DaggerError>> + Send>,
1230    > {
1231        Box::pin(async move { self.id().await })
1232    }
1233}
1234impl IntoID<HealthcheckConfigId> for HealthcheckConfigId {
1235    fn into_id(
1236        self,
1237    ) -> std::pin::Pin<
1238        Box<dyn core::future::Future<Output = Result<HealthcheckConfigId, DaggerError>> + Send>,
1239    > {
1240        Box::pin(async move { Ok::<HealthcheckConfigId, DaggerError>(self) })
1241    }
1242}
1243impl HealthcheckConfigId {
1244    fn quote(&self) -> String {
1245        format!("\"{}\"", self.0.clone())
1246    }
1247}
1248#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1249pub struct HostId(pub String);
1250impl From<&str> for HostId {
1251    fn from(value: &str) -> Self {
1252        Self(value.to_string())
1253    }
1254}
1255impl From<String> for HostId {
1256    fn from(value: String) -> Self {
1257        Self(value)
1258    }
1259}
1260impl IntoID<HostId> for Host {
1261    fn into_id(
1262        self,
1263    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
1264    {
1265        Box::pin(async move { self.id().await })
1266    }
1267}
1268impl IntoID<HostId> for HostId {
1269    fn into_id(
1270        self,
1271    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
1272    {
1273        Box::pin(async move { Ok::<HostId, DaggerError>(self) })
1274    }
1275}
1276impl HostId {
1277    fn quote(&self) -> String {
1278        format!("\"{}\"", self.0.clone())
1279    }
1280}
1281#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1282pub struct InputTypeDefId(pub String);
1283impl From<&str> for InputTypeDefId {
1284    fn from(value: &str) -> Self {
1285        Self(value.to_string())
1286    }
1287}
1288impl From<String> for InputTypeDefId {
1289    fn from(value: String) -> Self {
1290        Self(value)
1291    }
1292}
1293impl IntoID<InputTypeDefId> for InputTypeDef {
1294    fn into_id(
1295        self,
1296    ) -> std::pin::Pin<
1297        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1298    > {
1299        Box::pin(async move { self.id().await })
1300    }
1301}
1302impl IntoID<InputTypeDefId> for InputTypeDefId {
1303    fn into_id(
1304        self,
1305    ) -> std::pin::Pin<
1306        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1307    > {
1308        Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
1309    }
1310}
1311impl InputTypeDefId {
1312    fn quote(&self) -> String {
1313        format!("\"{}\"", self.0.clone())
1314    }
1315}
1316#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1317pub struct InterfaceTypeDefId(pub String);
1318impl From<&str> for InterfaceTypeDefId {
1319    fn from(value: &str) -> Self {
1320        Self(value.to_string())
1321    }
1322}
1323impl From<String> for InterfaceTypeDefId {
1324    fn from(value: String) -> Self {
1325        Self(value)
1326    }
1327}
1328impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
1329    fn into_id(
1330        self,
1331    ) -> std::pin::Pin<
1332        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1333    > {
1334        Box::pin(async move { self.id().await })
1335    }
1336}
1337impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
1338    fn into_id(
1339        self,
1340    ) -> std::pin::Pin<
1341        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1342    > {
1343        Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
1344    }
1345}
1346impl InterfaceTypeDefId {
1347    fn quote(&self) -> String {
1348        format!("\"{}\"", self.0.clone())
1349    }
1350}
1351#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1352pub struct Json(pub String);
1353impl From<&str> for Json {
1354    fn from(value: &str) -> Self {
1355        Self(value.to_string())
1356    }
1357}
1358impl From<String> for Json {
1359    fn from(value: String) -> Self {
1360        Self(value)
1361    }
1362}
1363impl Json {
1364    fn quote(&self) -> String {
1365        format!("\"{}\"", self.0.clone())
1366    }
1367}
1368#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1369pub struct JsonValueId(pub String);
1370impl From<&str> for JsonValueId {
1371    fn from(value: &str) -> Self {
1372        Self(value.to_string())
1373    }
1374}
1375impl From<String> for JsonValueId {
1376    fn from(value: String) -> Self {
1377        Self(value)
1378    }
1379}
1380impl IntoID<JsonValueId> for JsonValue {
1381    fn into_id(
1382        self,
1383    ) -> std::pin::Pin<
1384        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1385    > {
1386        Box::pin(async move { self.id().await })
1387    }
1388}
1389impl IntoID<JsonValueId> for JsonValueId {
1390    fn into_id(
1391        self,
1392    ) -> std::pin::Pin<
1393        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1394    > {
1395        Box::pin(async move { Ok::<JsonValueId, DaggerError>(self) })
1396    }
1397}
1398impl JsonValueId {
1399    fn quote(&self) -> String {
1400        format!("\"{}\"", self.0.clone())
1401    }
1402}
1403#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1404pub struct Llmid(pub String);
1405impl From<&str> for Llmid {
1406    fn from(value: &str) -> Self {
1407        Self(value.to_string())
1408    }
1409}
1410impl From<String> for Llmid {
1411    fn from(value: String) -> Self {
1412        Self(value)
1413    }
1414}
1415impl IntoID<Llmid> for Llm {
1416    fn into_id(
1417        self,
1418    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1419    {
1420        Box::pin(async move { self.id().await })
1421    }
1422}
1423impl IntoID<Llmid> for Llmid {
1424    fn into_id(
1425        self,
1426    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1427    {
1428        Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
1429    }
1430}
1431impl Llmid {
1432    fn quote(&self) -> String {
1433        format!("\"{}\"", self.0.clone())
1434    }
1435}
1436#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1437pub struct LlmTokenUsageId(pub String);
1438impl From<&str> for LlmTokenUsageId {
1439    fn from(value: &str) -> Self {
1440        Self(value.to_string())
1441    }
1442}
1443impl From<String> for LlmTokenUsageId {
1444    fn from(value: String) -> Self {
1445        Self(value)
1446    }
1447}
1448impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
1449    fn into_id(
1450        self,
1451    ) -> std::pin::Pin<
1452        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1453    > {
1454        Box::pin(async move { self.id().await })
1455    }
1456}
1457impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
1458    fn into_id(
1459        self,
1460    ) -> std::pin::Pin<
1461        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1462    > {
1463        Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
1464    }
1465}
1466impl LlmTokenUsageId {
1467    fn quote(&self) -> String {
1468        format!("\"{}\"", self.0.clone())
1469    }
1470}
1471#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1472pub struct LabelId(pub String);
1473impl From<&str> for LabelId {
1474    fn from(value: &str) -> Self {
1475        Self(value.to_string())
1476    }
1477}
1478impl From<String> for LabelId {
1479    fn from(value: String) -> Self {
1480        Self(value)
1481    }
1482}
1483impl IntoID<LabelId> for Label {
1484    fn into_id(
1485        self,
1486    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1487    {
1488        Box::pin(async move { self.id().await })
1489    }
1490}
1491impl IntoID<LabelId> for LabelId {
1492    fn into_id(
1493        self,
1494    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1495    {
1496        Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
1497    }
1498}
1499impl LabelId {
1500    fn quote(&self) -> String {
1501        format!("\"{}\"", self.0.clone())
1502    }
1503}
1504#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1505pub struct ListTypeDefId(pub String);
1506impl From<&str> for ListTypeDefId {
1507    fn from(value: &str) -> Self {
1508        Self(value.to_string())
1509    }
1510}
1511impl From<String> for ListTypeDefId {
1512    fn from(value: String) -> Self {
1513        Self(value)
1514    }
1515}
1516impl IntoID<ListTypeDefId> for ListTypeDef {
1517    fn into_id(
1518        self,
1519    ) -> std::pin::Pin<
1520        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1521    > {
1522        Box::pin(async move { self.id().await })
1523    }
1524}
1525impl IntoID<ListTypeDefId> for ListTypeDefId {
1526    fn into_id(
1527        self,
1528    ) -> std::pin::Pin<
1529        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1530    > {
1531        Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
1532    }
1533}
1534impl ListTypeDefId {
1535    fn quote(&self) -> String {
1536        format!("\"{}\"", self.0.clone())
1537    }
1538}
1539#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1540pub struct ModuleConfigClientId(pub String);
1541impl From<&str> for ModuleConfigClientId {
1542    fn from(value: &str) -> Self {
1543        Self(value.to_string())
1544    }
1545}
1546impl From<String> for ModuleConfigClientId {
1547    fn from(value: String) -> Self {
1548        Self(value)
1549    }
1550}
1551impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
1552    fn into_id(
1553        self,
1554    ) -> std::pin::Pin<
1555        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1556    > {
1557        Box::pin(async move { self.id().await })
1558    }
1559}
1560impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
1561    fn into_id(
1562        self,
1563    ) -> std::pin::Pin<
1564        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1565    > {
1566        Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
1567    }
1568}
1569impl ModuleConfigClientId {
1570    fn quote(&self) -> String {
1571        format!("\"{}\"", self.0.clone())
1572    }
1573}
1574#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1575pub struct ModuleId(pub String);
1576impl From<&str> for ModuleId {
1577    fn from(value: &str) -> Self {
1578        Self(value.to_string())
1579    }
1580}
1581impl From<String> for ModuleId {
1582    fn from(value: String) -> Self {
1583        Self(value)
1584    }
1585}
1586impl IntoID<ModuleId> for Module {
1587    fn into_id(
1588        self,
1589    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1590    {
1591        Box::pin(async move { self.id().await })
1592    }
1593}
1594impl IntoID<ModuleId> for ModuleId {
1595    fn into_id(
1596        self,
1597    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1598    {
1599        Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
1600    }
1601}
1602impl ModuleId {
1603    fn quote(&self) -> String {
1604        format!("\"{}\"", self.0.clone())
1605    }
1606}
1607#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1608pub struct ModuleSourceId(pub String);
1609impl From<&str> for ModuleSourceId {
1610    fn from(value: &str) -> Self {
1611        Self(value.to_string())
1612    }
1613}
1614impl From<String> for ModuleSourceId {
1615    fn from(value: String) -> Self {
1616        Self(value)
1617    }
1618}
1619impl IntoID<ModuleSourceId> for ModuleSource {
1620    fn into_id(
1621        self,
1622    ) -> std::pin::Pin<
1623        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1624    > {
1625        Box::pin(async move { self.id().await })
1626    }
1627}
1628impl IntoID<ModuleSourceId> for ModuleSourceId {
1629    fn into_id(
1630        self,
1631    ) -> std::pin::Pin<
1632        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1633    > {
1634        Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1635    }
1636}
1637impl ModuleSourceId {
1638    fn quote(&self) -> String {
1639        format!("\"{}\"", self.0.clone())
1640    }
1641}
1642#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1643pub struct ObjectTypeDefId(pub String);
1644impl From<&str> for ObjectTypeDefId {
1645    fn from(value: &str) -> Self {
1646        Self(value.to_string())
1647    }
1648}
1649impl From<String> for ObjectTypeDefId {
1650    fn from(value: String) -> Self {
1651        Self(value)
1652    }
1653}
1654impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1655    fn into_id(
1656        self,
1657    ) -> std::pin::Pin<
1658        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1659    > {
1660        Box::pin(async move { self.id().await })
1661    }
1662}
1663impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1664    fn into_id(
1665        self,
1666    ) -> std::pin::Pin<
1667        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1668    > {
1669        Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1670    }
1671}
1672impl ObjectTypeDefId {
1673    fn quote(&self) -> String {
1674        format!("\"{}\"", self.0.clone())
1675    }
1676}
1677#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1678pub struct Platform(pub String);
1679impl From<&str> for Platform {
1680    fn from(value: &str) -> Self {
1681        Self(value.to_string())
1682    }
1683}
1684impl From<String> for Platform {
1685    fn from(value: String) -> Self {
1686        Self(value)
1687    }
1688}
1689impl Platform {
1690    fn quote(&self) -> String {
1691        format!("\"{}\"", self.0.clone())
1692    }
1693}
1694#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1695pub struct PortId(pub String);
1696impl From<&str> for PortId {
1697    fn from(value: &str) -> Self {
1698        Self(value.to_string())
1699    }
1700}
1701impl From<String> for PortId {
1702    fn from(value: String) -> Self {
1703        Self(value)
1704    }
1705}
1706impl IntoID<PortId> for Port {
1707    fn into_id(
1708        self,
1709    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1710    {
1711        Box::pin(async move { self.id().await })
1712    }
1713}
1714impl IntoID<PortId> for PortId {
1715    fn into_id(
1716        self,
1717    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1718    {
1719        Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1720    }
1721}
1722impl PortId {
1723    fn quote(&self) -> String {
1724        format!("\"{}\"", self.0.clone())
1725    }
1726}
1727#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1728pub struct QueryId(pub String);
1729impl From<&str> for QueryId {
1730    fn from(value: &str) -> Self {
1731        Self(value.to_string())
1732    }
1733}
1734impl From<String> for QueryId {
1735    fn from(value: String) -> Self {
1736        Self(value)
1737    }
1738}
1739impl IntoID<QueryId> for Query {
1740    fn into_id(
1741        self,
1742    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<QueryId, DaggerError>> + Send>>
1743    {
1744        Box::pin(async move { self.id().await })
1745    }
1746}
1747impl IntoID<QueryId> for QueryId {
1748    fn into_id(
1749        self,
1750    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<QueryId, DaggerError>> + Send>>
1751    {
1752        Box::pin(async move { Ok::<QueryId, DaggerError>(self) })
1753    }
1754}
1755impl QueryId {
1756    fn quote(&self) -> String {
1757        format!("\"{}\"", self.0.clone())
1758    }
1759}
1760#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1761pub struct RemoteGitMirrorId(pub String);
1762impl From<&str> for RemoteGitMirrorId {
1763    fn from(value: &str) -> Self {
1764        Self(value.to_string())
1765    }
1766}
1767impl From<String> for RemoteGitMirrorId {
1768    fn from(value: String) -> Self {
1769        Self(value)
1770    }
1771}
1772impl IntoID<RemoteGitMirrorId> for RemoteGitMirror {
1773    fn into_id(
1774        self,
1775    ) -> std::pin::Pin<
1776        Box<dyn core::future::Future<Output = Result<RemoteGitMirrorId, DaggerError>> + Send>,
1777    > {
1778        Box::pin(async move { self.id().await })
1779    }
1780}
1781impl IntoID<RemoteGitMirrorId> for RemoteGitMirrorId {
1782    fn into_id(
1783        self,
1784    ) -> std::pin::Pin<
1785        Box<dyn core::future::Future<Output = Result<RemoteGitMirrorId, DaggerError>> + Send>,
1786    > {
1787        Box::pin(async move { Ok::<RemoteGitMirrorId, DaggerError>(self) })
1788    }
1789}
1790impl RemoteGitMirrorId {
1791    fn quote(&self) -> String {
1792        format!("\"{}\"", self.0.clone())
1793    }
1794}
1795#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1796pub struct SdkConfigId(pub String);
1797impl From<&str> for SdkConfigId {
1798    fn from(value: &str) -> Self {
1799        Self(value.to_string())
1800    }
1801}
1802impl From<String> for SdkConfigId {
1803    fn from(value: String) -> Self {
1804        Self(value)
1805    }
1806}
1807impl IntoID<SdkConfigId> for SdkConfig {
1808    fn into_id(
1809        self,
1810    ) -> std::pin::Pin<
1811        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1812    > {
1813        Box::pin(async move { self.id().await })
1814    }
1815}
1816impl IntoID<SdkConfigId> for SdkConfigId {
1817    fn into_id(
1818        self,
1819    ) -> std::pin::Pin<
1820        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1821    > {
1822        Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1823    }
1824}
1825impl SdkConfigId {
1826    fn quote(&self) -> String {
1827        format!("\"{}\"", self.0.clone())
1828    }
1829}
1830#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1831pub struct ScalarTypeDefId(pub String);
1832impl From<&str> for ScalarTypeDefId {
1833    fn from(value: &str) -> Self {
1834        Self(value.to_string())
1835    }
1836}
1837impl From<String> for ScalarTypeDefId {
1838    fn from(value: String) -> Self {
1839        Self(value)
1840    }
1841}
1842impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1843    fn into_id(
1844        self,
1845    ) -> std::pin::Pin<
1846        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1847    > {
1848        Box::pin(async move { self.id().await })
1849    }
1850}
1851impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1852    fn into_id(
1853        self,
1854    ) -> std::pin::Pin<
1855        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1856    > {
1857        Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1858    }
1859}
1860impl ScalarTypeDefId {
1861    fn quote(&self) -> String {
1862        format!("\"{}\"", self.0.clone())
1863    }
1864}
1865#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1866pub struct SearchResultId(pub String);
1867impl From<&str> for SearchResultId {
1868    fn from(value: &str) -> Self {
1869        Self(value.to_string())
1870    }
1871}
1872impl From<String> for SearchResultId {
1873    fn from(value: String) -> Self {
1874        Self(value)
1875    }
1876}
1877impl IntoID<SearchResultId> for SearchResult {
1878    fn into_id(
1879        self,
1880    ) -> std::pin::Pin<
1881        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1882    > {
1883        Box::pin(async move { self.id().await })
1884    }
1885}
1886impl IntoID<SearchResultId> for SearchResultId {
1887    fn into_id(
1888        self,
1889    ) -> std::pin::Pin<
1890        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1891    > {
1892        Box::pin(async move { Ok::<SearchResultId, DaggerError>(self) })
1893    }
1894}
1895impl SearchResultId {
1896    fn quote(&self) -> String {
1897        format!("\"{}\"", self.0.clone())
1898    }
1899}
1900#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1901pub struct SearchSubmatchId(pub String);
1902impl From<&str> for SearchSubmatchId {
1903    fn from(value: &str) -> Self {
1904        Self(value.to_string())
1905    }
1906}
1907impl From<String> for SearchSubmatchId {
1908    fn from(value: String) -> Self {
1909        Self(value)
1910    }
1911}
1912impl IntoID<SearchSubmatchId> for SearchSubmatch {
1913    fn into_id(
1914        self,
1915    ) -> std::pin::Pin<
1916        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1917    > {
1918        Box::pin(async move { self.id().await })
1919    }
1920}
1921impl IntoID<SearchSubmatchId> for SearchSubmatchId {
1922    fn into_id(
1923        self,
1924    ) -> std::pin::Pin<
1925        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1926    > {
1927        Box::pin(async move { Ok::<SearchSubmatchId, DaggerError>(self) })
1928    }
1929}
1930impl SearchSubmatchId {
1931    fn quote(&self) -> String {
1932        format!("\"{}\"", self.0.clone())
1933    }
1934}
1935#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1936pub struct SecretId(pub String);
1937impl From<&str> for SecretId {
1938    fn from(value: &str) -> Self {
1939        Self(value.to_string())
1940    }
1941}
1942impl From<String> for SecretId {
1943    fn from(value: String) -> Self {
1944        Self(value)
1945    }
1946}
1947impl IntoID<SecretId> for Secret {
1948    fn into_id(
1949        self,
1950    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1951    {
1952        Box::pin(async move { self.id().await })
1953    }
1954}
1955impl IntoID<SecretId> for SecretId {
1956    fn into_id(
1957        self,
1958    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1959    {
1960        Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1961    }
1962}
1963impl SecretId {
1964    fn quote(&self) -> String {
1965        format!("\"{}\"", self.0.clone())
1966    }
1967}
1968#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1969pub struct ServiceId(pub String);
1970impl From<&str> for ServiceId {
1971    fn from(value: &str) -> Self {
1972        Self(value.to_string())
1973    }
1974}
1975impl From<String> for ServiceId {
1976    fn from(value: String) -> Self {
1977        Self(value)
1978    }
1979}
1980impl IntoID<ServiceId> for Service {
1981    fn into_id(
1982        self,
1983    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1984    {
1985        Box::pin(async move { self.id().await })
1986    }
1987}
1988impl IntoID<ServiceId> for ServiceId {
1989    fn into_id(
1990        self,
1991    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1992    {
1993        Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1994    }
1995}
1996impl ServiceId {
1997    fn quote(&self) -> String {
1998        format!("\"{}\"", self.0.clone())
1999    }
2000}
2001#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2002pub struct SocketId(pub String);
2003impl From<&str> for SocketId {
2004    fn from(value: &str) -> Self {
2005        Self(value.to_string())
2006    }
2007}
2008impl From<String> for SocketId {
2009    fn from(value: String) -> Self {
2010        Self(value)
2011    }
2012}
2013impl IntoID<SocketId> for Socket {
2014    fn into_id(
2015        self,
2016    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
2017    {
2018        Box::pin(async move { self.id().await })
2019    }
2020}
2021impl IntoID<SocketId> for SocketId {
2022    fn into_id(
2023        self,
2024    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
2025    {
2026        Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
2027    }
2028}
2029impl SocketId {
2030    fn quote(&self) -> String {
2031        format!("\"{}\"", self.0.clone())
2032    }
2033}
2034#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2035pub struct SourceMapId(pub String);
2036impl From<&str> for SourceMapId {
2037    fn from(value: &str) -> Self {
2038        Self(value.to_string())
2039    }
2040}
2041impl From<String> for SourceMapId {
2042    fn from(value: String) -> Self {
2043        Self(value)
2044    }
2045}
2046impl IntoID<SourceMapId> for SourceMap {
2047    fn into_id(
2048        self,
2049    ) -> std::pin::Pin<
2050        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
2051    > {
2052        Box::pin(async move { self.id().await })
2053    }
2054}
2055impl IntoID<SourceMapId> for SourceMapId {
2056    fn into_id(
2057        self,
2058    ) -> std::pin::Pin<
2059        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
2060    > {
2061        Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
2062    }
2063}
2064impl SourceMapId {
2065    fn quote(&self) -> String {
2066        format!("\"{}\"", self.0.clone())
2067    }
2068}
2069#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2070pub struct StatId(pub String);
2071impl From<&str> for StatId {
2072    fn from(value: &str) -> Self {
2073        Self(value.to_string())
2074    }
2075}
2076impl From<String> for StatId {
2077    fn from(value: String) -> Self {
2078        Self(value)
2079    }
2080}
2081impl IntoID<StatId> for Stat {
2082    fn into_id(
2083        self,
2084    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<StatId, DaggerError>> + Send>>
2085    {
2086        Box::pin(async move { self.id().await })
2087    }
2088}
2089impl IntoID<StatId> for StatId {
2090    fn into_id(
2091        self,
2092    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<StatId, DaggerError>> + Send>>
2093    {
2094        Box::pin(async move { Ok::<StatId, DaggerError>(self) })
2095    }
2096}
2097impl StatId {
2098    fn quote(&self) -> String {
2099        format!("\"{}\"", self.0.clone())
2100    }
2101}
2102#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2103pub struct TerminalId(pub String);
2104impl From<&str> for TerminalId {
2105    fn from(value: &str) -> Self {
2106        Self(value.to_string())
2107    }
2108}
2109impl From<String> for TerminalId {
2110    fn from(value: String) -> Self {
2111        Self(value)
2112    }
2113}
2114impl IntoID<TerminalId> for Terminal {
2115    fn into_id(
2116        self,
2117    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
2118    {
2119        Box::pin(async move { self.id().await })
2120    }
2121}
2122impl IntoID<TerminalId> for TerminalId {
2123    fn into_id(
2124        self,
2125    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
2126    {
2127        Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
2128    }
2129}
2130impl TerminalId {
2131    fn quote(&self) -> String {
2132        format!("\"{}\"", self.0.clone())
2133    }
2134}
2135#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2136pub struct TypeDefId(pub String);
2137impl From<&str> for TypeDefId {
2138    fn from(value: &str) -> Self {
2139        Self(value.to_string())
2140    }
2141}
2142impl From<String> for TypeDefId {
2143    fn from(value: String) -> Self {
2144        Self(value)
2145    }
2146}
2147impl IntoID<TypeDefId> for TypeDef {
2148    fn into_id(
2149        self,
2150    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
2151    {
2152        Box::pin(async move { self.id().await })
2153    }
2154}
2155impl IntoID<TypeDefId> for TypeDefId {
2156    fn into_id(
2157        self,
2158    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
2159    {
2160        Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
2161    }
2162}
2163impl TypeDefId {
2164    fn quote(&self) -> String {
2165        format!("\"{}\"", self.0.clone())
2166    }
2167}
2168#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2169pub struct UpGroupId(pub String);
2170impl From<&str> for UpGroupId {
2171    fn from(value: &str) -> Self {
2172        Self(value.to_string())
2173    }
2174}
2175impl From<String> for UpGroupId {
2176    fn from(value: String) -> Self {
2177        Self(value)
2178    }
2179}
2180impl IntoID<UpGroupId> for UpGroup {
2181    fn into_id(
2182        self,
2183    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpGroupId, DaggerError>> + Send>>
2184    {
2185        Box::pin(async move { self.id().await })
2186    }
2187}
2188impl IntoID<UpGroupId> for UpGroupId {
2189    fn into_id(
2190        self,
2191    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpGroupId, DaggerError>> + Send>>
2192    {
2193        Box::pin(async move { Ok::<UpGroupId, DaggerError>(self) })
2194    }
2195}
2196impl UpGroupId {
2197    fn quote(&self) -> String {
2198        format!("\"{}\"", self.0.clone())
2199    }
2200}
2201#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2202pub struct UpId(pub String);
2203impl From<&str> for UpId {
2204    fn from(value: &str) -> Self {
2205        Self(value.to_string())
2206    }
2207}
2208impl From<String> for UpId {
2209    fn from(value: String) -> Self {
2210        Self(value)
2211    }
2212}
2213impl IntoID<UpId> for Up {
2214    fn into_id(
2215        self,
2216    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpId, DaggerError>> + Send>>
2217    {
2218        Box::pin(async move { self.id().await })
2219    }
2220}
2221impl IntoID<UpId> for UpId {
2222    fn into_id(
2223        self,
2224    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpId, DaggerError>> + Send>>
2225    {
2226        Box::pin(async move { Ok::<UpId, DaggerError>(self) })
2227    }
2228}
2229impl UpId {
2230    fn quote(&self) -> String {
2231        format!("\"{}\"", self.0.clone())
2232    }
2233}
2234#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2235pub struct Void(pub String);
2236impl From<&str> for Void {
2237    fn from(value: &str) -> Self {
2238        Self(value.to_string())
2239    }
2240}
2241impl From<String> for Void {
2242    fn from(value: String) -> Self {
2243        Self(value)
2244    }
2245}
2246impl Void {
2247    fn quote(&self) -> String {
2248        format!("\"{}\"", self.0.clone())
2249    }
2250}
2251#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2252pub struct WorkspaceId(pub String);
2253impl From<&str> for WorkspaceId {
2254    fn from(value: &str) -> Self {
2255        Self(value.to_string())
2256    }
2257}
2258impl From<String> for WorkspaceId {
2259    fn from(value: String) -> Self {
2260        Self(value)
2261    }
2262}
2263impl IntoID<WorkspaceId> for Workspace {
2264    fn into_id(
2265        self,
2266    ) -> std::pin::Pin<
2267        Box<dyn core::future::Future<Output = Result<WorkspaceId, DaggerError>> + Send>,
2268    > {
2269        Box::pin(async move { self.id().await })
2270    }
2271}
2272impl IntoID<WorkspaceId> for WorkspaceId {
2273    fn into_id(
2274        self,
2275    ) -> std::pin::Pin<
2276        Box<dyn core::future::Future<Output = Result<WorkspaceId, DaggerError>> + Send>,
2277    > {
2278        Box::pin(async move { Ok::<WorkspaceId, DaggerError>(self) })
2279    }
2280}
2281impl WorkspaceId {
2282    fn quote(&self) -> String {
2283        format!("\"{}\"", self.0.clone())
2284    }
2285}
2286#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
2287pub struct BuildArg {
2288    pub name: String,
2289    pub value: String,
2290}
2291#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
2292pub struct PipelineLabel {
2293    pub name: String,
2294    pub value: String,
2295}
2296#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
2297pub struct PortForward {
2298    pub backend: isize,
2299    pub frontend: isize,
2300    pub protocol: NetworkProtocol,
2301}
2302#[derive(Clone)]
2303pub struct Address {
2304    pub proc: Option<Arc<DaggerSessionProc>>,
2305    pub selection: Selection,
2306    pub graphql_client: DynGraphQLClient,
2307}
2308#[derive(Builder, Debug, PartialEq)]
2309pub struct AddressDirectoryOpts<'a> {
2310    #[builder(setter(into, strip_option), default)]
2311    pub exclude: Option<Vec<&'a str>>,
2312    #[builder(setter(into, strip_option), default)]
2313    pub gitignore: Option<bool>,
2314    #[builder(setter(into, strip_option), default)]
2315    pub include: Option<Vec<&'a str>>,
2316    #[builder(setter(into, strip_option), default)]
2317    pub no_cache: Option<bool>,
2318}
2319#[derive(Builder, Debug, PartialEq)]
2320pub struct AddressFileOpts<'a> {
2321    #[builder(setter(into, strip_option), default)]
2322    pub exclude: Option<Vec<&'a str>>,
2323    #[builder(setter(into, strip_option), default)]
2324    pub gitignore: Option<bool>,
2325    #[builder(setter(into, strip_option), default)]
2326    pub include: Option<Vec<&'a str>>,
2327    #[builder(setter(into, strip_option), default)]
2328    pub no_cache: Option<bool>,
2329}
2330impl Address {
2331    /// Load a container from the address.
2332    pub fn container(&self) -> Container {
2333        let query = self.selection.select("container");
2334        Container {
2335            proc: self.proc.clone(),
2336            selection: query,
2337            graphql_client: self.graphql_client.clone(),
2338        }
2339    }
2340    /// Load a directory from the address.
2341    ///
2342    /// # Arguments
2343    ///
2344    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2345    pub fn directory(&self) -> Directory {
2346        let query = self.selection.select("directory");
2347        Directory {
2348            proc: self.proc.clone(),
2349            selection: query,
2350            graphql_client: self.graphql_client.clone(),
2351        }
2352    }
2353    /// Load a directory from the address.
2354    ///
2355    /// # Arguments
2356    ///
2357    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2358    pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
2359        let mut query = self.selection.select("directory");
2360        if let Some(exclude) = opts.exclude {
2361            query = query.arg("exclude", exclude);
2362        }
2363        if let Some(include) = opts.include {
2364            query = query.arg("include", include);
2365        }
2366        if let Some(gitignore) = opts.gitignore {
2367            query = query.arg("gitignore", gitignore);
2368        }
2369        if let Some(no_cache) = opts.no_cache {
2370            query = query.arg("noCache", no_cache);
2371        }
2372        Directory {
2373            proc: self.proc.clone(),
2374            selection: query,
2375            graphql_client: self.graphql_client.clone(),
2376        }
2377    }
2378    /// Load a file from the address.
2379    ///
2380    /// # Arguments
2381    ///
2382    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2383    pub fn file(&self) -> File {
2384        let query = self.selection.select("file");
2385        File {
2386            proc: self.proc.clone(),
2387            selection: query,
2388            graphql_client: self.graphql_client.clone(),
2389        }
2390    }
2391    /// Load a file from the address.
2392    ///
2393    /// # Arguments
2394    ///
2395    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2396    pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
2397        let mut query = self.selection.select("file");
2398        if let Some(exclude) = opts.exclude {
2399            query = query.arg("exclude", exclude);
2400        }
2401        if let Some(include) = opts.include {
2402            query = query.arg("include", include);
2403        }
2404        if let Some(gitignore) = opts.gitignore {
2405            query = query.arg("gitignore", gitignore);
2406        }
2407        if let Some(no_cache) = opts.no_cache {
2408            query = query.arg("noCache", no_cache);
2409        }
2410        File {
2411            proc: self.proc.clone(),
2412            selection: query,
2413            graphql_client: self.graphql_client.clone(),
2414        }
2415    }
2416    /// Load a git ref (branch, tag or commit) from the address.
2417    pub fn git_ref(&self) -> GitRef {
2418        let query = self.selection.select("gitRef");
2419        GitRef {
2420            proc: self.proc.clone(),
2421            selection: query,
2422            graphql_client: self.graphql_client.clone(),
2423        }
2424    }
2425    /// Load a git repository from the address.
2426    pub fn git_repository(&self) -> GitRepository {
2427        let query = self.selection.select("gitRepository");
2428        GitRepository {
2429            proc: self.proc.clone(),
2430            selection: query,
2431            graphql_client: self.graphql_client.clone(),
2432        }
2433    }
2434    /// A unique identifier for this Address.
2435    pub async fn id(&self) -> Result<AddressId, DaggerError> {
2436        let query = self.selection.select("id");
2437        query.execute(self.graphql_client.clone()).await
2438    }
2439    /// Load a secret from the address.
2440    pub fn secret(&self) -> Secret {
2441        let query = self.selection.select("secret");
2442        Secret {
2443            proc: self.proc.clone(),
2444            selection: query,
2445            graphql_client: self.graphql_client.clone(),
2446        }
2447    }
2448    /// Load a service from the address.
2449    pub fn service(&self) -> Service {
2450        let query = self.selection.select("service");
2451        Service {
2452            proc: self.proc.clone(),
2453            selection: query,
2454            graphql_client: self.graphql_client.clone(),
2455        }
2456    }
2457    /// Load a local socket from the address.
2458    pub fn socket(&self) -> Socket {
2459        let query = self.selection.select("socket");
2460        Socket {
2461            proc: self.proc.clone(),
2462            selection: query,
2463            graphql_client: self.graphql_client.clone(),
2464        }
2465    }
2466    /// The address value
2467    pub async fn value(&self) -> Result<String, DaggerError> {
2468        let query = self.selection.select("value");
2469        query.execute(self.graphql_client.clone()).await
2470    }
2471}
2472#[derive(Clone)]
2473pub struct Binding {
2474    pub proc: Option<Arc<DaggerSessionProc>>,
2475    pub selection: Selection,
2476    pub graphql_client: DynGraphQLClient,
2477}
2478impl Binding {
2479    /// Retrieve the binding value, as type Address
2480    pub fn as_address(&self) -> Address {
2481        let query = self.selection.select("asAddress");
2482        Address {
2483            proc: self.proc.clone(),
2484            selection: query,
2485            graphql_client: self.graphql_client.clone(),
2486        }
2487    }
2488    /// Retrieve the binding value, as type CacheVolume
2489    pub fn as_cache_volume(&self) -> CacheVolume {
2490        let query = self.selection.select("asCacheVolume");
2491        CacheVolume {
2492            proc: self.proc.clone(),
2493            selection: query,
2494            graphql_client: self.graphql_client.clone(),
2495        }
2496    }
2497    /// Retrieve the binding value, as type Changeset
2498    pub fn as_changeset(&self) -> Changeset {
2499        let query = self.selection.select("asChangeset");
2500        Changeset {
2501            proc: self.proc.clone(),
2502            selection: query,
2503            graphql_client: self.graphql_client.clone(),
2504        }
2505    }
2506    /// Retrieve the binding value, as type Check
2507    pub fn as_check(&self) -> Check {
2508        let query = self.selection.select("asCheck");
2509        Check {
2510            proc: self.proc.clone(),
2511            selection: query,
2512            graphql_client: self.graphql_client.clone(),
2513        }
2514    }
2515    /// Retrieve the binding value, as type CheckGroup
2516    pub fn as_check_group(&self) -> CheckGroup {
2517        let query = self.selection.select("asCheckGroup");
2518        CheckGroup {
2519            proc: self.proc.clone(),
2520            selection: query,
2521            graphql_client: self.graphql_client.clone(),
2522        }
2523    }
2524    /// Retrieve the binding value, as type Cloud
2525    pub fn as_cloud(&self) -> Cloud {
2526        let query = self.selection.select("asCloud");
2527        Cloud {
2528            proc: self.proc.clone(),
2529            selection: query,
2530            graphql_client: self.graphql_client.clone(),
2531        }
2532    }
2533    /// Retrieve the binding value, as type Container
2534    pub fn as_container(&self) -> Container {
2535        let query = self.selection.select("asContainer");
2536        Container {
2537            proc: self.proc.clone(),
2538            selection: query,
2539            graphql_client: self.graphql_client.clone(),
2540        }
2541    }
2542    /// Retrieve the binding value, as type DiffStat
2543    pub fn as_diff_stat(&self) -> DiffStat {
2544        let query = self.selection.select("asDiffStat");
2545        DiffStat {
2546            proc: self.proc.clone(),
2547            selection: query,
2548            graphql_client: self.graphql_client.clone(),
2549        }
2550    }
2551    /// Retrieve the binding value, as type Directory
2552    pub fn as_directory(&self) -> Directory {
2553        let query = self.selection.select("asDirectory");
2554        Directory {
2555            proc: self.proc.clone(),
2556            selection: query,
2557            graphql_client: self.graphql_client.clone(),
2558        }
2559    }
2560    /// Retrieve the binding value, as type Env
2561    pub fn as_env(&self) -> Env {
2562        let query = self.selection.select("asEnv");
2563        Env {
2564            proc: self.proc.clone(),
2565            selection: query,
2566            graphql_client: self.graphql_client.clone(),
2567        }
2568    }
2569    /// Retrieve the binding value, as type EnvFile
2570    pub fn as_env_file(&self) -> EnvFile {
2571        let query = self.selection.select("asEnvFile");
2572        EnvFile {
2573            proc: self.proc.clone(),
2574            selection: query,
2575            graphql_client: self.graphql_client.clone(),
2576        }
2577    }
2578    /// Retrieve the binding value, as type File
2579    pub fn as_file(&self) -> File {
2580        let query = self.selection.select("asFile");
2581        File {
2582            proc: self.proc.clone(),
2583            selection: query,
2584            graphql_client: self.graphql_client.clone(),
2585        }
2586    }
2587    /// Retrieve the binding value, as type Generator
2588    pub fn as_generator(&self) -> Generator {
2589        let query = self.selection.select("asGenerator");
2590        Generator {
2591            proc: self.proc.clone(),
2592            selection: query,
2593            graphql_client: self.graphql_client.clone(),
2594        }
2595    }
2596    /// Retrieve the binding value, as type GeneratorGroup
2597    pub fn as_generator_group(&self) -> GeneratorGroup {
2598        let query = self.selection.select("asGeneratorGroup");
2599        GeneratorGroup {
2600            proc: self.proc.clone(),
2601            selection: query,
2602            graphql_client: self.graphql_client.clone(),
2603        }
2604    }
2605    /// Retrieve the binding value, as type GitRef
2606    pub fn as_git_ref(&self) -> GitRef {
2607        let query = self.selection.select("asGitRef");
2608        GitRef {
2609            proc: self.proc.clone(),
2610            selection: query,
2611            graphql_client: self.graphql_client.clone(),
2612        }
2613    }
2614    /// Retrieve the binding value, as type GitRepository
2615    pub fn as_git_repository(&self) -> GitRepository {
2616        let query = self.selection.select("asGitRepository");
2617        GitRepository {
2618            proc: self.proc.clone(),
2619            selection: query,
2620            graphql_client: self.graphql_client.clone(),
2621        }
2622    }
2623    /// Retrieve the binding value, as type HTTPState
2624    pub fn as_http_state(&self) -> HttpState {
2625        let query = self.selection.select("asHTTPState");
2626        HttpState {
2627            proc: self.proc.clone(),
2628            selection: query,
2629            graphql_client: self.graphql_client.clone(),
2630        }
2631    }
2632    /// Retrieve the binding value, as type JSONValue
2633    pub fn as_json_value(&self) -> JsonValue {
2634        let query = self.selection.select("asJSONValue");
2635        JsonValue {
2636            proc: self.proc.clone(),
2637            selection: query,
2638            graphql_client: self.graphql_client.clone(),
2639        }
2640    }
2641    /// Retrieve the binding value, as type Module
2642    pub fn as_module(&self) -> Module {
2643        let query = self.selection.select("asModule");
2644        Module {
2645            proc: self.proc.clone(),
2646            selection: query,
2647            graphql_client: self.graphql_client.clone(),
2648        }
2649    }
2650    /// Retrieve the binding value, as type ModuleConfigClient
2651    pub fn as_module_config_client(&self) -> ModuleConfigClient {
2652        let query = self.selection.select("asModuleConfigClient");
2653        ModuleConfigClient {
2654            proc: self.proc.clone(),
2655            selection: query,
2656            graphql_client: self.graphql_client.clone(),
2657        }
2658    }
2659    /// Retrieve the binding value, as type ModuleSource
2660    pub fn as_module_source(&self) -> ModuleSource {
2661        let query = self.selection.select("asModuleSource");
2662        ModuleSource {
2663            proc: self.proc.clone(),
2664            selection: query,
2665            graphql_client: self.graphql_client.clone(),
2666        }
2667    }
2668    /// Retrieve the binding value, as type SearchResult
2669    pub fn as_search_result(&self) -> SearchResult {
2670        let query = self.selection.select("asSearchResult");
2671        SearchResult {
2672            proc: self.proc.clone(),
2673            selection: query,
2674            graphql_client: self.graphql_client.clone(),
2675        }
2676    }
2677    /// Retrieve the binding value, as type SearchSubmatch
2678    pub fn as_search_submatch(&self) -> SearchSubmatch {
2679        let query = self.selection.select("asSearchSubmatch");
2680        SearchSubmatch {
2681            proc: self.proc.clone(),
2682            selection: query,
2683            graphql_client: self.graphql_client.clone(),
2684        }
2685    }
2686    /// Retrieve the binding value, as type Secret
2687    pub fn as_secret(&self) -> Secret {
2688        let query = self.selection.select("asSecret");
2689        Secret {
2690            proc: self.proc.clone(),
2691            selection: query,
2692            graphql_client: self.graphql_client.clone(),
2693        }
2694    }
2695    /// Retrieve the binding value, as type Service
2696    pub fn as_service(&self) -> Service {
2697        let query = self.selection.select("asService");
2698        Service {
2699            proc: self.proc.clone(),
2700            selection: query,
2701            graphql_client: self.graphql_client.clone(),
2702        }
2703    }
2704    /// Retrieve the binding value, as type Socket
2705    pub fn as_socket(&self) -> Socket {
2706        let query = self.selection.select("asSocket");
2707        Socket {
2708            proc: self.proc.clone(),
2709            selection: query,
2710            graphql_client: self.graphql_client.clone(),
2711        }
2712    }
2713    /// Retrieve the binding value, as type Stat
2714    pub fn as_stat(&self) -> Stat {
2715        let query = self.selection.select("asStat");
2716        Stat {
2717            proc: self.proc.clone(),
2718            selection: query,
2719            graphql_client: self.graphql_client.clone(),
2720        }
2721    }
2722    /// Returns the binding's string value
2723    pub async fn as_string(&self) -> Result<String, DaggerError> {
2724        let query = self.selection.select("asString");
2725        query.execute(self.graphql_client.clone()).await
2726    }
2727    /// Retrieve the binding value, as type Up
2728    pub fn as_up(&self) -> Up {
2729        let query = self.selection.select("asUp");
2730        Up {
2731            proc: self.proc.clone(),
2732            selection: query,
2733            graphql_client: self.graphql_client.clone(),
2734        }
2735    }
2736    /// Retrieve the binding value, as type UpGroup
2737    pub fn as_up_group(&self) -> UpGroup {
2738        let query = self.selection.select("asUpGroup");
2739        UpGroup {
2740            proc: self.proc.clone(),
2741            selection: query,
2742            graphql_client: self.graphql_client.clone(),
2743        }
2744    }
2745    /// Retrieve the binding value, as type Workspace
2746    pub fn as_workspace(&self) -> Workspace {
2747        let query = self.selection.select("asWorkspace");
2748        Workspace {
2749            proc: self.proc.clone(),
2750            selection: query,
2751            graphql_client: self.graphql_client.clone(),
2752        }
2753    }
2754    /// Returns the digest of the binding value
2755    pub async fn digest(&self) -> Result<String, DaggerError> {
2756        let query = self.selection.select("digest");
2757        query.execute(self.graphql_client.clone()).await
2758    }
2759    /// A unique identifier for this Binding.
2760    pub async fn id(&self) -> Result<BindingId, DaggerError> {
2761        let query = self.selection.select("id");
2762        query.execute(self.graphql_client.clone()).await
2763    }
2764    /// Returns true if the binding is null
2765    pub async fn is_null(&self) -> Result<bool, DaggerError> {
2766        let query = self.selection.select("isNull");
2767        query.execute(self.graphql_client.clone()).await
2768    }
2769    /// Returns the binding name
2770    pub async fn name(&self) -> Result<String, DaggerError> {
2771        let query = self.selection.select("name");
2772        query.execute(self.graphql_client.clone()).await
2773    }
2774    /// Returns the binding type
2775    pub async fn type_name(&self) -> Result<String, DaggerError> {
2776        let query = self.selection.select("typeName");
2777        query.execute(self.graphql_client.clone()).await
2778    }
2779}
2780#[derive(Clone)]
2781pub struct CacheVolume {
2782    pub proc: Option<Arc<DaggerSessionProc>>,
2783    pub selection: Selection,
2784    pub graphql_client: DynGraphQLClient,
2785}
2786impl CacheVolume {
2787    /// A unique identifier for this CacheVolume.
2788    pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
2789        let query = self.selection.select("id");
2790        query.execute(self.graphql_client.clone()).await
2791    }
2792}
2793#[derive(Clone)]
2794pub struct Changeset {
2795    pub proc: Option<Arc<DaggerSessionProc>>,
2796    pub selection: Selection,
2797    pub graphql_client: DynGraphQLClient,
2798}
2799#[derive(Builder, Debug, PartialEq)]
2800pub struct ChangesetWithChangesetOpts {
2801    /// What to do on a merge conflict
2802    #[builder(setter(into, strip_option), default)]
2803    pub on_conflict: Option<ChangesetMergeConflict>,
2804}
2805#[derive(Builder, Debug, PartialEq)]
2806pub struct ChangesetWithChangesetsOpts {
2807    /// What to do on a merge conflict
2808    #[builder(setter(into, strip_option), default)]
2809    pub on_conflict: Option<ChangesetsMergeConflict>,
2810}
2811impl Changeset {
2812    /// Files and directories that were added in the newer directory.
2813    pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2814        let query = self.selection.select("addedPaths");
2815        query.execute(self.graphql_client.clone()).await
2816    }
2817    /// The newer/upper snapshot.
2818    pub fn after(&self) -> Directory {
2819        let query = self.selection.select("after");
2820        Directory {
2821            proc: self.proc.clone(),
2822            selection: query,
2823            graphql_client: self.graphql_client.clone(),
2824        }
2825    }
2826    /// Return a Git-compatible patch of the changes
2827    pub fn as_patch(&self) -> File {
2828        let query = self.selection.select("asPatch");
2829        File {
2830            proc: self.proc.clone(),
2831            selection: query,
2832            graphql_client: self.graphql_client.clone(),
2833        }
2834    }
2835    /// The older/lower snapshot to compare against.
2836    pub fn before(&self) -> Directory {
2837        let query = self.selection.select("before");
2838        Directory {
2839            proc: self.proc.clone(),
2840            selection: query,
2841            graphql_client: self.graphql_client.clone(),
2842        }
2843    }
2844    /// Structured per-path diff statistics (kind and line counts) for this changeset.
2845    pub async fn diff_stats(&self) -> Result<Vec<DiffStat>, DaggerError> {
2846        let query = self.selection.select("diffStats");
2847        let query = query.select("id");
2848        let ids: Vec<DiffStatId> = query.execute(self.graphql_client.clone()).await?;
2849        let root = Query {
2850            proc: self.proc.clone(),
2851            selection: crate::querybuilder::query(),
2852            graphql_client: self.graphql_client.clone(),
2853        };
2854        Ok(ids
2855            .into_iter()
2856            .map(|id| root.load_diff_stat_from_id(id))
2857            .collect())
2858    }
2859    /// Applies the diff represented by this changeset to a path on the host.
2860    ///
2861    /// # Arguments
2862    ///
2863    /// * `path` - Location of the copied directory (e.g., "logs/").
2864    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2865        let mut query = self.selection.select("export");
2866        query = query.arg("path", path.into());
2867        query.execute(self.graphql_client.clone()).await
2868    }
2869    /// A unique identifier for this Changeset.
2870    pub async fn id(&self) -> Result<ChangesetId, DaggerError> {
2871        let query = self.selection.select("id");
2872        query.execute(self.graphql_client.clone()).await
2873    }
2874    /// Returns true if the changeset is empty (i.e. there are no changes).
2875    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
2876        let query = self.selection.select("isEmpty");
2877        query.execute(self.graphql_client.clone()).await
2878    }
2879    /// Return a snapshot containing only the created and modified files
2880    pub fn layer(&self) -> Directory {
2881        let query = self.selection.select("layer");
2882        Directory {
2883            proc: self.proc.clone(),
2884            selection: query,
2885            graphql_client: self.graphql_client.clone(),
2886        }
2887    }
2888    /// Files and directories that existed before and were updated in the newer directory.
2889    pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2890        let query = self.selection.select("modifiedPaths");
2891        query.execute(self.graphql_client.clone()).await
2892    }
2893    /// Files and directories that were removed. Directories are indicated by a trailing slash, and their child paths are not included.
2894    pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2895        let query = self.selection.select("removedPaths");
2896        query.execute(self.graphql_client.clone()).await
2897    }
2898    /// Force evaluation in the engine.
2899    pub async fn sync(&self) -> Result<ChangesetId, DaggerError> {
2900        let query = self.selection.select("sync");
2901        query.execute(self.graphql_client.clone()).await
2902    }
2903    /// Add changes to an existing changeset
2904    /// 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
2905    ///
2906    /// # Arguments
2907    ///
2908    /// * `changes` - Changes to merge into the actual changeset
2909    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2910    pub fn with_changeset(&self, changes: impl IntoID<ChangesetId>) -> Changeset {
2911        let mut query = self.selection.select("withChangeset");
2912        query = query.arg_lazy(
2913            "changes",
2914            Box::new(move || {
2915                let changes = changes.clone();
2916                Box::pin(async move { changes.into_id().await.unwrap().quote() })
2917            }),
2918        );
2919        Changeset {
2920            proc: self.proc.clone(),
2921            selection: query,
2922            graphql_client: self.graphql_client.clone(),
2923        }
2924    }
2925    /// Add changes to an existing changeset
2926    /// 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
2927    ///
2928    /// # Arguments
2929    ///
2930    /// * `changes` - Changes to merge into the actual changeset
2931    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2932    pub fn with_changeset_opts(
2933        &self,
2934        changes: impl IntoID<ChangesetId>,
2935        opts: ChangesetWithChangesetOpts,
2936    ) -> Changeset {
2937        let mut query = self.selection.select("withChangeset");
2938        query = query.arg_lazy(
2939            "changes",
2940            Box::new(move || {
2941                let changes = changes.clone();
2942                Box::pin(async move { changes.into_id().await.unwrap().quote() })
2943            }),
2944        );
2945        if let Some(on_conflict) = opts.on_conflict {
2946            query = query.arg("onConflict", on_conflict);
2947        }
2948        Changeset {
2949            proc: self.proc.clone(),
2950            selection: query,
2951            graphql_client: self.graphql_client.clone(),
2952        }
2953    }
2954    /// Add changes from multiple changesets using git octopus merge strategy
2955    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
2956    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
2957    ///
2958    /// # Arguments
2959    ///
2960    /// * `changes` - List of changesets to merge into the actual changeset
2961    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2962    pub fn with_changesets(&self, changes: Vec<ChangesetId>) -> Changeset {
2963        let mut query = self.selection.select("withChangesets");
2964        query = query.arg("changes", changes);
2965        Changeset {
2966            proc: self.proc.clone(),
2967            selection: query,
2968            graphql_client: self.graphql_client.clone(),
2969        }
2970    }
2971    /// Add changes from multiple changesets using git octopus merge strategy
2972    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
2973    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
2974    ///
2975    /// # Arguments
2976    ///
2977    /// * `changes` - List of changesets to merge into the actual changeset
2978    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2979    pub fn with_changesets_opts(
2980        &self,
2981        changes: Vec<ChangesetId>,
2982        opts: ChangesetWithChangesetsOpts,
2983    ) -> Changeset {
2984        let mut query = self.selection.select("withChangesets");
2985        query = query.arg("changes", changes);
2986        if let Some(on_conflict) = opts.on_conflict {
2987            query = query.arg("onConflict", on_conflict);
2988        }
2989        Changeset {
2990            proc: self.proc.clone(),
2991            selection: query,
2992            graphql_client: self.graphql_client.clone(),
2993        }
2994    }
2995}
2996#[derive(Clone)]
2997pub struct Check {
2998    pub proc: Option<Arc<DaggerSessionProc>>,
2999    pub selection: Selection,
3000    pub graphql_client: DynGraphQLClient,
3001}
3002impl Check {
3003    /// The type of check: 'check' for annotated checks, 'generate' for generate-as-checks
3004    pub async fn check_type(&self) -> Result<String, DaggerError> {
3005        let query = self.selection.select("checkType");
3006        query.execute(self.graphql_client.clone()).await
3007    }
3008    /// Whether the check completed
3009    pub async fn completed(&self) -> Result<bool, DaggerError> {
3010        let query = self.selection.select("completed");
3011        query.execute(self.graphql_client.clone()).await
3012    }
3013    /// The description of the check
3014    pub async fn description(&self) -> Result<String, DaggerError> {
3015        let query = self.selection.select("description");
3016        query.execute(self.graphql_client.clone()).await
3017    }
3018    /// If the check failed, this is the error
3019    pub fn error(&self) -> Error {
3020        let query = self.selection.select("error");
3021        Error {
3022            proc: self.proc.clone(),
3023            selection: query,
3024            graphql_client: self.graphql_client.clone(),
3025        }
3026    }
3027    /// A unique identifier for this Check.
3028    pub async fn id(&self) -> Result<CheckId, DaggerError> {
3029        let query = self.selection.select("id");
3030        query.execute(self.graphql_client.clone()).await
3031    }
3032    /// Return the fully qualified name of the check
3033    pub async fn name(&self) -> Result<String, DaggerError> {
3034        let query = self.selection.select("name");
3035        query.execute(self.graphql_client.clone()).await
3036    }
3037    /// The original module in which the check has been defined
3038    pub fn original_module(&self) -> Module {
3039        let query = self.selection.select("originalModule");
3040        Module {
3041            proc: self.proc.clone(),
3042            selection: query,
3043            graphql_client: self.graphql_client.clone(),
3044        }
3045    }
3046    /// Whether the check passed
3047    pub async fn passed(&self) -> Result<bool, DaggerError> {
3048        let query = self.selection.select("passed");
3049        query.execute(self.graphql_client.clone()).await
3050    }
3051    /// The path of the check within its module
3052    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
3053        let query = self.selection.select("path");
3054        query.execute(self.graphql_client.clone()).await
3055    }
3056    /// An emoji representing the result of the check
3057    pub async fn result_emoji(&self) -> Result<String, DaggerError> {
3058        let query = self.selection.select("resultEmoji");
3059        query.execute(self.graphql_client.clone()).await
3060    }
3061    /// Execute the check
3062    pub fn run(&self) -> Check {
3063        let query = self.selection.select("run");
3064        Check {
3065            proc: self.proc.clone(),
3066            selection: query,
3067            graphql_client: self.graphql_client.clone(),
3068        }
3069    }
3070}
3071#[derive(Clone)]
3072pub struct CheckGroup {
3073    pub proc: Option<Arc<DaggerSessionProc>>,
3074    pub selection: Selection,
3075    pub graphql_client: DynGraphQLClient,
3076}
3077#[derive(Builder, Debug, PartialEq)]
3078pub struct CheckGroupRunOpts {
3079    /// If true, stop running checks as soon as any check fails.
3080    #[builder(setter(into, strip_option), default)]
3081    pub fail_fast: Option<bool>,
3082}
3083impl CheckGroup {
3084    /// A unique identifier for this CheckGroup.
3085    pub async fn id(&self) -> Result<CheckGroupId, DaggerError> {
3086        let query = self.selection.select("id");
3087        query.execute(self.graphql_client.clone()).await
3088    }
3089    /// Return a list of individual checks and their details
3090    pub async fn list(&self) -> Result<Vec<Check>, DaggerError> {
3091        let query = self.selection.select("list");
3092        let query = query.select("id");
3093        let ids: Vec<CheckId> = query.execute(self.graphql_client.clone()).await?;
3094        let root = Query {
3095            proc: self.proc.clone(),
3096            selection: crate::querybuilder::query(),
3097            graphql_client: self.graphql_client.clone(),
3098        };
3099        Ok(ids
3100            .into_iter()
3101            .map(|id| root.load_check_from_id(id))
3102            .collect())
3103    }
3104    /// Generate a markdown report
3105    pub fn report(&self) -> File {
3106        let query = self.selection.select("report");
3107        File {
3108            proc: self.proc.clone(),
3109            selection: query,
3110            graphql_client: self.graphql_client.clone(),
3111        }
3112    }
3113    /// Execute all selected checks
3114    ///
3115    /// # Arguments
3116    ///
3117    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3118    pub fn run(&self) -> CheckGroup {
3119        let query = self.selection.select("run");
3120        CheckGroup {
3121            proc: self.proc.clone(),
3122            selection: query,
3123            graphql_client: self.graphql_client.clone(),
3124        }
3125    }
3126    /// Execute all selected checks
3127    ///
3128    /// # Arguments
3129    ///
3130    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3131    pub fn run_opts(&self, opts: CheckGroupRunOpts) -> CheckGroup {
3132        let mut query = self.selection.select("run");
3133        if let Some(fail_fast) = opts.fail_fast {
3134            query = query.arg("failFast", fail_fast);
3135        }
3136        CheckGroup {
3137            proc: self.proc.clone(),
3138            selection: query,
3139            graphql_client: self.graphql_client.clone(),
3140        }
3141    }
3142}
3143#[derive(Clone)]
3144pub struct ClientFilesyncMirror {
3145    pub proc: Option<Arc<DaggerSessionProc>>,
3146    pub selection: Selection,
3147    pub graphql_client: DynGraphQLClient,
3148}
3149impl ClientFilesyncMirror {
3150    /// A unique identifier for this ClientFilesyncMirror.
3151    pub async fn id(&self) -> Result<ClientFilesyncMirrorId, DaggerError> {
3152        let query = self.selection.select("id");
3153        query.execute(self.graphql_client.clone()).await
3154    }
3155}
3156#[derive(Clone)]
3157pub struct Cloud {
3158    pub proc: Option<Arc<DaggerSessionProc>>,
3159    pub selection: Selection,
3160    pub graphql_client: DynGraphQLClient,
3161}
3162impl Cloud {
3163    /// A unique identifier for this Cloud.
3164    pub async fn id(&self) -> Result<CloudId, DaggerError> {
3165        let query = self.selection.select("id");
3166        query.execute(self.graphql_client.clone()).await
3167    }
3168    /// The trace URL for the current session
3169    pub async fn trace_url(&self) -> Result<String, DaggerError> {
3170        let query = self.selection.select("traceURL");
3171        query.execute(self.graphql_client.clone()).await
3172    }
3173}
3174#[derive(Clone)]
3175pub struct Container {
3176    pub proc: Option<Arc<DaggerSessionProc>>,
3177    pub selection: Selection,
3178    pub graphql_client: DynGraphQLClient,
3179}
3180#[derive(Builder, Debug, PartialEq)]
3181pub struct ContainerAsServiceOpts<'a> {
3182    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
3183    /// If empty, the container's default command is used.
3184    #[builder(setter(into, strip_option), default)]
3185    pub args: Option<Vec<&'a str>>,
3186    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3187    #[builder(setter(into, strip_option), default)]
3188    pub expand: Option<bool>,
3189    /// Provides Dagger access to the executed command.
3190    #[builder(setter(into, strip_option), default)]
3191    pub experimental_privileged_nesting: Option<bool>,
3192    /// 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.
3193    #[builder(setter(into, strip_option), default)]
3194    pub insecure_root_capabilities: Option<bool>,
3195    /// If set, skip the automatic init process injected into containers by default.
3196    /// 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.
3197    #[builder(setter(into, strip_option), default)]
3198    pub no_init: Option<bool>,
3199    /// If the container has an entrypoint, prepend it to the args.
3200    #[builder(setter(into, strip_option), default)]
3201    pub use_entrypoint: Option<bool>,
3202}
3203#[derive(Builder, Debug, PartialEq)]
3204pub struct ContainerAsTarballOpts {
3205    /// Force each layer of the image to use the specified compression algorithm.
3206    /// 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.
3207    #[builder(setter(into, strip_option), default)]
3208    pub forced_compression: Option<ImageLayerCompression>,
3209    /// Use the specified media types for the image's layers.
3210    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
3211    #[builder(setter(into, strip_option), default)]
3212    pub media_types: Option<ImageMediaTypes>,
3213    /// Identifiers for other platform specific containers.
3214    /// Used for multi-platform images.
3215    #[builder(setter(into, strip_option), default)]
3216    pub platform_variants: Option<Vec<ContainerId>>,
3217}
3218#[derive(Builder, Debug, PartialEq)]
3219pub struct ContainerDirectoryOpts {
3220    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3221    #[builder(setter(into, strip_option), default)]
3222    pub expand: Option<bool>,
3223}
3224#[derive(Builder, Debug, PartialEq)]
3225pub struct ContainerExistsOpts {
3226    /// If specified, do not follow symlinks.
3227    #[builder(setter(into, strip_option), default)]
3228    pub do_not_follow_symlinks: Option<bool>,
3229    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
3230    #[builder(setter(into, strip_option), default)]
3231    pub expected_type: Option<ExistsType>,
3232}
3233#[derive(Builder, Debug, PartialEq)]
3234pub struct ContainerExportOpts {
3235    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3236    #[builder(setter(into, strip_option), default)]
3237    pub expand: Option<bool>,
3238    /// Force each layer of the exported image to use the specified compression algorithm.
3239    /// 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.
3240    #[builder(setter(into, strip_option), default)]
3241    pub forced_compression: Option<ImageLayerCompression>,
3242    /// Use the specified media types for the exported image's layers.
3243    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
3244    #[builder(setter(into, strip_option), default)]
3245    pub media_types: Option<ImageMediaTypes>,
3246    /// Identifiers for other platform specific containers.
3247    /// Used for multi-platform image.
3248    #[builder(setter(into, strip_option), default)]
3249    pub platform_variants: Option<Vec<ContainerId>>,
3250}
3251#[derive(Builder, Debug, PartialEq)]
3252pub struct ContainerExportImageOpts {
3253    /// Force each layer of the exported image to use the specified compression algorithm.
3254    /// 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.
3255    #[builder(setter(into, strip_option), default)]
3256    pub forced_compression: Option<ImageLayerCompression>,
3257    /// Use the specified media types for the exported image's layers.
3258    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
3259    #[builder(setter(into, strip_option), default)]
3260    pub media_types: Option<ImageMediaTypes>,
3261    /// Identifiers for other platform specific containers.
3262    /// Used for multi-platform image.
3263    #[builder(setter(into, strip_option), default)]
3264    pub platform_variants: Option<Vec<ContainerId>>,
3265}
3266#[derive(Builder, Debug, PartialEq)]
3267pub struct ContainerFileOpts {
3268    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3269    #[builder(setter(into, strip_option), default)]
3270    pub expand: Option<bool>,
3271}
3272#[derive(Builder, Debug, PartialEq)]
3273pub struct ContainerImportOpts<'a> {
3274    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
3275    #[builder(setter(into, strip_option), default)]
3276    pub tag: Option<&'a str>,
3277}
3278#[derive(Builder, Debug, PartialEq)]
3279pub struct ContainerPublishOpts {
3280    /// Force each layer of the published image to use the specified compression algorithm.
3281    /// 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.
3282    #[builder(setter(into, strip_option), default)]
3283    pub forced_compression: Option<ImageLayerCompression>,
3284    /// Use the specified media types for the published image's layers.
3285    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
3286    #[builder(setter(into, strip_option), default)]
3287    pub media_types: Option<ImageMediaTypes>,
3288    /// Identifiers for other platform specific containers.
3289    /// Used for multi-platform image.
3290    #[builder(setter(into, strip_option), default)]
3291    pub platform_variants: Option<Vec<ContainerId>>,
3292}
3293#[derive(Builder, Debug, PartialEq)]
3294pub struct ContainerStatOpts {
3295    /// If specified, do not follow symlinks.
3296    #[builder(setter(into, strip_option), default)]
3297    pub do_not_follow_symlinks: Option<bool>,
3298}
3299#[derive(Builder, Debug, PartialEq)]
3300pub struct ContainerTerminalOpts<'a> {
3301    /// If set, override the container's default terminal command and invoke these command arguments instead.
3302    #[builder(setter(into, strip_option), default)]
3303    pub cmd: Option<Vec<&'a str>>,
3304    /// Provides Dagger access to the executed command.
3305    #[builder(setter(into, strip_option), default)]
3306    pub experimental_privileged_nesting: Option<bool>,
3307    /// 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.
3308    #[builder(setter(into, strip_option), default)]
3309    pub insecure_root_capabilities: Option<bool>,
3310}
3311#[derive(Builder, Debug, PartialEq)]
3312pub struct ContainerUpOpts<'a> {
3313    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
3314    /// If empty, the container's default command is used.
3315    #[builder(setter(into, strip_option), default)]
3316    pub args: Option<Vec<&'a str>>,
3317    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3318    #[builder(setter(into, strip_option), default)]
3319    pub expand: Option<bool>,
3320    /// Provides Dagger access to the executed command.
3321    #[builder(setter(into, strip_option), default)]
3322    pub experimental_privileged_nesting: Option<bool>,
3323    /// 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.
3324    #[builder(setter(into, strip_option), default)]
3325    pub insecure_root_capabilities: Option<bool>,
3326    /// If set, skip the automatic init process injected into containers by default.
3327    /// 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.
3328    #[builder(setter(into, strip_option), default)]
3329    pub no_init: Option<bool>,
3330    /// List of frontend/backend port mappings to forward.
3331    /// Frontend is the port accepting traffic on the host, backend is the service port.
3332    #[builder(setter(into, strip_option), default)]
3333    pub ports: Option<Vec<PortForward>>,
3334    /// Bind each tunnel port to a random port on the host.
3335    #[builder(setter(into, strip_option), default)]
3336    pub random: Option<bool>,
3337    /// If the container has an entrypoint, prepend it to the args.
3338    #[builder(setter(into, strip_option), default)]
3339    pub use_entrypoint: Option<bool>,
3340}
3341#[derive(Builder, Debug, PartialEq)]
3342pub struct ContainerWithDefaultTerminalCmdOpts {
3343    /// Provides Dagger access to the executed command.
3344    #[builder(setter(into, strip_option), default)]
3345    pub experimental_privileged_nesting: Option<bool>,
3346    /// 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.
3347    #[builder(setter(into, strip_option), default)]
3348    pub insecure_root_capabilities: Option<bool>,
3349}
3350#[derive(Builder, Debug, PartialEq)]
3351pub struct ContainerWithDirectoryOpts<'a> {
3352    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
3353    #[builder(setter(into, strip_option), default)]
3354    pub exclude: Option<Vec<&'a str>>,
3355    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3356    #[builder(setter(into, strip_option), default)]
3357    pub expand: Option<bool>,
3358    /// Apply .gitignore rules when writing the directory.
3359    #[builder(setter(into, strip_option), default)]
3360    pub gitignore: Option<bool>,
3361    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
3362    #[builder(setter(into, strip_option), default)]
3363    pub include: Option<Vec<&'a str>>,
3364    /// A user:group to set for the directory and its contents.
3365    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3366    /// If the group is omitted, it defaults to the same as the user.
3367    #[builder(setter(into, strip_option), default)]
3368    pub owner: Option<&'a str>,
3369    #[builder(setter(into, strip_option), default)]
3370    pub permissions: Option<isize>,
3371}
3372#[derive(Builder, Debug, PartialEq)]
3373pub struct ContainerWithDockerHealthcheckOpts<'a> {
3374    /// Interval between running healthcheck. Example: "30s"
3375    #[builder(setter(into, strip_option), default)]
3376    pub interval: Option<&'a str>,
3377    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example: "3"
3378    #[builder(setter(into, strip_option), default)]
3379    pub retries: Option<isize>,
3380    /// When true, command must be a single element, which is run using the container's shell
3381    #[builder(setter(into, strip_option), default)]
3382    pub shell: Option<bool>,
3383    /// StartInterval configures the duration between checks during the startup phase. Example: "5s"
3384    #[builder(setter(into, strip_option), default)]
3385    pub start_interval: Option<&'a str>,
3386    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example: "0s"
3387    #[builder(setter(into, strip_option), default)]
3388    pub start_period: Option<&'a str>,
3389    /// Healthcheck timeout. Example: "3s"
3390    #[builder(setter(into, strip_option), default)]
3391    pub timeout: Option<&'a str>,
3392}
3393#[derive(Builder, Debug, PartialEq)]
3394pub struct ContainerWithEntrypointOpts {
3395    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
3396    #[builder(setter(into, strip_option), default)]
3397    pub keep_default_args: Option<bool>,
3398}
3399#[derive(Builder, Debug, PartialEq)]
3400pub struct ContainerWithEnvVariableOpts {
3401    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
3402    #[builder(setter(into, strip_option), default)]
3403    pub expand: Option<bool>,
3404}
3405#[derive(Builder, Debug, PartialEq)]
3406pub struct ContainerWithExecOpts<'a> {
3407    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3408    #[builder(setter(into, strip_option), default)]
3409    pub expand: Option<bool>,
3410    /// Exit codes this command is allowed to exit with without error
3411    #[builder(setter(into, strip_option), default)]
3412    pub expect: Option<ReturnType>,
3413    /// Provides Dagger access to the executed command.
3414    #[builder(setter(into, strip_option), default)]
3415    pub experimental_privileged_nesting: Option<bool>,
3416    /// Execute the command with all root capabilities. Like --privileged in Docker
3417    /// 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.
3418    #[builder(setter(into, strip_option), default)]
3419    pub insecure_root_capabilities: Option<bool>,
3420    /// Skip the automatic init process injected into containers by default.
3421    /// 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.
3422    #[builder(setter(into, strip_option), default)]
3423    pub no_init: Option<bool>,
3424    /// Redirect the command's standard error to a file in the container. Example: "./stderr.txt"
3425    #[builder(setter(into, strip_option), default)]
3426    pub redirect_stderr: Option<&'a str>,
3427    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
3428    #[builder(setter(into, strip_option), default)]
3429    pub redirect_stdin: Option<&'a str>,
3430    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
3431    #[builder(setter(into, strip_option), default)]
3432    pub redirect_stdout: Option<&'a str>,
3433    /// Content to write to the command's standard input. Example: "Hello world")
3434    #[builder(setter(into, strip_option), default)]
3435    pub stdin: Option<&'a str>,
3436    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
3437    #[builder(setter(into, strip_option), default)]
3438    pub use_entrypoint: Option<bool>,
3439}
3440#[derive(Builder, Debug, PartialEq)]
3441pub struct ContainerWithExposedPortOpts<'a> {
3442    /// Port description. Example: "payment API endpoint"
3443    #[builder(setter(into, strip_option), default)]
3444    pub description: Option<&'a str>,
3445    /// Skip the health check when run as a service.
3446    #[builder(setter(into, strip_option), default)]
3447    pub experimental_skip_healthcheck: Option<bool>,
3448    /// Network protocol. Example: "tcp"
3449    #[builder(setter(into, strip_option), default)]
3450    pub protocol: Option<NetworkProtocol>,
3451}
3452#[derive(Builder, Debug, PartialEq)]
3453pub struct ContainerWithFileOpts<'a> {
3454    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3455    #[builder(setter(into, strip_option), default)]
3456    pub expand: Option<bool>,
3457    /// A user:group to set for the file.
3458    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3459    /// If the group is omitted, it defaults to the same as the user.
3460    #[builder(setter(into, strip_option), default)]
3461    pub owner: Option<&'a str>,
3462    /// Permissions of the new file. Example: 0600
3463    #[builder(setter(into, strip_option), default)]
3464    pub permissions: Option<isize>,
3465}
3466#[derive(Builder, Debug, PartialEq)]
3467pub struct ContainerWithFilesOpts<'a> {
3468    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3469    #[builder(setter(into, strip_option), default)]
3470    pub expand: Option<bool>,
3471    /// A user:group to set for the files.
3472    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3473    /// If the group is omitted, it defaults to the same as the user.
3474    #[builder(setter(into, strip_option), default)]
3475    pub owner: Option<&'a str>,
3476    /// Permission given to the copied files (e.g., 0600).
3477    #[builder(setter(into, strip_option), default)]
3478    pub permissions: Option<isize>,
3479}
3480#[derive(Builder, Debug, PartialEq)]
3481pub struct ContainerWithMountedCacheOpts<'a> {
3482    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3483    #[builder(setter(into, strip_option), default)]
3484    pub expand: Option<bool>,
3485    /// A user:group to set for the mounted cache directory.
3486    /// 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.
3487    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3488    /// If the group is omitted, it defaults to the same as the user.
3489    #[builder(setter(into, strip_option), default)]
3490    pub owner: Option<&'a str>,
3491    /// Sharing mode of the cache volume.
3492    #[builder(setter(into, strip_option), default)]
3493    pub sharing: Option<CacheSharingMode>,
3494    /// Identifier of the directory to use as the cache volume's root.
3495    #[builder(setter(into, strip_option), default)]
3496    pub source: Option<DirectoryId>,
3497}
3498#[derive(Builder, Debug, PartialEq)]
3499pub struct ContainerWithMountedDirectoryOpts<'a> {
3500    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3501    #[builder(setter(into, strip_option), default)]
3502    pub expand: Option<bool>,
3503    /// A user:group to set for the mounted directory and its contents.
3504    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3505    /// If the group is omitted, it defaults to the same as the user.
3506    #[builder(setter(into, strip_option), default)]
3507    pub owner: Option<&'a str>,
3508    /// Mount the directory read-only.
3509    #[builder(setter(into, strip_option), default)]
3510    pub read_only: Option<bool>,
3511}
3512#[derive(Builder, Debug, PartialEq)]
3513pub struct ContainerWithMountedFileOpts<'a> {
3514    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3515    #[builder(setter(into, strip_option), default)]
3516    pub expand: Option<bool>,
3517    /// A user or user:group to set for the mounted file.
3518    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3519    /// If the group is omitted, it defaults to the same as the user.
3520    #[builder(setter(into, strip_option), default)]
3521    pub owner: Option<&'a str>,
3522}
3523#[derive(Builder, Debug, PartialEq)]
3524pub struct ContainerWithMountedSecretOpts<'a> {
3525    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3526    #[builder(setter(into, strip_option), default)]
3527    pub expand: Option<bool>,
3528    /// Permission given to the mounted secret (e.g., 0600).
3529    /// This option requires an owner to be set to be active.
3530    #[builder(setter(into, strip_option), default)]
3531    pub mode: Option<isize>,
3532    /// A user:group to set for the mounted secret.
3533    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3534    /// If the group is omitted, it defaults to the same as the user.
3535    #[builder(setter(into, strip_option), default)]
3536    pub owner: Option<&'a str>,
3537}
3538#[derive(Builder, Debug, PartialEq)]
3539pub struct ContainerWithMountedTempOpts {
3540    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3541    #[builder(setter(into, strip_option), default)]
3542    pub expand: Option<bool>,
3543    /// Size of the temporary directory in bytes.
3544    #[builder(setter(into, strip_option), default)]
3545    pub size: Option<isize>,
3546}
3547#[derive(Builder, Debug, PartialEq)]
3548pub struct ContainerWithNewFileOpts<'a> {
3549    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3550    #[builder(setter(into, strip_option), default)]
3551    pub expand: Option<bool>,
3552    /// A user:group to set for the file.
3553    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3554    /// If the group is omitted, it defaults to the same as the user.
3555    #[builder(setter(into, strip_option), default)]
3556    pub owner: Option<&'a str>,
3557    /// Permissions of the new file. Example: 0600
3558    #[builder(setter(into, strip_option), default)]
3559    pub permissions: Option<isize>,
3560}
3561#[derive(Builder, Debug, PartialEq)]
3562pub struct ContainerWithSymlinkOpts {
3563    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3564    #[builder(setter(into, strip_option), default)]
3565    pub expand: Option<bool>,
3566}
3567#[derive(Builder, Debug, PartialEq)]
3568pub struct ContainerWithUnixSocketOpts<'a> {
3569    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3570    #[builder(setter(into, strip_option), default)]
3571    pub expand: Option<bool>,
3572    /// A user:group to set for the mounted socket.
3573    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3574    /// If the group is omitted, it defaults to the same as the user.
3575    #[builder(setter(into, strip_option), default)]
3576    pub owner: Option<&'a str>,
3577}
3578#[derive(Builder, Debug, PartialEq)]
3579pub struct ContainerWithWorkdirOpts {
3580    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3581    #[builder(setter(into, strip_option), default)]
3582    pub expand: Option<bool>,
3583}
3584#[derive(Builder, Debug, PartialEq)]
3585pub struct ContainerWithoutDirectoryOpts {
3586    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3587    #[builder(setter(into, strip_option), default)]
3588    pub expand: Option<bool>,
3589}
3590#[derive(Builder, Debug, PartialEq)]
3591pub struct ContainerWithoutEntrypointOpts {
3592    /// Don't remove the default arguments when unsetting the entrypoint.
3593    #[builder(setter(into, strip_option), default)]
3594    pub keep_default_args: Option<bool>,
3595}
3596#[derive(Builder, Debug, PartialEq)]
3597pub struct ContainerWithoutExposedPortOpts {
3598    /// Port protocol to unexpose
3599    #[builder(setter(into, strip_option), default)]
3600    pub protocol: Option<NetworkProtocol>,
3601}
3602#[derive(Builder, Debug, PartialEq)]
3603pub struct ContainerWithoutFileOpts {
3604    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3605    #[builder(setter(into, strip_option), default)]
3606    pub expand: Option<bool>,
3607}
3608#[derive(Builder, Debug, PartialEq)]
3609pub struct ContainerWithoutFilesOpts {
3610    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3611    #[builder(setter(into, strip_option), default)]
3612    pub expand: Option<bool>,
3613}
3614#[derive(Builder, Debug, PartialEq)]
3615pub struct ContainerWithoutMountOpts {
3616    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3617    #[builder(setter(into, strip_option), default)]
3618    pub expand: Option<bool>,
3619}
3620#[derive(Builder, Debug, PartialEq)]
3621pub struct ContainerWithoutUnixSocketOpts {
3622    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3623    #[builder(setter(into, strip_option), default)]
3624    pub expand: Option<bool>,
3625}
3626impl Container {
3627    /// Turn the container into a Service.
3628    /// Be sure to set any exposed ports before this conversion.
3629    ///
3630    /// # Arguments
3631    ///
3632    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3633    pub fn as_service(&self) -> Service {
3634        let query = self.selection.select("asService");
3635        Service {
3636            proc: self.proc.clone(),
3637            selection: query,
3638            graphql_client: self.graphql_client.clone(),
3639        }
3640    }
3641    /// Turn the container into a Service.
3642    /// Be sure to set any exposed ports before this conversion.
3643    ///
3644    /// # Arguments
3645    ///
3646    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3647    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
3648        let mut query = self.selection.select("asService");
3649        if let Some(args) = opts.args {
3650            query = query.arg("args", args);
3651        }
3652        if let Some(use_entrypoint) = opts.use_entrypoint {
3653            query = query.arg("useEntrypoint", use_entrypoint);
3654        }
3655        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3656            query = query.arg(
3657                "experimentalPrivilegedNesting",
3658                experimental_privileged_nesting,
3659            );
3660        }
3661        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3662            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3663        }
3664        if let Some(expand) = opts.expand {
3665            query = query.arg("expand", expand);
3666        }
3667        if let Some(no_init) = opts.no_init {
3668            query = query.arg("noInit", no_init);
3669        }
3670        Service {
3671            proc: self.proc.clone(),
3672            selection: query,
3673            graphql_client: self.graphql_client.clone(),
3674        }
3675    }
3676    /// Package the container state as an OCI image, and return it as a tar archive
3677    ///
3678    /// # Arguments
3679    ///
3680    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3681    pub fn as_tarball(&self) -> File {
3682        let query = self.selection.select("asTarball");
3683        File {
3684            proc: self.proc.clone(),
3685            selection: query,
3686            graphql_client: self.graphql_client.clone(),
3687        }
3688    }
3689    /// Package the container state as an OCI image, and return it as a tar archive
3690    ///
3691    /// # Arguments
3692    ///
3693    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3694    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
3695        let mut query = self.selection.select("asTarball");
3696        if let Some(platform_variants) = opts.platform_variants {
3697            query = query.arg("platformVariants", platform_variants);
3698        }
3699        if let Some(forced_compression) = opts.forced_compression {
3700            query = query.arg("forcedCompression", forced_compression);
3701        }
3702        if let Some(media_types) = opts.media_types {
3703            query = query.arg("mediaTypes", media_types);
3704        }
3705        File {
3706            proc: self.proc.clone(),
3707            selection: query,
3708            graphql_client: self.graphql_client.clone(),
3709        }
3710    }
3711    /// The combined buffered standard output and standard error stream of the last executed command
3712    /// Returns an error if no command was executed
3713    pub async fn combined_output(&self) -> Result<String, DaggerError> {
3714        let query = self.selection.select("combinedOutput");
3715        query.execute(self.graphql_client.clone()).await
3716    }
3717    /// Return the container's default arguments.
3718    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
3719        let query = self.selection.select("defaultArgs");
3720        query.execute(self.graphql_client.clone()).await
3721    }
3722    /// Retrieve a directory from the container's root filesystem
3723    /// Mounts are included.
3724    ///
3725    /// # Arguments
3726    ///
3727    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3728    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3729    pub fn directory(&self, path: impl Into<String>) -> Directory {
3730        let mut query = self.selection.select("directory");
3731        query = query.arg("path", path.into());
3732        Directory {
3733            proc: self.proc.clone(),
3734            selection: query,
3735            graphql_client: self.graphql_client.clone(),
3736        }
3737    }
3738    /// Retrieve a directory from the container's root filesystem
3739    /// Mounts are included.
3740    ///
3741    /// # Arguments
3742    ///
3743    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3744    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3745    pub fn directory_opts(
3746        &self,
3747        path: impl Into<String>,
3748        opts: ContainerDirectoryOpts,
3749    ) -> Directory {
3750        let mut query = self.selection.select("directory");
3751        query = query.arg("path", path.into());
3752        if let Some(expand) = opts.expand {
3753            query = query.arg("expand", expand);
3754        }
3755        Directory {
3756            proc: self.proc.clone(),
3757            selection: query,
3758            graphql_client: self.graphql_client.clone(),
3759        }
3760    }
3761    /// Retrieves this container's configured docker healthcheck.
3762    pub fn docker_healthcheck(&self) -> HealthcheckConfig {
3763        let query = self.selection.select("dockerHealthcheck");
3764        HealthcheckConfig {
3765            proc: self.proc.clone(),
3766            selection: query,
3767            graphql_client: self.graphql_client.clone(),
3768        }
3769    }
3770    /// Return the container's OCI entrypoint.
3771    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
3772        let query = self.selection.select("entrypoint");
3773        query.execute(self.graphql_client.clone()).await
3774    }
3775    /// Retrieves the value of the specified environment variable.
3776    ///
3777    /// # Arguments
3778    ///
3779    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
3780    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3781        let mut query = self.selection.select("envVariable");
3782        query = query.arg("name", name.into());
3783        query.execute(self.graphql_client.clone()).await
3784    }
3785    /// Retrieves the list of environment variables passed to commands.
3786    pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
3787        let query = self.selection.select("envVariables");
3788        let query = query.select("id");
3789        let ids: Vec<EnvVariableId> = query.execute(self.graphql_client.clone()).await?;
3790        let root = Query {
3791            proc: self.proc.clone(),
3792            selection: crate::querybuilder::query(),
3793            graphql_client: self.graphql_client.clone(),
3794        };
3795        Ok(ids
3796            .into_iter()
3797            .map(|id| root.load_env_variable_from_id(id))
3798            .collect())
3799    }
3800    /// check if a file or directory exists
3801    ///
3802    /// # Arguments
3803    ///
3804    /// * `path` - Path to check (e.g., "/file.txt").
3805    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3806    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
3807        let mut query = self.selection.select("exists");
3808        query = query.arg("path", path.into());
3809        query.execute(self.graphql_client.clone()).await
3810    }
3811    /// check if a file or directory exists
3812    ///
3813    /// # Arguments
3814    ///
3815    /// * `path` - Path to check (e.g., "/file.txt").
3816    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3817    pub async fn exists_opts(
3818        &self,
3819        path: impl Into<String>,
3820        opts: ContainerExistsOpts,
3821    ) -> Result<bool, DaggerError> {
3822        let mut query = self.selection.select("exists");
3823        query = query.arg("path", path.into());
3824        if let Some(expected_type) = opts.expected_type {
3825            query = query.arg("expectedType", expected_type);
3826        }
3827        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
3828            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
3829        }
3830        query.execute(self.graphql_client.clone()).await
3831    }
3832    /// The exit code of the last executed command
3833    /// Returns an error if no command was executed
3834    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
3835        let query = self.selection.select("exitCode");
3836        query.execute(self.graphql_client.clone()).await
3837    }
3838    /// EXPERIMENTAL API! Subject to change/removal at any time.
3839    /// Configures all available GPUs on the host to be accessible to this container.
3840    /// This currently works for Nvidia devices only.
3841    pub fn experimental_with_all_gp_us(&self) -> Container {
3842        let query = self.selection.select("experimentalWithAllGPUs");
3843        Container {
3844            proc: self.proc.clone(),
3845            selection: query,
3846            graphql_client: self.graphql_client.clone(),
3847        }
3848    }
3849    /// EXPERIMENTAL API! Subject to change/removal at any time.
3850    /// Configures the provided list of devices to be accessible to this container.
3851    /// This currently works for Nvidia devices only.
3852    ///
3853    /// # Arguments
3854    ///
3855    /// * `devices` - List of devices to be accessible to this container.
3856    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
3857        let mut query = self.selection.select("experimentalWithGPU");
3858        query = query.arg(
3859            "devices",
3860            devices
3861                .into_iter()
3862                .map(|i| i.into())
3863                .collect::<Vec<String>>(),
3864        );
3865        Container {
3866            proc: self.proc.clone(),
3867            selection: query,
3868            graphql_client: self.graphql_client.clone(),
3869        }
3870    }
3871    /// Writes the container as an OCI tarball to the destination file path on the host.
3872    /// It can also export platform variants.
3873    ///
3874    /// # Arguments
3875    ///
3876    /// * `path` - Host's destination path (e.g., "./tarball").
3877    ///
3878    /// Path can be relative to the engine's workdir or absolute.
3879    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3880    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
3881        let mut query = self.selection.select("export");
3882        query = query.arg("path", path.into());
3883        query.execute(self.graphql_client.clone()).await
3884    }
3885    /// Writes the container as an OCI tarball to the destination file path on the host.
3886    /// It can also export platform variants.
3887    ///
3888    /// # Arguments
3889    ///
3890    /// * `path` - Host's destination path (e.g., "./tarball").
3891    ///
3892    /// Path can be relative to the engine's workdir or absolute.
3893    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3894    pub async fn export_opts(
3895        &self,
3896        path: impl Into<String>,
3897        opts: ContainerExportOpts,
3898    ) -> Result<String, DaggerError> {
3899        let mut query = self.selection.select("export");
3900        query = query.arg("path", path.into());
3901        if let Some(platform_variants) = opts.platform_variants {
3902            query = query.arg("platformVariants", platform_variants);
3903        }
3904        if let Some(forced_compression) = opts.forced_compression {
3905            query = query.arg("forcedCompression", forced_compression);
3906        }
3907        if let Some(media_types) = opts.media_types {
3908            query = query.arg("mediaTypes", media_types);
3909        }
3910        if let Some(expand) = opts.expand {
3911            query = query.arg("expand", expand);
3912        }
3913        query.execute(self.graphql_client.clone()).await
3914    }
3915    /// Exports the container as an image to the host's container image store.
3916    ///
3917    /// # Arguments
3918    ///
3919    /// * `name` - Name of image to export to in the host's store
3920    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3921    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
3922        let mut query = self.selection.select("exportImage");
3923        query = query.arg("name", name.into());
3924        query.execute(self.graphql_client.clone()).await
3925    }
3926    /// Exports the container as an image to the host's container image store.
3927    ///
3928    /// # Arguments
3929    ///
3930    /// * `name` - Name of image to export to in the host's store
3931    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3932    pub async fn export_image_opts(
3933        &self,
3934        name: impl Into<String>,
3935        opts: ContainerExportImageOpts,
3936    ) -> Result<Void, DaggerError> {
3937        let mut query = self.selection.select("exportImage");
3938        query = query.arg("name", name.into());
3939        if let Some(platform_variants) = opts.platform_variants {
3940            query = query.arg("platformVariants", platform_variants);
3941        }
3942        if let Some(forced_compression) = opts.forced_compression {
3943            query = query.arg("forcedCompression", forced_compression);
3944        }
3945        if let Some(media_types) = opts.media_types {
3946            query = query.arg("mediaTypes", media_types);
3947        }
3948        query.execute(self.graphql_client.clone()).await
3949    }
3950    /// Retrieves the list of exposed ports.
3951    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
3952    pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
3953        let query = self.selection.select("exposedPorts");
3954        let query = query.select("id");
3955        let ids: Vec<PortId> = query.execute(self.graphql_client.clone()).await?;
3956        let root = Query {
3957            proc: self.proc.clone(),
3958            selection: crate::querybuilder::query(),
3959            graphql_client: self.graphql_client.clone(),
3960        };
3961        Ok(ids
3962            .into_iter()
3963            .map(|id| root.load_port_from_id(id))
3964            .collect())
3965    }
3966    /// Retrieves a file at the given path.
3967    /// Mounts are included.
3968    ///
3969    /// # Arguments
3970    ///
3971    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3972    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3973    pub fn file(&self, path: impl Into<String>) -> File {
3974        let mut query = self.selection.select("file");
3975        query = query.arg("path", path.into());
3976        File {
3977            proc: self.proc.clone(),
3978            selection: query,
3979            graphql_client: self.graphql_client.clone(),
3980        }
3981    }
3982    /// Retrieves a file at the given path.
3983    /// Mounts are included.
3984    ///
3985    /// # Arguments
3986    ///
3987    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3988    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3989    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3990        let mut query = self.selection.select("file");
3991        query = query.arg("path", path.into());
3992        if let Some(expand) = opts.expand {
3993            query = query.arg("expand", expand);
3994        }
3995        File {
3996            proc: self.proc.clone(),
3997            selection: query,
3998            graphql_client: self.graphql_client.clone(),
3999        }
4000    }
4001    /// Download a container image, and apply it to the container state. All previous state will be lost.
4002    ///
4003    /// # Arguments
4004    ///
4005    /// * `address` - Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
4006    pub fn from(&self, address: impl Into<String>) -> Container {
4007        let mut query = self.selection.select("from");
4008        query = query.arg("address", address.into());
4009        Container {
4010            proc: self.proc.clone(),
4011            selection: query,
4012            graphql_client: self.graphql_client.clone(),
4013        }
4014    }
4015    /// A unique identifier for this Container.
4016    pub async fn id(&self) -> Result<ContainerId, DaggerError> {
4017        let query = self.selection.select("id");
4018        query.execute(self.graphql_client.clone()).await
4019    }
4020    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
4021    pub async fn image_ref(&self) -> Result<String, DaggerError> {
4022        let query = self.selection.select("imageRef");
4023        query.execute(self.graphql_client.clone()).await
4024    }
4025    /// Reads the container from an OCI tarball.
4026    ///
4027    /// # Arguments
4028    ///
4029    /// * `source` - File to read the container from.
4030    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4031    pub fn import(&self, source: impl IntoID<FileId>) -> Container {
4032        let mut query = self.selection.select("import");
4033        query = query.arg_lazy(
4034            "source",
4035            Box::new(move || {
4036                let source = source.clone();
4037                Box::pin(async move { source.into_id().await.unwrap().quote() })
4038            }),
4039        );
4040        Container {
4041            proc: self.proc.clone(),
4042            selection: query,
4043            graphql_client: self.graphql_client.clone(),
4044        }
4045    }
4046    /// Reads the container from an OCI tarball.
4047    ///
4048    /// # Arguments
4049    ///
4050    /// * `source` - File to read the container from.
4051    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4052    pub fn import_opts<'a>(
4053        &self,
4054        source: impl IntoID<FileId>,
4055        opts: ContainerImportOpts<'a>,
4056    ) -> Container {
4057        let mut query = self.selection.select("import");
4058        query = query.arg_lazy(
4059            "source",
4060            Box::new(move || {
4061                let source = source.clone();
4062                Box::pin(async move { source.into_id().await.unwrap().quote() })
4063            }),
4064        );
4065        if let Some(tag) = opts.tag {
4066            query = query.arg("tag", tag);
4067        }
4068        Container {
4069            proc: self.proc.clone(),
4070            selection: query,
4071            graphql_client: self.graphql_client.clone(),
4072        }
4073    }
4074    /// Retrieves the value of the specified label.
4075    ///
4076    /// # Arguments
4077    ///
4078    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
4079    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
4080        let mut query = self.selection.select("label");
4081        query = query.arg("name", name.into());
4082        query.execute(self.graphql_client.clone()).await
4083    }
4084    /// Retrieves the list of labels passed to container.
4085    pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
4086        let query = self.selection.select("labels");
4087        let query = query.select("id");
4088        let ids: Vec<LabelId> = query.execute(self.graphql_client.clone()).await?;
4089        let root = Query {
4090            proc: self.proc.clone(),
4091            selection: crate::querybuilder::query(),
4092            graphql_client: self.graphql_client.clone(),
4093        };
4094        Ok(ids
4095            .into_iter()
4096            .map(|id| root.load_label_from_id(id))
4097            .collect())
4098    }
4099    /// Retrieves the list of paths where a directory is mounted.
4100    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
4101        let query = self.selection.select("mounts");
4102        query.execute(self.graphql_client.clone()).await
4103    }
4104    /// The platform this container executes and publishes as.
4105    pub async fn platform(&self) -> Result<Platform, DaggerError> {
4106        let query = self.selection.select("platform");
4107        query.execute(self.graphql_client.clone()).await
4108    }
4109    /// Package the container state as an OCI image, and publish it to a registry
4110    /// Returns the fully qualified address of the published image, with digest
4111    ///
4112    /// # Arguments
4113    ///
4114    /// * `address` - The OCI address to publish to
4115    ///
4116    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
4117    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4118    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
4119        let mut query = self.selection.select("publish");
4120        query = query.arg("address", address.into());
4121        query.execute(self.graphql_client.clone()).await
4122    }
4123    /// Package the container state as an OCI image, and publish it to a registry
4124    /// Returns the fully qualified address of the published image, with digest
4125    ///
4126    /// # Arguments
4127    ///
4128    /// * `address` - The OCI address to publish to
4129    ///
4130    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
4131    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4132    pub async fn publish_opts(
4133        &self,
4134        address: impl Into<String>,
4135        opts: ContainerPublishOpts,
4136    ) -> Result<String, DaggerError> {
4137        let mut query = self.selection.select("publish");
4138        query = query.arg("address", address.into());
4139        if let Some(platform_variants) = opts.platform_variants {
4140            query = query.arg("platformVariants", platform_variants);
4141        }
4142        if let Some(forced_compression) = opts.forced_compression {
4143            query = query.arg("forcedCompression", forced_compression);
4144        }
4145        if let Some(media_types) = opts.media_types {
4146            query = query.arg("mediaTypes", media_types);
4147        }
4148        query.execute(self.graphql_client.clone()).await
4149    }
4150    /// 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.
4151    pub fn rootfs(&self) -> Directory {
4152        let query = self.selection.select("rootfs");
4153        Directory {
4154            proc: self.proc.clone(),
4155            selection: query,
4156            graphql_client: self.graphql_client.clone(),
4157        }
4158    }
4159    /// Return file status
4160    ///
4161    /// # Arguments
4162    ///
4163    /// * `path` - Path to check (e.g., "/file.txt").
4164    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4165    pub fn stat(&self, path: impl Into<String>) -> Stat {
4166        let mut query = self.selection.select("stat");
4167        query = query.arg("path", path.into());
4168        Stat {
4169            proc: self.proc.clone(),
4170            selection: query,
4171            graphql_client: self.graphql_client.clone(),
4172        }
4173    }
4174    /// Return file status
4175    ///
4176    /// # Arguments
4177    ///
4178    /// * `path` - Path to check (e.g., "/file.txt").
4179    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4180    pub fn stat_opts(&self, path: impl Into<String>, opts: ContainerStatOpts) -> Stat {
4181        let mut query = self.selection.select("stat");
4182        query = query.arg("path", path.into());
4183        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
4184            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
4185        }
4186        Stat {
4187            proc: self.proc.clone(),
4188            selection: query,
4189            graphql_client: self.graphql_client.clone(),
4190        }
4191    }
4192    /// The buffered standard error stream of the last executed command
4193    /// Returns an error if no command was executed
4194    pub async fn stderr(&self) -> Result<String, DaggerError> {
4195        let query = self.selection.select("stderr");
4196        query.execute(self.graphql_client.clone()).await
4197    }
4198    /// The buffered standard output stream of the last executed command
4199    /// Returns an error if no command was executed
4200    pub async fn stdout(&self) -> Result<String, DaggerError> {
4201        let query = self.selection.select("stdout");
4202        query.execute(self.graphql_client.clone()).await
4203    }
4204    /// Forces evaluation of the pipeline in the engine.
4205    /// It doesn't run the default command if no exec has been set.
4206    pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
4207        let query = self.selection.select("sync");
4208        query.execute(self.graphql_client.clone()).await
4209    }
4210    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
4211    ///
4212    /// # Arguments
4213    ///
4214    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4215    pub fn terminal(&self) -> Container {
4216        let query = self.selection.select("terminal");
4217        Container {
4218            proc: self.proc.clone(),
4219            selection: query,
4220            graphql_client: self.graphql_client.clone(),
4221        }
4222    }
4223    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
4224    ///
4225    /// # Arguments
4226    ///
4227    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4228    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
4229        let mut query = self.selection.select("terminal");
4230        if let Some(cmd) = opts.cmd {
4231            query = query.arg("cmd", cmd);
4232        }
4233        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4234            query = query.arg(
4235                "experimentalPrivilegedNesting",
4236                experimental_privileged_nesting,
4237            );
4238        }
4239        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4240            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4241        }
4242        Container {
4243            proc: self.proc.clone(),
4244            selection: query,
4245            graphql_client: self.graphql_client.clone(),
4246        }
4247    }
4248    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
4249    /// Be sure to set any exposed ports before calling this api.
4250    ///
4251    /// # Arguments
4252    ///
4253    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4254    pub async fn up(&self) -> Result<Void, DaggerError> {
4255        let query = self.selection.select("up");
4256        query.execute(self.graphql_client.clone()).await
4257    }
4258    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
4259    /// Be sure to set any exposed ports before calling this api.
4260    ///
4261    /// # Arguments
4262    ///
4263    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4264    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
4265        let mut query = self.selection.select("up");
4266        if let Some(random) = opts.random {
4267            query = query.arg("random", random);
4268        }
4269        if let Some(ports) = opts.ports {
4270            query = query.arg("ports", ports);
4271        }
4272        if let Some(args) = opts.args {
4273            query = query.arg("args", args);
4274        }
4275        if let Some(use_entrypoint) = opts.use_entrypoint {
4276            query = query.arg("useEntrypoint", use_entrypoint);
4277        }
4278        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4279            query = query.arg(
4280                "experimentalPrivilegedNesting",
4281                experimental_privileged_nesting,
4282            );
4283        }
4284        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4285            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4286        }
4287        if let Some(expand) = opts.expand {
4288            query = query.arg("expand", expand);
4289        }
4290        if let Some(no_init) = opts.no_init {
4291            query = query.arg("noInit", no_init);
4292        }
4293        query.execute(self.graphql_client.clone()).await
4294    }
4295    /// Retrieves the user to be set for all commands.
4296    pub async fn user(&self) -> Result<String, DaggerError> {
4297        let query = self.selection.select("user");
4298        query.execute(self.graphql_client.clone()).await
4299    }
4300    /// Retrieves this container plus the given OCI annotation.
4301    ///
4302    /// # Arguments
4303    ///
4304    /// * `name` - The name of the annotation.
4305    /// * `value` - The value of the annotation.
4306    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
4307        let mut query = self.selection.select("withAnnotation");
4308        query = query.arg("name", name.into());
4309        query = query.arg("value", value.into());
4310        Container {
4311            proc: self.proc.clone(),
4312            selection: query,
4313            graphql_client: self.graphql_client.clone(),
4314        }
4315    }
4316    /// Configures default arguments for future commands. Like CMD in Dockerfile.
4317    ///
4318    /// # Arguments
4319    ///
4320    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
4321    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
4322        let mut query = self.selection.select("withDefaultArgs");
4323        query = query.arg(
4324            "args",
4325            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4326        );
4327        Container {
4328            proc: self.proc.clone(),
4329            selection: query,
4330            graphql_client: self.graphql_client.clone(),
4331        }
4332    }
4333    /// Set the default command to invoke for the container's terminal API.
4334    ///
4335    /// # Arguments
4336    ///
4337    /// * `args` - The args of the command.
4338    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4339    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
4340        let mut query = self.selection.select("withDefaultTerminalCmd");
4341        query = query.arg(
4342            "args",
4343            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4344        );
4345        Container {
4346            proc: self.proc.clone(),
4347            selection: query,
4348            graphql_client: self.graphql_client.clone(),
4349        }
4350    }
4351    /// Set the default command to invoke for the container's terminal API.
4352    ///
4353    /// # Arguments
4354    ///
4355    /// * `args` - The args of the command.
4356    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4357    pub fn with_default_terminal_cmd_opts(
4358        &self,
4359        args: Vec<impl Into<String>>,
4360        opts: ContainerWithDefaultTerminalCmdOpts,
4361    ) -> Container {
4362        let mut query = self.selection.select("withDefaultTerminalCmd");
4363        query = query.arg(
4364            "args",
4365            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4366        );
4367        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4368            query = query.arg(
4369                "experimentalPrivilegedNesting",
4370                experimental_privileged_nesting,
4371            );
4372        }
4373        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4374            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4375        }
4376        Container {
4377            proc: self.proc.clone(),
4378            selection: query,
4379            graphql_client: self.graphql_client.clone(),
4380        }
4381    }
4382    /// Return a new container snapshot, with a directory added to its filesystem
4383    ///
4384    /// # Arguments
4385    ///
4386    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
4387    /// * `source` - Identifier of the directory to write
4388    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4389    pub fn with_directory(
4390        &self,
4391        path: impl Into<String>,
4392        source: impl IntoID<DirectoryId>,
4393    ) -> Container {
4394        let mut query = self.selection.select("withDirectory");
4395        query = query.arg("path", path.into());
4396        query = query.arg_lazy(
4397            "source",
4398            Box::new(move || {
4399                let source = source.clone();
4400                Box::pin(async move { source.into_id().await.unwrap().quote() })
4401            }),
4402        );
4403        Container {
4404            proc: self.proc.clone(),
4405            selection: query,
4406            graphql_client: self.graphql_client.clone(),
4407        }
4408    }
4409    /// Return a new container snapshot, with a directory added to its filesystem
4410    ///
4411    /// # Arguments
4412    ///
4413    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
4414    /// * `source` - Identifier of the directory to write
4415    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4416    pub fn with_directory_opts<'a>(
4417        &self,
4418        path: impl Into<String>,
4419        source: impl IntoID<DirectoryId>,
4420        opts: ContainerWithDirectoryOpts<'a>,
4421    ) -> Container {
4422        let mut query = self.selection.select("withDirectory");
4423        query = query.arg("path", path.into());
4424        query = query.arg_lazy(
4425            "source",
4426            Box::new(move || {
4427                let source = source.clone();
4428                Box::pin(async move { source.into_id().await.unwrap().quote() })
4429            }),
4430        );
4431        if let Some(exclude) = opts.exclude {
4432            query = query.arg("exclude", exclude);
4433        }
4434        if let Some(include) = opts.include {
4435            query = query.arg("include", include);
4436        }
4437        if let Some(gitignore) = opts.gitignore {
4438            query = query.arg("gitignore", gitignore);
4439        }
4440        if let Some(owner) = opts.owner {
4441            query = query.arg("owner", owner);
4442        }
4443        if let Some(expand) = opts.expand {
4444            query = query.arg("expand", expand);
4445        }
4446        if let Some(permissions) = opts.permissions {
4447            query = query.arg("permissions", permissions);
4448        }
4449        Container {
4450            proc: self.proc.clone(),
4451            selection: query,
4452            graphql_client: self.graphql_client.clone(),
4453        }
4454    }
4455    /// Retrieves this container with the specificed docker healtcheck command set.
4456    ///
4457    /// # Arguments
4458    ///
4459    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
4460    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4461    pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
4462        let mut query = self.selection.select("withDockerHealthcheck");
4463        query = query.arg(
4464            "args",
4465            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4466        );
4467        Container {
4468            proc: self.proc.clone(),
4469            selection: query,
4470            graphql_client: self.graphql_client.clone(),
4471        }
4472    }
4473    /// Retrieves this container with the specificed docker healtcheck command set.
4474    ///
4475    /// # Arguments
4476    ///
4477    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
4478    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4479    pub fn with_docker_healthcheck_opts<'a>(
4480        &self,
4481        args: Vec<impl Into<String>>,
4482        opts: ContainerWithDockerHealthcheckOpts<'a>,
4483    ) -> Container {
4484        let mut query = self.selection.select("withDockerHealthcheck");
4485        query = query.arg(
4486            "args",
4487            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4488        );
4489        if let Some(shell) = opts.shell {
4490            query = query.arg("shell", shell);
4491        }
4492        if let Some(interval) = opts.interval {
4493            query = query.arg("interval", interval);
4494        }
4495        if let Some(timeout) = opts.timeout {
4496            query = query.arg("timeout", timeout);
4497        }
4498        if let Some(start_period) = opts.start_period {
4499            query = query.arg("startPeriod", start_period);
4500        }
4501        if let Some(start_interval) = opts.start_interval {
4502            query = query.arg("startInterval", start_interval);
4503        }
4504        if let Some(retries) = opts.retries {
4505            query = query.arg("retries", retries);
4506        }
4507        Container {
4508            proc: self.proc.clone(),
4509            selection: query,
4510            graphql_client: self.graphql_client.clone(),
4511        }
4512    }
4513    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
4514    ///
4515    /// # Arguments
4516    ///
4517    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
4518    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4519    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
4520        let mut query = self.selection.select("withEntrypoint");
4521        query = query.arg(
4522            "args",
4523            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4524        );
4525        Container {
4526            proc: self.proc.clone(),
4527            selection: query,
4528            graphql_client: self.graphql_client.clone(),
4529        }
4530    }
4531    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
4532    ///
4533    /// # Arguments
4534    ///
4535    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
4536    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4537    pub fn with_entrypoint_opts(
4538        &self,
4539        args: Vec<impl Into<String>>,
4540        opts: ContainerWithEntrypointOpts,
4541    ) -> Container {
4542        let mut query = self.selection.select("withEntrypoint");
4543        query = query.arg(
4544            "args",
4545            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4546        );
4547        if let Some(keep_default_args) = opts.keep_default_args {
4548            query = query.arg("keepDefaultArgs", keep_default_args);
4549        }
4550        Container {
4551            proc: self.proc.clone(),
4552            selection: query,
4553            graphql_client: self.graphql_client.clone(),
4554        }
4555    }
4556    /// Export environment variables from an env-file to the container.
4557    ///
4558    /// # Arguments
4559    ///
4560    /// * `source` - Identifier of the envfile
4561    pub fn with_env_file_variables(&self, source: impl IntoID<EnvFileId>) -> Container {
4562        let mut query = self.selection.select("withEnvFileVariables");
4563        query = query.arg_lazy(
4564            "source",
4565            Box::new(move || {
4566                let source = source.clone();
4567                Box::pin(async move { source.into_id().await.unwrap().quote() })
4568            }),
4569        );
4570        Container {
4571            proc: self.proc.clone(),
4572            selection: query,
4573            graphql_client: self.graphql_client.clone(),
4574        }
4575    }
4576    /// Set a new environment variable in the container.
4577    ///
4578    /// # Arguments
4579    ///
4580    /// * `name` - Name of the environment variable (e.g., "HOST").
4581    /// * `value` - Value of the environment variable. (e.g., "localhost").
4582    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4583    pub fn with_env_variable(
4584        &self,
4585        name: impl Into<String>,
4586        value: impl Into<String>,
4587    ) -> Container {
4588        let mut query = self.selection.select("withEnvVariable");
4589        query = query.arg("name", name.into());
4590        query = query.arg("value", value.into());
4591        Container {
4592            proc: self.proc.clone(),
4593            selection: query,
4594            graphql_client: self.graphql_client.clone(),
4595        }
4596    }
4597    /// Set a new environment variable in the container.
4598    ///
4599    /// # Arguments
4600    ///
4601    /// * `name` - Name of the environment variable (e.g., "HOST").
4602    /// * `value` - Value of the environment variable. (e.g., "localhost").
4603    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4604    pub fn with_env_variable_opts(
4605        &self,
4606        name: impl Into<String>,
4607        value: impl Into<String>,
4608        opts: ContainerWithEnvVariableOpts,
4609    ) -> Container {
4610        let mut query = self.selection.select("withEnvVariable");
4611        query = query.arg("name", name.into());
4612        query = query.arg("value", value.into());
4613        if let Some(expand) = opts.expand {
4614            query = query.arg("expand", expand);
4615        }
4616        Container {
4617            proc: self.proc.clone(),
4618            selection: query,
4619            graphql_client: self.graphql_client.clone(),
4620        }
4621    }
4622    /// Raise an error.
4623    ///
4624    /// # Arguments
4625    ///
4626    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
4627    pub fn with_error(&self, err: impl Into<String>) -> Container {
4628        let mut query = self.selection.select("withError");
4629        query = query.arg("err", err.into());
4630        Container {
4631            proc: self.proc.clone(),
4632            selection: query,
4633            graphql_client: self.graphql_client.clone(),
4634        }
4635    }
4636    /// Execute a command in the container, and return a new snapshot of the container state after execution.
4637    ///
4638    /// # Arguments
4639    ///
4640    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
4641    ///
4642    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
4643    ///
4644    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
4645    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4646    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
4647        let mut query = self.selection.select("withExec");
4648        query = query.arg(
4649            "args",
4650            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4651        );
4652        Container {
4653            proc: self.proc.clone(),
4654            selection: query,
4655            graphql_client: self.graphql_client.clone(),
4656        }
4657    }
4658    /// Execute a command in the container, and return a new snapshot of the container state after execution.
4659    ///
4660    /// # Arguments
4661    ///
4662    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
4663    ///
4664    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
4665    ///
4666    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
4667    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4668    pub fn with_exec_opts<'a>(
4669        &self,
4670        args: Vec<impl Into<String>>,
4671        opts: ContainerWithExecOpts<'a>,
4672    ) -> Container {
4673        let mut query = self.selection.select("withExec");
4674        query = query.arg(
4675            "args",
4676            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4677        );
4678        if let Some(use_entrypoint) = opts.use_entrypoint {
4679            query = query.arg("useEntrypoint", use_entrypoint);
4680        }
4681        if let Some(stdin) = opts.stdin {
4682            query = query.arg("stdin", stdin);
4683        }
4684        if let Some(redirect_stdin) = opts.redirect_stdin {
4685            query = query.arg("redirectStdin", redirect_stdin);
4686        }
4687        if let Some(redirect_stdout) = opts.redirect_stdout {
4688            query = query.arg("redirectStdout", redirect_stdout);
4689        }
4690        if let Some(redirect_stderr) = opts.redirect_stderr {
4691            query = query.arg("redirectStderr", redirect_stderr);
4692        }
4693        if let Some(expect) = opts.expect {
4694            query = query.arg("expect", expect);
4695        }
4696        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4697            query = query.arg(
4698                "experimentalPrivilegedNesting",
4699                experimental_privileged_nesting,
4700            );
4701        }
4702        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4703            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4704        }
4705        if let Some(expand) = opts.expand {
4706            query = query.arg("expand", expand);
4707        }
4708        if let Some(no_init) = opts.no_init {
4709            query = query.arg("noInit", no_init);
4710        }
4711        Container {
4712            proc: self.proc.clone(),
4713            selection: query,
4714            graphql_client: self.graphql_client.clone(),
4715        }
4716    }
4717    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
4718    /// Exposed ports serve two purposes:
4719    /// - For health checks and introspection, when running services
4720    /// - For setting the EXPOSE OCI field when publishing the container
4721    ///
4722    /// # Arguments
4723    ///
4724    /// * `port` - Port number to expose. Example: 8080
4725    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4726    pub fn with_exposed_port(&self, port: isize) -> Container {
4727        let mut query = self.selection.select("withExposedPort");
4728        query = query.arg("port", port);
4729        Container {
4730            proc: self.proc.clone(),
4731            selection: query,
4732            graphql_client: self.graphql_client.clone(),
4733        }
4734    }
4735    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
4736    /// Exposed ports serve two purposes:
4737    /// - For health checks and introspection, when running services
4738    /// - For setting the EXPOSE OCI field when publishing the container
4739    ///
4740    /// # Arguments
4741    ///
4742    /// * `port` - Port number to expose. Example: 8080
4743    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4744    pub fn with_exposed_port_opts<'a>(
4745        &self,
4746        port: isize,
4747        opts: ContainerWithExposedPortOpts<'a>,
4748    ) -> Container {
4749        let mut query = self.selection.select("withExposedPort");
4750        query = query.arg("port", port);
4751        if let Some(protocol) = opts.protocol {
4752            query = query.arg("protocol", protocol);
4753        }
4754        if let Some(description) = opts.description {
4755            query = query.arg("description", description);
4756        }
4757        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
4758            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
4759        }
4760        Container {
4761            proc: self.proc.clone(),
4762            selection: query,
4763            graphql_client: self.graphql_client.clone(),
4764        }
4765    }
4766    /// Return a container snapshot with a file added
4767    ///
4768    /// # Arguments
4769    ///
4770    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4771    /// * `source` - File to add
4772    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4773    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
4774        let mut query = self.selection.select("withFile");
4775        query = query.arg("path", path.into());
4776        query = query.arg_lazy(
4777            "source",
4778            Box::new(move || {
4779                let source = source.clone();
4780                Box::pin(async move { source.into_id().await.unwrap().quote() })
4781            }),
4782        );
4783        Container {
4784            proc: self.proc.clone(),
4785            selection: query,
4786            graphql_client: self.graphql_client.clone(),
4787        }
4788    }
4789    /// Return a container snapshot with a file added
4790    ///
4791    /// # Arguments
4792    ///
4793    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4794    /// * `source` - File to add
4795    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4796    pub fn with_file_opts<'a>(
4797        &self,
4798        path: impl Into<String>,
4799        source: impl IntoID<FileId>,
4800        opts: ContainerWithFileOpts<'a>,
4801    ) -> Container {
4802        let mut query = self.selection.select("withFile");
4803        query = query.arg("path", path.into());
4804        query = query.arg_lazy(
4805            "source",
4806            Box::new(move || {
4807                let source = source.clone();
4808                Box::pin(async move { source.into_id().await.unwrap().quote() })
4809            }),
4810        );
4811        if let Some(permissions) = opts.permissions {
4812            query = query.arg("permissions", permissions);
4813        }
4814        if let Some(owner) = opts.owner {
4815            query = query.arg("owner", owner);
4816        }
4817        if let Some(expand) = opts.expand {
4818            query = query.arg("expand", expand);
4819        }
4820        Container {
4821            proc: self.proc.clone(),
4822            selection: query,
4823            graphql_client: self.graphql_client.clone(),
4824        }
4825    }
4826    /// Retrieves this container plus the contents of the given files copied to the given path.
4827    ///
4828    /// # Arguments
4829    ///
4830    /// * `path` - Location where copied files should be placed (e.g., "/src").
4831    /// * `sources` - Identifiers of the files to copy.
4832    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4833    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
4834        let mut query = self.selection.select("withFiles");
4835        query = query.arg("path", path.into());
4836        query = query.arg("sources", sources);
4837        Container {
4838            proc: self.proc.clone(),
4839            selection: query,
4840            graphql_client: self.graphql_client.clone(),
4841        }
4842    }
4843    /// Retrieves this container plus the contents of the given files copied to the given path.
4844    ///
4845    /// # Arguments
4846    ///
4847    /// * `path` - Location where copied files should be placed (e.g., "/src").
4848    /// * `sources` - Identifiers of the files to copy.
4849    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4850    pub fn with_files_opts<'a>(
4851        &self,
4852        path: impl Into<String>,
4853        sources: Vec<FileId>,
4854        opts: ContainerWithFilesOpts<'a>,
4855    ) -> Container {
4856        let mut query = self.selection.select("withFiles");
4857        query = query.arg("path", path.into());
4858        query = query.arg("sources", sources);
4859        if let Some(permissions) = opts.permissions {
4860            query = query.arg("permissions", permissions);
4861        }
4862        if let Some(owner) = opts.owner {
4863            query = query.arg("owner", owner);
4864        }
4865        if let Some(expand) = opts.expand {
4866            query = query.arg("expand", expand);
4867        }
4868        Container {
4869            proc: self.proc.clone(),
4870            selection: query,
4871            graphql_client: self.graphql_client.clone(),
4872        }
4873    }
4874    /// Retrieves this container plus the given label.
4875    ///
4876    /// # Arguments
4877    ///
4878    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
4879    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
4880    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
4881        let mut query = self.selection.select("withLabel");
4882        query = query.arg("name", name.into());
4883        query = query.arg("value", value.into());
4884        Container {
4885            proc: self.proc.clone(),
4886            selection: query,
4887            graphql_client: self.graphql_client.clone(),
4888        }
4889    }
4890    /// Retrieves this container plus a cache volume mounted at the given path.
4891    ///
4892    /// # Arguments
4893    ///
4894    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4895    /// * `cache` - Identifier of the cache volume to mount.
4896    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4897    pub fn with_mounted_cache(
4898        &self,
4899        path: impl Into<String>,
4900        cache: impl IntoID<CacheVolumeId>,
4901    ) -> Container {
4902        let mut query = self.selection.select("withMountedCache");
4903        query = query.arg("path", path.into());
4904        query = query.arg_lazy(
4905            "cache",
4906            Box::new(move || {
4907                let cache = cache.clone();
4908                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4909            }),
4910        );
4911        Container {
4912            proc: self.proc.clone(),
4913            selection: query,
4914            graphql_client: self.graphql_client.clone(),
4915        }
4916    }
4917    /// Retrieves this container plus a cache volume mounted at the given path.
4918    ///
4919    /// # Arguments
4920    ///
4921    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4922    /// * `cache` - Identifier of the cache volume to mount.
4923    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4924    pub fn with_mounted_cache_opts<'a>(
4925        &self,
4926        path: impl Into<String>,
4927        cache: impl IntoID<CacheVolumeId>,
4928        opts: ContainerWithMountedCacheOpts<'a>,
4929    ) -> Container {
4930        let mut query = self.selection.select("withMountedCache");
4931        query = query.arg("path", path.into());
4932        query = query.arg_lazy(
4933            "cache",
4934            Box::new(move || {
4935                let cache = cache.clone();
4936                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4937            }),
4938        );
4939        if let Some(source) = opts.source {
4940            query = query.arg("source", source);
4941        }
4942        if let Some(sharing) = opts.sharing {
4943            query = query.arg("sharing", sharing);
4944        }
4945        if let Some(owner) = opts.owner {
4946            query = query.arg("owner", owner);
4947        }
4948        if let Some(expand) = opts.expand {
4949            query = query.arg("expand", expand);
4950        }
4951        Container {
4952            proc: self.proc.clone(),
4953            selection: query,
4954            graphql_client: self.graphql_client.clone(),
4955        }
4956    }
4957    /// Retrieves this container plus a directory mounted at the given path.
4958    ///
4959    /// # Arguments
4960    ///
4961    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4962    /// * `source` - Identifier of the mounted directory.
4963    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4964    pub fn with_mounted_directory(
4965        &self,
4966        path: impl Into<String>,
4967        source: impl IntoID<DirectoryId>,
4968    ) -> Container {
4969        let mut query = self.selection.select("withMountedDirectory");
4970        query = query.arg("path", path.into());
4971        query = query.arg_lazy(
4972            "source",
4973            Box::new(move || {
4974                let source = source.clone();
4975                Box::pin(async move { source.into_id().await.unwrap().quote() })
4976            }),
4977        );
4978        Container {
4979            proc: self.proc.clone(),
4980            selection: query,
4981            graphql_client: self.graphql_client.clone(),
4982        }
4983    }
4984    /// Retrieves this container plus a directory mounted at the given path.
4985    ///
4986    /// # Arguments
4987    ///
4988    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4989    /// * `source` - Identifier of the mounted directory.
4990    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4991    pub fn with_mounted_directory_opts<'a>(
4992        &self,
4993        path: impl Into<String>,
4994        source: impl IntoID<DirectoryId>,
4995        opts: ContainerWithMountedDirectoryOpts<'a>,
4996    ) -> Container {
4997        let mut query = self.selection.select("withMountedDirectory");
4998        query = query.arg("path", path.into());
4999        query = query.arg_lazy(
5000            "source",
5001            Box::new(move || {
5002                let source = source.clone();
5003                Box::pin(async move { source.into_id().await.unwrap().quote() })
5004            }),
5005        );
5006        if let Some(owner) = opts.owner {
5007            query = query.arg("owner", owner);
5008        }
5009        if let Some(read_only) = opts.read_only {
5010            query = query.arg("readOnly", read_only);
5011        }
5012        if let Some(expand) = opts.expand {
5013            query = query.arg("expand", expand);
5014        }
5015        Container {
5016            proc: self.proc.clone(),
5017            selection: query,
5018            graphql_client: self.graphql_client.clone(),
5019        }
5020    }
5021    /// Retrieves this container plus a file mounted at the given path.
5022    ///
5023    /// # Arguments
5024    ///
5025    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
5026    /// * `source` - Identifier of the mounted file.
5027    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5028    pub fn with_mounted_file(
5029        &self,
5030        path: impl Into<String>,
5031        source: impl IntoID<FileId>,
5032    ) -> Container {
5033        let mut query = self.selection.select("withMountedFile");
5034        query = query.arg("path", path.into());
5035        query = query.arg_lazy(
5036            "source",
5037            Box::new(move || {
5038                let source = source.clone();
5039                Box::pin(async move { source.into_id().await.unwrap().quote() })
5040            }),
5041        );
5042        Container {
5043            proc: self.proc.clone(),
5044            selection: query,
5045            graphql_client: self.graphql_client.clone(),
5046        }
5047    }
5048    /// Retrieves this container plus a file mounted at the given path.
5049    ///
5050    /// # Arguments
5051    ///
5052    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
5053    /// * `source` - Identifier of the mounted file.
5054    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5055    pub fn with_mounted_file_opts<'a>(
5056        &self,
5057        path: impl Into<String>,
5058        source: impl IntoID<FileId>,
5059        opts: ContainerWithMountedFileOpts<'a>,
5060    ) -> Container {
5061        let mut query = self.selection.select("withMountedFile");
5062        query = query.arg("path", path.into());
5063        query = query.arg_lazy(
5064            "source",
5065            Box::new(move || {
5066                let source = source.clone();
5067                Box::pin(async move { source.into_id().await.unwrap().quote() })
5068            }),
5069        );
5070        if let Some(owner) = opts.owner {
5071            query = query.arg("owner", owner);
5072        }
5073        if let Some(expand) = opts.expand {
5074            query = query.arg("expand", expand);
5075        }
5076        Container {
5077            proc: self.proc.clone(),
5078            selection: query,
5079            graphql_client: self.graphql_client.clone(),
5080        }
5081    }
5082    /// Retrieves this container plus a secret mounted into a file at the given path.
5083    ///
5084    /// # Arguments
5085    ///
5086    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
5087    /// * `source` - Identifier of the secret to mount.
5088    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5089    pub fn with_mounted_secret(
5090        &self,
5091        path: impl Into<String>,
5092        source: impl IntoID<SecretId>,
5093    ) -> Container {
5094        let mut query = self.selection.select("withMountedSecret");
5095        query = query.arg("path", path.into());
5096        query = query.arg_lazy(
5097            "source",
5098            Box::new(move || {
5099                let source = source.clone();
5100                Box::pin(async move { source.into_id().await.unwrap().quote() })
5101            }),
5102        );
5103        Container {
5104            proc: self.proc.clone(),
5105            selection: query,
5106            graphql_client: self.graphql_client.clone(),
5107        }
5108    }
5109    /// Retrieves this container plus a secret mounted into a file at the given path.
5110    ///
5111    /// # Arguments
5112    ///
5113    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
5114    /// * `source` - Identifier of the secret to mount.
5115    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5116    pub fn with_mounted_secret_opts<'a>(
5117        &self,
5118        path: impl Into<String>,
5119        source: impl IntoID<SecretId>,
5120        opts: ContainerWithMountedSecretOpts<'a>,
5121    ) -> Container {
5122        let mut query = self.selection.select("withMountedSecret");
5123        query = query.arg("path", path.into());
5124        query = query.arg_lazy(
5125            "source",
5126            Box::new(move || {
5127                let source = source.clone();
5128                Box::pin(async move { source.into_id().await.unwrap().quote() })
5129            }),
5130        );
5131        if let Some(owner) = opts.owner {
5132            query = query.arg("owner", owner);
5133        }
5134        if let Some(mode) = opts.mode {
5135            query = query.arg("mode", mode);
5136        }
5137        if let Some(expand) = opts.expand {
5138            query = query.arg("expand", expand);
5139        }
5140        Container {
5141            proc: self.proc.clone(),
5142            selection: query,
5143            graphql_client: self.graphql_client.clone(),
5144        }
5145    }
5146    /// 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.
5147    ///
5148    /// # Arguments
5149    ///
5150    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
5151    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5152    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
5153        let mut query = self.selection.select("withMountedTemp");
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 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.
5162    ///
5163    /// # Arguments
5164    ///
5165    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
5166    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5167    pub fn with_mounted_temp_opts(
5168        &self,
5169        path: impl Into<String>,
5170        opts: ContainerWithMountedTempOpts,
5171    ) -> Container {
5172        let mut query = self.selection.select("withMountedTemp");
5173        query = query.arg("path", path.into());
5174        if let Some(size) = opts.size {
5175            query = query.arg("size", size);
5176        }
5177        if let Some(expand) = opts.expand {
5178            query = query.arg("expand", expand);
5179        }
5180        Container {
5181            proc: self.proc.clone(),
5182            selection: query,
5183            graphql_client: self.graphql_client.clone(),
5184        }
5185    }
5186    /// Return a new container snapshot, with a file added to its filesystem with text content
5187    ///
5188    /// # Arguments
5189    ///
5190    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
5191    /// * `contents` - Contents of the new file. Example: "Hello world!"
5192    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5193    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
5194        let mut query = self.selection.select("withNewFile");
5195        query = query.arg("path", path.into());
5196        query = query.arg("contents", contents.into());
5197        Container {
5198            proc: self.proc.clone(),
5199            selection: query,
5200            graphql_client: self.graphql_client.clone(),
5201        }
5202    }
5203    /// Return a new container snapshot, with a file added to its filesystem with text content
5204    ///
5205    /// # Arguments
5206    ///
5207    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
5208    /// * `contents` - Contents of the new file. Example: "Hello world!"
5209    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5210    pub fn with_new_file_opts<'a>(
5211        &self,
5212        path: impl Into<String>,
5213        contents: impl Into<String>,
5214        opts: ContainerWithNewFileOpts<'a>,
5215    ) -> Container {
5216        let mut query = self.selection.select("withNewFile");
5217        query = query.arg("path", path.into());
5218        query = query.arg("contents", contents.into());
5219        if let Some(permissions) = opts.permissions {
5220            query = query.arg("permissions", permissions);
5221        }
5222        if let Some(owner) = opts.owner {
5223            query = query.arg("owner", owner);
5224        }
5225        if let Some(expand) = opts.expand {
5226            query = query.arg("expand", expand);
5227        }
5228        Container {
5229            proc: self.proc.clone(),
5230            selection: query,
5231            graphql_client: self.graphql_client.clone(),
5232        }
5233    }
5234    /// Attach credentials for future publishing to a registry. Use in combination with publish
5235    ///
5236    /// # Arguments
5237    ///
5238    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
5239    /// * `username` - The username to authenticate with. Example: "alice"
5240    /// * `secret` - The API key, password or token to authenticate to this registry
5241    pub fn with_registry_auth(
5242        &self,
5243        address: impl Into<String>,
5244        username: impl Into<String>,
5245        secret: impl IntoID<SecretId>,
5246    ) -> Container {
5247        let mut query = self.selection.select("withRegistryAuth");
5248        query = query.arg("address", address.into());
5249        query = query.arg("username", username.into());
5250        query = query.arg_lazy(
5251            "secret",
5252            Box::new(move || {
5253                let secret = secret.clone();
5254                Box::pin(async move { secret.into_id().await.unwrap().quote() })
5255            }),
5256        );
5257        Container {
5258            proc: self.proc.clone(),
5259            selection: query,
5260            graphql_client: self.graphql_client.clone(),
5261        }
5262    }
5263    /// Change the container's root filesystem. The previous root filesystem will be lost.
5264    ///
5265    /// # Arguments
5266    ///
5267    /// * `directory` - The new root filesystem.
5268    pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
5269        let mut query = self.selection.select("withRootfs");
5270        query = query.arg_lazy(
5271            "directory",
5272            Box::new(move || {
5273                let directory = directory.clone();
5274                Box::pin(async move { directory.into_id().await.unwrap().quote() })
5275            }),
5276        );
5277        Container {
5278            proc: self.proc.clone(),
5279            selection: query,
5280            graphql_client: self.graphql_client.clone(),
5281        }
5282    }
5283    /// Set a new environment variable, using a secret value
5284    ///
5285    /// # Arguments
5286    ///
5287    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
5288    /// * `secret` - Identifier of the secret value.
5289    pub fn with_secret_variable(
5290        &self,
5291        name: impl Into<String>,
5292        secret: impl IntoID<SecretId>,
5293    ) -> Container {
5294        let mut query = self.selection.select("withSecretVariable");
5295        query = query.arg("name", name.into());
5296        query = query.arg_lazy(
5297            "secret",
5298            Box::new(move || {
5299                let secret = secret.clone();
5300                Box::pin(async move { secret.into_id().await.unwrap().quote() })
5301            }),
5302        );
5303        Container {
5304            proc: self.proc.clone(),
5305            selection: query,
5306            graphql_client: self.graphql_client.clone(),
5307        }
5308    }
5309    /// Establish a runtime dependency from a container to a network service.
5310    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
5311    /// The service will be reachable from the container via the provided hostname alias.
5312    /// The service dependency will also convey to any files or directories produced by the container.
5313    ///
5314    /// # Arguments
5315    ///
5316    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
5317    /// * `service` - The target service
5318    pub fn with_service_binding(
5319        &self,
5320        alias: impl Into<String>,
5321        service: impl IntoID<ServiceId>,
5322    ) -> Container {
5323        let mut query = self.selection.select("withServiceBinding");
5324        query = query.arg("alias", alias.into());
5325        query = query.arg_lazy(
5326            "service",
5327            Box::new(move || {
5328                let service = service.clone();
5329                Box::pin(async move { service.into_id().await.unwrap().quote() })
5330            }),
5331        );
5332        Container {
5333            proc: self.proc.clone(),
5334            selection: query,
5335            graphql_client: self.graphql_client.clone(),
5336        }
5337    }
5338    /// Return a snapshot with a symlink
5339    ///
5340    /// # Arguments
5341    ///
5342    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5343    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5344    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5345    pub fn with_symlink(
5346        &self,
5347        target: impl Into<String>,
5348        link_name: impl Into<String>,
5349    ) -> Container {
5350        let mut query = self.selection.select("withSymlink");
5351        query = query.arg("target", target.into());
5352        query = query.arg("linkName", link_name.into());
5353        Container {
5354            proc: self.proc.clone(),
5355            selection: query,
5356            graphql_client: self.graphql_client.clone(),
5357        }
5358    }
5359    /// Return a snapshot with a symlink
5360    ///
5361    /// # Arguments
5362    ///
5363    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5364    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5365    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5366    pub fn with_symlink_opts(
5367        &self,
5368        target: impl Into<String>,
5369        link_name: impl Into<String>,
5370        opts: ContainerWithSymlinkOpts,
5371    ) -> Container {
5372        let mut query = self.selection.select("withSymlink");
5373        query = query.arg("target", target.into());
5374        query = query.arg("linkName", link_name.into());
5375        if let Some(expand) = opts.expand {
5376            query = query.arg("expand", expand);
5377        }
5378        Container {
5379            proc: self.proc.clone(),
5380            selection: query,
5381            graphql_client: self.graphql_client.clone(),
5382        }
5383    }
5384    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
5385    ///
5386    /// # Arguments
5387    ///
5388    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
5389    /// * `source` - Identifier of the socket to forward.
5390    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5391    pub fn with_unix_socket(
5392        &self,
5393        path: impl Into<String>,
5394        source: impl IntoID<SocketId>,
5395    ) -> Container {
5396        let mut query = self.selection.select("withUnixSocket");
5397        query = query.arg("path", path.into());
5398        query = query.arg_lazy(
5399            "source",
5400            Box::new(move || {
5401                let source = source.clone();
5402                Box::pin(async move { source.into_id().await.unwrap().quote() })
5403            }),
5404        );
5405        Container {
5406            proc: self.proc.clone(),
5407            selection: query,
5408            graphql_client: self.graphql_client.clone(),
5409        }
5410    }
5411    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
5412    ///
5413    /// # Arguments
5414    ///
5415    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
5416    /// * `source` - Identifier of the socket to forward.
5417    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5418    pub fn with_unix_socket_opts<'a>(
5419        &self,
5420        path: impl Into<String>,
5421        source: impl IntoID<SocketId>,
5422        opts: ContainerWithUnixSocketOpts<'a>,
5423    ) -> Container {
5424        let mut query = self.selection.select("withUnixSocket");
5425        query = query.arg("path", path.into());
5426        query = query.arg_lazy(
5427            "source",
5428            Box::new(move || {
5429                let source = source.clone();
5430                Box::pin(async move { source.into_id().await.unwrap().quote() })
5431            }),
5432        );
5433        if let Some(owner) = opts.owner {
5434            query = query.arg("owner", owner);
5435        }
5436        if let Some(expand) = opts.expand {
5437            query = query.arg("expand", expand);
5438        }
5439        Container {
5440            proc: self.proc.clone(),
5441            selection: query,
5442            graphql_client: self.graphql_client.clone(),
5443        }
5444    }
5445    /// Retrieves this container with a different command user.
5446    ///
5447    /// # Arguments
5448    ///
5449    /// * `name` - The user to set (e.g., "root").
5450    pub fn with_user(&self, name: impl Into<String>) -> Container {
5451        let mut query = self.selection.select("withUser");
5452        query = query.arg("name", name.into());
5453        Container {
5454            proc: self.proc.clone(),
5455            selection: query,
5456            graphql_client: self.graphql_client.clone(),
5457        }
5458    }
5459    /// Change the container's working directory. Like WORKDIR in Dockerfile.
5460    ///
5461    /// # Arguments
5462    ///
5463    /// * `path` - The path to set as the working directory (e.g., "/app").
5464    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5465    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
5466        let mut query = self.selection.select("withWorkdir");
5467        query = query.arg("path", path.into());
5468        Container {
5469            proc: self.proc.clone(),
5470            selection: query,
5471            graphql_client: self.graphql_client.clone(),
5472        }
5473    }
5474    /// Change the container's working directory. Like WORKDIR in Dockerfile.
5475    ///
5476    /// # Arguments
5477    ///
5478    /// * `path` - The path to set as the working directory (e.g., "/app").
5479    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5480    pub fn with_workdir_opts(
5481        &self,
5482        path: impl Into<String>,
5483        opts: ContainerWithWorkdirOpts,
5484    ) -> Container {
5485        let mut query = self.selection.select("withWorkdir");
5486        query = query.arg("path", path.into());
5487        if let Some(expand) = opts.expand {
5488            query = query.arg("expand", expand);
5489        }
5490        Container {
5491            proc: self.proc.clone(),
5492            selection: query,
5493            graphql_client: self.graphql_client.clone(),
5494        }
5495    }
5496    /// Retrieves this container minus the given OCI annotation.
5497    ///
5498    /// # Arguments
5499    ///
5500    /// * `name` - The name of the annotation.
5501    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
5502        let mut query = self.selection.select("withoutAnnotation");
5503        query = query.arg("name", name.into());
5504        Container {
5505            proc: self.proc.clone(),
5506            selection: query,
5507            graphql_client: self.graphql_client.clone(),
5508        }
5509    }
5510    /// Remove the container's default arguments.
5511    pub fn without_default_args(&self) -> Container {
5512        let query = self.selection.select("withoutDefaultArgs");
5513        Container {
5514            proc: self.proc.clone(),
5515            selection: query,
5516            graphql_client: self.graphql_client.clone(),
5517        }
5518    }
5519    /// Return a new container snapshot, with a directory removed from its filesystem
5520    ///
5521    /// # Arguments
5522    ///
5523    /// * `path` - Location of the directory to remove (e.g., ".github/").
5524    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5525    pub fn without_directory(&self, path: impl Into<String>) -> Container {
5526        let mut query = self.selection.select("withoutDirectory");
5527        query = query.arg("path", path.into());
5528        Container {
5529            proc: self.proc.clone(),
5530            selection: query,
5531            graphql_client: self.graphql_client.clone(),
5532        }
5533    }
5534    /// Return a new container snapshot, with a directory removed from its filesystem
5535    ///
5536    /// # Arguments
5537    ///
5538    /// * `path` - Location of the directory to remove (e.g., ".github/").
5539    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5540    pub fn without_directory_opts(
5541        &self,
5542        path: impl Into<String>,
5543        opts: ContainerWithoutDirectoryOpts,
5544    ) -> Container {
5545        let mut query = self.selection.select("withoutDirectory");
5546        query = query.arg("path", path.into());
5547        if let Some(expand) = opts.expand {
5548            query = query.arg("expand", expand);
5549        }
5550        Container {
5551            proc: self.proc.clone(),
5552            selection: query,
5553            graphql_client: self.graphql_client.clone(),
5554        }
5555    }
5556    /// Retrieves this container without a configured docker healtcheck command.
5557    pub fn without_docker_healthcheck(&self) -> Container {
5558        let query = self.selection.select("withoutDockerHealthcheck");
5559        Container {
5560            proc: self.proc.clone(),
5561            selection: query,
5562            graphql_client: self.graphql_client.clone(),
5563        }
5564    }
5565    /// Reset the container's OCI entrypoint.
5566    ///
5567    /// # Arguments
5568    ///
5569    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5570    pub fn without_entrypoint(&self) -> Container {
5571        let query = self.selection.select("withoutEntrypoint");
5572        Container {
5573            proc: self.proc.clone(),
5574            selection: query,
5575            graphql_client: self.graphql_client.clone(),
5576        }
5577    }
5578    /// Reset the container's OCI entrypoint.
5579    ///
5580    /// # Arguments
5581    ///
5582    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5583    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
5584        let mut query = self.selection.select("withoutEntrypoint");
5585        if let Some(keep_default_args) = opts.keep_default_args {
5586            query = query.arg("keepDefaultArgs", keep_default_args);
5587        }
5588        Container {
5589            proc: self.proc.clone(),
5590            selection: query,
5591            graphql_client: self.graphql_client.clone(),
5592        }
5593    }
5594    /// Retrieves this container minus the given environment variable.
5595    ///
5596    /// # Arguments
5597    ///
5598    /// * `name` - The name of the environment variable (e.g., "HOST").
5599    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
5600        let mut query = self.selection.select("withoutEnvVariable");
5601        query = query.arg("name", name.into());
5602        Container {
5603            proc: self.proc.clone(),
5604            selection: query,
5605            graphql_client: self.graphql_client.clone(),
5606        }
5607    }
5608    /// Unexpose a previously exposed port.
5609    ///
5610    /// # Arguments
5611    ///
5612    /// * `port` - Port number to unexpose
5613    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5614    pub fn without_exposed_port(&self, port: isize) -> Container {
5615        let mut query = self.selection.select("withoutExposedPort");
5616        query = query.arg("port", port);
5617        Container {
5618            proc: self.proc.clone(),
5619            selection: query,
5620            graphql_client: self.graphql_client.clone(),
5621        }
5622    }
5623    /// Unexpose a previously exposed port.
5624    ///
5625    /// # Arguments
5626    ///
5627    /// * `port` - Port number to unexpose
5628    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5629    pub fn without_exposed_port_opts(
5630        &self,
5631        port: isize,
5632        opts: ContainerWithoutExposedPortOpts,
5633    ) -> Container {
5634        let mut query = self.selection.select("withoutExposedPort");
5635        query = query.arg("port", port);
5636        if let Some(protocol) = opts.protocol {
5637            query = query.arg("protocol", protocol);
5638        }
5639        Container {
5640            proc: self.proc.clone(),
5641            selection: query,
5642            graphql_client: self.graphql_client.clone(),
5643        }
5644    }
5645    /// Retrieves this container with the file at the given path removed.
5646    ///
5647    /// # Arguments
5648    ///
5649    /// * `path` - Location of the file to remove (e.g., "/file.txt").
5650    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5651    pub fn without_file(&self, path: impl Into<String>) -> Container {
5652        let mut query = self.selection.select("withoutFile");
5653        query = query.arg("path", path.into());
5654        Container {
5655            proc: self.proc.clone(),
5656            selection: query,
5657            graphql_client: self.graphql_client.clone(),
5658        }
5659    }
5660    /// Retrieves this container with the file at the given path removed.
5661    ///
5662    /// # Arguments
5663    ///
5664    /// * `path` - Location of the file to remove (e.g., "/file.txt").
5665    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5666    pub fn without_file_opts(
5667        &self,
5668        path: impl Into<String>,
5669        opts: ContainerWithoutFileOpts,
5670    ) -> Container {
5671        let mut query = self.selection.select("withoutFile");
5672        query = query.arg("path", path.into());
5673        if let Some(expand) = opts.expand {
5674            query = query.arg("expand", expand);
5675        }
5676        Container {
5677            proc: self.proc.clone(),
5678            selection: query,
5679            graphql_client: self.graphql_client.clone(),
5680        }
5681    }
5682    /// Return a new container spanshot with specified files removed
5683    ///
5684    /// # Arguments
5685    ///
5686    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
5687    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5688    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
5689        let mut query = self.selection.select("withoutFiles");
5690        query = query.arg(
5691            "paths",
5692            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5693        );
5694        Container {
5695            proc: self.proc.clone(),
5696            selection: query,
5697            graphql_client: self.graphql_client.clone(),
5698        }
5699    }
5700    /// Return a new container spanshot with specified files removed
5701    ///
5702    /// # Arguments
5703    ///
5704    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
5705    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5706    pub fn without_files_opts(
5707        &self,
5708        paths: Vec<impl Into<String>>,
5709        opts: ContainerWithoutFilesOpts,
5710    ) -> Container {
5711        let mut query = self.selection.select("withoutFiles");
5712        query = query.arg(
5713            "paths",
5714            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5715        );
5716        if let Some(expand) = opts.expand {
5717            query = query.arg("expand", expand);
5718        }
5719        Container {
5720            proc: self.proc.clone(),
5721            selection: query,
5722            graphql_client: self.graphql_client.clone(),
5723        }
5724    }
5725    /// Retrieves this container minus the given environment label.
5726    ///
5727    /// # Arguments
5728    ///
5729    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
5730    pub fn without_label(&self, name: impl Into<String>) -> Container {
5731        let mut query = self.selection.select("withoutLabel");
5732        query = query.arg("name", name.into());
5733        Container {
5734            proc: self.proc.clone(),
5735            selection: query,
5736            graphql_client: self.graphql_client.clone(),
5737        }
5738    }
5739    /// Retrieves this container after unmounting everything at the given path.
5740    ///
5741    /// # Arguments
5742    ///
5743    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
5744    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5745    pub fn without_mount(&self, path: impl Into<String>) -> Container {
5746        let mut query = self.selection.select("withoutMount");
5747        query = query.arg("path", path.into());
5748        Container {
5749            proc: self.proc.clone(),
5750            selection: query,
5751            graphql_client: self.graphql_client.clone(),
5752        }
5753    }
5754    /// Retrieves this container after unmounting everything at the given path.
5755    ///
5756    /// # Arguments
5757    ///
5758    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
5759    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5760    pub fn without_mount_opts(
5761        &self,
5762        path: impl Into<String>,
5763        opts: ContainerWithoutMountOpts,
5764    ) -> Container {
5765        let mut query = self.selection.select("withoutMount");
5766        query = query.arg("path", path.into());
5767        if let Some(expand) = opts.expand {
5768            query = query.arg("expand", expand);
5769        }
5770        Container {
5771            proc: self.proc.clone(),
5772            selection: query,
5773            graphql_client: self.graphql_client.clone(),
5774        }
5775    }
5776    /// Retrieves this container without the registry authentication of a given address.
5777    ///
5778    /// # Arguments
5779    ///
5780    /// * `address` - Registry's address to remove the authentication from.
5781    ///
5782    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
5783    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
5784        let mut query = self.selection.select("withoutRegistryAuth");
5785        query = query.arg("address", address.into());
5786        Container {
5787            proc: self.proc.clone(),
5788            selection: query,
5789            graphql_client: self.graphql_client.clone(),
5790        }
5791    }
5792    /// Retrieves this container minus the given environment variable containing the secret.
5793    ///
5794    /// # Arguments
5795    ///
5796    /// * `name` - The name of the environment variable (e.g., "HOST").
5797    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
5798        let mut query = self.selection.select("withoutSecretVariable");
5799        query = query.arg("name", name.into());
5800        Container {
5801            proc: self.proc.clone(),
5802            selection: query,
5803            graphql_client: self.graphql_client.clone(),
5804        }
5805    }
5806    /// Retrieves this container with a previously added Unix socket removed.
5807    ///
5808    /// # Arguments
5809    ///
5810    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
5811    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5812    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
5813        let mut query = self.selection.select("withoutUnixSocket");
5814        query = query.arg("path", path.into());
5815        Container {
5816            proc: self.proc.clone(),
5817            selection: query,
5818            graphql_client: self.graphql_client.clone(),
5819        }
5820    }
5821    /// Retrieves this container with a previously added Unix socket removed.
5822    ///
5823    /// # Arguments
5824    ///
5825    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
5826    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5827    pub fn without_unix_socket_opts(
5828        &self,
5829        path: impl Into<String>,
5830        opts: ContainerWithoutUnixSocketOpts,
5831    ) -> Container {
5832        let mut query = self.selection.select("withoutUnixSocket");
5833        query = query.arg("path", path.into());
5834        if let Some(expand) = opts.expand {
5835            query = query.arg("expand", expand);
5836        }
5837        Container {
5838            proc: self.proc.clone(),
5839            selection: query,
5840            graphql_client: self.graphql_client.clone(),
5841        }
5842    }
5843    /// Retrieves this container with an unset command user.
5844    /// Should default to root.
5845    pub fn without_user(&self) -> Container {
5846        let query = self.selection.select("withoutUser");
5847        Container {
5848            proc: self.proc.clone(),
5849            selection: query,
5850            graphql_client: self.graphql_client.clone(),
5851        }
5852    }
5853    /// Unset the container's working directory.
5854    /// Should default to "/".
5855    pub fn without_workdir(&self) -> Container {
5856        let query = self.selection.select("withoutWorkdir");
5857        Container {
5858            proc: self.proc.clone(),
5859            selection: query,
5860            graphql_client: self.graphql_client.clone(),
5861        }
5862    }
5863    /// Retrieves the working directory for all commands.
5864    pub async fn workdir(&self) -> Result<String, DaggerError> {
5865        let query = self.selection.select("workdir");
5866        query.execute(self.graphql_client.clone()).await
5867    }
5868}
5869#[derive(Clone)]
5870pub struct CurrentModule {
5871    pub proc: Option<Arc<DaggerSessionProc>>,
5872    pub selection: Selection,
5873    pub graphql_client: DynGraphQLClient,
5874}
5875#[derive(Builder, Debug, PartialEq)]
5876pub struct CurrentModuleGeneratorsOpts<'a> {
5877    /// Only include generators matching the specified patterns
5878    #[builder(setter(into, strip_option), default)]
5879    pub include: Option<Vec<&'a str>>,
5880}
5881#[derive(Builder, Debug, PartialEq)]
5882pub struct CurrentModuleWorkdirOpts<'a> {
5883    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
5884    #[builder(setter(into, strip_option), default)]
5885    pub exclude: Option<Vec<&'a str>>,
5886    /// Apply .gitignore filter rules inside the directory
5887    #[builder(setter(into, strip_option), default)]
5888    pub gitignore: Option<bool>,
5889    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
5890    #[builder(setter(into, strip_option), default)]
5891    pub include: Option<Vec<&'a str>>,
5892}
5893impl CurrentModule {
5894    /// The dependencies of the module.
5895    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
5896        let query = self.selection.select("dependencies");
5897        let query = query.select("id");
5898        let ids: Vec<ModuleId> = query.execute(self.graphql_client.clone()).await?;
5899        let root = Query {
5900            proc: self.proc.clone(),
5901            selection: crate::querybuilder::query(),
5902            graphql_client: self.graphql_client.clone(),
5903        };
5904        Ok(ids
5905            .into_iter()
5906            .map(|id| root.load_module_from_id(id))
5907            .collect())
5908    }
5909    /// The generated files and directories made on top of the module source's context directory.
5910    pub fn generated_context_directory(&self) -> Directory {
5911        let query = self.selection.select("generatedContextDirectory");
5912        Directory {
5913            proc: self.proc.clone(),
5914            selection: query,
5915            graphql_client: self.graphql_client.clone(),
5916        }
5917    }
5918    /// Return all generators defined by the module
5919    ///
5920    /// # Arguments
5921    ///
5922    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5923    pub fn generators(&self) -> GeneratorGroup {
5924        let query = self.selection.select("generators");
5925        GeneratorGroup {
5926            proc: self.proc.clone(),
5927            selection: query,
5928            graphql_client: self.graphql_client.clone(),
5929        }
5930    }
5931    /// Return all generators defined by the module
5932    ///
5933    /// # Arguments
5934    ///
5935    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5936    pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
5937        let mut query = self.selection.select("generators");
5938        if let Some(include) = opts.include {
5939            query = query.arg("include", include);
5940        }
5941        GeneratorGroup {
5942            proc: self.proc.clone(),
5943            selection: query,
5944            graphql_client: self.graphql_client.clone(),
5945        }
5946    }
5947    /// A unique identifier for this CurrentModule.
5948    pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
5949        let query = self.selection.select("id");
5950        query.execute(self.graphql_client.clone()).await
5951    }
5952    /// The name of the module being executed in
5953    pub async fn name(&self) -> Result<String, DaggerError> {
5954        let query = self.selection.select("name");
5955        query.execute(self.graphql_client.clone()).await
5956    }
5957    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
5958    pub fn source(&self) -> Directory {
5959        let query = self.selection.select("source");
5960        Directory {
5961            proc: self.proc.clone(),
5962            selection: query,
5963            graphql_client: self.graphql_client.clone(),
5964        }
5965    }
5966    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
5967    ///
5968    /// # Arguments
5969    ///
5970    /// * `path` - Location of the directory to access (e.g., ".").
5971    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5972    pub fn workdir(&self, path: impl Into<String>) -> Directory {
5973        let mut query = self.selection.select("workdir");
5974        query = query.arg("path", path.into());
5975        Directory {
5976            proc: self.proc.clone(),
5977            selection: query,
5978            graphql_client: self.graphql_client.clone(),
5979        }
5980    }
5981    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
5982    ///
5983    /// # Arguments
5984    ///
5985    /// * `path` - Location of the directory to access (e.g., ".").
5986    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5987    pub fn workdir_opts<'a>(
5988        &self,
5989        path: impl Into<String>,
5990        opts: CurrentModuleWorkdirOpts<'a>,
5991    ) -> Directory {
5992        let mut query = self.selection.select("workdir");
5993        query = query.arg("path", path.into());
5994        if let Some(exclude) = opts.exclude {
5995            query = query.arg("exclude", exclude);
5996        }
5997        if let Some(include) = opts.include {
5998            query = query.arg("include", include);
5999        }
6000        if let Some(gitignore) = opts.gitignore {
6001            query = query.arg("gitignore", gitignore);
6002        }
6003        Directory {
6004            proc: self.proc.clone(),
6005            selection: query,
6006            graphql_client: self.graphql_client.clone(),
6007        }
6008    }
6009    /// 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.
6010    ///
6011    /// # Arguments
6012    ///
6013    /// * `path` - Location of the file to retrieve (e.g., "README.md").
6014    pub fn workdir_file(&self, path: impl Into<String>) -> File {
6015        let mut query = self.selection.select("workdirFile");
6016        query = query.arg("path", path.into());
6017        File {
6018            proc: self.proc.clone(),
6019            selection: query,
6020            graphql_client: self.graphql_client.clone(),
6021        }
6022    }
6023}
6024#[derive(Clone)]
6025pub struct DiffStat {
6026    pub proc: Option<Arc<DaggerSessionProc>>,
6027    pub selection: Selection,
6028    pub graphql_client: DynGraphQLClient,
6029}
6030impl DiffStat {
6031    /// Number of added lines for this path.
6032    pub async fn added_lines(&self) -> Result<isize, DaggerError> {
6033        let query = self.selection.select("addedLines");
6034        query.execute(self.graphql_client.clone()).await
6035    }
6036    /// A unique identifier for this DiffStat.
6037    pub async fn id(&self) -> Result<DiffStatId, DaggerError> {
6038        let query = self.selection.select("id");
6039        query.execute(self.graphql_client.clone()).await
6040    }
6041    /// Type of change.
6042    pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
6043        let query = self.selection.select("kind");
6044        query.execute(self.graphql_client.clone()).await
6045    }
6046    /// Previous path of the file, set only for renames.
6047    pub async fn old_path(&self) -> Result<String, DaggerError> {
6048        let query = self.selection.select("oldPath");
6049        query.execute(self.graphql_client.clone()).await
6050    }
6051    /// Path of the changed file or directory.
6052    pub async fn path(&self) -> Result<String, DaggerError> {
6053        let query = self.selection.select("path");
6054        query.execute(self.graphql_client.clone()).await
6055    }
6056    /// Number of removed lines for this path.
6057    pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
6058        let query = self.selection.select("removedLines");
6059        query.execute(self.graphql_client.clone()).await
6060    }
6061}
6062#[derive(Clone)]
6063pub struct Directory {
6064    pub proc: Option<Arc<DaggerSessionProc>>,
6065    pub selection: Selection,
6066    pub graphql_client: DynGraphQLClient,
6067}
6068#[derive(Builder, Debug, PartialEq)]
6069pub struct DirectoryAsModuleOpts<'a> {
6070    /// An optional subpath of the directory which contains the module's configuration file.
6071    /// If not set, the module source code is loaded from the root of the directory.
6072    #[builder(setter(into, strip_option), default)]
6073    pub source_root_path: Option<&'a str>,
6074}
6075#[derive(Builder, Debug, PartialEq)]
6076pub struct DirectoryAsModuleSourceOpts<'a> {
6077    /// An optional subpath of the directory which contains the module's configuration file.
6078    /// If not set, the module source code is loaded from the root of the directory.
6079    #[builder(setter(into, strip_option), default)]
6080    pub source_root_path: Option<&'a str>,
6081}
6082#[derive(Builder, Debug, PartialEq)]
6083pub struct DirectoryDockerBuildOpts<'a> {
6084    /// Build arguments to use in the build.
6085    #[builder(setter(into, strip_option), default)]
6086    pub build_args: Option<Vec<BuildArg>>,
6087    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
6088    #[builder(setter(into, strip_option), default)]
6089    pub dockerfile: Option<&'a str>,
6090    /// If set, skip the automatic init process injected into containers created by RUN statements.
6091    /// 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.
6092    #[builder(setter(into, strip_option), default)]
6093    pub no_init: Option<bool>,
6094    /// The platform to build.
6095    #[builder(setter(into, strip_option), default)]
6096    pub platform: Option<Platform>,
6097    /// Secrets to pass to the build.
6098    /// They will be mounted at /run/secrets/[secret-name].
6099    #[builder(setter(into, strip_option), default)]
6100    pub secrets: Option<Vec<SecretId>>,
6101    /// A socket to use for SSH authentication during the build
6102    /// (e.g., for Dockerfile RUN --mount=type=ssh instructions).
6103    /// Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
6104    #[builder(setter(into, strip_option), default)]
6105    pub ssh: Option<SocketId>,
6106    /// Target build stage to build.
6107    #[builder(setter(into, strip_option), default)]
6108    pub target: Option<&'a str>,
6109}
6110#[derive(Builder, Debug, PartialEq)]
6111pub struct DirectoryEntriesOpts<'a> {
6112    /// Location of the directory to look at (e.g., "/src").
6113    #[builder(setter(into, strip_option), default)]
6114    pub path: Option<&'a str>,
6115}
6116#[derive(Builder, Debug, PartialEq)]
6117pub struct DirectoryExistsOpts {
6118    /// If specified, do not follow symlinks.
6119    #[builder(setter(into, strip_option), default)]
6120    pub do_not_follow_symlinks: Option<bool>,
6121    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
6122    #[builder(setter(into, strip_option), default)]
6123    pub expected_type: Option<ExistsType>,
6124}
6125#[derive(Builder, Debug, PartialEq)]
6126pub struct DirectoryExportOpts {
6127    /// 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.
6128    #[builder(setter(into, strip_option), default)]
6129    pub wipe: Option<bool>,
6130}
6131#[derive(Builder, Debug, PartialEq)]
6132pub struct DirectoryFilterOpts<'a> {
6133    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
6134    #[builder(setter(into, strip_option), default)]
6135    pub exclude: Option<Vec<&'a str>>,
6136    /// If set, apply .gitignore rules when filtering the directory.
6137    #[builder(setter(into, strip_option), default)]
6138    pub gitignore: Option<bool>,
6139    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
6140    #[builder(setter(into, strip_option), default)]
6141    pub include: Option<Vec<&'a str>>,
6142}
6143#[derive(Builder, Debug, PartialEq)]
6144pub struct DirectorySearchOpts<'a> {
6145    /// Allow the . pattern to match newlines in multiline mode.
6146    #[builder(setter(into, strip_option), default)]
6147    pub dotall: Option<bool>,
6148    /// Only return matching files, not lines and content
6149    #[builder(setter(into, strip_option), default)]
6150    pub files_only: Option<bool>,
6151    /// Glob patterns to match (e.g., "*.md")
6152    #[builder(setter(into, strip_option), default)]
6153    pub globs: Option<Vec<&'a str>>,
6154    /// Enable case-insensitive matching.
6155    #[builder(setter(into, strip_option), default)]
6156    pub insensitive: Option<bool>,
6157    /// Limit the number of results to return
6158    #[builder(setter(into, strip_option), default)]
6159    pub limit: Option<isize>,
6160    /// Interpret the pattern as a literal string instead of a regular expression.
6161    #[builder(setter(into, strip_option), default)]
6162    pub literal: Option<bool>,
6163    /// Enable searching across multiple lines.
6164    #[builder(setter(into, strip_option), default)]
6165    pub multiline: Option<bool>,
6166    /// Directory or file paths to search
6167    #[builder(setter(into, strip_option), default)]
6168    pub paths: Option<Vec<&'a str>>,
6169    /// Skip hidden files (files starting with .).
6170    #[builder(setter(into, strip_option), default)]
6171    pub skip_hidden: Option<bool>,
6172    /// Honor .gitignore, .ignore, and .rgignore files.
6173    #[builder(setter(into, strip_option), default)]
6174    pub skip_ignored: Option<bool>,
6175}
6176#[derive(Builder, Debug, PartialEq)]
6177pub struct DirectoryStatOpts {
6178    /// If specified, do not follow symlinks.
6179    #[builder(setter(into, strip_option), default)]
6180    pub do_not_follow_symlinks: Option<bool>,
6181}
6182#[derive(Builder, Debug, PartialEq)]
6183pub struct DirectoryTerminalOpts<'a> {
6184    /// If set, override the container's default terminal command and invoke these command arguments instead.
6185    #[builder(setter(into, strip_option), default)]
6186    pub cmd: Option<Vec<&'a str>>,
6187    /// If set, override the default container used for the terminal.
6188    #[builder(setter(into, strip_option), default)]
6189    pub container: Option<ContainerId>,
6190    /// Provides Dagger access to the executed command.
6191    #[builder(setter(into, strip_option), default)]
6192    pub experimental_privileged_nesting: Option<bool>,
6193    /// 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.
6194    #[builder(setter(into, strip_option), default)]
6195    pub insecure_root_capabilities: Option<bool>,
6196}
6197#[derive(Builder, Debug, PartialEq)]
6198pub struct DirectoryWithDirectoryOpts<'a> {
6199    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
6200    #[builder(setter(into, strip_option), default)]
6201    pub exclude: Option<Vec<&'a str>>,
6202    /// Apply .gitignore filter rules inside the directory
6203    #[builder(setter(into, strip_option), default)]
6204    pub gitignore: Option<bool>,
6205    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
6206    #[builder(setter(into, strip_option), default)]
6207    pub include: Option<Vec<&'a str>>,
6208    /// A user:group to set for the copied directory and its contents.
6209    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
6210    /// If the group is omitted, it defaults to the same as the user.
6211    #[builder(setter(into, strip_option), default)]
6212    pub owner: Option<&'a str>,
6213    /// Permission given to the copied directory and contents (e.g., 0755).
6214    #[builder(setter(into, strip_option), default)]
6215    pub permissions: Option<isize>,
6216}
6217#[derive(Builder, Debug, PartialEq)]
6218pub struct DirectoryWithFileOpts<'a> {
6219    /// A user:group to set for the copied directory and its contents.
6220    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
6221    /// If the group is omitted, it defaults to the same as the user.
6222    #[builder(setter(into, strip_option), default)]
6223    pub owner: Option<&'a str>,
6224    /// Permission given to the copied file (e.g., 0600).
6225    #[builder(setter(into, strip_option), default)]
6226    pub permissions: Option<isize>,
6227}
6228#[derive(Builder, Debug, PartialEq)]
6229pub struct DirectoryWithFilesOpts {
6230    /// Permission given to the copied files (e.g., 0600).
6231    #[builder(setter(into, strip_option), default)]
6232    pub permissions: Option<isize>,
6233}
6234#[derive(Builder, Debug, PartialEq)]
6235pub struct DirectoryWithNewDirectoryOpts {
6236    /// Permission granted to the created directory (e.g., 0777).
6237    #[builder(setter(into, strip_option), default)]
6238    pub permissions: Option<isize>,
6239}
6240#[derive(Builder, Debug, PartialEq)]
6241pub struct DirectoryWithNewFileOpts {
6242    /// Permissions of the new file. Example: 0600
6243    #[builder(setter(into, strip_option), default)]
6244    pub permissions: Option<isize>,
6245}
6246impl Directory {
6247    /// Converts this directory to a local git repository
6248    pub fn as_git(&self) -> GitRepository {
6249        let query = self.selection.select("asGit");
6250        GitRepository {
6251            proc: self.proc.clone(),
6252            selection: query,
6253            graphql_client: self.graphql_client.clone(),
6254        }
6255    }
6256    /// Load the directory as a Dagger module source
6257    ///
6258    /// # Arguments
6259    ///
6260    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6261    pub fn as_module(&self) -> Module {
6262        let query = self.selection.select("asModule");
6263        Module {
6264            proc: self.proc.clone(),
6265            selection: query,
6266            graphql_client: self.graphql_client.clone(),
6267        }
6268    }
6269    /// Load the directory as a Dagger module source
6270    ///
6271    /// # Arguments
6272    ///
6273    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6274    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
6275        let mut query = self.selection.select("asModule");
6276        if let Some(source_root_path) = opts.source_root_path {
6277            query = query.arg("sourceRootPath", source_root_path);
6278        }
6279        Module {
6280            proc: self.proc.clone(),
6281            selection: query,
6282            graphql_client: self.graphql_client.clone(),
6283        }
6284    }
6285    /// Load the directory as a Dagger module source
6286    ///
6287    /// # Arguments
6288    ///
6289    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6290    pub fn as_module_source(&self) -> ModuleSource {
6291        let query = self.selection.select("asModuleSource");
6292        ModuleSource {
6293            proc: self.proc.clone(),
6294            selection: query,
6295            graphql_client: self.graphql_client.clone(),
6296        }
6297    }
6298    /// Load the directory as a Dagger module source
6299    ///
6300    /// # Arguments
6301    ///
6302    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6303    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
6304        let mut query = self.selection.select("asModuleSource");
6305        if let Some(source_root_path) = opts.source_root_path {
6306            query = query.arg("sourceRootPath", source_root_path);
6307        }
6308        ModuleSource {
6309            proc: self.proc.clone(),
6310            selection: query,
6311            graphql_client: self.graphql_client.clone(),
6312        }
6313    }
6314    /// Return the difference between this directory and another directory, typically an older snapshot.
6315    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
6316    ///
6317    /// # Arguments
6318    ///
6319    /// * `from` - The base directory snapshot to compare against
6320    pub fn changes(&self, from: impl IntoID<DirectoryId>) -> Changeset {
6321        let mut query = self.selection.select("changes");
6322        query = query.arg_lazy(
6323            "from",
6324            Box::new(move || {
6325                let from = from.clone();
6326                Box::pin(async move { from.into_id().await.unwrap().quote() })
6327            }),
6328        );
6329        Changeset {
6330            proc: self.proc.clone(),
6331            selection: query,
6332            graphql_client: self.graphql_client.clone(),
6333        }
6334    }
6335    /// Change the owner of the directory contents recursively.
6336    ///
6337    /// # Arguments
6338    ///
6339    /// * `path` - Path of the directory to change ownership of (e.g., "/").
6340    /// * `owner` - A user:group to set for the mounted directory and its contents.
6341    ///
6342    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
6343    ///
6344    /// If the group is omitted, it defaults to the same as the user.
6345    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
6346        let mut query = self.selection.select("chown");
6347        query = query.arg("path", path.into());
6348        query = query.arg("owner", owner.into());
6349        Directory {
6350            proc: self.proc.clone(),
6351            selection: query,
6352            graphql_client: self.graphql_client.clone(),
6353        }
6354    }
6355    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
6356    ///
6357    /// # Arguments
6358    ///
6359    /// * `other` - The directory to compare against
6360    pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
6361        let mut query = self.selection.select("diff");
6362        query = query.arg_lazy(
6363            "other",
6364            Box::new(move || {
6365                let other = other.clone();
6366                Box::pin(async move { other.into_id().await.unwrap().quote() })
6367            }),
6368        );
6369        Directory {
6370            proc: self.proc.clone(),
6371            selection: query,
6372            graphql_client: self.graphql_client.clone(),
6373        }
6374    }
6375    /// 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.
6376    pub async fn digest(&self) -> Result<String, DaggerError> {
6377        let query = self.selection.select("digest");
6378        query.execute(self.graphql_client.clone()).await
6379    }
6380    /// Retrieves a directory at the given path.
6381    ///
6382    /// # Arguments
6383    ///
6384    /// * `path` - Location of the directory to retrieve. Example: "/src"
6385    pub fn directory(&self, path: impl Into<String>) -> Directory {
6386        let mut query = self.selection.select("directory");
6387        query = query.arg("path", path.into());
6388        Directory {
6389            proc: self.proc.clone(),
6390            selection: query,
6391            graphql_client: self.graphql_client.clone(),
6392        }
6393    }
6394    /// 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.
6395    ///
6396    /// # Arguments
6397    ///
6398    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6399    pub fn docker_build(&self) -> Container {
6400        let query = self.selection.select("dockerBuild");
6401        Container {
6402            proc: self.proc.clone(),
6403            selection: query,
6404            graphql_client: self.graphql_client.clone(),
6405        }
6406    }
6407    /// 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.
6408    ///
6409    /// # Arguments
6410    ///
6411    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6412    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
6413        let mut query = self.selection.select("dockerBuild");
6414        if let Some(dockerfile) = opts.dockerfile {
6415            query = query.arg("dockerfile", dockerfile);
6416        }
6417        if let Some(platform) = opts.platform {
6418            query = query.arg("platform", platform);
6419        }
6420        if let Some(build_args) = opts.build_args {
6421            query = query.arg("buildArgs", build_args);
6422        }
6423        if let Some(target) = opts.target {
6424            query = query.arg("target", target);
6425        }
6426        if let Some(secrets) = opts.secrets {
6427            query = query.arg("secrets", secrets);
6428        }
6429        if let Some(no_init) = opts.no_init {
6430            query = query.arg("noInit", no_init);
6431        }
6432        if let Some(ssh) = opts.ssh {
6433            query = query.arg("ssh", ssh);
6434        }
6435        Container {
6436            proc: self.proc.clone(),
6437            selection: query,
6438            graphql_client: self.graphql_client.clone(),
6439        }
6440    }
6441    /// Returns a list of files and directories at the given path.
6442    ///
6443    /// # Arguments
6444    ///
6445    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6446    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
6447        let query = self.selection.select("entries");
6448        query.execute(self.graphql_client.clone()).await
6449    }
6450    /// Returns a list of files and directories at the given path.
6451    ///
6452    /// # Arguments
6453    ///
6454    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6455    pub async fn entries_opts<'a>(
6456        &self,
6457        opts: DirectoryEntriesOpts<'a>,
6458    ) -> Result<Vec<String>, DaggerError> {
6459        let mut query = self.selection.select("entries");
6460        if let Some(path) = opts.path {
6461            query = query.arg("path", path);
6462        }
6463        query.execute(self.graphql_client.clone()).await
6464    }
6465    /// check if a file or directory exists
6466    ///
6467    /// # Arguments
6468    ///
6469    /// * `path` - Path to check (e.g., "/file.txt").
6470    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6471    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
6472        let mut query = self.selection.select("exists");
6473        query = query.arg("path", path.into());
6474        query.execute(self.graphql_client.clone()).await
6475    }
6476    /// check if a file or directory exists
6477    ///
6478    /// # Arguments
6479    ///
6480    /// * `path` - Path to check (e.g., "/file.txt").
6481    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6482    pub async fn exists_opts(
6483        &self,
6484        path: impl Into<String>,
6485        opts: DirectoryExistsOpts,
6486    ) -> Result<bool, DaggerError> {
6487        let mut query = self.selection.select("exists");
6488        query = query.arg("path", path.into());
6489        if let Some(expected_type) = opts.expected_type {
6490            query = query.arg("expectedType", expected_type);
6491        }
6492        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
6493            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
6494        }
6495        query.execute(self.graphql_client.clone()).await
6496    }
6497    /// Writes the contents of the directory to a path on the host.
6498    ///
6499    /// # Arguments
6500    ///
6501    /// * `path` - Location of the copied directory (e.g., "logs/").
6502    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6503    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
6504        let mut query = self.selection.select("export");
6505        query = query.arg("path", path.into());
6506        query.execute(self.graphql_client.clone()).await
6507    }
6508    /// Writes the contents of the directory to a path on the host.
6509    ///
6510    /// # Arguments
6511    ///
6512    /// * `path` - Location of the copied directory (e.g., "logs/").
6513    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6514    pub async fn export_opts(
6515        &self,
6516        path: impl Into<String>,
6517        opts: DirectoryExportOpts,
6518    ) -> Result<String, DaggerError> {
6519        let mut query = self.selection.select("export");
6520        query = query.arg("path", path.into());
6521        if let Some(wipe) = opts.wipe {
6522            query = query.arg("wipe", wipe);
6523        }
6524        query.execute(self.graphql_client.clone()).await
6525    }
6526    /// Retrieve a file at the given path.
6527    ///
6528    /// # Arguments
6529    ///
6530    /// * `path` - Location of the file to retrieve (e.g., "README.md").
6531    pub fn file(&self, path: impl Into<String>) -> File {
6532        let mut query = self.selection.select("file");
6533        query = query.arg("path", path.into());
6534        File {
6535            proc: self.proc.clone(),
6536            selection: query,
6537            graphql_client: self.graphql_client.clone(),
6538        }
6539    }
6540    /// Return a snapshot with some paths included or excluded
6541    ///
6542    /// # Arguments
6543    ///
6544    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6545    pub fn filter(&self) -> Directory {
6546        let query = self.selection.select("filter");
6547        Directory {
6548            proc: self.proc.clone(),
6549            selection: query,
6550            graphql_client: self.graphql_client.clone(),
6551        }
6552    }
6553    /// Return a snapshot with some paths included or excluded
6554    ///
6555    /// # Arguments
6556    ///
6557    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6558    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
6559        let mut query = self.selection.select("filter");
6560        if let Some(exclude) = opts.exclude {
6561            query = query.arg("exclude", exclude);
6562        }
6563        if let Some(include) = opts.include {
6564            query = query.arg("include", include);
6565        }
6566        if let Some(gitignore) = opts.gitignore {
6567            query = query.arg("gitignore", gitignore);
6568        }
6569        Directory {
6570            proc: self.proc.clone(),
6571            selection: query,
6572            graphql_client: self.graphql_client.clone(),
6573        }
6574    }
6575    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
6576    ///
6577    /// # Arguments
6578    ///
6579    /// * `name` - The name of the file or directory to search for
6580    /// * `start` - The path to start the search from
6581    pub async fn find_up(
6582        &self,
6583        name: impl Into<String>,
6584        start: impl Into<String>,
6585    ) -> Result<String, DaggerError> {
6586        let mut query = self.selection.select("findUp");
6587        query = query.arg("name", name.into());
6588        query = query.arg("start", start.into());
6589        query.execute(self.graphql_client.clone()).await
6590    }
6591    /// Returns a list of files and directories that matche the given pattern.
6592    ///
6593    /// # Arguments
6594    ///
6595    /// * `pattern` - Pattern to match (e.g., "*.md").
6596    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
6597        let mut query = self.selection.select("glob");
6598        query = query.arg("pattern", pattern.into());
6599        query.execute(self.graphql_client.clone()).await
6600    }
6601    /// A unique identifier for this Directory.
6602    pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
6603        let query = self.selection.select("id");
6604        query.execute(self.graphql_client.clone()).await
6605    }
6606    /// Returns the name of the directory.
6607    pub async fn name(&self) -> Result<String, DaggerError> {
6608        let query = self.selection.select("name");
6609        query.execute(self.graphql_client.clone()).await
6610    }
6611    /// Searches for content matching the given regular expression or literal string.
6612    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6613    ///
6614    /// # Arguments
6615    ///
6616    /// * `pattern` - The text to match.
6617    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6618    pub async fn search(
6619        &self,
6620        pattern: impl Into<String>,
6621    ) -> Result<Vec<SearchResult>, DaggerError> {
6622        let mut query = self.selection.select("search");
6623        query = query.arg("pattern", pattern.into());
6624        let query = query.select("id");
6625        let ids: Vec<SearchResultId> = query.execute(self.graphql_client.clone()).await?;
6626        let root = Query {
6627            proc: self.proc.clone(),
6628            selection: crate::querybuilder::query(),
6629            graphql_client: self.graphql_client.clone(),
6630        };
6631        Ok(ids
6632            .into_iter()
6633            .map(|id| root.load_search_result_from_id(id))
6634            .collect())
6635    }
6636    /// Searches for content matching the given regular expression or literal string.
6637    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6638    ///
6639    /// # Arguments
6640    ///
6641    /// * `pattern` - The text to match.
6642    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6643    pub async fn search_opts<'a>(
6644        &self,
6645        pattern: impl Into<String>,
6646        opts: DirectorySearchOpts<'a>,
6647    ) -> Result<Vec<SearchResult>, DaggerError> {
6648        let mut query = self.selection.select("search");
6649        query = query.arg("pattern", pattern.into());
6650        if let Some(paths) = opts.paths {
6651            query = query.arg("paths", paths);
6652        }
6653        if let Some(globs) = opts.globs {
6654            query = query.arg("globs", globs);
6655        }
6656        if let Some(literal) = opts.literal {
6657            query = query.arg("literal", literal);
6658        }
6659        if let Some(multiline) = opts.multiline {
6660            query = query.arg("multiline", multiline);
6661        }
6662        if let Some(dotall) = opts.dotall {
6663            query = query.arg("dotall", dotall);
6664        }
6665        if let Some(insensitive) = opts.insensitive {
6666            query = query.arg("insensitive", insensitive);
6667        }
6668        if let Some(skip_ignored) = opts.skip_ignored {
6669            query = query.arg("skipIgnored", skip_ignored);
6670        }
6671        if let Some(skip_hidden) = opts.skip_hidden {
6672            query = query.arg("skipHidden", skip_hidden);
6673        }
6674        if let Some(files_only) = opts.files_only {
6675            query = query.arg("filesOnly", files_only);
6676        }
6677        if let Some(limit) = opts.limit {
6678            query = query.arg("limit", limit);
6679        }
6680        let query = query.select("id");
6681        let ids: Vec<SearchResultId> = query.execute(self.graphql_client.clone()).await?;
6682        let root = Query {
6683            proc: self.proc.clone(),
6684            selection: crate::querybuilder::query(),
6685            graphql_client: self.graphql_client.clone(),
6686        };
6687        Ok(ids
6688            .into_iter()
6689            .map(|id| root.load_search_result_from_id(id))
6690            .collect())
6691    }
6692    /// Return file status
6693    ///
6694    /// # Arguments
6695    ///
6696    /// * `path` - Path to stat (e.g., "/file.txt").
6697    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6698    pub fn stat(&self, path: impl Into<String>) -> Stat {
6699        let mut query = self.selection.select("stat");
6700        query = query.arg("path", path.into());
6701        Stat {
6702            proc: self.proc.clone(),
6703            selection: query,
6704            graphql_client: self.graphql_client.clone(),
6705        }
6706    }
6707    /// Return file status
6708    ///
6709    /// # Arguments
6710    ///
6711    /// * `path` - Path to stat (e.g., "/file.txt").
6712    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6713    pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
6714        let mut query = self.selection.select("stat");
6715        query = query.arg("path", path.into());
6716        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
6717            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
6718        }
6719        Stat {
6720            proc: self.proc.clone(),
6721            selection: query,
6722            graphql_client: self.graphql_client.clone(),
6723        }
6724    }
6725    /// Force evaluation in the engine.
6726    pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
6727        let query = self.selection.select("sync");
6728        query.execute(self.graphql_client.clone()).await
6729    }
6730    /// Opens an interactive terminal in new container with this directory mounted inside.
6731    ///
6732    /// # Arguments
6733    ///
6734    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6735    pub fn terminal(&self) -> Directory {
6736        let query = self.selection.select("terminal");
6737        Directory {
6738            proc: self.proc.clone(),
6739            selection: query,
6740            graphql_client: self.graphql_client.clone(),
6741        }
6742    }
6743    /// Opens an interactive terminal in new container with this directory mounted inside.
6744    ///
6745    /// # Arguments
6746    ///
6747    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6748    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
6749        let mut query = self.selection.select("terminal");
6750        if let Some(container) = opts.container {
6751            query = query.arg("container", container);
6752        }
6753        if let Some(cmd) = opts.cmd {
6754            query = query.arg("cmd", cmd);
6755        }
6756        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6757            query = query.arg(
6758                "experimentalPrivilegedNesting",
6759                experimental_privileged_nesting,
6760            );
6761        }
6762        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6763            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6764        }
6765        Directory {
6766            proc: self.proc.clone(),
6767            selection: query,
6768            graphql_client: self.graphql_client.clone(),
6769        }
6770    }
6771    /// Return a directory with changes from another directory applied to it.
6772    ///
6773    /// # Arguments
6774    ///
6775    /// * `changes` - Changes to apply to the directory
6776    pub fn with_changes(&self, changes: impl IntoID<ChangesetId>) -> Directory {
6777        let mut query = self.selection.select("withChanges");
6778        query = query.arg_lazy(
6779            "changes",
6780            Box::new(move || {
6781                let changes = changes.clone();
6782                Box::pin(async move { changes.into_id().await.unwrap().quote() })
6783            }),
6784        );
6785        Directory {
6786            proc: self.proc.clone(),
6787            selection: query,
6788            graphql_client: self.graphql_client.clone(),
6789        }
6790    }
6791    /// Return a snapshot with a directory added
6792    ///
6793    /// # Arguments
6794    ///
6795    /// * `path` - Location of the written directory (e.g., "/src/").
6796    /// * `source` - Identifier of the directory to copy.
6797    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6798    pub fn with_directory(
6799        &self,
6800        path: impl Into<String>,
6801        source: impl IntoID<DirectoryId>,
6802    ) -> Directory {
6803        let mut query = self.selection.select("withDirectory");
6804        query = query.arg("path", path.into());
6805        query = query.arg_lazy(
6806            "source",
6807            Box::new(move || {
6808                let source = source.clone();
6809                Box::pin(async move { source.into_id().await.unwrap().quote() })
6810            }),
6811        );
6812        Directory {
6813            proc: self.proc.clone(),
6814            selection: query,
6815            graphql_client: self.graphql_client.clone(),
6816        }
6817    }
6818    /// Return a snapshot with a directory added
6819    ///
6820    /// # Arguments
6821    ///
6822    /// * `path` - Location of the written directory (e.g., "/src/").
6823    /// * `source` - Identifier of the directory to copy.
6824    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6825    pub fn with_directory_opts<'a>(
6826        &self,
6827        path: impl Into<String>,
6828        source: impl IntoID<DirectoryId>,
6829        opts: DirectoryWithDirectoryOpts<'a>,
6830    ) -> Directory {
6831        let mut query = self.selection.select("withDirectory");
6832        query = query.arg("path", path.into());
6833        query = query.arg_lazy(
6834            "source",
6835            Box::new(move || {
6836                let source = source.clone();
6837                Box::pin(async move { source.into_id().await.unwrap().quote() })
6838            }),
6839        );
6840        if let Some(exclude) = opts.exclude {
6841            query = query.arg("exclude", exclude);
6842        }
6843        if let Some(include) = opts.include {
6844            query = query.arg("include", include);
6845        }
6846        if let Some(gitignore) = opts.gitignore {
6847            query = query.arg("gitignore", gitignore);
6848        }
6849        if let Some(owner) = opts.owner {
6850            query = query.arg("owner", owner);
6851        }
6852        if let Some(permissions) = opts.permissions {
6853            query = query.arg("permissions", permissions);
6854        }
6855        Directory {
6856            proc: self.proc.clone(),
6857            selection: query,
6858            graphql_client: self.graphql_client.clone(),
6859        }
6860    }
6861    /// Raise an error.
6862    ///
6863    /// # Arguments
6864    ///
6865    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
6866    pub fn with_error(&self, err: impl Into<String>) -> Directory {
6867        let mut query = self.selection.select("withError");
6868        query = query.arg("err", err.into());
6869        Directory {
6870            proc: self.proc.clone(),
6871            selection: query,
6872            graphql_client: self.graphql_client.clone(),
6873        }
6874    }
6875    /// Retrieves this directory plus the contents of the given file copied to the given path.
6876    ///
6877    /// # Arguments
6878    ///
6879    /// * `path` - Location of the copied file (e.g., "/file.txt").
6880    /// * `source` - Identifier of the file to copy.
6881    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6882    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
6883        let mut query = self.selection.select("withFile");
6884        query = query.arg("path", path.into());
6885        query = query.arg_lazy(
6886            "source",
6887            Box::new(move || {
6888                let source = source.clone();
6889                Box::pin(async move { source.into_id().await.unwrap().quote() })
6890            }),
6891        );
6892        Directory {
6893            proc: self.proc.clone(),
6894            selection: query,
6895            graphql_client: self.graphql_client.clone(),
6896        }
6897    }
6898    /// Retrieves this directory plus the contents of the given file copied to the given path.
6899    ///
6900    /// # Arguments
6901    ///
6902    /// * `path` - Location of the copied file (e.g., "/file.txt").
6903    /// * `source` - Identifier of the file to copy.
6904    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6905    pub fn with_file_opts<'a>(
6906        &self,
6907        path: impl Into<String>,
6908        source: impl IntoID<FileId>,
6909        opts: DirectoryWithFileOpts<'a>,
6910    ) -> Directory {
6911        let mut query = self.selection.select("withFile");
6912        query = query.arg("path", path.into());
6913        query = query.arg_lazy(
6914            "source",
6915            Box::new(move || {
6916                let source = source.clone();
6917                Box::pin(async move { source.into_id().await.unwrap().quote() })
6918            }),
6919        );
6920        if let Some(permissions) = opts.permissions {
6921            query = query.arg("permissions", permissions);
6922        }
6923        if let Some(owner) = opts.owner {
6924            query = query.arg("owner", owner);
6925        }
6926        Directory {
6927            proc: self.proc.clone(),
6928            selection: query,
6929            graphql_client: self.graphql_client.clone(),
6930        }
6931    }
6932    /// Retrieves this directory plus the contents of the given files copied to the given path.
6933    ///
6934    /// # Arguments
6935    ///
6936    /// * `path` - Location where copied files should be placed (e.g., "/src").
6937    /// * `sources` - Identifiers of the files to copy.
6938    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6939    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
6940        let mut query = self.selection.select("withFiles");
6941        query = query.arg("path", path.into());
6942        query = query.arg("sources", sources);
6943        Directory {
6944            proc: self.proc.clone(),
6945            selection: query,
6946            graphql_client: self.graphql_client.clone(),
6947        }
6948    }
6949    /// Retrieves this directory plus the contents of the given files copied to the given path.
6950    ///
6951    /// # Arguments
6952    ///
6953    /// * `path` - Location where copied files should be placed (e.g., "/src").
6954    /// * `sources` - Identifiers of the files to copy.
6955    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6956    pub fn with_files_opts(
6957        &self,
6958        path: impl Into<String>,
6959        sources: Vec<FileId>,
6960        opts: DirectoryWithFilesOpts,
6961    ) -> Directory {
6962        let mut query = self.selection.select("withFiles");
6963        query = query.arg("path", path.into());
6964        query = query.arg("sources", sources);
6965        if let Some(permissions) = opts.permissions {
6966            query = query.arg("permissions", permissions);
6967        }
6968        Directory {
6969            proc: self.proc.clone(),
6970            selection: query,
6971            graphql_client: self.graphql_client.clone(),
6972        }
6973    }
6974    /// Retrieves this directory plus a new directory created at the given path.
6975    ///
6976    /// # Arguments
6977    ///
6978    /// * `path` - Location of the directory created (e.g., "/logs").
6979    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6980    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
6981        let mut query = self.selection.select("withNewDirectory");
6982        query = query.arg("path", path.into());
6983        Directory {
6984            proc: self.proc.clone(),
6985            selection: query,
6986            graphql_client: self.graphql_client.clone(),
6987        }
6988    }
6989    /// Retrieves this directory plus a new directory created at the given path.
6990    ///
6991    /// # Arguments
6992    ///
6993    /// * `path` - Location of the directory created (e.g., "/logs").
6994    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6995    pub fn with_new_directory_opts(
6996        &self,
6997        path: impl Into<String>,
6998        opts: DirectoryWithNewDirectoryOpts,
6999    ) -> Directory {
7000        let mut query = self.selection.select("withNewDirectory");
7001        query = query.arg("path", path.into());
7002        if let Some(permissions) = opts.permissions {
7003            query = query.arg("permissions", permissions);
7004        }
7005        Directory {
7006            proc: self.proc.clone(),
7007            selection: query,
7008            graphql_client: self.graphql_client.clone(),
7009        }
7010    }
7011    /// Return a snapshot with a new file added
7012    ///
7013    /// # Arguments
7014    ///
7015    /// * `path` - Path of the new file. Example: "foo/bar.txt"
7016    /// * `contents` - Contents of the new file. Example: "Hello world!"
7017    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7018    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
7019        let mut query = self.selection.select("withNewFile");
7020        query = query.arg("path", path.into());
7021        query = query.arg("contents", contents.into());
7022        Directory {
7023            proc: self.proc.clone(),
7024            selection: query,
7025            graphql_client: self.graphql_client.clone(),
7026        }
7027    }
7028    /// Return a snapshot with a new file added
7029    ///
7030    /// # Arguments
7031    ///
7032    /// * `path` - Path of the new file. Example: "foo/bar.txt"
7033    /// * `contents` - Contents of the new file. Example: "Hello world!"
7034    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7035    pub fn with_new_file_opts(
7036        &self,
7037        path: impl Into<String>,
7038        contents: impl Into<String>,
7039        opts: DirectoryWithNewFileOpts,
7040    ) -> Directory {
7041        let mut query = self.selection.select("withNewFile");
7042        query = query.arg("path", path.into());
7043        query = query.arg("contents", contents.into());
7044        if let Some(permissions) = opts.permissions {
7045            query = query.arg("permissions", permissions);
7046        }
7047        Directory {
7048            proc: self.proc.clone(),
7049            selection: query,
7050            graphql_client: self.graphql_client.clone(),
7051        }
7052    }
7053    /// Retrieves this directory with the given Git-compatible patch applied.
7054    ///
7055    /// # Arguments
7056    ///
7057    /// * `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").
7058    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
7059        let mut query = self.selection.select("withPatch");
7060        query = query.arg("patch", patch.into());
7061        Directory {
7062            proc: self.proc.clone(),
7063            selection: query,
7064            graphql_client: self.graphql_client.clone(),
7065        }
7066    }
7067    /// Retrieves this directory with the given Git-compatible patch file applied.
7068    ///
7069    /// # Arguments
7070    ///
7071    /// * `patch` - File containing the patch to apply
7072    pub fn with_patch_file(&self, patch: impl IntoID<FileId>) -> Directory {
7073        let mut query = self.selection.select("withPatchFile");
7074        query = query.arg_lazy(
7075            "patch",
7076            Box::new(move || {
7077                let patch = patch.clone();
7078                Box::pin(async move { patch.into_id().await.unwrap().quote() })
7079            }),
7080        );
7081        Directory {
7082            proc: self.proc.clone(),
7083            selection: query,
7084            graphql_client: self.graphql_client.clone(),
7085        }
7086    }
7087    /// Return a snapshot with a symlink
7088    ///
7089    /// # Arguments
7090    ///
7091    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
7092    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
7093    pub fn with_symlink(
7094        &self,
7095        target: impl Into<String>,
7096        link_name: impl Into<String>,
7097    ) -> Directory {
7098        let mut query = self.selection.select("withSymlink");
7099        query = query.arg("target", target.into());
7100        query = query.arg("linkName", link_name.into());
7101        Directory {
7102            proc: self.proc.clone(),
7103            selection: query,
7104            graphql_client: self.graphql_client.clone(),
7105        }
7106    }
7107    /// Retrieves this directory with all file/dir timestamps set to the given time.
7108    ///
7109    /// # Arguments
7110    ///
7111    /// * `timestamp` - Timestamp to set dir/files in.
7112    ///
7113    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
7114    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
7115        let mut query = self.selection.select("withTimestamps");
7116        query = query.arg("timestamp", timestamp);
7117        Directory {
7118            proc: self.proc.clone(),
7119            selection: query,
7120            graphql_client: self.graphql_client.clone(),
7121        }
7122    }
7123    /// Return a snapshot with a subdirectory removed
7124    ///
7125    /// # Arguments
7126    ///
7127    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
7128    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
7129        let mut query = self.selection.select("withoutDirectory");
7130        query = query.arg("path", path.into());
7131        Directory {
7132            proc: self.proc.clone(),
7133            selection: query,
7134            graphql_client: self.graphql_client.clone(),
7135        }
7136    }
7137    /// Return a snapshot with a file removed
7138    ///
7139    /// # Arguments
7140    ///
7141    /// * `path` - Path of the file to remove (e.g., "/file.txt").
7142    pub fn without_file(&self, path: impl Into<String>) -> Directory {
7143        let mut query = self.selection.select("withoutFile");
7144        query = query.arg("path", path.into());
7145        Directory {
7146            proc: self.proc.clone(),
7147            selection: query,
7148            graphql_client: self.graphql_client.clone(),
7149        }
7150    }
7151    /// Return a snapshot with files removed
7152    ///
7153    /// # Arguments
7154    ///
7155    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
7156    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
7157        let mut query = self.selection.select("withoutFiles");
7158        query = query.arg(
7159            "paths",
7160            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
7161        );
7162        Directory {
7163            proc: self.proc.clone(),
7164            selection: query,
7165            graphql_client: self.graphql_client.clone(),
7166        }
7167    }
7168}
7169#[derive(Clone)]
7170pub struct Engine {
7171    pub proc: Option<Arc<DaggerSessionProc>>,
7172    pub selection: Selection,
7173    pub graphql_client: DynGraphQLClient,
7174}
7175impl Engine {
7176    /// The list of connected client IDs
7177    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
7178        let query = self.selection.select("clients");
7179        query.execute(self.graphql_client.clone()).await
7180    }
7181    /// A unique identifier for this Engine.
7182    pub async fn id(&self) -> Result<EngineId, DaggerError> {
7183        let query = self.selection.select("id");
7184        query.execute(self.graphql_client.clone()).await
7185    }
7186    /// The local engine cache state tracked by dagql
7187    pub fn local_cache(&self) -> EngineCache {
7188        let query = self.selection.select("localCache");
7189        EngineCache {
7190            proc: self.proc.clone(),
7191            selection: query,
7192            graphql_client: self.graphql_client.clone(),
7193        }
7194    }
7195    /// The name of the engine instance.
7196    pub async fn name(&self) -> Result<String, DaggerError> {
7197        let query = self.selection.select("name");
7198        query.execute(self.graphql_client.clone()).await
7199    }
7200}
7201#[derive(Clone)]
7202pub struct EngineCache {
7203    pub proc: Option<Arc<DaggerSessionProc>>,
7204    pub selection: Selection,
7205    pub graphql_client: DynGraphQLClient,
7206}
7207#[derive(Builder, Debug, PartialEq)]
7208pub struct EngineCacheEntrySetOpts<'a> {
7209    #[builder(setter(into, strip_option), default)]
7210    pub key: Option<&'a str>,
7211}
7212#[derive(Builder, Debug, PartialEq)]
7213pub struct EngineCachePruneOpts<'a> {
7214    /// Override the maximum disk space to keep before pruning (e.g. "200GB" or "80%").
7215    #[builder(setter(into, strip_option), default)]
7216    pub max_used_space: Option<&'a str>,
7217    /// Override the minimum free disk space target during pruning (e.g. "20GB" or "20%").
7218    #[builder(setter(into, strip_option), default)]
7219    pub min_free_space: Option<&'a str>,
7220    /// Override the minimum disk space to retain during pruning (e.g. "500GB" or "10%").
7221    #[builder(setter(into, strip_option), default)]
7222    pub reserved_space: Option<&'a str>,
7223    /// Override the target disk space to keep after pruning (e.g. "200GB" or "50%").
7224    #[builder(setter(into, strip_option), default)]
7225    pub target_space: Option<&'a str>,
7226    /// Use the engine-wide default pruning policy if true, otherwise prune the whole cache of any releasable entries.
7227    #[builder(setter(into, strip_option), default)]
7228    pub use_default_policy: Option<bool>,
7229}
7230impl EngineCache {
7231    /// The current set of entries in the cache
7232    ///
7233    /// # Arguments
7234    ///
7235    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7236    pub fn entry_set(&self) -> EngineCacheEntrySet {
7237        let query = self.selection.select("entrySet");
7238        EngineCacheEntrySet {
7239            proc: self.proc.clone(),
7240            selection: query,
7241            graphql_client: self.graphql_client.clone(),
7242        }
7243    }
7244    /// The current set of entries in the cache
7245    ///
7246    /// # Arguments
7247    ///
7248    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7249    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
7250        let mut query = self.selection.select("entrySet");
7251        if let Some(key) = opts.key {
7252            query = query.arg("key", key);
7253        }
7254        EngineCacheEntrySet {
7255            proc: self.proc.clone(),
7256            selection: query,
7257            graphql_client: self.graphql_client.clone(),
7258        }
7259    }
7260    /// A unique identifier for this EngineCache.
7261    pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
7262        let query = self.selection.select("id");
7263        query.execute(self.graphql_client.clone()).await
7264    }
7265    /// The maximum bytes to keep in the cache without pruning.
7266    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
7267        let query = self.selection.select("maxUsedSpace");
7268        query.execute(self.graphql_client.clone()).await
7269    }
7270    /// The target amount of free disk space the garbage collector will attempt to leave.
7271    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
7272        let query = self.selection.select("minFreeSpace");
7273        query.execute(self.graphql_client.clone()).await
7274    }
7275    /// Prune the cache of releaseable entries
7276    ///
7277    /// # Arguments
7278    ///
7279    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7280    pub async fn prune(&self) -> Result<Void, DaggerError> {
7281        let query = self.selection.select("prune");
7282        query.execute(self.graphql_client.clone()).await
7283    }
7284    /// Prune the cache of releaseable entries
7285    ///
7286    /// # Arguments
7287    ///
7288    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7289    pub async fn prune_opts<'a>(
7290        &self,
7291        opts: EngineCachePruneOpts<'a>,
7292    ) -> Result<Void, DaggerError> {
7293        let mut query = self.selection.select("prune");
7294        if let Some(use_default_policy) = opts.use_default_policy {
7295            query = query.arg("useDefaultPolicy", use_default_policy);
7296        }
7297        if let Some(max_used_space) = opts.max_used_space {
7298            query = query.arg("maxUsedSpace", max_used_space);
7299        }
7300        if let Some(reserved_space) = opts.reserved_space {
7301            query = query.arg("reservedSpace", reserved_space);
7302        }
7303        if let Some(min_free_space) = opts.min_free_space {
7304            query = query.arg("minFreeSpace", min_free_space);
7305        }
7306        if let Some(target_space) = opts.target_space {
7307            query = query.arg("targetSpace", target_space);
7308        }
7309        query.execute(self.graphql_client.clone()).await
7310    }
7311    /// The minimum amount of disk space this policy is guaranteed to retain.
7312    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
7313        let query = self.selection.select("reservedSpace");
7314        query.execute(self.graphql_client.clone()).await
7315    }
7316    /// The target number of bytes to keep when pruning.
7317    pub async fn target_space(&self) -> Result<isize, DaggerError> {
7318        let query = self.selection.select("targetSpace");
7319        query.execute(self.graphql_client.clone()).await
7320    }
7321}
7322#[derive(Clone)]
7323pub struct EngineCacheEntry {
7324    pub proc: Option<Arc<DaggerSessionProc>>,
7325    pub selection: Selection,
7326    pub graphql_client: DynGraphQLClient,
7327}
7328impl EngineCacheEntry {
7329    /// Whether the cache entry is actively being used.
7330    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
7331        let query = self.selection.select("activelyUsed");
7332        query.execute(self.graphql_client.clone()).await
7333    }
7334    /// The time the cache entry was created, in Unix nanoseconds.
7335    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
7336        let query = self.selection.select("createdTimeUnixNano");
7337        query.execute(self.graphql_client.clone()).await
7338    }
7339    /// The DagQL call that produced this cache entry.
7340    pub async fn dagql_call(&self) -> Result<String, DaggerError> {
7341        let query = self.selection.select("dagqlCall");
7342        query.execute(self.graphql_client.clone()).await
7343    }
7344    /// The description of the cache entry.
7345    pub async fn description(&self) -> Result<String, DaggerError> {
7346        let query = self.selection.select("description");
7347        query.execute(self.graphql_client.clone()).await
7348    }
7349    /// The disk space used by the cache entry.
7350    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
7351        let query = self.selection.select("diskSpaceBytes");
7352        query.execute(self.graphql_client.clone()).await
7353    }
7354    /// A unique identifier for this EngineCacheEntry.
7355    pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
7356        let query = self.selection.select("id");
7357        query.execute(self.graphql_client.clone()).await
7358    }
7359    /// The most recent time the cache entry was used, in Unix nanoseconds.
7360    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
7361        let query = self.selection.select("mostRecentUseTimeUnixNano");
7362        query.execute(self.graphql_client.clone()).await
7363    }
7364    /// The type of the cache record (e.g. regular, internal, frontend, source.local, source.git.checkout, exec.cachemount).
7365    pub async fn record_type(&self) -> Result<String, DaggerError> {
7366        let query = self.selection.select("recordType");
7367        query.execute(self.graphql_client.clone()).await
7368    }
7369    /// The storage record types represented by this cache entry.
7370    pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
7371        let query = self.selection.select("recordTypes");
7372        query.execute(self.graphql_client.clone()).await
7373    }
7374}
7375#[derive(Clone)]
7376pub struct EngineCacheEntrySet {
7377    pub proc: Option<Arc<DaggerSessionProc>>,
7378    pub selection: Selection,
7379    pub graphql_client: DynGraphQLClient,
7380}
7381impl EngineCacheEntrySet {
7382    /// The total disk space used by the cache entries in this set.
7383    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
7384        let query = self.selection.select("diskSpaceBytes");
7385        query.execute(self.graphql_client.clone()).await
7386    }
7387    /// The list of individual cache entries in the set
7388    pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
7389        let query = self.selection.select("entries");
7390        let query = query.select("id");
7391        let ids: Vec<EngineCacheEntryId> = query.execute(self.graphql_client.clone()).await?;
7392        let root = Query {
7393            proc: self.proc.clone(),
7394            selection: crate::querybuilder::query(),
7395            graphql_client: self.graphql_client.clone(),
7396        };
7397        Ok(ids
7398            .into_iter()
7399            .map(|id| root.load_engine_cache_entry_from_id(id))
7400            .collect())
7401    }
7402    /// The number of cache entries in this set.
7403    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
7404        let query = self.selection.select("entryCount");
7405        query.execute(self.graphql_client.clone()).await
7406    }
7407    /// A unique identifier for this EngineCacheEntrySet.
7408    pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
7409        let query = self.selection.select("id");
7410        query.execute(self.graphql_client.clone()).await
7411    }
7412}
7413#[derive(Clone)]
7414pub struct EnumTypeDef {
7415    pub proc: Option<Arc<DaggerSessionProc>>,
7416    pub selection: Selection,
7417    pub graphql_client: DynGraphQLClient,
7418}
7419impl EnumTypeDef {
7420    /// A doc string for the enum, if any.
7421    pub async fn description(&self) -> Result<String, DaggerError> {
7422        let query = self.selection.select("description");
7423        query.execute(self.graphql_client.clone()).await
7424    }
7425    /// A unique identifier for this EnumTypeDef.
7426    pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
7427        let query = self.selection.select("id");
7428        query.execute(self.graphql_client.clone()).await
7429    }
7430    /// The members of the enum.
7431    pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
7432        let query = self.selection.select("members");
7433        let query = query.select("id");
7434        let ids: Vec<EnumValueTypeDefId> = query.execute(self.graphql_client.clone()).await?;
7435        let root = Query {
7436            proc: self.proc.clone(),
7437            selection: crate::querybuilder::query(),
7438            graphql_client: self.graphql_client.clone(),
7439        };
7440        Ok(ids
7441            .into_iter()
7442            .map(|id| root.load_enum_value_type_def_from_id(id))
7443            .collect())
7444    }
7445    /// The name of the enum.
7446    pub async fn name(&self) -> Result<String, DaggerError> {
7447        let query = self.selection.select("name");
7448        query.execute(self.graphql_client.clone()).await
7449    }
7450    /// The location of this enum declaration.
7451    pub fn source_map(&self) -> SourceMap {
7452        let query = self.selection.select("sourceMap");
7453        SourceMap {
7454            proc: self.proc.clone(),
7455            selection: query,
7456            graphql_client: self.graphql_client.clone(),
7457        }
7458    }
7459    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
7460    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
7461        let query = self.selection.select("sourceModuleName");
7462        query.execute(self.graphql_client.clone()).await
7463    }
7464    /// The members of the enum.
7465    pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
7466        let query = self.selection.select("values");
7467        let query = query.select("id");
7468        let ids: Vec<EnumValueTypeDefId> = query.execute(self.graphql_client.clone()).await?;
7469        let root = Query {
7470            proc: self.proc.clone(),
7471            selection: crate::querybuilder::query(),
7472            graphql_client: self.graphql_client.clone(),
7473        };
7474        Ok(ids
7475            .into_iter()
7476            .map(|id| root.load_enum_value_type_def_from_id(id))
7477            .collect())
7478    }
7479}
7480#[derive(Clone)]
7481pub struct EnumValueTypeDef {
7482    pub proc: Option<Arc<DaggerSessionProc>>,
7483    pub selection: Selection,
7484    pub graphql_client: DynGraphQLClient,
7485}
7486impl EnumValueTypeDef {
7487    /// The reason this enum member is deprecated, if any.
7488    pub async fn deprecated(&self) -> Result<String, DaggerError> {
7489        let query = self.selection.select("deprecated");
7490        query.execute(self.graphql_client.clone()).await
7491    }
7492    /// A doc string for the enum member, if any.
7493    pub async fn description(&self) -> Result<String, DaggerError> {
7494        let query = self.selection.select("description");
7495        query.execute(self.graphql_client.clone()).await
7496    }
7497    /// A unique identifier for this EnumValueTypeDef.
7498    pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
7499        let query = self.selection.select("id");
7500        query.execute(self.graphql_client.clone()).await
7501    }
7502    /// The name of the enum member.
7503    pub async fn name(&self) -> Result<String, DaggerError> {
7504        let query = self.selection.select("name");
7505        query.execute(self.graphql_client.clone()).await
7506    }
7507    /// The location of this enum member declaration.
7508    pub fn source_map(&self) -> SourceMap {
7509        let query = self.selection.select("sourceMap");
7510        SourceMap {
7511            proc: self.proc.clone(),
7512            selection: query,
7513            graphql_client: self.graphql_client.clone(),
7514        }
7515    }
7516    /// The value of the enum member
7517    pub async fn value(&self) -> Result<String, DaggerError> {
7518        let query = self.selection.select("value");
7519        query.execute(self.graphql_client.clone()).await
7520    }
7521}
7522#[derive(Clone)]
7523pub struct Env {
7524    pub proc: Option<Arc<DaggerSessionProc>>,
7525    pub selection: Selection,
7526    pub graphql_client: DynGraphQLClient,
7527}
7528#[derive(Builder, Debug, PartialEq)]
7529pub struct EnvChecksOpts<'a> {
7530    /// Only include checks matching the specified patterns
7531    #[builder(setter(into, strip_option), default)]
7532    pub include: Option<Vec<&'a str>>,
7533    /// When true, only return annotated check functions; exclude generate-as-checks
7534    #[builder(setter(into, strip_option), default)]
7535    pub no_generate: Option<bool>,
7536}
7537#[derive(Builder, Debug, PartialEq)]
7538pub struct EnvServicesOpts<'a> {
7539    /// Only include services matching the specified patterns
7540    #[builder(setter(into, strip_option), default)]
7541    pub include: Option<Vec<&'a str>>,
7542}
7543impl Env {
7544    /// Return the check with the given name from the installed modules. Must match exactly one check.
7545    ///
7546    /// # Arguments
7547    ///
7548    /// * `name` - The name of the check to retrieve
7549    pub fn check(&self, name: impl Into<String>) -> Check {
7550        let mut query = self.selection.select("check");
7551        query = query.arg("name", name.into());
7552        Check {
7553            proc: self.proc.clone(),
7554            selection: query,
7555            graphql_client: self.graphql_client.clone(),
7556        }
7557    }
7558    /// Return all checks defined by the installed modules
7559    ///
7560    /// # Arguments
7561    ///
7562    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7563    pub fn checks(&self) -> CheckGroup {
7564        let query = self.selection.select("checks");
7565        CheckGroup {
7566            proc: self.proc.clone(),
7567            selection: query,
7568            graphql_client: self.graphql_client.clone(),
7569        }
7570    }
7571    /// Return all checks defined by the installed modules
7572    ///
7573    /// # Arguments
7574    ///
7575    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7576    pub fn checks_opts<'a>(&self, opts: EnvChecksOpts<'a>) -> CheckGroup {
7577        let mut query = self.selection.select("checks");
7578        if let Some(include) = opts.include {
7579            query = query.arg("include", include);
7580        }
7581        if let Some(no_generate) = opts.no_generate {
7582            query = query.arg("noGenerate", no_generate);
7583        }
7584        CheckGroup {
7585            proc: self.proc.clone(),
7586            selection: query,
7587            graphql_client: self.graphql_client.clone(),
7588        }
7589    }
7590    /// A unique identifier for this Env.
7591    pub async fn id(&self) -> Result<EnvId, DaggerError> {
7592        let query = self.selection.select("id");
7593        query.execute(self.graphql_client.clone()).await
7594    }
7595    /// Retrieves an input binding by name
7596    pub fn input(&self, name: impl Into<String>) -> Binding {
7597        let mut query = self.selection.select("input");
7598        query = query.arg("name", name.into());
7599        Binding {
7600            proc: self.proc.clone(),
7601            selection: query,
7602            graphql_client: self.graphql_client.clone(),
7603        }
7604    }
7605    /// Returns all input bindings provided to the environment
7606    pub async fn inputs(&self) -> Result<Vec<Binding>, DaggerError> {
7607        let query = self.selection.select("inputs");
7608        let query = query.select("id");
7609        let ids: Vec<BindingId> = query.execute(self.graphql_client.clone()).await?;
7610        let root = Query {
7611            proc: self.proc.clone(),
7612            selection: crate::querybuilder::query(),
7613            graphql_client: self.graphql_client.clone(),
7614        };
7615        Ok(ids
7616            .into_iter()
7617            .map(|id| root.load_binding_from_id(id))
7618            .collect())
7619    }
7620    /// Retrieves an output binding by name
7621    pub fn output(&self, name: impl Into<String>) -> Binding {
7622        let mut query = self.selection.select("output");
7623        query = query.arg("name", name.into());
7624        Binding {
7625            proc: self.proc.clone(),
7626            selection: query,
7627            graphql_client: self.graphql_client.clone(),
7628        }
7629    }
7630    /// Returns all declared output bindings for the environment
7631    pub async fn outputs(&self) -> Result<Vec<Binding>, DaggerError> {
7632        let query = self.selection.select("outputs");
7633        let query = query.select("id");
7634        let ids: Vec<BindingId> = query.execute(self.graphql_client.clone()).await?;
7635        let root = Query {
7636            proc: self.proc.clone(),
7637            selection: crate::querybuilder::query(),
7638            graphql_client: self.graphql_client.clone(),
7639        };
7640        Ok(ids
7641            .into_iter()
7642            .map(|id| root.load_binding_from_id(id))
7643            .collect())
7644    }
7645    /// Return all services defined by the installed modules
7646    ///
7647    /// # Arguments
7648    ///
7649    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7650    pub fn services(&self) -> UpGroup {
7651        let query = self.selection.select("services");
7652        UpGroup {
7653            proc: self.proc.clone(),
7654            selection: query,
7655            graphql_client: self.graphql_client.clone(),
7656        }
7657    }
7658    /// Return all services defined by the installed modules
7659    ///
7660    /// # Arguments
7661    ///
7662    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7663    pub fn services_opts<'a>(&self, opts: EnvServicesOpts<'a>) -> UpGroup {
7664        let mut query = self.selection.select("services");
7665        if let Some(include) = opts.include {
7666            query = query.arg("include", include);
7667        }
7668        UpGroup {
7669            proc: self.proc.clone(),
7670            selection: query,
7671            graphql_client: self.graphql_client.clone(),
7672        }
7673    }
7674    /// Create or update a binding of type Address in the environment
7675    ///
7676    /// # Arguments
7677    ///
7678    /// * `name` - The name of the binding
7679    /// * `value` - The Address value to assign to the binding
7680    /// * `description` - The purpose of the input
7681    pub fn with_address_input(
7682        &self,
7683        name: impl Into<String>,
7684        value: impl IntoID<AddressId>,
7685        description: impl Into<String>,
7686    ) -> Env {
7687        let mut query = self.selection.select("withAddressInput");
7688        query = query.arg("name", name.into());
7689        query = query.arg_lazy(
7690            "value",
7691            Box::new(move || {
7692                let value = value.clone();
7693                Box::pin(async move { value.into_id().await.unwrap().quote() })
7694            }),
7695        );
7696        query = query.arg("description", description.into());
7697        Env {
7698            proc: self.proc.clone(),
7699            selection: query,
7700            graphql_client: self.graphql_client.clone(),
7701        }
7702    }
7703    /// Declare a desired Address output to be assigned in the environment
7704    ///
7705    /// # Arguments
7706    ///
7707    /// * `name` - The name of the binding
7708    /// * `description` - A description of the desired value of the binding
7709    pub fn with_address_output(
7710        &self,
7711        name: impl Into<String>,
7712        description: impl Into<String>,
7713    ) -> Env {
7714        let mut query = self.selection.select("withAddressOutput");
7715        query = query.arg("name", name.into());
7716        query = query.arg("description", description.into());
7717        Env {
7718            proc: self.proc.clone(),
7719            selection: query,
7720            graphql_client: self.graphql_client.clone(),
7721        }
7722    }
7723    /// Create or update a binding of type CacheVolume in the environment
7724    ///
7725    /// # Arguments
7726    ///
7727    /// * `name` - The name of the binding
7728    /// * `value` - The CacheVolume value to assign to the binding
7729    /// * `description` - The purpose of the input
7730    pub fn with_cache_volume_input(
7731        &self,
7732        name: impl Into<String>,
7733        value: impl IntoID<CacheVolumeId>,
7734        description: impl Into<String>,
7735    ) -> Env {
7736        let mut query = self.selection.select("withCacheVolumeInput");
7737        query = query.arg("name", name.into());
7738        query = query.arg_lazy(
7739            "value",
7740            Box::new(move || {
7741                let value = value.clone();
7742                Box::pin(async move { value.into_id().await.unwrap().quote() })
7743            }),
7744        );
7745        query = query.arg("description", description.into());
7746        Env {
7747            proc: self.proc.clone(),
7748            selection: query,
7749            graphql_client: self.graphql_client.clone(),
7750        }
7751    }
7752    /// Declare a desired CacheVolume output to be assigned in the environment
7753    ///
7754    /// # Arguments
7755    ///
7756    /// * `name` - The name of the binding
7757    /// * `description` - A description of the desired value of the binding
7758    pub fn with_cache_volume_output(
7759        &self,
7760        name: impl Into<String>,
7761        description: impl Into<String>,
7762    ) -> Env {
7763        let mut query = self.selection.select("withCacheVolumeOutput");
7764        query = query.arg("name", name.into());
7765        query = query.arg("description", description.into());
7766        Env {
7767            proc: self.proc.clone(),
7768            selection: query,
7769            graphql_client: self.graphql_client.clone(),
7770        }
7771    }
7772    /// Create or update a binding of type Changeset in the environment
7773    ///
7774    /// # Arguments
7775    ///
7776    /// * `name` - The name of the binding
7777    /// * `value` - The Changeset value to assign to the binding
7778    /// * `description` - The purpose of the input
7779    pub fn with_changeset_input(
7780        &self,
7781        name: impl Into<String>,
7782        value: impl IntoID<ChangesetId>,
7783        description: impl Into<String>,
7784    ) -> Env {
7785        let mut query = self.selection.select("withChangesetInput");
7786        query = query.arg("name", name.into());
7787        query = query.arg_lazy(
7788            "value",
7789            Box::new(move || {
7790                let value = value.clone();
7791                Box::pin(async move { value.into_id().await.unwrap().quote() })
7792            }),
7793        );
7794        query = query.arg("description", description.into());
7795        Env {
7796            proc: self.proc.clone(),
7797            selection: query,
7798            graphql_client: self.graphql_client.clone(),
7799        }
7800    }
7801    /// Declare a desired Changeset output to be assigned in the environment
7802    ///
7803    /// # Arguments
7804    ///
7805    /// * `name` - The name of the binding
7806    /// * `description` - A description of the desired value of the binding
7807    pub fn with_changeset_output(
7808        &self,
7809        name: impl Into<String>,
7810        description: impl Into<String>,
7811    ) -> Env {
7812        let mut query = self.selection.select("withChangesetOutput");
7813        query = query.arg("name", name.into());
7814        query = query.arg("description", description.into());
7815        Env {
7816            proc: self.proc.clone(),
7817            selection: query,
7818            graphql_client: self.graphql_client.clone(),
7819        }
7820    }
7821    /// Create or update a binding of type CheckGroup in the environment
7822    ///
7823    /// # Arguments
7824    ///
7825    /// * `name` - The name of the binding
7826    /// * `value` - The CheckGroup value to assign to the binding
7827    /// * `description` - The purpose of the input
7828    pub fn with_check_group_input(
7829        &self,
7830        name: impl Into<String>,
7831        value: impl IntoID<CheckGroupId>,
7832        description: impl Into<String>,
7833    ) -> Env {
7834        let mut query = self.selection.select("withCheckGroupInput");
7835        query = query.arg("name", name.into());
7836        query = query.arg_lazy(
7837            "value",
7838            Box::new(move || {
7839                let value = value.clone();
7840                Box::pin(async move { value.into_id().await.unwrap().quote() })
7841            }),
7842        );
7843        query = query.arg("description", description.into());
7844        Env {
7845            proc: self.proc.clone(),
7846            selection: query,
7847            graphql_client: self.graphql_client.clone(),
7848        }
7849    }
7850    /// Declare a desired CheckGroup output to be assigned in the environment
7851    ///
7852    /// # Arguments
7853    ///
7854    /// * `name` - The name of the binding
7855    /// * `description` - A description of the desired value of the binding
7856    pub fn with_check_group_output(
7857        &self,
7858        name: impl Into<String>,
7859        description: impl Into<String>,
7860    ) -> Env {
7861        let mut query = self.selection.select("withCheckGroupOutput");
7862        query = query.arg("name", name.into());
7863        query = query.arg("description", description.into());
7864        Env {
7865            proc: self.proc.clone(),
7866            selection: query,
7867            graphql_client: self.graphql_client.clone(),
7868        }
7869    }
7870    /// Create or update a binding of type Check in the environment
7871    ///
7872    /// # Arguments
7873    ///
7874    /// * `name` - The name of the binding
7875    /// * `value` - The Check value to assign to the binding
7876    /// * `description` - The purpose of the input
7877    pub fn with_check_input(
7878        &self,
7879        name: impl Into<String>,
7880        value: impl IntoID<CheckId>,
7881        description: impl Into<String>,
7882    ) -> Env {
7883        let mut query = self.selection.select("withCheckInput");
7884        query = query.arg("name", name.into());
7885        query = query.arg_lazy(
7886            "value",
7887            Box::new(move || {
7888                let value = value.clone();
7889                Box::pin(async move { value.into_id().await.unwrap().quote() })
7890            }),
7891        );
7892        query = query.arg("description", description.into());
7893        Env {
7894            proc: self.proc.clone(),
7895            selection: query,
7896            graphql_client: self.graphql_client.clone(),
7897        }
7898    }
7899    /// Declare a desired Check output to be assigned in the environment
7900    ///
7901    /// # Arguments
7902    ///
7903    /// * `name` - The name of the binding
7904    /// * `description` - A description of the desired value of the binding
7905    pub fn with_check_output(
7906        &self,
7907        name: impl Into<String>,
7908        description: impl Into<String>,
7909    ) -> Env {
7910        let mut query = self.selection.select("withCheckOutput");
7911        query = query.arg("name", name.into());
7912        query = query.arg("description", description.into());
7913        Env {
7914            proc: self.proc.clone(),
7915            selection: query,
7916            graphql_client: self.graphql_client.clone(),
7917        }
7918    }
7919    /// Create or update a binding of type Cloud in the environment
7920    ///
7921    /// # Arguments
7922    ///
7923    /// * `name` - The name of the binding
7924    /// * `value` - The Cloud value to assign to the binding
7925    /// * `description` - The purpose of the input
7926    pub fn with_cloud_input(
7927        &self,
7928        name: impl Into<String>,
7929        value: impl IntoID<CloudId>,
7930        description: impl Into<String>,
7931    ) -> Env {
7932        let mut query = self.selection.select("withCloudInput");
7933        query = query.arg("name", name.into());
7934        query = query.arg_lazy(
7935            "value",
7936            Box::new(move || {
7937                let value = value.clone();
7938                Box::pin(async move { value.into_id().await.unwrap().quote() })
7939            }),
7940        );
7941        query = query.arg("description", description.into());
7942        Env {
7943            proc: self.proc.clone(),
7944            selection: query,
7945            graphql_client: self.graphql_client.clone(),
7946        }
7947    }
7948    /// Declare a desired Cloud output to be assigned in the environment
7949    ///
7950    /// # Arguments
7951    ///
7952    /// * `name` - The name of the binding
7953    /// * `description` - A description of the desired value of the binding
7954    pub fn with_cloud_output(
7955        &self,
7956        name: impl Into<String>,
7957        description: impl Into<String>,
7958    ) -> Env {
7959        let mut query = self.selection.select("withCloudOutput");
7960        query = query.arg("name", name.into());
7961        query = query.arg("description", description.into());
7962        Env {
7963            proc: self.proc.clone(),
7964            selection: query,
7965            graphql_client: self.graphql_client.clone(),
7966        }
7967    }
7968    /// Create or update a binding of type Container in the environment
7969    ///
7970    /// # Arguments
7971    ///
7972    /// * `name` - The name of the binding
7973    /// * `value` - The Container value to assign to the binding
7974    /// * `description` - The purpose of the input
7975    pub fn with_container_input(
7976        &self,
7977        name: impl Into<String>,
7978        value: impl IntoID<ContainerId>,
7979        description: impl Into<String>,
7980    ) -> Env {
7981        let mut query = self.selection.select("withContainerInput");
7982        query = query.arg("name", name.into());
7983        query = query.arg_lazy(
7984            "value",
7985            Box::new(move || {
7986                let value = value.clone();
7987                Box::pin(async move { value.into_id().await.unwrap().quote() })
7988            }),
7989        );
7990        query = query.arg("description", description.into());
7991        Env {
7992            proc: self.proc.clone(),
7993            selection: query,
7994            graphql_client: self.graphql_client.clone(),
7995        }
7996    }
7997    /// Declare a desired Container output to be assigned in the environment
7998    ///
7999    /// # Arguments
8000    ///
8001    /// * `name` - The name of the binding
8002    /// * `description` - A description of the desired value of the binding
8003    pub fn with_container_output(
8004        &self,
8005        name: impl Into<String>,
8006        description: impl Into<String>,
8007    ) -> Env {
8008        let mut query = self.selection.select("withContainerOutput");
8009        query = query.arg("name", name.into());
8010        query = query.arg("description", description.into());
8011        Env {
8012            proc: self.proc.clone(),
8013            selection: query,
8014            graphql_client: self.graphql_client.clone(),
8015        }
8016    }
8017    /// Installs the current module into the environment, exposing its functions to the model
8018    /// Contextual path arguments will be populated using the environment's workspace.
8019    pub fn with_current_module(&self) -> Env {
8020        let query = self.selection.select("withCurrentModule");
8021        Env {
8022            proc: self.proc.clone(),
8023            selection: query,
8024            graphql_client: self.graphql_client.clone(),
8025        }
8026    }
8027    /// Create or update a binding of type DiffStat in the environment
8028    ///
8029    /// # Arguments
8030    ///
8031    /// * `name` - The name of the binding
8032    /// * `value` - The DiffStat value to assign to the binding
8033    /// * `description` - The purpose of the input
8034    pub fn with_diff_stat_input(
8035        &self,
8036        name: impl Into<String>,
8037        value: impl IntoID<DiffStatId>,
8038        description: impl Into<String>,
8039    ) -> Env {
8040        let mut query = self.selection.select("withDiffStatInput");
8041        query = query.arg("name", name.into());
8042        query = query.arg_lazy(
8043            "value",
8044            Box::new(move || {
8045                let value = value.clone();
8046                Box::pin(async move { value.into_id().await.unwrap().quote() })
8047            }),
8048        );
8049        query = query.arg("description", description.into());
8050        Env {
8051            proc: self.proc.clone(),
8052            selection: query,
8053            graphql_client: self.graphql_client.clone(),
8054        }
8055    }
8056    /// Declare a desired DiffStat output to be assigned in the environment
8057    ///
8058    /// # Arguments
8059    ///
8060    /// * `name` - The name of the binding
8061    /// * `description` - A description of the desired value of the binding
8062    pub fn with_diff_stat_output(
8063        &self,
8064        name: impl Into<String>,
8065        description: impl Into<String>,
8066    ) -> Env {
8067        let mut query = self.selection.select("withDiffStatOutput");
8068        query = query.arg("name", name.into());
8069        query = query.arg("description", description.into());
8070        Env {
8071            proc: self.proc.clone(),
8072            selection: query,
8073            graphql_client: self.graphql_client.clone(),
8074        }
8075    }
8076    /// Create or update a binding of type Directory in the environment
8077    ///
8078    /// # Arguments
8079    ///
8080    /// * `name` - The name of the binding
8081    /// * `value` - The Directory value to assign to the binding
8082    /// * `description` - The purpose of the input
8083    pub fn with_directory_input(
8084        &self,
8085        name: impl Into<String>,
8086        value: impl IntoID<DirectoryId>,
8087        description: impl Into<String>,
8088    ) -> Env {
8089        let mut query = self.selection.select("withDirectoryInput");
8090        query = query.arg("name", name.into());
8091        query = query.arg_lazy(
8092            "value",
8093            Box::new(move || {
8094                let value = value.clone();
8095                Box::pin(async move { value.into_id().await.unwrap().quote() })
8096            }),
8097        );
8098        query = query.arg("description", description.into());
8099        Env {
8100            proc: self.proc.clone(),
8101            selection: query,
8102            graphql_client: self.graphql_client.clone(),
8103        }
8104    }
8105    /// Declare a desired Directory output to be assigned in the environment
8106    ///
8107    /// # Arguments
8108    ///
8109    /// * `name` - The name of the binding
8110    /// * `description` - A description of the desired value of the binding
8111    pub fn with_directory_output(
8112        &self,
8113        name: impl Into<String>,
8114        description: impl Into<String>,
8115    ) -> Env {
8116        let mut query = self.selection.select("withDirectoryOutput");
8117        query = query.arg("name", name.into());
8118        query = query.arg("description", description.into());
8119        Env {
8120            proc: self.proc.clone(),
8121            selection: query,
8122            graphql_client: self.graphql_client.clone(),
8123        }
8124    }
8125    /// Create or update a binding of type EnvFile in the environment
8126    ///
8127    /// # Arguments
8128    ///
8129    /// * `name` - The name of the binding
8130    /// * `value` - The EnvFile value to assign to the binding
8131    /// * `description` - The purpose of the input
8132    pub fn with_env_file_input(
8133        &self,
8134        name: impl Into<String>,
8135        value: impl IntoID<EnvFileId>,
8136        description: impl Into<String>,
8137    ) -> Env {
8138        let mut query = self.selection.select("withEnvFileInput");
8139        query = query.arg("name", name.into());
8140        query = query.arg_lazy(
8141            "value",
8142            Box::new(move || {
8143                let value = value.clone();
8144                Box::pin(async move { value.into_id().await.unwrap().quote() })
8145            }),
8146        );
8147        query = query.arg("description", description.into());
8148        Env {
8149            proc: self.proc.clone(),
8150            selection: query,
8151            graphql_client: self.graphql_client.clone(),
8152        }
8153    }
8154    /// Declare a desired EnvFile output to be assigned in the environment
8155    ///
8156    /// # Arguments
8157    ///
8158    /// * `name` - The name of the binding
8159    /// * `description` - A description of the desired value of the binding
8160    pub fn with_env_file_output(
8161        &self,
8162        name: impl Into<String>,
8163        description: impl Into<String>,
8164    ) -> Env {
8165        let mut query = self.selection.select("withEnvFileOutput");
8166        query = query.arg("name", name.into());
8167        query = query.arg("description", description.into());
8168        Env {
8169            proc: self.proc.clone(),
8170            selection: query,
8171            graphql_client: self.graphql_client.clone(),
8172        }
8173    }
8174    /// Create or update a binding of type Env in the environment
8175    ///
8176    /// # Arguments
8177    ///
8178    /// * `name` - The name of the binding
8179    /// * `value` - The Env value to assign to the binding
8180    /// * `description` - The purpose of the input
8181    pub fn with_env_input(
8182        &self,
8183        name: impl Into<String>,
8184        value: impl IntoID<EnvId>,
8185        description: impl Into<String>,
8186    ) -> Env {
8187        let mut query = self.selection.select("withEnvInput");
8188        query = query.arg("name", name.into());
8189        query = query.arg_lazy(
8190            "value",
8191            Box::new(move || {
8192                let value = value.clone();
8193                Box::pin(async move { value.into_id().await.unwrap().quote() })
8194            }),
8195        );
8196        query = query.arg("description", description.into());
8197        Env {
8198            proc: self.proc.clone(),
8199            selection: query,
8200            graphql_client: self.graphql_client.clone(),
8201        }
8202    }
8203    /// Declare a desired Env output to be assigned in the environment
8204    ///
8205    /// # Arguments
8206    ///
8207    /// * `name` - The name of the binding
8208    /// * `description` - A description of the desired value of the binding
8209    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
8210        let mut query = self.selection.select("withEnvOutput");
8211        query = query.arg("name", name.into());
8212        query = query.arg("description", description.into());
8213        Env {
8214            proc: self.proc.clone(),
8215            selection: query,
8216            graphql_client: self.graphql_client.clone(),
8217        }
8218    }
8219    /// Create or update a binding of type File in the environment
8220    ///
8221    /// # Arguments
8222    ///
8223    /// * `name` - The name of the binding
8224    /// * `value` - The File value to assign to the binding
8225    /// * `description` - The purpose of the input
8226    pub fn with_file_input(
8227        &self,
8228        name: impl Into<String>,
8229        value: impl IntoID<FileId>,
8230        description: impl Into<String>,
8231    ) -> Env {
8232        let mut query = self.selection.select("withFileInput");
8233        query = query.arg("name", name.into());
8234        query = query.arg_lazy(
8235            "value",
8236            Box::new(move || {
8237                let value = value.clone();
8238                Box::pin(async move { value.into_id().await.unwrap().quote() })
8239            }),
8240        );
8241        query = query.arg("description", description.into());
8242        Env {
8243            proc: self.proc.clone(),
8244            selection: query,
8245            graphql_client: self.graphql_client.clone(),
8246        }
8247    }
8248    /// Declare a desired File output to be assigned in the environment
8249    ///
8250    /// # Arguments
8251    ///
8252    /// * `name` - The name of the binding
8253    /// * `description` - A description of the desired value of the binding
8254    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
8255        let mut query = self.selection.select("withFileOutput");
8256        query = query.arg("name", name.into());
8257        query = query.arg("description", description.into());
8258        Env {
8259            proc: self.proc.clone(),
8260            selection: query,
8261            graphql_client: self.graphql_client.clone(),
8262        }
8263    }
8264    /// Create or update a binding of type GeneratorGroup in the environment
8265    ///
8266    /// # Arguments
8267    ///
8268    /// * `name` - The name of the binding
8269    /// * `value` - The GeneratorGroup value to assign to the binding
8270    /// * `description` - The purpose of the input
8271    pub fn with_generator_group_input(
8272        &self,
8273        name: impl Into<String>,
8274        value: impl IntoID<GeneratorGroupId>,
8275        description: impl Into<String>,
8276    ) -> Env {
8277        let mut query = self.selection.select("withGeneratorGroupInput");
8278        query = query.arg("name", name.into());
8279        query = query.arg_lazy(
8280            "value",
8281            Box::new(move || {
8282                let value = value.clone();
8283                Box::pin(async move { value.into_id().await.unwrap().quote() })
8284            }),
8285        );
8286        query = query.arg("description", description.into());
8287        Env {
8288            proc: self.proc.clone(),
8289            selection: query,
8290            graphql_client: self.graphql_client.clone(),
8291        }
8292    }
8293    /// Declare a desired GeneratorGroup output to be assigned in the environment
8294    ///
8295    /// # Arguments
8296    ///
8297    /// * `name` - The name of the binding
8298    /// * `description` - A description of the desired value of the binding
8299    pub fn with_generator_group_output(
8300        &self,
8301        name: impl Into<String>,
8302        description: impl Into<String>,
8303    ) -> Env {
8304        let mut query = self.selection.select("withGeneratorGroupOutput");
8305        query = query.arg("name", name.into());
8306        query = query.arg("description", description.into());
8307        Env {
8308            proc: self.proc.clone(),
8309            selection: query,
8310            graphql_client: self.graphql_client.clone(),
8311        }
8312    }
8313    /// Create or update a binding of type Generator in the environment
8314    ///
8315    /// # Arguments
8316    ///
8317    /// * `name` - The name of the binding
8318    /// * `value` - The Generator value to assign to the binding
8319    /// * `description` - The purpose of the input
8320    pub fn with_generator_input(
8321        &self,
8322        name: impl Into<String>,
8323        value: impl IntoID<GeneratorId>,
8324        description: impl Into<String>,
8325    ) -> Env {
8326        let mut query = self.selection.select("withGeneratorInput");
8327        query = query.arg("name", name.into());
8328        query = query.arg_lazy(
8329            "value",
8330            Box::new(move || {
8331                let value = value.clone();
8332                Box::pin(async move { value.into_id().await.unwrap().quote() })
8333            }),
8334        );
8335        query = query.arg("description", description.into());
8336        Env {
8337            proc: self.proc.clone(),
8338            selection: query,
8339            graphql_client: self.graphql_client.clone(),
8340        }
8341    }
8342    /// Declare a desired Generator output to be assigned in the environment
8343    ///
8344    /// # Arguments
8345    ///
8346    /// * `name` - The name of the binding
8347    /// * `description` - A description of the desired value of the binding
8348    pub fn with_generator_output(
8349        &self,
8350        name: impl Into<String>,
8351        description: impl Into<String>,
8352    ) -> Env {
8353        let mut query = self.selection.select("withGeneratorOutput");
8354        query = query.arg("name", name.into());
8355        query = query.arg("description", description.into());
8356        Env {
8357            proc: self.proc.clone(),
8358            selection: query,
8359            graphql_client: self.graphql_client.clone(),
8360        }
8361    }
8362    /// Create or update a binding of type GitRef in the environment
8363    ///
8364    /// # Arguments
8365    ///
8366    /// * `name` - The name of the binding
8367    /// * `value` - The GitRef value to assign to the binding
8368    /// * `description` - The purpose of the input
8369    pub fn with_git_ref_input(
8370        &self,
8371        name: impl Into<String>,
8372        value: impl IntoID<GitRefId>,
8373        description: impl Into<String>,
8374    ) -> Env {
8375        let mut query = self.selection.select("withGitRefInput");
8376        query = query.arg("name", name.into());
8377        query = query.arg_lazy(
8378            "value",
8379            Box::new(move || {
8380                let value = value.clone();
8381                Box::pin(async move { value.into_id().await.unwrap().quote() })
8382            }),
8383        );
8384        query = query.arg("description", description.into());
8385        Env {
8386            proc: self.proc.clone(),
8387            selection: query,
8388            graphql_client: self.graphql_client.clone(),
8389        }
8390    }
8391    /// Declare a desired GitRef output to be assigned in the environment
8392    ///
8393    /// # Arguments
8394    ///
8395    /// * `name` - The name of the binding
8396    /// * `description` - A description of the desired value of the binding
8397    pub fn with_git_ref_output(
8398        &self,
8399        name: impl Into<String>,
8400        description: impl Into<String>,
8401    ) -> Env {
8402        let mut query = self.selection.select("withGitRefOutput");
8403        query = query.arg("name", name.into());
8404        query = query.arg("description", description.into());
8405        Env {
8406            proc: self.proc.clone(),
8407            selection: query,
8408            graphql_client: self.graphql_client.clone(),
8409        }
8410    }
8411    /// Create or update a binding of type GitRepository in the environment
8412    ///
8413    /// # Arguments
8414    ///
8415    /// * `name` - The name of the binding
8416    /// * `value` - The GitRepository value to assign to the binding
8417    /// * `description` - The purpose of the input
8418    pub fn with_git_repository_input(
8419        &self,
8420        name: impl Into<String>,
8421        value: impl IntoID<GitRepositoryId>,
8422        description: impl Into<String>,
8423    ) -> Env {
8424        let mut query = self.selection.select("withGitRepositoryInput");
8425        query = query.arg("name", name.into());
8426        query = query.arg_lazy(
8427            "value",
8428            Box::new(move || {
8429                let value = value.clone();
8430                Box::pin(async move { value.into_id().await.unwrap().quote() })
8431            }),
8432        );
8433        query = query.arg("description", description.into());
8434        Env {
8435            proc: self.proc.clone(),
8436            selection: query,
8437            graphql_client: self.graphql_client.clone(),
8438        }
8439    }
8440    /// Declare a desired GitRepository output to be assigned in the environment
8441    ///
8442    /// # Arguments
8443    ///
8444    /// * `name` - The name of the binding
8445    /// * `description` - A description of the desired value of the binding
8446    pub fn with_git_repository_output(
8447        &self,
8448        name: impl Into<String>,
8449        description: impl Into<String>,
8450    ) -> Env {
8451        let mut query = self.selection.select("withGitRepositoryOutput");
8452        query = query.arg("name", name.into());
8453        query = query.arg("description", description.into());
8454        Env {
8455            proc: self.proc.clone(),
8456            selection: query,
8457            graphql_client: self.graphql_client.clone(),
8458        }
8459    }
8460    /// Create or update a binding of type HTTPState in the environment
8461    ///
8462    /// # Arguments
8463    ///
8464    /// * `name` - The name of the binding
8465    /// * `value` - The HTTPState value to assign to the binding
8466    /// * `description` - The purpose of the input
8467    pub fn with_http_state_input(
8468        &self,
8469        name: impl Into<String>,
8470        value: impl IntoID<HttpStateId>,
8471        description: impl Into<String>,
8472    ) -> Env {
8473        let mut query = self.selection.select("withHTTPStateInput");
8474        query = query.arg("name", name.into());
8475        query = query.arg_lazy(
8476            "value",
8477            Box::new(move || {
8478                let value = value.clone();
8479                Box::pin(async move { value.into_id().await.unwrap().quote() })
8480            }),
8481        );
8482        query = query.arg("description", description.into());
8483        Env {
8484            proc: self.proc.clone(),
8485            selection: query,
8486            graphql_client: self.graphql_client.clone(),
8487        }
8488    }
8489    /// Declare a desired HTTPState output to be assigned in the environment
8490    ///
8491    /// # Arguments
8492    ///
8493    /// * `name` - The name of the binding
8494    /// * `description` - A description of the desired value of the binding
8495    pub fn with_http_state_output(
8496        &self,
8497        name: impl Into<String>,
8498        description: impl Into<String>,
8499    ) -> Env {
8500        let mut query = self.selection.select("withHTTPStateOutput");
8501        query = query.arg("name", name.into());
8502        query = query.arg("description", description.into());
8503        Env {
8504            proc: self.proc.clone(),
8505            selection: query,
8506            graphql_client: self.graphql_client.clone(),
8507        }
8508    }
8509    /// Create or update a binding of type JSONValue in the environment
8510    ///
8511    /// # Arguments
8512    ///
8513    /// * `name` - The name of the binding
8514    /// * `value` - The JSONValue value to assign to the binding
8515    /// * `description` - The purpose of the input
8516    pub fn with_json_value_input(
8517        &self,
8518        name: impl Into<String>,
8519        value: impl IntoID<JsonValueId>,
8520        description: impl Into<String>,
8521    ) -> Env {
8522        let mut query = self.selection.select("withJSONValueInput");
8523        query = query.arg("name", name.into());
8524        query = query.arg_lazy(
8525            "value",
8526            Box::new(move || {
8527                let value = value.clone();
8528                Box::pin(async move { value.into_id().await.unwrap().quote() })
8529            }),
8530        );
8531        query = query.arg("description", description.into());
8532        Env {
8533            proc: self.proc.clone(),
8534            selection: query,
8535            graphql_client: self.graphql_client.clone(),
8536        }
8537    }
8538    /// Declare a desired JSONValue output to be assigned in the environment
8539    ///
8540    /// # Arguments
8541    ///
8542    /// * `name` - The name of the binding
8543    /// * `description` - A description of the desired value of the binding
8544    pub fn with_json_value_output(
8545        &self,
8546        name: impl Into<String>,
8547        description: impl Into<String>,
8548    ) -> Env {
8549        let mut query = self.selection.select("withJSONValueOutput");
8550        query = query.arg("name", name.into());
8551        query = query.arg("description", description.into());
8552        Env {
8553            proc: self.proc.clone(),
8554            selection: query,
8555            graphql_client: self.graphql_client.clone(),
8556        }
8557    }
8558    /// Sets the main module for this environment (the project being worked on)
8559    /// Contextual path arguments will be populated using the environment's workspace.
8560    pub fn with_main_module(&self, module: impl IntoID<ModuleId>) -> Env {
8561        let mut query = self.selection.select("withMainModule");
8562        query = query.arg_lazy(
8563            "module",
8564            Box::new(move || {
8565                let module = module.clone();
8566                Box::pin(async move { module.into_id().await.unwrap().quote() })
8567            }),
8568        );
8569        Env {
8570            proc: self.proc.clone(),
8571            selection: query,
8572            graphql_client: self.graphql_client.clone(),
8573        }
8574    }
8575    /// Installs a module into the environment, exposing its functions to the model
8576    /// Contextual path arguments will be populated using the environment's workspace.
8577    pub fn with_module(&self, module: impl IntoID<ModuleId>) -> Env {
8578        let mut query = self.selection.select("withModule");
8579        query = query.arg_lazy(
8580            "module",
8581            Box::new(move || {
8582                let module = module.clone();
8583                Box::pin(async move { module.into_id().await.unwrap().quote() })
8584            }),
8585        );
8586        Env {
8587            proc: self.proc.clone(),
8588            selection: query,
8589            graphql_client: self.graphql_client.clone(),
8590        }
8591    }
8592    /// Create or update a binding of type ModuleConfigClient in the environment
8593    ///
8594    /// # Arguments
8595    ///
8596    /// * `name` - The name of the binding
8597    /// * `value` - The ModuleConfigClient value to assign to the binding
8598    /// * `description` - The purpose of the input
8599    pub fn with_module_config_client_input(
8600        &self,
8601        name: impl Into<String>,
8602        value: impl IntoID<ModuleConfigClientId>,
8603        description: impl Into<String>,
8604    ) -> Env {
8605        let mut query = self.selection.select("withModuleConfigClientInput");
8606        query = query.arg("name", name.into());
8607        query = query.arg_lazy(
8608            "value",
8609            Box::new(move || {
8610                let value = value.clone();
8611                Box::pin(async move { value.into_id().await.unwrap().quote() })
8612            }),
8613        );
8614        query = query.arg("description", description.into());
8615        Env {
8616            proc: self.proc.clone(),
8617            selection: query,
8618            graphql_client: self.graphql_client.clone(),
8619        }
8620    }
8621    /// Declare a desired ModuleConfigClient output to be assigned in the environment
8622    ///
8623    /// # Arguments
8624    ///
8625    /// * `name` - The name of the binding
8626    /// * `description` - A description of the desired value of the binding
8627    pub fn with_module_config_client_output(
8628        &self,
8629        name: impl Into<String>,
8630        description: impl Into<String>,
8631    ) -> Env {
8632        let mut query = self.selection.select("withModuleConfigClientOutput");
8633        query = query.arg("name", name.into());
8634        query = query.arg("description", description.into());
8635        Env {
8636            proc: self.proc.clone(),
8637            selection: query,
8638            graphql_client: self.graphql_client.clone(),
8639        }
8640    }
8641    /// Create or update a binding of type Module in the environment
8642    ///
8643    /// # Arguments
8644    ///
8645    /// * `name` - The name of the binding
8646    /// * `value` - The Module value to assign to the binding
8647    /// * `description` - The purpose of the input
8648    pub fn with_module_input(
8649        &self,
8650        name: impl Into<String>,
8651        value: impl IntoID<ModuleId>,
8652        description: impl Into<String>,
8653    ) -> Env {
8654        let mut query = self.selection.select("withModuleInput");
8655        query = query.arg("name", name.into());
8656        query = query.arg_lazy(
8657            "value",
8658            Box::new(move || {
8659                let value = value.clone();
8660                Box::pin(async move { value.into_id().await.unwrap().quote() })
8661            }),
8662        );
8663        query = query.arg("description", description.into());
8664        Env {
8665            proc: self.proc.clone(),
8666            selection: query,
8667            graphql_client: self.graphql_client.clone(),
8668        }
8669    }
8670    /// Declare a desired Module output to be assigned in the environment
8671    ///
8672    /// # Arguments
8673    ///
8674    /// * `name` - The name of the binding
8675    /// * `description` - A description of the desired value of the binding
8676    pub fn with_module_output(
8677        &self,
8678        name: impl Into<String>,
8679        description: impl Into<String>,
8680    ) -> Env {
8681        let mut query = self.selection.select("withModuleOutput");
8682        query = query.arg("name", name.into());
8683        query = query.arg("description", description.into());
8684        Env {
8685            proc: self.proc.clone(),
8686            selection: query,
8687            graphql_client: self.graphql_client.clone(),
8688        }
8689    }
8690    /// Create or update a binding of type ModuleSource in the environment
8691    ///
8692    /// # Arguments
8693    ///
8694    /// * `name` - The name of the binding
8695    /// * `value` - The ModuleSource value to assign to the binding
8696    /// * `description` - The purpose of the input
8697    pub fn with_module_source_input(
8698        &self,
8699        name: impl Into<String>,
8700        value: impl IntoID<ModuleSourceId>,
8701        description: impl Into<String>,
8702    ) -> Env {
8703        let mut query = self.selection.select("withModuleSourceInput");
8704        query = query.arg("name", name.into());
8705        query = query.arg_lazy(
8706            "value",
8707            Box::new(move || {
8708                let value = value.clone();
8709                Box::pin(async move { value.into_id().await.unwrap().quote() })
8710            }),
8711        );
8712        query = query.arg("description", description.into());
8713        Env {
8714            proc: self.proc.clone(),
8715            selection: query,
8716            graphql_client: self.graphql_client.clone(),
8717        }
8718    }
8719    /// Declare a desired ModuleSource output to be assigned in the environment
8720    ///
8721    /// # Arguments
8722    ///
8723    /// * `name` - The name of the binding
8724    /// * `description` - A description of the desired value of the binding
8725    pub fn with_module_source_output(
8726        &self,
8727        name: impl Into<String>,
8728        description: impl Into<String>,
8729    ) -> Env {
8730        let mut query = self.selection.select("withModuleSourceOutput");
8731        query = query.arg("name", name.into());
8732        query = query.arg("description", description.into());
8733        Env {
8734            proc: self.proc.clone(),
8735            selection: query,
8736            graphql_client: self.graphql_client.clone(),
8737        }
8738    }
8739    /// Create or update a binding of type SearchResult in the environment
8740    ///
8741    /// # Arguments
8742    ///
8743    /// * `name` - The name of the binding
8744    /// * `value` - The SearchResult value to assign to the binding
8745    /// * `description` - The purpose of the input
8746    pub fn with_search_result_input(
8747        &self,
8748        name: impl Into<String>,
8749        value: impl IntoID<SearchResultId>,
8750        description: impl Into<String>,
8751    ) -> Env {
8752        let mut query = self.selection.select("withSearchResultInput");
8753        query = query.arg("name", name.into());
8754        query = query.arg_lazy(
8755            "value",
8756            Box::new(move || {
8757                let value = value.clone();
8758                Box::pin(async move { value.into_id().await.unwrap().quote() })
8759            }),
8760        );
8761        query = query.arg("description", description.into());
8762        Env {
8763            proc: self.proc.clone(),
8764            selection: query,
8765            graphql_client: self.graphql_client.clone(),
8766        }
8767    }
8768    /// Declare a desired SearchResult output to be assigned in the environment
8769    ///
8770    /// # Arguments
8771    ///
8772    /// * `name` - The name of the binding
8773    /// * `description` - A description of the desired value of the binding
8774    pub fn with_search_result_output(
8775        &self,
8776        name: impl Into<String>,
8777        description: impl Into<String>,
8778    ) -> Env {
8779        let mut query = self.selection.select("withSearchResultOutput");
8780        query = query.arg("name", name.into());
8781        query = query.arg("description", description.into());
8782        Env {
8783            proc: self.proc.clone(),
8784            selection: query,
8785            graphql_client: self.graphql_client.clone(),
8786        }
8787    }
8788    /// Create or update a binding of type SearchSubmatch in the environment
8789    ///
8790    /// # Arguments
8791    ///
8792    /// * `name` - The name of the binding
8793    /// * `value` - The SearchSubmatch value to assign to the binding
8794    /// * `description` - The purpose of the input
8795    pub fn with_search_submatch_input(
8796        &self,
8797        name: impl Into<String>,
8798        value: impl IntoID<SearchSubmatchId>,
8799        description: impl Into<String>,
8800    ) -> Env {
8801        let mut query = self.selection.select("withSearchSubmatchInput");
8802        query = query.arg("name", name.into());
8803        query = query.arg_lazy(
8804            "value",
8805            Box::new(move || {
8806                let value = value.clone();
8807                Box::pin(async move { value.into_id().await.unwrap().quote() })
8808            }),
8809        );
8810        query = query.arg("description", description.into());
8811        Env {
8812            proc: self.proc.clone(),
8813            selection: query,
8814            graphql_client: self.graphql_client.clone(),
8815        }
8816    }
8817    /// Declare a desired SearchSubmatch output to be assigned in the environment
8818    ///
8819    /// # Arguments
8820    ///
8821    /// * `name` - The name of the binding
8822    /// * `description` - A description of the desired value of the binding
8823    pub fn with_search_submatch_output(
8824        &self,
8825        name: impl Into<String>,
8826        description: impl Into<String>,
8827    ) -> Env {
8828        let mut query = self.selection.select("withSearchSubmatchOutput");
8829        query = query.arg("name", name.into());
8830        query = query.arg("description", description.into());
8831        Env {
8832            proc: self.proc.clone(),
8833            selection: query,
8834            graphql_client: self.graphql_client.clone(),
8835        }
8836    }
8837    /// Create or update a binding of type Secret in the environment
8838    ///
8839    /// # Arguments
8840    ///
8841    /// * `name` - The name of the binding
8842    /// * `value` - The Secret value to assign to the binding
8843    /// * `description` - The purpose of the input
8844    pub fn with_secret_input(
8845        &self,
8846        name: impl Into<String>,
8847        value: impl IntoID<SecretId>,
8848        description: impl Into<String>,
8849    ) -> Env {
8850        let mut query = self.selection.select("withSecretInput");
8851        query = query.arg("name", name.into());
8852        query = query.arg_lazy(
8853            "value",
8854            Box::new(move || {
8855                let value = value.clone();
8856                Box::pin(async move { value.into_id().await.unwrap().quote() })
8857            }),
8858        );
8859        query = query.arg("description", description.into());
8860        Env {
8861            proc: self.proc.clone(),
8862            selection: query,
8863            graphql_client: self.graphql_client.clone(),
8864        }
8865    }
8866    /// Declare a desired Secret output to be assigned in the environment
8867    ///
8868    /// # Arguments
8869    ///
8870    /// * `name` - The name of the binding
8871    /// * `description` - A description of the desired value of the binding
8872    pub fn with_secret_output(
8873        &self,
8874        name: impl Into<String>,
8875        description: impl Into<String>,
8876    ) -> Env {
8877        let mut query = self.selection.select("withSecretOutput");
8878        query = query.arg("name", name.into());
8879        query = query.arg("description", description.into());
8880        Env {
8881            proc: self.proc.clone(),
8882            selection: query,
8883            graphql_client: self.graphql_client.clone(),
8884        }
8885    }
8886    /// Create or update a binding of type Service in the environment
8887    ///
8888    /// # Arguments
8889    ///
8890    /// * `name` - The name of the binding
8891    /// * `value` - The Service value to assign to the binding
8892    /// * `description` - The purpose of the input
8893    pub fn with_service_input(
8894        &self,
8895        name: impl Into<String>,
8896        value: impl IntoID<ServiceId>,
8897        description: impl Into<String>,
8898    ) -> Env {
8899        let mut query = self.selection.select("withServiceInput");
8900        query = query.arg("name", name.into());
8901        query = query.arg_lazy(
8902            "value",
8903            Box::new(move || {
8904                let value = value.clone();
8905                Box::pin(async move { value.into_id().await.unwrap().quote() })
8906            }),
8907        );
8908        query = query.arg("description", description.into());
8909        Env {
8910            proc: self.proc.clone(),
8911            selection: query,
8912            graphql_client: self.graphql_client.clone(),
8913        }
8914    }
8915    /// Declare a desired Service output to be assigned in the environment
8916    ///
8917    /// # Arguments
8918    ///
8919    /// * `name` - The name of the binding
8920    /// * `description` - A description of the desired value of the binding
8921    pub fn with_service_output(
8922        &self,
8923        name: impl Into<String>,
8924        description: impl Into<String>,
8925    ) -> Env {
8926        let mut query = self.selection.select("withServiceOutput");
8927        query = query.arg("name", name.into());
8928        query = query.arg("description", description.into());
8929        Env {
8930            proc: self.proc.clone(),
8931            selection: query,
8932            graphql_client: self.graphql_client.clone(),
8933        }
8934    }
8935    /// Create or update a binding of type Socket in the environment
8936    ///
8937    /// # Arguments
8938    ///
8939    /// * `name` - The name of the binding
8940    /// * `value` - The Socket value to assign to the binding
8941    /// * `description` - The purpose of the input
8942    pub fn with_socket_input(
8943        &self,
8944        name: impl Into<String>,
8945        value: impl IntoID<SocketId>,
8946        description: impl Into<String>,
8947    ) -> Env {
8948        let mut query = self.selection.select("withSocketInput");
8949        query = query.arg("name", name.into());
8950        query = query.arg_lazy(
8951            "value",
8952            Box::new(move || {
8953                let value = value.clone();
8954                Box::pin(async move { value.into_id().await.unwrap().quote() })
8955            }),
8956        );
8957        query = query.arg("description", description.into());
8958        Env {
8959            proc: self.proc.clone(),
8960            selection: query,
8961            graphql_client: self.graphql_client.clone(),
8962        }
8963    }
8964    /// Declare a desired Socket output to be assigned in the environment
8965    ///
8966    /// # Arguments
8967    ///
8968    /// * `name` - The name of the binding
8969    /// * `description` - A description of the desired value of the binding
8970    pub fn with_socket_output(
8971        &self,
8972        name: impl Into<String>,
8973        description: impl Into<String>,
8974    ) -> Env {
8975        let mut query = self.selection.select("withSocketOutput");
8976        query = query.arg("name", name.into());
8977        query = query.arg("description", description.into());
8978        Env {
8979            proc: self.proc.clone(),
8980            selection: query,
8981            graphql_client: self.graphql_client.clone(),
8982        }
8983    }
8984    /// Create or update a binding of type Stat in the environment
8985    ///
8986    /// # Arguments
8987    ///
8988    /// * `name` - The name of the binding
8989    /// * `value` - The Stat value to assign to the binding
8990    /// * `description` - The purpose of the input
8991    pub fn with_stat_input(
8992        &self,
8993        name: impl Into<String>,
8994        value: impl IntoID<StatId>,
8995        description: impl Into<String>,
8996    ) -> Env {
8997        let mut query = self.selection.select("withStatInput");
8998        query = query.arg("name", name.into());
8999        query = query.arg_lazy(
9000            "value",
9001            Box::new(move || {
9002                let value = value.clone();
9003                Box::pin(async move { value.into_id().await.unwrap().quote() })
9004            }),
9005        );
9006        query = query.arg("description", description.into());
9007        Env {
9008            proc: self.proc.clone(),
9009            selection: query,
9010            graphql_client: self.graphql_client.clone(),
9011        }
9012    }
9013    /// Declare a desired Stat output to be assigned in the environment
9014    ///
9015    /// # Arguments
9016    ///
9017    /// * `name` - The name of the binding
9018    /// * `description` - A description of the desired value of the binding
9019    pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
9020        let mut query = self.selection.select("withStatOutput");
9021        query = query.arg("name", name.into());
9022        query = query.arg("description", description.into());
9023        Env {
9024            proc: self.proc.clone(),
9025            selection: query,
9026            graphql_client: self.graphql_client.clone(),
9027        }
9028    }
9029    /// Provides a string input binding to the environment
9030    ///
9031    /// # Arguments
9032    ///
9033    /// * `name` - The name of the binding
9034    /// * `value` - The string value to assign to the binding
9035    /// * `description` - The description of the input
9036    pub fn with_string_input(
9037        &self,
9038        name: impl Into<String>,
9039        value: impl Into<String>,
9040        description: impl Into<String>,
9041    ) -> Env {
9042        let mut query = self.selection.select("withStringInput");
9043        query = query.arg("name", name.into());
9044        query = query.arg("value", value.into());
9045        query = query.arg("description", description.into());
9046        Env {
9047            proc: self.proc.clone(),
9048            selection: query,
9049            graphql_client: self.graphql_client.clone(),
9050        }
9051    }
9052    /// Declares a desired string output binding
9053    ///
9054    /// # Arguments
9055    ///
9056    /// * `name` - The name of the binding
9057    /// * `description` - The description of the output
9058    pub fn with_string_output(
9059        &self,
9060        name: impl Into<String>,
9061        description: impl Into<String>,
9062    ) -> Env {
9063        let mut query = self.selection.select("withStringOutput");
9064        query = query.arg("name", name.into());
9065        query = query.arg("description", description.into());
9066        Env {
9067            proc: self.proc.clone(),
9068            selection: query,
9069            graphql_client: self.graphql_client.clone(),
9070        }
9071    }
9072    /// Create or update a binding of type UpGroup in the environment
9073    ///
9074    /// # Arguments
9075    ///
9076    /// * `name` - The name of the binding
9077    /// * `value` - The UpGroup value to assign to the binding
9078    /// * `description` - The purpose of the input
9079    pub fn with_up_group_input(
9080        &self,
9081        name: impl Into<String>,
9082        value: impl IntoID<UpGroupId>,
9083        description: impl Into<String>,
9084    ) -> Env {
9085        let mut query = self.selection.select("withUpGroupInput");
9086        query = query.arg("name", name.into());
9087        query = query.arg_lazy(
9088            "value",
9089            Box::new(move || {
9090                let value = value.clone();
9091                Box::pin(async move { value.into_id().await.unwrap().quote() })
9092            }),
9093        );
9094        query = query.arg("description", description.into());
9095        Env {
9096            proc: self.proc.clone(),
9097            selection: query,
9098            graphql_client: self.graphql_client.clone(),
9099        }
9100    }
9101    /// Declare a desired UpGroup output to be assigned in the environment
9102    ///
9103    /// # Arguments
9104    ///
9105    /// * `name` - The name of the binding
9106    /// * `description` - A description of the desired value of the binding
9107    pub fn with_up_group_output(
9108        &self,
9109        name: impl Into<String>,
9110        description: impl Into<String>,
9111    ) -> Env {
9112        let mut query = self.selection.select("withUpGroupOutput");
9113        query = query.arg("name", name.into());
9114        query = query.arg("description", description.into());
9115        Env {
9116            proc: self.proc.clone(),
9117            selection: query,
9118            graphql_client: self.graphql_client.clone(),
9119        }
9120    }
9121    /// Create or update a binding of type Up in the environment
9122    ///
9123    /// # Arguments
9124    ///
9125    /// * `name` - The name of the binding
9126    /// * `value` - The Up value to assign to the binding
9127    /// * `description` - The purpose of the input
9128    pub fn with_up_input(
9129        &self,
9130        name: impl Into<String>,
9131        value: impl IntoID<UpId>,
9132        description: impl Into<String>,
9133    ) -> Env {
9134        let mut query = self.selection.select("withUpInput");
9135        query = query.arg("name", name.into());
9136        query = query.arg_lazy(
9137            "value",
9138            Box::new(move || {
9139                let value = value.clone();
9140                Box::pin(async move { value.into_id().await.unwrap().quote() })
9141            }),
9142        );
9143        query = query.arg("description", description.into());
9144        Env {
9145            proc: self.proc.clone(),
9146            selection: query,
9147            graphql_client: self.graphql_client.clone(),
9148        }
9149    }
9150    /// Declare a desired Up output to be assigned in the environment
9151    ///
9152    /// # Arguments
9153    ///
9154    /// * `name` - The name of the binding
9155    /// * `description` - A description of the desired value of the binding
9156    pub fn with_up_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
9157        let mut query = self.selection.select("withUpOutput");
9158        query = query.arg("name", name.into());
9159        query = query.arg("description", description.into());
9160        Env {
9161            proc: self.proc.clone(),
9162            selection: query,
9163            graphql_client: self.graphql_client.clone(),
9164        }
9165    }
9166    /// Returns a new environment with the provided workspace
9167    ///
9168    /// # Arguments
9169    ///
9170    /// * `workspace` - The directory to set as the host filesystem
9171    pub fn with_workspace(&self, workspace: impl IntoID<DirectoryId>) -> Env {
9172        let mut query = self.selection.select("withWorkspace");
9173        query = query.arg_lazy(
9174            "workspace",
9175            Box::new(move || {
9176                let workspace = workspace.clone();
9177                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
9178            }),
9179        );
9180        Env {
9181            proc: self.proc.clone(),
9182            selection: query,
9183            graphql_client: self.graphql_client.clone(),
9184        }
9185    }
9186    /// Create or update a binding of type Workspace in the environment
9187    ///
9188    /// # Arguments
9189    ///
9190    /// * `name` - The name of the binding
9191    /// * `value` - The Workspace value to assign to the binding
9192    /// * `description` - The purpose of the input
9193    pub fn with_workspace_input(
9194        &self,
9195        name: impl Into<String>,
9196        value: impl IntoID<WorkspaceId>,
9197        description: impl Into<String>,
9198    ) -> Env {
9199        let mut query = self.selection.select("withWorkspaceInput");
9200        query = query.arg("name", name.into());
9201        query = query.arg_lazy(
9202            "value",
9203            Box::new(move || {
9204                let value = value.clone();
9205                Box::pin(async move { value.into_id().await.unwrap().quote() })
9206            }),
9207        );
9208        query = query.arg("description", description.into());
9209        Env {
9210            proc: self.proc.clone(),
9211            selection: query,
9212            graphql_client: self.graphql_client.clone(),
9213        }
9214    }
9215    /// Declare a desired Workspace output to be assigned in the environment
9216    ///
9217    /// # Arguments
9218    ///
9219    /// * `name` - The name of the binding
9220    /// * `description` - A description of the desired value of the binding
9221    pub fn with_workspace_output(
9222        &self,
9223        name: impl Into<String>,
9224        description: impl Into<String>,
9225    ) -> Env {
9226        let mut query = self.selection.select("withWorkspaceOutput");
9227        query = query.arg("name", name.into());
9228        query = query.arg("description", description.into());
9229        Env {
9230            proc: self.proc.clone(),
9231            selection: query,
9232            graphql_client: self.graphql_client.clone(),
9233        }
9234    }
9235    /// Returns a new environment without any outputs
9236    pub fn without_outputs(&self) -> Env {
9237        let query = self.selection.select("withoutOutputs");
9238        Env {
9239            proc: self.proc.clone(),
9240            selection: query,
9241            graphql_client: self.graphql_client.clone(),
9242        }
9243    }
9244    pub fn workspace(&self) -> Directory {
9245        let query = self.selection.select("workspace");
9246        Directory {
9247            proc: self.proc.clone(),
9248            selection: query,
9249            graphql_client: self.graphql_client.clone(),
9250        }
9251    }
9252}
9253#[derive(Clone)]
9254pub struct EnvFile {
9255    pub proc: Option<Arc<DaggerSessionProc>>,
9256    pub selection: Selection,
9257    pub graphql_client: DynGraphQLClient,
9258}
9259#[derive(Builder, Debug, PartialEq)]
9260pub struct EnvFileGetOpts {
9261    /// Return the value exactly as written to the file. No quote removal or variable expansion
9262    #[builder(setter(into, strip_option), default)]
9263    pub raw: Option<bool>,
9264}
9265#[derive(Builder, Debug, PartialEq)]
9266pub struct EnvFileVariablesOpts {
9267    /// Return values exactly as written to the file. No quote removal or variable expansion
9268    #[builder(setter(into, strip_option), default)]
9269    pub raw: Option<bool>,
9270}
9271impl EnvFile {
9272    /// Return as a file
9273    pub fn as_file(&self) -> File {
9274        let query = self.selection.select("asFile");
9275        File {
9276            proc: self.proc.clone(),
9277            selection: query,
9278            graphql_client: self.graphql_client.clone(),
9279        }
9280    }
9281    /// Check if a variable exists
9282    ///
9283    /// # Arguments
9284    ///
9285    /// * `name` - Variable name
9286    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
9287        let mut query = self.selection.select("exists");
9288        query = query.arg("name", name.into());
9289        query.execute(self.graphql_client.clone()).await
9290    }
9291    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
9292    ///
9293    /// # Arguments
9294    ///
9295    /// * `name` - Variable name
9296    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9297    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
9298        let mut query = self.selection.select("get");
9299        query = query.arg("name", name.into());
9300        query.execute(self.graphql_client.clone()).await
9301    }
9302    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
9303    ///
9304    /// # Arguments
9305    ///
9306    /// * `name` - Variable name
9307    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9308    pub async fn get_opts(
9309        &self,
9310        name: impl Into<String>,
9311        opts: EnvFileGetOpts,
9312    ) -> Result<String, DaggerError> {
9313        let mut query = self.selection.select("get");
9314        query = query.arg("name", name.into());
9315        if let Some(raw) = opts.raw {
9316            query = query.arg("raw", raw);
9317        }
9318        query.execute(self.graphql_client.clone()).await
9319    }
9320    /// A unique identifier for this EnvFile.
9321    pub async fn id(&self) -> Result<EnvFileId, DaggerError> {
9322        let query = self.selection.select("id");
9323        query.execute(self.graphql_client.clone()).await
9324    }
9325    /// 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
9326    ///
9327    /// # Arguments
9328    ///
9329    /// * `prefix` - The prefix to filter by
9330    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
9331        let mut query = self.selection.select("namespace");
9332        query = query.arg("prefix", prefix.into());
9333        EnvFile {
9334            proc: self.proc.clone(),
9335            selection: query,
9336            graphql_client: self.graphql_client.clone(),
9337        }
9338    }
9339    /// Return all variables
9340    ///
9341    /// # Arguments
9342    ///
9343    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9344    pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
9345        let query = self.selection.select("variables");
9346        let query = query.select("id");
9347        let ids: Vec<EnvVariableId> = query.execute(self.graphql_client.clone()).await?;
9348        let root = Query {
9349            proc: self.proc.clone(),
9350            selection: crate::querybuilder::query(),
9351            graphql_client: self.graphql_client.clone(),
9352        };
9353        Ok(ids
9354            .into_iter()
9355            .map(|id| root.load_env_variable_from_id(id))
9356            .collect())
9357    }
9358    /// Return all variables
9359    ///
9360    /// # Arguments
9361    ///
9362    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9363    pub async fn variables_opts(
9364        &self,
9365        opts: EnvFileVariablesOpts,
9366    ) -> Result<Vec<EnvVariable>, DaggerError> {
9367        let mut query = self.selection.select("variables");
9368        if let Some(raw) = opts.raw {
9369            query = query.arg("raw", raw);
9370        }
9371        let query = query.select("id");
9372        let ids: Vec<EnvVariableId> = query.execute(self.graphql_client.clone()).await?;
9373        let root = Query {
9374            proc: self.proc.clone(),
9375            selection: crate::querybuilder::query(),
9376            graphql_client: self.graphql_client.clone(),
9377        };
9378        Ok(ids
9379            .into_iter()
9380            .map(|id| root.load_env_variable_from_id(id))
9381            .collect())
9382    }
9383    /// Add a variable
9384    ///
9385    /// # Arguments
9386    ///
9387    /// * `name` - Variable name
9388    /// * `value` - Variable value
9389    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
9390        let mut query = self.selection.select("withVariable");
9391        query = query.arg("name", name.into());
9392        query = query.arg("value", value.into());
9393        EnvFile {
9394            proc: self.proc.clone(),
9395            selection: query,
9396            graphql_client: self.graphql_client.clone(),
9397        }
9398    }
9399    /// Remove all occurrences of the named variable
9400    ///
9401    /// # Arguments
9402    ///
9403    /// * `name` - Variable name
9404    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
9405        let mut query = self.selection.select("withoutVariable");
9406        query = query.arg("name", name.into());
9407        EnvFile {
9408            proc: self.proc.clone(),
9409            selection: query,
9410            graphql_client: self.graphql_client.clone(),
9411        }
9412    }
9413}
9414#[derive(Clone)]
9415pub struct EnvVariable {
9416    pub proc: Option<Arc<DaggerSessionProc>>,
9417    pub selection: Selection,
9418    pub graphql_client: DynGraphQLClient,
9419}
9420impl EnvVariable {
9421    /// A unique identifier for this EnvVariable.
9422    pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
9423        let query = self.selection.select("id");
9424        query.execute(self.graphql_client.clone()).await
9425    }
9426    /// The environment variable name.
9427    pub async fn name(&self) -> Result<String, DaggerError> {
9428        let query = self.selection.select("name");
9429        query.execute(self.graphql_client.clone()).await
9430    }
9431    /// The environment variable value.
9432    pub async fn value(&self) -> Result<String, DaggerError> {
9433        let query = self.selection.select("value");
9434        query.execute(self.graphql_client.clone()).await
9435    }
9436}
9437#[derive(Clone)]
9438pub struct Error {
9439    pub proc: Option<Arc<DaggerSessionProc>>,
9440    pub selection: Selection,
9441    pub graphql_client: DynGraphQLClient,
9442}
9443impl Error {
9444    /// A unique identifier for this Error.
9445    pub async fn id(&self) -> Result<ErrorId, DaggerError> {
9446        let query = self.selection.select("id");
9447        query.execute(self.graphql_client.clone()).await
9448    }
9449    /// A description of the error.
9450    pub async fn message(&self) -> Result<String, DaggerError> {
9451        let query = self.selection.select("message");
9452        query.execute(self.graphql_client.clone()).await
9453    }
9454    /// The extensions of the error.
9455    pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
9456        let query = self.selection.select("values");
9457        let query = query.select("id");
9458        let ids: Vec<ErrorValueId> = query.execute(self.graphql_client.clone()).await?;
9459        let root = Query {
9460            proc: self.proc.clone(),
9461            selection: crate::querybuilder::query(),
9462            graphql_client: self.graphql_client.clone(),
9463        };
9464        Ok(ids
9465            .into_iter()
9466            .map(|id| root.load_error_value_from_id(id))
9467            .collect())
9468    }
9469    /// Add a value to the error.
9470    ///
9471    /// # Arguments
9472    ///
9473    /// * `name` - The name of the value.
9474    /// * `value` - The value to store on the error.
9475    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
9476        let mut query = self.selection.select("withValue");
9477        query = query.arg("name", name.into());
9478        query = query.arg("value", value);
9479        Error {
9480            proc: self.proc.clone(),
9481            selection: query,
9482            graphql_client: self.graphql_client.clone(),
9483        }
9484    }
9485}
9486#[derive(Clone)]
9487pub struct ErrorValue {
9488    pub proc: Option<Arc<DaggerSessionProc>>,
9489    pub selection: Selection,
9490    pub graphql_client: DynGraphQLClient,
9491}
9492impl ErrorValue {
9493    /// A unique identifier for this ErrorValue.
9494    pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
9495        let query = self.selection.select("id");
9496        query.execute(self.graphql_client.clone()).await
9497    }
9498    /// The name of the value.
9499    pub async fn name(&self) -> Result<String, DaggerError> {
9500        let query = self.selection.select("name");
9501        query.execute(self.graphql_client.clone()).await
9502    }
9503    /// The value.
9504    pub async fn value(&self) -> Result<Json, DaggerError> {
9505        let query = self.selection.select("value");
9506        query.execute(self.graphql_client.clone()).await
9507    }
9508}
9509#[derive(Clone)]
9510pub struct FieldTypeDef {
9511    pub proc: Option<Arc<DaggerSessionProc>>,
9512    pub selection: Selection,
9513    pub graphql_client: DynGraphQLClient,
9514}
9515impl FieldTypeDef {
9516    /// The reason this enum member is deprecated, if any.
9517    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9518        let query = self.selection.select("deprecated");
9519        query.execute(self.graphql_client.clone()).await
9520    }
9521    /// A doc string for the field, if any.
9522    pub async fn description(&self) -> Result<String, DaggerError> {
9523        let query = self.selection.select("description");
9524        query.execute(self.graphql_client.clone()).await
9525    }
9526    /// A unique identifier for this FieldTypeDef.
9527    pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
9528        let query = self.selection.select("id");
9529        query.execute(self.graphql_client.clone()).await
9530    }
9531    /// The name of the field in lowerCamelCase format.
9532    pub async fn name(&self) -> Result<String, DaggerError> {
9533        let query = self.selection.select("name");
9534        query.execute(self.graphql_client.clone()).await
9535    }
9536    /// The location of this field declaration.
9537    pub fn source_map(&self) -> SourceMap {
9538        let query = self.selection.select("sourceMap");
9539        SourceMap {
9540            proc: self.proc.clone(),
9541            selection: query,
9542            graphql_client: self.graphql_client.clone(),
9543        }
9544    }
9545    /// The type of the field.
9546    pub fn type_def(&self) -> TypeDef {
9547        let query = self.selection.select("typeDef");
9548        TypeDef {
9549            proc: self.proc.clone(),
9550            selection: query,
9551            graphql_client: self.graphql_client.clone(),
9552        }
9553    }
9554}
9555#[derive(Clone)]
9556pub struct File {
9557    pub proc: Option<Arc<DaggerSessionProc>>,
9558    pub selection: Selection,
9559    pub graphql_client: DynGraphQLClient,
9560}
9561#[derive(Builder, Debug, PartialEq)]
9562pub struct FileAsEnvFileOpts {
9563    /// Replace "${VAR}" or "$VAR" with the value of other vars
9564    #[builder(setter(into, strip_option), default)]
9565    pub expand: Option<bool>,
9566}
9567#[derive(Builder, Debug, PartialEq)]
9568pub struct FileContentsOpts {
9569    /// Maximum number of lines to read
9570    #[builder(setter(into, strip_option), default)]
9571    pub limit_lines: Option<isize>,
9572    /// Start reading after this line
9573    #[builder(setter(into, strip_option), default)]
9574    pub offset_lines: Option<isize>,
9575}
9576#[derive(Builder, Debug, PartialEq)]
9577pub struct FileDigestOpts {
9578    /// If true, exclude metadata from the digest.
9579    #[builder(setter(into, strip_option), default)]
9580    pub exclude_metadata: Option<bool>,
9581}
9582#[derive(Builder, Debug, PartialEq)]
9583pub struct FileExportOpts {
9584    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
9585    #[builder(setter(into, strip_option), default)]
9586    pub allow_parent_dir_path: Option<bool>,
9587}
9588#[derive(Builder, Debug, PartialEq)]
9589pub struct FileSearchOpts<'a> {
9590    /// Allow the . pattern to match newlines in multiline mode.
9591    #[builder(setter(into, strip_option), default)]
9592    pub dotall: Option<bool>,
9593    /// Only return matching files, not lines and content
9594    #[builder(setter(into, strip_option), default)]
9595    pub files_only: Option<bool>,
9596    #[builder(setter(into, strip_option), default)]
9597    pub globs: Option<Vec<&'a str>>,
9598    /// Enable case-insensitive matching.
9599    #[builder(setter(into, strip_option), default)]
9600    pub insensitive: Option<bool>,
9601    /// Limit the number of results to return
9602    #[builder(setter(into, strip_option), default)]
9603    pub limit: Option<isize>,
9604    /// Interpret the pattern as a literal string instead of a regular expression.
9605    #[builder(setter(into, strip_option), default)]
9606    pub literal: Option<bool>,
9607    /// Enable searching across multiple lines.
9608    #[builder(setter(into, strip_option), default)]
9609    pub multiline: Option<bool>,
9610    #[builder(setter(into, strip_option), default)]
9611    pub paths: Option<Vec<&'a str>>,
9612    /// Skip hidden files (files starting with .).
9613    #[builder(setter(into, strip_option), default)]
9614    pub skip_hidden: Option<bool>,
9615    /// Honor .gitignore, .ignore, and .rgignore files.
9616    #[builder(setter(into, strip_option), default)]
9617    pub skip_ignored: Option<bool>,
9618}
9619#[derive(Builder, Debug, PartialEq)]
9620pub struct FileWithReplacedOpts {
9621    /// Replace all occurrences of the pattern.
9622    #[builder(setter(into, strip_option), default)]
9623    pub all: Option<bool>,
9624    /// Replace the first match starting from the specified line.
9625    #[builder(setter(into, strip_option), default)]
9626    pub first_from: Option<isize>,
9627}
9628impl File {
9629    /// Parse as an env file
9630    ///
9631    /// # Arguments
9632    ///
9633    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9634    pub fn as_env_file(&self) -> EnvFile {
9635        let query = self.selection.select("asEnvFile");
9636        EnvFile {
9637            proc: self.proc.clone(),
9638            selection: query,
9639            graphql_client: self.graphql_client.clone(),
9640        }
9641    }
9642    /// Parse as an env file
9643    ///
9644    /// # Arguments
9645    ///
9646    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9647    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
9648        let mut query = self.selection.select("asEnvFile");
9649        if let Some(expand) = opts.expand {
9650            query = query.arg("expand", expand);
9651        }
9652        EnvFile {
9653            proc: self.proc.clone(),
9654            selection: query,
9655            graphql_client: self.graphql_client.clone(),
9656        }
9657    }
9658    /// Parse the file contents as JSON.
9659    pub fn as_json(&self) -> JsonValue {
9660        let query = self.selection.select("asJSON");
9661        JsonValue {
9662            proc: self.proc.clone(),
9663            selection: query,
9664            graphql_client: self.graphql_client.clone(),
9665        }
9666    }
9667    /// Change the owner of the file recursively.
9668    ///
9669    /// # Arguments
9670    ///
9671    /// * `owner` - A user:group to set for the file.
9672    ///
9673    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
9674    ///
9675    /// If the group is omitted, it defaults to the same as the user.
9676    pub fn chown(&self, owner: impl Into<String>) -> File {
9677        let mut query = self.selection.select("chown");
9678        query = query.arg("owner", owner.into());
9679        File {
9680            proc: self.proc.clone(),
9681            selection: query,
9682            graphql_client: self.graphql_client.clone(),
9683        }
9684    }
9685    /// Retrieves the contents of the file.
9686    ///
9687    /// # Arguments
9688    ///
9689    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9690    pub async fn contents(&self) -> Result<String, DaggerError> {
9691        let query = self.selection.select("contents");
9692        query.execute(self.graphql_client.clone()).await
9693    }
9694    /// Retrieves the contents of the file.
9695    ///
9696    /// # Arguments
9697    ///
9698    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9699    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
9700        let mut query = self.selection.select("contents");
9701        if let Some(offset_lines) = opts.offset_lines {
9702            query = query.arg("offsetLines", offset_lines);
9703        }
9704        if let Some(limit_lines) = opts.limit_lines {
9705            query = query.arg("limitLines", limit_lines);
9706        }
9707        query.execute(self.graphql_client.clone()).await
9708    }
9709    /// 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.
9710    ///
9711    /// # Arguments
9712    ///
9713    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9714    pub async fn digest(&self) -> Result<String, DaggerError> {
9715        let query = self.selection.select("digest");
9716        query.execute(self.graphql_client.clone()).await
9717    }
9718    /// 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.
9719    ///
9720    /// # Arguments
9721    ///
9722    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9723    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
9724        let mut query = self.selection.select("digest");
9725        if let Some(exclude_metadata) = opts.exclude_metadata {
9726            query = query.arg("excludeMetadata", exclude_metadata);
9727        }
9728        query.execute(self.graphql_client.clone()).await
9729    }
9730    /// Writes the file to a file path on the host.
9731    ///
9732    /// # Arguments
9733    ///
9734    /// * `path` - Location of the written directory (e.g., "output.txt").
9735    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9736    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
9737        let mut query = self.selection.select("export");
9738        query = query.arg("path", path.into());
9739        query.execute(self.graphql_client.clone()).await
9740    }
9741    /// Writes the file to a file path on the host.
9742    ///
9743    /// # Arguments
9744    ///
9745    /// * `path` - Location of the written directory (e.g., "output.txt").
9746    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9747    pub async fn export_opts(
9748        &self,
9749        path: impl Into<String>,
9750        opts: FileExportOpts,
9751    ) -> Result<String, DaggerError> {
9752        let mut query = self.selection.select("export");
9753        query = query.arg("path", path.into());
9754        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
9755            query = query.arg("allowParentDirPath", allow_parent_dir_path);
9756        }
9757        query.execute(self.graphql_client.clone()).await
9758    }
9759    /// A unique identifier for this File.
9760    pub async fn id(&self) -> Result<FileId, DaggerError> {
9761        let query = self.selection.select("id");
9762        query.execute(self.graphql_client.clone()).await
9763    }
9764    /// Retrieves the name of the file.
9765    pub async fn name(&self) -> Result<String, DaggerError> {
9766        let query = self.selection.select("name");
9767        query.execute(self.graphql_client.clone()).await
9768    }
9769    /// Searches for content matching the given regular expression or literal string.
9770    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
9771    ///
9772    /// # Arguments
9773    ///
9774    /// * `pattern` - The text to match.
9775    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9776    pub async fn search(
9777        &self,
9778        pattern: impl Into<String>,
9779    ) -> Result<Vec<SearchResult>, DaggerError> {
9780        let mut query = self.selection.select("search");
9781        query = query.arg("pattern", pattern.into());
9782        let query = query.select("id");
9783        let ids: Vec<SearchResultId> = query.execute(self.graphql_client.clone()).await?;
9784        let root = Query {
9785            proc: self.proc.clone(),
9786            selection: crate::querybuilder::query(),
9787            graphql_client: self.graphql_client.clone(),
9788        };
9789        Ok(ids
9790            .into_iter()
9791            .map(|id| root.load_search_result_from_id(id))
9792            .collect())
9793    }
9794    /// Searches for content matching the given regular expression or literal string.
9795    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
9796    ///
9797    /// # Arguments
9798    ///
9799    /// * `pattern` - The text to match.
9800    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9801    pub async fn search_opts<'a>(
9802        &self,
9803        pattern: impl Into<String>,
9804        opts: FileSearchOpts<'a>,
9805    ) -> Result<Vec<SearchResult>, DaggerError> {
9806        let mut query = self.selection.select("search");
9807        query = query.arg("pattern", pattern.into());
9808        if let Some(literal) = opts.literal {
9809            query = query.arg("literal", literal);
9810        }
9811        if let Some(multiline) = opts.multiline {
9812            query = query.arg("multiline", multiline);
9813        }
9814        if let Some(dotall) = opts.dotall {
9815            query = query.arg("dotall", dotall);
9816        }
9817        if let Some(insensitive) = opts.insensitive {
9818            query = query.arg("insensitive", insensitive);
9819        }
9820        if let Some(skip_ignored) = opts.skip_ignored {
9821            query = query.arg("skipIgnored", skip_ignored);
9822        }
9823        if let Some(skip_hidden) = opts.skip_hidden {
9824            query = query.arg("skipHidden", skip_hidden);
9825        }
9826        if let Some(files_only) = opts.files_only {
9827            query = query.arg("filesOnly", files_only);
9828        }
9829        if let Some(limit) = opts.limit {
9830            query = query.arg("limit", limit);
9831        }
9832        if let Some(paths) = opts.paths {
9833            query = query.arg("paths", paths);
9834        }
9835        if let Some(globs) = opts.globs {
9836            query = query.arg("globs", globs);
9837        }
9838        let query = query.select("id");
9839        let ids: Vec<SearchResultId> = query.execute(self.graphql_client.clone()).await?;
9840        let root = Query {
9841            proc: self.proc.clone(),
9842            selection: crate::querybuilder::query(),
9843            graphql_client: self.graphql_client.clone(),
9844        };
9845        Ok(ids
9846            .into_iter()
9847            .map(|id| root.load_search_result_from_id(id))
9848            .collect())
9849    }
9850    /// Retrieves the size of the file, in bytes.
9851    pub async fn size(&self) -> Result<isize, DaggerError> {
9852        let query = self.selection.select("size");
9853        query.execute(self.graphql_client.clone()).await
9854    }
9855    /// Return file status
9856    pub fn stat(&self) -> Stat {
9857        let query = self.selection.select("stat");
9858        Stat {
9859            proc: self.proc.clone(),
9860            selection: query,
9861            graphql_client: self.graphql_client.clone(),
9862        }
9863    }
9864    /// Force evaluation in the engine.
9865    pub async fn sync(&self) -> Result<FileId, DaggerError> {
9866        let query = self.selection.select("sync");
9867        query.execute(self.graphql_client.clone()).await
9868    }
9869    /// Retrieves this file with its name set to the given name.
9870    ///
9871    /// # Arguments
9872    ///
9873    /// * `name` - Name to set file to.
9874    pub fn with_name(&self, name: impl Into<String>) -> File {
9875        let mut query = self.selection.select("withName");
9876        query = query.arg("name", name.into());
9877        File {
9878            proc: self.proc.clone(),
9879            selection: query,
9880            graphql_client: self.graphql_client.clone(),
9881        }
9882    }
9883    /// Retrieves the file with content replaced with the given text.
9884    /// If 'all' is true, all occurrences of the pattern will be replaced.
9885    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9886    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9887    /// If there are no matches for the pattern, this will error.
9888    ///
9889    /// # Arguments
9890    ///
9891    /// * `search` - The text to match.
9892    /// * `replacement` - The text to match.
9893    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9894    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
9895        let mut query = self.selection.select("withReplaced");
9896        query = query.arg("search", search.into());
9897        query = query.arg("replacement", replacement.into());
9898        File {
9899            proc: self.proc.clone(),
9900            selection: query,
9901            graphql_client: self.graphql_client.clone(),
9902        }
9903    }
9904    /// Retrieves the file with content replaced with the given text.
9905    /// If 'all' is true, all occurrences of the pattern will be replaced.
9906    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9907    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9908    /// If there are no matches for the pattern, this will error.
9909    ///
9910    /// # Arguments
9911    ///
9912    /// * `search` - The text to match.
9913    /// * `replacement` - The text to match.
9914    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9915    pub fn with_replaced_opts(
9916        &self,
9917        search: impl Into<String>,
9918        replacement: impl Into<String>,
9919        opts: FileWithReplacedOpts,
9920    ) -> File {
9921        let mut query = self.selection.select("withReplaced");
9922        query = query.arg("search", search.into());
9923        query = query.arg("replacement", replacement.into());
9924        if let Some(all) = opts.all {
9925            query = query.arg("all", all);
9926        }
9927        if let Some(first_from) = opts.first_from {
9928            query = query.arg("firstFrom", first_from);
9929        }
9930        File {
9931            proc: self.proc.clone(),
9932            selection: query,
9933            graphql_client: self.graphql_client.clone(),
9934        }
9935    }
9936    /// Retrieves this file with its created/modified timestamps set to the given time.
9937    ///
9938    /// # Arguments
9939    ///
9940    /// * `timestamp` - Timestamp to set dir/files in.
9941    ///
9942    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
9943    pub fn with_timestamps(&self, timestamp: isize) -> File {
9944        let mut query = self.selection.select("withTimestamps");
9945        query = query.arg("timestamp", timestamp);
9946        File {
9947            proc: self.proc.clone(),
9948            selection: query,
9949            graphql_client: self.graphql_client.clone(),
9950        }
9951    }
9952}
9953#[derive(Clone)]
9954pub struct Function {
9955    pub proc: Option<Arc<DaggerSessionProc>>,
9956    pub selection: Selection,
9957    pub graphql_client: DynGraphQLClient,
9958}
9959#[derive(Builder, Debug, PartialEq)]
9960pub struct FunctionWithArgOpts<'a> {
9961    #[builder(setter(into, strip_option), default)]
9962    pub default_address: Option<&'a str>,
9963    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
9964    #[builder(setter(into, strip_option), default)]
9965    pub default_path: Option<&'a str>,
9966    /// A default value to use for this argument if not explicitly set by the caller, if any
9967    #[builder(setter(into, strip_option), default)]
9968    pub default_value: Option<Json>,
9969    /// If deprecated, the reason or migration path.
9970    #[builder(setter(into, strip_option), default)]
9971    pub deprecated: Option<&'a str>,
9972    /// A doc string for the argument, if any
9973    #[builder(setter(into, strip_option), default)]
9974    pub description: Option<&'a str>,
9975    /// Patterns to ignore when loading the contextual argument value.
9976    #[builder(setter(into, strip_option), default)]
9977    pub ignore: Option<Vec<&'a str>>,
9978    /// The source map for the argument definition.
9979    #[builder(setter(into, strip_option), default)]
9980    pub source_map: Option<SourceMapId>,
9981}
9982#[derive(Builder, Debug, PartialEq)]
9983pub struct FunctionWithCachePolicyOpts<'a> {
9984    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
9985    #[builder(setter(into, strip_option), default)]
9986    pub time_to_live: Option<&'a str>,
9987}
9988#[derive(Builder, Debug, PartialEq)]
9989pub struct FunctionWithDeprecatedOpts<'a> {
9990    /// Reason or migration path describing the deprecation.
9991    #[builder(setter(into, strip_option), default)]
9992    pub reason: Option<&'a str>,
9993}
9994impl Function {
9995    /// Arguments accepted by the function, if any.
9996    pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
9997        let query = self.selection.select("args");
9998        let query = query.select("id");
9999        let ids: Vec<FunctionArgId> = query.execute(self.graphql_client.clone()).await?;
10000        let root = Query {
10001            proc: self.proc.clone(),
10002            selection: crate::querybuilder::query(),
10003            graphql_client: self.graphql_client.clone(),
10004        };
10005        Ok(ids
10006            .into_iter()
10007            .map(|id| root.load_function_arg_from_id(id))
10008            .collect())
10009    }
10010    /// The reason this function is deprecated, if any.
10011    pub async fn deprecated(&self) -> Result<String, DaggerError> {
10012        let query = self.selection.select("deprecated");
10013        query.execute(self.graphql_client.clone()).await
10014    }
10015    /// A doc string for the function, if any.
10016    pub async fn description(&self) -> Result<String, DaggerError> {
10017        let query = self.selection.select("description");
10018        query.execute(self.graphql_client.clone()).await
10019    }
10020    /// A unique identifier for this Function.
10021    pub async fn id(&self) -> Result<FunctionId, DaggerError> {
10022        let query = self.selection.select("id");
10023        query.execute(self.graphql_client.clone()).await
10024    }
10025    /// The name of the function.
10026    pub async fn name(&self) -> Result<String, DaggerError> {
10027        let query = self.selection.select("name");
10028        query.execute(self.graphql_client.clone()).await
10029    }
10030    /// The type returned by the function.
10031    pub fn return_type(&self) -> TypeDef {
10032        let query = self.selection.select("returnType");
10033        TypeDef {
10034            proc: self.proc.clone(),
10035            selection: query,
10036            graphql_client: self.graphql_client.clone(),
10037        }
10038    }
10039    /// The location of this function declaration.
10040    pub fn source_map(&self) -> SourceMap {
10041        let query = self.selection.select("sourceMap");
10042        SourceMap {
10043            proc: self.proc.clone(),
10044            selection: query,
10045            graphql_client: self.graphql_client.clone(),
10046        }
10047    }
10048    /// If this function is provided by a module, the name of the module. Unset otherwise.
10049    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10050        let query = self.selection.select("sourceModuleName");
10051        query.execute(self.graphql_client.clone()).await
10052    }
10053    /// Returns the function with the provided argument
10054    ///
10055    /// # Arguments
10056    ///
10057    /// * `name` - The name of the argument
10058    /// * `type_def` - The type of the argument
10059    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10060    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
10061        let mut query = self.selection.select("withArg");
10062        query = query.arg("name", name.into());
10063        query = query.arg_lazy(
10064            "typeDef",
10065            Box::new(move || {
10066                let type_def = type_def.clone();
10067                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
10068            }),
10069        );
10070        Function {
10071            proc: self.proc.clone(),
10072            selection: query,
10073            graphql_client: self.graphql_client.clone(),
10074        }
10075    }
10076    /// Returns the function with the provided argument
10077    ///
10078    /// # Arguments
10079    ///
10080    /// * `name` - The name of the argument
10081    /// * `type_def` - The type of the argument
10082    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10083    pub fn with_arg_opts<'a>(
10084        &self,
10085        name: impl Into<String>,
10086        type_def: impl IntoID<TypeDefId>,
10087        opts: FunctionWithArgOpts<'a>,
10088    ) -> Function {
10089        let mut query = self.selection.select("withArg");
10090        query = query.arg("name", name.into());
10091        query = query.arg_lazy(
10092            "typeDef",
10093            Box::new(move || {
10094                let type_def = type_def.clone();
10095                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
10096            }),
10097        );
10098        if let Some(description) = opts.description {
10099            query = query.arg("description", description);
10100        }
10101        if let Some(default_value) = opts.default_value {
10102            query = query.arg("defaultValue", default_value);
10103        }
10104        if let Some(default_path) = opts.default_path {
10105            query = query.arg("defaultPath", default_path);
10106        }
10107        if let Some(ignore) = opts.ignore {
10108            query = query.arg("ignore", ignore);
10109        }
10110        if let Some(source_map) = opts.source_map {
10111            query = query.arg("sourceMap", source_map);
10112        }
10113        if let Some(deprecated) = opts.deprecated {
10114            query = query.arg("deprecated", deprecated);
10115        }
10116        if let Some(default_address) = opts.default_address {
10117            query = query.arg("defaultAddress", default_address);
10118        }
10119        Function {
10120            proc: self.proc.clone(),
10121            selection: query,
10122            graphql_client: self.graphql_client.clone(),
10123        }
10124    }
10125    /// Returns the function updated to use the provided cache policy.
10126    ///
10127    /// # Arguments
10128    ///
10129    /// * `policy` - The cache policy to use.
10130    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10131    pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
10132        let mut query = self.selection.select("withCachePolicy");
10133        query = query.arg("policy", policy);
10134        Function {
10135            proc: self.proc.clone(),
10136            selection: query,
10137            graphql_client: self.graphql_client.clone(),
10138        }
10139    }
10140    /// Returns the function updated to use the provided cache policy.
10141    ///
10142    /// # Arguments
10143    ///
10144    /// * `policy` - The cache policy to use.
10145    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10146    pub fn with_cache_policy_opts<'a>(
10147        &self,
10148        policy: FunctionCachePolicy,
10149        opts: FunctionWithCachePolicyOpts<'a>,
10150    ) -> Function {
10151        let mut query = self.selection.select("withCachePolicy");
10152        query = query.arg("policy", policy);
10153        if let Some(time_to_live) = opts.time_to_live {
10154            query = query.arg("timeToLive", time_to_live);
10155        }
10156        Function {
10157            proc: self.proc.clone(),
10158            selection: query,
10159            graphql_client: self.graphql_client.clone(),
10160        }
10161    }
10162    /// Returns the function with a flag indicating it's a check.
10163    pub fn with_check(&self) -> Function {
10164        let query = self.selection.select("withCheck");
10165        Function {
10166            proc: self.proc.clone(),
10167            selection: query,
10168            graphql_client: self.graphql_client.clone(),
10169        }
10170    }
10171    /// Returns the function with the provided deprecation reason.
10172    ///
10173    /// # Arguments
10174    ///
10175    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10176    pub fn with_deprecated(&self) -> Function {
10177        let query = self.selection.select("withDeprecated");
10178        Function {
10179            proc: self.proc.clone(),
10180            selection: query,
10181            graphql_client: self.graphql_client.clone(),
10182        }
10183    }
10184    /// Returns the function with the provided deprecation reason.
10185    ///
10186    /// # Arguments
10187    ///
10188    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10189    pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
10190        let mut query = self.selection.select("withDeprecated");
10191        if let Some(reason) = opts.reason {
10192            query = query.arg("reason", reason);
10193        }
10194        Function {
10195            proc: self.proc.clone(),
10196            selection: query,
10197            graphql_client: self.graphql_client.clone(),
10198        }
10199    }
10200    /// Returns the function with the given doc string.
10201    ///
10202    /// # Arguments
10203    ///
10204    /// * `description` - The doc string to set.
10205    pub fn with_description(&self, description: impl Into<String>) -> Function {
10206        let mut query = self.selection.select("withDescription");
10207        query = query.arg("description", description.into());
10208        Function {
10209            proc: self.proc.clone(),
10210            selection: query,
10211            graphql_client: self.graphql_client.clone(),
10212        }
10213    }
10214    /// Returns the function with a flag indicating it's a generator.
10215    pub fn with_generator(&self) -> Function {
10216        let query = self.selection.select("withGenerator");
10217        Function {
10218            proc: self.proc.clone(),
10219            selection: query,
10220            graphql_client: self.graphql_client.clone(),
10221        }
10222    }
10223    /// Returns the function with the given source map.
10224    ///
10225    /// # Arguments
10226    ///
10227    /// * `source_map` - The source map for the function definition.
10228    pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
10229        let mut query = self.selection.select("withSourceMap");
10230        query = query.arg_lazy(
10231            "sourceMap",
10232            Box::new(move || {
10233                let source_map = source_map.clone();
10234                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
10235            }),
10236        );
10237        Function {
10238            proc: self.proc.clone(),
10239            selection: query,
10240            graphql_client: self.graphql_client.clone(),
10241        }
10242    }
10243    /// Returns the function with a flag indicating it returns a service for dagger up.
10244    pub fn with_up(&self) -> Function {
10245        let query = self.selection.select("withUp");
10246        Function {
10247            proc: self.proc.clone(),
10248            selection: query,
10249            graphql_client: self.graphql_client.clone(),
10250        }
10251    }
10252}
10253#[derive(Clone)]
10254pub struct FunctionArg {
10255    pub proc: Option<Arc<DaggerSessionProc>>,
10256    pub selection: Selection,
10257    pub graphql_client: DynGraphQLClient,
10258}
10259impl FunctionArg {
10260    /// Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
10261    pub async fn default_address(&self) -> Result<String, DaggerError> {
10262        let query = self.selection.select("defaultAddress");
10263        query.execute(self.graphql_client.clone()).await
10264    }
10265    /// 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
10266    pub async fn default_path(&self) -> Result<String, DaggerError> {
10267        let query = self.selection.select("defaultPath");
10268        query.execute(self.graphql_client.clone()).await
10269    }
10270    /// A default value to use for this argument when not explicitly set by the caller, if any.
10271    pub async fn default_value(&self) -> Result<Json, DaggerError> {
10272        let query = self.selection.select("defaultValue");
10273        query.execute(self.graphql_client.clone()).await
10274    }
10275    /// The reason this function is deprecated, if any.
10276    pub async fn deprecated(&self) -> Result<String, DaggerError> {
10277        let query = self.selection.select("deprecated");
10278        query.execute(self.graphql_client.clone()).await
10279    }
10280    /// A doc string for the argument, if any.
10281    pub async fn description(&self) -> Result<String, DaggerError> {
10282        let query = self.selection.select("description");
10283        query.execute(self.graphql_client.clone()).await
10284    }
10285    /// A unique identifier for this FunctionArg.
10286    pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
10287        let query = self.selection.select("id");
10288        query.execute(self.graphql_client.clone()).await
10289    }
10290    /// 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.
10291    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
10292        let query = self.selection.select("ignore");
10293        query.execute(self.graphql_client.clone()).await
10294    }
10295    /// The name of the argument in lowerCamelCase format.
10296    pub async fn name(&self) -> Result<String, DaggerError> {
10297        let query = self.selection.select("name");
10298        query.execute(self.graphql_client.clone()).await
10299    }
10300    /// The location of this arg declaration.
10301    pub fn source_map(&self) -> SourceMap {
10302        let query = self.selection.select("sourceMap");
10303        SourceMap {
10304            proc: self.proc.clone(),
10305            selection: query,
10306            graphql_client: self.graphql_client.clone(),
10307        }
10308    }
10309    /// The type of the argument.
10310    pub fn type_def(&self) -> TypeDef {
10311        let query = self.selection.select("typeDef");
10312        TypeDef {
10313            proc: self.proc.clone(),
10314            selection: query,
10315            graphql_client: self.graphql_client.clone(),
10316        }
10317    }
10318}
10319#[derive(Clone)]
10320pub struct FunctionCall {
10321    pub proc: Option<Arc<DaggerSessionProc>>,
10322    pub selection: Selection,
10323    pub graphql_client: DynGraphQLClient,
10324}
10325impl FunctionCall {
10326    /// A unique identifier for this FunctionCall.
10327    pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
10328        let query = self.selection.select("id");
10329        query.execute(self.graphql_client.clone()).await
10330    }
10331    /// The argument values the function is being invoked with.
10332    pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
10333        let query = self.selection.select("inputArgs");
10334        let query = query.select("id");
10335        let ids: Vec<FunctionCallArgValueId> = query.execute(self.graphql_client.clone()).await?;
10336        let root = Query {
10337            proc: self.proc.clone(),
10338            selection: crate::querybuilder::query(),
10339            graphql_client: self.graphql_client.clone(),
10340        };
10341        Ok(ids
10342            .into_iter()
10343            .map(|id| root.load_function_call_arg_value_from_id(id))
10344            .collect())
10345    }
10346    /// The name of the function being called.
10347    pub async fn name(&self) -> Result<String, DaggerError> {
10348        let query = self.selection.select("name");
10349        query.execute(self.graphql_client.clone()).await
10350    }
10351    /// 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.
10352    pub async fn parent(&self) -> Result<Json, DaggerError> {
10353        let query = self.selection.select("parent");
10354        query.execute(self.graphql_client.clone()).await
10355    }
10356    /// 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.
10357    pub async fn parent_name(&self) -> Result<String, DaggerError> {
10358        let query = self.selection.select("parentName");
10359        query.execute(self.graphql_client.clone()).await
10360    }
10361    /// Return an error from the function.
10362    ///
10363    /// # Arguments
10364    ///
10365    /// * `error` - The error to return.
10366    pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
10367        let mut query = self.selection.select("returnError");
10368        query = query.arg_lazy(
10369            "error",
10370            Box::new(move || {
10371                let error = error.clone();
10372                Box::pin(async move { error.into_id().await.unwrap().quote() })
10373            }),
10374        );
10375        query.execute(self.graphql_client.clone()).await
10376    }
10377    /// Set the return value of the function call to the provided value.
10378    ///
10379    /// # Arguments
10380    ///
10381    /// * `value` - JSON serialization of the return value.
10382    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
10383        let mut query = self.selection.select("returnValue");
10384        query = query.arg("value", value);
10385        query.execute(self.graphql_client.clone()).await
10386    }
10387}
10388#[derive(Clone)]
10389pub struct FunctionCallArgValue {
10390    pub proc: Option<Arc<DaggerSessionProc>>,
10391    pub selection: Selection,
10392    pub graphql_client: DynGraphQLClient,
10393}
10394impl FunctionCallArgValue {
10395    /// A unique identifier for this FunctionCallArgValue.
10396    pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
10397        let query = self.selection.select("id");
10398        query.execute(self.graphql_client.clone()).await
10399    }
10400    /// The name of the argument.
10401    pub async fn name(&self) -> Result<String, DaggerError> {
10402        let query = self.selection.select("name");
10403        query.execute(self.graphql_client.clone()).await
10404    }
10405    /// The value of the argument represented as a JSON serialized string.
10406    pub async fn value(&self) -> Result<Json, DaggerError> {
10407        let query = self.selection.select("value");
10408        query.execute(self.graphql_client.clone()).await
10409    }
10410}
10411#[derive(Clone)]
10412pub struct GeneratedCode {
10413    pub proc: Option<Arc<DaggerSessionProc>>,
10414    pub selection: Selection,
10415    pub graphql_client: DynGraphQLClient,
10416}
10417impl GeneratedCode {
10418    /// The directory containing the generated code.
10419    pub fn code(&self) -> Directory {
10420        let query = self.selection.select("code");
10421        Directory {
10422            proc: self.proc.clone(),
10423            selection: query,
10424            graphql_client: self.graphql_client.clone(),
10425        }
10426    }
10427    /// A unique identifier for this GeneratedCode.
10428    pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
10429        let query = self.selection.select("id");
10430        query.execute(self.graphql_client.clone()).await
10431    }
10432    /// List of paths to mark generated in version control (i.e. .gitattributes).
10433    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
10434        let query = self.selection.select("vcsGeneratedPaths");
10435        query.execute(self.graphql_client.clone()).await
10436    }
10437    /// List of paths to ignore in version control (i.e. .gitignore).
10438    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
10439        let query = self.selection.select("vcsIgnoredPaths");
10440        query.execute(self.graphql_client.clone()).await
10441    }
10442    /// Set the list of paths to mark generated in version control.
10443    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10444        let mut query = self.selection.select("withVCSGeneratedPaths");
10445        query = query.arg(
10446            "paths",
10447            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10448        );
10449        GeneratedCode {
10450            proc: self.proc.clone(),
10451            selection: query,
10452            graphql_client: self.graphql_client.clone(),
10453        }
10454    }
10455    /// Set the list of paths to ignore in version control.
10456    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10457        let mut query = self.selection.select("withVCSIgnoredPaths");
10458        query = query.arg(
10459            "paths",
10460            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10461        );
10462        GeneratedCode {
10463            proc: self.proc.clone(),
10464            selection: query,
10465            graphql_client: self.graphql_client.clone(),
10466        }
10467    }
10468}
10469#[derive(Clone)]
10470pub struct Generator {
10471    pub proc: Option<Arc<DaggerSessionProc>>,
10472    pub selection: Selection,
10473    pub graphql_client: DynGraphQLClient,
10474}
10475impl Generator {
10476    /// The generated changeset from the last run
10477    pub fn changes(&self) -> Changeset {
10478        let query = self.selection.select("changes");
10479        Changeset {
10480            proc: self.proc.clone(),
10481            selection: query,
10482            graphql_client: self.graphql_client.clone(),
10483        }
10484    }
10485    /// Whether the generator complete
10486    pub async fn completed(&self) -> Result<bool, DaggerError> {
10487        let query = self.selection.select("completed");
10488        query.execute(self.graphql_client.clone()).await
10489    }
10490    /// Return the description of the generator
10491    pub async fn description(&self) -> Result<String, DaggerError> {
10492        let query = self.selection.select("description");
10493        query.execute(self.graphql_client.clone()).await
10494    }
10495    /// A unique identifier for this Generator.
10496    pub async fn id(&self) -> Result<GeneratorId, DaggerError> {
10497        let query = self.selection.select("id");
10498        query.execute(self.graphql_client.clone()).await
10499    }
10500    /// Whether changeset from the last generator run is empty or not
10501    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
10502        let query = self.selection.select("isEmpty");
10503        query.execute(self.graphql_client.clone()).await
10504    }
10505    /// Return the fully qualified name of the generator
10506    pub async fn name(&self) -> Result<String, DaggerError> {
10507        let query = self.selection.select("name");
10508        query.execute(self.graphql_client.clone()).await
10509    }
10510    /// The original module in which the generator has been defined
10511    pub fn original_module(&self) -> Module {
10512        let query = self.selection.select("originalModule");
10513        Module {
10514            proc: self.proc.clone(),
10515            selection: query,
10516            graphql_client: self.graphql_client.clone(),
10517        }
10518    }
10519    /// The path of the generator within its module
10520    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
10521        let query = self.selection.select("path");
10522        query.execute(self.graphql_client.clone()).await
10523    }
10524    /// Execute the generator
10525    pub fn run(&self) -> Generator {
10526        let query = self.selection.select("run");
10527        Generator {
10528            proc: self.proc.clone(),
10529            selection: query,
10530            graphql_client: self.graphql_client.clone(),
10531        }
10532    }
10533}
10534#[derive(Clone)]
10535pub struct GeneratorGroup {
10536    pub proc: Option<Arc<DaggerSessionProc>>,
10537    pub selection: Selection,
10538    pub graphql_client: DynGraphQLClient,
10539}
10540#[derive(Builder, Debug, PartialEq)]
10541pub struct GeneratorGroupChangesOpts {
10542    /// Strategy to apply on conflicts between generators
10543    #[builder(setter(into, strip_option), default)]
10544    pub on_conflict: Option<ChangesetsMergeConflict>,
10545}
10546impl GeneratorGroup {
10547    /// The combined changes from the last run of the generators
10548    /// 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.
10549    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
10550    ///
10551    /// # Arguments
10552    ///
10553    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10554    pub fn changes(&self) -> Changeset {
10555        let query = self.selection.select("changes");
10556        Changeset {
10557            proc: self.proc.clone(),
10558            selection: query,
10559            graphql_client: self.graphql_client.clone(),
10560        }
10561    }
10562    /// The combined changes from the last run of the generators
10563    /// 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.
10564    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
10565    ///
10566    /// # Arguments
10567    ///
10568    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10569    pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
10570        let mut query = self.selection.select("changes");
10571        if let Some(on_conflict) = opts.on_conflict {
10572            query = query.arg("onConflict", on_conflict);
10573        }
10574        Changeset {
10575            proc: self.proc.clone(),
10576            selection: query,
10577            graphql_client: self.graphql_client.clone(),
10578        }
10579    }
10580    /// A unique identifier for this GeneratorGroup.
10581    pub async fn id(&self) -> Result<GeneratorGroupId, DaggerError> {
10582        let query = self.selection.select("id");
10583        query.execute(self.graphql_client.clone()).await
10584    }
10585    /// Whether the generated changeset from the last run is empty or not
10586    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
10587        let query = self.selection.select("isEmpty");
10588        query.execute(self.graphql_client.clone()).await
10589    }
10590    /// Return a list of individual generators and their details
10591    pub async fn list(&self) -> Result<Vec<Generator>, DaggerError> {
10592        let query = self.selection.select("list");
10593        let query = query.select("id");
10594        let ids: Vec<GeneratorId> = query.execute(self.graphql_client.clone()).await?;
10595        let root = Query {
10596            proc: self.proc.clone(),
10597            selection: crate::querybuilder::query(),
10598            graphql_client: self.graphql_client.clone(),
10599        };
10600        Ok(ids
10601            .into_iter()
10602            .map(|id| root.load_generator_from_id(id))
10603            .collect())
10604    }
10605    /// Execute all selected generators
10606    pub fn run(&self) -> GeneratorGroup {
10607        let query = self.selection.select("run");
10608        GeneratorGroup {
10609            proc: self.proc.clone(),
10610            selection: query,
10611            graphql_client: self.graphql_client.clone(),
10612        }
10613    }
10614}
10615#[derive(Clone)]
10616pub struct GitRef {
10617    pub proc: Option<Arc<DaggerSessionProc>>,
10618    pub selection: Selection,
10619    pub graphql_client: DynGraphQLClient,
10620}
10621#[derive(Builder, Debug, PartialEq)]
10622pub struct GitRefTreeOpts {
10623    /// The depth of the tree to fetch.
10624    #[builder(setter(into, strip_option), default)]
10625    pub depth: Option<isize>,
10626    /// Set to true to discard .git directory.
10627    #[builder(setter(into, strip_option), default)]
10628    pub discard_git_dir: Option<bool>,
10629    /// Set to true to populate tag refs in the local checkout .git.
10630    #[builder(setter(into, strip_option), default)]
10631    pub include_tags: Option<bool>,
10632}
10633impl GitRef {
10634    /// The resolved commit id at this ref.
10635    pub async fn commit(&self) -> Result<String, DaggerError> {
10636        let query = self.selection.select("commit");
10637        query.execute(self.graphql_client.clone()).await
10638    }
10639    /// Find the best common ancestor between this ref and another ref.
10640    ///
10641    /// # Arguments
10642    ///
10643    /// * `other` - The other ref to compare against.
10644    pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
10645        let mut query = self.selection.select("commonAncestor");
10646        query = query.arg_lazy(
10647            "other",
10648            Box::new(move || {
10649                let other = other.clone();
10650                Box::pin(async move { other.into_id().await.unwrap().quote() })
10651            }),
10652        );
10653        GitRef {
10654            proc: self.proc.clone(),
10655            selection: query,
10656            graphql_client: self.graphql_client.clone(),
10657        }
10658    }
10659    /// A unique identifier for this GitRef.
10660    pub async fn id(&self) -> Result<GitRefId, DaggerError> {
10661        let query = self.selection.select("id");
10662        query.execute(self.graphql_client.clone()).await
10663    }
10664    /// The resolved ref name at this ref.
10665    pub async fn r#ref(&self) -> Result<String, DaggerError> {
10666        let query = self.selection.select("ref");
10667        query.execute(self.graphql_client.clone()).await
10668    }
10669    /// The filesystem tree at this ref.
10670    ///
10671    /// # Arguments
10672    ///
10673    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10674    pub fn tree(&self) -> Directory {
10675        let query = self.selection.select("tree");
10676        Directory {
10677            proc: self.proc.clone(),
10678            selection: query,
10679            graphql_client: self.graphql_client.clone(),
10680        }
10681    }
10682    /// The filesystem tree at this ref.
10683    ///
10684    /// # Arguments
10685    ///
10686    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10687    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
10688        let mut query = self.selection.select("tree");
10689        if let Some(discard_git_dir) = opts.discard_git_dir {
10690            query = query.arg("discardGitDir", discard_git_dir);
10691        }
10692        if let Some(depth) = opts.depth {
10693            query = query.arg("depth", depth);
10694        }
10695        if let Some(include_tags) = opts.include_tags {
10696            query = query.arg("includeTags", include_tags);
10697        }
10698        Directory {
10699            proc: self.proc.clone(),
10700            selection: query,
10701            graphql_client: self.graphql_client.clone(),
10702        }
10703    }
10704}
10705#[derive(Clone)]
10706pub struct GitRepository {
10707    pub proc: Option<Arc<DaggerSessionProc>>,
10708    pub selection: Selection,
10709    pub graphql_client: DynGraphQLClient,
10710}
10711#[derive(Builder, Debug, PartialEq)]
10712pub struct GitRepositoryBranchesOpts<'a> {
10713    /// Glob patterns (e.g., "refs/tags/v*").
10714    #[builder(setter(into, strip_option), default)]
10715    pub patterns: Option<Vec<&'a str>>,
10716}
10717#[derive(Builder, Debug, PartialEq)]
10718pub struct GitRepositoryTagsOpts<'a> {
10719    /// Glob patterns (e.g., "refs/tags/v*").
10720    #[builder(setter(into, strip_option), default)]
10721    pub patterns: Option<Vec<&'a str>>,
10722}
10723impl GitRepository {
10724    /// Returns details of a branch.
10725    ///
10726    /// # Arguments
10727    ///
10728    /// * `name` - Branch's name (e.g., "main").
10729    pub fn branch(&self, name: impl Into<String>) -> GitRef {
10730        let mut query = self.selection.select("branch");
10731        query = query.arg("name", name.into());
10732        GitRef {
10733            proc: self.proc.clone(),
10734            selection: query,
10735            graphql_client: self.graphql_client.clone(),
10736        }
10737    }
10738    /// branches that match any of the given glob patterns.
10739    ///
10740    /// # Arguments
10741    ///
10742    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10743    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
10744        let query = self.selection.select("branches");
10745        query.execute(self.graphql_client.clone()).await
10746    }
10747    /// branches that match any of the given glob patterns.
10748    ///
10749    /// # Arguments
10750    ///
10751    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10752    pub async fn branches_opts<'a>(
10753        &self,
10754        opts: GitRepositoryBranchesOpts<'a>,
10755    ) -> Result<Vec<String>, DaggerError> {
10756        let mut query = self.selection.select("branches");
10757        if let Some(patterns) = opts.patterns {
10758            query = query.arg("patterns", patterns);
10759        }
10760        query.execute(self.graphql_client.clone()).await
10761    }
10762    /// Returns details of a commit.
10763    ///
10764    /// # Arguments
10765    ///
10766    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
10767    pub fn commit(&self, id: impl Into<String>) -> GitRef {
10768        let mut query = self.selection.select("commit");
10769        query = query.arg("id", id.into());
10770        GitRef {
10771            proc: self.proc.clone(),
10772            selection: query,
10773            graphql_client: self.graphql_client.clone(),
10774        }
10775    }
10776    /// Returns details for HEAD.
10777    pub fn head(&self) -> GitRef {
10778        let query = self.selection.select("head");
10779        GitRef {
10780            proc: self.proc.clone(),
10781            selection: query,
10782            graphql_client: self.graphql_client.clone(),
10783        }
10784    }
10785    /// A unique identifier for this GitRepository.
10786    pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
10787        let query = self.selection.select("id");
10788        query.execute(self.graphql_client.clone()).await
10789    }
10790    /// Returns details for the latest semver tag.
10791    pub fn latest_version(&self) -> GitRef {
10792        let query = self.selection.select("latestVersion");
10793        GitRef {
10794            proc: self.proc.clone(),
10795            selection: query,
10796            graphql_client: self.graphql_client.clone(),
10797        }
10798    }
10799    /// Returns details of a ref.
10800    ///
10801    /// # Arguments
10802    ///
10803    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
10804    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
10805        let mut query = self.selection.select("ref");
10806        query = query.arg("name", name.into());
10807        GitRef {
10808            proc: self.proc.clone(),
10809            selection: query,
10810            graphql_client: self.graphql_client.clone(),
10811        }
10812    }
10813    /// Returns details of a tag.
10814    ///
10815    /// # Arguments
10816    ///
10817    /// * `name` - Tag's name (e.g., "v0.3.9").
10818    pub fn tag(&self, name: impl Into<String>) -> GitRef {
10819        let mut query = self.selection.select("tag");
10820        query = query.arg("name", name.into());
10821        GitRef {
10822            proc: self.proc.clone(),
10823            selection: query,
10824            graphql_client: self.graphql_client.clone(),
10825        }
10826    }
10827    /// tags that match any of the given glob patterns.
10828    ///
10829    /// # Arguments
10830    ///
10831    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10832    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
10833        let query = self.selection.select("tags");
10834        query.execute(self.graphql_client.clone()).await
10835    }
10836    /// tags that match any of the given glob patterns.
10837    ///
10838    /// # Arguments
10839    ///
10840    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10841    pub async fn tags_opts<'a>(
10842        &self,
10843        opts: GitRepositoryTagsOpts<'a>,
10844    ) -> Result<Vec<String>, DaggerError> {
10845        let mut query = self.selection.select("tags");
10846        if let Some(patterns) = opts.patterns {
10847            query = query.arg("patterns", patterns);
10848        }
10849        query.execute(self.graphql_client.clone()).await
10850    }
10851    /// Returns the changeset of uncommitted changes in the git repository.
10852    pub fn uncommitted(&self) -> Changeset {
10853        let query = self.selection.select("uncommitted");
10854        Changeset {
10855            proc: self.proc.clone(),
10856            selection: query,
10857            graphql_client: self.graphql_client.clone(),
10858        }
10859    }
10860    /// The URL of the git repository.
10861    pub async fn url(&self) -> Result<String, DaggerError> {
10862        let query = self.selection.select("url");
10863        query.execute(self.graphql_client.clone()).await
10864    }
10865}
10866#[derive(Clone)]
10867pub struct HttpState {
10868    pub proc: Option<Arc<DaggerSessionProc>>,
10869    pub selection: Selection,
10870    pub graphql_client: DynGraphQLClient,
10871}
10872impl HttpState {
10873    /// A unique identifier for this HTTPState.
10874    pub async fn id(&self) -> Result<HttpStateId, DaggerError> {
10875        let query = self.selection.select("id");
10876        query.execute(self.graphql_client.clone()).await
10877    }
10878}
10879#[derive(Clone)]
10880pub struct HealthcheckConfig {
10881    pub proc: Option<Arc<DaggerSessionProc>>,
10882    pub selection: Selection,
10883    pub graphql_client: DynGraphQLClient,
10884}
10885impl HealthcheckConfig {
10886    /// Healthcheck command arguments.
10887    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
10888        let query = self.selection.select("args");
10889        query.execute(self.graphql_client.clone()).await
10890    }
10891    /// A unique identifier for this HealthcheckConfig.
10892    pub async fn id(&self) -> Result<HealthcheckConfigId, DaggerError> {
10893        let query = self.selection.select("id");
10894        query.execute(self.graphql_client.clone()).await
10895    }
10896    /// Interval between running healthcheck. Example:30s
10897    pub async fn interval(&self) -> Result<String, DaggerError> {
10898        let query = self.selection.select("interval");
10899        query.execute(self.graphql_client.clone()).await
10900    }
10901    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example:3
10902    pub async fn retries(&self) -> Result<isize, DaggerError> {
10903        let query = self.selection.select("retries");
10904        query.execute(self.graphql_client.clone()).await
10905    }
10906    /// Healthcheck command is a shell command.
10907    pub async fn shell(&self) -> Result<bool, DaggerError> {
10908        let query = self.selection.select("shell");
10909        query.execute(self.graphql_client.clone()).await
10910    }
10911    /// StartInterval configures the duration between checks during the startup phase. Example:5s
10912    pub async fn start_interval(&self) -> Result<String, DaggerError> {
10913        let query = self.selection.select("startInterval");
10914        query.execute(self.graphql_client.clone()).await
10915    }
10916    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example:0s
10917    pub async fn start_period(&self) -> Result<String, DaggerError> {
10918        let query = self.selection.select("startPeriod");
10919        query.execute(self.graphql_client.clone()).await
10920    }
10921    /// Healthcheck timeout. Example:3s
10922    pub async fn timeout(&self) -> Result<String, DaggerError> {
10923        let query = self.selection.select("timeout");
10924        query.execute(self.graphql_client.clone()).await
10925    }
10926}
10927#[derive(Clone)]
10928pub struct Host {
10929    pub proc: Option<Arc<DaggerSessionProc>>,
10930    pub selection: Selection,
10931    pub graphql_client: DynGraphQLClient,
10932}
10933#[derive(Builder, Debug, PartialEq)]
10934pub struct HostDirectoryOpts<'a> {
10935    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
10936    #[builder(setter(into, strip_option), default)]
10937    pub exclude: Option<Vec<&'a str>>,
10938    /// Apply .gitignore filter rules inside the directory
10939    #[builder(setter(into, strip_option), default)]
10940    pub gitignore: Option<bool>,
10941    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
10942    #[builder(setter(into, strip_option), default)]
10943    pub include: Option<Vec<&'a str>>,
10944    /// If true, the directory will always be reloaded from the host.
10945    #[builder(setter(into, strip_option), default)]
10946    pub no_cache: Option<bool>,
10947}
10948#[derive(Builder, Debug, PartialEq)]
10949pub struct HostFileOpts {
10950    /// If true, the file will always be reloaded from the host.
10951    #[builder(setter(into, strip_option), default)]
10952    pub no_cache: Option<bool>,
10953}
10954#[derive(Builder, Debug, PartialEq)]
10955pub struct HostFindUpOpts {
10956    #[builder(setter(into, strip_option), default)]
10957    pub no_cache: Option<bool>,
10958}
10959#[derive(Builder, Debug, PartialEq)]
10960pub struct HostServiceOpts<'a> {
10961    /// Upstream host to forward traffic to.
10962    #[builder(setter(into, strip_option), default)]
10963    pub host: Option<&'a str>,
10964}
10965#[derive(Builder, Debug, PartialEq)]
10966pub struct HostTunnelOpts {
10967    /// Map each service port to the same port on the host, as if the service were running natively.
10968    /// Note: enabling may result in port conflicts.
10969    #[builder(setter(into, strip_option), default)]
10970    pub native: Option<bool>,
10971    /// Configure explicit port forwarding rules for the tunnel.
10972    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
10973    /// 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.
10974    /// If ports are given and native is true, the ports are additive.
10975    #[builder(setter(into, strip_option), default)]
10976    pub ports: Option<Vec<PortForward>>,
10977}
10978impl Host {
10979    /// Accesses a container image on the host.
10980    ///
10981    /// # Arguments
10982    ///
10983    /// * `name` - Name of the image to access.
10984    pub fn container_image(&self, name: impl Into<String>) -> Container {
10985        let mut query = self.selection.select("containerImage");
10986        query = query.arg("name", name.into());
10987        Container {
10988            proc: self.proc.clone(),
10989            selection: query,
10990            graphql_client: self.graphql_client.clone(),
10991        }
10992    }
10993    /// Accesses a directory on the host.
10994    ///
10995    /// # Arguments
10996    ///
10997    /// * `path` - Location of the directory to access (e.g., ".").
10998    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10999    pub fn directory(&self, path: impl Into<String>) -> Directory {
11000        let mut query = self.selection.select("directory");
11001        query = query.arg("path", path.into());
11002        Directory {
11003            proc: self.proc.clone(),
11004            selection: query,
11005            graphql_client: self.graphql_client.clone(),
11006        }
11007    }
11008    /// Accesses a directory on the host.
11009    ///
11010    /// # Arguments
11011    ///
11012    /// * `path` - Location of the directory to access (e.g., ".").
11013    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11014    pub fn directory_opts<'a>(
11015        &self,
11016        path: impl Into<String>,
11017        opts: HostDirectoryOpts<'a>,
11018    ) -> Directory {
11019        let mut query = self.selection.select("directory");
11020        query = query.arg("path", path.into());
11021        if let Some(exclude) = opts.exclude {
11022            query = query.arg("exclude", exclude);
11023        }
11024        if let Some(include) = opts.include {
11025            query = query.arg("include", include);
11026        }
11027        if let Some(no_cache) = opts.no_cache {
11028            query = query.arg("noCache", no_cache);
11029        }
11030        if let Some(gitignore) = opts.gitignore {
11031            query = query.arg("gitignore", gitignore);
11032        }
11033        Directory {
11034            proc: self.proc.clone(),
11035            selection: query,
11036            graphql_client: self.graphql_client.clone(),
11037        }
11038    }
11039    /// Accesses a file on the host.
11040    ///
11041    /// # Arguments
11042    ///
11043    /// * `path` - Location of the file to retrieve (e.g., "README.md").
11044    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11045    pub fn file(&self, path: impl Into<String>) -> File {
11046        let mut query = self.selection.select("file");
11047        query = query.arg("path", path.into());
11048        File {
11049            proc: self.proc.clone(),
11050            selection: query,
11051            graphql_client: self.graphql_client.clone(),
11052        }
11053    }
11054    /// Accesses a file on the host.
11055    ///
11056    /// # Arguments
11057    ///
11058    /// * `path` - Location of the file to retrieve (e.g., "README.md").
11059    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11060    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
11061        let mut query = self.selection.select("file");
11062        query = query.arg("path", path.into());
11063        if let Some(no_cache) = opts.no_cache {
11064            query = query.arg("noCache", no_cache);
11065        }
11066        File {
11067            proc: self.proc.clone(),
11068            selection: query,
11069            graphql_client: self.graphql_client.clone(),
11070        }
11071    }
11072    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
11073    ///
11074    /// # Arguments
11075    ///
11076    /// * `name` - name of the file or directory to search for
11077    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11078    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
11079        let mut query = self.selection.select("findUp");
11080        query = query.arg("name", name.into());
11081        query.execute(self.graphql_client.clone()).await
11082    }
11083    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
11084    ///
11085    /// # Arguments
11086    ///
11087    /// * `name` - name of the file or directory to search for
11088    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11089    pub async fn find_up_opts(
11090        &self,
11091        name: impl Into<String>,
11092        opts: HostFindUpOpts,
11093    ) -> Result<String, DaggerError> {
11094        let mut query = self.selection.select("findUp");
11095        query = query.arg("name", name.into());
11096        if let Some(no_cache) = opts.no_cache {
11097            query = query.arg("noCache", no_cache);
11098        }
11099        query.execute(self.graphql_client.clone()).await
11100    }
11101    /// A unique identifier for this Host.
11102    pub async fn id(&self) -> Result<HostId, DaggerError> {
11103        let query = self.selection.select("id");
11104        query.execute(self.graphql_client.clone()).await
11105    }
11106    /// Creates a service that forwards traffic to a specified address via the host.
11107    ///
11108    /// # Arguments
11109    ///
11110    /// * `ports` - Ports to expose via the service, forwarding through the host network.
11111    ///
11112    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
11113    ///
11114    /// An empty set of ports is not valid; an error will be returned.
11115    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11116    pub fn service(&self, ports: Vec<PortForward>) -> Service {
11117        let mut query = self.selection.select("service");
11118        query = query.arg("ports", ports);
11119        Service {
11120            proc: self.proc.clone(),
11121            selection: query,
11122            graphql_client: self.graphql_client.clone(),
11123        }
11124    }
11125    /// Creates a service that forwards traffic to a specified address via the host.
11126    ///
11127    /// # Arguments
11128    ///
11129    /// * `ports` - Ports to expose via the service, forwarding through the host network.
11130    ///
11131    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
11132    ///
11133    /// An empty set of ports is not valid; an error will be returned.
11134    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11135    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
11136        let mut query = self.selection.select("service");
11137        query = query.arg("ports", ports);
11138        if let Some(host) = opts.host {
11139            query = query.arg("host", host);
11140        }
11141        Service {
11142            proc: self.proc.clone(),
11143            selection: query,
11144            graphql_client: self.graphql_client.clone(),
11145        }
11146    }
11147    /// Creates a tunnel that forwards traffic from the host to a service.
11148    ///
11149    /// # Arguments
11150    ///
11151    /// * `service` - Service to send traffic from the tunnel.
11152    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11153    pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
11154        let mut query = self.selection.select("tunnel");
11155        query = query.arg_lazy(
11156            "service",
11157            Box::new(move || {
11158                let service = service.clone();
11159                Box::pin(async move { service.into_id().await.unwrap().quote() })
11160            }),
11161        );
11162        Service {
11163            proc: self.proc.clone(),
11164            selection: query,
11165            graphql_client: self.graphql_client.clone(),
11166        }
11167    }
11168    /// Creates a tunnel that forwards traffic from the host to a service.
11169    ///
11170    /// # Arguments
11171    ///
11172    /// * `service` - Service to send traffic from the tunnel.
11173    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11174    pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
11175        let mut query = self.selection.select("tunnel");
11176        query = query.arg_lazy(
11177            "service",
11178            Box::new(move || {
11179                let service = service.clone();
11180                Box::pin(async move { service.into_id().await.unwrap().quote() })
11181            }),
11182        );
11183        if let Some(native) = opts.native {
11184            query = query.arg("native", native);
11185        }
11186        if let Some(ports) = opts.ports {
11187            query = query.arg("ports", ports);
11188        }
11189        Service {
11190            proc: self.proc.clone(),
11191            selection: query,
11192            graphql_client: self.graphql_client.clone(),
11193        }
11194    }
11195    /// Accesses a Unix socket on the host.
11196    ///
11197    /// # Arguments
11198    ///
11199    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
11200    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
11201        let mut query = self.selection.select("unixSocket");
11202        query = query.arg("path", path.into());
11203        Socket {
11204            proc: self.proc.clone(),
11205            selection: query,
11206            graphql_client: self.graphql_client.clone(),
11207        }
11208    }
11209}
11210#[derive(Clone)]
11211pub struct InputTypeDef {
11212    pub proc: Option<Arc<DaggerSessionProc>>,
11213    pub selection: Selection,
11214    pub graphql_client: DynGraphQLClient,
11215}
11216impl InputTypeDef {
11217    /// Static fields defined on this input object, if any.
11218    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
11219        let query = self.selection.select("fields");
11220        let query = query.select("id");
11221        let ids: Vec<FieldTypeDefId> = query.execute(self.graphql_client.clone()).await?;
11222        let root = Query {
11223            proc: self.proc.clone(),
11224            selection: crate::querybuilder::query(),
11225            graphql_client: self.graphql_client.clone(),
11226        };
11227        Ok(ids
11228            .into_iter()
11229            .map(|id| root.load_field_type_def_from_id(id))
11230            .collect())
11231    }
11232    /// A unique identifier for this InputTypeDef.
11233    pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
11234        let query = self.selection.select("id");
11235        query.execute(self.graphql_client.clone()).await
11236    }
11237    /// The name of the input object.
11238    pub async fn name(&self) -> Result<String, DaggerError> {
11239        let query = self.selection.select("name");
11240        query.execute(self.graphql_client.clone()).await
11241    }
11242}
11243#[derive(Clone)]
11244pub struct InterfaceTypeDef {
11245    pub proc: Option<Arc<DaggerSessionProc>>,
11246    pub selection: Selection,
11247    pub graphql_client: DynGraphQLClient,
11248}
11249impl InterfaceTypeDef {
11250    /// The doc string for the interface, if any.
11251    pub async fn description(&self) -> Result<String, DaggerError> {
11252        let query = self.selection.select("description");
11253        query.execute(self.graphql_client.clone()).await
11254    }
11255    /// Functions defined on this interface, if any.
11256    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
11257        let query = self.selection.select("functions");
11258        let query = query.select("id");
11259        let ids: Vec<FunctionId> = query.execute(self.graphql_client.clone()).await?;
11260        let root = Query {
11261            proc: self.proc.clone(),
11262            selection: crate::querybuilder::query(),
11263            graphql_client: self.graphql_client.clone(),
11264        };
11265        Ok(ids
11266            .into_iter()
11267            .map(|id| root.load_function_from_id(id))
11268            .collect())
11269    }
11270    /// A unique identifier for this InterfaceTypeDef.
11271    pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
11272        let query = self.selection.select("id");
11273        query.execute(self.graphql_client.clone()).await
11274    }
11275    /// The name of the interface.
11276    pub async fn name(&self) -> Result<String, DaggerError> {
11277        let query = self.selection.select("name");
11278        query.execute(self.graphql_client.clone()).await
11279    }
11280    /// The location of this interface declaration.
11281    pub fn source_map(&self) -> SourceMap {
11282        let query = self.selection.select("sourceMap");
11283        SourceMap {
11284            proc: self.proc.clone(),
11285            selection: query,
11286            graphql_client: self.graphql_client.clone(),
11287        }
11288    }
11289    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
11290    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
11291        let query = self.selection.select("sourceModuleName");
11292        query.execute(self.graphql_client.clone()).await
11293    }
11294}
11295#[derive(Clone)]
11296pub struct JsonValue {
11297    pub proc: Option<Arc<DaggerSessionProc>>,
11298    pub selection: Selection,
11299    pub graphql_client: DynGraphQLClient,
11300}
11301#[derive(Builder, Debug, PartialEq)]
11302pub struct JsonValueContentsOpts<'a> {
11303    /// Optional line prefix
11304    #[builder(setter(into, strip_option), default)]
11305    pub indent: Option<&'a str>,
11306    /// Pretty-print
11307    #[builder(setter(into, strip_option), default)]
11308    pub pretty: Option<bool>,
11309}
11310impl JsonValue {
11311    /// Decode an array from json
11312    pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
11313        let query = self.selection.select("asArray");
11314        let query = query.select("id");
11315        let ids: Vec<JsonValueId> = query.execute(self.graphql_client.clone()).await?;
11316        let root = Query {
11317            proc: self.proc.clone(),
11318            selection: crate::querybuilder::query(),
11319            graphql_client: self.graphql_client.clone(),
11320        };
11321        Ok(ids
11322            .into_iter()
11323            .map(|id| root.load_json_value_from_id(id))
11324            .collect())
11325    }
11326    /// Decode a boolean from json
11327    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
11328        let query = self.selection.select("asBoolean");
11329        query.execute(self.graphql_client.clone()).await
11330    }
11331    /// Decode an integer from json
11332    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
11333        let query = self.selection.select("asInteger");
11334        query.execute(self.graphql_client.clone()).await
11335    }
11336    /// Decode a string from json
11337    pub async fn as_string(&self) -> Result<String, DaggerError> {
11338        let query = self.selection.select("asString");
11339        query.execute(self.graphql_client.clone()).await
11340    }
11341    /// Return the value encoded as json
11342    ///
11343    /// # Arguments
11344    ///
11345    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11346    pub async fn contents(&self) -> Result<Json, DaggerError> {
11347        let query = self.selection.select("contents");
11348        query.execute(self.graphql_client.clone()).await
11349    }
11350    /// Return the value encoded as json
11351    ///
11352    /// # Arguments
11353    ///
11354    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11355    pub async fn contents_opts<'a>(
11356        &self,
11357        opts: JsonValueContentsOpts<'a>,
11358    ) -> Result<Json, DaggerError> {
11359        let mut query = self.selection.select("contents");
11360        if let Some(pretty) = opts.pretty {
11361            query = query.arg("pretty", pretty);
11362        }
11363        if let Some(indent) = opts.indent {
11364            query = query.arg("indent", indent);
11365        }
11366        query.execute(self.graphql_client.clone()).await
11367    }
11368    /// Lookup the field at the given path, and return its value.
11369    ///
11370    /// # Arguments
11371    ///
11372    /// * `path` - Path of the field to lookup, encoded as an array of field names
11373    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
11374        let mut query = self.selection.select("field");
11375        query = query.arg(
11376            "path",
11377            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11378        );
11379        JsonValue {
11380            proc: self.proc.clone(),
11381            selection: query,
11382            graphql_client: self.graphql_client.clone(),
11383        }
11384    }
11385    /// List fields of the encoded object
11386    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
11387        let query = self.selection.select("fields");
11388        query.execute(self.graphql_client.clone()).await
11389    }
11390    /// A unique identifier for this JSONValue.
11391    pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
11392        let query = self.selection.select("id");
11393        query.execute(self.graphql_client.clone()).await
11394    }
11395    /// Encode a boolean to json
11396    ///
11397    /// # Arguments
11398    ///
11399    /// * `value` - New boolean value
11400    pub fn new_boolean(&self, value: bool) -> JsonValue {
11401        let mut query = self.selection.select("newBoolean");
11402        query = query.arg("value", value);
11403        JsonValue {
11404            proc: self.proc.clone(),
11405            selection: query,
11406            graphql_client: self.graphql_client.clone(),
11407        }
11408    }
11409    /// Encode an integer to json
11410    ///
11411    /// # Arguments
11412    ///
11413    /// * `value` - New integer value
11414    pub fn new_integer(&self, value: isize) -> JsonValue {
11415        let mut query = self.selection.select("newInteger");
11416        query = query.arg("value", value);
11417        JsonValue {
11418            proc: self.proc.clone(),
11419            selection: query,
11420            graphql_client: self.graphql_client.clone(),
11421        }
11422    }
11423    /// Encode a string to json
11424    ///
11425    /// # Arguments
11426    ///
11427    /// * `value` - New string value
11428    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
11429        let mut query = self.selection.select("newString");
11430        query = query.arg("value", value.into());
11431        JsonValue {
11432            proc: self.proc.clone(),
11433            selection: query,
11434            graphql_client: self.graphql_client.clone(),
11435        }
11436    }
11437    /// Return a new json value, decoded from the given content
11438    ///
11439    /// # Arguments
11440    ///
11441    /// * `contents` - New JSON-encoded contents
11442    pub fn with_contents(&self, contents: Json) -> JsonValue {
11443        let mut query = self.selection.select("withContents");
11444        query = query.arg("contents", contents);
11445        JsonValue {
11446            proc: self.proc.clone(),
11447            selection: query,
11448            graphql_client: self.graphql_client.clone(),
11449        }
11450    }
11451    /// Set a new field at the given path
11452    ///
11453    /// # Arguments
11454    ///
11455    /// * `path` - Path of the field to set, encoded as an array of field names
11456    /// * `value` - The new value of the field
11457    pub fn with_field(
11458        &self,
11459        path: Vec<impl Into<String>>,
11460        value: impl IntoID<JsonValueId>,
11461    ) -> JsonValue {
11462        let mut query = self.selection.select("withField");
11463        query = query.arg(
11464            "path",
11465            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11466        );
11467        query = query.arg_lazy(
11468            "value",
11469            Box::new(move || {
11470                let value = value.clone();
11471                Box::pin(async move { value.into_id().await.unwrap().quote() })
11472            }),
11473        );
11474        JsonValue {
11475            proc: self.proc.clone(),
11476            selection: query,
11477            graphql_client: self.graphql_client.clone(),
11478        }
11479    }
11480}
11481#[derive(Clone)]
11482pub struct Llm {
11483    pub proc: Option<Arc<DaggerSessionProc>>,
11484    pub selection: Selection,
11485    pub graphql_client: DynGraphQLClient,
11486}
11487impl Llm {
11488    /// create a branch in the LLM's history
11489    pub fn attempt(&self, number: isize) -> Llm {
11490        let mut query = self.selection.select("attempt");
11491        query = query.arg("number", number);
11492        Llm {
11493            proc: self.proc.clone(),
11494            selection: query,
11495            graphql_client: self.graphql_client.clone(),
11496        }
11497    }
11498    /// returns the type of the current state
11499    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
11500        let mut query = self.selection.select("bindResult");
11501        query = query.arg("name", name.into());
11502        Binding {
11503            proc: self.proc.clone(),
11504            selection: query,
11505            graphql_client: self.graphql_client.clone(),
11506        }
11507    }
11508    /// return the LLM's current environment
11509    pub fn env(&self) -> Env {
11510        let query = self.selection.select("env");
11511        Env {
11512            proc: self.proc.clone(),
11513            selection: query,
11514            graphql_client: self.graphql_client.clone(),
11515        }
11516    }
11517    /// Indicates whether there are any queued prompts or tool results to send to the model
11518    pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
11519        let query = self.selection.select("hasPrompt");
11520        query.execute(self.graphql_client.clone()).await
11521    }
11522    /// return the llm message history
11523    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
11524        let query = self.selection.select("history");
11525        query.execute(self.graphql_client.clone()).await
11526    }
11527    /// return the raw llm message history as json
11528    pub async fn history_json(&self) -> Result<Json, DaggerError> {
11529        let query = self.selection.select("historyJSON");
11530        query.execute(self.graphql_client.clone()).await
11531    }
11532    /// A unique identifier for this LLM.
11533    pub async fn id(&self) -> Result<Llmid, DaggerError> {
11534        let query = self.selection.select("id");
11535        query.execute(self.graphql_client.clone()).await
11536    }
11537    /// return the last llm reply from the history
11538    pub async fn last_reply(&self) -> Result<String, DaggerError> {
11539        let query = self.selection.select("lastReply");
11540        query.execute(self.graphql_client.clone()).await
11541    }
11542    /// Submit the queued prompt, evaluate any tool calls, queue their results, and keep going until the model ends its turn
11543    pub fn r#loop(&self) -> Llm {
11544        let query = self.selection.select("loop");
11545        Llm {
11546            proc: self.proc.clone(),
11547            selection: query,
11548            graphql_client: self.graphql_client.clone(),
11549        }
11550    }
11551    /// return the model used by the llm
11552    pub async fn model(&self) -> Result<String, DaggerError> {
11553        let query = self.selection.select("model");
11554        query.execute(self.graphql_client.clone()).await
11555    }
11556    /// return the provider used by the llm
11557    pub async fn provider(&self) -> Result<String, DaggerError> {
11558        let query = self.selection.select("provider");
11559        query.execute(self.graphql_client.clone()).await
11560    }
11561    /// Submit the queued prompt or tool call results, evaluate any tool calls, and queue their results
11562    pub async fn step(&self) -> Result<Llmid, DaggerError> {
11563        let query = self.selection.select("step");
11564        query.execute(self.graphql_client.clone()).await
11565    }
11566    /// synchronize LLM state
11567    pub async fn sync(&self) -> Result<Llmid, DaggerError> {
11568        let query = self.selection.select("sync");
11569        query.execute(self.graphql_client.clone()).await
11570    }
11571    /// returns the token usage of the current state
11572    pub fn token_usage(&self) -> LlmTokenUsage {
11573        let query = self.selection.select("tokenUsage");
11574        LlmTokenUsage {
11575            proc: self.proc.clone(),
11576            selection: query,
11577            graphql_client: self.graphql_client.clone(),
11578        }
11579    }
11580    /// print documentation for available tools
11581    pub async fn tools(&self) -> Result<String, DaggerError> {
11582        let query = self.selection.select("tools");
11583        query.execute(self.graphql_client.clone()).await
11584    }
11585    /// Return a new LLM with the specified function no longer exposed as a tool
11586    ///
11587    /// # Arguments
11588    ///
11589    /// * `type_name` - The type name whose function will be blocked
11590    /// * `function` - The function to block
11591    ///
11592    /// Will be converted to lowerCamelCase if necessary.
11593    pub fn with_blocked_function(
11594        &self,
11595        type_name: impl Into<String>,
11596        function: impl Into<String>,
11597    ) -> Llm {
11598        let mut query = self.selection.select("withBlockedFunction");
11599        query = query.arg("typeName", type_name.into());
11600        query = query.arg("function", function.into());
11601        Llm {
11602            proc: self.proc.clone(),
11603            selection: query,
11604            graphql_client: self.graphql_client.clone(),
11605        }
11606    }
11607    /// allow the LLM to interact with an environment via MCP
11608    pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
11609        let mut query = self.selection.select("withEnv");
11610        query = query.arg_lazy(
11611            "env",
11612            Box::new(move || {
11613                let env = env.clone();
11614                Box::pin(async move { env.into_id().await.unwrap().quote() })
11615            }),
11616        );
11617        Llm {
11618            proc: self.proc.clone(),
11619            selection: query,
11620            graphql_client: self.graphql_client.clone(),
11621        }
11622    }
11623    /// Add an external MCP server to the LLM
11624    ///
11625    /// # Arguments
11626    ///
11627    /// * `name` - The name of the MCP server
11628    /// * `service` - The MCP service to run and communicate with over stdio
11629    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<ServiceId>) -> Llm {
11630        let mut query = self.selection.select("withMCPServer");
11631        query = query.arg("name", name.into());
11632        query = query.arg_lazy(
11633            "service",
11634            Box::new(move || {
11635                let service = service.clone();
11636                Box::pin(async move { service.into_id().await.unwrap().quote() })
11637            }),
11638        );
11639        Llm {
11640            proc: self.proc.clone(),
11641            selection: query,
11642            graphql_client: self.graphql_client.clone(),
11643        }
11644    }
11645    /// swap out the llm model
11646    ///
11647    /// # Arguments
11648    ///
11649    /// * `model` - The model to use
11650    pub fn with_model(&self, model: impl Into<String>) -> Llm {
11651        let mut query = self.selection.select("withModel");
11652        query = query.arg("model", model.into());
11653        Llm {
11654            proc: self.proc.clone(),
11655            selection: query,
11656            graphql_client: self.graphql_client.clone(),
11657        }
11658    }
11659    /// append a prompt to the llm context
11660    ///
11661    /// # Arguments
11662    ///
11663    /// * `prompt` - The prompt to send
11664    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
11665        let mut query = self.selection.select("withPrompt");
11666        query = query.arg("prompt", prompt.into());
11667        Llm {
11668            proc: self.proc.clone(),
11669            selection: query,
11670            graphql_client: self.graphql_client.clone(),
11671        }
11672    }
11673    /// append the contents of a file to the llm context
11674    ///
11675    /// # Arguments
11676    ///
11677    /// * `file` - The file to read the prompt from
11678    pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
11679        let mut query = self.selection.select("withPromptFile");
11680        query = query.arg_lazy(
11681            "file",
11682            Box::new(move || {
11683                let file = file.clone();
11684                Box::pin(async move { file.into_id().await.unwrap().quote() })
11685            }),
11686        );
11687        Llm {
11688            proc: self.proc.clone(),
11689            selection: query,
11690            graphql_client: self.graphql_client.clone(),
11691        }
11692    }
11693    /// Use a static set of tools for method calls, e.g. for MCP clients that do not support dynamic tool registration
11694    pub fn with_static_tools(&self) -> Llm {
11695        let query = self.selection.select("withStaticTools");
11696        Llm {
11697            proc: self.proc.clone(),
11698            selection: query,
11699            graphql_client: self.graphql_client.clone(),
11700        }
11701    }
11702    /// Add a system prompt to the LLM's environment
11703    ///
11704    /// # Arguments
11705    ///
11706    /// * `prompt` - The system prompt to send
11707    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
11708        let mut query = self.selection.select("withSystemPrompt");
11709        query = query.arg("prompt", prompt.into());
11710        Llm {
11711            proc: self.proc.clone(),
11712            selection: query,
11713            graphql_client: self.graphql_client.clone(),
11714        }
11715    }
11716    /// Disable the default system prompt
11717    pub fn without_default_system_prompt(&self) -> Llm {
11718        let query = self.selection.select("withoutDefaultSystemPrompt");
11719        Llm {
11720            proc: self.proc.clone(),
11721            selection: query,
11722            graphql_client: self.graphql_client.clone(),
11723        }
11724    }
11725    /// Clear the message history, leaving only the system prompts
11726    pub fn without_message_history(&self) -> Llm {
11727        let query = self.selection.select("withoutMessageHistory");
11728        Llm {
11729            proc: self.proc.clone(),
11730            selection: query,
11731            graphql_client: self.graphql_client.clone(),
11732        }
11733    }
11734    /// Clear the system prompts, leaving only the default system prompt
11735    pub fn without_system_prompts(&self) -> Llm {
11736        let query = self.selection.select("withoutSystemPrompts");
11737        Llm {
11738            proc: self.proc.clone(),
11739            selection: query,
11740            graphql_client: self.graphql_client.clone(),
11741        }
11742    }
11743}
11744#[derive(Clone)]
11745pub struct LlmTokenUsage {
11746    pub proc: Option<Arc<DaggerSessionProc>>,
11747    pub selection: Selection,
11748    pub graphql_client: DynGraphQLClient,
11749}
11750impl LlmTokenUsage {
11751    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
11752        let query = self.selection.select("cachedTokenReads");
11753        query.execute(self.graphql_client.clone()).await
11754    }
11755    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
11756        let query = self.selection.select("cachedTokenWrites");
11757        query.execute(self.graphql_client.clone()).await
11758    }
11759    /// A unique identifier for this LLMTokenUsage.
11760    pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
11761        let query = self.selection.select("id");
11762        query.execute(self.graphql_client.clone()).await
11763    }
11764    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
11765        let query = self.selection.select("inputTokens");
11766        query.execute(self.graphql_client.clone()).await
11767    }
11768    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
11769        let query = self.selection.select("outputTokens");
11770        query.execute(self.graphql_client.clone()).await
11771    }
11772    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
11773        let query = self.selection.select("totalTokens");
11774        query.execute(self.graphql_client.clone()).await
11775    }
11776}
11777#[derive(Clone)]
11778pub struct Label {
11779    pub proc: Option<Arc<DaggerSessionProc>>,
11780    pub selection: Selection,
11781    pub graphql_client: DynGraphQLClient,
11782}
11783impl Label {
11784    /// A unique identifier for this Label.
11785    pub async fn id(&self) -> Result<LabelId, DaggerError> {
11786        let query = self.selection.select("id");
11787        query.execute(self.graphql_client.clone()).await
11788    }
11789    /// The label name.
11790    pub async fn name(&self) -> Result<String, DaggerError> {
11791        let query = self.selection.select("name");
11792        query.execute(self.graphql_client.clone()).await
11793    }
11794    /// The label value.
11795    pub async fn value(&self) -> Result<String, DaggerError> {
11796        let query = self.selection.select("value");
11797        query.execute(self.graphql_client.clone()).await
11798    }
11799}
11800#[derive(Clone)]
11801pub struct ListTypeDef {
11802    pub proc: Option<Arc<DaggerSessionProc>>,
11803    pub selection: Selection,
11804    pub graphql_client: DynGraphQLClient,
11805}
11806impl ListTypeDef {
11807    /// The type of the elements in the list.
11808    pub fn element_type_def(&self) -> TypeDef {
11809        let query = self.selection.select("elementTypeDef");
11810        TypeDef {
11811            proc: self.proc.clone(),
11812            selection: query,
11813            graphql_client: self.graphql_client.clone(),
11814        }
11815    }
11816    /// A unique identifier for this ListTypeDef.
11817    pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
11818        let query = self.selection.select("id");
11819        query.execute(self.graphql_client.clone()).await
11820    }
11821}
11822#[derive(Clone)]
11823pub struct Module {
11824    pub proc: Option<Arc<DaggerSessionProc>>,
11825    pub selection: Selection,
11826    pub graphql_client: DynGraphQLClient,
11827}
11828#[derive(Builder, Debug, PartialEq)]
11829pub struct ModuleChecksOpts<'a> {
11830    /// Only include checks matching the specified patterns
11831    #[builder(setter(into, strip_option), default)]
11832    pub include: Option<Vec<&'a str>>,
11833    /// When true, only return annotated check functions; exclude generate-as-checks
11834    #[builder(setter(into, strip_option), default)]
11835    pub no_generate: Option<bool>,
11836}
11837#[derive(Builder, Debug, PartialEq)]
11838pub struct ModuleGeneratorsOpts<'a> {
11839    /// Only include generators matching the specified patterns
11840    #[builder(setter(into, strip_option), default)]
11841    pub include: Option<Vec<&'a str>>,
11842}
11843#[derive(Builder, Debug, PartialEq)]
11844pub struct ModuleServeOpts {
11845    /// Install the module as the entrypoint, promoting its main-object methods onto the Query root
11846    #[builder(setter(into, strip_option), default)]
11847    pub entrypoint: Option<bool>,
11848    /// Expose the dependencies of this module to the client
11849    #[builder(setter(into, strip_option), default)]
11850    pub include_dependencies: Option<bool>,
11851}
11852#[derive(Builder, Debug, PartialEq)]
11853pub struct ModuleServicesOpts<'a> {
11854    /// Only include services matching the specified patterns
11855    #[builder(setter(into, strip_option), default)]
11856    pub include: Option<Vec<&'a str>>,
11857}
11858impl Module {
11859    /// Return the check defined by the module with the given name. Must match to exactly one check.
11860    ///
11861    /// # Arguments
11862    ///
11863    /// * `name` - The name of the check to retrieve
11864    pub fn check(&self, name: impl Into<String>) -> Check {
11865        let mut query = self.selection.select("check");
11866        query = query.arg("name", name.into());
11867        Check {
11868            proc: self.proc.clone(),
11869            selection: query,
11870            graphql_client: self.graphql_client.clone(),
11871        }
11872    }
11873    /// Return all checks defined by the module
11874    ///
11875    /// # Arguments
11876    ///
11877    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11878    pub fn checks(&self) -> CheckGroup {
11879        let query = self.selection.select("checks");
11880        CheckGroup {
11881            proc: self.proc.clone(),
11882            selection: query,
11883            graphql_client: self.graphql_client.clone(),
11884        }
11885    }
11886    /// Return all checks defined by the module
11887    ///
11888    /// # Arguments
11889    ///
11890    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11891    pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
11892        let mut query = self.selection.select("checks");
11893        if let Some(include) = opts.include {
11894            query = query.arg("include", include);
11895        }
11896        if let Some(no_generate) = opts.no_generate {
11897            query = query.arg("noGenerate", no_generate);
11898        }
11899        CheckGroup {
11900            proc: self.proc.clone(),
11901            selection: query,
11902            graphql_client: self.graphql_client.clone(),
11903        }
11904    }
11905    /// The dependencies of the module.
11906    pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
11907        let query = self.selection.select("dependencies");
11908        let query = query.select("id");
11909        let ids: Vec<ModuleId> = query.execute(self.graphql_client.clone()).await?;
11910        let root = Query {
11911            proc: self.proc.clone(),
11912            selection: crate::querybuilder::query(),
11913            graphql_client: self.graphql_client.clone(),
11914        };
11915        Ok(ids
11916            .into_iter()
11917            .map(|id| root.load_module_from_id(id))
11918            .collect())
11919    }
11920    /// The doc string of the module, if any
11921    pub async fn description(&self) -> Result<String, DaggerError> {
11922        let query = self.selection.select("description");
11923        query.execute(self.graphql_client.clone()).await
11924    }
11925    /// Enumerations served by this module.
11926    pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
11927        let query = self.selection.select("enums");
11928        let query = query.select("id");
11929        let ids: Vec<TypeDefId> = query.execute(self.graphql_client.clone()).await?;
11930        let root = Query {
11931            proc: self.proc.clone(),
11932            selection: crate::querybuilder::query(),
11933            graphql_client: self.graphql_client.clone(),
11934        };
11935        Ok(ids
11936            .into_iter()
11937            .map(|id| root.load_type_def_from_id(id))
11938            .collect())
11939    }
11940    /// The generated files and directories made on top of the module source's context directory.
11941    pub fn generated_context_directory(&self) -> Directory {
11942        let query = self.selection.select("generatedContextDirectory");
11943        Directory {
11944            proc: self.proc.clone(),
11945            selection: query,
11946            graphql_client: self.graphql_client.clone(),
11947        }
11948    }
11949    /// Return the generator defined by the module with the given name. Must match to exactly one generator.
11950    ///
11951    /// # Arguments
11952    ///
11953    /// * `name` - The name of the generator to retrieve
11954    pub fn generator(&self, name: impl Into<String>) -> Generator {
11955        let mut query = self.selection.select("generator");
11956        query = query.arg("name", name.into());
11957        Generator {
11958            proc: self.proc.clone(),
11959            selection: query,
11960            graphql_client: self.graphql_client.clone(),
11961        }
11962    }
11963    /// Return all generators defined by the module
11964    ///
11965    /// # Arguments
11966    ///
11967    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11968    pub fn generators(&self) -> GeneratorGroup {
11969        let query = self.selection.select("generators");
11970        GeneratorGroup {
11971            proc: self.proc.clone(),
11972            selection: query,
11973            graphql_client: self.graphql_client.clone(),
11974        }
11975    }
11976    /// Return all generators defined by the module
11977    ///
11978    /// # Arguments
11979    ///
11980    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11981    pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
11982        let mut query = self.selection.select("generators");
11983        if let Some(include) = opts.include {
11984            query = query.arg("include", include);
11985        }
11986        GeneratorGroup {
11987            proc: self.proc.clone(),
11988            selection: query,
11989            graphql_client: self.graphql_client.clone(),
11990        }
11991    }
11992    /// A unique identifier for this Module.
11993    pub async fn id(&self) -> Result<ModuleId, DaggerError> {
11994        let query = self.selection.select("id");
11995        query.execute(self.graphql_client.clone()).await
11996    }
11997    /// Interfaces served by this module.
11998    pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
11999        let query = self.selection.select("interfaces");
12000        let query = query.select("id");
12001        let ids: Vec<TypeDefId> = query.execute(self.graphql_client.clone()).await?;
12002        let root = Query {
12003            proc: self.proc.clone(),
12004            selection: crate::querybuilder::query(),
12005            graphql_client: self.graphql_client.clone(),
12006        };
12007        Ok(ids
12008            .into_iter()
12009            .map(|id| root.load_type_def_from_id(id))
12010            .collect())
12011    }
12012    /// The introspection schema JSON file for this module.
12013    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
12014    /// Note: this is in the context of a module, so some core types may be hidden.
12015    pub fn introspection_schema_json(&self) -> File {
12016        let query = self.selection.select("introspectionSchemaJSON");
12017        File {
12018            proc: self.proc.clone(),
12019            selection: query,
12020            graphql_client: self.graphql_client.clone(),
12021        }
12022    }
12023    /// The name of the module
12024    pub async fn name(&self) -> Result<String, DaggerError> {
12025        let query = self.selection.select("name");
12026        query.execute(self.graphql_client.clone()).await
12027    }
12028    /// Objects served by this module.
12029    pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
12030        let query = self.selection.select("objects");
12031        let query = query.select("id");
12032        let ids: Vec<TypeDefId> = query.execute(self.graphql_client.clone()).await?;
12033        let root = Query {
12034            proc: self.proc.clone(),
12035            selection: crate::querybuilder::query(),
12036            graphql_client: self.graphql_client.clone(),
12037        };
12038        Ok(ids
12039            .into_iter()
12040            .map(|id| root.load_type_def_from_id(id))
12041            .collect())
12042    }
12043    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
12044    pub fn runtime(&self) -> Container {
12045        let query = self.selection.select("runtime");
12046        Container {
12047            proc: self.proc.clone(),
12048            selection: query,
12049            graphql_client: self.graphql_client.clone(),
12050        }
12051    }
12052    /// The SDK config used by this module.
12053    pub fn sdk(&self) -> SdkConfig {
12054        let query = self.selection.select("sdk");
12055        SdkConfig {
12056            proc: self.proc.clone(),
12057            selection: query,
12058            graphql_client: self.graphql_client.clone(),
12059        }
12060    }
12061    /// Serve a module's API in the current session.
12062    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
12063    ///
12064    /// # Arguments
12065    ///
12066    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12067    pub async fn serve(&self) -> Result<Void, DaggerError> {
12068        let query = self.selection.select("serve");
12069        query.execute(self.graphql_client.clone()).await
12070    }
12071    /// Serve a module's API in the current session.
12072    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
12073    ///
12074    /// # Arguments
12075    ///
12076    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12077    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
12078        let mut query = self.selection.select("serve");
12079        if let Some(include_dependencies) = opts.include_dependencies {
12080            query = query.arg("includeDependencies", include_dependencies);
12081        }
12082        if let Some(entrypoint) = opts.entrypoint {
12083            query = query.arg("entrypoint", entrypoint);
12084        }
12085        query.execute(self.graphql_client.clone()).await
12086    }
12087    /// Return all services defined by the module
12088    ///
12089    /// # Arguments
12090    ///
12091    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12092    pub fn services(&self) -> UpGroup {
12093        let query = self.selection.select("services");
12094        UpGroup {
12095            proc: self.proc.clone(),
12096            selection: query,
12097            graphql_client: self.graphql_client.clone(),
12098        }
12099    }
12100    /// Return all services defined by the module
12101    ///
12102    /// # Arguments
12103    ///
12104    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12105    pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
12106        let mut query = self.selection.select("services");
12107        if let Some(include) = opts.include {
12108            query = query.arg("include", include);
12109        }
12110        UpGroup {
12111            proc: self.proc.clone(),
12112            selection: query,
12113            graphql_client: self.graphql_client.clone(),
12114        }
12115    }
12116    /// The source for the module.
12117    pub fn source(&self) -> ModuleSource {
12118        let query = self.selection.select("source");
12119        ModuleSource {
12120            proc: self.proc.clone(),
12121            selection: query,
12122            graphql_client: self.graphql_client.clone(),
12123        }
12124    }
12125    /// Forces evaluation of the module, including any loading into the engine and associated validation.
12126    pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
12127        let query = self.selection.select("sync");
12128        query.execute(self.graphql_client.clone()).await
12129    }
12130    /// User-defined default values, loaded from local .env files.
12131    pub fn user_defaults(&self) -> EnvFile {
12132        let query = self.selection.select("userDefaults");
12133        EnvFile {
12134            proc: self.proc.clone(),
12135            selection: query,
12136            graphql_client: self.graphql_client.clone(),
12137        }
12138    }
12139    /// Retrieves the module with the given description
12140    ///
12141    /// # Arguments
12142    ///
12143    /// * `description` - The description to set
12144    pub fn with_description(&self, description: impl Into<String>) -> Module {
12145        let mut query = self.selection.select("withDescription");
12146        query = query.arg("description", description.into());
12147        Module {
12148            proc: self.proc.clone(),
12149            selection: query,
12150            graphql_client: self.graphql_client.clone(),
12151        }
12152    }
12153    /// This module plus the given Enum type and associated values
12154    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
12155        let mut query = self.selection.select("withEnum");
12156        query = query.arg_lazy(
12157            "enum",
12158            Box::new(move || {
12159                let r#enum = r#enum.clone();
12160                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
12161            }),
12162        );
12163        Module {
12164            proc: self.proc.clone(),
12165            selection: query,
12166            graphql_client: self.graphql_client.clone(),
12167        }
12168    }
12169    /// This module plus the given Interface type and associated functions
12170    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
12171        let mut query = self.selection.select("withInterface");
12172        query = query.arg_lazy(
12173            "iface",
12174            Box::new(move || {
12175                let iface = iface.clone();
12176                Box::pin(async move { iface.into_id().await.unwrap().quote() })
12177            }),
12178        );
12179        Module {
12180            proc: self.proc.clone(),
12181            selection: query,
12182            graphql_client: self.graphql_client.clone(),
12183        }
12184    }
12185    /// This module plus the given Object type and associated functions.
12186    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
12187        let mut query = self.selection.select("withObject");
12188        query = query.arg_lazy(
12189            "object",
12190            Box::new(move || {
12191                let object = object.clone();
12192                Box::pin(async move { object.into_id().await.unwrap().quote() })
12193            }),
12194        );
12195        Module {
12196            proc: self.proc.clone(),
12197            selection: query,
12198            graphql_client: self.graphql_client.clone(),
12199        }
12200    }
12201}
12202#[derive(Clone)]
12203pub struct ModuleConfigClient {
12204    pub proc: Option<Arc<DaggerSessionProc>>,
12205    pub selection: Selection,
12206    pub graphql_client: DynGraphQLClient,
12207}
12208impl ModuleConfigClient {
12209    /// The directory the client is generated in.
12210    pub async fn directory(&self) -> Result<String, DaggerError> {
12211        let query = self.selection.select("directory");
12212        query.execute(self.graphql_client.clone()).await
12213    }
12214    /// The generator to use
12215    pub async fn generator(&self) -> Result<String, DaggerError> {
12216        let query = self.selection.select("generator");
12217        query.execute(self.graphql_client.clone()).await
12218    }
12219    /// A unique identifier for this ModuleConfigClient.
12220    pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
12221        let query = self.selection.select("id");
12222        query.execute(self.graphql_client.clone()).await
12223    }
12224}
12225#[derive(Clone)]
12226pub struct ModuleSource {
12227    pub proc: Option<Arc<DaggerSessionProc>>,
12228    pub selection: Selection,
12229    pub graphql_client: DynGraphQLClient,
12230}
12231impl ModuleSource {
12232    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
12233    pub fn as_module(&self) -> Module {
12234        let query = self.selection.select("asModule");
12235        Module {
12236            proc: self.proc.clone(),
12237            selection: query,
12238            graphql_client: self.graphql_client.clone(),
12239        }
12240    }
12241    /// A human readable ref string representation of this module source.
12242    pub async fn as_string(&self) -> Result<String, DaggerError> {
12243        let query = self.selection.select("asString");
12244        query.execute(self.graphql_client.clone()).await
12245    }
12246    /// The blueprint referenced by the module source.
12247    pub fn blueprint(&self) -> ModuleSource {
12248        let query = self.selection.select("blueprint");
12249        ModuleSource {
12250            proc: self.proc.clone(),
12251            selection: query,
12252            graphql_client: self.graphql_client.clone(),
12253        }
12254    }
12255    /// The ref to clone the root of the git repo from. Only valid for git sources.
12256    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
12257        let query = self.selection.select("cloneRef");
12258        query.execute(self.graphql_client.clone()).await
12259    }
12260    /// The resolved commit of the git repo this source points to.
12261    pub async fn commit(&self) -> Result<String, DaggerError> {
12262        let query = self.selection.select("commit");
12263        query.execute(self.graphql_client.clone()).await
12264    }
12265    /// The clients generated for the module.
12266    pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
12267        let query = self.selection.select("configClients");
12268        let query = query.select("id");
12269        let ids: Vec<ModuleConfigClientId> = query.execute(self.graphql_client.clone()).await?;
12270        let root = Query {
12271            proc: self.proc.clone(),
12272            selection: crate::querybuilder::query(),
12273            graphql_client: self.graphql_client.clone(),
12274        };
12275        Ok(ids
12276            .into_iter()
12277            .map(|id| root.load_module_config_client_from_id(id))
12278            .collect())
12279    }
12280    /// Whether an existing dagger.json for the module was found.
12281    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
12282        let query = self.selection.select("configExists");
12283        query.execute(self.graphql_client.clone()).await
12284    }
12285    /// The full directory loaded for the module source, including the source code as a subdirectory.
12286    pub fn context_directory(&self) -> Directory {
12287        let query = self.selection.select("contextDirectory");
12288        Directory {
12289            proc: self.proc.clone(),
12290            selection: query,
12291            graphql_client: self.graphql_client.clone(),
12292        }
12293    }
12294    /// The dependencies of the module source.
12295    pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12296        let query = self.selection.select("dependencies");
12297        let query = query.select("id");
12298        let ids: Vec<ModuleSourceId> = query.execute(self.graphql_client.clone()).await?;
12299        let root = Query {
12300            proc: self.proc.clone(),
12301            selection: crate::querybuilder::query(),
12302            graphql_client: self.graphql_client.clone(),
12303        };
12304        Ok(ids
12305            .into_iter()
12306            .map(|id| root.load_module_source_from_id(id))
12307            .collect())
12308    }
12309    /// 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.
12310    pub async fn digest(&self) -> Result<String, DaggerError> {
12311        let query = self.selection.select("digest");
12312        query.execute(self.graphql_client.clone()).await
12313    }
12314    /// The directory containing the module configuration and source code (source code may be in a subdir).
12315    ///
12316    /// # Arguments
12317    ///
12318    /// * `path` - A subpath from the source directory to select.
12319    pub fn directory(&self, path: impl Into<String>) -> Directory {
12320        let mut query = self.selection.select("directory");
12321        query = query.arg("path", path.into());
12322        Directory {
12323            proc: self.proc.clone(),
12324            selection: query,
12325            graphql_client: self.graphql_client.clone(),
12326        }
12327    }
12328    /// The engine version of the module.
12329    pub async fn engine_version(&self) -> Result<String, DaggerError> {
12330        let query = self.selection.select("engineVersion");
12331        query.execute(self.graphql_client.clone()).await
12332    }
12333    /// The generated files and directories made on top of the module source's context directory, returned as a Changeset.
12334    pub fn generated_context_changeset(&self) -> Changeset {
12335        let query = self.selection.select("generatedContextChangeset");
12336        Changeset {
12337            proc: self.proc.clone(),
12338            selection: query,
12339            graphql_client: self.graphql_client.clone(),
12340        }
12341    }
12342    /// The generated files and directories made on top of the module source's context directory.
12343    pub fn generated_context_directory(&self) -> Directory {
12344        let query = self.selection.select("generatedContextDirectory");
12345        Directory {
12346            proc: self.proc.clone(),
12347            selection: query,
12348            graphql_client: self.graphql_client.clone(),
12349        }
12350    }
12351    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
12352    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
12353        let query = self.selection.select("htmlRepoURL");
12354        query.execute(self.graphql_client.clone()).await
12355    }
12356    /// The URL to the source's git repo in a web browser. Only valid for git sources.
12357    pub async fn html_url(&self) -> Result<String, DaggerError> {
12358        let query = self.selection.select("htmlURL");
12359        query.execute(self.graphql_client.clone()).await
12360    }
12361    /// A unique identifier for this ModuleSource.
12362    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
12363        let query = self.selection.select("id");
12364        query.execute(self.graphql_client.clone()).await
12365    }
12366    /// The introspection schema JSON file for this module source.
12367    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
12368    /// Note: this is in the context of a module, so some core types may be hidden.
12369    pub fn introspection_schema_json(&self) -> File {
12370        let query = self.selection.select("introspectionSchemaJSON");
12371        File {
12372            proc: self.proc.clone(),
12373            selection: query,
12374            graphql_client: self.graphql_client.clone(),
12375        }
12376    }
12377    /// The kind of module source (currently local, git or dir).
12378    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
12379        let query = self.selection.select("kind");
12380        query.execute(self.graphql_client.clone()).await
12381    }
12382    /// 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.
12383    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
12384        let query = self.selection.select("localContextDirectoryPath");
12385        query.execute(self.graphql_client.clone()).await
12386    }
12387    /// The name of the module, including any setting via the withName API.
12388    pub async fn module_name(&self) -> Result<String, DaggerError> {
12389        let query = self.selection.select("moduleName");
12390        query.execute(self.graphql_client.clone()).await
12391    }
12392    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
12393    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
12394        let query = self.selection.select("moduleOriginalName");
12395        query.execute(self.graphql_client.clone()).await
12396    }
12397    /// The original subpath used when instantiating this module source, relative to the context directory.
12398    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
12399        let query = self.selection.select("originalSubpath");
12400        query.execute(self.graphql_client.clone()).await
12401    }
12402    /// The pinned version of this module source.
12403    pub async fn pin(&self) -> Result<String, DaggerError> {
12404        let query = self.selection.select("pin");
12405        query.execute(self.graphql_client.clone()).await
12406    }
12407    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
12408    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
12409        let query = self.selection.select("repoRootPath");
12410        query.execute(self.graphql_client.clone()).await
12411    }
12412    /// The SDK configuration of the module.
12413    pub fn sdk(&self) -> SdkConfig {
12414        let query = self.selection.select("sdk");
12415        SdkConfig {
12416            proc: self.proc.clone(),
12417            selection: query,
12418            graphql_client: self.graphql_client.clone(),
12419        }
12420    }
12421    /// The path, relative to the context directory, that contains the module's dagger.json.
12422    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
12423        let query = self.selection.select("sourceRootSubpath");
12424        query.execute(self.graphql_client.clone()).await
12425    }
12426    /// The path to the directory containing the module's source code, relative to the context directory.
12427    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
12428        let query = self.selection.select("sourceSubpath");
12429        query.execute(self.graphql_client.clone()).await
12430    }
12431    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
12432    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
12433        let query = self.selection.select("sync");
12434        query.execute(self.graphql_client.clone()).await
12435    }
12436    /// The toolchains referenced by the module source.
12437    pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12438        let query = self.selection.select("toolchains");
12439        let query = query.select("id");
12440        let ids: Vec<ModuleSourceId> = query.execute(self.graphql_client.clone()).await?;
12441        let root = Query {
12442            proc: self.proc.clone(),
12443            selection: crate::querybuilder::query(),
12444            graphql_client: self.graphql_client.clone(),
12445        };
12446        Ok(ids
12447            .into_iter()
12448            .map(|id| root.load_module_source_from_id(id))
12449            .collect())
12450    }
12451    /// User-defined defaults read from local .env files
12452    pub fn user_defaults(&self) -> EnvFile {
12453        let query = self.selection.select("userDefaults");
12454        EnvFile {
12455            proc: self.proc.clone(),
12456            selection: query,
12457            graphql_client: self.graphql_client.clone(),
12458        }
12459    }
12460    /// The specified version of the git repo this source points to.
12461    pub async fn version(&self) -> Result<String, DaggerError> {
12462        let query = self.selection.select("version");
12463        query.execute(self.graphql_client.clone()).await
12464    }
12465    /// Set a blueprint for the module source.
12466    ///
12467    /// # Arguments
12468    ///
12469    /// * `blueprint` - The blueprint module to set.
12470    pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
12471        let mut query = self.selection.select("withBlueprint");
12472        query = query.arg_lazy(
12473            "blueprint",
12474            Box::new(move || {
12475                let blueprint = blueprint.clone();
12476                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
12477            }),
12478        );
12479        ModuleSource {
12480            proc: self.proc.clone(),
12481            selection: query,
12482            graphql_client: self.graphql_client.clone(),
12483        }
12484    }
12485    /// Update the module source with a new client to generate.
12486    ///
12487    /// # Arguments
12488    ///
12489    /// * `generator` - The generator to use
12490    /// * `output_dir` - The output directory for the generated client.
12491    pub fn with_client(
12492        &self,
12493        generator: impl Into<String>,
12494        output_dir: impl Into<String>,
12495    ) -> ModuleSource {
12496        let mut query = self.selection.select("withClient");
12497        query = query.arg("generator", generator.into());
12498        query = query.arg("outputDir", output_dir.into());
12499        ModuleSource {
12500            proc: self.proc.clone(),
12501            selection: query,
12502            graphql_client: self.graphql_client.clone(),
12503        }
12504    }
12505    /// Append the provided dependencies to the module source's dependency list.
12506    ///
12507    /// # Arguments
12508    ///
12509    /// * `dependencies` - The dependencies to append.
12510    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
12511        let mut query = self.selection.select("withDependencies");
12512        query = query.arg("dependencies", dependencies);
12513        ModuleSource {
12514            proc: self.proc.clone(),
12515            selection: query,
12516            graphql_client: self.graphql_client.clone(),
12517        }
12518    }
12519    /// Upgrade the engine version of the module to the given value.
12520    ///
12521    /// # Arguments
12522    ///
12523    /// * `version` - The engine version to upgrade to.
12524    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
12525        let mut query = self.selection.select("withEngineVersion");
12526        query = query.arg("version", version.into());
12527        ModuleSource {
12528            proc: self.proc.clone(),
12529            selection: query,
12530            graphql_client: self.graphql_client.clone(),
12531        }
12532    }
12533    /// Enable the experimental features for the module source.
12534    ///
12535    /// # Arguments
12536    ///
12537    /// * `features` - The experimental features to enable.
12538    pub fn with_experimental_features(
12539        &self,
12540        features: Vec<ModuleSourceExperimentalFeature>,
12541    ) -> ModuleSource {
12542        let mut query = self.selection.select("withExperimentalFeatures");
12543        query = query.arg("features", features);
12544        ModuleSource {
12545            proc: self.proc.clone(),
12546            selection: query,
12547            graphql_client: self.graphql_client.clone(),
12548        }
12549    }
12550    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
12551    ///
12552    /// # Arguments
12553    ///
12554    /// * `patterns` - The new additional include patterns.
12555    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
12556        let mut query = self.selection.select("withIncludes");
12557        query = query.arg(
12558            "patterns",
12559            patterns
12560                .into_iter()
12561                .map(|i| i.into())
12562                .collect::<Vec<String>>(),
12563        );
12564        ModuleSource {
12565            proc: self.proc.clone(),
12566            selection: query,
12567            graphql_client: self.graphql_client.clone(),
12568        }
12569    }
12570    /// Update the module source with a new name.
12571    ///
12572    /// # Arguments
12573    ///
12574    /// * `name` - The name to set.
12575    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
12576        let mut query = self.selection.select("withName");
12577        query = query.arg("name", name.into());
12578        ModuleSource {
12579            proc: self.proc.clone(),
12580            selection: query,
12581            graphql_client: self.graphql_client.clone(),
12582        }
12583    }
12584    /// Update the module source with a new SDK.
12585    ///
12586    /// # Arguments
12587    ///
12588    /// * `source` - The SDK source to set.
12589    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
12590        let mut query = self.selection.select("withSDK");
12591        query = query.arg("source", source.into());
12592        ModuleSource {
12593            proc: self.proc.clone(),
12594            selection: query,
12595            graphql_client: self.graphql_client.clone(),
12596        }
12597    }
12598    /// Update the module source with a new source subpath.
12599    ///
12600    /// # Arguments
12601    ///
12602    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
12603    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
12604        let mut query = self.selection.select("withSourceSubpath");
12605        query = query.arg("path", path.into());
12606        ModuleSource {
12607            proc: self.proc.clone(),
12608            selection: query,
12609            graphql_client: self.graphql_client.clone(),
12610        }
12611    }
12612    /// Add toolchains to the module source.
12613    ///
12614    /// # Arguments
12615    ///
12616    /// * `toolchains` - The toolchain modules to add.
12617    pub fn with_toolchains(&self, toolchains: Vec<ModuleSourceId>) -> ModuleSource {
12618        let mut query = self.selection.select("withToolchains");
12619        query = query.arg("toolchains", toolchains);
12620        ModuleSource {
12621            proc: self.proc.clone(),
12622            selection: query,
12623            graphql_client: self.graphql_client.clone(),
12624        }
12625    }
12626    /// Update the blueprint module to the latest version.
12627    pub fn with_update_blueprint(&self) -> ModuleSource {
12628        let query = self.selection.select("withUpdateBlueprint");
12629        ModuleSource {
12630            proc: self.proc.clone(),
12631            selection: query,
12632            graphql_client: self.graphql_client.clone(),
12633        }
12634    }
12635    /// Update one or more module dependencies.
12636    ///
12637    /// # Arguments
12638    ///
12639    /// * `dependencies` - The dependencies to update.
12640    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12641        let mut query = self.selection.select("withUpdateDependencies");
12642        query = query.arg(
12643            "dependencies",
12644            dependencies
12645                .into_iter()
12646                .map(|i| i.into())
12647                .collect::<Vec<String>>(),
12648        );
12649        ModuleSource {
12650            proc: self.proc.clone(),
12651            selection: query,
12652            graphql_client: self.graphql_client.clone(),
12653        }
12654    }
12655    /// Update one or more toolchains.
12656    ///
12657    /// # Arguments
12658    ///
12659    /// * `toolchains` - The toolchains to update.
12660    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12661        let mut query = self.selection.select("withUpdateToolchains");
12662        query = query.arg(
12663            "toolchains",
12664            toolchains
12665                .into_iter()
12666                .map(|i| i.into())
12667                .collect::<Vec<String>>(),
12668        );
12669        ModuleSource {
12670            proc: self.proc.clone(),
12671            selection: query,
12672            graphql_client: self.graphql_client.clone(),
12673        }
12674    }
12675    /// Update one or more clients.
12676    ///
12677    /// # Arguments
12678    ///
12679    /// * `clients` - The clients to update
12680    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
12681        let mut query = self.selection.select("withUpdatedClients");
12682        query = query.arg(
12683            "clients",
12684            clients
12685                .into_iter()
12686                .map(|i| i.into())
12687                .collect::<Vec<String>>(),
12688        );
12689        ModuleSource {
12690            proc: self.proc.clone(),
12691            selection: query,
12692            graphql_client: self.graphql_client.clone(),
12693        }
12694    }
12695    /// Remove the current blueprint from the module source.
12696    pub fn without_blueprint(&self) -> ModuleSource {
12697        let query = self.selection.select("withoutBlueprint");
12698        ModuleSource {
12699            proc: self.proc.clone(),
12700            selection: query,
12701            graphql_client: self.graphql_client.clone(),
12702        }
12703    }
12704    /// Remove a client from the module source.
12705    ///
12706    /// # Arguments
12707    ///
12708    /// * `path` - The path of the client to remove.
12709    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
12710        let mut query = self.selection.select("withoutClient");
12711        query = query.arg("path", path.into());
12712        ModuleSource {
12713            proc: self.proc.clone(),
12714            selection: query,
12715            graphql_client: self.graphql_client.clone(),
12716        }
12717    }
12718    /// Remove the provided dependencies from the module source's dependency list.
12719    ///
12720    /// # Arguments
12721    ///
12722    /// * `dependencies` - The dependencies to remove.
12723    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12724        let mut query = self.selection.select("withoutDependencies");
12725        query = query.arg(
12726            "dependencies",
12727            dependencies
12728                .into_iter()
12729                .map(|i| i.into())
12730                .collect::<Vec<String>>(),
12731        );
12732        ModuleSource {
12733            proc: self.proc.clone(),
12734            selection: query,
12735            graphql_client: self.graphql_client.clone(),
12736        }
12737    }
12738    /// Disable experimental features for the module source.
12739    ///
12740    /// # Arguments
12741    ///
12742    /// * `features` - The experimental features to disable.
12743    pub fn without_experimental_features(
12744        &self,
12745        features: Vec<ModuleSourceExperimentalFeature>,
12746    ) -> ModuleSource {
12747        let mut query = self.selection.select("withoutExperimentalFeatures");
12748        query = query.arg("features", features);
12749        ModuleSource {
12750            proc: self.proc.clone(),
12751            selection: query,
12752            graphql_client: self.graphql_client.clone(),
12753        }
12754    }
12755    /// Remove the provided toolchains from the module source.
12756    ///
12757    /// # Arguments
12758    ///
12759    /// * `toolchains` - The toolchains to remove.
12760    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12761        let mut query = self.selection.select("withoutToolchains");
12762        query = query.arg(
12763            "toolchains",
12764            toolchains
12765                .into_iter()
12766                .map(|i| i.into())
12767                .collect::<Vec<String>>(),
12768        );
12769        ModuleSource {
12770            proc: self.proc.clone(),
12771            selection: query,
12772            graphql_client: self.graphql_client.clone(),
12773        }
12774    }
12775}
12776#[derive(Clone)]
12777pub struct ObjectTypeDef {
12778    pub proc: Option<Arc<DaggerSessionProc>>,
12779    pub selection: Selection,
12780    pub graphql_client: DynGraphQLClient,
12781}
12782impl ObjectTypeDef {
12783    /// The function used to construct new instances of this object, if any.
12784    pub fn constructor(&self) -> Function {
12785        let query = self.selection.select("constructor");
12786        Function {
12787            proc: self.proc.clone(),
12788            selection: query,
12789            graphql_client: self.graphql_client.clone(),
12790        }
12791    }
12792    /// The reason this enum member is deprecated, if any.
12793    pub async fn deprecated(&self) -> Result<String, DaggerError> {
12794        let query = self.selection.select("deprecated");
12795        query.execute(self.graphql_client.clone()).await
12796    }
12797    /// The doc string for the object, if any.
12798    pub async fn description(&self) -> Result<String, DaggerError> {
12799        let query = self.selection.select("description");
12800        query.execute(self.graphql_client.clone()).await
12801    }
12802    /// Static fields defined on this object, if any.
12803    pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12804        let query = self.selection.select("fields");
12805        let query = query.select("id");
12806        let ids: Vec<FieldTypeDefId> = query.execute(self.graphql_client.clone()).await?;
12807        let root = Query {
12808            proc: self.proc.clone(),
12809            selection: crate::querybuilder::query(),
12810            graphql_client: self.graphql_client.clone(),
12811        };
12812        Ok(ids
12813            .into_iter()
12814            .map(|id| root.load_field_type_def_from_id(id))
12815            .collect())
12816    }
12817    /// Functions defined on this object, if any.
12818    pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12819        let query = self.selection.select("functions");
12820        let query = query.select("id");
12821        let ids: Vec<FunctionId> = query.execute(self.graphql_client.clone()).await?;
12822        let root = Query {
12823            proc: self.proc.clone(),
12824            selection: crate::querybuilder::query(),
12825            graphql_client: self.graphql_client.clone(),
12826        };
12827        Ok(ids
12828            .into_iter()
12829            .map(|id| root.load_function_from_id(id))
12830            .collect())
12831    }
12832    /// A unique identifier for this ObjectTypeDef.
12833    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
12834        let query = self.selection.select("id");
12835        query.execute(self.graphql_client.clone()).await
12836    }
12837    /// The name of the object.
12838    pub async fn name(&self) -> Result<String, DaggerError> {
12839        let query = self.selection.select("name");
12840        query.execute(self.graphql_client.clone()).await
12841    }
12842    /// The location of this object declaration.
12843    pub fn source_map(&self) -> SourceMap {
12844        let query = self.selection.select("sourceMap");
12845        SourceMap {
12846            proc: self.proc.clone(),
12847            selection: query,
12848            graphql_client: self.graphql_client.clone(),
12849        }
12850    }
12851    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
12852    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12853        let query = self.selection.select("sourceModuleName");
12854        query.execute(self.graphql_client.clone()).await
12855    }
12856}
12857#[derive(Clone)]
12858pub struct Port {
12859    pub proc: Option<Arc<DaggerSessionProc>>,
12860    pub selection: Selection,
12861    pub graphql_client: DynGraphQLClient,
12862}
12863impl Port {
12864    /// The port description.
12865    pub async fn description(&self) -> Result<String, DaggerError> {
12866        let query = self.selection.select("description");
12867        query.execute(self.graphql_client.clone()).await
12868    }
12869    /// Skip the health check when run as a service.
12870    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
12871        let query = self.selection.select("experimentalSkipHealthcheck");
12872        query.execute(self.graphql_client.clone()).await
12873    }
12874    /// A unique identifier for this Port.
12875    pub async fn id(&self) -> Result<PortId, DaggerError> {
12876        let query = self.selection.select("id");
12877        query.execute(self.graphql_client.clone()).await
12878    }
12879    /// The port number.
12880    pub async fn port(&self) -> Result<isize, DaggerError> {
12881        let query = self.selection.select("port");
12882        query.execute(self.graphql_client.clone()).await
12883    }
12884    /// The transport layer protocol.
12885    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
12886        let query = self.selection.select("protocol");
12887        query.execute(self.graphql_client.clone()).await
12888    }
12889}
12890#[derive(Clone)]
12891pub struct Query {
12892    pub proc: Option<Arc<DaggerSessionProc>>,
12893    pub selection: Selection,
12894    pub graphql_client: DynGraphQLClient,
12895}
12896#[derive(Builder, Debug, PartialEq)]
12897pub struct QueryCacheVolumeOpts<'a> {
12898    /// A user:group to set for the cache volume root.
12899    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
12900    /// If the group is omitted, it defaults to the same as the user.
12901    #[builder(setter(into, strip_option), default)]
12902    pub owner: Option<&'a str>,
12903    /// Sharing mode of the cache volume.
12904    #[builder(setter(into, strip_option), default)]
12905    pub sharing: Option<CacheSharingMode>,
12906    /// Identifier of the directory to use as the cache volume's root.
12907    #[builder(setter(into, strip_option), default)]
12908    pub source: Option<DirectoryId>,
12909}
12910#[derive(Builder, Debug, PartialEq)]
12911pub struct QueryContainerOpts {
12912    /// Platform to initialize the container with. Defaults to the native platform of the current engine
12913    #[builder(setter(into, strip_option), default)]
12914    pub platform: Option<Platform>,
12915}
12916#[derive(Builder, Debug, PartialEq)]
12917pub struct QueryCurrentTypeDefsOpts {
12918    /// Strip core API functions from the Query type, leaving only module-sourced functions (constructors, entrypoint proxies, etc.).
12919    /// Core types (Container, Directory, etc.) are kept so return types and method chaining still work.
12920    #[builder(setter(into, strip_option), default)]
12921    pub hide_core: Option<bool>,
12922    /// Return the full referenced typedef closure instead of only top-level served typedefs.
12923    #[builder(setter(into, strip_option), default)]
12924    pub return_all_types: Option<bool>,
12925}
12926#[derive(Builder, Debug, PartialEq)]
12927pub struct QueryEnvOpts {
12928    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
12929    #[builder(setter(into, strip_option), default)]
12930    pub privileged: Option<bool>,
12931    /// Allow new outputs to be declared and saved in the environment
12932    #[builder(setter(into, strip_option), default)]
12933    pub writable: Option<bool>,
12934}
12935#[derive(Builder, Debug, PartialEq)]
12936pub struct QueryEnvFileOpts {
12937    /// Replace "${VAR}" or "$VAR" with the value of other vars
12938    #[builder(setter(into, strip_option), default)]
12939    pub expand: Option<bool>,
12940}
12941#[derive(Builder, Debug, PartialEq)]
12942pub struct QueryFileOpts {
12943    /// Permissions of the new file. Example: 0600
12944    #[builder(setter(into, strip_option), default)]
12945    pub permissions: Option<isize>,
12946}
12947#[derive(Builder, Debug, PartialEq)]
12948pub struct QueryGitOpts<'a> {
12949    /// A service which must be started before the repo is fetched.
12950    #[builder(setter(into, strip_option), default)]
12951    pub experimental_service_host: Option<ServiceId>,
12952    /// Secret used to populate the Authorization HTTP header
12953    #[builder(setter(into, strip_option), default)]
12954    pub http_auth_header: Option<SecretId>,
12955    /// Secret used to populate the password during basic HTTP Authorization
12956    #[builder(setter(into, strip_option), default)]
12957    pub http_auth_token: Option<SecretId>,
12958    /// Username used to populate the password during basic HTTP Authorization
12959    #[builder(setter(into, strip_option), default)]
12960    pub http_auth_username: Option<&'a str>,
12961    /// DEPRECATED: Set to true to keep .git directory.
12962    #[builder(setter(into, strip_option), default)]
12963    pub keep_git_dir: Option<bool>,
12964    /// Set SSH auth socket
12965    #[builder(setter(into, strip_option), default)]
12966    pub ssh_auth_socket: Option<SocketId>,
12967    /// Set SSH known hosts
12968    #[builder(setter(into, strip_option), default)]
12969    pub ssh_known_hosts: Option<&'a str>,
12970}
12971#[derive(Builder, Debug, PartialEq)]
12972pub struct QueryHttpOpts<'a> {
12973    /// Secret used to populate the Authorization HTTP header
12974    #[builder(setter(into, strip_option), default)]
12975    pub auth_header: Option<SecretId>,
12976    /// Expected digest of the downloaded content (e.g., "sha256:...").
12977    #[builder(setter(into, strip_option), default)]
12978    pub checksum: Option<&'a str>,
12979    /// A service which must be started before the URL is fetched.
12980    #[builder(setter(into, strip_option), default)]
12981    pub experimental_service_host: Option<ServiceId>,
12982    /// File name to use for the file. Defaults to the last part of the URL.
12983    #[builder(setter(into, strip_option), default)]
12984    pub name: Option<&'a str>,
12985    /// Permissions to set on the file.
12986    #[builder(setter(into, strip_option), default)]
12987    pub permissions: Option<isize>,
12988}
12989#[derive(Builder, Debug, PartialEq)]
12990pub struct QueryLlmOpts<'a> {
12991    /// Cap the number of API calls for this LLM
12992    #[builder(setter(into, strip_option), default)]
12993    pub max_api_calls: Option<isize>,
12994    /// Model to use
12995    #[builder(setter(into, strip_option), default)]
12996    pub model: Option<&'a str>,
12997}
12998#[derive(Builder, Debug, PartialEq)]
12999pub struct QueryModuleSourceOpts<'a> {
13000    /// 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.
13001    #[builder(setter(into, strip_option), default)]
13002    pub allow_not_exists: Option<bool>,
13003    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
13004    #[builder(setter(into, strip_option), default)]
13005    pub disable_find_up: Option<bool>,
13006    /// The pinned version of the module source
13007    #[builder(setter(into, strip_option), default)]
13008    pub ref_pin: Option<&'a str>,
13009    /// If set, error out if the ref string is not of the provided requireKind.
13010    #[builder(setter(into, strip_option), default)]
13011    pub require_kind: Option<ModuleSourceKind>,
13012}
13013#[derive(Builder, Debug, PartialEq)]
13014pub struct QuerySecretOpts<'a> {
13015    /// 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.
13016    /// 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.
13017    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
13018    #[builder(setter(into, strip_option), default)]
13019    pub cache_key: Option<&'a str>,
13020}
13021impl Query {
13022    /// initialize an address to load directories, containers, secrets or other object types.
13023    pub fn address(&self, value: impl Into<String>) -> Address {
13024        let mut query = self.selection.select("address");
13025        query = query.arg("value", value.into());
13026        Address {
13027            proc: self.proc.clone(),
13028            selection: query,
13029            graphql_client: self.graphql_client.clone(),
13030        }
13031    }
13032    /// Constructs a cache volume for a given cache key.
13033    ///
13034    /// # Arguments
13035    ///
13036    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
13037    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13038    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
13039        let mut query = self.selection.select("cacheVolume");
13040        query = query.arg("key", key.into());
13041        CacheVolume {
13042            proc: self.proc.clone(),
13043            selection: query,
13044            graphql_client: self.graphql_client.clone(),
13045        }
13046    }
13047    /// Constructs a cache volume for a given cache key.
13048    ///
13049    /// # Arguments
13050    ///
13051    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
13052    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13053    pub fn cache_volume_opts<'a>(
13054        &self,
13055        key: impl Into<String>,
13056        opts: QueryCacheVolumeOpts<'a>,
13057    ) -> CacheVolume {
13058        let mut query = self.selection.select("cacheVolume");
13059        query = query.arg("key", key.into());
13060        if let Some(source) = opts.source {
13061            query = query.arg("source", source);
13062        }
13063        if let Some(sharing) = opts.sharing {
13064            query = query.arg("sharing", sharing);
13065        }
13066        if let Some(owner) = opts.owner {
13067            query = query.arg("owner", owner);
13068        }
13069        CacheVolume {
13070            proc: self.proc.clone(),
13071            selection: query,
13072            graphql_client: self.graphql_client.clone(),
13073        }
13074    }
13075    /// Creates an empty changeset
13076    pub fn changeset(&self) -> Changeset {
13077        let query = self.selection.select("changeset");
13078        Changeset {
13079            proc: self.proc.clone(),
13080            selection: query,
13081            graphql_client: self.graphql_client.clone(),
13082        }
13083    }
13084    /// Dagger Cloud configuration and state
13085    pub fn cloud(&self) -> Cloud {
13086        let query = self.selection.select("cloud");
13087        Cloud {
13088            proc: self.proc.clone(),
13089            selection: query,
13090            graphql_client: self.graphql_client.clone(),
13091        }
13092    }
13093    /// Creates a scratch container, with no image or metadata.
13094    /// To pull an image, follow up with the "from" function.
13095    ///
13096    /// # Arguments
13097    ///
13098    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13099    pub fn container(&self) -> Container {
13100        let query = self.selection.select("container");
13101        Container {
13102            proc: self.proc.clone(),
13103            selection: query,
13104            graphql_client: self.graphql_client.clone(),
13105        }
13106    }
13107    /// Creates a scratch container, with no image or metadata.
13108    /// To pull an image, follow up with the "from" function.
13109    ///
13110    /// # Arguments
13111    ///
13112    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13113    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
13114        let mut query = self.selection.select("container");
13115        if let Some(platform) = opts.platform {
13116            query = query.arg("platform", platform);
13117        }
13118        Container {
13119            proc: self.proc.clone(),
13120            selection: query,
13121            graphql_client: self.graphql_client.clone(),
13122        }
13123    }
13124    /// Returns the current environment
13125    /// 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.
13126    /// 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.
13127    pub fn current_env(&self) -> Env {
13128        let query = self.selection.select("currentEnv");
13129        Env {
13130            proc: self.proc.clone(),
13131            selection: query,
13132            graphql_client: self.graphql_client.clone(),
13133        }
13134    }
13135    /// The FunctionCall context that the SDK caller is currently executing in.
13136    /// If the caller is not currently executing in a function, this will return an error.
13137    pub fn current_function_call(&self) -> FunctionCall {
13138        let query = self.selection.select("currentFunctionCall");
13139        FunctionCall {
13140            proc: self.proc.clone(),
13141            selection: query,
13142            graphql_client: self.graphql_client.clone(),
13143        }
13144    }
13145    /// The module currently being served in the session, if any.
13146    pub fn current_module(&self) -> CurrentModule {
13147        let query = self.selection.select("currentModule");
13148        CurrentModule {
13149            proc: self.proc.clone(),
13150            selection: query,
13151            graphql_client: self.graphql_client.clone(),
13152        }
13153    }
13154    /// The TypeDef representations of the objects currently being served in the session.
13155    ///
13156    /// # Arguments
13157    ///
13158    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13159    pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
13160        let query = self.selection.select("currentTypeDefs");
13161        let query = query.select("id");
13162        let ids: Vec<TypeDefId> = query.execute(self.graphql_client.clone()).await?;
13163        let root = Query {
13164            proc: self.proc.clone(),
13165            selection: crate::querybuilder::query(),
13166            graphql_client: self.graphql_client.clone(),
13167        };
13168        Ok(ids
13169            .into_iter()
13170            .map(|id| root.load_type_def_from_id(id))
13171            .collect())
13172    }
13173    /// The TypeDef representations of the objects currently being served in the session.
13174    ///
13175    /// # Arguments
13176    ///
13177    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13178    pub async fn current_type_defs_opts(
13179        &self,
13180        opts: QueryCurrentTypeDefsOpts,
13181    ) -> Result<Vec<TypeDef>, DaggerError> {
13182        let mut query = self.selection.select("currentTypeDefs");
13183        if let Some(return_all_types) = opts.return_all_types {
13184            query = query.arg("returnAllTypes", return_all_types);
13185        }
13186        if let Some(hide_core) = opts.hide_core {
13187            query = query.arg("hideCore", hide_core);
13188        }
13189        let query = query.select("id");
13190        let ids: Vec<TypeDefId> = query.execute(self.graphql_client.clone()).await?;
13191        let root = Query {
13192            proc: self.proc.clone(),
13193            selection: crate::querybuilder::query(),
13194            graphql_client: self.graphql_client.clone(),
13195        };
13196        Ok(ids
13197            .into_iter()
13198            .map(|id| root.load_type_def_from_id(id))
13199            .collect())
13200    }
13201    /// Detect and return the current workspace.
13202    pub fn current_workspace(&self) -> Workspace {
13203        let query = self.selection.select("currentWorkspace");
13204        Workspace {
13205            proc: self.proc.clone(),
13206            selection: query,
13207            graphql_client: self.graphql_client.clone(),
13208        }
13209    }
13210    /// The default platform of the engine.
13211    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
13212        let query = self.selection.select("defaultPlatform");
13213        query.execute(self.graphql_client.clone()).await
13214    }
13215    /// Creates an empty directory.
13216    pub fn directory(&self) -> Directory {
13217        let query = self.selection.select("directory");
13218        Directory {
13219            proc: self.proc.clone(),
13220            selection: query,
13221            graphql_client: self.graphql_client.clone(),
13222        }
13223    }
13224    /// The Dagger engine container configuration and state
13225    pub fn engine(&self) -> Engine {
13226        let query = self.selection.select("engine");
13227        Engine {
13228            proc: self.proc.clone(),
13229            selection: query,
13230            graphql_client: self.graphql_client.clone(),
13231        }
13232    }
13233    /// Initializes a new environment
13234    ///
13235    /// # Arguments
13236    ///
13237    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13238    pub fn env(&self) -> Env {
13239        let query = self.selection.select("env");
13240        Env {
13241            proc: self.proc.clone(),
13242            selection: query,
13243            graphql_client: self.graphql_client.clone(),
13244        }
13245    }
13246    /// Initializes a new environment
13247    ///
13248    /// # Arguments
13249    ///
13250    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13251    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
13252        let mut query = self.selection.select("env");
13253        if let Some(privileged) = opts.privileged {
13254            query = query.arg("privileged", privileged);
13255        }
13256        if let Some(writable) = opts.writable {
13257            query = query.arg("writable", writable);
13258        }
13259        Env {
13260            proc: self.proc.clone(),
13261            selection: query,
13262            graphql_client: self.graphql_client.clone(),
13263        }
13264    }
13265    /// Initialize an environment file
13266    ///
13267    /// # Arguments
13268    ///
13269    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13270    pub fn env_file(&self) -> EnvFile {
13271        let query = self.selection.select("envFile");
13272        EnvFile {
13273            proc: self.proc.clone(),
13274            selection: query,
13275            graphql_client: self.graphql_client.clone(),
13276        }
13277    }
13278    /// Initialize an environment file
13279    ///
13280    /// # Arguments
13281    ///
13282    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13283    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
13284        let mut query = self.selection.select("envFile");
13285        if let Some(expand) = opts.expand {
13286            query = query.arg("expand", expand);
13287        }
13288        EnvFile {
13289            proc: self.proc.clone(),
13290            selection: query,
13291            graphql_client: self.graphql_client.clone(),
13292        }
13293    }
13294    /// Create a new error.
13295    ///
13296    /// # Arguments
13297    ///
13298    /// * `message` - A brief description of the error.
13299    pub fn error(&self, message: impl Into<String>) -> Error {
13300        let mut query = self.selection.select("error");
13301        query = query.arg("message", message.into());
13302        Error {
13303            proc: self.proc.clone(),
13304            selection: query,
13305            graphql_client: self.graphql_client.clone(),
13306        }
13307    }
13308    /// Creates a file with the specified contents.
13309    ///
13310    /// # Arguments
13311    ///
13312    /// * `name` - Name of the new file. Example: "foo.txt"
13313    /// * `contents` - Contents of the new file. Example: "Hello world!"
13314    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13315    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
13316        let mut query = self.selection.select("file");
13317        query = query.arg("name", name.into());
13318        query = query.arg("contents", contents.into());
13319        File {
13320            proc: self.proc.clone(),
13321            selection: query,
13322            graphql_client: self.graphql_client.clone(),
13323        }
13324    }
13325    /// Creates a file with the specified contents.
13326    ///
13327    /// # Arguments
13328    ///
13329    /// * `name` - Name of the new file. Example: "foo.txt"
13330    /// * `contents` - Contents of the new file. Example: "Hello world!"
13331    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13332    pub fn file_opts(
13333        &self,
13334        name: impl Into<String>,
13335        contents: impl Into<String>,
13336        opts: QueryFileOpts,
13337    ) -> File {
13338        let mut query = self.selection.select("file");
13339        query = query.arg("name", name.into());
13340        query = query.arg("contents", contents.into());
13341        if let Some(permissions) = opts.permissions {
13342            query = query.arg("permissions", permissions);
13343        }
13344        File {
13345            proc: self.proc.clone(),
13346            selection: query,
13347            graphql_client: self.graphql_client.clone(),
13348        }
13349    }
13350    /// Creates a function.
13351    ///
13352    /// # Arguments
13353    ///
13354    /// * `name` - Name of the function, in its original format from the implementation language.
13355    /// * `return_type` - Return type of the function.
13356    pub fn function(
13357        &self,
13358        name: impl Into<String>,
13359        return_type: impl IntoID<TypeDefId>,
13360    ) -> Function {
13361        let mut query = self.selection.select("function");
13362        query = query.arg("name", name.into());
13363        query = query.arg_lazy(
13364            "returnType",
13365            Box::new(move || {
13366                let return_type = return_type.clone();
13367                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
13368            }),
13369        );
13370        Function {
13371            proc: self.proc.clone(),
13372            selection: query,
13373            graphql_client: self.graphql_client.clone(),
13374        }
13375    }
13376    /// Create a code generation result, given a directory containing the generated code.
13377    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
13378        let mut query = self.selection.select("generatedCode");
13379        query = query.arg_lazy(
13380            "code",
13381            Box::new(move || {
13382                let code = code.clone();
13383                Box::pin(async move { code.into_id().await.unwrap().quote() })
13384            }),
13385        );
13386        GeneratedCode {
13387            proc: self.proc.clone(),
13388            selection: query,
13389            graphql_client: self.graphql_client.clone(),
13390        }
13391    }
13392    /// Queries a Git repository.
13393    ///
13394    /// # Arguments
13395    ///
13396    /// * `url` - URL of the git repository.
13397    ///
13398    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
13399    ///
13400    /// Suffix ".git" is optional.
13401    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13402    pub fn git(&self, url: impl Into<String>) -> GitRepository {
13403        let mut query = self.selection.select("git");
13404        query = query.arg("url", url.into());
13405        GitRepository {
13406            proc: self.proc.clone(),
13407            selection: query,
13408            graphql_client: self.graphql_client.clone(),
13409        }
13410    }
13411    /// Queries a Git repository.
13412    ///
13413    /// # Arguments
13414    ///
13415    /// * `url` - URL of the git repository.
13416    ///
13417    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
13418    ///
13419    /// Suffix ".git" is optional.
13420    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13421    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
13422        let mut query = self.selection.select("git");
13423        query = query.arg("url", url.into());
13424        if let Some(keep_git_dir) = opts.keep_git_dir {
13425            query = query.arg("keepGitDir", keep_git_dir);
13426        }
13427        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
13428            query = query.arg("sshKnownHosts", ssh_known_hosts);
13429        }
13430        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
13431            query = query.arg("sshAuthSocket", ssh_auth_socket);
13432        }
13433        if let Some(http_auth_username) = opts.http_auth_username {
13434            query = query.arg("httpAuthUsername", http_auth_username);
13435        }
13436        if let Some(http_auth_token) = opts.http_auth_token {
13437            query = query.arg("httpAuthToken", http_auth_token);
13438        }
13439        if let Some(http_auth_header) = opts.http_auth_header {
13440            query = query.arg("httpAuthHeader", http_auth_header);
13441        }
13442        if let Some(experimental_service_host) = opts.experimental_service_host {
13443            query = query.arg("experimentalServiceHost", experimental_service_host);
13444        }
13445        GitRepository {
13446            proc: self.proc.clone(),
13447            selection: query,
13448            graphql_client: self.graphql_client.clone(),
13449        }
13450    }
13451    /// Queries the host environment.
13452    pub fn host(&self) -> Host {
13453        let query = self.selection.select("host");
13454        Host {
13455            proc: self.proc.clone(),
13456            selection: query,
13457            graphql_client: self.graphql_client.clone(),
13458        }
13459    }
13460    /// Returns a file containing an http remote url content.
13461    ///
13462    /// # Arguments
13463    ///
13464    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
13465    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13466    pub fn http(&self, url: impl Into<String>) -> File {
13467        let mut query = self.selection.select("http");
13468        query = query.arg("url", url.into());
13469        File {
13470            proc: self.proc.clone(),
13471            selection: query,
13472            graphql_client: self.graphql_client.clone(),
13473        }
13474    }
13475    /// Returns a file containing an http remote url content.
13476    ///
13477    /// # Arguments
13478    ///
13479    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
13480    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13481    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
13482        let mut query = self.selection.select("http");
13483        query = query.arg("url", url.into());
13484        if let Some(name) = opts.name {
13485            query = query.arg("name", name);
13486        }
13487        if let Some(permissions) = opts.permissions {
13488            query = query.arg("permissions", permissions);
13489        }
13490        if let Some(checksum) = opts.checksum {
13491            query = query.arg("checksum", checksum);
13492        }
13493        if let Some(auth_header) = opts.auth_header {
13494            query = query.arg("authHeader", auth_header);
13495        }
13496        if let Some(experimental_service_host) = opts.experimental_service_host {
13497            query = query.arg("experimentalServiceHost", experimental_service_host);
13498        }
13499        File {
13500            proc: self.proc.clone(),
13501            selection: query,
13502            graphql_client: self.graphql_client.clone(),
13503        }
13504    }
13505    /// A unique identifier for this Query.
13506    pub async fn id(&self) -> Result<QueryId, DaggerError> {
13507        let query = self.selection.select("id");
13508        query.execute(self.graphql_client.clone()).await
13509    }
13510    /// Initialize a JSON value
13511    pub fn json(&self) -> JsonValue {
13512        let query = self.selection.select("json");
13513        JsonValue {
13514            proc: self.proc.clone(),
13515            selection: query,
13516            graphql_client: self.graphql_client.clone(),
13517        }
13518    }
13519    /// Initialize a Large Language Model (LLM)
13520    ///
13521    /// # Arguments
13522    ///
13523    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13524    pub fn llm(&self) -> Llm {
13525        let query = self.selection.select("llm");
13526        Llm {
13527            proc: self.proc.clone(),
13528            selection: query,
13529            graphql_client: self.graphql_client.clone(),
13530        }
13531    }
13532    /// Initialize a Large Language Model (LLM)
13533    ///
13534    /// # Arguments
13535    ///
13536    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13537    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
13538        let mut query = self.selection.select("llm");
13539        if let Some(model) = opts.model {
13540            query = query.arg("model", model);
13541        }
13542        if let Some(max_api_calls) = opts.max_api_calls {
13543            query = query.arg("maxAPICalls", max_api_calls);
13544        }
13545        Llm {
13546            proc: self.proc.clone(),
13547            selection: query,
13548            graphql_client: self.graphql_client.clone(),
13549        }
13550    }
13551    /// Load a Address from its ID.
13552    pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
13553        let mut query = self.selection.select("loadAddressFromID");
13554        query = query.arg_lazy(
13555            "id",
13556            Box::new(move || {
13557                let id = id.clone();
13558                Box::pin(async move { id.into_id().await.unwrap().quote() })
13559            }),
13560        );
13561        Address {
13562            proc: self.proc.clone(),
13563            selection: query,
13564            graphql_client: self.graphql_client.clone(),
13565        }
13566    }
13567    /// Load a Binding from its ID.
13568    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
13569        let mut query = self.selection.select("loadBindingFromID");
13570        query = query.arg_lazy(
13571            "id",
13572            Box::new(move || {
13573                let id = id.clone();
13574                Box::pin(async move { id.into_id().await.unwrap().quote() })
13575            }),
13576        );
13577        Binding {
13578            proc: self.proc.clone(),
13579            selection: query,
13580            graphql_client: self.graphql_client.clone(),
13581        }
13582    }
13583    /// Load a CacheVolume from its ID.
13584    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
13585        let mut query = self.selection.select("loadCacheVolumeFromID");
13586        query = query.arg_lazy(
13587            "id",
13588            Box::new(move || {
13589                let id = id.clone();
13590                Box::pin(async move { id.into_id().await.unwrap().quote() })
13591            }),
13592        );
13593        CacheVolume {
13594            proc: self.proc.clone(),
13595            selection: query,
13596            graphql_client: self.graphql_client.clone(),
13597        }
13598    }
13599    /// Load a Changeset from its ID.
13600    pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
13601        let mut query = self.selection.select("loadChangesetFromID");
13602        query = query.arg_lazy(
13603            "id",
13604            Box::new(move || {
13605                let id = id.clone();
13606                Box::pin(async move { id.into_id().await.unwrap().quote() })
13607            }),
13608        );
13609        Changeset {
13610            proc: self.proc.clone(),
13611            selection: query,
13612            graphql_client: self.graphql_client.clone(),
13613        }
13614    }
13615    /// Load a Check from its ID.
13616    pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
13617        let mut query = self.selection.select("loadCheckFromID");
13618        query = query.arg_lazy(
13619            "id",
13620            Box::new(move || {
13621                let id = id.clone();
13622                Box::pin(async move { id.into_id().await.unwrap().quote() })
13623            }),
13624        );
13625        Check {
13626            proc: self.proc.clone(),
13627            selection: query,
13628            graphql_client: self.graphql_client.clone(),
13629        }
13630    }
13631    /// Load a CheckGroup from its ID.
13632    pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
13633        let mut query = self.selection.select("loadCheckGroupFromID");
13634        query = query.arg_lazy(
13635            "id",
13636            Box::new(move || {
13637                let id = id.clone();
13638                Box::pin(async move { id.into_id().await.unwrap().quote() })
13639            }),
13640        );
13641        CheckGroup {
13642            proc: self.proc.clone(),
13643            selection: query,
13644            graphql_client: self.graphql_client.clone(),
13645        }
13646    }
13647    /// Load a ClientFilesyncMirror from its ID.
13648    pub fn load_client_filesync_mirror_from_id(
13649        &self,
13650        id: impl IntoID<ClientFilesyncMirrorId>,
13651    ) -> ClientFilesyncMirror {
13652        let mut query = self.selection.select("loadClientFilesyncMirrorFromID");
13653        query = query.arg_lazy(
13654            "id",
13655            Box::new(move || {
13656                let id = id.clone();
13657                Box::pin(async move { id.into_id().await.unwrap().quote() })
13658            }),
13659        );
13660        ClientFilesyncMirror {
13661            proc: self.proc.clone(),
13662            selection: query,
13663            graphql_client: self.graphql_client.clone(),
13664        }
13665    }
13666    /// Load a Cloud from its ID.
13667    pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
13668        let mut query = self.selection.select("loadCloudFromID");
13669        query = query.arg_lazy(
13670            "id",
13671            Box::new(move || {
13672                let id = id.clone();
13673                Box::pin(async move { id.into_id().await.unwrap().quote() })
13674            }),
13675        );
13676        Cloud {
13677            proc: self.proc.clone(),
13678            selection: query,
13679            graphql_client: self.graphql_client.clone(),
13680        }
13681    }
13682    /// Load a Container from its ID.
13683    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
13684        let mut query = self.selection.select("loadContainerFromID");
13685        query = query.arg_lazy(
13686            "id",
13687            Box::new(move || {
13688                let id = id.clone();
13689                Box::pin(async move { id.into_id().await.unwrap().quote() })
13690            }),
13691        );
13692        Container {
13693            proc: self.proc.clone(),
13694            selection: query,
13695            graphql_client: self.graphql_client.clone(),
13696        }
13697    }
13698    /// Load a CurrentModule from its ID.
13699    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
13700        let mut query = self.selection.select("loadCurrentModuleFromID");
13701        query = query.arg_lazy(
13702            "id",
13703            Box::new(move || {
13704                let id = id.clone();
13705                Box::pin(async move { id.into_id().await.unwrap().quote() })
13706            }),
13707        );
13708        CurrentModule {
13709            proc: self.proc.clone(),
13710            selection: query,
13711            graphql_client: self.graphql_client.clone(),
13712        }
13713    }
13714    /// Load a DiffStat from its ID.
13715    pub fn load_diff_stat_from_id(&self, id: impl IntoID<DiffStatId>) -> DiffStat {
13716        let mut query = self.selection.select("loadDiffStatFromID");
13717        query = query.arg_lazy(
13718            "id",
13719            Box::new(move || {
13720                let id = id.clone();
13721                Box::pin(async move { id.into_id().await.unwrap().quote() })
13722            }),
13723        );
13724        DiffStat {
13725            proc: self.proc.clone(),
13726            selection: query,
13727            graphql_client: self.graphql_client.clone(),
13728        }
13729    }
13730    /// Load a Directory from its ID.
13731    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
13732        let mut query = self.selection.select("loadDirectoryFromID");
13733        query = query.arg_lazy(
13734            "id",
13735            Box::new(move || {
13736                let id = id.clone();
13737                Box::pin(async move { id.into_id().await.unwrap().quote() })
13738            }),
13739        );
13740        Directory {
13741            proc: self.proc.clone(),
13742            selection: query,
13743            graphql_client: self.graphql_client.clone(),
13744        }
13745    }
13746    /// Load a EngineCacheEntry from its ID.
13747    pub fn load_engine_cache_entry_from_id(
13748        &self,
13749        id: impl IntoID<EngineCacheEntryId>,
13750    ) -> EngineCacheEntry {
13751        let mut query = self.selection.select("loadEngineCacheEntryFromID");
13752        query = query.arg_lazy(
13753            "id",
13754            Box::new(move || {
13755                let id = id.clone();
13756                Box::pin(async move { id.into_id().await.unwrap().quote() })
13757            }),
13758        );
13759        EngineCacheEntry {
13760            proc: self.proc.clone(),
13761            selection: query,
13762            graphql_client: self.graphql_client.clone(),
13763        }
13764    }
13765    /// Load a EngineCacheEntrySet from its ID.
13766    pub fn load_engine_cache_entry_set_from_id(
13767        &self,
13768        id: impl IntoID<EngineCacheEntrySetId>,
13769    ) -> EngineCacheEntrySet {
13770        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
13771        query = query.arg_lazy(
13772            "id",
13773            Box::new(move || {
13774                let id = id.clone();
13775                Box::pin(async move { id.into_id().await.unwrap().quote() })
13776            }),
13777        );
13778        EngineCacheEntrySet {
13779            proc: self.proc.clone(),
13780            selection: query,
13781            graphql_client: self.graphql_client.clone(),
13782        }
13783    }
13784    /// Load a EngineCache from its ID.
13785    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
13786        let mut query = self.selection.select("loadEngineCacheFromID");
13787        query = query.arg_lazy(
13788            "id",
13789            Box::new(move || {
13790                let id = id.clone();
13791                Box::pin(async move { id.into_id().await.unwrap().quote() })
13792            }),
13793        );
13794        EngineCache {
13795            proc: self.proc.clone(),
13796            selection: query,
13797            graphql_client: self.graphql_client.clone(),
13798        }
13799    }
13800    /// Load a Engine from its ID.
13801    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
13802        let mut query = self.selection.select("loadEngineFromID");
13803        query = query.arg_lazy(
13804            "id",
13805            Box::new(move || {
13806                let id = id.clone();
13807                Box::pin(async move { id.into_id().await.unwrap().quote() })
13808            }),
13809        );
13810        Engine {
13811            proc: self.proc.clone(),
13812            selection: query,
13813            graphql_client: self.graphql_client.clone(),
13814        }
13815    }
13816    /// Load a EnumTypeDef from its ID.
13817    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
13818        let mut query = self.selection.select("loadEnumTypeDefFromID");
13819        query = query.arg_lazy(
13820            "id",
13821            Box::new(move || {
13822                let id = id.clone();
13823                Box::pin(async move { id.into_id().await.unwrap().quote() })
13824            }),
13825        );
13826        EnumTypeDef {
13827            proc: self.proc.clone(),
13828            selection: query,
13829            graphql_client: self.graphql_client.clone(),
13830        }
13831    }
13832    /// Load a EnumValueTypeDef from its ID.
13833    pub fn load_enum_value_type_def_from_id(
13834        &self,
13835        id: impl IntoID<EnumValueTypeDefId>,
13836    ) -> EnumValueTypeDef {
13837        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
13838        query = query.arg_lazy(
13839            "id",
13840            Box::new(move || {
13841                let id = id.clone();
13842                Box::pin(async move { id.into_id().await.unwrap().quote() })
13843            }),
13844        );
13845        EnumValueTypeDef {
13846            proc: self.proc.clone(),
13847            selection: query,
13848            graphql_client: self.graphql_client.clone(),
13849        }
13850    }
13851    /// Load a EnvFile from its ID.
13852    pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
13853        let mut query = self.selection.select("loadEnvFileFromID");
13854        query = query.arg_lazy(
13855            "id",
13856            Box::new(move || {
13857                let id = id.clone();
13858                Box::pin(async move { id.into_id().await.unwrap().quote() })
13859            }),
13860        );
13861        EnvFile {
13862            proc: self.proc.clone(),
13863            selection: query,
13864            graphql_client: self.graphql_client.clone(),
13865        }
13866    }
13867    /// Load a Env from its ID.
13868    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
13869        let mut query = self.selection.select("loadEnvFromID");
13870        query = query.arg_lazy(
13871            "id",
13872            Box::new(move || {
13873                let id = id.clone();
13874                Box::pin(async move { id.into_id().await.unwrap().quote() })
13875            }),
13876        );
13877        Env {
13878            proc: self.proc.clone(),
13879            selection: query,
13880            graphql_client: self.graphql_client.clone(),
13881        }
13882    }
13883    /// Load a EnvVariable from its ID.
13884    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
13885        let mut query = self.selection.select("loadEnvVariableFromID");
13886        query = query.arg_lazy(
13887            "id",
13888            Box::new(move || {
13889                let id = id.clone();
13890                Box::pin(async move { id.into_id().await.unwrap().quote() })
13891            }),
13892        );
13893        EnvVariable {
13894            proc: self.proc.clone(),
13895            selection: query,
13896            graphql_client: self.graphql_client.clone(),
13897        }
13898    }
13899    /// Load a Error from its ID.
13900    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
13901        let mut query = self.selection.select("loadErrorFromID");
13902        query = query.arg_lazy(
13903            "id",
13904            Box::new(move || {
13905                let id = id.clone();
13906                Box::pin(async move { id.into_id().await.unwrap().quote() })
13907            }),
13908        );
13909        Error {
13910            proc: self.proc.clone(),
13911            selection: query,
13912            graphql_client: self.graphql_client.clone(),
13913        }
13914    }
13915    /// Load a ErrorValue from its ID.
13916    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
13917        let mut query = self.selection.select("loadErrorValueFromID");
13918        query = query.arg_lazy(
13919            "id",
13920            Box::new(move || {
13921                let id = id.clone();
13922                Box::pin(async move { id.into_id().await.unwrap().quote() })
13923            }),
13924        );
13925        ErrorValue {
13926            proc: self.proc.clone(),
13927            selection: query,
13928            graphql_client: self.graphql_client.clone(),
13929        }
13930    }
13931    /// Load a FieldTypeDef from its ID.
13932    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
13933        let mut query = self.selection.select("loadFieldTypeDefFromID");
13934        query = query.arg_lazy(
13935            "id",
13936            Box::new(move || {
13937                let id = id.clone();
13938                Box::pin(async move { id.into_id().await.unwrap().quote() })
13939            }),
13940        );
13941        FieldTypeDef {
13942            proc: self.proc.clone(),
13943            selection: query,
13944            graphql_client: self.graphql_client.clone(),
13945        }
13946    }
13947    /// Load a File from its ID.
13948    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
13949        let mut query = self.selection.select("loadFileFromID");
13950        query = query.arg_lazy(
13951            "id",
13952            Box::new(move || {
13953                let id = id.clone();
13954                Box::pin(async move { id.into_id().await.unwrap().quote() })
13955            }),
13956        );
13957        File {
13958            proc: self.proc.clone(),
13959            selection: query,
13960            graphql_client: self.graphql_client.clone(),
13961        }
13962    }
13963    /// Load a FunctionArg from its ID.
13964    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
13965        let mut query = self.selection.select("loadFunctionArgFromID");
13966        query = query.arg_lazy(
13967            "id",
13968            Box::new(move || {
13969                let id = id.clone();
13970                Box::pin(async move { id.into_id().await.unwrap().quote() })
13971            }),
13972        );
13973        FunctionArg {
13974            proc: self.proc.clone(),
13975            selection: query,
13976            graphql_client: self.graphql_client.clone(),
13977        }
13978    }
13979    /// Load a FunctionCallArgValue from its ID.
13980    pub fn load_function_call_arg_value_from_id(
13981        &self,
13982        id: impl IntoID<FunctionCallArgValueId>,
13983    ) -> FunctionCallArgValue {
13984        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
13985        query = query.arg_lazy(
13986            "id",
13987            Box::new(move || {
13988                let id = id.clone();
13989                Box::pin(async move { id.into_id().await.unwrap().quote() })
13990            }),
13991        );
13992        FunctionCallArgValue {
13993            proc: self.proc.clone(),
13994            selection: query,
13995            graphql_client: self.graphql_client.clone(),
13996        }
13997    }
13998    /// Load a FunctionCall from its ID.
13999    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
14000        let mut query = self.selection.select("loadFunctionCallFromID");
14001        query = query.arg_lazy(
14002            "id",
14003            Box::new(move || {
14004                let id = id.clone();
14005                Box::pin(async move { id.into_id().await.unwrap().quote() })
14006            }),
14007        );
14008        FunctionCall {
14009            proc: self.proc.clone(),
14010            selection: query,
14011            graphql_client: self.graphql_client.clone(),
14012        }
14013    }
14014    /// Load a Function from its ID.
14015    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
14016        let mut query = self.selection.select("loadFunctionFromID");
14017        query = query.arg_lazy(
14018            "id",
14019            Box::new(move || {
14020                let id = id.clone();
14021                Box::pin(async move { id.into_id().await.unwrap().quote() })
14022            }),
14023        );
14024        Function {
14025            proc: self.proc.clone(),
14026            selection: query,
14027            graphql_client: self.graphql_client.clone(),
14028        }
14029    }
14030    /// Load a GeneratedCode from its ID.
14031    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
14032        let mut query = self.selection.select("loadGeneratedCodeFromID");
14033        query = query.arg_lazy(
14034            "id",
14035            Box::new(move || {
14036                let id = id.clone();
14037                Box::pin(async move { id.into_id().await.unwrap().quote() })
14038            }),
14039        );
14040        GeneratedCode {
14041            proc: self.proc.clone(),
14042            selection: query,
14043            graphql_client: self.graphql_client.clone(),
14044        }
14045    }
14046    /// Load a Generator from its ID.
14047    pub fn load_generator_from_id(&self, id: impl IntoID<GeneratorId>) -> Generator {
14048        let mut query = self.selection.select("loadGeneratorFromID");
14049        query = query.arg_lazy(
14050            "id",
14051            Box::new(move || {
14052                let id = id.clone();
14053                Box::pin(async move { id.into_id().await.unwrap().quote() })
14054            }),
14055        );
14056        Generator {
14057            proc: self.proc.clone(),
14058            selection: query,
14059            graphql_client: self.graphql_client.clone(),
14060        }
14061    }
14062    /// Load a GeneratorGroup from its ID.
14063    pub fn load_generator_group_from_id(
14064        &self,
14065        id: impl IntoID<GeneratorGroupId>,
14066    ) -> GeneratorGroup {
14067        let mut query = self.selection.select("loadGeneratorGroupFromID");
14068        query = query.arg_lazy(
14069            "id",
14070            Box::new(move || {
14071                let id = id.clone();
14072                Box::pin(async move { id.into_id().await.unwrap().quote() })
14073            }),
14074        );
14075        GeneratorGroup {
14076            proc: self.proc.clone(),
14077            selection: query,
14078            graphql_client: self.graphql_client.clone(),
14079        }
14080    }
14081    /// Load a GitRef from its ID.
14082    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
14083        let mut query = self.selection.select("loadGitRefFromID");
14084        query = query.arg_lazy(
14085            "id",
14086            Box::new(move || {
14087                let id = id.clone();
14088                Box::pin(async move { id.into_id().await.unwrap().quote() })
14089            }),
14090        );
14091        GitRef {
14092            proc: self.proc.clone(),
14093            selection: query,
14094            graphql_client: self.graphql_client.clone(),
14095        }
14096    }
14097    /// Load a GitRepository from its ID.
14098    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
14099        let mut query = self.selection.select("loadGitRepositoryFromID");
14100        query = query.arg_lazy(
14101            "id",
14102            Box::new(move || {
14103                let id = id.clone();
14104                Box::pin(async move { id.into_id().await.unwrap().quote() })
14105            }),
14106        );
14107        GitRepository {
14108            proc: self.proc.clone(),
14109            selection: query,
14110            graphql_client: self.graphql_client.clone(),
14111        }
14112    }
14113    /// Load a HTTPState from its ID.
14114    pub fn load_http_state_from_id(&self, id: impl IntoID<HttpStateId>) -> HttpState {
14115        let mut query = self.selection.select("loadHTTPStateFromID");
14116        query = query.arg_lazy(
14117            "id",
14118            Box::new(move || {
14119                let id = id.clone();
14120                Box::pin(async move { id.into_id().await.unwrap().quote() })
14121            }),
14122        );
14123        HttpState {
14124            proc: self.proc.clone(),
14125            selection: query,
14126            graphql_client: self.graphql_client.clone(),
14127        }
14128    }
14129    /// Load a HealthcheckConfig from its ID.
14130    pub fn load_healthcheck_config_from_id(
14131        &self,
14132        id: impl IntoID<HealthcheckConfigId>,
14133    ) -> HealthcheckConfig {
14134        let mut query = self.selection.select("loadHealthcheckConfigFromID");
14135        query = query.arg_lazy(
14136            "id",
14137            Box::new(move || {
14138                let id = id.clone();
14139                Box::pin(async move { id.into_id().await.unwrap().quote() })
14140            }),
14141        );
14142        HealthcheckConfig {
14143            proc: self.proc.clone(),
14144            selection: query,
14145            graphql_client: self.graphql_client.clone(),
14146        }
14147    }
14148    /// Load a Host from its ID.
14149    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
14150        let mut query = self.selection.select("loadHostFromID");
14151        query = query.arg_lazy(
14152            "id",
14153            Box::new(move || {
14154                let id = id.clone();
14155                Box::pin(async move { id.into_id().await.unwrap().quote() })
14156            }),
14157        );
14158        Host {
14159            proc: self.proc.clone(),
14160            selection: query,
14161            graphql_client: self.graphql_client.clone(),
14162        }
14163    }
14164    /// Load a InputTypeDef from its ID.
14165    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
14166        let mut query = self.selection.select("loadInputTypeDefFromID");
14167        query = query.arg_lazy(
14168            "id",
14169            Box::new(move || {
14170                let id = id.clone();
14171                Box::pin(async move { id.into_id().await.unwrap().quote() })
14172            }),
14173        );
14174        InputTypeDef {
14175            proc: self.proc.clone(),
14176            selection: query,
14177            graphql_client: self.graphql_client.clone(),
14178        }
14179    }
14180    /// Load a InterfaceTypeDef from its ID.
14181    pub fn load_interface_type_def_from_id(
14182        &self,
14183        id: impl IntoID<InterfaceTypeDefId>,
14184    ) -> InterfaceTypeDef {
14185        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
14186        query = query.arg_lazy(
14187            "id",
14188            Box::new(move || {
14189                let id = id.clone();
14190                Box::pin(async move { id.into_id().await.unwrap().quote() })
14191            }),
14192        );
14193        InterfaceTypeDef {
14194            proc: self.proc.clone(),
14195            selection: query,
14196            graphql_client: self.graphql_client.clone(),
14197        }
14198    }
14199    /// Load a JSONValue from its ID.
14200    pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
14201        let mut query = self.selection.select("loadJSONValueFromID");
14202        query = query.arg_lazy(
14203            "id",
14204            Box::new(move || {
14205                let id = id.clone();
14206                Box::pin(async move { id.into_id().await.unwrap().quote() })
14207            }),
14208        );
14209        JsonValue {
14210            proc: self.proc.clone(),
14211            selection: query,
14212            graphql_client: self.graphql_client.clone(),
14213        }
14214    }
14215    /// Load a LLM from its ID.
14216    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
14217        let mut query = self.selection.select("loadLLMFromID");
14218        query = query.arg_lazy(
14219            "id",
14220            Box::new(move || {
14221                let id = id.clone();
14222                Box::pin(async move { id.into_id().await.unwrap().quote() })
14223            }),
14224        );
14225        Llm {
14226            proc: self.proc.clone(),
14227            selection: query,
14228            graphql_client: self.graphql_client.clone(),
14229        }
14230    }
14231    /// Load a LLMTokenUsage from its ID.
14232    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
14233        let mut query = self.selection.select("loadLLMTokenUsageFromID");
14234        query = query.arg_lazy(
14235            "id",
14236            Box::new(move || {
14237                let id = id.clone();
14238                Box::pin(async move { id.into_id().await.unwrap().quote() })
14239            }),
14240        );
14241        LlmTokenUsage {
14242            proc: self.proc.clone(),
14243            selection: query,
14244            graphql_client: self.graphql_client.clone(),
14245        }
14246    }
14247    /// Load a Label from its ID.
14248    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
14249        let mut query = self.selection.select("loadLabelFromID");
14250        query = query.arg_lazy(
14251            "id",
14252            Box::new(move || {
14253                let id = id.clone();
14254                Box::pin(async move { id.into_id().await.unwrap().quote() })
14255            }),
14256        );
14257        Label {
14258            proc: self.proc.clone(),
14259            selection: query,
14260            graphql_client: self.graphql_client.clone(),
14261        }
14262    }
14263    /// Load a ListTypeDef from its ID.
14264    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
14265        let mut query = self.selection.select("loadListTypeDefFromID");
14266        query = query.arg_lazy(
14267            "id",
14268            Box::new(move || {
14269                let id = id.clone();
14270                Box::pin(async move { id.into_id().await.unwrap().quote() })
14271            }),
14272        );
14273        ListTypeDef {
14274            proc: self.proc.clone(),
14275            selection: query,
14276            graphql_client: self.graphql_client.clone(),
14277        }
14278    }
14279    /// Load a ModuleConfigClient from its ID.
14280    pub fn load_module_config_client_from_id(
14281        &self,
14282        id: impl IntoID<ModuleConfigClientId>,
14283    ) -> ModuleConfigClient {
14284        let mut query = self.selection.select("loadModuleConfigClientFromID");
14285        query = query.arg_lazy(
14286            "id",
14287            Box::new(move || {
14288                let id = id.clone();
14289                Box::pin(async move { id.into_id().await.unwrap().quote() })
14290            }),
14291        );
14292        ModuleConfigClient {
14293            proc: self.proc.clone(),
14294            selection: query,
14295            graphql_client: self.graphql_client.clone(),
14296        }
14297    }
14298    /// Load a Module from its ID.
14299    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
14300        let mut query = self.selection.select("loadModuleFromID");
14301        query = query.arg_lazy(
14302            "id",
14303            Box::new(move || {
14304                let id = id.clone();
14305                Box::pin(async move { id.into_id().await.unwrap().quote() })
14306            }),
14307        );
14308        Module {
14309            proc: self.proc.clone(),
14310            selection: query,
14311            graphql_client: self.graphql_client.clone(),
14312        }
14313    }
14314    /// Load a ModuleSource from its ID.
14315    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
14316        let mut query = self.selection.select("loadModuleSourceFromID");
14317        query = query.arg_lazy(
14318            "id",
14319            Box::new(move || {
14320                let id = id.clone();
14321                Box::pin(async move { id.into_id().await.unwrap().quote() })
14322            }),
14323        );
14324        ModuleSource {
14325            proc: self.proc.clone(),
14326            selection: query,
14327            graphql_client: self.graphql_client.clone(),
14328        }
14329    }
14330    /// Load a ObjectTypeDef from its ID.
14331    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
14332        let mut query = self.selection.select("loadObjectTypeDefFromID");
14333        query = query.arg_lazy(
14334            "id",
14335            Box::new(move || {
14336                let id = id.clone();
14337                Box::pin(async move { id.into_id().await.unwrap().quote() })
14338            }),
14339        );
14340        ObjectTypeDef {
14341            proc: self.proc.clone(),
14342            selection: query,
14343            graphql_client: self.graphql_client.clone(),
14344        }
14345    }
14346    /// Load a Port from its ID.
14347    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
14348        let mut query = self.selection.select("loadPortFromID");
14349        query = query.arg_lazy(
14350            "id",
14351            Box::new(move || {
14352                let id = id.clone();
14353                Box::pin(async move { id.into_id().await.unwrap().quote() })
14354            }),
14355        );
14356        Port {
14357            proc: self.proc.clone(),
14358            selection: query,
14359            graphql_client: self.graphql_client.clone(),
14360        }
14361    }
14362    /// Load a Query from its ID.
14363    pub fn load_query_from_id(&self, id: impl IntoID<QueryId>) -> Query {
14364        let mut query = self.selection.select("loadQueryFromID");
14365        query = query.arg_lazy(
14366            "id",
14367            Box::new(move || {
14368                let id = id.clone();
14369                Box::pin(async move { id.into_id().await.unwrap().quote() })
14370            }),
14371        );
14372        Query {
14373            proc: self.proc.clone(),
14374            selection: query,
14375            graphql_client: self.graphql_client.clone(),
14376        }
14377    }
14378    /// Load a RemoteGitMirror from its ID.
14379    pub fn load_remote_git_mirror_from_id(
14380        &self,
14381        id: impl IntoID<RemoteGitMirrorId>,
14382    ) -> RemoteGitMirror {
14383        let mut query = self.selection.select("loadRemoteGitMirrorFromID");
14384        query = query.arg_lazy(
14385            "id",
14386            Box::new(move || {
14387                let id = id.clone();
14388                Box::pin(async move { id.into_id().await.unwrap().quote() })
14389            }),
14390        );
14391        RemoteGitMirror {
14392            proc: self.proc.clone(),
14393            selection: query,
14394            graphql_client: self.graphql_client.clone(),
14395        }
14396    }
14397    /// Load a SDKConfig from its ID.
14398    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
14399        let mut query = self.selection.select("loadSDKConfigFromID");
14400        query = query.arg_lazy(
14401            "id",
14402            Box::new(move || {
14403                let id = id.clone();
14404                Box::pin(async move { id.into_id().await.unwrap().quote() })
14405            }),
14406        );
14407        SdkConfig {
14408            proc: self.proc.clone(),
14409            selection: query,
14410            graphql_client: self.graphql_client.clone(),
14411        }
14412    }
14413    /// Load a ScalarTypeDef from its ID.
14414    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
14415        let mut query = self.selection.select("loadScalarTypeDefFromID");
14416        query = query.arg_lazy(
14417            "id",
14418            Box::new(move || {
14419                let id = id.clone();
14420                Box::pin(async move { id.into_id().await.unwrap().quote() })
14421            }),
14422        );
14423        ScalarTypeDef {
14424            proc: self.proc.clone(),
14425            selection: query,
14426            graphql_client: self.graphql_client.clone(),
14427        }
14428    }
14429    /// Load a SearchResult from its ID.
14430    pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
14431        let mut query = self.selection.select("loadSearchResultFromID");
14432        query = query.arg_lazy(
14433            "id",
14434            Box::new(move || {
14435                let id = id.clone();
14436                Box::pin(async move { id.into_id().await.unwrap().quote() })
14437            }),
14438        );
14439        SearchResult {
14440            proc: self.proc.clone(),
14441            selection: query,
14442            graphql_client: self.graphql_client.clone(),
14443        }
14444    }
14445    /// Load a SearchSubmatch from its ID.
14446    pub fn load_search_submatch_from_id(
14447        &self,
14448        id: impl IntoID<SearchSubmatchId>,
14449    ) -> SearchSubmatch {
14450        let mut query = self.selection.select("loadSearchSubmatchFromID");
14451        query = query.arg_lazy(
14452            "id",
14453            Box::new(move || {
14454                let id = id.clone();
14455                Box::pin(async move { id.into_id().await.unwrap().quote() })
14456            }),
14457        );
14458        SearchSubmatch {
14459            proc: self.proc.clone(),
14460            selection: query,
14461            graphql_client: self.graphql_client.clone(),
14462        }
14463    }
14464    /// Load a Secret from its ID.
14465    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
14466        let mut query = self.selection.select("loadSecretFromID");
14467        query = query.arg_lazy(
14468            "id",
14469            Box::new(move || {
14470                let id = id.clone();
14471                Box::pin(async move { id.into_id().await.unwrap().quote() })
14472            }),
14473        );
14474        Secret {
14475            proc: self.proc.clone(),
14476            selection: query,
14477            graphql_client: self.graphql_client.clone(),
14478        }
14479    }
14480    /// Load a Service from its ID.
14481    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
14482        let mut query = self.selection.select("loadServiceFromID");
14483        query = query.arg_lazy(
14484            "id",
14485            Box::new(move || {
14486                let id = id.clone();
14487                Box::pin(async move { id.into_id().await.unwrap().quote() })
14488            }),
14489        );
14490        Service {
14491            proc: self.proc.clone(),
14492            selection: query,
14493            graphql_client: self.graphql_client.clone(),
14494        }
14495    }
14496    /// Load a Socket from its ID.
14497    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
14498        let mut query = self.selection.select("loadSocketFromID");
14499        query = query.arg_lazy(
14500            "id",
14501            Box::new(move || {
14502                let id = id.clone();
14503                Box::pin(async move { id.into_id().await.unwrap().quote() })
14504            }),
14505        );
14506        Socket {
14507            proc: self.proc.clone(),
14508            selection: query,
14509            graphql_client: self.graphql_client.clone(),
14510        }
14511    }
14512    /// Load a SourceMap from its ID.
14513    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
14514        let mut query = self.selection.select("loadSourceMapFromID");
14515        query = query.arg_lazy(
14516            "id",
14517            Box::new(move || {
14518                let id = id.clone();
14519                Box::pin(async move { id.into_id().await.unwrap().quote() })
14520            }),
14521        );
14522        SourceMap {
14523            proc: self.proc.clone(),
14524            selection: query,
14525            graphql_client: self.graphql_client.clone(),
14526        }
14527    }
14528    /// Load a Stat from its ID.
14529    pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
14530        let mut query = self.selection.select("loadStatFromID");
14531        query = query.arg_lazy(
14532            "id",
14533            Box::new(move || {
14534                let id = id.clone();
14535                Box::pin(async move { id.into_id().await.unwrap().quote() })
14536            }),
14537        );
14538        Stat {
14539            proc: self.proc.clone(),
14540            selection: query,
14541            graphql_client: self.graphql_client.clone(),
14542        }
14543    }
14544    /// Load a Terminal from its ID.
14545    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
14546        let mut query = self.selection.select("loadTerminalFromID");
14547        query = query.arg_lazy(
14548            "id",
14549            Box::new(move || {
14550                let id = id.clone();
14551                Box::pin(async move { id.into_id().await.unwrap().quote() })
14552            }),
14553        );
14554        Terminal {
14555            proc: self.proc.clone(),
14556            selection: query,
14557            graphql_client: self.graphql_client.clone(),
14558        }
14559    }
14560    /// Load a TypeDef from its ID.
14561    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
14562        let mut query = self.selection.select("loadTypeDefFromID");
14563        query = query.arg_lazy(
14564            "id",
14565            Box::new(move || {
14566                let id = id.clone();
14567                Box::pin(async move { id.into_id().await.unwrap().quote() })
14568            }),
14569        );
14570        TypeDef {
14571            proc: self.proc.clone(),
14572            selection: query,
14573            graphql_client: self.graphql_client.clone(),
14574        }
14575    }
14576    /// Load a Up from its ID.
14577    pub fn load_up_from_id(&self, id: impl IntoID<UpId>) -> Up {
14578        let mut query = self.selection.select("loadUpFromID");
14579        query = query.arg_lazy(
14580            "id",
14581            Box::new(move || {
14582                let id = id.clone();
14583                Box::pin(async move { id.into_id().await.unwrap().quote() })
14584            }),
14585        );
14586        Up {
14587            proc: self.proc.clone(),
14588            selection: query,
14589            graphql_client: self.graphql_client.clone(),
14590        }
14591    }
14592    /// Load a UpGroup from its ID.
14593    pub fn load_up_group_from_id(&self, id: impl IntoID<UpGroupId>) -> UpGroup {
14594        let mut query = self.selection.select("loadUpGroupFromID");
14595        query = query.arg_lazy(
14596            "id",
14597            Box::new(move || {
14598                let id = id.clone();
14599                Box::pin(async move { id.into_id().await.unwrap().quote() })
14600            }),
14601        );
14602        UpGroup {
14603            proc: self.proc.clone(),
14604            selection: query,
14605            graphql_client: self.graphql_client.clone(),
14606        }
14607    }
14608    /// Load a Workspace from its ID.
14609    pub fn load_workspace_from_id(&self, id: impl IntoID<WorkspaceId>) -> Workspace {
14610        let mut query = self.selection.select("loadWorkspaceFromID");
14611        query = query.arg_lazy(
14612            "id",
14613            Box::new(move || {
14614                let id = id.clone();
14615                Box::pin(async move { id.into_id().await.unwrap().quote() })
14616            }),
14617        );
14618        Workspace {
14619            proc: self.proc.clone(),
14620            selection: query,
14621            graphql_client: self.graphql_client.clone(),
14622        }
14623    }
14624    /// Create a new module.
14625    pub fn module(&self) -> Module {
14626        let query = self.selection.select("module");
14627        Module {
14628            proc: self.proc.clone(),
14629            selection: query,
14630            graphql_client: self.graphql_client.clone(),
14631        }
14632    }
14633    /// Create a new module source instance from a source ref string
14634    ///
14635    /// # Arguments
14636    ///
14637    /// * `ref_string` - The string ref representation of the module source
14638    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14639    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
14640        let mut query = self.selection.select("moduleSource");
14641        query = query.arg("refString", ref_string.into());
14642        ModuleSource {
14643            proc: self.proc.clone(),
14644            selection: query,
14645            graphql_client: self.graphql_client.clone(),
14646        }
14647    }
14648    /// Create a new module source instance from a source ref string
14649    ///
14650    /// # Arguments
14651    ///
14652    /// * `ref_string` - The string ref representation of the module source
14653    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14654    pub fn module_source_opts<'a>(
14655        &self,
14656        ref_string: impl Into<String>,
14657        opts: QueryModuleSourceOpts<'a>,
14658    ) -> ModuleSource {
14659        let mut query = self.selection.select("moduleSource");
14660        query = query.arg("refString", ref_string.into());
14661        if let Some(ref_pin) = opts.ref_pin {
14662            query = query.arg("refPin", ref_pin);
14663        }
14664        if let Some(disable_find_up) = opts.disable_find_up {
14665            query = query.arg("disableFindUp", disable_find_up);
14666        }
14667        if let Some(allow_not_exists) = opts.allow_not_exists {
14668            query = query.arg("allowNotExists", allow_not_exists);
14669        }
14670        if let Some(require_kind) = opts.require_kind {
14671            query = query.arg("requireKind", require_kind);
14672        }
14673        ModuleSource {
14674            proc: self.proc.clone(),
14675            selection: query,
14676            graphql_client: self.graphql_client.clone(),
14677        }
14678    }
14679    /// Creates a new secret.
14680    ///
14681    /// # Arguments
14682    ///
14683    /// * `uri` - The URI of the secret store
14684    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14685    pub fn secret(&self, uri: impl Into<String>) -> Secret {
14686        let mut query = self.selection.select("secret");
14687        query = query.arg("uri", uri.into());
14688        Secret {
14689            proc: self.proc.clone(),
14690            selection: query,
14691            graphql_client: self.graphql_client.clone(),
14692        }
14693    }
14694    /// Creates a new secret.
14695    ///
14696    /// # Arguments
14697    ///
14698    /// * `uri` - The URI of the secret store
14699    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14700    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
14701        let mut query = self.selection.select("secret");
14702        query = query.arg("uri", uri.into());
14703        if let Some(cache_key) = opts.cache_key {
14704            query = query.arg("cacheKey", cache_key);
14705        }
14706        Secret {
14707            proc: self.proc.clone(),
14708            selection: query,
14709            graphql_client: self.graphql_client.clone(),
14710        }
14711    }
14712    /// Sets a secret given a user defined name to its plaintext and returns the secret.
14713    /// The plaintext value is limited to a size of 128000 bytes.
14714    ///
14715    /// # Arguments
14716    ///
14717    /// * `name` - The user defined name for this secret
14718    /// * `plaintext` - The plaintext of the secret
14719    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
14720        let mut query = self.selection.select("setSecret");
14721        query = query.arg("name", name.into());
14722        query = query.arg("plaintext", plaintext.into());
14723        Secret {
14724            proc: self.proc.clone(),
14725            selection: query,
14726            graphql_client: self.graphql_client.clone(),
14727        }
14728    }
14729    /// Creates source map metadata.
14730    ///
14731    /// # Arguments
14732    ///
14733    /// * `filename` - The filename from the module source.
14734    /// * `line` - The line number within the filename.
14735    /// * `column` - The column number within the line.
14736    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
14737        let mut query = self.selection.select("sourceMap");
14738        query = query.arg("filename", filename.into());
14739        query = query.arg("line", line);
14740        query = query.arg("column", column);
14741        SourceMap {
14742            proc: self.proc.clone(),
14743            selection: query,
14744            graphql_client: self.graphql_client.clone(),
14745        }
14746    }
14747    /// Create a new TypeDef.
14748    pub fn type_def(&self) -> TypeDef {
14749        let query = self.selection.select("typeDef");
14750        TypeDef {
14751            proc: self.proc.clone(),
14752            selection: query,
14753            graphql_client: self.graphql_client.clone(),
14754        }
14755    }
14756    /// Get the current Dagger Engine version.
14757    pub async fn version(&self) -> Result<String, DaggerError> {
14758        let query = self.selection.select("version");
14759        query.execute(self.graphql_client.clone()).await
14760    }
14761}
14762#[derive(Clone)]
14763pub struct RemoteGitMirror {
14764    pub proc: Option<Arc<DaggerSessionProc>>,
14765    pub selection: Selection,
14766    pub graphql_client: DynGraphQLClient,
14767}
14768impl RemoteGitMirror {
14769    /// A unique identifier for this RemoteGitMirror.
14770    pub async fn id(&self) -> Result<RemoteGitMirrorId, DaggerError> {
14771        let query = self.selection.select("id");
14772        query.execute(self.graphql_client.clone()).await
14773    }
14774}
14775#[derive(Clone)]
14776pub struct SdkConfig {
14777    pub proc: Option<Arc<DaggerSessionProc>>,
14778    pub selection: Selection,
14779    pub graphql_client: DynGraphQLClient,
14780}
14781impl SdkConfig {
14782    /// Whether to start the SDK runtime in debug mode with an interactive terminal.
14783    pub async fn debug(&self) -> Result<bool, DaggerError> {
14784        let query = self.selection.select("debug");
14785        query.execute(self.graphql_client.clone()).await
14786    }
14787    /// A unique identifier for this SDKConfig.
14788    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
14789        let query = self.selection.select("id");
14790        query.execute(self.graphql_client.clone()).await
14791    }
14792    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
14793    pub async fn source(&self) -> Result<String, DaggerError> {
14794        let query = self.selection.select("source");
14795        query.execute(self.graphql_client.clone()).await
14796    }
14797}
14798#[derive(Clone)]
14799pub struct ScalarTypeDef {
14800    pub proc: Option<Arc<DaggerSessionProc>>,
14801    pub selection: Selection,
14802    pub graphql_client: DynGraphQLClient,
14803}
14804impl ScalarTypeDef {
14805    /// A doc string for the scalar, if any.
14806    pub async fn description(&self) -> Result<String, DaggerError> {
14807        let query = self.selection.select("description");
14808        query.execute(self.graphql_client.clone()).await
14809    }
14810    /// A unique identifier for this ScalarTypeDef.
14811    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
14812        let query = self.selection.select("id");
14813        query.execute(self.graphql_client.clone()).await
14814    }
14815    /// The name of the scalar.
14816    pub async fn name(&self) -> Result<String, DaggerError> {
14817        let query = self.selection.select("name");
14818        query.execute(self.graphql_client.clone()).await
14819    }
14820    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
14821    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
14822        let query = self.selection.select("sourceModuleName");
14823        query.execute(self.graphql_client.clone()).await
14824    }
14825}
14826#[derive(Clone)]
14827pub struct SearchResult {
14828    pub proc: Option<Arc<DaggerSessionProc>>,
14829    pub selection: Selection,
14830    pub graphql_client: DynGraphQLClient,
14831}
14832impl SearchResult {
14833    /// The byte offset of this line within the file.
14834    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
14835        let query = self.selection.select("absoluteOffset");
14836        query.execute(self.graphql_client.clone()).await
14837    }
14838    /// The path to the file that matched.
14839    pub async fn file_path(&self) -> Result<String, DaggerError> {
14840        let query = self.selection.select("filePath");
14841        query.execute(self.graphql_client.clone()).await
14842    }
14843    /// A unique identifier for this SearchResult.
14844    pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
14845        let query = self.selection.select("id");
14846        query.execute(self.graphql_client.clone()).await
14847    }
14848    /// The first line that matched.
14849    pub async fn line_number(&self) -> Result<isize, DaggerError> {
14850        let query = self.selection.select("lineNumber");
14851        query.execute(self.graphql_client.clone()).await
14852    }
14853    /// The line content that matched.
14854    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
14855        let query = self.selection.select("matchedLines");
14856        query.execute(self.graphql_client.clone()).await
14857    }
14858    /// Sub-match positions and content within the matched lines.
14859    pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
14860        let query = self.selection.select("submatches");
14861        let query = query.select("id");
14862        let ids: Vec<SearchSubmatchId> = query.execute(self.graphql_client.clone()).await?;
14863        let root = Query {
14864            proc: self.proc.clone(),
14865            selection: crate::querybuilder::query(),
14866            graphql_client: self.graphql_client.clone(),
14867        };
14868        Ok(ids
14869            .into_iter()
14870            .map(|id| root.load_search_submatch_from_id(id))
14871            .collect())
14872    }
14873}
14874#[derive(Clone)]
14875pub struct SearchSubmatch {
14876    pub proc: Option<Arc<DaggerSessionProc>>,
14877    pub selection: Selection,
14878    pub graphql_client: DynGraphQLClient,
14879}
14880impl SearchSubmatch {
14881    /// The match's end offset within the matched lines.
14882    pub async fn end(&self) -> Result<isize, DaggerError> {
14883        let query = self.selection.select("end");
14884        query.execute(self.graphql_client.clone()).await
14885    }
14886    /// A unique identifier for this SearchSubmatch.
14887    pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
14888        let query = self.selection.select("id");
14889        query.execute(self.graphql_client.clone()).await
14890    }
14891    /// The match's start offset within the matched lines.
14892    pub async fn start(&self) -> Result<isize, DaggerError> {
14893        let query = self.selection.select("start");
14894        query.execute(self.graphql_client.clone()).await
14895    }
14896    /// The matched text.
14897    pub async fn text(&self) -> Result<String, DaggerError> {
14898        let query = self.selection.select("text");
14899        query.execute(self.graphql_client.clone()).await
14900    }
14901}
14902#[derive(Clone)]
14903pub struct Secret {
14904    pub proc: Option<Arc<DaggerSessionProc>>,
14905    pub selection: Selection,
14906    pub graphql_client: DynGraphQLClient,
14907}
14908impl Secret {
14909    /// A unique identifier for this Secret.
14910    pub async fn id(&self) -> Result<SecretId, DaggerError> {
14911        let query = self.selection.select("id");
14912        query.execute(self.graphql_client.clone()).await
14913    }
14914    /// The name of this secret.
14915    pub async fn name(&self) -> Result<String, DaggerError> {
14916        let query = self.selection.select("name");
14917        query.execute(self.graphql_client.clone()).await
14918    }
14919    /// The value of this secret.
14920    pub async fn plaintext(&self) -> Result<String, DaggerError> {
14921        let query = self.selection.select("plaintext");
14922        query.execute(self.graphql_client.clone()).await
14923    }
14924    /// The URI of this secret.
14925    pub async fn uri(&self) -> Result<String, DaggerError> {
14926        let query = self.selection.select("uri");
14927        query.execute(self.graphql_client.clone()).await
14928    }
14929}
14930#[derive(Clone)]
14931pub struct Service {
14932    pub proc: Option<Arc<DaggerSessionProc>>,
14933    pub selection: Selection,
14934    pub graphql_client: DynGraphQLClient,
14935}
14936#[derive(Builder, Debug, PartialEq)]
14937pub struct ServiceEndpointOpts<'a> {
14938    /// The exposed port number for the endpoint
14939    #[builder(setter(into, strip_option), default)]
14940    pub port: Option<isize>,
14941    /// Return a URL with the given scheme, eg. http for http://
14942    #[builder(setter(into, strip_option), default)]
14943    pub scheme: Option<&'a str>,
14944}
14945#[derive(Builder, Debug, PartialEq)]
14946pub struct ServiceStopOpts {
14947    /// Immediately kill the service without waiting for a graceful exit
14948    #[builder(setter(into, strip_option), default)]
14949    pub kill: Option<bool>,
14950}
14951#[derive(Builder, Debug, PartialEq)]
14952pub struct ServiceTerminalOpts<'a> {
14953    #[builder(setter(into, strip_option), default)]
14954    pub cmd: Option<Vec<&'a str>>,
14955}
14956#[derive(Builder, Debug, PartialEq)]
14957pub struct ServiceUpOpts {
14958    /// List of frontend/backend port mappings to forward.
14959    /// Frontend is the port accepting traffic on the host, backend is the service port.
14960    #[builder(setter(into, strip_option), default)]
14961    pub ports: Option<Vec<PortForward>>,
14962    /// Bind each tunnel port to a random port on the host.
14963    #[builder(setter(into, strip_option), default)]
14964    pub random: Option<bool>,
14965}
14966impl Service {
14967    /// Retrieves an endpoint that clients can use to reach this container.
14968    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
14969    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
14970    ///
14971    /// # Arguments
14972    ///
14973    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14974    pub async fn endpoint(&self) -> Result<String, DaggerError> {
14975        let query = self.selection.select("endpoint");
14976        query.execute(self.graphql_client.clone()).await
14977    }
14978    /// Retrieves an endpoint that clients can use to reach this container.
14979    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
14980    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
14981    ///
14982    /// # Arguments
14983    ///
14984    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14985    pub async fn endpoint_opts<'a>(
14986        &self,
14987        opts: ServiceEndpointOpts<'a>,
14988    ) -> Result<String, DaggerError> {
14989        let mut query = self.selection.select("endpoint");
14990        if let Some(port) = opts.port {
14991            query = query.arg("port", port);
14992        }
14993        if let Some(scheme) = opts.scheme {
14994            query = query.arg("scheme", scheme);
14995        }
14996        query.execute(self.graphql_client.clone()).await
14997    }
14998    /// Retrieves a hostname which can be used by clients to reach this container.
14999    pub async fn hostname(&self) -> Result<String, DaggerError> {
15000        let query = self.selection.select("hostname");
15001        query.execute(self.graphql_client.clone()).await
15002    }
15003    /// A unique identifier for this Service.
15004    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
15005        let query = self.selection.select("id");
15006        query.execute(self.graphql_client.clone()).await
15007    }
15008    /// Retrieves the list of ports provided by the service.
15009    pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
15010        let query = self.selection.select("ports");
15011        let query = query.select("id");
15012        let ids: Vec<PortId> = query.execute(self.graphql_client.clone()).await?;
15013        let root = Query {
15014            proc: self.proc.clone(),
15015            selection: crate::querybuilder::query(),
15016            graphql_client: self.graphql_client.clone(),
15017        };
15018        Ok(ids
15019            .into_iter()
15020            .map(|id| root.load_port_from_id(id))
15021            .collect())
15022    }
15023    /// Start the service and wait for its health checks to succeed.
15024    /// Services bound to a Container do not need to be manually started.
15025    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
15026        let query = self.selection.select("start");
15027        query.execute(self.graphql_client.clone()).await
15028    }
15029    /// Stop the service.
15030    ///
15031    /// # Arguments
15032    ///
15033    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15034    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
15035        let query = self.selection.select("stop");
15036        query.execute(self.graphql_client.clone()).await
15037    }
15038    /// Stop the service.
15039    ///
15040    /// # Arguments
15041    ///
15042    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15043    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
15044        let mut query = self.selection.select("stop");
15045        if let Some(kill) = opts.kill {
15046            query = query.arg("kill", kill);
15047        }
15048        query.execute(self.graphql_client.clone()).await
15049    }
15050    /// Forces evaluation of the pipeline in the engine.
15051    pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
15052        let query = self.selection.select("sync");
15053        query.execute(self.graphql_client.clone()).await
15054    }
15055    ///
15056    /// # Arguments
15057    ///
15058    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15059    pub fn terminal(&self) -> Service {
15060        let query = self.selection.select("terminal");
15061        Service {
15062            proc: self.proc.clone(),
15063            selection: query,
15064            graphql_client: self.graphql_client.clone(),
15065        }
15066    }
15067    ///
15068    /// # Arguments
15069    ///
15070    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15071    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
15072        let mut query = self.selection.select("terminal");
15073        if let Some(cmd) = opts.cmd {
15074            query = query.arg("cmd", cmd);
15075        }
15076        Service {
15077            proc: self.proc.clone(),
15078            selection: query,
15079            graphql_client: self.graphql_client.clone(),
15080        }
15081    }
15082    /// Creates a tunnel that forwards traffic from the caller's network to this service.
15083    ///
15084    /// # Arguments
15085    ///
15086    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15087    pub async fn up(&self) -> Result<Void, DaggerError> {
15088        let query = self.selection.select("up");
15089        query.execute(self.graphql_client.clone()).await
15090    }
15091    /// Creates a tunnel that forwards traffic from the caller's network to this service.
15092    ///
15093    /// # Arguments
15094    ///
15095    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15096    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
15097        let mut query = self.selection.select("up");
15098        if let Some(ports) = opts.ports {
15099            query = query.arg("ports", ports);
15100        }
15101        if let Some(random) = opts.random {
15102            query = query.arg("random", random);
15103        }
15104        query.execute(self.graphql_client.clone()).await
15105    }
15106    /// Configures a hostname which can be used by clients within the session to reach this container.
15107    ///
15108    /// # Arguments
15109    ///
15110    /// * `hostname` - The hostname to use.
15111    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
15112        let mut query = self.selection.select("withHostname");
15113        query = query.arg("hostname", hostname.into());
15114        Service {
15115            proc: self.proc.clone(),
15116            selection: query,
15117            graphql_client: self.graphql_client.clone(),
15118        }
15119    }
15120}
15121#[derive(Clone)]
15122pub struct Socket {
15123    pub proc: Option<Arc<DaggerSessionProc>>,
15124    pub selection: Selection,
15125    pub graphql_client: DynGraphQLClient,
15126}
15127impl Socket {
15128    /// A unique identifier for this Socket.
15129    pub async fn id(&self) -> Result<SocketId, DaggerError> {
15130        let query = self.selection.select("id");
15131        query.execute(self.graphql_client.clone()).await
15132    }
15133}
15134#[derive(Clone)]
15135pub struct SourceMap {
15136    pub proc: Option<Arc<DaggerSessionProc>>,
15137    pub selection: Selection,
15138    pub graphql_client: DynGraphQLClient,
15139}
15140impl SourceMap {
15141    /// The column number within the line.
15142    pub async fn column(&self) -> Result<isize, DaggerError> {
15143        let query = self.selection.select("column");
15144        query.execute(self.graphql_client.clone()).await
15145    }
15146    /// The filename from the module source.
15147    pub async fn filename(&self) -> Result<String, DaggerError> {
15148        let query = self.selection.select("filename");
15149        query.execute(self.graphql_client.clone()).await
15150    }
15151    /// A unique identifier for this SourceMap.
15152    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
15153        let query = self.selection.select("id");
15154        query.execute(self.graphql_client.clone()).await
15155    }
15156    /// The line number within the filename.
15157    pub async fn line(&self) -> Result<isize, DaggerError> {
15158        let query = self.selection.select("line");
15159        query.execute(self.graphql_client.clone()).await
15160    }
15161    /// The module dependency this was declared in.
15162    pub async fn module(&self) -> Result<String, DaggerError> {
15163        let query = self.selection.select("module");
15164        query.execute(self.graphql_client.clone()).await
15165    }
15166    /// The URL to the file, if any. This can be used to link to the source map in the browser.
15167    pub async fn url(&self) -> Result<String, DaggerError> {
15168        let query = self.selection.select("url");
15169        query.execute(self.graphql_client.clone()).await
15170    }
15171}
15172#[derive(Clone)]
15173pub struct Stat {
15174    pub proc: Option<Arc<DaggerSessionProc>>,
15175    pub selection: Selection,
15176    pub graphql_client: DynGraphQLClient,
15177}
15178impl Stat {
15179    /// file type
15180    pub async fn file_type(&self) -> Result<FileType, DaggerError> {
15181        let query = self.selection.select("fileType");
15182        query.execute(self.graphql_client.clone()).await
15183    }
15184    /// A unique identifier for this Stat.
15185    pub async fn id(&self) -> Result<StatId, DaggerError> {
15186        let query = self.selection.select("id");
15187        query.execute(self.graphql_client.clone()).await
15188    }
15189    /// file name
15190    pub async fn name(&self) -> Result<String, DaggerError> {
15191        let query = self.selection.select("name");
15192        query.execute(self.graphql_client.clone()).await
15193    }
15194    /// permission bits
15195    pub async fn permissions(&self) -> Result<isize, DaggerError> {
15196        let query = self.selection.select("permissions");
15197        query.execute(self.graphql_client.clone()).await
15198    }
15199    /// file size
15200    pub async fn size(&self) -> Result<isize, DaggerError> {
15201        let query = self.selection.select("size");
15202        query.execute(self.graphql_client.clone()).await
15203    }
15204}
15205#[derive(Clone)]
15206pub struct Terminal {
15207    pub proc: Option<Arc<DaggerSessionProc>>,
15208    pub selection: Selection,
15209    pub graphql_client: DynGraphQLClient,
15210}
15211impl Terminal {
15212    /// A unique identifier for this Terminal.
15213    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
15214        let query = self.selection.select("id");
15215        query.execute(self.graphql_client.clone()).await
15216    }
15217    /// Forces evaluation of the pipeline in the engine.
15218    /// It doesn't run the default command if no exec has been set.
15219    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
15220        let query = self.selection.select("sync");
15221        query.execute(self.graphql_client.clone()).await
15222    }
15223}
15224#[derive(Clone)]
15225pub struct TypeDef {
15226    pub proc: Option<Arc<DaggerSessionProc>>,
15227    pub selection: Selection,
15228    pub graphql_client: DynGraphQLClient,
15229}
15230#[derive(Builder, Debug, PartialEq)]
15231pub struct TypeDefWithEnumOpts<'a> {
15232    /// A doc string for the enum, if any
15233    #[builder(setter(into, strip_option), default)]
15234    pub description: Option<&'a str>,
15235    /// The source map for the enum definition.
15236    #[builder(setter(into, strip_option), default)]
15237    pub source_map: Option<SourceMapId>,
15238}
15239#[derive(Builder, Debug, PartialEq)]
15240pub struct TypeDefWithEnumMemberOpts<'a> {
15241    /// If deprecated, the reason or migration path.
15242    #[builder(setter(into, strip_option), default)]
15243    pub deprecated: Option<&'a str>,
15244    /// A doc string for the member, if any
15245    #[builder(setter(into, strip_option), default)]
15246    pub description: Option<&'a str>,
15247    /// The source map for the enum member definition.
15248    #[builder(setter(into, strip_option), default)]
15249    pub source_map: Option<SourceMapId>,
15250    /// The value of the member in the enum
15251    #[builder(setter(into, strip_option), default)]
15252    pub value: Option<&'a str>,
15253}
15254#[derive(Builder, Debug, PartialEq)]
15255pub struct TypeDefWithEnumValueOpts<'a> {
15256    /// If deprecated, the reason or migration path.
15257    #[builder(setter(into, strip_option), default)]
15258    pub deprecated: Option<&'a str>,
15259    /// A doc string for the value, if any
15260    #[builder(setter(into, strip_option), default)]
15261    pub description: Option<&'a str>,
15262    /// The source map for the enum value definition.
15263    #[builder(setter(into, strip_option), default)]
15264    pub source_map: Option<SourceMapId>,
15265}
15266#[derive(Builder, Debug, PartialEq)]
15267pub struct TypeDefWithFieldOpts<'a> {
15268    /// If deprecated, the reason or migration path.
15269    #[builder(setter(into, strip_option), default)]
15270    pub deprecated: Option<&'a str>,
15271    /// A doc string for the field, if any
15272    #[builder(setter(into, strip_option), default)]
15273    pub description: Option<&'a str>,
15274    /// The source map for the field definition.
15275    #[builder(setter(into, strip_option), default)]
15276    pub source_map: Option<SourceMapId>,
15277}
15278#[derive(Builder, Debug, PartialEq)]
15279pub struct TypeDefWithInterfaceOpts<'a> {
15280    #[builder(setter(into, strip_option), default)]
15281    pub description: Option<&'a str>,
15282    #[builder(setter(into, strip_option), default)]
15283    pub source_map: Option<SourceMapId>,
15284}
15285#[derive(Builder, Debug, PartialEq)]
15286pub struct TypeDefWithObjectOpts<'a> {
15287    #[builder(setter(into, strip_option), default)]
15288    pub deprecated: Option<&'a str>,
15289    #[builder(setter(into, strip_option), default)]
15290    pub description: Option<&'a str>,
15291    #[builder(setter(into, strip_option), default)]
15292    pub source_map: Option<SourceMapId>,
15293}
15294#[derive(Builder, Debug, PartialEq)]
15295pub struct TypeDefWithScalarOpts<'a> {
15296    #[builder(setter(into, strip_option), default)]
15297    pub description: Option<&'a str>,
15298}
15299impl TypeDef {
15300    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
15301    pub fn as_enum(&self) -> EnumTypeDef {
15302        let query = self.selection.select("asEnum");
15303        EnumTypeDef {
15304            proc: self.proc.clone(),
15305            selection: query,
15306            graphql_client: self.graphql_client.clone(),
15307        }
15308    }
15309    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
15310    pub fn as_input(&self) -> InputTypeDef {
15311        let query = self.selection.select("asInput");
15312        InputTypeDef {
15313            proc: self.proc.clone(),
15314            selection: query,
15315            graphql_client: self.graphql_client.clone(),
15316        }
15317    }
15318    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
15319    pub fn as_interface(&self) -> InterfaceTypeDef {
15320        let query = self.selection.select("asInterface");
15321        InterfaceTypeDef {
15322            proc: self.proc.clone(),
15323            selection: query,
15324            graphql_client: self.graphql_client.clone(),
15325        }
15326    }
15327    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
15328    pub fn as_list(&self) -> ListTypeDef {
15329        let query = self.selection.select("asList");
15330        ListTypeDef {
15331            proc: self.proc.clone(),
15332            selection: query,
15333            graphql_client: self.graphql_client.clone(),
15334        }
15335    }
15336    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
15337    pub fn as_object(&self) -> ObjectTypeDef {
15338        let query = self.selection.select("asObject");
15339        ObjectTypeDef {
15340            proc: self.proc.clone(),
15341            selection: query,
15342            graphql_client: self.graphql_client.clone(),
15343        }
15344    }
15345    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
15346    pub fn as_scalar(&self) -> ScalarTypeDef {
15347        let query = self.selection.select("asScalar");
15348        ScalarTypeDef {
15349            proc: self.proc.clone(),
15350            selection: query,
15351            graphql_client: self.graphql_client.clone(),
15352        }
15353    }
15354    /// A unique identifier for this TypeDef.
15355    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
15356        let query = self.selection.select("id");
15357        query.execute(self.graphql_client.clone()).await
15358    }
15359    /// The kind of type this is (e.g. primitive, list, object).
15360    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
15361        let query = self.selection.select("kind");
15362        query.execute(self.graphql_client.clone()).await
15363    }
15364    /// The canonical non-optional name of the type.
15365    pub async fn name(&self) -> Result<String, DaggerError> {
15366        let query = self.selection.select("name");
15367        query.execute(self.graphql_client.clone()).await
15368    }
15369    /// Whether this type can be set to null. Defaults to false.
15370    pub async fn optional(&self) -> Result<bool, DaggerError> {
15371        let query = self.selection.select("optional");
15372        query.execute(self.graphql_client.clone()).await
15373    }
15374    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
15375    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
15376        let mut query = self.selection.select("withConstructor");
15377        query = query.arg_lazy(
15378            "function",
15379            Box::new(move || {
15380                let function = function.clone();
15381                Box::pin(async move { function.into_id().await.unwrap().quote() })
15382            }),
15383        );
15384        TypeDef {
15385            proc: self.proc.clone(),
15386            selection: query,
15387            graphql_client: self.graphql_client.clone(),
15388        }
15389    }
15390    /// Returns a TypeDef of kind Enum with the provided name.
15391    /// 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.
15392    ///
15393    /// # Arguments
15394    ///
15395    /// * `name` - The name of the enum
15396    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15397    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
15398        let mut query = self.selection.select("withEnum");
15399        query = query.arg("name", name.into());
15400        TypeDef {
15401            proc: self.proc.clone(),
15402            selection: query,
15403            graphql_client: self.graphql_client.clone(),
15404        }
15405    }
15406    /// Returns a TypeDef of kind Enum with the provided name.
15407    /// 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.
15408    ///
15409    /// # Arguments
15410    ///
15411    /// * `name` - The name of the enum
15412    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15413    pub fn with_enum_opts<'a>(
15414        &self,
15415        name: impl Into<String>,
15416        opts: TypeDefWithEnumOpts<'a>,
15417    ) -> TypeDef {
15418        let mut query = self.selection.select("withEnum");
15419        query = query.arg("name", name.into());
15420        if let Some(description) = opts.description {
15421            query = query.arg("description", description);
15422        }
15423        if let Some(source_map) = opts.source_map {
15424            query = query.arg("sourceMap", source_map);
15425        }
15426        TypeDef {
15427            proc: self.proc.clone(),
15428            selection: query,
15429            graphql_client: self.graphql_client.clone(),
15430        }
15431    }
15432    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15433    ///
15434    /// # Arguments
15435    ///
15436    /// * `name` - The name of the member in the enum
15437    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15438    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
15439        let mut query = self.selection.select("withEnumMember");
15440        query = query.arg("name", name.into());
15441        TypeDef {
15442            proc: self.proc.clone(),
15443            selection: query,
15444            graphql_client: self.graphql_client.clone(),
15445        }
15446    }
15447    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15448    ///
15449    /// # Arguments
15450    ///
15451    /// * `name` - The name of the member in the enum
15452    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15453    pub fn with_enum_member_opts<'a>(
15454        &self,
15455        name: impl Into<String>,
15456        opts: TypeDefWithEnumMemberOpts<'a>,
15457    ) -> TypeDef {
15458        let mut query = self.selection.select("withEnumMember");
15459        query = query.arg("name", name.into());
15460        if let Some(value) = opts.value {
15461            query = query.arg("value", value);
15462        }
15463        if let Some(description) = opts.description {
15464            query = query.arg("description", description);
15465        }
15466        if let Some(source_map) = opts.source_map {
15467            query = query.arg("sourceMap", source_map);
15468        }
15469        if let Some(deprecated) = opts.deprecated {
15470            query = query.arg("deprecated", deprecated);
15471        }
15472        TypeDef {
15473            proc: self.proc.clone(),
15474            selection: query,
15475            graphql_client: self.graphql_client.clone(),
15476        }
15477    }
15478    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15479    ///
15480    /// # Arguments
15481    ///
15482    /// * `value` - The name of the value in the enum
15483    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15484    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
15485        let mut query = self.selection.select("withEnumValue");
15486        query = query.arg("value", value.into());
15487        TypeDef {
15488            proc: self.proc.clone(),
15489            selection: query,
15490            graphql_client: self.graphql_client.clone(),
15491        }
15492    }
15493    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
15494    ///
15495    /// # Arguments
15496    ///
15497    /// * `value` - The name of the value in the enum
15498    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15499    pub fn with_enum_value_opts<'a>(
15500        &self,
15501        value: impl Into<String>,
15502        opts: TypeDefWithEnumValueOpts<'a>,
15503    ) -> TypeDef {
15504        let mut query = self.selection.select("withEnumValue");
15505        query = query.arg("value", value.into());
15506        if let Some(description) = opts.description {
15507            query = query.arg("description", description);
15508        }
15509        if let Some(source_map) = opts.source_map {
15510            query = query.arg("sourceMap", source_map);
15511        }
15512        if let Some(deprecated) = opts.deprecated {
15513            query = query.arg("deprecated", deprecated);
15514        }
15515        TypeDef {
15516            proc: self.proc.clone(),
15517            selection: query,
15518            graphql_client: self.graphql_client.clone(),
15519        }
15520    }
15521    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
15522    ///
15523    /// # Arguments
15524    ///
15525    /// * `name` - The name of the field in the object
15526    /// * `type_def` - The type of the field
15527    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15528    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
15529        let mut query = self.selection.select("withField");
15530        query = query.arg("name", name.into());
15531        query = query.arg_lazy(
15532            "typeDef",
15533            Box::new(move || {
15534                let type_def = type_def.clone();
15535                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15536            }),
15537        );
15538        TypeDef {
15539            proc: self.proc.clone(),
15540            selection: query,
15541            graphql_client: self.graphql_client.clone(),
15542        }
15543    }
15544    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
15545    ///
15546    /// # Arguments
15547    ///
15548    /// * `name` - The name of the field in the object
15549    /// * `type_def` - The type of the field
15550    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15551    pub fn with_field_opts<'a>(
15552        &self,
15553        name: impl Into<String>,
15554        type_def: impl IntoID<TypeDefId>,
15555        opts: TypeDefWithFieldOpts<'a>,
15556    ) -> TypeDef {
15557        let mut query = self.selection.select("withField");
15558        query = query.arg("name", name.into());
15559        query = query.arg_lazy(
15560            "typeDef",
15561            Box::new(move || {
15562                let type_def = type_def.clone();
15563                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
15564            }),
15565        );
15566        if let Some(description) = opts.description {
15567            query = query.arg("description", description);
15568        }
15569        if let Some(source_map) = opts.source_map {
15570            query = query.arg("sourceMap", source_map);
15571        }
15572        if let Some(deprecated) = opts.deprecated {
15573            query = query.arg("deprecated", deprecated);
15574        }
15575        TypeDef {
15576            proc: self.proc.clone(),
15577            selection: query,
15578            graphql_client: self.graphql_client.clone(),
15579        }
15580    }
15581    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
15582    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
15583        let mut query = self.selection.select("withFunction");
15584        query = query.arg_lazy(
15585            "function",
15586            Box::new(move || {
15587                let function = function.clone();
15588                Box::pin(async move { function.into_id().await.unwrap().quote() })
15589            }),
15590        );
15591        TypeDef {
15592            proc: self.proc.clone(),
15593            selection: query,
15594            graphql_client: self.graphql_client.clone(),
15595        }
15596    }
15597    /// Returns a TypeDef of kind Interface with the provided name.
15598    ///
15599    /// # Arguments
15600    ///
15601    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15602    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
15603        let mut query = self.selection.select("withInterface");
15604        query = query.arg("name", name.into());
15605        TypeDef {
15606            proc: self.proc.clone(),
15607            selection: query,
15608            graphql_client: self.graphql_client.clone(),
15609        }
15610    }
15611    /// Returns a TypeDef of kind Interface with the provided name.
15612    ///
15613    /// # Arguments
15614    ///
15615    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15616    pub fn with_interface_opts<'a>(
15617        &self,
15618        name: impl Into<String>,
15619        opts: TypeDefWithInterfaceOpts<'a>,
15620    ) -> TypeDef {
15621        let mut query = self.selection.select("withInterface");
15622        query = query.arg("name", name.into());
15623        if let Some(description) = opts.description {
15624            query = query.arg("description", description);
15625        }
15626        if let Some(source_map) = opts.source_map {
15627            query = query.arg("sourceMap", source_map);
15628        }
15629        TypeDef {
15630            proc: self.proc.clone(),
15631            selection: query,
15632            graphql_client: self.graphql_client.clone(),
15633        }
15634    }
15635    /// Sets the kind of the type.
15636    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
15637        let mut query = self.selection.select("withKind");
15638        query = query.arg("kind", kind);
15639        TypeDef {
15640            proc: self.proc.clone(),
15641            selection: query,
15642            graphql_client: self.graphql_client.clone(),
15643        }
15644    }
15645    /// Returns a TypeDef of kind List with the provided type for its elements.
15646    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
15647        let mut query = self.selection.select("withListOf");
15648        query = query.arg_lazy(
15649            "elementType",
15650            Box::new(move || {
15651                let element_type = element_type.clone();
15652                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
15653            }),
15654        );
15655        TypeDef {
15656            proc: self.proc.clone(),
15657            selection: query,
15658            graphql_client: self.graphql_client.clone(),
15659        }
15660    }
15661    /// Returns a TypeDef of kind Object with the provided name.
15662    /// 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.
15663    ///
15664    /// # Arguments
15665    ///
15666    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15667    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
15668        let mut query = self.selection.select("withObject");
15669        query = query.arg("name", name.into());
15670        TypeDef {
15671            proc: self.proc.clone(),
15672            selection: query,
15673            graphql_client: self.graphql_client.clone(),
15674        }
15675    }
15676    /// Returns a TypeDef of kind Object with the provided name.
15677    /// 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.
15678    ///
15679    /// # Arguments
15680    ///
15681    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15682    pub fn with_object_opts<'a>(
15683        &self,
15684        name: impl Into<String>,
15685        opts: TypeDefWithObjectOpts<'a>,
15686    ) -> TypeDef {
15687        let mut query = self.selection.select("withObject");
15688        query = query.arg("name", name.into());
15689        if let Some(description) = opts.description {
15690            query = query.arg("description", description);
15691        }
15692        if let Some(source_map) = opts.source_map {
15693            query = query.arg("sourceMap", source_map);
15694        }
15695        if let Some(deprecated) = opts.deprecated {
15696            query = query.arg("deprecated", deprecated);
15697        }
15698        TypeDef {
15699            proc: self.proc.clone(),
15700            selection: query,
15701            graphql_client: self.graphql_client.clone(),
15702        }
15703    }
15704    /// Sets whether this type can be set to null.
15705    pub fn with_optional(&self, optional: bool) -> TypeDef {
15706        let mut query = self.selection.select("withOptional");
15707        query = query.arg("optional", optional);
15708        TypeDef {
15709            proc: self.proc.clone(),
15710            selection: query,
15711            graphql_client: self.graphql_client.clone(),
15712        }
15713    }
15714    /// Returns a TypeDef of kind Scalar with the provided name.
15715    ///
15716    /// # Arguments
15717    ///
15718    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15719    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
15720        let mut query = self.selection.select("withScalar");
15721        query = query.arg("name", name.into());
15722        TypeDef {
15723            proc: self.proc.clone(),
15724            selection: query,
15725            graphql_client: self.graphql_client.clone(),
15726        }
15727    }
15728    /// Returns a TypeDef of kind Scalar with the provided name.
15729    ///
15730    /// # Arguments
15731    ///
15732    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15733    pub fn with_scalar_opts<'a>(
15734        &self,
15735        name: impl Into<String>,
15736        opts: TypeDefWithScalarOpts<'a>,
15737    ) -> TypeDef {
15738        let mut query = self.selection.select("withScalar");
15739        query = query.arg("name", name.into());
15740        if let Some(description) = opts.description {
15741            query = query.arg("description", description);
15742        }
15743        TypeDef {
15744            proc: self.proc.clone(),
15745            selection: query,
15746            graphql_client: self.graphql_client.clone(),
15747        }
15748    }
15749}
15750#[derive(Clone)]
15751pub struct Up {
15752    pub proc: Option<Arc<DaggerSessionProc>>,
15753    pub selection: Selection,
15754    pub graphql_client: DynGraphQLClient,
15755}
15756impl Up {
15757    /// The description of the service
15758    pub async fn description(&self) -> Result<String, DaggerError> {
15759        let query = self.selection.select("description");
15760        query.execute(self.graphql_client.clone()).await
15761    }
15762    /// A unique identifier for this Up.
15763    pub async fn id(&self) -> Result<UpId, DaggerError> {
15764        let query = self.selection.select("id");
15765        query.execute(self.graphql_client.clone()).await
15766    }
15767    /// Return the fully qualified name of the service
15768    pub async fn name(&self) -> Result<String, DaggerError> {
15769        let query = self.selection.select("name");
15770        query.execute(self.graphql_client.clone()).await
15771    }
15772    /// The original module in which the service has been defined
15773    pub fn original_module(&self) -> Module {
15774        let query = self.selection.select("originalModule");
15775        Module {
15776            proc: self.proc.clone(),
15777            selection: query,
15778            graphql_client: self.graphql_client.clone(),
15779        }
15780    }
15781    /// The path of the service within its module
15782    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
15783        let query = self.selection.select("path");
15784        query.execute(self.graphql_client.clone()).await
15785    }
15786    /// Execute the service function
15787    pub fn run(&self) -> Up {
15788        let query = self.selection.select("run");
15789        Up {
15790            proc: self.proc.clone(),
15791            selection: query,
15792            graphql_client: self.graphql_client.clone(),
15793        }
15794    }
15795}
15796#[derive(Clone)]
15797pub struct UpGroup {
15798    pub proc: Option<Arc<DaggerSessionProc>>,
15799    pub selection: Selection,
15800    pub graphql_client: DynGraphQLClient,
15801}
15802impl UpGroup {
15803    /// A unique identifier for this UpGroup.
15804    pub async fn id(&self) -> Result<UpGroupId, DaggerError> {
15805        let query = self.selection.select("id");
15806        query.execute(self.graphql_client.clone()).await
15807    }
15808    /// Return a list of individual services and their details
15809    pub async fn list(&self) -> Result<Vec<Up>, DaggerError> {
15810        let query = self.selection.select("list");
15811        let query = query.select("id");
15812        let ids: Vec<UpId> = query.execute(self.graphql_client.clone()).await?;
15813        let root = Query {
15814            proc: self.proc.clone(),
15815            selection: crate::querybuilder::query(),
15816            graphql_client: self.graphql_client.clone(),
15817        };
15818        Ok(ids.into_iter().map(|id| root.load_up_from_id(id)).collect())
15819    }
15820    /// Execute all selected service functions
15821    pub fn run(&self) -> UpGroup {
15822        let query = self.selection.select("run");
15823        UpGroup {
15824            proc: self.proc.clone(),
15825            selection: query,
15826            graphql_client: self.graphql_client.clone(),
15827        }
15828    }
15829}
15830#[derive(Clone)]
15831pub struct Workspace {
15832    pub proc: Option<Arc<DaggerSessionProc>>,
15833    pub selection: Selection,
15834    pub graphql_client: DynGraphQLClient,
15835}
15836#[derive(Builder, Debug, PartialEq)]
15837pub struct WorkspaceChecksOpts<'a> {
15838    /// Only include checks matching the specified patterns
15839    #[builder(setter(into, strip_option), default)]
15840    pub include: Option<Vec<&'a str>>,
15841    /// When true, only return annotated check functions; exclude generate-as-checks
15842    #[builder(setter(into, strip_option), default)]
15843    pub no_generate: Option<bool>,
15844}
15845#[derive(Builder, Debug, PartialEq)]
15846pub struct WorkspaceDirectoryOpts<'a> {
15847    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
15848    #[builder(setter(into, strip_option), default)]
15849    pub exclude: Option<Vec<&'a str>>,
15850    /// Apply .gitignore filter rules inside the directory.
15851    #[builder(setter(into, strip_option), default)]
15852    pub gitignore: Option<bool>,
15853    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
15854    #[builder(setter(into, strip_option), default)]
15855    pub include: Option<Vec<&'a str>>,
15856}
15857#[derive(Builder, Debug, PartialEq)]
15858pub struct WorkspaceFindUpOpts<'a> {
15859    /// Path to start the search from. Relative paths resolve from the workspace directory; absolute paths resolve from the workspace boundary.
15860    #[builder(setter(into, strip_option), default)]
15861    pub from: Option<&'a str>,
15862}
15863#[derive(Builder, Debug, PartialEq)]
15864pub struct WorkspaceGeneratorsOpts<'a> {
15865    /// Only include generators matching the specified patterns
15866    #[builder(setter(into, strip_option), default)]
15867    pub include: Option<Vec<&'a str>>,
15868}
15869#[derive(Builder, Debug, PartialEq)]
15870pub struct WorkspaceServicesOpts<'a> {
15871    /// Only include services matching the specified patterns
15872    #[builder(setter(into, strip_option), default)]
15873    pub include: Option<Vec<&'a str>>,
15874}
15875impl Workspace {
15876    /// Canonical Dagger address of the workspace directory.
15877    pub async fn address(&self) -> Result<String, DaggerError> {
15878        let query = self.selection.select("address");
15879        query.execute(self.graphql_client.clone()).await
15880    }
15881    /// Return all checks from modules loaded in the workspace.
15882    ///
15883    /// # Arguments
15884    ///
15885    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15886    pub fn checks(&self) -> CheckGroup {
15887        let query = self.selection.select("checks");
15888        CheckGroup {
15889            proc: self.proc.clone(),
15890            selection: query,
15891            graphql_client: self.graphql_client.clone(),
15892        }
15893    }
15894    /// Return all checks from modules loaded in the workspace.
15895    ///
15896    /// # Arguments
15897    ///
15898    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15899    pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
15900        let mut query = self.selection.select("checks");
15901        if let Some(include) = opts.include {
15902            query = query.arg("include", include);
15903        }
15904        if let Some(no_generate) = opts.no_generate {
15905            query = query.arg("noGenerate", no_generate);
15906        }
15907        CheckGroup {
15908            proc: self.proc.clone(),
15909            selection: query,
15910            graphql_client: self.graphql_client.clone(),
15911        }
15912    }
15913    /// The client ID that owns this workspace's host filesystem.
15914    pub async fn client_id(&self) -> Result<String, DaggerError> {
15915        let query = self.selection.select("clientId");
15916        query.execute(self.graphql_client.clone()).await
15917    }
15918    /// Path to config.toml relative to the workspace boundary (empty if not initialized).
15919    pub async fn config_path(&self) -> Result<String, DaggerError> {
15920        let query = self.selection.select("configPath");
15921        query.execute(self.graphql_client.clone()).await
15922    }
15923    /// Returns a Directory from the workspace.
15924    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
15925    ///
15926    /// # Arguments
15927    ///
15928    /// * `path` - Location of the directory to retrieve. Relative paths (e.g., "src") resolve from the workspace directory; absolute paths (e.g., "/src") resolve from the workspace boundary.
15929    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15930    pub fn directory(&self, path: impl Into<String>) -> Directory {
15931        let mut query = self.selection.select("directory");
15932        query = query.arg("path", path.into());
15933        Directory {
15934            proc: self.proc.clone(),
15935            selection: query,
15936            graphql_client: self.graphql_client.clone(),
15937        }
15938    }
15939    /// Returns a Directory from the workspace.
15940    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
15941    ///
15942    /// # Arguments
15943    ///
15944    /// * `path` - Location of the directory to retrieve. Relative paths (e.g., "src") resolve from the workspace directory; absolute paths (e.g., "/src") resolve from the workspace boundary.
15945    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15946    pub fn directory_opts<'a>(
15947        &self,
15948        path: impl Into<String>,
15949        opts: WorkspaceDirectoryOpts<'a>,
15950    ) -> Directory {
15951        let mut query = self.selection.select("directory");
15952        query = query.arg("path", path.into());
15953        if let Some(exclude) = opts.exclude {
15954            query = query.arg("exclude", exclude);
15955        }
15956        if let Some(include) = opts.include {
15957            query = query.arg("include", include);
15958        }
15959        if let Some(gitignore) = opts.gitignore {
15960            query = query.arg("gitignore", gitignore);
15961        }
15962        Directory {
15963            proc: self.proc.clone(),
15964            selection: query,
15965            graphql_client: self.graphql_client.clone(),
15966        }
15967    }
15968    /// Returns a File from the workspace.
15969    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
15970    ///
15971    /// # Arguments
15972    ///
15973    /// * `path` - Location of the file to retrieve. Relative paths (e.g., "go.mod") resolve from the workspace directory; absolute paths (e.g., "/go.mod") resolve from the workspace boundary.
15974    pub fn file(&self, path: impl Into<String>) -> File {
15975        let mut query = self.selection.select("file");
15976        query = query.arg("path", path.into());
15977        File {
15978            proc: self.proc.clone(),
15979            selection: query,
15980            graphql_client: self.graphql_client.clone(),
15981        }
15982    }
15983    /// Search for a file or directory by walking up from the start path within the workspace.
15984    /// Returns the absolute workspace path if found, or null if not found.
15985    /// Relative start paths resolve from the workspace directory.
15986    /// The search stops at the workspace boundary and will not traverse above it.
15987    ///
15988    /// # Arguments
15989    ///
15990    /// * `name` - The name of the file or directory to search for.
15991    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15992    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
15993        let mut query = self.selection.select("findUp");
15994        query = query.arg("name", name.into());
15995        query.execute(self.graphql_client.clone()).await
15996    }
15997    /// Search for a file or directory by walking up from the start path within the workspace.
15998    /// Returns the absolute workspace path if found, or null if not found.
15999    /// Relative start paths resolve from the workspace directory.
16000    /// The search stops at the workspace boundary and will not traverse above it.
16001    ///
16002    /// # Arguments
16003    ///
16004    /// * `name` - The name of the file or directory to search for.
16005    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16006    pub async fn find_up_opts<'a>(
16007        &self,
16008        name: impl Into<String>,
16009        opts: WorkspaceFindUpOpts<'a>,
16010    ) -> Result<String, DaggerError> {
16011        let mut query = self.selection.select("findUp");
16012        query = query.arg("name", name.into());
16013        if let Some(from) = opts.from {
16014            query = query.arg("from", from);
16015        }
16016        query.execute(self.graphql_client.clone()).await
16017    }
16018    /// Return all generators from modules loaded in the workspace.
16019    ///
16020    /// # Arguments
16021    ///
16022    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16023    pub fn generators(&self) -> GeneratorGroup {
16024        let query = self.selection.select("generators");
16025        GeneratorGroup {
16026            proc: self.proc.clone(),
16027            selection: query,
16028            graphql_client: self.graphql_client.clone(),
16029        }
16030    }
16031    /// Return all generators from modules loaded in the workspace.
16032    ///
16033    /// # Arguments
16034    ///
16035    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16036    pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
16037        let mut query = self.selection.select("generators");
16038        if let Some(include) = opts.include {
16039            query = query.arg("include", include);
16040        }
16041        GeneratorGroup {
16042            proc: self.proc.clone(),
16043            selection: query,
16044            graphql_client: self.graphql_client.clone(),
16045        }
16046    }
16047    /// Whether a config.toml file exists in the workspace.
16048    pub async fn has_config(&self) -> Result<bool, DaggerError> {
16049        let query = self.selection.select("hasConfig");
16050        query.execute(self.graphql_client.clone()).await
16051    }
16052    /// A unique identifier for this Workspace.
16053    pub async fn id(&self) -> Result<WorkspaceId, DaggerError> {
16054        let query = self.selection.select("id");
16055        query.execute(self.graphql_client.clone()).await
16056    }
16057    /// Whether .dagger/config.toml exists.
16058    pub async fn initialized(&self) -> Result<bool, DaggerError> {
16059        let query = self.selection.select("initialized");
16060        query.execute(self.graphql_client.clone()).await
16061    }
16062    /// Workspace directory path relative to the workspace boundary.
16063    pub async fn path(&self) -> Result<String, DaggerError> {
16064        let query = self.selection.select("path");
16065        query.execute(self.graphql_client.clone()).await
16066    }
16067    /// Return all services from modules loaded in the workspace.
16068    ///
16069    /// # Arguments
16070    ///
16071    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16072    pub fn services(&self) -> UpGroup {
16073        let query = self.selection.select("services");
16074        UpGroup {
16075            proc: self.proc.clone(),
16076            selection: query,
16077            graphql_client: self.graphql_client.clone(),
16078        }
16079    }
16080    /// Return all services from modules loaded in the workspace.
16081    ///
16082    /// # Arguments
16083    ///
16084    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
16085    pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
16086        let mut query = self.selection.select("services");
16087        if let Some(include) = opts.include {
16088            query = query.arg("include", include);
16089        }
16090        UpGroup {
16091            proc: self.proc.clone(),
16092            selection: query,
16093            graphql_client: self.graphql_client.clone(),
16094        }
16095    }
16096    /// Refresh workspace-managed state and return the resulting changeset.
16097    /// Currently this refreshes existing lockfile entries only.
16098    pub fn update(&self) -> Changeset {
16099        let query = self.selection.select("update");
16100        Changeset {
16101            proc: self.proc.clone(),
16102            selection: query,
16103            graphql_client: self.graphql_client.clone(),
16104        }
16105    }
16106}
16107#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16108pub enum CacheSharingMode {
16109    #[serde(rename = "LOCKED")]
16110    Locked,
16111    #[serde(rename = "PRIVATE")]
16112    Private,
16113    #[serde(rename = "SHARED")]
16114    Shared,
16115}
16116#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16117pub enum ChangesetMergeConflict {
16118    #[serde(rename = "FAIL")]
16119    Fail,
16120    #[serde(rename = "FAIL_EARLY")]
16121    FailEarly,
16122    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
16123    LeaveConflictMarkers,
16124    #[serde(rename = "PREFER_OURS")]
16125    PreferOurs,
16126    #[serde(rename = "PREFER_THEIRS")]
16127    PreferTheirs,
16128}
16129#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16130pub enum ChangesetsMergeConflict {
16131    #[serde(rename = "FAIL")]
16132    Fail,
16133    #[serde(rename = "FAIL_EARLY")]
16134    FailEarly,
16135}
16136#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16137pub enum DiffStatKind {
16138    #[serde(rename = "ADDED")]
16139    Added,
16140    #[serde(rename = "MODIFIED")]
16141    Modified,
16142    #[serde(rename = "REMOVED")]
16143    Removed,
16144    #[serde(rename = "RENAMED")]
16145    Renamed,
16146}
16147#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16148pub enum ExistsType {
16149    #[serde(rename = "DIRECTORY_TYPE")]
16150    DirectoryType,
16151    #[serde(rename = "REGULAR_TYPE")]
16152    RegularType,
16153    #[serde(rename = "SYMLINK_TYPE")]
16154    SymlinkType,
16155}
16156#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16157pub enum FileType {
16158    #[serde(rename = "DIRECTORY")]
16159    Directory,
16160    #[serde(rename = "DIRECTORY_TYPE")]
16161    DirectoryType,
16162    #[serde(rename = "REGULAR")]
16163    Regular,
16164    #[serde(rename = "REGULAR_TYPE")]
16165    RegularType,
16166    #[serde(rename = "SYMLINK")]
16167    Symlink,
16168    #[serde(rename = "SYMLINK_TYPE")]
16169    SymlinkType,
16170    #[serde(rename = "UNKNOWN")]
16171    Unknown,
16172}
16173#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16174pub enum FunctionCachePolicy {
16175    #[serde(rename = "Default")]
16176    Default,
16177    #[serde(rename = "Never")]
16178    Never,
16179    #[serde(rename = "PerSession")]
16180    PerSession,
16181}
16182#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16183pub enum ImageLayerCompression {
16184    #[serde(rename = "EStarGZ")]
16185    EStarGz,
16186    #[serde(rename = "ESTARGZ")]
16187    Estargz,
16188    #[serde(rename = "Gzip")]
16189    Gzip,
16190    #[serde(rename = "Uncompressed")]
16191    Uncompressed,
16192    #[serde(rename = "Zstd")]
16193    Zstd,
16194}
16195#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16196pub enum ImageMediaTypes {
16197    #[serde(rename = "DOCKER")]
16198    Docker,
16199    #[serde(rename = "DockerMediaTypes")]
16200    DockerMediaTypes,
16201    #[serde(rename = "OCI")]
16202    Oci,
16203    #[serde(rename = "OCIMediaTypes")]
16204    OciMediaTypes,
16205}
16206#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16207pub enum ModuleSourceExperimentalFeature {
16208    #[serde(rename = "SELF_CALLS")]
16209    SelfCalls,
16210}
16211#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16212pub enum ModuleSourceKind {
16213    #[serde(rename = "DIR")]
16214    Dir,
16215    #[serde(rename = "DIR_SOURCE")]
16216    DirSource,
16217    #[serde(rename = "GIT")]
16218    Git,
16219    #[serde(rename = "GIT_SOURCE")]
16220    GitSource,
16221    #[serde(rename = "LOCAL")]
16222    Local,
16223    #[serde(rename = "LOCAL_SOURCE")]
16224    LocalSource,
16225}
16226#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16227pub enum NetworkProtocol {
16228    #[serde(rename = "TCP")]
16229    Tcp,
16230    #[serde(rename = "UDP")]
16231    Udp,
16232}
16233#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16234pub enum ReturnType {
16235    #[serde(rename = "ANY")]
16236    Any,
16237    #[serde(rename = "FAILURE")]
16238    Failure,
16239    #[serde(rename = "SUCCESS")]
16240    Success,
16241}
16242#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16243pub enum TypeDefKind {
16244    #[serde(rename = "BOOLEAN")]
16245    Boolean,
16246    #[serde(rename = "BOOLEAN_KIND")]
16247    BooleanKind,
16248    #[serde(rename = "ENUM")]
16249    Enum,
16250    #[serde(rename = "ENUM_KIND")]
16251    EnumKind,
16252    #[serde(rename = "FLOAT")]
16253    Float,
16254    #[serde(rename = "FLOAT_KIND")]
16255    FloatKind,
16256    #[serde(rename = "INPUT")]
16257    Input,
16258    #[serde(rename = "INPUT_KIND")]
16259    InputKind,
16260    #[serde(rename = "INTEGER")]
16261    Integer,
16262    #[serde(rename = "INTEGER_KIND")]
16263    IntegerKind,
16264    #[serde(rename = "INTERFACE")]
16265    Interface,
16266    #[serde(rename = "INTERFACE_KIND")]
16267    InterfaceKind,
16268    #[serde(rename = "LIST")]
16269    List,
16270    #[serde(rename = "LIST_KIND")]
16271    ListKind,
16272    #[serde(rename = "OBJECT")]
16273    Object,
16274    #[serde(rename = "OBJECT_KIND")]
16275    ObjectKind,
16276    #[serde(rename = "SCALAR")]
16277    Scalar,
16278    #[serde(rename = "SCALAR_KIND")]
16279    ScalarKind,
16280    #[serde(rename = "STRING")]
16281    String,
16282    #[serde(rename = "STRING_KIND")]
16283    StringKind,
16284    #[serde(rename = "VOID")]
16285    Void,
16286    #[serde(rename = "VOID_KIND")]
16287    VoidKind,
16288}