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 CloudId(pub String);
150impl From<&str> for CloudId {
151    fn from(value: &str) -> Self {
152        Self(value.to_string())
153    }
154}
155impl From<String> for CloudId {
156    fn from(value: String) -> Self {
157        Self(value)
158    }
159}
160impl IntoID<CloudId> for Cloud {
161    fn into_id(
162        self,
163    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
164    {
165        Box::pin(async move { self.id().await })
166    }
167}
168impl IntoID<CloudId> for CloudId {
169    fn into_id(
170        self,
171    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
172    {
173        Box::pin(async move { Ok::<CloudId, DaggerError>(self) })
174    }
175}
176impl CloudId {
177    fn quote(&self) -> String {
178        format!("\"{}\"", self.0.clone())
179    }
180}
181#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
182pub struct ContainerId(pub String);
183impl From<&str> for ContainerId {
184    fn from(value: &str) -> Self {
185        Self(value.to_string())
186    }
187}
188impl From<String> for ContainerId {
189    fn from(value: String) -> Self {
190        Self(value)
191    }
192}
193impl IntoID<ContainerId> for Container {
194    fn into_id(
195        self,
196    ) -> std::pin::Pin<
197        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
198    > {
199        Box::pin(async move { self.id().await })
200    }
201}
202impl IntoID<ContainerId> for ContainerId {
203    fn into_id(
204        self,
205    ) -> std::pin::Pin<
206        Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
207    > {
208        Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
209    }
210}
211impl ContainerId {
212    fn quote(&self) -> String {
213        format!("\"{}\"", self.0.clone())
214    }
215}
216#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
217pub struct CurrentModuleId(pub String);
218impl From<&str> for CurrentModuleId {
219    fn from(value: &str) -> Self {
220        Self(value.to_string())
221    }
222}
223impl From<String> for CurrentModuleId {
224    fn from(value: String) -> Self {
225        Self(value)
226    }
227}
228impl IntoID<CurrentModuleId> for CurrentModule {
229    fn into_id(
230        self,
231    ) -> std::pin::Pin<
232        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
233    > {
234        Box::pin(async move { self.id().await })
235    }
236}
237impl IntoID<CurrentModuleId> for CurrentModuleId {
238    fn into_id(
239        self,
240    ) -> std::pin::Pin<
241        Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
242    > {
243        Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
244    }
245}
246impl CurrentModuleId {
247    fn quote(&self) -> String {
248        format!("\"{}\"", self.0.clone())
249    }
250}
251#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
252pub struct DirectoryId(pub String);
253impl From<&str> for DirectoryId {
254    fn from(value: &str) -> Self {
255        Self(value.to_string())
256    }
257}
258impl From<String> for DirectoryId {
259    fn from(value: String) -> Self {
260        Self(value)
261    }
262}
263impl IntoID<DirectoryId> for Directory {
264    fn into_id(
265        self,
266    ) -> std::pin::Pin<
267        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
268    > {
269        Box::pin(async move { self.id().await })
270    }
271}
272impl IntoID<DirectoryId> for DirectoryId {
273    fn into_id(
274        self,
275    ) -> std::pin::Pin<
276        Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
277    > {
278        Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
279    }
280}
281impl DirectoryId {
282    fn quote(&self) -> String {
283        format!("\"{}\"", self.0.clone())
284    }
285}
286#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
287pub struct EngineCacheEntryId(pub String);
288impl From<&str> for EngineCacheEntryId {
289    fn from(value: &str) -> Self {
290        Self(value.to_string())
291    }
292}
293impl From<String> for EngineCacheEntryId {
294    fn from(value: String) -> Self {
295        Self(value)
296    }
297}
298impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
299    fn into_id(
300        self,
301    ) -> std::pin::Pin<
302        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
303    > {
304        Box::pin(async move { self.id().await })
305    }
306}
307impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
308    fn into_id(
309        self,
310    ) -> std::pin::Pin<
311        Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
312    > {
313        Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
314    }
315}
316impl EngineCacheEntryId {
317    fn quote(&self) -> String {
318        format!("\"{}\"", self.0.clone())
319    }
320}
321#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
322pub struct EngineCacheEntrySetId(pub String);
323impl From<&str> for EngineCacheEntrySetId {
324    fn from(value: &str) -> Self {
325        Self(value.to_string())
326    }
327}
328impl From<String> for EngineCacheEntrySetId {
329    fn from(value: String) -> Self {
330        Self(value)
331    }
332}
333impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
334    fn into_id(
335        self,
336    ) -> std::pin::Pin<
337        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
338    > {
339        Box::pin(async move { self.id().await })
340    }
341}
342impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
343    fn into_id(
344        self,
345    ) -> std::pin::Pin<
346        Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
347    > {
348        Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
349    }
350}
351impl EngineCacheEntrySetId {
352    fn quote(&self) -> String {
353        format!("\"{}\"", self.0.clone())
354    }
355}
356#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
357pub struct EngineCacheId(pub String);
358impl From<&str> for EngineCacheId {
359    fn from(value: &str) -> Self {
360        Self(value.to_string())
361    }
362}
363impl From<String> for EngineCacheId {
364    fn from(value: String) -> Self {
365        Self(value)
366    }
367}
368impl IntoID<EngineCacheId> for EngineCache {
369    fn into_id(
370        self,
371    ) -> std::pin::Pin<
372        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
373    > {
374        Box::pin(async move { self.id().await })
375    }
376}
377impl IntoID<EngineCacheId> for EngineCacheId {
378    fn into_id(
379        self,
380    ) -> std::pin::Pin<
381        Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
382    > {
383        Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
384    }
385}
386impl EngineCacheId {
387    fn quote(&self) -> String {
388        format!("\"{}\"", self.0.clone())
389    }
390}
391#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
392pub struct EngineId(pub String);
393impl From<&str> for EngineId {
394    fn from(value: &str) -> Self {
395        Self(value.to_string())
396    }
397}
398impl From<String> for EngineId {
399    fn from(value: String) -> Self {
400        Self(value)
401    }
402}
403impl IntoID<EngineId> for Engine {
404    fn into_id(
405        self,
406    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
407    {
408        Box::pin(async move { self.id().await })
409    }
410}
411impl IntoID<EngineId> for EngineId {
412    fn into_id(
413        self,
414    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
415    {
416        Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
417    }
418}
419impl EngineId {
420    fn quote(&self) -> String {
421        format!("\"{}\"", self.0.clone())
422    }
423}
424#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
425pub struct EnumTypeDefId(pub String);
426impl From<&str> for EnumTypeDefId {
427    fn from(value: &str) -> Self {
428        Self(value.to_string())
429    }
430}
431impl From<String> for EnumTypeDefId {
432    fn from(value: String) -> Self {
433        Self(value)
434    }
435}
436impl IntoID<EnumTypeDefId> for EnumTypeDef {
437    fn into_id(
438        self,
439    ) -> std::pin::Pin<
440        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
441    > {
442        Box::pin(async move { self.id().await })
443    }
444}
445impl IntoID<EnumTypeDefId> for EnumTypeDefId {
446    fn into_id(
447        self,
448    ) -> std::pin::Pin<
449        Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
450    > {
451        Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
452    }
453}
454impl EnumTypeDefId {
455    fn quote(&self) -> String {
456        format!("\"{}\"", self.0.clone())
457    }
458}
459#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
460pub struct EnumValueTypeDefId(pub String);
461impl From<&str> for EnumValueTypeDefId {
462    fn from(value: &str) -> Self {
463        Self(value.to_string())
464    }
465}
466impl From<String> for EnumValueTypeDefId {
467    fn from(value: String) -> Self {
468        Self(value)
469    }
470}
471impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
472    fn into_id(
473        self,
474    ) -> std::pin::Pin<
475        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
476    > {
477        Box::pin(async move { self.id().await })
478    }
479}
480impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
481    fn into_id(
482        self,
483    ) -> std::pin::Pin<
484        Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
485    > {
486        Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
487    }
488}
489impl EnumValueTypeDefId {
490    fn quote(&self) -> String {
491        format!("\"{}\"", self.0.clone())
492    }
493}
494#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
495pub struct EnvFileId(pub String);
496impl From<&str> for EnvFileId {
497    fn from(value: &str) -> Self {
498        Self(value.to_string())
499    }
500}
501impl From<String> for EnvFileId {
502    fn from(value: String) -> Self {
503        Self(value)
504    }
505}
506impl IntoID<EnvFileId> for EnvFile {
507    fn into_id(
508        self,
509    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
510    {
511        Box::pin(async move { self.id().await })
512    }
513}
514impl IntoID<EnvFileId> for EnvFileId {
515    fn into_id(
516        self,
517    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
518    {
519        Box::pin(async move { Ok::<EnvFileId, DaggerError>(self) })
520    }
521}
522impl EnvFileId {
523    fn quote(&self) -> String {
524        format!("\"{}\"", self.0.clone())
525    }
526}
527#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
528pub struct EnvId(pub String);
529impl From<&str> for EnvId {
530    fn from(value: &str) -> Self {
531        Self(value.to_string())
532    }
533}
534impl From<String> for EnvId {
535    fn from(value: String) -> Self {
536        Self(value)
537    }
538}
539impl IntoID<EnvId> for Env {
540    fn into_id(
541        self,
542    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
543    {
544        Box::pin(async move { self.id().await })
545    }
546}
547impl IntoID<EnvId> for EnvId {
548    fn into_id(
549        self,
550    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
551    {
552        Box::pin(async move { Ok::<EnvId, DaggerError>(self) })
553    }
554}
555impl EnvId {
556    fn quote(&self) -> String {
557        format!("\"{}\"", self.0.clone())
558    }
559}
560#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
561pub struct EnvVariableId(pub String);
562impl From<&str> for EnvVariableId {
563    fn from(value: &str) -> Self {
564        Self(value.to_string())
565    }
566}
567impl From<String> for EnvVariableId {
568    fn from(value: String) -> Self {
569        Self(value)
570    }
571}
572impl IntoID<EnvVariableId> for EnvVariable {
573    fn into_id(
574        self,
575    ) -> std::pin::Pin<
576        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
577    > {
578        Box::pin(async move { self.id().await })
579    }
580}
581impl IntoID<EnvVariableId> for EnvVariableId {
582    fn into_id(
583        self,
584    ) -> std::pin::Pin<
585        Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
586    > {
587        Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
588    }
589}
590impl EnvVariableId {
591    fn quote(&self) -> String {
592        format!("\"{}\"", self.0.clone())
593    }
594}
595#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
596pub struct ErrorId(pub String);
597impl From<&str> for ErrorId {
598    fn from(value: &str) -> Self {
599        Self(value.to_string())
600    }
601}
602impl From<String> for ErrorId {
603    fn from(value: String) -> Self {
604        Self(value)
605    }
606}
607impl IntoID<ErrorId> for Error {
608    fn into_id(
609        self,
610    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
611    {
612        Box::pin(async move { self.id().await })
613    }
614}
615impl IntoID<ErrorId> for ErrorId {
616    fn into_id(
617        self,
618    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
619    {
620        Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
621    }
622}
623impl ErrorId {
624    fn quote(&self) -> String {
625        format!("\"{}\"", self.0.clone())
626    }
627}
628#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
629pub struct ErrorValueId(pub String);
630impl From<&str> for ErrorValueId {
631    fn from(value: &str) -> Self {
632        Self(value.to_string())
633    }
634}
635impl From<String> for ErrorValueId {
636    fn from(value: String) -> Self {
637        Self(value)
638    }
639}
640impl IntoID<ErrorValueId> for ErrorValue {
641    fn into_id(
642        self,
643    ) -> std::pin::Pin<
644        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
645    > {
646        Box::pin(async move { self.id().await })
647    }
648}
649impl IntoID<ErrorValueId> for ErrorValueId {
650    fn into_id(
651        self,
652    ) -> std::pin::Pin<
653        Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
654    > {
655        Box::pin(async move { Ok::<ErrorValueId, DaggerError>(self) })
656    }
657}
658impl ErrorValueId {
659    fn quote(&self) -> String {
660        format!("\"{}\"", self.0.clone())
661    }
662}
663#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
664pub struct FieldTypeDefId(pub String);
665impl From<&str> for FieldTypeDefId {
666    fn from(value: &str) -> Self {
667        Self(value.to_string())
668    }
669}
670impl From<String> for FieldTypeDefId {
671    fn from(value: String) -> Self {
672        Self(value)
673    }
674}
675impl IntoID<FieldTypeDefId> for FieldTypeDef {
676    fn into_id(
677        self,
678    ) -> std::pin::Pin<
679        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
680    > {
681        Box::pin(async move { self.id().await })
682    }
683}
684impl IntoID<FieldTypeDefId> for FieldTypeDefId {
685    fn into_id(
686        self,
687    ) -> std::pin::Pin<
688        Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
689    > {
690        Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
691    }
692}
693impl FieldTypeDefId {
694    fn quote(&self) -> String {
695        format!("\"{}\"", self.0.clone())
696    }
697}
698#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
699pub struct FileId(pub String);
700impl From<&str> for FileId {
701    fn from(value: &str) -> Self {
702        Self(value.to_string())
703    }
704}
705impl From<String> for FileId {
706    fn from(value: String) -> Self {
707        Self(value)
708    }
709}
710impl IntoID<FileId> for File {
711    fn into_id(
712        self,
713    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
714    {
715        Box::pin(async move { self.id().await })
716    }
717}
718impl IntoID<FileId> for FileId {
719    fn into_id(
720        self,
721    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
722    {
723        Box::pin(async move { Ok::<FileId, DaggerError>(self) })
724    }
725}
726impl FileId {
727    fn quote(&self) -> String {
728        format!("\"{}\"", self.0.clone())
729    }
730}
731#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
732pub struct FunctionArgId(pub String);
733impl From<&str> for FunctionArgId {
734    fn from(value: &str) -> Self {
735        Self(value.to_string())
736    }
737}
738impl From<String> for FunctionArgId {
739    fn from(value: String) -> Self {
740        Self(value)
741    }
742}
743impl IntoID<FunctionArgId> for FunctionArg {
744    fn into_id(
745        self,
746    ) -> std::pin::Pin<
747        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
748    > {
749        Box::pin(async move { self.id().await })
750    }
751}
752impl IntoID<FunctionArgId> for FunctionArgId {
753    fn into_id(
754        self,
755    ) -> std::pin::Pin<
756        Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
757    > {
758        Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
759    }
760}
761impl FunctionArgId {
762    fn quote(&self) -> String {
763        format!("\"{}\"", self.0.clone())
764    }
765}
766#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
767pub struct FunctionCallArgValueId(pub String);
768impl From<&str> for FunctionCallArgValueId {
769    fn from(value: &str) -> Self {
770        Self(value.to_string())
771    }
772}
773impl From<String> for FunctionCallArgValueId {
774    fn from(value: String) -> Self {
775        Self(value)
776    }
777}
778impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
779    fn into_id(
780        self,
781    ) -> std::pin::Pin<
782        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
783    > {
784        Box::pin(async move { self.id().await })
785    }
786}
787impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
788    fn into_id(
789        self,
790    ) -> std::pin::Pin<
791        Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
792    > {
793        Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
794    }
795}
796impl FunctionCallArgValueId {
797    fn quote(&self) -> String {
798        format!("\"{}\"", self.0.clone())
799    }
800}
801#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
802pub struct FunctionCallId(pub String);
803impl From<&str> for FunctionCallId {
804    fn from(value: &str) -> Self {
805        Self(value.to_string())
806    }
807}
808impl From<String> for FunctionCallId {
809    fn from(value: String) -> Self {
810        Self(value)
811    }
812}
813impl IntoID<FunctionCallId> for FunctionCall {
814    fn into_id(
815        self,
816    ) -> std::pin::Pin<
817        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
818    > {
819        Box::pin(async move { self.id().await })
820    }
821}
822impl IntoID<FunctionCallId> for FunctionCallId {
823    fn into_id(
824        self,
825    ) -> std::pin::Pin<
826        Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
827    > {
828        Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
829    }
830}
831impl FunctionCallId {
832    fn quote(&self) -> String {
833        format!("\"{}\"", self.0.clone())
834    }
835}
836#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
837pub struct FunctionId(pub String);
838impl From<&str> for FunctionId {
839    fn from(value: &str) -> Self {
840        Self(value.to_string())
841    }
842}
843impl From<String> for FunctionId {
844    fn from(value: String) -> Self {
845        Self(value)
846    }
847}
848impl IntoID<FunctionId> for Function {
849    fn into_id(
850        self,
851    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
852    {
853        Box::pin(async move { self.id().await })
854    }
855}
856impl IntoID<FunctionId> for FunctionId {
857    fn into_id(
858        self,
859    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
860    {
861        Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
862    }
863}
864impl FunctionId {
865    fn quote(&self) -> String {
866        format!("\"{}\"", self.0.clone())
867    }
868}
869#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
870pub struct GeneratedCodeId(pub String);
871impl From<&str> for GeneratedCodeId {
872    fn from(value: &str) -> Self {
873        Self(value.to_string())
874    }
875}
876impl From<String> for GeneratedCodeId {
877    fn from(value: String) -> Self {
878        Self(value)
879    }
880}
881impl IntoID<GeneratedCodeId> for GeneratedCode {
882    fn into_id(
883        self,
884    ) -> std::pin::Pin<
885        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
886    > {
887        Box::pin(async move { self.id().await })
888    }
889}
890impl IntoID<GeneratedCodeId> for GeneratedCodeId {
891    fn into_id(
892        self,
893    ) -> std::pin::Pin<
894        Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
895    > {
896        Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
897    }
898}
899impl GeneratedCodeId {
900    fn quote(&self) -> String {
901        format!("\"{}\"", self.0.clone())
902    }
903}
904#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
905pub struct GitRefId(pub String);
906impl From<&str> for GitRefId {
907    fn from(value: &str) -> Self {
908        Self(value.to_string())
909    }
910}
911impl From<String> for GitRefId {
912    fn from(value: String) -> Self {
913        Self(value)
914    }
915}
916impl IntoID<GitRefId> for GitRef {
917    fn into_id(
918        self,
919    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
920    {
921        Box::pin(async move { self.id().await })
922    }
923}
924impl IntoID<GitRefId> for GitRefId {
925    fn into_id(
926        self,
927    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
928    {
929        Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
930    }
931}
932impl GitRefId {
933    fn quote(&self) -> String {
934        format!("\"{}\"", self.0.clone())
935    }
936}
937#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
938pub struct GitRepositoryId(pub String);
939impl From<&str> for GitRepositoryId {
940    fn from(value: &str) -> Self {
941        Self(value.to_string())
942    }
943}
944impl From<String> for GitRepositoryId {
945    fn from(value: String) -> Self {
946        Self(value)
947    }
948}
949impl IntoID<GitRepositoryId> for GitRepository {
950    fn into_id(
951        self,
952    ) -> std::pin::Pin<
953        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
954    > {
955        Box::pin(async move { self.id().await })
956    }
957}
958impl IntoID<GitRepositoryId> for GitRepositoryId {
959    fn into_id(
960        self,
961    ) -> std::pin::Pin<
962        Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
963    > {
964        Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
965    }
966}
967impl GitRepositoryId {
968    fn quote(&self) -> String {
969        format!("\"{}\"", self.0.clone())
970    }
971}
972#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
973pub struct HostId(pub String);
974impl From<&str> for HostId {
975    fn from(value: &str) -> Self {
976        Self(value.to_string())
977    }
978}
979impl From<String> for HostId {
980    fn from(value: String) -> Self {
981        Self(value)
982    }
983}
984impl IntoID<HostId> for Host {
985    fn into_id(
986        self,
987    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
988    {
989        Box::pin(async move { self.id().await })
990    }
991}
992impl IntoID<HostId> for HostId {
993    fn into_id(
994        self,
995    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
996    {
997        Box::pin(async move { Ok::<HostId, DaggerError>(self) })
998    }
999}
1000impl HostId {
1001    fn quote(&self) -> String {
1002        format!("\"{}\"", self.0.clone())
1003    }
1004}
1005#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1006pub struct InputTypeDefId(pub String);
1007impl From<&str> for InputTypeDefId {
1008    fn from(value: &str) -> Self {
1009        Self(value.to_string())
1010    }
1011}
1012impl From<String> for InputTypeDefId {
1013    fn from(value: String) -> Self {
1014        Self(value)
1015    }
1016}
1017impl IntoID<InputTypeDefId> for InputTypeDef {
1018    fn into_id(
1019        self,
1020    ) -> std::pin::Pin<
1021        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1022    > {
1023        Box::pin(async move { self.id().await })
1024    }
1025}
1026impl IntoID<InputTypeDefId> for InputTypeDefId {
1027    fn into_id(
1028        self,
1029    ) -> std::pin::Pin<
1030        Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1031    > {
1032        Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
1033    }
1034}
1035impl InputTypeDefId {
1036    fn quote(&self) -> String {
1037        format!("\"{}\"", self.0.clone())
1038    }
1039}
1040#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1041pub struct InterfaceTypeDefId(pub String);
1042impl From<&str> for InterfaceTypeDefId {
1043    fn from(value: &str) -> Self {
1044        Self(value.to_string())
1045    }
1046}
1047impl From<String> for InterfaceTypeDefId {
1048    fn from(value: String) -> Self {
1049        Self(value)
1050    }
1051}
1052impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
1053    fn into_id(
1054        self,
1055    ) -> std::pin::Pin<
1056        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1057    > {
1058        Box::pin(async move { self.id().await })
1059    }
1060}
1061impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
1062    fn into_id(
1063        self,
1064    ) -> std::pin::Pin<
1065        Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1066    > {
1067        Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
1068    }
1069}
1070impl InterfaceTypeDefId {
1071    fn quote(&self) -> String {
1072        format!("\"{}\"", self.0.clone())
1073    }
1074}
1075#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1076pub struct Json(pub String);
1077impl From<&str> for Json {
1078    fn from(value: &str) -> Self {
1079        Self(value.to_string())
1080    }
1081}
1082impl From<String> for Json {
1083    fn from(value: String) -> Self {
1084        Self(value)
1085    }
1086}
1087impl Json {
1088    fn quote(&self) -> String {
1089        format!("\"{}\"", self.0.clone())
1090    }
1091}
1092#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1093pub struct JsonValueId(pub String);
1094impl From<&str> for JsonValueId {
1095    fn from(value: &str) -> Self {
1096        Self(value.to_string())
1097    }
1098}
1099impl From<String> for JsonValueId {
1100    fn from(value: String) -> Self {
1101        Self(value)
1102    }
1103}
1104impl IntoID<JsonValueId> for JsonValue {
1105    fn into_id(
1106        self,
1107    ) -> std::pin::Pin<
1108        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1109    > {
1110        Box::pin(async move { self.id().await })
1111    }
1112}
1113impl IntoID<JsonValueId> for JsonValueId {
1114    fn into_id(
1115        self,
1116    ) -> std::pin::Pin<
1117        Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1118    > {
1119        Box::pin(async move { Ok::<JsonValueId, DaggerError>(self) })
1120    }
1121}
1122impl JsonValueId {
1123    fn quote(&self) -> String {
1124        format!("\"{}\"", self.0.clone())
1125    }
1126}
1127#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1128pub struct Llmid(pub String);
1129impl From<&str> for Llmid {
1130    fn from(value: &str) -> Self {
1131        Self(value.to_string())
1132    }
1133}
1134impl From<String> for Llmid {
1135    fn from(value: String) -> Self {
1136        Self(value)
1137    }
1138}
1139impl IntoID<Llmid> for Llm {
1140    fn into_id(
1141        self,
1142    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1143    {
1144        Box::pin(async move { self.id().await })
1145    }
1146}
1147impl IntoID<Llmid> for Llmid {
1148    fn into_id(
1149        self,
1150    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1151    {
1152        Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
1153    }
1154}
1155impl Llmid {
1156    fn quote(&self) -> String {
1157        format!("\"{}\"", self.0.clone())
1158    }
1159}
1160#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1161pub struct LlmTokenUsageId(pub String);
1162impl From<&str> for LlmTokenUsageId {
1163    fn from(value: &str) -> Self {
1164        Self(value.to_string())
1165    }
1166}
1167impl From<String> for LlmTokenUsageId {
1168    fn from(value: String) -> Self {
1169        Self(value)
1170    }
1171}
1172impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
1173    fn into_id(
1174        self,
1175    ) -> std::pin::Pin<
1176        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1177    > {
1178        Box::pin(async move { self.id().await })
1179    }
1180}
1181impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
1182    fn into_id(
1183        self,
1184    ) -> std::pin::Pin<
1185        Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1186    > {
1187        Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
1188    }
1189}
1190impl LlmTokenUsageId {
1191    fn quote(&self) -> String {
1192        format!("\"{}\"", self.0.clone())
1193    }
1194}
1195#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1196pub struct LabelId(pub String);
1197impl From<&str> for LabelId {
1198    fn from(value: &str) -> Self {
1199        Self(value.to_string())
1200    }
1201}
1202impl From<String> for LabelId {
1203    fn from(value: String) -> Self {
1204        Self(value)
1205    }
1206}
1207impl IntoID<LabelId> for Label {
1208    fn into_id(
1209        self,
1210    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1211    {
1212        Box::pin(async move { self.id().await })
1213    }
1214}
1215impl IntoID<LabelId> for LabelId {
1216    fn into_id(
1217        self,
1218    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1219    {
1220        Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
1221    }
1222}
1223impl LabelId {
1224    fn quote(&self) -> String {
1225        format!("\"{}\"", self.0.clone())
1226    }
1227}
1228#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1229pub struct ListTypeDefId(pub String);
1230impl From<&str> for ListTypeDefId {
1231    fn from(value: &str) -> Self {
1232        Self(value.to_string())
1233    }
1234}
1235impl From<String> for ListTypeDefId {
1236    fn from(value: String) -> Self {
1237        Self(value)
1238    }
1239}
1240impl IntoID<ListTypeDefId> for ListTypeDef {
1241    fn into_id(
1242        self,
1243    ) -> std::pin::Pin<
1244        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1245    > {
1246        Box::pin(async move { self.id().await })
1247    }
1248}
1249impl IntoID<ListTypeDefId> for ListTypeDefId {
1250    fn into_id(
1251        self,
1252    ) -> std::pin::Pin<
1253        Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1254    > {
1255        Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
1256    }
1257}
1258impl ListTypeDefId {
1259    fn quote(&self) -> String {
1260        format!("\"{}\"", self.0.clone())
1261    }
1262}
1263#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1264pub struct ModuleConfigClientId(pub String);
1265impl From<&str> for ModuleConfigClientId {
1266    fn from(value: &str) -> Self {
1267        Self(value.to_string())
1268    }
1269}
1270impl From<String> for ModuleConfigClientId {
1271    fn from(value: String) -> Self {
1272        Self(value)
1273    }
1274}
1275impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
1276    fn into_id(
1277        self,
1278    ) -> std::pin::Pin<
1279        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1280    > {
1281        Box::pin(async move { self.id().await })
1282    }
1283}
1284impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
1285    fn into_id(
1286        self,
1287    ) -> std::pin::Pin<
1288        Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1289    > {
1290        Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
1291    }
1292}
1293impl ModuleConfigClientId {
1294    fn quote(&self) -> String {
1295        format!("\"{}\"", self.0.clone())
1296    }
1297}
1298#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1299pub struct ModuleId(pub String);
1300impl From<&str> for ModuleId {
1301    fn from(value: &str) -> Self {
1302        Self(value.to_string())
1303    }
1304}
1305impl From<String> for ModuleId {
1306    fn from(value: String) -> Self {
1307        Self(value)
1308    }
1309}
1310impl IntoID<ModuleId> for Module {
1311    fn into_id(
1312        self,
1313    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1314    {
1315        Box::pin(async move { self.id().await })
1316    }
1317}
1318impl IntoID<ModuleId> for ModuleId {
1319    fn into_id(
1320        self,
1321    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1322    {
1323        Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
1324    }
1325}
1326impl ModuleId {
1327    fn quote(&self) -> String {
1328        format!("\"{}\"", self.0.clone())
1329    }
1330}
1331#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1332pub struct ModuleSourceId(pub String);
1333impl From<&str> for ModuleSourceId {
1334    fn from(value: &str) -> Self {
1335        Self(value.to_string())
1336    }
1337}
1338impl From<String> for ModuleSourceId {
1339    fn from(value: String) -> Self {
1340        Self(value)
1341    }
1342}
1343impl IntoID<ModuleSourceId> for ModuleSource {
1344    fn into_id(
1345        self,
1346    ) -> std::pin::Pin<
1347        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1348    > {
1349        Box::pin(async move { self.id().await })
1350    }
1351}
1352impl IntoID<ModuleSourceId> for ModuleSourceId {
1353    fn into_id(
1354        self,
1355    ) -> std::pin::Pin<
1356        Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1357    > {
1358        Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1359    }
1360}
1361impl ModuleSourceId {
1362    fn quote(&self) -> String {
1363        format!("\"{}\"", self.0.clone())
1364    }
1365}
1366#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1367pub struct ObjectTypeDefId(pub String);
1368impl From<&str> for ObjectTypeDefId {
1369    fn from(value: &str) -> Self {
1370        Self(value.to_string())
1371    }
1372}
1373impl From<String> for ObjectTypeDefId {
1374    fn from(value: String) -> Self {
1375        Self(value)
1376    }
1377}
1378impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1379    fn into_id(
1380        self,
1381    ) -> std::pin::Pin<
1382        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1383    > {
1384        Box::pin(async move { self.id().await })
1385    }
1386}
1387impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1388    fn into_id(
1389        self,
1390    ) -> std::pin::Pin<
1391        Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1392    > {
1393        Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1394    }
1395}
1396impl ObjectTypeDefId {
1397    fn quote(&self) -> String {
1398        format!("\"{}\"", self.0.clone())
1399    }
1400}
1401#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1402pub struct Platform(pub String);
1403impl From<&str> for Platform {
1404    fn from(value: &str) -> Self {
1405        Self(value.to_string())
1406    }
1407}
1408impl From<String> for Platform {
1409    fn from(value: String) -> Self {
1410        Self(value)
1411    }
1412}
1413impl Platform {
1414    fn quote(&self) -> String {
1415        format!("\"{}\"", self.0.clone())
1416    }
1417}
1418#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1419pub struct PortId(pub String);
1420impl From<&str> for PortId {
1421    fn from(value: &str) -> Self {
1422        Self(value.to_string())
1423    }
1424}
1425impl From<String> for PortId {
1426    fn from(value: String) -> Self {
1427        Self(value)
1428    }
1429}
1430impl IntoID<PortId> for Port {
1431    fn into_id(
1432        self,
1433    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1434    {
1435        Box::pin(async move { self.id().await })
1436    }
1437}
1438impl IntoID<PortId> for PortId {
1439    fn into_id(
1440        self,
1441    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1442    {
1443        Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1444    }
1445}
1446impl PortId {
1447    fn quote(&self) -> String {
1448        format!("\"{}\"", self.0.clone())
1449    }
1450}
1451#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1452pub struct SdkConfigId(pub String);
1453impl From<&str> for SdkConfigId {
1454    fn from(value: &str) -> Self {
1455        Self(value.to_string())
1456    }
1457}
1458impl From<String> for SdkConfigId {
1459    fn from(value: String) -> Self {
1460        Self(value)
1461    }
1462}
1463impl IntoID<SdkConfigId> for SdkConfig {
1464    fn into_id(
1465        self,
1466    ) -> std::pin::Pin<
1467        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1468    > {
1469        Box::pin(async move { self.id().await })
1470    }
1471}
1472impl IntoID<SdkConfigId> for SdkConfigId {
1473    fn into_id(
1474        self,
1475    ) -> std::pin::Pin<
1476        Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1477    > {
1478        Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1479    }
1480}
1481impl SdkConfigId {
1482    fn quote(&self) -> String {
1483        format!("\"{}\"", self.0.clone())
1484    }
1485}
1486#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1487pub struct ScalarTypeDefId(pub String);
1488impl From<&str> for ScalarTypeDefId {
1489    fn from(value: &str) -> Self {
1490        Self(value.to_string())
1491    }
1492}
1493impl From<String> for ScalarTypeDefId {
1494    fn from(value: String) -> Self {
1495        Self(value)
1496    }
1497}
1498impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1499    fn into_id(
1500        self,
1501    ) -> std::pin::Pin<
1502        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1503    > {
1504        Box::pin(async move { self.id().await })
1505    }
1506}
1507impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1508    fn into_id(
1509        self,
1510    ) -> std::pin::Pin<
1511        Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1512    > {
1513        Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1514    }
1515}
1516impl ScalarTypeDefId {
1517    fn quote(&self) -> String {
1518        format!("\"{}\"", self.0.clone())
1519    }
1520}
1521#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1522pub struct SearchResultId(pub String);
1523impl From<&str> for SearchResultId {
1524    fn from(value: &str) -> Self {
1525        Self(value.to_string())
1526    }
1527}
1528impl From<String> for SearchResultId {
1529    fn from(value: String) -> Self {
1530        Self(value)
1531    }
1532}
1533impl IntoID<SearchResultId> for SearchResult {
1534    fn into_id(
1535        self,
1536    ) -> std::pin::Pin<
1537        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1538    > {
1539        Box::pin(async move { self.id().await })
1540    }
1541}
1542impl IntoID<SearchResultId> for SearchResultId {
1543    fn into_id(
1544        self,
1545    ) -> std::pin::Pin<
1546        Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1547    > {
1548        Box::pin(async move { Ok::<SearchResultId, DaggerError>(self) })
1549    }
1550}
1551impl SearchResultId {
1552    fn quote(&self) -> String {
1553        format!("\"{}\"", self.0.clone())
1554    }
1555}
1556#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1557pub struct SearchSubmatchId(pub String);
1558impl From<&str> for SearchSubmatchId {
1559    fn from(value: &str) -> Self {
1560        Self(value.to_string())
1561    }
1562}
1563impl From<String> for SearchSubmatchId {
1564    fn from(value: String) -> Self {
1565        Self(value)
1566    }
1567}
1568impl IntoID<SearchSubmatchId> for SearchSubmatch {
1569    fn into_id(
1570        self,
1571    ) -> std::pin::Pin<
1572        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1573    > {
1574        Box::pin(async move { self.id().await })
1575    }
1576}
1577impl IntoID<SearchSubmatchId> for SearchSubmatchId {
1578    fn into_id(
1579        self,
1580    ) -> std::pin::Pin<
1581        Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1582    > {
1583        Box::pin(async move { Ok::<SearchSubmatchId, DaggerError>(self) })
1584    }
1585}
1586impl SearchSubmatchId {
1587    fn quote(&self) -> String {
1588        format!("\"{}\"", self.0.clone())
1589    }
1590}
1591#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1592pub struct SecretId(pub String);
1593impl From<&str> for SecretId {
1594    fn from(value: &str) -> Self {
1595        Self(value.to_string())
1596    }
1597}
1598impl From<String> for SecretId {
1599    fn from(value: String) -> Self {
1600        Self(value)
1601    }
1602}
1603impl IntoID<SecretId> for Secret {
1604    fn into_id(
1605        self,
1606    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1607    {
1608        Box::pin(async move { self.id().await })
1609    }
1610}
1611impl IntoID<SecretId> for SecretId {
1612    fn into_id(
1613        self,
1614    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1615    {
1616        Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1617    }
1618}
1619impl SecretId {
1620    fn quote(&self) -> String {
1621        format!("\"{}\"", self.0.clone())
1622    }
1623}
1624#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1625pub struct ServiceId(pub String);
1626impl From<&str> for ServiceId {
1627    fn from(value: &str) -> Self {
1628        Self(value.to_string())
1629    }
1630}
1631impl From<String> for ServiceId {
1632    fn from(value: String) -> Self {
1633        Self(value)
1634    }
1635}
1636impl IntoID<ServiceId> for Service {
1637    fn into_id(
1638        self,
1639    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1640    {
1641        Box::pin(async move { self.id().await })
1642    }
1643}
1644impl IntoID<ServiceId> for ServiceId {
1645    fn into_id(
1646        self,
1647    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1648    {
1649        Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1650    }
1651}
1652impl ServiceId {
1653    fn quote(&self) -> String {
1654        format!("\"{}\"", self.0.clone())
1655    }
1656}
1657#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1658pub struct SocketId(pub String);
1659impl From<&str> for SocketId {
1660    fn from(value: &str) -> Self {
1661        Self(value.to_string())
1662    }
1663}
1664impl From<String> for SocketId {
1665    fn from(value: String) -> Self {
1666        Self(value)
1667    }
1668}
1669impl IntoID<SocketId> for Socket {
1670    fn into_id(
1671        self,
1672    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1673    {
1674        Box::pin(async move { self.id().await })
1675    }
1676}
1677impl IntoID<SocketId> for SocketId {
1678    fn into_id(
1679        self,
1680    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1681    {
1682        Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1683    }
1684}
1685impl SocketId {
1686    fn quote(&self) -> String {
1687        format!("\"{}\"", self.0.clone())
1688    }
1689}
1690#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1691pub struct SourceMapId(pub String);
1692impl From<&str> for SourceMapId {
1693    fn from(value: &str) -> Self {
1694        Self(value.to_string())
1695    }
1696}
1697impl From<String> for SourceMapId {
1698    fn from(value: String) -> Self {
1699        Self(value)
1700    }
1701}
1702impl IntoID<SourceMapId> for SourceMap {
1703    fn into_id(
1704        self,
1705    ) -> std::pin::Pin<
1706        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1707    > {
1708        Box::pin(async move { self.id().await })
1709    }
1710}
1711impl IntoID<SourceMapId> for SourceMapId {
1712    fn into_id(
1713        self,
1714    ) -> std::pin::Pin<
1715        Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1716    > {
1717        Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1718    }
1719}
1720impl SourceMapId {
1721    fn quote(&self) -> String {
1722        format!("\"{}\"", self.0.clone())
1723    }
1724}
1725#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1726pub struct TerminalId(pub String);
1727impl From<&str> for TerminalId {
1728    fn from(value: &str) -> Self {
1729        Self(value.to_string())
1730    }
1731}
1732impl From<String> for TerminalId {
1733    fn from(value: String) -> Self {
1734        Self(value)
1735    }
1736}
1737impl IntoID<TerminalId> for Terminal {
1738    fn into_id(
1739        self,
1740    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1741    {
1742        Box::pin(async move { self.id().await })
1743    }
1744}
1745impl IntoID<TerminalId> for TerminalId {
1746    fn into_id(
1747        self,
1748    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1749    {
1750        Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
1751    }
1752}
1753impl TerminalId {
1754    fn quote(&self) -> String {
1755        format!("\"{}\"", self.0.clone())
1756    }
1757}
1758#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1759pub struct TypeDefId(pub String);
1760impl From<&str> for TypeDefId {
1761    fn from(value: &str) -> Self {
1762        Self(value.to_string())
1763    }
1764}
1765impl From<String> for TypeDefId {
1766    fn from(value: String) -> Self {
1767        Self(value)
1768    }
1769}
1770impl IntoID<TypeDefId> for TypeDef {
1771    fn into_id(
1772        self,
1773    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1774    {
1775        Box::pin(async move { self.id().await })
1776    }
1777}
1778impl IntoID<TypeDefId> for TypeDefId {
1779    fn into_id(
1780        self,
1781    ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1782    {
1783        Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
1784    }
1785}
1786impl TypeDefId {
1787    fn quote(&self) -> String {
1788        format!("\"{}\"", self.0.clone())
1789    }
1790}
1791#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1792pub struct Void(pub String);
1793impl From<&str> for Void {
1794    fn from(value: &str) -> Self {
1795        Self(value.to_string())
1796    }
1797}
1798impl From<String> for Void {
1799    fn from(value: String) -> Self {
1800        Self(value)
1801    }
1802}
1803impl Void {
1804    fn quote(&self) -> String {
1805        format!("\"{}\"", self.0.clone())
1806    }
1807}
1808#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1809pub struct BuildArg {
1810    pub name: String,
1811    pub value: String,
1812}
1813#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1814pub struct PipelineLabel {
1815    pub name: String,
1816    pub value: String,
1817}
1818#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1819pub struct PortForward {
1820    pub backend: isize,
1821    pub frontend: isize,
1822    pub protocol: NetworkProtocol,
1823}
1824#[derive(Clone)]
1825pub struct Address {
1826    pub proc: Option<Arc<DaggerSessionProc>>,
1827    pub selection: Selection,
1828    pub graphql_client: DynGraphQLClient,
1829}
1830#[derive(Builder, Debug, PartialEq)]
1831pub struct AddressDirectoryOpts<'a> {
1832    #[builder(setter(into, strip_option), default)]
1833    pub exclude: Option<Vec<&'a str>>,
1834    #[builder(setter(into, strip_option), default)]
1835    pub include: Option<Vec<&'a str>>,
1836    #[builder(setter(into, strip_option), default)]
1837    pub no_cache: Option<bool>,
1838}
1839#[derive(Builder, Debug, PartialEq)]
1840pub struct AddressFileOpts<'a> {
1841    #[builder(setter(into, strip_option), default)]
1842    pub exclude: Option<Vec<&'a str>>,
1843    #[builder(setter(into, strip_option), default)]
1844    pub include: Option<Vec<&'a str>>,
1845    #[builder(setter(into, strip_option), default)]
1846    pub no_cache: Option<bool>,
1847}
1848impl Address {
1849    /// Load a container from the address.
1850    pub fn container(&self) -> Container {
1851        let query = self.selection.select("container");
1852        Container {
1853            proc: self.proc.clone(),
1854            selection: query,
1855            graphql_client: self.graphql_client.clone(),
1856        }
1857    }
1858    /// Load a directory from the address.
1859    ///
1860    /// # Arguments
1861    ///
1862    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1863    pub fn directory(&self) -> Directory {
1864        let query = self.selection.select("directory");
1865        Directory {
1866            proc: self.proc.clone(),
1867            selection: query,
1868            graphql_client: self.graphql_client.clone(),
1869        }
1870    }
1871    /// Load a directory from the address.
1872    ///
1873    /// # Arguments
1874    ///
1875    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1876    pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
1877        let mut query = self.selection.select("directory");
1878        if let Some(exclude) = opts.exclude {
1879            query = query.arg("exclude", exclude);
1880        }
1881        if let Some(include) = opts.include {
1882            query = query.arg("include", include);
1883        }
1884        if let Some(no_cache) = opts.no_cache {
1885            query = query.arg("noCache", no_cache);
1886        }
1887        Directory {
1888            proc: self.proc.clone(),
1889            selection: query,
1890            graphql_client: self.graphql_client.clone(),
1891        }
1892    }
1893    /// Load a file from the address.
1894    ///
1895    /// # Arguments
1896    ///
1897    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1898    pub fn file(&self) -> File {
1899        let query = self.selection.select("file");
1900        File {
1901            proc: self.proc.clone(),
1902            selection: query,
1903            graphql_client: self.graphql_client.clone(),
1904        }
1905    }
1906    /// Load a file from the address.
1907    ///
1908    /// # Arguments
1909    ///
1910    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1911    pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
1912        let mut query = self.selection.select("file");
1913        if let Some(exclude) = opts.exclude {
1914            query = query.arg("exclude", exclude);
1915        }
1916        if let Some(include) = opts.include {
1917            query = query.arg("include", include);
1918        }
1919        if let Some(no_cache) = opts.no_cache {
1920            query = query.arg("noCache", no_cache);
1921        }
1922        File {
1923            proc: self.proc.clone(),
1924            selection: query,
1925            graphql_client: self.graphql_client.clone(),
1926        }
1927    }
1928    /// Load a git ref (branch, tag or commit) from the address.
1929    pub fn git_ref(&self) -> GitRef {
1930        let query = self.selection.select("gitRef");
1931        GitRef {
1932            proc: self.proc.clone(),
1933            selection: query,
1934            graphql_client: self.graphql_client.clone(),
1935        }
1936    }
1937    /// Load a git repository from the address.
1938    pub fn git_repository(&self) -> GitRepository {
1939        let query = self.selection.select("gitRepository");
1940        GitRepository {
1941            proc: self.proc.clone(),
1942            selection: query,
1943            graphql_client: self.graphql_client.clone(),
1944        }
1945    }
1946    /// A unique identifier for this Address.
1947    pub async fn id(&self) -> Result<AddressId, DaggerError> {
1948        let query = self.selection.select("id");
1949        query.execute(self.graphql_client.clone()).await
1950    }
1951    /// Load a secret from the address.
1952    pub fn secret(&self) -> Secret {
1953        let query = self.selection.select("secret");
1954        Secret {
1955            proc: self.proc.clone(),
1956            selection: query,
1957            graphql_client: self.graphql_client.clone(),
1958        }
1959    }
1960    /// Load a service from the address.
1961    pub fn service(&self) -> Service {
1962        let query = self.selection.select("service");
1963        Service {
1964            proc: self.proc.clone(),
1965            selection: query,
1966            graphql_client: self.graphql_client.clone(),
1967        }
1968    }
1969    /// Load a local socket from the address.
1970    pub fn socket(&self) -> Socket {
1971        let query = self.selection.select("socket");
1972        Socket {
1973            proc: self.proc.clone(),
1974            selection: query,
1975            graphql_client: self.graphql_client.clone(),
1976        }
1977    }
1978    /// The address value
1979    pub async fn value(&self) -> Result<String, DaggerError> {
1980        let query = self.selection.select("value");
1981        query.execute(self.graphql_client.clone()).await
1982    }
1983}
1984#[derive(Clone)]
1985pub struct Binding {
1986    pub proc: Option<Arc<DaggerSessionProc>>,
1987    pub selection: Selection,
1988    pub graphql_client: DynGraphQLClient,
1989}
1990impl Binding {
1991    /// Retrieve the binding value, as type Address
1992    pub fn as_address(&self) -> Address {
1993        let query = self.selection.select("asAddress");
1994        Address {
1995            proc: self.proc.clone(),
1996            selection: query,
1997            graphql_client: self.graphql_client.clone(),
1998        }
1999    }
2000    /// Retrieve the binding value, as type CacheVolume
2001    pub fn as_cache_volume(&self) -> CacheVolume {
2002        let query = self.selection.select("asCacheVolume");
2003        CacheVolume {
2004            proc: self.proc.clone(),
2005            selection: query,
2006            graphql_client: self.graphql_client.clone(),
2007        }
2008    }
2009    /// Retrieve the binding value, as type Changeset
2010    pub fn as_changeset(&self) -> Changeset {
2011        let query = self.selection.select("asChangeset");
2012        Changeset {
2013            proc: self.proc.clone(),
2014            selection: query,
2015            graphql_client: self.graphql_client.clone(),
2016        }
2017    }
2018    /// Retrieve the binding value, as type Cloud
2019    pub fn as_cloud(&self) -> Cloud {
2020        let query = self.selection.select("asCloud");
2021        Cloud {
2022            proc: self.proc.clone(),
2023            selection: query,
2024            graphql_client: self.graphql_client.clone(),
2025        }
2026    }
2027    /// Retrieve the binding value, as type Container
2028    pub fn as_container(&self) -> Container {
2029        let query = self.selection.select("asContainer");
2030        Container {
2031            proc: self.proc.clone(),
2032            selection: query,
2033            graphql_client: self.graphql_client.clone(),
2034        }
2035    }
2036    /// Retrieve the binding value, as type Directory
2037    pub fn as_directory(&self) -> Directory {
2038        let query = self.selection.select("asDirectory");
2039        Directory {
2040            proc: self.proc.clone(),
2041            selection: query,
2042            graphql_client: self.graphql_client.clone(),
2043        }
2044    }
2045    /// Retrieve the binding value, as type Env
2046    pub fn as_env(&self) -> Env {
2047        let query = self.selection.select("asEnv");
2048        Env {
2049            proc: self.proc.clone(),
2050            selection: query,
2051            graphql_client: self.graphql_client.clone(),
2052        }
2053    }
2054    /// Retrieve the binding value, as type EnvFile
2055    pub fn as_env_file(&self) -> EnvFile {
2056        let query = self.selection.select("asEnvFile");
2057        EnvFile {
2058            proc: self.proc.clone(),
2059            selection: query,
2060            graphql_client: self.graphql_client.clone(),
2061        }
2062    }
2063    /// Retrieve the binding value, as type File
2064    pub fn as_file(&self) -> File {
2065        let query = self.selection.select("asFile");
2066        File {
2067            proc: self.proc.clone(),
2068            selection: query,
2069            graphql_client: self.graphql_client.clone(),
2070        }
2071    }
2072    /// Retrieve the binding value, as type GitRef
2073    pub fn as_git_ref(&self) -> GitRef {
2074        let query = self.selection.select("asGitRef");
2075        GitRef {
2076            proc: self.proc.clone(),
2077            selection: query,
2078            graphql_client: self.graphql_client.clone(),
2079        }
2080    }
2081    /// Retrieve the binding value, as type GitRepository
2082    pub fn as_git_repository(&self) -> GitRepository {
2083        let query = self.selection.select("asGitRepository");
2084        GitRepository {
2085            proc: self.proc.clone(),
2086            selection: query,
2087            graphql_client: self.graphql_client.clone(),
2088        }
2089    }
2090    /// Retrieve the binding value, as type JSONValue
2091    pub fn as_json_value(&self) -> JsonValue {
2092        let query = self.selection.select("asJSONValue");
2093        JsonValue {
2094            proc: self.proc.clone(),
2095            selection: query,
2096            graphql_client: self.graphql_client.clone(),
2097        }
2098    }
2099    /// Retrieve the binding value, as type Module
2100    pub fn as_module(&self) -> Module {
2101        let query = self.selection.select("asModule");
2102        Module {
2103            proc: self.proc.clone(),
2104            selection: query,
2105            graphql_client: self.graphql_client.clone(),
2106        }
2107    }
2108    /// Retrieve the binding value, as type ModuleConfigClient
2109    pub fn as_module_config_client(&self) -> ModuleConfigClient {
2110        let query = self.selection.select("asModuleConfigClient");
2111        ModuleConfigClient {
2112            proc: self.proc.clone(),
2113            selection: query,
2114            graphql_client: self.graphql_client.clone(),
2115        }
2116    }
2117    /// Retrieve the binding value, as type ModuleSource
2118    pub fn as_module_source(&self) -> ModuleSource {
2119        let query = self.selection.select("asModuleSource");
2120        ModuleSource {
2121            proc: self.proc.clone(),
2122            selection: query,
2123            graphql_client: self.graphql_client.clone(),
2124        }
2125    }
2126    /// Retrieve the binding value, as type SearchResult
2127    pub fn as_search_result(&self) -> SearchResult {
2128        let query = self.selection.select("asSearchResult");
2129        SearchResult {
2130            proc: self.proc.clone(),
2131            selection: query,
2132            graphql_client: self.graphql_client.clone(),
2133        }
2134    }
2135    /// Retrieve the binding value, as type SearchSubmatch
2136    pub fn as_search_submatch(&self) -> SearchSubmatch {
2137        let query = self.selection.select("asSearchSubmatch");
2138        SearchSubmatch {
2139            proc: self.proc.clone(),
2140            selection: query,
2141            graphql_client: self.graphql_client.clone(),
2142        }
2143    }
2144    /// Retrieve the binding value, as type Secret
2145    pub fn as_secret(&self) -> Secret {
2146        let query = self.selection.select("asSecret");
2147        Secret {
2148            proc: self.proc.clone(),
2149            selection: query,
2150            graphql_client: self.graphql_client.clone(),
2151        }
2152    }
2153    /// Retrieve the binding value, as type Service
2154    pub fn as_service(&self) -> Service {
2155        let query = self.selection.select("asService");
2156        Service {
2157            proc: self.proc.clone(),
2158            selection: query,
2159            graphql_client: self.graphql_client.clone(),
2160        }
2161    }
2162    /// Retrieve the binding value, as type Socket
2163    pub fn as_socket(&self) -> Socket {
2164        let query = self.selection.select("asSocket");
2165        Socket {
2166            proc: self.proc.clone(),
2167            selection: query,
2168            graphql_client: self.graphql_client.clone(),
2169        }
2170    }
2171    /// Returns the binding's string value
2172    pub async fn as_string(&self) -> Result<String, DaggerError> {
2173        let query = self.selection.select("asString");
2174        query.execute(self.graphql_client.clone()).await
2175    }
2176    /// Returns the digest of the binding value
2177    pub async fn digest(&self) -> Result<String, DaggerError> {
2178        let query = self.selection.select("digest");
2179        query.execute(self.graphql_client.clone()).await
2180    }
2181    /// A unique identifier for this Binding.
2182    pub async fn id(&self) -> Result<BindingId, DaggerError> {
2183        let query = self.selection.select("id");
2184        query.execute(self.graphql_client.clone()).await
2185    }
2186    /// Returns true if the binding is null
2187    pub async fn is_null(&self) -> Result<bool, DaggerError> {
2188        let query = self.selection.select("isNull");
2189        query.execute(self.graphql_client.clone()).await
2190    }
2191    /// Returns the binding name
2192    pub async fn name(&self) -> Result<String, DaggerError> {
2193        let query = self.selection.select("name");
2194        query.execute(self.graphql_client.clone()).await
2195    }
2196    /// Returns the binding type
2197    pub async fn type_name(&self) -> Result<String, DaggerError> {
2198        let query = self.selection.select("typeName");
2199        query.execute(self.graphql_client.clone()).await
2200    }
2201}
2202#[derive(Clone)]
2203pub struct CacheVolume {
2204    pub proc: Option<Arc<DaggerSessionProc>>,
2205    pub selection: Selection,
2206    pub graphql_client: DynGraphQLClient,
2207}
2208impl CacheVolume {
2209    /// A unique identifier for this CacheVolume.
2210    pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
2211        let query = self.selection.select("id");
2212        query.execute(self.graphql_client.clone()).await
2213    }
2214}
2215#[derive(Clone)]
2216pub struct Changeset {
2217    pub proc: Option<Arc<DaggerSessionProc>>,
2218    pub selection: Selection,
2219    pub graphql_client: DynGraphQLClient,
2220}
2221impl Changeset {
2222    /// Files and directories that were added in the newer directory.
2223    pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2224        let query = self.selection.select("addedPaths");
2225        query.execute(self.graphql_client.clone()).await
2226    }
2227    /// The newer/upper snapshot.
2228    pub fn after(&self) -> Directory {
2229        let query = self.selection.select("after");
2230        Directory {
2231            proc: self.proc.clone(),
2232            selection: query,
2233            graphql_client: self.graphql_client.clone(),
2234        }
2235    }
2236    /// Return a Git-compatible patch of the changes
2237    pub fn as_patch(&self) -> File {
2238        let query = self.selection.select("asPatch");
2239        File {
2240            proc: self.proc.clone(),
2241            selection: query,
2242            graphql_client: self.graphql_client.clone(),
2243        }
2244    }
2245    /// The older/lower snapshot to compare against.
2246    pub fn before(&self) -> Directory {
2247        let query = self.selection.select("before");
2248        Directory {
2249            proc: self.proc.clone(),
2250            selection: query,
2251            graphql_client: self.graphql_client.clone(),
2252        }
2253    }
2254    /// Applies the diff represented by this changeset to a path on the host.
2255    ///
2256    /// # Arguments
2257    ///
2258    /// * `path` - Location of the copied directory (e.g., "logs/").
2259    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2260        let mut query = self.selection.select("export");
2261        query = query.arg("path", path.into());
2262        query.execute(self.graphql_client.clone()).await
2263    }
2264    /// A unique identifier for this Changeset.
2265    pub async fn id(&self) -> Result<ChangesetId, DaggerError> {
2266        let query = self.selection.select("id");
2267        query.execute(self.graphql_client.clone()).await
2268    }
2269    /// Return a snapshot containing only the created and modified files
2270    pub fn layer(&self) -> Directory {
2271        let query = self.selection.select("layer");
2272        Directory {
2273            proc: self.proc.clone(),
2274            selection: query,
2275            graphql_client: self.graphql_client.clone(),
2276        }
2277    }
2278    /// Files and directories that existed before and were updated in the newer directory.
2279    pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2280        let query = self.selection.select("modifiedPaths");
2281        query.execute(self.graphql_client.clone()).await
2282    }
2283    /// Files and directories that were removed. Directories are indicated by a trailing slash, and their child paths are not included.
2284    pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2285        let query = self.selection.select("removedPaths");
2286        query.execute(self.graphql_client.clone()).await
2287    }
2288    /// Force evaluation in the engine.
2289    pub async fn sync(&self) -> Result<ChangesetId, DaggerError> {
2290        let query = self.selection.select("sync");
2291        query.execute(self.graphql_client.clone()).await
2292    }
2293}
2294#[derive(Clone)]
2295pub struct Cloud {
2296    pub proc: Option<Arc<DaggerSessionProc>>,
2297    pub selection: Selection,
2298    pub graphql_client: DynGraphQLClient,
2299}
2300impl Cloud {
2301    /// A unique identifier for this Cloud.
2302    pub async fn id(&self) -> Result<CloudId, DaggerError> {
2303        let query = self.selection.select("id");
2304        query.execute(self.graphql_client.clone()).await
2305    }
2306    /// The trace URL for the current session
2307    pub async fn trace_url(&self) -> Result<String, DaggerError> {
2308        let query = self.selection.select("traceURL");
2309        query.execute(self.graphql_client.clone()).await
2310    }
2311}
2312#[derive(Clone)]
2313pub struct Container {
2314    pub proc: Option<Arc<DaggerSessionProc>>,
2315    pub selection: Selection,
2316    pub graphql_client: DynGraphQLClient,
2317}
2318#[derive(Builder, Debug, PartialEq)]
2319pub struct ContainerAsServiceOpts<'a> {
2320    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2321    /// If empty, the container's default command is used.
2322    #[builder(setter(into, strip_option), default)]
2323    pub args: Option<Vec<&'a str>>,
2324    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2325    #[builder(setter(into, strip_option), default)]
2326    pub expand: Option<bool>,
2327    /// Provides Dagger access to the executed command.
2328    #[builder(setter(into, strip_option), default)]
2329    pub experimental_privileged_nesting: Option<bool>,
2330    /// 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.
2331    #[builder(setter(into, strip_option), default)]
2332    pub insecure_root_capabilities: Option<bool>,
2333    /// If set, skip the automatic init process injected into containers by default.
2334    /// 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.
2335    #[builder(setter(into, strip_option), default)]
2336    pub no_init: Option<bool>,
2337    /// If the container has an entrypoint, prepend it to the args.
2338    #[builder(setter(into, strip_option), default)]
2339    pub use_entrypoint: Option<bool>,
2340}
2341#[derive(Builder, Debug, PartialEq)]
2342pub struct ContainerAsTarballOpts {
2343    /// Force each layer of the image to use the specified compression algorithm.
2344    /// 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.
2345    #[builder(setter(into, strip_option), default)]
2346    pub forced_compression: Option<ImageLayerCompression>,
2347    /// Use the specified media types for the image's layers.
2348    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2349    #[builder(setter(into, strip_option), default)]
2350    pub media_types: Option<ImageMediaTypes>,
2351    /// Identifiers for other platform specific containers.
2352    /// Used for multi-platform images.
2353    #[builder(setter(into, strip_option), default)]
2354    pub platform_variants: Option<Vec<ContainerId>>,
2355}
2356#[derive(Builder, Debug, PartialEq)]
2357pub struct ContainerDirectoryOpts {
2358    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2359    #[builder(setter(into, strip_option), default)]
2360    pub expand: Option<bool>,
2361}
2362#[derive(Builder, Debug, PartialEq)]
2363pub struct ContainerExistsOpts {
2364    /// If specified, do not follow symlinks.
2365    #[builder(setter(into, strip_option), default)]
2366    pub do_not_follow_symlinks: Option<bool>,
2367    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
2368    #[builder(setter(into, strip_option), default)]
2369    pub expected_type: Option<ExistsType>,
2370}
2371#[derive(Builder, Debug, PartialEq)]
2372pub struct ContainerExportOpts {
2373    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2374    #[builder(setter(into, strip_option), default)]
2375    pub expand: Option<bool>,
2376    /// Force each layer of the exported image to use the specified compression algorithm.
2377    /// 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.
2378    #[builder(setter(into, strip_option), default)]
2379    pub forced_compression: Option<ImageLayerCompression>,
2380    /// Use the specified media types for the exported image's layers.
2381    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2382    #[builder(setter(into, strip_option), default)]
2383    pub media_types: Option<ImageMediaTypes>,
2384    /// Identifiers for other platform specific containers.
2385    /// Used for multi-platform image.
2386    #[builder(setter(into, strip_option), default)]
2387    pub platform_variants: Option<Vec<ContainerId>>,
2388}
2389#[derive(Builder, Debug, PartialEq)]
2390pub struct ContainerExportImageOpts {
2391    /// Force each layer of the exported image to use the specified compression algorithm.
2392    /// 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.
2393    #[builder(setter(into, strip_option), default)]
2394    pub forced_compression: Option<ImageLayerCompression>,
2395    /// Use the specified media types for the exported image's layers.
2396    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2397    #[builder(setter(into, strip_option), default)]
2398    pub media_types: Option<ImageMediaTypes>,
2399    /// Identifiers for other platform specific containers.
2400    /// Used for multi-platform image.
2401    #[builder(setter(into, strip_option), default)]
2402    pub platform_variants: Option<Vec<ContainerId>>,
2403}
2404#[derive(Builder, Debug, PartialEq)]
2405pub struct ContainerFileOpts {
2406    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2407    #[builder(setter(into, strip_option), default)]
2408    pub expand: Option<bool>,
2409}
2410#[derive(Builder, Debug, PartialEq)]
2411pub struct ContainerImportOpts<'a> {
2412    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
2413    #[builder(setter(into, strip_option), default)]
2414    pub tag: Option<&'a str>,
2415}
2416#[derive(Builder, Debug, PartialEq)]
2417pub struct ContainerPublishOpts {
2418    /// Force each layer of the published image to use the specified compression algorithm.
2419    /// 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.
2420    #[builder(setter(into, strip_option), default)]
2421    pub forced_compression: Option<ImageLayerCompression>,
2422    /// Use the specified media types for the published image's layers.
2423    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
2424    #[builder(setter(into, strip_option), default)]
2425    pub media_types: Option<ImageMediaTypes>,
2426    /// Identifiers for other platform specific containers.
2427    /// Used for multi-platform image.
2428    #[builder(setter(into, strip_option), default)]
2429    pub platform_variants: Option<Vec<ContainerId>>,
2430}
2431#[derive(Builder, Debug, PartialEq)]
2432pub struct ContainerTerminalOpts<'a> {
2433    /// If set, override the container's default terminal command and invoke these command arguments instead.
2434    #[builder(setter(into, strip_option), default)]
2435    pub cmd: Option<Vec<&'a str>>,
2436    /// Provides Dagger access to the executed command.
2437    #[builder(setter(into, strip_option), default)]
2438    pub experimental_privileged_nesting: Option<bool>,
2439    /// 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.
2440    #[builder(setter(into, strip_option), default)]
2441    pub insecure_root_capabilities: Option<bool>,
2442}
2443#[derive(Builder, Debug, PartialEq)]
2444pub struct ContainerUpOpts<'a> {
2445    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2446    /// If empty, the container's default command is used.
2447    #[builder(setter(into, strip_option), default)]
2448    pub args: Option<Vec<&'a str>>,
2449    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2450    #[builder(setter(into, strip_option), default)]
2451    pub expand: Option<bool>,
2452    /// Provides Dagger access to the executed command.
2453    #[builder(setter(into, strip_option), default)]
2454    pub experimental_privileged_nesting: Option<bool>,
2455    /// 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.
2456    #[builder(setter(into, strip_option), default)]
2457    pub insecure_root_capabilities: Option<bool>,
2458    /// If set, skip the automatic init process injected into containers by default.
2459    /// 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.
2460    #[builder(setter(into, strip_option), default)]
2461    pub no_init: Option<bool>,
2462    /// List of frontend/backend port mappings to forward.
2463    /// Frontend is the port accepting traffic on the host, backend is the service port.
2464    #[builder(setter(into, strip_option), default)]
2465    pub ports: Option<Vec<PortForward>>,
2466    /// Bind each tunnel port to a random port on the host.
2467    #[builder(setter(into, strip_option), default)]
2468    pub random: Option<bool>,
2469    /// If the container has an entrypoint, prepend it to the args.
2470    #[builder(setter(into, strip_option), default)]
2471    pub use_entrypoint: Option<bool>,
2472}
2473#[derive(Builder, Debug, PartialEq)]
2474pub struct ContainerWithDefaultTerminalCmdOpts {
2475    /// Provides Dagger access to the executed command.
2476    #[builder(setter(into, strip_option), default)]
2477    pub experimental_privileged_nesting: Option<bool>,
2478    /// 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.
2479    #[builder(setter(into, strip_option), default)]
2480    pub insecure_root_capabilities: Option<bool>,
2481}
2482#[derive(Builder, Debug, PartialEq)]
2483pub struct ContainerWithDirectoryOpts<'a> {
2484    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
2485    #[builder(setter(into, strip_option), default)]
2486    pub exclude: Option<Vec<&'a str>>,
2487    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2488    #[builder(setter(into, strip_option), default)]
2489    pub expand: Option<bool>,
2490    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
2491    #[builder(setter(into, strip_option), default)]
2492    pub include: Option<Vec<&'a str>>,
2493    /// A user:group to set for the directory and its contents.
2494    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2495    /// If the group is omitted, it defaults to the same as the user.
2496    #[builder(setter(into, strip_option), default)]
2497    pub owner: Option<&'a str>,
2498}
2499#[derive(Builder, Debug, PartialEq)]
2500pub struct ContainerWithEntrypointOpts {
2501    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
2502    #[builder(setter(into, strip_option), default)]
2503    pub keep_default_args: Option<bool>,
2504}
2505#[derive(Builder, Debug, PartialEq)]
2506pub struct ContainerWithEnvVariableOpts {
2507    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
2508    #[builder(setter(into, strip_option), default)]
2509    pub expand: Option<bool>,
2510}
2511#[derive(Builder, Debug, PartialEq)]
2512pub struct ContainerWithExecOpts<'a> {
2513    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2514    #[builder(setter(into, strip_option), default)]
2515    pub expand: Option<bool>,
2516    /// Exit codes this command is allowed to exit with without error
2517    #[builder(setter(into, strip_option), default)]
2518    pub expect: Option<ReturnType>,
2519    /// Provides Dagger access to the executed command.
2520    #[builder(setter(into, strip_option), default)]
2521    pub experimental_privileged_nesting: Option<bool>,
2522    /// Execute the command with all root capabilities. Like --privileged in Docker
2523    /// 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.
2524    #[builder(setter(into, strip_option), default)]
2525    pub insecure_root_capabilities: Option<bool>,
2526    /// Skip the automatic init process injected into containers by default.
2527    /// 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.
2528    #[builder(setter(into, strip_option), default)]
2529    pub no_init: Option<bool>,
2530    /// Redirect the command's standard error to a file in the container. Example: "./stderr.txt"
2531    #[builder(setter(into, strip_option), default)]
2532    pub redirect_stderr: Option<&'a str>,
2533    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
2534    #[builder(setter(into, strip_option), default)]
2535    pub redirect_stdin: Option<&'a str>,
2536    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
2537    #[builder(setter(into, strip_option), default)]
2538    pub redirect_stdout: Option<&'a str>,
2539    /// Content to write to the command's standard input. Example: "Hello world")
2540    #[builder(setter(into, strip_option), default)]
2541    pub stdin: Option<&'a str>,
2542    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
2543    #[builder(setter(into, strip_option), default)]
2544    pub use_entrypoint: Option<bool>,
2545}
2546#[derive(Builder, Debug, PartialEq)]
2547pub struct ContainerWithExposedPortOpts<'a> {
2548    /// Port description. Example: "payment API endpoint"
2549    #[builder(setter(into, strip_option), default)]
2550    pub description: Option<&'a str>,
2551    /// Skip the health check when run as a service.
2552    #[builder(setter(into, strip_option), default)]
2553    pub experimental_skip_healthcheck: Option<bool>,
2554    /// Network protocol. Example: "tcp"
2555    #[builder(setter(into, strip_option), default)]
2556    pub protocol: Option<NetworkProtocol>,
2557}
2558#[derive(Builder, Debug, PartialEq)]
2559pub struct ContainerWithFileOpts<'a> {
2560    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2561    #[builder(setter(into, strip_option), default)]
2562    pub expand: Option<bool>,
2563    /// A user:group to set for the file.
2564    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2565    /// If the group is omitted, it defaults to the same as the user.
2566    #[builder(setter(into, strip_option), default)]
2567    pub owner: Option<&'a str>,
2568    /// Permissions of the new file. Example: 0600
2569    #[builder(setter(into, strip_option), default)]
2570    pub permissions: Option<isize>,
2571}
2572#[derive(Builder, Debug, PartialEq)]
2573pub struct ContainerWithFilesOpts<'a> {
2574    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2575    #[builder(setter(into, strip_option), default)]
2576    pub expand: Option<bool>,
2577    /// A user:group to set for the files.
2578    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2579    /// If the group is omitted, it defaults to the same as the user.
2580    #[builder(setter(into, strip_option), default)]
2581    pub owner: Option<&'a str>,
2582    /// Permission given to the copied files (e.g., 0600).
2583    #[builder(setter(into, strip_option), default)]
2584    pub permissions: Option<isize>,
2585}
2586#[derive(Builder, Debug, PartialEq)]
2587pub struct ContainerWithMountedCacheOpts<'a> {
2588    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2589    #[builder(setter(into, strip_option), default)]
2590    pub expand: Option<bool>,
2591    /// A user:group to set for the mounted cache directory.
2592    /// 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.
2593    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2594    /// If the group is omitted, it defaults to the same as the user.
2595    #[builder(setter(into, strip_option), default)]
2596    pub owner: Option<&'a str>,
2597    /// Sharing mode of the cache volume.
2598    #[builder(setter(into, strip_option), default)]
2599    pub sharing: Option<CacheSharingMode>,
2600    /// Identifier of the directory to use as the cache volume's root.
2601    #[builder(setter(into, strip_option), default)]
2602    pub source: Option<DirectoryId>,
2603}
2604#[derive(Builder, Debug, PartialEq)]
2605pub struct ContainerWithMountedDirectoryOpts<'a> {
2606    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2607    #[builder(setter(into, strip_option), default)]
2608    pub expand: Option<bool>,
2609    /// A user:group to set for the mounted directory and its contents.
2610    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2611    /// If the group is omitted, it defaults to the same as the user.
2612    #[builder(setter(into, strip_option), default)]
2613    pub owner: Option<&'a str>,
2614}
2615#[derive(Builder, Debug, PartialEq)]
2616pub struct ContainerWithMountedFileOpts<'a> {
2617    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2618    #[builder(setter(into, strip_option), default)]
2619    pub expand: Option<bool>,
2620    /// A user or user:group to set for the mounted file.
2621    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2622    /// If the group is omitted, it defaults to the same as the user.
2623    #[builder(setter(into, strip_option), default)]
2624    pub owner: Option<&'a str>,
2625}
2626#[derive(Builder, Debug, PartialEq)]
2627pub struct ContainerWithMountedSecretOpts<'a> {
2628    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2629    #[builder(setter(into, strip_option), default)]
2630    pub expand: Option<bool>,
2631    /// Permission given to the mounted secret (e.g., 0600).
2632    /// This option requires an owner to be set to be active.
2633    #[builder(setter(into, strip_option), default)]
2634    pub mode: Option<isize>,
2635    /// A user:group to set for the mounted secret.
2636    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2637    /// If the group is omitted, it defaults to the same as the user.
2638    #[builder(setter(into, strip_option), default)]
2639    pub owner: Option<&'a str>,
2640}
2641#[derive(Builder, Debug, PartialEq)]
2642pub struct ContainerWithMountedTempOpts {
2643    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2644    #[builder(setter(into, strip_option), default)]
2645    pub expand: Option<bool>,
2646    /// Size of the temporary directory in bytes.
2647    #[builder(setter(into, strip_option), default)]
2648    pub size: Option<isize>,
2649}
2650#[derive(Builder, Debug, PartialEq)]
2651pub struct ContainerWithNewFileOpts<'a> {
2652    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2653    #[builder(setter(into, strip_option), default)]
2654    pub expand: Option<bool>,
2655    /// A user:group to set for the file.
2656    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2657    /// If the group is omitted, it defaults to the same as the user.
2658    #[builder(setter(into, strip_option), default)]
2659    pub owner: Option<&'a str>,
2660    /// Permissions of the new file. Example: 0600
2661    #[builder(setter(into, strip_option), default)]
2662    pub permissions: Option<isize>,
2663}
2664#[derive(Builder, Debug, PartialEq)]
2665pub struct ContainerWithSymlinkOpts {
2666    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2667    #[builder(setter(into, strip_option), default)]
2668    pub expand: Option<bool>,
2669}
2670#[derive(Builder, Debug, PartialEq)]
2671pub struct ContainerWithUnixSocketOpts<'a> {
2672    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2673    #[builder(setter(into, strip_option), default)]
2674    pub expand: Option<bool>,
2675    /// A user:group to set for the mounted socket.
2676    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2677    /// If the group is omitted, it defaults to the same as the user.
2678    #[builder(setter(into, strip_option), default)]
2679    pub owner: Option<&'a str>,
2680}
2681#[derive(Builder, Debug, PartialEq)]
2682pub struct ContainerWithWorkdirOpts {
2683    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2684    #[builder(setter(into, strip_option), default)]
2685    pub expand: Option<bool>,
2686}
2687#[derive(Builder, Debug, PartialEq)]
2688pub struct ContainerWithoutDirectoryOpts {
2689    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2690    #[builder(setter(into, strip_option), default)]
2691    pub expand: Option<bool>,
2692}
2693#[derive(Builder, Debug, PartialEq)]
2694pub struct ContainerWithoutEntrypointOpts {
2695    /// Don't remove the default arguments when unsetting the entrypoint.
2696    #[builder(setter(into, strip_option), default)]
2697    pub keep_default_args: Option<bool>,
2698}
2699#[derive(Builder, Debug, PartialEq)]
2700pub struct ContainerWithoutExposedPortOpts {
2701    /// Port protocol to unexpose
2702    #[builder(setter(into, strip_option), default)]
2703    pub protocol: Option<NetworkProtocol>,
2704}
2705#[derive(Builder, Debug, PartialEq)]
2706pub struct ContainerWithoutFileOpts {
2707    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2708    #[builder(setter(into, strip_option), default)]
2709    pub expand: Option<bool>,
2710}
2711#[derive(Builder, Debug, PartialEq)]
2712pub struct ContainerWithoutFilesOpts {
2713    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2714    #[builder(setter(into, strip_option), default)]
2715    pub expand: Option<bool>,
2716}
2717#[derive(Builder, Debug, PartialEq)]
2718pub struct ContainerWithoutMountOpts {
2719    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2720    #[builder(setter(into, strip_option), default)]
2721    pub expand: Option<bool>,
2722}
2723#[derive(Builder, Debug, PartialEq)]
2724pub struct ContainerWithoutUnixSocketOpts {
2725    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2726    #[builder(setter(into, strip_option), default)]
2727    pub expand: Option<bool>,
2728}
2729impl Container {
2730    /// Turn the container into a Service.
2731    /// Be sure to set any exposed ports before this conversion.
2732    ///
2733    /// # Arguments
2734    ///
2735    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2736    pub fn as_service(&self) -> Service {
2737        let query = self.selection.select("asService");
2738        Service {
2739            proc: self.proc.clone(),
2740            selection: query,
2741            graphql_client: self.graphql_client.clone(),
2742        }
2743    }
2744    /// Turn the container into a Service.
2745    /// Be sure to set any exposed ports before this conversion.
2746    ///
2747    /// # Arguments
2748    ///
2749    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2750    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2751        let mut query = self.selection.select("asService");
2752        if let Some(args) = opts.args {
2753            query = query.arg("args", args);
2754        }
2755        if let Some(use_entrypoint) = opts.use_entrypoint {
2756            query = query.arg("useEntrypoint", use_entrypoint);
2757        }
2758        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2759            query = query.arg(
2760                "experimentalPrivilegedNesting",
2761                experimental_privileged_nesting,
2762            );
2763        }
2764        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2765            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2766        }
2767        if let Some(expand) = opts.expand {
2768            query = query.arg("expand", expand);
2769        }
2770        if let Some(no_init) = opts.no_init {
2771            query = query.arg("noInit", no_init);
2772        }
2773        Service {
2774            proc: self.proc.clone(),
2775            selection: query,
2776            graphql_client: self.graphql_client.clone(),
2777        }
2778    }
2779    /// Package the container state as an OCI image, and return it as a tar archive
2780    ///
2781    /// # Arguments
2782    ///
2783    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2784    pub fn as_tarball(&self) -> File {
2785        let query = self.selection.select("asTarball");
2786        File {
2787            proc: self.proc.clone(),
2788            selection: query,
2789            graphql_client: self.graphql_client.clone(),
2790        }
2791    }
2792    /// Package the container state as an OCI image, and return it as a tar archive
2793    ///
2794    /// # Arguments
2795    ///
2796    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2797    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2798        let mut query = self.selection.select("asTarball");
2799        if let Some(platform_variants) = opts.platform_variants {
2800            query = query.arg("platformVariants", platform_variants);
2801        }
2802        if let Some(forced_compression) = opts.forced_compression {
2803            query = query.arg("forcedCompression", forced_compression);
2804        }
2805        if let Some(media_types) = opts.media_types {
2806            query = query.arg("mediaTypes", media_types);
2807        }
2808        File {
2809            proc: self.proc.clone(),
2810            selection: query,
2811            graphql_client: self.graphql_client.clone(),
2812        }
2813    }
2814    /// The combined buffered standard output and standard error stream of the last executed command
2815    /// Returns an error if no command was executed
2816    pub async fn combined_output(&self) -> Result<String, DaggerError> {
2817        let query = self.selection.select("combinedOutput");
2818        query.execute(self.graphql_client.clone()).await
2819    }
2820    /// Return the container's default arguments.
2821    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2822        let query = self.selection.select("defaultArgs");
2823        query.execute(self.graphql_client.clone()).await
2824    }
2825    /// Retrieve a directory from the container's root filesystem
2826    /// Mounts are included.
2827    ///
2828    /// # Arguments
2829    ///
2830    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2831    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2832    pub fn directory(&self, path: impl Into<String>) -> Directory {
2833        let mut query = self.selection.select("directory");
2834        query = query.arg("path", path.into());
2835        Directory {
2836            proc: self.proc.clone(),
2837            selection: query,
2838            graphql_client: self.graphql_client.clone(),
2839        }
2840    }
2841    /// Retrieve a directory from the container's root filesystem
2842    /// Mounts are included.
2843    ///
2844    /// # Arguments
2845    ///
2846    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2847    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2848    pub fn directory_opts(
2849        &self,
2850        path: impl Into<String>,
2851        opts: ContainerDirectoryOpts,
2852    ) -> Directory {
2853        let mut query = self.selection.select("directory");
2854        query = query.arg("path", path.into());
2855        if let Some(expand) = opts.expand {
2856            query = query.arg("expand", expand);
2857        }
2858        Directory {
2859            proc: self.proc.clone(),
2860            selection: query,
2861            graphql_client: self.graphql_client.clone(),
2862        }
2863    }
2864    /// Return the container's OCI entrypoint.
2865    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2866        let query = self.selection.select("entrypoint");
2867        query.execute(self.graphql_client.clone()).await
2868    }
2869    /// Retrieves the value of the specified environment variable.
2870    ///
2871    /// # Arguments
2872    ///
2873    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
2874    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2875        let mut query = self.selection.select("envVariable");
2876        query = query.arg("name", name.into());
2877        query.execute(self.graphql_client.clone()).await
2878    }
2879    /// Retrieves the list of environment variables passed to commands.
2880    pub fn env_variables(&self) -> Vec<EnvVariable> {
2881        let query = self.selection.select("envVariables");
2882        vec![EnvVariable {
2883            proc: self.proc.clone(),
2884            selection: query,
2885            graphql_client: self.graphql_client.clone(),
2886        }]
2887    }
2888    /// check if a file or directory exists
2889    ///
2890    /// # Arguments
2891    ///
2892    /// * `path` - Path to check (e.g., "/file.txt").
2893    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2894    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2895        let mut query = self.selection.select("exists");
2896        query = query.arg("path", path.into());
2897        query.execute(self.graphql_client.clone()).await
2898    }
2899    /// check if a file or directory exists
2900    ///
2901    /// # Arguments
2902    ///
2903    /// * `path` - Path to check (e.g., "/file.txt").
2904    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2905    pub async fn exists_opts(
2906        &self,
2907        path: impl Into<String>,
2908        opts: ContainerExistsOpts,
2909    ) -> Result<bool, DaggerError> {
2910        let mut query = self.selection.select("exists");
2911        query = query.arg("path", path.into());
2912        if let Some(expected_type) = opts.expected_type {
2913            query = query.arg("expectedType", expected_type);
2914        }
2915        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2916            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2917        }
2918        query.execute(self.graphql_client.clone()).await
2919    }
2920    /// The exit code of the last executed command
2921    /// Returns an error if no command was executed
2922    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2923        let query = self.selection.select("exitCode");
2924        query.execute(self.graphql_client.clone()).await
2925    }
2926    /// EXPERIMENTAL API! Subject to change/removal at any time.
2927    /// Configures all available GPUs on the host to be accessible to this container.
2928    /// This currently works for Nvidia devices only.
2929    pub fn experimental_with_all_gp_us(&self) -> Container {
2930        let query = self.selection.select("experimentalWithAllGPUs");
2931        Container {
2932            proc: self.proc.clone(),
2933            selection: query,
2934            graphql_client: self.graphql_client.clone(),
2935        }
2936    }
2937    /// EXPERIMENTAL API! Subject to change/removal at any time.
2938    /// Configures the provided list of devices to be accessible to this container.
2939    /// This currently works for Nvidia devices only.
2940    ///
2941    /// # Arguments
2942    ///
2943    /// * `devices` - List of devices to be accessible to this container.
2944    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2945        let mut query = self.selection.select("experimentalWithGPU");
2946        query = query.arg(
2947            "devices",
2948            devices
2949                .into_iter()
2950                .map(|i| i.into())
2951                .collect::<Vec<String>>(),
2952        );
2953        Container {
2954            proc: self.proc.clone(),
2955            selection: query,
2956            graphql_client: self.graphql_client.clone(),
2957        }
2958    }
2959    /// Writes the container as an OCI tarball to the destination file path on the host.
2960    /// It can also export platform variants.
2961    ///
2962    /// # Arguments
2963    ///
2964    /// * `path` - Host's destination path (e.g., "./tarball").
2965    ///
2966    /// Path can be relative to the engine's workdir or absolute.
2967    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2968    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2969        let mut query = self.selection.select("export");
2970        query = query.arg("path", path.into());
2971        query.execute(self.graphql_client.clone()).await
2972    }
2973    /// Writes the container as an OCI tarball to the destination file path on the host.
2974    /// It can also export platform variants.
2975    ///
2976    /// # Arguments
2977    ///
2978    /// * `path` - Host's destination path (e.g., "./tarball").
2979    ///
2980    /// Path can be relative to the engine's workdir or absolute.
2981    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2982    pub async fn export_opts(
2983        &self,
2984        path: impl Into<String>,
2985        opts: ContainerExportOpts,
2986    ) -> Result<String, DaggerError> {
2987        let mut query = self.selection.select("export");
2988        query = query.arg("path", path.into());
2989        if let Some(platform_variants) = opts.platform_variants {
2990            query = query.arg("platformVariants", platform_variants);
2991        }
2992        if let Some(forced_compression) = opts.forced_compression {
2993            query = query.arg("forcedCompression", forced_compression);
2994        }
2995        if let Some(media_types) = opts.media_types {
2996            query = query.arg("mediaTypes", media_types);
2997        }
2998        if let Some(expand) = opts.expand {
2999            query = query.arg("expand", expand);
3000        }
3001        query.execute(self.graphql_client.clone()).await
3002    }
3003    /// Exports the container as an image to the host's container image store.
3004    ///
3005    /// # Arguments
3006    ///
3007    /// * `name` - Name of image to export to in the host's store
3008    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3009    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
3010        let mut query = self.selection.select("exportImage");
3011        query = query.arg("name", name.into());
3012        query.execute(self.graphql_client.clone()).await
3013    }
3014    /// Exports the container as an image to the host's container image store.
3015    ///
3016    /// # Arguments
3017    ///
3018    /// * `name` - Name of image to export to in the host's store
3019    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3020    pub async fn export_image_opts(
3021        &self,
3022        name: impl Into<String>,
3023        opts: ContainerExportImageOpts,
3024    ) -> Result<Void, DaggerError> {
3025        let mut query = self.selection.select("exportImage");
3026        query = query.arg("name", name.into());
3027        if let Some(platform_variants) = opts.platform_variants {
3028            query = query.arg("platformVariants", platform_variants);
3029        }
3030        if let Some(forced_compression) = opts.forced_compression {
3031            query = query.arg("forcedCompression", forced_compression);
3032        }
3033        if let Some(media_types) = opts.media_types {
3034            query = query.arg("mediaTypes", media_types);
3035        }
3036        query.execute(self.graphql_client.clone()).await
3037    }
3038    /// Retrieves the list of exposed ports.
3039    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
3040    pub fn exposed_ports(&self) -> Vec<Port> {
3041        let query = self.selection.select("exposedPorts");
3042        vec![Port {
3043            proc: self.proc.clone(),
3044            selection: query,
3045            graphql_client: self.graphql_client.clone(),
3046        }]
3047    }
3048    /// Retrieves a file at the given path.
3049    /// Mounts are included.
3050    ///
3051    /// # Arguments
3052    ///
3053    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3054    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3055    pub fn file(&self, path: impl Into<String>) -> File {
3056        let mut query = self.selection.select("file");
3057        query = query.arg("path", path.into());
3058        File {
3059            proc: self.proc.clone(),
3060            selection: query,
3061            graphql_client: self.graphql_client.clone(),
3062        }
3063    }
3064    /// Retrieves a file at the given path.
3065    /// Mounts are included.
3066    ///
3067    /// # Arguments
3068    ///
3069    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3070    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3071    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3072        let mut query = self.selection.select("file");
3073        query = query.arg("path", path.into());
3074        if let Some(expand) = opts.expand {
3075            query = query.arg("expand", expand);
3076        }
3077        File {
3078            proc: self.proc.clone(),
3079            selection: query,
3080            graphql_client: self.graphql_client.clone(),
3081        }
3082    }
3083    /// Download a container image, and apply it to the container state. All previous state will be lost.
3084    ///
3085    /// # Arguments
3086    ///
3087    /// * `address` - Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
3088    pub fn from(&self, address: impl Into<String>) -> Container {
3089        let mut query = self.selection.select("from");
3090        query = query.arg("address", address.into());
3091        Container {
3092            proc: self.proc.clone(),
3093            selection: query,
3094            graphql_client: self.graphql_client.clone(),
3095        }
3096    }
3097    /// A unique identifier for this Container.
3098    pub async fn id(&self) -> Result<ContainerId, DaggerError> {
3099        let query = self.selection.select("id");
3100        query.execute(self.graphql_client.clone()).await
3101    }
3102    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
3103    pub async fn image_ref(&self) -> Result<String, DaggerError> {
3104        let query = self.selection.select("imageRef");
3105        query.execute(self.graphql_client.clone()).await
3106    }
3107    /// Reads the container from an OCI tarball.
3108    ///
3109    /// # Arguments
3110    ///
3111    /// * `source` - File to read the container from.
3112    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3113    pub fn import(&self, source: impl IntoID<FileId>) -> Container {
3114        let mut query = self.selection.select("import");
3115        query = query.arg_lazy(
3116            "source",
3117            Box::new(move || {
3118                let source = source.clone();
3119                Box::pin(async move { source.into_id().await.unwrap().quote() })
3120            }),
3121        );
3122        Container {
3123            proc: self.proc.clone(),
3124            selection: query,
3125            graphql_client: self.graphql_client.clone(),
3126        }
3127    }
3128    /// Reads the container from an OCI tarball.
3129    ///
3130    /// # Arguments
3131    ///
3132    /// * `source` - File to read the container from.
3133    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3134    pub fn import_opts<'a>(
3135        &self,
3136        source: impl IntoID<FileId>,
3137        opts: ContainerImportOpts<'a>,
3138    ) -> Container {
3139        let mut query = self.selection.select("import");
3140        query = query.arg_lazy(
3141            "source",
3142            Box::new(move || {
3143                let source = source.clone();
3144                Box::pin(async move { source.into_id().await.unwrap().quote() })
3145            }),
3146        );
3147        if let Some(tag) = opts.tag {
3148            query = query.arg("tag", tag);
3149        }
3150        Container {
3151            proc: self.proc.clone(),
3152            selection: query,
3153            graphql_client: self.graphql_client.clone(),
3154        }
3155    }
3156    /// Retrieves the value of the specified label.
3157    ///
3158    /// # Arguments
3159    ///
3160    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3161    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3162        let mut query = self.selection.select("label");
3163        query = query.arg("name", name.into());
3164        query.execute(self.graphql_client.clone()).await
3165    }
3166    /// Retrieves the list of labels passed to container.
3167    pub fn labels(&self) -> Vec<Label> {
3168        let query = self.selection.select("labels");
3169        vec![Label {
3170            proc: self.proc.clone(),
3171            selection: query,
3172            graphql_client: self.graphql_client.clone(),
3173        }]
3174    }
3175    /// Retrieves the list of paths where a directory is mounted.
3176    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
3177        let query = self.selection.select("mounts");
3178        query.execute(self.graphql_client.clone()).await
3179    }
3180    /// The platform this container executes and publishes as.
3181    pub async fn platform(&self) -> Result<Platform, DaggerError> {
3182        let query = self.selection.select("platform");
3183        query.execute(self.graphql_client.clone()).await
3184    }
3185    /// Package the container state as an OCI image, and publish it to a registry
3186    /// Returns the fully qualified address of the published image, with digest
3187    ///
3188    /// # Arguments
3189    ///
3190    /// * `address` - The OCI address to publish to
3191    ///
3192    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
3193    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3194    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
3195        let mut query = self.selection.select("publish");
3196        query = query.arg("address", address.into());
3197        query.execute(self.graphql_client.clone()).await
3198    }
3199    /// Package the container state as an OCI image, and publish it to a registry
3200    /// Returns the fully qualified address of the published image, with digest
3201    ///
3202    /// # Arguments
3203    ///
3204    /// * `address` - The OCI address to publish to
3205    ///
3206    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
3207    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3208    pub async fn publish_opts(
3209        &self,
3210        address: impl Into<String>,
3211        opts: ContainerPublishOpts,
3212    ) -> Result<String, DaggerError> {
3213        let mut query = self.selection.select("publish");
3214        query = query.arg("address", address.into());
3215        if let Some(platform_variants) = opts.platform_variants {
3216            query = query.arg("platformVariants", platform_variants);
3217        }
3218        if let Some(forced_compression) = opts.forced_compression {
3219            query = query.arg("forcedCompression", forced_compression);
3220        }
3221        if let Some(media_types) = opts.media_types {
3222            query = query.arg("mediaTypes", media_types);
3223        }
3224        query.execute(self.graphql_client.clone()).await
3225    }
3226    /// 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.
3227    pub fn rootfs(&self) -> Directory {
3228        let query = self.selection.select("rootfs");
3229        Directory {
3230            proc: self.proc.clone(),
3231            selection: query,
3232            graphql_client: self.graphql_client.clone(),
3233        }
3234    }
3235    /// The buffered standard error stream of the last executed command
3236    /// Returns an error if no command was executed
3237    pub async fn stderr(&self) -> Result<String, DaggerError> {
3238        let query = self.selection.select("stderr");
3239        query.execute(self.graphql_client.clone()).await
3240    }
3241    /// The buffered standard output stream of the last executed command
3242    /// Returns an error if no command was executed
3243    pub async fn stdout(&self) -> Result<String, DaggerError> {
3244        let query = self.selection.select("stdout");
3245        query.execute(self.graphql_client.clone()).await
3246    }
3247    /// Forces evaluation of the pipeline in the engine.
3248    /// It doesn't run the default command if no exec has been set.
3249    pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
3250        let query = self.selection.select("sync");
3251        query.execute(self.graphql_client.clone()).await
3252    }
3253    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
3254    ///
3255    /// # Arguments
3256    ///
3257    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3258    pub fn terminal(&self) -> Container {
3259        let query = self.selection.select("terminal");
3260        Container {
3261            proc: self.proc.clone(),
3262            selection: query,
3263            graphql_client: self.graphql_client.clone(),
3264        }
3265    }
3266    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
3267    ///
3268    /// # Arguments
3269    ///
3270    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3271    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
3272        let mut query = self.selection.select("terminal");
3273        if let Some(cmd) = opts.cmd {
3274            query = query.arg("cmd", cmd);
3275        }
3276        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3277            query = query.arg(
3278                "experimentalPrivilegedNesting",
3279                experimental_privileged_nesting,
3280            );
3281        }
3282        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3283            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3284        }
3285        Container {
3286            proc: self.proc.clone(),
3287            selection: query,
3288            graphql_client: self.graphql_client.clone(),
3289        }
3290    }
3291    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3292    /// Be sure to set any exposed ports before calling this api.
3293    ///
3294    /// # Arguments
3295    ///
3296    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3297    pub async fn up(&self) -> Result<Void, DaggerError> {
3298        let query = self.selection.select("up");
3299        query.execute(self.graphql_client.clone()).await
3300    }
3301    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3302    /// Be sure to set any exposed ports before calling this api.
3303    ///
3304    /// # Arguments
3305    ///
3306    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3307    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
3308        let mut query = self.selection.select("up");
3309        if let Some(random) = opts.random {
3310            query = query.arg("random", random);
3311        }
3312        if let Some(ports) = opts.ports {
3313            query = query.arg("ports", ports);
3314        }
3315        if let Some(args) = opts.args {
3316            query = query.arg("args", args);
3317        }
3318        if let Some(use_entrypoint) = opts.use_entrypoint {
3319            query = query.arg("useEntrypoint", use_entrypoint);
3320        }
3321        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3322            query = query.arg(
3323                "experimentalPrivilegedNesting",
3324                experimental_privileged_nesting,
3325            );
3326        }
3327        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3328            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3329        }
3330        if let Some(expand) = opts.expand {
3331            query = query.arg("expand", expand);
3332        }
3333        if let Some(no_init) = opts.no_init {
3334            query = query.arg("noInit", no_init);
3335        }
3336        query.execute(self.graphql_client.clone()).await
3337    }
3338    /// Retrieves the user to be set for all commands.
3339    pub async fn user(&self) -> Result<String, DaggerError> {
3340        let query = self.selection.select("user");
3341        query.execute(self.graphql_client.clone()).await
3342    }
3343    /// Retrieves this container plus the given OCI anotation.
3344    ///
3345    /// # Arguments
3346    ///
3347    /// * `name` - The name of the annotation.
3348    /// * `value` - The value of the annotation.
3349    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3350        let mut query = self.selection.select("withAnnotation");
3351        query = query.arg("name", name.into());
3352        query = query.arg("value", value.into());
3353        Container {
3354            proc: self.proc.clone(),
3355            selection: query,
3356            graphql_client: self.graphql_client.clone(),
3357        }
3358    }
3359    /// Configures default arguments for future commands. Like CMD in Dockerfile.
3360    ///
3361    /// # Arguments
3362    ///
3363    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
3364    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
3365        let mut query = self.selection.select("withDefaultArgs");
3366        query = query.arg(
3367            "args",
3368            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3369        );
3370        Container {
3371            proc: self.proc.clone(),
3372            selection: query,
3373            graphql_client: self.graphql_client.clone(),
3374        }
3375    }
3376    /// Set the default command to invoke for the container's terminal API.
3377    ///
3378    /// # Arguments
3379    ///
3380    /// * `args` - The args of the command.
3381    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3382    pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
3383        let mut query = self.selection.select("withDefaultTerminalCmd");
3384        query = query.arg(
3385            "args",
3386            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3387        );
3388        Container {
3389            proc: self.proc.clone(),
3390            selection: query,
3391            graphql_client: self.graphql_client.clone(),
3392        }
3393    }
3394    /// Set the default command to invoke for the container's terminal API.
3395    ///
3396    /// # Arguments
3397    ///
3398    /// * `args` - The args of the command.
3399    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3400    pub fn with_default_terminal_cmd_opts(
3401        &self,
3402        args: Vec<impl Into<String>>,
3403        opts: ContainerWithDefaultTerminalCmdOpts,
3404    ) -> Container {
3405        let mut query = self.selection.select("withDefaultTerminalCmd");
3406        query = query.arg(
3407            "args",
3408            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3409        );
3410        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3411            query = query.arg(
3412                "experimentalPrivilegedNesting",
3413                experimental_privileged_nesting,
3414            );
3415        }
3416        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3417            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3418        }
3419        Container {
3420            proc: self.proc.clone(),
3421            selection: query,
3422            graphql_client: self.graphql_client.clone(),
3423        }
3424    }
3425    /// Return a new container snapshot, with a directory added to its filesystem
3426    ///
3427    /// # Arguments
3428    ///
3429    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
3430    /// * `source` - Identifier of the directory to write
3431    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3432    pub fn with_directory(
3433        &self,
3434        path: impl Into<String>,
3435        source: impl IntoID<DirectoryId>,
3436    ) -> Container {
3437        let mut query = self.selection.select("withDirectory");
3438        query = query.arg("path", path.into());
3439        query = query.arg_lazy(
3440            "source",
3441            Box::new(move || {
3442                let source = source.clone();
3443                Box::pin(async move { source.into_id().await.unwrap().quote() })
3444            }),
3445        );
3446        Container {
3447            proc: self.proc.clone(),
3448            selection: query,
3449            graphql_client: self.graphql_client.clone(),
3450        }
3451    }
3452    /// Return a new container snapshot, with a directory added to its filesystem
3453    ///
3454    /// # Arguments
3455    ///
3456    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
3457    /// * `source` - Identifier of the directory to write
3458    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3459    pub fn with_directory_opts<'a>(
3460        &self,
3461        path: impl Into<String>,
3462        source: impl IntoID<DirectoryId>,
3463        opts: ContainerWithDirectoryOpts<'a>,
3464    ) -> Container {
3465        let mut query = self.selection.select("withDirectory");
3466        query = query.arg("path", path.into());
3467        query = query.arg_lazy(
3468            "source",
3469            Box::new(move || {
3470                let source = source.clone();
3471                Box::pin(async move { source.into_id().await.unwrap().quote() })
3472            }),
3473        );
3474        if let Some(exclude) = opts.exclude {
3475            query = query.arg("exclude", exclude);
3476        }
3477        if let Some(include) = opts.include {
3478            query = query.arg("include", include);
3479        }
3480        if let Some(owner) = opts.owner {
3481            query = query.arg("owner", owner);
3482        }
3483        if let Some(expand) = opts.expand {
3484            query = query.arg("expand", expand);
3485        }
3486        Container {
3487            proc: self.proc.clone(),
3488            selection: query,
3489            graphql_client: self.graphql_client.clone(),
3490        }
3491    }
3492    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
3493    ///
3494    /// # Arguments
3495    ///
3496    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
3497    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3498    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
3499        let mut query = self.selection.select("withEntrypoint");
3500        query = query.arg(
3501            "args",
3502            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3503        );
3504        Container {
3505            proc: self.proc.clone(),
3506            selection: query,
3507            graphql_client: self.graphql_client.clone(),
3508        }
3509    }
3510    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
3511    ///
3512    /// # Arguments
3513    ///
3514    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
3515    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3516    pub fn with_entrypoint_opts(
3517        &self,
3518        args: Vec<impl Into<String>>,
3519        opts: ContainerWithEntrypointOpts,
3520    ) -> Container {
3521        let mut query = self.selection.select("withEntrypoint");
3522        query = query.arg(
3523            "args",
3524            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3525        );
3526        if let Some(keep_default_args) = opts.keep_default_args {
3527            query = query.arg("keepDefaultArgs", keep_default_args);
3528        }
3529        Container {
3530            proc: self.proc.clone(),
3531            selection: query,
3532            graphql_client: self.graphql_client.clone(),
3533        }
3534    }
3535    /// Set a new environment variable in the container.
3536    ///
3537    /// # Arguments
3538    ///
3539    /// * `name` - Name of the environment variable (e.g., "HOST").
3540    /// * `value` - Value of the environment variable. (e.g., "localhost").
3541    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3542    pub fn with_env_variable(
3543        &self,
3544        name: impl Into<String>,
3545        value: impl Into<String>,
3546    ) -> Container {
3547        let mut query = self.selection.select("withEnvVariable");
3548        query = query.arg("name", name.into());
3549        query = query.arg("value", value.into());
3550        Container {
3551            proc: self.proc.clone(),
3552            selection: query,
3553            graphql_client: self.graphql_client.clone(),
3554        }
3555    }
3556    /// Set a new environment variable in the container.
3557    ///
3558    /// # Arguments
3559    ///
3560    /// * `name` - Name of the environment variable (e.g., "HOST").
3561    /// * `value` - Value of the environment variable. (e.g., "localhost").
3562    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3563    pub fn with_env_variable_opts(
3564        &self,
3565        name: impl Into<String>,
3566        value: impl Into<String>,
3567        opts: ContainerWithEnvVariableOpts,
3568    ) -> Container {
3569        let mut query = self.selection.select("withEnvVariable");
3570        query = query.arg("name", name.into());
3571        query = query.arg("value", value.into());
3572        if let Some(expand) = opts.expand {
3573            query = query.arg("expand", expand);
3574        }
3575        Container {
3576            proc: self.proc.clone(),
3577            selection: query,
3578            graphql_client: self.graphql_client.clone(),
3579        }
3580    }
3581    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3582    ///
3583    /// # Arguments
3584    ///
3585    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3586    ///
3587    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3588    ///
3589    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3590    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3591    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3592        let mut query = self.selection.select("withExec");
3593        query = query.arg(
3594            "args",
3595            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3596        );
3597        Container {
3598            proc: self.proc.clone(),
3599            selection: query,
3600            graphql_client: self.graphql_client.clone(),
3601        }
3602    }
3603    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3604    ///
3605    /// # Arguments
3606    ///
3607    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3608    ///
3609    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3610    ///
3611    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3612    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3613    pub fn with_exec_opts<'a>(
3614        &self,
3615        args: Vec<impl Into<String>>,
3616        opts: ContainerWithExecOpts<'a>,
3617    ) -> Container {
3618        let mut query = self.selection.select("withExec");
3619        query = query.arg(
3620            "args",
3621            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3622        );
3623        if let Some(use_entrypoint) = opts.use_entrypoint {
3624            query = query.arg("useEntrypoint", use_entrypoint);
3625        }
3626        if let Some(stdin) = opts.stdin {
3627            query = query.arg("stdin", stdin);
3628        }
3629        if let Some(redirect_stdin) = opts.redirect_stdin {
3630            query = query.arg("redirectStdin", redirect_stdin);
3631        }
3632        if let Some(redirect_stdout) = opts.redirect_stdout {
3633            query = query.arg("redirectStdout", redirect_stdout);
3634        }
3635        if let Some(redirect_stderr) = opts.redirect_stderr {
3636            query = query.arg("redirectStderr", redirect_stderr);
3637        }
3638        if let Some(expect) = opts.expect {
3639            query = query.arg("expect", expect);
3640        }
3641        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3642            query = query.arg(
3643                "experimentalPrivilegedNesting",
3644                experimental_privileged_nesting,
3645            );
3646        }
3647        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3648            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3649        }
3650        if let Some(expand) = opts.expand {
3651            query = query.arg("expand", expand);
3652        }
3653        if let Some(no_init) = opts.no_init {
3654            query = query.arg("noInit", no_init);
3655        }
3656        Container {
3657            proc: self.proc.clone(),
3658            selection: query,
3659            graphql_client: self.graphql_client.clone(),
3660        }
3661    }
3662    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3663    /// Exposed ports serve two purposes:
3664    /// - For health checks and introspection, when running services
3665    /// - For setting the EXPOSE OCI field when publishing the container
3666    ///
3667    /// # Arguments
3668    ///
3669    /// * `port` - Port number to expose. Example: 8080
3670    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3671    pub fn with_exposed_port(&self, port: isize) -> Container {
3672        let mut query = self.selection.select("withExposedPort");
3673        query = query.arg("port", port);
3674        Container {
3675            proc: self.proc.clone(),
3676            selection: query,
3677            graphql_client: self.graphql_client.clone(),
3678        }
3679    }
3680    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3681    /// Exposed ports serve two purposes:
3682    /// - For health checks and introspection, when running services
3683    /// - For setting the EXPOSE OCI field when publishing the container
3684    ///
3685    /// # Arguments
3686    ///
3687    /// * `port` - Port number to expose. Example: 8080
3688    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3689    pub fn with_exposed_port_opts<'a>(
3690        &self,
3691        port: isize,
3692        opts: ContainerWithExposedPortOpts<'a>,
3693    ) -> Container {
3694        let mut query = self.selection.select("withExposedPort");
3695        query = query.arg("port", port);
3696        if let Some(protocol) = opts.protocol {
3697            query = query.arg("protocol", protocol);
3698        }
3699        if let Some(description) = opts.description {
3700            query = query.arg("description", description);
3701        }
3702        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3703            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3704        }
3705        Container {
3706            proc: self.proc.clone(),
3707            selection: query,
3708            graphql_client: self.graphql_client.clone(),
3709        }
3710    }
3711    /// Return a container snapshot with a file added
3712    ///
3713    /// # Arguments
3714    ///
3715    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3716    /// * `source` - File to add
3717    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3718    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
3719        let mut query = self.selection.select("withFile");
3720        query = query.arg("path", path.into());
3721        query = query.arg_lazy(
3722            "source",
3723            Box::new(move || {
3724                let source = source.clone();
3725                Box::pin(async move { source.into_id().await.unwrap().quote() })
3726            }),
3727        );
3728        Container {
3729            proc: self.proc.clone(),
3730            selection: query,
3731            graphql_client: self.graphql_client.clone(),
3732        }
3733    }
3734    /// Return a container snapshot with a file added
3735    ///
3736    /// # Arguments
3737    ///
3738    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3739    /// * `source` - File to add
3740    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3741    pub fn with_file_opts<'a>(
3742        &self,
3743        path: impl Into<String>,
3744        source: impl IntoID<FileId>,
3745        opts: ContainerWithFileOpts<'a>,
3746    ) -> Container {
3747        let mut query = self.selection.select("withFile");
3748        query = query.arg("path", path.into());
3749        query = query.arg_lazy(
3750            "source",
3751            Box::new(move || {
3752                let source = source.clone();
3753                Box::pin(async move { source.into_id().await.unwrap().quote() })
3754            }),
3755        );
3756        if let Some(permissions) = opts.permissions {
3757            query = query.arg("permissions", permissions);
3758        }
3759        if let Some(owner) = opts.owner {
3760            query = query.arg("owner", owner);
3761        }
3762        if let Some(expand) = opts.expand {
3763            query = query.arg("expand", expand);
3764        }
3765        Container {
3766            proc: self.proc.clone(),
3767            selection: query,
3768            graphql_client: self.graphql_client.clone(),
3769        }
3770    }
3771    /// Retrieves this container plus the contents of the given files copied to the given path.
3772    ///
3773    /// # Arguments
3774    ///
3775    /// * `path` - Location where copied files should be placed (e.g., "/src").
3776    /// * `sources` - Identifiers of the files to copy.
3777    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3778    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
3779        let mut query = self.selection.select("withFiles");
3780        query = query.arg("path", path.into());
3781        query = query.arg("sources", sources);
3782        Container {
3783            proc: self.proc.clone(),
3784            selection: query,
3785            graphql_client: self.graphql_client.clone(),
3786        }
3787    }
3788    /// Retrieves this container plus the contents of the given files copied to the given path.
3789    ///
3790    /// # Arguments
3791    ///
3792    /// * `path` - Location where copied files should be placed (e.g., "/src").
3793    /// * `sources` - Identifiers of the files to copy.
3794    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3795    pub fn with_files_opts<'a>(
3796        &self,
3797        path: impl Into<String>,
3798        sources: Vec<FileId>,
3799        opts: ContainerWithFilesOpts<'a>,
3800    ) -> Container {
3801        let mut query = self.selection.select("withFiles");
3802        query = query.arg("path", path.into());
3803        query = query.arg("sources", sources);
3804        if let Some(permissions) = opts.permissions {
3805            query = query.arg("permissions", permissions);
3806        }
3807        if let Some(owner) = opts.owner {
3808            query = query.arg("owner", owner);
3809        }
3810        if let Some(expand) = opts.expand {
3811            query = query.arg("expand", expand);
3812        }
3813        Container {
3814            proc: self.proc.clone(),
3815            selection: query,
3816            graphql_client: self.graphql_client.clone(),
3817        }
3818    }
3819    /// Retrieves this container plus the given label.
3820    ///
3821    /// # Arguments
3822    ///
3823    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3824    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
3825    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3826        let mut query = self.selection.select("withLabel");
3827        query = query.arg("name", name.into());
3828        query = query.arg("value", value.into());
3829        Container {
3830            proc: self.proc.clone(),
3831            selection: query,
3832            graphql_client: self.graphql_client.clone(),
3833        }
3834    }
3835    /// Retrieves this container plus a cache volume mounted at the given path.
3836    ///
3837    /// # Arguments
3838    ///
3839    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3840    /// * `cache` - Identifier of the cache volume to mount.
3841    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3842    pub fn with_mounted_cache(
3843        &self,
3844        path: impl Into<String>,
3845        cache: impl IntoID<CacheVolumeId>,
3846    ) -> Container {
3847        let mut query = self.selection.select("withMountedCache");
3848        query = query.arg("path", path.into());
3849        query = query.arg_lazy(
3850            "cache",
3851            Box::new(move || {
3852                let cache = cache.clone();
3853                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3854            }),
3855        );
3856        Container {
3857            proc: self.proc.clone(),
3858            selection: query,
3859            graphql_client: self.graphql_client.clone(),
3860        }
3861    }
3862    /// Retrieves this container plus a cache volume mounted at the given path.
3863    ///
3864    /// # Arguments
3865    ///
3866    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3867    /// * `cache` - Identifier of the cache volume to mount.
3868    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3869    pub fn with_mounted_cache_opts<'a>(
3870        &self,
3871        path: impl Into<String>,
3872        cache: impl IntoID<CacheVolumeId>,
3873        opts: ContainerWithMountedCacheOpts<'a>,
3874    ) -> Container {
3875        let mut query = self.selection.select("withMountedCache");
3876        query = query.arg("path", path.into());
3877        query = query.arg_lazy(
3878            "cache",
3879            Box::new(move || {
3880                let cache = cache.clone();
3881                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3882            }),
3883        );
3884        if let Some(source) = opts.source {
3885            query = query.arg("source", source);
3886        }
3887        if let Some(sharing) = opts.sharing {
3888            query = query.arg("sharing", sharing);
3889        }
3890        if let Some(owner) = opts.owner {
3891            query = query.arg("owner", owner);
3892        }
3893        if let Some(expand) = opts.expand {
3894            query = query.arg("expand", expand);
3895        }
3896        Container {
3897            proc: self.proc.clone(),
3898            selection: query,
3899            graphql_client: self.graphql_client.clone(),
3900        }
3901    }
3902    /// Retrieves this container plus a directory mounted at the given path.
3903    ///
3904    /// # Arguments
3905    ///
3906    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3907    /// * `source` - Identifier of the mounted directory.
3908    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3909    pub fn with_mounted_directory(
3910        &self,
3911        path: impl Into<String>,
3912        source: impl IntoID<DirectoryId>,
3913    ) -> Container {
3914        let mut query = self.selection.select("withMountedDirectory");
3915        query = query.arg("path", path.into());
3916        query = query.arg_lazy(
3917            "source",
3918            Box::new(move || {
3919                let source = source.clone();
3920                Box::pin(async move { source.into_id().await.unwrap().quote() })
3921            }),
3922        );
3923        Container {
3924            proc: self.proc.clone(),
3925            selection: query,
3926            graphql_client: self.graphql_client.clone(),
3927        }
3928    }
3929    /// Retrieves this container plus a directory mounted at the given path.
3930    ///
3931    /// # Arguments
3932    ///
3933    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3934    /// * `source` - Identifier of the mounted directory.
3935    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3936    pub fn with_mounted_directory_opts<'a>(
3937        &self,
3938        path: impl Into<String>,
3939        source: impl IntoID<DirectoryId>,
3940        opts: ContainerWithMountedDirectoryOpts<'a>,
3941    ) -> Container {
3942        let mut query = self.selection.select("withMountedDirectory");
3943        query = query.arg("path", path.into());
3944        query = query.arg_lazy(
3945            "source",
3946            Box::new(move || {
3947                let source = source.clone();
3948                Box::pin(async move { source.into_id().await.unwrap().quote() })
3949            }),
3950        );
3951        if let Some(owner) = opts.owner {
3952            query = query.arg("owner", owner);
3953        }
3954        if let Some(expand) = opts.expand {
3955            query = query.arg("expand", expand);
3956        }
3957        Container {
3958            proc: self.proc.clone(),
3959            selection: query,
3960            graphql_client: self.graphql_client.clone(),
3961        }
3962    }
3963    /// Retrieves this container plus a file mounted at the given path.
3964    ///
3965    /// # Arguments
3966    ///
3967    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3968    /// * `source` - Identifier of the mounted file.
3969    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3970    pub fn with_mounted_file(
3971        &self,
3972        path: impl Into<String>,
3973        source: impl IntoID<FileId>,
3974    ) -> Container {
3975        let mut query = self.selection.select("withMountedFile");
3976        query = query.arg("path", path.into());
3977        query = query.arg_lazy(
3978            "source",
3979            Box::new(move || {
3980                let source = source.clone();
3981                Box::pin(async move { source.into_id().await.unwrap().quote() })
3982            }),
3983        );
3984        Container {
3985            proc: self.proc.clone(),
3986            selection: query,
3987            graphql_client: self.graphql_client.clone(),
3988        }
3989    }
3990    /// Retrieves this container plus a file mounted at the given path.
3991    ///
3992    /// # Arguments
3993    ///
3994    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
3995    /// * `source` - Identifier of the mounted file.
3996    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3997    pub fn with_mounted_file_opts<'a>(
3998        &self,
3999        path: impl Into<String>,
4000        source: impl IntoID<FileId>,
4001        opts: ContainerWithMountedFileOpts<'a>,
4002    ) -> Container {
4003        let mut query = self.selection.select("withMountedFile");
4004        query = query.arg("path", path.into());
4005        query = query.arg_lazy(
4006            "source",
4007            Box::new(move || {
4008                let source = source.clone();
4009                Box::pin(async move { source.into_id().await.unwrap().quote() })
4010            }),
4011        );
4012        if let Some(owner) = opts.owner {
4013            query = query.arg("owner", owner);
4014        }
4015        if let Some(expand) = opts.expand {
4016            query = query.arg("expand", expand);
4017        }
4018        Container {
4019            proc: self.proc.clone(),
4020            selection: query,
4021            graphql_client: self.graphql_client.clone(),
4022        }
4023    }
4024    /// Retrieves this container plus a secret mounted into a file at the given path.
4025    ///
4026    /// # Arguments
4027    ///
4028    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4029    /// * `source` - Identifier of the secret to mount.
4030    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4031    pub fn with_mounted_secret(
4032        &self,
4033        path: impl Into<String>,
4034        source: impl IntoID<SecretId>,
4035    ) -> Container {
4036        let mut query = self.selection.select("withMountedSecret");
4037        query = query.arg("path", path.into());
4038        query = query.arg_lazy(
4039            "source",
4040            Box::new(move || {
4041                let source = source.clone();
4042                Box::pin(async move { source.into_id().await.unwrap().quote() })
4043            }),
4044        );
4045        Container {
4046            proc: self.proc.clone(),
4047            selection: query,
4048            graphql_client: self.graphql_client.clone(),
4049        }
4050    }
4051    /// Retrieves this container plus a secret mounted into a file at the given path.
4052    ///
4053    /// # Arguments
4054    ///
4055    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4056    /// * `source` - Identifier of the secret to mount.
4057    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4058    pub fn with_mounted_secret_opts<'a>(
4059        &self,
4060        path: impl Into<String>,
4061        source: impl IntoID<SecretId>,
4062        opts: ContainerWithMountedSecretOpts<'a>,
4063    ) -> Container {
4064        let mut query = self.selection.select("withMountedSecret");
4065        query = query.arg("path", path.into());
4066        query = query.arg_lazy(
4067            "source",
4068            Box::new(move || {
4069                let source = source.clone();
4070                Box::pin(async move { source.into_id().await.unwrap().quote() })
4071            }),
4072        );
4073        if let Some(owner) = opts.owner {
4074            query = query.arg("owner", owner);
4075        }
4076        if let Some(mode) = opts.mode {
4077            query = query.arg("mode", mode);
4078        }
4079        if let Some(expand) = opts.expand {
4080            query = query.arg("expand", expand);
4081        }
4082        Container {
4083            proc: self.proc.clone(),
4084            selection: query,
4085            graphql_client: self.graphql_client.clone(),
4086        }
4087    }
4088    /// 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.
4089    ///
4090    /// # Arguments
4091    ///
4092    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4093    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4094    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4095        let mut query = self.selection.select("withMountedTemp");
4096        query = query.arg("path", path.into());
4097        Container {
4098            proc: self.proc.clone(),
4099            selection: query,
4100            graphql_client: self.graphql_client.clone(),
4101        }
4102    }
4103    /// 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.
4104    ///
4105    /// # Arguments
4106    ///
4107    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4108    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4109    pub fn with_mounted_temp_opts(
4110        &self,
4111        path: impl Into<String>,
4112        opts: ContainerWithMountedTempOpts,
4113    ) -> Container {
4114        let mut query = self.selection.select("withMountedTemp");
4115        query = query.arg("path", path.into());
4116        if let Some(size) = opts.size {
4117            query = query.arg("size", size);
4118        }
4119        if let Some(expand) = opts.expand {
4120            query = query.arg("expand", expand);
4121        }
4122        Container {
4123            proc: self.proc.clone(),
4124            selection: query,
4125            graphql_client: self.graphql_client.clone(),
4126        }
4127    }
4128    /// Return a new container snapshot, with a file added to its filesystem with text content
4129    ///
4130    /// # Arguments
4131    ///
4132    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4133    /// * `contents` - Contents of the new file. Example: "Hello world!"
4134    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4135    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
4136        let mut query = self.selection.select("withNewFile");
4137        query = query.arg("path", path.into());
4138        query = query.arg("contents", contents.into());
4139        Container {
4140            proc: self.proc.clone(),
4141            selection: query,
4142            graphql_client: self.graphql_client.clone(),
4143        }
4144    }
4145    /// Return a new container snapshot, with a file added to its filesystem with text content
4146    ///
4147    /// # Arguments
4148    ///
4149    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4150    /// * `contents` - Contents of the new file. Example: "Hello world!"
4151    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4152    pub fn with_new_file_opts<'a>(
4153        &self,
4154        path: impl Into<String>,
4155        contents: impl Into<String>,
4156        opts: ContainerWithNewFileOpts<'a>,
4157    ) -> Container {
4158        let mut query = self.selection.select("withNewFile");
4159        query = query.arg("path", path.into());
4160        query = query.arg("contents", contents.into());
4161        if let Some(permissions) = opts.permissions {
4162            query = query.arg("permissions", permissions);
4163        }
4164        if let Some(owner) = opts.owner {
4165            query = query.arg("owner", owner);
4166        }
4167        if let Some(expand) = opts.expand {
4168            query = query.arg("expand", expand);
4169        }
4170        Container {
4171            proc: self.proc.clone(),
4172            selection: query,
4173            graphql_client: self.graphql_client.clone(),
4174        }
4175    }
4176    /// Attach credentials for future publishing to a registry. Use in combination with publish
4177    ///
4178    /// # Arguments
4179    ///
4180    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
4181    /// * `username` - The username to authenticate with. Example: "alice"
4182    /// * `secret` - The API key, password or token to authenticate to this registry
4183    pub fn with_registry_auth(
4184        &self,
4185        address: impl Into<String>,
4186        username: impl Into<String>,
4187        secret: impl IntoID<SecretId>,
4188    ) -> Container {
4189        let mut query = self.selection.select("withRegistryAuth");
4190        query = query.arg("address", address.into());
4191        query = query.arg("username", username.into());
4192        query = query.arg_lazy(
4193            "secret",
4194            Box::new(move || {
4195                let secret = secret.clone();
4196                Box::pin(async move { secret.into_id().await.unwrap().quote() })
4197            }),
4198        );
4199        Container {
4200            proc: self.proc.clone(),
4201            selection: query,
4202            graphql_client: self.graphql_client.clone(),
4203        }
4204    }
4205    /// Change the container's root filesystem. The previous root filesystem will be lost.
4206    ///
4207    /// # Arguments
4208    ///
4209    /// * `directory` - The new root filesystem.
4210    pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
4211        let mut query = self.selection.select("withRootfs");
4212        query = query.arg_lazy(
4213            "directory",
4214            Box::new(move || {
4215                let directory = directory.clone();
4216                Box::pin(async move { directory.into_id().await.unwrap().quote() })
4217            }),
4218        );
4219        Container {
4220            proc: self.proc.clone(),
4221            selection: query,
4222            graphql_client: self.graphql_client.clone(),
4223        }
4224    }
4225    /// Set a new environment variable, using a secret value
4226    ///
4227    /// # Arguments
4228    ///
4229    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
4230    /// * `secret` - Identifier of the secret value.
4231    pub fn with_secret_variable(
4232        &self,
4233        name: impl Into<String>,
4234        secret: impl IntoID<SecretId>,
4235    ) -> Container {
4236        let mut query = self.selection.select("withSecretVariable");
4237        query = query.arg("name", name.into());
4238        query = query.arg_lazy(
4239            "secret",
4240            Box::new(move || {
4241                let secret = secret.clone();
4242                Box::pin(async move { secret.into_id().await.unwrap().quote() })
4243            }),
4244        );
4245        Container {
4246            proc: self.proc.clone(),
4247            selection: query,
4248            graphql_client: self.graphql_client.clone(),
4249        }
4250    }
4251    /// Establish a runtime dependency from a container to a network service.
4252    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
4253    /// The service will be reachable from the container via the provided hostname alias.
4254    /// The service dependency will also convey to any files or directories produced by the container.
4255    ///
4256    /// # Arguments
4257    ///
4258    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
4259    /// * `service` - The target service
4260    pub fn with_service_binding(
4261        &self,
4262        alias: impl Into<String>,
4263        service: impl IntoID<ServiceId>,
4264    ) -> Container {
4265        let mut query = self.selection.select("withServiceBinding");
4266        query = query.arg("alias", alias.into());
4267        query = query.arg_lazy(
4268            "service",
4269            Box::new(move || {
4270                let service = service.clone();
4271                Box::pin(async move { service.into_id().await.unwrap().quote() })
4272            }),
4273        );
4274        Container {
4275            proc: self.proc.clone(),
4276            selection: query,
4277            graphql_client: self.graphql_client.clone(),
4278        }
4279    }
4280    /// Return a snapshot with a symlink
4281    ///
4282    /// # Arguments
4283    ///
4284    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4285    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4286    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4287    pub fn with_symlink(
4288        &self,
4289        target: impl Into<String>,
4290        link_name: impl Into<String>,
4291    ) -> Container {
4292        let mut query = self.selection.select("withSymlink");
4293        query = query.arg("target", target.into());
4294        query = query.arg("linkName", link_name.into());
4295        Container {
4296            proc: self.proc.clone(),
4297            selection: query,
4298            graphql_client: self.graphql_client.clone(),
4299        }
4300    }
4301    /// Return a snapshot with a symlink
4302    ///
4303    /// # Arguments
4304    ///
4305    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4306    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4307    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4308    pub fn with_symlink_opts(
4309        &self,
4310        target: impl Into<String>,
4311        link_name: impl Into<String>,
4312        opts: ContainerWithSymlinkOpts,
4313    ) -> Container {
4314        let mut query = self.selection.select("withSymlink");
4315        query = query.arg("target", target.into());
4316        query = query.arg("linkName", link_name.into());
4317        if let Some(expand) = opts.expand {
4318            query = query.arg("expand", expand);
4319        }
4320        Container {
4321            proc: self.proc.clone(),
4322            selection: query,
4323            graphql_client: self.graphql_client.clone(),
4324        }
4325    }
4326    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4327    ///
4328    /// # Arguments
4329    ///
4330    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4331    /// * `source` - Identifier of the socket to forward.
4332    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4333    pub fn with_unix_socket(
4334        &self,
4335        path: impl Into<String>,
4336        source: impl IntoID<SocketId>,
4337    ) -> Container {
4338        let mut query = self.selection.select("withUnixSocket");
4339        query = query.arg("path", path.into());
4340        query = query.arg_lazy(
4341            "source",
4342            Box::new(move || {
4343                let source = source.clone();
4344                Box::pin(async move { source.into_id().await.unwrap().quote() })
4345            }),
4346        );
4347        Container {
4348            proc: self.proc.clone(),
4349            selection: query,
4350            graphql_client: self.graphql_client.clone(),
4351        }
4352    }
4353    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4354    ///
4355    /// # Arguments
4356    ///
4357    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4358    /// * `source` - Identifier of the socket to forward.
4359    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4360    pub fn with_unix_socket_opts<'a>(
4361        &self,
4362        path: impl Into<String>,
4363        source: impl IntoID<SocketId>,
4364        opts: ContainerWithUnixSocketOpts<'a>,
4365    ) -> Container {
4366        let mut query = self.selection.select("withUnixSocket");
4367        query = query.arg("path", path.into());
4368        query = query.arg_lazy(
4369            "source",
4370            Box::new(move || {
4371                let source = source.clone();
4372                Box::pin(async move { source.into_id().await.unwrap().quote() })
4373            }),
4374        );
4375        if let Some(owner) = opts.owner {
4376            query = query.arg("owner", owner);
4377        }
4378        if let Some(expand) = opts.expand {
4379            query = query.arg("expand", expand);
4380        }
4381        Container {
4382            proc: self.proc.clone(),
4383            selection: query,
4384            graphql_client: self.graphql_client.clone(),
4385        }
4386    }
4387    /// Retrieves this container with a different command user.
4388    ///
4389    /// # Arguments
4390    ///
4391    /// * `name` - The user to set (e.g., "root").
4392    pub fn with_user(&self, name: impl Into<String>) -> Container {
4393        let mut query = self.selection.select("withUser");
4394        query = query.arg("name", name.into());
4395        Container {
4396            proc: self.proc.clone(),
4397            selection: query,
4398            graphql_client: self.graphql_client.clone(),
4399        }
4400    }
4401    /// Change the container's working directory. Like WORKDIR in Dockerfile.
4402    ///
4403    /// # Arguments
4404    ///
4405    /// * `path` - The path to set as the working directory (e.g., "/app").
4406    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4407    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
4408        let mut query = self.selection.select("withWorkdir");
4409        query = query.arg("path", path.into());
4410        Container {
4411            proc: self.proc.clone(),
4412            selection: query,
4413            graphql_client: self.graphql_client.clone(),
4414        }
4415    }
4416    /// Change the container's working directory. Like WORKDIR in Dockerfile.
4417    ///
4418    /// # Arguments
4419    ///
4420    /// * `path` - The path to set as the working directory (e.g., "/app").
4421    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4422    pub fn with_workdir_opts(
4423        &self,
4424        path: impl Into<String>,
4425        opts: ContainerWithWorkdirOpts,
4426    ) -> Container {
4427        let mut query = self.selection.select("withWorkdir");
4428        query = query.arg("path", path.into());
4429        if let Some(expand) = opts.expand {
4430            query = query.arg("expand", expand);
4431        }
4432        Container {
4433            proc: self.proc.clone(),
4434            selection: query,
4435            graphql_client: self.graphql_client.clone(),
4436        }
4437    }
4438    /// Retrieves this container minus the given OCI annotation.
4439    ///
4440    /// # Arguments
4441    ///
4442    /// * `name` - The name of the annotation.
4443    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
4444        let mut query = self.selection.select("withoutAnnotation");
4445        query = query.arg("name", name.into());
4446        Container {
4447            proc: self.proc.clone(),
4448            selection: query,
4449            graphql_client: self.graphql_client.clone(),
4450        }
4451    }
4452    /// Remove the container's default arguments.
4453    pub fn without_default_args(&self) -> Container {
4454        let query = self.selection.select("withoutDefaultArgs");
4455        Container {
4456            proc: self.proc.clone(),
4457            selection: query,
4458            graphql_client: self.graphql_client.clone(),
4459        }
4460    }
4461    /// Return a new container snapshot, with a directory removed from its filesystem
4462    ///
4463    /// # Arguments
4464    ///
4465    /// * `path` - Location of the directory to remove (e.g., ".github/").
4466    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4467    pub fn without_directory(&self, path: impl Into<String>) -> Container {
4468        let mut query = self.selection.select("withoutDirectory");
4469        query = query.arg("path", path.into());
4470        Container {
4471            proc: self.proc.clone(),
4472            selection: query,
4473            graphql_client: self.graphql_client.clone(),
4474        }
4475    }
4476    /// Return a new container snapshot, with a directory removed from its filesystem
4477    ///
4478    /// # Arguments
4479    ///
4480    /// * `path` - Location of the directory to remove (e.g., ".github/").
4481    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4482    pub fn without_directory_opts(
4483        &self,
4484        path: impl Into<String>,
4485        opts: ContainerWithoutDirectoryOpts,
4486    ) -> Container {
4487        let mut query = self.selection.select("withoutDirectory");
4488        query = query.arg("path", path.into());
4489        if let Some(expand) = opts.expand {
4490            query = query.arg("expand", expand);
4491        }
4492        Container {
4493            proc: self.proc.clone(),
4494            selection: query,
4495            graphql_client: self.graphql_client.clone(),
4496        }
4497    }
4498    /// Reset the container's OCI entrypoint.
4499    ///
4500    /// # Arguments
4501    ///
4502    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4503    pub fn without_entrypoint(&self) -> Container {
4504        let query = self.selection.select("withoutEntrypoint");
4505        Container {
4506            proc: self.proc.clone(),
4507            selection: query,
4508            graphql_client: self.graphql_client.clone(),
4509        }
4510    }
4511    /// Reset the container's OCI entrypoint.
4512    ///
4513    /// # Arguments
4514    ///
4515    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4516    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4517        let mut query = self.selection.select("withoutEntrypoint");
4518        if let Some(keep_default_args) = opts.keep_default_args {
4519            query = query.arg("keepDefaultArgs", keep_default_args);
4520        }
4521        Container {
4522            proc: self.proc.clone(),
4523            selection: query,
4524            graphql_client: self.graphql_client.clone(),
4525        }
4526    }
4527    /// Retrieves this container minus the given environment variable.
4528    ///
4529    /// # Arguments
4530    ///
4531    /// * `name` - The name of the environment variable (e.g., "HOST").
4532    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4533        let mut query = self.selection.select("withoutEnvVariable");
4534        query = query.arg("name", name.into());
4535        Container {
4536            proc: self.proc.clone(),
4537            selection: query,
4538            graphql_client: self.graphql_client.clone(),
4539        }
4540    }
4541    /// Unexpose a previously exposed port.
4542    ///
4543    /// # Arguments
4544    ///
4545    /// * `port` - Port number to unexpose
4546    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4547    pub fn without_exposed_port(&self, port: isize) -> Container {
4548        let mut query = self.selection.select("withoutExposedPort");
4549        query = query.arg("port", port);
4550        Container {
4551            proc: self.proc.clone(),
4552            selection: query,
4553            graphql_client: self.graphql_client.clone(),
4554        }
4555    }
4556    /// Unexpose a previously exposed port.
4557    ///
4558    /// # Arguments
4559    ///
4560    /// * `port` - Port number to unexpose
4561    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4562    pub fn without_exposed_port_opts(
4563        &self,
4564        port: isize,
4565        opts: ContainerWithoutExposedPortOpts,
4566    ) -> Container {
4567        let mut query = self.selection.select("withoutExposedPort");
4568        query = query.arg("port", port);
4569        if let Some(protocol) = opts.protocol {
4570            query = query.arg("protocol", protocol);
4571        }
4572        Container {
4573            proc: self.proc.clone(),
4574            selection: query,
4575            graphql_client: self.graphql_client.clone(),
4576        }
4577    }
4578    /// Retrieves this container with the file at the given path removed.
4579    ///
4580    /// # Arguments
4581    ///
4582    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4583    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4584    pub fn without_file(&self, path: impl Into<String>) -> Container {
4585        let mut query = self.selection.select("withoutFile");
4586        query = query.arg("path", path.into());
4587        Container {
4588            proc: self.proc.clone(),
4589            selection: query,
4590            graphql_client: self.graphql_client.clone(),
4591        }
4592    }
4593    /// Retrieves this container with the file at the given path removed.
4594    ///
4595    /// # Arguments
4596    ///
4597    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4598    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4599    pub fn without_file_opts(
4600        &self,
4601        path: impl Into<String>,
4602        opts: ContainerWithoutFileOpts,
4603    ) -> Container {
4604        let mut query = self.selection.select("withoutFile");
4605        query = query.arg("path", path.into());
4606        if let Some(expand) = opts.expand {
4607            query = query.arg("expand", expand);
4608        }
4609        Container {
4610            proc: self.proc.clone(),
4611            selection: query,
4612            graphql_client: self.graphql_client.clone(),
4613        }
4614    }
4615    /// Return a new container spanshot with specified files removed
4616    ///
4617    /// # Arguments
4618    ///
4619    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4620    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4621    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4622        let mut query = self.selection.select("withoutFiles");
4623        query = query.arg(
4624            "paths",
4625            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4626        );
4627        Container {
4628            proc: self.proc.clone(),
4629            selection: query,
4630            graphql_client: self.graphql_client.clone(),
4631        }
4632    }
4633    /// Return a new container spanshot with specified files removed
4634    ///
4635    /// # Arguments
4636    ///
4637    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4638    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4639    pub fn without_files_opts(
4640        &self,
4641        paths: Vec<impl Into<String>>,
4642        opts: ContainerWithoutFilesOpts,
4643    ) -> Container {
4644        let mut query = self.selection.select("withoutFiles");
4645        query = query.arg(
4646            "paths",
4647            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4648        );
4649        if let Some(expand) = opts.expand {
4650            query = query.arg("expand", expand);
4651        }
4652        Container {
4653            proc: self.proc.clone(),
4654            selection: query,
4655            graphql_client: self.graphql_client.clone(),
4656        }
4657    }
4658    /// Retrieves this container minus the given environment label.
4659    ///
4660    /// # Arguments
4661    ///
4662    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4663    pub fn without_label(&self, name: impl Into<String>) -> Container {
4664        let mut query = self.selection.select("withoutLabel");
4665        query = query.arg("name", name.into());
4666        Container {
4667            proc: self.proc.clone(),
4668            selection: query,
4669            graphql_client: self.graphql_client.clone(),
4670        }
4671    }
4672    /// Retrieves this container after unmounting everything at the given path.
4673    ///
4674    /// # Arguments
4675    ///
4676    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4677    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4678    pub fn without_mount(&self, path: impl Into<String>) -> Container {
4679        let mut query = self.selection.select("withoutMount");
4680        query = query.arg("path", path.into());
4681        Container {
4682            proc: self.proc.clone(),
4683            selection: query,
4684            graphql_client: self.graphql_client.clone(),
4685        }
4686    }
4687    /// Retrieves this container after unmounting everything at the given path.
4688    ///
4689    /// # Arguments
4690    ///
4691    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4692    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4693    pub fn without_mount_opts(
4694        &self,
4695        path: impl Into<String>,
4696        opts: ContainerWithoutMountOpts,
4697    ) -> Container {
4698        let mut query = self.selection.select("withoutMount");
4699        query = query.arg("path", path.into());
4700        if let Some(expand) = opts.expand {
4701            query = query.arg("expand", expand);
4702        }
4703        Container {
4704            proc: self.proc.clone(),
4705            selection: query,
4706            graphql_client: self.graphql_client.clone(),
4707        }
4708    }
4709    /// Retrieves this container without the registry authentication of a given address.
4710    ///
4711    /// # Arguments
4712    ///
4713    /// * `address` - Registry's address to remove the authentication from.
4714    ///
4715    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
4716    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4717        let mut query = self.selection.select("withoutRegistryAuth");
4718        query = query.arg("address", address.into());
4719        Container {
4720            proc: self.proc.clone(),
4721            selection: query,
4722            graphql_client: self.graphql_client.clone(),
4723        }
4724    }
4725    /// Retrieves this container minus the given environment variable containing the secret.
4726    ///
4727    /// # Arguments
4728    ///
4729    /// * `name` - The name of the environment variable (e.g., "HOST").
4730    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4731        let mut query = self.selection.select("withoutSecretVariable");
4732        query = query.arg("name", name.into());
4733        Container {
4734            proc: self.proc.clone(),
4735            selection: query,
4736            graphql_client: self.graphql_client.clone(),
4737        }
4738    }
4739    /// Retrieves this container with a previously added Unix socket removed.
4740    ///
4741    /// # Arguments
4742    ///
4743    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4744    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4745    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4746        let mut query = self.selection.select("withoutUnixSocket");
4747        query = query.arg("path", path.into());
4748        Container {
4749            proc: self.proc.clone(),
4750            selection: query,
4751            graphql_client: self.graphql_client.clone(),
4752        }
4753    }
4754    /// Retrieves this container with a previously added Unix socket removed.
4755    ///
4756    /// # Arguments
4757    ///
4758    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4759    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4760    pub fn without_unix_socket_opts(
4761        &self,
4762        path: impl Into<String>,
4763        opts: ContainerWithoutUnixSocketOpts,
4764    ) -> Container {
4765        let mut query = self.selection.select("withoutUnixSocket");
4766        query = query.arg("path", path.into());
4767        if let Some(expand) = opts.expand {
4768            query = query.arg("expand", expand);
4769        }
4770        Container {
4771            proc: self.proc.clone(),
4772            selection: query,
4773            graphql_client: self.graphql_client.clone(),
4774        }
4775    }
4776    /// Retrieves this container with an unset command user.
4777    /// Should default to root.
4778    pub fn without_user(&self) -> Container {
4779        let query = self.selection.select("withoutUser");
4780        Container {
4781            proc: self.proc.clone(),
4782            selection: query,
4783            graphql_client: self.graphql_client.clone(),
4784        }
4785    }
4786    /// Unset the container's working directory.
4787    /// Should default to "/".
4788    pub fn without_workdir(&self) -> Container {
4789        let query = self.selection.select("withoutWorkdir");
4790        Container {
4791            proc: self.proc.clone(),
4792            selection: query,
4793            graphql_client: self.graphql_client.clone(),
4794        }
4795    }
4796    /// Retrieves the working directory for all commands.
4797    pub async fn workdir(&self) -> Result<String, DaggerError> {
4798        let query = self.selection.select("workdir");
4799        query.execute(self.graphql_client.clone()).await
4800    }
4801}
4802#[derive(Clone)]
4803pub struct CurrentModule {
4804    pub proc: Option<Arc<DaggerSessionProc>>,
4805    pub selection: Selection,
4806    pub graphql_client: DynGraphQLClient,
4807}
4808#[derive(Builder, Debug, PartialEq)]
4809pub struct CurrentModuleWorkdirOpts<'a> {
4810    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4811    #[builder(setter(into, strip_option), default)]
4812    pub exclude: Option<Vec<&'a str>>,
4813    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4814    #[builder(setter(into, strip_option), default)]
4815    pub include: Option<Vec<&'a str>>,
4816}
4817impl CurrentModule {
4818    /// A unique identifier for this CurrentModule.
4819    pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
4820        let query = self.selection.select("id");
4821        query.execute(self.graphql_client.clone()).await
4822    }
4823    /// The name of the module being executed in
4824    pub async fn name(&self) -> Result<String, DaggerError> {
4825        let query = self.selection.select("name");
4826        query.execute(self.graphql_client.clone()).await
4827    }
4828    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
4829    pub fn source(&self) -> Directory {
4830        let query = self.selection.select("source");
4831        Directory {
4832            proc: self.proc.clone(),
4833            selection: query,
4834            graphql_client: self.graphql_client.clone(),
4835        }
4836    }
4837    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4838    ///
4839    /// # Arguments
4840    ///
4841    /// * `path` - Location of the directory to access (e.g., ".").
4842    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4843    pub fn workdir(&self, path: impl Into<String>) -> Directory {
4844        let mut query = self.selection.select("workdir");
4845        query = query.arg("path", path.into());
4846        Directory {
4847            proc: self.proc.clone(),
4848            selection: query,
4849            graphql_client: self.graphql_client.clone(),
4850        }
4851    }
4852    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4853    ///
4854    /// # Arguments
4855    ///
4856    /// * `path` - Location of the directory to access (e.g., ".").
4857    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4858    pub fn workdir_opts<'a>(
4859        &self,
4860        path: impl Into<String>,
4861        opts: CurrentModuleWorkdirOpts<'a>,
4862    ) -> Directory {
4863        let mut query = self.selection.select("workdir");
4864        query = query.arg("path", path.into());
4865        if let Some(exclude) = opts.exclude {
4866            query = query.arg("exclude", exclude);
4867        }
4868        if let Some(include) = opts.include {
4869            query = query.arg("include", include);
4870        }
4871        Directory {
4872            proc: self.proc.clone(),
4873            selection: query,
4874            graphql_client: self.graphql_client.clone(),
4875        }
4876    }
4877    /// 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.
4878    ///
4879    /// # Arguments
4880    ///
4881    /// * `path` - Location of the file to retrieve (e.g., "README.md").
4882    pub fn workdir_file(&self, path: impl Into<String>) -> File {
4883        let mut query = self.selection.select("workdirFile");
4884        query = query.arg("path", path.into());
4885        File {
4886            proc: self.proc.clone(),
4887            selection: query,
4888            graphql_client: self.graphql_client.clone(),
4889        }
4890    }
4891}
4892#[derive(Clone)]
4893pub struct Directory {
4894    pub proc: Option<Arc<DaggerSessionProc>>,
4895    pub selection: Selection,
4896    pub graphql_client: DynGraphQLClient,
4897}
4898#[derive(Builder, Debug, PartialEq)]
4899pub struct DirectoryAsModuleOpts<'a> {
4900    /// An optional subpath of the directory which contains the module's configuration file.
4901    /// If not set, the module source code is loaded from the root of the directory.
4902    #[builder(setter(into, strip_option), default)]
4903    pub source_root_path: Option<&'a str>,
4904}
4905#[derive(Builder, Debug, PartialEq)]
4906pub struct DirectoryAsModuleSourceOpts<'a> {
4907    /// An optional subpath of the directory which contains the module's configuration file.
4908    /// If not set, the module source code is loaded from the root of the directory.
4909    #[builder(setter(into, strip_option), default)]
4910    pub source_root_path: Option<&'a str>,
4911}
4912#[derive(Builder, Debug, PartialEq)]
4913pub struct DirectoryDockerBuildOpts<'a> {
4914    /// Build arguments to use in the build.
4915    #[builder(setter(into, strip_option), default)]
4916    pub build_args: Option<Vec<BuildArg>>,
4917    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
4918    #[builder(setter(into, strip_option), default)]
4919    pub dockerfile: Option<&'a str>,
4920    /// If set, skip the automatic init process injected into containers created by RUN statements.
4921    /// 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.
4922    #[builder(setter(into, strip_option), default)]
4923    pub no_init: Option<bool>,
4924    /// The platform to build.
4925    #[builder(setter(into, strip_option), default)]
4926    pub platform: Option<Platform>,
4927    /// Secrets to pass to the build.
4928    /// They will be mounted at /run/secrets/[secret-name].
4929    #[builder(setter(into, strip_option), default)]
4930    pub secrets: Option<Vec<SecretId>>,
4931    /// Target build stage to build.
4932    #[builder(setter(into, strip_option), default)]
4933    pub target: Option<&'a str>,
4934}
4935#[derive(Builder, Debug, PartialEq)]
4936pub struct DirectoryEntriesOpts<'a> {
4937    /// Location of the directory to look at (e.g., "/src").
4938    #[builder(setter(into, strip_option), default)]
4939    pub path: Option<&'a str>,
4940}
4941#[derive(Builder, Debug, PartialEq)]
4942pub struct DirectoryExistsOpts {
4943    /// If specified, do not follow symlinks.
4944    #[builder(setter(into, strip_option), default)]
4945    pub do_not_follow_symlinks: Option<bool>,
4946    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
4947    #[builder(setter(into, strip_option), default)]
4948    pub expected_type: Option<ExistsType>,
4949}
4950#[derive(Builder, Debug, PartialEq)]
4951pub struct DirectoryExportOpts {
4952    /// 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.
4953    #[builder(setter(into, strip_option), default)]
4954    pub wipe: Option<bool>,
4955}
4956#[derive(Builder, Debug, PartialEq)]
4957pub struct DirectoryFilterOpts<'a> {
4958    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
4959    #[builder(setter(into, strip_option), default)]
4960    pub exclude: Option<Vec<&'a str>>,
4961    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
4962    #[builder(setter(into, strip_option), default)]
4963    pub include: Option<Vec<&'a str>>,
4964}
4965#[derive(Builder, Debug, PartialEq)]
4966pub struct DirectorySearchOpts<'a> {
4967    /// Allow the . pattern to match newlines in multiline mode.
4968    #[builder(setter(into, strip_option), default)]
4969    pub dotall: Option<bool>,
4970    /// Only return matching files, not lines and content
4971    #[builder(setter(into, strip_option), default)]
4972    pub files_only: Option<bool>,
4973    /// Glob patterns to match (e.g., "*.md")
4974    #[builder(setter(into, strip_option), default)]
4975    pub globs: Option<Vec<&'a str>>,
4976    /// Enable case-insensitive matching.
4977    #[builder(setter(into, strip_option), default)]
4978    pub insensitive: Option<bool>,
4979    /// Limit the number of results to return
4980    #[builder(setter(into, strip_option), default)]
4981    pub limit: Option<isize>,
4982    /// Interpret the pattern as a literal string instead of a regular expression.
4983    #[builder(setter(into, strip_option), default)]
4984    pub literal: Option<bool>,
4985    /// Enable searching across multiple lines.
4986    #[builder(setter(into, strip_option), default)]
4987    pub multiline: Option<bool>,
4988    /// Directory or file paths to search
4989    #[builder(setter(into, strip_option), default)]
4990    pub paths: Option<Vec<&'a str>>,
4991    /// Skip hidden files (files starting with .).
4992    #[builder(setter(into, strip_option), default)]
4993    pub skip_hidden: Option<bool>,
4994    /// Honor .gitignore, .ignore, and .rgignore files.
4995    #[builder(setter(into, strip_option), default)]
4996    pub skip_ignored: Option<bool>,
4997}
4998#[derive(Builder, Debug, PartialEq)]
4999pub struct DirectoryTerminalOpts<'a> {
5000    /// If set, override the container's default terminal command and invoke these command arguments instead.
5001    #[builder(setter(into, strip_option), default)]
5002    pub cmd: Option<Vec<&'a str>>,
5003    /// If set, override the default container used for the terminal.
5004    #[builder(setter(into, strip_option), default)]
5005    pub container: Option<ContainerId>,
5006    /// Provides Dagger access to the executed command.
5007    #[builder(setter(into, strip_option), default)]
5008    pub experimental_privileged_nesting: Option<bool>,
5009    /// 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.
5010    #[builder(setter(into, strip_option), default)]
5011    pub insecure_root_capabilities: Option<bool>,
5012}
5013#[derive(Builder, Debug, PartialEq)]
5014pub struct DirectoryWithDirectoryOpts<'a> {
5015    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
5016    #[builder(setter(into, strip_option), default)]
5017    pub exclude: Option<Vec<&'a str>>,
5018    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
5019    #[builder(setter(into, strip_option), default)]
5020    pub include: Option<Vec<&'a str>>,
5021    /// A user:group to set for the copied directory and its contents.
5022    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5023    /// If the group is omitted, it defaults to the same as the user.
5024    #[builder(setter(into, strip_option), default)]
5025    pub owner: Option<&'a str>,
5026}
5027#[derive(Builder, Debug, PartialEq)]
5028pub struct DirectoryWithFileOpts<'a> {
5029    /// A user:group to set for the copied directory and its contents.
5030    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5031    /// If the group is omitted, it defaults to the same as the user.
5032    #[builder(setter(into, strip_option), default)]
5033    pub owner: Option<&'a str>,
5034    /// Permission given to the copied file (e.g., 0600).
5035    #[builder(setter(into, strip_option), default)]
5036    pub permissions: Option<isize>,
5037}
5038#[derive(Builder, Debug, PartialEq)]
5039pub struct DirectoryWithFilesOpts {
5040    /// Permission given to the copied files (e.g., 0600).
5041    #[builder(setter(into, strip_option), default)]
5042    pub permissions: Option<isize>,
5043}
5044#[derive(Builder, Debug, PartialEq)]
5045pub struct DirectoryWithNewDirectoryOpts {
5046    /// Permission granted to the created directory (e.g., 0777).
5047    #[builder(setter(into, strip_option), default)]
5048    pub permissions: Option<isize>,
5049}
5050#[derive(Builder, Debug, PartialEq)]
5051pub struct DirectoryWithNewFileOpts {
5052    /// Permissions of the new file. Example: 0600
5053    #[builder(setter(into, strip_option), default)]
5054    pub permissions: Option<isize>,
5055}
5056impl Directory {
5057    /// Converts this directory to a local git repository
5058    pub fn as_git(&self) -> GitRepository {
5059        let query = self.selection.select("asGit");
5060        GitRepository {
5061            proc: self.proc.clone(),
5062            selection: query,
5063            graphql_client: self.graphql_client.clone(),
5064        }
5065    }
5066    /// Load the directory as a Dagger module source
5067    ///
5068    /// # Arguments
5069    ///
5070    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5071    pub fn as_module(&self) -> Module {
5072        let query = self.selection.select("asModule");
5073        Module {
5074            proc: self.proc.clone(),
5075            selection: query,
5076            graphql_client: self.graphql_client.clone(),
5077        }
5078    }
5079    /// Load the directory as a Dagger module source
5080    ///
5081    /// # Arguments
5082    ///
5083    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5084    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
5085        let mut query = self.selection.select("asModule");
5086        if let Some(source_root_path) = opts.source_root_path {
5087            query = query.arg("sourceRootPath", source_root_path);
5088        }
5089        Module {
5090            proc: self.proc.clone(),
5091            selection: query,
5092            graphql_client: self.graphql_client.clone(),
5093        }
5094    }
5095    /// Load the directory as a Dagger module source
5096    ///
5097    /// # Arguments
5098    ///
5099    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5100    pub fn as_module_source(&self) -> ModuleSource {
5101        let query = self.selection.select("asModuleSource");
5102        ModuleSource {
5103            proc: self.proc.clone(),
5104            selection: query,
5105            graphql_client: self.graphql_client.clone(),
5106        }
5107    }
5108    /// Load the directory as a Dagger module source
5109    ///
5110    /// # Arguments
5111    ///
5112    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5113    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
5114        let mut query = self.selection.select("asModuleSource");
5115        if let Some(source_root_path) = opts.source_root_path {
5116            query = query.arg("sourceRootPath", source_root_path);
5117        }
5118        ModuleSource {
5119            proc: self.proc.clone(),
5120            selection: query,
5121            graphql_client: self.graphql_client.clone(),
5122        }
5123    }
5124    /// Return the difference between this directory and another directory, typically an older snapshot.
5125    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
5126    ///
5127    /// # Arguments
5128    ///
5129    /// * `from` - The base directory snapshot to compare against
5130    pub fn changes(&self, from: impl IntoID<DirectoryId>) -> Changeset {
5131        let mut query = self.selection.select("changes");
5132        query = query.arg_lazy(
5133            "from",
5134            Box::new(move || {
5135                let from = from.clone();
5136                Box::pin(async move { from.into_id().await.unwrap().quote() })
5137            }),
5138        );
5139        Changeset {
5140            proc: self.proc.clone(),
5141            selection: query,
5142            graphql_client: self.graphql_client.clone(),
5143        }
5144    }
5145    /// Change the owner of the directory contents recursively.
5146    ///
5147    /// # Arguments
5148    ///
5149    /// * `path` - Path of the directory to change ownership of (e.g., "/").
5150    /// * `owner` - A user:group to set for the mounted directory and its contents.
5151    ///
5152    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5153    ///
5154    /// If the group is omitted, it defaults to the same as the user.
5155    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
5156        let mut query = self.selection.select("chown");
5157        query = query.arg("path", path.into());
5158        query = query.arg("owner", owner.into());
5159        Directory {
5160            proc: self.proc.clone(),
5161            selection: query,
5162            graphql_client: self.graphql_client.clone(),
5163        }
5164    }
5165    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
5166    ///
5167    /// # Arguments
5168    ///
5169    /// * `other` - The directory to compare against
5170    pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
5171        let mut query = self.selection.select("diff");
5172        query = query.arg_lazy(
5173            "other",
5174            Box::new(move || {
5175                let other = other.clone();
5176                Box::pin(async move { other.into_id().await.unwrap().quote() })
5177            }),
5178        );
5179        Directory {
5180            proc: self.proc.clone(),
5181            selection: query,
5182            graphql_client: self.graphql_client.clone(),
5183        }
5184    }
5185    /// 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.
5186    pub async fn digest(&self) -> Result<String, DaggerError> {
5187        let query = self.selection.select("digest");
5188        query.execute(self.graphql_client.clone()).await
5189    }
5190    /// Retrieves a directory at the given path.
5191    ///
5192    /// # Arguments
5193    ///
5194    /// * `path` - Location of the directory to retrieve. Example: "/src"
5195    pub fn directory(&self, path: impl Into<String>) -> Directory {
5196        let mut query = self.selection.select("directory");
5197        query = query.arg("path", path.into());
5198        Directory {
5199            proc: self.proc.clone(),
5200            selection: query,
5201            graphql_client: self.graphql_client.clone(),
5202        }
5203    }
5204    /// 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.
5205    ///
5206    /// # Arguments
5207    ///
5208    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5209    pub fn docker_build(&self) -> Container {
5210        let query = self.selection.select("dockerBuild");
5211        Container {
5212            proc: self.proc.clone(),
5213            selection: query,
5214            graphql_client: self.graphql_client.clone(),
5215        }
5216    }
5217    /// 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.
5218    ///
5219    /// # Arguments
5220    ///
5221    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5222    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5223        let mut query = self.selection.select("dockerBuild");
5224        if let Some(dockerfile) = opts.dockerfile {
5225            query = query.arg("dockerfile", dockerfile);
5226        }
5227        if let Some(platform) = opts.platform {
5228            query = query.arg("platform", platform);
5229        }
5230        if let Some(build_args) = opts.build_args {
5231            query = query.arg("buildArgs", build_args);
5232        }
5233        if let Some(target) = opts.target {
5234            query = query.arg("target", target);
5235        }
5236        if let Some(secrets) = opts.secrets {
5237            query = query.arg("secrets", secrets);
5238        }
5239        if let Some(no_init) = opts.no_init {
5240            query = query.arg("noInit", no_init);
5241        }
5242        Container {
5243            proc: self.proc.clone(),
5244            selection: query,
5245            graphql_client: self.graphql_client.clone(),
5246        }
5247    }
5248    /// Returns a list of files and directories at the given path.
5249    ///
5250    /// # Arguments
5251    ///
5252    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5253    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
5254        let query = self.selection.select("entries");
5255        query.execute(self.graphql_client.clone()).await
5256    }
5257    /// Returns a list of files and directories at the given path.
5258    ///
5259    /// # Arguments
5260    ///
5261    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5262    pub async fn entries_opts<'a>(
5263        &self,
5264        opts: DirectoryEntriesOpts<'a>,
5265    ) -> Result<Vec<String>, DaggerError> {
5266        let mut query = self.selection.select("entries");
5267        if let Some(path) = opts.path {
5268            query = query.arg("path", path);
5269        }
5270        query.execute(self.graphql_client.clone()).await
5271    }
5272    /// check if a file or directory exists
5273    ///
5274    /// # Arguments
5275    ///
5276    /// * `path` - Path to check (e.g., "/file.txt").
5277    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5278    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5279        let mut query = self.selection.select("exists");
5280        query = query.arg("path", path.into());
5281        query.execute(self.graphql_client.clone()).await
5282    }
5283    /// check if a file or directory exists
5284    ///
5285    /// # Arguments
5286    ///
5287    /// * `path` - Path to check (e.g., "/file.txt").
5288    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5289    pub async fn exists_opts(
5290        &self,
5291        path: impl Into<String>,
5292        opts: DirectoryExistsOpts,
5293    ) -> Result<bool, DaggerError> {
5294        let mut query = self.selection.select("exists");
5295        query = query.arg("path", path.into());
5296        if let Some(expected_type) = opts.expected_type {
5297            query = query.arg("expectedType", expected_type);
5298        }
5299        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5300            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5301        }
5302        query.execute(self.graphql_client.clone()).await
5303    }
5304    /// Writes the contents of the directory to a path on the host.
5305    ///
5306    /// # Arguments
5307    ///
5308    /// * `path` - Location of the copied directory (e.g., "logs/").
5309    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5310    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5311        let mut query = self.selection.select("export");
5312        query = query.arg("path", path.into());
5313        query.execute(self.graphql_client.clone()).await
5314    }
5315    /// Writes the contents of the directory to a path on the host.
5316    ///
5317    /// # Arguments
5318    ///
5319    /// * `path` - Location of the copied directory (e.g., "logs/").
5320    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5321    pub async fn export_opts(
5322        &self,
5323        path: impl Into<String>,
5324        opts: DirectoryExportOpts,
5325    ) -> Result<String, DaggerError> {
5326        let mut query = self.selection.select("export");
5327        query = query.arg("path", path.into());
5328        if let Some(wipe) = opts.wipe {
5329            query = query.arg("wipe", wipe);
5330        }
5331        query.execute(self.graphql_client.clone()).await
5332    }
5333    /// Retrieve a file at the given path.
5334    ///
5335    /// # Arguments
5336    ///
5337    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5338    pub fn file(&self, path: impl Into<String>) -> File {
5339        let mut query = self.selection.select("file");
5340        query = query.arg("path", path.into());
5341        File {
5342            proc: self.proc.clone(),
5343            selection: query,
5344            graphql_client: self.graphql_client.clone(),
5345        }
5346    }
5347    /// Return a snapshot with some paths included or excluded
5348    ///
5349    /// # Arguments
5350    ///
5351    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5352    pub fn filter(&self) -> Directory {
5353        let query = self.selection.select("filter");
5354        Directory {
5355            proc: self.proc.clone(),
5356            selection: query,
5357            graphql_client: self.graphql_client.clone(),
5358        }
5359    }
5360    /// Return a snapshot with some paths included or excluded
5361    ///
5362    /// # Arguments
5363    ///
5364    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5365    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5366        let mut query = self.selection.select("filter");
5367        if let Some(exclude) = opts.exclude {
5368            query = query.arg("exclude", exclude);
5369        }
5370        if let Some(include) = opts.include {
5371            query = query.arg("include", include);
5372        }
5373        Directory {
5374            proc: self.proc.clone(),
5375            selection: query,
5376            graphql_client: self.graphql_client.clone(),
5377        }
5378    }
5379    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
5380    ///
5381    /// # Arguments
5382    ///
5383    /// * `name` - The name of the file or directory to search for
5384    /// * `start` - The path to start the search from
5385    pub async fn find_up(
5386        &self,
5387        name: impl Into<String>,
5388        start: impl Into<String>,
5389    ) -> Result<String, DaggerError> {
5390        let mut query = self.selection.select("findUp");
5391        query = query.arg("name", name.into());
5392        query = query.arg("start", start.into());
5393        query.execute(self.graphql_client.clone()).await
5394    }
5395    /// Returns a list of files and directories that matche the given pattern.
5396    ///
5397    /// # Arguments
5398    ///
5399    /// * `pattern` - Pattern to match (e.g., "*.md").
5400    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5401        let mut query = self.selection.select("glob");
5402        query = query.arg("pattern", pattern.into());
5403        query.execute(self.graphql_client.clone()).await
5404    }
5405    /// A unique identifier for this Directory.
5406    pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
5407        let query = self.selection.select("id");
5408        query.execute(self.graphql_client.clone()).await
5409    }
5410    /// Returns the name of the directory.
5411    pub async fn name(&self) -> Result<String, DaggerError> {
5412        let query = self.selection.select("name");
5413        query.execute(self.graphql_client.clone()).await
5414    }
5415    /// Searches for content matching the given regular expression or literal string.
5416    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5417    ///
5418    /// # Arguments
5419    ///
5420    /// * `pattern` - The text to match.
5421    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5422    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
5423        let mut query = self.selection.select("search");
5424        query = query.arg("pattern", pattern.into());
5425        vec![SearchResult {
5426            proc: self.proc.clone(),
5427            selection: query,
5428            graphql_client: self.graphql_client.clone(),
5429        }]
5430    }
5431    /// Searches for content matching the given regular expression or literal string.
5432    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5433    ///
5434    /// # Arguments
5435    ///
5436    /// * `pattern` - The text to match.
5437    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5438    pub fn search_opts<'a>(
5439        &self,
5440        pattern: impl Into<String>,
5441        opts: DirectorySearchOpts<'a>,
5442    ) -> Vec<SearchResult> {
5443        let mut query = self.selection.select("search");
5444        query = query.arg("pattern", pattern.into());
5445        if let Some(paths) = opts.paths {
5446            query = query.arg("paths", paths);
5447        }
5448        if let Some(globs) = opts.globs {
5449            query = query.arg("globs", globs);
5450        }
5451        if let Some(literal) = opts.literal {
5452            query = query.arg("literal", literal);
5453        }
5454        if let Some(multiline) = opts.multiline {
5455            query = query.arg("multiline", multiline);
5456        }
5457        if let Some(dotall) = opts.dotall {
5458            query = query.arg("dotall", dotall);
5459        }
5460        if let Some(insensitive) = opts.insensitive {
5461            query = query.arg("insensitive", insensitive);
5462        }
5463        if let Some(skip_ignored) = opts.skip_ignored {
5464            query = query.arg("skipIgnored", skip_ignored);
5465        }
5466        if let Some(skip_hidden) = opts.skip_hidden {
5467            query = query.arg("skipHidden", skip_hidden);
5468        }
5469        if let Some(files_only) = opts.files_only {
5470            query = query.arg("filesOnly", files_only);
5471        }
5472        if let Some(limit) = opts.limit {
5473            query = query.arg("limit", limit);
5474        }
5475        vec![SearchResult {
5476            proc: self.proc.clone(),
5477            selection: query,
5478            graphql_client: self.graphql_client.clone(),
5479        }]
5480    }
5481    /// Force evaluation in the engine.
5482    pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
5483        let query = self.selection.select("sync");
5484        query.execute(self.graphql_client.clone()).await
5485    }
5486    /// Opens an interactive terminal in new container with this directory mounted inside.
5487    ///
5488    /// # Arguments
5489    ///
5490    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5491    pub fn terminal(&self) -> Directory {
5492        let query = self.selection.select("terminal");
5493        Directory {
5494            proc: self.proc.clone(),
5495            selection: query,
5496            graphql_client: self.graphql_client.clone(),
5497        }
5498    }
5499    /// Opens an interactive terminal in new container with this directory mounted inside.
5500    ///
5501    /// # Arguments
5502    ///
5503    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5504    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5505        let mut query = self.selection.select("terminal");
5506        if let Some(container) = opts.container {
5507            query = query.arg("container", container);
5508        }
5509        if let Some(cmd) = opts.cmd {
5510            query = query.arg("cmd", cmd);
5511        }
5512        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5513            query = query.arg(
5514                "experimentalPrivilegedNesting",
5515                experimental_privileged_nesting,
5516            );
5517        }
5518        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5519            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5520        }
5521        Directory {
5522            proc: self.proc.clone(),
5523            selection: query,
5524            graphql_client: self.graphql_client.clone(),
5525        }
5526    }
5527    /// Return a directory with changes from another directory applied to it.
5528    ///
5529    /// # Arguments
5530    ///
5531    /// * `changes` - Changes to apply to the directory
5532    pub fn with_changes(&self, changes: impl IntoID<ChangesetId>) -> Directory {
5533        let mut query = self.selection.select("withChanges");
5534        query = query.arg_lazy(
5535            "changes",
5536            Box::new(move || {
5537                let changes = changes.clone();
5538                Box::pin(async move { changes.into_id().await.unwrap().quote() })
5539            }),
5540        );
5541        Directory {
5542            proc: self.proc.clone(),
5543            selection: query,
5544            graphql_client: self.graphql_client.clone(),
5545        }
5546    }
5547    /// Return a snapshot with a directory added
5548    ///
5549    /// # Arguments
5550    ///
5551    /// * `path` - Location of the written directory (e.g., "/src/").
5552    /// * `source` - Identifier of the directory to copy.
5553    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5554    pub fn with_directory(
5555        &self,
5556        path: impl Into<String>,
5557        source: impl IntoID<DirectoryId>,
5558    ) -> Directory {
5559        let mut query = self.selection.select("withDirectory");
5560        query = query.arg("path", path.into());
5561        query = query.arg_lazy(
5562            "source",
5563            Box::new(move || {
5564                let source = source.clone();
5565                Box::pin(async move { source.into_id().await.unwrap().quote() })
5566            }),
5567        );
5568        Directory {
5569            proc: self.proc.clone(),
5570            selection: query,
5571            graphql_client: self.graphql_client.clone(),
5572        }
5573    }
5574    /// Return a snapshot with a directory added
5575    ///
5576    /// # Arguments
5577    ///
5578    /// * `path` - Location of the written directory (e.g., "/src/").
5579    /// * `source` - Identifier of the directory to copy.
5580    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5581    pub fn with_directory_opts<'a>(
5582        &self,
5583        path: impl Into<String>,
5584        source: impl IntoID<DirectoryId>,
5585        opts: DirectoryWithDirectoryOpts<'a>,
5586    ) -> Directory {
5587        let mut query = self.selection.select("withDirectory");
5588        query = query.arg("path", path.into());
5589        query = query.arg_lazy(
5590            "source",
5591            Box::new(move || {
5592                let source = source.clone();
5593                Box::pin(async move { source.into_id().await.unwrap().quote() })
5594            }),
5595        );
5596        if let Some(exclude) = opts.exclude {
5597            query = query.arg("exclude", exclude);
5598        }
5599        if let Some(include) = opts.include {
5600            query = query.arg("include", include);
5601        }
5602        if let Some(owner) = opts.owner {
5603            query = query.arg("owner", owner);
5604        }
5605        Directory {
5606            proc: self.proc.clone(),
5607            selection: query,
5608            graphql_client: self.graphql_client.clone(),
5609        }
5610    }
5611    /// Retrieves this directory plus the contents of the given file copied to the given path.
5612    ///
5613    /// # Arguments
5614    ///
5615    /// * `path` - Location of the copied file (e.g., "/file.txt").
5616    /// * `source` - Identifier of the file to copy.
5617    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5618    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
5619        let mut query = self.selection.select("withFile");
5620        query = query.arg("path", path.into());
5621        query = query.arg_lazy(
5622            "source",
5623            Box::new(move || {
5624                let source = source.clone();
5625                Box::pin(async move { source.into_id().await.unwrap().quote() })
5626            }),
5627        );
5628        Directory {
5629            proc: self.proc.clone(),
5630            selection: query,
5631            graphql_client: self.graphql_client.clone(),
5632        }
5633    }
5634    /// Retrieves this directory plus the contents of the given file copied to the given path.
5635    ///
5636    /// # Arguments
5637    ///
5638    /// * `path` - Location of the copied file (e.g., "/file.txt").
5639    /// * `source` - Identifier of the file to copy.
5640    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5641    pub fn with_file_opts<'a>(
5642        &self,
5643        path: impl Into<String>,
5644        source: impl IntoID<FileId>,
5645        opts: DirectoryWithFileOpts<'a>,
5646    ) -> Directory {
5647        let mut query = self.selection.select("withFile");
5648        query = query.arg("path", path.into());
5649        query = query.arg_lazy(
5650            "source",
5651            Box::new(move || {
5652                let source = source.clone();
5653                Box::pin(async move { source.into_id().await.unwrap().quote() })
5654            }),
5655        );
5656        if let Some(permissions) = opts.permissions {
5657            query = query.arg("permissions", permissions);
5658        }
5659        if let Some(owner) = opts.owner {
5660            query = query.arg("owner", owner);
5661        }
5662        Directory {
5663            proc: self.proc.clone(),
5664            selection: query,
5665            graphql_client: self.graphql_client.clone(),
5666        }
5667    }
5668    /// Retrieves this directory plus the contents of the given files copied to the given path.
5669    ///
5670    /// # Arguments
5671    ///
5672    /// * `path` - Location where copied files should be placed (e.g., "/src").
5673    /// * `sources` - Identifiers of the files to copy.
5674    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5675    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
5676        let mut query = self.selection.select("withFiles");
5677        query = query.arg("path", path.into());
5678        query = query.arg("sources", sources);
5679        Directory {
5680            proc: self.proc.clone(),
5681            selection: query,
5682            graphql_client: self.graphql_client.clone(),
5683        }
5684    }
5685    /// Retrieves this directory plus the contents of the given files copied to the given path.
5686    ///
5687    /// # Arguments
5688    ///
5689    /// * `path` - Location where copied files should be placed (e.g., "/src").
5690    /// * `sources` - Identifiers of the files to copy.
5691    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5692    pub fn with_files_opts(
5693        &self,
5694        path: impl Into<String>,
5695        sources: Vec<FileId>,
5696        opts: DirectoryWithFilesOpts,
5697    ) -> Directory {
5698        let mut query = self.selection.select("withFiles");
5699        query = query.arg("path", path.into());
5700        query = query.arg("sources", sources);
5701        if let Some(permissions) = opts.permissions {
5702            query = query.arg("permissions", permissions);
5703        }
5704        Directory {
5705            proc: self.proc.clone(),
5706            selection: query,
5707            graphql_client: self.graphql_client.clone(),
5708        }
5709    }
5710    /// Retrieves this directory plus a new directory created at the given path.
5711    ///
5712    /// # Arguments
5713    ///
5714    /// * `path` - Location of the directory created (e.g., "/logs").
5715    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5716    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5717        let mut query = self.selection.select("withNewDirectory");
5718        query = query.arg("path", path.into());
5719        Directory {
5720            proc: self.proc.clone(),
5721            selection: query,
5722            graphql_client: self.graphql_client.clone(),
5723        }
5724    }
5725    /// Retrieves this directory plus a new directory created at the given path.
5726    ///
5727    /// # Arguments
5728    ///
5729    /// * `path` - Location of the directory created (e.g., "/logs").
5730    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5731    pub fn with_new_directory_opts(
5732        &self,
5733        path: impl Into<String>,
5734        opts: DirectoryWithNewDirectoryOpts,
5735    ) -> Directory {
5736        let mut query = self.selection.select("withNewDirectory");
5737        query = query.arg("path", path.into());
5738        if let Some(permissions) = opts.permissions {
5739            query = query.arg("permissions", permissions);
5740        }
5741        Directory {
5742            proc: self.proc.clone(),
5743            selection: query,
5744            graphql_client: self.graphql_client.clone(),
5745        }
5746    }
5747    /// Return a snapshot with a new file added
5748    ///
5749    /// # Arguments
5750    ///
5751    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5752    /// * `contents` - Contents of the new file. Example: "Hello world!"
5753    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5754    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5755        let mut query = self.selection.select("withNewFile");
5756        query = query.arg("path", path.into());
5757        query = query.arg("contents", contents.into());
5758        Directory {
5759            proc: self.proc.clone(),
5760            selection: query,
5761            graphql_client: self.graphql_client.clone(),
5762        }
5763    }
5764    /// Return a snapshot with a new file added
5765    ///
5766    /// # Arguments
5767    ///
5768    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5769    /// * `contents` - Contents of the new file. Example: "Hello world!"
5770    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5771    pub fn with_new_file_opts(
5772        &self,
5773        path: impl Into<String>,
5774        contents: impl Into<String>,
5775        opts: DirectoryWithNewFileOpts,
5776    ) -> Directory {
5777        let mut query = self.selection.select("withNewFile");
5778        query = query.arg("path", path.into());
5779        query = query.arg("contents", contents.into());
5780        if let Some(permissions) = opts.permissions {
5781            query = query.arg("permissions", permissions);
5782        }
5783        Directory {
5784            proc: self.proc.clone(),
5785            selection: query,
5786            graphql_client: self.graphql_client.clone(),
5787        }
5788    }
5789    /// Retrieves this directory with the given Git-compatible patch applied.
5790    ///
5791    /// # Arguments
5792    ///
5793    /// * `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").
5794    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5795        let mut query = self.selection.select("withPatch");
5796        query = query.arg("patch", patch.into());
5797        Directory {
5798            proc: self.proc.clone(),
5799            selection: query,
5800            graphql_client: self.graphql_client.clone(),
5801        }
5802    }
5803    /// Retrieves this directory with the given Git-compatible patch file applied.
5804    ///
5805    /// # Arguments
5806    ///
5807    /// * `patch` - File containing the patch to apply
5808    pub fn with_patch_file(&self, patch: impl IntoID<FileId>) -> Directory {
5809        let mut query = self.selection.select("withPatchFile");
5810        query = query.arg_lazy(
5811            "patch",
5812            Box::new(move || {
5813                let patch = patch.clone();
5814                Box::pin(async move { patch.into_id().await.unwrap().quote() })
5815            }),
5816        );
5817        Directory {
5818            proc: self.proc.clone(),
5819            selection: query,
5820            graphql_client: self.graphql_client.clone(),
5821        }
5822    }
5823    /// Return a snapshot with a symlink
5824    ///
5825    /// # Arguments
5826    ///
5827    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5828    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5829    pub fn with_symlink(
5830        &self,
5831        target: impl Into<String>,
5832        link_name: impl Into<String>,
5833    ) -> Directory {
5834        let mut query = self.selection.select("withSymlink");
5835        query = query.arg("target", target.into());
5836        query = query.arg("linkName", link_name.into());
5837        Directory {
5838            proc: self.proc.clone(),
5839            selection: query,
5840            graphql_client: self.graphql_client.clone(),
5841        }
5842    }
5843    /// Retrieves this directory with all file/dir timestamps set to the given time.
5844    ///
5845    /// # Arguments
5846    ///
5847    /// * `timestamp` - Timestamp to set dir/files in.
5848    ///
5849    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
5850    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5851        let mut query = self.selection.select("withTimestamps");
5852        query = query.arg("timestamp", timestamp);
5853        Directory {
5854            proc: self.proc.clone(),
5855            selection: query,
5856            graphql_client: self.graphql_client.clone(),
5857        }
5858    }
5859    /// Return a snapshot with a subdirectory removed
5860    ///
5861    /// # Arguments
5862    ///
5863    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
5864    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5865        let mut query = self.selection.select("withoutDirectory");
5866        query = query.arg("path", path.into());
5867        Directory {
5868            proc: self.proc.clone(),
5869            selection: query,
5870            graphql_client: self.graphql_client.clone(),
5871        }
5872    }
5873    /// Return a snapshot with a file removed
5874    ///
5875    /// # Arguments
5876    ///
5877    /// * `path` - Path of the file to remove (e.g., "/file.txt").
5878    pub fn without_file(&self, path: impl Into<String>) -> Directory {
5879        let mut query = self.selection.select("withoutFile");
5880        query = query.arg("path", path.into());
5881        Directory {
5882            proc: self.proc.clone(),
5883            selection: query,
5884            graphql_client: self.graphql_client.clone(),
5885        }
5886    }
5887    /// Return a snapshot with files removed
5888    ///
5889    /// # Arguments
5890    ///
5891    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
5892    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5893        let mut query = self.selection.select("withoutFiles");
5894        query = query.arg(
5895            "paths",
5896            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5897        );
5898        Directory {
5899            proc: self.proc.clone(),
5900            selection: query,
5901            graphql_client: self.graphql_client.clone(),
5902        }
5903    }
5904}
5905#[derive(Clone)]
5906pub struct Engine {
5907    pub proc: Option<Arc<DaggerSessionProc>>,
5908    pub selection: Selection,
5909    pub graphql_client: DynGraphQLClient,
5910}
5911impl Engine {
5912    /// A unique identifier for this Engine.
5913    pub async fn id(&self) -> Result<EngineId, DaggerError> {
5914        let query = self.selection.select("id");
5915        query.execute(self.graphql_client.clone()).await
5916    }
5917    /// The local (on-disk) cache for the Dagger engine
5918    pub fn local_cache(&self) -> EngineCache {
5919        let query = self.selection.select("localCache");
5920        EngineCache {
5921            proc: self.proc.clone(),
5922            selection: query,
5923            graphql_client: self.graphql_client.clone(),
5924        }
5925    }
5926}
5927#[derive(Clone)]
5928pub struct EngineCache {
5929    pub proc: Option<Arc<DaggerSessionProc>>,
5930    pub selection: Selection,
5931    pub graphql_client: DynGraphQLClient,
5932}
5933#[derive(Builder, Debug, PartialEq)]
5934pub struct EngineCacheEntrySetOpts<'a> {
5935    #[builder(setter(into, strip_option), default)]
5936    pub key: Option<&'a str>,
5937}
5938#[derive(Builder, Debug, PartialEq)]
5939pub struct EngineCachePruneOpts {
5940    /// Use the engine-wide default pruning policy if true, otherwise prune the whole cache of any releasable entries.
5941    #[builder(setter(into, strip_option), default)]
5942    pub use_default_policy: Option<bool>,
5943}
5944impl EngineCache {
5945    /// The current set of entries in the cache
5946    ///
5947    /// # Arguments
5948    ///
5949    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5950    pub fn entry_set(&self) -> EngineCacheEntrySet {
5951        let query = self.selection.select("entrySet");
5952        EngineCacheEntrySet {
5953            proc: self.proc.clone(),
5954            selection: query,
5955            graphql_client: self.graphql_client.clone(),
5956        }
5957    }
5958    /// The current set of entries in the cache
5959    ///
5960    /// # Arguments
5961    ///
5962    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5963    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5964        let mut query = self.selection.select("entrySet");
5965        if let Some(key) = opts.key {
5966            query = query.arg("key", key);
5967        }
5968        EngineCacheEntrySet {
5969            proc: self.proc.clone(),
5970            selection: query,
5971            graphql_client: self.graphql_client.clone(),
5972        }
5973    }
5974    /// A unique identifier for this EngineCache.
5975    pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
5976        let query = self.selection.select("id");
5977        query.execute(self.graphql_client.clone()).await
5978    }
5979    /// The maximum bytes to keep in the cache without pruning.
5980    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5981        let query = self.selection.select("maxUsedSpace");
5982        query.execute(self.graphql_client.clone()).await
5983    }
5984    /// The target amount of free disk space the garbage collector will attempt to leave.
5985    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5986        let query = self.selection.select("minFreeSpace");
5987        query.execute(self.graphql_client.clone()).await
5988    }
5989    /// Prune the cache of releaseable entries
5990    ///
5991    /// # Arguments
5992    ///
5993    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5994    pub async fn prune(&self) -> Result<Void, DaggerError> {
5995        let query = self.selection.select("prune");
5996        query.execute(self.graphql_client.clone()).await
5997    }
5998    /// Prune the cache of releaseable entries
5999    ///
6000    /// # Arguments
6001    ///
6002    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6003    pub async fn prune_opts(&self, opts: EngineCachePruneOpts) -> Result<Void, DaggerError> {
6004        let mut query = self.selection.select("prune");
6005        if let Some(use_default_policy) = opts.use_default_policy {
6006            query = query.arg("useDefaultPolicy", use_default_policy);
6007        }
6008        query.execute(self.graphql_client.clone()).await
6009    }
6010    /// The minimum amount of disk space this policy is guaranteed to retain.
6011    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
6012        let query = self.selection.select("reservedSpace");
6013        query.execute(self.graphql_client.clone()).await
6014    }
6015    /// The target number of bytes to keep when pruning.
6016    pub async fn target_space(&self) -> Result<isize, DaggerError> {
6017        let query = self.selection.select("targetSpace");
6018        query.execute(self.graphql_client.clone()).await
6019    }
6020}
6021#[derive(Clone)]
6022pub struct EngineCacheEntry {
6023    pub proc: Option<Arc<DaggerSessionProc>>,
6024    pub selection: Selection,
6025    pub graphql_client: DynGraphQLClient,
6026}
6027impl EngineCacheEntry {
6028    /// Whether the cache entry is actively being used.
6029    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
6030        let query = self.selection.select("activelyUsed");
6031        query.execute(self.graphql_client.clone()).await
6032    }
6033    /// The time the cache entry was created, in Unix nanoseconds.
6034    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
6035        let query = self.selection.select("createdTimeUnixNano");
6036        query.execute(self.graphql_client.clone()).await
6037    }
6038    /// The description of the cache entry.
6039    pub async fn description(&self) -> Result<String, DaggerError> {
6040        let query = self.selection.select("description");
6041        query.execute(self.graphql_client.clone()).await
6042    }
6043    /// The disk space used by the cache entry.
6044    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6045        let query = self.selection.select("diskSpaceBytes");
6046        query.execute(self.graphql_client.clone()).await
6047    }
6048    /// A unique identifier for this EngineCacheEntry.
6049    pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
6050        let query = self.selection.select("id");
6051        query.execute(self.graphql_client.clone()).await
6052    }
6053    /// The most recent time the cache entry was used, in Unix nanoseconds.
6054    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
6055        let query = self.selection.select("mostRecentUseTimeUnixNano");
6056        query.execute(self.graphql_client.clone()).await
6057    }
6058}
6059#[derive(Clone)]
6060pub struct EngineCacheEntrySet {
6061    pub proc: Option<Arc<DaggerSessionProc>>,
6062    pub selection: Selection,
6063    pub graphql_client: DynGraphQLClient,
6064}
6065impl EngineCacheEntrySet {
6066    /// The total disk space used by the cache entries in this set.
6067    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6068        let query = self.selection.select("diskSpaceBytes");
6069        query.execute(self.graphql_client.clone()).await
6070    }
6071    /// The list of individual cache entries in the set
6072    pub fn entries(&self) -> Vec<EngineCacheEntry> {
6073        let query = self.selection.select("entries");
6074        vec![EngineCacheEntry {
6075            proc: self.proc.clone(),
6076            selection: query,
6077            graphql_client: self.graphql_client.clone(),
6078        }]
6079    }
6080    /// The number of cache entries in this set.
6081    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6082        let query = self.selection.select("entryCount");
6083        query.execute(self.graphql_client.clone()).await
6084    }
6085    /// A unique identifier for this EngineCacheEntrySet.
6086    pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
6087        let query = self.selection.select("id");
6088        query.execute(self.graphql_client.clone()).await
6089    }
6090}
6091#[derive(Clone)]
6092pub struct EnumTypeDef {
6093    pub proc: Option<Arc<DaggerSessionProc>>,
6094    pub selection: Selection,
6095    pub graphql_client: DynGraphQLClient,
6096}
6097impl EnumTypeDef {
6098    /// A doc string for the enum, if any.
6099    pub async fn description(&self) -> Result<String, DaggerError> {
6100        let query = self.selection.select("description");
6101        query.execute(self.graphql_client.clone()).await
6102    }
6103    /// A unique identifier for this EnumTypeDef.
6104    pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
6105        let query = self.selection.select("id");
6106        query.execute(self.graphql_client.clone()).await
6107    }
6108    /// The members of the enum.
6109    pub fn members(&self) -> Vec<EnumValueTypeDef> {
6110        let query = self.selection.select("members");
6111        vec![EnumValueTypeDef {
6112            proc: self.proc.clone(),
6113            selection: query,
6114            graphql_client: self.graphql_client.clone(),
6115        }]
6116    }
6117    /// The name of the enum.
6118    pub async fn name(&self) -> Result<String, DaggerError> {
6119        let query = self.selection.select("name");
6120        query.execute(self.graphql_client.clone()).await
6121    }
6122    /// The location of this enum declaration.
6123    pub fn source_map(&self) -> SourceMap {
6124        let query = self.selection.select("sourceMap");
6125        SourceMap {
6126            proc: self.proc.clone(),
6127            selection: query,
6128            graphql_client: self.graphql_client.clone(),
6129        }
6130    }
6131    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
6132    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6133        let query = self.selection.select("sourceModuleName");
6134        query.execute(self.graphql_client.clone()).await
6135    }
6136    pub fn values(&self) -> Vec<EnumValueTypeDef> {
6137        let query = self.selection.select("values");
6138        vec![EnumValueTypeDef {
6139            proc: self.proc.clone(),
6140            selection: query,
6141            graphql_client: self.graphql_client.clone(),
6142        }]
6143    }
6144}
6145#[derive(Clone)]
6146pub struct EnumValueTypeDef {
6147    pub proc: Option<Arc<DaggerSessionProc>>,
6148    pub selection: Selection,
6149    pub graphql_client: DynGraphQLClient,
6150}
6151impl EnumValueTypeDef {
6152    /// A doc string for the enum member, if any.
6153    pub async fn description(&self) -> Result<String, DaggerError> {
6154        let query = self.selection.select("description");
6155        query.execute(self.graphql_client.clone()).await
6156    }
6157    /// A unique identifier for this EnumValueTypeDef.
6158    pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
6159        let query = self.selection.select("id");
6160        query.execute(self.graphql_client.clone()).await
6161    }
6162    /// The name of the enum member.
6163    pub async fn name(&self) -> Result<String, DaggerError> {
6164        let query = self.selection.select("name");
6165        query.execute(self.graphql_client.clone()).await
6166    }
6167    /// The location of this enum member declaration.
6168    pub fn source_map(&self) -> SourceMap {
6169        let query = self.selection.select("sourceMap");
6170        SourceMap {
6171            proc: self.proc.clone(),
6172            selection: query,
6173            graphql_client: self.graphql_client.clone(),
6174        }
6175    }
6176    /// The value of the enum member
6177    pub async fn value(&self) -> Result<String, DaggerError> {
6178        let query = self.selection.select("value");
6179        query.execute(self.graphql_client.clone()).await
6180    }
6181}
6182#[derive(Clone)]
6183pub struct Env {
6184    pub proc: Option<Arc<DaggerSessionProc>>,
6185    pub selection: Selection,
6186    pub graphql_client: DynGraphQLClient,
6187}
6188impl Env {
6189    /// A unique identifier for this Env.
6190    pub async fn id(&self) -> Result<EnvId, DaggerError> {
6191        let query = self.selection.select("id");
6192        query.execute(self.graphql_client.clone()).await
6193    }
6194    /// Retrieves an input binding by name
6195    pub fn input(&self, name: impl Into<String>) -> Binding {
6196        let mut query = self.selection.select("input");
6197        query = query.arg("name", name.into());
6198        Binding {
6199            proc: self.proc.clone(),
6200            selection: query,
6201            graphql_client: self.graphql_client.clone(),
6202        }
6203    }
6204    /// Returns all input bindings provided to the environment
6205    pub fn inputs(&self) -> Vec<Binding> {
6206        let query = self.selection.select("inputs");
6207        vec![Binding {
6208            proc: self.proc.clone(),
6209            selection: query,
6210            graphql_client: self.graphql_client.clone(),
6211        }]
6212    }
6213    /// Retrieves an output binding by name
6214    pub fn output(&self, name: impl Into<String>) -> Binding {
6215        let mut query = self.selection.select("output");
6216        query = query.arg("name", name.into());
6217        Binding {
6218            proc: self.proc.clone(),
6219            selection: query,
6220            graphql_client: self.graphql_client.clone(),
6221        }
6222    }
6223    /// Returns all declared output bindings for the environment
6224    pub fn outputs(&self) -> Vec<Binding> {
6225        let query = self.selection.select("outputs");
6226        vec![Binding {
6227            proc: self.proc.clone(),
6228            selection: query,
6229            graphql_client: self.graphql_client.clone(),
6230        }]
6231    }
6232    /// Create or update a binding of type Address in the environment
6233    ///
6234    /// # Arguments
6235    ///
6236    /// * `name` - The name of the binding
6237    /// * `value` - The Address value to assign to the binding
6238    /// * `description` - The purpose of the input
6239    pub fn with_address_input(
6240        &self,
6241        name: impl Into<String>,
6242        value: impl IntoID<AddressId>,
6243        description: impl Into<String>,
6244    ) -> Env {
6245        let mut query = self.selection.select("withAddressInput");
6246        query = query.arg("name", name.into());
6247        query = query.arg_lazy(
6248            "value",
6249            Box::new(move || {
6250                let value = value.clone();
6251                Box::pin(async move { value.into_id().await.unwrap().quote() })
6252            }),
6253        );
6254        query = query.arg("description", description.into());
6255        Env {
6256            proc: self.proc.clone(),
6257            selection: query,
6258            graphql_client: self.graphql_client.clone(),
6259        }
6260    }
6261    /// Declare a desired Address output to be assigned in the environment
6262    ///
6263    /// # Arguments
6264    ///
6265    /// * `name` - The name of the binding
6266    /// * `description` - A description of the desired value of the binding
6267    pub fn with_address_output(
6268        &self,
6269        name: impl Into<String>,
6270        description: impl Into<String>,
6271    ) -> Env {
6272        let mut query = self.selection.select("withAddressOutput");
6273        query = query.arg("name", name.into());
6274        query = query.arg("description", description.into());
6275        Env {
6276            proc: self.proc.clone(),
6277            selection: query,
6278            graphql_client: self.graphql_client.clone(),
6279        }
6280    }
6281    /// Create or update a binding of type CacheVolume in the environment
6282    ///
6283    /// # Arguments
6284    ///
6285    /// * `name` - The name of the binding
6286    /// * `value` - The CacheVolume value to assign to the binding
6287    /// * `description` - The purpose of the input
6288    pub fn with_cache_volume_input(
6289        &self,
6290        name: impl Into<String>,
6291        value: impl IntoID<CacheVolumeId>,
6292        description: impl Into<String>,
6293    ) -> Env {
6294        let mut query = self.selection.select("withCacheVolumeInput");
6295        query = query.arg("name", name.into());
6296        query = query.arg_lazy(
6297            "value",
6298            Box::new(move || {
6299                let value = value.clone();
6300                Box::pin(async move { value.into_id().await.unwrap().quote() })
6301            }),
6302        );
6303        query = query.arg("description", description.into());
6304        Env {
6305            proc: self.proc.clone(),
6306            selection: query,
6307            graphql_client: self.graphql_client.clone(),
6308        }
6309    }
6310    /// Declare a desired CacheVolume output to be assigned in the environment
6311    ///
6312    /// # Arguments
6313    ///
6314    /// * `name` - The name of the binding
6315    /// * `description` - A description of the desired value of the binding
6316    pub fn with_cache_volume_output(
6317        &self,
6318        name: impl Into<String>,
6319        description: impl Into<String>,
6320    ) -> Env {
6321        let mut query = self.selection.select("withCacheVolumeOutput");
6322        query = query.arg("name", name.into());
6323        query = query.arg("description", description.into());
6324        Env {
6325            proc: self.proc.clone(),
6326            selection: query,
6327            graphql_client: self.graphql_client.clone(),
6328        }
6329    }
6330    /// Create or update a binding of type Changeset in the environment
6331    ///
6332    /// # Arguments
6333    ///
6334    /// * `name` - The name of the binding
6335    /// * `value` - The Changeset value to assign to the binding
6336    /// * `description` - The purpose of the input
6337    pub fn with_changeset_input(
6338        &self,
6339        name: impl Into<String>,
6340        value: impl IntoID<ChangesetId>,
6341        description: impl Into<String>,
6342    ) -> Env {
6343        let mut query = self.selection.select("withChangesetInput");
6344        query = query.arg("name", name.into());
6345        query = query.arg_lazy(
6346            "value",
6347            Box::new(move || {
6348                let value = value.clone();
6349                Box::pin(async move { value.into_id().await.unwrap().quote() })
6350            }),
6351        );
6352        query = query.arg("description", description.into());
6353        Env {
6354            proc: self.proc.clone(),
6355            selection: query,
6356            graphql_client: self.graphql_client.clone(),
6357        }
6358    }
6359    /// Declare a desired Changeset output to be assigned in the environment
6360    ///
6361    /// # Arguments
6362    ///
6363    /// * `name` - The name of the binding
6364    /// * `description` - A description of the desired value of the binding
6365    pub fn with_changeset_output(
6366        &self,
6367        name: impl Into<String>,
6368        description: impl Into<String>,
6369    ) -> Env {
6370        let mut query = self.selection.select("withChangesetOutput");
6371        query = query.arg("name", name.into());
6372        query = query.arg("description", description.into());
6373        Env {
6374            proc: self.proc.clone(),
6375            selection: query,
6376            graphql_client: self.graphql_client.clone(),
6377        }
6378    }
6379    /// Create or update a binding of type Cloud in the environment
6380    ///
6381    /// # Arguments
6382    ///
6383    /// * `name` - The name of the binding
6384    /// * `value` - The Cloud value to assign to the binding
6385    /// * `description` - The purpose of the input
6386    pub fn with_cloud_input(
6387        &self,
6388        name: impl Into<String>,
6389        value: impl IntoID<CloudId>,
6390        description: impl Into<String>,
6391    ) -> Env {
6392        let mut query = self.selection.select("withCloudInput");
6393        query = query.arg("name", name.into());
6394        query = query.arg_lazy(
6395            "value",
6396            Box::new(move || {
6397                let value = value.clone();
6398                Box::pin(async move { value.into_id().await.unwrap().quote() })
6399            }),
6400        );
6401        query = query.arg("description", description.into());
6402        Env {
6403            proc: self.proc.clone(),
6404            selection: query,
6405            graphql_client: self.graphql_client.clone(),
6406        }
6407    }
6408    /// Declare a desired Cloud output to be assigned in the environment
6409    ///
6410    /// # Arguments
6411    ///
6412    /// * `name` - The name of the binding
6413    /// * `description` - A description of the desired value of the binding
6414    pub fn with_cloud_output(
6415        &self,
6416        name: impl Into<String>,
6417        description: impl Into<String>,
6418    ) -> Env {
6419        let mut query = self.selection.select("withCloudOutput");
6420        query = query.arg("name", name.into());
6421        query = query.arg("description", description.into());
6422        Env {
6423            proc: self.proc.clone(),
6424            selection: query,
6425            graphql_client: self.graphql_client.clone(),
6426        }
6427    }
6428    /// Create or update a binding of type Container in the environment
6429    ///
6430    /// # Arguments
6431    ///
6432    /// * `name` - The name of the binding
6433    /// * `value` - The Container value to assign to the binding
6434    /// * `description` - The purpose of the input
6435    pub fn with_container_input(
6436        &self,
6437        name: impl Into<String>,
6438        value: impl IntoID<ContainerId>,
6439        description: impl Into<String>,
6440    ) -> Env {
6441        let mut query = self.selection.select("withContainerInput");
6442        query = query.arg("name", name.into());
6443        query = query.arg_lazy(
6444            "value",
6445            Box::new(move || {
6446                let value = value.clone();
6447                Box::pin(async move { value.into_id().await.unwrap().quote() })
6448            }),
6449        );
6450        query = query.arg("description", description.into());
6451        Env {
6452            proc: self.proc.clone(),
6453            selection: query,
6454            graphql_client: self.graphql_client.clone(),
6455        }
6456    }
6457    /// Declare a desired Container output to be assigned in the environment
6458    ///
6459    /// # Arguments
6460    ///
6461    /// * `name` - The name of the binding
6462    /// * `description` - A description of the desired value of the binding
6463    pub fn with_container_output(
6464        &self,
6465        name: impl Into<String>,
6466        description: impl Into<String>,
6467    ) -> Env {
6468        let mut query = self.selection.select("withContainerOutput");
6469        query = query.arg("name", name.into());
6470        query = query.arg("description", description.into());
6471        Env {
6472            proc: self.proc.clone(),
6473            selection: query,
6474            graphql_client: self.graphql_client.clone(),
6475        }
6476    }
6477    /// Installs the current module into the environment, exposing its functions to the model
6478    /// Contextual path arguments will be populated using the environment's workspace.
6479    pub fn with_current_module(&self) -> Env {
6480        let query = self.selection.select("withCurrentModule");
6481        Env {
6482            proc: self.proc.clone(),
6483            selection: query,
6484            graphql_client: self.graphql_client.clone(),
6485        }
6486    }
6487    /// Create or update a binding of type Directory in the environment
6488    ///
6489    /// # Arguments
6490    ///
6491    /// * `name` - The name of the binding
6492    /// * `value` - The Directory value to assign to the binding
6493    /// * `description` - The purpose of the input
6494    pub fn with_directory_input(
6495        &self,
6496        name: impl Into<String>,
6497        value: impl IntoID<DirectoryId>,
6498        description: impl Into<String>,
6499    ) -> Env {
6500        let mut query = self.selection.select("withDirectoryInput");
6501        query = query.arg("name", name.into());
6502        query = query.arg_lazy(
6503            "value",
6504            Box::new(move || {
6505                let value = value.clone();
6506                Box::pin(async move { value.into_id().await.unwrap().quote() })
6507            }),
6508        );
6509        query = query.arg("description", description.into());
6510        Env {
6511            proc: self.proc.clone(),
6512            selection: query,
6513            graphql_client: self.graphql_client.clone(),
6514        }
6515    }
6516    /// Declare a desired Directory output to be assigned in the environment
6517    ///
6518    /// # Arguments
6519    ///
6520    /// * `name` - The name of the binding
6521    /// * `description` - A description of the desired value of the binding
6522    pub fn with_directory_output(
6523        &self,
6524        name: impl Into<String>,
6525        description: impl Into<String>,
6526    ) -> Env {
6527        let mut query = self.selection.select("withDirectoryOutput");
6528        query = query.arg("name", name.into());
6529        query = query.arg("description", description.into());
6530        Env {
6531            proc: self.proc.clone(),
6532            selection: query,
6533            graphql_client: self.graphql_client.clone(),
6534        }
6535    }
6536    /// Create or update a binding of type EnvFile in the environment
6537    ///
6538    /// # Arguments
6539    ///
6540    /// * `name` - The name of the binding
6541    /// * `value` - The EnvFile value to assign to the binding
6542    /// * `description` - The purpose of the input
6543    pub fn with_env_file_input(
6544        &self,
6545        name: impl Into<String>,
6546        value: impl IntoID<EnvFileId>,
6547        description: impl Into<String>,
6548    ) -> Env {
6549        let mut query = self.selection.select("withEnvFileInput");
6550        query = query.arg("name", name.into());
6551        query = query.arg_lazy(
6552            "value",
6553            Box::new(move || {
6554                let value = value.clone();
6555                Box::pin(async move { value.into_id().await.unwrap().quote() })
6556            }),
6557        );
6558        query = query.arg("description", description.into());
6559        Env {
6560            proc: self.proc.clone(),
6561            selection: query,
6562            graphql_client: self.graphql_client.clone(),
6563        }
6564    }
6565    /// Declare a desired EnvFile output to be assigned in the environment
6566    ///
6567    /// # Arguments
6568    ///
6569    /// * `name` - The name of the binding
6570    /// * `description` - A description of the desired value of the binding
6571    pub fn with_env_file_output(
6572        &self,
6573        name: impl Into<String>,
6574        description: impl Into<String>,
6575    ) -> Env {
6576        let mut query = self.selection.select("withEnvFileOutput");
6577        query = query.arg("name", name.into());
6578        query = query.arg("description", description.into());
6579        Env {
6580            proc: self.proc.clone(),
6581            selection: query,
6582            graphql_client: self.graphql_client.clone(),
6583        }
6584    }
6585    /// Create or update a binding of type Env in the environment
6586    ///
6587    /// # Arguments
6588    ///
6589    /// * `name` - The name of the binding
6590    /// * `value` - The Env value to assign to the binding
6591    /// * `description` - The purpose of the input
6592    pub fn with_env_input(
6593        &self,
6594        name: impl Into<String>,
6595        value: impl IntoID<EnvId>,
6596        description: impl Into<String>,
6597    ) -> Env {
6598        let mut query = self.selection.select("withEnvInput");
6599        query = query.arg("name", name.into());
6600        query = query.arg_lazy(
6601            "value",
6602            Box::new(move || {
6603                let value = value.clone();
6604                Box::pin(async move { value.into_id().await.unwrap().quote() })
6605            }),
6606        );
6607        query = query.arg("description", description.into());
6608        Env {
6609            proc: self.proc.clone(),
6610            selection: query,
6611            graphql_client: self.graphql_client.clone(),
6612        }
6613    }
6614    /// Declare a desired Env output to be assigned in the environment
6615    ///
6616    /// # Arguments
6617    ///
6618    /// * `name` - The name of the binding
6619    /// * `description` - A description of the desired value of the binding
6620    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6621        let mut query = self.selection.select("withEnvOutput");
6622        query = query.arg("name", name.into());
6623        query = query.arg("description", description.into());
6624        Env {
6625            proc: self.proc.clone(),
6626            selection: query,
6627            graphql_client: self.graphql_client.clone(),
6628        }
6629    }
6630    /// Create or update a binding of type File in the environment
6631    ///
6632    /// # Arguments
6633    ///
6634    /// * `name` - The name of the binding
6635    /// * `value` - The File value to assign to the binding
6636    /// * `description` - The purpose of the input
6637    pub fn with_file_input(
6638        &self,
6639        name: impl Into<String>,
6640        value: impl IntoID<FileId>,
6641        description: impl Into<String>,
6642    ) -> Env {
6643        let mut query = self.selection.select("withFileInput");
6644        query = query.arg("name", name.into());
6645        query = query.arg_lazy(
6646            "value",
6647            Box::new(move || {
6648                let value = value.clone();
6649                Box::pin(async move { value.into_id().await.unwrap().quote() })
6650            }),
6651        );
6652        query = query.arg("description", description.into());
6653        Env {
6654            proc: self.proc.clone(),
6655            selection: query,
6656            graphql_client: self.graphql_client.clone(),
6657        }
6658    }
6659    /// Declare a desired File output to be assigned in the environment
6660    ///
6661    /// # Arguments
6662    ///
6663    /// * `name` - The name of the binding
6664    /// * `description` - A description of the desired value of the binding
6665    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6666        let mut query = self.selection.select("withFileOutput");
6667        query = query.arg("name", name.into());
6668        query = query.arg("description", description.into());
6669        Env {
6670            proc: self.proc.clone(),
6671            selection: query,
6672            graphql_client: self.graphql_client.clone(),
6673        }
6674    }
6675    /// Create or update a binding of type GitRef in the environment
6676    ///
6677    /// # Arguments
6678    ///
6679    /// * `name` - The name of the binding
6680    /// * `value` - The GitRef value to assign to the binding
6681    /// * `description` - The purpose of the input
6682    pub fn with_git_ref_input(
6683        &self,
6684        name: impl Into<String>,
6685        value: impl IntoID<GitRefId>,
6686        description: impl Into<String>,
6687    ) -> Env {
6688        let mut query = self.selection.select("withGitRefInput");
6689        query = query.arg("name", name.into());
6690        query = query.arg_lazy(
6691            "value",
6692            Box::new(move || {
6693                let value = value.clone();
6694                Box::pin(async move { value.into_id().await.unwrap().quote() })
6695            }),
6696        );
6697        query = query.arg("description", description.into());
6698        Env {
6699            proc: self.proc.clone(),
6700            selection: query,
6701            graphql_client: self.graphql_client.clone(),
6702        }
6703    }
6704    /// Declare a desired GitRef output to be assigned in the environment
6705    ///
6706    /// # Arguments
6707    ///
6708    /// * `name` - The name of the binding
6709    /// * `description` - A description of the desired value of the binding
6710    pub fn with_git_ref_output(
6711        &self,
6712        name: impl Into<String>,
6713        description: impl Into<String>,
6714    ) -> Env {
6715        let mut query = self.selection.select("withGitRefOutput");
6716        query = query.arg("name", name.into());
6717        query = query.arg("description", description.into());
6718        Env {
6719            proc: self.proc.clone(),
6720            selection: query,
6721            graphql_client: self.graphql_client.clone(),
6722        }
6723    }
6724    /// Create or update a binding of type GitRepository in the environment
6725    ///
6726    /// # Arguments
6727    ///
6728    /// * `name` - The name of the binding
6729    /// * `value` - The GitRepository value to assign to the binding
6730    /// * `description` - The purpose of the input
6731    pub fn with_git_repository_input(
6732        &self,
6733        name: impl Into<String>,
6734        value: impl IntoID<GitRepositoryId>,
6735        description: impl Into<String>,
6736    ) -> Env {
6737        let mut query = self.selection.select("withGitRepositoryInput");
6738        query = query.arg("name", name.into());
6739        query = query.arg_lazy(
6740            "value",
6741            Box::new(move || {
6742                let value = value.clone();
6743                Box::pin(async move { value.into_id().await.unwrap().quote() })
6744            }),
6745        );
6746        query = query.arg("description", description.into());
6747        Env {
6748            proc: self.proc.clone(),
6749            selection: query,
6750            graphql_client: self.graphql_client.clone(),
6751        }
6752    }
6753    /// Declare a desired GitRepository output to be assigned in the environment
6754    ///
6755    /// # Arguments
6756    ///
6757    /// * `name` - The name of the binding
6758    /// * `description` - A description of the desired value of the binding
6759    pub fn with_git_repository_output(
6760        &self,
6761        name: impl Into<String>,
6762        description: impl Into<String>,
6763    ) -> Env {
6764        let mut query = self.selection.select("withGitRepositoryOutput");
6765        query = query.arg("name", name.into());
6766        query = query.arg("description", description.into());
6767        Env {
6768            proc: self.proc.clone(),
6769            selection: query,
6770            graphql_client: self.graphql_client.clone(),
6771        }
6772    }
6773    /// Create or update a binding of type JSONValue in the environment
6774    ///
6775    /// # Arguments
6776    ///
6777    /// * `name` - The name of the binding
6778    /// * `value` - The JSONValue value to assign to the binding
6779    /// * `description` - The purpose of the input
6780    pub fn with_json_value_input(
6781        &self,
6782        name: impl Into<String>,
6783        value: impl IntoID<JsonValueId>,
6784        description: impl Into<String>,
6785    ) -> Env {
6786        let mut query = self.selection.select("withJSONValueInput");
6787        query = query.arg("name", name.into());
6788        query = query.arg_lazy(
6789            "value",
6790            Box::new(move || {
6791                let value = value.clone();
6792                Box::pin(async move { value.into_id().await.unwrap().quote() })
6793            }),
6794        );
6795        query = query.arg("description", description.into());
6796        Env {
6797            proc: self.proc.clone(),
6798            selection: query,
6799            graphql_client: self.graphql_client.clone(),
6800        }
6801    }
6802    /// Declare a desired JSONValue output to be assigned in the environment
6803    ///
6804    /// # Arguments
6805    ///
6806    /// * `name` - The name of the binding
6807    /// * `description` - A description of the desired value of the binding
6808    pub fn with_json_value_output(
6809        &self,
6810        name: impl Into<String>,
6811        description: impl Into<String>,
6812    ) -> Env {
6813        let mut query = self.selection.select("withJSONValueOutput");
6814        query = query.arg("name", name.into());
6815        query = query.arg("description", description.into());
6816        Env {
6817            proc: self.proc.clone(),
6818            selection: query,
6819            graphql_client: self.graphql_client.clone(),
6820        }
6821    }
6822    /// Installs a module into the environment, exposing its functions to the model
6823    /// Contextual path arguments will be populated using the environment's workspace.
6824    pub fn with_module(&self, module: impl IntoID<ModuleId>) -> Env {
6825        let mut query = self.selection.select("withModule");
6826        query = query.arg_lazy(
6827            "module",
6828            Box::new(move || {
6829                let module = module.clone();
6830                Box::pin(async move { module.into_id().await.unwrap().quote() })
6831            }),
6832        );
6833        Env {
6834            proc: self.proc.clone(),
6835            selection: query,
6836            graphql_client: self.graphql_client.clone(),
6837        }
6838    }
6839    /// Create or update a binding of type ModuleConfigClient in the environment
6840    ///
6841    /// # Arguments
6842    ///
6843    /// * `name` - The name of the binding
6844    /// * `value` - The ModuleConfigClient value to assign to the binding
6845    /// * `description` - The purpose of the input
6846    pub fn with_module_config_client_input(
6847        &self,
6848        name: impl Into<String>,
6849        value: impl IntoID<ModuleConfigClientId>,
6850        description: impl Into<String>,
6851    ) -> Env {
6852        let mut query = self.selection.select("withModuleConfigClientInput");
6853        query = query.arg("name", name.into());
6854        query = query.arg_lazy(
6855            "value",
6856            Box::new(move || {
6857                let value = value.clone();
6858                Box::pin(async move { value.into_id().await.unwrap().quote() })
6859            }),
6860        );
6861        query = query.arg("description", description.into());
6862        Env {
6863            proc: self.proc.clone(),
6864            selection: query,
6865            graphql_client: self.graphql_client.clone(),
6866        }
6867    }
6868    /// Declare a desired ModuleConfigClient output to be assigned in the environment
6869    ///
6870    /// # Arguments
6871    ///
6872    /// * `name` - The name of the binding
6873    /// * `description` - A description of the desired value of the binding
6874    pub fn with_module_config_client_output(
6875        &self,
6876        name: impl Into<String>,
6877        description: impl Into<String>,
6878    ) -> Env {
6879        let mut query = self.selection.select("withModuleConfigClientOutput");
6880        query = query.arg("name", name.into());
6881        query = query.arg("description", description.into());
6882        Env {
6883            proc: self.proc.clone(),
6884            selection: query,
6885            graphql_client: self.graphql_client.clone(),
6886        }
6887    }
6888    /// Create or update a binding of type Module in the environment
6889    ///
6890    /// # Arguments
6891    ///
6892    /// * `name` - The name of the binding
6893    /// * `value` - The Module value to assign to the binding
6894    /// * `description` - The purpose of the input
6895    pub fn with_module_input(
6896        &self,
6897        name: impl Into<String>,
6898        value: impl IntoID<ModuleId>,
6899        description: impl Into<String>,
6900    ) -> Env {
6901        let mut query = self.selection.select("withModuleInput");
6902        query = query.arg("name", name.into());
6903        query = query.arg_lazy(
6904            "value",
6905            Box::new(move || {
6906                let value = value.clone();
6907                Box::pin(async move { value.into_id().await.unwrap().quote() })
6908            }),
6909        );
6910        query = query.arg("description", description.into());
6911        Env {
6912            proc: self.proc.clone(),
6913            selection: query,
6914            graphql_client: self.graphql_client.clone(),
6915        }
6916    }
6917    /// Declare a desired Module output to be assigned in the environment
6918    ///
6919    /// # Arguments
6920    ///
6921    /// * `name` - The name of the binding
6922    /// * `description` - A description of the desired value of the binding
6923    pub fn with_module_output(
6924        &self,
6925        name: impl Into<String>,
6926        description: impl Into<String>,
6927    ) -> Env {
6928        let mut query = self.selection.select("withModuleOutput");
6929        query = query.arg("name", name.into());
6930        query = query.arg("description", description.into());
6931        Env {
6932            proc: self.proc.clone(),
6933            selection: query,
6934            graphql_client: self.graphql_client.clone(),
6935        }
6936    }
6937    /// Create or update a binding of type ModuleSource in the environment
6938    ///
6939    /// # Arguments
6940    ///
6941    /// * `name` - The name of the binding
6942    /// * `value` - The ModuleSource value to assign to the binding
6943    /// * `description` - The purpose of the input
6944    pub fn with_module_source_input(
6945        &self,
6946        name: impl Into<String>,
6947        value: impl IntoID<ModuleSourceId>,
6948        description: impl Into<String>,
6949    ) -> Env {
6950        let mut query = self.selection.select("withModuleSourceInput");
6951        query = query.arg("name", name.into());
6952        query = query.arg_lazy(
6953            "value",
6954            Box::new(move || {
6955                let value = value.clone();
6956                Box::pin(async move { value.into_id().await.unwrap().quote() })
6957            }),
6958        );
6959        query = query.arg("description", description.into());
6960        Env {
6961            proc: self.proc.clone(),
6962            selection: query,
6963            graphql_client: self.graphql_client.clone(),
6964        }
6965    }
6966    /// Declare a desired ModuleSource output to be assigned in the environment
6967    ///
6968    /// # Arguments
6969    ///
6970    /// * `name` - The name of the binding
6971    /// * `description` - A description of the desired value of the binding
6972    pub fn with_module_source_output(
6973        &self,
6974        name: impl Into<String>,
6975        description: impl Into<String>,
6976    ) -> Env {
6977        let mut query = self.selection.select("withModuleSourceOutput");
6978        query = query.arg("name", name.into());
6979        query = query.arg("description", description.into());
6980        Env {
6981            proc: self.proc.clone(),
6982            selection: query,
6983            graphql_client: self.graphql_client.clone(),
6984        }
6985    }
6986    /// Create or update a binding of type SearchResult in the environment
6987    ///
6988    /// # Arguments
6989    ///
6990    /// * `name` - The name of the binding
6991    /// * `value` - The SearchResult value to assign to the binding
6992    /// * `description` - The purpose of the input
6993    pub fn with_search_result_input(
6994        &self,
6995        name: impl Into<String>,
6996        value: impl IntoID<SearchResultId>,
6997        description: impl Into<String>,
6998    ) -> Env {
6999        let mut query = self.selection.select("withSearchResultInput");
7000        query = query.arg("name", name.into());
7001        query = query.arg_lazy(
7002            "value",
7003            Box::new(move || {
7004                let value = value.clone();
7005                Box::pin(async move { value.into_id().await.unwrap().quote() })
7006            }),
7007        );
7008        query = query.arg("description", description.into());
7009        Env {
7010            proc: self.proc.clone(),
7011            selection: query,
7012            graphql_client: self.graphql_client.clone(),
7013        }
7014    }
7015    /// Declare a desired SearchResult output to be assigned in the environment
7016    ///
7017    /// # Arguments
7018    ///
7019    /// * `name` - The name of the binding
7020    /// * `description` - A description of the desired value of the binding
7021    pub fn with_search_result_output(
7022        &self,
7023        name: impl Into<String>,
7024        description: impl Into<String>,
7025    ) -> Env {
7026        let mut query = self.selection.select("withSearchResultOutput");
7027        query = query.arg("name", name.into());
7028        query = query.arg("description", description.into());
7029        Env {
7030            proc: self.proc.clone(),
7031            selection: query,
7032            graphql_client: self.graphql_client.clone(),
7033        }
7034    }
7035    /// Create or update a binding of type SearchSubmatch in the environment
7036    ///
7037    /// # Arguments
7038    ///
7039    /// * `name` - The name of the binding
7040    /// * `value` - The SearchSubmatch value to assign to the binding
7041    /// * `description` - The purpose of the input
7042    pub fn with_search_submatch_input(
7043        &self,
7044        name: impl Into<String>,
7045        value: impl IntoID<SearchSubmatchId>,
7046        description: impl Into<String>,
7047    ) -> Env {
7048        let mut query = self.selection.select("withSearchSubmatchInput");
7049        query = query.arg("name", name.into());
7050        query = query.arg_lazy(
7051            "value",
7052            Box::new(move || {
7053                let value = value.clone();
7054                Box::pin(async move { value.into_id().await.unwrap().quote() })
7055            }),
7056        );
7057        query = query.arg("description", description.into());
7058        Env {
7059            proc: self.proc.clone(),
7060            selection: query,
7061            graphql_client: self.graphql_client.clone(),
7062        }
7063    }
7064    /// Declare a desired SearchSubmatch output to be assigned in the environment
7065    ///
7066    /// # Arguments
7067    ///
7068    /// * `name` - The name of the binding
7069    /// * `description` - A description of the desired value of the binding
7070    pub fn with_search_submatch_output(
7071        &self,
7072        name: impl Into<String>,
7073        description: impl Into<String>,
7074    ) -> Env {
7075        let mut query = self.selection.select("withSearchSubmatchOutput");
7076        query = query.arg("name", name.into());
7077        query = query.arg("description", description.into());
7078        Env {
7079            proc: self.proc.clone(),
7080            selection: query,
7081            graphql_client: self.graphql_client.clone(),
7082        }
7083    }
7084    /// Create or update a binding of type Secret in the environment
7085    ///
7086    /// # Arguments
7087    ///
7088    /// * `name` - The name of the binding
7089    /// * `value` - The Secret value to assign to the binding
7090    /// * `description` - The purpose of the input
7091    pub fn with_secret_input(
7092        &self,
7093        name: impl Into<String>,
7094        value: impl IntoID<SecretId>,
7095        description: impl Into<String>,
7096    ) -> Env {
7097        let mut query = self.selection.select("withSecretInput");
7098        query = query.arg("name", name.into());
7099        query = query.arg_lazy(
7100            "value",
7101            Box::new(move || {
7102                let value = value.clone();
7103                Box::pin(async move { value.into_id().await.unwrap().quote() })
7104            }),
7105        );
7106        query = query.arg("description", description.into());
7107        Env {
7108            proc: self.proc.clone(),
7109            selection: query,
7110            graphql_client: self.graphql_client.clone(),
7111        }
7112    }
7113    /// Declare a desired Secret output to be assigned in the environment
7114    ///
7115    /// # Arguments
7116    ///
7117    /// * `name` - The name of the binding
7118    /// * `description` - A description of the desired value of the binding
7119    pub fn with_secret_output(
7120        &self,
7121        name: impl Into<String>,
7122        description: impl Into<String>,
7123    ) -> Env {
7124        let mut query = self.selection.select("withSecretOutput");
7125        query = query.arg("name", name.into());
7126        query = query.arg("description", description.into());
7127        Env {
7128            proc: self.proc.clone(),
7129            selection: query,
7130            graphql_client: self.graphql_client.clone(),
7131        }
7132    }
7133    /// Create or update a binding of type Service in the environment
7134    ///
7135    /// # Arguments
7136    ///
7137    /// * `name` - The name of the binding
7138    /// * `value` - The Service value to assign to the binding
7139    /// * `description` - The purpose of the input
7140    pub fn with_service_input(
7141        &self,
7142        name: impl Into<String>,
7143        value: impl IntoID<ServiceId>,
7144        description: impl Into<String>,
7145    ) -> Env {
7146        let mut query = self.selection.select("withServiceInput");
7147        query = query.arg("name", name.into());
7148        query = query.arg_lazy(
7149            "value",
7150            Box::new(move || {
7151                let value = value.clone();
7152                Box::pin(async move { value.into_id().await.unwrap().quote() })
7153            }),
7154        );
7155        query = query.arg("description", description.into());
7156        Env {
7157            proc: self.proc.clone(),
7158            selection: query,
7159            graphql_client: self.graphql_client.clone(),
7160        }
7161    }
7162    /// Declare a desired Service output to be assigned in the environment
7163    ///
7164    /// # Arguments
7165    ///
7166    /// * `name` - The name of the binding
7167    /// * `description` - A description of the desired value of the binding
7168    pub fn with_service_output(
7169        &self,
7170        name: impl Into<String>,
7171        description: impl Into<String>,
7172    ) -> Env {
7173        let mut query = self.selection.select("withServiceOutput");
7174        query = query.arg("name", name.into());
7175        query = query.arg("description", description.into());
7176        Env {
7177            proc: self.proc.clone(),
7178            selection: query,
7179            graphql_client: self.graphql_client.clone(),
7180        }
7181    }
7182    /// Create or update a binding of type Socket in the environment
7183    ///
7184    /// # Arguments
7185    ///
7186    /// * `name` - The name of the binding
7187    /// * `value` - The Socket value to assign to the binding
7188    /// * `description` - The purpose of the input
7189    pub fn with_socket_input(
7190        &self,
7191        name: impl Into<String>,
7192        value: impl IntoID<SocketId>,
7193        description: impl Into<String>,
7194    ) -> Env {
7195        let mut query = self.selection.select("withSocketInput");
7196        query = query.arg("name", name.into());
7197        query = query.arg_lazy(
7198            "value",
7199            Box::new(move || {
7200                let value = value.clone();
7201                Box::pin(async move { value.into_id().await.unwrap().quote() })
7202            }),
7203        );
7204        query = query.arg("description", description.into());
7205        Env {
7206            proc: self.proc.clone(),
7207            selection: query,
7208            graphql_client: self.graphql_client.clone(),
7209        }
7210    }
7211    /// Declare a desired Socket output to be assigned in the environment
7212    ///
7213    /// # Arguments
7214    ///
7215    /// * `name` - The name of the binding
7216    /// * `description` - A description of the desired value of the binding
7217    pub fn with_socket_output(
7218        &self,
7219        name: impl Into<String>,
7220        description: impl Into<String>,
7221    ) -> Env {
7222        let mut query = self.selection.select("withSocketOutput");
7223        query = query.arg("name", name.into());
7224        query = query.arg("description", description.into());
7225        Env {
7226            proc: self.proc.clone(),
7227            selection: query,
7228            graphql_client: self.graphql_client.clone(),
7229        }
7230    }
7231    /// Provides a string input binding to the environment
7232    ///
7233    /// # Arguments
7234    ///
7235    /// * `name` - The name of the binding
7236    /// * `value` - The string value to assign to the binding
7237    /// * `description` - The description of the input
7238    pub fn with_string_input(
7239        &self,
7240        name: impl Into<String>,
7241        value: impl Into<String>,
7242        description: impl Into<String>,
7243    ) -> Env {
7244        let mut query = self.selection.select("withStringInput");
7245        query = query.arg("name", name.into());
7246        query = query.arg("value", value.into());
7247        query = query.arg("description", description.into());
7248        Env {
7249            proc: self.proc.clone(),
7250            selection: query,
7251            graphql_client: self.graphql_client.clone(),
7252        }
7253    }
7254    /// Declares a desired string output binding
7255    ///
7256    /// # Arguments
7257    ///
7258    /// * `name` - The name of the binding
7259    /// * `description` - The description of the output
7260    pub fn with_string_output(
7261        &self,
7262        name: impl Into<String>,
7263        description: impl Into<String>,
7264    ) -> Env {
7265        let mut query = self.selection.select("withStringOutput");
7266        query = query.arg("name", name.into());
7267        query = query.arg("description", description.into());
7268        Env {
7269            proc: self.proc.clone(),
7270            selection: query,
7271            graphql_client: self.graphql_client.clone(),
7272        }
7273    }
7274    /// Returns a new environment with the provided workspace
7275    ///
7276    /// # Arguments
7277    ///
7278    /// * `workspace` - The directory to set as the host filesystem
7279    pub fn with_workspace(&self, workspace: impl IntoID<DirectoryId>) -> Env {
7280        let mut query = self.selection.select("withWorkspace");
7281        query = query.arg_lazy(
7282            "workspace",
7283            Box::new(move || {
7284                let workspace = workspace.clone();
7285                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
7286            }),
7287        );
7288        Env {
7289            proc: self.proc.clone(),
7290            selection: query,
7291            graphql_client: self.graphql_client.clone(),
7292        }
7293    }
7294    /// Returns a new environment without any outputs
7295    pub fn without_outputs(&self) -> Env {
7296        let query = self.selection.select("withoutOutputs");
7297        Env {
7298            proc: self.proc.clone(),
7299            selection: query,
7300            graphql_client: self.graphql_client.clone(),
7301        }
7302    }
7303    pub fn workspace(&self) -> Directory {
7304        let query = self.selection.select("workspace");
7305        Directory {
7306            proc: self.proc.clone(),
7307            selection: query,
7308            graphql_client: self.graphql_client.clone(),
7309        }
7310    }
7311}
7312#[derive(Clone)]
7313pub struct EnvFile {
7314    pub proc: Option<Arc<DaggerSessionProc>>,
7315    pub selection: Selection,
7316    pub graphql_client: DynGraphQLClient,
7317}
7318#[derive(Builder, Debug, PartialEq)]
7319pub struct EnvFileGetOpts {
7320    /// Return the value exactly as written to the file. No quote removal or variable expansion
7321    #[builder(setter(into, strip_option), default)]
7322    pub raw: Option<bool>,
7323}
7324#[derive(Builder, Debug, PartialEq)]
7325pub struct EnvFileVariablesOpts {
7326    /// Return values exactly as written to the file. No quote removal or variable expansion
7327    #[builder(setter(into, strip_option), default)]
7328    pub raw: Option<bool>,
7329}
7330impl EnvFile {
7331    /// Return as a file
7332    pub fn as_file(&self) -> File {
7333        let query = self.selection.select("asFile");
7334        File {
7335            proc: self.proc.clone(),
7336            selection: query,
7337            graphql_client: self.graphql_client.clone(),
7338        }
7339    }
7340    /// Check if a variable exists
7341    ///
7342    /// # Arguments
7343    ///
7344    /// * `name` - Variable name
7345    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
7346        let mut query = self.selection.select("exists");
7347        query = query.arg("name", name.into());
7348        query.execute(self.graphql_client.clone()).await
7349    }
7350    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
7351    ///
7352    /// # Arguments
7353    ///
7354    /// * `name` - Variable name
7355    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7356    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
7357        let mut query = self.selection.select("get");
7358        query = query.arg("name", name.into());
7359        query.execute(self.graphql_client.clone()).await
7360    }
7361    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
7362    ///
7363    /// # Arguments
7364    ///
7365    /// * `name` - Variable name
7366    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7367    pub async fn get_opts(
7368        &self,
7369        name: impl Into<String>,
7370        opts: EnvFileGetOpts,
7371    ) -> Result<String, DaggerError> {
7372        let mut query = self.selection.select("get");
7373        query = query.arg("name", name.into());
7374        if let Some(raw) = opts.raw {
7375            query = query.arg("raw", raw);
7376        }
7377        query.execute(self.graphql_client.clone()).await
7378    }
7379    /// A unique identifier for this EnvFile.
7380    pub async fn id(&self) -> Result<EnvFileId, DaggerError> {
7381        let query = self.selection.select("id");
7382        query.execute(self.graphql_client.clone()).await
7383    }
7384    /// Return all variables
7385    ///
7386    /// # Arguments
7387    ///
7388    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7389    pub fn variables(&self) -> Vec<EnvVariable> {
7390        let query = self.selection.select("variables");
7391        vec![EnvVariable {
7392            proc: self.proc.clone(),
7393            selection: query,
7394            graphql_client: self.graphql_client.clone(),
7395        }]
7396    }
7397    /// Return all variables
7398    ///
7399    /// # Arguments
7400    ///
7401    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7402    pub fn variables_opts(&self, opts: EnvFileVariablesOpts) -> Vec<EnvVariable> {
7403        let mut query = self.selection.select("variables");
7404        if let Some(raw) = opts.raw {
7405            query = query.arg("raw", raw);
7406        }
7407        vec![EnvVariable {
7408            proc: self.proc.clone(),
7409            selection: query,
7410            graphql_client: self.graphql_client.clone(),
7411        }]
7412    }
7413    /// Add a variable
7414    ///
7415    /// # Arguments
7416    ///
7417    /// * `name` - Variable name
7418    /// * `value` - Variable value
7419    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
7420        let mut query = self.selection.select("withVariable");
7421        query = query.arg("name", name.into());
7422        query = query.arg("value", value.into());
7423        EnvFile {
7424            proc: self.proc.clone(),
7425            selection: query,
7426            graphql_client: self.graphql_client.clone(),
7427        }
7428    }
7429    /// Remove all occurrences of the named variable
7430    ///
7431    /// # Arguments
7432    ///
7433    /// * `name` - Variable name
7434    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
7435        let mut query = self.selection.select("withoutVariable");
7436        query = query.arg("name", name.into());
7437        EnvFile {
7438            proc: self.proc.clone(),
7439            selection: query,
7440            graphql_client: self.graphql_client.clone(),
7441        }
7442    }
7443}
7444#[derive(Clone)]
7445pub struct EnvVariable {
7446    pub proc: Option<Arc<DaggerSessionProc>>,
7447    pub selection: Selection,
7448    pub graphql_client: DynGraphQLClient,
7449}
7450impl EnvVariable {
7451    /// A unique identifier for this EnvVariable.
7452    pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
7453        let query = self.selection.select("id");
7454        query.execute(self.graphql_client.clone()).await
7455    }
7456    /// The environment variable name.
7457    pub async fn name(&self) -> Result<String, DaggerError> {
7458        let query = self.selection.select("name");
7459        query.execute(self.graphql_client.clone()).await
7460    }
7461    /// The environment variable value.
7462    pub async fn value(&self) -> Result<String, DaggerError> {
7463        let query = self.selection.select("value");
7464        query.execute(self.graphql_client.clone()).await
7465    }
7466}
7467#[derive(Clone)]
7468pub struct Error {
7469    pub proc: Option<Arc<DaggerSessionProc>>,
7470    pub selection: Selection,
7471    pub graphql_client: DynGraphQLClient,
7472}
7473impl Error {
7474    /// A unique identifier for this Error.
7475    pub async fn id(&self) -> Result<ErrorId, DaggerError> {
7476        let query = self.selection.select("id");
7477        query.execute(self.graphql_client.clone()).await
7478    }
7479    /// A description of the error.
7480    pub async fn message(&self) -> Result<String, DaggerError> {
7481        let query = self.selection.select("message");
7482        query.execute(self.graphql_client.clone()).await
7483    }
7484    /// The extensions of the error.
7485    pub fn values(&self) -> Vec<ErrorValue> {
7486        let query = self.selection.select("values");
7487        vec![ErrorValue {
7488            proc: self.proc.clone(),
7489            selection: query,
7490            graphql_client: self.graphql_client.clone(),
7491        }]
7492    }
7493    /// Add a value to the error.
7494    ///
7495    /// # Arguments
7496    ///
7497    /// * `name` - The name of the value.
7498    /// * `value` - The value to store on the error.
7499    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
7500        let mut query = self.selection.select("withValue");
7501        query = query.arg("name", name.into());
7502        query = query.arg("value", value);
7503        Error {
7504            proc: self.proc.clone(),
7505            selection: query,
7506            graphql_client: self.graphql_client.clone(),
7507        }
7508    }
7509}
7510#[derive(Clone)]
7511pub struct ErrorValue {
7512    pub proc: Option<Arc<DaggerSessionProc>>,
7513    pub selection: Selection,
7514    pub graphql_client: DynGraphQLClient,
7515}
7516impl ErrorValue {
7517    /// A unique identifier for this ErrorValue.
7518    pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
7519        let query = self.selection.select("id");
7520        query.execute(self.graphql_client.clone()).await
7521    }
7522    /// The name of the value.
7523    pub async fn name(&self) -> Result<String, DaggerError> {
7524        let query = self.selection.select("name");
7525        query.execute(self.graphql_client.clone()).await
7526    }
7527    /// The value.
7528    pub async fn value(&self) -> Result<Json, DaggerError> {
7529        let query = self.selection.select("value");
7530        query.execute(self.graphql_client.clone()).await
7531    }
7532}
7533#[derive(Clone)]
7534pub struct FieldTypeDef {
7535    pub proc: Option<Arc<DaggerSessionProc>>,
7536    pub selection: Selection,
7537    pub graphql_client: DynGraphQLClient,
7538}
7539impl FieldTypeDef {
7540    /// A doc string for the field, if any.
7541    pub async fn description(&self) -> Result<String, DaggerError> {
7542        let query = self.selection.select("description");
7543        query.execute(self.graphql_client.clone()).await
7544    }
7545    /// A unique identifier for this FieldTypeDef.
7546    pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
7547        let query = self.selection.select("id");
7548        query.execute(self.graphql_client.clone()).await
7549    }
7550    /// The name of the field in lowerCamelCase format.
7551    pub async fn name(&self) -> Result<String, DaggerError> {
7552        let query = self.selection.select("name");
7553        query.execute(self.graphql_client.clone()).await
7554    }
7555    /// The location of this field declaration.
7556    pub fn source_map(&self) -> SourceMap {
7557        let query = self.selection.select("sourceMap");
7558        SourceMap {
7559            proc: self.proc.clone(),
7560            selection: query,
7561            graphql_client: self.graphql_client.clone(),
7562        }
7563    }
7564    /// The type of the field.
7565    pub fn type_def(&self) -> TypeDef {
7566        let query = self.selection.select("typeDef");
7567        TypeDef {
7568            proc: self.proc.clone(),
7569            selection: query,
7570            graphql_client: self.graphql_client.clone(),
7571        }
7572    }
7573}
7574#[derive(Clone)]
7575pub struct File {
7576    pub proc: Option<Arc<DaggerSessionProc>>,
7577    pub selection: Selection,
7578    pub graphql_client: DynGraphQLClient,
7579}
7580#[derive(Builder, Debug, PartialEq)]
7581pub struct FileAsEnvFileOpts {
7582    /// Replace "${VAR}" or "$VAR" with the value of other vars
7583    #[builder(setter(into, strip_option), default)]
7584    pub expand: Option<bool>,
7585}
7586#[derive(Builder, Debug, PartialEq)]
7587pub struct FileContentsOpts {
7588    /// Maximum number of lines to read
7589    #[builder(setter(into, strip_option), default)]
7590    pub limit_lines: Option<isize>,
7591    /// Start reading after this line
7592    #[builder(setter(into, strip_option), default)]
7593    pub offset_lines: Option<isize>,
7594}
7595#[derive(Builder, Debug, PartialEq)]
7596pub struct FileDigestOpts {
7597    /// If true, exclude metadata from the digest.
7598    #[builder(setter(into, strip_option), default)]
7599    pub exclude_metadata: Option<bool>,
7600}
7601#[derive(Builder, Debug, PartialEq)]
7602pub struct FileExportOpts {
7603    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
7604    #[builder(setter(into, strip_option), default)]
7605    pub allow_parent_dir_path: Option<bool>,
7606}
7607#[derive(Builder, Debug, PartialEq)]
7608pub struct FileSearchOpts<'a> {
7609    /// Allow the . pattern to match newlines in multiline mode.
7610    #[builder(setter(into, strip_option), default)]
7611    pub dotall: Option<bool>,
7612    /// Only return matching files, not lines and content
7613    #[builder(setter(into, strip_option), default)]
7614    pub files_only: Option<bool>,
7615    #[builder(setter(into, strip_option), default)]
7616    pub globs: Option<Vec<&'a str>>,
7617    /// Enable case-insensitive matching.
7618    #[builder(setter(into, strip_option), default)]
7619    pub insensitive: Option<bool>,
7620    /// Limit the number of results to return
7621    #[builder(setter(into, strip_option), default)]
7622    pub limit: Option<isize>,
7623    /// Interpret the pattern as a literal string instead of a regular expression.
7624    #[builder(setter(into, strip_option), default)]
7625    pub literal: Option<bool>,
7626    /// Enable searching across multiple lines.
7627    #[builder(setter(into, strip_option), default)]
7628    pub multiline: Option<bool>,
7629    #[builder(setter(into, strip_option), default)]
7630    pub paths: Option<Vec<&'a str>>,
7631    /// Skip hidden files (files starting with .).
7632    #[builder(setter(into, strip_option), default)]
7633    pub skip_hidden: Option<bool>,
7634    /// Honor .gitignore, .ignore, and .rgignore files.
7635    #[builder(setter(into, strip_option), default)]
7636    pub skip_ignored: Option<bool>,
7637}
7638#[derive(Builder, Debug, PartialEq)]
7639pub struct FileWithReplacedOpts {
7640    /// Replace all occurrences of the pattern.
7641    #[builder(setter(into, strip_option), default)]
7642    pub all: Option<bool>,
7643    /// Replace the first match starting from the specified line.
7644    #[builder(setter(into, strip_option), default)]
7645    pub first_from: Option<isize>,
7646}
7647impl File {
7648    /// Parse as an env file
7649    ///
7650    /// # Arguments
7651    ///
7652    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7653    pub fn as_env_file(&self) -> EnvFile {
7654        let query = self.selection.select("asEnvFile");
7655        EnvFile {
7656            proc: self.proc.clone(),
7657            selection: query,
7658            graphql_client: self.graphql_client.clone(),
7659        }
7660    }
7661    /// Parse as an env file
7662    ///
7663    /// # Arguments
7664    ///
7665    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7666    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
7667        let mut query = self.selection.select("asEnvFile");
7668        if let Some(expand) = opts.expand {
7669            query = query.arg("expand", expand);
7670        }
7671        EnvFile {
7672            proc: self.proc.clone(),
7673            selection: query,
7674            graphql_client: self.graphql_client.clone(),
7675        }
7676    }
7677    /// Change the owner of the file recursively.
7678    ///
7679    /// # Arguments
7680    ///
7681    /// * `owner` - A user:group to set for the file.
7682    ///
7683    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
7684    ///
7685    /// If the group is omitted, it defaults to the same as the user.
7686    pub fn chown(&self, owner: impl Into<String>) -> File {
7687        let mut query = self.selection.select("chown");
7688        query = query.arg("owner", owner.into());
7689        File {
7690            proc: self.proc.clone(),
7691            selection: query,
7692            graphql_client: self.graphql_client.clone(),
7693        }
7694    }
7695    /// Retrieves the contents of the file.
7696    ///
7697    /// # Arguments
7698    ///
7699    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7700    pub async fn contents(&self) -> Result<String, DaggerError> {
7701        let query = self.selection.select("contents");
7702        query.execute(self.graphql_client.clone()).await
7703    }
7704    /// Retrieves the contents of the file.
7705    ///
7706    /// # Arguments
7707    ///
7708    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7709    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
7710        let mut query = self.selection.select("contents");
7711        if let Some(offset_lines) = opts.offset_lines {
7712            query = query.arg("offsetLines", offset_lines);
7713        }
7714        if let Some(limit_lines) = opts.limit_lines {
7715            query = query.arg("limitLines", limit_lines);
7716        }
7717        query.execute(self.graphql_client.clone()).await
7718    }
7719    /// 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.
7720    ///
7721    /// # Arguments
7722    ///
7723    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7724    pub async fn digest(&self) -> Result<String, DaggerError> {
7725        let query = self.selection.select("digest");
7726        query.execute(self.graphql_client.clone()).await
7727    }
7728    /// 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.
7729    ///
7730    /// # Arguments
7731    ///
7732    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7733    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
7734        let mut query = self.selection.select("digest");
7735        if let Some(exclude_metadata) = opts.exclude_metadata {
7736            query = query.arg("excludeMetadata", exclude_metadata);
7737        }
7738        query.execute(self.graphql_client.clone()).await
7739    }
7740    /// Writes the file to a file path on the host.
7741    ///
7742    /// # Arguments
7743    ///
7744    /// * `path` - Location of the written directory (e.g., "output.txt").
7745    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7746    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7747        let mut query = self.selection.select("export");
7748        query = query.arg("path", path.into());
7749        query.execute(self.graphql_client.clone()).await
7750    }
7751    /// Writes the file to a file path on the host.
7752    ///
7753    /// # Arguments
7754    ///
7755    /// * `path` - Location of the written directory (e.g., "output.txt").
7756    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7757    pub async fn export_opts(
7758        &self,
7759        path: impl Into<String>,
7760        opts: FileExportOpts,
7761    ) -> Result<String, DaggerError> {
7762        let mut query = self.selection.select("export");
7763        query = query.arg("path", path.into());
7764        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
7765            query = query.arg("allowParentDirPath", allow_parent_dir_path);
7766        }
7767        query.execute(self.graphql_client.clone()).await
7768    }
7769    /// A unique identifier for this File.
7770    pub async fn id(&self) -> Result<FileId, DaggerError> {
7771        let query = self.selection.select("id");
7772        query.execute(self.graphql_client.clone()).await
7773    }
7774    /// Retrieves the name of the file.
7775    pub async fn name(&self) -> Result<String, DaggerError> {
7776        let query = self.selection.select("name");
7777        query.execute(self.graphql_client.clone()).await
7778    }
7779    /// Searches for content matching the given regular expression or literal string.
7780    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
7781    ///
7782    /// # Arguments
7783    ///
7784    /// * `pattern` - The text to match.
7785    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7786    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
7787        let mut query = self.selection.select("search");
7788        query = query.arg("pattern", pattern.into());
7789        vec![SearchResult {
7790            proc: self.proc.clone(),
7791            selection: query,
7792            graphql_client: self.graphql_client.clone(),
7793        }]
7794    }
7795    /// Searches for content matching the given regular expression or literal string.
7796    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
7797    ///
7798    /// # Arguments
7799    ///
7800    /// * `pattern` - The text to match.
7801    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7802    pub fn search_opts<'a>(
7803        &self,
7804        pattern: impl Into<String>,
7805        opts: FileSearchOpts<'a>,
7806    ) -> Vec<SearchResult> {
7807        let mut query = self.selection.select("search");
7808        query = query.arg("pattern", pattern.into());
7809        if let Some(literal) = opts.literal {
7810            query = query.arg("literal", literal);
7811        }
7812        if let Some(multiline) = opts.multiline {
7813            query = query.arg("multiline", multiline);
7814        }
7815        if let Some(dotall) = opts.dotall {
7816            query = query.arg("dotall", dotall);
7817        }
7818        if let Some(insensitive) = opts.insensitive {
7819            query = query.arg("insensitive", insensitive);
7820        }
7821        if let Some(skip_ignored) = opts.skip_ignored {
7822            query = query.arg("skipIgnored", skip_ignored);
7823        }
7824        if let Some(skip_hidden) = opts.skip_hidden {
7825            query = query.arg("skipHidden", skip_hidden);
7826        }
7827        if let Some(files_only) = opts.files_only {
7828            query = query.arg("filesOnly", files_only);
7829        }
7830        if let Some(limit) = opts.limit {
7831            query = query.arg("limit", limit);
7832        }
7833        if let Some(paths) = opts.paths {
7834            query = query.arg("paths", paths);
7835        }
7836        if let Some(globs) = opts.globs {
7837            query = query.arg("globs", globs);
7838        }
7839        vec![SearchResult {
7840            proc: self.proc.clone(),
7841            selection: query,
7842            graphql_client: self.graphql_client.clone(),
7843        }]
7844    }
7845    /// Retrieves the size of the file, in bytes.
7846    pub async fn size(&self) -> Result<isize, DaggerError> {
7847        let query = self.selection.select("size");
7848        query.execute(self.graphql_client.clone()).await
7849    }
7850    /// Force evaluation in the engine.
7851    pub async fn sync(&self) -> Result<FileId, DaggerError> {
7852        let query = self.selection.select("sync");
7853        query.execute(self.graphql_client.clone()).await
7854    }
7855    /// Retrieves this file with its name set to the given name.
7856    ///
7857    /// # Arguments
7858    ///
7859    /// * `name` - Name to set file to.
7860    pub fn with_name(&self, name: impl Into<String>) -> File {
7861        let mut query = self.selection.select("withName");
7862        query = query.arg("name", name.into());
7863        File {
7864            proc: self.proc.clone(),
7865            selection: query,
7866            graphql_client: self.graphql_client.clone(),
7867        }
7868    }
7869    /// Retrieves the file with content replaced with the given text.
7870    /// If 'all' is true, all occurrences of the pattern will be replaced.
7871    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
7872    /// If neither are specified, and there are multiple matches for the pattern, this will error.
7873    /// If there are no matches for the pattern, this will error.
7874    ///
7875    /// # Arguments
7876    ///
7877    /// * `search` - The text to match.
7878    /// * `replacement` - The text to match.
7879    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7880    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
7881        let mut query = self.selection.select("withReplaced");
7882        query = query.arg("search", search.into());
7883        query = query.arg("replacement", replacement.into());
7884        File {
7885            proc: self.proc.clone(),
7886            selection: query,
7887            graphql_client: self.graphql_client.clone(),
7888        }
7889    }
7890    /// Retrieves the file with content replaced with the given text.
7891    /// If 'all' is true, all occurrences of the pattern will be replaced.
7892    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
7893    /// If neither are specified, and there are multiple matches for the pattern, this will error.
7894    /// If there are no matches for the pattern, this will error.
7895    ///
7896    /// # Arguments
7897    ///
7898    /// * `search` - The text to match.
7899    /// * `replacement` - The text to match.
7900    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7901    pub fn with_replaced_opts(
7902        &self,
7903        search: impl Into<String>,
7904        replacement: impl Into<String>,
7905        opts: FileWithReplacedOpts,
7906    ) -> File {
7907        let mut query = self.selection.select("withReplaced");
7908        query = query.arg("search", search.into());
7909        query = query.arg("replacement", replacement.into());
7910        if let Some(all) = opts.all {
7911            query = query.arg("all", all);
7912        }
7913        if let Some(first_from) = opts.first_from {
7914            query = query.arg("firstFrom", first_from);
7915        }
7916        File {
7917            proc: self.proc.clone(),
7918            selection: query,
7919            graphql_client: self.graphql_client.clone(),
7920        }
7921    }
7922    /// Retrieves this file with its created/modified timestamps set to the given time.
7923    ///
7924    /// # Arguments
7925    ///
7926    /// * `timestamp` - Timestamp to set dir/files in.
7927    ///
7928    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
7929    pub fn with_timestamps(&self, timestamp: isize) -> File {
7930        let mut query = self.selection.select("withTimestamps");
7931        query = query.arg("timestamp", timestamp);
7932        File {
7933            proc: self.proc.clone(),
7934            selection: query,
7935            graphql_client: self.graphql_client.clone(),
7936        }
7937    }
7938}
7939#[derive(Clone)]
7940pub struct Function {
7941    pub proc: Option<Arc<DaggerSessionProc>>,
7942    pub selection: Selection,
7943    pub graphql_client: DynGraphQLClient,
7944}
7945#[derive(Builder, Debug, PartialEq)]
7946pub struct FunctionWithArgOpts<'a> {
7947    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
7948    #[builder(setter(into, strip_option), default)]
7949    pub default_path: Option<&'a str>,
7950    /// A default value to use for this argument if not explicitly set by the caller, if any
7951    #[builder(setter(into, strip_option), default)]
7952    pub default_value: Option<Json>,
7953    /// A doc string for the argument, if any
7954    #[builder(setter(into, strip_option), default)]
7955    pub description: Option<&'a str>,
7956    /// Patterns to ignore when loading the contextual argument value.
7957    #[builder(setter(into, strip_option), default)]
7958    pub ignore: Option<Vec<&'a str>>,
7959    /// The source map for the argument definition.
7960    #[builder(setter(into, strip_option), default)]
7961    pub source_map: Option<SourceMapId>,
7962}
7963impl Function {
7964    /// Arguments accepted by the function, if any.
7965    pub fn args(&self) -> Vec<FunctionArg> {
7966        let query = self.selection.select("args");
7967        vec![FunctionArg {
7968            proc: self.proc.clone(),
7969            selection: query,
7970            graphql_client: self.graphql_client.clone(),
7971        }]
7972    }
7973    /// A doc string for the function, if any.
7974    pub async fn description(&self) -> Result<String, DaggerError> {
7975        let query = self.selection.select("description");
7976        query.execute(self.graphql_client.clone()).await
7977    }
7978    /// A unique identifier for this Function.
7979    pub async fn id(&self) -> Result<FunctionId, DaggerError> {
7980        let query = self.selection.select("id");
7981        query.execute(self.graphql_client.clone()).await
7982    }
7983    /// The name of the function.
7984    pub async fn name(&self) -> Result<String, DaggerError> {
7985        let query = self.selection.select("name");
7986        query.execute(self.graphql_client.clone()).await
7987    }
7988    /// The type returned by the function.
7989    pub fn return_type(&self) -> TypeDef {
7990        let query = self.selection.select("returnType");
7991        TypeDef {
7992            proc: self.proc.clone(),
7993            selection: query,
7994            graphql_client: self.graphql_client.clone(),
7995        }
7996    }
7997    /// The location of this function declaration.
7998    pub fn source_map(&self) -> SourceMap {
7999        let query = self.selection.select("sourceMap");
8000        SourceMap {
8001            proc: self.proc.clone(),
8002            selection: query,
8003            graphql_client: self.graphql_client.clone(),
8004        }
8005    }
8006    /// Returns the function with the provided argument
8007    ///
8008    /// # Arguments
8009    ///
8010    /// * `name` - The name of the argument
8011    /// * `type_def` - The type of the argument
8012    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8013    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
8014        let mut query = self.selection.select("withArg");
8015        query = query.arg("name", name.into());
8016        query = query.arg_lazy(
8017            "typeDef",
8018            Box::new(move || {
8019                let type_def = type_def.clone();
8020                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8021            }),
8022        );
8023        Function {
8024            proc: self.proc.clone(),
8025            selection: query,
8026            graphql_client: self.graphql_client.clone(),
8027        }
8028    }
8029    /// Returns the function with the provided argument
8030    ///
8031    /// # Arguments
8032    ///
8033    /// * `name` - The name of the argument
8034    /// * `type_def` - The type of the argument
8035    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8036    pub fn with_arg_opts<'a>(
8037        &self,
8038        name: impl Into<String>,
8039        type_def: impl IntoID<TypeDefId>,
8040        opts: FunctionWithArgOpts<'a>,
8041    ) -> Function {
8042        let mut query = self.selection.select("withArg");
8043        query = query.arg("name", name.into());
8044        query = query.arg_lazy(
8045            "typeDef",
8046            Box::new(move || {
8047                let type_def = type_def.clone();
8048                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8049            }),
8050        );
8051        if let Some(description) = opts.description {
8052            query = query.arg("description", description);
8053        }
8054        if let Some(default_value) = opts.default_value {
8055            query = query.arg("defaultValue", default_value);
8056        }
8057        if let Some(default_path) = opts.default_path {
8058            query = query.arg("defaultPath", default_path);
8059        }
8060        if let Some(ignore) = opts.ignore {
8061            query = query.arg("ignore", ignore);
8062        }
8063        if let Some(source_map) = opts.source_map {
8064            query = query.arg("sourceMap", source_map);
8065        }
8066        Function {
8067            proc: self.proc.clone(),
8068            selection: query,
8069            graphql_client: self.graphql_client.clone(),
8070        }
8071    }
8072    /// Returns the function with the given doc string.
8073    ///
8074    /// # Arguments
8075    ///
8076    /// * `description` - The doc string to set.
8077    pub fn with_description(&self, description: impl Into<String>) -> Function {
8078        let mut query = self.selection.select("withDescription");
8079        query = query.arg("description", description.into());
8080        Function {
8081            proc: self.proc.clone(),
8082            selection: query,
8083            graphql_client: self.graphql_client.clone(),
8084        }
8085    }
8086    /// Returns the function with the given source map.
8087    ///
8088    /// # Arguments
8089    ///
8090    /// * `source_map` - The source map for the function definition.
8091    pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
8092        let mut query = self.selection.select("withSourceMap");
8093        query = query.arg_lazy(
8094            "sourceMap",
8095            Box::new(move || {
8096                let source_map = source_map.clone();
8097                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
8098            }),
8099        );
8100        Function {
8101            proc: self.proc.clone(),
8102            selection: query,
8103            graphql_client: self.graphql_client.clone(),
8104        }
8105    }
8106}
8107#[derive(Clone)]
8108pub struct FunctionArg {
8109    pub proc: Option<Arc<DaggerSessionProc>>,
8110    pub selection: Selection,
8111    pub graphql_client: DynGraphQLClient,
8112}
8113impl FunctionArg {
8114    /// 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
8115    pub async fn default_path(&self) -> Result<String, DaggerError> {
8116        let query = self.selection.select("defaultPath");
8117        query.execute(self.graphql_client.clone()).await
8118    }
8119    /// A default value to use for this argument when not explicitly set by the caller, if any.
8120    pub async fn default_value(&self) -> Result<Json, DaggerError> {
8121        let query = self.selection.select("defaultValue");
8122        query.execute(self.graphql_client.clone()).await
8123    }
8124    /// A doc string for the argument, if any.
8125    pub async fn description(&self) -> Result<String, DaggerError> {
8126        let query = self.selection.select("description");
8127        query.execute(self.graphql_client.clone()).await
8128    }
8129    /// A unique identifier for this FunctionArg.
8130    pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
8131        let query = self.selection.select("id");
8132        query.execute(self.graphql_client.clone()).await
8133    }
8134    /// 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.
8135    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
8136        let query = self.selection.select("ignore");
8137        query.execute(self.graphql_client.clone()).await
8138    }
8139    /// The name of the argument in lowerCamelCase format.
8140    pub async fn name(&self) -> Result<String, DaggerError> {
8141        let query = self.selection.select("name");
8142        query.execute(self.graphql_client.clone()).await
8143    }
8144    /// The location of this arg declaration.
8145    pub fn source_map(&self) -> SourceMap {
8146        let query = self.selection.select("sourceMap");
8147        SourceMap {
8148            proc: self.proc.clone(),
8149            selection: query,
8150            graphql_client: self.graphql_client.clone(),
8151        }
8152    }
8153    /// The type of the argument.
8154    pub fn type_def(&self) -> TypeDef {
8155        let query = self.selection.select("typeDef");
8156        TypeDef {
8157            proc: self.proc.clone(),
8158            selection: query,
8159            graphql_client: self.graphql_client.clone(),
8160        }
8161    }
8162}
8163#[derive(Clone)]
8164pub struct FunctionCall {
8165    pub proc: Option<Arc<DaggerSessionProc>>,
8166    pub selection: Selection,
8167    pub graphql_client: DynGraphQLClient,
8168}
8169impl FunctionCall {
8170    /// A unique identifier for this FunctionCall.
8171    pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
8172        let query = self.selection.select("id");
8173        query.execute(self.graphql_client.clone()).await
8174    }
8175    /// The argument values the function is being invoked with.
8176    pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
8177        let query = self.selection.select("inputArgs");
8178        vec![FunctionCallArgValue {
8179            proc: self.proc.clone(),
8180            selection: query,
8181            graphql_client: self.graphql_client.clone(),
8182        }]
8183    }
8184    /// The name of the function being called.
8185    pub async fn name(&self) -> Result<String, DaggerError> {
8186        let query = self.selection.select("name");
8187        query.execute(self.graphql_client.clone()).await
8188    }
8189    /// 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.
8190    pub async fn parent(&self) -> Result<Json, DaggerError> {
8191        let query = self.selection.select("parent");
8192        query.execute(self.graphql_client.clone()).await
8193    }
8194    /// 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.
8195    pub async fn parent_name(&self) -> Result<String, DaggerError> {
8196        let query = self.selection.select("parentName");
8197        query.execute(self.graphql_client.clone()).await
8198    }
8199    /// Return an error from the function.
8200    ///
8201    /// # Arguments
8202    ///
8203    /// * `error` - The error to return.
8204    pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
8205        let mut query = self.selection.select("returnError");
8206        query = query.arg_lazy(
8207            "error",
8208            Box::new(move || {
8209                let error = error.clone();
8210                Box::pin(async move { error.into_id().await.unwrap().quote() })
8211            }),
8212        );
8213        query.execute(self.graphql_client.clone()).await
8214    }
8215    /// Set the return value of the function call to the provided value.
8216    ///
8217    /// # Arguments
8218    ///
8219    /// * `value` - JSON serialization of the return value.
8220    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
8221        let mut query = self.selection.select("returnValue");
8222        query = query.arg("value", value);
8223        query.execute(self.graphql_client.clone()).await
8224    }
8225}
8226#[derive(Clone)]
8227pub struct FunctionCallArgValue {
8228    pub proc: Option<Arc<DaggerSessionProc>>,
8229    pub selection: Selection,
8230    pub graphql_client: DynGraphQLClient,
8231}
8232impl FunctionCallArgValue {
8233    /// A unique identifier for this FunctionCallArgValue.
8234    pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
8235        let query = self.selection.select("id");
8236        query.execute(self.graphql_client.clone()).await
8237    }
8238    /// The name of the argument.
8239    pub async fn name(&self) -> Result<String, DaggerError> {
8240        let query = self.selection.select("name");
8241        query.execute(self.graphql_client.clone()).await
8242    }
8243    /// The value of the argument represented as a JSON serialized string.
8244    pub async fn value(&self) -> Result<Json, DaggerError> {
8245        let query = self.selection.select("value");
8246        query.execute(self.graphql_client.clone()).await
8247    }
8248}
8249#[derive(Clone)]
8250pub struct GeneratedCode {
8251    pub proc: Option<Arc<DaggerSessionProc>>,
8252    pub selection: Selection,
8253    pub graphql_client: DynGraphQLClient,
8254}
8255impl GeneratedCode {
8256    /// The directory containing the generated code.
8257    pub fn code(&self) -> Directory {
8258        let query = self.selection.select("code");
8259        Directory {
8260            proc: self.proc.clone(),
8261            selection: query,
8262            graphql_client: self.graphql_client.clone(),
8263        }
8264    }
8265    /// A unique identifier for this GeneratedCode.
8266    pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
8267        let query = self.selection.select("id");
8268        query.execute(self.graphql_client.clone()).await
8269    }
8270    /// List of paths to mark generated in version control (i.e. .gitattributes).
8271    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
8272        let query = self.selection.select("vcsGeneratedPaths");
8273        query.execute(self.graphql_client.clone()).await
8274    }
8275    /// List of paths to ignore in version control (i.e. .gitignore).
8276    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
8277        let query = self.selection.select("vcsIgnoredPaths");
8278        query.execute(self.graphql_client.clone()).await
8279    }
8280    /// Set the list of paths to mark generated in version control.
8281    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8282        let mut query = self.selection.select("withVCSGeneratedPaths");
8283        query = query.arg(
8284            "paths",
8285            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8286        );
8287        GeneratedCode {
8288            proc: self.proc.clone(),
8289            selection: query,
8290            graphql_client: self.graphql_client.clone(),
8291        }
8292    }
8293    /// Set the list of paths to ignore in version control.
8294    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8295        let mut query = self.selection.select("withVCSIgnoredPaths");
8296        query = query.arg(
8297            "paths",
8298            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8299        );
8300        GeneratedCode {
8301            proc: self.proc.clone(),
8302            selection: query,
8303            graphql_client: self.graphql_client.clone(),
8304        }
8305    }
8306}
8307#[derive(Clone)]
8308pub struct GitRef {
8309    pub proc: Option<Arc<DaggerSessionProc>>,
8310    pub selection: Selection,
8311    pub graphql_client: DynGraphQLClient,
8312}
8313#[derive(Builder, Debug, PartialEq)]
8314pub struct GitRefTreeOpts {
8315    /// The depth of the tree to fetch.
8316    #[builder(setter(into, strip_option), default)]
8317    pub depth: Option<isize>,
8318    /// Set to true to discard .git directory.
8319    #[builder(setter(into, strip_option), default)]
8320    pub discard_git_dir: Option<bool>,
8321}
8322impl GitRef {
8323    /// The resolved commit id at this ref.
8324    pub async fn commit(&self) -> Result<String, DaggerError> {
8325        let query = self.selection.select("commit");
8326        query.execute(self.graphql_client.clone()).await
8327    }
8328    /// Find the best common ancestor between this ref and another ref.
8329    ///
8330    /// # Arguments
8331    ///
8332    /// * `other` - The other ref to compare against.
8333    pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
8334        let mut query = self.selection.select("commonAncestor");
8335        query = query.arg_lazy(
8336            "other",
8337            Box::new(move || {
8338                let other = other.clone();
8339                Box::pin(async move { other.into_id().await.unwrap().quote() })
8340            }),
8341        );
8342        GitRef {
8343            proc: self.proc.clone(),
8344            selection: query,
8345            graphql_client: self.graphql_client.clone(),
8346        }
8347    }
8348    /// A unique identifier for this GitRef.
8349    pub async fn id(&self) -> Result<GitRefId, DaggerError> {
8350        let query = self.selection.select("id");
8351        query.execute(self.graphql_client.clone()).await
8352    }
8353    /// The resolved ref name at this ref.
8354    pub async fn r#ref(&self) -> Result<String, DaggerError> {
8355        let query = self.selection.select("ref");
8356        query.execute(self.graphql_client.clone()).await
8357    }
8358    /// The filesystem tree at this ref.
8359    ///
8360    /// # Arguments
8361    ///
8362    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8363    pub fn tree(&self) -> Directory {
8364        let query = self.selection.select("tree");
8365        Directory {
8366            proc: self.proc.clone(),
8367            selection: query,
8368            graphql_client: self.graphql_client.clone(),
8369        }
8370    }
8371    /// The filesystem tree at this ref.
8372    ///
8373    /// # Arguments
8374    ///
8375    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8376    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
8377        let mut query = self.selection.select("tree");
8378        if let Some(discard_git_dir) = opts.discard_git_dir {
8379            query = query.arg("discardGitDir", discard_git_dir);
8380        }
8381        if let Some(depth) = opts.depth {
8382            query = query.arg("depth", depth);
8383        }
8384        Directory {
8385            proc: self.proc.clone(),
8386            selection: query,
8387            graphql_client: self.graphql_client.clone(),
8388        }
8389    }
8390}
8391#[derive(Clone)]
8392pub struct GitRepository {
8393    pub proc: Option<Arc<DaggerSessionProc>>,
8394    pub selection: Selection,
8395    pub graphql_client: DynGraphQLClient,
8396}
8397#[derive(Builder, Debug, PartialEq)]
8398pub struct GitRepositoryBranchesOpts<'a> {
8399    /// Glob patterns (e.g., "refs/tags/v*").
8400    #[builder(setter(into, strip_option), default)]
8401    pub patterns: Option<Vec<&'a str>>,
8402}
8403#[derive(Builder, Debug, PartialEq)]
8404pub struct GitRepositoryTagsOpts<'a> {
8405    /// Glob patterns (e.g., "refs/tags/v*").
8406    #[builder(setter(into, strip_option), default)]
8407    pub patterns: Option<Vec<&'a str>>,
8408}
8409impl GitRepository {
8410    /// Returns details of a branch.
8411    ///
8412    /// # Arguments
8413    ///
8414    /// * `name` - Branch's name (e.g., "main").
8415    pub fn branch(&self, name: impl Into<String>) -> GitRef {
8416        let mut query = self.selection.select("branch");
8417        query = query.arg("name", name.into());
8418        GitRef {
8419            proc: self.proc.clone(),
8420            selection: query,
8421            graphql_client: self.graphql_client.clone(),
8422        }
8423    }
8424    /// branches that match any of the given glob patterns.
8425    ///
8426    /// # Arguments
8427    ///
8428    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8429    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
8430        let query = self.selection.select("branches");
8431        query.execute(self.graphql_client.clone()).await
8432    }
8433    /// branches that match any of the given glob patterns.
8434    ///
8435    /// # Arguments
8436    ///
8437    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8438    pub async fn branches_opts<'a>(
8439        &self,
8440        opts: GitRepositoryBranchesOpts<'a>,
8441    ) -> Result<Vec<String>, DaggerError> {
8442        let mut query = self.selection.select("branches");
8443        if let Some(patterns) = opts.patterns {
8444            query = query.arg("patterns", patterns);
8445        }
8446        query.execute(self.graphql_client.clone()).await
8447    }
8448    /// Returns details of a commit.
8449    ///
8450    /// # Arguments
8451    ///
8452    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
8453    pub fn commit(&self, id: impl Into<String>) -> GitRef {
8454        let mut query = self.selection.select("commit");
8455        query = query.arg("id", id.into());
8456        GitRef {
8457            proc: self.proc.clone(),
8458            selection: query,
8459            graphql_client: self.graphql_client.clone(),
8460        }
8461    }
8462    /// Returns details for HEAD.
8463    pub fn head(&self) -> GitRef {
8464        let query = self.selection.select("head");
8465        GitRef {
8466            proc: self.proc.clone(),
8467            selection: query,
8468            graphql_client: self.graphql_client.clone(),
8469        }
8470    }
8471    /// A unique identifier for this GitRepository.
8472    pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
8473        let query = self.selection.select("id");
8474        query.execute(self.graphql_client.clone()).await
8475    }
8476    /// Returns details for the latest semver tag.
8477    pub fn latest_version(&self) -> GitRef {
8478        let query = self.selection.select("latestVersion");
8479        GitRef {
8480            proc: self.proc.clone(),
8481            selection: query,
8482            graphql_client: self.graphql_client.clone(),
8483        }
8484    }
8485    /// Returns details of a ref.
8486    ///
8487    /// # Arguments
8488    ///
8489    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
8490    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
8491        let mut query = self.selection.select("ref");
8492        query = query.arg("name", name.into());
8493        GitRef {
8494            proc: self.proc.clone(),
8495            selection: query,
8496            graphql_client: self.graphql_client.clone(),
8497        }
8498    }
8499    /// Returns details of a tag.
8500    ///
8501    /// # Arguments
8502    ///
8503    /// * `name` - Tag's name (e.g., "v0.3.9").
8504    pub fn tag(&self, name: impl Into<String>) -> GitRef {
8505        let mut query = self.selection.select("tag");
8506        query = query.arg("name", name.into());
8507        GitRef {
8508            proc: self.proc.clone(),
8509            selection: query,
8510            graphql_client: self.graphql_client.clone(),
8511        }
8512    }
8513    /// tags that match any of the given glob patterns.
8514    ///
8515    /// # Arguments
8516    ///
8517    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8518    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
8519        let query = self.selection.select("tags");
8520        query.execute(self.graphql_client.clone()).await
8521    }
8522    /// tags that match any of the given glob patterns.
8523    ///
8524    /// # Arguments
8525    ///
8526    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8527    pub async fn tags_opts<'a>(
8528        &self,
8529        opts: GitRepositoryTagsOpts<'a>,
8530    ) -> Result<Vec<String>, DaggerError> {
8531        let mut query = self.selection.select("tags");
8532        if let Some(patterns) = opts.patterns {
8533            query = query.arg("patterns", patterns);
8534        }
8535        query.execute(self.graphql_client.clone()).await
8536    }
8537    /// The URL of the git repository.
8538    pub async fn url(&self) -> Result<String, DaggerError> {
8539        let query = self.selection.select("url");
8540        query.execute(self.graphql_client.clone()).await
8541    }
8542}
8543#[derive(Clone)]
8544pub struct Host {
8545    pub proc: Option<Arc<DaggerSessionProc>>,
8546    pub selection: Selection,
8547    pub graphql_client: DynGraphQLClient,
8548}
8549#[derive(Builder, Debug, PartialEq)]
8550pub struct HostDirectoryOpts<'a> {
8551    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
8552    #[builder(setter(into, strip_option), default)]
8553    pub exclude: Option<Vec<&'a str>>,
8554    /// Apply .gitignore filter rules inside the directory
8555    #[builder(setter(into, strip_option), default)]
8556    pub gitignore: Option<bool>,
8557    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
8558    #[builder(setter(into, strip_option), default)]
8559    pub include: Option<Vec<&'a str>>,
8560    /// If true, the directory will always be reloaded from the host.
8561    #[builder(setter(into, strip_option), default)]
8562    pub no_cache: Option<bool>,
8563}
8564#[derive(Builder, Debug, PartialEq)]
8565pub struct HostFileOpts {
8566    /// If true, the file will always be reloaded from the host.
8567    #[builder(setter(into, strip_option), default)]
8568    pub no_cache: Option<bool>,
8569}
8570#[derive(Builder, Debug, PartialEq)]
8571pub struct HostFindUpOpts {
8572    #[builder(setter(into, strip_option), default)]
8573    pub no_cache: Option<bool>,
8574}
8575#[derive(Builder, Debug, PartialEq)]
8576pub struct HostServiceOpts<'a> {
8577    /// Upstream host to forward traffic to.
8578    #[builder(setter(into, strip_option), default)]
8579    pub host: Option<&'a str>,
8580}
8581#[derive(Builder, Debug, PartialEq)]
8582pub struct HostTunnelOpts {
8583    /// Map each service port to the same port on the host, as if the service were running natively.
8584    /// Note: enabling may result in port conflicts.
8585    #[builder(setter(into, strip_option), default)]
8586    pub native: Option<bool>,
8587    /// Configure explicit port forwarding rules for the tunnel.
8588    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
8589    /// 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.
8590    /// If ports are given and native is true, the ports are additive.
8591    #[builder(setter(into, strip_option), default)]
8592    pub ports: Option<Vec<PortForward>>,
8593}
8594impl Host {
8595    /// Accesses a container image on the host.
8596    ///
8597    /// # Arguments
8598    ///
8599    /// * `name` - Name of the image to access.
8600    pub fn container_image(&self, name: impl Into<String>) -> Container {
8601        let mut query = self.selection.select("containerImage");
8602        query = query.arg("name", name.into());
8603        Container {
8604            proc: self.proc.clone(),
8605            selection: query,
8606            graphql_client: self.graphql_client.clone(),
8607        }
8608    }
8609    /// Accesses a directory on the host.
8610    ///
8611    /// # Arguments
8612    ///
8613    /// * `path` - Location of the directory to access (e.g., ".").
8614    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8615    pub fn directory(&self, path: impl Into<String>) -> Directory {
8616        let mut query = self.selection.select("directory");
8617        query = query.arg("path", path.into());
8618        Directory {
8619            proc: self.proc.clone(),
8620            selection: query,
8621            graphql_client: self.graphql_client.clone(),
8622        }
8623    }
8624    /// Accesses a directory on the host.
8625    ///
8626    /// # Arguments
8627    ///
8628    /// * `path` - Location of the directory to access (e.g., ".").
8629    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8630    pub fn directory_opts<'a>(
8631        &self,
8632        path: impl Into<String>,
8633        opts: HostDirectoryOpts<'a>,
8634    ) -> Directory {
8635        let mut query = self.selection.select("directory");
8636        query = query.arg("path", path.into());
8637        if let Some(exclude) = opts.exclude {
8638            query = query.arg("exclude", exclude);
8639        }
8640        if let Some(include) = opts.include {
8641            query = query.arg("include", include);
8642        }
8643        if let Some(no_cache) = opts.no_cache {
8644            query = query.arg("noCache", no_cache);
8645        }
8646        if let Some(gitignore) = opts.gitignore {
8647            query = query.arg("gitignore", gitignore);
8648        }
8649        Directory {
8650            proc: self.proc.clone(),
8651            selection: query,
8652            graphql_client: self.graphql_client.clone(),
8653        }
8654    }
8655    /// Accesses a file on the host.
8656    ///
8657    /// # Arguments
8658    ///
8659    /// * `path` - Location of the file to retrieve (e.g., "README.md").
8660    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8661    pub fn file(&self, path: impl Into<String>) -> File {
8662        let mut query = self.selection.select("file");
8663        query = query.arg("path", path.into());
8664        File {
8665            proc: self.proc.clone(),
8666            selection: query,
8667            graphql_client: self.graphql_client.clone(),
8668        }
8669    }
8670    /// Accesses a file on the host.
8671    ///
8672    /// # Arguments
8673    ///
8674    /// * `path` - Location of the file to retrieve (e.g., "README.md").
8675    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8676    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
8677        let mut query = self.selection.select("file");
8678        query = query.arg("path", path.into());
8679        if let Some(no_cache) = opts.no_cache {
8680            query = query.arg("noCache", no_cache);
8681        }
8682        File {
8683            proc: self.proc.clone(),
8684            selection: query,
8685            graphql_client: self.graphql_client.clone(),
8686        }
8687    }
8688    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
8689    ///
8690    /// # Arguments
8691    ///
8692    /// * `name` - name of the file or directory to search for
8693    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8694    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8695        let mut query = self.selection.select("findUp");
8696        query = query.arg("name", name.into());
8697        query.execute(self.graphql_client.clone()).await
8698    }
8699    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
8700    ///
8701    /// # Arguments
8702    ///
8703    /// * `name` - name of the file or directory to search for
8704    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8705    pub async fn find_up_opts(
8706        &self,
8707        name: impl Into<String>,
8708        opts: HostFindUpOpts,
8709    ) -> Result<String, DaggerError> {
8710        let mut query = self.selection.select("findUp");
8711        query = query.arg("name", name.into());
8712        if let Some(no_cache) = opts.no_cache {
8713            query = query.arg("noCache", no_cache);
8714        }
8715        query.execute(self.graphql_client.clone()).await
8716    }
8717    /// A unique identifier for this Host.
8718    pub async fn id(&self) -> Result<HostId, DaggerError> {
8719        let query = self.selection.select("id");
8720        query.execute(self.graphql_client.clone()).await
8721    }
8722    /// Creates a service that forwards traffic to a specified address via the host.
8723    ///
8724    /// # Arguments
8725    ///
8726    /// * `ports` - Ports to expose via the service, forwarding through the host network.
8727    ///
8728    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
8729    ///
8730    /// An empty set of ports is not valid; an error will be returned.
8731    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8732    pub fn service(&self, ports: Vec<PortForward>) -> Service {
8733        let mut query = self.selection.select("service");
8734        query = query.arg("ports", ports);
8735        Service {
8736            proc: self.proc.clone(),
8737            selection: query,
8738            graphql_client: self.graphql_client.clone(),
8739        }
8740    }
8741    /// Creates a service that forwards traffic to a specified address via the host.
8742    ///
8743    /// # Arguments
8744    ///
8745    /// * `ports` - Ports to expose via the service, forwarding through the host network.
8746    ///
8747    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
8748    ///
8749    /// An empty set of ports is not valid; an error will be returned.
8750    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8751    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
8752        let mut query = self.selection.select("service");
8753        query = query.arg("ports", ports);
8754        if let Some(host) = opts.host {
8755            query = query.arg("host", host);
8756        }
8757        Service {
8758            proc: self.proc.clone(),
8759            selection: query,
8760            graphql_client: self.graphql_client.clone(),
8761        }
8762    }
8763    /// Creates a tunnel that forwards traffic from the host to a service.
8764    ///
8765    /// # Arguments
8766    ///
8767    /// * `service` - Service to send traffic from the tunnel.
8768    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8769    pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
8770        let mut query = self.selection.select("tunnel");
8771        query = query.arg_lazy(
8772            "service",
8773            Box::new(move || {
8774                let service = service.clone();
8775                Box::pin(async move { service.into_id().await.unwrap().quote() })
8776            }),
8777        );
8778        Service {
8779            proc: self.proc.clone(),
8780            selection: query,
8781            graphql_client: self.graphql_client.clone(),
8782        }
8783    }
8784    /// Creates a tunnel that forwards traffic from the host to a service.
8785    ///
8786    /// # Arguments
8787    ///
8788    /// * `service` - Service to send traffic from the tunnel.
8789    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8790    pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
8791        let mut query = self.selection.select("tunnel");
8792        query = query.arg_lazy(
8793            "service",
8794            Box::new(move || {
8795                let service = service.clone();
8796                Box::pin(async move { service.into_id().await.unwrap().quote() })
8797            }),
8798        );
8799        if let Some(native) = opts.native {
8800            query = query.arg("native", native);
8801        }
8802        if let Some(ports) = opts.ports {
8803            query = query.arg("ports", ports);
8804        }
8805        Service {
8806            proc: self.proc.clone(),
8807            selection: query,
8808            graphql_client: self.graphql_client.clone(),
8809        }
8810    }
8811    /// Accesses a Unix socket on the host.
8812    ///
8813    /// # Arguments
8814    ///
8815    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
8816    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
8817        let mut query = self.selection.select("unixSocket");
8818        query = query.arg("path", path.into());
8819        Socket {
8820            proc: self.proc.clone(),
8821            selection: query,
8822            graphql_client: self.graphql_client.clone(),
8823        }
8824    }
8825}
8826#[derive(Clone)]
8827pub struct InputTypeDef {
8828    pub proc: Option<Arc<DaggerSessionProc>>,
8829    pub selection: Selection,
8830    pub graphql_client: DynGraphQLClient,
8831}
8832impl InputTypeDef {
8833    /// Static fields defined on this input object, if any.
8834    pub fn fields(&self) -> Vec<FieldTypeDef> {
8835        let query = self.selection.select("fields");
8836        vec![FieldTypeDef {
8837            proc: self.proc.clone(),
8838            selection: query,
8839            graphql_client: self.graphql_client.clone(),
8840        }]
8841    }
8842    /// A unique identifier for this InputTypeDef.
8843    pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
8844        let query = self.selection.select("id");
8845        query.execute(self.graphql_client.clone()).await
8846    }
8847    /// The name of the input object.
8848    pub async fn name(&self) -> Result<String, DaggerError> {
8849        let query = self.selection.select("name");
8850        query.execute(self.graphql_client.clone()).await
8851    }
8852}
8853#[derive(Clone)]
8854pub struct InterfaceTypeDef {
8855    pub proc: Option<Arc<DaggerSessionProc>>,
8856    pub selection: Selection,
8857    pub graphql_client: DynGraphQLClient,
8858}
8859impl InterfaceTypeDef {
8860    /// The doc string for the interface, if any.
8861    pub async fn description(&self) -> Result<String, DaggerError> {
8862        let query = self.selection.select("description");
8863        query.execute(self.graphql_client.clone()).await
8864    }
8865    /// Functions defined on this interface, if any.
8866    pub fn functions(&self) -> Vec<Function> {
8867        let query = self.selection.select("functions");
8868        vec![Function {
8869            proc: self.proc.clone(),
8870            selection: query,
8871            graphql_client: self.graphql_client.clone(),
8872        }]
8873    }
8874    /// A unique identifier for this InterfaceTypeDef.
8875    pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
8876        let query = self.selection.select("id");
8877        query.execute(self.graphql_client.clone()).await
8878    }
8879    /// The name of the interface.
8880    pub async fn name(&self) -> Result<String, DaggerError> {
8881        let query = self.selection.select("name");
8882        query.execute(self.graphql_client.clone()).await
8883    }
8884    /// The location of this interface declaration.
8885    pub fn source_map(&self) -> SourceMap {
8886        let query = self.selection.select("sourceMap");
8887        SourceMap {
8888            proc: self.proc.clone(),
8889            selection: query,
8890            graphql_client: self.graphql_client.clone(),
8891        }
8892    }
8893    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
8894    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
8895        let query = self.selection.select("sourceModuleName");
8896        query.execute(self.graphql_client.clone()).await
8897    }
8898}
8899#[derive(Clone)]
8900pub struct JsonValue {
8901    pub proc: Option<Arc<DaggerSessionProc>>,
8902    pub selection: Selection,
8903    pub graphql_client: DynGraphQLClient,
8904}
8905#[derive(Builder, Debug, PartialEq)]
8906pub struct JsonValueContentsOpts<'a> {
8907    /// Optional line prefix
8908    #[builder(setter(into, strip_option), default)]
8909    pub indent: Option<&'a str>,
8910    /// Pretty-print
8911    #[builder(setter(into, strip_option), default)]
8912    pub pretty: Option<bool>,
8913}
8914impl JsonValue {
8915    /// Decode an array from json
8916    pub fn as_array(&self) -> Vec<JsonValue> {
8917        let query = self.selection.select("asArray");
8918        vec![JsonValue {
8919            proc: self.proc.clone(),
8920            selection: query,
8921            graphql_client: self.graphql_client.clone(),
8922        }]
8923    }
8924    /// Decode a boolean from json
8925    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
8926        let query = self.selection.select("asBoolean");
8927        query.execute(self.graphql_client.clone()).await
8928    }
8929    /// Decode an integer from json
8930    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
8931        let query = self.selection.select("asInteger");
8932        query.execute(self.graphql_client.clone()).await
8933    }
8934    /// Decode a string from json
8935    pub async fn as_string(&self) -> Result<String, DaggerError> {
8936        let query = self.selection.select("asString");
8937        query.execute(self.graphql_client.clone()).await
8938    }
8939    /// Return the value encoded as json
8940    ///
8941    /// # Arguments
8942    ///
8943    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8944    pub async fn contents(&self) -> Result<Json, DaggerError> {
8945        let query = self.selection.select("contents");
8946        query.execute(self.graphql_client.clone()).await
8947    }
8948    /// Return the value encoded as json
8949    ///
8950    /// # Arguments
8951    ///
8952    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8953    pub async fn contents_opts<'a>(
8954        &self,
8955        opts: JsonValueContentsOpts<'a>,
8956    ) -> Result<Json, DaggerError> {
8957        let mut query = self.selection.select("contents");
8958        if let Some(pretty) = opts.pretty {
8959            query = query.arg("pretty", pretty);
8960        }
8961        if let Some(indent) = opts.indent {
8962            query = query.arg("indent", indent);
8963        }
8964        query.execute(self.graphql_client.clone()).await
8965    }
8966    /// Lookup the field at the given path, and return its value.
8967    ///
8968    /// # Arguments
8969    ///
8970    /// * `path` - Path of the field to lookup, encoded as an array of field names
8971    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
8972        let mut query = self.selection.select("field");
8973        query = query.arg(
8974            "path",
8975            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8976        );
8977        JsonValue {
8978            proc: self.proc.clone(),
8979            selection: query,
8980            graphql_client: self.graphql_client.clone(),
8981        }
8982    }
8983    /// List fields of the encoded object
8984    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
8985        let query = self.selection.select("fields");
8986        query.execute(self.graphql_client.clone()).await
8987    }
8988    /// A unique identifier for this JSONValue.
8989    pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
8990        let query = self.selection.select("id");
8991        query.execute(self.graphql_client.clone()).await
8992    }
8993    /// Encode a boolean to json
8994    ///
8995    /// # Arguments
8996    ///
8997    /// * `value` - New boolean value
8998    pub fn new_boolean(&self, value: bool) -> JsonValue {
8999        let mut query = self.selection.select("newBoolean");
9000        query = query.arg("value", value);
9001        JsonValue {
9002            proc: self.proc.clone(),
9003            selection: query,
9004            graphql_client: self.graphql_client.clone(),
9005        }
9006    }
9007    /// Encode an integer to json
9008    ///
9009    /// # Arguments
9010    ///
9011    /// * `value` - New integer value
9012    pub fn new_integer(&self, value: isize) -> JsonValue {
9013        let mut query = self.selection.select("newInteger");
9014        query = query.arg("value", value);
9015        JsonValue {
9016            proc: self.proc.clone(),
9017            selection: query,
9018            graphql_client: self.graphql_client.clone(),
9019        }
9020    }
9021    /// Encode a string to json
9022    ///
9023    /// # Arguments
9024    ///
9025    /// * `value` - New string value
9026    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
9027        let mut query = self.selection.select("newString");
9028        query = query.arg("value", value.into());
9029        JsonValue {
9030            proc: self.proc.clone(),
9031            selection: query,
9032            graphql_client: self.graphql_client.clone(),
9033        }
9034    }
9035    /// Return a new json value, decoded from the given content
9036    ///
9037    /// # Arguments
9038    ///
9039    /// * `contents` - New JSON-encoded contents
9040    pub fn with_contents(&self, contents: Json) -> JsonValue {
9041        let mut query = self.selection.select("withContents");
9042        query = query.arg("contents", contents);
9043        JsonValue {
9044            proc: self.proc.clone(),
9045            selection: query,
9046            graphql_client: self.graphql_client.clone(),
9047        }
9048    }
9049    /// Set a new field at the given path
9050    ///
9051    /// # Arguments
9052    ///
9053    /// * `path` - Path of the field to set, encoded as an array of field names
9054    /// * `value` - The new value of the field
9055    pub fn with_field(
9056        &self,
9057        path: Vec<impl Into<String>>,
9058        value: impl IntoID<JsonValueId>,
9059    ) -> JsonValue {
9060        let mut query = self.selection.select("withField");
9061        query = query.arg(
9062            "path",
9063            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9064        );
9065        query = query.arg_lazy(
9066            "value",
9067            Box::new(move || {
9068                let value = value.clone();
9069                Box::pin(async move { value.into_id().await.unwrap().quote() })
9070            }),
9071        );
9072        JsonValue {
9073            proc: self.proc.clone(),
9074            selection: query,
9075            graphql_client: self.graphql_client.clone(),
9076        }
9077    }
9078}
9079#[derive(Clone)]
9080pub struct Llm {
9081    pub proc: Option<Arc<DaggerSessionProc>>,
9082    pub selection: Selection,
9083    pub graphql_client: DynGraphQLClient,
9084}
9085impl Llm {
9086    /// create a branch in the LLM's history
9087    pub fn attempt(&self, number: isize) -> Llm {
9088        let mut query = self.selection.select("attempt");
9089        query = query.arg("number", number);
9090        Llm {
9091            proc: self.proc.clone(),
9092            selection: query,
9093            graphql_client: self.graphql_client.clone(),
9094        }
9095    }
9096    /// returns the type of the current state
9097    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
9098        let mut query = self.selection.select("bindResult");
9099        query = query.arg("name", name.into());
9100        Binding {
9101            proc: self.proc.clone(),
9102            selection: query,
9103            graphql_client: self.graphql_client.clone(),
9104        }
9105    }
9106    /// return the LLM's current environment
9107    pub fn env(&self) -> Env {
9108        let query = self.selection.select("env");
9109        Env {
9110            proc: self.proc.clone(),
9111            selection: query,
9112            graphql_client: self.graphql_client.clone(),
9113        }
9114    }
9115    /// Indicates whether there are any queued prompts or tool results to send to the model
9116    pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
9117        let query = self.selection.select("hasPrompt");
9118        query.execute(self.graphql_client.clone()).await
9119    }
9120    /// return the llm message history
9121    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
9122        let query = self.selection.select("history");
9123        query.execute(self.graphql_client.clone()).await
9124    }
9125    /// return the raw llm message history as json
9126    pub async fn history_json(&self) -> Result<Json, DaggerError> {
9127        let query = self.selection.select("historyJSON");
9128        query.execute(self.graphql_client.clone()).await
9129    }
9130    /// A unique identifier for this LLM.
9131    pub async fn id(&self) -> Result<Llmid, DaggerError> {
9132        let query = self.selection.select("id");
9133        query.execute(self.graphql_client.clone()).await
9134    }
9135    /// return the last llm reply from the history
9136    pub async fn last_reply(&self) -> Result<String, DaggerError> {
9137        let query = self.selection.select("lastReply");
9138        query.execute(self.graphql_client.clone()).await
9139    }
9140    /// Submit the queued prompt, evaluate any tool calls, queue their results, and keep going until the model ends its turn
9141    pub fn r#loop(&self) -> Llm {
9142        let query = self.selection.select("loop");
9143        Llm {
9144            proc: self.proc.clone(),
9145            selection: query,
9146            graphql_client: self.graphql_client.clone(),
9147        }
9148    }
9149    /// return the model used by the llm
9150    pub async fn model(&self) -> Result<String, DaggerError> {
9151        let query = self.selection.select("model");
9152        query.execute(self.graphql_client.clone()).await
9153    }
9154    /// return the provider used by the llm
9155    pub async fn provider(&self) -> Result<String, DaggerError> {
9156        let query = self.selection.select("provider");
9157        query.execute(self.graphql_client.clone()).await
9158    }
9159    /// Submit the queued prompt or tool call results, evaluate any tool calls, and queue their results
9160    pub async fn step(&self) -> Result<Llmid, DaggerError> {
9161        let query = self.selection.select("step");
9162        query.execute(self.graphql_client.clone()).await
9163    }
9164    /// synchronize LLM state
9165    pub async fn sync(&self) -> Result<Llmid, DaggerError> {
9166        let query = self.selection.select("sync");
9167        query.execute(self.graphql_client.clone()).await
9168    }
9169    /// returns the token usage of the current state
9170    pub fn token_usage(&self) -> LlmTokenUsage {
9171        let query = self.selection.select("tokenUsage");
9172        LlmTokenUsage {
9173            proc: self.proc.clone(),
9174            selection: query,
9175            graphql_client: self.graphql_client.clone(),
9176        }
9177    }
9178    /// print documentation for available tools
9179    pub async fn tools(&self) -> Result<String, DaggerError> {
9180        let query = self.selection.select("tools");
9181        query.execute(self.graphql_client.clone()).await
9182    }
9183    /// Return a new LLM with the specified function no longer exposed as a tool
9184    ///
9185    /// # Arguments
9186    ///
9187    /// * `type_name` - The type name whose function will be blocked
9188    /// * `function` - The function to block
9189    ///
9190    /// Will be converted to lowerCamelCase if necessary.
9191    pub fn with_blocked_function(
9192        &self,
9193        type_name: impl Into<String>,
9194        function: impl Into<String>,
9195    ) -> Llm {
9196        let mut query = self.selection.select("withBlockedFunction");
9197        query = query.arg("typeName", type_name.into());
9198        query = query.arg("function", function.into());
9199        Llm {
9200            proc: self.proc.clone(),
9201            selection: query,
9202            graphql_client: self.graphql_client.clone(),
9203        }
9204    }
9205    /// allow the LLM to interact with an environment via MCP
9206    pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
9207        let mut query = self.selection.select("withEnv");
9208        query = query.arg_lazy(
9209            "env",
9210            Box::new(move || {
9211                let env = env.clone();
9212                Box::pin(async move { env.into_id().await.unwrap().quote() })
9213            }),
9214        );
9215        Llm {
9216            proc: self.proc.clone(),
9217            selection: query,
9218            graphql_client: self.graphql_client.clone(),
9219        }
9220    }
9221    /// Add an external MCP server to the LLM
9222    ///
9223    /// # Arguments
9224    ///
9225    /// * `name` - The name of the MCP server
9226    /// * `service` - The MCP service to run and communicate with over stdio
9227    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<ServiceId>) -> Llm {
9228        let mut query = self.selection.select("withMCPServer");
9229        query = query.arg("name", name.into());
9230        query = query.arg_lazy(
9231            "service",
9232            Box::new(move || {
9233                let service = service.clone();
9234                Box::pin(async move { service.into_id().await.unwrap().quote() })
9235            }),
9236        );
9237        Llm {
9238            proc: self.proc.clone(),
9239            selection: query,
9240            graphql_client: self.graphql_client.clone(),
9241        }
9242    }
9243    /// swap out the llm model
9244    ///
9245    /// # Arguments
9246    ///
9247    /// * `model` - The model to use
9248    pub fn with_model(&self, model: impl Into<String>) -> Llm {
9249        let mut query = self.selection.select("withModel");
9250        query = query.arg("model", model.into());
9251        Llm {
9252            proc: self.proc.clone(),
9253            selection: query,
9254            graphql_client: self.graphql_client.clone(),
9255        }
9256    }
9257    /// append a prompt to the llm context
9258    ///
9259    /// # Arguments
9260    ///
9261    /// * `prompt` - The prompt to send
9262    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
9263        let mut query = self.selection.select("withPrompt");
9264        query = query.arg("prompt", prompt.into());
9265        Llm {
9266            proc: self.proc.clone(),
9267            selection: query,
9268            graphql_client: self.graphql_client.clone(),
9269        }
9270    }
9271    /// append the contents of a file to the llm context
9272    ///
9273    /// # Arguments
9274    ///
9275    /// * `file` - The file to read the prompt from
9276    pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
9277        let mut query = self.selection.select("withPromptFile");
9278        query = query.arg_lazy(
9279            "file",
9280            Box::new(move || {
9281                let file = file.clone();
9282                Box::pin(async move { file.into_id().await.unwrap().quote() })
9283            }),
9284        );
9285        Llm {
9286            proc: self.proc.clone(),
9287            selection: query,
9288            graphql_client: self.graphql_client.clone(),
9289        }
9290    }
9291    /// Use a static set of tools for method calls, e.g. for MCP clients that do not support dynamic tool registration
9292    pub fn with_static_tools(&self) -> Llm {
9293        let query = self.selection.select("withStaticTools");
9294        Llm {
9295            proc: self.proc.clone(),
9296            selection: query,
9297            graphql_client: self.graphql_client.clone(),
9298        }
9299    }
9300    /// Add a system prompt to the LLM's environment
9301    ///
9302    /// # Arguments
9303    ///
9304    /// * `prompt` - The system prompt to send
9305    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
9306        let mut query = self.selection.select("withSystemPrompt");
9307        query = query.arg("prompt", prompt.into());
9308        Llm {
9309            proc: self.proc.clone(),
9310            selection: query,
9311            graphql_client: self.graphql_client.clone(),
9312        }
9313    }
9314    /// Disable the default system prompt
9315    pub fn without_default_system_prompt(&self) -> Llm {
9316        let query = self.selection.select("withoutDefaultSystemPrompt");
9317        Llm {
9318            proc: self.proc.clone(),
9319            selection: query,
9320            graphql_client: self.graphql_client.clone(),
9321        }
9322    }
9323}
9324#[derive(Clone)]
9325pub struct LlmTokenUsage {
9326    pub proc: Option<Arc<DaggerSessionProc>>,
9327    pub selection: Selection,
9328    pub graphql_client: DynGraphQLClient,
9329}
9330impl LlmTokenUsage {
9331    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
9332        let query = self.selection.select("cachedTokenReads");
9333        query.execute(self.graphql_client.clone()).await
9334    }
9335    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
9336        let query = self.selection.select("cachedTokenWrites");
9337        query.execute(self.graphql_client.clone()).await
9338    }
9339    /// A unique identifier for this LLMTokenUsage.
9340    pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
9341        let query = self.selection.select("id");
9342        query.execute(self.graphql_client.clone()).await
9343    }
9344    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
9345        let query = self.selection.select("inputTokens");
9346        query.execute(self.graphql_client.clone()).await
9347    }
9348    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
9349        let query = self.selection.select("outputTokens");
9350        query.execute(self.graphql_client.clone()).await
9351    }
9352    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
9353        let query = self.selection.select("totalTokens");
9354        query.execute(self.graphql_client.clone()).await
9355    }
9356}
9357#[derive(Clone)]
9358pub struct Label {
9359    pub proc: Option<Arc<DaggerSessionProc>>,
9360    pub selection: Selection,
9361    pub graphql_client: DynGraphQLClient,
9362}
9363impl Label {
9364    /// A unique identifier for this Label.
9365    pub async fn id(&self) -> Result<LabelId, DaggerError> {
9366        let query = self.selection.select("id");
9367        query.execute(self.graphql_client.clone()).await
9368    }
9369    /// The label name.
9370    pub async fn name(&self) -> Result<String, DaggerError> {
9371        let query = self.selection.select("name");
9372        query.execute(self.graphql_client.clone()).await
9373    }
9374    /// The label value.
9375    pub async fn value(&self) -> Result<String, DaggerError> {
9376        let query = self.selection.select("value");
9377        query.execute(self.graphql_client.clone()).await
9378    }
9379}
9380#[derive(Clone)]
9381pub struct ListTypeDef {
9382    pub proc: Option<Arc<DaggerSessionProc>>,
9383    pub selection: Selection,
9384    pub graphql_client: DynGraphQLClient,
9385}
9386impl ListTypeDef {
9387    /// The type of the elements in the list.
9388    pub fn element_type_def(&self) -> TypeDef {
9389        let query = self.selection.select("elementTypeDef");
9390        TypeDef {
9391            proc: self.proc.clone(),
9392            selection: query,
9393            graphql_client: self.graphql_client.clone(),
9394        }
9395    }
9396    /// A unique identifier for this ListTypeDef.
9397    pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
9398        let query = self.selection.select("id");
9399        query.execute(self.graphql_client.clone()).await
9400    }
9401}
9402#[derive(Clone)]
9403pub struct Module {
9404    pub proc: Option<Arc<DaggerSessionProc>>,
9405    pub selection: Selection,
9406    pub graphql_client: DynGraphQLClient,
9407}
9408#[derive(Builder, Debug, PartialEq)]
9409pub struct ModuleServeOpts {
9410    /// Expose the dependencies of this module to the client
9411    #[builder(setter(into, strip_option), default)]
9412    pub include_dependencies: Option<bool>,
9413}
9414impl Module {
9415    /// The dependencies of the module.
9416    pub fn dependencies(&self) -> Vec<Module> {
9417        let query = self.selection.select("dependencies");
9418        vec![Module {
9419            proc: self.proc.clone(),
9420            selection: query,
9421            graphql_client: self.graphql_client.clone(),
9422        }]
9423    }
9424    /// The doc string of the module, if any
9425    pub async fn description(&self) -> Result<String, DaggerError> {
9426        let query = self.selection.select("description");
9427        query.execute(self.graphql_client.clone()).await
9428    }
9429    /// Enumerations served by this module.
9430    pub fn enums(&self) -> Vec<TypeDef> {
9431        let query = self.selection.select("enums");
9432        vec![TypeDef {
9433            proc: self.proc.clone(),
9434            selection: query,
9435            graphql_client: self.graphql_client.clone(),
9436        }]
9437    }
9438    /// The generated files and directories made on top of the module source's context directory.
9439    pub fn generated_context_directory(&self) -> Directory {
9440        let query = self.selection.select("generatedContextDirectory");
9441        Directory {
9442            proc: self.proc.clone(),
9443            selection: query,
9444            graphql_client: self.graphql_client.clone(),
9445        }
9446    }
9447    /// A unique identifier for this Module.
9448    pub async fn id(&self) -> Result<ModuleId, DaggerError> {
9449        let query = self.selection.select("id");
9450        query.execute(self.graphql_client.clone()).await
9451    }
9452    /// Interfaces served by this module.
9453    pub fn interfaces(&self) -> Vec<TypeDef> {
9454        let query = self.selection.select("interfaces");
9455        vec![TypeDef {
9456            proc: self.proc.clone(),
9457            selection: query,
9458            graphql_client: self.graphql_client.clone(),
9459        }]
9460    }
9461    /// The name of the module
9462    pub async fn name(&self) -> Result<String, DaggerError> {
9463        let query = self.selection.select("name");
9464        query.execute(self.graphql_client.clone()).await
9465    }
9466    /// Objects served by this module.
9467    pub fn objects(&self) -> Vec<TypeDef> {
9468        let query = self.selection.select("objects");
9469        vec![TypeDef {
9470            proc: self.proc.clone(),
9471            selection: query,
9472            graphql_client: self.graphql_client.clone(),
9473        }]
9474    }
9475    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
9476    pub fn runtime(&self) -> Container {
9477        let query = self.selection.select("runtime");
9478        Container {
9479            proc: self.proc.clone(),
9480            selection: query,
9481            graphql_client: self.graphql_client.clone(),
9482        }
9483    }
9484    /// The SDK config used by this module.
9485    pub fn sdk(&self) -> SdkConfig {
9486        let query = self.selection.select("sdk");
9487        SdkConfig {
9488            proc: self.proc.clone(),
9489            selection: query,
9490            graphql_client: self.graphql_client.clone(),
9491        }
9492    }
9493    /// Serve a module's API in the current session.
9494    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
9495    ///
9496    /// # Arguments
9497    ///
9498    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9499    pub async fn serve(&self) -> Result<Void, DaggerError> {
9500        let query = self.selection.select("serve");
9501        query.execute(self.graphql_client.clone()).await
9502    }
9503    /// Serve a module's API in the current session.
9504    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
9505    ///
9506    /// # Arguments
9507    ///
9508    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9509    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
9510        let mut query = self.selection.select("serve");
9511        if let Some(include_dependencies) = opts.include_dependencies {
9512            query = query.arg("includeDependencies", include_dependencies);
9513        }
9514        query.execute(self.graphql_client.clone()).await
9515    }
9516    /// The source for the module.
9517    pub fn source(&self) -> ModuleSource {
9518        let query = self.selection.select("source");
9519        ModuleSource {
9520            proc: self.proc.clone(),
9521            selection: query,
9522            graphql_client: self.graphql_client.clone(),
9523        }
9524    }
9525    /// Forces evaluation of the module, including any loading into the engine and associated validation.
9526    pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
9527        let query = self.selection.select("sync");
9528        query.execute(self.graphql_client.clone()).await
9529    }
9530    /// User-defined default values, loaded from local .env files.
9531    pub fn user_defaults(&self) -> EnvFile {
9532        let query = self.selection.select("userDefaults");
9533        EnvFile {
9534            proc: self.proc.clone(),
9535            selection: query,
9536            graphql_client: self.graphql_client.clone(),
9537        }
9538    }
9539    /// Retrieves the module with the given description
9540    ///
9541    /// # Arguments
9542    ///
9543    /// * `description` - The description to set
9544    pub fn with_description(&self, description: impl Into<String>) -> Module {
9545        let mut query = self.selection.select("withDescription");
9546        query = query.arg("description", description.into());
9547        Module {
9548            proc: self.proc.clone(),
9549            selection: query,
9550            graphql_client: self.graphql_client.clone(),
9551        }
9552    }
9553    /// This module plus the given Enum type and associated values
9554    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
9555        let mut query = self.selection.select("withEnum");
9556        query = query.arg_lazy(
9557            "enum",
9558            Box::new(move || {
9559                let r#enum = r#enum.clone();
9560                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
9561            }),
9562        );
9563        Module {
9564            proc: self.proc.clone(),
9565            selection: query,
9566            graphql_client: self.graphql_client.clone(),
9567        }
9568    }
9569    /// This module plus the given Interface type and associated functions
9570    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
9571        let mut query = self.selection.select("withInterface");
9572        query = query.arg_lazy(
9573            "iface",
9574            Box::new(move || {
9575                let iface = iface.clone();
9576                Box::pin(async move { iface.into_id().await.unwrap().quote() })
9577            }),
9578        );
9579        Module {
9580            proc: self.proc.clone(),
9581            selection: query,
9582            graphql_client: self.graphql_client.clone(),
9583        }
9584    }
9585    /// This module plus the given Object type and associated functions.
9586    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
9587        let mut query = self.selection.select("withObject");
9588        query = query.arg_lazy(
9589            "object",
9590            Box::new(move || {
9591                let object = object.clone();
9592                Box::pin(async move { object.into_id().await.unwrap().quote() })
9593            }),
9594        );
9595        Module {
9596            proc: self.proc.clone(),
9597            selection: query,
9598            graphql_client: self.graphql_client.clone(),
9599        }
9600    }
9601}
9602#[derive(Clone)]
9603pub struct ModuleConfigClient {
9604    pub proc: Option<Arc<DaggerSessionProc>>,
9605    pub selection: Selection,
9606    pub graphql_client: DynGraphQLClient,
9607}
9608impl ModuleConfigClient {
9609    /// The directory the client is generated in.
9610    pub async fn directory(&self) -> Result<String, DaggerError> {
9611        let query = self.selection.select("directory");
9612        query.execute(self.graphql_client.clone()).await
9613    }
9614    /// The generator to use
9615    pub async fn generator(&self) -> Result<String, DaggerError> {
9616        let query = self.selection.select("generator");
9617        query.execute(self.graphql_client.clone()).await
9618    }
9619    /// A unique identifier for this ModuleConfigClient.
9620    pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
9621        let query = self.selection.select("id");
9622        query.execute(self.graphql_client.clone()).await
9623    }
9624}
9625#[derive(Clone)]
9626pub struct ModuleSource {
9627    pub proc: Option<Arc<DaggerSessionProc>>,
9628    pub selection: Selection,
9629    pub graphql_client: DynGraphQLClient,
9630}
9631impl ModuleSource {
9632    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
9633    pub fn as_module(&self) -> Module {
9634        let query = self.selection.select("asModule");
9635        Module {
9636            proc: self.proc.clone(),
9637            selection: query,
9638            graphql_client: self.graphql_client.clone(),
9639        }
9640    }
9641    /// A human readable ref string representation of this module source.
9642    pub async fn as_string(&self) -> Result<String, DaggerError> {
9643        let query = self.selection.select("asString");
9644        query.execute(self.graphql_client.clone()).await
9645    }
9646    /// The blueprint referenced by the module source.
9647    pub fn blueprint(&self) -> ModuleSource {
9648        let query = self.selection.select("blueprint");
9649        ModuleSource {
9650            proc: self.proc.clone(),
9651            selection: query,
9652            graphql_client: self.graphql_client.clone(),
9653        }
9654    }
9655    /// The ref to clone the root of the git repo from. Only valid for git sources.
9656    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
9657        let query = self.selection.select("cloneRef");
9658        query.execute(self.graphql_client.clone()).await
9659    }
9660    /// The resolved commit of the git repo this source points to.
9661    pub async fn commit(&self) -> Result<String, DaggerError> {
9662        let query = self.selection.select("commit");
9663        query.execute(self.graphql_client.clone()).await
9664    }
9665    /// The clients generated for the module.
9666    pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
9667        let query = self.selection.select("configClients");
9668        vec![ModuleConfigClient {
9669            proc: self.proc.clone(),
9670            selection: query,
9671            graphql_client: self.graphql_client.clone(),
9672        }]
9673    }
9674    /// Whether an existing dagger.json for the module was found.
9675    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
9676        let query = self.selection.select("configExists");
9677        query.execute(self.graphql_client.clone()).await
9678    }
9679    /// The full directory loaded for the module source, including the source code as a subdirectory.
9680    pub fn context_directory(&self) -> Directory {
9681        let query = self.selection.select("contextDirectory");
9682        Directory {
9683            proc: self.proc.clone(),
9684            selection: query,
9685            graphql_client: self.graphql_client.clone(),
9686        }
9687    }
9688    /// The dependencies of the module source.
9689    pub fn dependencies(&self) -> Vec<ModuleSource> {
9690        let query = self.selection.select("dependencies");
9691        vec![ModuleSource {
9692            proc: self.proc.clone(),
9693            selection: query,
9694            graphql_client: self.graphql_client.clone(),
9695        }]
9696    }
9697    /// 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.
9698    pub async fn digest(&self) -> Result<String, DaggerError> {
9699        let query = self.selection.select("digest");
9700        query.execute(self.graphql_client.clone()).await
9701    }
9702    /// The directory containing the module configuration and source code (source code may be in a subdir).
9703    ///
9704    /// # Arguments
9705    ///
9706    /// * `path` - A subpath from the source directory to select.
9707    pub fn directory(&self, path: impl Into<String>) -> Directory {
9708        let mut query = self.selection.select("directory");
9709        query = query.arg("path", path.into());
9710        Directory {
9711            proc: self.proc.clone(),
9712            selection: query,
9713            graphql_client: self.graphql_client.clone(),
9714        }
9715    }
9716    /// The engine version of the module.
9717    pub async fn engine_version(&self) -> Result<String, DaggerError> {
9718        let query = self.selection.select("engineVersion");
9719        query.execute(self.graphql_client.clone()).await
9720    }
9721    /// The generated files and directories made on top of the module source's context directory.
9722    pub fn generated_context_directory(&self) -> Directory {
9723        let query = self.selection.select("generatedContextDirectory");
9724        Directory {
9725            proc: self.proc.clone(),
9726            selection: query,
9727            graphql_client: self.graphql_client.clone(),
9728        }
9729    }
9730    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
9731    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
9732        let query = self.selection.select("htmlRepoURL");
9733        query.execute(self.graphql_client.clone()).await
9734    }
9735    /// The URL to the source's git repo in a web browser. Only valid for git sources.
9736    pub async fn html_url(&self) -> Result<String, DaggerError> {
9737        let query = self.selection.select("htmlURL");
9738        query.execute(self.graphql_client.clone()).await
9739    }
9740    /// A unique identifier for this ModuleSource.
9741    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
9742        let query = self.selection.select("id");
9743        query.execute(self.graphql_client.clone()).await
9744    }
9745    /// The kind of module source (currently local, git or dir).
9746    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
9747        let query = self.selection.select("kind");
9748        query.execute(self.graphql_client.clone()).await
9749    }
9750    /// 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.
9751    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
9752        let query = self.selection.select("localContextDirectoryPath");
9753        query.execute(self.graphql_client.clone()).await
9754    }
9755    /// The name of the module, including any setting via the withName API.
9756    pub async fn module_name(&self) -> Result<String, DaggerError> {
9757        let query = self.selection.select("moduleName");
9758        query.execute(self.graphql_client.clone()).await
9759    }
9760    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
9761    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
9762        let query = self.selection.select("moduleOriginalName");
9763        query.execute(self.graphql_client.clone()).await
9764    }
9765    /// The original subpath used when instantiating this module source, relative to the context directory.
9766    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
9767        let query = self.selection.select("originalSubpath");
9768        query.execute(self.graphql_client.clone()).await
9769    }
9770    /// The pinned version of this module source.
9771    pub async fn pin(&self) -> Result<String, DaggerError> {
9772        let query = self.selection.select("pin");
9773        query.execute(self.graphql_client.clone()).await
9774    }
9775    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
9776    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
9777        let query = self.selection.select("repoRootPath");
9778        query.execute(self.graphql_client.clone()).await
9779    }
9780    /// The SDK configuration of the module.
9781    pub fn sdk(&self) -> SdkConfig {
9782        let query = self.selection.select("sdk");
9783        SdkConfig {
9784            proc: self.proc.clone(),
9785            selection: query,
9786            graphql_client: self.graphql_client.clone(),
9787        }
9788    }
9789    /// The path, relative to the context directory, that contains the module's dagger.json.
9790    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
9791        let query = self.selection.select("sourceRootSubpath");
9792        query.execute(self.graphql_client.clone()).await
9793    }
9794    /// The path to the directory containing the module's source code, relative to the context directory.
9795    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
9796        let query = self.selection.select("sourceSubpath");
9797        query.execute(self.graphql_client.clone()).await
9798    }
9799    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
9800    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
9801        let query = self.selection.select("sync");
9802        query.execute(self.graphql_client.clone()).await
9803    }
9804    /// User-defined defaults read from local .env files
9805    pub fn user_defaults(&self) -> EnvFile {
9806        let query = self.selection.select("userDefaults");
9807        EnvFile {
9808            proc: self.proc.clone(),
9809            selection: query,
9810            graphql_client: self.graphql_client.clone(),
9811        }
9812    }
9813    /// The specified version of the git repo this source points to.
9814    pub async fn version(&self) -> Result<String, DaggerError> {
9815        let query = self.selection.select("version");
9816        query.execute(self.graphql_client.clone()).await
9817    }
9818    /// Set a blueprint for the module source.
9819    ///
9820    /// # Arguments
9821    ///
9822    /// * `blueprint` - The blueprint module to set.
9823    pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
9824        let mut query = self.selection.select("withBlueprint");
9825        query = query.arg_lazy(
9826            "blueprint",
9827            Box::new(move || {
9828                let blueprint = blueprint.clone();
9829                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
9830            }),
9831        );
9832        ModuleSource {
9833            proc: self.proc.clone(),
9834            selection: query,
9835            graphql_client: self.graphql_client.clone(),
9836        }
9837    }
9838    /// Update the module source with a new client to generate.
9839    ///
9840    /// # Arguments
9841    ///
9842    /// * `generator` - The generator to use
9843    /// * `output_dir` - The output directory for the generated client.
9844    pub fn with_client(
9845        &self,
9846        generator: impl Into<String>,
9847        output_dir: impl Into<String>,
9848    ) -> ModuleSource {
9849        let mut query = self.selection.select("withClient");
9850        query = query.arg("generator", generator.into());
9851        query = query.arg("outputDir", output_dir.into());
9852        ModuleSource {
9853            proc: self.proc.clone(),
9854            selection: query,
9855            graphql_client: self.graphql_client.clone(),
9856        }
9857    }
9858    /// Append the provided dependencies to the module source's dependency list.
9859    ///
9860    /// # Arguments
9861    ///
9862    /// * `dependencies` - The dependencies to append.
9863    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
9864        let mut query = self.selection.select("withDependencies");
9865        query = query.arg("dependencies", dependencies);
9866        ModuleSource {
9867            proc: self.proc.clone(),
9868            selection: query,
9869            graphql_client: self.graphql_client.clone(),
9870        }
9871    }
9872    /// Upgrade the engine version of the module to the given value.
9873    ///
9874    /// # Arguments
9875    ///
9876    /// * `version` - The engine version to upgrade to.
9877    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
9878        let mut query = self.selection.select("withEngineVersion");
9879        query = query.arg("version", version.into());
9880        ModuleSource {
9881            proc: self.proc.clone(),
9882            selection: query,
9883            graphql_client: self.graphql_client.clone(),
9884        }
9885    }
9886    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
9887    ///
9888    /// # Arguments
9889    ///
9890    /// * `patterns` - The new additional include patterns.
9891    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
9892        let mut query = self.selection.select("withIncludes");
9893        query = query.arg(
9894            "patterns",
9895            patterns
9896                .into_iter()
9897                .map(|i| i.into())
9898                .collect::<Vec<String>>(),
9899        );
9900        ModuleSource {
9901            proc: self.proc.clone(),
9902            selection: query,
9903            graphql_client: self.graphql_client.clone(),
9904        }
9905    }
9906    /// Update the module source with a new name.
9907    ///
9908    /// # Arguments
9909    ///
9910    /// * `name` - The name to set.
9911    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
9912        let mut query = self.selection.select("withName");
9913        query = query.arg("name", name.into());
9914        ModuleSource {
9915            proc: self.proc.clone(),
9916            selection: query,
9917            graphql_client: self.graphql_client.clone(),
9918        }
9919    }
9920    /// Update the module source with a new SDK.
9921    ///
9922    /// # Arguments
9923    ///
9924    /// * `source` - The SDK source to set.
9925    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
9926        let mut query = self.selection.select("withSDK");
9927        query = query.arg("source", source.into());
9928        ModuleSource {
9929            proc: self.proc.clone(),
9930            selection: query,
9931            graphql_client: self.graphql_client.clone(),
9932        }
9933    }
9934    /// Update the module source with a new source subpath.
9935    ///
9936    /// # Arguments
9937    ///
9938    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
9939    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
9940        let mut query = self.selection.select("withSourceSubpath");
9941        query = query.arg("path", path.into());
9942        ModuleSource {
9943            proc: self.proc.clone(),
9944            selection: query,
9945            graphql_client: self.graphql_client.clone(),
9946        }
9947    }
9948    /// Update the blueprint module to the latest version.
9949    pub fn with_update_blueprint(&self) -> ModuleSource {
9950        let query = self.selection.select("withUpdateBlueprint");
9951        ModuleSource {
9952            proc: self.proc.clone(),
9953            selection: query,
9954            graphql_client: self.graphql_client.clone(),
9955        }
9956    }
9957    /// Update one or more module dependencies.
9958    ///
9959    /// # Arguments
9960    ///
9961    /// * `dependencies` - The dependencies to update.
9962    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
9963        let mut query = self.selection.select("withUpdateDependencies");
9964        query = query.arg(
9965            "dependencies",
9966            dependencies
9967                .into_iter()
9968                .map(|i| i.into())
9969                .collect::<Vec<String>>(),
9970        );
9971        ModuleSource {
9972            proc: self.proc.clone(),
9973            selection: query,
9974            graphql_client: self.graphql_client.clone(),
9975        }
9976    }
9977    /// Update one or more clients.
9978    ///
9979    /// # Arguments
9980    ///
9981    /// * `clients` - The clients to update
9982    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
9983        let mut query = self.selection.select("withUpdatedClients");
9984        query = query.arg(
9985            "clients",
9986            clients
9987                .into_iter()
9988                .map(|i| i.into())
9989                .collect::<Vec<String>>(),
9990        );
9991        ModuleSource {
9992            proc: self.proc.clone(),
9993            selection: query,
9994            graphql_client: self.graphql_client.clone(),
9995        }
9996    }
9997    /// Remove the current blueprint from the module source.
9998    pub fn without_blueprint(&self) -> ModuleSource {
9999        let query = self.selection.select("withoutBlueprint");
10000        ModuleSource {
10001            proc: self.proc.clone(),
10002            selection: query,
10003            graphql_client: self.graphql_client.clone(),
10004        }
10005    }
10006    /// Remove a client from the module source.
10007    ///
10008    /// # Arguments
10009    ///
10010    /// * `path` - The path of the client to remove.
10011    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
10012        let mut query = self.selection.select("withoutClient");
10013        query = query.arg("path", path.into());
10014        ModuleSource {
10015            proc: self.proc.clone(),
10016            selection: query,
10017            graphql_client: self.graphql_client.clone(),
10018        }
10019    }
10020    /// Remove the provided dependencies from the module source's dependency list.
10021    ///
10022    /// # Arguments
10023    ///
10024    /// * `dependencies` - The dependencies to remove.
10025    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
10026        let mut query = self.selection.select("withoutDependencies");
10027        query = query.arg(
10028            "dependencies",
10029            dependencies
10030                .into_iter()
10031                .map(|i| i.into())
10032                .collect::<Vec<String>>(),
10033        );
10034        ModuleSource {
10035            proc: self.proc.clone(),
10036            selection: query,
10037            graphql_client: self.graphql_client.clone(),
10038        }
10039    }
10040}
10041#[derive(Clone)]
10042pub struct ObjectTypeDef {
10043    pub proc: Option<Arc<DaggerSessionProc>>,
10044    pub selection: Selection,
10045    pub graphql_client: DynGraphQLClient,
10046}
10047impl ObjectTypeDef {
10048    /// The function used to construct new instances of this object, if any
10049    pub fn constructor(&self) -> Function {
10050        let query = self.selection.select("constructor");
10051        Function {
10052            proc: self.proc.clone(),
10053            selection: query,
10054            graphql_client: self.graphql_client.clone(),
10055        }
10056    }
10057    /// The doc string for the object, if any.
10058    pub async fn description(&self) -> Result<String, DaggerError> {
10059        let query = self.selection.select("description");
10060        query.execute(self.graphql_client.clone()).await
10061    }
10062    /// Static fields defined on this object, if any.
10063    pub fn fields(&self) -> Vec<FieldTypeDef> {
10064        let query = self.selection.select("fields");
10065        vec![FieldTypeDef {
10066            proc: self.proc.clone(),
10067            selection: query,
10068            graphql_client: self.graphql_client.clone(),
10069        }]
10070    }
10071    /// Functions defined on this object, if any.
10072    pub fn functions(&self) -> Vec<Function> {
10073        let query = self.selection.select("functions");
10074        vec![Function {
10075            proc: self.proc.clone(),
10076            selection: query,
10077            graphql_client: self.graphql_client.clone(),
10078        }]
10079    }
10080    /// A unique identifier for this ObjectTypeDef.
10081    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
10082        let query = self.selection.select("id");
10083        query.execute(self.graphql_client.clone()).await
10084    }
10085    /// The name of the object.
10086    pub async fn name(&self) -> Result<String, DaggerError> {
10087        let query = self.selection.select("name");
10088        query.execute(self.graphql_client.clone()).await
10089    }
10090    /// The location of this object declaration.
10091    pub fn source_map(&self) -> SourceMap {
10092        let query = self.selection.select("sourceMap");
10093        SourceMap {
10094            proc: self.proc.clone(),
10095            selection: query,
10096            graphql_client: self.graphql_client.clone(),
10097        }
10098    }
10099    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
10100    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10101        let query = self.selection.select("sourceModuleName");
10102        query.execute(self.graphql_client.clone()).await
10103    }
10104}
10105#[derive(Clone)]
10106pub struct Port {
10107    pub proc: Option<Arc<DaggerSessionProc>>,
10108    pub selection: Selection,
10109    pub graphql_client: DynGraphQLClient,
10110}
10111impl Port {
10112    /// The port description.
10113    pub async fn description(&self) -> Result<String, DaggerError> {
10114        let query = self.selection.select("description");
10115        query.execute(self.graphql_client.clone()).await
10116    }
10117    /// Skip the health check when run as a service.
10118    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
10119        let query = self.selection.select("experimentalSkipHealthcheck");
10120        query.execute(self.graphql_client.clone()).await
10121    }
10122    /// A unique identifier for this Port.
10123    pub async fn id(&self) -> Result<PortId, DaggerError> {
10124        let query = self.selection.select("id");
10125        query.execute(self.graphql_client.clone()).await
10126    }
10127    /// The port number.
10128    pub async fn port(&self) -> Result<isize, DaggerError> {
10129        let query = self.selection.select("port");
10130        query.execute(self.graphql_client.clone()).await
10131    }
10132    /// The transport layer protocol.
10133    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
10134        let query = self.selection.select("protocol");
10135        query.execute(self.graphql_client.clone()).await
10136    }
10137}
10138#[derive(Clone)]
10139pub struct Query {
10140    pub proc: Option<Arc<DaggerSessionProc>>,
10141    pub selection: Selection,
10142    pub graphql_client: DynGraphQLClient,
10143}
10144#[derive(Builder, Debug, PartialEq)]
10145pub struct QueryContainerOpts {
10146    /// Platform to initialize the container with. Defaults to the native platform of the current engine
10147    #[builder(setter(into, strip_option), default)]
10148    pub platform: Option<Platform>,
10149}
10150#[derive(Builder, Debug, PartialEq)]
10151pub struct QueryEnvOpts {
10152    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
10153    #[builder(setter(into, strip_option), default)]
10154    pub privileged: Option<bool>,
10155    /// Allow new outputs to be declared and saved in the environment
10156    #[builder(setter(into, strip_option), default)]
10157    pub writable: Option<bool>,
10158}
10159#[derive(Builder, Debug, PartialEq)]
10160pub struct QueryEnvFileOpts {
10161    /// Replace "${VAR}" or "$VAR" with the value of other vars
10162    #[builder(setter(into, strip_option), default)]
10163    pub expand: Option<bool>,
10164}
10165#[derive(Builder, Debug, PartialEq)]
10166pub struct QueryFileOpts {
10167    /// Permissions of the new file. Example: 0600
10168    #[builder(setter(into, strip_option), default)]
10169    pub permissions: Option<isize>,
10170}
10171#[derive(Builder, Debug, PartialEq)]
10172pub struct QueryGitOpts<'a> {
10173    /// A service which must be started before the repo is fetched.
10174    #[builder(setter(into, strip_option), default)]
10175    pub experimental_service_host: Option<ServiceId>,
10176    /// Secret used to populate the Authorization HTTP header
10177    #[builder(setter(into, strip_option), default)]
10178    pub http_auth_header: Option<SecretId>,
10179    /// Secret used to populate the password during basic HTTP Authorization
10180    #[builder(setter(into, strip_option), default)]
10181    pub http_auth_token: Option<SecretId>,
10182    /// Username used to populate the password during basic HTTP Authorization
10183    #[builder(setter(into, strip_option), default)]
10184    pub http_auth_username: Option<&'a str>,
10185    /// DEPRECATED: Set to true to keep .git directory.
10186    #[builder(setter(into, strip_option), default)]
10187    pub keep_git_dir: Option<bool>,
10188    /// Set SSH auth socket
10189    #[builder(setter(into, strip_option), default)]
10190    pub ssh_auth_socket: Option<SocketId>,
10191    /// Set SSH known hosts
10192    #[builder(setter(into, strip_option), default)]
10193    pub ssh_known_hosts: Option<&'a str>,
10194}
10195#[derive(Builder, Debug, PartialEq)]
10196pub struct QueryHttpOpts<'a> {
10197    /// Secret used to populate the Authorization HTTP header
10198    #[builder(setter(into, strip_option), default)]
10199    pub auth_header: Option<SecretId>,
10200    /// A service which must be started before the URL is fetched.
10201    #[builder(setter(into, strip_option), default)]
10202    pub experimental_service_host: Option<ServiceId>,
10203    /// File name to use for the file. Defaults to the last part of the URL.
10204    #[builder(setter(into, strip_option), default)]
10205    pub name: Option<&'a str>,
10206    /// Permissions to set on the file.
10207    #[builder(setter(into, strip_option), default)]
10208    pub permissions: Option<isize>,
10209}
10210#[derive(Builder, Debug, PartialEq)]
10211pub struct QueryLlmOpts<'a> {
10212    /// Cap the number of API calls for this LLM
10213    #[builder(setter(into, strip_option), default)]
10214    pub max_api_calls: Option<isize>,
10215    /// Model to use
10216    #[builder(setter(into, strip_option), default)]
10217    pub model: Option<&'a str>,
10218}
10219#[derive(Builder, Debug, PartialEq)]
10220pub struct QueryModuleSourceOpts<'a> {
10221    /// 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.
10222    #[builder(setter(into, strip_option), default)]
10223    pub allow_not_exists: Option<bool>,
10224    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
10225    #[builder(setter(into, strip_option), default)]
10226    pub disable_find_up: Option<bool>,
10227    /// The pinned version of the module source
10228    #[builder(setter(into, strip_option), default)]
10229    pub ref_pin: Option<&'a str>,
10230    /// If set, error out if the ref string is not of the provided requireKind.
10231    #[builder(setter(into, strip_option), default)]
10232    pub require_kind: Option<ModuleSourceKind>,
10233}
10234#[derive(Builder, Debug, PartialEq)]
10235pub struct QuerySecretOpts<'a> {
10236    /// 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.
10237    /// 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.
10238    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
10239    #[builder(setter(into, strip_option), default)]
10240    pub cache_key: Option<&'a str>,
10241}
10242impl Query {
10243    /// initialize an address to load directories, containers, secrets or other object types.
10244    pub fn address(&self, value: impl Into<String>) -> Address {
10245        let mut query = self.selection.select("address");
10246        query = query.arg("value", value.into());
10247        Address {
10248            proc: self.proc.clone(),
10249            selection: query,
10250            graphql_client: self.graphql_client.clone(),
10251        }
10252    }
10253    /// Constructs a cache volume for a given cache key.
10254    ///
10255    /// # Arguments
10256    ///
10257    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
10258    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
10259        let mut query = self.selection.select("cacheVolume");
10260        query = query.arg("key", key.into());
10261        CacheVolume {
10262            proc: self.proc.clone(),
10263            selection: query,
10264            graphql_client: self.graphql_client.clone(),
10265        }
10266    }
10267    /// Dagger Cloud configuration and state
10268    pub fn cloud(&self) -> Cloud {
10269        let query = self.selection.select("cloud");
10270        Cloud {
10271            proc: self.proc.clone(),
10272            selection: query,
10273            graphql_client: self.graphql_client.clone(),
10274        }
10275    }
10276    /// Creates a scratch container, with no image or metadata.
10277    /// To pull an image, follow up with the "from" function.
10278    ///
10279    /// # Arguments
10280    ///
10281    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10282    pub fn container(&self) -> Container {
10283        let query = self.selection.select("container");
10284        Container {
10285            proc: self.proc.clone(),
10286            selection: query,
10287            graphql_client: self.graphql_client.clone(),
10288        }
10289    }
10290    /// Creates a scratch container, with no image or metadata.
10291    /// To pull an image, follow up with the "from" function.
10292    ///
10293    /// # Arguments
10294    ///
10295    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10296    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
10297        let mut query = self.selection.select("container");
10298        if let Some(platform) = opts.platform {
10299            query = query.arg("platform", platform);
10300        }
10301        Container {
10302            proc: self.proc.clone(),
10303            selection: query,
10304            graphql_client: self.graphql_client.clone(),
10305        }
10306    }
10307    /// Returns the current environment
10308    /// 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.
10309    /// 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.
10310    pub fn current_env(&self) -> Env {
10311        let query = self.selection.select("currentEnv");
10312        Env {
10313            proc: self.proc.clone(),
10314            selection: query,
10315            graphql_client: self.graphql_client.clone(),
10316        }
10317    }
10318    /// The FunctionCall context that the SDK caller is currently executing in.
10319    /// If the caller is not currently executing in a function, this will return an error.
10320    pub fn current_function_call(&self) -> FunctionCall {
10321        let query = self.selection.select("currentFunctionCall");
10322        FunctionCall {
10323            proc: self.proc.clone(),
10324            selection: query,
10325            graphql_client: self.graphql_client.clone(),
10326        }
10327    }
10328    /// The module currently being served in the session, if any.
10329    pub fn current_module(&self) -> CurrentModule {
10330        let query = self.selection.select("currentModule");
10331        CurrentModule {
10332            proc: self.proc.clone(),
10333            selection: query,
10334            graphql_client: self.graphql_client.clone(),
10335        }
10336    }
10337    /// The TypeDef representations of the objects currently being served in the session.
10338    pub fn current_type_defs(&self) -> Vec<TypeDef> {
10339        let query = self.selection.select("currentTypeDefs");
10340        vec![TypeDef {
10341            proc: self.proc.clone(),
10342            selection: query,
10343            graphql_client: self.graphql_client.clone(),
10344        }]
10345    }
10346    /// The default platform of the engine.
10347    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
10348        let query = self.selection.select("defaultPlatform");
10349        query.execute(self.graphql_client.clone()).await
10350    }
10351    /// Creates an empty directory.
10352    pub fn directory(&self) -> Directory {
10353        let query = self.selection.select("directory");
10354        Directory {
10355            proc: self.proc.clone(),
10356            selection: query,
10357            graphql_client: self.graphql_client.clone(),
10358        }
10359    }
10360    /// The Dagger engine container configuration and state
10361    pub fn engine(&self) -> Engine {
10362        let query = self.selection.select("engine");
10363        Engine {
10364            proc: self.proc.clone(),
10365            selection: query,
10366            graphql_client: self.graphql_client.clone(),
10367        }
10368    }
10369    /// Initializes a new environment
10370    ///
10371    /// # Arguments
10372    ///
10373    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10374    pub fn env(&self) -> Env {
10375        let query = self.selection.select("env");
10376        Env {
10377            proc: self.proc.clone(),
10378            selection: query,
10379            graphql_client: self.graphql_client.clone(),
10380        }
10381    }
10382    /// Initializes a new environment
10383    ///
10384    /// # Arguments
10385    ///
10386    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10387    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
10388        let mut query = self.selection.select("env");
10389        if let Some(privileged) = opts.privileged {
10390            query = query.arg("privileged", privileged);
10391        }
10392        if let Some(writable) = opts.writable {
10393            query = query.arg("writable", writable);
10394        }
10395        Env {
10396            proc: self.proc.clone(),
10397            selection: query,
10398            graphql_client: self.graphql_client.clone(),
10399        }
10400    }
10401    /// Initialize an environment file
10402    ///
10403    /// # Arguments
10404    ///
10405    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10406    pub fn env_file(&self) -> EnvFile {
10407        let query = self.selection.select("envFile");
10408        EnvFile {
10409            proc: self.proc.clone(),
10410            selection: query,
10411            graphql_client: self.graphql_client.clone(),
10412        }
10413    }
10414    /// Initialize an environment file
10415    ///
10416    /// # Arguments
10417    ///
10418    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10419    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
10420        let mut query = self.selection.select("envFile");
10421        if let Some(expand) = opts.expand {
10422            query = query.arg("expand", expand);
10423        }
10424        EnvFile {
10425            proc: self.proc.clone(),
10426            selection: query,
10427            graphql_client: self.graphql_client.clone(),
10428        }
10429    }
10430    /// Create a new error.
10431    ///
10432    /// # Arguments
10433    ///
10434    /// * `message` - A brief description of the error.
10435    pub fn error(&self, message: impl Into<String>) -> Error {
10436        let mut query = self.selection.select("error");
10437        query = query.arg("message", message.into());
10438        Error {
10439            proc: self.proc.clone(),
10440            selection: query,
10441            graphql_client: self.graphql_client.clone(),
10442        }
10443    }
10444    /// Creates a file with the specified contents.
10445    ///
10446    /// # Arguments
10447    ///
10448    /// * `name` - Name of the new file. Example: "foo.txt"
10449    /// * `contents` - Contents of the new file. Example: "Hello world!"
10450    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10451    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
10452        let mut query = self.selection.select("file");
10453        query = query.arg("name", name.into());
10454        query = query.arg("contents", contents.into());
10455        File {
10456            proc: self.proc.clone(),
10457            selection: query,
10458            graphql_client: self.graphql_client.clone(),
10459        }
10460    }
10461    /// Creates a file with the specified contents.
10462    ///
10463    /// # Arguments
10464    ///
10465    /// * `name` - Name of the new file. Example: "foo.txt"
10466    /// * `contents` - Contents of the new file. Example: "Hello world!"
10467    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10468    pub fn file_opts(
10469        &self,
10470        name: impl Into<String>,
10471        contents: impl Into<String>,
10472        opts: QueryFileOpts,
10473    ) -> File {
10474        let mut query = self.selection.select("file");
10475        query = query.arg("name", name.into());
10476        query = query.arg("contents", contents.into());
10477        if let Some(permissions) = opts.permissions {
10478            query = query.arg("permissions", permissions);
10479        }
10480        File {
10481            proc: self.proc.clone(),
10482            selection: query,
10483            graphql_client: self.graphql_client.clone(),
10484        }
10485    }
10486    /// Creates a function.
10487    ///
10488    /// # Arguments
10489    ///
10490    /// * `name` - Name of the function, in its original format from the implementation language.
10491    /// * `return_type` - Return type of the function.
10492    pub fn function(
10493        &self,
10494        name: impl Into<String>,
10495        return_type: impl IntoID<TypeDefId>,
10496    ) -> Function {
10497        let mut query = self.selection.select("function");
10498        query = query.arg("name", name.into());
10499        query = query.arg_lazy(
10500            "returnType",
10501            Box::new(move || {
10502                let return_type = return_type.clone();
10503                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
10504            }),
10505        );
10506        Function {
10507            proc: self.proc.clone(),
10508            selection: query,
10509            graphql_client: self.graphql_client.clone(),
10510        }
10511    }
10512    /// Create a code generation result, given a directory containing the generated code.
10513    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
10514        let mut query = self.selection.select("generatedCode");
10515        query = query.arg_lazy(
10516            "code",
10517            Box::new(move || {
10518                let code = code.clone();
10519                Box::pin(async move { code.into_id().await.unwrap().quote() })
10520            }),
10521        );
10522        GeneratedCode {
10523            proc: self.proc.clone(),
10524            selection: query,
10525            graphql_client: self.graphql_client.clone(),
10526        }
10527    }
10528    /// Queries a Git repository.
10529    ///
10530    /// # Arguments
10531    ///
10532    /// * `url` - URL of the git repository.
10533    ///
10534    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
10535    ///
10536    /// Suffix ".git" is optional.
10537    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10538    pub fn git(&self, url: impl Into<String>) -> GitRepository {
10539        let mut query = self.selection.select("git");
10540        query = query.arg("url", url.into());
10541        GitRepository {
10542            proc: self.proc.clone(),
10543            selection: query,
10544            graphql_client: self.graphql_client.clone(),
10545        }
10546    }
10547    /// Queries a Git repository.
10548    ///
10549    /// # Arguments
10550    ///
10551    /// * `url` - URL of the git repository.
10552    ///
10553    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
10554    ///
10555    /// Suffix ".git" is optional.
10556    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10557    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
10558        let mut query = self.selection.select("git");
10559        query = query.arg("url", url.into());
10560        if let Some(keep_git_dir) = opts.keep_git_dir {
10561            query = query.arg("keepGitDir", keep_git_dir);
10562        }
10563        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
10564            query = query.arg("sshKnownHosts", ssh_known_hosts);
10565        }
10566        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
10567            query = query.arg("sshAuthSocket", ssh_auth_socket);
10568        }
10569        if let Some(http_auth_username) = opts.http_auth_username {
10570            query = query.arg("httpAuthUsername", http_auth_username);
10571        }
10572        if let Some(http_auth_token) = opts.http_auth_token {
10573            query = query.arg("httpAuthToken", http_auth_token);
10574        }
10575        if let Some(http_auth_header) = opts.http_auth_header {
10576            query = query.arg("httpAuthHeader", http_auth_header);
10577        }
10578        if let Some(experimental_service_host) = opts.experimental_service_host {
10579            query = query.arg("experimentalServiceHost", experimental_service_host);
10580        }
10581        GitRepository {
10582            proc: self.proc.clone(),
10583            selection: query,
10584            graphql_client: self.graphql_client.clone(),
10585        }
10586    }
10587    /// Queries the host environment.
10588    pub fn host(&self) -> Host {
10589        let query = self.selection.select("host");
10590        Host {
10591            proc: self.proc.clone(),
10592            selection: query,
10593            graphql_client: self.graphql_client.clone(),
10594        }
10595    }
10596    /// Returns a file containing an http remote url content.
10597    ///
10598    /// # Arguments
10599    ///
10600    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
10601    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10602    pub fn http(&self, url: impl Into<String>) -> File {
10603        let mut query = self.selection.select("http");
10604        query = query.arg("url", url.into());
10605        File {
10606            proc: self.proc.clone(),
10607            selection: query,
10608            graphql_client: self.graphql_client.clone(),
10609        }
10610    }
10611    /// Returns a file containing an http remote url content.
10612    ///
10613    /// # Arguments
10614    ///
10615    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
10616    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10617    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
10618        let mut query = self.selection.select("http");
10619        query = query.arg("url", url.into());
10620        if let Some(name) = opts.name {
10621            query = query.arg("name", name);
10622        }
10623        if let Some(permissions) = opts.permissions {
10624            query = query.arg("permissions", permissions);
10625        }
10626        if let Some(auth_header) = opts.auth_header {
10627            query = query.arg("authHeader", auth_header);
10628        }
10629        if let Some(experimental_service_host) = opts.experimental_service_host {
10630            query = query.arg("experimentalServiceHost", experimental_service_host);
10631        }
10632        File {
10633            proc: self.proc.clone(),
10634            selection: query,
10635            graphql_client: self.graphql_client.clone(),
10636        }
10637    }
10638    /// Initialize a JSON value
10639    pub fn json(&self) -> JsonValue {
10640        let query = self.selection.select("json");
10641        JsonValue {
10642            proc: self.proc.clone(),
10643            selection: query,
10644            graphql_client: self.graphql_client.clone(),
10645        }
10646    }
10647    /// Initialize a Large Language Model (LLM)
10648    ///
10649    /// # Arguments
10650    ///
10651    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10652    pub fn llm(&self) -> Llm {
10653        let query = self.selection.select("llm");
10654        Llm {
10655            proc: self.proc.clone(),
10656            selection: query,
10657            graphql_client: self.graphql_client.clone(),
10658        }
10659    }
10660    /// Initialize a Large Language Model (LLM)
10661    ///
10662    /// # Arguments
10663    ///
10664    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10665    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
10666        let mut query = self.selection.select("llm");
10667        if let Some(model) = opts.model {
10668            query = query.arg("model", model);
10669        }
10670        if let Some(max_api_calls) = opts.max_api_calls {
10671            query = query.arg("maxAPICalls", max_api_calls);
10672        }
10673        Llm {
10674            proc: self.proc.clone(),
10675            selection: query,
10676            graphql_client: self.graphql_client.clone(),
10677        }
10678    }
10679    /// Load a Address from its ID.
10680    pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
10681        let mut query = self.selection.select("loadAddressFromID");
10682        query = query.arg_lazy(
10683            "id",
10684            Box::new(move || {
10685                let id = id.clone();
10686                Box::pin(async move { id.into_id().await.unwrap().quote() })
10687            }),
10688        );
10689        Address {
10690            proc: self.proc.clone(),
10691            selection: query,
10692            graphql_client: self.graphql_client.clone(),
10693        }
10694    }
10695    /// Load a Binding from its ID.
10696    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
10697        let mut query = self.selection.select("loadBindingFromID");
10698        query = query.arg_lazy(
10699            "id",
10700            Box::new(move || {
10701                let id = id.clone();
10702                Box::pin(async move { id.into_id().await.unwrap().quote() })
10703            }),
10704        );
10705        Binding {
10706            proc: self.proc.clone(),
10707            selection: query,
10708            graphql_client: self.graphql_client.clone(),
10709        }
10710    }
10711    /// Load a CacheVolume from its ID.
10712    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
10713        let mut query = self.selection.select("loadCacheVolumeFromID");
10714        query = query.arg_lazy(
10715            "id",
10716            Box::new(move || {
10717                let id = id.clone();
10718                Box::pin(async move { id.into_id().await.unwrap().quote() })
10719            }),
10720        );
10721        CacheVolume {
10722            proc: self.proc.clone(),
10723            selection: query,
10724            graphql_client: self.graphql_client.clone(),
10725        }
10726    }
10727    /// Load a Changeset from its ID.
10728    pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
10729        let mut query = self.selection.select("loadChangesetFromID");
10730        query = query.arg_lazy(
10731            "id",
10732            Box::new(move || {
10733                let id = id.clone();
10734                Box::pin(async move { id.into_id().await.unwrap().quote() })
10735            }),
10736        );
10737        Changeset {
10738            proc: self.proc.clone(),
10739            selection: query,
10740            graphql_client: self.graphql_client.clone(),
10741        }
10742    }
10743    /// Load a Cloud from its ID.
10744    pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
10745        let mut query = self.selection.select("loadCloudFromID");
10746        query = query.arg_lazy(
10747            "id",
10748            Box::new(move || {
10749                let id = id.clone();
10750                Box::pin(async move { id.into_id().await.unwrap().quote() })
10751            }),
10752        );
10753        Cloud {
10754            proc: self.proc.clone(),
10755            selection: query,
10756            graphql_client: self.graphql_client.clone(),
10757        }
10758    }
10759    /// Load a Container from its ID.
10760    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
10761        let mut query = self.selection.select("loadContainerFromID");
10762        query = query.arg_lazy(
10763            "id",
10764            Box::new(move || {
10765                let id = id.clone();
10766                Box::pin(async move { id.into_id().await.unwrap().quote() })
10767            }),
10768        );
10769        Container {
10770            proc: self.proc.clone(),
10771            selection: query,
10772            graphql_client: self.graphql_client.clone(),
10773        }
10774    }
10775    /// Load a CurrentModule from its ID.
10776    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
10777        let mut query = self.selection.select("loadCurrentModuleFromID");
10778        query = query.arg_lazy(
10779            "id",
10780            Box::new(move || {
10781                let id = id.clone();
10782                Box::pin(async move { id.into_id().await.unwrap().quote() })
10783            }),
10784        );
10785        CurrentModule {
10786            proc: self.proc.clone(),
10787            selection: query,
10788            graphql_client: self.graphql_client.clone(),
10789        }
10790    }
10791    /// Load a Directory from its ID.
10792    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
10793        let mut query = self.selection.select("loadDirectoryFromID");
10794        query = query.arg_lazy(
10795            "id",
10796            Box::new(move || {
10797                let id = id.clone();
10798                Box::pin(async move { id.into_id().await.unwrap().quote() })
10799            }),
10800        );
10801        Directory {
10802            proc: self.proc.clone(),
10803            selection: query,
10804            graphql_client: self.graphql_client.clone(),
10805        }
10806    }
10807    /// Load a EngineCacheEntry from its ID.
10808    pub fn load_engine_cache_entry_from_id(
10809        &self,
10810        id: impl IntoID<EngineCacheEntryId>,
10811    ) -> EngineCacheEntry {
10812        let mut query = self.selection.select("loadEngineCacheEntryFromID");
10813        query = query.arg_lazy(
10814            "id",
10815            Box::new(move || {
10816                let id = id.clone();
10817                Box::pin(async move { id.into_id().await.unwrap().quote() })
10818            }),
10819        );
10820        EngineCacheEntry {
10821            proc: self.proc.clone(),
10822            selection: query,
10823            graphql_client: self.graphql_client.clone(),
10824        }
10825    }
10826    /// Load a EngineCacheEntrySet from its ID.
10827    pub fn load_engine_cache_entry_set_from_id(
10828        &self,
10829        id: impl IntoID<EngineCacheEntrySetId>,
10830    ) -> EngineCacheEntrySet {
10831        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
10832        query = query.arg_lazy(
10833            "id",
10834            Box::new(move || {
10835                let id = id.clone();
10836                Box::pin(async move { id.into_id().await.unwrap().quote() })
10837            }),
10838        );
10839        EngineCacheEntrySet {
10840            proc: self.proc.clone(),
10841            selection: query,
10842            graphql_client: self.graphql_client.clone(),
10843        }
10844    }
10845    /// Load a EngineCache from its ID.
10846    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
10847        let mut query = self.selection.select("loadEngineCacheFromID");
10848        query = query.arg_lazy(
10849            "id",
10850            Box::new(move || {
10851                let id = id.clone();
10852                Box::pin(async move { id.into_id().await.unwrap().quote() })
10853            }),
10854        );
10855        EngineCache {
10856            proc: self.proc.clone(),
10857            selection: query,
10858            graphql_client: self.graphql_client.clone(),
10859        }
10860    }
10861    /// Load a Engine from its ID.
10862    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
10863        let mut query = self.selection.select("loadEngineFromID");
10864        query = query.arg_lazy(
10865            "id",
10866            Box::new(move || {
10867                let id = id.clone();
10868                Box::pin(async move { id.into_id().await.unwrap().quote() })
10869            }),
10870        );
10871        Engine {
10872            proc: self.proc.clone(),
10873            selection: query,
10874            graphql_client: self.graphql_client.clone(),
10875        }
10876    }
10877    /// Load a EnumTypeDef from its ID.
10878    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
10879        let mut query = self.selection.select("loadEnumTypeDefFromID");
10880        query = query.arg_lazy(
10881            "id",
10882            Box::new(move || {
10883                let id = id.clone();
10884                Box::pin(async move { id.into_id().await.unwrap().quote() })
10885            }),
10886        );
10887        EnumTypeDef {
10888            proc: self.proc.clone(),
10889            selection: query,
10890            graphql_client: self.graphql_client.clone(),
10891        }
10892    }
10893    /// Load a EnumValueTypeDef from its ID.
10894    pub fn load_enum_value_type_def_from_id(
10895        &self,
10896        id: impl IntoID<EnumValueTypeDefId>,
10897    ) -> EnumValueTypeDef {
10898        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
10899        query = query.arg_lazy(
10900            "id",
10901            Box::new(move || {
10902                let id = id.clone();
10903                Box::pin(async move { id.into_id().await.unwrap().quote() })
10904            }),
10905        );
10906        EnumValueTypeDef {
10907            proc: self.proc.clone(),
10908            selection: query,
10909            graphql_client: self.graphql_client.clone(),
10910        }
10911    }
10912    /// Load a EnvFile from its ID.
10913    pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
10914        let mut query = self.selection.select("loadEnvFileFromID");
10915        query = query.arg_lazy(
10916            "id",
10917            Box::new(move || {
10918                let id = id.clone();
10919                Box::pin(async move { id.into_id().await.unwrap().quote() })
10920            }),
10921        );
10922        EnvFile {
10923            proc: self.proc.clone(),
10924            selection: query,
10925            graphql_client: self.graphql_client.clone(),
10926        }
10927    }
10928    /// Load a Env from its ID.
10929    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
10930        let mut query = self.selection.select("loadEnvFromID");
10931        query = query.arg_lazy(
10932            "id",
10933            Box::new(move || {
10934                let id = id.clone();
10935                Box::pin(async move { id.into_id().await.unwrap().quote() })
10936            }),
10937        );
10938        Env {
10939            proc: self.proc.clone(),
10940            selection: query,
10941            graphql_client: self.graphql_client.clone(),
10942        }
10943    }
10944    /// Load a EnvVariable from its ID.
10945    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
10946        let mut query = self.selection.select("loadEnvVariableFromID");
10947        query = query.arg_lazy(
10948            "id",
10949            Box::new(move || {
10950                let id = id.clone();
10951                Box::pin(async move { id.into_id().await.unwrap().quote() })
10952            }),
10953        );
10954        EnvVariable {
10955            proc: self.proc.clone(),
10956            selection: query,
10957            graphql_client: self.graphql_client.clone(),
10958        }
10959    }
10960    /// Load a Error from its ID.
10961    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
10962        let mut query = self.selection.select("loadErrorFromID");
10963        query = query.arg_lazy(
10964            "id",
10965            Box::new(move || {
10966                let id = id.clone();
10967                Box::pin(async move { id.into_id().await.unwrap().quote() })
10968            }),
10969        );
10970        Error {
10971            proc: self.proc.clone(),
10972            selection: query,
10973            graphql_client: self.graphql_client.clone(),
10974        }
10975    }
10976    /// Load a ErrorValue from its ID.
10977    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
10978        let mut query = self.selection.select("loadErrorValueFromID");
10979        query = query.arg_lazy(
10980            "id",
10981            Box::new(move || {
10982                let id = id.clone();
10983                Box::pin(async move { id.into_id().await.unwrap().quote() })
10984            }),
10985        );
10986        ErrorValue {
10987            proc: self.proc.clone(),
10988            selection: query,
10989            graphql_client: self.graphql_client.clone(),
10990        }
10991    }
10992    /// Load a FieldTypeDef from its ID.
10993    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
10994        let mut query = self.selection.select("loadFieldTypeDefFromID");
10995        query = query.arg_lazy(
10996            "id",
10997            Box::new(move || {
10998                let id = id.clone();
10999                Box::pin(async move { id.into_id().await.unwrap().quote() })
11000            }),
11001        );
11002        FieldTypeDef {
11003            proc: self.proc.clone(),
11004            selection: query,
11005            graphql_client: self.graphql_client.clone(),
11006        }
11007    }
11008    /// Load a File from its ID.
11009    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
11010        let mut query = self.selection.select("loadFileFromID");
11011        query = query.arg_lazy(
11012            "id",
11013            Box::new(move || {
11014                let id = id.clone();
11015                Box::pin(async move { id.into_id().await.unwrap().quote() })
11016            }),
11017        );
11018        File {
11019            proc: self.proc.clone(),
11020            selection: query,
11021            graphql_client: self.graphql_client.clone(),
11022        }
11023    }
11024    /// Load a FunctionArg from its ID.
11025    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
11026        let mut query = self.selection.select("loadFunctionArgFromID");
11027        query = query.arg_lazy(
11028            "id",
11029            Box::new(move || {
11030                let id = id.clone();
11031                Box::pin(async move { id.into_id().await.unwrap().quote() })
11032            }),
11033        );
11034        FunctionArg {
11035            proc: self.proc.clone(),
11036            selection: query,
11037            graphql_client: self.graphql_client.clone(),
11038        }
11039    }
11040    /// Load a FunctionCallArgValue from its ID.
11041    pub fn load_function_call_arg_value_from_id(
11042        &self,
11043        id: impl IntoID<FunctionCallArgValueId>,
11044    ) -> FunctionCallArgValue {
11045        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
11046        query = query.arg_lazy(
11047            "id",
11048            Box::new(move || {
11049                let id = id.clone();
11050                Box::pin(async move { id.into_id().await.unwrap().quote() })
11051            }),
11052        );
11053        FunctionCallArgValue {
11054            proc: self.proc.clone(),
11055            selection: query,
11056            graphql_client: self.graphql_client.clone(),
11057        }
11058    }
11059    /// Load a FunctionCall from its ID.
11060    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
11061        let mut query = self.selection.select("loadFunctionCallFromID");
11062        query = query.arg_lazy(
11063            "id",
11064            Box::new(move || {
11065                let id = id.clone();
11066                Box::pin(async move { id.into_id().await.unwrap().quote() })
11067            }),
11068        );
11069        FunctionCall {
11070            proc: self.proc.clone(),
11071            selection: query,
11072            graphql_client: self.graphql_client.clone(),
11073        }
11074    }
11075    /// Load a Function from its ID.
11076    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
11077        let mut query = self.selection.select("loadFunctionFromID");
11078        query = query.arg_lazy(
11079            "id",
11080            Box::new(move || {
11081                let id = id.clone();
11082                Box::pin(async move { id.into_id().await.unwrap().quote() })
11083            }),
11084        );
11085        Function {
11086            proc: self.proc.clone(),
11087            selection: query,
11088            graphql_client: self.graphql_client.clone(),
11089        }
11090    }
11091    /// Load a GeneratedCode from its ID.
11092    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
11093        let mut query = self.selection.select("loadGeneratedCodeFromID");
11094        query = query.arg_lazy(
11095            "id",
11096            Box::new(move || {
11097                let id = id.clone();
11098                Box::pin(async move { id.into_id().await.unwrap().quote() })
11099            }),
11100        );
11101        GeneratedCode {
11102            proc: self.proc.clone(),
11103            selection: query,
11104            graphql_client: self.graphql_client.clone(),
11105        }
11106    }
11107    /// Load a GitRef from its ID.
11108    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
11109        let mut query = self.selection.select("loadGitRefFromID");
11110        query = query.arg_lazy(
11111            "id",
11112            Box::new(move || {
11113                let id = id.clone();
11114                Box::pin(async move { id.into_id().await.unwrap().quote() })
11115            }),
11116        );
11117        GitRef {
11118            proc: self.proc.clone(),
11119            selection: query,
11120            graphql_client: self.graphql_client.clone(),
11121        }
11122    }
11123    /// Load a GitRepository from its ID.
11124    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
11125        let mut query = self.selection.select("loadGitRepositoryFromID");
11126        query = query.arg_lazy(
11127            "id",
11128            Box::new(move || {
11129                let id = id.clone();
11130                Box::pin(async move { id.into_id().await.unwrap().quote() })
11131            }),
11132        );
11133        GitRepository {
11134            proc: self.proc.clone(),
11135            selection: query,
11136            graphql_client: self.graphql_client.clone(),
11137        }
11138    }
11139    /// Load a Host from its ID.
11140    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
11141        let mut query = self.selection.select("loadHostFromID");
11142        query = query.arg_lazy(
11143            "id",
11144            Box::new(move || {
11145                let id = id.clone();
11146                Box::pin(async move { id.into_id().await.unwrap().quote() })
11147            }),
11148        );
11149        Host {
11150            proc: self.proc.clone(),
11151            selection: query,
11152            graphql_client: self.graphql_client.clone(),
11153        }
11154    }
11155    /// Load a InputTypeDef from its ID.
11156    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
11157        let mut query = self.selection.select("loadInputTypeDefFromID");
11158        query = query.arg_lazy(
11159            "id",
11160            Box::new(move || {
11161                let id = id.clone();
11162                Box::pin(async move { id.into_id().await.unwrap().quote() })
11163            }),
11164        );
11165        InputTypeDef {
11166            proc: self.proc.clone(),
11167            selection: query,
11168            graphql_client: self.graphql_client.clone(),
11169        }
11170    }
11171    /// Load a InterfaceTypeDef from its ID.
11172    pub fn load_interface_type_def_from_id(
11173        &self,
11174        id: impl IntoID<InterfaceTypeDefId>,
11175    ) -> InterfaceTypeDef {
11176        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
11177        query = query.arg_lazy(
11178            "id",
11179            Box::new(move || {
11180                let id = id.clone();
11181                Box::pin(async move { id.into_id().await.unwrap().quote() })
11182            }),
11183        );
11184        InterfaceTypeDef {
11185            proc: self.proc.clone(),
11186            selection: query,
11187            graphql_client: self.graphql_client.clone(),
11188        }
11189    }
11190    /// Load a JSONValue from its ID.
11191    pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
11192        let mut query = self.selection.select("loadJSONValueFromID");
11193        query = query.arg_lazy(
11194            "id",
11195            Box::new(move || {
11196                let id = id.clone();
11197                Box::pin(async move { id.into_id().await.unwrap().quote() })
11198            }),
11199        );
11200        JsonValue {
11201            proc: self.proc.clone(),
11202            selection: query,
11203            graphql_client: self.graphql_client.clone(),
11204        }
11205    }
11206    /// Load a LLM from its ID.
11207    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
11208        let mut query = self.selection.select("loadLLMFromID");
11209        query = query.arg_lazy(
11210            "id",
11211            Box::new(move || {
11212                let id = id.clone();
11213                Box::pin(async move { id.into_id().await.unwrap().quote() })
11214            }),
11215        );
11216        Llm {
11217            proc: self.proc.clone(),
11218            selection: query,
11219            graphql_client: self.graphql_client.clone(),
11220        }
11221    }
11222    /// Load a LLMTokenUsage from its ID.
11223    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
11224        let mut query = self.selection.select("loadLLMTokenUsageFromID");
11225        query = query.arg_lazy(
11226            "id",
11227            Box::new(move || {
11228                let id = id.clone();
11229                Box::pin(async move { id.into_id().await.unwrap().quote() })
11230            }),
11231        );
11232        LlmTokenUsage {
11233            proc: self.proc.clone(),
11234            selection: query,
11235            graphql_client: self.graphql_client.clone(),
11236        }
11237    }
11238    /// Load a Label from its ID.
11239    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
11240        let mut query = self.selection.select("loadLabelFromID");
11241        query = query.arg_lazy(
11242            "id",
11243            Box::new(move || {
11244                let id = id.clone();
11245                Box::pin(async move { id.into_id().await.unwrap().quote() })
11246            }),
11247        );
11248        Label {
11249            proc: self.proc.clone(),
11250            selection: query,
11251            graphql_client: self.graphql_client.clone(),
11252        }
11253    }
11254    /// Load a ListTypeDef from its ID.
11255    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
11256        let mut query = self.selection.select("loadListTypeDefFromID");
11257        query = query.arg_lazy(
11258            "id",
11259            Box::new(move || {
11260                let id = id.clone();
11261                Box::pin(async move { id.into_id().await.unwrap().quote() })
11262            }),
11263        );
11264        ListTypeDef {
11265            proc: self.proc.clone(),
11266            selection: query,
11267            graphql_client: self.graphql_client.clone(),
11268        }
11269    }
11270    /// Load a ModuleConfigClient from its ID.
11271    pub fn load_module_config_client_from_id(
11272        &self,
11273        id: impl IntoID<ModuleConfigClientId>,
11274    ) -> ModuleConfigClient {
11275        let mut query = self.selection.select("loadModuleConfigClientFromID");
11276        query = query.arg_lazy(
11277            "id",
11278            Box::new(move || {
11279                let id = id.clone();
11280                Box::pin(async move { id.into_id().await.unwrap().quote() })
11281            }),
11282        );
11283        ModuleConfigClient {
11284            proc: self.proc.clone(),
11285            selection: query,
11286            graphql_client: self.graphql_client.clone(),
11287        }
11288    }
11289    /// Load a Module from its ID.
11290    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
11291        let mut query = self.selection.select("loadModuleFromID");
11292        query = query.arg_lazy(
11293            "id",
11294            Box::new(move || {
11295                let id = id.clone();
11296                Box::pin(async move { id.into_id().await.unwrap().quote() })
11297            }),
11298        );
11299        Module {
11300            proc: self.proc.clone(),
11301            selection: query,
11302            graphql_client: self.graphql_client.clone(),
11303        }
11304    }
11305    /// Load a ModuleSource from its ID.
11306    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
11307        let mut query = self.selection.select("loadModuleSourceFromID");
11308        query = query.arg_lazy(
11309            "id",
11310            Box::new(move || {
11311                let id = id.clone();
11312                Box::pin(async move { id.into_id().await.unwrap().quote() })
11313            }),
11314        );
11315        ModuleSource {
11316            proc: self.proc.clone(),
11317            selection: query,
11318            graphql_client: self.graphql_client.clone(),
11319        }
11320    }
11321    /// Load a ObjectTypeDef from its ID.
11322    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
11323        let mut query = self.selection.select("loadObjectTypeDefFromID");
11324        query = query.arg_lazy(
11325            "id",
11326            Box::new(move || {
11327                let id = id.clone();
11328                Box::pin(async move { id.into_id().await.unwrap().quote() })
11329            }),
11330        );
11331        ObjectTypeDef {
11332            proc: self.proc.clone(),
11333            selection: query,
11334            graphql_client: self.graphql_client.clone(),
11335        }
11336    }
11337    /// Load a Port from its ID.
11338    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
11339        let mut query = self.selection.select("loadPortFromID");
11340        query = query.arg_lazy(
11341            "id",
11342            Box::new(move || {
11343                let id = id.clone();
11344                Box::pin(async move { id.into_id().await.unwrap().quote() })
11345            }),
11346        );
11347        Port {
11348            proc: self.proc.clone(),
11349            selection: query,
11350            graphql_client: self.graphql_client.clone(),
11351        }
11352    }
11353    /// Load a SDKConfig from its ID.
11354    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
11355        let mut query = self.selection.select("loadSDKConfigFromID");
11356        query = query.arg_lazy(
11357            "id",
11358            Box::new(move || {
11359                let id = id.clone();
11360                Box::pin(async move { id.into_id().await.unwrap().quote() })
11361            }),
11362        );
11363        SdkConfig {
11364            proc: self.proc.clone(),
11365            selection: query,
11366            graphql_client: self.graphql_client.clone(),
11367        }
11368    }
11369    /// Load a ScalarTypeDef from its ID.
11370    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
11371        let mut query = self.selection.select("loadScalarTypeDefFromID");
11372        query = query.arg_lazy(
11373            "id",
11374            Box::new(move || {
11375                let id = id.clone();
11376                Box::pin(async move { id.into_id().await.unwrap().quote() })
11377            }),
11378        );
11379        ScalarTypeDef {
11380            proc: self.proc.clone(),
11381            selection: query,
11382            graphql_client: self.graphql_client.clone(),
11383        }
11384    }
11385    /// Load a SearchResult from its ID.
11386    pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
11387        let mut query = self.selection.select("loadSearchResultFromID");
11388        query = query.arg_lazy(
11389            "id",
11390            Box::new(move || {
11391                let id = id.clone();
11392                Box::pin(async move { id.into_id().await.unwrap().quote() })
11393            }),
11394        );
11395        SearchResult {
11396            proc: self.proc.clone(),
11397            selection: query,
11398            graphql_client: self.graphql_client.clone(),
11399        }
11400    }
11401    /// Load a SearchSubmatch from its ID.
11402    pub fn load_search_submatch_from_id(
11403        &self,
11404        id: impl IntoID<SearchSubmatchId>,
11405    ) -> SearchSubmatch {
11406        let mut query = self.selection.select("loadSearchSubmatchFromID");
11407        query = query.arg_lazy(
11408            "id",
11409            Box::new(move || {
11410                let id = id.clone();
11411                Box::pin(async move { id.into_id().await.unwrap().quote() })
11412            }),
11413        );
11414        SearchSubmatch {
11415            proc: self.proc.clone(),
11416            selection: query,
11417            graphql_client: self.graphql_client.clone(),
11418        }
11419    }
11420    /// Load a Secret from its ID.
11421    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
11422        let mut query = self.selection.select("loadSecretFromID");
11423        query = query.arg_lazy(
11424            "id",
11425            Box::new(move || {
11426                let id = id.clone();
11427                Box::pin(async move { id.into_id().await.unwrap().quote() })
11428            }),
11429        );
11430        Secret {
11431            proc: self.proc.clone(),
11432            selection: query,
11433            graphql_client: self.graphql_client.clone(),
11434        }
11435    }
11436    /// Load a Service from its ID.
11437    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
11438        let mut query = self.selection.select("loadServiceFromID");
11439        query = query.arg_lazy(
11440            "id",
11441            Box::new(move || {
11442                let id = id.clone();
11443                Box::pin(async move { id.into_id().await.unwrap().quote() })
11444            }),
11445        );
11446        Service {
11447            proc: self.proc.clone(),
11448            selection: query,
11449            graphql_client: self.graphql_client.clone(),
11450        }
11451    }
11452    /// Load a Socket from its ID.
11453    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
11454        let mut query = self.selection.select("loadSocketFromID");
11455        query = query.arg_lazy(
11456            "id",
11457            Box::new(move || {
11458                let id = id.clone();
11459                Box::pin(async move { id.into_id().await.unwrap().quote() })
11460            }),
11461        );
11462        Socket {
11463            proc: self.proc.clone(),
11464            selection: query,
11465            graphql_client: self.graphql_client.clone(),
11466        }
11467    }
11468    /// Load a SourceMap from its ID.
11469    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
11470        let mut query = self.selection.select("loadSourceMapFromID");
11471        query = query.arg_lazy(
11472            "id",
11473            Box::new(move || {
11474                let id = id.clone();
11475                Box::pin(async move { id.into_id().await.unwrap().quote() })
11476            }),
11477        );
11478        SourceMap {
11479            proc: self.proc.clone(),
11480            selection: query,
11481            graphql_client: self.graphql_client.clone(),
11482        }
11483    }
11484    /// Load a Terminal from its ID.
11485    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
11486        let mut query = self.selection.select("loadTerminalFromID");
11487        query = query.arg_lazy(
11488            "id",
11489            Box::new(move || {
11490                let id = id.clone();
11491                Box::pin(async move { id.into_id().await.unwrap().quote() })
11492            }),
11493        );
11494        Terminal {
11495            proc: self.proc.clone(),
11496            selection: query,
11497            graphql_client: self.graphql_client.clone(),
11498        }
11499    }
11500    /// Load a TypeDef from its ID.
11501    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
11502        let mut query = self.selection.select("loadTypeDefFromID");
11503        query = query.arg_lazy(
11504            "id",
11505            Box::new(move || {
11506                let id = id.clone();
11507                Box::pin(async move { id.into_id().await.unwrap().quote() })
11508            }),
11509        );
11510        TypeDef {
11511            proc: self.proc.clone(),
11512            selection: query,
11513            graphql_client: self.graphql_client.clone(),
11514        }
11515    }
11516    /// Create a new module.
11517    pub fn module(&self) -> Module {
11518        let query = self.selection.select("module");
11519        Module {
11520            proc: self.proc.clone(),
11521            selection: query,
11522            graphql_client: self.graphql_client.clone(),
11523        }
11524    }
11525    /// Create a new module source instance from a source ref string
11526    ///
11527    /// # Arguments
11528    ///
11529    /// * `ref_string` - The string ref representation of the module source
11530    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11531    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
11532        let mut query = self.selection.select("moduleSource");
11533        query = query.arg("refString", ref_string.into());
11534        ModuleSource {
11535            proc: self.proc.clone(),
11536            selection: query,
11537            graphql_client: self.graphql_client.clone(),
11538        }
11539    }
11540    /// Create a new module source instance from a source ref string
11541    ///
11542    /// # Arguments
11543    ///
11544    /// * `ref_string` - The string ref representation of the module source
11545    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11546    pub fn module_source_opts<'a>(
11547        &self,
11548        ref_string: impl Into<String>,
11549        opts: QueryModuleSourceOpts<'a>,
11550    ) -> ModuleSource {
11551        let mut query = self.selection.select("moduleSource");
11552        query = query.arg("refString", ref_string.into());
11553        if let Some(ref_pin) = opts.ref_pin {
11554            query = query.arg("refPin", ref_pin);
11555        }
11556        if let Some(disable_find_up) = opts.disable_find_up {
11557            query = query.arg("disableFindUp", disable_find_up);
11558        }
11559        if let Some(allow_not_exists) = opts.allow_not_exists {
11560            query = query.arg("allowNotExists", allow_not_exists);
11561        }
11562        if let Some(require_kind) = opts.require_kind {
11563            query = query.arg("requireKind", require_kind);
11564        }
11565        ModuleSource {
11566            proc: self.proc.clone(),
11567            selection: query,
11568            graphql_client: self.graphql_client.clone(),
11569        }
11570    }
11571    /// Creates a new secret.
11572    ///
11573    /// # Arguments
11574    ///
11575    /// * `uri` - The URI of the secret store
11576    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11577    pub fn secret(&self, uri: impl Into<String>) -> Secret {
11578        let mut query = self.selection.select("secret");
11579        query = query.arg("uri", uri.into());
11580        Secret {
11581            proc: self.proc.clone(),
11582            selection: query,
11583            graphql_client: self.graphql_client.clone(),
11584        }
11585    }
11586    /// Creates a new secret.
11587    ///
11588    /// # Arguments
11589    ///
11590    /// * `uri` - The URI of the secret store
11591    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11592    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
11593        let mut query = self.selection.select("secret");
11594        query = query.arg("uri", uri.into());
11595        if let Some(cache_key) = opts.cache_key {
11596            query = query.arg("cacheKey", cache_key);
11597        }
11598        Secret {
11599            proc: self.proc.clone(),
11600            selection: query,
11601            graphql_client: self.graphql_client.clone(),
11602        }
11603    }
11604    /// Sets a secret given a user defined name to its plaintext and returns the secret.
11605    /// The plaintext value is limited to a size of 128000 bytes.
11606    ///
11607    /// # Arguments
11608    ///
11609    /// * `name` - The user defined name for this secret
11610    /// * `plaintext` - The plaintext of the secret
11611    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
11612        let mut query = self.selection.select("setSecret");
11613        query = query.arg("name", name.into());
11614        query = query.arg("plaintext", plaintext.into());
11615        Secret {
11616            proc: self.proc.clone(),
11617            selection: query,
11618            graphql_client: self.graphql_client.clone(),
11619        }
11620    }
11621    /// Creates source map metadata.
11622    ///
11623    /// # Arguments
11624    ///
11625    /// * `filename` - The filename from the module source.
11626    /// * `line` - The line number within the filename.
11627    /// * `column` - The column number within the line.
11628    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
11629        let mut query = self.selection.select("sourceMap");
11630        query = query.arg("filename", filename.into());
11631        query = query.arg("line", line);
11632        query = query.arg("column", column);
11633        SourceMap {
11634            proc: self.proc.clone(),
11635            selection: query,
11636            graphql_client: self.graphql_client.clone(),
11637        }
11638    }
11639    /// Create a new TypeDef.
11640    pub fn type_def(&self) -> TypeDef {
11641        let query = self.selection.select("typeDef");
11642        TypeDef {
11643            proc: self.proc.clone(),
11644            selection: query,
11645            graphql_client: self.graphql_client.clone(),
11646        }
11647    }
11648    /// Get the current Dagger Engine version.
11649    pub async fn version(&self) -> Result<String, DaggerError> {
11650        let query = self.selection.select("version");
11651        query.execute(self.graphql_client.clone()).await
11652    }
11653}
11654#[derive(Clone)]
11655pub struct SdkConfig {
11656    pub proc: Option<Arc<DaggerSessionProc>>,
11657    pub selection: Selection,
11658    pub graphql_client: DynGraphQLClient,
11659}
11660impl SdkConfig {
11661    /// A unique identifier for this SDKConfig.
11662    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
11663        let query = self.selection.select("id");
11664        query.execute(self.graphql_client.clone()).await
11665    }
11666    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
11667    pub async fn source(&self) -> Result<String, DaggerError> {
11668        let query = self.selection.select("source");
11669        query.execute(self.graphql_client.clone()).await
11670    }
11671}
11672#[derive(Clone)]
11673pub struct ScalarTypeDef {
11674    pub proc: Option<Arc<DaggerSessionProc>>,
11675    pub selection: Selection,
11676    pub graphql_client: DynGraphQLClient,
11677}
11678impl ScalarTypeDef {
11679    /// A doc string for the scalar, if any.
11680    pub async fn description(&self) -> Result<String, DaggerError> {
11681        let query = self.selection.select("description");
11682        query.execute(self.graphql_client.clone()).await
11683    }
11684    /// A unique identifier for this ScalarTypeDef.
11685    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
11686        let query = self.selection.select("id");
11687        query.execute(self.graphql_client.clone()).await
11688    }
11689    /// The name of the scalar.
11690    pub async fn name(&self) -> Result<String, DaggerError> {
11691        let query = self.selection.select("name");
11692        query.execute(self.graphql_client.clone()).await
11693    }
11694    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
11695    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
11696        let query = self.selection.select("sourceModuleName");
11697        query.execute(self.graphql_client.clone()).await
11698    }
11699}
11700#[derive(Clone)]
11701pub struct SearchResult {
11702    pub proc: Option<Arc<DaggerSessionProc>>,
11703    pub selection: Selection,
11704    pub graphql_client: DynGraphQLClient,
11705}
11706impl SearchResult {
11707    /// The byte offset of this line within the file.
11708    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
11709        let query = self.selection.select("absoluteOffset");
11710        query.execute(self.graphql_client.clone()).await
11711    }
11712    /// The path to the file that matched.
11713    pub async fn file_path(&self) -> Result<String, DaggerError> {
11714        let query = self.selection.select("filePath");
11715        query.execute(self.graphql_client.clone()).await
11716    }
11717    /// A unique identifier for this SearchResult.
11718    pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
11719        let query = self.selection.select("id");
11720        query.execute(self.graphql_client.clone()).await
11721    }
11722    /// The first line that matched.
11723    pub async fn line_number(&self) -> Result<isize, DaggerError> {
11724        let query = self.selection.select("lineNumber");
11725        query.execute(self.graphql_client.clone()).await
11726    }
11727    /// The line content that matched.
11728    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
11729        let query = self.selection.select("matchedLines");
11730        query.execute(self.graphql_client.clone()).await
11731    }
11732    /// Sub-match positions and content within the matched lines.
11733    pub fn submatches(&self) -> Vec<SearchSubmatch> {
11734        let query = self.selection.select("submatches");
11735        vec![SearchSubmatch {
11736            proc: self.proc.clone(),
11737            selection: query,
11738            graphql_client: self.graphql_client.clone(),
11739        }]
11740    }
11741}
11742#[derive(Clone)]
11743pub struct SearchSubmatch {
11744    pub proc: Option<Arc<DaggerSessionProc>>,
11745    pub selection: Selection,
11746    pub graphql_client: DynGraphQLClient,
11747}
11748impl SearchSubmatch {
11749    /// The match's end offset within the matched lines.
11750    pub async fn end(&self) -> Result<isize, DaggerError> {
11751        let query = self.selection.select("end");
11752        query.execute(self.graphql_client.clone()).await
11753    }
11754    /// A unique identifier for this SearchSubmatch.
11755    pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
11756        let query = self.selection.select("id");
11757        query.execute(self.graphql_client.clone()).await
11758    }
11759    /// The match's start offset within the matched lines.
11760    pub async fn start(&self) -> Result<isize, DaggerError> {
11761        let query = self.selection.select("start");
11762        query.execute(self.graphql_client.clone()).await
11763    }
11764    /// The matched text.
11765    pub async fn text(&self) -> Result<String, DaggerError> {
11766        let query = self.selection.select("text");
11767        query.execute(self.graphql_client.clone()).await
11768    }
11769}
11770#[derive(Clone)]
11771pub struct Secret {
11772    pub proc: Option<Arc<DaggerSessionProc>>,
11773    pub selection: Selection,
11774    pub graphql_client: DynGraphQLClient,
11775}
11776impl Secret {
11777    /// A unique identifier for this Secret.
11778    pub async fn id(&self) -> Result<SecretId, DaggerError> {
11779        let query = self.selection.select("id");
11780        query.execute(self.graphql_client.clone()).await
11781    }
11782    /// The name of this secret.
11783    pub async fn name(&self) -> Result<String, DaggerError> {
11784        let query = self.selection.select("name");
11785        query.execute(self.graphql_client.clone()).await
11786    }
11787    /// The value of this secret.
11788    pub async fn plaintext(&self) -> Result<String, DaggerError> {
11789        let query = self.selection.select("plaintext");
11790        query.execute(self.graphql_client.clone()).await
11791    }
11792    /// The URI of this secret.
11793    pub async fn uri(&self) -> Result<String, DaggerError> {
11794        let query = self.selection.select("uri");
11795        query.execute(self.graphql_client.clone()).await
11796    }
11797}
11798#[derive(Clone)]
11799pub struct Service {
11800    pub proc: Option<Arc<DaggerSessionProc>>,
11801    pub selection: Selection,
11802    pub graphql_client: DynGraphQLClient,
11803}
11804#[derive(Builder, Debug, PartialEq)]
11805pub struct ServiceEndpointOpts<'a> {
11806    /// The exposed port number for the endpoint
11807    #[builder(setter(into, strip_option), default)]
11808    pub port: Option<isize>,
11809    /// Return a URL with the given scheme, eg. http for http://
11810    #[builder(setter(into, strip_option), default)]
11811    pub scheme: Option<&'a str>,
11812}
11813#[derive(Builder, Debug, PartialEq)]
11814pub struct ServiceStopOpts {
11815    /// Immediately kill the service without waiting for a graceful exit
11816    #[builder(setter(into, strip_option), default)]
11817    pub kill: Option<bool>,
11818}
11819#[derive(Builder, Debug, PartialEq)]
11820pub struct ServiceTerminalOpts<'a> {
11821    #[builder(setter(into, strip_option), default)]
11822    pub cmd: Option<Vec<&'a str>>,
11823}
11824#[derive(Builder, Debug, PartialEq)]
11825pub struct ServiceUpOpts {
11826    /// List of frontend/backend port mappings to forward.
11827    /// Frontend is the port accepting traffic on the host, backend is the service port.
11828    #[builder(setter(into, strip_option), default)]
11829    pub ports: Option<Vec<PortForward>>,
11830    /// Bind each tunnel port to a random port on the host.
11831    #[builder(setter(into, strip_option), default)]
11832    pub random: Option<bool>,
11833}
11834impl Service {
11835    /// Retrieves an endpoint that clients can use to reach this container.
11836    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
11837    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
11838    ///
11839    /// # Arguments
11840    ///
11841    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11842    pub async fn endpoint(&self) -> Result<String, DaggerError> {
11843        let query = self.selection.select("endpoint");
11844        query.execute(self.graphql_client.clone()).await
11845    }
11846    /// Retrieves an endpoint that clients can use to reach this container.
11847    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
11848    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
11849    ///
11850    /// # Arguments
11851    ///
11852    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11853    pub async fn endpoint_opts<'a>(
11854        &self,
11855        opts: ServiceEndpointOpts<'a>,
11856    ) -> Result<String, DaggerError> {
11857        let mut query = self.selection.select("endpoint");
11858        if let Some(port) = opts.port {
11859            query = query.arg("port", port);
11860        }
11861        if let Some(scheme) = opts.scheme {
11862            query = query.arg("scheme", scheme);
11863        }
11864        query.execute(self.graphql_client.clone()).await
11865    }
11866    /// Retrieves a hostname which can be used by clients to reach this container.
11867    pub async fn hostname(&self) -> Result<String, DaggerError> {
11868        let query = self.selection.select("hostname");
11869        query.execute(self.graphql_client.clone()).await
11870    }
11871    /// A unique identifier for this Service.
11872    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
11873        let query = self.selection.select("id");
11874        query.execute(self.graphql_client.clone()).await
11875    }
11876    /// Retrieves the list of ports provided by the service.
11877    pub fn ports(&self) -> Vec<Port> {
11878        let query = self.selection.select("ports");
11879        vec![Port {
11880            proc: self.proc.clone(),
11881            selection: query,
11882            graphql_client: self.graphql_client.clone(),
11883        }]
11884    }
11885    /// Start the service and wait for its health checks to succeed.
11886    /// Services bound to a Container do not need to be manually started.
11887    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
11888        let query = self.selection.select("start");
11889        query.execute(self.graphql_client.clone()).await
11890    }
11891    /// Stop the service.
11892    ///
11893    /// # Arguments
11894    ///
11895    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11896    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
11897        let query = self.selection.select("stop");
11898        query.execute(self.graphql_client.clone()).await
11899    }
11900    /// Stop the service.
11901    ///
11902    /// # Arguments
11903    ///
11904    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11905    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
11906        let mut query = self.selection.select("stop");
11907        if let Some(kill) = opts.kill {
11908            query = query.arg("kill", kill);
11909        }
11910        query.execute(self.graphql_client.clone()).await
11911    }
11912    /// Forces evaluation of the pipeline in the engine.
11913    pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
11914        let query = self.selection.select("sync");
11915        query.execute(self.graphql_client.clone()).await
11916    }
11917    ///
11918    /// # Arguments
11919    ///
11920    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11921    pub fn terminal(&self) -> Service {
11922        let query = self.selection.select("terminal");
11923        Service {
11924            proc: self.proc.clone(),
11925            selection: query,
11926            graphql_client: self.graphql_client.clone(),
11927        }
11928    }
11929    ///
11930    /// # Arguments
11931    ///
11932    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11933    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
11934        let mut query = self.selection.select("terminal");
11935        if let Some(cmd) = opts.cmd {
11936            query = query.arg("cmd", cmd);
11937        }
11938        Service {
11939            proc: self.proc.clone(),
11940            selection: query,
11941            graphql_client: self.graphql_client.clone(),
11942        }
11943    }
11944    /// Creates a tunnel that forwards traffic from the caller's network to this service.
11945    ///
11946    /// # Arguments
11947    ///
11948    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11949    pub async fn up(&self) -> Result<Void, DaggerError> {
11950        let query = self.selection.select("up");
11951        query.execute(self.graphql_client.clone()).await
11952    }
11953    /// Creates a tunnel that forwards traffic from the caller's network to this service.
11954    ///
11955    /// # Arguments
11956    ///
11957    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11958    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
11959        let mut query = self.selection.select("up");
11960        if let Some(ports) = opts.ports {
11961            query = query.arg("ports", ports);
11962        }
11963        if let Some(random) = opts.random {
11964            query = query.arg("random", random);
11965        }
11966        query.execute(self.graphql_client.clone()).await
11967    }
11968    /// Configures a hostname which can be used by clients within the session to reach this container.
11969    ///
11970    /// # Arguments
11971    ///
11972    /// * `hostname` - The hostname to use.
11973    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
11974        let mut query = self.selection.select("withHostname");
11975        query = query.arg("hostname", hostname.into());
11976        Service {
11977            proc: self.proc.clone(),
11978            selection: query,
11979            graphql_client: self.graphql_client.clone(),
11980        }
11981    }
11982}
11983#[derive(Clone)]
11984pub struct Socket {
11985    pub proc: Option<Arc<DaggerSessionProc>>,
11986    pub selection: Selection,
11987    pub graphql_client: DynGraphQLClient,
11988}
11989impl Socket {
11990    /// A unique identifier for this Socket.
11991    pub async fn id(&self) -> Result<SocketId, DaggerError> {
11992        let query = self.selection.select("id");
11993        query.execute(self.graphql_client.clone()).await
11994    }
11995}
11996#[derive(Clone)]
11997pub struct SourceMap {
11998    pub proc: Option<Arc<DaggerSessionProc>>,
11999    pub selection: Selection,
12000    pub graphql_client: DynGraphQLClient,
12001}
12002impl SourceMap {
12003    /// The column number within the line.
12004    pub async fn column(&self) -> Result<isize, DaggerError> {
12005        let query = self.selection.select("column");
12006        query.execute(self.graphql_client.clone()).await
12007    }
12008    /// The filename from the module source.
12009    pub async fn filename(&self) -> Result<String, DaggerError> {
12010        let query = self.selection.select("filename");
12011        query.execute(self.graphql_client.clone()).await
12012    }
12013    /// A unique identifier for this SourceMap.
12014    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
12015        let query = self.selection.select("id");
12016        query.execute(self.graphql_client.clone()).await
12017    }
12018    /// The line number within the filename.
12019    pub async fn line(&self) -> Result<isize, DaggerError> {
12020        let query = self.selection.select("line");
12021        query.execute(self.graphql_client.clone()).await
12022    }
12023    /// The module dependency this was declared in.
12024    pub async fn module(&self) -> Result<String, DaggerError> {
12025        let query = self.selection.select("module");
12026        query.execute(self.graphql_client.clone()).await
12027    }
12028    /// The URL to the file, if any. This can be used to link to the source map in the browser.
12029    pub async fn url(&self) -> Result<String, DaggerError> {
12030        let query = self.selection.select("url");
12031        query.execute(self.graphql_client.clone()).await
12032    }
12033}
12034#[derive(Clone)]
12035pub struct Terminal {
12036    pub proc: Option<Arc<DaggerSessionProc>>,
12037    pub selection: Selection,
12038    pub graphql_client: DynGraphQLClient,
12039}
12040impl Terminal {
12041    /// A unique identifier for this Terminal.
12042    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
12043        let query = self.selection.select("id");
12044        query.execute(self.graphql_client.clone()).await
12045    }
12046    /// Forces evaluation of the pipeline in the engine.
12047    /// It doesn't run the default command if no exec has been set.
12048    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
12049        let query = self.selection.select("sync");
12050        query.execute(self.graphql_client.clone()).await
12051    }
12052}
12053#[derive(Clone)]
12054pub struct TypeDef {
12055    pub proc: Option<Arc<DaggerSessionProc>>,
12056    pub selection: Selection,
12057    pub graphql_client: DynGraphQLClient,
12058}
12059#[derive(Builder, Debug, PartialEq)]
12060pub struct TypeDefWithEnumOpts<'a> {
12061    /// A doc string for the enum, if any
12062    #[builder(setter(into, strip_option), default)]
12063    pub description: Option<&'a str>,
12064    /// The source map for the enum definition.
12065    #[builder(setter(into, strip_option), default)]
12066    pub source_map: Option<SourceMapId>,
12067}
12068#[derive(Builder, Debug, PartialEq)]
12069pub struct TypeDefWithEnumMemberOpts<'a> {
12070    /// A doc string for the member, if any
12071    #[builder(setter(into, strip_option), default)]
12072    pub description: Option<&'a str>,
12073    /// The source map for the enum member definition.
12074    #[builder(setter(into, strip_option), default)]
12075    pub source_map: Option<SourceMapId>,
12076    /// The value of the member in the enum
12077    #[builder(setter(into, strip_option), default)]
12078    pub value: Option<&'a str>,
12079}
12080#[derive(Builder, Debug, PartialEq)]
12081pub struct TypeDefWithEnumValueOpts<'a> {
12082    /// A doc string for the value, if any
12083    #[builder(setter(into, strip_option), default)]
12084    pub description: Option<&'a str>,
12085    /// The source map for the enum value definition.
12086    #[builder(setter(into, strip_option), default)]
12087    pub source_map: Option<SourceMapId>,
12088}
12089#[derive(Builder, Debug, PartialEq)]
12090pub struct TypeDefWithFieldOpts<'a> {
12091    /// A doc string for the field, if any
12092    #[builder(setter(into, strip_option), default)]
12093    pub description: Option<&'a str>,
12094    /// The source map for the field definition.
12095    #[builder(setter(into, strip_option), default)]
12096    pub source_map: Option<SourceMapId>,
12097}
12098#[derive(Builder, Debug, PartialEq)]
12099pub struct TypeDefWithInterfaceOpts<'a> {
12100    #[builder(setter(into, strip_option), default)]
12101    pub description: Option<&'a str>,
12102    #[builder(setter(into, strip_option), default)]
12103    pub source_map: Option<SourceMapId>,
12104}
12105#[derive(Builder, Debug, PartialEq)]
12106pub struct TypeDefWithObjectOpts<'a> {
12107    #[builder(setter(into, strip_option), default)]
12108    pub description: Option<&'a str>,
12109    #[builder(setter(into, strip_option), default)]
12110    pub source_map: Option<SourceMapId>,
12111}
12112#[derive(Builder, Debug, PartialEq)]
12113pub struct TypeDefWithScalarOpts<'a> {
12114    #[builder(setter(into, strip_option), default)]
12115    pub description: Option<&'a str>,
12116}
12117impl TypeDef {
12118    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
12119    pub fn as_enum(&self) -> EnumTypeDef {
12120        let query = self.selection.select("asEnum");
12121        EnumTypeDef {
12122            proc: self.proc.clone(),
12123            selection: query,
12124            graphql_client: self.graphql_client.clone(),
12125        }
12126    }
12127    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
12128    pub fn as_input(&self) -> InputTypeDef {
12129        let query = self.selection.select("asInput");
12130        InputTypeDef {
12131            proc: self.proc.clone(),
12132            selection: query,
12133            graphql_client: self.graphql_client.clone(),
12134        }
12135    }
12136    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
12137    pub fn as_interface(&self) -> InterfaceTypeDef {
12138        let query = self.selection.select("asInterface");
12139        InterfaceTypeDef {
12140            proc: self.proc.clone(),
12141            selection: query,
12142            graphql_client: self.graphql_client.clone(),
12143        }
12144    }
12145    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
12146    pub fn as_list(&self) -> ListTypeDef {
12147        let query = self.selection.select("asList");
12148        ListTypeDef {
12149            proc: self.proc.clone(),
12150            selection: query,
12151            graphql_client: self.graphql_client.clone(),
12152        }
12153    }
12154    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
12155    pub fn as_object(&self) -> ObjectTypeDef {
12156        let query = self.selection.select("asObject");
12157        ObjectTypeDef {
12158            proc: self.proc.clone(),
12159            selection: query,
12160            graphql_client: self.graphql_client.clone(),
12161        }
12162    }
12163    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
12164    pub fn as_scalar(&self) -> ScalarTypeDef {
12165        let query = self.selection.select("asScalar");
12166        ScalarTypeDef {
12167            proc: self.proc.clone(),
12168            selection: query,
12169            graphql_client: self.graphql_client.clone(),
12170        }
12171    }
12172    /// A unique identifier for this TypeDef.
12173    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
12174        let query = self.selection.select("id");
12175        query.execute(self.graphql_client.clone()).await
12176    }
12177    /// The kind of type this is (e.g. primitive, list, object).
12178    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
12179        let query = self.selection.select("kind");
12180        query.execute(self.graphql_client.clone()).await
12181    }
12182    /// Whether this type can be set to null. Defaults to false.
12183    pub async fn optional(&self) -> Result<bool, DaggerError> {
12184        let query = self.selection.select("optional");
12185        query.execute(self.graphql_client.clone()).await
12186    }
12187    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
12188    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
12189        let mut query = self.selection.select("withConstructor");
12190        query = query.arg_lazy(
12191            "function",
12192            Box::new(move || {
12193                let function = function.clone();
12194                Box::pin(async move { function.into_id().await.unwrap().quote() })
12195            }),
12196        );
12197        TypeDef {
12198            proc: self.proc.clone(),
12199            selection: query,
12200            graphql_client: self.graphql_client.clone(),
12201        }
12202    }
12203    /// Returns a TypeDef of kind Enum with the provided name.
12204    /// 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.
12205    ///
12206    /// # Arguments
12207    ///
12208    /// * `name` - The name of the enum
12209    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12210    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
12211        let mut query = self.selection.select("withEnum");
12212        query = query.arg("name", name.into());
12213        TypeDef {
12214            proc: self.proc.clone(),
12215            selection: query,
12216            graphql_client: self.graphql_client.clone(),
12217        }
12218    }
12219    /// Returns a TypeDef of kind Enum with the provided name.
12220    /// 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.
12221    ///
12222    /// # Arguments
12223    ///
12224    /// * `name` - The name of the enum
12225    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12226    pub fn with_enum_opts<'a>(
12227        &self,
12228        name: impl Into<String>,
12229        opts: TypeDefWithEnumOpts<'a>,
12230    ) -> TypeDef {
12231        let mut query = self.selection.select("withEnum");
12232        query = query.arg("name", name.into());
12233        if let Some(description) = opts.description {
12234            query = query.arg("description", description);
12235        }
12236        if let Some(source_map) = opts.source_map {
12237            query = query.arg("sourceMap", source_map);
12238        }
12239        TypeDef {
12240            proc: self.proc.clone(),
12241            selection: query,
12242            graphql_client: self.graphql_client.clone(),
12243        }
12244    }
12245    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
12246    ///
12247    /// # Arguments
12248    ///
12249    /// * `name` - The name of the member in the enum
12250    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12251    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
12252        let mut query = self.selection.select("withEnumMember");
12253        query = query.arg("name", name.into());
12254        TypeDef {
12255            proc: self.proc.clone(),
12256            selection: query,
12257            graphql_client: self.graphql_client.clone(),
12258        }
12259    }
12260    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
12261    ///
12262    /// # Arguments
12263    ///
12264    /// * `name` - The name of the member in the enum
12265    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12266    pub fn with_enum_member_opts<'a>(
12267        &self,
12268        name: impl Into<String>,
12269        opts: TypeDefWithEnumMemberOpts<'a>,
12270    ) -> TypeDef {
12271        let mut query = self.selection.select("withEnumMember");
12272        query = query.arg("name", name.into());
12273        if let Some(value) = opts.value {
12274            query = query.arg("value", value);
12275        }
12276        if let Some(description) = opts.description {
12277            query = query.arg("description", description);
12278        }
12279        if let Some(source_map) = opts.source_map {
12280            query = query.arg("sourceMap", source_map);
12281        }
12282        TypeDef {
12283            proc: self.proc.clone(),
12284            selection: query,
12285            graphql_client: self.graphql_client.clone(),
12286        }
12287    }
12288    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
12289    ///
12290    /// # Arguments
12291    ///
12292    /// * `value` - The name of the value in the enum
12293    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12294    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
12295        let mut query = self.selection.select("withEnumValue");
12296        query = query.arg("value", value.into());
12297        TypeDef {
12298            proc: self.proc.clone(),
12299            selection: query,
12300            graphql_client: self.graphql_client.clone(),
12301        }
12302    }
12303    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
12304    ///
12305    /// # Arguments
12306    ///
12307    /// * `value` - The name of the value in the enum
12308    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12309    pub fn with_enum_value_opts<'a>(
12310        &self,
12311        value: impl Into<String>,
12312        opts: TypeDefWithEnumValueOpts<'a>,
12313    ) -> TypeDef {
12314        let mut query = self.selection.select("withEnumValue");
12315        query = query.arg("value", value.into());
12316        if let Some(description) = opts.description {
12317            query = query.arg("description", description);
12318        }
12319        if let Some(source_map) = opts.source_map {
12320            query = query.arg("sourceMap", source_map);
12321        }
12322        TypeDef {
12323            proc: self.proc.clone(),
12324            selection: query,
12325            graphql_client: self.graphql_client.clone(),
12326        }
12327    }
12328    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
12329    ///
12330    /// # Arguments
12331    ///
12332    /// * `name` - The name of the field in the object
12333    /// * `type_def` - The type of the field
12334    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12335    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
12336        let mut query = self.selection.select("withField");
12337        query = query.arg("name", name.into());
12338        query = query.arg_lazy(
12339            "typeDef",
12340            Box::new(move || {
12341                let type_def = type_def.clone();
12342                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
12343            }),
12344        );
12345        TypeDef {
12346            proc: self.proc.clone(),
12347            selection: query,
12348            graphql_client: self.graphql_client.clone(),
12349        }
12350    }
12351    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
12352    ///
12353    /// # Arguments
12354    ///
12355    /// * `name` - The name of the field in the object
12356    /// * `type_def` - The type of the field
12357    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12358    pub fn with_field_opts<'a>(
12359        &self,
12360        name: impl Into<String>,
12361        type_def: impl IntoID<TypeDefId>,
12362        opts: TypeDefWithFieldOpts<'a>,
12363    ) -> TypeDef {
12364        let mut query = self.selection.select("withField");
12365        query = query.arg("name", name.into());
12366        query = query.arg_lazy(
12367            "typeDef",
12368            Box::new(move || {
12369                let type_def = type_def.clone();
12370                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
12371            }),
12372        );
12373        if let Some(description) = opts.description {
12374            query = query.arg("description", description);
12375        }
12376        if let Some(source_map) = opts.source_map {
12377            query = query.arg("sourceMap", source_map);
12378        }
12379        TypeDef {
12380            proc: self.proc.clone(),
12381            selection: query,
12382            graphql_client: self.graphql_client.clone(),
12383        }
12384    }
12385    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
12386    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
12387        let mut query = self.selection.select("withFunction");
12388        query = query.arg_lazy(
12389            "function",
12390            Box::new(move || {
12391                let function = function.clone();
12392                Box::pin(async move { function.into_id().await.unwrap().quote() })
12393            }),
12394        );
12395        TypeDef {
12396            proc: self.proc.clone(),
12397            selection: query,
12398            graphql_client: self.graphql_client.clone(),
12399        }
12400    }
12401    /// Returns a TypeDef of kind Interface with the provided name.
12402    ///
12403    /// # Arguments
12404    ///
12405    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12406    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
12407        let mut query = self.selection.select("withInterface");
12408        query = query.arg("name", name.into());
12409        TypeDef {
12410            proc: self.proc.clone(),
12411            selection: query,
12412            graphql_client: self.graphql_client.clone(),
12413        }
12414    }
12415    /// Returns a TypeDef of kind Interface with the provided name.
12416    ///
12417    /// # Arguments
12418    ///
12419    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12420    pub fn with_interface_opts<'a>(
12421        &self,
12422        name: impl Into<String>,
12423        opts: TypeDefWithInterfaceOpts<'a>,
12424    ) -> TypeDef {
12425        let mut query = self.selection.select("withInterface");
12426        query = query.arg("name", name.into());
12427        if let Some(description) = opts.description {
12428            query = query.arg("description", description);
12429        }
12430        if let Some(source_map) = opts.source_map {
12431            query = query.arg("sourceMap", source_map);
12432        }
12433        TypeDef {
12434            proc: self.proc.clone(),
12435            selection: query,
12436            graphql_client: self.graphql_client.clone(),
12437        }
12438    }
12439    /// Sets the kind of the type.
12440    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
12441        let mut query = self.selection.select("withKind");
12442        query = query.arg("kind", kind);
12443        TypeDef {
12444            proc: self.proc.clone(),
12445            selection: query,
12446            graphql_client: self.graphql_client.clone(),
12447        }
12448    }
12449    /// Returns a TypeDef of kind List with the provided type for its elements.
12450    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
12451        let mut query = self.selection.select("withListOf");
12452        query = query.arg_lazy(
12453            "elementType",
12454            Box::new(move || {
12455                let element_type = element_type.clone();
12456                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
12457            }),
12458        );
12459        TypeDef {
12460            proc: self.proc.clone(),
12461            selection: query,
12462            graphql_client: self.graphql_client.clone(),
12463        }
12464    }
12465    /// Returns a TypeDef of kind Object with the provided name.
12466    /// 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.
12467    ///
12468    /// # Arguments
12469    ///
12470    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12471    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
12472        let mut query = self.selection.select("withObject");
12473        query = query.arg("name", name.into());
12474        TypeDef {
12475            proc: self.proc.clone(),
12476            selection: query,
12477            graphql_client: self.graphql_client.clone(),
12478        }
12479    }
12480    /// Returns a TypeDef of kind Object with the provided name.
12481    /// 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.
12482    ///
12483    /// # Arguments
12484    ///
12485    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12486    pub fn with_object_opts<'a>(
12487        &self,
12488        name: impl Into<String>,
12489        opts: TypeDefWithObjectOpts<'a>,
12490    ) -> TypeDef {
12491        let mut query = self.selection.select("withObject");
12492        query = query.arg("name", name.into());
12493        if let Some(description) = opts.description {
12494            query = query.arg("description", description);
12495        }
12496        if let Some(source_map) = opts.source_map {
12497            query = query.arg("sourceMap", source_map);
12498        }
12499        TypeDef {
12500            proc: self.proc.clone(),
12501            selection: query,
12502            graphql_client: self.graphql_client.clone(),
12503        }
12504    }
12505    /// Sets whether this type can be set to null.
12506    pub fn with_optional(&self, optional: bool) -> TypeDef {
12507        let mut query = self.selection.select("withOptional");
12508        query = query.arg("optional", optional);
12509        TypeDef {
12510            proc: self.proc.clone(),
12511            selection: query,
12512            graphql_client: self.graphql_client.clone(),
12513        }
12514    }
12515    /// Returns a TypeDef of kind Scalar with the provided name.
12516    ///
12517    /// # Arguments
12518    ///
12519    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12520    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
12521        let mut query = self.selection.select("withScalar");
12522        query = query.arg("name", name.into());
12523        TypeDef {
12524            proc: self.proc.clone(),
12525            selection: query,
12526            graphql_client: self.graphql_client.clone(),
12527        }
12528    }
12529    /// Returns a TypeDef of kind Scalar with the provided name.
12530    ///
12531    /// # Arguments
12532    ///
12533    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12534    pub fn with_scalar_opts<'a>(
12535        &self,
12536        name: impl Into<String>,
12537        opts: TypeDefWithScalarOpts<'a>,
12538    ) -> TypeDef {
12539        let mut query = self.selection.select("withScalar");
12540        query = query.arg("name", name.into());
12541        if let Some(description) = opts.description {
12542            query = query.arg("description", description);
12543        }
12544        TypeDef {
12545            proc: self.proc.clone(),
12546            selection: query,
12547            graphql_client: self.graphql_client.clone(),
12548        }
12549    }
12550}
12551#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12552pub enum CacheSharingMode {
12553    #[serde(rename = "LOCKED")]
12554    Locked,
12555    #[serde(rename = "PRIVATE")]
12556    Private,
12557    #[serde(rename = "SHARED")]
12558    Shared,
12559}
12560#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12561pub enum ExistsType {
12562    #[serde(rename = "DIRECTORY_TYPE")]
12563    DirectoryType,
12564    #[serde(rename = "REGULAR_TYPE")]
12565    RegularType,
12566    #[serde(rename = "SYMLINK_TYPE")]
12567    SymlinkType,
12568}
12569#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12570pub enum ImageLayerCompression {
12571    #[serde(rename = "EStarGZ")]
12572    EStarGz,
12573    #[serde(rename = "ESTARGZ")]
12574    Estargz,
12575    #[serde(rename = "Gzip")]
12576    Gzip,
12577    #[serde(rename = "Uncompressed")]
12578    Uncompressed,
12579    #[serde(rename = "Zstd")]
12580    Zstd,
12581}
12582#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12583pub enum ImageMediaTypes {
12584    #[serde(rename = "DOCKER")]
12585    Docker,
12586    #[serde(rename = "DockerMediaTypes")]
12587    DockerMediaTypes,
12588    #[serde(rename = "OCI")]
12589    Oci,
12590    #[serde(rename = "OCIMediaTypes")]
12591    OciMediaTypes,
12592}
12593#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12594pub enum ModuleSourceKind {
12595    #[serde(rename = "DIR")]
12596    Dir,
12597    #[serde(rename = "DIR_SOURCE")]
12598    DirSource,
12599    #[serde(rename = "GIT")]
12600    Git,
12601    #[serde(rename = "GIT_SOURCE")]
12602    GitSource,
12603    #[serde(rename = "LOCAL")]
12604    Local,
12605    #[serde(rename = "LOCAL_SOURCE")]
12606    LocalSource,
12607}
12608#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12609pub enum NetworkProtocol {
12610    #[serde(rename = "TCP")]
12611    Tcp,
12612    #[serde(rename = "UDP")]
12613    Udp,
12614}
12615#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12616pub enum ReturnType {
12617    #[serde(rename = "ANY")]
12618    Any,
12619    #[serde(rename = "FAILURE")]
12620    Failure,
12621    #[serde(rename = "SUCCESS")]
12622    Success,
12623}
12624#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12625pub enum TypeDefKind {
12626    #[serde(rename = "BOOLEAN")]
12627    Boolean,
12628    #[serde(rename = "BOOLEAN_KIND")]
12629    BooleanKind,
12630    #[serde(rename = "ENUM")]
12631    Enum,
12632    #[serde(rename = "ENUM_KIND")]
12633    EnumKind,
12634    #[serde(rename = "FLOAT")]
12635    Float,
12636    #[serde(rename = "FLOAT_KIND")]
12637    FloatKind,
12638    #[serde(rename = "INPUT")]
12639    Input,
12640    #[serde(rename = "INPUT_KIND")]
12641    InputKind,
12642    #[serde(rename = "INTEGER")]
12643    Integer,
12644    #[serde(rename = "INTEGER_KIND")]
12645    IntegerKind,
12646    #[serde(rename = "INTERFACE")]
12647    Interface,
12648    #[serde(rename = "INTERFACE_KIND")]
12649    InterfaceKind,
12650    #[serde(rename = "LIST")]
12651    List,
12652    #[serde(rename = "LIST_KIND")]
12653    ListKind,
12654    #[serde(rename = "OBJECT")]
12655    Object,
12656    #[serde(rename = "OBJECT_KIND")]
12657    ObjectKind,
12658    #[serde(rename = "SCALAR")]
12659    Scalar,
12660    #[serde(rename = "SCALAR_KIND")]
12661    ScalarKind,
12662    #[serde(rename = "STRING")]
12663    String,
12664    #[serde(rename = "STRING_KIND")]
12665    StringKind,
12666    #[serde(rename = "VOID")]
12667    Void,
12668    #[serde(rename = "VOID_KIND")]
12669    VoidKind,
12670}