Skip to main content

dagger_sdk/
gen.rs

1#![allow(clippy::needless_lifetimes)]
2
3use crate::core::cli_session::DaggerSessionProc;
4use crate::core::graphql_client::DynGraphQLClient;
5use crate::errors::DaggerError;
6use crate::id::IntoID;
7use crate::querybuilder::Selection;
8use derive_builder::Builder;
9use serde::{Deserialize, Serialize};
10use std::sync::Arc;
11
12#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
13pub struct AddressId(pub String);
14impl From<&str> for AddressId {
15    fn from(value: &str) -> Self {
16        Self(value.to_string())
17    }
18}
19impl From<String> for AddressId {
20    fn from(value: String) -> Self {
21        Self(value)
22    }
23}
24impl IntoID<AddressId> for Address {
25    fn into_id(
26        self,
27    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<AddressId, DaggerError>> + Send>>
28    {
29        Box::pin(async move { self.id().await })
30    }
31}
32impl IntoID<AddressId> for AddressId {
33    fn into_id(
34        self,
35    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<AddressId, DaggerError>> + Send>>
36    {
37        Box::pin(async move { Ok::<AddressId, DaggerError>(self) })
38    }
39}
40impl AddressId {
41    fn quote(&self) -> String {
42        format!("\"{}\"", self.0.clone())
43    }
44}
45#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
46pub struct BindingId(pub String);
47impl From<&str> for BindingId {
48    fn from(value: &str) -> Self {
49        Self(value.to_string())
50    }
51}
52impl From<String> for BindingId {
53    fn from(value: String) -> Self {
54        Self(value)
55    }
56}
57impl IntoID<BindingId> for Binding {
58    fn into_id(
59        self,
60    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
61    {
62        Box::pin(async move { self.id().await })
63    }
64}
65impl IntoID<BindingId> for BindingId {
66    fn into_id(
67        self,
68    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
69    {
70        Box::pin(async move { Ok::<BindingId, DaggerError>(self) })
71    }
72}
73impl BindingId {
74    fn quote(&self) -> String {
75        format!("\"{}\"", self.0.clone())
76    }
77}
78#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
79pub struct CacheVolumeId(pub String);
80impl From<&str> for CacheVolumeId {
81    fn from(value: &str) -> Self {
82        Self(value.to_string())
83    }
84}
85impl From<String> for CacheVolumeId {
86    fn from(value: String) -> Self {
87        Self(value)
88    }
89}
90impl IntoID<CacheVolumeId> for CacheVolume {
91    fn into_id(
92        self,
93    ) -> std::pin::Pin<
94        Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
95    > {
96        Box::pin(async move { self.id().await })
97    }
98}
99impl IntoID<CacheVolumeId> for CacheVolumeId {
100    fn into_id(
101        self,
102    ) -> std::pin::Pin<
103        Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
104    > {
105        Box::pin(async move { Ok::<CacheVolumeId, DaggerError>(self) })
106    }
107}
108impl CacheVolumeId {
109    fn quote(&self) -> String {
110        format!("\"{}\"", self.0.clone())
111    }
112}
113#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
114pub struct ChangesetId(pub String);
115impl From<&str> for ChangesetId {
116    fn from(value: &str) -> Self {
117        Self(value.to_string())
118    }
119}
120impl From<String> for ChangesetId {
121    fn from(value: String) -> Self {
122        Self(value)
123    }
124}
125impl IntoID<ChangesetId> for Changeset {
126    fn into_id(
127        self,
128    ) -> std::pin::Pin<
129        Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
130    > {
131        Box::pin(async move { self.id().await })
132    }
133}
134impl IntoID<ChangesetId> for ChangesetId {
135    fn into_id(
136        self,
137    ) -> std::pin::Pin<
138        Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
139    > {
140        Box::pin(async move { Ok::<ChangesetId, DaggerError>(self) })
141    }
142}
143impl ChangesetId {
144    fn quote(&self) -> String {
145        format!("\"{}\"", self.0.clone())
146    }
147}
148#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
149pub struct CheckGroupId(pub String);
150impl From<&str> for CheckGroupId {
151    fn from(value: &str) -> Self {
152        Self(value.to_string())
153    }
154}
155impl From<String> for CheckGroupId {
156    fn from(value: String) -> Self {
157        Self(value)
158    }
159}
160impl IntoID<CheckGroupId> for CheckGroup {
161    fn into_id(
162        self,
163    ) -> std::pin::Pin<
164        Box<dyn core::future::Future<Output = Result<CheckGroupId, DaggerError>> + Send>,
165    > {
166        Box::pin(async move { self.id().await })
167    }
168}
169impl IntoID<CheckGroupId> for CheckGroupId {
170    fn into_id(
171        self,
172    ) -> std::pin::Pin<
173        Box<dyn core::future::Future<Output = Result<CheckGroupId, DaggerError>> + Send>,
174    > {
175        Box::pin(async move { Ok::<CheckGroupId, DaggerError>(self) })
176    }
177}
178impl CheckGroupId {
179    fn quote(&self) -> String {
180        format!("\"{}\"", self.0.clone())
181    }
182}
183#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
184pub struct CheckId(pub String);
185impl From<&str> for CheckId {
186    fn from(value: &str) -> Self {
187        Self(value.to_string())
188    }
189}
190impl From<String> for CheckId {
191    fn from(value: String) -> Self {
192        Self(value)
193    }
194}
195impl IntoID<CheckId> for Check {
196    fn into_id(
197        self,
198    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CheckId, DaggerError>> + Send>>
199    {
200        Box::pin(async move { self.id().await })
201    }
202}
203impl IntoID<CheckId> for CheckId {
204    fn into_id(
205        self,
206    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CheckId, DaggerError>> + Send>>
207    {
208        Box::pin(async move { Ok::<CheckId, DaggerError>(self) })
209    }
210}
211impl CheckId {
212    fn quote(&self) -> String {
213        format!("\"{}\"", self.0.clone())
214    }
215}
216#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
217pub struct CloudId(pub String);
218impl From<&str> for CloudId {
219    fn from(value: &str) -> Self {
220        Self(value.to_string())
221    }
222}
223impl From<String> for CloudId {
224    fn from(value: String) -> Self {
225        Self(value)
226    }
227}
228impl IntoID<CloudId> for Cloud {
229    fn into_id(
230        self,
231    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
232    {
233        Box::pin(async move { self.id().await })
234    }
235}
236impl IntoID<CloudId> for CloudId {
237    fn into_id(
238        self,
239    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
240    {
241        Box::pin(async move { Ok::<CloudId, DaggerError>(self) })
242    }
243}
244impl CloudId {
245    fn quote(&self) -> String {
246        format!("\"{}\"", self.0.clone())
247    }
248}
249#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
250pub struct ContainerId(pub String);
251impl From<&str> for ContainerId {
252    fn from(value: &str) -> Self {
253        Self(value.to_string())
254    }
255}
256impl From<String> for ContainerId {
257    fn from(value: String) -> Self {
258        Self(value)
259    }
260}
261impl IntoID<ContainerId> for Container {
262    fn into_id(
263        self,
264    ) -> std::pin::Pin<
265        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
266    > {
267        Box::pin(async move { self.id().await })
268    }
269}
270impl IntoID<ContainerId> for ContainerId {
271    fn into_id(
272        self,
273    ) -> std::pin::Pin<
274        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
275    > {
276        Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
277    }
278}
279impl ContainerId {
280    fn quote(&self) -> String {
281        format!("\"{}\"", self.0.clone())
282    }
283}
284#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
285pub struct CurrentModuleId(pub String);
286impl From<&str> for CurrentModuleId {
287    fn from(value: &str) -> Self {
288        Self(value.to_string())
289    }
290}
291impl From<String> for CurrentModuleId {
292    fn from(value: String) -> Self {
293        Self(value)
294    }
295}
296impl IntoID<CurrentModuleId> for CurrentModule {
297    fn into_id(
298        self,
299    ) -> std::pin::Pin<
300        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
301    > {
302        Box::pin(async move { self.id().await })
303    }
304}
305impl IntoID<CurrentModuleId> for CurrentModuleId {
306    fn into_id(
307        self,
308    ) -> std::pin::Pin<
309        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
310    > {
311        Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
312    }
313}
314impl CurrentModuleId {
315    fn quote(&self) -> String {
316        format!("\"{}\"", self.0.clone())
317    }
318}
319#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
320pub struct DiffStatId(pub String);
321impl From<&str> for DiffStatId {
322    fn from(value: &str) -> Self {
323        Self(value.to_string())
324    }
325}
326impl From<String> for DiffStatId {
327    fn from(value: String) -> Self {
328        Self(value)
329    }
330}
331impl IntoID<DiffStatId> for DiffStat {
332    fn into_id(
333        self,
334    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<DiffStatId, DaggerError>> + Send>>
335    {
336        Box::pin(async move { self.id().await })
337    }
338}
339impl IntoID<DiffStatId> for DiffStatId {
340    fn into_id(
341        self,
342    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<DiffStatId, DaggerError>> + Send>>
343    {
344        Box::pin(async move { Ok::<DiffStatId, DaggerError>(self) })
345    }
346}
347impl DiffStatId {
348    fn quote(&self) -> String {
349        format!("\"{}\"", self.0.clone())
350    }
351}
352#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
353pub struct DirectoryId(pub String);
354impl From<&str> for DirectoryId {
355    fn from(value: &str) -> Self {
356        Self(value.to_string())
357    }
358}
359impl From<String> for DirectoryId {
360    fn from(value: String) -> Self {
361        Self(value)
362    }
363}
364impl IntoID<DirectoryId> for Directory {
365    fn into_id(
366        self,
367    ) -> std::pin::Pin<
368        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
369    > {
370        Box::pin(async move { self.id().await })
371    }
372}
373impl IntoID<DirectoryId> for DirectoryId {
374    fn into_id(
375        self,
376    ) -> std::pin::Pin<
377        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
378    > {
379        Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
380    }
381}
382impl DirectoryId {
383    fn quote(&self) -> String {
384        format!("\"{}\"", self.0.clone())
385    }
386}
387#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
388pub struct EngineCacheEntryId(pub String);
389impl From<&str> for EngineCacheEntryId {
390    fn from(value: &str) -> Self {
391        Self(value.to_string())
392    }
393}
394impl From<String> for EngineCacheEntryId {
395    fn from(value: String) -> Self {
396        Self(value)
397    }
398}
399impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
400    fn into_id(
401        self,
402    ) -> std::pin::Pin<
403        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
404    > {
405        Box::pin(async move { self.id().await })
406    }
407}
408impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
409    fn into_id(
410        self,
411    ) -> std::pin::Pin<
412        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
413    > {
414        Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
415    }
416}
417impl EngineCacheEntryId {
418    fn quote(&self) -> String {
419        format!("\"{}\"", self.0.clone())
420    }
421}
422#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
423pub struct EngineCacheEntrySetId(pub String);
424impl From<&str> for EngineCacheEntrySetId {
425    fn from(value: &str) -> Self {
426        Self(value.to_string())
427    }
428}
429impl From<String> for EngineCacheEntrySetId {
430    fn from(value: String) -> Self {
431        Self(value)
432    }
433}
434impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
435    fn into_id(
436        self,
437    ) -> std::pin::Pin<
438        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
439    > {
440        Box::pin(async move { self.id().await })
441    }
442}
443impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
444    fn into_id(
445        self,
446    ) -> std::pin::Pin<
447        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
448    > {
449        Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
450    }
451}
452impl EngineCacheEntrySetId {
453    fn quote(&self) -> String {
454        format!("\"{}\"", self.0.clone())
455    }
456}
457#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
458pub struct EngineCacheId(pub String);
459impl From<&str> for EngineCacheId {
460    fn from(value: &str) -> Self {
461        Self(value.to_string())
462    }
463}
464impl From<String> for EngineCacheId {
465    fn from(value: String) -> Self {
466        Self(value)
467    }
468}
469impl IntoID<EngineCacheId> for EngineCache {
470    fn into_id(
471        self,
472    ) -> std::pin::Pin<
473        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
474    > {
475        Box::pin(async move { self.id().await })
476    }
477}
478impl IntoID<EngineCacheId> for EngineCacheId {
479    fn into_id(
480        self,
481    ) -> std::pin::Pin<
482        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
483    > {
484        Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
485    }
486}
487impl EngineCacheId {
488    fn quote(&self) -> String {
489        format!("\"{}\"", self.0.clone())
490    }
491}
492#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
493pub struct EngineId(pub String);
494impl From<&str> for EngineId {
495    fn from(value: &str) -> Self {
496        Self(value.to_string())
497    }
498}
499impl From<String> for EngineId {
500    fn from(value: String) -> Self {
501        Self(value)
502    }
503}
504impl IntoID<EngineId> for Engine {
505    fn into_id(
506        self,
507    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
508    {
509        Box::pin(async move { self.id().await })
510    }
511}
512impl IntoID<EngineId> for EngineId {
513    fn into_id(
514        self,
515    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
516    {
517        Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
518    }
519}
520impl EngineId {
521    fn quote(&self) -> String {
522        format!("\"{}\"", self.0.clone())
523    }
524}
525#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
526pub struct EnumTypeDefId(pub String);
527impl From<&str> for EnumTypeDefId {
528    fn from(value: &str) -> Self {
529        Self(value.to_string())
530    }
531}
532impl From<String> for EnumTypeDefId {
533    fn from(value: String) -> Self {
534        Self(value)
535    }
536}
537impl IntoID<EnumTypeDefId> for EnumTypeDef {
538    fn into_id(
539        self,
540    ) -> std::pin::Pin<
541        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
542    > {
543        Box::pin(async move { self.id().await })
544    }
545}
546impl IntoID<EnumTypeDefId> for EnumTypeDefId {
547    fn into_id(
548        self,
549    ) -> std::pin::Pin<
550        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
551    > {
552        Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
553    }
554}
555impl EnumTypeDefId {
556    fn quote(&self) -> String {
557        format!("\"{}\"", self.0.clone())
558    }
559}
560#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
561pub struct EnumValueTypeDefId(pub String);
562impl From<&str> for EnumValueTypeDefId {
563    fn from(value: &str) -> Self {
564        Self(value.to_string())
565    }
566}
567impl From<String> for EnumValueTypeDefId {
568    fn from(value: String) -> Self {
569        Self(value)
570    }
571}
572impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
573    fn into_id(
574        self,
575    ) -> std::pin::Pin<
576        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
577    > {
578        Box::pin(async move { self.id().await })
579    }
580}
581impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
582    fn into_id(
583        self,
584    ) -> std::pin::Pin<
585        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
586    > {
587        Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
588    }
589}
590impl EnumValueTypeDefId {
591    fn quote(&self) -> String {
592        format!("\"{}\"", self.0.clone())
593    }
594}
595#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
596pub struct EnvFileId(pub String);
597impl From<&str> for EnvFileId {
598    fn from(value: &str) -> Self {
599        Self(value.to_string())
600    }
601}
602impl From<String> for EnvFileId {
603    fn from(value: String) -> Self {
604        Self(value)
605    }
606}
607impl IntoID<EnvFileId> for EnvFile {
608    fn into_id(
609        self,
610    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
611    {
612        Box::pin(async move { self.id().await })
613    }
614}
615impl IntoID<EnvFileId> for EnvFileId {
616    fn into_id(
617        self,
618    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
619    {
620        Box::pin(async move { Ok::<EnvFileId, DaggerError>(self) })
621    }
622}
623impl EnvFileId {
624    fn quote(&self) -> String {
625        format!("\"{}\"", self.0.clone())
626    }
627}
628#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
629pub struct EnvId(pub String);
630impl From<&str> for EnvId {
631    fn from(value: &str) -> Self {
632        Self(value.to_string())
633    }
634}
635impl From<String> for EnvId {
636    fn from(value: String) -> Self {
637        Self(value)
638    }
639}
640impl IntoID<EnvId> for Env {
641    fn into_id(
642        self,
643    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
644    {
645        Box::pin(async move { self.id().await })
646    }
647}
648impl IntoID<EnvId> for EnvId {
649    fn into_id(
650        self,
651    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
652    {
653        Box::pin(async move { Ok::<EnvId, DaggerError>(self) })
654    }
655}
656impl EnvId {
657    fn quote(&self) -> String {
658        format!("\"{}\"", self.0.clone())
659    }
660}
661#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
662pub struct EnvVariableId(pub String);
663impl From<&str> for EnvVariableId {
664    fn from(value: &str) -> Self {
665        Self(value.to_string())
666    }
667}
668impl From<String> for EnvVariableId {
669    fn from(value: String) -> Self {
670        Self(value)
671    }
672}
673impl IntoID<EnvVariableId> for EnvVariable {
674    fn into_id(
675        self,
676    ) -> std::pin::Pin<
677        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
678    > {
679        Box::pin(async move { self.id().await })
680    }
681}
682impl IntoID<EnvVariableId> for EnvVariableId {
683    fn into_id(
684        self,
685    ) -> std::pin::Pin<
686        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
687    > {
688        Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
689    }
690}
691impl EnvVariableId {
692    fn quote(&self) -> String {
693        format!("\"{}\"", self.0.clone())
694    }
695}
696#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
697pub struct ErrorId(pub String);
698impl From<&str> for ErrorId {
699    fn from(value: &str) -> Self {
700        Self(value.to_string())
701    }
702}
703impl From<String> for ErrorId {
704    fn from(value: String) -> Self {
705        Self(value)
706    }
707}
708impl IntoID<ErrorId> for Error {
709    fn into_id(
710        self,
711    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
712    {
713        Box::pin(async move { self.id().await })
714    }
715}
716impl IntoID<ErrorId> for ErrorId {
717    fn into_id(
718        self,
719    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
720    {
721        Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
722    }
723}
724impl ErrorId {
725    fn quote(&self) -> String {
726        format!("\"{}\"", self.0.clone())
727    }
728}
729#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
730pub struct ErrorValueId(pub String);
731impl From<&str> for ErrorValueId {
732    fn from(value: &str) -> Self {
733        Self(value.to_string())
734    }
735}
736impl From<String> for ErrorValueId {
737    fn from(value: String) -> Self {
738        Self(value)
739    }
740}
741impl IntoID<ErrorValueId> for ErrorValue {
742    fn into_id(
743        self,
744    ) -> std::pin::Pin<
745        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
746    > {
747        Box::pin(async move { self.id().await })
748    }
749}
750impl IntoID<ErrorValueId> for ErrorValueId {
751    fn into_id(
752        self,
753    ) -> std::pin::Pin<
754        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
755    > {
756        Box::pin(async move { Ok::<ErrorValueId, DaggerError>(self) })
757    }
758}
759impl ErrorValueId {
760    fn quote(&self) -> String {
761        format!("\"{}\"", self.0.clone())
762    }
763}
764#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
765pub struct FieldTypeDefId(pub String);
766impl From<&str> for FieldTypeDefId {
767    fn from(value: &str) -> Self {
768        Self(value.to_string())
769    }
770}
771impl From<String> for FieldTypeDefId {
772    fn from(value: String) -> Self {
773        Self(value)
774    }
775}
776impl IntoID<FieldTypeDefId> for FieldTypeDef {
777    fn into_id(
778        self,
779    ) -> std::pin::Pin<
780        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
781    > {
782        Box::pin(async move { self.id().await })
783    }
784}
785impl IntoID<FieldTypeDefId> for FieldTypeDefId {
786    fn into_id(
787        self,
788    ) -> std::pin::Pin<
789        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
790    > {
791        Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
792    }
793}
794impl FieldTypeDefId {
795    fn quote(&self) -> String {
796        format!("\"{}\"", self.0.clone())
797    }
798}
799#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
800pub struct FileId(pub String);
801impl From<&str> for FileId {
802    fn from(value: &str) -> Self {
803        Self(value.to_string())
804    }
805}
806impl From<String> for FileId {
807    fn from(value: String) -> Self {
808        Self(value)
809    }
810}
811impl IntoID<FileId> for File {
812    fn into_id(
813        self,
814    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
815    {
816        Box::pin(async move { self.id().await })
817    }
818}
819impl IntoID<FileId> for FileId {
820    fn into_id(
821        self,
822    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
823    {
824        Box::pin(async move { Ok::<FileId, DaggerError>(self) })
825    }
826}
827impl FileId {
828    fn quote(&self) -> String {
829        format!("\"{}\"", self.0.clone())
830    }
831}
832#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
833pub struct FunctionArgId(pub String);
834impl From<&str> for FunctionArgId {
835    fn from(value: &str) -> Self {
836        Self(value.to_string())
837    }
838}
839impl From<String> for FunctionArgId {
840    fn from(value: String) -> Self {
841        Self(value)
842    }
843}
844impl IntoID<FunctionArgId> for FunctionArg {
845    fn into_id(
846        self,
847    ) -> std::pin::Pin<
848        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
849    > {
850        Box::pin(async move { self.id().await })
851    }
852}
853impl IntoID<FunctionArgId> for FunctionArgId {
854    fn into_id(
855        self,
856    ) -> std::pin::Pin<
857        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
858    > {
859        Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
860    }
861}
862impl FunctionArgId {
863    fn quote(&self) -> String {
864        format!("\"{}\"", self.0.clone())
865    }
866}
867#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
868pub struct FunctionCallArgValueId(pub String);
869impl From<&str> for FunctionCallArgValueId {
870    fn from(value: &str) -> Self {
871        Self(value.to_string())
872    }
873}
874impl From<String> for FunctionCallArgValueId {
875    fn from(value: String) -> Self {
876        Self(value)
877    }
878}
879impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
880    fn into_id(
881        self,
882    ) -> std::pin::Pin<
883        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
884    > {
885        Box::pin(async move { self.id().await })
886    }
887}
888impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
889    fn into_id(
890        self,
891    ) -> std::pin::Pin<
892        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
893    > {
894        Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
895    }
896}
897impl FunctionCallArgValueId {
898    fn quote(&self) -> String {
899        format!("\"{}\"", self.0.clone())
900    }
901}
902#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
903pub struct FunctionCallId(pub String);
904impl From<&str> for FunctionCallId {
905    fn from(value: &str) -> Self {
906        Self(value.to_string())
907    }
908}
909impl From<String> for FunctionCallId {
910    fn from(value: String) -> Self {
911        Self(value)
912    }
913}
914impl IntoID<FunctionCallId> for FunctionCall {
915    fn into_id(
916        self,
917    ) -> std::pin::Pin<
918        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
919    > {
920        Box::pin(async move { self.id().await })
921    }
922}
923impl IntoID<FunctionCallId> for FunctionCallId {
924    fn into_id(
925        self,
926    ) -> std::pin::Pin<
927        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
928    > {
929        Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
930    }
931}
932impl FunctionCallId {
933    fn quote(&self) -> String {
934        format!("\"{}\"", self.0.clone())
935    }
936}
937#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
938pub struct FunctionId(pub String);
939impl From<&str> for FunctionId {
940    fn from(value: &str) -> Self {
941        Self(value.to_string())
942    }
943}
944impl From<String> for FunctionId {
945    fn from(value: String) -> Self {
946        Self(value)
947    }
948}
949impl IntoID<FunctionId> for Function {
950    fn into_id(
951        self,
952    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
953    {
954        Box::pin(async move { self.id().await })
955    }
956}
957impl IntoID<FunctionId> for FunctionId {
958    fn into_id(
959        self,
960    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
961    {
962        Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
963    }
964}
965impl FunctionId {
966    fn quote(&self) -> String {
967        format!("\"{}\"", self.0.clone())
968    }
969}
970#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
971pub struct GeneratedCodeId(pub String);
972impl From<&str> for GeneratedCodeId {
973    fn from(value: &str) -> Self {
974        Self(value.to_string())
975    }
976}
977impl From<String> for GeneratedCodeId {
978    fn from(value: String) -> Self {
979        Self(value)
980    }
981}
982impl IntoID<GeneratedCodeId> for GeneratedCode {
983    fn into_id(
984        self,
985    ) -> std::pin::Pin<
986        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
987    > {
988        Box::pin(async move { self.id().await })
989    }
990}
991impl IntoID<GeneratedCodeId> for GeneratedCodeId {
992    fn into_id(
993        self,
994    ) -> std::pin::Pin<
995        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
996    > {
997        Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
998    }
999}
1000impl GeneratedCodeId {
1001    fn quote(&self) -> String {
1002        format!("\"{}\"", self.0.clone())
1003    }
1004}
1005#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1006pub struct GeneratorGroupId(pub String);
1007impl From<&str> for GeneratorGroupId {
1008    fn from(value: &str) -> Self {
1009        Self(value.to_string())
1010    }
1011}
1012impl From<String> for GeneratorGroupId {
1013    fn from(value: String) -> Self {
1014        Self(value)
1015    }
1016}
1017impl IntoID<GeneratorGroupId> for GeneratorGroup {
1018    fn into_id(
1019        self,
1020    ) -> std::pin::Pin<
1021        Box<dyn core::future::Future<Output = Result<GeneratorGroupId, DaggerError>> + Send>,
1022    > {
1023        Box::pin(async move { self.id().await })
1024    }
1025}
1026impl IntoID<GeneratorGroupId> for GeneratorGroupId {
1027    fn into_id(
1028        self,
1029    ) -> std::pin::Pin<
1030        Box<dyn core::future::Future<Output = Result<GeneratorGroupId, DaggerError>> + Send>,
1031    > {
1032        Box::pin(async move { Ok::<GeneratorGroupId, DaggerError>(self) })
1033    }
1034}
1035impl GeneratorGroupId {
1036    fn quote(&self) -> String {
1037        format!("\"{}\"", self.0.clone())
1038    }
1039}
1040#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1041pub struct GeneratorId(pub String);
1042impl From<&str> for GeneratorId {
1043    fn from(value: &str) -> Self {
1044        Self(value.to_string())
1045    }
1046}
1047impl From<String> for GeneratorId {
1048    fn from(value: String) -> Self {
1049        Self(value)
1050    }
1051}
1052impl IntoID<GeneratorId> for Generator {
1053    fn into_id(
1054        self,
1055    ) -> std::pin::Pin<
1056        Box<dyn core::future::Future<Output = Result<GeneratorId, DaggerError>> + Send>,
1057    > {
1058        Box::pin(async move { self.id().await })
1059    }
1060}
1061impl IntoID<GeneratorId> for GeneratorId {
1062    fn into_id(
1063        self,
1064    ) -> std::pin::Pin<
1065        Box<dyn core::future::Future<Output = Result<GeneratorId, DaggerError>> + Send>,
1066    > {
1067        Box::pin(async move { Ok::<GeneratorId, DaggerError>(self) })
1068    }
1069}
1070impl GeneratorId {
1071    fn quote(&self) -> String {
1072        format!("\"{}\"", self.0.clone())
1073    }
1074}
1075#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1076pub struct GitRefId(pub String);
1077impl From<&str> for GitRefId {
1078    fn from(value: &str) -> Self {
1079        Self(value.to_string())
1080    }
1081}
1082impl From<String> for GitRefId {
1083    fn from(value: String) -> Self {
1084        Self(value)
1085    }
1086}
1087impl IntoID<GitRefId> for GitRef {
1088    fn into_id(
1089        self,
1090    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
1091    {
1092        Box::pin(async move { self.id().await })
1093    }
1094}
1095impl IntoID<GitRefId> for GitRefId {
1096    fn into_id(
1097        self,
1098    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
1099    {
1100        Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
1101    }
1102}
1103impl GitRefId {
1104    fn quote(&self) -> String {
1105        format!("\"{}\"", self.0.clone())
1106    }
1107}
1108#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1109pub struct GitRepositoryId(pub String);
1110impl From<&str> for GitRepositoryId {
1111    fn from(value: &str) -> Self {
1112        Self(value.to_string())
1113    }
1114}
1115impl From<String> for GitRepositoryId {
1116    fn from(value: String) -> Self {
1117        Self(value)
1118    }
1119}
1120impl IntoID<GitRepositoryId> for GitRepository {
1121    fn into_id(
1122        self,
1123    ) -> std::pin::Pin<
1124        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
1125    > {
1126        Box::pin(async move { self.id().await })
1127    }
1128}
1129impl IntoID<GitRepositoryId> for GitRepositoryId {
1130    fn into_id(
1131        self,
1132    ) -> std::pin::Pin<
1133        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
1134    > {
1135        Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
1136    }
1137}
1138impl GitRepositoryId {
1139    fn quote(&self) -> String {
1140        format!("\"{}\"", self.0.clone())
1141    }
1142}
1143#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1144pub struct HealthcheckConfigId(pub String);
1145impl From<&str> for HealthcheckConfigId {
1146    fn from(value: &str) -> Self {
1147        Self(value.to_string())
1148    }
1149}
1150impl From<String> for HealthcheckConfigId {
1151    fn from(value: String) -> Self {
1152        Self(value)
1153    }
1154}
1155impl IntoID<HealthcheckConfigId> for HealthcheckConfig {
1156    fn into_id(
1157        self,
1158    ) -> std::pin::Pin<
1159        Box<dyn core::future::Future<Output = Result<HealthcheckConfigId, DaggerError>> + Send>,
1160    > {
1161        Box::pin(async move { self.id().await })
1162    }
1163}
1164impl IntoID<HealthcheckConfigId> for HealthcheckConfigId {
1165    fn into_id(
1166        self,
1167    ) -> std::pin::Pin<
1168        Box<dyn core::future::Future<Output = Result<HealthcheckConfigId, DaggerError>> + Send>,
1169    > {
1170        Box::pin(async move { Ok::<HealthcheckConfigId, DaggerError>(self) })
1171    }
1172}
1173impl HealthcheckConfigId {
1174    fn quote(&self) -> String {
1175        format!("\"{}\"", self.0.clone())
1176    }
1177}
1178#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1179pub struct HostId(pub String);
1180impl From<&str> for HostId {
1181    fn from(value: &str) -> Self {
1182        Self(value.to_string())
1183    }
1184}
1185impl From<String> for HostId {
1186    fn from(value: String) -> Self {
1187        Self(value)
1188    }
1189}
1190impl IntoID<HostId> for Host {
1191    fn into_id(
1192        self,
1193    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
1194    {
1195        Box::pin(async move { self.id().await })
1196    }
1197}
1198impl IntoID<HostId> for HostId {
1199    fn into_id(
1200        self,
1201    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
1202    {
1203        Box::pin(async move { Ok::<HostId, DaggerError>(self) })
1204    }
1205}
1206impl HostId {
1207    fn quote(&self) -> String {
1208        format!("\"{}\"", self.0.clone())
1209    }
1210}
1211#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1212pub struct InputTypeDefId(pub String);
1213impl From<&str> for InputTypeDefId {
1214    fn from(value: &str) -> Self {
1215        Self(value.to_string())
1216    }
1217}
1218impl From<String> for InputTypeDefId {
1219    fn from(value: String) -> Self {
1220        Self(value)
1221    }
1222}
1223impl IntoID<InputTypeDefId> for InputTypeDef {
1224    fn into_id(
1225        self,
1226    ) -> std::pin::Pin<
1227        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1228    > {
1229        Box::pin(async move { self.id().await })
1230    }
1231}
1232impl IntoID<InputTypeDefId> for InputTypeDefId {
1233    fn into_id(
1234        self,
1235    ) -> std::pin::Pin<
1236        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1237    > {
1238        Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
1239    }
1240}
1241impl InputTypeDefId {
1242    fn quote(&self) -> String {
1243        format!("\"{}\"", self.0.clone())
1244    }
1245}
1246#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1247pub struct InterfaceTypeDefId(pub String);
1248impl From<&str> for InterfaceTypeDefId {
1249    fn from(value: &str) -> Self {
1250        Self(value.to_string())
1251    }
1252}
1253impl From<String> for InterfaceTypeDefId {
1254    fn from(value: String) -> Self {
1255        Self(value)
1256    }
1257}
1258impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
1259    fn into_id(
1260        self,
1261    ) -> std::pin::Pin<
1262        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1263    > {
1264        Box::pin(async move { self.id().await })
1265    }
1266}
1267impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
1268    fn into_id(
1269        self,
1270    ) -> std::pin::Pin<
1271        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1272    > {
1273        Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
1274    }
1275}
1276impl InterfaceTypeDefId {
1277    fn quote(&self) -> String {
1278        format!("\"{}\"", self.0.clone())
1279    }
1280}
1281#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1282pub struct Json(pub String);
1283impl From<&str> for Json {
1284    fn from(value: &str) -> Self {
1285        Self(value.to_string())
1286    }
1287}
1288impl From<String> for Json {
1289    fn from(value: String) -> Self {
1290        Self(value)
1291    }
1292}
1293impl Json {
1294    fn quote(&self) -> String {
1295        format!("\"{}\"", self.0.clone())
1296    }
1297}
1298#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1299pub struct JsonValueId(pub String);
1300impl From<&str> for JsonValueId {
1301    fn from(value: &str) -> Self {
1302        Self(value.to_string())
1303    }
1304}
1305impl From<String> for JsonValueId {
1306    fn from(value: String) -> Self {
1307        Self(value)
1308    }
1309}
1310impl IntoID<JsonValueId> for JsonValue {
1311    fn into_id(
1312        self,
1313    ) -> std::pin::Pin<
1314        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1315    > {
1316        Box::pin(async move { self.id().await })
1317    }
1318}
1319impl IntoID<JsonValueId> for JsonValueId {
1320    fn into_id(
1321        self,
1322    ) -> std::pin::Pin<
1323        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1324    > {
1325        Box::pin(async move { Ok::<JsonValueId, DaggerError>(self) })
1326    }
1327}
1328impl JsonValueId {
1329    fn quote(&self) -> String {
1330        format!("\"{}\"", self.0.clone())
1331    }
1332}
1333#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1334pub struct Llmid(pub String);
1335impl From<&str> for Llmid {
1336    fn from(value: &str) -> Self {
1337        Self(value.to_string())
1338    }
1339}
1340impl From<String> for Llmid {
1341    fn from(value: String) -> Self {
1342        Self(value)
1343    }
1344}
1345impl IntoID<Llmid> for Llm {
1346    fn into_id(
1347        self,
1348    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1349    {
1350        Box::pin(async move { self.id().await })
1351    }
1352}
1353impl IntoID<Llmid> for Llmid {
1354    fn into_id(
1355        self,
1356    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1357    {
1358        Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
1359    }
1360}
1361impl Llmid {
1362    fn quote(&self) -> String {
1363        format!("\"{}\"", self.0.clone())
1364    }
1365}
1366#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1367pub struct LlmTokenUsageId(pub String);
1368impl From<&str> for LlmTokenUsageId {
1369    fn from(value: &str) -> Self {
1370        Self(value.to_string())
1371    }
1372}
1373impl From<String> for LlmTokenUsageId {
1374    fn from(value: String) -> Self {
1375        Self(value)
1376    }
1377}
1378impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
1379    fn into_id(
1380        self,
1381    ) -> std::pin::Pin<
1382        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1383    > {
1384        Box::pin(async move { self.id().await })
1385    }
1386}
1387impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
1388    fn into_id(
1389        self,
1390    ) -> std::pin::Pin<
1391        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1392    > {
1393        Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
1394    }
1395}
1396impl LlmTokenUsageId {
1397    fn quote(&self) -> String {
1398        format!("\"{}\"", self.0.clone())
1399    }
1400}
1401#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1402pub struct LabelId(pub String);
1403impl From<&str> for LabelId {
1404    fn from(value: &str) -> Self {
1405        Self(value.to_string())
1406    }
1407}
1408impl From<String> for LabelId {
1409    fn from(value: String) -> Self {
1410        Self(value)
1411    }
1412}
1413impl IntoID<LabelId> for Label {
1414    fn into_id(
1415        self,
1416    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1417    {
1418        Box::pin(async move { self.id().await })
1419    }
1420}
1421impl IntoID<LabelId> for LabelId {
1422    fn into_id(
1423        self,
1424    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1425    {
1426        Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
1427    }
1428}
1429impl LabelId {
1430    fn quote(&self) -> String {
1431        format!("\"{}\"", self.0.clone())
1432    }
1433}
1434#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1435pub struct ListTypeDefId(pub String);
1436impl From<&str> for ListTypeDefId {
1437    fn from(value: &str) -> Self {
1438        Self(value.to_string())
1439    }
1440}
1441impl From<String> for ListTypeDefId {
1442    fn from(value: String) -> Self {
1443        Self(value)
1444    }
1445}
1446impl IntoID<ListTypeDefId> for ListTypeDef {
1447    fn into_id(
1448        self,
1449    ) -> std::pin::Pin<
1450        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1451    > {
1452        Box::pin(async move { self.id().await })
1453    }
1454}
1455impl IntoID<ListTypeDefId> for ListTypeDefId {
1456    fn into_id(
1457        self,
1458    ) -> std::pin::Pin<
1459        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1460    > {
1461        Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
1462    }
1463}
1464impl ListTypeDefId {
1465    fn quote(&self) -> String {
1466        format!("\"{}\"", self.0.clone())
1467    }
1468}
1469#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1470pub struct ModuleConfigClientId(pub String);
1471impl From<&str> for ModuleConfigClientId {
1472    fn from(value: &str) -> Self {
1473        Self(value.to_string())
1474    }
1475}
1476impl From<String> for ModuleConfigClientId {
1477    fn from(value: String) -> Self {
1478        Self(value)
1479    }
1480}
1481impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
1482    fn into_id(
1483        self,
1484    ) -> std::pin::Pin<
1485        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1486    > {
1487        Box::pin(async move { self.id().await })
1488    }
1489}
1490impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
1491    fn into_id(
1492        self,
1493    ) -> std::pin::Pin<
1494        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1495    > {
1496        Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
1497    }
1498}
1499impl ModuleConfigClientId {
1500    fn quote(&self) -> String {
1501        format!("\"{}\"", self.0.clone())
1502    }
1503}
1504#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1505pub struct ModuleId(pub String);
1506impl From<&str> for ModuleId {
1507    fn from(value: &str) -> Self {
1508        Self(value.to_string())
1509    }
1510}
1511impl From<String> for ModuleId {
1512    fn from(value: String) -> Self {
1513        Self(value)
1514    }
1515}
1516impl IntoID<ModuleId> for Module {
1517    fn into_id(
1518        self,
1519    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1520    {
1521        Box::pin(async move { self.id().await })
1522    }
1523}
1524impl IntoID<ModuleId> for ModuleId {
1525    fn into_id(
1526        self,
1527    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1528    {
1529        Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
1530    }
1531}
1532impl ModuleId {
1533    fn quote(&self) -> String {
1534        format!("\"{}\"", self.0.clone())
1535    }
1536}
1537#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1538pub struct ModuleSourceId(pub String);
1539impl From<&str> for ModuleSourceId {
1540    fn from(value: &str) -> Self {
1541        Self(value.to_string())
1542    }
1543}
1544impl From<String> for ModuleSourceId {
1545    fn from(value: String) -> Self {
1546        Self(value)
1547    }
1548}
1549impl IntoID<ModuleSourceId> for ModuleSource {
1550    fn into_id(
1551        self,
1552    ) -> std::pin::Pin<
1553        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1554    > {
1555        Box::pin(async move { self.id().await })
1556    }
1557}
1558impl IntoID<ModuleSourceId> for ModuleSourceId {
1559    fn into_id(
1560        self,
1561    ) -> std::pin::Pin<
1562        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1563    > {
1564        Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1565    }
1566}
1567impl ModuleSourceId {
1568    fn quote(&self) -> String {
1569        format!("\"{}\"", self.0.clone())
1570    }
1571}
1572#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1573pub struct ObjectTypeDefId(pub String);
1574impl From<&str> for ObjectTypeDefId {
1575    fn from(value: &str) -> Self {
1576        Self(value.to_string())
1577    }
1578}
1579impl From<String> for ObjectTypeDefId {
1580    fn from(value: String) -> Self {
1581        Self(value)
1582    }
1583}
1584impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1585    fn into_id(
1586        self,
1587    ) -> std::pin::Pin<
1588        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1589    > {
1590        Box::pin(async move { self.id().await })
1591    }
1592}
1593impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1594    fn into_id(
1595        self,
1596    ) -> std::pin::Pin<
1597        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1598    > {
1599        Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1600    }
1601}
1602impl ObjectTypeDefId {
1603    fn quote(&self) -> String {
1604        format!("\"{}\"", self.0.clone())
1605    }
1606}
1607#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1608pub struct Platform(pub String);
1609impl From<&str> for Platform {
1610    fn from(value: &str) -> Self {
1611        Self(value.to_string())
1612    }
1613}
1614impl From<String> for Platform {
1615    fn from(value: String) -> Self {
1616        Self(value)
1617    }
1618}
1619impl Platform {
1620    fn quote(&self) -> String {
1621        format!("\"{}\"", self.0.clone())
1622    }
1623}
1624#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1625pub struct PortId(pub String);
1626impl From<&str> for PortId {
1627    fn from(value: &str) -> Self {
1628        Self(value.to_string())
1629    }
1630}
1631impl From<String> for PortId {
1632    fn from(value: String) -> Self {
1633        Self(value)
1634    }
1635}
1636impl IntoID<PortId> for Port {
1637    fn into_id(
1638        self,
1639    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1640    {
1641        Box::pin(async move { self.id().await })
1642    }
1643}
1644impl IntoID<PortId> for PortId {
1645    fn into_id(
1646        self,
1647    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1648    {
1649        Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1650    }
1651}
1652impl PortId {
1653    fn quote(&self) -> String {
1654        format!("\"{}\"", self.0.clone())
1655    }
1656}
1657#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1658pub struct QueryId(pub String);
1659impl From<&str> for QueryId {
1660    fn from(value: &str) -> Self {
1661        Self(value.to_string())
1662    }
1663}
1664impl From<String> for QueryId {
1665    fn from(value: String) -> Self {
1666        Self(value)
1667    }
1668}
1669impl IntoID<QueryId> for Query {
1670    fn into_id(
1671        self,
1672    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<QueryId, DaggerError>> + Send>>
1673    {
1674        Box::pin(async move { self.id().await })
1675    }
1676}
1677impl IntoID<QueryId> for QueryId {
1678    fn into_id(
1679        self,
1680    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<QueryId, DaggerError>> + Send>>
1681    {
1682        Box::pin(async move { Ok::<QueryId, DaggerError>(self) })
1683    }
1684}
1685impl QueryId {
1686    fn quote(&self) -> String {
1687        format!("\"{}\"", self.0.clone())
1688    }
1689}
1690#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1691pub struct SdkConfigId(pub String);
1692impl From<&str> for SdkConfigId {
1693    fn from(value: &str) -> Self {
1694        Self(value.to_string())
1695    }
1696}
1697impl From<String> for SdkConfigId {
1698    fn from(value: String) -> Self {
1699        Self(value)
1700    }
1701}
1702impl IntoID<SdkConfigId> for SdkConfig {
1703    fn into_id(
1704        self,
1705    ) -> std::pin::Pin<
1706        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1707    > {
1708        Box::pin(async move { self.id().await })
1709    }
1710}
1711impl IntoID<SdkConfigId> for SdkConfigId {
1712    fn into_id(
1713        self,
1714    ) -> std::pin::Pin<
1715        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1716    > {
1717        Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1718    }
1719}
1720impl SdkConfigId {
1721    fn quote(&self) -> String {
1722        format!("\"{}\"", self.0.clone())
1723    }
1724}
1725#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1726pub struct ScalarTypeDefId(pub String);
1727impl From<&str> for ScalarTypeDefId {
1728    fn from(value: &str) -> Self {
1729        Self(value.to_string())
1730    }
1731}
1732impl From<String> for ScalarTypeDefId {
1733    fn from(value: String) -> Self {
1734        Self(value)
1735    }
1736}
1737impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1738    fn into_id(
1739        self,
1740    ) -> std::pin::Pin<
1741        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1742    > {
1743        Box::pin(async move { self.id().await })
1744    }
1745}
1746impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1747    fn into_id(
1748        self,
1749    ) -> std::pin::Pin<
1750        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1751    > {
1752        Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1753    }
1754}
1755impl ScalarTypeDefId {
1756    fn quote(&self) -> String {
1757        format!("\"{}\"", self.0.clone())
1758    }
1759}
1760#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1761pub struct SearchResultId(pub String);
1762impl From<&str> for SearchResultId {
1763    fn from(value: &str) -> Self {
1764        Self(value.to_string())
1765    }
1766}
1767impl From<String> for SearchResultId {
1768    fn from(value: String) -> Self {
1769        Self(value)
1770    }
1771}
1772impl IntoID<SearchResultId> for SearchResult {
1773    fn into_id(
1774        self,
1775    ) -> std::pin::Pin<
1776        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1777    > {
1778        Box::pin(async move { self.id().await })
1779    }
1780}
1781impl IntoID<SearchResultId> for SearchResultId {
1782    fn into_id(
1783        self,
1784    ) -> std::pin::Pin<
1785        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1786    > {
1787        Box::pin(async move { Ok::<SearchResultId, DaggerError>(self) })
1788    }
1789}
1790impl SearchResultId {
1791    fn quote(&self) -> String {
1792        format!("\"{}\"", self.0.clone())
1793    }
1794}
1795#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1796pub struct SearchSubmatchId(pub String);
1797impl From<&str> for SearchSubmatchId {
1798    fn from(value: &str) -> Self {
1799        Self(value.to_string())
1800    }
1801}
1802impl From<String> for SearchSubmatchId {
1803    fn from(value: String) -> Self {
1804        Self(value)
1805    }
1806}
1807impl IntoID<SearchSubmatchId> for SearchSubmatch {
1808    fn into_id(
1809        self,
1810    ) -> std::pin::Pin<
1811        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1812    > {
1813        Box::pin(async move { self.id().await })
1814    }
1815}
1816impl IntoID<SearchSubmatchId> for SearchSubmatchId {
1817    fn into_id(
1818        self,
1819    ) -> std::pin::Pin<
1820        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1821    > {
1822        Box::pin(async move { Ok::<SearchSubmatchId, DaggerError>(self) })
1823    }
1824}
1825impl SearchSubmatchId {
1826    fn quote(&self) -> String {
1827        format!("\"{}\"", self.0.clone())
1828    }
1829}
1830#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1831pub struct SecretId(pub String);
1832impl From<&str> for SecretId {
1833    fn from(value: &str) -> Self {
1834        Self(value.to_string())
1835    }
1836}
1837impl From<String> for SecretId {
1838    fn from(value: String) -> Self {
1839        Self(value)
1840    }
1841}
1842impl IntoID<SecretId> for Secret {
1843    fn into_id(
1844        self,
1845    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1846    {
1847        Box::pin(async move { self.id().await })
1848    }
1849}
1850impl IntoID<SecretId> for SecretId {
1851    fn into_id(
1852        self,
1853    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1854    {
1855        Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1856    }
1857}
1858impl SecretId {
1859    fn quote(&self) -> String {
1860        format!("\"{}\"", self.0.clone())
1861    }
1862}
1863#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1864pub struct ServiceId(pub String);
1865impl From<&str> for ServiceId {
1866    fn from(value: &str) -> Self {
1867        Self(value.to_string())
1868    }
1869}
1870impl From<String> for ServiceId {
1871    fn from(value: String) -> Self {
1872        Self(value)
1873    }
1874}
1875impl IntoID<ServiceId> for Service {
1876    fn into_id(
1877        self,
1878    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1879    {
1880        Box::pin(async move { self.id().await })
1881    }
1882}
1883impl IntoID<ServiceId> for ServiceId {
1884    fn into_id(
1885        self,
1886    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1887    {
1888        Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1889    }
1890}
1891impl ServiceId {
1892    fn quote(&self) -> String {
1893        format!("\"{}\"", self.0.clone())
1894    }
1895}
1896#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1897pub struct SocketId(pub String);
1898impl From<&str> for SocketId {
1899    fn from(value: &str) -> Self {
1900        Self(value.to_string())
1901    }
1902}
1903impl From<String> for SocketId {
1904    fn from(value: String) -> Self {
1905        Self(value)
1906    }
1907}
1908impl IntoID<SocketId> for Socket {
1909    fn into_id(
1910        self,
1911    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1912    {
1913        Box::pin(async move { self.id().await })
1914    }
1915}
1916impl IntoID<SocketId> for SocketId {
1917    fn into_id(
1918        self,
1919    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1920    {
1921        Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1922    }
1923}
1924impl SocketId {
1925    fn quote(&self) -> String {
1926        format!("\"{}\"", self.0.clone())
1927    }
1928}
1929#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1930pub struct SourceMapId(pub String);
1931impl From<&str> for SourceMapId {
1932    fn from(value: &str) -> Self {
1933        Self(value.to_string())
1934    }
1935}
1936impl From<String> for SourceMapId {
1937    fn from(value: String) -> Self {
1938        Self(value)
1939    }
1940}
1941impl IntoID<SourceMapId> for SourceMap {
1942    fn into_id(
1943        self,
1944    ) -> std::pin::Pin<
1945        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1946    > {
1947        Box::pin(async move { self.id().await })
1948    }
1949}
1950impl IntoID<SourceMapId> for SourceMapId {
1951    fn into_id(
1952        self,
1953    ) -> std::pin::Pin<
1954        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1955    > {
1956        Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1957    }
1958}
1959impl SourceMapId {
1960    fn quote(&self) -> String {
1961        format!("\"{}\"", self.0.clone())
1962    }
1963}
1964#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1965pub struct StatId(pub String);
1966impl From<&str> for StatId {
1967    fn from(value: &str) -> Self {
1968        Self(value.to_string())
1969    }
1970}
1971impl From<String> for StatId {
1972    fn from(value: String) -> Self {
1973        Self(value)
1974    }
1975}
1976impl IntoID<StatId> for Stat {
1977    fn into_id(
1978        self,
1979    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<StatId, DaggerError>> + Send>>
1980    {
1981        Box::pin(async move { self.id().await })
1982    }
1983}
1984impl IntoID<StatId> for StatId {
1985    fn into_id(
1986        self,
1987    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<StatId, DaggerError>> + Send>>
1988    {
1989        Box::pin(async move { Ok::<StatId, DaggerError>(self) })
1990    }
1991}
1992impl StatId {
1993    fn quote(&self) -> String {
1994        format!("\"{}\"", self.0.clone())
1995    }
1996}
1997#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1998pub struct TerminalId(pub String);
1999impl From<&str> for TerminalId {
2000    fn from(value: &str) -> Self {
2001        Self(value.to_string())
2002    }
2003}
2004impl From<String> for TerminalId {
2005    fn from(value: String) -> Self {
2006        Self(value)
2007    }
2008}
2009impl IntoID<TerminalId> for Terminal {
2010    fn into_id(
2011        self,
2012    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
2013    {
2014        Box::pin(async move { self.id().await })
2015    }
2016}
2017impl IntoID<TerminalId> for TerminalId {
2018    fn into_id(
2019        self,
2020    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
2021    {
2022        Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
2023    }
2024}
2025impl TerminalId {
2026    fn quote(&self) -> String {
2027        format!("\"{}\"", self.0.clone())
2028    }
2029}
2030#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2031pub struct TypeDefId(pub String);
2032impl From<&str> for TypeDefId {
2033    fn from(value: &str) -> Self {
2034        Self(value.to_string())
2035    }
2036}
2037impl From<String> for TypeDefId {
2038    fn from(value: String) -> Self {
2039        Self(value)
2040    }
2041}
2042impl IntoID<TypeDefId> for TypeDef {
2043    fn into_id(
2044        self,
2045    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
2046    {
2047        Box::pin(async move { self.id().await })
2048    }
2049}
2050impl IntoID<TypeDefId> for TypeDefId {
2051    fn into_id(
2052        self,
2053    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
2054    {
2055        Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
2056    }
2057}
2058impl TypeDefId {
2059    fn quote(&self) -> String {
2060        format!("\"{}\"", self.0.clone())
2061    }
2062}
2063#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2064pub struct UpGroupId(pub String);
2065impl From<&str> for UpGroupId {
2066    fn from(value: &str) -> Self {
2067        Self(value.to_string())
2068    }
2069}
2070impl From<String> for UpGroupId {
2071    fn from(value: String) -> Self {
2072        Self(value)
2073    }
2074}
2075impl IntoID<UpGroupId> for UpGroup {
2076    fn into_id(
2077        self,
2078    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpGroupId, DaggerError>> + Send>>
2079    {
2080        Box::pin(async move { self.id().await })
2081    }
2082}
2083impl IntoID<UpGroupId> for UpGroupId {
2084    fn into_id(
2085        self,
2086    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpGroupId, DaggerError>> + Send>>
2087    {
2088        Box::pin(async move { Ok::<UpGroupId, DaggerError>(self) })
2089    }
2090}
2091impl UpGroupId {
2092    fn quote(&self) -> String {
2093        format!("\"{}\"", self.0.clone())
2094    }
2095}
2096#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2097pub struct UpId(pub String);
2098impl From<&str> for UpId {
2099    fn from(value: &str) -> Self {
2100        Self(value.to_string())
2101    }
2102}
2103impl From<String> for UpId {
2104    fn from(value: String) -> Self {
2105        Self(value)
2106    }
2107}
2108impl IntoID<UpId> for Up {
2109    fn into_id(
2110        self,
2111    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpId, DaggerError>> + Send>>
2112    {
2113        Box::pin(async move { self.id().await })
2114    }
2115}
2116impl IntoID<UpId> for UpId {
2117    fn into_id(
2118        self,
2119    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpId, DaggerError>> + Send>>
2120    {
2121        Box::pin(async move { Ok::<UpId, DaggerError>(self) })
2122    }
2123}
2124impl UpId {
2125    fn quote(&self) -> String {
2126        format!("\"{}\"", self.0.clone())
2127    }
2128}
2129#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2130pub struct Void(pub String);
2131impl From<&str> for Void {
2132    fn from(value: &str) -> Self {
2133        Self(value.to_string())
2134    }
2135}
2136impl From<String> for Void {
2137    fn from(value: String) -> Self {
2138        Self(value)
2139    }
2140}
2141impl Void {
2142    fn quote(&self) -> String {
2143        format!("\"{}\"", self.0.clone())
2144    }
2145}
2146#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
2147pub struct WorkspaceId(pub String);
2148impl From<&str> for WorkspaceId {
2149    fn from(value: &str) -> Self {
2150        Self(value.to_string())
2151    }
2152}
2153impl From<String> for WorkspaceId {
2154    fn from(value: String) -> Self {
2155        Self(value)
2156    }
2157}
2158impl IntoID<WorkspaceId> for Workspace {
2159    fn into_id(
2160        self,
2161    ) -> std::pin::Pin<
2162        Box<dyn core::future::Future<Output = Result<WorkspaceId, DaggerError>> + Send>,
2163    > {
2164        Box::pin(async move { self.id().await })
2165    }
2166}
2167impl IntoID<WorkspaceId> for WorkspaceId {
2168    fn into_id(
2169        self,
2170    ) -> std::pin::Pin<
2171        Box<dyn core::future::Future<Output = Result<WorkspaceId, DaggerError>> + Send>,
2172    > {
2173        Box::pin(async move { Ok::<WorkspaceId, DaggerError>(self) })
2174    }
2175}
2176impl WorkspaceId {
2177    fn quote(&self) -> String {
2178        format!("\"{}\"", self.0.clone())
2179    }
2180}
2181#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
2182pub struct BuildArg {
2183    pub name: String,
2184    pub value: String,
2185}
2186#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
2187pub struct PipelineLabel {
2188    pub name: String,
2189    pub value: String,
2190}
2191#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
2192pub struct PortForward {
2193    pub backend: isize,
2194    pub frontend: isize,
2195    pub protocol: NetworkProtocol,
2196}
2197#[derive(Clone)]
2198pub struct Address {
2199    pub proc: Option<Arc<DaggerSessionProc>>,
2200    pub selection: Selection,
2201    pub graphql_client: DynGraphQLClient,
2202}
2203#[derive(Builder, Debug, PartialEq)]
2204pub struct AddressDirectoryOpts<'a> {
2205    #[builder(setter(into, strip_option), default)]
2206    pub exclude: Option<Vec<&'a str>>,
2207    #[builder(setter(into, strip_option), default)]
2208    pub gitignore: Option<bool>,
2209    #[builder(setter(into, strip_option), default)]
2210    pub include: Option<Vec<&'a str>>,
2211    #[builder(setter(into, strip_option), default)]
2212    pub no_cache: Option<bool>,
2213}
2214#[derive(Builder, Debug, PartialEq)]
2215pub struct AddressFileOpts<'a> {
2216    #[builder(setter(into, strip_option), default)]
2217    pub exclude: Option<Vec<&'a str>>,
2218    #[builder(setter(into, strip_option), default)]
2219    pub gitignore: Option<bool>,
2220    #[builder(setter(into, strip_option), default)]
2221    pub include: Option<Vec<&'a str>>,
2222    #[builder(setter(into, strip_option), default)]
2223    pub no_cache: Option<bool>,
2224}
2225impl Address {
2226    /// Load a container from the address.
2227    pub fn container(&self) -> Container {
2228        let query = self.selection.select("container");
2229        Container {
2230            proc: self.proc.clone(),
2231            selection: query,
2232            graphql_client: self.graphql_client.clone(),
2233        }
2234    }
2235    /// Load a directory from the address.
2236    ///
2237    /// # Arguments
2238    ///
2239    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2240    pub fn directory(&self) -> Directory {
2241        let query = self.selection.select("directory");
2242        Directory {
2243            proc: self.proc.clone(),
2244            selection: query,
2245            graphql_client: self.graphql_client.clone(),
2246        }
2247    }
2248    /// Load a directory from the address.
2249    ///
2250    /// # Arguments
2251    ///
2252    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2253    pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
2254        let mut query = self.selection.select("directory");
2255        if let Some(exclude) = opts.exclude {
2256            query = query.arg("exclude", exclude);
2257        }
2258        if let Some(include) = opts.include {
2259            query = query.arg("include", include);
2260        }
2261        if let Some(gitignore) = opts.gitignore {
2262            query = query.arg("gitignore", gitignore);
2263        }
2264        if let Some(no_cache) = opts.no_cache {
2265            query = query.arg("noCache", no_cache);
2266        }
2267        Directory {
2268            proc: self.proc.clone(),
2269            selection: query,
2270            graphql_client: self.graphql_client.clone(),
2271        }
2272    }
2273    /// Load a file from the address.
2274    ///
2275    /// # Arguments
2276    ///
2277    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2278    pub fn file(&self) -> File {
2279        let query = self.selection.select("file");
2280        File {
2281            proc: self.proc.clone(),
2282            selection: query,
2283            graphql_client: self.graphql_client.clone(),
2284        }
2285    }
2286    /// Load a file from the address.
2287    ///
2288    /// # Arguments
2289    ///
2290    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2291    pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
2292        let mut query = self.selection.select("file");
2293        if let Some(exclude) = opts.exclude {
2294            query = query.arg("exclude", exclude);
2295        }
2296        if let Some(include) = opts.include {
2297            query = query.arg("include", include);
2298        }
2299        if let Some(gitignore) = opts.gitignore {
2300            query = query.arg("gitignore", gitignore);
2301        }
2302        if let Some(no_cache) = opts.no_cache {
2303            query = query.arg("noCache", no_cache);
2304        }
2305        File {
2306            proc: self.proc.clone(),
2307            selection: query,
2308            graphql_client: self.graphql_client.clone(),
2309        }
2310    }
2311    /// Load a git ref (branch, tag or commit) from the address.
2312    pub fn git_ref(&self) -> GitRef {
2313        let query = self.selection.select("gitRef");
2314        GitRef {
2315            proc: self.proc.clone(),
2316            selection: query,
2317            graphql_client: self.graphql_client.clone(),
2318        }
2319    }
2320    /// Load a git repository from the address.
2321    pub fn git_repository(&self) -> GitRepository {
2322        let query = self.selection.select("gitRepository");
2323        GitRepository {
2324            proc: self.proc.clone(),
2325            selection: query,
2326            graphql_client: self.graphql_client.clone(),
2327        }
2328    }
2329    /// A unique identifier for this Address.
2330    pub async fn id(&self) -> Result<AddressId, DaggerError> {
2331        let query = self.selection.select("id");
2332        query.execute(self.graphql_client.clone()).await
2333    }
2334    /// Load a secret from the address.
2335    pub fn secret(&self) -> Secret {
2336        let query = self.selection.select("secret");
2337        Secret {
2338            proc: self.proc.clone(),
2339            selection: query,
2340            graphql_client: self.graphql_client.clone(),
2341        }
2342    }
2343    /// Load a service from the address.
2344    pub fn service(&self) -> Service {
2345        let query = self.selection.select("service");
2346        Service {
2347            proc: self.proc.clone(),
2348            selection: query,
2349            graphql_client: self.graphql_client.clone(),
2350        }
2351    }
2352    /// Load a local socket from the address.
2353    pub fn socket(&self) -> Socket {
2354        let query = self.selection.select("socket");
2355        Socket {
2356            proc: self.proc.clone(),
2357            selection: query,
2358            graphql_client: self.graphql_client.clone(),
2359        }
2360    }
2361    /// The address value
2362    pub async fn value(&self) -> Result<String, DaggerError> {
2363        let query = self.selection.select("value");
2364        query.execute(self.graphql_client.clone()).await
2365    }
2366}
2367#[derive(Clone)]
2368pub struct Binding {
2369    pub proc: Option<Arc<DaggerSessionProc>>,
2370    pub selection: Selection,
2371    pub graphql_client: DynGraphQLClient,
2372}
2373impl Binding {
2374    /// Retrieve the binding value, as type Address
2375    pub fn as_address(&self) -> Address {
2376        let query = self.selection.select("asAddress");
2377        Address {
2378            proc: self.proc.clone(),
2379            selection: query,
2380            graphql_client: self.graphql_client.clone(),
2381        }
2382    }
2383    /// Retrieve the binding value, as type CacheVolume
2384    pub fn as_cache_volume(&self) -> CacheVolume {
2385        let query = self.selection.select("asCacheVolume");
2386        CacheVolume {
2387            proc: self.proc.clone(),
2388            selection: query,
2389            graphql_client: self.graphql_client.clone(),
2390        }
2391    }
2392    /// Retrieve the binding value, as type Changeset
2393    pub fn as_changeset(&self) -> Changeset {
2394        let query = self.selection.select("asChangeset");
2395        Changeset {
2396            proc: self.proc.clone(),
2397            selection: query,
2398            graphql_client: self.graphql_client.clone(),
2399        }
2400    }
2401    /// Retrieve the binding value, as type Check
2402    pub fn as_check(&self) -> Check {
2403        let query = self.selection.select("asCheck");
2404        Check {
2405            proc: self.proc.clone(),
2406            selection: query,
2407            graphql_client: self.graphql_client.clone(),
2408        }
2409    }
2410    /// Retrieve the binding value, as type CheckGroup
2411    pub fn as_check_group(&self) -> CheckGroup {
2412        let query = self.selection.select("asCheckGroup");
2413        CheckGroup {
2414            proc: self.proc.clone(),
2415            selection: query,
2416            graphql_client: self.graphql_client.clone(),
2417        }
2418    }
2419    /// Retrieve the binding value, as type Cloud
2420    pub fn as_cloud(&self) -> Cloud {
2421        let query = self.selection.select("asCloud");
2422        Cloud {
2423            proc: self.proc.clone(),
2424            selection: query,
2425            graphql_client: self.graphql_client.clone(),
2426        }
2427    }
2428    /// Retrieve the binding value, as type Container
2429    pub fn as_container(&self) -> Container {
2430        let query = self.selection.select("asContainer");
2431        Container {
2432            proc: self.proc.clone(),
2433            selection: query,
2434            graphql_client: self.graphql_client.clone(),
2435        }
2436    }
2437    /// Retrieve the binding value, as type DiffStat
2438    pub fn as_diff_stat(&self) -> DiffStat {
2439        let query = self.selection.select("asDiffStat");
2440        DiffStat {
2441            proc: self.proc.clone(),
2442            selection: query,
2443            graphql_client: self.graphql_client.clone(),
2444        }
2445    }
2446    /// Retrieve the binding value, as type Directory
2447    pub fn as_directory(&self) -> Directory {
2448        let query = self.selection.select("asDirectory");
2449        Directory {
2450            proc: self.proc.clone(),
2451            selection: query,
2452            graphql_client: self.graphql_client.clone(),
2453        }
2454    }
2455    /// Retrieve the binding value, as type Env
2456    pub fn as_env(&self) -> Env {
2457        let query = self.selection.select("asEnv");
2458        Env {
2459            proc: self.proc.clone(),
2460            selection: query,
2461            graphql_client: self.graphql_client.clone(),
2462        }
2463    }
2464    /// Retrieve the binding value, as type EnvFile
2465    pub fn as_env_file(&self) -> EnvFile {
2466        let query = self.selection.select("asEnvFile");
2467        EnvFile {
2468            proc: self.proc.clone(),
2469            selection: query,
2470            graphql_client: self.graphql_client.clone(),
2471        }
2472    }
2473    /// Retrieve the binding value, as type File
2474    pub fn as_file(&self) -> File {
2475        let query = self.selection.select("asFile");
2476        File {
2477            proc: self.proc.clone(),
2478            selection: query,
2479            graphql_client: self.graphql_client.clone(),
2480        }
2481    }
2482    /// Retrieve the binding value, as type Generator
2483    pub fn as_generator(&self) -> Generator {
2484        let query = self.selection.select("asGenerator");
2485        Generator {
2486            proc: self.proc.clone(),
2487            selection: query,
2488            graphql_client: self.graphql_client.clone(),
2489        }
2490    }
2491    /// Retrieve the binding value, as type GeneratorGroup
2492    pub fn as_generator_group(&self) -> GeneratorGroup {
2493        let query = self.selection.select("asGeneratorGroup");
2494        GeneratorGroup {
2495            proc: self.proc.clone(),
2496            selection: query,
2497            graphql_client: self.graphql_client.clone(),
2498        }
2499    }
2500    /// Retrieve the binding value, as type GitRef
2501    pub fn as_git_ref(&self) -> GitRef {
2502        let query = self.selection.select("asGitRef");
2503        GitRef {
2504            proc: self.proc.clone(),
2505            selection: query,
2506            graphql_client: self.graphql_client.clone(),
2507        }
2508    }
2509    /// Retrieve the binding value, as type GitRepository
2510    pub fn as_git_repository(&self) -> GitRepository {
2511        let query = self.selection.select("asGitRepository");
2512        GitRepository {
2513            proc: self.proc.clone(),
2514            selection: query,
2515            graphql_client: self.graphql_client.clone(),
2516        }
2517    }
2518    /// Retrieve the binding value, as type JSONValue
2519    pub fn as_json_value(&self) -> JsonValue {
2520        let query = self.selection.select("asJSONValue");
2521        JsonValue {
2522            proc: self.proc.clone(),
2523            selection: query,
2524            graphql_client: self.graphql_client.clone(),
2525        }
2526    }
2527    /// Retrieve the binding value, as type Module
2528    pub fn as_module(&self) -> Module {
2529        let query = self.selection.select("asModule");
2530        Module {
2531            proc: self.proc.clone(),
2532            selection: query,
2533            graphql_client: self.graphql_client.clone(),
2534        }
2535    }
2536    /// Retrieve the binding value, as type ModuleConfigClient
2537    pub fn as_module_config_client(&self) -> ModuleConfigClient {
2538        let query = self.selection.select("asModuleConfigClient");
2539        ModuleConfigClient {
2540            proc: self.proc.clone(),
2541            selection: query,
2542            graphql_client: self.graphql_client.clone(),
2543        }
2544    }
2545    /// Retrieve the binding value, as type ModuleSource
2546    pub fn as_module_source(&self) -> ModuleSource {
2547        let query = self.selection.select("asModuleSource");
2548        ModuleSource {
2549            proc: self.proc.clone(),
2550            selection: query,
2551            graphql_client: self.graphql_client.clone(),
2552        }
2553    }
2554    /// Retrieve the binding value, as type SearchResult
2555    pub fn as_search_result(&self) -> SearchResult {
2556        let query = self.selection.select("asSearchResult");
2557        SearchResult {
2558            proc: self.proc.clone(),
2559            selection: query,
2560            graphql_client: self.graphql_client.clone(),
2561        }
2562    }
2563    /// Retrieve the binding value, as type SearchSubmatch
2564    pub fn as_search_submatch(&self) -> SearchSubmatch {
2565        let query = self.selection.select("asSearchSubmatch");
2566        SearchSubmatch {
2567            proc: self.proc.clone(),
2568            selection: query,
2569            graphql_client: self.graphql_client.clone(),
2570        }
2571    }
2572    /// Retrieve the binding value, as type Secret
2573    pub fn as_secret(&self) -> Secret {
2574        let query = self.selection.select("asSecret");
2575        Secret {
2576            proc: self.proc.clone(),
2577            selection: query,
2578            graphql_client: self.graphql_client.clone(),
2579        }
2580    }
2581    /// Retrieve the binding value, as type Service
2582    pub fn as_service(&self) -> Service {
2583        let query = self.selection.select("asService");
2584        Service {
2585            proc: self.proc.clone(),
2586            selection: query,
2587            graphql_client: self.graphql_client.clone(),
2588        }
2589    }
2590    /// Retrieve the binding value, as type Socket
2591    pub fn as_socket(&self) -> Socket {
2592        let query = self.selection.select("asSocket");
2593        Socket {
2594            proc: self.proc.clone(),
2595            selection: query,
2596            graphql_client: self.graphql_client.clone(),
2597        }
2598    }
2599    /// Retrieve the binding value, as type Stat
2600    pub fn as_stat(&self) -> Stat {
2601        let query = self.selection.select("asStat");
2602        Stat {
2603            proc: self.proc.clone(),
2604            selection: query,
2605            graphql_client: self.graphql_client.clone(),
2606        }
2607    }
2608    /// Returns the binding's string value
2609    pub async fn as_string(&self) -> Result<String, DaggerError> {
2610        let query = self.selection.select("asString");
2611        query.execute(self.graphql_client.clone()).await
2612    }
2613    /// Retrieve the binding value, as type Up
2614    pub fn as_up(&self) -> Up {
2615        let query = self.selection.select("asUp");
2616        Up {
2617            proc: self.proc.clone(),
2618            selection: query,
2619            graphql_client: self.graphql_client.clone(),
2620        }
2621    }
2622    /// Retrieve the binding value, as type UpGroup
2623    pub fn as_up_group(&self) -> UpGroup {
2624        let query = self.selection.select("asUpGroup");
2625        UpGroup {
2626            proc: self.proc.clone(),
2627            selection: query,
2628            graphql_client: self.graphql_client.clone(),
2629        }
2630    }
2631    /// Retrieve the binding value, as type Workspace
2632    pub fn as_workspace(&self) -> Workspace {
2633        let query = self.selection.select("asWorkspace");
2634        Workspace {
2635            proc: self.proc.clone(),
2636            selection: query,
2637            graphql_client: self.graphql_client.clone(),
2638        }
2639    }
2640    /// Returns the digest of the binding value
2641    pub async fn digest(&self) -> Result<String, DaggerError> {
2642        let query = self.selection.select("digest");
2643        query.execute(self.graphql_client.clone()).await
2644    }
2645    /// A unique identifier for this Binding.
2646    pub async fn id(&self) -> Result<BindingId, DaggerError> {
2647        let query = self.selection.select("id");
2648        query.execute(self.graphql_client.clone()).await
2649    }
2650    /// Returns true if the binding is null
2651    pub async fn is_null(&self) -> Result<bool, DaggerError> {
2652        let query = self.selection.select("isNull");
2653        query.execute(self.graphql_client.clone()).await
2654    }
2655    /// Returns the binding name
2656    pub async fn name(&self) -> Result<String, DaggerError> {
2657        let query = self.selection.select("name");
2658        query.execute(self.graphql_client.clone()).await
2659    }
2660    /// Returns the binding type
2661    pub async fn type_name(&self) -> Result<String, DaggerError> {
2662        let query = self.selection.select("typeName");
2663        query.execute(self.graphql_client.clone()).await
2664    }
2665}
2666#[derive(Clone)]
2667pub struct CacheVolume {
2668    pub proc: Option<Arc<DaggerSessionProc>>,
2669    pub selection: Selection,
2670    pub graphql_client: DynGraphQLClient,
2671}
2672impl CacheVolume {
2673    /// A unique identifier for this CacheVolume.
2674    pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
2675        let query = self.selection.select("id");
2676        query.execute(self.graphql_client.clone()).await
2677    }
2678}
2679#[derive(Clone)]
2680pub struct Changeset {
2681    pub proc: Option<Arc<DaggerSessionProc>>,
2682    pub selection: Selection,
2683    pub graphql_client: DynGraphQLClient,
2684}
2685#[derive(Builder, Debug, PartialEq)]
2686pub struct ChangesetWithChangesetOpts {
2687    /// What to do on a merge conflict
2688    #[builder(setter(into, strip_option), default)]
2689    pub on_conflict: Option<ChangesetMergeConflict>,
2690}
2691#[derive(Builder, Debug, PartialEq)]
2692pub struct ChangesetWithChangesetsOpts {
2693    /// What to do on a merge conflict
2694    #[builder(setter(into, strip_option), default)]
2695    pub on_conflict: Option<ChangesetsMergeConflict>,
2696}
2697impl Changeset {
2698    /// Files and directories that were added in the newer directory.
2699    pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2700        let query = self.selection.select("addedPaths");
2701        query.execute(self.graphql_client.clone()).await
2702    }
2703    /// The newer/upper snapshot.
2704    pub fn after(&self) -> Directory {
2705        let query = self.selection.select("after");
2706        Directory {
2707            proc: self.proc.clone(),
2708            selection: query,
2709            graphql_client: self.graphql_client.clone(),
2710        }
2711    }
2712    /// Return a Git-compatible patch of the changes
2713    pub fn as_patch(&self) -> File {
2714        let query = self.selection.select("asPatch");
2715        File {
2716            proc: self.proc.clone(),
2717            selection: query,
2718            graphql_client: self.graphql_client.clone(),
2719        }
2720    }
2721    /// The older/lower snapshot to compare against.
2722    pub fn before(&self) -> Directory {
2723        let query = self.selection.select("before");
2724        Directory {
2725            proc: self.proc.clone(),
2726            selection: query,
2727            graphql_client: self.graphql_client.clone(),
2728        }
2729    }
2730    /// Structured per-path diff statistics (kind and line counts) for this changeset.
2731    pub fn diff_stats(&self) -> Vec<DiffStat> {
2732        let query = self.selection.select("diffStats");
2733        vec![DiffStat {
2734            proc: self.proc.clone(),
2735            selection: query,
2736            graphql_client: self.graphql_client.clone(),
2737        }]
2738    }
2739    /// Applies the diff represented by this changeset to a path on the host.
2740    ///
2741    /// # Arguments
2742    ///
2743    /// * `path` - Location of the copied directory (e.g., "logs/").
2744    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2745        let mut query = self.selection.select("export");
2746        query = query.arg("path", path.into());
2747        query.execute(self.graphql_client.clone()).await
2748    }
2749    /// A unique identifier for this Changeset.
2750    pub async fn id(&self) -> Result<ChangesetId, DaggerError> {
2751        let query = self.selection.select("id");
2752        query.execute(self.graphql_client.clone()).await
2753    }
2754    /// Returns true if the changeset is empty (i.e. there are no changes).
2755    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
2756        let query = self.selection.select("isEmpty");
2757        query.execute(self.graphql_client.clone()).await
2758    }
2759    /// Return a snapshot containing only the created and modified files
2760    pub fn layer(&self) -> Directory {
2761        let query = self.selection.select("layer");
2762        Directory {
2763            proc: self.proc.clone(),
2764            selection: query,
2765            graphql_client: self.graphql_client.clone(),
2766        }
2767    }
2768    /// Files and directories that existed before and were updated in the newer directory.
2769    pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2770        let query = self.selection.select("modifiedPaths");
2771        query.execute(self.graphql_client.clone()).await
2772    }
2773    /// Files and directories that were removed. Directories are indicated by a trailing slash, and their child paths are not included.
2774    pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2775        let query = self.selection.select("removedPaths");
2776        query.execute(self.graphql_client.clone()).await
2777    }
2778    /// Force evaluation in the engine.
2779    pub async fn sync(&self) -> Result<ChangesetId, DaggerError> {
2780        let query = self.selection.select("sync");
2781        query.execute(self.graphql_client.clone()).await
2782    }
2783    /// Add changes to an existing changeset
2784    /// 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
2785    ///
2786    /// # Arguments
2787    ///
2788    /// * `changes` - Changes to merge into the actual changeset
2789    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2790    pub fn with_changeset(&self, changes: impl IntoID<ChangesetId>) -> Changeset {
2791        let mut query = self.selection.select("withChangeset");
2792        query = query.arg_lazy(
2793            "changes",
2794            Box::new(move || {
2795                let changes = changes.clone();
2796                Box::pin(async move { changes.into_id().await.unwrap().quote() })
2797            }),
2798        );
2799        Changeset {
2800            proc: self.proc.clone(),
2801            selection: query,
2802            graphql_client: self.graphql_client.clone(),
2803        }
2804    }
2805    /// Add changes to an existing changeset
2806    /// 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
2807    ///
2808    /// # Arguments
2809    ///
2810    /// * `changes` - Changes to merge into the actual changeset
2811    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2812    pub fn with_changeset_opts(
2813        &self,
2814        changes: impl IntoID<ChangesetId>,
2815        opts: ChangesetWithChangesetOpts,
2816    ) -> Changeset {
2817        let mut query = self.selection.select("withChangeset");
2818        query = query.arg_lazy(
2819            "changes",
2820            Box::new(move || {
2821                let changes = changes.clone();
2822                Box::pin(async move { changes.into_id().await.unwrap().quote() })
2823            }),
2824        );
2825        if let Some(on_conflict) = opts.on_conflict {
2826            query = query.arg("onConflict", on_conflict);
2827        }
2828        Changeset {
2829            proc: self.proc.clone(),
2830            selection: query,
2831            graphql_client: self.graphql_client.clone(),
2832        }
2833    }
2834    /// Add changes from multiple changesets using git octopus merge strategy
2835    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
2836    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
2837    ///
2838    /// # Arguments
2839    ///
2840    /// * `changes` - List of changesets to merge into the actual changeset
2841    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2842    pub fn with_changesets(&self, changes: Vec<ChangesetId>) -> Changeset {
2843        let mut query = self.selection.select("withChangesets");
2844        query = query.arg("changes", changes);
2845        Changeset {
2846            proc: self.proc.clone(),
2847            selection: query,
2848            graphql_client: self.graphql_client.clone(),
2849        }
2850    }
2851    /// Add changes from multiple changesets using git octopus merge strategy
2852    /// This is more efficient than chaining multiple withChangeset calls when merging many changesets.
2853    /// Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
2854    ///
2855    /// # Arguments
2856    ///
2857    /// * `changes` - List of changesets to merge into the actual changeset
2858    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2859    pub fn with_changesets_opts(
2860        &self,
2861        changes: Vec<ChangesetId>,
2862        opts: ChangesetWithChangesetsOpts,
2863    ) -> Changeset {
2864        let mut query = self.selection.select("withChangesets");
2865        query = query.arg("changes", changes);
2866        if let Some(on_conflict) = opts.on_conflict {
2867            query = query.arg("onConflict", on_conflict);
2868        }
2869        Changeset {
2870            proc: self.proc.clone(),
2871            selection: query,
2872            graphql_client: self.graphql_client.clone(),
2873        }
2874    }
2875}
2876#[derive(Clone)]
2877pub struct Check {
2878    pub proc: Option<Arc<DaggerSessionProc>>,
2879    pub selection: Selection,
2880    pub graphql_client: DynGraphQLClient,
2881}
2882impl Check {
2883    /// Whether the check completed
2884    pub async fn completed(&self) -> Result<bool, DaggerError> {
2885        let query = self.selection.select("completed");
2886        query.execute(self.graphql_client.clone()).await
2887    }
2888    /// The description of the check
2889    pub async fn description(&self) -> Result<String, DaggerError> {
2890        let query = self.selection.select("description");
2891        query.execute(self.graphql_client.clone()).await
2892    }
2893    /// If the check failed, this is the error
2894    pub fn error(&self) -> Error {
2895        let query = self.selection.select("error");
2896        Error {
2897            proc: self.proc.clone(),
2898            selection: query,
2899            graphql_client: self.graphql_client.clone(),
2900        }
2901    }
2902    /// A unique identifier for this Check.
2903    pub async fn id(&self) -> Result<CheckId, DaggerError> {
2904        let query = self.selection.select("id");
2905        query.execute(self.graphql_client.clone()).await
2906    }
2907    /// Return the fully qualified name of the check
2908    pub async fn name(&self) -> Result<String, DaggerError> {
2909        let query = self.selection.select("name");
2910        query.execute(self.graphql_client.clone()).await
2911    }
2912    /// The original module in which the check has been defined
2913    pub fn original_module(&self) -> Module {
2914        let query = self.selection.select("originalModule");
2915        Module {
2916            proc: self.proc.clone(),
2917            selection: query,
2918            graphql_client: self.graphql_client.clone(),
2919        }
2920    }
2921    /// Whether the check passed
2922    pub async fn passed(&self) -> Result<bool, DaggerError> {
2923        let query = self.selection.select("passed");
2924        query.execute(self.graphql_client.clone()).await
2925    }
2926    /// The path of the check within its module
2927    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
2928        let query = self.selection.select("path");
2929        query.execute(self.graphql_client.clone()).await
2930    }
2931    /// An emoji representing the result of the check
2932    pub async fn result_emoji(&self) -> Result<String, DaggerError> {
2933        let query = self.selection.select("resultEmoji");
2934        query.execute(self.graphql_client.clone()).await
2935    }
2936    /// Execute the check
2937    pub fn run(&self) -> Check {
2938        let query = self.selection.select("run");
2939        Check {
2940            proc: self.proc.clone(),
2941            selection: query,
2942            graphql_client: self.graphql_client.clone(),
2943        }
2944    }
2945}
2946#[derive(Clone)]
2947pub struct CheckGroup {
2948    pub proc: Option<Arc<DaggerSessionProc>>,
2949    pub selection: Selection,
2950    pub graphql_client: DynGraphQLClient,
2951}
2952#[derive(Builder, Debug, PartialEq)]
2953pub struct CheckGroupRunOpts {
2954    /// If true, stop running checks as soon as any check fails.
2955    #[builder(setter(into, strip_option), default)]
2956    pub fail_fast: Option<bool>,
2957}
2958impl CheckGroup {
2959    /// A unique identifier for this CheckGroup.
2960    pub async fn id(&self) -> Result<CheckGroupId, DaggerError> {
2961        let query = self.selection.select("id");
2962        query.execute(self.graphql_client.clone()).await
2963    }
2964    /// Return a list of individual checks and their details
2965    pub fn list(&self) -> Vec<Check> {
2966        let query = self.selection.select("list");
2967        vec![Check {
2968            proc: self.proc.clone(),
2969            selection: query,
2970            graphql_client: self.graphql_client.clone(),
2971        }]
2972    }
2973    /// Generate a markdown report
2974    pub fn report(&self) -> File {
2975        let query = self.selection.select("report");
2976        File {
2977            proc: self.proc.clone(),
2978            selection: query,
2979            graphql_client: self.graphql_client.clone(),
2980        }
2981    }
2982    /// Execute all selected checks
2983    ///
2984    /// # Arguments
2985    ///
2986    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2987    pub fn run(&self) -> CheckGroup {
2988        let query = self.selection.select("run");
2989        CheckGroup {
2990            proc: self.proc.clone(),
2991            selection: query,
2992            graphql_client: self.graphql_client.clone(),
2993        }
2994    }
2995    /// Execute all selected checks
2996    ///
2997    /// # Arguments
2998    ///
2999    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3000    pub fn run_opts(&self, opts: CheckGroupRunOpts) -> CheckGroup {
3001        let mut query = self.selection.select("run");
3002        if let Some(fail_fast) = opts.fail_fast {
3003            query = query.arg("failFast", fail_fast);
3004        }
3005        CheckGroup {
3006            proc: self.proc.clone(),
3007            selection: query,
3008            graphql_client: self.graphql_client.clone(),
3009        }
3010    }
3011}
3012#[derive(Clone)]
3013pub struct Cloud {
3014    pub proc: Option<Arc<DaggerSessionProc>>,
3015    pub selection: Selection,
3016    pub graphql_client: DynGraphQLClient,
3017}
3018impl Cloud {
3019    /// A unique identifier for this Cloud.
3020    pub async fn id(&self) -> Result<CloudId, DaggerError> {
3021        let query = self.selection.select("id");
3022        query.execute(self.graphql_client.clone()).await
3023    }
3024    /// The trace URL for the current session
3025    pub async fn trace_url(&self) -> Result<String, DaggerError> {
3026        let query = self.selection.select("traceURL");
3027        query.execute(self.graphql_client.clone()).await
3028    }
3029}
3030#[derive(Clone)]
3031pub struct Container {
3032    pub proc: Option<Arc<DaggerSessionProc>>,
3033    pub selection: Selection,
3034    pub graphql_client: DynGraphQLClient,
3035}
3036#[derive(Builder, Debug, PartialEq)]
3037pub struct ContainerAsServiceOpts<'a> {
3038    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
3039    /// If empty, the container's default command is used.
3040    #[builder(setter(into, strip_option), default)]
3041    pub args: Option<Vec<&'a str>>,
3042    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3043    #[builder(setter(into, strip_option), default)]
3044    pub expand: Option<bool>,
3045    /// Provides Dagger access to the executed command.
3046    #[builder(setter(into, strip_option), default)]
3047    pub experimental_privileged_nesting: Option<bool>,
3048    /// 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.
3049    #[builder(setter(into, strip_option), default)]
3050    pub insecure_root_capabilities: Option<bool>,
3051    /// If set, skip the automatic init process injected into containers by default.
3052    /// 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.
3053    #[builder(setter(into, strip_option), default)]
3054    pub no_init: Option<bool>,
3055    /// If the container has an entrypoint, prepend it to the args.
3056    #[builder(setter(into, strip_option), default)]
3057    pub use_entrypoint: Option<bool>,
3058}
3059#[derive(Builder, Debug, PartialEq)]
3060pub struct ContainerAsTarballOpts {
3061    /// Force each layer of the image to use the specified compression algorithm.
3062    /// 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.
3063    #[builder(setter(into, strip_option), default)]
3064    pub forced_compression: Option<ImageLayerCompression>,
3065    /// Use the specified media types for the image's layers.
3066    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
3067    #[builder(setter(into, strip_option), default)]
3068    pub media_types: Option<ImageMediaTypes>,
3069    /// Identifiers for other platform specific containers.
3070    /// Used for multi-platform images.
3071    #[builder(setter(into, strip_option), default)]
3072    pub platform_variants: Option<Vec<ContainerId>>,
3073}
3074#[derive(Builder, Debug, PartialEq)]
3075pub struct ContainerDirectoryOpts {
3076    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3077    #[builder(setter(into, strip_option), default)]
3078    pub expand: Option<bool>,
3079}
3080#[derive(Builder, Debug, PartialEq)]
3081pub struct ContainerExistsOpts {
3082    /// If specified, do not follow symlinks.
3083    #[builder(setter(into, strip_option), default)]
3084    pub do_not_follow_symlinks: Option<bool>,
3085    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
3086    #[builder(setter(into, strip_option), default)]
3087    pub expected_type: Option<ExistsType>,
3088}
3089#[derive(Builder, Debug, PartialEq)]
3090pub struct ContainerExportOpts {
3091    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3092    #[builder(setter(into, strip_option), default)]
3093    pub expand: Option<bool>,
3094    /// Force each layer of the exported image to use the specified compression algorithm.
3095    /// 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.
3096    #[builder(setter(into, strip_option), default)]
3097    pub forced_compression: Option<ImageLayerCompression>,
3098    /// Use the specified media types for the exported image's layers.
3099    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
3100    #[builder(setter(into, strip_option), default)]
3101    pub media_types: Option<ImageMediaTypes>,
3102    /// Identifiers for other platform specific containers.
3103    /// Used for multi-platform image.
3104    #[builder(setter(into, strip_option), default)]
3105    pub platform_variants: Option<Vec<ContainerId>>,
3106}
3107#[derive(Builder, Debug, PartialEq)]
3108pub struct ContainerExportImageOpts {
3109    /// Force each layer of the exported image to use the specified compression algorithm.
3110    /// 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.
3111    #[builder(setter(into, strip_option), default)]
3112    pub forced_compression: Option<ImageLayerCompression>,
3113    /// Use the specified media types for the exported image's layers.
3114    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
3115    #[builder(setter(into, strip_option), default)]
3116    pub media_types: Option<ImageMediaTypes>,
3117    /// Identifiers for other platform specific containers.
3118    /// Used for multi-platform image.
3119    #[builder(setter(into, strip_option), default)]
3120    pub platform_variants: Option<Vec<ContainerId>>,
3121}
3122#[derive(Builder, Debug, PartialEq)]
3123pub struct ContainerFileOpts {
3124    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3125    #[builder(setter(into, strip_option), default)]
3126    pub expand: Option<bool>,
3127}
3128#[derive(Builder, Debug, PartialEq)]
3129pub struct ContainerImportOpts<'a> {
3130    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
3131    #[builder(setter(into, strip_option), default)]
3132    pub tag: Option<&'a str>,
3133}
3134#[derive(Builder, Debug, PartialEq)]
3135pub struct ContainerPublishOpts {
3136    /// Force each layer of the published image to use the specified compression algorithm.
3137    /// 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.
3138    #[builder(setter(into, strip_option), default)]
3139    pub forced_compression: Option<ImageLayerCompression>,
3140    /// Use the specified media types for the published image's layers.
3141    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
3142    #[builder(setter(into, strip_option), default)]
3143    pub media_types: Option<ImageMediaTypes>,
3144    /// Identifiers for other platform specific containers.
3145    /// Used for multi-platform image.
3146    #[builder(setter(into, strip_option), default)]
3147    pub platform_variants: Option<Vec<ContainerId>>,
3148}
3149#[derive(Builder, Debug, PartialEq)]
3150pub struct ContainerStatOpts {
3151    /// If specified, do not follow symlinks.
3152    #[builder(setter(into, strip_option), default)]
3153    pub do_not_follow_symlinks: Option<bool>,
3154}
3155#[derive(Builder, Debug, PartialEq)]
3156pub struct ContainerTerminalOpts<'a> {
3157    /// If set, override the container's default terminal command and invoke these command arguments instead.
3158    #[builder(setter(into, strip_option), default)]
3159    pub cmd: Option<Vec<&'a str>>,
3160    /// Provides Dagger access to the executed command.
3161    #[builder(setter(into, strip_option), default)]
3162    pub experimental_privileged_nesting: Option<bool>,
3163    /// 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.
3164    #[builder(setter(into, strip_option), default)]
3165    pub insecure_root_capabilities: Option<bool>,
3166}
3167#[derive(Builder, Debug, PartialEq)]
3168pub struct ContainerUpOpts<'a> {
3169    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
3170    /// If empty, the container's default command is used.
3171    #[builder(setter(into, strip_option), default)]
3172    pub args: Option<Vec<&'a str>>,
3173    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3174    #[builder(setter(into, strip_option), default)]
3175    pub expand: Option<bool>,
3176    /// Provides Dagger access to the executed command.
3177    #[builder(setter(into, strip_option), default)]
3178    pub experimental_privileged_nesting: Option<bool>,
3179    /// 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.
3180    #[builder(setter(into, strip_option), default)]
3181    pub insecure_root_capabilities: Option<bool>,
3182    /// If set, skip the automatic init process injected into containers by default.
3183    /// 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.
3184    #[builder(setter(into, strip_option), default)]
3185    pub no_init: Option<bool>,
3186    /// List of frontend/backend port mappings to forward.
3187    /// Frontend is the port accepting traffic on the host, backend is the service port.
3188    #[builder(setter(into, strip_option), default)]
3189    pub ports: Option<Vec<PortForward>>,
3190    /// Bind each tunnel port to a random port on the host.
3191    #[builder(setter(into, strip_option), default)]
3192    pub random: Option<bool>,
3193    /// If the container has an entrypoint, prepend it to the args.
3194    #[builder(setter(into, strip_option), default)]
3195    pub use_entrypoint: Option<bool>,
3196}
3197#[derive(Builder, Debug, PartialEq)]
3198pub struct ContainerWithDefaultTerminalCmdOpts {
3199    /// Provides Dagger access to the executed command.
3200    #[builder(setter(into, strip_option), default)]
3201    pub experimental_privileged_nesting: Option<bool>,
3202    /// 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.
3203    #[builder(setter(into, strip_option), default)]
3204    pub insecure_root_capabilities: Option<bool>,
3205}
3206#[derive(Builder, Debug, PartialEq)]
3207pub struct ContainerWithDirectoryOpts<'a> {
3208    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
3209    #[builder(setter(into, strip_option), default)]
3210    pub exclude: Option<Vec<&'a str>>,
3211    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3212    #[builder(setter(into, strip_option), default)]
3213    pub expand: Option<bool>,
3214    /// Apply .gitignore rules when writing the directory.
3215    #[builder(setter(into, strip_option), default)]
3216    pub gitignore: Option<bool>,
3217    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
3218    #[builder(setter(into, strip_option), default)]
3219    pub include: Option<Vec<&'a str>>,
3220    /// A user:group to set for the directory and its contents.
3221    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3222    /// If the group is omitted, it defaults to the same as the user.
3223    #[builder(setter(into, strip_option), default)]
3224    pub owner: Option<&'a str>,
3225}
3226#[derive(Builder, Debug, PartialEq)]
3227pub struct ContainerWithDockerHealthcheckOpts<'a> {
3228    /// Interval between running healthcheck. Example: "30s"
3229    #[builder(setter(into, strip_option), default)]
3230    pub interval: Option<&'a str>,
3231    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example: "3"
3232    #[builder(setter(into, strip_option), default)]
3233    pub retries: Option<isize>,
3234    /// When true, command must be a single element, which is run using the container's shell
3235    #[builder(setter(into, strip_option), default)]
3236    pub shell: Option<bool>,
3237    /// StartInterval configures the duration between checks during the startup phase. Example: "5s"
3238    #[builder(setter(into, strip_option), default)]
3239    pub start_interval: Option<&'a str>,
3240    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example: "0s"
3241    #[builder(setter(into, strip_option), default)]
3242    pub start_period: Option<&'a str>,
3243    /// Healthcheck timeout. Example: "3s"
3244    #[builder(setter(into, strip_option), default)]
3245    pub timeout: Option<&'a str>,
3246}
3247#[derive(Builder, Debug, PartialEq)]
3248pub struct ContainerWithEntrypointOpts {
3249    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
3250    #[builder(setter(into, strip_option), default)]
3251    pub keep_default_args: Option<bool>,
3252}
3253#[derive(Builder, Debug, PartialEq)]
3254pub struct ContainerWithEnvVariableOpts {
3255    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
3256    #[builder(setter(into, strip_option), default)]
3257    pub expand: Option<bool>,
3258}
3259#[derive(Builder, Debug, PartialEq)]
3260pub struct ContainerWithExecOpts<'a> {
3261    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3262    #[builder(setter(into, strip_option), default)]
3263    pub expand: Option<bool>,
3264    /// Exit codes this command is allowed to exit with without error
3265    #[builder(setter(into, strip_option), default)]
3266    pub expect: Option<ReturnType>,
3267    /// Provides Dagger access to the executed command.
3268    #[builder(setter(into, strip_option), default)]
3269    pub experimental_privileged_nesting: Option<bool>,
3270    /// Execute the command with all root capabilities. Like --privileged in Docker
3271    /// 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.
3272    #[builder(setter(into, strip_option), default)]
3273    pub insecure_root_capabilities: Option<bool>,
3274    /// Skip the automatic init process injected into containers by default.
3275    /// 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.
3276    #[builder(setter(into, strip_option), default)]
3277    pub no_init: Option<bool>,
3278    /// Redirect the command's standard error to a file in the container. Example: "./stderr.txt"
3279    #[builder(setter(into, strip_option), default)]
3280    pub redirect_stderr: Option<&'a str>,
3281    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
3282    #[builder(setter(into, strip_option), default)]
3283    pub redirect_stdin: Option<&'a str>,
3284    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
3285    #[builder(setter(into, strip_option), default)]
3286    pub redirect_stdout: Option<&'a str>,
3287    /// Content to write to the command's standard input. Example: "Hello world")
3288    #[builder(setter(into, strip_option), default)]
3289    pub stdin: Option<&'a str>,
3290    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
3291    #[builder(setter(into, strip_option), default)]
3292    pub use_entrypoint: Option<bool>,
3293}
3294#[derive(Builder, Debug, PartialEq)]
3295pub struct ContainerWithExposedPortOpts<'a> {
3296    /// Port description. Example: "payment API endpoint"
3297    #[builder(setter(into, strip_option), default)]
3298    pub description: Option<&'a str>,
3299    /// Skip the health check when run as a service.
3300    #[builder(setter(into, strip_option), default)]
3301    pub experimental_skip_healthcheck: Option<bool>,
3302    /// Network protocol. Example: "tcp"
3303    #[builder(setter(into, strip_option), default)]
3304    pub protocol: Option<NetworkProtocol>,
3305}
3306#[derive(Builder, Debug, PartialEq)]
3307pub struct ContainerWithFileOpts<'a> {
3308    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3309    #[builder(setter(into, strip_option), default)]
3310    pub expand: Option<bool>,
3311    /// A user:group to set for the file.
3312    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3313    /// If the group is omitted, it defaults to the same as the user.
3314    #[builder(setter(into, strip_option), default)]
3315    pub owner: Option<&'a str>,
3316    /// Permissions of the new file. Example: 0600
3317    #[builder(setter(into, strip_option), default)]
3318    pub permissions: Option<isize>,
3319}
3320#[derive(Builder, Debug, PartialEq)]
3321pub struct ContainerWithFilesOpts<'a> {
3322    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3323    #[builder(setter(into, strip_option), default)]
3324    pub expand: Option<bool>,
3325    /// A user:group to set for the files.
3326    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3327    /// If the group is omitted, it defaults to the same as the user.
3328    #[builder(setter(into, strip_option), default)]
3329    pub owner: Option<&'a str>,
3330    /// Permission given to the copied files (e.g., 0600).
3331    #[builder(setter(into, strip_option), default)]
3332    pub permissions: Option<isize>,
3333}
3334#[derive(Builder, Debug, PartialEq)]
3335pub struct ContainerWithMountedCacheOpts<'a> {
3336    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3337    #[builder(setter(into, strip_option), default)]
3338    pub expand: Option<bool>,
3339    /// A user:group to set for the mounted cache directory.
3340    /// 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.
3341    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3342    /// If the group is omitted, it defaults to the same as the user.
3343    #[builder(setter(into, strip_option), default)]
3344    pub owner: Option<&'a str>,
3345    /// Sharing mode of the cache volume.
3346    #[builder(setter(into, strip_option), default)]
3347    pub sharing: Option<CacheSharingMode>,
3348    /// Identifier of the directory to use as the cache volume's root.
3349    #[builder(setter(into, strip_option), default)]
3350    pub source: Option<DirectoryId>,
3351}
3352#[derive(Builder, Debug, PartialEq)]
3353pub struct ContainerWithMountedDirectoryOpts<'a> {
3354    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3355    #[builder(setter(into, strip_option), default)]
3356    pub expand: Option<bool>,
3357    /// A user:group to set for the mounted directory and its contents.
3358    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3359    /// If the group is omitted, it defaults to the same as the user.
3360    #[builder(setter(into, strip_option), default)]
3361    pub owner: Option<&'a str>,
3362}
3363#[derive(Builder, Debug, PartialEq)]
3364pub struct ContainerWithMountedFileOpts<'a> {
3365    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3366    #[builder(setter(into, strip_option), default)]
3367    pub expand: Option<bool>,
3368    /// A user or user:group to set for the mounted file.
3369    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3370    /// If the group is omitted, it defaults to the same as the user.
3371    #[builder(setter(into, strip_option), default)]
3372    pub owner: Option<&'a str>,
3373}
3374#[derive(Builder, Debug, PartialEq)]
3375pub struct ContainerWithMountedSecretOpts<'a> {
3376    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3377    #[builder(setter(into, strip_option), default)]
3378    pub expand: Option<bool>,
3379    /// Permission given to the mounted secret (e.g., 0600).
3380    /// This option requires an owner to be set to be active.
3381    #[builder(setter(into, strip_option), default)]
3382    pub mode: Option<isize>,
3383    /// A user:group to set for the mounted secret.
3384    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3385    /// If the group is omitted, it defaults to the same as the user.
3386    #[builder(setter(into, strip_option), default)]
3387    pub owner: Option<&'a str>,
3388}
3389#[derive(Builder, Debug, PartialEq)]
3390pub struct ContainerWithMountedTempOpts {
3391    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3392    #[builder(setter(into, strip_option), default)]
3393    pub expand: Option<bool>,
3394    /// Size of the temporary directory in bytes.
3395    #[builder(setter(into, strip_option), default)]
3396    pub size: Option<isize>,
3397}
3398#[derive(Builder, Debug, PartialEq)]
3399pub struct ContainerWithNewFileOpts<'a> {
3400    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3401    #[builder(setter(into, strip_option), default)]
3402    pub expand: Option<bool>,
3403    /// A user:group to set for the file.
3404    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3405    /// If the group is omitted, it defaults to the same as the user.
3406    #[builder(setter(into, strip_option), default)]
3407    pub owner: Option<&'a str>,
3408    /// Permissions of the new file. Example: 0600
3409    #[builder(setter(into, strip_option), default)]
3410    pub permissions: Option<isize>,
3411}
3412#[derive(Builder, Debug, PartialEq)]
3413pub struct ContainerWithSymlinkOpts {
3414    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3415    #[builder(setter(into, strip_option), default)]
3416    pub expand: Option<bool>,
3417}
3418#[derive(Builder, Debug, PartialEq)]
3419pub struct ContainerWithUnixSocketOpts<'a> {
3420    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3421    #[builder(setter(into, strip_option), default)]
3422    pub expand: Option<bool>,
3423    /// A user:group to set for the mounted socket.
3424    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
3425    /// If the group is omitted, it defaults to the same as the user.
3426    #[builder(setter(into, strip_option), default)]
3427    pub owner: Option<&'a str>,
3428}
3429#[derive(Builder, Debug, PartialEq)]
3430pub struct ContainerWithWorkdirOpts {
3431    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3432    #[builder(setter(into, strip_option), default)]
3433    pub expand: Option<bool>,
3434}
3435#[derive(Builder, Debug, PartialEq)]
3436pub struct ContainerWithoutDirectoryOpts {
3437    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3438    #[builder(setter(into, strip_option), default)]
3439    pub expand: Option<bool>,
3440}
3441#[derive(Builder, Debug, PartialEq)]
3442pub struct ContainerWithoutEntrypointOpts {
3443    /// Don't remove the default arguments when unsetting the entrypoint.
3444    #[builder(setter(into, strip_option), default)]
3445    pub keep_default_args: Option<bool>,
3446}
3447#[derive(Builder, Debug, PartialEq)]
3448pub struct ContainerWithoutExposedPortOpts {
3449    /// Port protocol to unexpose
3450    #[builder(setter(into, strip_option), default)]
3451    pub protocol: Option<NetworkProtocol>,
3452}
3453#[derive(Builder, Debug, PartialEq)]
3454pub struct ContainerWithoutFileOpts {
3455    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3456    #[builder(setter(into, strip_option), default)]
3457    pub expand: Option<bool>,
3458}
3459#[derive(Builder, Debug, PartialEq)]
3460pub struct ContainerWithoutFilesOpts {
3461    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
3462    #[builder(setter(into, strip_option), default)]
3463    pub expand: Option<bool>,
3464}
3465#[derive(Builder, Debug, PartialEq)]
3466pub struct ContainerWithoutMountOpts {
3467    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3468    #[builder(setter(into, strip_option), default)]
3469    pub expand: Option<bool>,
3470}
3471#[derive(Builder, Debug, PartialEq)]
3472pub struct ContainerWithoutUnixSocketOpts {
3473    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
3474    #[builder(setter(into, strip_option), default)]
3475    pub expand: Option<bool>,
3476}
3477impl Container {
3478    /// Turn the container into a Service.
3479    /// Be sure to set any exposed ports before this conversion.
3480    ///
3481    /// # Arguments
3482    ///
3483    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3484    pub fn as_service(&self) -> Service {
3485        let query = self.selection.select("asService");
3486        Service {
3487            proc: self.proc.clone(),
3488            selection: query,
3489            graphql_client: self.graphql_client.clone(),
3490        }
3491    }
3492    /// Turn the container into a Service.
3493    /// Be sure to set any exposed ports before this conversion.
3494    ///
3495    /// # Arguments
3496    ///
3497    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3498    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
3499        let mut query = self.selection.select("asService");
3500        if let Some(args) = opts.args {
3501            query = query.arg("args", args);
3502        }
3503        if let Some(use_entrypoint) = opts.use_entrypoint {
3504            query = query.arg("useEntrypoint", use_entrypoint);
3505        }
3506        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3507            query = query.arg(
3508                "experimentalPrivilegedNesting",
3509                experimental_privileged_nesting,
3510            );
3511        }
3512        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3513            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3514        }
3515        if let Some(expand) = opts.expand {
3516            query = query.arg("expand", expand);
3517        }
3518        if let Some(no_init) = opts.no_init {
3519            query = query.arg("noInit", no_init);
3520        }
3521        Service {
3522            proc: self.proc.clone(),
3523            selection: query,
3524            graphql_client: self.graphql_client.clone(),
3525        }
3526    }
3527    /// Package the container state as an OCI image, and return it as a tar archive
3528    ///
3529    /// # Arguments
3530    ///
3531    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3532    pub fn as_tarball(&self) -> File {
3533        let query = self.selection.select("asTarball");
3534        File {
3535            proc: self.proc.clone(),
3536            selection: query,
3537            graphql_client: self.graphql_client.clone(),
3538        }
3539    }
3540    /// Package the container state as an OCI image, and return it as a tar archive
3541    ///
3542    /// # Arguments
3543    ///
3544    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3545    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
3546        let mut query = self.selection.select("asTarball");
3547        if let Some(platform_variants) = opts.platform_variants {
3548            query = query.arg("platformVariants", platform_variants);
3549        }
3550        if let Some(forced_compression) = opts.forced_compression {
3551            query = query.arg("forcedCompression", forced_compression);
3552        }
3553        if let Some(media_types) = opts.media_types {
3554            query = query.arg("mediaTypes", media_types);
3555        }
3556        File {
3557            proc: self.proc.clone(),
3558            selection: query,
3559            graphql_client: self.graphql_client.clone(),
3560        }
3561    }
3562    /// The combined buffered standard output and standard error stream of the last executed command
3563    /// Returns an error if no command was executed
3564    pub async fn combined_output(&self) -> Result<String, DaggerError> {
3565        let query = self.selection.select("combinedOutput");
3566        query.execute(self.graphql_client.clone()).await
3567    }
3568    /// Return the container's default arguments.
3569    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
3570        let query = self.selection.select("defaultArgs");
3571        query.execute(self.graphql_client.clone()).await
3572    }
3573    /// Retrieve a directory from the container's root filesystem
3574    /// Mounts are included.
3575    ///
3576    /// # Arguments
3577    ///
3578    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3579    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3580    pub fn directory(&self, path: impl Into<String>) -> Directory {
3581        let mut query = self.selection.select("directory");
3582        query = query.arg("path", path.into());
3583        Directory {
3584            proc: self.proc.clone(),
3585            selection: query,
3586            graphql_client: self.graphql_client.clone(),
3587        }
3588    }
3589    /// Retrieve a directory from the container's root filesystem
3590    /// Mounts are included.
3591    ///
3592    /// # Arguments
3593    ///
3594    /// * `path` - The path of the directory to retrieve (e.g., "./src").
3595    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3596    pub fn directory_opts(
3597        &self,
3598        path: impl Into<String>,
3599        opts: ContainerDirectoryOpts,
3600    ) -> Directory {
3601        let mut query = self.selection.select("directory");
3602        query = query.arg("path", path.into());
3603        if let Some(expand) = opts.expand {
3604            query = query.arg("expand", expand);
3605        }
3606        Directory {
3607            proc: self.proc.clone(),
3608            selection: query,
3609            graphql_client: self.graphql_client.clone(),
3610        }
3611    }
3612    /// Retrieves this container's configured docker healthcheck.
3613    pub fn docker_healthcheck(&self) -> HealthcheckConfig {
3614        let query = self.selection.select("dockerHealthcheck");
3615        HealthcheckConfig {
3616            proc: self.proc.clone(),
3617            selection: query,
3618            graphql_client: self.graphql_client.clone(),
3619        }
3620    }
3621    /// Return the container's OCI entrypoint.
3622    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
3623        let query = self.selection.select("entrypoint");
3624        query.execute(self.graphql_client.clone()).await
3625    }
3626    /// Retrieves the value of the specified environment variable.
3627    ///
3628    /// # Arguments
3629    ///
3630    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
3631    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3632        let mut query = self.selection.select("envVariable");
3633        query = query.arg("name", name.into());
3634        query.execute(self.graphql_client.clone()).await
3635    }
3636    /// Retrieves the list of environment variables passed to commands.
3637    pub fn env_variables(&self) -> Vec<EnvVariable> {
3638        let query = self.selection.select("envVariables");
3639        vec![EnvVariable {
3640            proc: self.proc.clone(),
3641            selection: query,
3642            graphql_client: self.graphql_client.clone(),
3643        }]
3644    }
3645    /// check if a file or directory exists
3646    ///
3647    /// # Arguments
3648    ///
3649    /// * `path` - Path to check (e.g., "/file.txt").
3650    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3651    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
3652        let mut query = self.selection.select("exists");
3653        query = query.arg("path", path.into());
3654        query.execute(self.graphql_client.clone()).await
3655    }
3656    /// check if a file or directory exists
3657    ///
3658    /// # Arguments
3659    ///
3660    /// * `path` - Path to check (e.g., "/file.txt").
3661    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3662    pub async fn exists_opts(
3663        &self,
3664        path: impl Into<String>,
3665        opts: ContainerExistsOpts,
3666    ) -> Result<bool, DaggerError> {
3667        let mut query = self.selection.select("exists");
3668        query = query.arg("path", path.into());
3669        if let Some(expected_type) = opts.expected_type {
3670            query = query.arg("expectedType", expected_type);
3671        }
3672        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
3673            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
3674        }
3675        query.execute(self.graphql_client.clone()).await
3676    }
3677    /// The exit code of the last executed command
3678    /// Returns an error if no command was executed
3679    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
3680        let query = self.selection.select("exitCode");
3681        query.execute(self.graphql_client.clone()).await
3682    }
3683    /// EXPERIMENTAL API! Subject to change/removal at any time.
3684    /// Configures all available GPUs on the host to be accessible to this container.
3685    /// This currently works for Nvidia devices only.
3686    pub fn experimental_with_all_gp_us(&self) -> Container {
3687        let query = self.selection.select("experimentalWithAllGPUs");
3688        Container {
3689            proc: self.proc.clone(),
3690            selection: query,
3691            graphql_client: self.graphql_client.clone(),
3692        }
3693    }
3694    /// EXPERIMENTAL API! Subject to change/removal at any time.
3695    /// Configures the provided list of devices to be accessible to this container.
3696    /// This currently works for Nvidia devices only.
3697    ///
3698    /// # Arguments
3699    ///
3700    /// * `devices` - List of devices to be accessible to this container.
3701    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
3702        let mut query = self.selection.select("experimentalWithGPU");
3703        query = query.arg(
3704            "devices",
3705            devices
3706                .into_iter()
3707                .map(|i| i.into())
3708                .collect::<Vec<String>>(),
3709        );
3710        Container {
3711            proc: self.proc.clone(),
3712            selection: query,
3713            graphql_client: self.graphql_client.clone(),
3714        }
3715    }
3716    /// Writes the container as an OCI tarball to the destination file path on the host.
3717    /// It can also export platform variants.
3718    ///
3719    /// # Arguments
3720    ///
3721    /// * `path` - Host's destination path (e.g., "./tarball").
3722    ///
3723    /// Path can be relative to the engine's workdir or absolute.
3724    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3725    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
3726        let mut query = self.selection.select("export");
3727        query = query.arg("path", path.into());
3728        query.execute(self.graphql_client.clone()).await
3729    }
3730    /// Writes the container as an OCI tarball to the destination file path on the host.
3731    /// It can also export platform variants.
3732    ///
3733    /// # Arguments
3734    ///
3735    /// * `path` - Host's destination path (e.g., "./tarball").
3736    ///
3737    /// Path can be relative to the engine's workdir or absolute.
3738    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3739    pub async fn export_opts(
3740        &self,
3741        path: impl Into<String>,
3742        opts: ContainerExportOpts,
3743    ) -> Result<String, DaggerError> {
3744        let mut query = self.selection.select("export");
3745        query = query.arg("path", path.into());
3746        if let Some(platform_variants) = opts.platform_variants {
3747            query = query.arg("platformVariants", platform_variants);
3748        }
3749        if let Some(forced_compression) = opts.forced_compression {
3750            query = query.arg("forcedCompression", forced_compression);
3751        }
3752        if let Some(media_types) = opts.media_types {
3753            query = query.arg("mediaTypes", media_types);
3754        }
3755        if let Some(expand) = opts.expand {
3756            query = query.arg("expand", expand);
3757        }
3758        query.execute(self.graphql_client.clone()).await
3759    }
3760    /// Exports the container as an image to the host's container image store.
3761    ///
3762    /// # Arguments
3763    ///
3764    /// * `name` - Name of image to export to in the host's store
3765    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3766    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
3767        let mut query = self.selection.select("exportImage");
3768        query = query.arg("name", name.into());
3769        query.execute(self.graphql_client.clone()).await
3770    }
3771    /// Exports the container as an image to the host's container image store.
3772    ///
3773    /// # Arguments
3774    ///
3775    /// * `name` - Name of image to export to in the host's store
3776    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3777    pub async fn export_image_opts(
3778        &self,
3779        name: impl Into<String>,
3780        opts: ContainerExportImageOpts,
3781    ) -> Result<Void, DaggerError> {
3782        let mut query = self.selection.select("exportImage");
3783        query = query.arg("name", name.into());
3784        if let Some(platform_variants) = opts.platform_variants {
3785            query = query.arg("platformVariants", platform_variants);
3786        }
3787        if let Some(forced_compression) = opts.forced_compression {
3788            query = query.arg("forcedCompression", forced_compression);
3789        }
3790        if let Some(media_types) = opts.media_types {
3791            query = query.arg("mediaTypes", media_types);
3792        }
3793        query.execute(self.graphql_client.clone()).await
3794    }
3795    /// Retrieves the list of exposed ports.
3796    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
3797    pub fn exposed_ports(&self) -> Vec<Port> {
3798        let query = self.selection.select("exposedPorts");
3799        vec![Port {
3800            proc: self.proc.clone(),
3801            selection: query,
3802            graphql_client: self.graphql_client.clone(),
3803        }]
3804    }
3805    /// Retrieves a file at the given path.
3806    /// Mounts are included.
3807    ///
3808    /// # Arguments
3809    ///
3810    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3811    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3812    pub fn file(&self, path: impl Into<String>) -> File {
3813        let mut query = self.selection.select("file");
3814        query = query.arg("path", path.into());
3815        File {
3816            proc: self.proc.clone(),
3817            selection: query,
3818            graphql_client: self.graphql_client.clone(),
3819        }
3820    }
3821    /// Retrieves a file at the given path.
3822    /// Mounts are included.
3823    ///
3824    /// # Arguments
3825    ///
3826    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3827    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3828    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3829        let mut query = self.selection.select("file");
3830        query = query.arg("path", path.into());
3831        if let Some(expand) = opts.expand {
3832            query = query.arg("expand", expand);
3833        }
3834        File {
3835            proc: self.proc.clone(),
3836            selection: query,
3837            graphql_client: self.graphql_client.clone(),
3838        }
3839    }
3840    /// Download a container image, and apply it to the container state. All previous state will be lost.
3841    ///
3842    /// # Arguments
3843    ///
3844    /// * `address` - Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
3845    pub fn from(&self, address: impl Into<String>) -> Container {
3846        let mut query = self.selection.select("from");
3847        query = query.arg("address", address.into());
3848        Container {
3849            proc: self.proc.clone(),
3850            selection: query,
3851            graphql_client: self.graphql_client.clone(),
3852        }
3853    }
3854    /// A unique identifier for this Container.
3855    pub async fn id(&self) -> Result<ContainerId, DaggerError> {
3856        let query = self.selection.select("id");
3857        query.execute(self.graphql_client.clone()).await
3858    }
3859    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
3860    pub async fn image_ref(&self) -> Result<String, DaggerError> {
3861        let query = self.selection.select("imageRef");
3862        query.execute(self.graphql_client.clone()).await
3863    }
3864    /// Reads the container from an OCI tarball.
3865    ///
3866    /// # Arguments
3867    ///
3868    /// * `source` - File to read the container from.
3869    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3870    pub fn import(&self, source: impl IntoID<FileId>) -> Container {
3871        let mut query = self.selection.select("import");
3872        query = query.arg_lazy(
3873            "source",
3874            Box::new(move || {
3875                let source = source.clone();
3876                Box::pin(async move { source.into_id().await.unwrap().quote() })
3877            }),
3878        );
3879        Container {
3880            proc: self.proc.clone(),
3881            selection: query,
3882            graphql_client: self.graphql_client.clone(),
3883        }
3884    }
3885    /// Reads the container from an OCI tarball.
3886    ///
3887    /// # Arguments
3888    ///
3889    /// * `source` - File to read the container from.
3890    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3891    pub fn import_opts<'a>(
3892        &self,
3893        source: impl IntoID<FileId>,
3894        opts: ContainerImportOpts<'a>,
3895    ) -> Container {
3896        let mut query = self.selection.select("import");
3897        query = query.arg_lazy(
3898            "source",
3899            Box::new(move || {
3900                let source = source.clone();
3901                Box::pin(async move { source.into_id().await.unwrap().quote() })
3902            }),
3903        );
3904        if let Some(tag) = opts.tag {
3905            query = query.arg("tag", tag);
3906        }
3907        Container {
3908            proc: self.proc.clone(),
3909            selection: query,
3910            graphql_client: self.graphql_client.clone(),
3911        }
3912    }
3913    /// Retrieves the value of the specified label.
3914    ///
3915    /// # Arguments
3916    ///
3917    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3918    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3919        let mut query = self.selection.select("label");
3920        query = query.arg("name", name.into());
3921        query.execute(self.graphql_client.clone()).await
3922    }
3923    /// Retrieves the list of labels passed to container.
3924    pub fn labels(&self) -> Vec<Label> {
3925        let query = self.selection.select("labels");
3926        vec![Label {
3927            proc: self.proc.clone(),
3928            selection: query,
3929            graphql_client: self.graphql_client.clone(),
3930        }]
3931    }
3932    /// Retrieves the list of paths where a directory is mounted.
3933    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
3934        let query = self.selection.select("mounts");
3935        query.execute(self.graphql_client.clone()).await
3936    }
3937    /// The platform this container executes and publishes as.
3938    pub async fn platform(&self) -> Result<Platform, DaggerError> {
3939        let query = self.selection.select("platform");
3940        query.execute(self.graphql_client.clone()).await
3941    }
3942    /// Package the container state as an OCI image, and publish it to a registry
3943    /// Returns the fully qualified address of the published image, with digest
3944    ///
3945    /// # Arguments
3946    ///
3947    /// * `address` - The OCI address to publish to
3948    ///
3949    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
3950    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3951    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
3952        let mut query = self.selection.select("publish");
3953        query = query.arg("address", address.into());
3954        query.execute(self.graphql_client.clone()).await
3955    }
3956    /// Package the container state as an OCI image, and publish it to a registry
3957    /// Returns the fully qualified address of the published image, with digest
3958    ///
3959    /// # Arguments
3960    ///
3961    /// * `address` - The OCI address to publish to
3962    ///
3963    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
3964    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3965    pub async fn publish_opts(
3966        &self,
3967        address: impl Into<String>,
3968        opts: ContainerPublishOpts,
3969    ) -> Result<String, DaggerError> {
3970        let mut query = self.selection.select("publish");
3971        query = query.arg("address", address.into());
3972        if let Some(platform_variants) = opts.platform_variants {
3973            query = query.arg("platformVariants", platform_variants);
3974        }
3975        if let Some(forced_compression) = opts.forced_compression {
3976            query = query.arg("forcedCompression", forced_compression);
3977        }
3978        if let Some(media_types) = opts.media_types {
3979            query = query.arg("mediaTypes", media_types);
3980        }
3981        query.execute(self.graphql_client.clone()).await
3982    }
3983    /// 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.
3984    pub fn rootfs(&self) -> Directory {
3985        let query = self.selection.select("rootfs");
3986        Directory {
3987            proc: self.proc.clone(),
3988            selection: query,
3989            graphql_client: self.graphql_client.clone(),
3990        }
3991    }
3992    /// Return file status
3993    ///
3994    /// # Arguments
3995    ///
3996    /// * `path` - Path to check (e.g., "/file.txt").
3997    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3998    pub fn stat(&self, path: impl Into<String>) -> Stat {
3999        let mut query = self.selection.select("stat");
4000        query = query.arg("path", path.into());
4001        Stat {
4002            proc: self.proc.clone(),
4003            selection: query,
4004            graphql_client: self.graphql_client.clone(),
4005        }
4006    }
4007    /// Return file status
4008    ///
4009    /// # Arguments
4010    ///
4011    /// * `path` - Path to check (e.g., "/file.txt").
4012    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4013    pub fn stat_opts(&self, path: impl Into<String>, opts: ContainerStatOpts) -> Stat {
4014        let mut query = self.selection.select("stat");
4015        query = query.arg("path", path.into());
4016        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
4017            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
4018        }
4019        Stat {
4020            proc: self.proc.clone(),
4021            selection: query,
4022            graphql_client: self.graphql_client.clone(),
4023        }
4024    }
4025    /// The buffered standard error stream of the last executed command
4026    /// Returns an error if no command was executed
4027    pub async fn stderr(&self) -> Result<String, DaggerError> {
4028        let query = self.selection.select("stderr");
4029        query.execute(self.graphql_client.clone()).await
4030    }
4031    /// The buffered standard output stream of the last executed command
4032    /// Returns an error if no command was executed
4033    pub async fn stdout(&self) -> Result<String, DaggerError> {
4034        let query = self.selection.select("stdout");
4035        query.execute(self.graphql_client.clone()).await
4036    }
4037    /// Forces evaluation of the pipeline in the engine.
4038    /// It doesn't run the default command if no exec has been set.
4039    pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
4040        let query = self.selection.select("sync");
4041        query.execute(self.graphql_client.clone()).await
4042    }
4043    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
4044    ///
4045    /// # Arguments
4046    ///
4047    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4048    pub fn terminal(&self) -> Container {
4049        let query = self.selection.select("terminal");
4050        Container {
4051            proc: self.proc.clone(),
4052            selection: query,
4053            graphql_client: self.graphql_client.clone(),
4054        }
4055    }
4056    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
4057    ///
4058    /// # Arguments
4059    ///
4060    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4061    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
4062        let mut query = self.selection.select("terminal");
4063        if let Some(cmd) = opts.cmd {
4064            query = query.arg("cmd", cmd);
4065        }
4066        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4067            query = query.arg(
4068                "experimentalPrivilegedNesting",
4069                experimental_privileged_nesting,
4070            );
4071        }
4072        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4073            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4074        }
4075        Container {
4076            proc: self.proc.clone(),
4077            selection: query,
4078            graphql_client: self.graphql_client.clone(),
4079        }
4080    }
4081    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
4082    /// Be sure to set any exposed ports before calling this api.
4083    ///
4084    /// # Arguments
4085    ///
4086    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4087    pub async fn up(&self) -> Result<Void, DaggerError> {
4088        let query = self.selection.select("up");
4089        query.execute(self.graphql_client.clone()).await
4090    }
4091    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
4092    /// Be sure to set any exposed ports before calling this api.
4093    ///
4094    /// # Arguments
4095    ///
4096    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4097    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
4098        let mut query = self.selection.select("up");
4099        if let Some(random) = opts.random {
4100            query = query.arg("random", random);
4101        }
4102        if let Some(ports) = opts.ports {
4103            query = query.arg("ports", ports);
4104        }
4105        if let Some(args) = opts.args {
4106            query = query.arg("args", args);
4107        }
4108        if let Some(use_entrypoint) = opts.use_entrypoint {
4109            query = query.arg("useEntrypoint", use_entrypoint);
4110        }
4111        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4112            query = query.arg(
4113                "experimentalPrivilegedNesting",
4114                experimental_privileged_nesting,
4115            );
4116        }
4117        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4118            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4119        }
4120        if let Some(expand) = opts.expand {
4121            query = query.arg("expand", expand);
4122        }
4123        if let Some(no_init) = opts.no_init {
4124            query = query.arg("noInit", no_init);
4125        }
4126        query.execute(self.graphql_client.clone()).await
4127    }
4128    /// Retrieves the user to be set for all commands.
4129    pub async fn user(&self) -> Result<String, DaggerError> {
4130        let query = self.selection.select("user");
4131        query.execute(self.graphql_client.clone()).await
4132    }
4133    /// Retrieves this container plus the given OCI annotation.
4134    ///
4135    /// # Arguments
4136    ///
4137    /// * `name` - The name of the annotation.
4138    /// * `value` - The value of the annotation.
4139    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
4140        let mut query = self.selection.select("withAnnotation");
4141        query = query.arg("name", name.into());
4142        query = query.arg("value", value.into());
4143        Container {
4144            proc: self.proc.clone(),
4145            selection: query,
4146            graphql_client: self.graphql_client.clone(),
4147        }
4148    }
4149    /// Configures default arguments for future commands. Like CMD in Dockerfile.
4150    ///
4151    /// # Arguments
4152    ///
4153    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
4154    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
4155        let mut query = self.selection.select("withDefaultArgs");
4156        query = query.arg(
4157            "args",
4158            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4159        );
4160        Container {
4161            proc: self.proc.clone(),
4162            selection: query,
4163            graphql_client: self.graphql_client.clone(),
4164        }
4165    }
4166    /// Set the default command to invoke for the container's terminal API.
4167    ///
4168    /// # Arguments
4169    ///
4170    /// * `args` - The args of the command.
4171    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4172    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
4173        let mut query = self.selection.select("withDefaultTerminalCmd");
4174        query = query.arg(
4175            "args",
4176            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4177        );
4178        Container {
4179            proc: self.proc.clone(),
4180            selection: query,
4181            graphql_client: self.graphql_client.clone(),
4182        }
4183    }
4184    /// Set the default command to invoke for the container's terminal API.
4185    ///
4186    /// # Arguments
4187    ///
4188    /// * `args` - The args of the command.
4189    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4190    pub fn with_default_terminal_cmd_opts(
4191        &self,
4192        args: Vec<impl Into<String>>,
4193        opts: ContainerWithDefaultTerminalCmdOpts,
4194    ) -> Container {
4195        let mut query = self.selection.select("withDefaultTerminalCmd");
4196        query = query.arg(
4197            "args",
4198            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4199        );
4200        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4201            query = query.arg(
4202                "experimentalPrivilegedNesting",
4203                experimental_privileged_nesting,
4204            );
4205        }
4206        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4207            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4208        }
4209        Container {
4210            proc: self.proc.clone(),
4211            selection: query,
4212            graphql_client: self.graphql_client.clone(),
4213        }
4214    }
4215    /// Return a new container snapshot, with a directory added to its filesystem
4216    ///
4217    /// # Arguments
4218    ///
4219    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
4220    /// * `source` - Identifier of the directory to write
4221    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4222    pub fn with_directory(
4223        &self,
4224        path: impl Into<String>,
4225        source: impl IntoID<DirectoryId>,
4226    ) -> Container {
4227        let mut query = self.selection.select("withDirectory");
4228        query = query.arg("path", path.into());
4229        query = query.arg_lazy(
4230            "source",
4231            Box::new(move || {
4232                let source = source.clone();
4233                Box::pin(async move { source.into_id().await.unwrap().quote() })
4234            }),
4235        );
4236        Container {
4237            proc: self.proc.clone(),
4238            selection: query,
4239            graphql_client: self.graphql_client.clone(),
4240        }
4241    }
4242    /// Return a new container snapshot, with a directory added to its filesystem
4243    ///
4244    /// # Arguments
4245    ///
4246    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
4247    /// * `source` - Identifier of the directory to write
4248    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4249    pub fn with_directory_opts<'a>(
4250        &self,
4251        path: impl Into<String>,
4252        source: impl IntoID<DirectoryId>,
4253        opts: ContainerWithDirectoryOpts<'a>,
4254    ) -> Container {
4255        let mut query = self.selection.select("withDirectory");
4256        query = query.arg("path", path.into());
4257        query = query.arg_lazy(
4258            "source",
4259            Box::new(move || {
4260                let source = source.clone();
4261                Box::pin(async move { source.into_id().await.unwrap().quote() })
4262            }),
4263        );
4264        if let Some(exclude) = opts.exclude {
4265            query = query.arg("exclude", exclude);
4266        }
4267        if let Some(include) = opts.include {
4268            query = query.arg("include", include);
4269        }
4270        if let Some(gitignore) = opts.gitignore {
4271            query = query.arg("gitignore", gitignore);
4272        }
4273        if let Some(owner) = opts.owner {
4274            query = query.arg("owner", owner);
4275        }
4276        if let Some(expand) = opts.expand {
4277            query = query.arg("expand", expand);
4278        }
4279        Container {
4280            proc: self.proc.clone(),
4281            selection: query,
4282            graphql_client: self.graphql_client.clone(),
4283        }
4284    }
4285    /// Retrieves this container with the specificed docker healtcheck command set.
4286    ///
4287    /// # Arguments
4288    ///
4289    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
4290    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4291    pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
4292        let mut query = self.selection.select("withDockerHealthcheck");
4293        query = query.arg(
4294            "args",
4295            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4296        );
4297        Container {
4298            proc: self.proc.clone(),
4299            selection: query,
4300            graphql_client: self.graphql_client.clone(),
4301        }
4302    }
4303    /// Retrieves this container with the specificed docker healtcheck command set.
4304    ///
4305    /// # Arguments
4306    ///
4307    /// * `args` - Healthcheck command to execute. Example: ["go", "run", "main.go"].
4308    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4309    pub fn with_docker_healthcheck_opts<'a>(
4310        &self,
4311        args: Vec<impl Into<String>>,
4312        opts: ContainerWithDockerHealthcheckOpts<'a>,
4313    ) -> Container {
4314        let mut query = self.selection.select("withDockerHealthcheck");
4315        query = query.arg(
4316            "args",
4317            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4318        );
4319        if let Some(shell) = opts.shell {
4320            query = query.arg("shell", shell);
4321        }
4322        if let Some(interval) = opts.interval {
4323            query = query.arg("interval", interval);
4324        }
4325        if let Some(timeout) = opts.timeout {
4326            query = query.arg("timeout", timeout);
4327        }
4328        if let Some(start_period) = opts.start_period {
4329            query = query.arg("startPeriod", start_period);
4330        }
4331        if let Some(start_interval) = opts.start_interval {
4332            query = query.arg("startInterval", start_interval);
4333        }
4334        if let Some(retries) = opts.retries {
4335            query = query.arg("retries", retries);
4336        }
4337        Container {
4338            proc: self.proc.clone(),
4339            selection: query,
4340            graphql_client: self.graphql_client.clone(),
4341        }
4342    }
4343    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
4344    ///
4345    /// # Arguments
4346    ///
4347    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
4348    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4349    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
4350        let mut query = self.selection.select("withEntrypoint");
4351        query = query.arg(
4352            "args",
4353            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4354        );
4355        Container {
4356            proc: self.proc.clone(),
4357            selection: query,
4358            graphql_client: self.graphql_client.clone(),
4359        }
4360    }
4361    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
4362    ///
4363    /// # Arguments
4364    ///
4365    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
4366    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4367    pub fn with_entrypoint_opts(
4368        &self,
4369        args: Vec<impl Into<String>>,
4370        opts: ContainerWithEntrypointOpts,
4371    ) -> Container {
4372        let mut query = self.selection.select("withEntrypoint");
4373        query = query.arg(
4374            "args",
4375            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4376        );
4377        if let Some(keep_default_args) = opts.keep_default_args {
4378            query = query.arg("keepDefaultArgs", keep_default_args);
4379        }
4380        Container {
4381            proc: self.proc.clone(),
4382            selection: query,
4383            graphql_client: self.graphql_client.clone(),
4384        }
4385    }
4386    /// Export environment variables from an env-file to the container.
4387    ///
4388    /// # Arguments
4389    ///
4390    /// * `source` - Identifier of the envfile
4391    pub fn with_env_file_variables(&self, source: impl IntoID<EnvFileId>) -> Container {
4392        let mut query = self.selection.select("withEnvFileVariables");
4393        query = query.arg_lazy(
4394            "source",
4395            Box::new(move || {
4396                let source = source.clone();
4397                Box::pin(async move { source.into_id().await.unwrap().quote() })
4398            }),
4399        );
4400        Container {
4401            proc: self.proc.clone(),
4402            selection: query,
4403            graphql_client: self.graphql_client.clone(),
4404        }
4405    }
4406    /// Set a new environment variable in the container.
4407    ///
4408    /// # Arguments
4409    ///
4410    /// * `name` - Name of the environment variable (e.g., "HOST").
4411    /// * `value` - Value of the environment variable. (e.g., "localhost").
4412    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4413    pub fn with_env_variable(
4414        &self,
4415        name: impl Into<String>,
4416        value: impl Into<String>,
4417    ) -> Container {
4418        let mut query = self.selection.select("withEnvVariable");
4419        query = query.arg("name", name.into());
4420        query = query.arg("value", value.into());
4421        Container {
4422            proc: self.proc.clone(),
4423            selection: query,
4424            graphql_client: self.graphql_client.clone(),
4425        }
4426    }
4427    /// Set a new environment variable in the container.
4428    ///
4429    /// # Arguments
4430    ///
4431    /// * `name` - Name of the environment variable (e.g., "HOST").
4432    /// * `value` - Value of the environment variable. (e.g., "localhost").
4433    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4434    pub fn with_env_variable_opts(
4435        &self,
4436        name: impl Into<String>,
4437        value: impl Into<String>,
4438        opts: ContainerWithEnvVariableOpts,
4439    ) -> Container {
4440        let mut query = self.selection.select("withEnvVariable");
4441        query = query.arg("name", name.into());
4442        query = query.arg("value", value.into());
4443        if let Some(expand) = opts.expand {
4444            query = query.arg("expand", expand);
4445        }
4446        Container {
4447            proc: self.proc.clone(),
4448            selection: query,
4449            graphql_client: self.graphql_client.clone(),
4450        }
4451    }
4452    /// Raise an error.
4453    ///
4454    /// # Arguments
4455    ///
4456    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
4457    pub fn with_error(&self, err: impl Into<String>) -> Container {
4458        let mut query = self.selection.select("withError");
4459        query = query.arg("err", err.into());
4460        Container {
4461            proc: self.proc.clone(),
4462            selection: query,
4463            graphql_client: self.graphql_client.clone(),
4464        }
4465    }
4466    /// Execute a command in the container, and return a new snapshot of the container state after execution.
4467    ///
4468    /// # Arguments
4469    ///
4470    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
4471    ///
4472    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
4473    ///
4474    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
4475    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4476    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
4477        let mut query = self.selection.select("withExec");
4478        query = query.arg(
4479            "args",
4480            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4481        );
4482        Container {
4483            proc: self.proc.clone(),
4484            selection: query,
4485            graphql_client: self.graphql_client.clone(),
4486        }
4487    }
4488    /// Execute a command in the container, and return a new snapshot of the container state after execution.
4489    ///
4490    /// # Arguments
4491    ///
4492    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
4493    ///
4494    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
4495    ///
4496    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
4497    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4498    pub fn with_exec_opts<'a>(
4499        &self,
4500        args: Vec<impl Into<String>>,
4501        opts: ContainerWithExecOpts<'a>,
4502    ) -> Container {
4503        let mut query = self.selection.select("withExec");
4504        query = query.arg(
4505            "args",
4506            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4507        );
4508        if let Some(use_entrypoint) = opts.use_entrypoint {
4509            query = query.arg("useEntrypoint", use_entrypoint);
4510        }
4511        if let Some(stdin) = opts.stdin {
4512            query = query.arg("stdin", stdin);
4513        }
4514        if let Some(redirect_stdin) = opts.redirect_stdin {
4515            query = query.arg("redirectStdin", redirect_stdin);
4516        }
4517        if let Some(redirect_stdout) = opts.redirect_stdout {
4518            query = query.arg("redirectStdout", redirect_stdout);
4519        }
4520        if let Some(redirect_stderr) = opts.redirect_stderr {
4521            query = query.arg("redirectStderr", redirect_stderr);
4522        }
4523        if let Some(expect) = opts.expect {
4524            query = query.arg("expect", expect);
4525        }
4526        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4527            query = query.arg(
4528                "experimentalPrivilegedNesting",
4529                experimental_privileged_nesting,
4530            );
4531        }
4532        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4533            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4534        }
4535        if let Some(expand) = opts.expand {
4536            query = query.arg("expand", expand);
4537        }
4538        if let Some(no_init) = opts.no_init {
4539            query = query.arg("noInit", no_init);
4540        }
4541        Container {
4542            proc: self.proc.clone(),
4543            selection: query,
4544            graphql_client: self.graphql_client.clone(),
4545        }
4546    }
4547    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
4548    /// Exposed ports serve two purposes:
4549    /// - For health checks and introspection, when running services
4550    /// - For setting the EXPOSE OCI field when publishing the container
4551    ///
4552    /// # Arguments
4553    ///
4554    /// * `port` - Port number to expose. Example: 8080
4555    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4556    pub fn with_exposed_port(&self, port: isize) -> Container {
4557        let mut query = self.selection.select("withExposedPort");
4558        query = query.arg("port", port);
4559        Container {
4560            proc: self.proc.clone(),
4561            selection: query,
4562            graphql_client: self.graphql_client.clone(),
4563        }
4564    }
4565    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
4566    /// Exposed ports serve two purposes:
4567    /// - For health checks and introspection, when running services
4568    /// - For setting the EXPOSE OCI field when publishing the container
4569    ///
4570    /// # Arguments
4571    ///
4572    /// * `port` - Port number to expose. Example: 8080
4573    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4574    pub fn with_exposed_port_opts<'a>(
4575        &self,
4576        port: isize,
4577        opts: ContainerWithExposedPortOpts<'a>,
4578    ) -> Container {
4579        let mut query = self.selection.select("withExposedPort");
4580        query = query.arg("port", port);
4581        if let Some(protocol) = opts.protocol {
4582            query = query.arg("protocol", protocol);
4583        }
4584        if let Some(description) = opts.description {
4585            query = query.arg("description", description);
4586        }
4587        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
4588            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
4589        }
4590        Container {
4591            proc: self.proc.clone(),
4592            selection: query,
4593            graphql_client: self.graphql_client.clone(),
4594        }
4595    }
4596    /// Return a container snapshot with a file added
4597    ///
4598    /// # Arguments
4599    ///
4600    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4601    /// * `source` - File to add
4602    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4603    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
4604        let mut query = self.selection.select("withFile");
4605        query = query.arg("path", path.into());
4606        query = query.arg_lazy(
4607            "source",
4608            Box::new(move || {
4609                let source = source.clone();
4610                Box::pin(async move { source.into_id().await.unwrap().quote() })
4611            }),
4612        );
4613        Container {
4614            proc: self.proc.clone(),
4615            selection: query,
4616            graphql_client: self.graphql_client.clone(),
4617        }
4618    }
4619    /// Return a container snapshot with a file added
4620    ///
4621    /// # Arguments
4622    ///
4623    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
4624    /// * `source` - File to add
4625    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4626    pub fn with_file_opts<'a>(
4627        &self,
4628        path: impl Into<String>,
4629        source: impl IntoID<FileId>,
4630        opts: ContainerWithFileOpts<'a>,
4631    ) -> Container {
4632        let mut query = self.selection.select("withFile");
4633        query = query.arg("path", path.into());
4634        query = query.arg_lazy(
4635            "source",
4636            Box::new(move || {
4637                let source = source.clone();
4638                Box::pin(async move { source.into_id().await.unwrap().quote() })
4639            }),
4640        );
4641        if let Some(permissions) = opts.permissions {
4642            query = query.arg("permissions", permissions);
4643        }
4644        if let Some(owner) = opts.owner {
4645            query = query.arg("owner", owner);
4646        }
4647        if let Some(expand) = opts.expand {
4648            query = query.arg("expand", expand);
4649        }
4650        Container {
4651            proc: self.proc.clone(),
4652            selection: query,
4653            graphql_client: self.graphql_client.clone(),
4654        }
4655    }
4656    /// Retrieves this container plus the contents of the given files copied to the given path.
4657    ///
4658    /// # Arguments
4659    ///
4660    /// * `path` - Location where copied files should be placed (e.g., "/src").
4661    /// * `sources` - Identifiers of the files to copy.
4662    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4663    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
4664        let mut query = self.selection.select("withFiles");
4665        query = query.arg("path", path.into());
4666        query = query.arg("sources", sources);
4667        Container {
4668            proc: self.proc.clone(),
4669            selection: query,
4670            graphql_client: self.graphql_client.clone(),
4671        }
4672    }
4673    /// Retrieves this container plus the contents of the given files copied to the given path.
4674    ///
4675    /// # Arguments
4676    ///
4677    /// * `path` - Location where copied files should be placed (e.g., "/src").
4678    /// * `sources` - Identifiers of the files to copy.
4679    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4680    pub fn with_files_opts<'a>(
4681        &self,
4682        path: impl Into<String>,
4683        sources: Vec<FileId>,
4684        opts: ContainerWithFilesOpts<'a>,
4685    ) -> Container {
4686        let mut query = self.selection.select("withFiles");
4687        query = query.arg("path", path.into());
4688        query = query.arg("sources", sources);
4689        if let Some(permissions) = opts.permissions {
4690            query = query.arg("permissions", permissions);
4691        }
4692        if let Some(owner) = opts.owner {
4693            query = query.arg("owner", owner);
4694        }
4695        if let Some(expand) = opts.expand {
4696            query = query.arg("expand", expand);
4697        }
4698        Container {
4699            proc: self.proc.clone(),
4700            selection: query,
4701            graphql_client: self.graphql_client.clone(),
4702        }
4703    }
4704    /// Retrieves this container plus the given label.
4705    ///
4706    /// # Arguments
4707    ///
4708    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
4709    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
4710    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
4711        let mut query = self.selection.select("withLabel");
4712        query = query.arg("name", name.into());
4713        query = query.arg("value", value.into());
4714        Container {
4715            proc: self.proc.clone(),
4716            selection: query,
4717            graphql_client: self.graphql_client.clone(),
4718        }
4719    }
4720    /// Retrieves this container plus a cache volume mounted at the given path.
4721    ///
4722    /// # Arguments
4723    ///
4724    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4725    /// * `cache` - Identifier of the cache volume to mount.
4726    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4727    pub fn with_mounted_cache(
4728        &self,
4729        path: impl Into<String>,
4730        cache: impl IntoID<CacheVolumeId>,
4731    ) -> Container {
4732        let mut query = self.selection.select("withMountedCache");
4733        query = query.arg("path", path.into());
4734        query = query.arg_lazy(
4735            "cache",
4736            Box::new(move || {
4737                let cache = cache.clone();
4738                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4739            }),
4740        );
4741        Container {
4742            proc: self.proc.clone(),
4743            selection: query,
4744            graphql_client: self.graphql_client.clone(),
4745        }
4746    }
4747    /// Retrieves this container plus a cache volume mounted at the given path.
4748    ///
4749    /// # Arguments
4750    ///
4751    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4752    /// * `cache` - Identifier of the cache volume to mount.
4753    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4754    pub fn with_mounted_cache_opts<'a>(
4755        &self,
4756        path: impl Into<String>,
4757        cache: impl IntoID<CacheVolumeId>,
4758        opts: ContainerWithMountedCacheOpts<'a>,
4759    ) -> Container {
4760        let mut query = self.selection.select("withMountedCache");
4761        query = query.arg("path", path.into());
4762        query = query.arg_lazy(
4763            "cache",
4764            Box::new(move || {
4765                let cache = cache.clone();
4766                Box::pin(async move { cache.into_id().await.unwrap().quote() })
4767            }),
4768        );
4769        if let Some(source) = opts.source {
4770            query = query.arg("source", source);
4771        }
4772        if let Some(sharing) = opts.sharing {
4773            query = query.arg("sharing", sharing);
4774        }
4775        if let Some(owner) = opts.owner {
4776            query = query.arg("owner", owner);
4777        }
4778        if let Some(expand) = opts.expand {
4779            query = query.arg("expand", expand);
4780        }
4781        Container {
4782            proc: self.proc.clone(),
4783            selection: query,
4784            graphql_client: self.graphql_client.clone(),
4785        }
4786    }
4787    /// Retrieves this container plus a directory mounted at the given path.
4788    ///
4789    /// # Arguments
4790    ///
4791    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4792    /// * `source` - Identifier of the mounted directory.
4793    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4794    pub fn with_mounted_directory(
4795        &self,
4796        path: impl Into<String>,
4797        source: impl IntoID<DirectoryId>,
4798    ) -> Container {
4799        let mut query = self.selection.select("withMountedDirectory");
4800        query = query.arg("path", path.into());
4801        query = query.arg_lazy(
4802            "source",
4803            Box::new(move || {
4804                let source = source.clone();
4805                Box::pin(async move { source.into_id().await.unwrap().quote() })
4806            }),
4807        );
4808        Container {
4809            proc: self.proc.clone(),
4810            selection: query,
4811            graphql_client: self.graphql_client.clone(),
4812        }
4813    }
4814    /// Retrieves this container plus a directory mounted at the given path.
4815    ///
4816    /// # Arguments
4817    ///
4818    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
4819    /// * `source` - Identifier of the mounted directory.
4820    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4821    pub fn with_mounted_directory_opts<'a>(
4822        &self,
4823        path: impl Into<String>,
4824        source: impl IntoID<DirectoryId>,
4825        opts: ContainerWithMountedDirectoryOpts<'a>,
4826    ) -> Container {
4827        let mut query = self.selection.select("withMountedDirectory");
4828        query = query.arg("path", path.into());
4829        query = query.arg_lazy(
4830            "source",
4831            Box::new(move || {
4832                let source = source.clone();
4833                Box::pin(async move { source.into_id().await.unwrap().quote() })
4834            }),
4835        );
4836        if let Some(owner) = opts.owner {
4837            query = query.arg("owner", owner);
4838        }
4839        if let Some(expand) = opts.expand {
4840            query = query.arg("expand", expand);
4841        }
4842        Container {
4843            proc: self.proc.clone(),
4844            selection: query,
4845            graphql_client: self.graphql_client.clone(),
4846        }
4847    }
4848    /// Retrieves this container plus a file mounted at the given path.
4849    ///
4850    /// # Arguments
4851    ///
4852    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4853    /// * `source` - Identifier of the mounted file.
4854    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4855    pub fn with_mounted_file(
4856        &self,
4857        path: impl Into<String>,
4858        source: impl IntoID<FileId>,
4859    ) -> Container {
4860        let mut query = self.selection.select("withMountedFile");
4861        query = query.arg("path", path.into());
4862        query = query.arg_lazy(
4863            "source",
4864            Box::new(move || {
4865                let source = source.clone();
4866                Box::pin(async move { source.into_id().await.unwrap().quote() })
4867            }),
4868        );
4869        Container {
4870            proc: self.proc.clone(),
4871            selection: query,
4872            graphql_client: self.graphql_client.clone(),
4873        }
4874    }
4875    /// Retrieves this container plus a file mounted at the given path.
4876    ///
4877    /// # Arguments
4878    ///
4879    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4880    /// * `source` - Identifier of the mounted file.
4881    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4882    pub fn with_mounted_file_opts<'a>(
4883        &self,
4884        path: impl Into<String>,
4885        source: impl IntoID<FileId>,
4886        opts: ContainerWithMountedFileOpts<'a>,
4887    ) -> Container {
4888        let mut query = self.selection.select("withMountedFile");
4889        query = query.arg("path", path.into());
4890        query = query.arg_lazy(
4891            "source",
4892            Box::new(move || {
4893                let source = source.clone();
4894                Box::pin(async move { source.into_id().await.unwrap().quote() })
4895            }),
4896        );
4897        if let Some(owner) = opts.owner {
4898            query = query.arg("owner", owner);
4899        }
4900        if let Some(expand) = opts.expand {
4901            query = query.arg("expand", expand);
4902        }
4903        Container {
4904            proc: self.proc.clone(),
4905            selection: query,
4906            graphql_client: self.graphql_client.clone(),
4907        }
4908    }
4909    /// Retrieves this container plus a secret mounted into a file at the given path.
4910    ///
4911    /// # Arguments
4912    ///
4913    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4914    /// * `source` - Identifier of the secret to mount.
4915    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4916    pub fn with_mounted_secret(
4917        &self,
4918        path: impl Into<String>,
4919        source: impl IntoID<SecretId>,
4920    ) -> Container {
4921        let mut query = self.selection.select("withMountedSecret");
4922        query = query.arg("path", path.into());
4923        query = query.arg_lazy(
4924            "source",
4925            Box::new(move || {
4926                let source = source.clone();
4927                Box::pin(async move { source.into_id().await.unwrap().quote() })
4928            }),
4929        );
4930        Container {
4931            proc: self.proc.clone(),
4932            selection: query,
4933            graphql_client: self.graphql_client.clone(),
4934        }
4935    }
4936    /// Retrieves this container plus a secret mounted into a file at the given path.
4937    ///
4938    /// # Arguments
4939    ///
4940    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4941    /// * `source` - Identifier of the secret to mount.
4942    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4943    pub fn with_mounted_secret_opts<'a>(
4944        &self,
4945        path: impl Into<String>,
4946        source: impl IntoID<SecretId>,
4947        opts: ContainerWithMountedSecretOpts<'a>,
4948    ) -> Container {
4949        let mut query = self.selection.select("withMountedSecret");
4950        query = query.arg("path", path.into());
4951        query = query.arg_lazy(
4952            "source",
4953            Box::new(move || {
4954                let source = source.clone();
4955                Box::pin(async move { source.into_id().await.unwrap().quote() })
4956            }),
4957        );
4958        if let Some(owner) = opts.owner {
4959            query = query.arg("owner", owner);
4960        }
4961        if let Some(mode) = opts.mode {
4962            query = query.arg("mode", mode);
4963        }
4964        if let Some(expand) = opts.expand {
4965            query = query.arg("expand", expand);
4966        }
4967        Container {
4968            proc: self.proc.clone(),
4969            selection: query,
4970            graphql_client: self.graphql_client.clone(),
4971        }
4972    }
4973    /// 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.
4974    ///
4975    /// # Arguments
4976    ///
4977    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4978    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4979    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4980        let mut query = self.selection.select("withMountedTemp");
4981        query = query.arg("path", path.into());
4982        Container {
4983            proc: self.proc.clone(),
4984            selection: query,
4985            graphql_client: self.graphql_client.clone(),
4986        }
4987    }
4988    /// 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.
4989    ///
4990    /// # Arguments
4991    ///
4992    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4993    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4994    pub fn with_mounted_temp_opts(
4995        &self,
4996        path: impl Into<String>,
4997        opts: ContainerWithMountedTempOpts,
4998    ) -> Container {
4999        let mut query = self.selection.select("withMountedTemp");
5000        query = query.arg("path", path.into());
5001        if let Some(size) = opts.size {
5002            query = query.arg("size", size);
5003        }
5004        if let Some(expand) = opts.expand {
5005            query = query.arg("expand", expand);
5006        }
5007        Container {
5008            proc: self.proc.clone(),
5009            selection: query,
5010            graphql_client: self.graphql_client.clone(),
5011        }
5012    }
5013    /// Return a new container snapshot, with a file added to its filesystem with text content
5014    ///
5015    /// # Arguments
5016    ///
5017    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
5018    /// * `contents` - Contents of the new file. Example: "Hello world!"
5019    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5020    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
5021        let mut query = self.selection.select("withNewFile");
5022        query = query.arg("path", path.into());
5023        query = query.arg("contents", contents.into());
5024        Container {
5025            proc: self.proc.clone(),
5026            selection: query,
5027            graphql_client: self.graphql_client.clone(),
5028        }
5029    }
5030    /// Return a new container snapshot, with a file added to its filesystem with text content
5031    ///
5032    /// # Arguments
5033    ///
5034    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
5035    /// * `contents` - Contents of the new file. Example: "Hello world!"
5036    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5037    pub fn with_new_file_opts<'a>(
5038        &self,
5039        path: impl Into<String>,
5040        contents: impl Into<String>,
5041        opts: ContainerWithNewFileOpts<'a>,
5042    ) -> Container {
5043        let mut query = self.selection.select("withNewFile");
5044        query = query.arg("path", path.into());
5045        query = query.arg("contents", contents.into());
5046        if let Some(permissions) = opts.permissions {
5047            query = query.arg("permissions", permissions);
5048        }
5049        if let Some(owner) = opts.owner {
5050            query = query.arg("owner", owner);
5051        }
5052        if let Some(expand) = opts.expand {
5053            query = query.arg("expand", expand);
5054        }
5055        Container {
5056            proc: self.proc.clone(),
5057            selection: query,
5058            graphql_client: self.graphql_client.clone(),
5059        }
5060    }
5061    /// Attach credentials for future publishing to a registry. Use in combination with publish
5062    ///
5063    /// # Arguments
5064    ///
5065    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
5066    /// * `username` - The username to authenticate with. Example: "alice"
5067    /// * `secret` - The API key, password or token to authenticate to this registry
5068    pub fn with_registry_auth(
5069        &self,
5070        address: impl Into<String>,
5071        username: impl Into<String>,
5072        secret: impl IntoID<SecretId>,
5073    ) -> Container {
5074        let mut query = self.selection.select("withRegistryAuth");
5075        query = query.arg("address", address.into());
5076        query = query.arg("username", username.into());
5077        query = query.arg_lazy(
5078            "secret",
5079            Box::new(move || {
5080                let secret = secret.clone();
5081                Box::pin(async move { secret.into_id().await.unwrap().quote() })
5082            }),
5083        );
5084        Container {
5085            proc: self.proc.clone(),
5086            selection: query,
5087            graphql_client: self.graphql_client.clone(),
5088        }
5089    }
5090    /// Change the container's root filesystem. The previous root filesystem will be lost.
5091    ///
5092    /// # Arguments
5093    ///
5094    /// * `directory` - The new root filesystem.
5095    pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
5096        let mut query = self.selection.select("withRootfs");
5097        query = query.arg_lazy(
5098            "directory",
5099            Box::new(move || {
5100                let directory = directory.clone();
5101                Box::pin(async move { directory.into_id().await.unwrap().quote() })
5102            }),
5103        );
5104        Container {
5105            proc: self.proc.clone(),
5106            selection: query,
5107            graphql_client: self.graphql_client.clone(),
5108        }
5109    }
5110    /// Set a new environment variable, using a secret value
5111    ///
5112    /// # Arguments
5113    ///
5114    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
5115    /// * `secret` - Identifier of the secret value.
5116    pub fn with_secret_variable(
5117        &self,
5118        name: impl Into<String>,
5119        secret: impl IntoID<SecretId>,
5120    ) -> Container {
5121        let mut query = self.selection.select("withSecretVariable");
5122        query = query.arg("name", name.into());
5123        query = query.arg_lazy(
5124            "secret",
5125            Box::new(move || {
5126                let secret = secret.clone();
5127                Box::pin(async move { secret.into_id().await.unwrap().quote() })
5128            }),
5129        );
5130        Container {
5131            proc: self.proc.clone(),
5132            selection: query,
5133            graphql_client: self.graphql_client.clone(),
5134        }
5135    }
5136    /// Establish a runtime dependency from a container to a network service.
5137    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
5138    /// The service will be reachable from the container via the provided hostname alias.
5139    /// The service dependency will also convey to any files or directories produced by the container.
5140    ///
5141    /// # Arguments
5142    ///
5143    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
5144    /// * `service` - The target service
5145    pub fn with_service_binding(
5146        &self,
5147        alias: impl Into<String>,
5148        service: impl IntoID<ServiceId>,
5149    ) -> Container {
5150        let mut query = self.selection.select("withServiceBinding");
5151        query = query.arg("alias", alias.into());
5152        query = query.arg_lazy(
5153            "service",
5154            Box::new(move || {
5155                let service = service.clone();
5156                Box::pin(async move { service.into_id().await.unwrap().quote() })
5157            }),
5158        );
5159        Container {
5160            proc: self.proc.clone(),
5161            selection: query,
5162            graphql_client: self.graphql_client.clone(),
5163        }
5164    }
5165    /// Return a snapshot with a symlink
5166    ///
5167    /// # Arguments
5168    ///
5169    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5170    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5171    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5172    pub fn with_symlink(
5173        &self,
5174        target: impl Into<String>,
5175        link_name: impl Into<String>,
5176    ) -> Container {
5177        let mut query = self.selection.select("withSymlink");
5178        query = query.arg("target", target.into());
5179        query = query.arg("linkName", link_name.into());
5180        Container {
5181            proc: self.proc.clone(),
5182            selection: query,
5183            graphql_client: self.graphql_client.clone(),
5184        }
5185    }
5186    /// Return a snapshot with a symlink
5187    ///
5188    /// # Arguments
5189    ///
5190    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5191    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5192    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5193    pub fn with_symlink_opts(
5194        &self,
5195        target: impl Into<String>,
5196        link_name: impl Into<String>,
5197        opts: ContainerWithSymlinkOpts,
5198    ) -> Container {
5199        let mut query = self.selection.select("withSymlink");
5200        query = query.arg("target", target.into());
5201        query = query.arg("linkName", link_name.into());
5202        if let Some(expand) = opts.expand {
5203            query = query.arg("expand", expand);
5204        }
5205        Container {
5206            proc: self.proc.clone(),
5207            selection: query,
5208            graphql_client: self.graphql_client.clone(),
5209        }
5210    }
5211    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
5212    ///
5213    /// # Arguments
5214    ///
5215    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
5216    /// * `source` - Identifier of the socket to forward.
5217    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5218    pub fn with_unix_socket(
5219        &self,
5220        path: impl Into<String>,
5221        source: impl IntoID<SocketId>,
5222    ) -> Container {
5223        let mut query = self.selection.select("withUnixSocket");
5224        query = query.arg("path", path.into());
5225        query = query.arg_lazy(
5226            "source",
5227            Box::new(move || {
5228                let source = source.clone();
5229                Box::pin(async move { source.into_id().await.unwrap().quote() })
5230            }),
5231        );
5232        Container {
5233            proc: self.proc.clone(),
5234            selection: query,
5235            graphql_client: self.graphql_client.clone(),
5236        }
5237    }
5238    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
5239    ///
5240    /// # Arguments
5241    ///
5242    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
5243    /// * `source` - Identifier of the socket to forward.
5244    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5245    pub fn with_unix_socket_opts<'a>(
5246        &self,
5247        path: impl Into<String>,
5248        source: impl IntoID<SocketId>,
5249        opts: ContainerWithUnixSocketOpts<'a>,
5250    ) -> Container {
5251        let mut query = self.selection.select("withUnixSocket");
5252        query = query.arg("path", path.into());
5253        query = query.arg_lazy(
5254            "source",
5255            Box::new(move || {
5256                let source = source.clone();
5257                Box::pin(async move { source.into_id().await.unwrap().quote() })
5258            }),
5259        );
5260        if let Some(owner) = opts.owner {
5261            query = query.arg("owner", owner);
5262        }
5263        if let Some(expand) = opts.expand {
5264            query = query.arg("expand", expand);
5265        }
5266        Container {
5267            proc: self.proc.clone(),
5268            selection: query,
5269            graphql_client: self.graphql_client.clone(),
5270        }
5271    }
5272    /// Retrieves this container with a different command user.
5273    ///
5274    /// # Arguments
5275    ///
5276    /// * `name` - The user to set (e.g., "root").
5277    pub fn with_user(&self, name: impl Into<String>) -> Container {
5278        let mut query = self.selection.select("withUser");
5279        query = query.arg("name", name.into());
5280        Container {
5281            proc: self.proc.clone(),
5282            selection: query,
5283            graphql_client: self.graphql_client.clone(),
5284        }
5285    }
5286    /// Change the container's working directory. Like WORKDIR in Dockerfile.
5287    ///
5288    /// # Arguments
5289    ///
5290    /// * `path` - The path to set as the working directory (e.g., "/app").
5291    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5292    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
5293        let mut query = self.selection.select("withWorkdir");
5294        query = query.arg("path", path.into());
5295        Container {
5296            proc: self.proc.clone(),
5297            selection: query,
5298            graphql_client: self.graphql_client.clone(),
5299        }
5300    }
5301    /// Change the container's working directory. Like WORKDIR in Dockerfile.
5302    ///
5303    /// # Arguments
5304    ///
5305    /// * `path` - The path to set as the working directory (e.g., "/app").
5306    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5307    pub fn with_workdir_opts(
5308        &self,
5309        path: impl Into<String>,
5310        opts: ContainerWithWorkdirOpts,
5311    ) -> Container {
5312        let mut query = self.selection.select("withWorkdir");
5313        query = query.arg("path", path.into());
5314        if let Some(expand) = opts.expand {
5315            query = query.arg("expand", expand);
5316        }
5317        Container {
5318            proc: self.proc.clone(),
5319            selection: query,
5320            graphql_client: self.graphql_client.clone(),
5321        }
5322    }
5323    /// Retrieves this container minus the given OCI annotation.
5324    ///
5325    /// # Arguments
5326    ///
5327    /// * `name` - The name of the annotation.
5328    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
5329        let mut query = self.selection.select("withoutAnnotation");
5330        query = query.arg("name", name.into());
5331        Container {
5332            proc: self.proc.clone(),
5333            selection: query,
5334            graphql_client: self.graphql_client.clone(),
5335        }
5336    }
5337    /// Remove the container's default arguments.
5338    pub fn without_default_args(&self) -> Container {
5339        let query = self.selection.select("withoutDefaultArgs");
5340        Container {
5341            proc: self.proc.clone(),
5342            selection: query,
5343            graphql_client: self.graphql_client.clone(),
5344        }
5345    }
5346    /// Return a new container snapshot, with a directory removed from its filesystem
5347    ///
5348    /// # Arguments
5349    ///
5350    /// * `path` - Location of the directory to remove (e.g., ".github/").
5351    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5352    pub fn without_directory(&self, path: impl Into<String>) -> Container {
5353        let mut query = self.selection.select("withoutDirectory");
5354        query = query.arg("path", path.into());
5355        Container {
5356            proc: self.proc.clone(),
5357            selection: query,
5358            graphql_client: self.graphql_client.clone(),
5359        }
5360    }
5361    /// Return a new container snapshot, with a directory removed from its filesystem
5362    ///
5363    /// # Arguments
5364    ///
5365    /// * `path` - Location of the directory to remove (e.g., ".github/").
5366    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5367    pub fn without_directory_opts(
5368        &self,
5369        path: impl Into<String>,
5370        opts: ContainerWithoutDirectoryOpts,
5371    ) -> Container {
5372        let mut query = self.selection.select("withoutDirectory");
5373        query = query.arg("path", path.into());
5374        if let Some(expand) = opts.expand {
5375            query = query.arg("expand", expand);
5376        }
5377        Container {
5378            proc: self.proc.clone(),
5379            selection: query,
5380            graphql_client: self.graphql_client.clone(),
5381        }
5382    }
5383    /// Retrieves this container without a configured docker healtcheck command.
5384    pub fn without_docker_healthcheck(&self) -> Container {
5385        let query = self.selection.select("withoutDockerHealthcheck");
5386        Container {
5387            proc: self.proc.clone(),
5388            selection: query,
5389            graphql_client: self.graphql_client.clone(),
5390        }
5391    }
5392    /// Reset the container's OCI entrypoint.
5393    ///
5394    /// # Arguments
5395    ///
5396    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5397    pub fn without_entrypoint(&self) -> Container {
5398        let query = self.selection.select("withoutEntrypoint");
5399        Container {
5400            proc: self.proc.clone(),
5401            selection: query,
5402            graphql_client: self.graphql_client.clone(),
5403        }
5404    }
5405    /// Reset the container's OCI entrypoint.
5406    ///
5407    /// # Arguments
5408    ///
5409    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5410    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
5411        let mut query = self.selection.select("withoutEntrypoint");
5412        if let Some(keep_default_args) = opts.keep_default_args {
5413            query = query.arg("keepDefaultArgs", keep_default_args);
5414        }
5415        Container {
5416            proc: self.proc.clone(),
5417            selection: query,
5418            graphql_client: self.graphql_client.clone(),
5419        }
5420    }
5421    /// Retrieves this container minus the given environment variable.
5422    ///
5423    /// # Arguments
5424    ///
5425    /// * `name` - The name of the environment variable (e.g., "HOST").
5426    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
5427        let mut query = self.selection.select("withoutEnvVariable");
5428        query = query.arg("name", name.into());
5429        Container {
5430            proc: self.proc.clone(),
5431            selection: query,
5432            graphql_client: self.graphql_client.clone(),
5433        }
5434    }
5435    /// Unexpose a previously exposed port.
5436    ///
5437    /// # Arguments
5438    ///
5439    /// * `port` - Port number to unexpose
5440    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5441    pub fn without_exposed_port(&self, port: isize) -> Container {
5442        let mut query = self.selection.select("withoutExposedPort");
5443        query = query.arg("port", port);
5444        Container {
5445            proc: self.proc.clone(),
5446            selection: query,
5447            graphql_client: self.graphql_client.clone(),
5448        }
5449    }
5450    /// Unexpose a previously exposed port.
5451    ///
5452    /// # Arguments
5453    ///
5454    /// * `port` - Port number to unexpose
5455    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5456    pub fn without_exposed_port_opts(
5457        &self,
5458        port: isize,
5459        opts: ContainerWithoutExposedPortOpts,
5460    ) -> Container {
5461        let mut query = self.selection.select("withoutExposedPort");
5462        query = query.arg("port", port);
5463        if let Some(protocol) = opts.protocol {
5464            query = query.arg("protocol", protocol);
5465        }
5466        Container {
5467            proc: self.proc.clone(),
5468            selection: query,
5469            graphql_client: self.graphql_client.clone(),
5470        }
5471    }
5472    /// Retrieves this container with the file at the given path removed.
5473    ///
5474    /// # Arguments
5475    ///
5476    /// * `path` - Location of the file to remove (e.g., "/file.txt").
5477    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5478    pub fn without_file(&self, path: impl Into<String>) -> Container {
5479        let mut query = self.selection.select("withoutFile");
5480        query = query.arg("path", path.into());
5481        Container {
5482            proc: self.proc.clone(),
5483            selection: query,
5484            graphql_client: self.graphql_client.clone(),
5485        }
5486    }
5487    /// Retrieves this container with the file at the given path removed.
5488    ///
5489    /// # Arguments
5490    ///
5491    /// * `path` - Location of the file to remove (e.g., "/file.txt").
5492    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5493    pub fn without_file_opts(
5494        &self,
5495        path: impl Into<String>,
5496        opts: ContainerWithoutFileOpts,
5497    ) -> Container {
5498        let mut query = self.selection.select("withoutFile");
5499        query = query.arg("path", path.into());
5500        if let Some(expand) = opts.expand {
5501            query = query.arg("expand", expand);
5502        }
5503        Container {
5504            proc: self.proc.clone(),
5505            selection: query,
5506            graphql_client: self.graphql_client.clone(),
5507        }
5508    }
5509    /// Return a new container spanshot with specified files removed
5510    ///
5511    /// # Arguments
5512    ///
5513    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
5514    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5515    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
5516        let mut query = self.selection.select("withoutFiles");
5517        query = query.arg(
5518            "paths",
5519            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5520        );
5521        Container {
5522            proc: self.proc.clone(),
5523            selection: query,
5524            graphql_client: self.graphql_client.clone(),
5525        }
5526    }
5527    /// Return a new container spanshot with specified files removed
5528    ///
5529    /// # Arguments
5530    ///
5531    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
5532    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5533    pub fn without_files_opts(
5534        &self,
5535        paths: Vec<impl Into<String>>,
5536        opts: ContainerWithoutFilesOpts,
5537    ) -> Container {
5538        let mut query = self.selection.select("withoutFiles");
5539        query = query.arg(
5540            "paths",
5541            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5542        );
5543        if let Some(expand) = opts.expand {
5544            query = query.arg("expand", expand);
5545        }
5546        Container {
5547            proc: self.proc.clone(),
5548            selection: query,
5549            graphql_client: self.graphql_client.clone(),
5550        }
5551    }
5552    /// Retrieves this container minus the given environment label.
5553    ///
5554    /// # Arguments
5555    ///
5556    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
5557    pub fn without_label(&self, name: impl Into<String>) -> Container {
5558        let mut query = self.selection.select("withoutLabel");
5559        query = query.arg("name", name.into());
5560        Container {
5561            proc: self.proc.clone(),
5562            selection: query,
5563            graphql_client: self.graphql_client.clone(),
5564        }
5565    }
5566    /// Retrieves this container after unmounting everything at the given path.
5567    ///
5568    /// # Arguments
5569    ///
5570    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
5571    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5572    pub fn without_mount(&self, path: impl Into<String>) -> Container {
5573        let mut query = self.selection.select("withoutMount");
5574        query = query.arg("path", path.into());
5575        Container {
5576            proc: self.proc.clone(),
5577            selection: query,
5578            graphql_client: self.graphql_client.clone(),
5579        }
5580    }
5581    /// Retrieves this container after unmounting everything at the given path.
5582    ///
5583    /// # Arguments
5584    ///
5585    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
5586    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5587    pub fn without_mount_opts(
5588        &self,
5589        path: impl Into<String>,
5590        opts: ContainerWithoutMountOpts,
5591    ) -> Container {
5592        let mut query = self.selection.select("withoutMount");
5593        query = query.arg("path", path.into());
5594        if let Some(expand) = opts.expand {
5595            query = query.arg("expand", expand);
5596        }
5597        Container {
5598            proc: self.proc.clone(),
5599            selection: query,
5600            graphql_client: self.graphql_client.clone(),
5601        }
5602    }
5603    /// Retrieves this container without the registry authentication of a given address.
5604    ///
5605    /// # Arguments
5606    ///
5607    /// * `address` - Registry's address to remove the authentication from.
5608    ///
5609    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
5610    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
5611        let mut query = self.selection.select("withoutRegistryAuth");
5612        query = query.arg("address", address.into());
5613        Container {
5614            proc: self.proc.clone(),
5615            selection: query,
5616            graphql_client: self.graphql_client.clone(),
5617        }
5618    }
5619    /// Retrieves this container minus the given environment variable containing the secret.
5620    ///
5621    /// # Arguments
5622    ///
5623    /// * `name` - The name of the environment variable (e.g., "HOST").
5624    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
5625        let mut query = self.selection.select("withoutSecretVariable");
5626        query = query.arg("name", name.into());
5627        Container {
5628            proc: self.proc.clone(),
5629            selection: query,
5630            graphql_client: self.graphql_client.clone(),
5631        }
5632    }
5633    /// Retrieves this container with a previously added Unix socket removed.
5634    ///
5635    /// # Arguments
5636    ///
5637    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
5638    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5639    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
5640        let mut query = self.selection.select("withoutUnixSocket");
5641        query = query.arg("path", path.into());
5642        Container {
5643            proc: self.proc.clone(),
5644            selection: query,
5645            graphql_client: self.graphql_client.clone(),
5646        }
5647    }
5648    /// Retrieves this container with a previously added Unix socket removed.
5649    ///
5650    /// # Arguments
5651    ///
5652    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
5653    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5654    pub fn without_unix_socket_opts(
5655        &self,
5656        path: impl Into<String>,
5657        opts: ContainerWithoutUnixSocketOpts,
5658    ) -> Container {
5659        let mut query = self.selection.select("withoutUnixSocket");
5660        query = query.arg("path", path.into());
5661        if let Some(expand) = opts.expand {
5662            query = query.arg("expand", expand);
5663        }
5664        Container {
5665            proc: self.proc.clone(),
5666            selection: query,
5667            graphql_client: self.graphql_client.clone(),
5668        }
5669    }
5670    /// Retrieves this container with an unset command user.
5671    /// Should default to root.
5672    pub fn without_user(&self) -> Container {
5673        let query = self.selection.select("withoutUser");
5674        Container {
5675            proc: self.proc.clone(),
5676            selection: query,
5677            graphql_client: self.graphql_client.clone(),
5678        }
5679    }
5680    /// Unset the container's working directory.
5681    /// Should default to "/".
5682    pub fn without_workdir(&self) -> Container {
5683        let query = self.selection.select("withoutWorkdir");
5684        Container {
5685            proc: self.proc.clone(),
5686            selection: query,
5687            graphql_client: self.graphql_client.clone(),
5688        }
5689    }
5690    /// Retrieves the working directory for all commands.
5691    pub async fn workdir(&self) -> Result<String, DaggerError> {
5692        let query = self.selection.select("workdir");
5693        query.execute(self.graphql_client.clone()).await
5694    }
5695}
5696#[derive(Clone)]
5697pub struct CurrentModule {
5698    pub proc: Option<Arc<DaggerSessionProc>>,
5699    pub selection: Selection,
5700    pub graphql_client: DynGraphQLClient,
5701}
5702#[derive(Builder, Debug, PartialEq)]
5703pub struct CurrentModuleGeneratorsOpts<'a> {
5704    /// Only include generators matching the specified patterns
5705    #[builder(setter(into, strip_option), default)]
5706    pub include: Option<Vec<&'a str>>,
5707}
5708#[derive(Builder, Debug, PartialEq)]
5709pub struct CurrentModuleWorkdirOpts<'a> {
5710    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
5711    #[builder(setter(into, strip_option), default)]
5712    pub exclude: Option<Vec<&'a str>>,
5713    /// Apply .gitignore filter rules inside the directory
5714    #[builder(setter(into, strip_option), default)]
5715    pub gitignore: Option<bool>,
5716    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
5717    #[builder(setter(into, strip_option), default)]
5718    pub include: Option<Vec<&'a str>>,
5719}
5720impl CurrentModule {
5721    /// The dependencies of the module.
5722    pub fn dependencies(&self) -> Vec<Module> {
5723        let query = self.selection.select("dependencies");
5724        vec![Module {
5725            proc: self.proc.clone(),
5726            selection: query,
5727            graphql_client: self.graphql_client.clone(),
5728        }]
5729    }
5730    /// The generated files and directories made on top of the module source's context directory.
5731    pub fn generated_context_directory(&self) -> Directory {
5732        let query = self.selection.select("generatedContextDirectory");
5733        Directory {
5734            proc: self.proc.clone(),
5735            selection: query,
5736            graphql_client: self.graphql_client.clone(),
5737        }
5738    }
5739    /// Return all generators defined by the module
5740    ///
5741    /// # Arguments
5742    ///
5743    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5744    pub fn generators(&self) -> GeneratorGroup {
5745        let query = self.selection.select("generators");
5746        GeneratorGroup {
5747            proc: self.proc.clone(),
5748            selection: query,
5749            graphql_client: self.graphql_client.clone(),
5750        }
5751    }
5752    /// Return all generators defined by the module
5753    ///
5754    /// # Arguments
5755    ///
5756    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5757    pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
5758        let mut query = self.selection.select("generators");
5759        if let Some(include) = opts.include {
5760            query = query.arg("include", include);
5761        }
5762        GeneratorGroup {
5763            proc: self.proc.clone(),
5764            selection: query,
5765            graphql_client: self.graphql_client.clone(),
5766        }
5767    }
5768    /// A unique identifier for this CurrentModule.
5769    pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
5770        let query = self.selection.select("id");
5771        query.execute(self.graphql_client.clone()).await
5772    }
5773    /// The name of the module being executed in
5774    pub async fn name(&self) -> Result<String, DaggerError> {
5775        let query = self.selection.select("name");
5776        query.execute(self.graphql_client.clone()).await
5777    }
5778    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
5779    pub fn source(&self) -> Directory {
5780        let query = self.selection.select("source");
5781        Directory {
5782            proc: self.proc.clone(),
5783            selection: query,
5784            graphql_client: self.graphql_client.clone(),
5785        }
5786    }
5787    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
5788    ///
5789    /// # Arguments
5790    ///
5791    /// * `path` - Location of the directory to access (e.g., ".").
5792    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5793    pub fn workdir(&self, path: impl Into<String>) -> Directory {
5794        let mut query = self.selection.select("workdir");
5795        query = query.arg("path", path.into());
5796        Directory {
5797            proc: self.proc.clone(),
5798            selection: query,
5799            graphql_client: self.graphql_client.clone(),
5800        }
5801    }
5802    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
5803    ///
5804    /// # Arguments
5805    ///
5806    /// * `path` - Location of the directory to access (e.g., ".").
5807    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5808    pub fn workdir_opts<'a>(
5809        &self,
5810        path: impl Into<String>,
5811        opts: CurrentModuleWorkdirOpts<'a>,
5812    ) -> Directory {
5813        let mut query = self.selection.select("workdir");
5814        query = query.arg("path", path.into());
5815        if let Some(exclude) = opts.exclude {
5816            query = query.arg("exclude", exclude);
5817        }
5818        if let Some(include) = opts.include {
5819            query = query.arg("include", include);
5820        }
5821        if let Some(gitignore) = opts.gitignore {
5822            query = query.arg("gitignore", gitignore);
5823        }
5824        Directory {
5825            proc: self.proc.clone(),
5826            selection: query,
5827            graphql_client: self.graphql_client.clone(),
5828        }
5829    }
5830    /// 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.
5831    ///
5832    /// # Arguments
5833    ///
5834    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5835    pub fn workdir_file(&self, path: impl Into<String>) -> File {
5836        let mut query = self.selection.select("workdirFile");
5837        query = query.arg("path", path.into());
5838        File {
5839            proc: self.proc.clone(),
5840            selection: query,
5841            graphql_client: self.graphql_client.clone(),
5842        }
5843    }
5844}
5845#[derive(Clone)]
5846pub struct DiffStat {
5847    pub proc: Option<Arc<DaggerSessionProc>>,
5848    pub selection: Selection,
5849    pub graphql_client: DynGraphQLClient,
5850}
5851impl DiffStat {
5852    /// Number of added lines for this path.
5853    pub async fn added_lines(&self) -> Result<isize, DaggerError> {
5854        let query = self.selection.select("addedLines");
5855        query.execute(self.graphql_client.clone()).await
5856    }
5857    /// A unique identifier for this DiffStat.
5858    pub async fn id(&self) -> Result<DiffStatId, DaggerError> {
5859        let query = self.selection.select("id");
5860        query.execute(self.graphql_client.clone()).await
5861    }
5862    /// Type of change.
5863    pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
5864        let query = self.selection.select("kind");
5865        query.execute(self.graphql_client.clone()).await
5866    }
5867    /// Previous path of the file, set only for renames.
5868    pub async fn old_path(&self) -> Result<String, DaggerError> {
5869        let query = self.selection.select("oldPath");
5870        query.execute(self.graphql_client.clone()).await
5871    }
5872    /// Path of the changed file or directory.
5873    pub async fn path(&self) -> Result<String, DaggerError> {
5874        let query = self.selection.select("path");
5875        query.execute(self.graphql_client.clone()).await
5876    }
5877    /// Number of removed lines for this path.
5878    pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
5879        let query = self.selection.select("removedLines");
5880        query.execute(self.graphql_client.clone()).await
5881    }
5882}
5883#[derive(Clone)]
5884pub struct Directory {
5885    pub proc: Option<Arc<DaggerSessionProc>>,
5886    pub selection: Selection,
5887    pub graphql_client: DynGraphQLClient,
5888}
5889#[derive(Builder, Debug, PartialEq)]
5890pub struct DirectoryAsModuleOpts<'a> {
5891    /// An optional subpath of the directory which contains the module's configuration file.
5892    /// If not set, the module source code is loaded from the root of the directory.
5893    #[builder(setter(into, strip_option), default)]
5894    pub source_root_path: Option<&'a str>,
5895}
5896#[derive(Builder, Debug, PartialEq)]
5897pub struct DirectoryAsModuleSourceOpts<'a> {
5898    /// An optional subpath of the directory which contains the module's configuration file.
5899    /// If not set, the module source code is loaded from the root of the directory.
5900    #[builder(setter(into, strip_option), default)]
5901    pub source_root_path: Option<&'a str>,
5902}
5903#[derive(Builder, Debug, PartialEq)]
5904pub struct DirectoryDockerBuildOpts<'a> {
5905    /// Build arguments to use in the build.
5906    #[builder(setter(into, strip_option), default)]
5907    pub build_args: Option<Vec<BuildArg>>,
5908    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
5909    #[builder(setter(into, strip_option), default)]
5910    pub dockerfile: Option<&'a str>,
5911    /// If set, skip the automatic init process injected into containers created by RUN statements.
5912    /// 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.
5913    #[builder(setter(into, strip_option), default)]
5914    pub no_init: Option<bool>,
5915    /// The platform to build.
5916    #[builder(setter(into, strip_option), default)]
5917    pub platform: Option<Platform>,
5918    /// Secrets to pass to the build.
5919    /// They will be mounted at /run/secrets/[secret-name].
5920    #[builder(setter(into, strip_option), default)]
5921    pub secrets: Option<Vec<SecretId>>,
5922    /// A socket to use for SSH authentication during the build
5923    /// (e.g., for Dockerfile RUN --mount=type=ssh instructions).
5924    /// Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
5925    #[builder(setter(into, strip_option), default)]
5926    pub ssh: Option<SocketId>,
5927    /// Target build stage to build.
5928    #[builder(setter(into, strip_option), default)]
5929    pub target: Option<&'a str>,
5930}
5931#[derive(Builder, Debug, PartialEq)]
5932pub struct DirectoryEntriesOpts<'a> {
5933    /// Location of the directory to look at (e.g., "/src").
5934    #[builder(setter(into, strip_option), default)]
5935    pub path: Option<&'a str>,
5936}
5937#[derive(Builder, Debug, PartialEq)]
5938pub struct DirectoryExistsOpts {
5939    /// If specified, do not follow symlinks.
5940    #[builder(setter(into, strip_option), default)]
5941    pub do_not_follow_symlinks: Option<bool>,
5942    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
5943    #[builder(setter(into, strip_option), default)]
5944    pub expected_type: Option<ExistsType>,
5945}
5946#[derive(Builder, Debug, PartialEq)]
5947pub struct DirectoryExportOpts {
5948    /// 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.
5949    #[builder(setter(into, strip_option), default)]
5950    pub wipe: Option<bool>,
5951}
5952#[derive(Builder, Debug, PartialEq)]
5953pub struct DirectoryFilterOpts<'a> {
5954    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
5955    #[builder(setter(into, strip_option), default)]
5956    pub exclude: Option<Vec<&'a str>>,
5957    /// If set, apply .gitignore rules when filtering the directory.
5958    #[builder(setter(into, strip_option), default)]
5959    pub gitignore: Option<bool>,
5960    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
5961    #[builder(setter(into, strip_option), default)]
5962    pub include: Option<Vec<&'a str>>,
5963}
5964#[derive(Builder, Debug, PartialEq)]
5965pub struct DirectorySearchOpts<'a> {
5966    /// Allow the . pattern to match newlines in multiline mode.
5967    #[builder(setter(into, strip_option), default)]
5968    pub dotall: Option<bool>,
5969    /// Only return matching files, not lines and content
5970    #[builder(setter(into, strip_option), default)]
5971    pub files_only: Option<bool>,
5972    /// Glob patterns to match (e.g., "*.md")
5973    #[builder(setter(into, strip_option), default)]
5974    pub globs: Option<Vec<&'a str>>,
5975    /// Enable case-insensitive matching.
5976    #[builder(setter(into, strip_option), default)]
5977    pub insensitive: Option<bool>,
5978    /// Limit the number of results to return
5979    #[builder(setter(into, strip_option), default)]
5980    pub limit: Option<isize>,
5981    /// Interpret the pattern as a literal string instead of a regular expression.
5982    #[builder(setter(into, strip_option), default)]
5983    pub literal: Option<bool>,
5984    /// Enable searching across multiple lines.
5985    #[builder(setter(into, strip_option), default)]
5986    pub multiline: Option<bool>,
5987    /// Directory or file paths to search
5988    #[builder(setter(into, strip_option), default)]
5989    pub paths: Option<Vec<&'a str>>,
5990    /// Skip hidden files (files starting with .).
5991    #[builder(setter(into, strip_option), default)]
5992    pub skip_hidden: Option<bool>,
5993    /// Honor .gitignore, .ignore, and .rgignore files.
5994    #[builder(setter(into, strip_option), default)]
5995    pub skip_ignored: Option<bool>,
5996}
5997#[derive(Builder, Debug, PartialEq)]
5998pub struct DirectoryStatOpts {
5999    /// If specified, do not follow symlinks.
6000    #[builder(setter(into, strip_option), default)]
6001    pub do_not_follow_symlinks: Option<bool>,
6002}
6003#[derive(Builder, Debug, PartialEq)]
6004pub struct DirectoryTerminalOpts<'a> {
6005    /// If set, override the container's default terminal command and invoke these command arguments instead.
6006    #[builder(setter(into, strip_option), default)]
6007    pub cmd: Option<Vec<&'a str>>,
6008    /// If set, override the default container used for the terminal.
6009    #[builder(setter(into, strip_option), default)]
6010    pub container: Option<ContainerId>,
6011    /// Provides Dagger access to the executed command.
6012    #[builder(setter(into, strip_option), default)]
6013    pub experimental_privileged_nesting: Option<bool>,
6014    /// 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.
6015    #[builder(setter(into, strip_option), default)]
6016    pub insecure_root_capabilities: Option<bool>,
6017}
6018#[derive(Builder, Debug, PartialEq)]
6019pub struct DirectoryWithDirectoryOpts<'a> {
6020    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
6021    #[builder(setter(into, strip_option), default)]
6022    pub exclude: Option<Vec<&'a str>>,
6023    /// Apply .gitignore filter rules inside the directory
6024    #[builder(setter(into, strip_option), default)]
6025    pub gitignore: Option<bool>,
6026    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
6027    #[builder(setter(into, strip_option), default)]
6028    pub include: Option<Vec<&'a str>>,
6029    /// A user:group to set for the copied directory and its contents.
6030    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
6031    /// If the group is omitted, it defaults to the same as the user.
6032    #[builder(setter(into, strip_option), default)]
6033    pub owner: Option<&'a str>,
6034}
6035#[derive(Builder, Debug, PartialEq)]
6036pub struct DirectoryWithFileOpts<'a> {
6037    /// A user:group to set for the copied directory and its contents.
6038    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
6039    /// If the group is omitted, it defaults to the same as the user.
6040    #[builder(setter(into, strip_option), default)]
6041    pub owner: Option<&'a str>,
6042    /// Permission given to the copied file (e.g., 0600).
6043    #[builder(setter(into, strip_option), default)]
6044    pub permissions: Option<isize>,
6045}
6046#[derive(Builder, Debug, PartialEq)]
6047pub struct DirectoryWithFilesOpts {
6048    /// Permission given to the copied files (e.g., 0600).
6049    #[builder(setter(into, strip_option), default)]
6050    pub permissions: Option<isize>,
6051}
6052#[derive(Builder, Debug, PartialEq)]
6053pub struct DirectoryWithNewDirectoryOpts {
6054    /// Permission granted to the created directory (e.g., 0777).
6055    #[builder(setter(into, strip_option), default)]
6056    pub permissions: Option<isize>,
6057}
6058#[derive(Builder, Debug, PartialEq)]
6059pub struct DirectoryWithNewFileOpts {
6060    /// Permissions of the new file. Example: 0600
6061    #[builder(setter(into, strip_option), default)]
6062    pub permissions: Option<isize>,
6063}
6064impl Directory {
6065    /// Converts this directory to a local git repository
6066    pub fn as_git(&self) -> GitRepository {
6067        let query = self.selection.select("asGit");
6068        GitRepository {
6069            proc: self.proc.clone(),
6070            selection: query,
6071            graphql_client: self.graphql_client.clone(),
6072        }
6073    }
6074    /// Load the directory as a Dagger module source
6075    ///
6076    /// # Arguments
6077    ///
6078    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6079    pub fn as_module(&self) -> Module {
6080        let query = self.selection.select("asModule");
6081        Module {
6082            proc: self.proc.clone(),
6083            selection: query,
6084            graphql_client: self.graphql_client.clone(),
6085        }
6086    }
6087    /// Load the directory as a Dagger module source
6088    ///
6089    /// # Arguments
6090    ///
6091    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6092    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
6093        let mut query = self.selection.select("asModule");
6094        if let Some(source_root_path) = opts.source_root_path {
6095            query = query.arg("sourceRootPath", source_root_path);
6096        }
6097        Module {
6098            proc: self.proc.clone(),
6099            selection: query,
6100            graphql_client: self.graphql_client.clone(),
6101        }
6102    }
6103    /// Load the directory as a Dagger module source
6104    ///
6105    /// # Arguments
6106    ///
6107    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6108    pub fn as_module_source(&self) -> ModuleSource {
6109        let query = self.selection.select("asModuleSource");
6110        ModuleSource {
6111            proc: self.proc.clone(),
6112            selection: query,
6113            graphql_client: self.graphql_client.clone(),
6114        }
6115    }
6116    /// Load the directory as a Dagger module source
6117    ///
6118    /// # Arguments
6119    ///
6120    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6121    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
6122        let mut query = self.selection.select("asModuleSource");
6123        if let Some(source_root_path) = opts.source_root_path {
6124            query = query.arg("sourceRootPath", source_root_path);
6125        }
6126        ModuleSource {
6127            proc: self.proc.clone(),
6128            selection: query,
6129            graphql_client: self.graphql_client.clone(),
6130        }
6131    }
6132    /// Return the difference between this directory and another directory, typically an older snapshot.
6133    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
6134    ///
6135    /// # Arguments
6136    ///
6137    /// * `from` - The base directory snapshot to compare against
6138    pub fn changes(&self, from: impl IntoID<DirectoryId>) -> Changeset {
6139        let mut query = self.selection.select("changes");
6140        query = query.arg_lazy(
6141            "from",
6142            Box::new(move || {
6143                let from = from.clone();
6144                Box::pin(async move { from.into_id().await.unwrap().quote() })
6145            }),
6146        );
6147        Changeset {
6148            proc: self.proc.clone(),
6149            selection: query,
6150            graphql_client: self.graphql_client.clone(),
6151        }
6152    }
6153    /// Change the owner of the directory contents recursively.
6154    ///
6155    /// # Arguments
6156    ///
6157    /// * `path` - Path of the directory to change ownership of (e.g., "/").
6158    /// * `owner` - A user:group to set for the mounted directory and its contents.
6159    ///
6160    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
6161    ///
6162    /// If the group is omitted, it defaults to the same as the user.
6163    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
6164        let mut query = self.selection.select("chown");
6165        query = query.arg("path", path.into());
6166        query = query.arg("owner", owner.into());
6167        Directory {
6168            proc: self.proc.clone(),
6169            selection: query,
6170            graphql_client: self.graphql_client.clone(),
6171        }
6172    }
6173    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
6174    ///
6175    /// # Arguments
6176    ///
6177    /// * `other` - The directory to compare against
6178    pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
6179        let mut query = self.selection.select("diff");
6180        query = query.arg_lazy(
6181            "other",
6182            Box::new(move || {
6183                let other = other.clone();
6184                Box::pin(async move { other.into_id().await.unwrap().quote() })
6185            }),
6186        );
6187        Directory {
6188            proc: self.proc.clone(),
6189            selection: query,
6190            graphql_client: self.graphql_client.clone(),
6191        }
6192    }
6193    /// 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.
6194    pub async fn digest(&self) -> Result<String, DaggerError> {
6195        let query = self.selection.select("digest");
6196        query.execute(self.graphql_client.clone()).await
6197    }
6198    /// Retrieves a directory at the given path.
6199    ///
6200    /// # Arguments
6201    ///
6202    /// * `path` - Location of the directory to retrieve. Example: "/src"
6203    pub fn directory(&self, path: impl Into<String>) -> Directory {
6204        let mut query = self.selection.select("directory");
6205        query = query.arg("path", path.into());
6206        Directory {
6207            proc: self.proc.clone(),
6208            selection: query,
6209            graphql_client: self.graphql_client.clone(),
6210        }
6211    }
6212    /// 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.
6213    ///
6214    /// # Arguments
6215    ///
6216    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6217    pub fn docker_build(&self) -> Container {
6218        let query = self.selection.select("dockerBuild");
6219        Container {
6220            proc: self.proc.clone(),
6221            selection: query,
6222            graphql_client: self.graphql_client.clone(),
6223        }
6224    }
6225    /// 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.
6226    ///
6227    /// # Arguments
6228    ///
6229    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6230    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
6231        let mut query = self.selection.select("dockerBuild");
6232        if let Some(dockerfile) = opts.dockerfile {
6233            query = query.arg("dockerfile", dockerfile);
6234        }
6235        if let Some(platform) = opts.platform {
6236            query = query.arg("platform", platform);
6237        }
6238        if let Some(build_args) = opts.build_args {
6239            query = query.arg("buildArgs", build_args);
6240        }
6241        if let Some(target) = opts.target {
6242            query = query.arg("target", target);
6243        }
6244        if let Some(secrets) = opts.secrets {
6245            query = query.arg("secrets", secrets);
6246        }
6247        if let Some(no_init) = opts.no_init {
6248            query = query.arg("noInit", no_init);
6249        }
6250        if let Some(ssh) = opts.ssh {
6251            query = query.arg("ssh", ssh);
6252        }
6253        Container {
6254            proc: self.proc.clone(),
6255            selection: query,
6256            graphql_client: self.graphql_client.clone(),
6257        }
6258    }
6259    /// Returns a list of files and directories at the given path.
6260    ///
6261    /// # Arguments
6262    ///
6263    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6264    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
6265        let query = self.selection.select("entries");
6266        query.execute(self.graphql_client.clone()).await
6267    }
6268    /// Returns a list of files and directories at the given path.
6269    ///
6270    /// # Arguments
6271    ///
6272    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6273    pub async fn entries_opts<'a>(
6274        &self,
6275        opts: DirectoryEntriesOpts<'a>,
6276    ) -> Result<Vec<String>, DaggerError> {
6277        let mut query = self.selection.select("entries");
6278        if let Some(path) = opts.path {
6279            query = query.arg("path", path);
6280        }
6281        query.execute(self.graphql_client.clone()).await
6282    }
6283    /// check if a file or directory exists
6284    ///
6285    /// # Arguments
6286    ///
6287    /// * `path` - Path to check (e.g., "/file.txt").
6288    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6289    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
6290        let mut query = self.selection.select("exists");
6291        query = query.arg("path", path.into());
6292        query.execute(self.graphql_client.clone()).await
6293    }
6294    /// check if a file or directory exists
6295    ///
6296    /// # Arguments
6297    ///
6298    /// * `path` - Path to check (e.g., "/file.txt").
6299    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6300    pub async fn exists_opts(
6301        &self,
6302        path: impl Into<String>,
6303        opts: DirectoryExistsOpts,
6304    ) -> Result<bool, DaggerError> {
6305        let mut query = self.selection.select("exists");
6306        query = query.arg("path", path.into());
6307        if let Some(expected_type) = opts.expected_type {
6308            query = query.arg("expectedType", expected_type);
6309        }
6310        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
6311            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
6312        }
6313        query.execute(self.graphql_client.clone()).await
6314    }
6315    /// Writes the contents of the directory to a path on the host.
6316    ///
6317    /// # Arguments
6318    ///
6319    /// * `path` - Location of the copied directory (e.g., "logs/").
6320    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6321    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
6322        let mut query = self.selection.select("export");
6323        query = query.arg("path", path.into());
6324        query.execute(self.graphql_client.clone()).await
6325    }
6326    /// Writes the contents of the directory to a path on the host.
6327    ///
6328    /// # Arguments
6329    ///
6330    /// * `path` - Location of the copied directory (e.g., "logs/").
6331    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6332    pub async fn export_opts(
6333        &self,
6334        path: impl Into<String>,
6335        opts: DirectoryExportOpts,
6336    ) -> Result<String, DaggerError> {
6337        let mut query = self.selection.select("export");
6338        query = query.arg("path", path.into());
6339        if let Some(wipe) = opts.wipe {
6340            query = query.arg("wipe", wipe);
6341        }
6342        query.execute(self.graphql_client.clone()).await
6343    }
6344    /// Retrieve a file at the given path.
6345    ///
6346    /// # Arguments
6347    ///
6348    /// * `path` - Location of the file to retrieve (e.g., "README.md").
6349    pub fn file(&self, path: impl Into<String>) -> File {
6350        let mut query = self.selection.select("file");
6351        query = query.arg("path", path.into());
6352        File {
6353            proc: self.proc.clone(),
6354            selection: query,
6355            graphql_client: self.graphql_client.clone(),
6356        }
6357    }
6358    /// Return a snapshot with some paths included or excluded
6359    ///
6360    /// # Arguments
6361    ///
6362    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6363    pub fn filter(&self) -> Directory {
6364        let query = self.selection.select("filter");
6365        Directory {
6366            proc: self.proc.clone(),
6367            selection: query,
6368            graphql_client: self.graphql_client.clone(),
6369        }
6370    }
6371    /// Return a snapshot with some paths included or excluded
6372    ///
6373    /// # Arguments
6374    ///
6375    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6376    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
6377        let mut query = self.selection.select("filter");
6378        if let Some(exclude) = opts.exclude {
6379            query = query.arg("exclude", exclude);
6380        }
6381        if let Some(include) = opts.include {
6382            query = query.arg("include", include);
6383        }
6384        if let Some(gitignore) = opts.gitignore {
6385            query = query.arg("gitignore", gitignore);
6386        }
6387        Directory {
6388            proc: self.proc.clone(),
6389            selection: query,
6390            graphql_client: self.graphql_client.clone(),
6391        }
6392    }
6393    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
6394    ///
6395    /// # Arguments
6396    ///
6397    /// * `name` - The name of the file or directory to search for
6398    /// * `start` - The path to start the search from
6399    pub async fn find_up(
6400        &self,
6401        name: impl Into<String>,
6402        start: impl Into<String>,
6403    ) -> Result<String, DaggerError> {
6404        let mut query = self.selection.select("findUp");
6405        query = query.arg("name", name.into());
6406        query = query.arg("start", start.into());
6407        query.execute(self.graphql_client.clone()).await
6408    }
6409    /// Returns a list of files and directories that matche the given pattern.
6410    ///
6411    /// # Arguments
6412    ///
6413    /// * `pattern` - Pattern to match (e.g., "*.md").
6414    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
6415        let mut query = self.selection.select("glob");
6416        query = query.arg("pattern", pattern.into());
6417        query.execute(self.graphql_client.clone()).await
6418    }
6419    /// A unique identifier for this Directory.
6420    pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
6421        let query = self.selection.select("id");
6422        query.execute(self.graphql_client.clone()).await
6423    }
6424    /// Returns the name of the directory.
6425    pub async fn name(&self) -> Result<String, DaggerError> {
6426        let query = self.selection.select("name");
6427        query.execute(self.graphql_client.clone()).await
6428    }
6429    /// Searches for content matching the given regular expression or literal string.
6430    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6431    ///
6432    /// # Arguments
6433    ///
6434    /// * `pattern` - The text to match.
6435    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6436    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
6437        let mut query = self.selection.select("search");
6438        query = query.arg("pattern", pattern.into());
6439        vec![SearchResult {
6440            proc: self.proc.clone(),
6441            selection: query,
6442            graphql_client: self.graphql_client.clone(),
6443        }]
6444    }
6445    /// Searches for content matching the given regular expression or literal string.
6446    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
6447    ///
6448    /// # Arguments
6449    ///
6450    /// * `pattern` - The text to match.
6451    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6452    pub fn search_opts<'a>(
6453        &self,
6454        pattern: impl Into<String>,
6455        opts: DirectorySearchOpts<'a>,
6456    ) -> Vec<SearchResult> {
6457        let mut query = self.selection.select("search");
6458        query = query.arg("pattern", pattern.into());
6459        if let Some(paths) = opts.paths {
6460            query = query.arg("paths", paths);
6461        }
6462        if let Some(globs) = opts.globs {
6463            query = query.arg("globs", globs);
6464        }
6465        if let Some(literal) = opts.literal {
6466            query = query.arg("literal", literal);
6467        }
6468        if let Some(multiline) = opts.multiline {
6469            query = query.arg("multiline", multiline);
6470        }
6471        if let Some(dotall) = opts.dotall {
6472            query = query.arg("dotall", dotall);
6473        }
6474        if let Some(insensitive) = opts.insensitive {
6475            query = query.arg("insensitive", insensitive);
6476        }
6477        if let Some(skip_ignored) = opts.skip_ignored {
6478            query = query.arg("skipIgnored", skip_ignored);
6479        }
6480        if let Some(skip_hidden) = opts.skip_hidden {
6481            query = query.arg("skipHidden", skip_hidden);
6482        }
6483        if let Some(files_only) = opts.files_only {
6484            query = query.arg("filesOnly", files_only);
6485        }
6486        if let Some(limit) = opts.limit {
6487            query = query.arg("limit", limit);
6488        }
6489        vec![SearchResult {
6490            proc: self.proc.clone(),
6491            selection: query,
6492            graphql_client: self.graphql_client.clone(),
6493        }]
6494    }
6495    /// Return file status
6496    ///
6497    /// # Arguments
6498    ///
6499    /// * `path` - Path to stat (e.g., "/file.txt").
6500    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6501    pub fn stat(&self, path: impl Into<String>) -> Stat {
6502        let mut query = self.selection.select("stat");
6503        query = query.arg("path", path.into());
6504        Stat {
6505            proc: self.proc.clone(),
6506            selection: query,
6507            graphql_client: self.graphql_client.clone(),
6508        }
6509    }
6510    /// Return file status
6511    ///
6512    /// # Arguments
6513    ///
6514    /// * `path` - Path to stat (e.g., "/file.txt").
6515    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6516    pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
6517        let mut query = self.selection.select("stat");
6518        query = query.arg("path", path.into());
6519        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
6520            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
6521        }
6522        Stat {
6523            proc: self.proc.clone(),
6524            selection: query,
6525            graphql_client: self.graphql_client.clone(),
6526        }
6527    }
6528    /// Force evaluation in the engine.
6529    pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
6530        let query = self.selection.select("sync");
6531        query.execute(self.graphql_client.clone()).await
6532    }
6533    /// Opens an interactive terminal in new container with this directory mounted inside.
6534    ///
6535    /// # Arguments
6536    ///
6537    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6538    pub fn terminal(&self) -> Directory {
6539        let query = self.selection.select("terminal");
6540        Directory {
6541            proc: self.proc.clone(),
6542            selection: query,
6543            graphql_client: self.graphql_client.clone(),
6544        }
6545    }
6546    /// Opens an interactive terminal in new container with this directory mounted inside.
6547    ///
6548    /// # Arguments
6549    ///
6550    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6551    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
6552        let mut query = self.selection.select("terminal");
6553        if let Some(container) = opts.container {
6554            query = query.arg("container", container);
6555        }
6556        if let Some(cmd) = opts.cmd {
6557            query = query.arg("cmd", cmd);
6558        }
6559        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
6560            query = query.arg(
6561                "experimentalPrivilegedNesting",
6562                experimental_privileged_nesting,
6563            );
6564        }
6565        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
6566            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
6567        }
6568        Directory {
6569            proc: self.proc.clone(),
6570            selection: query,
6571            graphql_client: self.graphql_client.clone(),
6572        }
6573    }
6574    /// Return a directory with changes from another directory applied to it.
6575    ///
6576    /// # Arguments
6577    ///
6578    /// * `changes` - Changes to apply to the directory
6579    pub fn with_changes(&self, changes: impl IntoID<ChangesetId>) -> Directory {
6580        let mut query = self.selection.select("withChanges");
6581        query = query.arg_lazy(
6582            "changes",
6583            Box::new(move || {
6584                let changes = changes.clone();
6585                Box::pin(async move { changes.into_id().await.unwrap().quote() })
6586            }),
6587        );
6588        Directory {
6589            proc: self.proc.clone(),
6590            selection: query,
6591            graphql_client: self.graphql_client.clone(),
6592        }
6593    }
6594    /// Return a snapshot with a directory added
6595    ///
6596    /// # Arguments
6597    ///
6598    /// * `path` - Location of the written directory (e.g., "/src/").
6599    /// * `source` - Identifier of the directory to copy.
6600    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6601    pub fn with_directory(
6602        &self,
6603        path: impl Into<String>,
6604        source: impl IntoID<DirectoryId>,
6605    ) -> Directory {
6606        let mut query = self.selection.select("withDirectory");
6607        query = query.arg("path", path.into());
6608        query = query.arg_lazy(
6609            "source",
6610            Box::new(move || {
6611                let source = source.clone();
6612                Box::pin(async move { source.into_id().await.unwrap().quote() })
6613            }),
6614        );
6615        Directory {
6616            proc: self.proc.clone(),
6617            selection: query,
6618            graphql_client: self.graphql_client.clone(),
6619        }
6620    }
6621    /// Return a snapshot with a directory added
6622    ///
6623    /// # Arguments
6624    ///
6625    /// * `path` - Location of the written directory (e.g., "/src/").
6626    /// * `source` - Identifier of the directory to copy.
6627    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6628    pub fn with_directory_opts<'a>(
6629        &self,
6630        path: impl Into<String>,
6631        source: impl IntoID<DirectoryId>,
6632        opts: DirectoryWithDirectoryOpts<'a>,
6633    ) -> Directory {
6634        let mut query = self.selection.select("withDirectory");
6635        query = query.arg("path", path.into());
6636        query = query.arg_lazy(
6637            "source",
6638            Box::new(move || {
6639                let source = source.clone();
6640                Box::pin(async move { source.into_id().await.unwrap().quote() })
6641            }),
6642        );
6643        if let Some(exclude) = opts.exclude {
6644            query = query.arg("exclude", exclude);
6645        }
6646        if let Some(include) = opts.include {
6647            query = query.arg("include", include);
6648        }
6649        if let Some(gitignore) = opts.gitignore {
6650            query = query.arg("gitignore", gitignore);
6651        }
6652        if let Some(owner) = opts.owner {
6653            query = query.arg("owner", owner);
6654        }
6655        Directory {
6656            proc: self.proc.clone(),
6657            selection: query,
6658            graphql_client: self.graphql_client.clone(),
6659        }
6660    }
6661    /// Raise an error.
6662    ///
6663    /// # Arguments
6664    ///
6665    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
6666    pub fn with_error(&self, err: impl Into<String>) -> Directory {
6667        let mut query = self.selection.select("withError");
6668        query = query.arg("err", err.into());
6669        Directory {
6670            proc: self.proc.clone(),
6671            selection: query,
6672            graphql_client: self.graphql_client.clone(),
6673        }
6674    }
6675    /// Retrieves this directory plus the contents of the given file copied to the given path.
6676    ///
6677    /// # Arguments
6678    ///
6679    /// * `path` - Location of the copied file (e.g., "/file.txt").
6680    /// * `source` - Identifier of the file to copy.
6681    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6682    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
6683        let mut query = self.selection.select("withFile");
6684        query = query.arg("path", path.into());
6685        query = query.arg_lazy(
6686            "source",
6687            Box::new(move || {
6688                let source = source.clone();
6689                Box::pin(async move { source.into_id().await.unwrap().quote() })
6690            }),
6691        );
6692        Directory {
6693            proc: self.proc.clone(),
6694            selection: query,
6695            graphql_client: self.graphql_client.clone(),
6696        }
6697    }
6698    /// Retrieves this directory plus the contents of the given file copied to the given path.
6699    ///
6700    /// # Arguments
6701    ///
6702    /// * `path` - Location of the copied file (e.g., "/file.txt").
6703    /// * `source` - Identifier of the file to copy.
6704    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6705    pub fn with_file_opts<'a>(
6706        &self,
6707        path: impl Into<String>,
6708        source: impl IntoID<FileId>,
6709        opts: DirectoryWithFileOpts<'a>,
6710    ) -> Directory {
6711        let mut query = self.selection.select("withFile");
6712        query = query.arg("path", path.into());
6713        query = query.arg_lazy(
6714            "source",
6715            Box::new(move || {
6716                let source = source.clone();
6717                Box::pin(async move { source.into_id().await.unwrap().quote() })
6718            }),
6719        );
6720        if let Some(permissions) = opts.permissions {
6721            query = query.arg("permissions", permissions);
6722        }
6723        if let Some(owner) = opts.owner {
6724            query = query.arg("owner", owner);
6725        }
6726        Directory {
6727            proc: self.proc.clone(),
6728            selection: query,
6729            graphql_client: self.graphql_client.clone(),
6730        }
6731    }
6732    /// Retrieves this directory plus the contents of the given files copied to the given path.
6733    ///
6734    /// # Arguments
6735    ///
6736    /// * `path` - Location where copied files should be placed (e.g., "/src").
6737    /// * `sources` - Identifiers of the files to copy.
6738    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6739    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
6740        let mut query = self.selection.select("withFiles");
6741        query = query.arg("path", path.into());
6742        query = query.arg("sources", sources);
6743        Directory {
6744            proc: self.proc.clone(),
6745            selection: query,
6746            graphql_client: self.graphql_client.clone(),
6747        }
6748    }
6749    /// Retrieves this directory plus the contents of the given files copied to the given path.
6750    ///
6751    /// # Arguments
6752    ///
6753    /// * `path` - Location where copied files should be placed (e.g., "/src").
6754    /// * `sources` - Identifiers of the files to copy.
6755    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6756    pub fn with_files_opts(
6757        &self,
6758        path: impl Into<String>,
6759        sources: Vec<FileId>,
6760        opts: DirectoryWithFilesOpts,
6761    ) -> Directory {
6762        let mut query = self.selection.select("withFiles");
6763        query = query.arg("path", path.into());
6764        query = query.arg("sources", sources);
6765        if let Some(permissions) = opts.permissions {
6766            query = query.arg("permissions", permissions);
6767        }
6768        Directory {
6769            proc: self.proc.clone(),
6770            selection: query,
6771            graphql_client: self.graphql_client.clone(),
6772        }
6773    }
6774    /// Retrieves this directory plus a new directory created at the given path.
6775    ///
6776    /// # Arguments
6777    ///
6778    /// * `path` - Location of the directory created (e.g., "/logs").
6779    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6780    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
6781        let mut query = self.selection.select("withNewDirectory");
6782        query = query.arg("path", path.into());
6783        Directory {
6784            proc: self.proc.clone(),
6785            selection: query,
6786            graphql_client: self.graphql_client.clone(),
6787        }
6788    }
6789    /// Retrieves this directory plus a new directory created at the given path.
6790    ///
6791    /// # Arguments
6792    ///
6793    /// * `path` - Location of the directory created (e.g., "/logs").
6794    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6795    pub fn with_new_directory_opts(
6796        &self,
6797        path: impl Into<String>,
6798        opts: DirectoryWithNewDirectoryOpts,
6799    ) -> Directory {
6800        let mut query = self.selection.select("withNewDirectory");
6801        query = query.arg("path", path.into());
6802        if let Some(permissions) = opts.permissions {
6803            query = query.arg("permissions", permissions);
6804        }
6805        Directory {
6806            proc: self.proc.clone(),
6807            selection: query,
6808            graphql_client: self.graphql_client.clone(),
6809        }
6810    }
6811    /// Return a snapshot with a new file added
6812    ///
6813    /// # Arguments
6814    ///
6815    /// * `path` - Path of the new file. Example: "foo/bar.txt"
6816    /// * `contents` - Contents of the new file. Example: "Hello world!"
6817    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6818    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
6819        let mut query = self.selection.select("withNewFile");
6820        query = query.arg("path", path.into());
6821        query = query.arg("contents", contents.into());
6822        Directory {
6823            proc: self.proc.clone(),
6824            selection: query,
6825            graphql_client: self.graphql_client.clone(),
6826        }
6827    }
6828    /// Return a snapshot with a new file added
6829    ///
6830    /// # Arguments
6831    ///
6832    /// * `path` - Path of the new file. Example: "foo/bar.txt"
6833    /// * `contents` - Contents of the new file. Example: "Hello world!"
6834    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6835    pub fn with_new_file_opts(
6836        &self,
6837        path: impl Into<String>,
6838        contents: impl Into<String>,
6839        opts: DirectoryWithNewFileOpts,
6840    ) -> Directory {
6841        let mut query = self.selection.select("withNewFile");
6842        query = query.arg("path", path.into());
6843        query = query.arg("contents", contents.into());
6844        if let Some(permissions) = opts.permissions {
6845            query = query.arg("permissions", permissions);
6846        }
6847        Directory {
6848            proc: self.proc.clone(),
6849            selection: query,
6850            graphql_client: self.graphql_client.clone(),
6851        }
6852    }
6853    /// Retrieves this directory with the given Git-compatible patch applied.
6854    ///
6855    /// # Arguments
6856    ///
6857    /// * `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").
6858    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
6859        let mut query = self.selection.select("withPatch");
6860        query = query.arg("patch", patch.into());
6861        Directory {
6862            proc: self.proc.clone(),
6863            selection: query,
6864            graphql_client: self.graphql_client.clone(),
6865        }
6866    }
6867    /// Retrieves this directory with the given Git-compatible patch file applied.
6868    ///
6869    /// # Arguments
6870    ///
6871    /// * `patch` - File containing the patch to apply
6872    pub fn with_patch_file(&self, patch: impl IntoID<FileId>) -> Directory {
6873        let mut query = self.selection.select("withPatchFile");
6874        query = query.arg_lazy(
6875            "patch",
6876            Box::new(move || {
6877                let patch = patch.clone();
6878                Box::pin(async move { patch.into_id().await.unwrap().quote() })
6879            }),
6880        );
6881        Directory {
6882            proc: self.proc.clone(),
6883            selection: query,
6884            graphql_client: self.graphql_client.clone(),
6885        }
6886    }
6887    /// Return a snapshot with a symlink
6888    ///
6889    /// # Arguments
6890    ///
6891    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
6892    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
6893    pub fn with_symlink(
6894        &self,
6895        target: impl Into<String>,
6896        link_name: impl Into<String>,
6897    ) -> Directory {
6898        let mut query = self.selection.select("withSymlink");
6899        query = query.arg("target", target.into());
6900        query = query.arg("linkName", link_name.into());
6901        Directory {
6902            proc: self.proc.clone(),
6903            selection: query,
6904            graphql_client: self.graphql_client.clone(),
6905        }
6906    }
6907    /// Retrieves this directory with all file/dir timestamps set to the given time.
6908    ///
6909    /// # Arguments
6910    ///
6911    /// * `timestamp` - Timestamp to set dir/files in.
6912    ///
6913    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
6914    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
6915        let mut query = self.selection.select("withTimestamps");
6916        query = query.arg("timestamp", timestamp);
6917        Directory {
6918            proc: self.proc.clone(),
6919            selection: query,
6920            graphql_client: self.graphql_client.clone(),
6921        }
6922    }
6923    /// Return a snapshot with a subdirectory removed
6924    ///
6925    /// # Arguments
6926    ///
6927    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
6928    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
6929        let mut query = self.selection.select("withoutDirectory");
6930        query = query.arg("path", path.into());
6931        Directory {
6932            proc: self.proc.clone(),
6933            selection: query,
6934            graphql_client: self.graphql_client.clone(),
6935        }
6936    }
6937    /// Return a snapshot with a file removed
6938    ///
6939    /// # Arguments
6940    ///
6941    /// * `path` - Path of the file to remove (e.g., "/file.txt").
6942    pub fn without_file(&self, path: impl Into<String>) -> Directory {
6943        let mut query = self.selection.select("withoutFile");
6944        query = query.arg("path", path.into());
6945        Directory {
6946            proc: self.proc.clone(),
6947            selection: query,
6948            graphql_client: self.graphql_client.clone(),
6949        }
6950    }
6951    /// Return a snapshot with files removed
6952    ///
6953    /// # Arguments
6954    ///
6955    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
6956    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
6957        let mut query = self.selection.select("withoutFiles");
6958        query = query.arg(
6959            "paths",
6960            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
6961        );
6962        Directory {
6963            proc: self.proc.clone(),
6964            selection: query,
6965            graphql_client: self.graphql_client.clone(),
6966        }
6967    }
6968}
6969#[derive(Clone)]
6970pub struct Engine {
6971    pub proc: Option<Arc<DaggerSessionProc>>,
6972    pub selection: Selection,
6973    pub graphql_client: DynGraphQLClient,
6974}
6975impl Engine {
6976    /// The list of connected client IDs
6977    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
6978        let query = self.selection.select("clients");
6979        query.execute(self.graphql_client.clone()).await
6980    }
6981    /// A unique identifier for this Engine.
6982    pub async fn id(&self) -> Result<EngineId, DaggerError> {
6983        let query = self.selection.select("id");
6984        query.execute(self.graphql_client.clone()).await
6985    }
6986    /// The local (on-disk) cache for the Dagger engine
6987    pub fn local_cache(&self) -> EngineCache {
6988        let query = self.selection.select("localCache");
6989        EngineCache {
6990            proc: self.proc.clone(),
6991            selection: query,
6992            graphql_client: self.graphql_client.clone(),
6993        }
6994    }
6995    /// The name of the engine instance.
6996    pub async fn name(&self) -> Result<String, DaggerError> {
6997        let query = self.selection.select("name");
6998        query.execute(self.graphql_client.clone()).await
6999    }
7000}
7001#[derive(Clone)]
7002pub struct EngineCache {
7003    pub proc: Option<Arc<DaggerSessionProc>>,
7004    pub selection: Selection,
7005    pub graphql_client: DynGraphQLClient,
7006}
7007#[derive(Builder, Debug, PartialEq)]
7008pub struct EngineCacheEntrySetOpts<'a> {
7009    #[builder(setter(into, strip_option), default)]
7010    pub key: Option<&'a str>,
7011}
7012#[derive(Builder, Debug, PartialEq)]
7013pub struct EngineCachePruneOpts<'a> {
7014    /// Override the maximum disk space to keep before pruning (e.g. "200GB" or "80%").
7015    #[builder(setter(into, strip_option), default)]
7016    pub max_used_space: Option<&'a str>,
7017    /// Override the minimum free disk space target during pruning (e.g. "20GB" or "20%").
7018    #[builder(setter(into, strip_option), default)]
7019    pub min_free_space: Option<&'a str>,
7020    /// Override the minimum disk space to retain during pruning (e.g. "500GB" or "10%").
7021    #[builder(setter(into, strip_option), default)]
7022    pub reserved_space: Option<&'a str>,
7023    /// Override the target disk space to keep after pruning (e.g. "200GB" or "50%").
7024    #[builder(setter(into, strip_option), default)]
7025    pub target_space: Option<&'a str>,
7026    /// Use the engine-wide default pruning policy if true, otherwise prune the whole cache of any releasable entries.
7027    #[builder(setter(into, strip_option), default)]
7028    pub use_default_policy: Option<bool>,
7029}
7030impl EngineCache {
7031    /// The current set of entries in the cache
7032    ///
7033    /// # Arguments
7034    ///
7035    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7036    pub fn entry_set(&self) -> EngineCacheEntrySet {
7037        let query = self.selection.select("entrySet");
7038        EngineCacheEntrySet {
7039            proc: self.proc.clone(),
7040            selection: query,
7041            graphql_client: self.graphql_client.clone(),
7042        }
7043    }
7044    /// The current set of entries in the cache
7045    ///
7046    /// # Arguments
7047    ///
7048    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7049    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
7050        let mut query = self.selection.select("entrySet");
7051        if let Some(key) = opts.key {
7052            query = query.arg("key", key);
7053        }
7054        EngineCacheEntrySet {
7055            proc: self.proc.clone(),
7056            selection: query,
7057            graphql_client: self.graphql_client.clone(),
7058        }
7059    }
7060    /// A unique identifier for this EngineCache.
7061    pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
7062        let query = self.selection.select("id");
7063        query.execute(self.graphql_client.clone()).await
7064    }
7065    /// The maximum bytes to keep in the cache without pruning.
7066    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
7067        let query = self.selection.select("maxUsedSpace");
7068        query.execute(self.graphql_client.clone()).await
7069    }
7070    /// The target amount of free disk space the garbage collector will attempt to leave.
7071    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
7072        let query = self.selection.select("minFreeSpace");
7073        query.execute(self.graphql_client.clone()).await
7074    }
7075    /// Prune the cache of releaseable entries
7076    ///
7077    /// # Arguments
7078    ///
7079    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7080    pub async fn prune(&self) -> Result<Void, DaggerError> {
7081        let query = self.selection.select("prune");
7082        query.execute(self.graphql_client.clone()).await
7083    }
7084    /// Prune the cache of releaseable entries
7085    ///
7086    /// # Arguments
7087    ///
7088    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7089    pub async fn prune_opts<'a>(
7090        &self,
7091        opts: EngineCachePruneOpts<'a>,
7092    ) -> Result<Void, DaggerError> {
7093        let mut query = self.selection.select("prune");
7094        if let Some(use_default_policy) = opts.use_default_policy {
7095            query = query.arg("useDefaultPolicy", use_default_policy);
7096        }
7097        if let Some(max_used_space) = opts.max_used_space {
7098            query = query.arg("maxUsedSpace", max_used_space);
7099        }
7100        if let Some(reserved_space) = opts.reserved_space {
7101            query = query.arg("reservedSpace", reserved_space);
7102        }
7103        if let Some(min_free_space) = opts.min_free_space {
7104            query = query.arg("minFreeSpace", min_free_space);
7105        }
7106        if let Some(target_space) = opts.target_space {
7107            query = query.arg("targetSpace", target_space);
7108        }
7109        query.execute(self.graphql_client.clone()).await
7110    }
7111    /// The minimum amount of disk space this policy is guaranteed to retain.
7112    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
7113        let query = self.selection.select("reservedSpace");
7114        query.execute(self.graphql_client.clone()).await
7115    }
7116    /// The target number of bytes to keep when pruning.
7117    pub async fn target_space(&self) -> Result<isize, DaggerError> {
7118        let query = self.selection.select("targetSpace");
7119        query.execute(self.graphql_client.clone()).await
7120    }
7121}
7122#[derive(Clone)]
7123pub struct EngineCacheEntry {
7124    pub proc: Option<Arc<DaggerSessionProc>>,
7125    pub selection: Selection,
7126    pub graphql_client: DynGraphQLClient,
7127}
7128impl EngineCacheEntry {
7129    /// Whether the cache entry is actively being used.
7130    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
7131        let query = self.selection.select("activelyUsed");
7132        query.execute(self.graphql_client.clone()).await
7133    }
7134    /// The time the cache entry was created, in Unix nanoseconds.
7135    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
7136        let query = self.selection.select("createdTimeUnixNano");
7137        query.execute(self.graphql_client.clone()).await
7138    }
7139    /// The description of the cache entry.
7140    pub async fn description(&self) -> Result<String, DaggerError> {
7141        let query = self.selection.select("description");
7142        query.execute(self.graphql_client.clone()).await
7143    }
7144    /// The disk space used by the cache entry.
7145    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
7146        let query = self.selection.select("diskSpaceBytes");
7147        query.execute(self.graphql_client.clone()).await
7148    }
7149    /// A unique identifier for this EngineCacheEntry.
7150    pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
7151        let query = self.selection.select("id");
7152        query.execute(self.graphql_client.clone()).await
7153    }
7154    /// The most recent time the cache entry was used, in Unix nanoseconds.
7155    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
7156        let query = self.selection.select("mostRecentUseTimeUnixNano");
7157        query.execute(self.graphql_client.clone()).await
7158    }
7159    /// The type of the cache record (e.g. regular, internal, frontend, source.local, source.git.checkout, exec.cachemount).
7160    pub async fn record_type(&self) -> Result<String, DaggerError> {
7161        let query = self.selection.select("recordType");
7162        query.execute(self.graphql_client.clone()).await
7163    }
7164}
7165#[derive(Clone)]
7166pub struct EngineCacheEntrySet {
7167    pub proc: Option<Arc<DaggerSessionProc>>,
7168    pub selection: Selection,
7169    pub graphql_client: DynGraphQLClient,
7170}
7171impl EngineCacheEntrySet {
7172    /// The total disk space used by the cache entries in this set.
7173    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
7174        let query = self.selection.select("diskSpaceBytes");
7175        query.execute(self.graphql_client.clone()).await
7176    }
7177    /// The list of individual cache entries in the set
7178    pub fn entries(&self) -> Vec<EngineCacheEntry> {
7179        let query = self.selection.select("entries");
7180        vec![EngineCacheEntry {
7181            proc: self.proc.clone(),
7182            selection: query,
7183            graphql_client: self.graphql_client.clone(),
7184        }]
7185    }
7186    /// The number of cache entries in this set.
7187    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
7188        let query = self.selection.select("entryCount");
7189        query.execute(self.graphql_client.clone()).await
7190    }
7191    /// A unique identifier for this EngineCacheEntrySet.
7192    pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
7193        let query = self.selection.select("id");
7194        query.execute(self.graphql_client.clone()).await
7195    }
7196}
7197#[derive(Clone)]
7198pub struct EnumTypeDef {
7199    pub proc: Option<Arc<DaggerSessionProc>>,
7200    pub selection: Selection,
7201    pub graphql_client: DynGraphQLClient,
7202}
7203impl EnumTypeDef {
7204    /// A doc string for the enum, if any.
7205    pub async fn description(&self) -> Result<String, DaggerError> {
7206        let query = self.selection.select("description");
7207        query.execute(self.graphql_client.clone()).await
7208    }
7209    /// A unique identifier for this EnumTypeDef.
7210    pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
7211        let query = self.selection.select("id");
7212        query.execute(self.graphql_client.clone()).await
7213    }
7214    /// The members of the enum.
7215    pub fn members(&self) -> Vec<EnumValueTypeDef> {
7216        let query = self.selection.select("members");
7217        vec![EnumValueTypeDef {
7218            proc: self.proc.clone(),
7219            selection: query,
7220            graphql_client: self.graphql_client.clone(),
7221        }]
7222    }
7223    /// The name of the enum.
7224    pub async fn name(&self) -> Result<String, DaggerError> {
7225        let query = self.selection.select("name");
7226        query.execute(self.graphql_client.clone()).await
7227    }
7228    /// The location of this enum declaration.
7229    pub fn source_map(&self) -> SourceMap {
7230        let query = self.selection.select("sourceMap");
7231        SourceMap {
7232            proc: self.proc.clone(),
7233            selection: query,
7234            graphql_client: self.graphql_client.clone(),
7235        }
7236    }
7237    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
7238    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
7239        let query = self.selection.select("sourceModuleName");
7240        query.execute(self.graphql_client.clone()).await
7241    }
7242    pub fn values(&self) -> Vec<EnumValueTypeDef> {
7243        let query = self.selection.select("values");
7244        vec![EnumValueTypeDef {
7245            proc: self.proc.clone(),
7246            selection: query,
7247            graphql_client: self.graphql_client.clone(),
7248        }]
7249    }
7250}
7251#[derive(Clone)]
7252pub struct EnumValueTypeDef {
7253    pub proc: Option<Arc<DaggerSessionProc>>,
7254    pub selection: Selection,
7255    pub graphql_client: DynGraphQLClient,
7256}
7257impl EnumValueTypeDef {
7258    /// The reason this enum member is deprecated, if any.
7259    pub async fn deprecated(&self) -> Result<String, DaggerError> {
7260        let query = self.selection.select("deprecated");
7261        query.execute(self.graphql_client.clone()).await
7262    }
7263    /// A doc string for the enum member, if any.
7264    pub async fn description(&self) -> Result<String, DaggerError> {
7265        let query = self.selection.select("description");
7266        query.execute(self.graphql_client.clone()).await
7267    }
7268    /// A unique identifier for this EnumValueTypeDef.
7269    pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
7270        let query = self.selection.select("id");
7271        query.execute(self.graphql_client.clone()).await
7272    }
7273    /// The name of the enum member.
7274    pub async fn name(&self) -> Result<String, DaggerError> {
7275        let query = self.selection.select("name");
7276        query.execute(self.graphql_client.clone()).await
7277    }
7278    /// The location of this enum member declaration.
7279    pub fn source_map(&self) -> SourceMap {
7280        let query = self.selection.select("sourceMap");
7281        SourceMap {
7282            proc: self.proc.clone(),
7283            selection: query,
7284            graphql_client: self.graphql_client.clone(),
7285        }
7286    }
7287    /// The value of the enum member
7288    pub async fn value(&self) -> Result<String, DaggerError> {
7289        let query = self.selection.select("value");
7290        query.execute(self.graphql_client.clone()).await
7291    }
7292}
7293#[derive(Clone)]
7294pub struct Env {
7295    pub proc: Option<Arc<DaggerSessionProc>>,
7296    pub selection: Selection,
7297    pub graphql_client: DynGraphQLClient,
7298}
7299#[derive(Builder, Debug, PartialEq)]
7300pub struct EnvChecksOpts<'a> {
7301    /// Only include checks matching the specified patterns
7302    #[builder(setter(into, strip_option), default)]
7303    pub include: Option<Vec<&'a str>>,
7304}
7305#[derive(Builder, Debug, PartialEq)]
7306pub struct EnvServicesOpts<'a> {
7307    /// Only include services matching the specified patterns
7308    #[builder(setter(into, strip_option), default)]
7309    pub include: Option<Vec<&'a str>>,
7310}
7311impl Env {
7312    /// Return the check with the given name from the installed modules. Must match exactly one check.
7313    ///
7314    /// # Arguments
7315    ///
7316    /// * `name` - The name of the check to retrieve
7317    pub fn check(&self, name: impl Into<String>) -> Check {
7318        let mut query = self.selection.select("check");
7319        query = query.arg("name", name.into());
7320        Check {
7321            proc: self.proc.clone(),
7322            selection: query,
7323            graphql_client: self.graphql_client.clone(),
7324        }
7325    }
7326    /// Return all checks defined by the installed modules
7327    ///
7328    /// # Arguments
7329    ///
7330    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7331    pub fn checks(&self) -> CheckGroup {
7332        let query = self.selection.select("checks");
7333        CheckGroup {
7334            proc: self.proc.clone(),
7335            selection: query,
7336            graphql_client: self.graphql_client.clone(),
7337        }
7338    }
7339    /// Return all checks defined by the installed modules
7340    ///
7341    /// # Arguments
7342    ///
7343    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7344    pub fn checks_opts<'a>(&self, opts: EnvChecksOpts<'a>) -> CheckGroup {
7345        let mut query = self.selection.select("checks");
7346        if let Some(include) = opts.include {
7347            query = query.arg("include", include);
7348        }
7349        CheckGroup {
7350            proc: self.proc.clone(),
7351            selection: query,
7352            graphql_client: self.graphql_client.clone(),
7353        }
7354    }
7355    /// A unique identifier for this Env.
7356    pub async fn id(&self) -> Result<EnvId, DaggerError> {
7357        let query = self.selection.select("id");
7358        query.execute(self.graphql_client.clone()).await
7359    }
7360    /// Retrieves an input binding by name
7361    pub fn input(&self, name: impl Into<String>) -> Binding {
7362        let mut query = self.selection.select("input");
7363        query = query.arg("name", name.into());
7364        Binding {
7365            proc: self.proc.clone(),
7366            selection: query,
7367            graphql_client: self.graphql_client.clone(),
7368        }
7369    }
7370    /// Returns all input bindings provided to the environment
7371    pub fn inputs(&self) -> Vec<Binding> {
7372        let query = self.selection.select("inputs");
7373        vec![Binding {
7374            proc: self.proc.clone(),
7375            selection: query,
7376            graphql_client: self.graphql_client.clone(),
7377        }]
7378    }
7379    /// Retrieves an output binding by name
7380    pub fn output(&self, name: impl Into<String>) -> Binding {
7381        let mut query = self.selection.select("output");
7382        query = query.arg("name", name.into());
7383        Binding {
7384            proc: self.proc.clone(),
7385            selection: query,
7386            graphql_client: self.graphql_client.clone(),
7387        }
7388    }
7389    /// Returns all declared output bindings for the environment
7390    pub fn outputs(&self) -> Vec<Binding> {
7391        let query = self.selection.select("outputs");
7392        vec![Binding {
7393            proc: self.proc.clone(),
7394            selection: query,
7395            graphql_client: self.graphql_client.clone(),
7396        }]
7397    }
7398    /// Return all services defined by the installed modules
7399    ///
7400    /// # Arguments
7401    ///
7402    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7403    pub fn services(&self) -> UpGroup {
7404        let query = self.selection.select("services");
7405        UpGroup {
7406            proc: self.proc.clone(),
7407            selection: query,
7408            graphql_client: self.graphql_client.clone(),
7409        }
7410    }
7411    /// Return all services defined by the installed modules
7412    ///
7413    /// # Arguments
7414    ///
7415    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7416    pub fn services_opts<'a>(&self, opts: EnvServicesOpts<'a>) -> UpGroup {
7417        let mut query = self.selection.select("services");
7418        if let Some(include) = opts.include {
7419            query = query.arg("include", include);
7420        }
7421        UpGroup {
7422            proc: self.proc.clone(),
7423            selection: query,
7424            graphql_client: self.graphql_client.clone(),
7425        }
7426    }
7427    /// Create or update a binding of type Address in the environment
7428    ///
7429    /// # Arguments
7430    ///
7431    /// * `name` - The name of the binding
7432    /// * `value` - The Address value to assign to the binding
7433    /// * `description` - The purpose of the input
7434    pub fn with_address_input(
7435        &self,
7436        name: impl Into<String>,
7437        value: impl IntoID<AddressId>,
7438        description: impl Into<String>,
7439    ) -> Env {
7440        let mut query = self.selection.select("withAddressInput");
7441        query = query.arg("name", name.into());
7442        query = query.arg_lazy(
7443            "value",
7444            Box::new(move || {
7445                let value = value.clone();
7446                Box::pin(async move { value.into_id().await.unwrap().quote() })
7447            }),
7448        );
7449        query = query.arg("description", description.into());
7450        Env {
7451            proc: self.proc.clone(),
7452            selection: query,
7453            graphql_client: self.graphql_client.clone(),
7454        }
7455    }
7456    /// Declare a desired Address output to be assigned in the environment
7457    ///
7458    /// # Arguments
7459    ///
7460    /// * `name` - The name of the binding
7461    /// * `description` - A description of the desired value of the binding
7462    pub fn with_address_output(
7463        &self,
7464        name: impl Into<String>,
7465        description: impl Into<String>,
7466    ) -> Env {
7467        let mut query = self.selection.select("withAddressOutput");
7468        query = query.arg("name", name.into());
7469        query = query.arg("description", description.into());
7470        Env {
7471            proc: self.proc.clone(),
7472            selection: query,
7473            graphql_client: self.graphql_client.clone(),
7474        }
7475    }
7476    /// Create or update a binding of type CacheVolume in the environment
7477    ///
7478    /// # Arguments
7479    ///
7480    /// * `name` - The name of the binding
7481    /// * `value` - The CacheVolume value to assign to the binding
7482    /// * `description` - The purpose of the input
7483    pub fn with_cache_volume_input(
7484        &self,
7485        name: impl Into<String>,
7486        value: impl IntoID<CacheVolumeId>,
7487        description: impl Into<String>,
7488    ) -> Env {
7489        let mut query = self.selection.select("withCacheVolumeInput");
7490        query = query.arg("name", name.into());
7491        query = query.arg_lazy(
7492            "value",
7493            Box::new(move || {
7494                let value = value.clone();
7495                Box::pin(async move { value.into_id().await.unwrap().quote() })
7496            }),
7497        );
7498        query = query.arg("description", description.into());
7499        Env {
7500            proc: self.proc.clone(),
7501            selection: query,
7502            graphql_client: self.graphql_client.clone(),
7503        }
7504    }
7505    /// Declare a desired CacheVolume output to be assigned in the environment
7506    ///
7507    /// # Arguments
7508    ///
7509    /// * `name` - The name of the binding
7510    /// * `description` - A description of the desired value of the binding
7511    pub fn with_cache_volume_output(
7512        &self,
7513        name: impl Into<String>,
7514        description: impl Into<String>,
7515    ) -> Env {
7516        let mut query = self.selection.select("withCacheVolumeOutput");
7517        query = query.arg("name", name.into());
7518        query = query.arg("description", description.into());
7519        Env {
7520            proc: self.proc.clone(),
7521            selection: query,
7522            graphql_client: self.graphql_client.clone(),
7523        }
7524    }
7525    /// Create or update a binding of type Changeset in the environment
7526    ///
7527    /// # Arguments
7528    ///
7529    /// * `name` - The name of the binding
7530    /// * `value` - The Changeset value to assign to the binding
7531    /// * `description` - The purpose of the input
7532    pub fn with_changeset_input(
7533        &self,
7534        name: impl Into<String>,
7535        value: impl IntoID<ChangesetId>,
7536        description: impl Into<String>,
7537    ) -> Env {
7538        let mut query = self.selection.select("withChangesetInput");
7539        query = query.arg("name", name.into());
7540        query = query.arg_lazy(
7541            "value",
7542            Box::new(move || {
7543                let value = value.clone();
7544                Box::pin(async move { value.into_id().await.unwrap().quote() })
7545            }),
7546        );
7547        query = query.arg("description", description.into());
7548        Env {
7549            proc: self.proc.clone(),
7550            selection: query,
7551            graphql_client: self.graphql_client.clone(),
7552        }
7553    }
7554    /// Declare a desired Changeset output to be assigned in the environment
7555    ///
7556    /// # Arguments
7557    ///
7558    /// * `name` - The name of the binding
7559    /// * `description` - A description of the desired value of the binding
7560    pub fn with_changeset_output(
7561        &self,
7562        name: impl Into<String>,
7563        description: impl Into<String>,
7564    ) -> Env {
7565        let mut query = self.selection.select("withChangesetOutput");
7566        query = query.arg("name", name.into());
7567        query = query.arg("description", description.into());
7568        Env {
7569            proc: self.proc.clone(),
7570            selection: query,
7571            graphql_client: self.graphql_client.clone(),
7572        }
7573    }
7574    /// Create or update a binding of type CheckGroup in the environment
7575    ///
7576    /// # Arguments
7577    ///
7578    /// * `name` - The name of the binding
7579    /// * `value` - The CheckGroup value to assign to the binding
7580    /// * `description` - The purpose of the input
7581    pub fn with_check_group_input(
7582        &self,
7583        name: impl Into<String>,
7584        value: impl IntoID<CheckGroupId>,
7585        description: impl Into<String>,
7586    ) -> Env {
7587        let mut query = self.selection.select("withCheckGroupInput");
7588        query = query.arg("name", name.into());
7589        query = query.arg_lazy(
7590            "value",
7591            Box::new(move || {
7592                let value = value.clone();
7593                Box::pin(async move { value.into_id().await.unwrap().quote() })
7594            }),
7595        );
7596        query = query.arg("description", description.into());
7597        Env {
7598            proc: self.proc.clone(),
7599            selection: query,
7600            graphql_client: self.graphql_client.clone(),
7601        }
7602    }
7603    /// Declare a desired CheckGroup output to be assigned in the environment
7604    ///
7605    /// # Arguments
7606    ///
7607    /// * `name` - The name of the binding
7608    /// * `description` - A description of the desired value of the binding
7609    pub fn with_check_group_output(
7610        &self,
7611        name: impl Into<String>,
7612        description: impl Into<String>,
7613    ) -> Env {
7614        let mut query = self.selection.select("withCheckGroupOutput");
7615        query = query.arg("name", name.into());
7616        query = query.arg("description", description.into());
7617        Env {
7618            proc: self.proc.clone(),
7619            selection: query,
7620            graphql_client: self.graphql_client.clone(),
7621        }
7622    }
7623    /// Create or update a binding of type Check in the environment
7624    ///
7625    /// # Arguments
7626    ///
7627    /// * `name` - The name of the binding
7628    /// * `value` - The Check value to assign to the binding
7629    /// * `description` - The purpose of the input
7630    pub fn with_check_input(
7631        &self,
7632        name: impl Into<String>,
7633        value: impl IntoID<CheckId>,
7634        description: impl Into<String>,
7635    ) -> Env {
7636        let mut query = self.selection.select("withCheckInput");
7637        query = query.arg("name", name.into());
7638        query = query.arg_lazy(
7639            "value",
7640            Box::new(move || {
7641                let value = value.clone();
7642                Box::pin(async move { value.into_id().await.unwrap().quote() })
7643            }),
7644        );
7645        query = query.arg("description", description.into());
7646        Env {
7647            proc: self.proc.clone(),
7648            selection: query,
7649            graphql_client: self.graphql_client.clone(),
7650        }
7651    }
7652    /// Declare a desired Check output to be assigned in the environment
7653    ///
7654    /// # Arguments
7655    ///
7656    /// * `name` - The name of the binding
7657    /// * `description` - A description of the desired value of the binding
7658    pub fn with_check_output(
7659        &self,
7660        name: impl Into<String>,
7661        description: impl Into<String>,
7662    ) -> Env {
7663        let mut query = self.selection.select("withCheckOutput");
7664        query = query.arg("name", name.into());
7665        query = query.arg("description", description.into());
7666        Env {
7667            proc: self.proc.clone(),
7668            selection: query,
7669            graphql_client: self.graphql_client.clone(),
7670        }
7671    }
7672    /// Create or update a binding of type Cloud in the environment
7673    ///
7674    /// # Arguments
7675    ///
7676    /// * `name` - The name of the binding
7677    /// * `value` - The Cloud value to assign to the binding
7678    /// * `description` - The purpose of the input
7679    pub fn with_cloud_input(
7680        &self,
7681        name: impl Into<String>,
7682        value: impl IntoID<CloudId>,
7683        description: impl Into<String>,
7684    ) -> Env {
7685        let mut query = self.selection.select("withCloudInput");
7686        query = query.arg("name", name.into());
7687        query = query.arg_lazy(
7688            "value",
7689            Box::new(move || {
7690                let value = value.clone();
7691                Box::pin(async move { value.into_id().await.unwrap().quote() })
7692            }),
7693        );
7694        query = query.arg("description", description.into());
7695        Env {
7696            proc: self.proc.clone(),
7697            selection: query,
7698            graphql_client: self.graphql_client.clone(),
7699        }
7700    }
7701    /// Declare a desired Cloud output to be assigned in the environment
7702    ///
7703    /// # Arguments
7704    ///
7705    /// * `name` - The name of the binding
7706    /// * `description` - A description of the desired value of the binding
7707    pub fn with_cloud_output(
7708        &self,
7709        name: impl Into<String>,
7710        description: impl Into<String>,
7711    ) -> Env {
7712        let mut query = self.selection.select("withCloudOutput");
7713        query = query.arg("name", name.into());
7714        query = query.arg("description", description.into());
7715        Env {
7716            proc: self.proc.clone(),
7717            selection: query,
7718            graphql_client: self.graphql_client.clone(),
7719        }
7720    }
7721    /// Create or update a binding of type Container in the environment
7722    ///
7723    /// # Arguments
7724    ///
7725    /// * `name` - The name of the binding
7726    /// * `value` - The Container value to assign to the binding
7727    /// * `description` - The purpose of the input
7728    pub fn with_container_input(
7729        &self,
7730        name: impl Into<String>,
7731        value: impl IntoID<ContainerId>,
7732        description: impl Into<String>,
7733    ) -> Env {
7734        let mut query = self.selection.select("withContainerInput");
7735        query = query.arg("name", name.into());
7736        query = query.arg_lazy(
7737            "value",
7738            Box::new(move || {
7739                let value = value.clone();
7740                Box::pin(async move { value.into_id().await.unwrap().quote() })
7741            }),
7742        );
7743        query = query.arg("description", description.into());
7744        Env {
7745            proc: self.proc.clone(),
7746            selection: query,
7747            graphql_client: self.graphql_client.clone(),
7748        }
7749    }
7750    /// Declare a desired Container output to be assigned in the environment
7751    ///
7752    /// # Arguments
7753    ///
7754    /// * `name` - The name of the binding
7755    /// * `description` - A description of the desired value of the binding
7756    pub fn with_container_output(
7757        &self,
7758        name: impl Into<String>,
7759        description: impl Into<String>,
7760    ) -> Env {
7761        let mut query = self.selection.select("withContainerOutput");
7762        query = query.arg("name", name.into());
7763        query = query.arg("description", description.into());
7764        Env {
7765            proc: self.proc.clone(),
7766            selection: query,
7767            graphql_client: self.graphql_client.clone(),
7768        }
7769    }
7770    /// Installs the current module into the environment, exposing its functions to the model
7771    /// Contextual path arguments will be populated using the environment's workspace.
7772    pub fn with_current_module(&self) -> Env {
7773        let query = self.selection.select("withCurrentModule");
7774        Env {
7775            proc: self.proc.clone(),
7776            selection: query,
7777            graphql_client: self.graphql_client.clone(),
7778        }
7779    }
7780    /// Create or update a binding of type DiffStat in the environment
7781    ///
7782    /// # Arguments
7783    ///
7784    /// * `name` - The name of the binding
7785    /// * `value` - The DiffStat value to assign to the binding
7786    /// * `description` - The purpose of the input
7787    pub fn with_diff_stat_input(
7788        &self,
7789        name: impl Into<String>,
7790        value: impl IntoID<DiffStatId>,
7791        description: impl Into<String>,
7792    ) -> Env {
7793        let mut query = self.selection.select("withDiffStatInput");
7794        query = query.arg("name", name.into());
7795        query = query.arg_lazy(
7796            "value",
7797            Box::new(move || {
7798                let value = value.clone();
7799                Box::pin(async move { value.into_id().await.unwrap().quote() })
7800            }),
7801        );
7802        query = query.arg("description", description.into());
7803        Env {
7804            proc: self.proc.clone(),
7805            selection: query,
7806            graphql_client: self.graphql_client.clone(),
7807        }
7808    }
7809    /// Declare a desired DiffStat output to be assigned in the environment
7810    ///
7811    /// # Arguments
7812    ///
7813    /// * `name` - The name of the binding
7814    /// * `description` - A description of the desired value of the binding
7815    pub fn with_diff_stat_output(
7816        &self,
7817        name: impl Into<String>,
7818        description: impl Into<String>,
7819    ) -> Env {
7820        let mut query = self.selection.select("withDiffStatOutput");
7821        query = query.arg("name", name.into());
7822        query = query.arg("description", description.into());
7823        Env {
7824            proc: self.proc.clone(),
7825            selection: query,
7826            graphql_client: self.graphql_client.clone(),
7827        }
7828    }
7829    /// Create or update a binding of type Directory in the environment
7830    ///
7831    /// # Arguments
7832    ///
7833    /// * `name` - The name of the binding
7834    /// * `value` - The Directory value to assign to the binding
7835    /// * `description` - The purpose of the input
7836    pub fn with_directory_input(
7837        &self,
7838        name: impl Into<String>,
7839        value: impl IntoID<DirectoryId>,
7840        description: impl Into<String>,
7841    ) -> Env {
7842        let mut query = self.selection.select("withDirectoryInput");
7843        query = query.arg("name", name.into());
7844        query = query.arg_lazy(
7845            "value",
7846            Box::new(move || {
7847                let value = value.clone();
7848                Box::pin(async move { value.into_id().await.unwrap().quote() })
7849            }),
7850        );
7851        query = query.arg("description", description.into());
7852        Env {
7853            proc: self.proc.clone(),
7854            selection: query,
7855            graphql_client: self.graphql_client.clone(),
7856        }
7857    }
7858    /// Declare a desired Directory output to be assigned in the environment
7859    ///
7860    /// # Arguments
7861    ///
7862    /// * `name` - The name of the binding
7863    /// * `description` - A description of the desired value of the binding
7864    pub fn with_directory_output(
7865        &self,
7866        name: impl Into<String>,
7867        description: impl Into<String>,
7868    ) -> Env {
7869        let mut query = self.selection.select("withDirectoryOutput");
7870        query = query.arg("name", name.into());
7871        query = query.arg("description", description.into());
7872        Env {
7873            proc: self.proc.clone(),
7874            selection: query,
7875            graphql_client: self.graphql_client.clone(),
7876        }
7877    }
7878    /// Create or update a binding of type EnvFile in the environment
7879    ///
7880    /// # Arguments
7881    ///
7882    /// * `name` - The name of the binding
7883    /// * `value` - The EnvFile value to assign to the binding
7884    /// * `description` - The purpose of the input
7885    pub fn with_env_file_input(
7886        &self,
7887        name: impl Into<String>,
7888        value: impl IntoID<EnvFileId>,
7889        description: impl Into<String>,
7890    ) -> Env {
7891        let mut query = self.selection.select("withEnvFileInput");
7892        query = query.arg("name", name.into());
7893        query = query.arg_lazy(
7894            "value",
7895            Box::new(move || {
7896                let value = value.clone();
7897                Box::pin(async move { value.into_id().await.unwrap().quote() })
7898            }),
7899        );
7900        query = query.arg("description", description.into());
7901        Env {
7902            proc: self.proc.clone(),
7903            selection: query,
7904            graphql_client: self.graphql_client.clone(),
7905        }
7906    }
7907    /// Declare a desired EnvFile output to be assigned in the environment
7908    ///
7909    /// # Arguments
7910    ///
7911    /// * `name` - The name of the binding
7912    /// * `description` - A description of the desired value of the binding
7913    pub fn with_env_file_output(
7914        &self,
7915        name: impl Into<String>,
7916        description: impl Into<String>,
7917    ) -> Env {
7918        let mut query = self.selection.select("withEnvFileOutput");
7919        query = query.arg("name", name.into());
7920        query = query.arg("description", description.into());
7921        Env {
7922            proc: self.proc.clone(),
7923            selection: query,
7924            graphql_client: self.graphql_client.clone(),
7925        }
7926    }
7927    /// Create or update a binding of type Env in the environment
7928    ///
7929    /// # Arguments
7930    ///
7931    /// * `name` - The name of the binding
7932    /// * `value` - The Env value to assign to the binding
7933    /// * `description` - The purpose of the input
7934    pub fn with_env_input(
7935        &self,
7936        name: impl Into<String>,
7937        value: impl IntoID<EnvId>,
7938        description: impl Into<String>,
7939    ) -> Env {
7940        let mut query = self.selection.select("withEnvInput");
7941        query = query.arg("name", name.into());
7942        query = query.arg_lazy(
7943            "value",
7944            Box::new(move || {
7945                let value = value.clone();
7946                Box::pin(async move { value.into_id().await.unwrap().quote() })
7947            }),
7948        );
7949        query = query.arg("description", description.into());
7950        Env {
7951            proc: self.proc.clone(),
7952            selection: query,
7953            graphql_client: self.graphql_client.clone(),
7954        }
7955    }
7956    /// Declare a desired Env output to be assigned in the environment
7957    ///
7958    /// # Arguments
7959    ///
7960    /// * `name` - The name of the binding
7961    /// * `description` - A description of the desired value of the binding
7962    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7963        let mut query = self.selection.select("withEnvOutput");
7964        query = query.arg("name", name.into());
7965        query = query.arg("description", description.into());
7966        Env {
7967            proc: self.proc.clone(),
7968            selection: query,
7969            graphql_client: self.graphql_client.clone(),
7970        }
7971    }
7972    /// Create or update a binding of type File in the environment
7973    ///
7974    /// # Arguments
7975    ///
7976    /// * `name` - The name of the binding
7977    /// * `value` - The File value to assign to the binding
7978    /// * `description` - The purpose of the input
7979    pub fn with_file_input(
7980        &self,
7981        name: impl Into<String>,
7982        value: impl IntoID<FileId>,
7983        description: impl Into<String>,
7984    ) -> Env {
7985        let mut query = self.selection.select("withFileInput");
7986        query = query.arg("name", name.into());
7987        query = query.arg_lazy(
7988            "value",
7989            Box::new(move || {
7990                let value = value.clone();
7991                Box::pin(async move { value.into_id().await.unwrap().quote() })
7992            }),
7993        );
7994        query = query.arg("description", description.into());
7995        Env {
7996            proc: self.proc.clone(),
7997            selection: query,
7998            graphql_client: self.graphql_client.clone(),
7999        }
8000    }
8001    /// Declare a desired File output to be assigned in the environment
8002    ///
8003    /// # Arguments
8004    ///
8005    /// * `name` - The name of the binding
8006    /// * `description` - A description of the desired value of the binding
8007    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
8008        let mut query = self.selection.select("withFileOutput");
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    /// Create or update a binding of type GeneratorGroup in the environment
8018    ///
8019    /// # Arguments
8020    ///
8021    /// * `name` - The name of the binding
8022    /// * `value` - The GeneratorGroup value to assign to the binding
8023    /// * `description` - The purpose of the input
8024    pub fn with_generator_group_input(
8025        &self,
8026        name: impl Into<String>,
8027        value: impl IntoID<GeneratorGroupId>,
8028        description: impl Into<String>,
8029    ) -> Env {
8030        let mut query = self.selection.select("withGeneratorGroupInput");
8031        query = query.arg("name", name.into());
8032        query = query.arg_lazy(
8033            "value",
8034            Box::new(move || {
8035                let value = value.clone();
8036                Box::pin(async move { value.into_id().await.unwrap().quote() })
8037            }),
8038        );
8039        query = query.arg("description", description.into());
8040        Env {
8041            proc: self.proc.clone(),
8042            selection: query,
8043            graphql_client: self.graphql_client.clone(),
8044        }
8045    }
8046    /// Declare a desired GeneratorGroup output to be assigned in the environment
8047    ///
8048    /// # Arguments
8049    ///
8050    /// * `name` - The name of the binding
8051    /// * `description` - A description of the desired value of the binding
8052    pub fn with_generator_group_output(
8053        &self,
8054        name: impl Into<String>,
8055        description: impl Into<String>,
8056    ) -> Env {
8057        let mut query = self.selection.select("withGeneratorGroupOutput");
8058        query = query.arg("name", name.into());
8059        query = query.arg("description", description.into());
8060        Env {
8061            proc: self.proc.clone(),
8062            selection: query,
8063            graphql_client: self.graphql_client.clone(),
8064        }
8065    }
8066    /// Create or update a binding of type Generator in the environment
8067    ///
8068    /// # Arguments
8069    ///
8070    /// * `name` - The name of the binding
8071    /// * `value` - The Generator value to assign to the binding
8072    /// * `description` - The purpose of the input
8073    pub fn with_generator_input(
8074        &self,
8075        name: impl Into<String>,
8076        value: impl IntoID<GeneratorId>,
8077        description: impl Into<String>,
8078    ) -> Env {
8079        let mut query = self.selection.select("withGeneratorInput");
8080        query = query.arg("name", name.into());
8081        query = query.arg_lazy(
8082            "value",
8083            Box::new(move || {
8084                let value = value.clone();
8085                Box::pin(async move { value.into_id().await.unwrap().quote() })
8086            }),
8087        );
8088        query = query.arg("description", description.into());
8089        Env {
8090            proc: self.proc.clone(),
8091            selection: query,
8092            graphql_client: self.graphql_client.clone(),
8093        }
8094    }
8095    /// Declare a desired Generator output to be assigned in the environment
8096    ///
8097    /// # Arguments
8098    ///
8099    /// * `name` - The name of the binding
8100    /// * `description` - A description of the desired value of the binding
8101    pub fn with_generator_output(
8102        &self,
8103        name: impl Into<String>,
8104        description: impl Into<String>,
8105    ) -> Env {
8106        let mut query = self.selection.select("withGeneratorOutput");
8107        query = query.arg("name", name.into());
8108        query = query.arg("description", description.into());
8109        Env {
8110            proc: self.proc.clone(),
8111            selection: query,
8112            graphql_client: self.graphql_client.clone(),
8113        }
8114    }
8115    /// Create or update a binding of type GitRef in the environment
8116    ///
8117    /// # Arguments
8118    ///
8119    /// * `name` - The name of the binding
8120    /// * `value` - The GitRef value to assign to the binding
8121    /// * `description` - The purpose of the input
8122    pub fn with_git_ref_input(
8123        &self,
8124        name: impl Into<String>,
8125        value: impl IntoID<GitRefId>,
8126        description: impl Into<String>,
8127    ) -> Env {
8128        let mut query = self.selection.select("withGitRefInput");
8129        query = query.arg("name", name.into());
8130        query = query.arg_lazy(
8131            "value",
8132            Box::new(move || {
8133                let value = value.clone();
8134                Box::pin(async move { value.into_id().await.unwrap().quote() })
8135            }),
8136        );
8137        query = query.arg("description", description.into());
8138        Env {
8139            proc: self.proc.clone(),
8140            selection: query,
8141            graphql_client: self.graphql_client.clone(),
8142        }
8143    }
8144    /// Declare a desired GitRef output to be assigned in the environment
8145    ///
8146    /// # Arguments
8147    ///
8148    /// * `name` - The name of the binding
8149    /// * `description` - A description of the desired value of the binding
8150    pub fn with_git_ref_output(
8151        &self,
8152        name: impl Into<String>,
8153        description: impl Into<String>,
8154    ) -> Env {
8155        let mut query = self.selection.select("withGitRefOutput");
8156        query = query.arg("name", name.into());
8157        query = query.arg("description", description.into());
8158        Env {
8159            proc: self.proc.clone(),
8160            selection: query,
8161            graphql_client: self.graphql_client.clone(),
8162        }
8163    }
8164    /// Create or update a binding of type GitRepository in the environment
8165    ///
8166    /// # Arguments
8167    ///
8168    /// * `name` - The name of the binding
8169    /// * `value` - The GitRepository value to assign to the binding
8170    /// * `description` - The purpose of the input
8171    pub fn with_git_repository_input(
8172        &self,
8173        name: impl Into<String>,
8174        value: impl IntoID<GitRepositoryId>,
8175        description: impl Into<String>,
8176    ) -> Env {
8177        let mut query = self.selection.select("withGitRepositoryInput");
8178        query = query.arg("name", name.into());
8179        query = query.arg_lazy(
8180            "value",
8181            Box::new(move || {
8182                let value = value.clone();
8183                Box::pin(async move { value.into_id().await.unwrap().quote() })
8184            }),
8185        );
8186        query = query.arg("description", description.into());
8187        Env {
8188            proc: self.proc.clone(),
8189            selection: query,
8190            graphql_client: self.graphql_client.clone(),
8191        }
8192    }
8193    /// Declare a desired GitRepository output to be assigned in the environment
8194    ///
8195    /// # Arguments
8196    ///
8197    /// * `name` - The name of the binding
8198    /// * `description` - A description of the desired value of the binding
8199    pub fn with_git_repository_output(
8200        &self,
8201        name: impl Into<String>,
8202        description: impl Into<String>,
8203    ) -> Env {
8204        let mut query = self.selection.select("withGitRepositoryOutput");
8205        query = query.arg("name", name.into());
8206        query = query.arg("description", description.into());
8207        Env {
8208            proc: self.proc.clone(),
8209            selection: query,
8210            graphql_client: self.graphql_client.clone(),
8211        }
8212    }
8213    /// Create or update a binding of type JSONValue in the environment
8214    ///
8215    /// # Arguments
8216    ///
8217    /// * `name` - The name of the binding
8218    /// * `value` - The JSONValue value to assign to the binding
8219    /// * `description` - The purpose of the input
8220    pub fn with_json_value_input(
8221        &self,
8222        name: impl Into<String>,
8223        value: impl IntoID<JsonValueId>,
8224        description: impl Into<String>,
8225    ) -> Env {
8226        let mut query = self.selection.select("withJSONValueInput");
8227        query = query.arg("name", name.into());
8228        query = query.arg_lazy(
8229            "value",
8230            Box::new(move || {
8231                let value = value.clone();
8232                Box::pin(async move { value.into_id().await.unwrap().quote() })
8233            }),
8234        );
8235        query = query.arg("description", description.into());
8236        Env {
8237            proc: self.proc.clone(),
8238            selection: query,
8239            graphql_client: self.graphql_client.clone(),
8240        }
8241    }
8242    /// Declare a desired JSONValue output to be assigned in the environment
8243    ///
8244    /// # Arguments
8245    ///
8246    /// * `name` - The name of the binding
8247    /// * `description` - A description of the desired value of the binding
8248    pub fn with_json_value_output(
8249        &self,
8250        name: impl Into<String>,
8251        description: impl Into<String>,
8252    ) -> Env {
8253        let mut query = self.selection.select("withJSONValueOutput");
8254        query = query.arg("name", name.into());
8255        query = query.arg("description", description.into());
8256        Env {
8257            proc: self.proc.clone(),
8258            selection: query,
8259            graphql_client: self.graphql_client.clone(),
8260        }
8261    }
8262    /// Sets the main module for this environment (the project being worked on)
8263    /// Contextual path arguments will be populated using the environment's workspace.
8264    pub fn with_main_module(&self, module: impl IntoID<ModuleId>) -> Env {
8265        let mut query = self.selection.select("withMainModule");
8266        query = query.arg_lazy(
8267            "module",
8268            Box::new(move || {
8269                let module = module.clone();
8270                Box::pin(async move { module.into_id().await.unwrap().quote() })
8271            }),
8272        );
8273        Env {
8274            proc: self.proc.clone(),
8275            selection: query,
8276            graphql_client: self.graphql_client.clone(),
8277        }
8278    }
8279    /// Installs a module into the environment, exposing its functions to the model
8280    /// Contextual path arguments will be populated using the environment's workspace.
8281    pub fn with_module(&self, module: impl IntoID<ModuleId>) -> Env {
8282        let mut query = self.selection.select("withModule");
8283        query = query.arg_lazy(
8284            "module",
8285            Box::new(move || {
8286                let module = module.clone();
8287                Box::pin(async move { module.into_id().await.unwrap().quote() })
8288            }),
8289        );
8290        Env {
8291            proc: self.proc.clone(),
8292            selection: query,
8293            graphql_client: self.graphql_client.clone(),
8294        }
8295    }
8296    /// Create or update a binding of type ModuleConfigClient in the environment
8297    ///
8298    /// # Arguments
8299    ///
8300    /// * `name` - The name of the binding
8301    /// * `value` - The ModuleConfigClient value to assign to the binding
8302    /// * `description` - The purpose of the input
8303    pub fn with_module_config_client_input(
8304        &self,
8305        name: impl Into<String>,
8306        value: impl IntoID<ModuleConfigClientId>,
8307        description: impl Into<String>,
8308    ) -> Env {
8309        let mut query = self.selection.select("withModuleConfigClientInput");
8310        query = query.arg("name", name.into());
8311        query = query.arg_lazy(
8312            "value",
8313            Box::new(move || {
8314                let value = value.clone();
8315                Box::pin(async move { value.into_id().await.unwrap().quote() })
8316            }),
8317        );
8318        query = query.arg("description", description.into());
8319        Env {
8320            proc: self.proc.clone(),
8321            selection: query,
8322            graphql_client: self.graphql_client.clone(),
8323        }
8324    }
8325    /// Declare a desired ModuleConfigClient output to be assigned in the environment
8326    ///
8327    /// # Arguments
8328    ///
8329    /// * `name` - The name of the binding
8330    /// * `description` - A description of the desired value of the binding
8331    pub fn with_module_config_client_output(
8332        &self,
8333        name: impl Into<String>,
8334        description: impl Into<String>,
8335    ) -> Env {
8336        let mut query = self.selection.select("withModuleConfigClientOutput");
8337        query = query.arg("name", name.into());
8338        query = query.arg("description", description.into());
8339        Env {
8340            proc: self.proc.clone(),
8341            selection: query,
8342            graphql_client: self.graphql_client.clone(),
8343        }
8344    }
8345    /// Create or update a binding of type Module in the environment
8346    ///
8347    /// # Arguments
8348    ///
8349    /// * `name` - The name of the binding
8350    /// * `value` - The Module value to assign to the binding
8351    /// * `description` - The purpose of the input
8352    pub fn with_module_input(
8353        &self,
8354        name: impl Into<String>,
8355        value: impl IntoID<ModuleId>,
8356        description: impl Into<String>,
8357    ) -> Env {
8358        let mut query = self.selection.select("withModuleInput");
8359        query = query.arg("name", name.into());
8360        query = query.arg_lazy(
8361            "value",
8362            Box::new(move || {
8363                let value = value.clone();
8364                Box::pin(async move { value.into_id().await.unwrap().quote() })
8365            }),
8366        );
8367        query = query.arg("description", description.into());
8368        Env {
8369            proc: self.proc.clone(),
8370            selection: query,
8371            graphql_client: self.graphql_client.clone(),
8372        }
8373    }
8374    /// Declare a desired Module output to be assigned in the environment
8375    ///
8376    /// # Arguments
8377    ///
8378    /// * `name` - The name of the binding
8379    /// * `description` - A description of the desired value of the binding
8380    pub fn with_module_output(
8381        &self,
8382        name: impl Into<String>,
8383        description: impl Into<String>,
8384    ) -> Env {
8385        let mut query = self.selection.select("withModuleOutput");
8386        query = query.arg("name", name.into());
8387        query = query.arg("description", description.into());
8388        Env {
8389            proc: self.proc.clone(),
8390            selection: query,
8391            graphql_client: self.graphql_client.clone(),
8392        }
8393    }
8394    /// Create or update a binding of type ModuleSource in the environment
8395    ///
8396    /// # Arguments
8397    ///
8398    /// * `name` - The name of the binding
8399    /// * `value` - The ModuleSource value to assign to the binding
8400    /// * `description` - The purpose of the input
8401    pub fn with_module_source_input(
8402        &self,
8403        name: impl Into<String>,
8404        value: impl IntoID<ModuleSourceId>,
8405        description: impl Into<String>,
8406    ) -> Env {
8407        let mut query = self.selection.select("withModuleSourceInput");
8408        query = query.arg("name", name.into());
8409        query = query.arg_lazy(
8410            "value",
8411            Box::new(move || {
8412                let value = value.clone();
8413                Box::pin(async move { value.into_id().await.unwrap().quote() })
8414            }),
8415        );
8416        query = query.arg("description", description.into());
8417        Env {
8418            proc: self.proc.clone(),
8419            selection: query,
8420            graphql_client: self.graphql_client.clone(),
8421        }
8422    }
8423    /// Declare a desired ModuleSource output to be assigned in the environment
8424    ///
8425    /// # Arguments
8426    ///
8427    /// * `name` - The name of the binding
8428    /// * `description` - A description of the desired value of the binding
8429    pub fn with_module_source_output(
8430        &self,
8431        name: impl Into<String>,
8432        description: impl Into<String>,
8433    ) -> Env {
8434        let mut query = self.selection.select("withModuleSourceOutput");
8435        query = query.arg("name", name.into());
8436        query = query.arg("description", description.into());
8437        Env {
8438            proc: self.proc.clone(),
8439            selection: query,
8440            graphql_client: self.graphql_client.clone(),
8441        }
8442    }
8443    /// Create or update a binding of type SearchResult in the environment
8444    ///
8445    /// # Arguments
8446    ///
8447    /// * `name` - The name of the binding
8448    /// * `value` - The SearchResult value to assign to the binding
8449    /// * `description` - The purpose of the input
8450    pub fn with_search_result_input(
8451        &self,
8452        name: impl Into<String>,
8453        value: impl IntoID<SearchResultId>,
8454        description: impl Into<String>,
8455    ) -> Env {
8456        let mut query = self.selection.select("withSearchResultInput");
8457        query = query.arg("name", name.into());
8458        query = query.arg_lazy(
8459            "value",
8460            Box::new(move || {
8461                let value = value.clone();
8462                Box::pin(async move { value.into_id().await.unwrap().quote() })
8463            }),
8464        );
8465        query = query.arg("description", description.into());
8466        Env {
8467            proc: self.proc.clone(),
8468            selection: query,
8469            graphql_client: self.graphql_client.clone(),
8470        }
8471    }
8472    /// Declare a desired SearchResult output to be assigned in the environment
8473    ///
8474    /// # Arguments
8475    ///
8476    /// * `name` - The name of the binding
8477    /// * `description` - A description of the desired value of the binding
8478    pub fn with_search_result_output(
8479        &self,
8480        name: impl Into<String>,
8481        description: impl Into<String>,
8482    ) -> Env {
8483        let mut query = self.selection.select("withSearchResultOutput");
8484        query = query.arg("name", name.into());
8485        query = query.arg("description", description.into());
8486        Env {
8487            proc: self.proc.clone(),
8488            selection: query,
8489            graphql_client: self.graphql_client.clone(),
8490        }
8491    }
8492    /// Create or update a binding of type SearchSubmatch in the environment
8493    ///
8494    /// # Arguments
8495    ///
8496    /// * `name` - The name of the binding
8497    /// * `value` - The SearchSubmatch value to assign to the binding
8498    /// * `description` - The purpose of the input
8499    pub fn with_search_submatch_input(
8500        &self,
8501        name: impl Into<String>,
8502        value: impl IntoID<SearchSubmatchId>,
8503        description: impl Into<String>,
8504    ) -> Env {
8505        let mut query = self.selection.select("withSearchSubmatchInput");
8506        query = query.arg("name", name.into());
8507        query = query.arg_lazy(
8508            "value",
8509            Box::new(move || {
8510                let value = value.clone();
8511                Box::pin(async move { value.into_id().await.unwrap().quote() })
8512            }),
8513        );
8514        query = query.arg("description", description.into());
8515        Env {
8516            proc: self.proc.clone(),
8517            selection: query,
8518            graphql_client: self.graphql_client.clone(),
8519        }
8520    }
8521    /// Declare a desired SearchSubmatch output to be assigned in the environment
8522    ///
8523    /// # Arguments
8524    ///
8525    /// * `name` - The name of the binding
8526    /// * `description` - A description of the desired value of the binding
8527    pub fn with_search_submatch_output(
8528        &self,
8529        name: impl Into<String>,
8530        description: impl Into<String>,
8531    ) -> Env {
8532        let mut query = self.selection.select("withSearchSubmatchOutput");
8533        query = query.arg("name", name.into());
8534        query = query.arg("description", description.into());
8535        Env {
8536            proc: self.proc.clone(),
8537            selection: query,
8538            graphql_client: self.graphql_client.clone(),
8539        }
8540    }
8541    /// Create or update a binding of type Secret in the environment
8542    ///
8543    /// # Arguments
8544    ///
8545    /// * `name` - The name of the binding
8546    /// * `value` - The Secret value to assign to the binding
8547    /// * `description` - The purpose of the input
8548    pub fn with_secret_input(
8549        &self,
8550        name: impl Into<String>,
8551        value: impl IntoID<SecretId>,
8552        description: impl Into<String>,
8553    ) -> Env {
8554        let mut query = self.selection.select("withSecretInput");
8555        query = query.arg("name", name.into());
8556        query = query.arg_lazy(
8557            "value",
8558            Box::new(move || {
8559                let value = value.clone();
8560                Box::pin(async move { value.into_id().await.unwrap().quote() })
8561            }),
8562        );
8563        query = query.arg("description", description.into());
8564        Env {
8565            proc: self.proc.clone(),
8566            selection: query,
8567            graphql_client: self.graphql_client.clone(),
8568        }
8569    }
8570    /// Declare a desired Secret output to be assigned in the environment
8571    ///
8572    /// # Arguments
8573    ///
8574    /// * `name` - The name of the binding
8575    /// * `description` - A description of the desired value of the binding
8576    pub fn with_secret_output(
8577        &self,
8578        name: impl Into<String>,
8579        description: impl Into<String>,
8580    ) -> Env {
8581        let mut query = self.selection.select("withSecretOutput");
8582        query = query.arg("name", name.into());
8583        query = query.arg("description", description.into());
8584        Env {
8585            proc: self.proc.clone(),
8586            selection: query,
8587            graphql_client: self.graphql_client.clone(),
8588        }
8589    }
8590    /// Create or update a binding of type Service in the environment
8591    ///
8592    /// # Arguments
8593    ///
8594    /// * `name` - The name of the binding
8595    /// * `value` - The Service value to assign to the binding
8596    /// * `description` - The purpose of the input
8597    pub fn with_service_input(
8598        &self,
8599        name: impl Into<String>,
8600        value: impl IntoID<ServiceId>,
8601        description: impl Into<String>,
8602    ) -> Env {
8603        let mut query = self.selection.select("withServiceInput");
8604        query = query.arg("name", name.into());
8605        query = query.arg_lazy(
8606            "value",
8607            Box::new(move || {
8608                let value = value.clone();
8609                Box::pin(async move { value.into_id().await.unwrap().quote() })
8610            }),
8611        );
8612        query = query.arg("description", description.into());
8613        Env {
8614            proc: self.proc.clone(),
8615            selection: query,
8616            graphql_client: self.graphql_client.clone(),
8617        }
8618    }
8619    /// Declare a desired Service output to be assigned in the environment
8620    ///
8621    /// # Arguments
8622    ///
8623    /// * `name` - The name of the binding
8624    /// * `description` - A description of the desired value of the binding
8625    pub fn with_service_output(
8626        &self,
8627        name: impl Into<String>,
8628        description: impl Into<String>,
8629    ) -> Env {
8630        let mut query = self.selection.select("withServiceOutput");
8631        query = query.arg("name", name.into());
8632        query = query.arg("description", description.into());
8633        Env {
8634            proc: self.proc.clone(),
8635            selection: query,
8636            graphql_client: self.graphql_client.clone(),
8637        }
8638    }
8639    /// Create or update a binding of type Socket in the environment
8640    ///
8641    /// # Arguments
8642    ///
8643    /// * `name` - The name of the binding
8644    /// * `value` - The Socket value to assign to the binding
8645    /// * `description` - The purpose of the input
8646    pub fn with_socket_input(
8647        &self,
8648        name: impl Into<String>,
8649        value: impl IntoID<SocketId>,
8650        description: impl Into<String>,
8651    ) -> Env {
8652        let mut query = self.selection.select("withSocketInput");
8653        query = query.arg("name", name.into());
8654        query = query.arg_lazy(
8655            "value",
8656            Box::new(move || {
8657                let value = value.clone();
8658                Box::pin(async move { value.into_id().await.unwrap().quote() })
8659            }),
8660        );
8661        query = query.arg("description", description.into());
8662        Env {
8663            proc: self.proc.clone(),
8664            selection: query,
8665            graphql_client: self.graphql_client.clone(),
8666        }
8667    }
8668    /// Declare a desired Socket output to be assigned in the environment
8669    ///
8670    /// # Arguments
8671    ///
8672    /// * `name` - The name of the binding
8673    /// * `description` - A description of the desired value of the binding
8674    pub fn with_socket_output(
8675        &self,
8676        name: impl Into<String>,
8677        description: impl Into<String>,
8678    ) -> Env {
8679        let mut query = self.selection.select("withSocketOutput");
8680        query = query.arg("name", name.into());
8681        query = query.arg("description", description.into());
8682        Env {
8683            proc: self.proc.clone(),
8684            selection: query,
8685            graphql_client: self.graphql_client.clone(),
8686        }
8687    }
8688    /// Create or update a binding of type Stat in the environment
8689    ///
8690    /// # Arguments
8691    ///
8692    /// * `name` - The name of the binding
8693    /// * `value` - The Stat value to assign to the binding
8694    /// * `description` - The purpose of the input
8695    pub fn with_stat_input(
8696        &self,
8697        name: impl Into<String>,
8698        value: impl IntoID<StatId>,
8699        description: impl Into<String>,
8700    ) -> Env {
8701        let mut query = self.selection.select("withStatInput");
8702        query = query.arg("name", name.into());
8703        query = query.arg_lazy(
8704            "value",
8705            Box::new(move || {
8706                let value = value.clone();
8707                Box::pin(async move { value.into_id().await.unwrap().quote() })
8708            }),
8709        );
8710        query = query.arg("description", description.into());
8711        Env {
8712            proc: self.proc.clone(),
8713            selection: query,
8714            graphql_client: self.graphql_client.clone(),
8715        }
8716    }
8717    /// Declare a desired Stat output to be assigned in the environment
8718    ///
8719    /// # Arguments
8720    ///
8721    /// * `name` - The name of the binding
8722    /// * `description` - A description of the desired value of the binding
8723    pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
8724        let mut query = self.selection.select("withStatOutput");
8725        query = query.arg("name", name.into());
8726        query = query.arg("description", description.into());
8727        Env {
8728            proc: self.proc.clone(),
8729            selection: query,
8730            graphql_client: self.graphql_client.clone(),
8731        }
8732    }
8733    /// Provides a string input binding to the environment
8734    ///
8735    /// # Arguments
8736    ///
8737    /// * `name` - The name of the binding
8738    /// * `value` - The string value to assign to the binding
8739    /// * `description` - The description of the input
8740    pub fn with_string_input(
8741        &self,
8742        name: impl Into<String>,
8743        value: impl Into<String>,
8744        description: impl Into<String>,
8745    ) -> Env {
8746        let mut query = self.selection.select("withStringInput");
8747        query = query.arg("name", name.into());
8748        query = query.arg("value", value.into());
8749        query = query.arg("description", description.into());
8750        Env {
8751            proc: self.proc.clone(),
8752            selection: query,
8753            graphql_client: self.graphql_client.clone(),
8754        }
8755    }
8756    /// Declares a desired string output binding
8757    ///
8758    /// # Arguments
8759    ///
8760    /// * `name` - The name of the binding
8761    /// * `description` - The description of the output
8762    pub fn with_string_output(
8763        &self,
8764        name: impl Into<String>,
8765        description: impl Into<String>,
8766    ) -> Env {
8767        let mut query = self.selection.select("withStringOutput");
8768        query = query.arg("name", name.into());
8769        query = query.arg("description", description.into());
8770        Env {
8771            proc: self.proc.clone(),
8772            selection: query,
8773            graphql_client: self.graphql_client.clone(),
8774        }
8775    }
8776    /// Create or update a binding of type UpGroup in the environment
8777    ///
8778    /// # Arguments
8779    ///
8780    /// * `name` - The name of the binding
8781    /// * `value` - The UpGroup value to assign to the binding
8782    /// * `description` - The purpose of the input
8783    pub fn with_up_group_input(
8784        &self,
8785        name: impl Into<String>,
8786        value: impl IntoID<UpGroupId>,
8787        description: impl Into<String>,
8788    ) -> Env {
8789        let mut query = self.selection.select("withUpGroupInput");
8790        query = query.arg("name", name.into());
8791        query = query.arg_lazy(
8792            "value",
8793            Box::new(move || {
8794                let value = value.clone();
8795                Box::pin(async move { value.into_id().await.unwrap().quote() })
8796            }),
8797        );
8798        query = query.arg("description", description.into());
8799        Env {
8800            proc: self.proc.clone(),
8801            selection: query,
8802            graphql_client: self.graphql_client.clone(),
8803        }
8804    }
8805    /// Declare a desired UpGroup output to be assigned in the environment
8806    ///
8807    /// # Arguments
8808    ///
8809    /// * `name` - The name of the binding
8810    /// * `description` - A description of the desired value of the binding
8811    pub fn with_up_group_output(
8812        &self,
8813        name: impl Into<String>,
8814        description: impl Into<String>,
8815    ) -> Env {
8816        let mut query = self.selection.select("withUpGroupOutput");
8817        query = query.arg("name", name.into());
8818        query = query.arg("description", description.into());
8819        Env {
8820            proc: self.proc.clone(),
8821            selection: query,
8822            graphql_client: self.graphql_client.clone(),
8823        }
8824    }
8825    /// Create or update a binding of type Up in the environment
8826    ///
8827    /// # Arguments
8828    ///
8829    /// * `name` - The name of the binding
8830    /// * `value` - The Up value to assign to the binding
8831    /// * `description` - The purpose of the input
8832    pub fn with_up_input(
8833        &self,
8834        name: impl Into<String>,
8835        value: impl IntoID<UpId>,
8836        description: impl Into<String>,
8837    ) -> Env {
8838        let mut query = self.selection.select("withUpInput");
8839        query = query.arg("name", name.into());
8840        query = query.arg_lazy(
8841            "value",
8842            Box::new(move || {
8843                let value = value.clone();
8844                Box::pin(async move { value.into_id().await.unwrap().quote() })
8845            }),
8846        );
8847        query = query.arg("description", description.into());
8848        Env {
8849            proc: self.proc.clone(),
8850            selection: query,
8851            graphql_client: self.graphql_client.clone(),
8852        }
8853    }
8854    /// Declare a desired Up output to be assigned in the environment
8855    ///
8856    /// # Arguments
8857    ///
8858    /// * `name` - The name of the binding
8859    /// * `description` - A description of the desired value of the binding
8860    pub fn with_up_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
8861        let mut query = self.selection.select("withUpOutput");
8862        query = query.arg("name", name.into());
8863        query = query.arg("description", description.into());
8864        Env {
8865            proc: self.proc.clone(),
8866            selection: query,
8867            graphql_client: self.graphql_client.clone(),
8868        }
8869    }
8870    /// Returns a new environment with the provided workspace
8871    ///
8872    /// # Arguments
8873    ///
8874    /// * `workspace` - The directory to set as the host filesystem
8875    pub fn with_workspace(&self, workspace: impl IntoID<DirectoryId>) -> Env {
8876        let mut query = self.selection.select("withWorkspace");
8877        query = query.arg_lazy(
8878            "workspace",
8879            Box::new(move || {
8880                let workspace = workspace.clone();
8881                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
8882            }),
8883        );
8884        Env {
8885            proc: self.proc.clone(),
8886            selection: query,
8887            graphql_client: self.graphql_client.clone(),
8888        }
8889    }
8890    /// Create or update a binding of type Workspace in the environment
8891    ///
8892    /// # Arguments
8893    ///
8894    /// * `name` - The name of the binding
8895    /// * `value` - The Workspace value to assign to the binding
8896    /// * `description` - The purpose of the input
8897    pub fn with_workspace_input(
8898        &self,
8899        name: impl Into<String>,
8900        value: impl IntoID<WorkspaceId>,
8901        description: impl Into<String>,
8902    ) -> Env {
8903        let mut query = self.selection.select("withWorkspaceInput");
8904        query = query.arg("name", name.into());
8905        query = query.arg_lazy(
8906            "value",
8907            Box::new(move || {
8908                let value = value.clone();
8909                Box::pin(async move { value.into_id().await.unwrap().quote() })
8910            }),
8911        );
8912        query = query.arg("description", description.into());
8913        Env {
8914            proc: self.proc.clone(),
8915            selection: query,
8916            graphql_client: self.graphql_client.clone(),
8917        }
8918    }
8919    /// Declare a desired Workspace output to be assigned in the environment
8920    ///
8921    /// # Arguments
8922    ///
8923    /// * `name` - The name of the binding
8924    /// * `description` - A description of the desired value of the binding
8925    pub fn with_workspace_output(
8926        &self,
8927        name: impl Into<String>,
8928        description: impl Into<String>,
8929    ) -> Env {
8930        let mut query = self.selection.select("withWorkspaceOutput");
8931        query = query.arg("name", name.into());
8932        query = query.arg("description", description.into());
8933        Env {
8934            proc: self.proc.clone(),
8935            selection: query,
8936            graphql_client: self.graphql_client.clone(),
8937        }
8938    }
8939    /// Returns a new environment without any outputs
8940    pub fn without_outputs(&self) -> Env {
8941        let query = self.selection.select("withoutOutputs");
8942        Env {
8943            proc: self.proc.clone(),
8944            selection: query,
8945            graphql_client: self.graphql_client.clone(),
8946        }
8947    }
8948    pub fn workspace(&self) -> Directory {
8949        let query = self.selection.select("workspace");
8950        Directory {
8951            proc: self.proc.clone(),
8952            selection: query,
8953            graphql_client: self.graphql_client.clone(),
8954        }
8955    }
8956}
8957#[derive(Clone)]
8958pub struct EnvFile {
8959    pub proc: Option<Arc<DaggerSessionProc>>,
8960    pub selection: Selection,
8961    pub graphql_client: DynGraphQLClient,
8962}
8963#[derive(Builder, Debug, PartialEq)]
8964pub struct EnvFileGetOpts {
8965    /// Return the value exactly as written to the file. No quote removal or variable expansion
8966    #[builder(setter(into, strip_option), default)]
8967    pub raw: Option<bool>,
8968}
8969#[derive(Builder, Debug, PartialEq)]
8970pub struct EnvFileVariablesOpts {
8971    /// Return values exactly as written to the file. No quote removal or variable expansion
8972    #[builder(setter(into, strip_option), default)]
8973    pub raw: Option<bool>,
8974}
8975impl EnvFile {
8976    /// Return as a file
8977    pub fn as_file(&self) -> File {
8978        let query = self.selection.select("asFile");
8979        File {
8980            proc: self.proc.clone(),
8981            selection: query,
8982            graphql_client: self.graphql_client.clone(),
8983        }
8984    }
8985    /// Check if a variable exists
8986    ///
8987    /// # Arguments
8988    ///
8989    /// * `name` - Variable name
8990    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8991        let mut query = self.selection.select("exists");
8992        query = query.arg("name", name.into());
8993        query.execute(self.graphql_client.clone()).await
8994    }
8995    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
8996    ///
8997    /// # Arguments
8998    ///
8999    /// * `name` - Variable name
9000    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9001    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
9002        let mut query = self.selection.select("get");
9003        query = query.arg("name", name.into());
9004        query.execute(self.graphql_client.clone()).await
9005    }
9006    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
9007    ///
9008    /// # Arguments
9009    ///
9010    /// * `name` - Variable name
9011    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9012    pub async fn get_opts(
9013        &self,
9014        name: impl Into<String>,
9015        opts: EnvFileGetOpts,
9016    ) -> Result<String, DaggerError> {
9017        let mut query = self.selection.select("get");
9018        query = query.arg("name", name.into());
9019        if let Some(raw) = opts.raw {
9020            query = query.arg("raw", raw);
9021        }
9022        query.execute(self.graphql_client.clone()).await
9023    }
9024    /// A unique identifier for this EnvFile.
9025    pub async fn id(&self) -> Result<EnvFileId, DaggerError> {
9026        let query = self.selection.select("id");
9027        query.execute(self.graphql_client.clone()).await
9028    }
9029    /// 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
9030    ///
9031    /// # Arguments
9032    ///
9033    /// * `prefix` - The prefix to filter by
9034    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
9035        let mut query = self.selection.select("namespace");
9036        query = query.arg("prefix", prefix.into());
9037        EnvFile {
9038            proc: self.proc.clone(),
9039            selection: query,
9040            graphql_client: self.graphql_client.clone(),
9041        }
9042    }
9043    /// Return all variables
9044    ///
9045    /// # Arguments
9046    ///
9047    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9048    pub fn variables(&self) -> Vec<EnvVariable> {
9049        let query = self.selection.select("variables");
9050        vec![EnvVariable {
9051            proc: self.proc.clone(),
9052            selection: query,
9053            graphql_client: self.graphql_client.clone(),
9054        }]
9055    }
9056    /// Return all variables
9057    ///
9058    /// # Arguments
9059    ///
9060    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9061    pub fn variables_opts(&self, opts: EnvFileVariablesOpts) -> Vec<EnvVariable> {
9062        let mut query = self.selection.select("variables");
9063        if let Some(raw) = opts.raw {
9064            query = query.arg("raw", raw);
9065        }
9066        vec![EnvVariable {
9067            proc: self.proc.clone(),
9068            selection: query,
9069            graphql_client: self.graphql_client.clone(),
9070        }]
9071    }
9072    /// Add a variable
9073    ///
9074    /// # Arguments
9075    ///
9076    /// * `name` - Variable name
9077    /// * `value` - Variable value
9078    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
9079        let mut query = self.selection.select("withVariable");
9080        query = query.arg("name", name.into());
9081        query = query.arg("value", value.into());
9082        EnvFile {
9083            proc: self.proc.clone(),
9084            selection: query,
9085            graphql_client: self.graphql_client.clone(),
9086        }
9087    }
9088    /// Remove all occurrences of the named variable
9089    ///
9090    /// # Arguments
9091    ///
9092    /// * `name` - Variable name
9093    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
9094        let mut query = self.selection.select("withoutVariable");
9095        query = query.arg("name", name.into());
9096        EnvFile {
9097            proc: self.proc.clone(),
9098            selection: query,
9099            graphql_client: self.graphql_client.clone(),
9100        }
9101    }
9102}
9103#[derive(Clone)]
9104pub struct EnvVariable {
9105    pub proc: Option<Arc<DaggerSessionProc>>,
9106    pub selection: Selection,
9107    pub graphql_client: DynGraphQLClient,
9108}
9109impl EnvVariable {
9110    /// A unique identifier for this EnvVariable.
9111    pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
9112        let query = self.selection.select("id");
9113        query.execute(self.graphql_client.clone()).await
9114    }
9115    /// The environment variable name.
9116    pub async fn name(&self) -> Result<String, DaggerError> {
9117        let query = self.selection.select("name");
9118        query.execute(self.graphql_client.clone()).await
9119    }
9120    /// The environment variable value.
9121    pub async fn value(&self) -> Result<String, DaggerError> {
9122        let query = self.selection.select("value");
9123        query.execute(self.graphql_client.clone()).await
9124    }
9125}
9126#[derive(Clone)]
9127pub struct Error {
9128    pub proc: Option<Arc<DaggerSessionProc>>,
9129    pub selection: Selection,
9130    pub graphql_client: DynGraphQLClient,
9131}
9132impl Error {
9133    /// A unique identifier for this Error.
9134    pub async fn id(&self) -> Result<ErrorId, DaggerError> {
9135        let query = self.selection.select("id");
9136        query.execute(self.graphql_client.clone()).await
9137    }
9138    /// A description of the error.
9139    pub async fn message(&self) -> Result<String, DaggerError> {
9140        let query = self.selection.select("message");
9141        query.execute(self.graphql_client.clone()).await
9142    }
9143    /// The extensions of the error.
9144    pub fn values(&self) -> Vec<ErrorValue> {
9145        let query = self.selection.select("values");
9146        vec![ErrorValue {
9147            proc: self.proc.clone(),
9148            selection: query,
9149            graphql_client: self.graphql_client.clone(),
9150        }]
9151    }
9152    /// Add a value to the error.
9153    ///
9154    /// # Arguments
9155    ///
9156    /// * `name` - The name of the value.
9157    /// * `value` - The value to store on the error.
9158    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
9159        let mut query = self.selection.select("withValue");
9160        query = query.arg("name", name.into());
9161        query = query.arg("value", value);
9162        Error {
9163            proc: self.proc.clone(),
9164            selection: query,
9165            graphql_client: self.graphql_client.clone(),
9166        }
9167    }
9168}
9169#[derive(Clone)]
9170pub struct ErrorValue {
9171    pub proc: Option<Arc<DaggerSessionProc>>,
9172    pub selection: Selection,
9173    pub graphql_client: DynGraphQLClient,
9174}
9175impl ErrorValue {
9176    /// A unique identifier for this ErrorValue.
9177    pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
9178        let query = self.selection.select("id");
9179        query.execute(self.graphql_client.clone()).await
9180    }
9181    /// The name of the value.
9182    pub async fn name(&self) -> Result<String, DaggerError> {
9183        let query = self.selection.select("name");
9184        query.execute(self.graphql_client.clone()).await
9185    }
9186    /// The value.
9187    pub async fn value(&self) -> Result<Json, DaggerError> {
9188        let query = self.selection.select("value");
9189        query.execute(self.graphql_client.clone()).await
9190    }
9191}
9192#[derive(Clone)]
9193pub struct FieldTypeDef {
9194    pub proc: Option<Arc<DaggerSessionProc>>,
9195    pub selection: Selection,
9196    pub graphql_client: DynGraphQLClient,
9197}
9198impl FieldTypeDef {
9199    /// The reason this enum member is deprecated, if any.
9200    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9201        let query = self.selection.select("deprecated");
9202        query.execute(self.graphql_client.clone()).await
9203    }
9204    /// A doc string for the field, if any.
9205    pub async fn description(&self) -> Result<String, DaggerError> {
9206        let query = self.selection.select("description");
9207        query.execute(self.graphql_client.clone()).await
9208    }
9209    /// A unique identifier for this FieldTypeDef.
9210    pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
9211        let query = self.selection.select("id");
9212        query.execute(self.graphql_client.clone()).await
9213    }
9214    /// The name of the field in lowerCamelCase format.
9215    pub async fn name(&self) -> Result<String, DaggerError> {
9216        let query = self.selection.select("name");
9217        query.execute(self.graphql_client.clone()).await
9218    }
9219    /// The location of this field declaration.
9220    pub fn source_map(&self) -> SourceMap {
9221        let query = self.selection.select("sourceMap");
9222        SourceMap {
9223            proc: self.proc.clone(),
9224            selection: query,
9225            graphql_client: self.graphql_client.clone(),
9226        }
9227    }
9228    /// The type of the field.
9229    pub fn type_def(&self) -> TypeDef {
9230        let query = self.selection.select("typeDef");
9231        TypeDef {
9232            proc: self.proc.clone(),
9233            selection: query,
9234            graphql_client: self.graphql_client.clone(),
9235        }
9236    }
9237}
9238#[derive(Clone)]
9239pub struct File {
9240    pub proc: Option<Arc<DaggerSessionProc>>,
9241    pub selection: Selection,
9242    pub graphql_client: DynGraphQLClient,
9243}
9244#[derive(Builder, Debug, PartialEq)]
9245pub struct FileAsEnvFileOpts {
9246    /// Replace "${VAR}" or "$VAR" with the value of other vars
9247    #[builder(setter(into, strip_option), default)]
9248    pub expand: Option<bool>,
9249}
9250#[derive(Builder, Debug, PartialEq)]
9251pub struct FileContentsOpts {
9252    /// Maximum number of lines to read
9253    #[builder(setter(into, strip_option), default)]
9254    pub limit_lines: Option<isize>,
9255    /// Start reading after this line
9256    #[builder(setter(into, strip_option), default)]
9257    pub offset_lines: Option<isize>,
9258}
9259#[derive(Builder, Debug, PartialEq)]
9260pub struct FileDigestOpts {
9261    /// If true, exclude metadata from the digest.
9262    #[builder(setter(into, strip_option), default)]
9263    pub exclude_metadata: Option<bool>,
9264}
9265#[derive(Builder, Debug, PartialEq)]
9266pub struct FileExportOpts {
9267    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
9268    #[builder(setter(into, strip_option), default)]
9269    pub allow_parent_dir_path: Option<bool>,
9270}
9271#[derive(Builder, Debug, PartialEq)]
9272pub struct FileSearchOpts<'a> {
9273    /// Allow the . pattern to match newlines in multiline mode.
9274    #[builder(setter(into, strip_option), default)]
9275    pub dotall: Option<bool>,
9276    /// Only return matching files, not lines and content
9277    #[builder(setter(into, strip_option), default)]
9278    pub files_only: Option<bool>,
9279    #[builder(setter(into, strip_option), default)]
9280    pub globs: Option<Vec<&'a str>>,
9281    /// Enable case-insensitive matching.
9282    #[builder(setter(into, strip_option), default)]
9283    pub insensitive: Option<bool>,
9284    /// Limit the number of results to return
9285    #[builder(setter(into, strip_option), default)]
9286    pub limit: Option<isize>,
9287    /// Interpret the pattern as a literal string instead of a regular expression.
9288    #[builder(setter(into, strip_option), default)]
9289    pub literal: Option<bool>,
9290    /// Enable searching across multiple lines.
9291    #[builder(setter(into, strip_option), default)]
9292    pub multiline: Option<bool>,
9293    #[builder(setter(into, strip_option), default)]
9294    pub paths: Option<Vec<&'a str>>,
9295    /// Skip hidden files (files starting with .).
9296    #[builder(setter(into, strip_option), default)]
9297    pub skip_hidden: Option<bool>,
9298    /// Honor .gitignore, .ignore, and .rgignore files.
9299    #[builder(setter(into, strip_option), default)]
9300    pub skip_ignored: Option<bool>,
9301}
9302#[derive(Builder, Debug, PartialEq)]
9303pub struct FileWithReplacedOpts {
9304    /// Replace all occurrences of the pattern.
9305    #[builder(setter(into, strip_option), default)]
9306    pub all: Option<bool>,
9307    /// Replace the first match starting from the specified line.
9308    #[builder(setter(into, strip_option), default)]
9309    pub first_from: Option<isize>,
9310}
9311impl File {
9312    /// Parse as an env file
9313    ///
9314    /// # Arguments
9315    ///
9316    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9317    pub fn as_env_file(&self) -> EnvFile {
9318        let query = self.selection.select("asEnvFile");
9319        EnvFile {
9320            proc: self.proc.clone(),
9321            selection: query,
9322            graphql_client: self.graphql_client.clone(),
9323        }
9324    }
9325    /// Parse as an env file
9326    ///
9327    /// # Arguments
9328    ///
9329    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9330    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
9331        let mut query = self.selection.select("asEnvFile");
9332        if let Some(expand) = opts.expand {
9333            query = query.arg("expand", expand);
9334        }
9335        EnvFile {
9336            proc: self.proc.clone(),
9337            selection: query,
9338            graphql_client: self.graphql_client.clone(),
9339        }
9340    }
9341    /// Parse the file contents as JSON.
9342    pub fn as_json(&self) -> JsonValue {
9343        let query = self.selection.select("asJSON");
9344        JsonValue {
9345            proc: self.proc.clone(),
9346            selection: query,
9347            graphql_client: self.graphql_client.clone(),
9348        }
9349    }
9350    /// Change the owner of the file recursively.
9351    ///
9352    /// # Arguments
9353    ///
9354    /// * `owner` - A user:group to set for the file.
9355    ///
9356    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
9357    ///
9358    /// If the group is omitted, it defaults to the same as the user.
9359    pub fn chown(&self, owner: impl Into<String>) -> File {
9360        let mut query = self.selection.select("chown");
9361        query = query.arg("owner", owner.into());
9362        File {
9363            proc: self.proc.clone(),
9364            selection: query,
9365            graphql_client: self.graphql_client.clone(),
9366        }
9367    }
9368    /// Retrieves the contents of the file.
9369    ///
9370    /// # Arguments
9371    ///
9372    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9373    pub async fn contents(&self) -> Result<String, DaggerError> {
9374        let query = self.selection.select("contents");
9375        query.execute(self.graphql_client.clone()).await
9376    }
9377    /// Retrieves the contents of the file.
9378    ///
9379    /// # Arguments
9380    ///
9381    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9382    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
9383        let mut query = self.selection.select("contents");
9384        if let Some(offset_lines) = opts.offset_lines {
9385            query = query.arg("offsetLines", offset_lines);
9386        }
9387        if let Some(limit_lines) = opts.limit_lines {
9388            query = query.arg("limitLines", limit_lines);
9389        }
9390        query.execute(self.graphql_client.clone()).await
9391    }
9392    /// 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.
9393    ///
9394    /// # Arguments
9395    ///
9396    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9397    pub async fn digest(&self) -> Result<String, DaggerError> {
9398        let query = self.selection.select("digest");
9399        query.execute(self.graphql_client.clone()).await
9400    }
9401    /// 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.
9402    ///
9403    /// # Arguments
9404    ///
9405    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9406    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
9407        let mut query = self.selection.select("digest");
9408        if let Some(exclude_metadata) = opts.exclude_metadata {
9409            query = query.arg("excludeMetadata", exclude_metadata);
9410        }
9411        query.execute(self.graphql_client.clone()).await
9412    }
9413    /// Writes the file to a file path on the host.
9414    ///
9415    /// # Arguments
9416    ///
9417    /// * `path` - Location of the written directory (e.g., "output.txt").
9418    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9419    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
9420        let mut query = self.selection.select("export");
9421        query = query.arg("path", path.into());
9422        query.execute(self.graphql_client.clone()).await
9423    }
9424    /// Writes the file to a file path on the host.
9425    ///
9426    /// # Arguments
9427    ///
9428    /// * `path` - Location of the written directory (e.g., "output.txt").
9429    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9430    pub async fn export_opts(
9431        &self,
9432        path: impl Into<String>,
9433        opts: FileExportOpts,
9434    ) -> Result<String, DaggerError> {
9435        let mut query = self.selection.select("export");
9436        query = query.arg("path", path.into());
9437        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
9438            query = query.arg("allowParentDirPath", allow_parent_dir_path);
9439        }
9440        query.execute(self.graphql_client.clone()).await
9441    }
9442    /// A unique identifier for this File.
9443    pub async fn id(&self) -> Result<FileId, DaggerError> {
9444        let query = self.selection.select("id");
9445        query.execute(self.graphql_client.clone()).await
9446    }
9447    /// Retrieves the name of the file.
9448    pub async fn name(&self) -> Result<String, DaggerError> {
9449        let query = self.selection.select("name");
9450        query.execute(self.graphql_client.clone()).await
9451    }
9452    /// Searches for content matching the given regular expression or literal string.
9453    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
9454    ///
9455    /// # Arguments
9456    ///
9457    /// * `pattern` - The text to match.
9458    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9459    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
9460        let mut query = self.selection.select("search");
9461        query = query.arg("pattern", pattern.into());
9462        vec![SearchResult {
9463            proc: self.proc.clone(),
9464            selection: query,
9465            graphql_client: self.graphql_client.clone(),
9466        }]
9467    }
9468    /// Searches for content matching the given regular expression or literal string.
9469    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
9470    ///
9471    /// # Arguments
9472    ///
9473    /// * `pattern` - The text to match.
9474    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9475    pub fn search_opts<'a>(
9476        &self,
9477        pattern: impl Into<String>,
9478        opts: FileSearchOpts<'a>,
9479    ) -> Vec<SearchResult> {
9480        let mut query = self.selection.select("search");
9481        query = query.arg("pattern", pattern.into());
9482        if let Some(literal) = opts.literal {
9483            query = query.arg("literal", literal);
9484        }
9485        if let Some(multiline) = opts.multiline {
9486            query = query.arg("multiline", multiline);
9487        }
9488        if let Some(dotall) = opts.dotall {
9489            query = query.arg("dotall", dotall);
9490        }
9491        if let Some(insensitive) = opts.insensitive {
9492            query = query.arg("insensitive", insensitive);
9493        }
9494        if let Some(skip_ignored) = opts.skip_ignored {
9495            query = query.arg("skipIgnored", skip_ignored);
9496        }
9497        if let Some(skip_hidden) = opts.skip_hidden {
9498            query = query.arg("skipHidden", skip_hidden);
9499        }
9500        if let Some(files_only) = opts.files_only {
9501            query = query.arg("filesOnly", files_only);
9502        }
9503        if let Some(limit) = opts.limit {
9504            query = query.arg("limit", limit);
9505        }
9506        if let Some(paths) = opts.paths {
9507            query = query.arg("paths", paths);
9508        }
9509        if let Some(globs) = opts.globs {
9510            query = query.arg("globs", globs);
9511        }
9512        vec![SearchResult {
9513            proc: self.proc.clone(),
9514            selection: query,
9515            graphql_client: self.graphql_client.clone(),
9516        }]
9517    }
9518    /// Retrieves the size of the file, in bytes.
9519    pub async fn size(&self) -> Result<isize, DaggerError> {
9520        let query = self.selection.select("size");
9521        query.execute(self.graphql_client.clone()).await
9522    }
9523    /// Return file status
9524    pub fn stat(&self) -> Stat {
9525        let query = self.selection.select("stat");
9526        Stat {
9527            proc: self.proc.clone(),
9528            selection: query,
9529            graphql_client: self.graphql_client.clone(),
9530        }
9531    }
9532    /// Force evaluation in the engine.
9533    pub async fn sync(&self) -> Result<FileId, DaggerError> {
9534        let query = self.selection.select("sync");
9535        query.execute(self.graphql_client.clone()).await
9536    }
9537    /// Retrieves this file with its name set to the given name.
9538    ///
9539    /// # Arguments
9540    ///
9541    /// * `name` - Name to set file to.
9542    pub fn with_name(&self, name: impl Into<String>) -> File {
9543        let mut query = self.selection.select("withName");
9544        query = query.arg("name", name.into());
9545        File {
9546            proc: self.proc.clone(),
9547            selection: query,
9548            graphql_client: self.graphql_client.clone(),
9549        }
9550    }
9551    /// Retrieves the file with content replaced with the given text.
9552    /// If 'all' is true, all occurrences of the pattern will be replaced.
9553    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9554    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9555    /// If there are no matches for the pattern, this will error.
9556    ///
9557    /// # Arguments
9558    ///
9559    /// * `search` - The text to match.
9560    /// * `replacement` - The text to match.
9561    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9562    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
9563        let mut query = self.selection.select("withReplaced");
9564        query = query.arg("search", search.into());
9565        query = query.arg("replacement", replacement.into());
9566        File {
9567            proc: self.proc.clone(),
9568            selection: query,
9569            graphql_client: self.graphql_client.clone(),
9570        }
9571    }
9572    /// Retrieves the file with content replaced with the given text.
9573    /// If 'all' is true, all occurrences of the pattern will be replaced.
9574    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
9575    /// If neither are specified, and there are multiple matches for the pattern, this will error.
9576    /// If there are no matches for the pattern, this will error.
9577    ///
9578    /// # Arguments
9579    ///
9580    /// * `search` - The text to match.
9581    /// * `replacement` - The text to match.
9582    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9583    pub fn with_replaced_opts(
9584        &self,
9585        search: impl Into<String>,
9586        replacement: impl Into<String>,
9587        opts: FileWithReplacedOpts,
9588    ) -> File {
9589        let mut query = self.selection.select("withReplaced");
9590        query = query.arg("search", search.into());
9591        query = query.arg("replacement", replacement.into());
9592        if let Some(all) = opts.all {
9593            query = query.arg("all", all);
9594        }
9595        if let Some(first_from) = opts.first_from {
9596            query = query.arg("firstFrom", first_from);
9597        }
9598        File {
9599            proc: self.proc.clone(),
9600            selection: query,
9601            graphql_client: self.graphql_client.clone(),
9602        }
9603    }
9604    /// Retrieves this file with its created/modified timestamps set to the given time.
9605    ///
9606    /// # Arguments
9607    ///
9608    /// * `timestamp` - Timestamp to set dir/files in.
9609    ///
9610    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
9611    pub fn with_timestamps(&self, timestamp: isize) -> File {
9612        let mut query = self.selection.select("withTimestamps");
9613        query = query.arg("timestamp", timestamp);
9614        File {
9615            proc: self.proc.clone(),
9616            selection: query,
9617            graphql_client: self.graphql_client.clone(),
9618        }
9619    }
9620}
9621#[derive(Clone)]
9622pub struct Function {
9623    pub proc: Option<Arc<DaggerSessionProc>>,
9624    pub selection: Selection,
9625    pub graphql_client: DynGraphQLClient,
9626}
9627#[derive(Builder, Debug, PartialEq)]
9628pub struct FunctionWithArgOpts<'a> {
9629    #[builder(setter(into, strip_option), default)]
9630    pub default_address: Option<&'a str>,
9631    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
9632    #[builder(setter(into, strip_option), default)]
9633    pub default_path: Option<&'a str>,
9634    /// A default value to use for this argument if not explicitly set by the caller, if any
9635    #[builder(setter(into, strip_option), default)]
9636    pub default_value: Option<Json>,
9637    /// If deprecated, the reason or migration path.
9638    #[builder(setter(into, strip_option), default)]
9639    pub deprecated: Option<&'a str>,
9640    /// A doc string for the argument, if any
9641    #[builder(setter(into, strip_option), default)]
9642    pub description: Option<&'a str>,
9643    /// Patterns to ignore when loading the contextual argument value.
9644    #[builder(setter(into, strip_option), default)]
9645    pub ignore: Option<Vec<&'a str>>,
9646    /// The source map for the argument definition.
9647    #[builder(setter(into, strip_option), default)]
9648    pub source_map: Option<SourceMapId>,
9649}
9650#[derive(Builder, Debug, PartialEq)]
9651pub struct FunctionWithCachePolicyOpts<'a> {
9652    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
9653    #[builder(setter(into, strip_option), default)]
9654    pub time_to_live: Option<&'a str>,
9655}
9656#[derive(Builder, Debug, PartialEq)]
9657pub struct FunctionWithDeprecatedOpts<'a> {
9658    /// Reason or migration path describing the deprecation.
9659    #[builder(setter(into, strip_option), default)]
9660    pub reason: Option<&'a str>,
9661}
9662impl Function {
9663    /// Arguments accepted by the function, if any.
9664    pub fn args(&self) -> Vec<FunctionArg> {
9665        let query = self.selection.select("args");
9666        vec![FunctionArg {
9667            proc: self.proc.clone(),
9668            selection: query,
9669            graphql_client: self.graphql_client.clone(),
9670        }]
9671    }
9672    /// The reason this function is deprecated, if any.
9673    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9674        let query = self.selection.select("deprecated");
9675        query.execute(self.graphql_client.clone()).await
9676    }
9677    /// A doc string for the function, if any.
9678    pub async fn description(&self) -> Result<String, DaggerError> {
9679        let query = self.selection.select("description");
9680        query.execute(self.graphql_client.clone()).await
9681    }
9682    /// A unique identifier for this Function.
9683    pub async fn id(&self) -> Result<FunctionId, DaggerError> {
9684        let query = self.selection.select("id");
9685        query.execute(self.graphql_client.clone()).await
9686    }
9687    /// The name of the function.
9688    pub async fn name(&self) -> Result<String, DaggerError> {
9689        let query = self.selection.select("name");
9690        query.execute(self.graphql_client.clone()).await
9691    }
9692    /// The type returned by the function.
9693    pub fn return_type(&self) -> TypeDef {
9694        let query = self.selection.select("returnType");
9695        TypeDef {
9696            proc: self.proc.clone(),
9697            selection: query,
9698            graphql_client: self.graphql_client.clone(),
9699        }
9700    }
9701    /// The location of this function declaration.
9702    pub fn source_map(&self) -> SourceMap {
9703        let query = self.selection.select("sourceMap");
9704        SourceMap {
9705            proc: self.proc.clone(),
9706            selection: query,
9707            graphql_client: self.graphql_client.clone(),
9708        }
9709    }
9710    /// If this function is provided by a module, the name of the module. Unset otherwise.
9711    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9712        let query = self.selection.select("sourceModuleName");
9713        query.execute(self.graphql_client.clone()).await
9714    }
9715    /// Returns the function with the provided argument
9716    ///
9717    /// # Arguments
9718    ///
9719    /// * `name` - The name of the argument
9720    /// * `type_def` - The type of the argument
9721    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9722    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
9723        let mut query = self.selection.select("withArg");
9724        query = query.arg("name", name.into());
9725        query = query.arg_lazy(
9726            "typeDef",
9727            Box::new(move || {
9728                let type_def = type_def.clone();
9729                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9730            }),
9731        );
9732        Function {
9733            proc: self.proc.clone(),
9734            selection: query,
9735            graphql_client: self.graphql_client.clone(),
9736        }
9737    }
9738    /// Returns the function with the provided argument
9739    ///
9740    /// # Arguments
9741    ///
9742    /// * `name` - The name of the argument
9743    /// * `type_def` - The type of the argument
9744    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9745    pub fn with_arg_opts<'a>(
9746        &self,
9747        name: impl Into<String>,
9748        type_def: impl IntoID<TypeDefId>,
9749        opts: FunctionWithArgOpts<'a>,
9750    ) -> Function {
9751        let mut query = self.selection.select("withArg");
9752        query = query.arg("name", name.into());
9753        query = query.arg_lazy(
9754            "typeDef",
9755            Box::new(move || {
9756                let type_def = type_def.clone();
9757                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9758            }),
9759        );
9760        if let Some(description) = opts.description {
9761            query = query.arg("description", description);
9762        }
9763        if let Some(default_value) = opts.default_value {
9764            query = query.arg("defaultValue", default_value);
9765        }
9766        if let Some(default_path) = opts.default_path {
9767            query = query.arg("defaultPath", default_path);
9768        }
9769        if let Some(ignore) = opts.ignore {
9770            query = query.arg("ignore", ignore);
9771        }
9772        if let Some(source_map) = opts.source_map {
9773            query = query.arg("sourceMap", source_map);
9774        }
9775        if let Some(deprecated) = opts.deprecated {
9776            query = query.arg("deprecated", deprecated);
9777        }
9778        if let Some(default_address) = opts.default_address {
9779            query = query.arg("defaultAddress", default_address);
9780        }
9781        Function {
9782            proc: self.proc.clone(),
9783            selection: query,
9784            graphql_client: self.graphql_client.clone(),
9785        }
9786    }
9787    /// Returns the function updated to use the provided cache policy.
9788    ///
9789    /// # Arguments
9790    ///
9791    /// * `policy` - The cache policy to use.
9792    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9793    pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9794        let mut query = self.selection.select("withCachePolicy");
9795        query = query.arg("policy", policy);
9796        Function {
9797            proc: self.proc.clone(),
9798            selection: query,
9799            graphql_client: self.graphql_client.clone(),
9800        }
9801    }
9802    /// Returns the function updated to use the provided cache policy.
9803    ///
9804    /// # Arguments
9805    ///
9806    /// * `policy` - The cache policy to use.
9807    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9808    pub fn with_cache_policy_opts<'a>(
9809        &self,
9810        policy: FunctionCachePolicy,
9811        opts: FunctionWithCachePolicyOpts<'a>,
9812    ) -> Function {
9813        let mut query = self.selection.select("withCachePolicy");
9814        query = query.arg("policy", policy);
9815        if let Some(time_to_live) = opts.time_to_live {
9816            query = query.arg("timeToLive", time_to_live);
9817        }
9818        Function {
9819            proc: self.proc.clone(),
9820            selection: query,
9821            graphql_client: self.graphql_client.clone(),
9822        }
9823    }
9824    /// Returns the function with a flag indicating it's a check.
9825    pub fn with_check(&self) -> Function {
9826        let query = self.selection.select("withCheck");
9827        Function {
9828            proc: self.proc.clone(),
9829            selection: query,
9830            graphql_client: self.graphql_client.clone(),
9831        }
9832    }
9833    /// Returns the function with the provided deprecation reason.
9834    ///
9835    /// # Arguments
9836    ///
9837    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9838    pub fn with_deprecated(&self) -> Function {
9839        let query = self.selection.select("withDeprecated");
9840        Function {
9841            proc: self.proc.clone(),
9842            selection: query,
9843            graphql_client: self.graphql_client.clone(),
9844        }
9845    }
9846    /// Returns the function with the provided deprecation reason.
9847    ///
9848    /// # Arguments
9849    ///
9850    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9851    pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9852        let mut query = self.selection.select("withDeprecated");
9853        if let Some(reason) = opts.reason {
9854            query = query.arg("reason", reason);
9855        }
9856        Function {
9857            proc: self.proc.clone(),
9858            selection: query,
9859            graphql_client: self.graphql_client.clone(),
9860        }
9861    }
9862    /// Returns the function with the given doc string.
9863    ///
9864    /// # Arguments
9865    ///
9866    /// * `description` - The doc string to set.
9867    pub fn with_description(&self, description: impl Into<String>) -> Function {
9868        let mut query = self.selection.select("withDescription");
9869        query = query.arg("description", description.into());
9870        Function {
9871            proc: self.proc.clone(),
9872            selection: query,
9873            graphql_client: self.graphql_client.clone(),
9874        }
9875    }
9876    /// Returns the function with a flag indicating it's a generator.
9877    pub fn with_generator(&self) -> Function {
9878        let query = self.selection.select("withGenerator");
9879        Function {
9880            proc: self.proc.clone(),
9881            selection: query,
9882            graphql_client: self.graphql_client.clone(),
9883        }
9884    }
9885    /// Returns the function with the given source map.
9886    ///
9887    /// # Arguments
9888    ///
9889    /// * `source_map` - The source map for the function definition.
9890    pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
9891        let mut query = self.selection.select("withSourceMap");
9892        query = query.arg_lazy(
9893            "sourceMap",
9894            Box::new(move || {
9895                let source_map = source_map.clone();
9896                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9897            }),
9898        );
9899        Function {
9900            proc: self.proc.clone(),
9901            selection: query,
9902            graphql_client: self.graphql_client.clone(),
9903        }
9904    }
9905    /// Returns the function with a flag indicating it returns a service for dagger up.
9906    pub fn with_up(&self) -> Function {
9907        let query = self.selection.select("withUp");
9908        Function {
9909            proc: self.proc.clone(),
9910            selection: query,
9911            graphql_client: self.graphql_client.clone(),
9912        }
9913    }
9914}
9915#[derive(Clone)]
9916pub struct FunctionArg {
9917    pub proc: Option<Arc<DaggerSessionProc>>,
9918    pub selection: Selection,
9919    pub graphql_client: DynGraphQLClient,
9920}
9921impl FunctionArg {
9922    /// Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
9923    pub async fn default_address(&self) -> Result<String, DaggerError> {
9924        let query = self.selection.select("defaultAddress");
9925        query.execute(self.graphql_client.clone()).await
9926    }
9927    /// 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
9928    pub async fn default_path(&self) -> Result<String, DaggerError> {
9929        let query = self.selection.select("defaultPath");
9930        query.execute(self.graphql_client.clone()).await
9931    }
9932    /// A default value to use for this argument when not explicitly set by the caller, if any.
9933    pub async fn default_value(&self) -> Result<Json, DaggerError> {
9934        let query = self.selection.select("defaultValue");
9935        query.execute(self.graphql_client.clone()).await
9936    }
9937    /// The reason this function is deprecated, if any.
9938    pub async fn deprecated(&self) -> Result<String, DaggerError> {
9939        let query = self.selection.select("deprecated");
9940        query.execute(self.graphql_client.clone()).await
9941    }
9942    /// A doc string for the argument, if any.
9943    pub async fn description(&self) -> Result<String, DaggerError> {
9944        let query = self.selection.select("description");
9945        query.execute(self.graphql_client.clone()).await
9946    }
9947    /// A unique identifier for this FunctionArg.
9948    pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
9949        let query = self.selection.select("id");
9950        query.execute(self.graphql_client.clone()).await
9951    }
9952    /// 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.
9953    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9954        let query = self.selection.select("ignore");
9955        query.execute(self.graphql_client.clone()).await
9956    }
9957    /// The name of the argument in lowerCamelCase format.
9958    pub async fn name(&self) -> Result<String, DaggerError> {
9959        let query = self.selection.select("name");
9960        query.execute(self.graphql_client.clone()).await
9961    }
9962    /// The location of this arg declaration.
9963    pub fn source_map(&self) -> SourceMap {
9964        let query = self.selection.select("sourceMap");
9965        SourceMap {
9966            proc: self.proc.clone(),
9967            selection: query,
9968            graphql_client: self.graphql_client.clone(),
9969        }
9970    }
9971    /// The type of the argument.
9972    pub fn type_def(&self) -> TypeDef {
9973        let query = self.selection.select("typeDef");
9974        TypeDef {
9975            proc: self.proc.clone(),
9976            selection: query,
9977            graphql_client: self.graphql_client.clone(),
9978        }
9979    }
9980}
9981#[derive(Clone)]
9982pub struct FunctionCall {
9983    pub proc: Option<Arc<DaggerSessionProc>>,
9984    pub selection: Selection,
9985    pub graphql_client: DynGraphQLClient,
9986}
9987impl FunctionCall {
9988    /// A unique identifier for this FunctionCall.
9989    pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
9990        let query = self.selection.select("id");
9991        query.execute(self.graphql_client.clone()).await
9992    }
9993    /// The argument values the function is being invoked with.
9994    pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
9995        let query = self.selection.select("inputArgs");
9996        vec![FunctionCallArgValue {
9997            proc: self.proc.clone(),
9998            selection: query,
9999            graphql_client: self.graphql_client.clone(),
10000        }]
10001    }
10002    /// The name of the function being called.
10003    pub async fn name(&self) -> Result<String, DaggerError> {
10004        let query = self.selection.select("name");
10005        query.execute(self.graphql_client.clone()).await
10006    }
10007    /// 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.
10008    pub async fn parent(&self) -> Result<Json, DaggerError> {
10009        let query = self.selection.select("parent");
10010        query.execute(self.graphql_client.clone()).await
10011    }
10012    /// 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.
10013    pub async fn parent_name(&self) -> Result<String, DaggerError> {
10014        let query = self.selection.select("parentName");
10015        query.execute(self.graphql_client.clone()).await
10016    }
10017    /// Return an error from the function.
10018    ///
10019    /// # Arguments
10020    ///
10021    /// * `error` - The error to return.
10022    pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
10023        let mut query = self.selection.select("returnError");
10024        query = query.arg_lazy(
10025            "error",
10026            Box::new(move || {
10027                let error = error.clone();
10028                Box::pin(async move { error.into_id().await.unwrap().quote() })
10029            }),
10030        );
10031        query.execute(self.graphql_client.clone()).await
10032    }
10033    /// Set the return value of the function call to the provided value.
10034    ///
10035    /// # Arguments
10036    ///
10037    /// * `value` - JSON serialization of the return value.
10038    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
10039        let mut query = self.selection.select("returnValue");
10040        query = query.arg("value", value);
10041        query.execute(self.graphql_client.clone()).await
10042    }
10043}
10044#[derive(Clone)]
10045pub struct FunctionCallArgValue {
10046    pub proc: Option<Arc<DaggerSessionProc>>,
10047    pub selection: Selection,
10048    pub graphql_client: DynGraphQLClient,
10049}
10050impl FunctionCallArgValue {
10051    /// A unique identifier for this FunctionCallArgValue.
10052    pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
10053        let query = self.selection.select("id");
10054        query.execute(self.graphql_client.clone()).await
10055    }
10056    /// The name of the argument.
10057    pub async fn name(&self) -> Result<String, DaggerError> {
10058        let query = self.selection.select("name");
10059        query.execute(self.graphql_client.clone()).await
10060    }
10061    /// The value of the argument represented as a JSON serialized string.
10062    pub async fn value(&self) -> Result<Json, DaggerError> {
10063        let query = self.selection.select("value");
10064        query.execute(self.graphql_client.clone()).await
10065    }
10066}
10067#[derive(Clone)]
10068pub struct GeneratedCode {
10069    pub proc: Option<Arc<DaggerSessionProc>>,
10070    pub selection: Selection,
10071    pub graphql_client: DynGraphQLClient,
10072}
10073impl GeneratedCode {
10074    /// The directory containing the generated code.
10075    pub fn code(&self) -> Directory {
10076        let query = self.selection.select("code");
10077        Directory {
10078            proc: self.proc.clone(),
10079            selection: query,
10080            graphql_client: self.graphql_client.clone(),
10081        }
10082    }
10083    /// A unique identifier for this GeneratedCode.
10084    pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
10085        let query = self.selection.select("id");
10086        query.execute(self.graphql_client.clone()).await
10087    }
10088    /// List of paths to mark generated in version control (i.e. .gitattributes).
10089    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
10090        let query = self.selection.select("vcsGeneratedPaths");
10091        query.execute(self.graphql_client.clone()).await
10092    }
10093    /// List of paths to ignore in version control (i.e. .gitignore).
10094    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
10095        let query = self.selection.select("vcsIgnoredPaths");
10096        query.execute(self.graphql_client.clone()).await
10097    }
10098    /// Set the list of paths to mark generated in version control.
10099    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10100        let mut query = self.selection.select("withVCSGeneratedPaths");
10101        query = query.arg(
10102            "paths",
10103            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10104        );
10105        GeneratedCode {
10106            proc: self.proc.clone(),
10107            selection: query,
10108            graphql_client: self.graphql_client.clone(),
10109        }
10110    }
10111    /// Set the list of paths to ignore in version control.
10112    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
10113        let mut query = self.selection.select("withVCSIgnoredPaths");
10114        query = query.arg(
10115            "paths",
10116            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10117        );
10118        GeneratedCode {
10119            proc: self.proc.clone(),
10120            selection: query,
10121            graphql_client: self.graphql_client.clone(),
10122        }
10123    }
10124}
10125#[derive(Clone)]
10126pub struct Generator {
10127    pub proc: Option<Arc<DaggerSessionProc>>,
10128    pub selection: Selection,
10129    pub graphql_client: DynGraphQLClient,
10130}
10131impl Generator {
10132    /// The generated changeset
10133    pub fn changes(&self) -> Changeset {
10134        let query = self.selection.select("changes");
10135        Changeset {
10136            proc: self.proc.clone(),
10137            selection: query,
10138            graphql_client: self.graphql_client.clone(),
10139        }
10140    }
10141    /// Whether the generator complete
10142    pub async fn completed(&self) -> Result<bool, DaggerError> {
10143        let query = self.selection.select("completed");
10144        query.execute(self.graphql_client.clone()).await
10145    }
10146    /// Return the description of the generator
10147    pub async fn description(&self) -> Result<String, DaggerError> {
10148        let query = self.selection.select("description");
10149        query.execute(self.graphql_client.clone()).await
10150    }
10151    /// A unique identifier for this Generator.
10152    pub async fn id(&self) -> Result<GeneratorId, DaggerError> {
10153        let query = self.selection.select("id");
10154        query.execute(self.graphql_client.clone()).await
10155    }
10156    /// Wether changeset from the generator execution is empty or not
10157    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
10158        let query = self.selection.select("isEmpty");
10159        query.execute(self.graphql_client.clone()).await
10160    }
10161    /// Return the fully qualified name of the generator
10162    pub async fn name(&self) -> Result<String, DaggerError> {
10163        let query = self.selection.select("name");
10164        query.execute(self.graphql_client.clone()).await
10165    }
10166    /// The original module in which the generator has been defined
10167    pub fn original_module(&self) -> Module {
10168        let query = self.selection.select("originalModule");
10169        Module {
10170            proc: self.proc.clone(),
10171            selection: query,
10172            graphql_client: self.graphql_client.clone(),
10173        }
10174    }
10175    /// The path of the generator within its module
10176    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
10177        let query = self.selection.select("path");
10178        query.execute(self.graphql_client.clone()).await
10179    }
10180    /// Execute the generator
10181    pub fn run(&self) -> Generator {
10182        let query = self.selection.select("run");
10183        Generator {
10184            proc: self.proc.clone(),
10185            selection: query,
10186            graphql_client: self.graphql_client.clone(),
10187        }
10188    }
10189}
10190#[derive(Clone)]
10191pub struct GeneratorGroup {
10192    pub proc: Option<Arc<DaggerSessionProc>>,
10193    pub selection: Selection,
10194    pub graphql_client: DynGraphQLClient,
10195}
10196#[derive(Builder, Debug, PartialEq)]
10197pub struct GeneratorGroupChangesOpts {
10198    /// Strategy to apply on conflicts between generators
10199    #[builder(setter(into, strip_option), default)]
10200    pub on_conflict: Option<ChangesetsMergeConflict>,
10201}
10202impl GeneratorGroup {
10203    /// The combined changes from the generators execution
10204    /// 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.
10205    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
10206    ///
10207    /// # Arguments
10208    ///
10209    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10210    pub fn changes(&self) -> Changeset {
10211        let query = self.selection.select("changes");
10212        Changeset {
10213            proc: self.proc.clone(),
10214            selection: query,
10215            graphql_client: self.graphql_client.clone(),
10216        }
10217    }
10218    /// The combined changes from the generators execution
10219    /// 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.
10220    /// Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
10221    ///
10222    /// # Arguments
10223    ///
10224    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10225    pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
10226        let mut query = self.selection.select("changes");
10227        if let Some(on_conflict) = opts.on_conflict {
10228            query = query.arg("onConflict", on_conflict);
10229        }
10230        Changeset {
10231            proc: self.proc.clone(),
10232            selection: query,
10233            graphql_client: self.graphql_client.clone(),
10234        }
10235    }
10236    /// A unique identifier for this GeneratorGroup.
10237    pub async fn id(&self) -> Result<GeneratorGroupId, DaggerError> {
10238        let query = self.selection.select("id");
10239        query.execute(self.graphql_client.clone()).await
10240    }
10241    /// Whether the generated changeset is empty or not
10242    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
10243        let query = self.selection.select("isEmpty");
10244        query.execute(self.graphql_client.clone()).await
10245    }
10246    /// Return a list of individual generators and their details
10247    pub fn list(&self) -> Vec<Generator> {
10248        let query = self.selection.select("list");
10249        vec![Generator {
10250            proc: self.proc.clone(),
10251            selection: query,
10252            graphql_client: self.graphql_client.clone(),
10253        }]
10254    }
10255    /// Execute all selected generators
10256    pub fn run(&self) -> GeneratorGroup {
10257        let query = self.selection.select("run");
10258        GeneratorGroup {
10259            proc: self.proc.clone(),
10260            selection: query,
10261            graphql_client: self.graphql_client.clone(),
10262        }
10263    }
10264}
10265#[derive(Clone)]
10266pub struct GitRef {
10267    pub proc: Option<Arc<DaggerSessionProc>>,
10268    pub selection: Selection,
10269    pub graphql_client: DynGraphQLClient,
10270}
10271#[derive(Builder, Debug, PartialEq)]
10272pub struct GitRefTreeOpts {
10273    /// The depth of the tree to fetch.
10274    #[builder(setter(into, strip_option), default)]
10275    pub depth: Option<isize>,
10276    /// Set to true to discard .git directory.
10277    #[builder(setter(into, strip_option), default)]
10278    pub discard_git_dir: Option<bool>,
10279    /// Set to true to populate tag refs in the local checkout .git.
10280    #[builder(setter(into, strip_option), default)]
10281    pub include_tags: Option<bool>,
10282}
10283impl GitRef {
10284    /// The resolved commit id at this ref.
10285    pub async fn commit(&self) -> Result<String, DaggerError> {
10286        let query = self.selection.select("commit");
10287        query.execute(self.graphql_client.clone()).await
10288    }
10289    /// Find the best common ancestor between this ref and another ref.
10290    ///
10291    /// # Arguments
10292    ///
10293    /// * `other` - The other ref to compare against.
10294    pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
10295        let mut query = self.selection.select("commonAncestor");
10296        query = query.arg_lazy(
10297            "other",
10298            Box::new(move || {
10299                let other = other.clone();
10300                Box::pin(async move { other.into_id().await.unwrap().quote() })
10301            }),
10302        );
10303        GitRef {
10304            proc: self.proc.clone(),
10305            selection: query,
10306            graphql_client: self.graphql_client.clone(),
10307        }
10308    }
10309    /// A unique identifier for this GitRef.
10310    pub async fn id(&self) -> Result<GitRefId, DaggerError> {
10311        let query = self.selection.select("id");
10312        query.execute(self.graphql_client.clone()).await
10313    }
10314    /// The resolved ref name at this ref.
10315    pub async fn r#ref(&self) -> Result<String, DaggerError> {
10316        let query = self.selection.select("ref");
10317        query.execute(self.graphql_client.clone()).await
10318    }
10319    /// The filesystem tree at this ref.
10320    ///
10321    /// # Arguments
10322    ///
10323    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10324    pub fn tree(&self) -> Directory {
10325        let query = self.selection.select("tree");
10326        Directory {
10327            proc: self.proc.clone(),
10328            selection: query,
10329            graphql_client: self.graphql_client.clone(),
10330        }
10331    }
10332    /// The filesystem tree at this ref.
10333    ///
10334    /// # Arguments
10335    ///
10336    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10337    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
10338        let mut query = self.selection.select("tree");
10339        if let Some(discard_git_dir) = opts.discard_git_dir {
10340            query = query.arg("discardGitDir", discard_git_dir);
10341        }
10342        if let Some(depth) = opts.depth {
10343            query = query.arg("depth", depth);
10344        }
10345        if let Some(include_tags) = opts.include_tags {
10346            query = query.arg("includeTags", include_tags);
10347        }
10348        Directory {
10349            proc: self.proc.clone(),
10350            selection: query,
10351            graphql_client: self.graphql_client.clone(),
10352        }
10353    }
10354}
10355#[derive(Clone)]
10356pub struct GitRepository {
10357    pub proc: Option<Arc<DaggerSessionProc>>,
10358    pub selection: Selection,
10359    pub graphql_client: DynGraphQLClient,
10360}
10361#[derive(Builder, Debug, PartialEq)]
10362pub struct GitRepositoryBranchesOpts<'a> {
10363    /// Glob patterns (e.g., "refs/tags/v*").
10364    #[builder(setter(into, strip_option), default)]
10365    pub patterns: Option<Vec<&'a str>>,
10366}
10367#[derive(Builder, Debug, PartialEq)]
10368pub struct GitRepositoryTagsOpts<'a> {
10369    /// Glob patterns (e.g., "refs/tags/v*").
10370    #[builder(setter(into, strip_option), default)]
10371    pub patterns: Option<Vec<&'a str>>,
10372}
10373impl GitRepository {
10374    /// Returns details of a branch.
10375    ///
10376    /// # Arguments
10377    ///
10378    /// * `name` - Branch's name (e.g., "main").
10379    pub fn branch(&self, name: impl Into<String>) -> GitRef {
10380        let mut query = self.selection.select("branch");
10381        query = query.arg("name", name.into());
10382        GitRef {
10383            proc: self.proc.clone(),
10384            selection: query,
10385            graphql_client: self.graphql_client.clone(),
10386        }
10387    }
10388    /// branches that match any of the given glob patterns.
10389    ///
10390    /// # Arguments
10391    ///
10392    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10393    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
10394        let query = self.selection.select("branches");
10395        query.execute(self.graphql_client.clone()).await
10396    }
10397    /// branches that match any of the given glob patterns.
10398    ///
10399    /// # Arguments
10400    ///
10401    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10402    pub async fn branches_opts<'a>(
10403        &self,
10404        opts: GitRepositoryBranchesOpts<'a>,
10405    ) -> Result<Vec<String>, DaggerError> {
10406        let mut query = self.selection.select("branches");
10407        if let Some(patterns) = opts.patterns {
10408            query = query.arg("patterns", patterns);
10409        }
10410        query.execute(self.graphql_client.clone()).await
10411    }
10412    /// Returns details of a commit.
10413    ///
10414    /// # Arguments
10415    ///
10416    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
10417    pub fn commit(&self, id: impl Into<String>) -> GitRef {
10418        let mut query = self.selection.select("commit");
10419        query = query.arg("id", id.into());
10420        GitRef {
10421            proc: self.proc.clone(),
10422            selection: query,
10423            graphql_client: self.graphql_client.clone(),
10424        }
10425    }
10426    /// Returns details for HEAD.
10427    pub fn head(&self) -> GitRef {
10428        let query = self.selection.select("head");
10429        GitRef {
10430            proc: self.proc.clone(),
10431            selection: query,
10432            graphql_client: self.graphql_client.clone(),
10433        }
10434    }
10435    /// A unique identifier for this GitRepository.
10436    pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
10437        let query = self.selection.select("id");
10438        query.execute(self.graphql_client.clone()).await
10439    }
10440    /// Returns details for the latest semver tag.
10441    pub fn latest_version(&self) -> GitRef {
10442        let query = self.selection.select("latestVersion");
10443        GitRef {
10444            proc: self.proc.clone(),
10445            selection: query,
10446            graphql_client: self.graphql_client.clone(),
10447        }
10448    }
10449    /// Returns details of a ref.
10450    ///
10451    /// # Arguments
10452    ///
10453    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
10454    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
10455        let mut query = self.selection.select("ref");
10456        query = query.arg("name", name.into());
10457        GitRef {
10458            proc: self.proc.clone(),
10459            selection: query,
10460            graphql_client: self.graphql_client.clone(),
10461        }
10462    }
10463    /// Returns details of a tag.
10464    ///
10465    /// # Arguments
10466    ///
10467    /// * `name` - Tag's name (e.g., "v0.3.9").
10468    pub fn tag(&self, name: impl Into<String>) -> GitRef {
10469        let mut query = self.selection.select("tag");
10470        query = query.arg("name", name.into());
10471        GitRef {
10472            proc: self.proc.clone(),
10473            selection: query,
10474            graphql_client: self.graphql_client.clone(),
10475        }
10476    }
10477    /// tags that match any of the given glob patterns.
10478    ///
10479    /// # Arguments
10480    ///
10481    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10482    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
10483        let query = self.selection.select("tags");
10484        query.execute(self.graphql_client.clone()).await
10485    }
10486    /// tags that match any of the given glob patterns.
10487    ///
10488    /// # Arguments
10489    ///
10490    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10491    pub async fn tags_opts<'a>(
10492        &self,
10493        opts: GitRepositoryTagsOpts<'a>,
10494    ) -> Result<Vec<String>, DaggerError> {
10495        let mut query = self.selection.select("tags");
10496        if let Some(patterns) = opts.patterns {
10497            query = query.arg("patterns", patterns);
10498        }
10499        query.execute(self.graphql_client.clone()).await
10500    }
10501    /// Returns the changeset of uncommitted changes in the git repository.
10502    pub fn uncommitted(&self) -> Changeset {
10503        let query = self.selection.select("uncommitted");
10504        Changeset {
10505            proc: self.proc.clone(),
10506            selection: query,
10507            graphql_client: self.graphql_client.clone(),
10508        }
10509    }
10510    /// The URL of the git repository.
10511    pub async fn url(&self) -> Result<String, DaggerError> {
10512        let query = self.selection.select("url");
10513        query.execute(self.graphql_client.clone()).await
10514    }
10515}
10516#[derive(Clone)]
10517pub struct HealthcheckConfig {
10518    pub proc: Option<Arc<DaggerSessionProc>>,
10519    pub selection: Selection,
10520    pub graphql_client: DynGraphQLClient,
10521}
10522impl HealthcheckConfig {
10523    /// Healthcheck command arguments.
10524    pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
10525        let query = self.selection.select("args");
10526        query.execute(self.graphql_client.clone()).await
10527    }
10528    /// A unique identifier for this HealthcheckConfig.
10529    pub async fn id(&self) -> Result<HealthcheckConfigId, DaggerError> {
10530        let query = self.selection.select("id");
10531        query.execute(self.graphql_client.clone()).await
10532    }
10533    /// Interval between running healthcheck. Example:30s
10534    pub async fn interval(&self) -> Result<String, DaggerError> {
10535        let query = self.selection.select("interval");
10536        query.execute(self.graphql_client.clone()).await
10537    }
10538    /// The maximum number of consecutive failures before the container is marked as unhealthy. Example:3
10539    pub async fn retries(&self) -> Result<isize, DaggerError> {
10540        let query = self.selection.select("retries");
10541        query.execute(self.graphql_client.clone()).await
10542    }
10543    /// Healthcheck command is a shell command.
10544    pub async fn shell(&self) -> Result<bool, DaggerError> {
10545        let query = self.selection.select("shell");
10546        query.execute(self.graphql_client.clone()).await
10547    }
10548    /// StartInterval configures the duration between checks during the startup phase. Example:5s
10549    pub async fn start_interval(&self) -> Result<String, DaggerError> {
10550        let query = self.selection.select("startInterval");
10551        query.execute(self.graphql_client.clone()).await
10552    }
10553    /// StartPeriod allows for failures during this initial startup period which do not count towards maximum number of retries. Example:0s
10554    pub async fn start_period(&self) -> Result<String, DaggerError> {
10555        let query = self.selection.select("startPeriod");
10556        query.execute(self.graphql_client.clone()).await
10557    }
10558    /// Healthcheck timeout. Example:3s
10559    pub async fn timeout(&self) -> Result<String, DaggerError> {
10560        let query = self.selection.select("timeout");
10561        query.execute(self.graphql_client.clone()).await
10562    }
10563}
10564#[derive(Clone)]
10565pub struct Host {
10566    pub proc: Option<Arc<DaggerSessionProc>>,
10567    pub selection: Selection,
10568    pub graphql_client: DynGraphQLClient,
10569}
10570#[derive(Builder, Debug, PartialEq)]
10571pub struct HostDirectoryOpts<'a> {
10572    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
10573    #[builder(setter(into, strip_option), default)]
10574    pub exclude: Option<Vec<&'a str>>,
10575    /// Apply .gitignore filter rules inside the directory
10576    #[builder(setter(into, strip_option), default)]
10577    pub gitignore: Option<bool>,
10578    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
10579    #[builder(setter(into, strip_option), default)]
10580    pub include: Option<Vec<&'a str>>,
10581    /// If true, the directory will always be reloaded from the host.
10582    #[builder(setter(into, strip_option), default)]
10583    pub no_cache: Option<bool>,
10584}
10585#[derive(Builder, Debug, PartialEq)]
10586pub struct HostFileOpts {
10587    /// If true, the file will always be reloaded from the host.
10588    #[builder(setter(into, strip_option), default)]
10589    pub no_cache: Option<bool>,
10590}
10591#[derive(Builder, Debug, PartialEq)]
10592pub struct HostFindUpOpts {
10593    #[builder(setter(into, strip_option), default)]
10594    pub no_cache: Option<bool>,
10595}
10596#[derive(Builder, Debug, PartialEq)]
10597pub struct HostServiceOpts<'a> {
10598    /// Upstream host to forward traffic to.
10599    #[builder(setter(into, strip_option), default)]
10600    pub host: Option<&'a str>,
10601}
10602#[derive(Builder, Debug, PartialEq)]
10603pub struct HostTunnelOpts {
10604    /// Map each service port to the same port on the host, as if the service were running natively.
10605    /// Note: enabling may result in port conflicts.
10606    #[builder(setter(into, strip_option), default)]
10607    pub native: Option<bool>,
10608    /// Configure explicit port forwarding rules for the tunnel.
10609    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
10610    /// 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.
10611    /// If ports are given and native is true, the ports are additive.
10612    #[builder(setter(into, strip_option), default)]
10613    pub ports: Option<Vec<PortForward>>,
10614}
10615impl Host {
10616    /// Accesses a container image on the host.
10617    ///
10618    /// # Arguments
10619    ///
10620    /// * `name` - Name of the image to access.
10621    pub fn container_image(&self, name: impl Into<String>) -> Container {
10622        let mut query = self.selection.select("containerImage");
10623        query = query.arg("name", name.into());
10624        Container {
10625            proc: self.proc.clone(),
10626            selection: query,
10627            graphql_client: self.graphql_client.clone(),
10628        }
10629    }
10630    /// Accesses a directory on the host.
10631    ///
10632    /// # Arguments
10633    ///
10634    /// * `path` - Location of the directory to access (e.g., ".").
10635    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10636    pub fn directory(&self, path: impl Into<String>) -> Directory {
10637        let mut query = self.selection.select("directory");
10638        query = query.arg("path", path.into());
10639        Directory {
10640            proc: self.proc.clone(),
10641            selection: query,
10642            graphql_client: self.graphql_client.clone(),
10643        }
10644    }
10645    /// Accesses a directory on the host.
10646    ///
10647    /// # Arguments
10648    ///
10649    /// * `path` - Location of the directory to access (e.g., ".").
10650    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10651    pub fn directory_opts<'a>(
10652        &self,
10653        path: impl Into<String>,
10654        opts: HostDirectoryOpts<'a>,
10655    ) -> Directory {
10656        let mut query = self.selection.select("directory");
10657        query = query.arg("path", path.into());
10658        if let Some(exclude) = opts.exclude {
10659            query = query.arg("exclude", exclude);
10660        }
10661        if let Some(include) = opts.include {
10662            query = query.arg("include", include);
10663        }
10664        if let Some(no_cache) = opts.no_cache {
10665            query = query.arg("noCache", no_cache);
10666        }
10667        if let Some(gitignore) = opts.gitignore {
10668            query = query.arg("gitignore", gitignore);
10669        }
10670        Directory {
10671            proc: self.proc.clone(),
10672            selection: query,
10673            graphql_client: self.graphql_client.clone(),
10674        }
10675    }
10676    /// Accesses a file on the host.
10677    ///
10678    /// # Arguments
10679    ///
10680    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10681    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10682    pub fn file(&self, path: impl Into<String>) -> File {
10683        let mut query = self.selection.select("file");
10684        query = query.arg("path", path.into());
10685        File {
10686            proc: self.proc.clone(),
10687            selection: query,
10688            graphql_client: self.graphql_client.clone(),
10689        }
10690    }
10691    /// Accesses a file on the host.
10692    ///
10693    /// # Arguments
10694    ///
10695    /// * `path` - Location of the file to retrieve (e.g., "README.md").
10696    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10697    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
10698        let mut query = self.selection.select("file");
10699        query = query.arg("path", path.into());
10700        if let Some(no_cache) = opts.no_cache {
10701            query = query.arg("noCache", no_cache);
10702        }
10703        File {
10704            proc: self.proc.clone(),
10705            selection: query,
10706            graphql_client: self.graphql_client.clone(),
10707        }
10708    }
10709    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10710    ///
10711    /// # Arguments
10712    ///
10713    /// * `name` - name of the file or directory to search for
10714    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10715    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
10716        let mut query = self.selection.select("findUp");
10717        query = query.arg("name", name.into());
10718        query.execute(self.graphql_client.clone()).await
10719    }
10720    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
10721    ///
10722    /// # Arguments
10723    ///
10724    /// * `name` - name of the file or directory to search for
10725    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10726    pub async fn find_up_opts(
10727        &self,
10728        name: impl Into<String>,
10729        opts: HostFindUpOpts,
10730    ) -> Result<String, DaggerError> {
10731        let mut query = self.selection.select("findUp");
10732        query = query.arg("name", name.into());
10733        if let Some(no_cache) = opts.no_cache {
10734            query = query.arg("noCache", no_cache);
10735        }
10736        query.execute(self.graphql_client.clone()).await
10737    }
10738    /// A unique identifier for this Host.
10739    pub async fn id(&self) -> Result<HostId, DaggerError> {
10740        let query = self.selection.select("id");
10741        query.execute(self.graphql_client.clone()).await
10742    }
10743    /// Creates a service that forwards traffic to a specified address via the host.
10744    ///
10745    /// # Arguments
10746    ///
10747    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10748    ///
10749    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10750    ///
10751    /// An empty set of ports is not valid; an error will be returned.
10752    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10753    pub fn service(&self, ports: Vec<PortForward>) -> Service {
10754        let mut query = self.selection.select("service");
10755        query = query.arg("ports", ports);
10756        Service {
10757            proc: self.proc.clone(),
10758            selection: query,
10759            graphql_client: self.graphql_client.clone(),
10760        }
10761    }
10762    /// Creates a service that forwards traffic to a specified address via the host.
10763    ///
10764    /// # Arguments
10765    ///
10766    /// * `ports` - Ports to expose via the service, forwarding through the host network.
10767    ///
10768    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
10769    ///
10770    /// An empty set of ports is not valid; an error will be returned.
10771    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10772    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
10773        let mut query = self.selection.select("service");
10774        query = query.arg("ports", ports);
10775        if let Some(host) = opts.host {
10776            query = query.arg("host", host);
10777        }
10778        Service {
10779            proc: self.proc.clone(),
10780            selection: query,
10781            graphql_client: self.graphql_client.clone(),
10782        }
10783    }
10784    /// Creates a tunnel that forwards traffic from the host to a service.
10785    ///
10786    /// # Arguments
10787    ///
10788    /// * `service` - Service to send traffic from the tunnel.
10789    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10790    pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
10791        let mut query = self.selection.select("tunnel");
10792        query = query.arg_lazy(
10793            "service",
10794            Box::new(move || {
10795                let service = service.clone();
10796                Box::pin(async move { service.into_id().await.unwrap().quote() })
10797            }),
10798        );
10799        Service {
10800            proc: self.proc.clone(),
10801            selection: query,
10802            graphql_client: self.graphql_client.clone(),
10803        }
10804    }
10805    /// Creates a tunnel that forwards traffic from the host to a service.
10806    ///
10807    /// # Arguments
10808    ///
10809    /// * `service` - Service to send traffic from the tunnel.
10810    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10811    pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
10812        let mut query = self.selection.select("tunnel");
10813        query = query.arg_lazy(
10814            "service",
10815            Box::new(move || {
10816                let service = service.clone();
10817                Box::pin(async move { service.into_id().await.unwrap().quote() })
10818            }),
10819        );
10820        if let Some(native) = opts.native {
10821            query = query.arg("native", native);
10822        }
10823        if let Some(ports) = opts.ports {
10824            query = query.arg("ports", ports);
10825        }
10826        Service {
10827            proc: self.proc.clone(),
10828            selection: query,
10829            graphql_client: self.graphql_client.clone(),
10830        }
10831    }
10832    /// Accesses a Unix socket on the host.
10833    ///
10834    /// # Arguments
10835    ///
10836    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
10837    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
10838        let mut query = self.selection.select("unixSocket");
10839        query = query.arg("path", path.into());
10840        Socket {
10841            proc: self.proc.clone(),
10842            selection: query,
10843            graphql_client: self.graphql_client.clone(),
10844        }
10845    }
10846}
10847#[derive(Clone)]
10848pub struct InputTypeDef {
10849    pub proc: Option<Arc<DaggerSessionProc>>,
10850    pub selection: Selection,
10851    pub graphql_client: DynGraphQLClient,
10852}
10853impl InputTypeDef {
10854    /// Static fields defined on this input object, if any.
10855    pub fn fields(&self) -> Vec<FieldTypeDef> {
10856        let query = self.selection.select("fields");
10857        vec![FieldTypeDef {
10858            proc: self.proc.clone(),
10859            selection: query,
10860            graphql_client: self.graphql_client.clone(),
10861        }]
10862    }
10863    /// A unique identifier for this InputTypeDef.
10864    pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
10865        let query = self.selection.select("id");
10866        query.execute(self.graphql_client.clone()).await
10867    }
10868    /// The name of the input object.
10869    pub async fn name(&self) -> Result<String, DaggerError> {
10870        let query = self.selection.select("name");
10871        query.execute(self.graphql_client.clone()).await
10872    }
10873}
10874#[derive(Clone)]
10875pub struct InterfaceTypeDef {
10876    pub proc: Option<Arc<DaggerSessionProc>>,
10877    pub selection: Selection,
10878    pub graphql_client: DynGraphQLClient,
10879}
10880impl InterfaceTypeDef {
10881    /// The doc string for the interface, if any.
10882    pub async fn description(&self) -> Result<String, DaggerError> {
10883        let query = self.selection.select("description");
10884        query.execute(self.graphql_client.clone()).await
10885    }
10886    /// Functions defined on this interface, if any.
10887    pub fn functions(&self) -> Vec<Function> {
10888        let query = self.selection.select("functions");
10889        vec![Function {
10890            proc: self.proc.clone(),
10891            selection: query,
10892            graphql_client: self.graphql_client.clone(),
10893        }]
10894    }
10895    /// A unique identifier for this InterfaceTypeDef.
10896    pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
10897        let query = self.selection.select("id");
10898        query.execute(self.graphql_client.clone()).await
10899    }
10900    /// The name of the interface.
10901    pub async fn name(&self) -> Result<String, DaggerError> {
10902        let query = self.selection.select("name");
10903        query.execute(self.graphql_client.clone()).await
10904    }
10905    /// The location of this interface declaration.
10906    pub fn source_map(&self) -> SourceMap {
10907        let query = self.selection.select("sourceMap");
10908        SourceMap {
10909            proc: self.proc.clone(),
10910            selection: query,
10911            graphql_client: self.graphql_client.clone(),
10912        }
10913    }
10914    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
10915    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10916        let query = self.selection.select("sourceModuleName");
10917        query.execute(self.graphql_client.clone()).await
10918    }
10919}
10920#[derive(Clone)]
10921pub struct JsonValue {
10922    pub proc: Option<Arc<DaggerSessionProc>>,
10923    pub selection: Selection,
10924    pub graphql_client: DynGraphQLClient,
10925}
10926#[derive(Builder, Debug, PartialEq)]
10927pub struct JsonValueContentsOpts<'a> {
10928    /// Optional line prefix
10929    #[builder(setter(into, strip_option), default)]
10930    pub indent: Option<&'a str>,
10931    /// Pretty-print
10932    #[builder(setter(into, strip_option), default)]
10933    pub pretty: Option<bool>,
10934}
10935impl JsonValue {
10936    /// Decode an array from json
10937    pub fn as_array(&self) -> Vec<JsonValue> {
10938        let query = self.selection.select("asArray");
10939        vec![JsonValue {
10940            proc: self.proc.clone(),
10941            selection: query,
10942            graphql_client: self.graphql_client.clone(),
10943        }]
10944    }
10945    /// Decode a boolean from json
10946    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10947        let query = self.selection.select("asBoolean");
10948        query.execute(self.graphql_client.clone()).await
10949    }
10950    /// Decode an integer from json
10951    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10952        let query = self.selection.select("asInteger");
10953        query.execute(self.graphql_client.clone()).await
10954    }
10955    /// Decode a string from json
10956    pub async fn as_string(&self) -> Result<String, DaggerError> {
10957        let query = self.selection.select("asString");
10958        query.execute(self.graphql_client.clone()).await
10959    }
10960    /// Return the value encoded as json
10961    ///
10962    /// # Arguments
10963    ///
10964    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10965    pub async fn contents(&self) -> Result<Json, DaggerError> {
10966        let query = self.selection.select("contents");
10967        query.execute(self.graphql_client.clone()).await
10968    }
10969    /// Return the value encoded as json
10970    ///
10971    /// # Arguments
10972    ///
10973    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10974    pub async fn contents_opts<'a>(
10975        &self,
10976        opts: JsonValueContentsOpts<'a>,
10977    ) -> Result<Json, DaggerError> {
10978        let mut query = self.selection.select("contents");
10979        if let Some(pretty) = opts.pretty {
10980            query = query.arg("pretty", pretty);
10981        }
10982        if let Some(indent) = opts.indent {
10983            query = query.arg("indent", indent);
10984        }
10985        query.execute(self.graphql_client.clone()).await
10986    }
10987    /// Lookup the field at the given path, and return its value.
10988    ///
10989    /// # Arguments
10990    ///
10991    /// * `path` - Path of the field to lookup, encoded as an array of field names
10992    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
10993        let mut query = self.selection.select("field");
10994        query = query.arg(
10995            "path",
10996            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10997        );
10998        JsonValue {
10999            proc: self.proc.clone(),
11000            selection: query,
11001            graphql_client: self.graphql_client.clone(),
11002        }
11003    }
11004    /// List fields of the encoded object
11005    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
11006        let query = self.selection.select("fields");
11007        query.execute(self.graphql_client.clone()).await
11008    }
11009    /// A unique identifier for this JSONValue.
11010    pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
11011        let query = self.selection.select("id");
11012        query.execute(self.graphql_client.clone()).await
11013    }
11014    /// Encode a boolean to json
11015    ///
11016    /// # Arguments
11017    ///
11018    /// * `value` - New boolean value
11019    pub fn new_boolean(&self, value: bool) -> JsonValue {
11020        let mut query = self.selection.select("newBoolean");
11021        query = query.arg("value", value);
11022        JsonValue {
11023            proc: self.proc.clone(),
11024            selection: query,
11025            graphql_client: self.graphql_client.clone(),
11026        }
11027    }
11028    /// Encode an integer to json
11029    ///
11030    /// # Arguments
11031    ///
11032    /// * `value` - New integer value
11033    pub fn new_integer(&self, value: isize) -> JsonValue {
11034        let mut query = self.selection.select("newInteger");
11035        query = query.arg("value", value);
11036        JsonValue {
11037            proc: self.proc.clone(),
11038            selection: query,
11039            graphql_client: self.graphql_client.clone(),
11040        }
11041    }
11042    /// Encode a string to json
11043    ///
11044    /// # Arguments
11045    ///
11046    /// * `value` - New string value
11047    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
11048        let mut query = self.selection.select("newString");
11049        query = query.arg("value", value.into());
11050        JsonValue {
11051            proc: self.proc.clone(),
11052            selection: query,
11053            graphql_client: self.graphql_client.clone(),
11054        }
11055    }
11056    /// Return a new json value, decoded from the given content
11057    ///
11058    /// # Arguments
11059    ///
11060    /// * `contents` - New JSON-encoded contents
11061    pub fn with_contents(&self, contents: Json) -> JsonValue {
11062        let mut query = self.selection.select("withContents");
11063        query = query.arg("contents", contents);
11064        JsonValue {
11065            proc: self.proc.clone(),
11066            selection: query,
11067            graphql_client: self.graphql_client.clone(),
11068        }
11069    }
11070    /// Set a new field at the given path
11071    ///
11072    /// # Arguments
11073    ///
11074    /// * `path` - Path of the field to set, encoded as an array of field names
11075    /// * `value` - The new value of the field
11076    pub fn with_field(
11077        &self,
11078        path: Vec<impl Into<String>>,
11079        value: impl IntoID<JsonValueId>,
11080    ) -> JsonValue {
11081        let mut query = self.selection.select("withField");
11082        query = query.arg(
11083            "path",
11084            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11085        );
11086        query = query.arg_lazy(
11087            "value",
11088            Box::new(move || {
11089                let value = value.clone();
11090                Box::pin(async move { value.into_id().await.unwrap().quote() })
11091            }),
11092        );
11093        JsonValue {
11094            proc: self.proc.clone(),
11095            selection: query,
11096            graphql_client: self.graphql_client.clone(),
11097        }
11098    }
11099}
11100#[derive(Clone)]
11101pub struct Llm {
11102    pub proc: Option<Arc<DaggerSessionProc>>,
11103    pub selection: Selection,
11104    pub graphql_client: DynGraphQLClient,
11105}
11106impl Llm {
11107    /// create a branch in the LLM's history
11108    pub fn attempt(&self, number: isize) -> Llm {
11109        let mut query = self.selection.select("attempt");
11110        query = query.arg("number", number);
11111        Llm {
11112            proc: self.proc.clone(),
11113            selection: query,
11114            graphql_client: self.graphql_client.clone(),
11115        }
11116    }
11117    /// returns the type of the current state
11118    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
11119        let mut query = self.selection.select("bindResult");
11120        query = query.arg("name", name.into());
11121        Binding {
11122            proc: self.proc.clone(),
11123            selection: query,
11124            graphql_client: self.graphql_client.clone(),
11125        }
11126    }
11127    /// return the LLM's current environment
11128    pub fn env(&self) -> Env {
11129        let query = self.selection.select("env");
11130        Env {
11131            proc: self.proc.clone(),
11132            selection: query,
11133            graphql_client: self.graphql_client.clone(),
11134        }
11135    }
11136    /// Indicates whether there are any queued prompts or tool results to send to the model
11137    pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
11138        let query = self.selection.select("hasPrompt");
11139        query.execute(self.graphql_client.clone()).await
11140    }
11141    /// return the llm message history
11142    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
11143        let query = self.selection.select("history");
11144        query.execute(self.graphql_client.clone()).await
11145    }
11146    /// return the raw llm message history as json
11147    pub async fn history_json(&self) -> Result<Json, DaggerError> {
11148        let query = self.selection.select("historyJSON");
11149        query.execute(self.graphql_client.clone()).await
11150    }
11151    /// A unique identifier for this LLM.
11152    pub async fn id(&self) -> Result<Llmid, DaggerError> {
11153        let query = self.selection.select("id");
11154        query.execute(self.graphql_client.clone()).await
11155    }
11156    /// return the last llm reply from the history
11157    pub async fn last_reply(&self) -> Result<String, DaggerError> {
11158        let query = self.selection.select("lastReply");
11159        query.execute(self.graphql_client.clone()).await
11160    }
11161    /// Submit the queued prompt, evaluate any tool calls, queue their results, and keep going until the model ends its turn
11162    pub fn r#loop(&self) -> Llm {
11163        let query = self.selection.select("loop");
11164        Llm {
11165            proc: self.proc.clone(),
11166            selection: query,
11167            graphql_client: self.graphql_client.clone(),
11168        }
11169    }
11170    /// return the model used by the llm
11171    pub async fn model(&self) -> Result<String, DaggerError> {
11172        let query = self.selection.select("model");
11173        query.execute(self.graphql_client.clone()).await
11174    }
11175    /// return the provider used by the llm
11176    pub async fn provider(&self) -> Result<String, DaggerError> {
11177        let query = self.selection.select("provider");
11178        query.execute(self.graphql_client.clone()).await
11179    }
11180    /// Submit the queued prompt or tool call results, evaluate any tool calls, and queue their results
11181    pub async fn step(&self) -> Result<Llmid, DaggerError> {
11182        let query = self.selection.select("step");
11183        query.execute(self.graphql_client.clone()).await
11184    }
11185    /// synchronize LLM state
11186    pub async fn sync(&self) -> Result<Llmid, DaggerError> {
11187        let query = self.selection.select("sync");
11188        query.execute(self.graphql_client.clone()).await
11189    }
11190    /// returns the token usage of the current state
11191    pub fn token_usage(&self) -> LlmTokenUsage {
11192        let query = self.selection.select("tokenUsage");
11193        LlmTokenUsage {
11194            proc: self.proc.clone(),
11195            selection: query,
11196            graphql_client: self.graphql_client.clone(),
11197        }
11198    }
11199    /// print documentation for available tools
11200    pub async fn tools(&self) -> Result<String, DaggerError> {
11201        let query = self.selection.select("tools");
11202        query.execute(self.graphql_client.clone()).await
11203    }
11204    /// Return a new LLM with the specified function no longer exposed as a tool
11205    ///
11206    /// # Arguments
11207    ///
11208    /// * `type_name` - The type name whose function will be blocked
11209    /// * `function` - The function to block
11210    ///
11211    /// Will be converted to lowerCamelCase if necessary.
11212    pub fn with_blocked_function(
11213        &self,
11214        type_name: impl Into<String>,
11215        function: impl Into<String>,
11216    ) -> Llm {
11217        let mut query = self.selection.select("withBlockedFunction");
11218        query = query.arg("typeName", type_name.into());
11219        query = query.arg("function", function.into());
11220        Llm {
11221            proc: self.proc.clone(),
11222            selection: query,
11223            graphql_client: self.graphql_client.clone(),
11224        }
11225    }
11226    /// allow the LLM to interact with an environment via MCP
11227    pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
11228        let mut query = self.selection.select("withEnv");
11229        query = query.arg_lazy(
11230            "env",
11231            Box::new(move || {
11232                let env = env.clone();
11233                Box::pin(async move { env.into_id().await.unwrap().quote() })
11234            }),
11235        );
11236        Llm {
11237            proc: self.proc.clone(),
11238            selection: query,
11239            graphql_client: self.graphql_client.clone(),
11240        }
11241    }
11242    /// Add an external MCP server to the LLM
11243    ///
11244    /// # Arguments
11245    ///
11246    /// * `name` - The name of the MCP server
11247    /// * `service` - The MCP service to run and communicate with over stdio
11248    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<ServiceId>) -> Llm {
11249        let mut query = self.selection.select("withMCPServer");
11250        query = query.arg("name", name.into());
11251        query = query.arg_lazy(
11252            "service",
11253            Box::new(move || {
11254                let service = service.clone();
11255                Box::pin(async move { service.into_id().await.unwrap().quote() })
11256            }),
11257        );
11258        Llm {
11259            proc: self.proc.clone(),
11260            selection: query,
11261            graphql_client: self.graphql_client.clone(),
11262        }
11263    }
11264    /// swap out the llm model
11265    ///
11266    /// # Arguments
11267    ///
11268    /// * `model` - The model to use
11269    pub fn with_model(&self, model: impl Into<String>) -> Llm {
11270        let mut query = self.selection.select("withModel");
11271        query = query.arg("model", model.into());
11272        Llm {
11273            proc: self.proc.clone(),
11274            selection: query,
11275            graphql_client: self.graphql_client.clone(),
11276        }
11277    }
11278    /// append a prompt to the llm context
11279    ///
11280    /// # Arguments
11281    ///
11282    /// * `prompt` - The prompt to send
11283    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
11284        let mut query = self.selection.select("withPrompt");
11285        query = query.arg("prompt", prompt.into());
11286        Llm {
11287            proc: self.proc.clone(),
11288            selection: query,
11289            graphql_client: self.graphql_client.clone(),
11290        }
11291    }
11292    /// append the contents of a file to the llm context
11293    ///
11294    /// # Arguments
11295    ///
11296    /// * `file` - The file to read the prompt from
11297    pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
11298        let mut query = self.selection.select("withPromptFile");
11299        query = query.arg_lazy(
11300            "file",
11301            Box::new(move || {
11302                let file = file.clone();
11303                Box::pin(async move { file.into_id().await.unwrap().quote() })
11304            }),
11305        );
11306        Llm {
11307            proc: self.proc.clone(),
11308            selection: query,
11309            graphql_client: self.graphql_client.clone(),
11310        }
11311    }
11312    /// Use a static set of tools for method calls, e.g. for MCP clients that do not support dynamic tool registration
11313    pub fn with_static_tools(&self) -> Llm {
11314        let query = self.selection.select("withStaticTools");
11315        Llm {
11316            proc: self.proc.clone(),
11317            selection: query,
11318            graphql_client: self.graphql_client.clone(),
11319        }
11320    }
11321    /// Add a system prompt to the LLM's environment
11322    ///
11323    /// # Arguments
11324    ///
11325    /// * `prompt` - The system prompt to send
11326    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
11327        let mut query = self.selection.select("withSystemPrompt");
11328        query = query.arg("prompt", prompt.into());
11329        Llm {
11330            proc: self.proc.clone(),
11331            selection: query,
11332            graphql_client: self.graphql_client.clone(),
11333        }
11334    }
11335    /// Disable the default system prompt
11336    pub fn without_default_system_prompt(&self) -> Llm {
11337        let query = self.selection.select("withoutDefaultSystemPrompt");
11338        Llm {
11339            proc: self.proc.clone(),
11340            selection: query,
11341            graphql_client: self.graphql_client.clone(),
11342        }
11343    }
11344    /// Clear the message history, leaving only the system prompts
11345    pub fn without_message_history(&self) -> Llm {
11346        let query = self.selection.select("withoutMessageHistory");
11347        Llm {
11348            proc: self.proc.clone(),
11349            selection: query,
11350            graphql_client: self.graphql_client.clone(),
11351        }
11352    }
11353    /// Clear the system prompts, leaving only the default system prompt
11354    pub fn without_system_prompts(&self) -> Llm {
11355        let query = self.selection.select("withoutSystemPrompts");
11356        Llm {
11357            proc: self.proc.clone(),
11358            selection: query,
11359            graphql_client: self.graphql_client.clone(),
11360        }
11361    }
11362}
11363#[derive(Clone)]
11364pub struct LlmTokenUsage {
11365    pub proc: Option<Arc<DaggerSessionProc>>,
11366    pub selection: Selection,
11367    pub graphql_client: DynGraphQLClient,
11368}
11369impl LlmTokenUsage {
11370    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
11371        let query = self.selection.select("cachedTokenReads");
11372        query.execute(self.graphql_client.clone()).await
11373    }
11374    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
11375        let query = self.selection.select("cachedTokenWrites");
11376        query.execute(self.graphql_client.clone()).await
11377    }
11378    /// A unique identifier for this LLMTokenUsage.
11379    pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
11380        let query = self.selection.select("id");
11381        query.execute(self.graphql_client.clone()).await
11382    }
11383    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
11384        let query = self.selection.select("inputTokens");
11385        query.execute(self.graphql_client.clone()).await
11386    }
11387    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
11388        let query = self.selection.select("outputTokens");
11389        query.execute(self.graphql_client.clone()).await
11390    }
11391    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
11392        let query = self.selection.select("totalTokens");
11393        query.execute(self.graphql_client.clone()).await
11394    }
11395}
11396#[derive(Clone)]
11397pub struct Label {
11398    pub proc: Option<Arc<DaggerSessionProc>>,
11399    pub selection: Selection,
11400    pub graphql_client: DynGraphQLClient,
11401}
11402impl Label {
11403    /// A unique identifier for this Label.
11404    pub async fn id(&self) -> Result<LabelId, DaggerError> {
11405        let query = self.selection.select("id");
11406        query.execute(self.graphql_client.clone()).await
11407    }
11408    /// The label name.
11409    pub async fn name(&self) -> Result<String, DaggerError> {
11410        let query = self.selection.select("name");
11411        query.execute(self.graphql_client.clone()).await
11412    }
11413    /// The label value.
11414    pub async fn value(&self) -> Result<String, DaggerError> {
11415        let query = self.selection.select("value");
11416        query.execute(self.graphql_client.clone()).await
11417    }
11418}
11419#[derive(Clone)]
11420pub struct ListTypeDef {
11421    pub proc: Option<Arc<DaggerSessionProc>>,
11422    pub selection: Selection,
11423    pub graphql_client: DynGraphQLClient,
11424}
11425impl ListTypeDef {
11426    /// The type of the elements in the list.
11427    pub fn element_type_def(&self) -> TypeDef {
11428        let query = self.selection.select("elementTypeDef");
11429        TypeDef {
11430            proc: self.proc.clone(),
11431            selection: query,
11432            graphql_client: self.graphql_client.clone(),
11433        }
11434    }
11435    /// A unique identifier for this ListTypeDef.
11436    pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
11437        let query = self.selection.select("id");
11438        query.execute(self.graphql_client.clone()).await
11439    }
11440}
11441#[derive(Clone)]
11442pub struct Module {
11443    pub proc: Option<Arc<DaggerSessionProc>>,
11444    pub selection: Selection,
11445    pub graphql_client: DynGraphQLClient,
11446}
11447#[derive(Builder, Debug, PartialEq)]
11448pub struct ModuleChecksOpts<'a> {
11449    /// Only include checks matching the specified patterns
11450    #[builder(setter(into, strip_option), default)]
11451    pub include: Option<Vec<&'a str>>,
11452}
11453#[derive(Builder, Debug, PartialEq)]
11454pub struct ModuleGeneratorsOpts<'a> {
11455    /// Only include generators matching the specified patterns
11456    #[builder(setter(into, strip_option), default)]
11457    pub include: Option<Vec<&'a str>>,
11458}
11459#[derive(Builder, Debug, PartialEq)]
11460pub struct ModuleServeOpts {
11461    /// Install the module as the entrypoint, promoting its main-object methods onto the Query root
11462    #[builder(setter(into, strip_option), default)]
11463    pub entrypoint: Option<bool>,
11464    /// Expose the dependencies of this module to the client
11465    #[builder(setter(into, strip_option), default)]
11466    pub include_dependencies: Option<bool>,
11467}
11468#[derive(Builder, Debug, PartialEq)]
11469pub struct ModuleServicesOpts<'a> {
11470    /// Only include services matching the specified patterns
11471    #[builder(setter(into, strip_option), default)]
11472    pub include: Option<Vec<&'a str>>,
11473}
11474impl Module {
11475    /// Return the check defined by the module with the given name. Must match to exactly one check.
11476    ///
11477    /// # Arguments
11478    ///
11479    /// * `name` - The name of the check to retrieve
11480    pub fn check(&self, name: impl Into<String>) -> Check {
11481        let mut query = self.selection.select("check");
11482        query = query.arg("name", name.into());
11483        Check {
11484            proc: self.proc.clone(),
11485            selection: query,
11486            graphql_client: self.graphql_client.clone(),
11487        }
11488    }
11489    /// Return all checks defined by the module
11490    ///
11491    /// # Arguments
11492    ///
11493    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11494    pub fn checks(&self) -> CheckGroup {
11495        let query = self.selection.select("checks");
11496        CheckGroup {
11497            proc: self.proc.clone(),
11498            selection: query,
11499            graphql_client: self.graphql_client.clone(),
11500        }
11501    }
11502    /// Return all checks defined by the module
11503    ///
11504    /// # Arguments
11505    ///
11506    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11507    pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
11508        let mut query = self.selection.select("checks");
11509        if let Some(include) = opts.include {
11510            query = query.arg("include", include);
11511        }
11512        CheckGroup {
11513            proc: self.proc.clone(),
11514            selection: query,
11515            graphql_client: self.graphql_client.clone(),
11516        }
11517    }
11518    /// The dependencies of the module.
11519    pub fn dependencies(&self) -> Vec<Module> {
11520        let query = self.selection.select("dependencies");
11521        vec![Module {
11522            proc: self.proc.clone(),
11523            selection: query,
11524            graphql_client: self.graphql_client.clone(),
11525        }]
11526    }
11527    /// The doc string of the module, if any
11528    pub async fn description(&self) -> Result<String, DaggerError> {
11529        let query = self.selection.select("description");
11530        query.execute(self.graphql_client.clone()).await
11531    }
11532    /// Enumerations served by this module.
11533    pub fn enums(&self) -> Vec<TypeDef> {
11534        let query = self.selection.select("enums");
11535        vec![TypeDef {
11536            proc: self.proc.clone(),
11537            selection: query,
11538            graphql_client: self.graphql_client.clone(),
11539        }]
11540    }
11541    /// The generated files and directories made on top of the module source's context directory.
11542    pub fn generated_context_directory(&self) -> Directory {
11543        let query = self.selection.select("generatedContextDirectory");
11544        Directory {
11545            proc: self.proc.clone(),
11546            selection: query,
11547            graphql_client: self.graphql_client.clone(),
11548        }
11549    }
11550    /// Return the generator defined by the module with the given name. Must match to exactly one generator.
11551    ///
11552    /// # Arguments
11553    ///
11554    /// * `name` - The name of the generator to retrieve
11555    pub fn generator(&self, name: impl Into<String>) -> Generator {
11556        let mut query = self.selection.select("generator");
11557        query = query.arg("name", name.into());
11558        Generator {
11559            proc: self.proc.clone(),
11560            selection: query,
11561            graphql_client: self.graphql_client.clone(),
11562        }
11563    }
11564    /// Return all generators defined by the module
11565    ///
11566    /// # Arguments
11567    ///
11568    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11569    pub fn generators(&self) -> GeneratorGroup {
11570        let query = self.selection.select("generators");
11571        GeneratorGroup {
11572            proc: self.proc.clone(),
11573            selection: query,
11574            graphql_client: self.graphql_client.clone(),
11575        }
11576    }
11577    /// Return all generators defined by the module
11578    ///
11579    /// # Arguments
11580    ///
11581    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11582    pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
11583        let mut query = self.selection.select("generators");
11584        if let Some(include) = opts.include {
11585            query = query.arg("include", include);
11586        }
11587        GeneratorGroup {
11588            proc: self.proc.clone(),
11589            selection: query,
11590            graphql_client: self.graphql_client.clone(),
11591        }
11592    }
11593    /// A unique identifier for this Module.
11594    pub async fn id(&self) -> Result<ModuleId, DaggerError> {
11595        let query = self.selection.select("id");
11596        query.execute(self.graphql_client.clone()).await
11597    }
11598    /// Interfaces served by this module.
11599    pub fn interfaces(&self) -> Vec<TypeDef> {
11600        let query = self.selection.select("interfaces");
11601        vec![TypeDef {
11602            proc: self.proc.clone(),
11603            selection: query,
11604            graphql_client: self.graphql_client.clone(),
11605        }]
11606    }
11607    /// The introspection schema JSON file for this module.
11608    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
11609    /// Note: this is in the context of a module, so some core types may be hidden.
11610    pub fn introspection_schema_json(&self) -> File {
11611        let query = self.selection.select("introspectionSchemaJSON");
11612        File {
11613            proc: self.proc.clone(),
11614            selection: query,
11615            graphql_client: self.graphql_client.clone(),
11616        }
11617    }
11618    /// The name of the module
11619    pub async fn name(&self) -> Result<String, DaggerError> {
11620        let query = self.selection.select("name");
11621        query.execute(self.graphql_client.clone()).await
11622    }
11623    /// Objects served by this module.
11624    pub fn objects(&self) -> Vec<TypeDef> {
11625        let query = self.selection.select("objects");
11626        vec![TypeDef {
11627            proc: self.proc.clone(),
11628            selection: query,
11629            graphql_client: self.graphql_client.clone(),
11630        }]
11631    }
11632    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
11633    pub fn runtime(&self) -> Container {
11634        let query = self.selection.select("runtime");
11635        Container {
11636            proc: self.proc.clone(),
11637            selection: query,
11638            graphql_client: self.graphql_client.clone(),
11639        }
11640    }
11641    /// The SDK config used by this module.
11642    pub fn sdk(&self) -> SdkConfig {
11643        let query = self.selection.select("sdk");
11644        SdkConfig {
11645            proc: self.proc.clone(),
11646            selection: query,
11647            graphql_client: self.graphql_client.clone(),
11648        }
11649    }
11650    /// Serve a module's API in the current session.
11651    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11652    ///
11653    /// # Arguments
11654    ///
11655    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11656    pub async fn serve(&self) -> Result<Void, DaggerError> {
11657        let query = self.selection.select("serve");
11658        query.execute(self.graphql_client.clone()).await
11659    }
11660    /// Serve a module's API in the current session.
11661    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
11662    ///
11663    /// # Arguments
11664    ///
11665    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11666    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
11667        let mut query = self.selection.select("serve");
11668        if let Some(include_dependencies) = opts.include_dependencies {
11669            query = query.arg("includeDependencies", include_dependencies);
11670        }
11671        if let Some(entrypoint) = opts.entrypoint {
11672            query = query.arg("entrypoint", entrypoint);
11673        }
11674        query.execute(self.graphql_client.clone()).await
11675    }
11676    /// Return all services defined by the module
11677    ///
11678    /// # Arguments
11679    ///
11680    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11681    pub fn services(&self) -> UpGroup {
11682        let query = self.selection.select("services");
11683        UpGroup {
11684            proc: self.proc.clone(),
11685            selection: query,
11686            graphql_client: self.graphql_client.clone(),
11687        }
11688    }
11689    /// Return all services defined by the module
11690    ///
11691    /// # Arguments
11692    ///
11693    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11694    pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
11695        let mut query = self.selection.select("services");
11696        if let Some(include) = opts.include {
11697            query = query.arg("include", include);
11698        }
11699        UpGroup {
11700            proc: self.proc.clone(),
11701            selection: query,
11702            graphql_client: self.graphql_client.clone(),
11703        }
11704    }
11705    /// The source for the module.
11706    pub fn source(&self) -> ModuleSource {
11707        let query = self.selection.select("source");
11708        ModuleSource {
11709            proc: self.proc.clone(),
11710            selection: query,
11711            graphql_client: self.graphql_client.clone(),
11712        }
11713    }
11714    /// Forces evaluation of the module, including any loading into the engine and associated validation.
11715    pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
11716        let query = self.selection.select("sync");
11717        query.execute(self.graphql_client.clone()).await
11718    }
11719    /// User-defined default values, loaded from local .env files.
11720    pub fn user_defaults(&self) -> EnvFile {
11721        let query = self.selection.select("userDefaults");
11722        EnvFile {
11723            proc: self.proc.clone(),
11724            selection: query,
11725            graphql_client: self.graphql_client.clone(),
11726        }
11727    }
11728    /// Retrieves the module with the given description
11729    ///
11730    /// # Arguments
11731    ///
11732    /// * `description` - The description to set
11733    pub fn with_description(&self, description: impl Into<String>) -> Module {
11734        let mut query = self.selection.select("withDescription");
11735        query = query.arg("description", description.into());
11736        Module {
11737            proc: self.proc.clone(),
11738            selection: query,
11739            graphql_client: self.graphql_client.clone(),
11740        }
11741    }
11742    /// This module plus the given Enum type and associated values
11743    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
11744        let mut query = self.selection.select("withEnum");
11745        query = query.arg_lazy(
11746            "enum",
11747            Box::new(move || {
11748                let r#enum = r#enum.clone();
11749                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
11750            }),
11751        );
11752        Module {
11753            proc: self.proc.clone(),
11754            selection: query,
11755            graphql_client: self.graphql_client.clone(),
11756        }
11757    }
11758    /// This module plus the given Interface type and associated functions
11759    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
11760        let mut query = self.selection.select("withInterface");
11761        query = query.arg_lazy(
11762            "iface",
11763            Box::new(move || {
11764                let iface = iface.clone();
11765                Box::pin(async move { iface.into_id().await.unwrap().quote() })
11766            }),
11767        );
11768        Module {
11769            proc: self.proc.clone(),
11770            selection: query,
11771            graphql_client: self.graphql_client.clone(),
11772        }
11773    }
11774    /// This module plus the given Object type and associated functions.
11775    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
11776        let mut query = self.selection.select("withObject");
11777        query = query.arg_lazy(
11778            "object",
11779            Box::new(move || {
11780                let object = object.clone();
11781                Box::pin(async move { object.into_id().await.unwrap().quote() })
11782            }),
11783        );
11784        Module {
11785            proc: self.proc.clone(),
11786            selection: query,
11787            graphql_client: self.graphql_client.clone(),
11788        }
11789    }
11790}
11791#[derive(Clone)]
11792pub struct ModuleConfigClient {
11793    pub proc: Option<Arc<DaggerSessionProc>>,
11794    pub selection: Selection,
11795    pub graphql_client: DynGraphQLClient,
11796}
11797impl ModuleConfigClient {
11798    /// The directory the client is generated in.
11799    pub async fn directory(&self) -> Result<String, DaggerError> {
11800        let query = self.selection.select("directory");
11801        query.execute(self.graphql_client.clone()).await
11802    }
11803    /// The generator to use
11804    pub async fn generator(&self) -> Result<String, DaggerError> {
11805        let query = self.selection.select("generator");
11806        query.execute(self.graphql_client.clone()).await
11807    }
11808    /// A unique identifier for this ModuleConfigClient.
11809    pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
11810        let query = self.selection.select("id");
11811        query.execute(self.graphql_client.clone()).await
11812    }
11813}
11814#[derive(Clone)]
11815pub struct ModuleSource {
11816    pub proc: Option<Arc<DaggerSessionProc>>,
11817    pub selection: Selection,
11818    pub graphql_client: DynGraphQLClient,
11819}
11820impl ModuleSource {
11821    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
11822    pub fn as_module(&self) -> Module {
11823        let query = self.selection.select("asModule");
11824        Module {
11825            proc: self.proc.clone(),
11826            selection: query,
11827            graphql_client: self.graphql_client.clone(),
11828        }
11829    }
11830    /// A human readable ref string representation of this module source.
11831    pub async fn as_string(&self) -> Result<String, DaggerError> {
11832        let query = self.selection.select("asString");
11833        query.execute(self.graphql_client.clone()).await
11834    }
11835    /// The blueprint referenced by the module source.
11836    pub fn blueprint(&self) -> ModuleSource {
11837        let query = self.selection.select("blueprint");
11838        ModuleSource {
11839            proc: self.proc.clone(),
11840            selection: query,
11841            graphql_client: self.graphql_client.clone(),
11842        }
11843    }
11844    /// The ref to clone the root of the git repo from. Only valid for git sources.
11845    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
11846        let query = self.selection.select("cloneRef");
11847        query.execute(self.graphql_client.clone()).await
11848    }
11849    /// The resolved commit of the git repo this source points to.
11850    pub async fn commit(&self) -> Result<String, DaggerError> {
11851        let query = self.selection.select("commit");
11852        query.execute(self.graphql_client.clone()).await
11853    }
11854    /// The clients generated for the module.
11855    pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
11856        let query = self.selection.select("configClients");
11857        vec![ModuleConfigClient {
11858            proc: self.proc.clone(),
11859            selection: query,
11860            graphql_client: self.graphql_client.clone(),
11861        }]
11862    }
11863    /// Whether an existing dagger.json for the module was found.
11864    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
11865        let query = self.selection.select("configExists");
11866        query.execute(self.graphql_client.clone()).await
11867    }
11868    /// The full directory loaded for the module source, including the source code as a subdirectory.
11869    pub fn context_directory(&self) -> Directory {
11870        let query = self.selection.select("contextDirectory");
11871        Directory {
11872            proc: self.proc.clone(),
11873            selection: query,
11874            graphql_client: self.graphql_client.clone(),
11875        }
11876    }
11877    /// The dependencies of the module source.
11878    pub fn dependencies(&self) -> Vec<ModuleSource> {
11879        let query = self.selection.select("dependencies");
11880        vec![ModuleSource {
11881            proc: self.proc.clone(),
11882            selection: query,
11883            graphql_client: self.graphql_client.clone(),
11884        }]
11885    }
11886    /// 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.
11887    pub async fn digest(&self) -> Result<String, DaggerError> {
11888        let query = self.selection.select("digest");
11889        query.execute(self.graphql_client.clone()).await
11890    }
11891    /// The directory containing the module configuration and source code (source code may be in a subdir).
11892    ///
11893    /// # Arguments
11894    ///
11895    /// * `path` - A subpath from the source directory to select.
11896    pub fn directory(&self, path: impl Into<String>) -> Directory {
11897        let mut query = self.selection.select("directory");
11898        query = query.arg("path", path.into());
11899        Directory {
11900            proc: self.proc.clone(),
11901            selection: query,
11902            graphql_client: self.graphql_client.clone(),
11903        }
11904    }
11905    /// The engine version of the module.
11906    pub async fn engine_version(&self) -> Result<String, DaggerError> {
11907        let query = self.selection.select("engineVersion");
11908        query.execute(self.graphql_client.clone()).await
11909    }
11910    /// The generated files and directories made on top of the module source's context directory, returned as a Changeset.
11911    pub fn generated_context_changeset(&self) -> Changeset {
11912        let query = self.selection.select("generatedContextChangeset");
11913        Changeset {
11914            proc: self.proc.clone(),
11915            selection: query,
11916            graphql_client: self.graphql_client.clone(),
11917        }
11918    }
11919    /// The generated files and directories made on top of the module source's context directory.
11920    pub fn generated_context_directory(&self) -> Directory {
11921        let query = self.selection.select("generatedContextDirectory");
11922        Directory {
11923            proc: self.proc.clone(),
11924            selection: query,
11925            graphql_client: self.graphql_client.clone(),
11926        }
11927    }
11928    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
11929    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
11930        let query = self.selection.select("htmlRepoURL");
11931        query.execute(self.graphql_client.clone()).await
11932    }
11933    /// The URL to the source's git repo in a web browser. Only valid for git sources.
11934    pub async fn html_url(&self) -> Result<String, DaggerError> {
11935        let query = self.selection.select("htmlURL");
11936        query.execute(self.graphql_client.clone()).await
11937    }
11938    /// A unique identifier for this ModuleSource.
11939    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
11940        let query = self.selection.select("id");
11941        query.execute(self.graphql_client.clone()).await
11942    }
11943    /// The introspection schema JSON file for this module source.
11944    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
11945    /// Note: this is in the context of a module, so some core types may be hidden.
11946    pub fn introspection_schema_json(&self) -> File {
11947        let query = self.selection.select("introspectionSchemaJSON");
11948        File {
11949            proc: self.proc.clone(),
11950            selection: query,
11951            graphql_client: self.graphql_client.clone(),
11952        }
11953    }
11954    /// The kind of module source (currently local, git or dir).
11955    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
11956        let query = self.selection.select("kind");
11957        query.execute(self.graphql_client.clone()).await
11958    }
11959    /// 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.
11960    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
11961        let query = self.selection.select("localContextDirectoryPath");
11962        query.execute(self.graphql_client.clone()).await
11963    }
11964    /// The name of the module, including any setting via the withName API.
11965    pub async fn module_name(&self) -> Result<String, DaggerError> {
11966        let query = self.selection.select("moduleName");
11967        query.execute(self.graphql_client.clone()).await
11968    }
11969    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
11970    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
11971        let query = self.selection.select("moduleOriginalName");
11972        query.execute(self.graphql_client.clone()).await
11973    }
11974    /// The original subpath used when instantiating this module source, relative to the context directory.
11975    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
11976        let query = self.selection.select("originalSubpath");
11977        query.execute(self.graphql_client.clone()).await
11978    }
11979    /// The pinned version of this module source.
11980    pub async fn pin(&self) -> Result<String, DaggerError> {
11981        let query = self.selection.select("pin");
11982        query.execute(self.graphql_client.clone()).await
11983    }
11984    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
11985    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
11986        let query = self.selection.select("repoRootPath");
11987        query.execute(self.graphql_client.clone()).await
11988    }
11989    /// The SDK configuration of the module.
11990    pub fn sdk(&self) -> SdkConfig {
11991        let query = self.selection.select("sdk");
11992        SdkConfig {
11993            proc: self.proc.clone(),
11994            selection: query,
11995            graphql_client: self.graphql_client.clone(),
11996        }
11997    }
11998    /// The path, relative to the context directory, that contains the module's dagger.json.
11999    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
12000        let query = self.selection.select("sourceRootSubpath");
12001        query.execute(self.graphql_client.clone()).await
12002    }
12003    /// The path to the directory containing the module's source code, relative to the context directory.
12004    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
12005        let query = self.selection.select("sourceSubpath");
12006        query.execute(self.graphql_client.clone()).await
12007    }
12008    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
12009    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
12010        let query = self.selection.select("sync");
12011        query.execute(self.graphql_client.clone()).await
12012    }
12013    /// The toolchains referenced by the module source.
12014    pub fn toolchains(&self) -> Vec<ModuleSource> {
12015        let query = self.selection.select("toolchains");
12016        vec![ModuleSource {
12017            proc: self.proc.clone(),
12018            selection: query,
12019            graphql_client: self.graphql_client.clone(),
12020        }]
12021    }
12022    /// User-defined defaults read from local .env files
12023    pub fn user_defaults(&self) -> EnvFile {
12024        let query = self.selection.select("userDefaults");
12025        EnvFile {
12026            proc: self.proc.clone(),
12027            selection: query,
12028            graphql_client: self.graphql_client.clone(),
12029        }
12030    }
12031    /// The specified version of the git repo this source points to.
12032    pub async fn version(&self) -> Result<String, DaggerError> {
12033        let query = self.selection.select("version");
12034        query.execute(self.graphql_client.clone()).await
12035    }
12036    /// Set a blueprint for the module source.
12037    ///
12038    /// # Arguments
12039    ///
12040    /// * `blueprint` - The blueprint module to set.
12041    pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
12042        let mut query = self.selection.select("withBlueprint");
12043        query = query.arg_lazy(
12044            "blueprint",
12045            Box::new(move || {
12046                let blueprint = blueprint.clone();
12047                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
12048            }),
12049        );
12050        ModuleSource {
12051            proc: self.proc.clone(),
12052            selection: query,
12053            graphql_client: self.graphql_client.clone(),
12054        }
12055    }
12056    /// Update the module source with a new client to generate.
12057    ///
12058    /// # Arguments
12059    ///
12060    /// * `generator` - The generator to use
12061    /// * `output_dir` - The output directory for the generated client.
12062    pub fn with_client(
12063        &self,
12064        generator: impl Into<String>,
12065        output_dir: impl Into<String>,
12066    ) -> ModuleSource {
12067        let mut query = self.selection.select("withClient");
12068        query = query.arg("generator", generator.into());
12069        query = query.arg("outputDir", output_dir.into());
12070        ModuleSource {
12071            proc: self.proc.clone(),
12072            selection: query,
12073            graphql_client: self.graphql_client.clone(),
12074        }
12075    }
12076    /// Append the provided dependencies to the module source's dependency list.
12077    ///
12078    /// # Arguments
12079    ///
12080    /// * `dependencies` - The dependencies to append.
12081    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
12082        let mut query = self.selection.select("withDependencies");
12083        query = query.arg("dependencies", dependencies);
12084        ModuleSource {
12085            proc: self.proc.clone(),
12086            selection: query,
12087            graphql_client: self.graphql_client.clone(),
12088        }
12089    }
12090    /// Upgrade the engine version of the module to the given value.
12091    ///
12092    /// # Arguments
12093    ///
12094    /// * `version` - The engine version to upgrade to.
12095    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
12096        let mut query = self.selection.select("withEngineVersion");
12097        query = query.arg("version", version.into());
12098        ModuleSource {
12099            proc: self.proc.clone(),
12100            selection: query,
12101            graphql_client: self.graphql_client.clone(),
12102        }
12103    }
12104    /// Enable the experimental features for the module source.
12105    ///
12106    /// # Arguments
12107    ///
12108    /// * `features` - The experimental features to enable.
12109    pub fn with_experimental_features(
12110        &self,
12111        features: Vec<ModuleSourceExperimentalFeature>,
12112    ) -> ModuleSource {
12113        let mut query = self.selection.select("withExperimentalFeatures");
12114        query = query.arg("features", features);
12115        ModuleSource {
12116            proc: self.proc.clone(),
12117            selection: query,
12118            graphql_client: self.graphql_client.clone(),
12119        }
12120    }
12121    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
12122    ///
12123    /// # Arguments
12124    ///
12125    /// * `patterns` - The new additional include patterns.
12126    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
12127        let mut query = self.selection.select("withIncludes");
12128        query = query.arg(
12129            "patterns",
12130            patterns
12131                .into_iter()
12132                .map(|i| i.into())
12133                .collect::<Vec<String>>(),
12134        );
12135        ModuleSource {
12136            proc: self.proc.clone(),
12137            selection: query,
12138            graphql_client: self.graphql_client.clone(),
12139        }
12140    }
12141    /// Update the module source with a new name.
12142    ///
12143    /// # Arguments
12144    ///
12145    /// * `name` - The name to set.
12146    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
12147        let mut query = self.selection.select("withName");
12148        query = query.arg("name", name.into());
12149        ModuleSource {
12150            proc: self.proc.clone(),
12151            selection: query,
12152            graphql_client: self.graphql_client.clone(),
12153        }
12154    }
12155    /// Update the module source with a new SDK.
12156    ///
12157    /// # Arguments
12158    ///
12159    /// * `source` - The SDK source to set.
12160    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
12161        let mut query = self.selection.select("withSDK");
12162        query = query.arg("source", source.into());
12163        ModuleSource {
12164            proc: self.proc.clone(),
12165            selection: query,
12166            graphql_client: self.graphql_client.clone(),
12167        }
12168    }
12169    /// Update the module source with a new source subpath.
12170    ///
12171    /// # Arguments
12172    ///
12173    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
12174    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
12175        let mut query = self.selection.select("withSourceSubpath");
12176        query = query.arg("path", path.into());
12177        ModuleSource {
12178            proc: self.proc.clone(),
12179            selection: query,
12180            graphql_client: self.graphql_client.clone(),
12181        }
12182    }
12183    /// Add toolchains to the module source.
12184    ///
12185    /// # Arguments
12186    ///
12187    /// * `toolchains` - The toolchain modules to add.
12188    pub fn with_toolchains(&self, toolchains: Vec<ModuleSourceId>) -> ModuleSource {
12189        let mut query = self.selection.select("withToolchains");
12190        query = query.arg("toolchains", toolchains);
12191        ModuleSource {
12192            proc: self.proc.clone(),
12193            selection: query,
12194            graphql_client: self.graphql_client.clone(),
12195        }
12196    }
12197    /// Update the blueprint module to the latest version.
12198    pub fn with_update_blueprint(&self) -> ModuleSource {
12199        let query = self.selection.select("withUpdateBlueprint");
12200        ModuleSource {
12201            proc: self.proc.clone(),
12202            selection: query,
12203            graphql_client: self.graphql_client.clone(),
12204        }
12205    }
12206    /// Update one or more module dependencies.
12207    ///
12208    /// # Arguments
12209    ///
12210    /// * `dependencies` - The dependencies to update.
12211    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12212        let mut query = self.selection.select("withUpdateDependencies");
12213        query = query.arg(
12214            "dependencies",
12215            dependencies
12216                .into_iter()
12217                .map(|i| i.into())
12218                .collect::<Vec<String>>(),
12219        );
12220        ModuleSource {
12221            proc: self.proc.clone(),
12222            selection: query,
12223            graphql_client: self.graphql_client.clone(),
12224        }
12225    }
12226    /// Update one or more toolchains.
12227    ///
12228    /// # Arguments
12229    ///
12230    /// * `toolchains` - The toolchains to update.
12231    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12232        let mut query = self.selection.select("withUpdateToolchains");
12233        query = query.arg(
12234            "toolchains",
12235            toolchains
12236                .into_iter()
12237                .map(|i| i.into())
12238                .collect::<Vec<String>>(),
12239        );
12240        ModuleSource {
12241            proc: self.proc.clone(),
12242            selection: query,
12243            graphql_client: self.graphql_client.clone(),
12244        }
12245    }
12246    /// Update one or more clients.
12247    ///
12248    /// # Arguments
12249    ///
12250    /// * `clients` - The clients to update
12251    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
12252        let mut query = self.selection.select("withUpdatedClients");
12253        query = query.arg(
12254            "clients",
12255            clients
12256                .into_iter()
12257                .map(|i| i.into())
12258                .collect::<Vec<String>>(),
12259        );
12260        ModuleSource {
12261            proc: self.proc.clone(),
12262            selection: query,
12263            graphql_client: self.graphql_client.clone(),
12264        }
12265    }
12266    /// Remove the current blueprint from the module source.
12267    pub fn without_blueprint(&self) -> ModuleSource {
12268        let query = self.selection.select("withoutBlueprint");
12269        ModuleSource {
12270            proc: self.proc.clone(),
12271            selection: query,
12272            graphql_client: self.graphql_client.clone(),
12273        }
12274    }
12275    /// Remove a client from the module source.
12276    ///
12277    /// # Arguments
12278    ///
12279    /// * `path` - The path of the client to remove.
12280    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
12281        let mut query = self.selection.select("withoutClient");
12282        query = query.arg("path", path.into());
12283        ModuleSource {
12284            proc: self.proc.clone(),
12285            selection: query,
12286            graphql_client: self.graphql_client.clone(),
12287        }
12288    }
12289    /// Remove the provided dependencies from the module source's dependency list.
12290    ///
12291    /// # Arguments
12292    ///
12293    /// * `dependencies` - The dependencies to remove.
12294    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12295        let mut query = self.selection.select("withoutDependencies");
12296        query = query.arg(
12297            "dependencies",
12298            dependencies
12299                .into_iter()
12300                .map(|i| i.into())
12301                .collect::<Vec<String>>(),
12302        );
12303        ModuleSource {
12304            proc: self.proc.clone(),
12305            selection: query,
12306            graphql_client: self.graphql_client.clone(),
12307        }
12308    }
12309    /// Disable experimental features for the module source.
12310    ///
12311    /// # Arguments
12312    ///
12313    /// * `features` - The experimental features to disable.
12314    pub fn without_experimental_features(
12315        &self,
12316        features: Vec<ModuleSourceExperimentalFeature>,
12317    ) -> ModuleSource {
12318        let mut query = self.selection.select("withoutExperimentalFeatures");
12319        query = query.arg("features", features);
12320        ModuleSource {
12321            proc: self.proc.clone(),
12322            selection: query,
12323            graphql_client: self.graphql_client.clone(),
12324        }
12325    }
12326    /// Remove the provided toolchains from the module source.
12327    ///
12328    /// # Arguments
12329    ///
12330    /// * `toolchains` - The toolchains to remove.
12331    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12332        let mut query = self.selection.select("withoutToolchains");
12333        query = query.arg(
12334            "toolchains",
12335            toolchains
12336                .into_iter()
12337                .map(|i| i.into())
12338                .collect::<Vec<String>>(),
12339        );
12340        ModuleSource {
12341            proc: self.proc.clone(),
12342            selection: query,
12343            graphql_client: self.graphql_client.clone(),
12344        }
12345    }
12346}
12347#[derive(Clone)]
12348pub struct ObjectTypeDef {
12349    pub proc: Option<Arc<DaggerSessionProc>>,
12350    pub selection: Selection,
12351    pub graphql_client: DynGraphQLClient,
12352}
12353impl ObjectTypeDef {
12354    /// The function used to construct new instances of this object, if any
12355    pub fn constructor(&self) -> Function {
12356        let query = self.selection.select("constructor");
12357        Function {
12358            proc: self.proc.clone(),
12359            selection: query,
12360            graphql_client: self.graphql_client.clone(),
12361        }
12362    }
12363    /// The reason this enum member is deprecated, if any.
12364    pub async fn deprecated(&self) -> Result<String, DaggerError> {
12365        let query = self.selection.select("deprecated");
12366        query.execute(self.graphql_client.clone()).await
12367    }
12368    /// The doc string for the object, if any.
12369    pub async fn description(&self) -> Result<String, DaggerError> {
12370        let query = self.selection.select("description");
12371        query.execute(self.graphql_client.clone()).await
12372    }
12373    /// Static fields defined on this object, if any.
12374    pub fn fields(&self) -> Vec<FieldTypeDef> {
12375        let query = self.selection.select("fields");
12376        vec![FieldTypeDef {
12377            proc: self.proc.clone(),
12378            selection: query,
12379            graphql_client: self.graphql_client.clone(),
12380        }]
12381    }
12382    /// Functions defined on this object, if any.
12383    pub fn functions(&self) -> Vec<Function> {
12384        let query = self.selection.select("functions");
12385        vec![Function {
12386            proc: self.proc.clone(),
12387            selection: query,
12388            graphql_client: self.graphql_client.clone(),
12389        }]
12390    }
12391    /// A unique identifier for this ObjectTypeDef.
12392    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
12393        let query = self.selection.select("id");
12394        query.execute(self.graphql_client.clone()).await
12395    }
12396    /// The name of the object.
12397    pub async fn name(&self) -> Result<String, DaggerError> {
12398        let query = self.selection.select("name");
12399        query.execute(self.graphql_client.clone()).await
12400    }
12401    /// The location of this object declaration.
12402    pub fn source_map(&self) -> SourceMap {
12403        let query = self.selection.select("sourceMap");
12404        SourceMap {
12405            proc: self.proc.clone(),
12406            selection: query,
12407            graphql_client: self.graphql_client.clone(),
12408        }
12409    }
12410    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
12411    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12412        let query = self.selection.select("sourceModuleName");
12413        query.execute(self.graphql_client.clone()).await
12414    }
12415}
12416#[derive(Clone)]
12417pub struct Port {
12418    pub proc: Option<Arc<DaggerSessionProc>>,
12419    pub selection: Selection,
12420    pub graphql_client: DynGraphQLClient,
12421}
12422impl Port {
12423    /// The port description.
12424    pub async fn description(&self) -> Result<String, DaggerError> {
12425        let query = self.selection.select("description");
12426        query.execute(self.graphql_client.clone()).await
12427    }
12428    /// Skip the health check when run as a service.
12429    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
12430        let query = self.selection.select("experimentalSkipHealthcheck");
12431        query.execute(self.graphql_client.clone()).await
12432    }
12433    /// A unique identifier for this Port.
12434    pub async fn id(&self) -> Result<PortId, DaggerError> {
12435        let query = self.selection.select("id");
12436        query.execute(self.graphql_client.clone()).await
12437    }
12438    /// The port number.
12439    pub async fn port(&self) -> Result<isize, DaggerError> {
12440        let query = self.selection.select("port");
12441        query.execute(self.graphql_client.clone()).await
12442    }
12443    /// The transport layer protocol.
12444    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
12445        let query = self.selection.select("protocol");
12446        query.execute(self.graphql_client.clone()).await
12447    }
12448}
12449#[derive(Clone)]
12450pub struct Query {
12451    pub proc: Option<Arc<DaggerSessionProc>>,
12452    pub selection: Selection,
12453    pub graphql_client: DynGraphQLClient,
12454}
12455#[derive(Builder, Debug, PartialEq)]
12456pub struct QueryContainerOpts {
12457    /// Platform to initialize the container with. Defaults to the native platform of the current engine
12458    #[builder(setter(into, strip_option), default)]
12459    pub platform: Option<Platform>,
12460}
12461#[derive(Builder, Debug, PartialEq)]
12462pub struct QueryCurrentTypeDefsOpts {
12463    /// Strip core API functions from the Query type, leaving only module-sourced functions (constructors, entrypoint proxies, etc.).
12464    /// Core types (Container, Directory, etc.) are kept so return types and method chaining still work.
12465    #[builder(setter(into, strip_option), default)]
12466    pub hide_core: Option<bool>,
12467}
12468#[derive(Builder, Debug, PartialEq)]
12469pub struct QueryEnvOpts {
12470    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
12471    #[builder(setter(into, strip_option), default)]
12472    pub privileged: Option<bool>,
12473    /// Allow new outputs to be declared and saved in the environment
12474    #[builder(setter(into, strip_option), default)]
12475    pub writable: Option<bool>,
12476}
12477#[derive(Builder, Debug, PartialEq)]
12478pub struct QueryEnvFileOpts {
12479    /// Replace "${VAR}" or "$VAR" with the value of other vars
12480    #[builder(setter(into, strip_option), default)]
12481    pub expand: Option<bool>,
12482}
12483#[derive(Builder, Debug, PartialEq)]
12484pub struct QueryFileOpts {
12485    /// Permissions of the new file. Example: 0600
12486    #[builder(setter(into, strip_option), default)]
12487    pub permissions: Option<isize>,
12488}
12489#[derive(Builder, Debug, PartialEq)]
12490pub struct QueryGitOpts<'a> {
12491    /// A service which must be started before the repo is fetched.
12492    #[builder(setter(into, strip_option), default)]
12493    pub experimental_service_host: Option<ServiceId>,
12494    /// Secret used to populate the Authorization HTTP header
12495    #[builder(setter(into, strip_option), default)]
12496    pub http_auth_header: Option<SecretId>,
12497    /// Secret used to populate the password during basic HTTP Authorization
12498    #[builder(setter(into, strip_option), default)]
12499    pub http_auth_token: Option<SecretId>,
12500    /// Username used to populate the password during basic HTTP Authorization
12501    #[builder(setter(into, strip_option), default)]
12502    pub http_auth_username: Option<&'a str>,
12503    /// DEPRECATED: Set to true to keep .git directory.
12504    #[builder(setter(into, strip_option), default)]
12505    pub keep_git_dir: Option<bool>,
12506    /// Set SSH auth socket
12507    #[builder(setter(into, strip_option), default)]
12508    pub ssh_auth_socket: Option<SocketId>,
12509    /// Set SSH known hosts
12510    #[builder(setter(into, strip_option), default)]
12511    pub ssh_known_hosts: Option<&'a str>,
12512}
12513#[derive(Builder, Debug, PartialEq)]
12514pub struct QueryHttpOpts<'a> {
12515    /// Secret used to populate the Authorization HTTP header
12516    #[builder(setter(into, strip_option), default)]
12517    pub auth_header: Option<SecretId>,
12518    /// A service which must be started before the URL is fetched.
12519    #[builder(setter(into, strip_option), default)]
12520    pub experimental_service_host: Option<ServiceId>,
12521    /// File name to use for the file. Defaults to the last part of the URL.
12522    #[builder(setter(into, strip_option), default)]
12523    pub name: Option<&'a str>,
12524    /// Permissions to set on the file.
12525    #[builder(setter(into, strip_option), default)]
12526    pub permissions: Option<isize>,
12527}
12528#[derive(Builder, Debug, PartialEq)]
12529pub struct QueryLlmOpts<'a> {
12530    /// Cap the number of API calls for this LLM
12531    #[builder(setter(into, strip_option), default)]
12532    pub max_api_calls: Option<isize>,
12533    /// Model to use
12534    #[builder(setter(into, strip_option), default)]
12535    pub model: Option<&'a str>,
12536}
12537#[derive(Builder, Debug, PartialEq)]
12538pub struct QueryModuleSourceOpts<'a> {
12539    /// 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.
12540    #[builder(setter(into, strip_option), default)]
12541    pub allow_not_exists: Option<bool>,
12542    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
12543    #[builder(setter(into, strip_option), default)]
12544    pub disable_find_up: Option<bool>,
12545    /// The pinned version of the module source
12546    #[builder(setter(into, strip_option), default)]
12547    pub ref_pin: Option<&'a str>,
12548    /// If set, error out if the ref string is not of the provided requireKind.
12549    #[builder(setter(into, strip_option), default)]
12550    pub require_kind: Option<ModuleSourceKind>,
12551}
12552#[derive(Builder, Debug, PartialEq)]
12553pub struct QuerySecretOpts<'a> {
12554    /// 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.
12555    /// 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.
12556    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
12557    #[builder(setter(into, strip_option), default)]
12558    pub cache_key: Option<&'a str>,
12559}
12560impl Query {
12561    /// initialize an address to load directories, containers, secrets or other object types.
12562    pub fn address(&self, value: impl Into<String>) -> Address {
12563        let mut query = self.selection.select("address");
12564        query = query.arg("value", value.into());
12565        Address {
12566            proc: self.proc.clone(),
12567            selection: query,
12568            graphql_client: self.graphql_client.clone(),
12569        }
12570    }
12571    /// Constructs a cache volume for a given cache key.
12572    ///
12573    /// # Arguments
12574    ///
12575    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
12576    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
12577        let mut query = self.selection.select("cacheVolume");
12578        query = query.arg("key", key.into());
12579        CacheVolume {
12580            proc: self.proc.clone(),
12581            selection: query,
12582            graphql_client: self.graphql_client.clone(),
12583        }
12584    }
12585    /// Creates an empty changeset
12586    pub fn changeset(&self) -> Changeset {
12587        let query = self.selection.select("changeset");
12588        Changeset {
12589            proc: self.proc.clone(),
12590            selection: query,
12591            graphql_client: self.graphql_client.clone(),
12592        }
12593    }
12594    /// Dagger Cloud configuration and state
12595    pub fn cloud(&self) -> Cloud {
12596        let query = self.selection.select("cloud");
12597        Cloud {
12598            proc: self.proc.clone(),
12599            selection: query,
12600            graphql_client: self.graphql_client.clone(),
12601        }
12602    }
12603    /// Creates a scratch container, with no image or metadata.
12604    /// To pull an image, follow up with the "from" function.
12605    ///
12606    /// # Arguments
12607    ///
12608    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12609    pub fn container(&self) -> Container {
12610        let query = self.selection.select("container");
12611        Container {
12612            proc: self.proc.clone(),
12613            selection: query,
12614            graphql_client: self.graphql_client.clone(),
12615        }
12616    }
12617    /// Creates a scratch container, with no image or metadata.
12618    /// To pull an image, follow up with the "from" function.
12619    ///
12620    /// # Arguments
12621    ///
12622    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12623    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
12624        let mut query = self.selection.select("container");
12625        if let Some(platform) = opts.platform {
12626            query = query.arg("platform", platform);
12627        }
12628        Container {
12629            proc: self.proc.clone(),
12630            selection: query,
12631            graphql_client: self.graphql_client.clone(),
12632        }
12633    }
12634    /// Returns the current environment
12635    /// 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.
12636    /// 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.
12637    pub fn current_env(&self) -> Env {
12638        let query = self.selection.select("currentEnv");
12639        Env {
12640            proc: self.proc.clone(),
12641            selection: query,
12642            graphql_client: self.graphql_client.clone(),
12643        }
12644    }
12645    /// The FunctionCall context that the SDK caller is currently executing in.
12646    /// If the caller is not currently executing in a function, this will return an error.
12647    pub fn current_function_call(&self) -> FunctionCall {
12648        let query = self.selection.select("currentFunctionCall");
12649        FunctionCall {
12650            proc: self.proc.clone(),
12651            selection: query,
12652            graphql_client: self.graphql_client.clone(),
12653        }
12654    }
12655    /// The module currently being served in the session, if any.
12656    pub fn current_module(&self) -> CurrentModule {
12657        let query = self.selection.select("currentModule");
12658        CurrentModule {
12659            proc: self.proc.clone(),
12660            selection: query,
12661            graphql_client: self.graphql_client.clone(),
12662        }
12663    }
12664    /// The TypeDef representations of the objects currently being served in the session.
12665    ///
12666    /// # Arguments
12667    ///
12668    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12669    pub fn current_type_defs(&self) -> Vec<TypeDef> {
12670        let query = self.selection.select("currentTypeDefs");
12671        vec![TypeDef {
12672            proc: self.proc.clone(),
12673            selection: query,
12674            graphql_client: self.graphql_client.clone(),
12675        }]
12676    }
12677    /// The TypeDef representations of the objects currently being served in the session.
12678    ///
12679    /// # Arguments
12680    ///
12681    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12682    pub fn current_type_defs_opts(&self, opts: QueryCurrentTypeDefsOpts) -> Vec<TypeDef> {
12683        let mut query = self.selection.select("currentTypeDefs");
12684        if let Some(hide_core) = opts.hide_core {
12685            query = query.arg("hideCore", hide_core);
12686        }
12687        vec![TypeDef {
12688            proc: self.proc.clone(),
12689            selection: query,
12690            graphql_client: self.graphql_client.clone(),
12691        }]
12692    }
12693    /// Detect and return the current workspace.
12694    pub fn current_workspace(&self) -> Workspace {
12695        let query = self.selection.select("currentWorkspace");
12696        Workspace {
12697            proc: self.proc.clone(),
12698            selection: query,
12699            graphql_client: self.graphql_client.clone(),
12700        }
12701    }
12702    /// The default platform of the engine.
12703    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
12704        let query = self.selection.select("defaultPlatform");
12705        query.execute(self.graphql_client.clone()).await
12706    }
12707    /// Creates an empty directory.
12708    pub fn directory(&self) -> Directory {
12709        let query = self.selection.select("directory");
12710        Directory {
12711            proc: self.proc.clone(),
12712            selection: query,
12713            graphql_client: self.graphql_client.clone(),
12714        }
12715    }
12716    /// The Dagger engine container configuration and state
12717    pub fn engine(&self) -> Engine {
12718        let query = self.selection.select("engine");
12719        Engine {
12720            proc: self.proc.clone(),
12721            selection: query,
12722            graphql_client: self.graphql_client.clone(),
12723        }
12724    }
12725    /// Initializes a new environment
12726    ///
12727    /// # Arguments
12728    ///
12729    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12730    pub fn env(&self) -> Env {
12731        let query = self.selection.select("env");
12732        Env {
12733            proc: self.proc.clone(),
12734            selection: query,
12735            graphql_client: self.graphql_client.clone(),
12736        }
12737    }
12738    /// Initializes a new environment
12739    ///
12740    /// # Arguments
12741    ///
12742    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12743    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
12744        let mut query = self.selection.select("env");
12745        if let Some(privileged) = opts.privileged {
12746            query = query.arg("privileged", privileged);
12747        }
12748        if let Some(writable) = opts.writable {
12749            query = query.arg("writable", writable);
12750        }
12751        Env {
12752            proc: self.proc.clone(),
12753            selection: query,
12754            graphql_client: self.graphql_client.clone(),
12755        }
12756    }
12757    /// Initialize an environment file
12758    ///
12759    /// # Arguments
12760    ///
12761    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12762    pub fn env_file(&self) -> EnvFile {
12763        let query = self.selection.select("envFile");
12764        EnvFile {
12765            proc: self.proc.clone(),
12766            selection: query,
12767            graphql_client: self.graphql_client.clone(),
12768        }
12769    }
12770    /// Initialize an environment file
12771    ///
12772    /// # Arguments
12773    ///
12774    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12775    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
12776        let mut query = self.selection.select("envFile");
12777        if let Some(expand) = opts.expand {
12778            query = query.arg("expand", expand);
12779        }
12780        EnvFile {
12781            proc: self.proc.clone(),
12782            selection: query,
12783            graphql_client: self.graphql_client.clone(),
12784        }
12785    }
12786    /// Create a new error.
12787    ///
12788    /// # Arguments
12789    ///
12790    /// * `message` - A brief description of the error.
12791    pub fn error(&self, message: impl Into<String>) -> Error {
12792        let mut query = self.selection.select("error");
12793        query = query.arg("message", message.into());
12794        Error {
12795            proc: self.proc.clone(),
12796            selection: query,
12797            graphql_client: self.graphql_client.clone(),
12798        }
12799    }
12800    /// Creates a file with the specified contents.
12801    ///
12802    /// # Arguments
12803    ///
12804    /// * `name` - Name of the new file. Example: "foo.txt"
12805    /// * `contents` - Contents of the new file. Example: "Hello world!"
12806    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12807    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
12808        let mut query = self.selection.select("file");
12809        query = query.arg("name", name.into());
12810        query = query.arg("contents", contents.into());
12811        File {
12812            proc: self.proc.clone(),
12813            selection: query,
12814            graphql_client: self.graphql_client.clone(),
12815        }
12816    }
12817    /// Creates a file with the specified contents.
12818    ///
12819    /// # Arguments
12820    ///
12821    /// * `name` - Name of the new file. Example: "foo.txt"
12822    /// * `contents` - Contents of the new file. Example: "Hello world!"
12823    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12824    pub fn file_opts(
12825        &self,
12826        name: impl Into<String>,
12827        contents: impl Into<String>,
12828        opts: QueryFileOpts,
12829    ) -> File {
12830        let mut query = self.selection.select("file");
12831        query = query.arg("name", name.into());
12832        query = query.arg("contents", contents.into());
12833        if let Some(permissions) = opts.permissions {
12834            query = query.arg("permissions", permissions);
12835        }
12836        File {
12837            proc: self.proc.clone(),
12838            selection: query,
12839            graphql_client: self.graphql_client.clone(),
12840        }
12841    }
12842    /// Creates a function.
12843    ///
12844    /// # Arguments
12845    ///
12846    /// * `name` - Name of the function, in its original format from the implementation language.
12847    /// * `return_type` - Return type of the function.
12848    pub fn function(
12849        &self,
12850        name: impl Into<String>,
12851        return_type: impl IntoID<TypeDefId>,
12852    ) -> Function {
12853        let mut query = self.selection.select("function");
12854        query = query.arg("name", name.into());
12855        query = query.arg_lazy(
12856            "returnType",
12857            Box::new(move || {
12858                let return_type = return_type.clone();
12859                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
12860            }),
12861        );
12862        Function {
12863            proc: self.proc.clone(),
12864            selection: query,
12865            graphql_client: self.graphql_client.clone(),
12866        }
12867    }
12868    /// Create a code generation result, given a directory containing the generated code.
12869    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
12870        let mut query = self.selection.select("generatedCode");
12871        query = query.arg_lazy(
12872            "code",
12873            Box::new(move || {
12874                let code = code.clone();
12875                Box::pin(async move { code.into_id().await.unwrap().quote() })
12876            }),
12877        );
12878        GeneratedCode {
12879            proc: self.proc.clone(),
12880            selection: query,
12881            graphql_client: self.graphql_client.clone(),
12882        }
12883    }
12884    /// Queries a Git repository.
12885    ///
12886    /// # Arguments
12887    ///
12888    /// * `url` - URL of the git repository.
12889    ///
12890    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
12891    ///
12892    /// Suffix ".git" is optional.
12893    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12894    pub fn git(&self, url: impl Into<String>) -> GitRepository {
12895        let mut query = self.selection.select("git");
12896        query = query.arg("url", url.into());
12897        GitRepository {
12898            proc: self.proc.clone(),
12899            selection: query,
12900            graphql_client: self.graphql_client.clone(),
12901        }
12902    }
12903    /// Queries a Git repository.
12904    ///
12905    /// # Arguments
12906    ///
12907    /// * `url` - URL of the git repository.
12908    ///
12909    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
12910    ///
12911    /// Suffix ".git" is optional.
12912    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12913    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
12914        let mut query = self.selection.select("git");
12915        query = query.arg("url", url.into());
12916        if let Some(keep_git_dir) = opts.keep_git_dir {
12917            query = query.arg("keepGitDir", keep_git_dir);
12918        }
12919        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
12920            query = query.arg("sshKnownHosts", ssh_known_hosts);
12921        }
12922        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
12923            query = query.arg("sshAuthSocket", ssh_auth_socket);
12924        }
12925        if let Some(http_auth_username) = opts.http_auth_username {
12926            query = query.arg("httpAuthUsername", http_auth_username);
12927        }
12928        if let Some(http_auth_token) = opts.http_auth_token {
12929            query = query.arg("httpAuthToken", http_auth_token);
12930        }
12931        if let Some(http_auth_header) = opts.http_auth_header {
12932            query = query.arg("httpAuthHeader", http_auth_header);
12933        }
12934        if let Some(experimental_service_host) = opts.experimental_service_host {
12935            query = query.arg("experimentalServiceHost", experimental_service_host);
12936        }
12937        GitRepository {
12938            proc: self.proc.clone(),
12939            selection: query,
12940            graphql_client: self.graphql_client.clone(),
12941        }
12942    }
12943    /// Queries the host environment.
12944    pub fn host(&self) -> Host {
12945        let query = self.selection.select("host");
12946        Host {
12947            proc: self.proc.clone(),
12948            selection: query,
12949            graphql_client: self.graphql_client.clone(),
12950        }
12951    }
12952    /// Returns a file containing an http remote url content.
12953    ///
12954    /// # Arguments
12955    ///
12956    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
12957    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12958    pub fn http(&self, url: impl Into<String>) -> File {
12959        let mut query = self.selection.select("http");
12960        query = query.arg("url", url.into());
12961        File {
12962            proc: self.proc.clone(),
12963            selection: query,
12964            graphql_client: self.graphql_client.clone(),
12965        }
12966    }
12967    /// Returns a file containing an http remote url content.
12968    ///
12969    /// # Arguments
12970    ///
12971    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
12972    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12973    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
12974        let mut query = self.selection.select("http");
12975        query = query.arg("url", url.into());
12976        if let Some(name) = opts.name {
12977            query = query.arg("name", name);
12978        }
12979        if let Some(permissions) = opts.permissions {
12980            query = query.arg("permissions", permissions);
12981        }
12982        if let Some(auth_header) = opts.auth_header {
12983            query = query.arg("authHeader", auth_header);
12984        }
12985        if let Some(experimental_service_host) = opts.experimental_service_host {
12986            query = query.arg("experimentalServiceHost", experimental_service_host);
12987        }
12988        File {
12989            proc: self.proc.clone(),
12990            selection: query,
12991            graphql_client: self.graphql_client.clone(),
12992        }
12993    }
12994    /// A unique identifier for this Query.
12995    pub async fn id(&self) -> Result<QueryId, DaggerError> {
12996        let query = self.selection.select("id");
12997        query.execute(self.graphql_client.clone()).await
12998    }
12999    /// Initialize a JSON value
13000    pub fn json(&self) -> JsonValue {
13001        let query = self.selection.select("json");
13002        JsonValue {
13003            proc: self.proc.clone(),
13004            selection: query,
13005            graphql_client: self.graphql_client.clone(),
13006        }
13007    }
13008    /// Initialize a Large Language Model (LLM)
13009    ///
13010    /// # Arguments
13011    ///
13012    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13013    pub fn llm(&self) -> Llm {
13014        let query = self.selection.select("llm");
13015        Llm {
13016            proc: self.proc.clone(),
13017            selection: query,
13018            graphql_client: self.graphql_client.clone(),
13019        }
13020    }
13021    /// Initialize a Large Language Model (LLM)
13022    ///
13023    /// # Arguments
13024    ///
13025    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
13026    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
13027        let mut query = self.selection.select("llm");
13028        if let Some(model) = opts.model {
13029            query = query.arg("model", model);
13030        }
13031        if let Some(max_api_calls) = opts.max_api_calls {
13032            query = query.arg("maxAPICalls", max_api_calls);
13033        }
13034        Llm {
13035            proc: self.proc.clone(),
13036            selection: query,
13037            graphql_client: self.graphql_client.clone(),
13038        }
13039    }
13040    /// Load a Address from its ID.
13041    pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
13042        let mut query = self.selection.select("loadAddressFromID");
13043        query = query.arg_lazy(
13044            "id",
13045            Box::new(move || {
13046                let id = id.clone();
13047                Box::pin(async move { id.into_id().await.unwrap().quote() })
13048            }),
13049        );
13050        Address {
13051            proc: self.proc.clone(),
13052            selection: query,
13053            graphql_client: self.graphql_client.clone(),
13054        }
13055    }
13056    /// Load a Binding from its ID.
13057    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
13058        let mut query = self.selection.select("loadBindingFromID");
13059        query = query.arg_lazy(
13060            "id",
13061            Box::new(move || {
13062                let id = id.clone();
13063                Box::pin(async move { id.into_id().await.unwrap().quote() })
13064            }),
13065        );
13066        Binding {
13067            proc: self.proc.clone(),
13068            selection: query,
13069            graphql_client: self.graphql_client.clone(),
13070        }
13071    }
13072    /// Load a CacheVolume from its ID.
13073    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
13074        let mut query = self.selection.select("loadCacheVolumeFromID");
13075        query = query.arg_lazy(
13076            "id",
13077            Box::new(move || {
13078                let id = id.clone();
13079                Box::pin(async move { id.into_id().await.unwrap().quote() })
13080            }),
13081        );
13082        CacheVolume {
13083            proc: self.proc.clone(),
13084            selection: query,
13085            graphql_client: self.graphql_client.clone(),
13086        }
13087    }
13088    /// Load a Changeset from its ID.
13089    pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
13090        let mut query = self.selection.select("loadChangesetFromID");
13091        query = query.arg_lazy(
13092            "id",
13093            Box::new(move || {
13094                let id = id.clone();
13095                Box::pin(async move { id.into_id().await.unwrap().quote() })
13096            }),
13097        );
13098        Changeset {
13099            proc: self.proc.clone(),
13100            selection: query,
13101            graphql_client: self.graphql_client.clone(),
13102        }
13103    }
13104    /// Load a Check from its ID.
13105    pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
13106        let mut query = self.selection.select("loadCheckFromID");
13107        query = query.arg_lazy(
13108            "id",
13109            Box::new(move || {
13110                let id = id.clone();
13111                Box::pin(async move { id.into_id().await.unwrap().quote() })
13112            }),
13113        );
13114        Check {
13115            proc: self.proc.clone(),
13116            selection: query,
13117            graphql_client: self.graphql_client.clone(),
13118        }
13119    }
13120    /// Load a CheckGroup from its ID.
13121    pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
13122        let mut query = self.selection.select("loadCheckGroupFromID");
13123        query = query.arg_lazy(
13124            "id",
13125            Box::new(move || {
13126                let id = id.clone();
13127                Box::pin(async move { id.into_id().await.unwrap().quote() })
13128            }),
13129        );
13130        CheckGroup {
13131            proc: self.proc.clone(),
13132            selection: query,
13133            graphql_client: self.graphql_client.clone(),
13134        }
13135    }
13136    /// Load a Cloud from its ID.
13137    pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
13138        let mut query = self.selection.select("loadCloudFromID");
13139        query = query.arg_lazy(
13140            "id",
13141            Box::new(move || {
13142                let id = id.clone();
13143                Box::pin(async move { id.into_id().await.unwrap().quote() })
13144            }),
13145        );
13146        Cloud {
13147            proc: self.proc.clone(),
13148            selection: query,
13149            graphql_client: self.graphql_client.clone(),
13150        }
13151    }
13152    /// Load a Container from its ID.
13153    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
13154        let mut query = self.selection.select("loadContainerFromID");
13155        query = query.arg_lazy(
13156            "id",
13157            Box::new(move || {
13158                let id = id.clone();
13159                Box::pin(async move { id.into_id().await.unwrap().quote() })
13160            }),
13161        );
13162        Container {
13163            proc: self.proc.clone(),
13164            selection: query,
13165            graphql_client: self.graphql_client.clone(),
13166        }
13167    }
13168    /// Load a CurrentModule from its ID.
13169    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
13170        let mut query = self.selection.select("loadCurrentModuleFromID");
13171        query = query.arg_lazy(
13172            "id",
13173            Box::new(move || {
13174                let id = id.clone();
13175                Box::pin(async move { id.into_id().await.unwrap().quote() })
13176            }),
13177        );
13178        CurrentModule {
13179            proc: self.proc.clone(),
13180            selection: query,
13181            graphql_client: self.graphql_client.clone(),
13182        }
13183    }
13184    /// Load a DiffStat from its ID.
13185    pub fn load_diff_stat_from_id(&self, id: impl IntoID<DiffStatId>) -> DiffStat {
13186        let mut query = self.selection.select("loadDiffStatFromID");
13187        query = query.arg_lazy(
13188            "id",
13189            Box::new(move || {
13190                let id = id.clone();
13191                Box::pin(async move { id.into_id().await.unwrap().quote() })
13192            }),
13193        );
13194        DiffStat {
13195            proc: self.proc.clone(),
13196            selection: query,
13197            graphql_client: self.graphql_client.clone(),
13198        }
13199    }
13200    /// Load a Directory from its ID.
13201    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
13202        let mut query = self.selection.select("loadDirectoryFromID");
13203        query = query.arg_lazy(
13204            "id",
13205            Box::new(move || {
13206                let id = id.clone();
13207                Box::pin(async move { id.into_id().await.unwrap().quote() })
13208            }),
13209        );
13210        Directory {
13211            proc: self.proc.clone(),
13212            selection: query,
13213            graphql_client: self.graphql_client.clone(),
13214        }
13215    }
13216    /// Load a EngineCacheEntry from its ID.
13217    pub fn load_engine_cache_entry_from_id(
13218        &self,
13219        id: impl IntoID<EngineCacheEntryId>,
13220    ) -> EngineCacheEntry {
13221        let mut query = self.selection.select("loadEngineCacheEntryFromID");
13222        query = query.arg_lazy(
13223            "id",
13224            Box::new(move || {
13225                let id = id.clone();
13226                Box::pin(async move { id.into_id().await.unwrap().quote() })
13227            }),
13228        );
13229        EngineCacheEntry {
13230            proc: self.proc.clone(),
13231            selection: query,
13232            graphql_client: self.graphql_client.clone(),
13233        }
13234    }
13235    /// Load a EngineCacheEntrySet from its ID.
13236    pub fn load_engine_cache_entry_set_from_id(
13237        &self,
13238        id: impl IntoID<EngineCacheEntrySetId>,
13239    ) -> EngineCacheEntrySet {
13240        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
13241        query = query.arg_lazy(
13242            "id",
13243            Box::new(move || {
13244                let id = id.clone();
13245                Box::pin(async move { id.into_id().await.unwrap().quote() })
13246            }),
13247        );
13248        EngineCacheEntrySet {
13249            proc: self.proc.clone(),
13250            selection: query,
13251            graphql_client: self.graphql_client.clone(),
13252        }
13253    }
13254    /// Load a EngineCache from its ID.
13255    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
13256        let mut query = self.selection.select("loadEngineCacheFromID");
13257        query = query.arg_lazy(
13258            "id",
13259            Box::new(move || {
13260                let id = id.clone();
13261                Box::pin(async move { id.into_id().await.unwrap().quote() })
13262            }),
13263        );
13264        EngineCache {
13265            proc: self.proc.clone(),
13266            selection: query,
13267            graphql_client: self.graphql_client.clone(),
13268        }
13269    }
13270    /// Load a Engine from its ID.
13271    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
13272        let mut query = self.selection.select("loadEngineFromID");
13273        query = query.arg_lazy(
13274            "id",
13275            Box::new(move || {
13276                let id = id.clone();
13277                Box::pin(async move { id.into_id().await.unwrap().quote() })
13278            }),
13279        );
13280        Engine {
13281            proc: self.proc.clone(),
13282            selection: query,
13283            graphql_client: self.graphql_client.clone(),
13284        }
13285    }
13286    /// Load a EnumTypeDef from its ID.
13287    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
13288        let mut query = self.selection.select("loadEnumTypeDefFromID");
13289        query = query.arg_lazy(
13290            "id",
13291            Box::new(move || {
13292                let id = id.clone();
13293                Box::pin(async move { id.into_id().await.unwrap().quote() })
13294            }),
13295        );
13296        EnumTypeDef {
13297            proc: self.proc.clone(),
13298            selection: query,
13299            graphql_client: self.graphql_client.clone(),
13300        }
13301    }
13302    /// Load a EnumValueTypeDef from its ID.
13303    pub fn load_enum_value_type_def_from_id(
13304        &self,
13305        id: impl IntoID<EnumValueTypeDefId>,
13306    ) -> EnumValueTypeDef {
13307        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
13308        query = query.arg_lazy(
13309            "id",
13310            Box::new(move || {
13311                let id = id.clone();
13312                Box::pin(async move { id.into_id().await.unwrap().quote() })
13313            }),
13314        );
13315        EnumValueTypeDef {
13316            proc: self.proc.clone(),
13317            selection: query,
13318            graphql_client: self.graphql_client.clone(),
13319        }
13320    }
13321    /// Load a EnvFile from its ID.
13322    pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
13323        let mut query = self.selection.select("loadEnvFileFromID");
13324        query = query.arg_lazy(
13325            "id",
13326            Box::new(move || {
13327                let id = id.clone();
13328                Box::pin(async move { id.into_id().await.unwrap().quote() })
13329            }),
13330        );
13331        EnvFile {
13332            proc: self.proc.clone(),
13333            selection: query,
13334            graphql_client: self.graphql_client.clone(),
13335        }
13336    }
13337    /// Load a Env from its ID.
13338    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
13339        let mut query = self.selection.select("loadEnvFromID");
13340        query = query.arg_lazy(
13341            "id",
13342            Box::new(move || {
13343                let id = id.clone();
13344                Box::pin(async move { id.into_id().await.unwrap().quote() })
13345            }),
13346        );
13347        Env {
13348            proc: self.proc.clone(),
13349            selection: query,
13350            graphql_client: self.graphql_client.clone(),
13351        }
13352    }
13353    /// Load a EnvVariable from its ID.
13354    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
13355        let mut query = self.selection.select("loadEnvVariableFromID");
13356        query = query.arg_lazy(
13357            "id",
13358            Box::new(move || {
13359                let id = id.clone();
13360                Box::pin(async move { id.into_id().await.unwrap().quote() })
13361            }),
13362        );
13363        EnvVariable {
13364            proc: self.proc.clone(),
13365            selection: query,
13366            graphql_client: self.graphql_client.clone(),
13367        }
13368    }
13369    /// Load a Error from its ID.
13370    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
13371        let mut query = self.selection.select("loadErrorFromID");
13372        query = query.arg_lazy(
13373            "id",
13374            Box::new(move || {
13375                let id = id.clone();
13376                Box::pin(async move { id.into_id().await.unwrap().quote() })
13377            }),
13378        );
13379        Error {
13380            proc: self.proc.clone(),
13381            selection: query,
13382            graphql_client: self.graphql_client.clone(),
13383        }
13384    }
13385    /// Load a ErrorValue from its ID.
13386    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
13387        let mut query = self.selection.select("loadErrorValueFromID");
13388        query = query.arg_lazy(
13389            "id",
13390            Box::new(move || {
13391                let id = id.clone();
13392                Box::pin(async move { id.into_id().await.unwrap().quote() })
13393            }),
13394        );
13395        ErrorValue {
13396            proc: self.proc.clone(),
13397            selection: query,
13398            graphql_client: self.graphql_client.clone(),
13399        }
13400    }
13401    /// Load a FieldTypeDef from its ID.
13402    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
13403        let mut query = self.selection.select("loadFieldTypeDefFromID");
13404        query = query.arg_lazy(
13405            "id",
13406            Box::new(move || {
13407                let id = id.clone();
13408                Box::pin(async move { id.into_id().await.unwrap().quote() })
13409            }),
13410        );
13411        FieldTypeDef {
13412            proc: self.proc.clone(),
13413            selection: query,
13414            graphql_client: self.graphql_client.clone(),
13415        }
13416    }
13417    /// Load a File from its ID.
13418    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
13419        let mut query = self.selection.select("loadFileFromID");
13420        query = query.arg_lazy(
13421            "id",
13422            Box::new(move || {
13423                let id = id.clone();
13424                Box::pin(async move { id.into_id().await.unwrap().quote() })
13425            }),
13426        );
13427        File {
13428            proc: self.proc.clone(),
13429            selection: query,
13430            graphql_client: self.graphql_client.clone(),
13431        }
13432    }
13433    /// Load a FunctionArg from its ID.
13434    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
13435        let mut query = self.selection.select("loadFunctionArgFromID");
13436        query = query.arg_lazy(
13437            "id",
13438            Box::new(move || {
13439                let id = id.clone();
13440                Box::pin(async move { id.into_id().await.unwrap().quote() })
13441            }),
13442        );
13443        FunctionArg {
13444            proc: self.proc.clone(),
13445            selection: query,
13446            graphql_client: self.graphql_client.clone(),
13447        }
13448    }
13449    /// Load a FunctionCallArgValue from its ID.
13450    pub fn load_function_call_arg_value_from_id(
13451        &self,
13452        id: impl IntoID<FunctionCallArgValueId>,
13453    ) -> FunctionCallArgValue {
13454        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
13455        query = query.arg_lazy(
13456            "id",
13457            Box::new(move || {
13458                let id = id.clone();
13459                Box::pin(async move { id.into_id().await.unwrap().quote() })
13460            }),
13461        );
13462        FunctionCallArgValue {
13463            proc: self.proc.clone(),
13464            selection: query,
13465            graphql_client: self.graphql_client.clone(),
13466        }
13467    }
13468    /// Load a FunctionCall from its ID.
13469    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
13470        let mut query = self.selection.select("loadFunctionCallFromID");
13471        query = query.arg_lazy(
13472            "id",
13473            Box::new(move || {
13474                let id = id.clone();
13475                Box::pin(async move { id.into_id().await.unwrap().quote() })
13476            }),
13477        );
13478        FunctionCall {
13479            proc: self.proc.clone(),
13480            selection: query,
13481            graphql_client: self.graphql_client.clone(),
13482        }
13483    }
13484    /// Load a Function from its ID.
13485    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
13486        let mut query = self.selection.select("loadFunctionFromID");
13487        query = query.arg_lazy(
13488            "id",
13489            Box::new(move || {
13490                let id = id.clone();
13491                Box::pin(async move { id.into_id().await.unwrap().quote() })
13492            }),
13493        );
13494        Function {
13495            proc: self.proc.clone(),
13496            selection: query,
13497            graphql_client: self.graphql_client.clone(),
13498        }
13499    }
13500    /// Load a GeneratedCode from its ID.
13501    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
13502        let mut query = self.selection.select("loadGeneratedCodeFromID");
13503        query = query.arg_lazy(
13504            "id",
13505            Box::new(move || {
13506                let id = id.clone();
13507                Box::pin(async move { id.into_id().await.unwrap().quote() })
13508            }),
13509        );
13510        GeneratedCode {
13511            proc: self.proc.clone(),
13512            selection: query,
13513            graphql_client: self.graphql_client.clone(),
13514        }
13515    }
13516    /// Load a Generator from its ID.
13517    pub fn load_generator_from_id(&self, id: impl IntoID<GeneratorId>) -> Generator {
13518        let mut query = self.selection.select("loadGeneratorFromID");
13519        query = query.arg_lazy(
13520            "id",
13521            Box::new(move || {
13522                let id = id.clone();
13523                Box::pin(async move { id.into_id().await.unwrap().quote() })
13524            }),
13525        );
13526        Generator {
13527            proc: self.proc.clone(),
13528            selection: query,
13529            graphql_client: self.graphql_client.clone(),
13530        }
13531    }
13532    /// Load a GeneratorGroup from its ID.
13533    pub fn load_generator_group_from_id(
13534        &self,
13535        id: impl IntoID<GeneratorGroupId>,
13536    ) -> GeneratorGroup {
13537        let mut query = self.selection.select("loadGeneratorGroupFromID");
13538        query = query.arg_lazy(
13539            "id",
13540            Box::new(move || {
13541                let id = id.clone();
13542                Box::pin(async move { id.into_id().await.unwrap().quote() })
13543            }),
13544        );
13545        GeneratorGroup {
13546            proc: self.proc.clone(),
13547            selection: query,
13548            graphql_client: self.graphql_client.clone(),
13549        }
13550    }
13551    /// Load a GitRef from its ID.
13552    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
13553        let mut query = self.selection.select("loadGitRefFromID");
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        GitRef {
13562            proc: self.proc.clone(),
13563            selection: query,
13564            graphql_client: self.graphql_client.clone(),
13565        }
13566    }
13567    /// Load a GitRepository from its ID.
13568    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
13569        let mut query = self.selection.select("loadGitRepositoryFromID");
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        GitRepository {
13578            proc: self.proc.clone(),
13579            selection: query,
13580            graphql_client: self.graphql_client.clone(),
13581        }
13582    }
13583    /// Load a HealthcheckConfig from its ID.
13584    pub fn load_healthcheck_config_from_id(
13585        &self,
13586        id: impl IntoID<HealthcheckConfigId>,
13587    ) -> HealthcheckConfig {
13588        let mut query = self.selection.select("loadHealthcheckConfigFromID");
13589        query = query.arg_lazy(
13590            "id",
13591            Box::new(move || {
13592                let id = id.clone();
13593                Box::pin(async move { id.into_id().await.unwrap().quote() })
13594            }),
13595        );
13596        HealthcheckConfig {
13597            proc: self.proc.clone(),
13598            selection: query,
13599            graphql_client: self.graphql_client.clone(),
13600        }
13601    }
13602    /// Load a Host from its ID.
13603    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
13604        let mut query = self.selection.select("loadHostFromID");
13605        query = query.arg_lazy(
13606            "id",
13607            Box::new(move || {
13608                let id = id.clone();
13609                Box::pin(async move { id.into_id().await.unwrap().quote() })
13610            }),
13611        );
13612        Host {
13613            proc: self.proc.clone(),
13614            selection: query,
13615            graphql_client: self.graphql_client.clone(),
13616        }
13617    }
13618    /// Load a InputTypeDef from its ID.
13619    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
13620        let mut query = self.selection.select("loadInputTypeDefFromID");
13621        query = query.arg_lazy(
13622            "id",
13623            Box::new(move || {
13624                let id = id.clone();
13625                Box::pin(async move { id.into_id().await.unwrap().quote() })
13626            }),
13627        );
13628        InputTypeDef {
13629            proc: self.proc.clone(),
13630            selection: query,
13631            graphql_client: self.graphql_client.clone(),
13632        }
13633    }
13634    /// Load a InterfaceTypeDef from its ID.
13635    pub fn load_interface_type_def_from_id(
13636        &self,
13637        id: impl IntoID<InterfaceTypeDefId>,
13638    ) -> InterfaceTypeDef {
13639        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
13640        query = query.arg_lazy(
13641            "id",
13642            Box::new(move || {
13643                let id = id.clone();
13644                Box::pin(async move { id.into_id().await.unwrap().quote() })
13645            }),
13646        );
13647        InterfaceTypeDef {
13648            proc: self.proc.clone(),
13649            selection: query,
13650            graphql_client: self.graphql_client.clone(),
13651        }
13652    }
13653    /// Load a JSONValue from its ID.
13654    pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
13655        let mut query = self.selection.select("loadJSONValueFromID");
13656        query = query.arg_lazy(
13657            "id",
13658            Box::new(move || {
13659                let id = id.clone();
13660                Box::pin(async move { id.into_id().await.unwrap().quote() })
13661            }),
13662        );
13663        JsonValue {
13664            proc: self.proc.clone(),
13665            selection: query,
13666            graphql_client: self.graphql_client.clone(),
13667        }
13668    }
13669    /// Load a LLM from its ID.
13670    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
13671        let mut query = self.selection.select("loadLLMFromID");
13672        query = query.arg_lazy(
13673            "id",
13674            Box::new(move || {
13675                let id = id.clone();
13676                Box::pin(async move { id.into_id().await.unwrap().quote() })
13677            }),
13678        );
13679        Llm {
13680            proc: self.proc.clone(),
13681            selection: query,
13682            graphql_client: self.graphql_client.clone(),
13683        }
13684    }
13685    /// Load a LLMTokenUsage from its ID.
13686    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
13687        let mut query = self.selection.select("loadLLMTokenUsageFromID");
13688        query = query.arg_lazy(
13689            "id",
13690            Box::new(move || {
13691                let id = id.clone();
13692                Box::pin(async move { id.into_id().await.unwrap().quote() })
13693            }),
13694        );
13695        LlmTokenUsage {
13696            proc: self.proc.clone(),
13697            selection: query,
13698            graphql_client: self.graphql_client.clone(),
13699        }
13700    }
13701    /// Load a Label from its ID.
13702    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
13703        let mut query = self.selection.select("loadLabelFromID");
13704        query = query.arg_lazy(
13705            "id",
13706            Box::new(move || {
13707                let id = id.clone();
13708                Box::pin(async move { id.into_id().await.unwrap().quote() })
13709            }),
13710        );
13711        Label {
13712            proc: self.proc.clone(),
13713            selection: query,
13714            graphql_client: self.graphql_client.clone(),
13715        }
13716    }
13717    /// Load a ListTypeDef from its ID.
13718    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
13719        let mut query = self.selection.select("loadListTypeDefFromID");
13720        query = query.arg_lazy(
13721            "id",
13722            Box::new(move || {
13723                let id = id.clone();
13724                Box::pin(async move { id.into_id().await.unwrap().quote() })
13725            }),
13726        );
13727        ListTypeDef {
13728            proc: self.proc.clone(),
13729            selection: query,
13730            graphql_client: self.graphql_client.clone(),
13731        }
13732    }
13733    /// Load a ModuleConfigClient from its ID.
13734    pub fn load_module_config_client_from_id(
13735        &self,
13736        id: impl IntoID<ModuleConfigClientId>,
13737    ) -> ModuleConfigClient {
13738        let mut query = self.selection.select("loadModuleConfigClientFromID");
13739        query = query.arg_lazy(
13740            "id",
13741            Box::new(move || {
13742                let id = id.clone();
13743                Box::pin(async move { id.into_id().await.unwrap().quote() })
13744            }),
13745        );
13746        ModuleConfigClient {
13747            proc: self.proc.clone(),
13748            selection: query,
13749            graphql_client: self.graphql_client.clone(),
13750        }
13751    }
13752    /// Load a Module from its ID.
13753    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
13754        let mut query = self.selection.select("loadModuleFromID");
13755        query = query.arg_lazy(
13756            "id",
13757            Box::new(move || {
13758                let id = id.clone();
13759                Box::pin(async move { id.into_id().await.unwrap().quote() })
13760            }),
13761        );
13762        Module {
13763            proc: self.proc.clone(),
13764            selection: query,
13765            graphql_client: self.graphql_client.clone(),
13766        }
13767    }
13768    /// Load a ModuleSource from its ID.
13769    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
13770        let mut query = self.selection.select("loadModuleSourceFromID");
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        ModuleSource {
13779            proc: self.proc.clone(),
13780            selection: query,
13781            graphql_client: self.graphql_client.clone(),
13782        }
13783    }
13784    /// Load a ObjectTypeDef from its ID.
13785    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
13786        let mut query = self.selection.select("loadObjectTypeDefFromID");
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        ObjectTypeDef {
13795            proc: self.proc.clone(),
13796            selection: query,
13797            graphql_client: self.graphql_client.clone(),
13798        }
13799    }
13800    /// Load a Port from its ID.
13801    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
13802        let mut query = self.selection.select("loadPortFromID");
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        Port {
13811            proc: self.proc.clone(),
13812            selection: query,
13813            graphql_client: self.graphql_client.clone(),
13814        }
13815    }
13816    /// Load a Query from its ID.
13817    pub fn load_query_from_id(&self, id: impl IntoID<QueryId>) -> Query {
13818        let mut query = self.selection.select("loadQueryFromID");
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        Query {
13827            proc: self.proc.clone(),
13828            selection: query,
13829            graphql_client: self.graphql_client.clone(),
13830        }
13831    }
13832    /// Load a SDKConfig from its ID.
13833    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
13834        let mut query = self.selection.select("loadSDKConfigFromID");
13835        query = query.arg_lazy(
13836            "id",
13837            Box::new(move || {
13838                let id = id.clone();
13839                Box::pin(async move { id.into_id().await.unwrap().quote() })
13840            }),
13841        );
13842        SdkConfig {
13843            proc: self.proc.clone(),
13844            selection: query,
13845            graphql_client: self.graphql_client.clone(),
13846        }
13847    }
13848    /// Load a ScalarTypeDef from its ID.
13849    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
13850        let mut query = self.selection.select("loadScalarTypeDefFromID");
13851        query = query.arg_lazy(
13852            "id",
13853            Box::new(move || {
13854                let id = id.clone();
13855                Box::pin(async move { id.into_id().await.unwrap().quote() })
13856            }),
13857        );
13858        ScalarTypeDef {
13859            proc: self.proc.clone(),
13860            selection: query,
13861            graphql_client: self.graphql_client.clone(),
13862        }
13863    }
13864    /// Load a SearchResult from its ID.
13865    pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
13866        let mut query = self.selection.select("loadSearchResultFromID");
13867        query = query.arg_lazy(
13868            "id",
13869            Box::new(move || {
13870                let id = id.clone();
13871                Box::pin(async move { id.into_id().await.unwrap().quote() })
13872            }),
13873        );
13874        SearchResult {
13875            proc: self.proc.clone(),
13876            selection: query,
13877            graphql_client: self.graphql_client.clone(),
13878        }
13879    }
13880    /// Load a SearchSubmatch from its ID.
13881    pub fn load_search_submatch_from_id(
13882        &self,
13883        id: impl IntoID<SearchSubmatchId>,
13884    ) -> SearchSubmatch {
13885        let mut query = self.selection.select("loadSearchSubmatchFromID");
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        SearchSubmatch {
13894            proc: self.proc.clone(),
13895            selection: query,
13896            graphql_client: self.graphql_client.clone(),
13897        }
13898    }
13899    /// Load a Secret from its ID.
13900    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
13901        let mut query = self.selection.select("loadSecretFromID");
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        Secret {
13910            proc: self.proc.clone(),
13911            selection: query,
13912            graphql_client: self.graphql_client.clone(),
13913        }
13914    }
13915    /// Load a Service from its ID.
13916    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
13917        let mut query = self.selection.select("loadServiceFromID");
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        Service {
13926            proc: self.proc.clone(),
13927            selection: query,
13928            graphql_client: self.graphql_client.clone(),
13929        }
13930    }
13931    /// Load a Socket from its ID.
13932    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
13933        let mut query = self.selection.select("loadSocketFromID");
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        Socket {
13942            proc: self.proc.clone(),
13943            selection: query,
13944            graphql_client: self.graphql_client.clone(),
13945        }
13946    }
13947    /// Load a SourceMap from its ID.
13948    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
13949        let mut query = self.selection.select("loadSourceMapFromID");
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        SourceMap {
13958            proc: self.proc.clone(),
13959            selection: query,
13960            graphql_client: self.graphql_client.clone(),
13961        }
13962    }
13963    /// Load a Stat from its ID.
13964    pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
13965        let mut query = self.selection.select("loadStatFromID");
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        Stat {
13974            proc: self.proc.clone(),
13975            selection: query,
13976            graphql_client: self.graphql_client.clone(),
13977        }
13978    }
13979    /// Load a Terminal from its ID.
13980    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
13981        let mut query = self.selection.select("loadTerminalFromID");
13982        query = query.arg_lazy(
13983            "id",
13984            Box::new(move || {
13985                let id = id.clone();
13986                Box::pin(async move { id.into_id().await.unwrap().quote() })
13987            }),
13988        );
13989        Terminal {
13990            proc: self.proc.clone(),
13991            selection: query,
13992            graphql_client: self.graphql_client.clone(),
13993        }
13994    }
13995    /// Load a TypeDef from its ID.
13996    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
13997        let mut query = self.selection.select("loadTypeDefFromID");
13998        query = query.arg_lazy(
13999            "id",
14000            Box::new(move || {
14001                let id = id.clone();
14002                Box::pin(async move { id.into_id().await.unwrap().quote() })
14003            }),
14004        );
14005        TypeDef {
14006            proc: self.proc.clone(),
14007            selection: query,
14008            graphql_client: self.graphql_client.clone(),
14009        }
14010    }
14011    /// Load a Up from its ID.
14012    pub fn load_up_from_id(&self, id: impl IntoID<UpId>) -> Up {
14013        let mut query = self.selection.select("loadUpFromID");
14014        query = query.arg_lazy(
14015            "id",
14016            Box::new(move || {
14017                let id = id.clone();
14018                Box::pin(async move { id.into_id().await.unwrap().quote() })
14019            }),
14020        );
14021        Up {
14022            proc: self.proc.clone(),
14023            selection: query,
14024            graphql_client: self.graphql_client.clone(),
14025        }
14026    }
14027    /// Load a UpGroup from its ID.
14028    pub fn load_up_group_from_id(&self, id: impl IntoID<UpGroupId>) -> UpGroup {
14029        let mut query = self.selection.select("loadUpGroupFromID");
14030        query = query.arg_lazy(
14031            "id",
14032            Box::new(move || {
14033                let id = id.clone();
14034                Box::pin(async move { id.into_id().await.unwrap().quote() })
14035            }),
14036        );
14037        UpGroup {
14038            proc: self.proc.clone(),
14039            selection: query,
14040            graphql_client: self.graphql_client.clone(),
14041        }
14042    }
14043    /// Load a Workspace from its ID.
14044    pub fn load_workspace_from_id(&self, id: impl IntoID<WorkspaceId>) -> Workspace {
14045        let mut query = self.selection.select("loadWorkspaceFromID");
14046        query = query.arg_lazy(
14047            "id",
14048            Box::new(move || {
14049                let id = id.clone();
14050                Box::pin(async move { id.into_id().await.unwrap().quote() })
14051            }),
14052        );
14053        Workspace {
14054            proc: self.proc.clone(),
14055            selection: query,
14056            graphql_client: self.graphql_client.clone(),
14057        }
14058    }
14059    /// Create a new module.
14060    pub fn module(&self) -> Module {
14061        let query = self.selection.select("module");
14062        Module {
14063            proc: self.proc.clone(),
14064            selection: query,
14065            graphql_client: self.graphql_client.clone(),
14066        }
14067    }
14068    /// Create a new module source instance from a source ref string
14069    ///
14070    /// # Arguments
14071    ///
14072    /// * `ref_string` - The string ref representation of the module source
14073    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14074    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
14075        let mut query = self.selection.select("moduleSource");
14076        query = query.arg("refString", ref_string.into());
14077        ModuleSource {
14078            proc: self.proc.clone(),
14079            selection: query,
14080            graphql_client: self.graphql_client.clone(),
14081        }
14082    }
14083    /// Create a new module source instance from a source ref string
14084    ///
14085    /// # Arguments
14086    ///
14087    /// * `ref_string` - The string ref representation of the module source
14088    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14089    pub fn module_source_opts<'a>(
14090        &self,
14091        ref_string: impl Into<String>,
14092        opts: QueryModuleSourceOpts<'a>,
14093    ) -> ModuleSource {
14094        let mut query = self.selection.select("moduleSource");
14095        query = query.arg("refString", ref_string.into());
14096        if let Some(ref_pin) = opts.ref_pin {
14097            query = query.arg("refPin", ref_pin);
14098        }
14099        if let Some(disable_find_up) = opts.disable_find_up {
14100            query = query.arg("disableFindUp", disable_find_up);
14101        }
14102        if let Some(allow_not_exists) = opts.allow_not_exists {
14103            query = query.arg("allowNotExists", allow_not_exists);
14104        }
14105        if let Some(require_kind) = opts.require_kind {
14106            query = query.arg("requireKind", require_kind);
14107        }
14108        ModuleSource {
14109            proc: self.proc.clone(),
14110            selection: query,
14111            graphql_client: self.graphql_client.clone(),
14112        }
14113    }
14114    /// Creates a new secret.
14115    ///
14116    /// # Arguments
14117    ///
14118    /// * `uri` - The URI of the secret store
14119    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14120    pub fn secret(&self, uri: impl Into<String>) -> Secret {
14121        let mut query = self.selection.select("secret");
14122        query = query.arg("uri", uri.into());
14123        Secret {
14124            proc: self.proc.clone(),
14125            selection: query,
14126            graphql_client: self.graphql_client.clone(),
14127        }
14128    }
14129    /// Creates a new secret.
14130    ///
14131    /// # Arguments
14132    ///
14133    /// * `uri` - The URI of the secret store
14134    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14135    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
14136        let mut query = self.selection.select("secret");
14137        query = query.arg("uri", uri.into());
14138        if let Some(cache_key) = opts.cache_key {
14139            query = query.arg("cacheKey", cache_key);
14140        }
14141        Secret {
14142            proc: self.proc.clone(),
14143            selection: query,
14144            graphql_client: self.graphql_client.clone(),
14145        }
14146    }
14147    /// Sets a secret given a user defined name to its plaintext and returns the secret.
14148    /// The plaintext value is limited to a size of 128000 bytes.
14149    ///
14150    /// # Arguments
14151    ///
14152    /// * `name` - The user defined name for this secret
14153    /// * `plaintext` - The plaintext of the secret
14154    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
14155        let mut query = self.selection.select("setSecret");
14156        query = query.arg("name", name.into());
14157        query = query.arg("plaintext", plaintext.into());
14158        Secret {
14159            proc: self.proc.clone(),
14160            selection: query,
14161            graphql_client: self.graphql_client.clone(),
14162        }
14163    }
14164    /// Creates source map metadata.
14165    ///
14166    /// # Arguments
14167    ///
14168    /// * `filename` - The filename from the module source.
14169    /// * `line` - The line number within the filename.
14170    /// * `column` - The column number within the line.
14171    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
14172        let mut query = self.selection.select("sourceMap");
14173        query = query.arg("filename", filename.into());
14174        query = query.arg("line", line);
14175        query = query.arg("column", column);
14176        SourceMap {
14177            proc: self.proc.clone(),
14178            selection: query,
14179            graphql_client: self.graphql_client.clone(),
14180        }
14181    }
14182    /// Create a new TypeDef.
14183    pub fn type_def(&self) -> TypeDef {
14184        let query = self.selection.select("typeDef");
14185        TypeDef {
14186            proc: self.proc.clone(),
14187            selection: query,
14188            graphql_client: self.graphql_client.clone(),
14189        }
14190    }
14191    /// Get the current Dagger Engine version.
14192    pub async fn version(&self) -> Result<String, DaggerError> {
14193        let query = self.selection.select("version");
14194        query.execute(self.graphql_client.clone()).await
14195    }
14196}
14197#[derive(Clone)]
14198pub struct SdkConfig {
14199    pub proc: Option<Arc<DaggerSessionProc>>,
14200    pub selection: Selection,
14201    pub graphql_client: DynGraphQLClient,
14202}
14203impl SdkConfig {
14204    /// Whether to start the SDK runtime in debug mode with an interactive terminal.
14205    pub async fn debug(&self) -> Result<bool, DaggerError> {
14206        let query = self.selection.select("debug");
14207        query.execute(self.graphql_client.clone()).await
14208    }
14209    /// A unique identifier for this SDKConfig.
14210    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
14211        let query = self.selection.select("id");
14212        query.execute(self.graphql_client.clone()).await
14213    }
14214    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
14215    pub async fn source(&self) -> Result<String, DaggerError> {
14216        let query = self.selection.select("source");
14217        query.execute(self.graphql_client.clone()).await
14218    }
14219}
14220#[derive(Clone)]
14221pub struct ScalarTypeDef {
14222    pub proc: Option<Arc<DaggerSessionProc>>,
14223    pub selection: Selection,
14224    pub graphql_client: DynGraphQLClient,
14225}
14226impl ScalarTypeDef {
14227    /// A doc string for the scalar, if any.
14228    pub async fn description(&self) -> Result<String, DaggerError> {
14229        let query = self.selection.select("description");
14230        query.execute(self.graphql_client.clone()).await
14231    }
14232    /// A unique identifier for this ScalarTypeDef.
14233    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
14234        let query = self.selection.select("id");
14235        query.execute(self.graphql_client.clone()).await
14236    }
14237    /// The name of the scalar.
14238    pub async fn name(&self) -> Result<String, DaggerError> {
14239        let query = self.selection.select("name");
14240        query.execute(self.graphql_client.clone()).await
14241    }
14242    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
14243    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
14244        let query = self.selection.select("sourceModuleName");
14245        query.execute(self.graphql_client.clone()).await
14246    }
14247}
14248#[derive(Clone)]
14249pub struct SearchResult {
14250    pub proc: Option<Arc<DaggerSessionProc>>,
14251    pub selection: Selection,
14252    pub graphql_client: DynGraphQLClient,
14253}
14254impl SearchResult {
14255    /// The byte offset of this line within the file.
14256    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
14257        let query = self.selection.select("absoluteOffset");
14258        query.execute(self.graphql_client.clone()).await
14259    }
14260    /// The path to the file that matched.
14261    pub async fn file_path(&self) -> Result<String, DaggerError> {
14262        let query = self.selection.select("filePath");
14263        query.execute(self.graphql_client.clone()).await
14264    }
14265    /// A unique identifier for this SearchResult.
14266    pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
14267        let query = self.selection.select("id");
14268        query.execute(self.graphql_client.clone()).await
14269    }
14270    /// The first line that matched.
14271    pub async fn line_number(&self) -> Result<isize, DaggerError> {
14272        let query = self.selection.select("lineNumber");
14273        query.execute(self.graphql_client.clone()).await
14274    }
14275    /// The line content that matched.
14276    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
14277        let query = self.selection.select("matchedLines");
14278        query.execute(self.graphql_client.clone()).await
14279    }
14280    /// Sub-match positions and content within the matched lines.
14281    pub fn submatches(&self) -> Vec<SearchSubmatch> {
14282        let query = self.selection.select("submatches");
14283        vec![SearchSubmatch {
14284            proc: self.proc.clone(),
14285            selection: query,
14286            graphql_client: self.graphql_client.clone(),
14287        }]
14288    }
14289}
14290#[derive(Clone)]
14291pub struct SearchSubmatch {
14292    pub proc: Option<Arc<DaggerSessionProc>>,
14293    pub selection: Selection,
14294    pub graphql_client: DynGraphQLClient,
14295}
14296impl SearchSubmatch {
14297    /// The match's end offset within the matched lines.
14298    pub async fn end(&self) -> Result<isize, DaggerError> {
14299        let query = self.selection.select("end");
14300        query.execute(self.graphql_client.clone()).await
14301    }
14302    /// A unique identifier for this SearchSubmatch.
14303    pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
14304        let query = self.selection.select("id");
14305        query.execute(self.graphql_client.clone()).await
14306    }
14307    /// The match's start offset within the matched lines.
14308    pub async fn start(&self) -> Result<isize, DaggerError> {
14309        let query = self.selection.select("start");
14310        query.execute(self.graphql_client.clone()).await
14311    }
14312    /// The matched text.
14313    pub async fn text(&self) -> Result<String, DaggerError> {
14314        let query = self.selection.select("text");
14315        query.execute(self.graphql_client.clone()).await
14316    }
14317}
14318#[derive(Clone)]
14319pub struct Secret {
14320    pub proc: Option<Arc<DaggerSessionProc>>,
14321    pub selection: Selection,
14322    pub graphql_client: DynGraphQLClient,
14323}
14324impl Secret {
14325    /// A unique identifier for this Secret.
14326    pub async fn id(&self) -> Result<SecretId, DaggerError> {
14327        let query = self.selection.select("id");
14328        query.execute(self.graphql_client.clone()).await
14329    }
14330    /// The name of this secret.
14331    pub async fn name(&self) -> Result<String, DaggerError> {
14332        let query = self.selection.select("name");
14333        query.execute(self.graphql_client.clone()).await
14334    }
14335    /// The value of this secret.
14336    pub async fn plaintext(&self) -> Result<String, DaggerError> {
14337        let query = self.selection.select("plaintext");
14338        query.execute(self.graphql_client.clone()).await
14339    }
14340    /// The URI of this secret.
14341    pub async fn uri(&self) -> Result<String, DaggerError> {
14342        let query = self.selection.select("uri");
14343        query.execute(self.graphql_client.clone()).await
14344    }
14345}
14346#[derive(Clone)]
14347pub struct Service {
14348    pub proc: Option<Arc<DaggerSessionProc>>,
14349    pub selection: Selection,
14350    pub graphql_client: DynGraphQLClient,
14351}
14352#[derive(Builder, Debug, PartialEq)]
14353pub struct ServiceEndpointOpts<'a> {
14354    /// The exposed port number for the endpoint
14355    #[builder(setter(into, strip_option), default)]
14356    pub port: Option<isize>,
14357    /// Return a URL with the given scheme, eg. http for http://
14358    #[builder(setter(into, strip_option), default)]
14359    pub scheme: Option<&'a str>,
14360}
14361#[derive(Builder, Debug, PartialEq)]
14362pub struct ServiceStopOpts {
14363    /// Immediately kill the service without waiting for a graceful exit
14364    #[builder(setter(into, strip_option), default)]
14365    pub kill: Option<bool>,
14366}
14367#[derive(Builder, Debug, PartialEq)]
14368pub struct ServiceTerminalOpts<'a> {
14369    #[builder(setter(into, strip_option), default)]
14370    pub cmd: Option<Vec<&'a str>>,
14371}
14372#[derive(Builder, Debug, PartialEq)]
14373pub struct ServiceUpOpts {
14374    /// List of frontend/backend port mappings to forward.
14375    /// Frontend is the port accepting traffic on the host, backend is the service port.
14376    #[builder(setter(into, strip_option), default)]
14377    pub ports: Option<Vec<PortForward>>,
14378    /// Bind each tunnel port to a random port on the host.
14379    #[builder(setter(into, strip_option), default)]
14380    pub random: Option<bool>,
14381}
14382impl Service {
14383    /// Retrieves an endpoint that clients can use to reach this container.
14384    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
14385    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
14386    ///
14387    /// # Arguments
14388    ///
14389    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14390    pub async fn endpoint(&self) -> Result<String, DaggerError> {
14391        let query = self.selection.select("endpoint");
14392        query.execute(self.graphql_client.clone()).await
14393    }
14394    /// Retrieves an endpoint that clients can use to reach this container.
14395    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
14396    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
14397    ///
14398    /// # Arguments
14399    ///
14400    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14401    pub async fn endpoint_opts<'a>(
14402        &self,
14403        opts: ServiceEndpointOpts<'a>,
14404    ) -> Result<String, DaggerError> {
14405        let mut query = self.selection.select("endpoint");
14406        if let Some(port) = opts.port {
14407            query = query.arg("port", port);
14408        }
14409        if let Some(scheme) = opts.scheme {
14410            query = query.arg("scheme", scheme);
14411        }
14412        query.execute(self.graphql_client.clone()).await
14413    }
14414    /// Retrieves a hostname which can be used by clients to reach this container.
14415    pub async fn hostname(&self) -> Result<String, DaggerError> {
14416        let query = self.selection.select("hostname");
14417        query.execute(self.graphql_client.clone()).await
14418    }
14419    /// A unique identifier for this Service.
14420    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
14421        let query = self.selection.select("id");
14422        query.execute(self.graphql_client.clone()).await
14423    }
14424    /// Retrieves the list of ports provided by the service.
14425    pub fn ports(&self) -> Vec<Port> {
14426        let query = self.selection.select("ports");
14427        vec![Port {
14428            proc: self.proc.clone(),
14429            selection: query,
14430            graphql_client: self.graphql_client.clone(),
14431        }]
14432    }
14433    /// Start the service and wait for its health checks to succeed.
14434    /// Services bound to a Container do not need to be manually started.
14435    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
14436        let query = self.selection.select("start");
14437        query.execute(self.graphql_client.clone()).await
14438    }
14439    /// Stop the service.
14440    ///
14441    /// # Arguments
14442    ///
14443    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14444    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
14445        let query = self.selection.select("stop");
14446        query.execute(self.graphql_client.clone()).await
14447    }
14448    /// Stop the service.
14449    ///
14450    /// # Arguments
14451    ///
14452    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14453    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
14454        let mut query = self.selection.select("stop");
14455        if let Some(kill) = opts.kill {
14456            query = query.arg("kill", kill);
14457        }
14458        query.execute(self.graphql_client.clone()).await
14459    }
14460    /// Forces evaluation of the pipeline in the engine.
14461    pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
14462        let query = self.selection.select("sync");
14463        query.execute(self.graphql_client.clone()).await
14464    }
14465    ///
14466    /// # Arguments
14467    ///
14468    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14469    pub fn terminal(&self) -> Service {
14470        let query = self.selection.select("terminal");
14471        Service {
14472            proc: self.proc.clone(),
14473            selection: query,
14474            graphql_client: self.graphql_client.clone(),
14475        }
14476    }
14477    ///
14478    /// # Arguments
14479    ///
14480    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14481    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
14482        let mut query = self.selection.select("terminal");
14483        if let Some(cmd) = opts.cmd {
14484            query = query.arg("cmd", cmd);
14485        }
14486        Service {
14487            proc: self.proc.clone(),
14488            selection: query,
14489            graphql_client: self.graphql_client.clone(),
14490        }
14491    }
14492    /// Creates a tunnel that forwards traffic from the caller's network to this service.
14493    ///
14494    /// # Arguments
14495    ///
14496    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14497    pub async fn up(&self) -> Result<Void, DaggerError> {
14498        let query = self.selection.select("up");
14499        query.execute(self.graphql_client.clone()).await
14500    }
14501    /// Creates a tunnel that forwards traffic from the caller's network to this service.
14502    ///
14503    /// # Arguments
14504    ///
14505    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14506    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
14507        let mut query = self.selection.select("up");
14508        if let Some(ports) = opts.ports {
14509            query = query.arg("ports", ports);
14510        }
14511        if let Some(random) = opts.random {
14512            query = query.arg("random", random);
14513        }
14514        query.execute(self.graphql_client.clone()).await
14515    }
14516    /// Configures a hostname which can be used by clients within the session to reach this container.
14517    ///
14518    /// # Arguments
14519    ///
14520    /// * `hostname` - The hostname to use.
14521    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
14522        let mut query = self.selection.select("withHostname");
14523        query = query.arg("hostname", hostname.into());
14524        Service {
14525            proc: self.proc.clone(),
14526            selection: query,
14527            graphql_client: self.graphql_client.clone(),
14528        }
14529    }
14530}
14531#[derive(Clone)]
14532pub struct Socket {
14533    pub proc: Option<Arc<DaggerSessionProc>>,
14534    pub selection: Selection,
14535    pub graphql_client: DynGraphQLClient,
14536}
14537impl Socket {
14538    /// A unique identifier for this Socket.
14539    pub async fn id(&self) -> Result<SocketId, DaggerError> {
14540        let query = self.selection.select("id");
14541        query.execute(self.graphql_client.clone()).await
14542    }
14543}
14544#[derive(Clone)]
14545pub struct SourceMap {
14546    pub proc: Option<Arc<DaggerSessionProc>>,
14547    pub selection: Selection,
14548    pub graphql_client: DynGraphQLClient,
14549}
14550impl SourceMap {
14551    /// The column number within the line.
14552    pub async fn column(&self) -> Result<isize, DaggerError> {
14553        let query = self.selection.select("column");
14554        query.execute(self.graphql_client.clone()).await
14555    }
14556    /// The filename from the module source.
14557    pub async fn filename(&self) -> Result<String, DaggerError> {
14558        let query = self.selection.select("filename");
14559        query.execute(self.graphql_client.clone()).await
14560    }
14561    /// A unique identifier for this SourceMap.
14562    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
14563        let query = self.selection.select("id");
14564        query.execute(self.graphql_client.clone()).await
14565    }
14566    /// The line number within the filename.
14567    pub async fn line(&self) -> Result<isize, DaggerError> {
14568        let query = self.selection.select("line");
14569        query.execute(self.graphql_client.clone()).await
14570    }
14571    /// The module dependency this was declared in.
14572    pub async fn module(&self) -> Result<String, DaggerError> {
14573        let query = self.selection.select("module");
14574        query.execute(self.graphql_client.clone()).await
14575    }
14576    /// The URL to the file, if any. This can be used to link to the source map in the browser.
14577    pub async fn url(&self) -> Result<String, DaggerError> {
14578        let query = self.selection.select("url");
14579        query.execute(self.graphql_client.clone()).await
14580    }
14581}
14582#[derive(Clone)]
14583pub struct Stat {
14584    pub proc: Option<Arc<DaggerSessionProc>>,
14585    pub selection: Selection,
14586    pub graphql_client: DynGraphQLClient,
14587}
14588impl Stat {
14589    /// file type
14590    pub async fn file_type(&self) -> Result<FileType, DaggerError> {
14591        let query = self.selection.select("fileType");
14592        query.execute(self.graphql_client.clone()).await
14593    }
14594    /// A unique identifier for this Stat.
14595    pub async fn id(&self) -> Result<StatId, DaggerError> {
14596        let query = self.selection.select("id");
14597        query.execute(self.graphql_client.clone()).await
14598    }
14599    /// file name
14600    pub async fn name(&self) -> Result<String, DaggerError> {
14601        let query = self.selection.select("name");
14602        query.execute(self.graphql_client.clone()).await
14603    }
14604    /// permission bits
14605    pub async fn permissions(&self) -> Result<isize, DaggerError> {
14606        let query = self.selection.select("permissions");
14607        query.execute(self.graphql_client.clone()).await
14608    }
14609    /// file size
14610    pub async fn size(&self) -> Result<isize, DaggerError> {
14611        let query = self.selection.select("size");
14612        query.execute(self.graphql_client.clone()).await
14613    }
14614}
14615#[derive(Clone)]
14616pub struct Terminal {
14617    pub proc: Option<Arc<DaggerSessionProc>>,
14618    pub selection: Selection,
14619    pub graphql_client: DynGraphQLClient,
14620}
14621impl Terminal {
14622    /// A unique identifier for this Terminal.
14623    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
14624        let query = self.selection.select("id");
14625        query.execute(self.graphql_client.clone()).await
14626    }
14627    /// Forces evaluation of the pipeline in the engine.
14628    /// It doesn't run the default command if no exec has been set.
14629    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
14630        let query = self.selection.select("sync");
14631        query.execute(self.graphql_client.clone()).await
14632    }
14633}
14634#[derive(Clone)]
14635pub struct TypeDef {
14636    pub proc: Option<Arc<DaggerSessionProc>>,
14637    pub selection: Selection,
14638    pub graphql_client: DynGraphQLClient,
14639}
14640#[derive(Builder, Debug, PartialEq)]
14641pub struct TypeDefWithEnumOpts<'a> {
14642    /// A doc string for the enum, if any
14643    #[builder(setter(into, strip_option), default)]
14644    pub description: Option<&'a str>,
14645    /// The source map for the enum definition.
14646    #[builder(setter(into, strip_option), default)]
14647    pub source_map: Option<SourceMapId>,
14648}
14649#[derive(Builder, Debug, PartialEq)]
14650pub struct TypeDefWithEnumMemberOpts<'a> {
14651    /// If deprecated, the reason or migration path.
14652    #[builder(setter(into, strip_option), default)]
14653    pub deprecated: Option<&'a str>,
14654    /// A doc string for the member, if any
14655    #[builder(setter(into, strip_option), default)]
14656    pub description: Option<&'a str>,
14657    /// The source map for the enum member definition.
14658    #[builder(setter(into, strip_option), default)]
14659    pub source_map: Option<SourceMapId>,
14660    /// The value of the member in the enum
14661    #[builder(setter(into, strip_option), default)]
14662    pub value: Option<&'a str>,
14663}
14664#[derive(Builder, Debug, PartialEq)]
14665pub struct TypeDefWithEnumValueOpts<'a> {
14666    /// If deprecated, the reason or migration path.
14667    #[builder(setter(into, strip_option), default)]
14668    pub deprecated: Option<&'a str>,
14669    /// A doc string for the value, if any
14670    #[builder(setter(into, strip_option), default)]
14671    pub description: Option<&'a str>,
14672    /// The source map for the enum value definition.
14673    #[builder(setter(into, strip_option), default)]
14674    pub source_map: Option<SourceMapId>,
14675}
14676#[derive(Builder, Debug, PartialEq)]
14677pub struct TypeDefWithFieldOpts<'a> {
14678    /// If deprecated, the reason or migration path.
14679    #[builder(setter(into, strip_option), default)]
14680    pub deprecated: Option<&'a str>,
14681    /// A doc string for the field, if any
14682    #[builder(setter(into, strip_option), default)]
14683    pub description: Option<&'a str>,
14684    /// The source map for the field definition.
14685    #[builder(setter(into, strip_option), default)]
14686    pub source_map: Option<SourceMapId>,
14687}
14688#[derive(Builder, Debug, PartialEq)]
14689pub struct TypeDefWithInterfaceOpts<'a> {
14690    #[builder(setter(into, strip_option), default)]
14691    pub description: Option<&'a str>,
14692    #[builder(setter(into, strip_option), default)]
14693    pub source_map: Option<SourceMapId>,
14694}
14695#[derive(Builder, Debug, PartialEq)]
14696pub struct TypeDefWithObjectOpts<'a> {
14697    #[builder(setter(into, strip_option), default)]
14698    pub deprecated: Option<&'a str>,
14699    #[builder(setter(into, strip_option), default)]
14700    pub description: Option<&'a str>,
14701    #[builder(setter(into, strip_option), default)]
14702    pub source_map: Option<SourceMapId>,
14703}
14704#[derive(Builder, Debug, PartialEq)]
14705pub struct TypeDefWithScalarOpts<'a> {
14706    #[builder(setter(into, strip_option), default)]
14707    pub description: Option<&'a str>,
14708}
14709impl TypeDef {
14710    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
14711    pub fn as_enum(&self) -> EnumTypeDef {
14712        let query = self.selection.select("asEnum");
14713        EnumTypeDef {
14714            proc: self.proc.clone(),
14715            selection: query,
14716            graphql_client: self.graphql_client.clone(),
14717        }
14718    }
14719    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
14720    pub fn as_input(&self) -> InputTypeDef {
14721        let query = self.selection.select("asInput");
14722        InputTypeDef {
14723            proc: self.proc.clone(),
14724            selection: query,
14725            graphql_client: self.graphql_client.clone(),
14726        }
14727    }
14728    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
14729    pub fn as_interface(&self) -> InterfaceTypeDef {
14730        let query = self.selection.select("asInterface");
14731        InterfaceTypeDef {
14732            proc: self.proc.clone(),
14733            selection: query,
14734            graphql_client: self.graphql_client.clone(),
14735        }
14736    }
14737    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
14738    pub fn as_list(&self) -> ListTypeDef {
14739        let query = self.selection.select("asList");
14740        ListTypeDef {
14741            proc: self.proc.clone(),
14742            selection: query,
14743            graphql_client: self.graphql_client.clone(),
14744        }
14745    }
14746    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
14747    pub fn as_object(&self) -> ObjectTypeDef {
14748        let query = self.selection.select("asObject");
14749        ObjectTypeDef {
14750            proc: self.proc.clone(),
14751            selection: query,
14752            graphql_client: self.graphql_client.clone(),
14753        }
14754    }
14755    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
14756    pub fn as_scalar(&self) -> ScalarTypeDef {
14757        let query = self.selection.select("asScalar");
14758        ScalarTypeDef {
14759            proc: self.proc.clone(),
14760            selection: query,
14761            graphql_client: self.graphql_client.clone(),
14762        }
14763    }
14764    /// A unique identifier for this TypeDef.
14765    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
14766        let query = self.selection.select("id");
14767        query.execute(self.graphql_client.clone()).await
14768    }
14769    /// The kind of type this is (e.g. primitive, list, object).
14770    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
14771        let query = self.selection.select("kind");
14772        query.execute(self.graphql_client.clone()).await
14773    }
14774    /// Whether this type can be set to null. Defaults to false.
14775    pub async fn optional(&self) -> Result<bool, DaggerError> {
14776        let query = self.selection.select("optional");
14777        query.execute(self.graphql_client.clone()).await
14778    }
14779    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
14780    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
14781        let mut query = self.selection.select("withConstructor");
14782        query = query.arg_lazy(
14783            "function",
14784            Box::new(move || {
14785                let function = function.clone();
14786                Box::pin(async move { function.into_id().await.unwrap().quote() })
14787            }),
14788        );
14789        TypeDef {
14790            proc: self.proc.clone(),
14791            selection: query,
14792            graphql_client: self.graphql_client.clone(),
14793        }
14794    }
14795    /// Returns a TypeDef of kind Enum with the provided name.
14796    /// 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.
14797    ///
14798    /// # Arguments
14799    ///
14800    /// * `name` - The name of the enum
14801    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14802    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
14803        let mut query = self.selection.select("withEnum");
14804        query = query.arg("name", name.into());
14805        TypeDef {
14806            proc: self.proc.clone(),
14807            selection: query,
14808            graphql_client: self.graphql_client.clone(),
14809        }
14810    }
14811    /// Returns a TypeDef of kind Enum with the provided name.
14812    /// 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.
14813    ///
14814    /// # Arguments
14815    ///
14816    /// * `name` - The name of the enum
14817    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14818    pub fn with_enum_opts<'a>(
14819        &self,
14820        name: impl Into<String>,
14821        opts: TypeDefWithEnumOpts<'a>,
14822    ) -> TypeDef {
14823        let mut query = self.selection.select("withEnum");
14824        query = query.arg("name", name.into());
14825        if let Some(description) = opts.description {
14826            query = query.arg("description", description);
14827        }
14828        if let Some(source_map) = opts.source_map {
14829            query = query.arg("sourceMap", source_map);
14830        }
14831        TypeDef {
14832            proc: self.proc.clone(),
14833            selection: query,
14834            graphql_client: self.graphql_client.clone(),
14835        }
14836    }
14837    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14838    ///
14839    /// # Arguments
14840    ///
14841    /// * `name` - The name of the member in the enum
14842    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14843    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
14844        let mut query = self.selection.select("withEnumMember");
14845        query = query.arg("name", name.into());
14846        TypeDef {
14847            proc: self.proc.clone(),
14848            selection: query,
14849            graphql_client: self.graphql_client.clone(),
14850        }
14851    }
14852    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14853    ///
14854    /// # Arguments
14855    ///
14856    /// * `name` - The name of the member in the enum
14857    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14858    pub fn with_enum_member_opts<'a>(
14859        &self,
14860        name: impl Into<String>,
14861        opts: TypeDefWithEnumMemberOpts<'a>,
14862    ) -> TypeDef {
14863        let mut query = self.selection.select("withEnumMember");
14864        query = query.arg("name", name.into());
14865        if let Some(value) = opts.value {
14866            query = query.arg("value", value);
14867        }
14868        if let Some(description) = opts.description {
14869            query = query.arg("description", description);
14870        }
14871        if let Some(source_map) = opts.source_map {
14872            query = query.arg("sourceMap", source_map);
14873        }
14874        if let Some(deprecated) = opts.deprecated {
14875            query = query.arg("deprecated", deprecated);
14876        }
14877        TypeDef {
14878            proc: self.proc.clone(),
14879            selection: query,
14880            graphql_client: self.graphql_client.clone(),
14881        }
14882    }
14883    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14884    ///
14885    /// # Arguments
14886    ///
14887    /// * `value` - The name of the value in the enum
14888    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14889    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
14890        let mut query = self.selection.select("withEnumValue");
14891        query = query.arg("value", value.into());
14892        TypeDef {
14893            proc: self.proc.clone(),
14894            selection: query,
14895            graphql_client: self.graphql_client.clone(),
14896        }
14897    }
14898    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
14899    ///
14900    /// # Arguments
14901    ///
14902    /// * `value` - The name of the value in the enum
14903    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14904    pub fn with_enum_value_opts<'a>(
14905        &self,
14906        value: impl Into<String>,
14907        opts: TypeDefWithEnumValueOpts<'a>,
14908    ) -> TypeDef {
14909        let mut query = self.selection.select("withEnumValue");
14910        query = query.arg("value", value.into());
14911        if let Some(description) = opts.description {
14912            query = query.arg("description", description);
14913        }
14914        if let Some(source_map) = opts.source_map {
14915            query = query.arg("sourceMap", source_map);
14916        }
14917        if let Some(deprecated) = opts.deprecated {
14918            query = query.arg("deprecated", deprecated);
14919        }
14920        TypeDef {
14921            proc: self.proc.clone(),
14922            selection: query,
14923            graphql_client: self.graphql_client.clone(),
14924        }
14925    }
14926    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
14927    ///
14928    /// # Arguments
14929    ///
14930    /// * `name` - The name of the field in the object
14931    /// * `type_def` - The type of the field
14932    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14933    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
14934        let mut query = self.selection.select("withField");
14935        query = query.arg("name", name.into());
14936        query = query.arg_lazy(
14937            "typeDef",
14938            Box::new(move || {
14939                let type_def = type_def.clone();
14940                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
14941            }),
14942        );
14943        TypeDef {
14944            proc: self.proc.clone(),
14945            selection: query,
14946            graphql_client: self.graphql_client.clone(),
14947        }
14948    }
14949    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
14950    ///
14951    /// # Arguments
14952    ///
14953    /// * `name` - The name of the field in the object
14954    /// * `type_def` - The type of the field
14955    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
14956    pub fn with_field_opts<'a>(
14957        &self,
14958        name: impl Into<String>,
14959        type_def: impl IntoID<TypeDefId>,
14960        opts: TypeDefWithFieldOpts<'a>,
14961    ) -> TypeDef {
14962        let mut query = self.selection.select("withField");
14963        query = query.arg("name", name.into());
14964        query = query.arg_lazy(
14965            "typeDef",
14966            Box::new(move || {
14967                let type_def = type_def.clone();
14968                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
14969            }),
14970        );
14971        if let Some(description) = opts.description {
14972            query = query.arg("description", description);
14973        }
14974        if let Some(source_map) = opts.source_map {
14975            query = query.arg("sourceMap", source_map);
14976        }
14977        if let Some(deprecated) = opts.deprecated {
14978            query = query.arg("deprecated", deprecated);
14979        }
14980        TypeDef {
14981            proc: self.proc.clone(),
14982            selection: query,
14983            graphql_client: self.graphql_client.clone(),
14984        }
14985    }
14986    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
14987    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
14988        let mut query = self.selection.select("withFunction");
14989        query = query.arg_lazy(
14990            "function",
14991            Box::new(move || {
14992                let function = function.clone();
14993                Box::pin(async move { function.into_id().await.unwrap().quote() })
14994            }),
14995        );
14996        TypeDef {
14997            proc: self.proc.clone(),
14998            selection: query,
14999            graphql_client: self.graphql_client.clone(),
15000        }
15001    }
15002    /// Returns a TypeDef of kind Interface with the provided name.
15003    ///
15004    /// # Arguments
15005    ///
15006    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15007    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
15008        let mut query = self.selection.select("withInterface");
15009        query = query.arg("name", name.into());
15010        TypeDef {
15011            proc: self.proc.clone(),
15012            selection: query,
15013            graphql_client: self.graphql_client.clone(),
15014        }
15015    }
15016    /// Returns a TypeDef of kind Interface with the provided name.
15017    ///
15018    /// # Arguments
15019    ///
15020    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15021    pub fn with_interface_opts<'a>(
15022        &self,
15023        name: impl Into<String>,
15024        opts: TypeDefWithInterfaceOpts<'a>,
15025    ) -> TypeDef {
15026        let mut query = self.selection.select("withInterface");
15027        query = query.arg("name", name.into());
15028        if let Some(description) = opts.description {
15029            query = query.arg("description", description);
15030        }
15031        if let Some(source_map) = opts.source_map {
15032            query = query.arg("sourceMap", source_map);
15033        }
15034        TypeDef {
15035            proc: self.proc.clone(),
15036            selection: query,
15037            graphql_client: self.graphql_client.clone(),
15038        }
15039    }
15040    /// Sets the kind of the type.
15041    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
15042        let mut query = self.selection.select("withKind");
15043        query = query.arg("kind", kind);
15044        TypeDef {
15045            proc: self.proc.clone(),
15046            selection: query,
15047            graphql_client: self.graphql_client.clone(),
15048        }
15049    }
15050    /// Returns a TypeDef of kind List with the provided type for its elements.
15051    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
15052        let mut query = self.selection.select("withListOf");
15053        query = query.arg_lazy(
15054            "elementType",
15055            Box::new(move || {
15056                let element_type = element_type.clone();
15057                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
15058            }),
15059        );
15060        TypeDef {
15061            proc: self.proc.clone(),
15062            selection: query,
15063            graphql_client: self.graphql_client.clone(),
15064        }
15065    }
15066    /// Returns a TypeDef of kind Object with the provided name.
15067    /// 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.
15068    ///
15069    /// # Arguments
15070    ///
15071    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15072    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
15073        let mut query = self.selection.select("withObject");
15074        query = query.arg("name", name.into());
15075        TypeDef {
15076            proc: self.proc.clone(),
15077            selection: query,
15078            graphql_client: self.graphql_client.clone(),
15079        }
15080    }
15081    /// Returns a TypeDef of kind Object with the provided name.
15082    /// 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.
15083    ///
15084    /// # Arguments
15085    ///
15086    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15087    pub fn with_object_opts<'a>(
15088        &self,
15089        name: impl Into<String>,
15090        opts: TypeDefWithObjectOpts<'a>,
15091    ) -> TypeDef {
15092        let mut query = self.selection.select("withObject");
15093        query = query.arg("name", name.into());
15094        if let Some(description) = opts.description {
15095            query = query.arg("description", description);
15096        }
15097        if let Some(source_map) = opts.source_map {
15098            query = query.arg("sourceMap", source_map);
15099        }
15100        if let Some(deprecated) = opts.deprecated {
15101            query = query.arg("deprecated", deprecated);
15102        }
15103        TypeDef {
15104            proc: self.proc.clone(),
15105            selection: query,
15106            graphql_client: self.graphql_client.clone(),
15107        }
15108    }
15109    /// Sets whether this type can be set to null.
15110    pub fn with_optional(&self, optional: bool) -> TypeDef {
15111        let mut query = self.selection.select("withOptional");
15112        query = query.arg("optional", optional);
15113        TypeDef {
15114            proc: self.proc.clone(),
15115            selection: query,
15116            graphql_client: self.graphql_client.clone(),
15117        }
15118    }
15119    /// Returns a TypeDef of kind Scalar with the provided name.
15120    ///
15121    /// # Arguments
15122    ///
15123    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15124    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
15125        let mut query = self.selection.select("withScalar");
15126        query = query.arg("name", name.into());
15127        TypeDef {
15128            proc: self.proc.clone(),
15129            selection: query,
15130            graphql_client: self.graphql_client.clone(),
15131        }
15132    }
15133    /// Returns a TypeDef of kind Scalar with the provided name.
15134    ///
15135    /// # Arguments
15136    ///
15137    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15138    pub fn with_scalar_opts<'a>(
15139        &self,
15140        name: impl Into<String>,
15141        opts: TypeDefWithScalarOpts<'a>,
15142    ) -> TypeDef {
15143        let mut query = self.selection.select("withScalar");
15144        query = query.arg("name", name.into());
15145        if let Some(description) = opts.description {
15146            query = query.arg("description", description);
15147        }
15148        TypeDef {
15149            proc: self.proc.clone(),
15150            selection: query,
15151            graphql_client: self.graphql_client.clone(),
15152        }
15153    }
15154}
15155#[derive(Clone)]
15156pub struct Up {
15157    pub proc: Option<Arc<DaggerSessionProc>>,
15158    pub selection: Selection,
15159    pub graphql_client: DynGraphQLClient,
15160}
15161impl Up {
15162    /// The description of the service
15163    pub async fn description(&self) -> Result<String, DaggerError> {
15164        let query = self.selection.select("description");
15165        query.execute(self.graphql_client.clone()).await
15166    }
15167    /// A unique identifier for this Up.
15168    pub async fn id(&self) -> Result<UpId, DaggerError> {
15169        let query = self.selection.select("id");
15170        query.execute(self.graphql_client.clone()).await
15171    }
15172    /// Return the fully qualified name of the service
15173    pub async fn name(&self) -> Result<String, DaggerError> {
15174        let query = self.selection.select("name");
15175        query.execute(self.graphql_client.clone()).await
15176    }
15177    /// The original module in which the service has been defined
15178    pub fn original_module(&self) -> Module {
15179        let query = self.selection.select("originalModule");
15180        Module {
15181            proc: self.proc.clone(),
15182            selection: query,
15183            graphql_client: self.graphql_client.clone(),
15184        }
15185    }
15186    /// The path of the service within its module
15187    pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
15188        let query = self.selection.select("path");
15189        query.execute(self.graphql_client.clone()).await
15190    }
15191    /// Execute the service function
15192    pub fn run(&self) -> Up {
15193        let query = self.selection.select("run");
15194        Up {
15195            proc: self.proc.clone(),
15196            selection: query,
15197            graphql_client: self.graphql_client.clone(),
15198        }
15199    }
15200}
15201#[derive(Clone)]
15202pub struct UpGroup {
15203    pub proc: Option<Arc<DaggerSessionProc>>,
15204    pub selection: Selection,
15205    pub graphql_client: DynGraphQLClient,
15206}
15207impl UpGroup {
15208    /// A unique identifier for this UpGroup.
15209    pub async fn id(&self) -> Result<UpGroupId, DaggerError> {
15210        let query = self.selection.select("id");
15211        query.execute(self.graphql_client.clone()).await
15212    }
15213    /// Return a list of individual services and their details
15214    pub fn list(&self) -> Vec<Up> {
15215        let query = self.selection.select("list");
15216        vec![Up {
15217            proc: self.proc.clone(),
15218            selection: query,
15219            graphql_client: self.graphql_client.clone(),
15220        }]
15221    }
15222    /// Execute all selected service functions
15223    pub fn run(&self) -> UpGroup {
15224        let query = self.selection.select("run");
15225        UpGroup {
15226            proc: self.proc.clone(),
15227            selection: query,
15228            graphql_client: self.graphql_client.clone(),
15229        }
15230    }
15231}
15232#[derive(Clone)]
15233pub struct Workspace {
15234    pub proc: Option<Arc<DaggerSessionProc>>,
15235    pub selection: Selection,
15236    pub graphql_client: DynGraphQLClient,
15237}
15238#[derive(Builder, Debug, PartialEq)]
15239pub struct WorkspaceChecksOpts<'a> {
15240    /// Only include checks matching the specified patterns
15241    #[builder(setter(into, strip_option), default)]
15242    pub include: Option<Vec<&'a str>>,
15243}
15244#[derive(Builder, Debug, PartialEq)]
15245pub struct WorkspaceDirectoryOpts<'a> {
15246    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
15247    #[builder(setter(into, strip_option), default)]
15248    pub exclude: Option<Vec<&'a str>>,
15249    /// Apply .gitignore filter rules inside the directory.
15250    #[builder(setter(into, strip_option), default)]
15251    pub gitignore: Option<bool>,
15252    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
15253    #[builder(setter(into, strip_option), default)]
15254    pub include: Option<Vec<&'a str>>,
15255}
15256#[derive(Builder, Debug, PartialEq)]
15257pub struct WorkspaceFindUpOpts<'a> {
15258    /// Path to start the search from. Relative paths resolve from the workspace directory; absolute paths resolve from the workspace boundary.
15259    #[builder(setter(into, strip_option), default)]
15260    pub from: Option<&'a str>,
15261}
15262#[derive(Builder, Debug, PartialEq)]
15263pub struct WorkspaceGeneratorsOpts<'a> {
15264    /// Only include generators matching the specified patterns
15265    #[builder(setter(into, strip_option), default)]
15266    pub include: Option<Vec<&'a str>>,
15267}
15268#[derive(Builder, Debug, PartialEq)]
15269pub struct WorkspaceServicesOpts<'a> {
15270    /// Only include services matching the specified patterns
15271    #[builder(setter(into, strip_option), default)]
15272    pub include: Option<Vec<&'a str>>,
15273}
15274impl Workspace {
15275    /// Canonical Dagger address of the workspace directory.
15276    pub async fn address(&self) -> Result<String, DaggerError> {
15277        let query = self.selection.select("address");
15278        query.execute(self.graphql_client.clone()).await
15279    }
15280    /// Return all checks from modules loaded in the workspace.
15281    ///
15282    /// # Arguments
15283    ///
15284    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15285    pub fn checks(&self) -> CheckGroup {
15286        let query = self.selection.select("checks");
15287        CheckGroup {
15288            proc: self.proc.clone(),
15289            selection: query,
15290            graphql_client: self.graphql_client.clone(),
15291        }
15292    }
15293    /// Return all checks from modules loaded in the workspace.
15294    ///
15295    /// # Arguments
15296    ///
15297    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15298    pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
15299        let mut query = self.selection.select("checks");
15300        if let Some(include) = opts.include {
15301            query = query.arg("include", include);
15302        }
15303        CheckGroup {
15304            proc: self.proc.clone(),
15305            selection: query,
15306            graphql_client: self.graphql_client.clone(),
15307        }
15308    }
15309    /// The client ID that owns this workspace's host filesystem.
15310    pub async fn client_id(&self) -> Result<String, DaggerError> {
15311        let query = self.selection.select("clientId");
15312        query.execute(self.graphql_client.clone()).await
15313    }
15314    /// Path to config.toml relative to the workspace boundary (empty if not initialized).
15315    pub async fn config_path(&self) -> Result<String, DaggerError> {
15316        let query = self.selection.select("configPath");
15317        query.execute(self.graphql_client.clone()).await
15318    }
15319    /// Returns a Directory from the workspace.
15320    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
15321    ///
15322    /// # Arguments
15323    ///
15324    /// * `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.
15325    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15326    pub fn directory(&self, path: impl Into<String>) -> Directory {
15327        let mut query = self.selection.select("directory");
15328        query = query.arg("path", path.into());
15329        Directory {
15330            proc: self.proc.clone(),
15331            selection: query,
15332            graphql_client: self.graphql_client.clone(),
15333        }
15334    }
15335    /// Returns a Directory from the workspace.
15336    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
15337    ///
15338    /// # Arguments
15339    ///
15340    /// * `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.
15341    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15342    pub fn directory_opts<'a>(
15343        &self,
15344        path: impl Into<String>,
15345        opts: WorkspaceDirectoryOpts<'a>,
15346    ) -> Directory {
15347        let mut query = self.selection.select("directory");
15348        query = query.arg("path", path.into());
15349        if let Some(exclude) = opts.exclude {
15350            query = query.arg("exclude", exclude);
15351        }
15352        if let Some(include) = opts.include {
15353            query = query.arg("include", include);
15354        }
15355        if let Some(gitignore) = opts.gitignore {
15356            query = query.arg("gitignore", gitignore);
15357        }
15358        Directory {
15359            proc: self.proc.clone(),
15360            selection: query,
15361            graphql_client: self.graphql_client.clone(),
15362        }
15363    }
15364    /// Returns a File from the workspace.
15365    /// Relative paths resolve from the workspace directory. Absolute paths resolve from the workspace boundary.
15366    ///
15367    /// # Arguments
15368    ///
15369    /// * `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.
15370    pub fn file(&self, path: impl Into<String>) -> File {
15371        let mut query = self.selection.select("file");
15372        query = query.arg("path", path.into());
15373        File {
15374            proc: self.proc.clone(),
15375            selection: query,
15376            graphql_client: self.graphql_client.clone(),
15377        }
15378    }
15379    /// Search for a file or directory by walking up from the start path within the workspace.
15380    /// Returns the absolute workspace path if found, or null if not found.
15381    /// Relative start paths resolve from the workspace directory.
15382    /// The search stops at the workspace boundary and will not traverse above it.
15383    ///
15384    /// # Arguments
15385    ///
15386    /// * `name` - The name of the file or directory to search for.
15387    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15388    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
15389        let mut query = self.selection.select("findUp");
15390        query = query.arg("name", name.into());
15391        query.execute(self.graphql_client.clone()).await
15392    }
15393    /// Search for a file or directory by walking up from the start path within the workspace.
15394    /// Returns the absolute workspace path if found, or null if not found.
15395    /// Relative start paths resolve from the workspace directory.
15396    /// The search stops at the workspace boundary and will not traverse above it.
15397    ///
15398    /// # Arguments
15399    ///
15400    /// * `name` - The name of the file or directory to search for.
15401    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15402    pub async fn find_up_opts<'a>(
15403        &self,
15404        name: impl Into<String>,
15405        opts: WorkspaceFindUpOpts<'a>,
15406    ) -> Result<String, DaggerError> {
15407        let mut query = self.selection.select("findUp");
15408        query = query.arg("name", name.into());
15409        if let Some(from) = opts.from {
15410            query = query.arg("from", from);
15411        }
15412        query.execute(self.graphql_client.clone()).await
15413    }
15414    /// Return all generators from modules loaded in the workspace.
15415    ///
15416    /// # Arguments
15417    ///
15418    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15419    pub fn generators(&self) -> GeneratorGroup {
15420        let query = self.selection.select("generators");
15421        GeneratorGroup {
15422            proc: self.proc.clone(),
15423            selection: query,
15424            graphql_client: self.graphql_client.clone(),
15425        }
15426    }
15427    /// Return all generators from modules loaded in the workspace.
15428    ///
15429    /// # Arguments
15430    ///
15431    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15432    pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
15433        let mut query = self.selection.select("generators");
15434        if let Some(include) = opts.include {
15435            query = query.arg("include", include);
15436        }
15437        GeneratorGroup {
15438            proc: self.proc.clone(),
15439            selection: query,
15440            graphql_client: self.graphql_client.clone(),
15441        }
15442    }
15443    /// Whether a config.toml file exists in the workspace.
15444    pub async fn has_config(&self) -> Result<bool, DaggerError> {
15445        let query = self.selection.select("hasConfig");
15446        query.execute(self.graphql_client.clone()).await
15447    }
15448    /// A unique identifier for this Workspace.
15449    pub async fn id(&self) -> Result<WorkspaceId, DaggerError> {
15450        let query = self.selection.select("id");
15451        query.execute(self.graphql_client.clone()).await
15452    }
15453    /// Whether .dagger/config.toml exists.
15454    pub async fn initialized(&self) -> Result<bool, DaggerError> {
15455        let query = self.selection.select("initialized");
15456        query.execute(self.graphql_client.clone()).await
15457    }
15458    /// Workspace directory path relative to the workspace boundary.
15459    pub async fn path(&self) -> Result<String, DaggerError> {
15460        let query = self.selection.select("path");
15461        query.execute(self.graphql_client.clone()).await
15462    }
15463    /// Return all services from modules loaded in the workspace.
15464    ///
15465    /// # Arguments
15466    ///
15467    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15468    pub fn services(&self) -> UpGroup {
15469        let query = self.selection.select("services");
15470        UpGroup {
15471            proc: self.proc.clone(),
15472            selection: query,
15473            graphql_client: self.graphql_client.clone(),
15474        }
15475    }
15476    /// Return all services from modules loaded in the workspace.
15477    ///
15478    /// # Arguments
15479    ///
15480    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
15481    pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
15482        let mut query = self.selection.select("services");
15483        if let Some(include) = opts.include {
15484            query = query.arg("include", include);
15485        }
15486        UpGroup {
15487            proc: self.proc.clone(),
15488            selection: query,
15489            graphql_client: self.graphql_client.clone(),
15490        }
15491    }
15492}
15493#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
15494pub enum CacheSharingMode {
15495    #[serde(rename = "LOCKED")]
15496    Locked,
15497    #[serde(rename = "PRIVATE")]
15498    Private,
15499    #[serde(rename = "SHARED")]
15500    Shared,
15501}
15502#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
15503pub enum ChangesetMergeConflict {
15504    #[serde(rename = "FAIL")]
15505    Fail,
15506    #[serde(rename = "FAIL_EARLY")]
15507    FailEarly,
15508    #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
15509    LeaveConflictMarkers,
15510    #[serde(rename = "PREFER_OURS")]
15511    PreferOurs,
15512    #[serde(rename = "PREFER_THEIRS")]
15513    PreferTheirs,
15514}
15515#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
15516pub enum ChangesetsMergeConflict {
15517    #[serde(rename = "FAIL")]
15518    Fail,
15519    #[serde(rename = "FAIL_EARLY")]
15520    FailEarly,
15521}
15522#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
15523pub enum DiffStatKind {
15524    #[serde(rename = "ADDED")]
15525    Added,
15526    #[serde(rename = "MODIFIED")]
15527    Modified,
15528    #[serde(rename = "REMOVED")]
15529    Removed,
15530    #[serde(rename = "RENAMED")]
15531    Renamed,
15532}
15533#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
15534pub enum ExistsType {
15535    #[serde(rename = "DIRECTORY_TYPE")]
15536    DirectoryType,
15537    #[serde(rename = "REGULAR_TYPE")]
15538    RegularType,
15539    #[serde(rename = "SYMLINK_TYPE")]
15540    SymlinkType,
15541}
15542#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
15543pub enum FileType {
15544    #[serde(rename = "DIRECTORY")]
15545    Directory,
15546    #[serde(rename = "DIRECTORY_TYPE")]
15547    DirectoryType,
15548    #[serde(rename = "REGULAR")]
15549    Regular,
15550    #[serde(rename = "REGULAR_TYPE")]
15551    RegularType,
15552    #[serde(rename = "SYMLINK")]
15553    Symlink,
15554    #[serde(rename = "SYMLINK_TYPE")]
15555    SymlinkType,
15556    #[serde(rename = "UNKNOWN")]
15557    Unknown,
15558}
15559#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
15560pub enum FunctionCachePolicy {
15561    #[serde(rename = "Default")]
15562    Default,
15563    #[serde(rename = "Never")]
15564    Never,
15565    #[serde(rename = "PerSession")]
15566    PerSession,
15567}
15568#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
15569pub enum ImageLayerCompression {
15570    #[serde(rename = "EStarGZ")]
15571    EStarGz,
15572    #[serde(rename = "ESTARGZ")]
15573    Estargz,
15574    #[serde(rename = "Gzip")]
15575    Gzip,
15576    #[serde(rename = "Uncompressed")]
15577    Uncompressed,
15578    #[serde(rename = "Zstd")]
15579    Zstd,
15580}
15581#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
15582pub enum ImageMediaTypes {
15583    #[serde(rename = "DOCKER")]
15584    Docker,
15585    #[serde(rename = "DockerMediaTypes")]
15586    DockerMediaTypes,
15587    #[serde(rename = "OCI")]
15588    Oci,
15589    #[serde(rename = "OCIMediaTypes")]
15590    OciMediaTypes,
15591}
15592#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
15593pub enum ModuleSourceExperimentalFeature {
15594    #[serde(rename = "SELF_CALLS")]
15595    SelfCalls,
15596}
15597#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
15598pub enum ModuleSourceKind {
15599    #[serde(rename = "DIR")]
15600    Dir,
15601    #[serde(rename = "DIR_SOURCE")]
15602    DirSource,
15603    #[serde(rename = "GIT")]
15604    Git,
15605    #[serde(rename = "GIT_SOURCE")]
15606    GitSource,
15607    #[serde(rename = "LOCAL")]
15608    Local,
15609    #[serde(rename = "LOCAL_SOURCE")]
15610    LocalSource,
15611}
15612#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
15613pub enum NetworkProtocol {
15614    #[serde(rename = "TCP")]
15615    Tcp,
15616    #[serde(rename = "UDP")]
15617    Udp,
15618}
15619#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
15620pub enum ReturnType {
15621    #[serde(rename = "ANY")]
15622    Any,
15623    #[serde(rename = "FAILURE")]
15624    Failure,
15625    #[serde(rename = "SUCCESS")]
15626    Success,
15627}
15628#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
15629pub enum TypeDefKind {
15630    #[serde(rename = "BOOLEAN")]
15631    Boolean,
15632    #[serde(rename = "BOOLEAN_KIND")]
15633    BooleanKind,
15634    #[serde(rename = "ENUM")]
15635    Enum,
15636    #[serde(rename = "ENUM_KIND")]
15637    EnumKind,
15638    #[serde(rename = "FLOAT")]
15639    Float,
15640    #[serde(rename = "FLOAT_KIND")]
15641    FloatKind,
15642    #[serde(rename = "INPUT")]
15643    Input,
15644    #[serde(rename = "INPUT_KIND")]
15645    InputKind,
15646    #[serde(rename = "INTEGER")]
15647    Integer,
15648    #[serde(rename = "INTEGER_KIND")]
15649    IntegerKind,
15650    #[serde(rename = "INTERFACE")]
15651    Interface,
15652    #[serde(rename = "INTERFACE_KIND")]
15653    InterfaceKind,
15654    #[serde(rename = "LIST")]
15655    List,
15656    #[serde(rename = "LIST_KIND")]
15657    ListKind,
15658    #[serde(rename = "OBJECT")]
15659    Object,
15660    #[serde(rename = "OBJECT_KIND")]
15661    ObjectKind,
15662    #[serde(rename = "SCALAR")]
15663    Scalar,
15664    #[serde(rename = "SCALAR_KIND")]
15665    ScalarKind,
15666    #[serde(rename = "STRING")]
15667    String,
15668    #[serde(rename = "STRING_KIND")]
15669    StringKind,
15670    #[serde(rename = "VOID")]
15671    Void,
15672    #[serde(rename = "VOID_KIND")]
15673    VoidKind,
15674}