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    /// Retrieves the module with the given description
9531    ///
9532    /// # Arguments
9533    ///
9534    /// * `description` - The description to set
9535    pub fn with_description(&self, description: impl Into<String>) -> Module {
9536        let mut query = self.selection.select("withDescription");
9537        query = query.arg("description", description.into());
9538        Module {
9539            proc: self.proc.clone(),
9540            selection: query,
9541            graphql_client: self.graphql_client.clone(),
9542        }
9543    }
9544    /// This module plus the given Enum type and associated values
9545    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
9546        let mut query = self.selection.select("withEnum");
9547        query = query.arg_lazy(
9548            "enum",
9549            Box::new(move || {
9550                let r#enum = r#enum.clone();
9551                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
9552            }),
9553        );
9554        Module {
9555            proc: self.proc.clone(),
9556            selection: query,
9557            graphql_client: self.graphql_client.clone(),
9558        }
9559    }
9560    /// This module plus the given Interface type and associated functions
9561    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
9562        let mut query = self.selection.select("withInterface");
9563        query = query.arg_lazy(
9564            "iface",
9565            Box::new(move || {
9566                let iface = iface.clone();
9567                Box::pin(async move { iface.into_id().await.unwrap().quote() })
9568            }),
9569        );
9570        Module {
9571            proc: self.proc.clone(),
9572            selection: query,
9573            graphql_client: self.graphql_client.clone(),
9574        }
9575    }
9576    /// This module plus the given Object type and associated functions.
9577    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
9578        let mut query = self.selection.select("withObject");
9579        query = query.arg_lazy(
9580            "object",
9581            Box::new(move || {
9582                let object = object.clone();
9583                Box::pin(async move { object.into_id().await.unwrap().quote() })
9584            }),
9585        );
9586        Module {
9587            proc: self.proc.clone(),
9588            selection: query,
9589            graphql_client: self.graphql_client.clone(),
9590        }
9591    }
9592}
9593#[derive(Clone)]
9594pub struct ModuleConfigClient {
9595    pub proc: Option<Arc<DaggerSessionProc>>,
9596    pub selection: Selection,
9597    pub graphql_client: DynGraphQLClient,
9598}
9599impl ModuleConfigClient {
9600    /// The directory the client is generated in.
9601    pub async fn directory(&self) -> Result<String, DaggerError> {
9602        let query = self.selection.select("directory");
9603        query.execute(self.graphql_client.clone()).await
9604    }
9605    /// The generator to use
9606    pub async fn generator(&self) -> Result<String, DaggerError> {
9607        let query = self.selection.select("generator");
9608        query.execute(self.graphql_client.clone()).await
9609    }
9610    /// A unique identifier for this ModuleConfigClient.
9611    pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
9612        let query = self.selection.select("id");
9613        query.execute(self.graphql_client.clone()).await
9614    }
9615}
9616#[derive(Clone)]
9617pub struct ModuleSource {
9618    pub proc: Option<Arc<DaggerSessionProc>>,
9619    pub selection: Selection,
9620    pub graphql_client: DynGraphQLClient,
9621}
9622impl ModuleSource {
9623    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
9624    pub fn as_module(&self) -> Module {
9625        let query = self.selection.select("asModule");
9626        Module {
9627            proc: self.proc.clone(),
9628            selection: query,
9629            graphql_client: self.graphql_client.clone(),
9630        }
9631    }
9632    /// A human readable ref string representation of this module source.
9633    pub async fn as_string(&self) -> Result<String, DaggerError> {
9634        let query = self.selection.select("asString");
9635        query.execute(self.graphql_client.clone()).await
9636    }
9637    /// The blueprint referenced by the module source.
9638    pub fn blueprint(&self) -> ModuleSource {
9639        let query = self.selection.select("blueprint");
9640        ModuleSource {
9641            proc: self.proc.clone(),
9642            selection: query,
9643            graphql_client: self.graphql_client.clone(),
9644        }
9645    }
9646    /// The ref to clone the root of the git repo from. Only valid for git sources.
9647    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
9648        let query = self.selection.select("cloneRef");
9649        query.execute(self.graphql_client.clone()).await
9650    }
9651    /// The resolved commit of the git repo this source points to.
9652    pub async fn commit(&self) -> Result<String, DaggerError> {
9653        let query = self.selection.select("commit");
9654        query.execute(self.graphql_client.clone()).await
9655    }
9656    /// The clients generated for the module.
9657    pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
9658        let query = self.selection.select("configClients");
9659        vec![ModuleConfigClient {
9660            proc: self.proc.clone(),
9661            selection: query,
9662            graphql_client: self.graphql_client.clone(),
9663        }]
9664    }
9665    /// Whether an existing dagger.json for the module was found.
9666    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
9667        let query = self.selection.select("configExists");
9668        query.execute(self.graphql_client.clone()).await
9669    }
9670    /// The full directory loaded for the module source, including the source code as a subdirectory.
9671    pub fn context_directory(&self) -> Directory {
9672        let query = self.selection.select("contextDirectory");
9673        Directory {
9674            proc: self.proc.clone(),
9675            selection: query,
9676            graphql_client: self.graphql_client.clone(),
9677        }
9678    }
9679    /// The dependencies of the module source.
9680    pub fn dependencies(&self) -> Vec<ModuleSource> {
9681        let query = self.selection.select("dependencies");
9682        vec![ModuleSource {
9683            proc: self.proc.clone(),
9684            selection: query,
9685            graphql_client: self.graphql_client.clone(),
9686        }]
9687    }
9688    /// 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.
9689    pub async fn digest(&self) -> Result<String, DaggerError> {
9690        let query = self.selection.select("digest");
9691        query.execute(self.graphql_client.clone()).await
9692    }
9693    /// The directory containing the module configuration and source code (source code may be in a subdir).
9694    ///
9695    /// # Arguments
9696    ///
9697    /// * `path` - A subpath from the source directory to select.
9698    pub fn directory(&self, path: impl Into<String>) -> Directory {
9699        let mut query = self.selection.select("directory");
9700        query = query.arg("path", path.into());
9701        Directory {
9702            proc: self.proc.clone(),
9703            selection: query,
9704            graphql_client: self.graphql_client.clone(),
9705        }
9706    }
9707    /// The engine version of the module.
9708    pub async fn engine_version(&self) -> Result<String, DaggerError> {
9709        let query = self.selection.select("engineVersion");
9710        query.execute(self.graphql_client.clone()).await
9711    }
9712    /// The generated files and directories made on top of the module source's context directory.
9713    pub fn generated_context_directory(&self) -> Directory {
9714        let query = self.selection.select("generatedContextDirectory");
9715        Directory {
9716            proc: self.proc.clone(),
9717            selection: query,
9718            graphql_client: self.graphql_client.clone(),
9719        }
9720    }
9721    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
9722    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
9723        let query = self.selection.select("htmlRepoURL");
9724        query.execute(self.graphql_client.clone()).await
9725    }
9726    /// The URL to the source's git repo in a web browser. Only valid for git sources.
9727    pub async fn html_url(&self) -> Result<String, DaggerError> {
9728        let query = self.selection.select("htmlURL");
9729        query.execute(self.graphql_client.clone()).await
9730    }
9731    /// A unique identifier for this ModuleSource.
9732    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
9733        let query = self.selection.select("id");
9734        query.execute(self.graphql_client.clone()).await
9735    }
9736    /// The kind of module source (currently local, git or dir).
9737    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
9738        let query = self.selection.select("kind");
9739        query.execute(self.graphql_client.clone()).await
9740    }
9741    /// 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.
9742    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
9743        let query = self.selection.select("localContextDirectoryPath");
9744        query.execute(self.graphql_client.clone()).await
9745    }
9746    /// The name of the module, including any setting via the withName API.
9747    pub async fn module_name(&self) -> Result<String, DaggerError> {
9748        let query = self.selection.select("moduleName");
9749        query.execute(self.graphql_client.clone()).await
9750    }
9751    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
9752    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
9753        let query = self.selection.select("moduleOriginalName");
9754        query.execute(self.graphql_client.clone()).await
9755    }
9756    /// The original subpath used when instantiating this module source, relative to the context directory.
9757    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
9758        let query = self.selection.select("originalSubpath");
9759        query.execute(self.graphql_client.clone()).await
9760    }
9761    /// The pinned version of this module source.
9762    pub async fn pin(&self) -> Result<String, DaggerError> {
9763        let query = self.selection.select("pin");
9764        query.execute(self.graphql_client.clone()).await
9765    }
9766    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
9767    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
9768        let query = self.selection.select("repoRootPath");
9769        query.execute(self.graphql_client.clone()).await
9770    }
9771    /// The SDK configuration of the module.
9772    pub fn sdk(&self) -> SdkConfig {
9773        let query = self.selection.select("sdk");
9774        SdkConfig {
9775            proc: self.proc.clone(),
9776            selection: query,
9777            graphql_client: self.graphql_client.clone(),
9778        }
9779    }
9780    /// The path, relative to the context directory, that contains the module's dagger.json.
9781    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
9782        let query = self.selection.select("sourceRootSubpath");
9783        query.execute(self.graphql_client.clone()).await
9784    }
9785    /// The path to the directory containing the module's source code, relative to the context directory.
9786    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
9787        let query = self.selection.select("sourceSubpath");
9788        query.execute(self.graphql_client.clone()).await
9789    }
9790    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
9791    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
9792        let query = self.selection.select("sync");
9793        query.execute(self.graphql_client.clone()).await
9794    }
9795    /// The specified version of the git repo this source points to.
9796    pub async fn version(&self) -> Result<String, DaggerError> {
9797        let query = self.selection.select("version");
9798        query.execute(self.graphql_client.clone()).await
9799    }
9800    /// Set a blueprint for the module source.
9801    ///
9802    /// # Arguments
9803    ///
9804    /// * `blueprint` - The blueprint module to set.
9805    pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
9806        let mut query = self.selection.select("withBlueprint");
9807        query = query.arg_lazy(
9808            "blueprint",
9809            Box::new(move || {
9810                let blueprint = blueprint.clone();
9811                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
9812            }),
9813        );
9814        ModuleSource {
9815            proc: self.proc.clone(),
9816            selection: query,
9817            graphql_client: self.graphql_client.clone(),
9818        }
9819    }
9820    /// Update the module source with a new client to generate.
9821    ///
9822    /// # Arguments
9823    ///
9824    /// * `generator` - The generator to use
9825    /// * `output_dir` - The output directory for the generated client.
9826    pub fn with_client(
9827        &self,
9828        generator: impl Into<String>,
9829        output_dir: impl Into<String>,
9830    ) -> ModuleSource {
9831        let mut query = self.selection.select("withClient");
9832        query = query.arg("generator", generator.into());
9833        query = query.arg("outputDir", output_dir.into());
9834        ModuleSource {
9835            proc: self.proc.clone(),
9836            selection: query,
9837            graphql_client: self.graphql_client.clone(),
9838        }
9839    }
9840    /// Append the provided dependencies to the module source's dependency list.
9841    ///
9842    /// # Arguments
9843    ///
9844    /// * `dependencies` - The dependencies to append.
9845    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
9846        let mut query = self.selection.select("withDependencies");
9847        query = query.arg("dependencies", dependencies);
9848        ModuleSource {
9849            proc: self.proc.clone(),
9850            selection: query,
9851            graphql_client: self.graphql_client.clone(),
9852        }
9853    }
9854    /// Upgrade the engine version of the module to the given value.
9855    ///
9856    /// # Arguments
9857    ///
9858    /// * `version` - The engine version to upgrade to.
9859    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
9860        let mut query = self.selection.select("withEngineVersion");
9861        query = query.arg("version", version.into());
9862        ModuleSource {
9863            proc: self.proc.clone(),
9864            selection: query,
9865            graphql_client: self.graphql_client.clone(),
9866        }
9867    }
9868    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
9869    ///
9870    /// # Arguments
9871    ///
9872    /// * `patterns` - The new additional include patterns.
9873    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
9874        let mut query = self.selection.select("withIncludes");
9875        query = query.arg(
9876            "patterns",
9877            patterns
9878                .into_iter()
9879                .map(|i| i.into())
9880                .collect::<Vec<String>>(),
9881        );
9882        ModuleSource {
9883            proc: self.proc.clone(),
9884            selection: query,
9885            graphql_client: self.graphql_client.clone(),
9886        }
9887    }
9888    /// Update the module source with a new name.
9889    ///
9890    /// # Arguments
9891    ///
9892    /// * `name` - The name to set.
9893    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
9894        let mut query = self.selection.select("withName");
9895        query = query.arg("name", name.into());
9896        ModuleSource {
9897            proc: self.proc.clone(),
9898            selection: query,
9899            graphql_client: self.graphql_client.clone(),
9900        }
9901    }
9902    /// Update the module source with a new SDK.
9903    ///
9904    /// # Arguments
9905    ///
9906    /// * `source` - The SDK source to set.
9907    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
9908        let mut query = self.selection.select("withSDK");
9909        query = query.arg("source", source.into());
9910        ModuleSource {
9911            proc: self.proc.clone(),
9912            selection: query,
9913            graphql_client: self.graphql_client.clone(),
9914        }
9915    }
9916    /// Update the module source with a new source subpath.
9917    ///
9918    /// # Arguments
9919    ///
9920    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
9921    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
9922        let mut query = self.selection.select("withSourceSubpath");
9923        query = query.arg("path", path.into());
9924        ModuleSource {
9925            proc: self.proc.clone(),
9926            selection: query,
9927            graphql_client: self.graphql_client.clone(),
9928        }
9929    }
9930    /// Update the blueprint module to the latest version.
9931    pub fn with_update_blueprint(&self) -> ModuleSource {
9932        let query = self.selection.select("withUpdateBlueprint");
9933        ModuleSource {
9934            proc: self.proc.clone(),
9935            selection: query,
9936            graphql_client: self.graphql_client.clone(),
9937        }
9938    }
9939    /// Update one or more module dependencies.
9940    ///
9941    /// # Arguments
9942    ///
9943    /// * `dependencies` - The dependencies to update.
9944    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
9945        let mut query = self.selection.select("withUpdateDependencies");
9946        query = query.arg(
9947            "dependencies",
9948            dependencies
9949                .into_iter()
9950                .map(|i| i.into())
9951                .collect::<Vec<String>>(),
9952        );
9953        ModuleSource {
9954            proc: self.proc.clone(),
9955            selection: query,
9956            graphql_client: self.graphql_client.clone(),
9957        }
9958    }
9959    /// Update one or more clients.
9960    ///
9961    /// # Arguments
9962    ///
9963    /// * `clients` - The clients to update
9964    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
9965        let mut query = self.selection.select("withUpdatedClients");
9966        query = query.arg(
9967            "clients",
9968            clients
9969                .into_iter()
9970                .map(|i| i.into())
9971                .collect::<Vec<String>>(),
9972        );
9973        ModuleSource {
9974            proc: self.proc.clone(),
9975            selection: query,
9976            graphql_client: self.graphql_client.clone(),
9977        }
9978    }
9979    /// Remove the current blueprint from the module source.
9980    pub fn without_blueprint(&self) -> ModuleSource {
9981        let query = self.selection.select("withoutBlueprint");
9982        ModuleSource {
9983            proc: self.proc.clone(),
9984            selection: query,
9985            graphql_client: self.graphql_client.clone(),
9986        }
9987    }
9988    /// Remove a client from the module source.
9989    ///
9990    /// # Arguments
9991    ///
9992    /// * `path` - The path of the client to remove.
9993    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
9994        let mut query = self.selection.select("withoutClient");
9995        query = query.arg("path", path.into());
9996        ModuleSource {
9997            proc: self.proc.clone(),
9998            selection: query,
9999            graphql_client: self.graphql_client.clone(),
10000        }
10001    }
10002    /// Remove the provided dependencies from the module source's dependency list.
10003    ///
10004    /// # Arguments
10005    ///
10006    /// * `dependencies` - The dependencies to remove.
10007    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
10008        let mut query = self.selection.select("withoutDependencies");
10009        query = query.arg(
10010            "dependencies",
10011            dependencies
10012                .into_iter()
10013                .map(|i| i.into())
10014                .collect::<Vec<String>>(),
10015        );
10016        ModuleSource {
10017            proc: self.proc.clone(),
10018            selection: query,
10019            graphql_client: self.graphql_client.clone(),
10020        }
10021    }
10022}
10023#[derive(Clone)]
10024pub struct ObjectTypeDef {
10025    pub proc: Option<Arc<DaggerSessionProc>>,
10026    pub selection: Selection,
10027    pub graphql_client: DynGraphQLClient,
10028}
10029impl ObjectTypeDef {
10030    /// The function used to construct new instances of this object, if any
10031    pub fn constructor(&self) -> Function {
10032        let query = self.selection.select("constructor");
10033        Function {
10034            proc: self.proc.clone(),
10035            selection: query,
10036            graphql_client: self.graphql_client.clone(),
10037        }
10038    }
10039    /// The doc string for the object, if any.
10040    pub async fn description(&self) -> Result<String, DaggerError> {
10041        let query = self.selection.select("description");
10042        query.execute(self.graphql_client.clone()).await
10043    }
10044    /// Static fields defined on this object, if any.
10045    pub fn fields(&self) -> Vec<FieldTypeDef> {
10046        let query = self.selection.select("fields");
10047        vec![FieldTypeDef {
10048            proc: self.proc.clone(),
10049            selection: query,
10050            graphql_client: self.graphql_client.clone(),
10051        }]
10052    }
10053    /// Functions defined on this object, if any.
10054    pub fn functions(&self) -> Vec<Function> {
10055        let query = self.selection.select("functions");
10056        vec![Function {
10057            proc: self.proc.clone(),
10058            selection: query,
10059            graphql_client: self.graphql_client.clone(),
10060        }]
10061    }
10062    /// A unique identifier for this ObjectTypeDef.
10063    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
10064        let query = self.selection.select("id");
10065        query.execute(self.graphql_client.clone()).await
10066    }
10067    /// The name of the object.
10068    pub async fn name(&self) -> Result<String, DaggerError> {
10069        let query = self.selection.select("name");
10070        query.execute(self.graphql_client.clone()).await
10071    }
10072    /// The location of this object declaration.
10073    pub fn source_map(&self) -> SourceMap {
10074        let query = self.selection.select("sourceMap");
10075        SourceMap {
10076            proc: self.proc.clone(),
10077            selection: query,
10078            graphql_client: self.graphql_client.clone(),
10079        }
10080    }
10081    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
10082    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10083        let query = self.selection.select("sourceModuleName");
10084        query.execute(self.graphql_client.clone()).await
10085    }
10086}
10087#[derive(Clone)]
10088pub struct Port {
10089    pub proc: Option<Arc<DaggerSessionProc>>,
10090    pub selection: Selection,
10091    pub graphql_client: DynGraphQLClient,
10092}
10093impl Port {
10094    /// The port description.
10095    pub async fn description(&self) -> Result<String, DaggerError> {
10096        let query = self.selection.select("description");
10097        query.execute(self.graphql_client.clone()).await
10098    }
10099    /// Skip the health check when run as a service.
10100    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
10101        let query = self.selection.select("experimentalSkipHealthcheck");
10102        query.execute(self.graphql_client.clone()).await
10103    }
10104    /// A unique identifier for this Port.
10105    pub async fn id(&self) -> Result<PortId, DaggerError> {
10106        let query = self.selection.select("id");
10107        query.execute(self.graphql_client.clone()).await
10108    }
10109    /// The port number.
10110    pub async fn port(&self) -> Result<isize, DaggerError> {
10111        let query = self.selection.select("port");
10112        query.execute(self.graphql_client.clone()).await
10113    }
10114    /// The transport layer protocol.
10115    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
10116        let query = self.selection.select("protocol");
10117        query.execute(self.graphql_client.clone()).await
10118    }
10119}
10120#[derive(Clone)]
10121pub struct Query {
10122    pub proc: Option<Arc<DaggerSessionProc>>,
10123    pub selection: Selection,
10124    pub graphql_client: DynGraphQLClient,
10125}
10126#[derive(Builder, Debug, PartialEq)]
10127pub struct QueryContainerOpts {
10128    /// Platform to initialize the container with. Defaults to the native platform of the current engine
10129    #[builder(setter(into, strip_option), default)]
10130    pub platform: Option<Platform>,
10131}
10132#[derive(Builder, Debug, PartialEq)]
10133pub struct QueryEnvOpts {
10134    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
10135    #[builder(setter(into, strip_option), default)]
10136    pub privileged: Option<bool>,
10137    /// Allow new outputs to be declared and saved in the environment
10138    #[builder(setter(into, strip_option), default)]
10139    pub writable: Option<bool>,
10140}
10141#[derive(Builder, Debug, PartialEq)]
10142pub struct QueryEnvFileOpts {
10143    /// Replace "${VAR}" or "$VAR" with the value of other vars
10144    #[builder(setter(into, strip_option), default)]
10145    pub expand: Option<bool>,
10146}
10147#[derive(Builder, Debug, PartialEq)]
10148pub struct QueryFileOpts {
10149    /// Permissions of the new file. Example: 0600
10150    #[builder(setter(into, strip_option), default)]
10151    pub permissions: Option<isize>,
10152}
10153#[derive(Builder, Debug, PartialEq)]
10154pub struct QueryGitOpts<'a> {
10155    /// A service which must be started before the repo is fetched.
10156    #[builder(setter(into, strip_option), default)]
10157    pub experimental_service_host: Option<ServiceId>,
10158    /// Secret used to populate the Authorization HTTP header
10159    #[builder(setter(into, strip_option), default)]
10160    pub http_auth_header: Option<SecretId>,
10161    /// Secret used to populate the password during basic HTTP Authorization
10162    #[builder(setter(into, strip_option), default)]
10163    pub http_auth_token: Option<SecretId>,
10164    /// Username used to populate the password during basic HTTP Authorization
10165    #[builder(setter(into, strip_option), default)]
10166    pub http_auth_username: Option<&'a str>,
10167    /// DEPRECATED: Set to true to keep .git directory.
10168    #[builder(setter(into, strip_option), default)]
10169    pub keep_git_dir: Option<bool>,
10170    /// Set SSH auth socket
10171    #[builder(setter(into, strip_option), default)]
10172    pub ssh_auth_socket: Option<SocketId>,
10173    /// Set SSH known hosts
10174    #[builder(setter(into, strip_option), default)]
10175    pub ssh_known_hosts: Option<&'a str>,
10176}
10177#[derive(Builder, Debug, PartialEq)]
10178pub struct QueryHttpOpts<'a> {
10179    /// Secret used to populate the Authorization HTTP header
10180    #[builder(setter(into, strip_option), default)]
10181    pub auth_header: Option<SecretId>,
10182    /// A service which must be started before the URL is fetched.
10183    #[builder(setter(into, strip_option), default)]
10184    pub experimental_service_host: Option<ServiceId>,
10185    /// File name to use for the file. Defaults to the last part of the URL.
10186    #[builder(setter(into, strip_option), default)]
10187    pub name: Option<&'a str>,
10188    /// Permissions to set on the file.
10189    #[builder(setter(into, strip_option), default)]
10190    pub permissions: Option<isize>,
10191}
10192#[derive(Builder, Debug, PartialEq)]
10193pub struct QueryLlmOpts<'a> {
10194    /// Cap the number of API calls for this LLM
10195    #[builder(setter(into, strip_option), default)]
10196    pub max_api_calls: Option<isize>,
10197    /// Model to use
10198    #[builder(setter(into, strip_option), default)]
10199    pub model: Option<&'a str>,
10200}
10201#[derive(Builder, Debug, PartialEq)]
10202pub struct QueryModuleSourceOpts<'a> {
10203    /// 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.
10204    #[builder(setter(into, strip_option), default)]
10205    pub allow_not_exists: Option<bool>,
10206    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
10207    #[builder(setter(into, strip_option), default)]
10208    pub disable_find_up: Option<bool>,
10209    /// The pinned version of the module source
10210    #[builder(setter(into, strip_option), default)]
10211    pub ref_pin: Option<&'a str>,
10212    /// If set, error out if the ref string is not of the provided requireKind.
10213    #[builder(setter(into, strip_option), default)]
10214    pub require_kind: Option<ModuleSourceKind>,
10215}
10216#[derive(Builder, Debug, PartialEq)]
10217pub struct QuerySecretOpts<'a> {
10218    /// 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.
10219    /// 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.
10220    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
10221    #[builder(setter(into, strip_option), default)]
10222    pub cache_key: Option<&'a str>,
10223}
10224impl Query {
10225    /// initialize an address to load directories, containers, secrets or other object types.
10226    pub fn address(&self, value: impl Into<String>) -> Address {
10227        let mut query = self.selection.select("address");
10228        query = query.arg("value", value.into());
10229        Address {
10230            proc: self.proc.clone(),
10231            selection: query,
10232            graphql_client: self.graphql_client.clone(),
10233        }
10234    }
10235    /// Constructs a cache volume for a given cache key.
10236    ///
10237    /// # Arguments
10238    ///
10239    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
10240    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
10241        let mut query = self.selection.select("cacheVolume");
10242        query = query.arg("key", key.into());
10243        CacheVolume {
10244            proc: self.proc.clone(),
10245            selection: query,
10246            graphql_client: self.graphql_client.clone(),
10247        }
10248    }
10249    /// Dagger Cloud configuration and state
10250    pub fn cloud(&self) -> Cloud {
10251        let query = self.selection.select("cloud");
10252        Cloud {
10253            proc: self.proc.clone(),
10254            selection: query,
10255            graphql_client: self.graphql_client.clone(),
10256        }
10257    }
10258    /// Creates a scratch container, with no image or metadata.
10259    /// To pull an image, follow up with the "from" function.
10260    ///
10261    /// # Arguments
10262    ///
10263    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10264    pub fn container(&self) -> Container {
10265        let query = self.selection.select("container");
10266        Container {
10267            proc: self.proc.clone(),
10268            selection: query,
10269            graphql_client: self.graphql_client.clone(),
10270        }
10271    }
10272    /// Creates a scratch container, with no image or metadata.
10273    /// To pull an image, follow up with the "from" function.
10274    ///
10275    /// # Arguments
10276    ///
10277    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10278    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
10279        let mut query = self.selection.select("container");
10280        if let Some(platform) = opts.platform {
10281            query = query.arg("platform", platform);
10282        }
10283        Container {
10284            proc: self.proc.clone(),
10285            selection: query,
10286            graphql_client: self.graphql_client.clone(),
10287        }
10288    }
10289    /// Returns the current environment
10290    /// 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.
10291    /// 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.
10292    pub fn current_env(&self) -> Env {
10293        let query = self.selection.select("currentEnv");
10294        Env {
10295            proc: self.proc.clone(),
10296            selection: query,
10297            graphql_client: self.graphql_client.clone(),
10298        }
10299    }
10300    /// The FunctionCall context that the SDK caller is currently executing in.
10301    /// If the caller is not currently executing in a function, this will return an error.
10302    pub fn current_function_call(&self) -> FunctionCall {
10303        let query = self.selection.select("currentFunctionCall");
10304        FunctionCall {
10305            proc: self.proc.clone(),
10306            selection: query,
10307            graphql_client: self.graphql_client.clone(),
10308        }
10309    }
10310    /// The module currently being served in the session, if any.
10311    pub fn current_module(&self) -> CurrentModule {
10312        let query = self.selection.select("currentModule");
10313        CurrentModule {
10314            proc: self.proc.clone(),
10315            selection: query,
10316            graphql_client: self.graphql_client.clone(),
10317        }
10318    }
10319    /// The TypeDef representations of the objects currently being served in the session.
10320    pub fn current_type_defs(&self) -> Vec<TypeDef> {
10321        let query = self.selection.select("currentTypeDefs");
10322        vec![TypeDef {
10323            proc: self.proc.clone(),
10324            selection: query,
10325            graphql_client: self.graphql_client.clone(),
10326        }]
10327    }
10328    /// The default platform of the engine.
10329    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
10330        let query = self.selection.select("defaultPlatform");
10331        query.execute(self.graphql_client.clone()).await
10332    }
10333    /// Creates an empty directory.
10334    pub fn directory(&self) -> Directory {
10335        let query = self.selection.select("directory");
10336        Directory {
10337            proc: self.proc.clone(),
10338            selection: query,
10339            graphql_client: self.graphql_client.clone(),
10340        }
10341    }
10342    /// The Dagger engine container configuration and state
10343    pub fn engine(&self) -> Engine {
10344        let query = self.selection.select("engine");
10345        Engine {
10346            proc: self.proc.clone(),
10347            selection: query,
10348            graphql_client: self.graphql_client.clone(),
10349        }
10350    }
10351    /// Initializes a new environment
10352    ///
10353    /// # Arguments
10354    ///
10355    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10356    pub fn env(&self) -> Env {
10357        let query = self.selection.select("env");
10358        Env {
10359            proc: self.proc.clone(),
10360            selection: query,
10361            graphql_client: self.graphql_client.clone(),
10362        }
10363    }
10364    /// Initializes a new environment
10365    ///
10366    /// # Arguments
10367    ///
10368    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10369    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
10370        let mut query = self.selection.select("env");
10371        if let Some(privileged) = opts.privileged {
10372            query = query.arg("privileged", privileged);
10373        }
10374        if let Some(writable) = opts.writable {
10375            query = query.arg("writable", writable);
10376        }
10377        Env {
10378            proc: self.proc.clone(),
10379            selection: query,
10380            graphql_client: self.graphql_client.clone(),
10381        }
10382    }
10383    /// Initialize an environment file
10384    ///
10385    /// # Arguments
10386    ///
10387    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10388    pub fn env_file(&self) -> EnvFile {
10389        let query = self.selection.select("envFile");
10390        EnvFile {
10391            proc: self.proc.clone(),
10392            selection: query,
10393            graphql_client: self.graphql_client.clone(),
10394        }
10395    }
10396    /// Initialize an environment file
10397    ///
10398    /// # Arguments
10399    ///
10400    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10401    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
10402        let mut query = self.selection.select("envFile");
10403        if let Some(expand) = opts.expand {
10404            query = query.arg("expand", expand);
10405        }
10406        EnvFile {
10407            proc: self.proc.clone(),
10408            selection: query,
10409            graphql_client: self.graphql_client.clone(),
10410        }
10411    }
10412    /// Create a new error.
10413    ///
10414    /// # Arguments
10415    ///
10416    /// * `message` - A brief description of the error.
10417    pub fn error(&self, message: impl Into<String>) -> Error {
10418        let mut query = self.selection.select("error");
10419        query = query.arg("message", message.into());
10420        Error {
10421            proc: self.proc.clone(),
10422            selection: query,
10423            graphql_client: self.graphql_client.clone(),
10424        }
10425    }
10426    /// Creates a file with the specified contents.
10427    ///
10428    /// # Arguments
10429    ///
10430    /// * `name` - Name of the new file. Example: "foo.txt"
10431    /// * `contents` - Contents of the new file. Example: "Hello world!"
10432    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10433    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
10434        let mut query = self.selection.select("file");
10435        query = query.arg("name", name.into());
10436        query = query.arg("contents", contents.into());
10437        File {
10438            proc: self.proc.clone(),
10439            selection: query,
10440            graphql_client: self.graphql_client.clone(),
10441        }
10442    }
10443    /// Creates a file with the specified contents.
10444    ///
10445    /// # Arguments
10446    ///
10447    /// * `name` - Name of the new file. Example: "foo.txt"
10448    /// * `contents` - Contents of the new file. Example: "Hello world!"
10449    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10450    pub fn file_opts(
10451        &self,
10452        name: impl Into<String>,
10453        contents: impl Into<String>,
10454        opts: QueryFileOpts,
10455    ) -> File {
10456        let mut query = self.selection.select("file");
10457        query = query.arg("name", name.into());
10458        query = query.arg("contents", contents.into());
10459        if let Some(permissions) = opts.permissions {
10460            query = query.arg("permissions", permissions);
10461        }
10462        File {
10463            proc: self.proc.clone(),
10464            selection: query,
10465            graphql_client: self.graphql_client.clone(),
10466        }
10467    }
10468    /// Creates a function.
10469    ///
10470    /// # Arguments
10471    ///
10472    /// * `name` - Name of the function, in its original format from the implementation language.
10473    /// * `return_type` - Return type of the function.
10474    pub fn function(
10475        &self,
10476        name: impl Into<String>,
10477        return_type: impl IntoID<TypeDefId>,
10478    ) -> Function {
10479        let mut query = self.selection.select("function");
10480        query = query.arg("name", name.into());
10481        query = query.arg_lazy(
10482            "returnType",
10483            Box::new(move || {
10484                let return_type = return_type.clone();
10485                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
10486            }),
10487        );
10488        Function {
10489            proc: self.proc.clone(),
10490            selection: query,
10491            graphql_client: self.graphql_client.clone(),
10492        }
10493    }
10494    /// Create a code generation result, given a directory containing the generated code.
10495    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
10496        let mut query = self.selection.select("generatedCode");
10497        query = query.arg_lazy(
10498            "code",
10499            Box::new(move || {
10500                let code = code.clone();
10501                Box::pin(async move { code.into_id().await.unwrap().quote() })
10502            }),
10503        );
10504        GeneratedCode {
10505            proc: self.proc.clone(),
10506            selection: query,
10507            graphql_client: self.graphql_client.clone(),
10508        }
10509    }
10510    /// Queries a Git repository.
10511    ///
10512    /// # Arguments
10513    ///
10514    /// * `url` - URL of the git repository.
10515    ///
10516    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
10517    ///
10518    /// Suffix ".git" is optional.
10519    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10520    pub fn git(&self, url: impl Into<String>) -> GitRepository {
10521        let mut query = self.selection.select("git");
10522        query = query.arg("url", url.into());
10523        GitRepository {
10524            proc: self.proc.clone(),
10525            selection: query,
10526            graphql_client: self.graphql_client.clone(),
10527        }
10528    }
10529    /// Queries a Git repository.
10530    ///
10531    /// # Arguments
10532    ///
10533    /// * `url` - URL of the git repository.
10534    ///
10535    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
10536    ///
10537    /// Suffix ".git" is optional.
10538    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10539    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
10540        let mut query = self.selection.select("git");
10541        query = query.arg("url", url.into());
10542        if let Some(keep_git_dir) = opts.keep_git_dir {
10543            query = query.arg("keepGitDir", keep_git_dir);
10544        }
10545        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
10546            query = query.arg("sshKnownHosts", ssh_known_hosts);
10547        }
10548        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
10549            query = query.arg("sshAuthSocket", ssh_auth_socket);
10550        }
10551        if let Some(http_auth_username) = opts.http_auth_username {
10552            query = query.arg("httpAuthUsername", http_auth_username);
10553        }
10554        if let Some(http_auth_token) = opts.http_auth_token {
10555            query = query.arg("httpAuthToken", http_auth_token);
10556        }
10557        if let Some(http_auth_header) = opts.http_auth_header {
10558            query = query.arg("httpAuthHeader", http_auth_header);
10559        }
10560        if let Some(experimental_service_host) = opts.experimental_service_host {
10561            query = query.arg("experimentalServiceHost", experimental_service_host);
10562        }
10563        GitRepository {
10564            proc: self.proc.clone(),
10565            selection: query,
10566            graphql_client: self.graphql_client.clone(),
10567        }
10568    }
10569    /// Queries the host environment.
10570    pub fn host(&self) -> Host {
10571        let query = self.selection.select("host");
10572        Host {
10573            proc: self.proc.clone(),
10574            selection: query,
10575            graphql_client: self.graphql_client.clone(),
10576        }
10577    }
10578    /// Returns a file containing an http remote url content.
10579    ///
10580    /// # Arguments
10581    ///
10582    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
10583    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10584    pub fn http(&self, url: impl Into<String>) -> File {
10585        let mut query = self.selection.select("http");
10586        query = query.arg("url", url.into());
10587        File {
10588            proc: self.proc.clone(),
10589            selection: query,
10590            graphql_client: self.graphql_client.clone(),
10591        }
10592    }
10593    /// Returns a file containing an http remote url content.
10594    ///
10595    /// # Arguments
10596    ///
10597    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
10598    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10599    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
10600        let mut query = self.selection.select("http");
10601        query = query.arg("url", url.into());
10602        if let Some(name) = opts.name {
10603            query = query.arg("name", name);
10604        }
10605        if let Some(permissions) = opts.permissions {
10606            query = query.arg("permissions", permissions);
10607        }
10608        if let Some(auth_header) = opts.auth_header {
10609            query = query.arg("authHeader", auth_header);
10610        }
10611        if let Some(experimental_service_host) = opts.experimental_service_host {
10612            query = query.arg("experimentalServiceHost", experimental_service_host);
10613        }
10614        File {
10615            proc: self.proc.clone(),
10616            selection: query,
10617            graphql_client: self.graphql_client.clone(),
10618        }
10619    }
10620    /// Initialize a JSON value
10621    pub fn json(&self) -> JsonValue {
10622        let query = self.selection.select("json");
10623        JsonValue {
10624            proc: self.proc.clone(),
10625            selection: query,
10626            graphql_client: self.graphql_client.clone(),
10627        }
10628    }
10629    /// Initialize a Large Language Model (LLM)
10630    ///
10631    /// # Arguments
10632    ///
10633    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10634    pub fn llm(&self) -> Llm {
10635        let query = self.selection.select("llm");
10636        Llm {
10637            proc: self.proc.clone(),
10638            selection: query,
10639            graphql_client: self.graphql_client.clone(),
10640        }
10641    }
10642    /// Initialize a Large Language Model (LLM)
10643    ///
10644    /// # Arguments
10645    ///
10646    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10647    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
10648        let mut query = self.selection.select("llm");
10649        if let Some(model) = opts.model {
10650            query = query.arg("model", model);
10651        }
10652        if let Some(max_api_calls) = opts.max_api_calls {
10653            query = query.arg("maxAPICalls", max_api_calls);
10654        }
10655        Llm {
10656            proc: self.proc.clone(),
10657            selection: query,
10658            graphql_client: self.graphql_client.clone(),
10659        }
10660    }
10661    /// Load a Address from its ID.
10662    pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
10663        let mut query = self.selection.select("loadAddressFromID");
10664        query = query.arg_lazy(
10665            "id",
10666            Box::new(move || {
10667                let id = id.clone();
10668                Box::pin(async move { id.into_id().await.unwrap().quote() })
10669            }),
10670        );
10671        Address {
10672            proc: self.proc.clone(),
10673            selection: query,
10674            graphql_client: self.graphql_client.clone(),
10675        }
10676    }
10677    /// Load a Binding from its ID.
10678    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
10679        let mut query = self.selection.select("loadBindingFromID");
10680        query = query.arg_lazy(
10681            "id",
10682            Box::new(move || {
10683                let id = id.clone();
10684                Box::pin(async move { id.into_id().await.unwrap().quote() })
10685            }),
10686        );
10687        Binding {
10688            proc: self.proc.clone(),
10689            selection: query,
10690            graphql_client: self.graphql_client.clone(),
10691        }
10692    }
10693    /// Load a CacheVolume from its ID.
10694    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
10695        let mut query = self.selection.select("loadCacheVolumeFromID");
10696        query = query.arg_lazy(
10697            "id",
10698            Box::new(move || {
10699                let id = id.clone();
10700                Box::pin(async move { id.into_id().await.unwrap().quote() })
10701            }),
10702        );
10703        CacheVolume {
10704            proc: self.proc.clone(),
10705            selection: query,
10706            graphql_client: self.graphql_client.clone(),
10707        }
10708    }
10709    /// Load a Changeset from its ID.
10710    pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
10711        let mut query = self.selection.select("loadChangesetFromID");
10712        query = query.arg_lazy(
10713            "id",
10714            Box::new(move || {
10715                let id = id.clone();
10716                Box::pin(async move { id.into_id().await.unwrap().quote() })
10717            }),
10718        );
10719        Changeset {
10720            proc: self.proc.clone(),
10721            selection: query,
10722            graphql_client: self.graphql_client.clone(),
10723        }
10724    }
10725    /// Load a Cloud from its ID.
10726    pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
10727        let mut query = self.selection.select("loadCloudFromID");
10728        query = query.arg_lazy(
10729            "id",
10730            Box::new(move || {
10731                let id = id.clone();
10732                Box::pin(async move { id.into_id().await.unwrap().quote() })
10733            }),
10734        );
10735        Cloud {
10736            proc: self.proc.clone(),
10737            selection: query,
10738            graphql_client: self.graphql_client.clone(),
10739        }
10740    }
10741    /// Load a Container from its ID.
10742    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
10743        let mut query = self.selection.select("loadContainerFromID");
10744        query = query.arg_lazy(
10745            "id",
10746            Box::new(move || {
10747                let id = id.clone();
10748                Box::pin(async move { id.into_id().await.unwrap().quote() })
10749            }),
10750        );
10751        Container {
10752            proc: self.proc.clone(),
10753            selection: query,
10754            graphql_client: self.graphql_client.clone(),
10755        }
10756    }
10757    /// Load a CurrentModule from its ID.
10758    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
10759        let mut query = self.selection.select("loadCurrentModuleFromID");
10760        query = query.arg_lazy(
10761            "id",
10762            Box::new(move || {
10763                let id = id.clone();
10764                Box::pin(async move { id.into_id().await.unwrap().quote() })
10765            }),
10766        );
10767        CurrentModule {
10768            proc: self.proc.clone(),
10769            selection: query,
10770            graphql_client: self.graphql_client.clone(),
10771        }
10772    }
10773    /// Load a Directory from its ID.
10774    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
10775        let mut query = self.selection.select("loadDirectoryFromID");
10776        query = query.arg_lazy(
10777            "id",
10778            Box::new(move || {
10779                let id = id.clone();
10780                Box::pin(async move { id.into_id().await.unwrap().quote() })
10781            }),
10782        );
10783        Directory {
10784            proc: self.proc.clone(),
10785            selection: query,
10786            graphql_client: self.graphql_client.clone(),
10787        }
10788    }
10789    /// Load a EngineCacheEntry from its ID.
10790    pub fn load_engine_cache_entry_from_id(
10791        &self,
10792        id: impl IntoID<EngineCacheEntryId>,
10793    ) -> EngineCacheEntry {
10794        let mut query = self.selection.select("loadEngineCacheEntryFromID");
10795        query = query.arg_lazy(
10796            "id",
10797            Box::new(move || {
10798                let id = id.clone();
10799                Box::pin(async move { id.into_id().await.unwrap().quote() })
10800            }),
10801        );
10802        EngineCacheEntry {
10803            proc: self.proc.clone(),
10804            selection: query,
10805            graphql_client: self.graphql_client.clone(),
10806        }
10807    }
10808    /// Load a EngineCacheEntrySet from its ID.
10809    pub fn load_engine_cache_entry_set_from_id(
10810        &self,
10811        id: impl IntoID<EngineCacheEntrySetId>,
10812    ) -> EngineCacheEntrySet {
10813        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
10814        query = query.arg_lazy(
10815            "id",
10816            Box::new(move || {
10817                let id = id.clone();
10818                Box::pin(async move { id.into_id().await.unwrap().quote() })
10819            }),
10820        );
10821        EngineCacheEntrySet {
10822            proc: self.proc.clone(),
10823            selection: query,
10824            graphql_client: self.graphql_client.clone(),
10825        }
10826    }
10827    /// Load a EngineCache from its ID.
10828    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
10829        let mut query = self.selection.select("loadEngineCacheFromID");
10830        query = query.arg_lazy(
10831            "id",
10832            Box::new(move || {
10833                let id = id.clone();
10834                Box::pin(async move { id.into_id().await.unwrap().quote() })
10835            }),
10836        );
10837        EngineCache {
10838            proc: self.proc.clone(),
10839            selection: query,
10840            graphql_client: self.graphql_client.clone(),
10841        }
10842    }
10843    /// Load a Engine from its ID.
10844    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
10845        let mut query = self.selection.select("loadEngineFromID");
10846        query = query.arg_lazy(
10847            "id",
10848            Box::new(move || {
10849                let id = id.clone();
10850                Box::pin(async move { id.into_id().await.unwrap().quote() })
10851            }),
10852        );
10853        Engine {
10854            proc: self.proc.clone(),
10855            selection: query,
10856            graphql_client: self.graphql_client.clone(),
10857        }
10858    }
10859    /// Load a EnumTypeDef from its ID.
10860    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
10861        let mut query = self.selection.select("loadEnumTypeDefFromID");
10862        query = query.arg_lazy(
10863            "id",
10864            Box::new(move || {
10865                let id = id.clone();
10866                Box::pin(async move { id.into_id().await.unwrap().quote() })
10867            }),
10868        );
10869        EnumTypeDef {
10870            proc: self.proc.clone(),
10871            selection: query,
10872            graphql_client: self.graphql_client.clone(),
10873        }
10874    }
10875    /// Load a EnumValueTypeDef from its ID.
10876    pub fn load_enum_value_type_def_from_id(
10877        &self,
10878        id: impl IntoID<EnumValueTypeDefId>,
10879    ) -> EnumValueTypeDef {
10880        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
10881        query = query.arg_lazy(
10882            "id",
10883            Box::new(move || {
10884                let id = id.clone();
10885                Box::pin(async move { id.into_id().await.unwrap().quote() })
10886            }),
10887        );
10888        EnumValueTypeDef {
10889            proc: self.proc.clone(),
10890            selection: query,
10891            graphql_client: self.graphql_client.clone(),
10892        }
10893    }
10894    /// Load a EnvFile from its ID.
10895    pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
10896        let mut query = self.selection.select("loadEnvFileFromID");
10897        query = query.arg_lazy(
10898            "id",
10899            Box::new(move || {
10900                let id = id.clone();
10901                Box::pin(async move { id.into_id().await.unwrap().quote() })
10902            }),
10903        );
10904        EnvFile {
10905            proc: self.proc.clone(),
10906            selection: query,
10907            graphql_client: self.graphql_client.clone(),
10908        }
10909    }
10910    /// Load a Env from its ID.
10911    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
10912        let mut query = self.selection.select("loadEnvFromID");
10913        query = query.arg_lazy(
10914            "id",
10915            Box::new(move || {
10916                let id = id.clone();
10917                Box::pin(async move { id.into_id().await.unwrap().quote() })
10918            }),
10919        );
10920        Env {
10921            proc: self.proc.clone(),
10922            selection: query,
10923            graphql_client: self.graphql_client.clone(),
10924        }
10925    }
10926    /// Load a EnvVariable from its ID.
10927    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
10928        let mut query = self.selection.select("loadEnvVariableFromID");
10929        query = query.arg_lazy(
10930            "id",
10931            Box::new(move || {
10932                let id = id.clone();
10933                Box::pin(async move { id.into_id().await.unwrap().quote() })
10934            }),
10935        );
10936        EnvVariable {
10937            proc: self.proc.clone(),
10938            selection: query,
10939            graphql_client: self.graphql_client.clone(),
10940        }
10941    }
10942    /// Load a Error from its ID.
10943    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
10944        let mut query = self.selection.select("loadErrorFromID");
10945        query = query.arg_lazy(
10946            "id",
10947            Box::new(move || {
10948                let id = id.clone();
10949                Box::pin(async move { id.into_id().await.unwrap().quote() })
10950            }),
10951        );
10952        Error {
10953            proc: self.proc.clone(),
10954            selection: query,
10955            graphql_client: self.graphql_client.clone(),
10956        }
10957    }
10958    /// Load a ErrorValue from its ID.
10959    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
10960        let mut query = self.selection.select("loadErrorValueFromID");
10961        query = query.arg_lazy(
10962            "id",
10963            Box::new(move || {
10964                let id = id.clone();
10965                Box::pin(async move { id.into_id().await.unwrap().quote() })
10966            }),
10967        );
10968        ErrorValue {
10969            proc: self.proc.clone(),
10970            selection: query,
10971            graphql_client: self.graphql_client.clone(),
10972        }
10973    }
10974    /// Load a FieldTypeDef from its ID.
10975    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
10976        let mut query = self.selection.select("loadFieldTypeDefFromID");
10977        query = query.arg_lazy(
10978            "id",
10979            Box::new(move || {
10980                let id = id.clone();
10981                Box::pin(async move { id.into_id().await.unwrap().quote() })
10982            }),
10983        );
10984        FieldTypeDef {
10985            proc: self.proc.clone(),
10986            selection: query,
10987            graphql_client: self.graphql_client.clone(),
10988        }
10989    }
10990    /// Load a File from its ID.
10991    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
10992        let mut query = self.selection.select("loadFileFromID");
10993        query = query.arg_lazy(
10994            "id",
10995            Box::new(move || {
10996                let id = id.clone();
10997                Box::pin(async move { id.into_id().await.unwrap().quote() })
10998            }),
10999        );
11000        File {
11001            proc: self.proc.clone(),
11002            selection: query,
11003            graphql_client: self.graphql_client.clone(),
11004        }
11005    }
11006    /// Load a FunctionArg from its ID.
11007    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
11008        let mut query = self.selection.select("loadFunctionArgFromID");
11009        query = query.arg_lazy(
11010            "id",
11011            Box::new(move || {
11012                let id = id.clone();
11013                Box::pin(async move { id.into_id().await.unwrap().quote() })
11014            }),
11015        );
11016        FunctionArg {
11017            proc: self.proc.clone(),
11018            selection: query,
11019            graphql_client: self.graphql_client.clone(),
11020        }
11021    }
11022    /// Load a FunctionCallArgValue from its ID.
11023    pub fn load_function_call_arg_value_from_id(
11024        &self,
11025        id: impl IntoID<FunctionCallArgValueId>,
11026    ) -> FunctionCallArgValue {
11027        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
11028        query = query.arg_lazy(
11029            "id",
11030            Box::new(move || {
11031                let id = id.clone();
11032                Box::pin(async move { id.into_id().await.unwrap().quote() })
11033            }),
11034        );
11035        FunctionCallArgValue {
11036            proc: self.proc.clone(),
11037            selection: query,
11038            graphql_client: self.graphql_client.clone(),
11039        }
11040    }
11041    /// Load a FunctionCall from its ID.
11042    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
11043        let mut query = self.selection.select("loadFunctionCallFromID");
11044        query = query.arg_lazy(
11045            "id",
11046            Box::new(move || {
11047                let id = id.clone();
11048                Box::pin(async move { id.into_id().await.unwrap().quote() })
11049            }),
11050        );
11051        FunctionCall {
11052            proc: self.proc.clone(),
11053            selection: query,
11054            graphql_client: self.graphql_client.clone(),
11055        }
11056    }
11057    /// Load a Function from its ID.
11058    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
11059        let mut query = self.selection.select("loadFunctionFromID");
11060        query = query.arg_lazy(
11061            "id",
11062            Box::new(move || {
11063                let id = id.clone();
11064                Box::pin(async move { id.into_id().await.unwrap().quote() })
11065            }),
11066        );
11067        Function {
11068            proc: self.proc.clone(),
11069            selection: query,
11070            graphql_client: self.graphql_client.clone(),
11071        }
11072    }
11073    /// Load a GeneratedCode from its ID.
11074    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
11075        let mut query = self.selection.select("loadGeneratedCodeFromID");
11076        query = query.arg_lazy(
11077            "id",
11078            Box::new(move || {
11079                let id = id.clone();
11080                Box::pin(async move { id.into_id().await.unwrap().quote() })
11081            }),
11082        );
11083        GeneratedCode {
11084            proc: self.proc.clone(),
11085            selection: query,
11086            graphql_client: self.graphql_client.clone(),
11087        }
11088    }
11089    /// Load a GitRef from its ID.
11090    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
11091        let mut query = self.selection.select("loadGitRefFromID");
11092        query = query.arg_lazy(
11093            "id",
11094            Box::new(move || {
11095                let id = id.clone();
11096                Box::pin(async move { id.into_id().await.unwrap().quote() })
11097            }),
11098        );
11099        GitRef {
11100            proc: self.proc.clone(),
11101            selection: query,
11102            graphql_client: self.graphql_client.clone(),
11103        }
11104    }
11105    /// Load a GitRepository from its ID.
11106    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
11107        let mut query = self.selection.select("loadGitRepositoryFromID");
11108        query = query.arg_lazy(
11109            "id",
11110            Box::new(move || {
11111                let id = id.clone();
11112                Box::pin(async move { id.into_id().await.unwrap().quote() })
11113            }),
11114        );
11115        GitRepository {
11116            proc: self.proc.clone(),
11117            selection: query,
11118            graphql_client: self.graphql_client.clone(),
11119        }
11120    }
11121    /// Load a Host from its ID.
11122    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
11123        let mut query = self.selection.select("loadHostFromID");
11124        query = query.arg_lazy(
11125            "id",
11126            Box::new(move || {
11127                let id = id.clone();
11128                Box::pin(async move { id.into_id().await.unwrap().quote() })
11129            }),
11130        );
11131        Host {
11132            proc: self.proc.clone(),
11133            selection: query,
11134            graphql_client: self.graphql_client.clone(),
11135        }
11136    }
11137    /// Load a InputTypeDef from its ID.
11138    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
11139        let mut query = self.selection.select("loadInputTypeDefFromID");
11140        query = query.arg_lazy(
11141            "id",
11142            Box::new(move || {
11143                let id = id.clone();
11144                Box::pin(async move { id.into_id().await.unwrap().quote() })
11145            }),
11146        );
11147        InputTypeDef {
11148            proc: self.proc.clone(),
11149            selection: query,
11150            graphql_client: self.graphql_client.clone(),
11151        }
11152    }
11153    /// Load a InterfaceTypeDef from its ID.
11154    pub fn load_interface_type_def_from_id(
11155        &self,
11156        id: impl IntoID<InterfaceTypeDefId>,
11157    ) -> InterfaceTypeDef {
11158        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
11159        query = query.arg_lazy(
11160            "id",
11161            Box::new(move || {
11162                let id = id.clone();
11163                Box::pin(async move { id.into_id().await.unwrap().quote() })
11164            }),
11165        );
11166        InterfaceTypeDef {
11167            proc: self.proc.clone(),
11168            selection: query,
11169            graphql_client: self.graphql_client.clone(),
11170        }
11171    }
11172    /// Load a JSONValue from its ID.
11173    pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
11174        let mut query = self.selection.select("loadJSONValueFromID");
11175        query = query.arg_lazy(
11176            "id",
11177            Box::new(move || {
11178                let id = id.clone();
11179                Box::pin(async move { id.into_id().await.unwrap().quote() })
11180            }),
11181        );
11182        JsonValue {
11183            proc: self.proc.clone(),
11184            selection: query,
11185            graphql_client: self.graphql_client.clone(),
11186        }
11187    }
11188    /// Load a LLM from its ID.
11189    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
11190        let mut query = self.selection.select("loadLLMFromID");
11191        query = query.arg_lazy(
11192            "id",
11193            Box::new(move || {
11194                let id = id.clone();
11195                Box::pin(async move { id.into_id().await.unwrap().quote() })
11196            }),
11197        );
11198        Llm {
11199            proc: self.proc.clone(),
11200            selection: query,
11201            graphql_client: self.graphql_client.clone(),
11202        }
11203    }
11204    /// Load a LLMTokenUsage from its ID.
11205    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
11206        let mut query = self.selection.select("loadLLMTokenUsageFromID");
11207        query = query.arg_lazy(
11208            "id",
11209            Box::new(move || {
11210                let id = id.clone();
11211                Box::pin(async move { id.into_id().await.unwrap().quote() })
11212            }),
11213        );
11214        LlmTokenUsage {
11215            proc: self.proc.clone(),
11216            selection: query,
11217            graphql_client: self.graphql_client.clone(),
11218        }
11219    }
11220    /// Load a Label from its ID.
11221    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
11222        let mut query = self.selection.select("loadLabelFromID");
11223        query = query.arg_lazy(
11224            "id",
11225            Box::new(move || {
11226                let id = id.clone();
11227                Box::pin(async move { id.into_id().await.unwrap().quote() })
11228            }),
11229        );
11230        Label {
11231            proc: self.proc.clone(),
11232            selection: query,
11233            graphql_client: self.graphql_client.clone(),
11234        }
11235    }
11236    /// Load a ListTypeDef from its ID.
11237    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
11238        let mut query = self.selection.select("loadListTypeDefFromID");
11239        query = query.arg_lazy(
11240            "id",
11241            Box::new(move || {
11242                let id = id.clone();
11243                Box::pin(async move { id.into_id().await.unwrap().quote() })
11244            }),
11245        );
11246        ListTypeDef {
11247            proc: self.proc.clone(),
11248            selection: query,
11249            graphql_client: self.graphql_client.clone(),
11250        }
11251    }
11252    /// Load a ModuleConfigClient from its ID.
11253    pub fn load_module_config_client_from_id(
11254        &self,
11255        id: impl IntoID<ModuleConfigClientId>,
11256    ) -> ModuleConfigClient {
11257        let mut query = self.selection.select("loadModuleConfigClientFromID");
11258        query = query.arg_lazy(
11259            "id",
11260            Box::new(move || {
11261                let id = id.clone();
11262                Box::pin(async move { id.into_id().await.unwrap().quote() })
11263            }),
11264        );
11265        ModuleConfigClient {
11266            proc: self.proc.clone(),
11267            selection: query,
11268            graphql_client: self.graphql_client.clone(),
11269        }
11270    }
11271    /// Load a Module from its ID.
11272    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
11273        let mut query = self.selection.select("loadModuleFromID");
11274        query = query.arg_lazy(
11275            "id",
11276            Box::new(move || {
11277                let id = id.clone();
11278                Box::pin(async move { id.into_id().await.unwrap().quote() })
11279            }),
11280        );
11281        Module {
11282            proc: self.proc.clone(),
11283            selection: query,
11284            graphql_client: self.graphql_client.clone(),
11285        }
11286    }
11287    /// Load a ModuleSource from its ID.
11288    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
11289        let mut query = self.selection.select("loadModuleSourceFromID");
11290        query = query.arg_lazy(
11291            "id",
11292            Box::new(move || {
11293                let id = id.clone();
11294                Box::pin(async move { id.into_id().await.unwrap().quote() })
11295            }),
11296        );
11297        ModuleSource {
11298            proc: self.proc.clone(),
11299            selection: query,
11300            graphql_client: self.graphql_client.clone(),
11301        }
11302    }
11303    /// Load a ObjectTypeDef from its ID.
11304    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
11305        let mut query = self.selection.select("loadObjectTypeDefFromID");
11306        query = query.arg_lazy(
11307            "id",
11308            Box::new(move || {
11309                let id = id.clone();
11310                Box::pin(async move { id.into_id().await.unwrap().quote() })
11311            }),
11312        );
11313        ObjectTypeDef {
11314            proc: self.proc.clone(),
11315            selection: query,
11316            graphql_client: self.graphql_client.clone(),
11317        }
11318    }
11319    /// Load a Port from its ID.
11320    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
11321        let mut query = self.selection.select("loadPortFromID");
11322        query = query.arg_lazy(
11323            "id",
11324            Box::new(move || {
11325                let id = id.clone();
11326                Box::pin(async move { id.into_id().await.unwrap().quote() })
11327            }),
11328        );
11329        Port {
11330            proc: self.proc.clone(),
11331            selection: query,
11332            graphql_client: self.graphql_client.clone(),
11333        }
11334    }
11335    /// Load a SDKConfig from its ID.
11336    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
11337        let mut query = self.selection.select("loadSDKConfigFromID");
11338        query = query.arg_lazy(
11339            "id",
11340            Box::new(move || {
11341                let id = id.clone();
11342                Box::pin(async move { id.into_id().await.unwrap().quote() })
11343            }),
11344        );
11345        SdkConfig {
11346            proc: self.proc.clone(),
11347            selection: query,
11348            graphql_client: self.graphql_client.clone(),
11349        }
11350    }
11351    /// Load a ScalarTypeDef from its ID.
11352    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
11353        let mut query = self.selection.select("loadScalarTypeDefFromID");
11354        query = query.arg_lazy(
11355            "id",
11356            Box::new(move || {
11357                let id = id.clone();
11358                Box::pin(async move { id.into_id().await.unwrap().quote() })
11359            }),
11360        );
11361        ScalarTypeDef {
11362            proc: self.proc.clone(),
11363            selection: query,
11364            graphql_client: self.graphql_client.clone(),
11365        }
11366    }
11367    /// Load a SearchResult from its ID.
11368    pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
11369        let mut query = self.selection.select("loadSearchResultFromID");
11370        query = query.arg_lazy(
11371            "id",
11372            Box::new(move || {
11373                let id = id.clone();
11374                Box::pin(async move { id.into_id().await.unwrap().quote() })
11375            }),
11376        );
11377        SearchResult {
11378            proc: self.proc.clone(),
11379            selection: query,
11380            graphql_client: self.graphql_client.clone(),
11381        }
11382    }
11383    /// Load a SearchSubmatch from its ID.
11384    pub fn load_search_submatch_from_id(
11385        &self,
11386        id: impl IntoID<SearchSubmatchId>,
11387    ) -> SearchSubmatch {
11388        let mut query = self.selection.select("loadSearchSubmatchFromID");
11389        query = query.arg_lazy(
11390            "id",
11391            Box::new(move || {
11392                let id = id.clone();
11393                Box::pin(async move { id.into_id().await.unwrap().quote() })
11394            }),
11395        );
11396        SearchSubmatch {
11397            proc: self.proc.clone(),
11398            selection: query,
11399            graphql_client: self.graphql_client.clone(),
11400        }
11401    }
11402    /// Load a Secret from its ID.
11403    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
11404        let mut query = self.selection.select("loadSecretFromID");
11405        query = query.arg_lazy(
11406            "id",
11407            Box::new(move || {
11408                let id = id.clone();
11409                Box::pin(async move { id.into_id().await.unwrap().quote() })
11410            }),
11411        );
11412        Secret {
11413            proc: self.proc.clone(),
11414            selection: query,
11415            graphql_client: self.graphql_client.clone(),
11416        }
11417    }
11418    /// Load a Service from its ID.
11419    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
11420        let mut query = self.selection.select("loadServiceFromID");
11421        query = query.arg_lazy(
11422            "id",
11423            Box::new(move || {
11424                let id = id.clone();
11425                Box::pin(async move { id.into_id().await.unwrap().quote() })
11426            }),
11427        );
11428        Service {
11429            proc: self.proc.clone(),
11430            selection: query,
11431            graphql_client: self.graphql_client.clone(),
11432        }
11433    }
11434    /// Load a Socket from its ID.
11435    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
11436        let mut query = self.selection.select("loadSocketFromID");
11437        query = query.arg_lazy(
11438            "id",
11439            Box::new(move || {
11440                let id = id.clone();
11441                Box::pin(async move { id.into_id().await.unwrap().quote() })
11442            }),
11443        );
11444        Socket {
11445            proc: self.proc.clone(),
11446            selection: query,
11447            graphql_client: self.graphql_client.clone(),
11448        }
11449    }
11450    /// Load a SourceMap from its ID.
11451    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
11452        let mut query = self.selection.select("loadSourceMapFromID");
11453        query = query.arg_lazy(
11454            "id",
11455            Box::new(move || {
11456                let id = id.clone();
11457                Box::pin(async move { id.into_id().await.unwrap().quote() })
11458            }),
11459        );
11460        SourceMap {
11461            proc: self.proc.clone(),
11462            selection: query,
11463            graphql_client: self.graphql_client.clone(),
11464        }
11465    }
11466    /// Load a Terminal from its ID.
11467    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
11468        let mut query = self.selection.select("loadTerminalFromID");
11469        query = query.arg_lazy(
11470            "id",
11471            Box::new(move || {
11472                let id = id.clone();
11473                Box::pin(async move { id.into_id().await.unwrap().quote() })
11474            }),
11475        );
11476        Terminal {
11477            proc: self.proc.clone(),
11478            selection: query,
11479            graphql_client: self.graphql_client.clone(),
11480        }
11481    }
11482    /// Load a TypeDef from its ID.
11483    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
11484        let mut query = self.selection.select("loadTypeDefFromID");
11485        query = query.arg_lazy(
11486            "id",
11487            Box::new(move || {
11488                let id = id.clone();
11489                Box::pin(async move { id.into_id().await.unwrap().quote() })
11490            }),
11491        );
11492        TypeDef {
11493            proc: self.proc.clone(),
11494            selection: query,
11495            graphql_client: self.graphql_client.clone(),
11496        }
11497    }
11498    /// Create a new module.
11499    pub fn module(&self) -> Module {
11500        let query = self.selection.select("module");
11501        Module {
11502            proc: self.proc.clone(),
11503            selection: query,
11504            graphql_client: self.graphql_client.clone(),
11505        }
11506    }
11507    /// Create a new module source instance from a source ref string
11508    ///
11509    /// # Arguments
11510    ///
11511    /// * `ref_string` - The string ref representation of the module source
11512    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11513    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
11514        let mut query = self.selection.select("moduleSource");
11515        query = query.arg("refString", ref_string.into());
11516        ModuleSource {
11517            proc: self.proc.clone(),
11518            selection: query,
11519            graphql_client: self.graphql_client.clone(),
11520        }
11521    }
11522    /// Create a new module source instance from a source ref string
11523    ///
11524    /// # Arguments
11525    ///
11526    /// * `ref_string` - The string ref representation of the module source
11527    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11528    pub fn module_source_opts<'a>(
11529        &self,
11530        ref_string: impl Into<String>,
11531        opts: QueryModuleSourceOpts<'a>,
11532    ) -> ModuleSource {
11533        let mut query = self.selection.select("moduleSource");
11534        query = query.arg("refString", ref_string.into());
11535        if let Some(ref_pin) = opts.ref_pin {
11536            query = query.arg("refPin", ref_pin);
11537        }
11538        if let Some(disable_find_up) = opts.disable_find_up {
11539            query = query.arg("disableFindUp", disable_find_up);
11540        }
11541        if let Some(allow_not_exists) = opts.allow_not_exists {
11542            query = query.arg("allowNotExists", allow_not_exists);
11543        }
11544        if let Some(require_kind) = opts.require_kind {
11545            query = query.arg("requireKind", require_kind);
11546        }
11547        ModuleSource {
11548            proc: self.proc.clone(),
11549            selection: query,
11550            graphql_client: self.graphql_client.clone(),
11551        }
11552    }
11553    /// Creates a new secret.
11554    ///
11555    /// # Arguments
11556    ///
11557    /// * `uri` - The URI of the secret store
11558    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11559    pub fn secret(&self, uri: impl Into<String>) -> Secret {
11560        let mut query = self.selection.select("secret");
11561        query = query.arg("uri", uri.into());
11562        Secret {
11563            proc: self.proc.clone(),
11564            selection: query,
11565            graphql_client: self.graphql_client.clone(),
11566        }
11567    }
11568    /// Creates a new secret.
11569    ///
11570    /// # Arguments
11571    ///
11572    /// * `uri` - The URI of the secret store
11573    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11574    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
11575        let mut query = self.selection.select("secret");
11576        query = query.arg("uri", uri.into());
11577        if let Some(cache_key) = opts.cache_key {
11578            query = query.arg("cacheKey", cache_key);
11579        }
11580        Secret {
11581            proc: self.proc.clone(),
11582            selection: query,
11583            graphql_client: self.graphql_client.clone(),
11584        }
11585    }
11586    /// Sets a secret given a user defined name to its plaintext and returns the secret.
11587    /// The plaintext value is limited to a size of 128000 bytes.
11588    ///
11589    /// # Arguments
11590    ///
11591    /// * `name` - The user defined name for this secret
11592    /// * `plaintext` - The plaintext of the secret
11593    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
11594        let mut query = self.selection.select("setSecret");
11595        query = query.arg("name", name.into());
11596        query = query.arg("plaintext", plaintext.into());
11597        Secret {
11598            proc: self.proc.clone(),
11599            selection: query,
11600            graphql_client: self.graphql_client.clone(),
11601        }
11602    }
11603    /// Creates source map metadata.
11604    ///
11605    /// # Arguments
11606    ///
11607    /// * `filename` - The filename from the module source.
11608    /// * `line` - The line number within the filename.
11609    /// * `column` - The column number within the line.
11610    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
11611        let mut query = self.selection.select("sourceMap");
11612        query = query.arg("filename", filename.into());
11613        query = query.arg("line", line);
11614        query = query.arg("column", column);
11615        SourceMap {
11616            proc: self.proc.clone(),
11617            selection: query,
11618            graphql_client: self.graphql_client.clone(),
11619        }
11620    }
11621    /// Create a new TypeDef.
11622    pub fn type_def(&self) -> TypeDef {
11623        let query = self.selection.select("typeDef");
11624        TypeDef {
11625            proc: self.proc.clone(),
11626            selection: query,
11627            graphql_client: self.graphql_client.clone(),
11628        }
11629    }
11630    /// Get the current Dagger Engine version.
11631    pub async fn version(&self) -> Result<String, DaggerError> {
11632        let query = self.selection.select("version");
11633        query.execute(self.graphql_client.clone()).await
11634    }
11635}
11636#[derive(Clone)]
11637pub struct SdkConfig {
11638    pub proc: Option<Arc<DaggerSessionProc>>,
11639    pub selection: Selection,
11640    pub graphql_client: DynGraphQLClient,
11641}
11642impl SdkConfig {
11643    /// A unique identifier for this SDKConfig.
11644    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
11645        let query = self.selection.select("id");
11646        query.execute(self.graphql_client.clone()).await
11647    }
11648    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
11649    pub async fn source(&self) -> Result<String, DaggerError> {
11650        let query = self.selection.select("source");
11651        query.execute(self.graphql_client.clone()).await
11652    }
11653}
11654#[derive(Clone)]
11655pub struct ScalarTypeDef {
11656    pub proc: Option<Arc<DaggerSessionProc>>,
11657    pub selection: Selection,
11658    pub graphql_client: DynGraphQLClient,
11659}
11660impl ScalarTypeDef {
11661    /// A doc string for the scalar, if any.
11662    pub async fn description(&self) -> Result<String, DaggerError> {
11663        let query = self.selection.select("description");
11664        query.execute(self.graphql_client.clone()).await
11665    }
11666    /// A unique identifier for this ScalarTypeDef.
11667    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
11668        let query = self.selection.select("id");
11669        query.execute(self.graphql_client.clone()).await
11670    }
11671    /// The name of the scalar.
11672    pub async fn name(&self) -> Result<String, DaggerError> {
11673        let query = self.selection.select("name");
11674        query.execute(self.graphql_client.clone()).await
11675    }
11676    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
11677    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
11678        let query = self.selection.select("sourceModuleName");
11679        query.execute(self.graphql_client.clone()).await
11680    }
11681}
11682#[derive(Clone)]
11683pub struct SearchResult {
11684    pub proc: Option<Arc<DaggerSessionProc>>,
11685    pub selection: Selection,
11686    pub graphql_client: DynGraphQLClient,
11687}
11688impl SearchResult {
11689    /// The byte offset of this line within the file.
11690    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
11691        let query = self.selection.select("absoluteOffset");
11692        query.execute(self.graphql_client.clone()).await
11693    }
11694    /// The path to the file that matched.
11695    pub async fn file_path(&self) -> Result<String, DaggerError> {
11696        let query = self.selection.select("filePath");
11697        query.execute(self.graphql_client.clone()).await
11698    }
11699    /// A unique identifier for this SearchResult.
11700    pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
11701        let query = self.selection.select("id");
11702        query.execute(self.graphql_client.clone()).await
11703    }
11704    /// The first line that matched.
11705    pub async fn line_number(&self) -> Result<isize, DaggerError> {
11706        let query = self.selection.select("lineNumber");
11707        query.execute(self.graphql_client.clone()).await
11708    }
11709    /// The line content that matched.
11710    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
11711        let query = self.selection.select("matchedLines");
11712        query.execute(self.graphql_client.clone()).await
11713    }
11714    /// Sub-match positions and content within the matched lines.
11715    pub fn submatches(&self) -> Vec<SearchSubmatch> {
11716        let query = self.selection.select("submatches");
11717        vec![SearchSubmatch {
11718            proc: self.proc.clone(),
11719            selection: query,
11720            graphql_client: self.graphql_client.clone(),
11721        }]
11722    }
11723}
11724#[derive(Clone)]
11725pub struct SearchSubmatch {
11726    pub proc: Option<Arc<DaggerSessionProc>>,
11727    pub selection: Selection,
11728    pub graphql_client: DynGraphQLClient,
11729}
11730impl SearchSubmatch {
11731    /// The match's end offset within the matched lines.
11732    pub async fn end(&self) -> Result<isize, DaggerError> {
11733        let query = self.selection.select("end");
11734        query.execute(self.graphql_client.clone()).await
11735    }
11736    /// A unique identifier for this SearchSubmatch.
11737    pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
11738        let query = self.selection.select("id");
11739        query.execute(self.graphql_client.clone()).await
11740    }
11741    /// The match's start offset within the matched lines.
11742    pub async fn start(&self) -> Result<isize, DaggerError> {
11743        let query = self.selection.select("start");
11744        query.execute(self.graphql_client.clone()).await
11745    }
11746    /// The matched text.
11747    pub async fn text(&self) -> Result<String, DaggerError> {
11748        let query = self.selection.select("text");
11749        query.execute(self.graphql_client.clone()).await
11750    }
11751}
11752#[derive(Clone)]
11753pub struct Secret {
11754    pub proc: Option<Arc<DaggerSessionProc>>,
11755    pub selection: Selection,
11756    pub graphql_client: DynGraphQLClient,
11757}
11758impl Secret {
11759    /// A unique identifier for this Secret.
11760    pub async fn id(&self) -> Result<SecretId, DaggerError> {
11761        let query = self.selection.select("id");
11762        query.execute(self.graphql_client.clone()).await
11763    }
11764    /// The name of this secret.
11765    pub async fn name(&self) -> Result<String, DaggerError> {
11766        let query = self.selection.select("name");
11767        query.execute(self.graphql_client.clone()).await
11768    }
11769    /// The value of this secret.
11770    pub async fn plaintext(&self) -> Result<String, DaggerError> {
11771        let query = self.selection.select("plaintext");
11772        query.execute(self.graphql_client.clone()).await
11773    }
11774    /// The URI of this secret.
11775    pub async fn uri(&self) -> Result<String, DaggerError> {
11776        let query = self.selection.select("uri");
11777        query.execute(self.graphql_client.clone()).await
11778    }
11779}
11780#[derive(Clone)]
11781pub struct Service {
11782    pub proc: Option<Arc<DaggerSessionProc>>,
11783    pub selection: Selection,
11784    pub graphql_client: DynGraphQLClient,
11785}
11786#[derive(Builder, Debug, PartialEq)]
11787pub struct ServiceEndpointOpts<'a> {
11788    /// The exposed port number for the endpoint
11789    #[builder(setter(into, strip_option), default)]
11790    pub port: Option<isize>,
11791    /// Return a URL with the given scheme, eg. http for http://
11792    #[builder(setter(into, strip_option), default)]
11793    pub scheme: Option<&'a str>,
11794}
11795#[derive(Builder, Debug, PartialEq)]
11796pub struct ServiceStopOpts {
11797    /// Immediately kill the service without waiting for a graceful exit
11798    #[builder(setter(into, strip_option), default)]
11799    pub kill: Option<bool>,
11800}
11801#[derive(Builder, Debug, PartialEq)]
11802pub struct ServiceTerminalOpts<'a> {
11803    #[builder(setter(into, strip_option), default)]
11804    pub cmd: Option<Vec<&'a str>>,
11805}
11806#[derive(Builder, Debug, PartialEq)]
11807pub struct ServiceUpOpts {
11808    /// List of frontend/backend port mappings to forward.
11809    /// Frontend is the port accepting traffic on the host, backend is the service port.
11810    #[builder(setter(into, strip_option), default)]
11811    pub ports: Option<Vec<PortForward>>,
11812    /// Bind each tunnel port to a random port on the host.
11813    #[builder(setter(into, strip_option), default)]
11814    pub random: Option<bool>,
11815}
11816impl Service {
11817    /// Retrieves an endpoint that clients can use to reach this container.
11818    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
11819    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
11820    ///
11821    /// # Arguments
11822    ///
11823    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11824    pub async fn endpoint(&self) -> Result<String, DaggerError> {
11825        let query = self.selection.select("endpoint");
11826        query.execute(self.graphql_client.clone()).await
11827    }
11828    /// Retrieves an endpoint that clients can use to reach this container.
11829    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
11830    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
11831    ///
11832    /// # Arguments
11833    ///
11834    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11835    pub async fn endpoint_opts<'a>(
11836        &self,
11837        opts: ServiceEndpointOpts<'a>,
11838    ) -> Result<String, DaggerError> {
11839        let mut query = self.selection.select("endpoint");
11840        if let Some(port) = opts.port {
11841            query = query.arg("port", port);
11842        }
11843        if let Some(scheme) = opts.scheme {
11844            query = query.arg("scheme", scheme);
11845        }
11846        query.execute(self.graphql_client.clone()).await
11847    }
11848    /// Retrieves a hostname which can be used by clients to reach this container.
11849    pub async fn hostname(&self) -> Result<String, DaggerError> {
11850        let query = self.selection.select("hostname");
11851        query.execute(self.graphql_client.clone()).await
11852    }
11853    /// A unique identifier for this Service.
11854    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
11855        let query = self.selection.select("id");
11856        query.execute(self.graphql_client.clone()).await
11857    }
11858    /// Retrieves the list of ports provided by the service.
11859    pub fn ports(&self) -> Vec<Port> {
11860        let query = self.selection.select("ports");
11861        vec![Port {
11862            proc: self.proc.clone(),
11863            selection: query,
11864            graphql_client: self.graphql_client.clone(),
11865        }]
11866    }
11867    /// Start the service and wait for its health checks to succeed.
11868    /// Services bound to a Container do not need to be manually started.
11869    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
11870        let query = self.selection.select("start");
11871        query.execute(self.graphql_client.clone()).await
11872    }
11873    /// Stop the service.
11874    ///
11875    /// # Arguments
11876    ///
11877    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11878    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
11879        let query = self.selection.select("stop");
11880        query.execute(self.graphql_client.clone()).await
11881    }
11882    /// Stop the service.
11883    ///
11884    /// # Arguments
11885    ///
11886    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11887    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
11888        let mut query = self.selection.select("stop");
11889        if let Some(kill) = opts.kill {
11890            query = query.arg("kill", kill);
11891        }
11892        query.execute(self.graphql_client.clone()).await
11893    }
11894    /// Forces evaluation of the pipeline in the engine.
11895    pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
11896        let query = self.selection.select("sync");
11897        query.execute(self.graphql_client.clone()).await
11898    }
11899    ///
11900    /// # Arguments
11901    ///
11902    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11903    pub fn terminal(&self) -> Service {
11904        let query = self.selection.select("terminal");
11905        Service {
11906            proc: self.proc.clone(),
11907            selection: query,
11908            graphql_client: self.graphql_client.clone(),
11909        }
11910    }
11911    ///
11912    /// # Arguments
11913    ///
11914    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11915    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
11916        let mut query = self.selection.select("terminal");
11917        if let Some(cmd) = opts.cmd {
11918            query = query.arg("cmd", cmd);
11919        }
11920        Service {
11921            proc: self.proc.clone(),
11922            selection: query,
11923            graphql_client: self.graphql_client.clone(),
11924        }
11925    }
11926    /// Creates a tunnel that forwards traffic from the caller's network to this service.
11927    ///
11928    /// # Arguments
11929    ///
11930    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11931    pub async fn up(&self) -> Result<Void, DaggerError> {
11932        let query = self.selection.select("up");
11933        query.execute(self.graphql_client.clone()).await
11934    }
11935    /// Creates a tunnel that forwards traffic from the caller's network to this service.
11936    ///
11937    /// # Arguments
11938    ///
11939    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11940    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
11941        let mut query = self.selection.select("up");
11942        if let Some(ports) = opts.ports {
11943            query = query.arg("ports", ports);
11944        }
11945        if let Some(random) = opts.random {
11946            query = query.arg("random", random);
11947        }
11948        query.execute(self.graphql_client.clone()).await
11949    }
11950    /// Configures a hostname which can be used by clients within the session to reach this container.
11951    ///
11952    /// # Arguments
11953    ///
11954    /// * `hostname` - The hostname to use.
11955    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
11956        let mut query = self.selection.select("withHostname");
11957        query = query.arg("hostname", hostname.into());
11958        Service {
11959            proc: self.proc.clone(),
11960            selection: query,
11961            graphql_client: self.graphql_client.clone(),
11962        }
11963    }
11964}
11965#[derive(Clone)]
11966pub struct Socket {
11967    pub proc: Option<Arc<DaggerSessionProc>>,
11968    pub selection: Selection,
11969    pub graphql_client: DynGraphQLClient,
11970}
11971impl Socket {
11972    /// A unique identifier for this Socket.
11973    pub async fn id(&self) -> Result<SocketId, DaggerError> {
11974        let query = self.selection.select("id");
11975        query.execute(self.graphql_client.clone()).await
11976    }
11977}
11978#[derive(Clone)]
11979pub struct SourceMap {
11980    pub proc: Option<Arc<DaggerSessionProc>>,
11981    pub selection: Selection,
11982    pub graphql_client: DynGraphQLClient,
11983}
11984impl SourceMap {
11985    /// The column number within the line.
11986    pub async fn column(&self) -> Result<isize, DaggerError> {
11987        let query = self.selection.select("column");
11988        query.execute(self.graphql_client.clone()).await
11989    }
11990    /// The filename from the module source.
11991    pub async fn filename(&self) -> Result<String, DaggerError> {
11992        let query = self.selection.select("filename");
11993        query.execute(self.graphql_client.clone()).await
11994    }
11995    /// A unique identifier for this SourceMap.
11996    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
11997        let query = self.selection.select("id");
11998        query.execute(self.graphql_client.clone()).await
11999    }
12000    /// The line number within the filename.
12001    pub async fn line(&self) -> Result<isize, DaggerError> {
12002        let query = self.selection.select("line");
12003        query.execute(self.graphql_client.clone()).await
12004    }
12005    /// The module dependency this was declared in.
12006    pub async fn module(&self) -> Result<String, DaggerError> {
12007        let query = self.selection.select("module");
12008        query.execute(self.graphql_client.clone()).await
12009    }
12010    /// The URL to the file, if any. This can be used to link to the source map in the browser.
12011    pub async fn url(&self) -> Result<String, DaggerError> {
12012        let query = self.selection.select("url");
12013        query.execute(self.graphql_client.clone()).await
12014    }
12015}
12016#[derive(Clone)]
12017pub struct Terminal {
12018    pub proc: Option<Arc<DaggerSessionProc>>,
12019    pub selection: Selection,
12020    pub graphql_client: DynGraphQLClient,
12021}
12022impl Terminal {
12023    /// A unique identifier for this Terminal.
12024    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
12025        let query = self.selection.select("id");
12026        query.execute(self.graphql_client.clone()).await
12027    }
12028    /// Forces evaluation of the pipeline in the engine.
12029    /// It doesn't run the default command if no exec has been set.
12030    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
12031        let query = self.selection.select("sync");
12032        query.execute(self.graphql_client.clone()).await
12033    }
12034}
12035#[derive(Clone)]
12036pub struct TypeDef {
12037    pub proc: Option<Arc<DaggerSessionProc>>,
12038    pub selection: Selection,
12039    pub graphql_client: DynGraphQLClient,
12040}
12041#[derive(Builder, Debug, PartialEq)]
12042pub struct TypeDefWithEnumOpts<'a> {
12043    /// A doc string for the enum, if any
12044    #[builder(setter(into, strip_option), default)]
12045    pub description: Option<&'a str>,
12046    /// The source map for the enum definition.
12047    #[builder(setter(into, strip_option), default)]
12048    pub source_map: Option<SourceMapId>,
12049}
12050#[derive(Builder, Debug, PartialEq)]
12051pub struct TypeDefWithEnumMemberOpts<'a> {
12052    /// A doc string for the member, if any
12053    #[builder(setter(into, strip_option), default)]
12054    pub description: Option<&'a str>,
12055    /// The source map for the enum member definition.
12056    #[builder(setter(into, strip_option), default)]
12057    pub source_map: Option<SourceMapId>,
12058    /// The value of the member in the enum
12059    #[builder(setter(into, strip_option), default)]
12060    pub value: Option<&'a str>,
12061}
12062#[derive(Builder, Debug, PartialEq)]
12063pub struct TypeDefWithEnumValueOpts<'a> {
12064    /// A doc string for the value, if any
12065    #[builder(setter(into, strip_option), default)]
12066    pub description: Option<&'a str>,
12067    /// The source map for the enum value definition.
12068    #[builder(setter(into, strip_option), default)]
12069    pub source_map: Option<SourceMapId>,
12070}
12071#[derive(Builder, Debug, PartialEq)]
12072pub struct TypeDefWithFieldOpts<'a> {
12073    /// A doc string for the field, if any
12074    #[builder(setter(into, strip_option), default)]
12075    pub description: Option<&'a str>,
12076    /// The source map for the field definition.
12077    #[builder(setter(into, strip_option), default)]
12078    pub source_map: Option<SourceMapId>,
12079}
12080#[derive(Builder, Debug, PartialEq)]
12081pub struct TypeDefWithInterfaceOpts<'a> {
12082    #[builder(setter(into, strip_option), default)]
12083    pub description: Option<&'a str>,
12084    #[builder(setter(into, strip_option), default)]
12085    pub source_map: Option<SourceMapId>,
12086}
12087#[derive(Builder, Debug, PartialEq)]
12088pub struct TypeDefWithObjectOpts<'a> {
12089    #[builder(setter(into, strip_option), default)]
12090    pub description: Option<&'a str>,
12091    #[builder(setter(into, strip_option), default)]
12092    pub source_map: Option<SourceMapId>,
12093}
12094#[derive(Builder, Debug, PartialEq)]
12095pub struct TypeDefWithScalarOpts<'a> {
12096    #[builder(setter(into, strip_option), default)]
12097    pub description: Option<&'a str>,
12098}
12099impl TypeDef {
12100    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
12101    pub fn as_enum(&self) -> EnumTypeDef {
12102        let query = self.selection.select("asEnum");
12103        EnumTypeDef {
12104            proc: self.proc.clone(),
12105            selection: query,
12106            graphql_client: self.graphql_client.clone(),
12107        }
12108    }
12109    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
12110    pub fn as_input(&self) -> InputTypeDef {
12111        let query = self.selection.select("asInput");
12112        InputTypeDef {
12113            proc: self.proc.clone(),
12114            selection: query,
12115            graphql_client: self.graphql_client.clone(),
12116        }
12117    }
12118    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
12119    pub fn as_interface(&self) -> InterfaceTypeDef {
12120        let query = self.selection.select("asInterface");
12121        InterfaceTypeDef {
12122            proc: self.proc.clone(),
12123            selection: query,
12124            graphql_client: self.graphql_client.clone(),
12125        }
12126    }
12127    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
12128    pub fn as_list(&self) -> ListTypeDef {
12129        let query = self.selection.select("asList");
12130        ListTypeDef {
12131            proc: self.proc.clone(),
12132            selection: query,
12133            graphql_client: self.graphql_client.clone(),
12134        }
12135    }
12136    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
12137    pub fn as_object(&self) -> ObjectTypeDef {
12138        let query = self.selection.select("asObject");
12139        ObjectTypeDef {
12140            proc: self.proc.clone(),
12141            selection: query,
12142            graphql_client: self.graphql_client.clone(),
12143        }
12144    }
12145    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
12146    pub fn as_scalar(&self) -> ScalarTypeDef {
12147        let query = self.selection.select("asScalar");
12148        ScalarTypeDef {
12149            proc: self.proc.clone(),
12150            selection: query,
12151            graphql_client: self.graphql_client.clone(),
12152        }
12153    }
12154    /// A unique identifier for this TypeDef.
12155    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
12156        let query = self.selection.select("id");
12157        query.execute(self.graphql_client.clone()).await
12158    }
12159    /// The kind of type this is (e.g. primitive, list, object).
12160    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
12161        let query = self.selection.select("kind");
12162        query.execute(self.graphql_client.clone()).await
12163    }
12164    /// Whether this type can be set to null. Defaults to false.
12165    pub async fn optional(&self) -> Result<bool, DaggerError> {
12166        let query = self.selection.select("optional");
12167        query.execute(self.graphql_client.clone()).await
12168    }
12169    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
12170    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
12171        let mut query = self.selection.select("withConstructor");
12172        query = query.arg_lazy(
12173            "function",
12174            Box::new(move || {
12175                let function = function.clone();
12176                Box::pin(async move { function.into_id().await.unwrap().quote() })
12177            }),
12178        );
12179        TypeDef {
12180            proc: self.proc.clone(),
12181            selection: query,
12182            graphql_client: self.graphql_client.clone(),
12183        }
12184    }
12185    /// Returns a TypeDef of kind Enum with the provided name.
12186    /// 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.
12187    ///
12188    /// # Arguments
12189    ///
12190    /// * `name` - The name of the enum
12191    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12192    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
12193        let mut query = self.selection.select("withEnum");
12194        query = query.arg("name", name.into());
12195        TypeDef {
12196            proc: self.proc.clone(),
12197            selection: query,
12198            graphql_client: self.graphql_client.clone(),
12199        }
12200    }
12201    /// Returns a TypeDef of kind Enum with the provided name.
12202    /// 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.
12203    ///
12204    /// # Arguments
12205    ///
12206    /// * `name` - The name of the enum
12207    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12208    pub fn with_enum_opts<'a>(
12209        &self,
12210        name: impl Into<String>,
12211        opts: TypeDefWithEnumOpts<'a>,
12212    ) -> TypeDef {
12213        let mut query = self.selection.select("withEnum");
12214        query = query.arg("name", name.into());
12215        if let Some(description) = opts.description {
12216            query = query.arg("description", description);
12217        }
12218        if let Some(source_map) = opts.source_map {
12219            query = query.arg("sourceMap", source_map);
12220        }
12221        TypeDef {
12222            proc: self.proc.clone(),
12223            selection: query,
12224            graphql_client: self.graphql_client.clone(),
12225        }
12226    }
12227    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
12228    ///
12229    /// # Arguments
12230    ///
12231    /// * `name` - The name of the member in the enum
12232    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12233    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
12234        let mut query = self.selection.select("withEnumMember");
12235        query = query.arg("name", name.into());
12236        TypeDef {
12237            proc: self.proc.clone(),
12238            selection: query,
12239            graphql_client: self.graphql_client.clone(),
12240        }
12241    }
12242    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
12243    ///
12244    /// # Arguments
12245    ///
12246    /// * `name` - The name of the member in the enum
12247    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12248    pub fn with_enum_member_opts<'a>(
12249        &self,
12250        name: impl Into<String>,
12251        opts: TypeDefWithEnumMemberOpts<'a>,
12252    ) -> TypeDef {
12253        let mut query = self.selection.select("withEnumMember");
12254        query = query.arg("name", name.into());
12255        if let Some(value) = opts.value {
12256            query = query.arg("value", value);
12257        }
12258        if let Some(description) = opts.description {
12259            query = query.arg("description", description);
12260        }
12261        if let Some(source_map) = opts.source_map {
12262            query = query.arg("sourceMap", source_map);
12263        }
12264        TypeDef {
12265            proc: self.proc.clone(),
12266            selection: query,
12267            graphql_client: self.graphql_client.clone(),
12268        }
12269    }
12270    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
12271    ///
12272    /// # Arguments
12273    ///
12274    /// * `value` - The name of the value in the enum
12275    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12276    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
12277        let mut query = self.selection.select("withEnumValue");
12278        query = query.arg("value", value.into());
12279        TypeDef {
12280            proc: self.proc.clone(),
12281            selection: query,
12282            graphql_client: self.graphql_client.clone(),
12283        }
12284    }
12285    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
12286    ///
12287    /// # Arguments
12288    ///
12289    /// * `value` - The name of the value in the enum
12290    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12291    pub fn with_enum_value_opts<'a>(
12292        &self,
12293        value: impl Into<String>,
12294        opts: TypeDefWithEnumValueOpts<'a>,
12295    ) -> TypeDef {
12296        let mut query = self.selection.select("withEnumValue");
12297        query = query.arg("value", value.into());
12298        if let Some(description) = opts.description {
12299            query = query.arg("description", description);
12300        }
12301        if let Some(source_map) = opts.source_map {
12302            query = query.arg("sourceMap", source_map);
12303        }
12304        TypeDef {
12305            proc: self.proc.clone(),
12306            selection: query,
12307            graphql_client: self.graphql_client.clone(),
12308        }
12309    }
12310    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
12311    ///
12312    /// # Arguments
12313    ///
12314    /// * `name` - The name of the field in the object
12315    /// * `type_def` - The type of the field
12316    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12317    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
12318        let mut query = self.selection.select("withField");
12319        query = query.arg("name", name.into());
12320        query = query.arg_lazy(
12321            "typeDef",
12322            Box::new(move || {
12323                let type_def = type_def.clone();
12324                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
12325            }),
12326        );
12327        TypeDef {
12328            proc: self.proc.clone(),
12329            selection: query,
12330            graphql_client: self.graphql_client.clone(),
12331        }
12332    }
12333    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
12334    ///
12335    /// # Arguments
12336    ///
12337    /// * `name` - The name of the field in the object
12338    /// * `type_def` - The type of the field
12339    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12340    pub fn with_field_opts<'a>(
12341        &self,
12342        name: impl Into<String>,
12343        type_def: impl IntoID<TypeDefId>,
12344        opts: TypeDefWithFieldOpts<'a>,
12345    ) -> TypeDef {
12346        let mut query = self.selection.select("withField");
12347        query = query.arg("name", name.into());
12348        query = query.arg_lazy(
12349            "typeDef",
12350            Box::new(move || {
12351                let type_def = type_def.clone();
12352                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
12353            }),
12354        );
12355        if let Some(description) = opts.description {
12356            query = query.arg("description", description);
12357        }
12358        if let Some(source_map) = opts.source_map {
12359            query = query.arg("sourceMap", source_map);
12360        }
12361        TypeDef {
12362            proc: self.proc.clone(),
12363            selection: query,
12364            graphql_client: self.graphql_client.clone(),
12365        }
12366    }
12367    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
12368    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
12369        let mut query = self.selection.select("withFunction");
12370        query = query.arg_lazy(
12371            "function",
12372            Box::new(move || {
12373                let function = function.clone();
12374                Box::pin(async move { function.into_id().await.unwrap().quote() })
12375            }),
12376        );
12377        TypeDef {
12378            proc: self.proc.clone(),
12379            selection: query,
12380            graphql_client: self.graphql_client.clone(),
12381        }
12382    }
12383    /// Returns a TypeDef of kind Interface with the provided name.
12384    ///
12385    /// # Arguments
12386    ///
12387    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12388    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
12389        let mut query = self.selection.select("withInterface");
12390        query = query.arg("name", name.into());
12391        TypeDef {
12392            proc: self.proc.clone(),
12393            selection: query,
12394            graphql_client: self.graphql_client.clone(),
12395        }
12396    }
12397    /// Returns a TypeDef of kind Interface with the provided name.
12398    ///
12399    /// # Arguments
12400    ///
12401    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12402    pub fn with_interface_opts<'a>(
12403        &self,
12404        name: impl Into<String>,
12405        opts: TypeDefWithInterfaceOpts<'a>,
12406    ) -> TypeDef {
12407        let mut query = self.selection.select("withInterface");
12408        query = query.arg("name", name.into());
12409        if let Some(description) = opts.description {
12410            query = query.arg("description", description);
12411        }
12412        if let Some(source_map) = opts.source_map {
12413            query = query.arg("sourceMap", source_map);
12414        }
12415        TypeDef {
12416            proc: self.proc.clone(),
12417            selection: query,
12418            graphql_client: self.graphql_client.clone(),
12419        }
12420    }
12421    /// Sets the kind of the type.
12422    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
12423        let mut query = self.selection.select("withKind");
12424        query = query.arg("kind", kind);
12425        TypeDef {
12426            proc: self.proc.clone(),
12427            selection: query,
12428            graphql_client: self.graphql_client.clone(),
12429        }
12430    }
12431    /// Returns a TypeDef of kind List with the provided type for its elements.
12432    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
12433        let mut query = self.selection.select("withListOf");
12434        query = query.arg_lazy(
12435            "elementType",
12436            Box::new(move || {
12437                let element_type = element_type.clone();
12438                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
12439            }),
12440        );
12441        TypeDef {
12442            proc: self.proc.clone(),
12443            selection: query,
12444            graphql_client: self.graphql_client.clone(),
12445        }
12446    }
12447    /// Returns a TypeDef of kind Object with the provided name.
12448    /// 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.
12449    ///
12450    /// # Arguments
12451    ///
12452    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12453    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
12454        let mut query = self.selection.select("withObject");
12455        query = query.arg("name", name.into());
12456        TypeDef {
12457            proc: self.proc.clone(),
12458            selection: query,
12459            graphql_client: self.graphql_client.clone(),
12460        }
12461    }
12462    /// Returns a TypeDef of kind Object with the provided name.
12463    /// 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.
12464    ///
12465    /// # Arguments
12466    ///
12467    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12468    pub fn with_object_opts<'a>(
12469        &self,
12470        name: impl Into<String>,
12471        opts: TypeDefWithObjectOpts<'a>,
12472    ) -> TypeDef {
12473        let mut query = self.selection.select("withObject");
12474        query = query.arg("name", name.into());
12475        if let Some(description) = opts.description {
12476            query = query.arg("description", description);
12477        }
12478        if let Some(source_map) = opts.source_map {
12479            query = query.arg("sourceMap", source_map);
12480        }
12481        TypeDef {
12482            proc: self.proc.clone(),
12483            selection: query,
12484            graphql_client: self.graphql_client.clone(),
12485        }
12486    }
12487    /// Sets whether this type can be set to null.
12488    pub fn with_optional(&self, optional: bool) -> TypeDef {
12489        let mut query = self.selection.select("withOptional");
12490        query = query.arg("optional", optional);
12491        TypeDef {
12492            proc: self.proc.clone(),
12493            selection: query,
12494            graphql_client: self.graphql_client.clone(),
12495        }
12496    }
12497    /// Returns a TypeDef of kind Scalar with the provided name.
12498    ///
12499    /// # Arguments
12500    ///
12501    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12502    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
12503        let mut query = self.selection.select("withScalar");
12504        query = query.arg("name", name.into());
12505        TypeDef {
12506            proc: self.proc.clone(),
12507            selection: query,
12508            graphql_client: self.graphql_client.clone(),
12509        }
12510    }
12511    /// Returns a TypeDef of kind Scalar with the provided name.
12512    ///
12513    /// # Arguments
12514    ///
12515    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12516    pub fn with_scalar_opts<'a>(
12517        &self,
12518        name: impl Into<String>,
12519        opts: TypeDefWithScalarOpts<'a>,
12520    ) -> TypeDef {
12521        let mut query = self.selection.select("withScalar");
12522        query = query.arg("name", name.into());
12523        if let Some(description) = opts.description {
12524            query = query.arg("description", description);
12525        }
12526        TypeDef {
12527            proc: self.proc.clone(),
12528            selection: query,
12529            graphql_client: self.graphql_client.clone(),
12530        }
12531    }
12532}
12533#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12534pub enum CacheSharingMode {
12535    #[serde(rename = "LOCKED")]
12536    Locked,
12537    #[serde(rename = "PRIVATE")]
12538    Private,
12539    #[serde(rename = "SHARED")]
12540    Shared,
12541}
12542#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12543pub enum ExistsType {
12544    #[serde(rename = "DIRECTORY_TYPE")]
12545    DirectoryType,
12546    #[serde(rename = "REGULAR_TYPE")]
12547    RegularType,
12548    #[serde(rename = "SYMLINK_TYPE")]
12549    SymlinkType,
12550}
12551#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12552pub enum ImageLayerCompression {
12553    #[serde(rename = "EStarGZ")]
12554    EStarGz,
12555    #[serde(rename = "ESTARGZ")]
12556    Estargz,
12557    #[serde(rename = "Gzip")]
12558    Gzip,
12559    #[serde(rename = "Uncompressed")]
12560    Uncompressed,
12561    #[serde(rename = "Zstd")]
12562    Zstd,
12563}
12564#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12565pub enum ImageMediaTypes {
12566    #[serde(rename = "DOCKER")]
12567    Docker,
12568    #[serde(rename = "DockerMediaTypes")]
12569    DockerMediaTypes,
12570    #[serde(rename = "OCI")]
12571    Oci,
12572    #[serde(rename = "OCIMediaTypes")]
12573    OciMediaTypes,
12574}
12575#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12576pub enum ModuleSourceKind {
12577    #[serde(rename = "DIR")]
12578    Dir,
12579    #[serde(rename = "DIR_SOURCE")]
12580    DirSource,
12581    #[serde(rename = "GIT")]
12582    Git,
12583    #[serde(rename = "GIT_SOURCE")]
12584    GitSource,
12585    #[serde(rename = "LOCAL")]
12586    Local,
12587    #[serde(rename = "LOCAL_SOURCE")]
12588    LocalSource,
12589}
12590#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12591pub enum NetworkProtocol {
12592    #[serde(rename = "TCP")]
12593    Tcp,
12594    #[serde(rename = "UDP")]
12595    Udp,
12596}
12597#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12598pub enum ReturnType {
12599    #[serde(rename = "ANY")]
12600    Any,
12601    #[serde(rename = "FAILURE")]
12602    Failure,
12603    #[serde(rename = "SUCCESS")]
12604    Success,
12605}
12606#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12607pub enum TypeDefKind {
12608    #[serde(rename = "BOOLEAN")]
12609    Boolean,
12610    #[serde(rename = "BOOLEAN_KIND")]
12611    BooleanKind,
12612    #[serde(rename = "ENUM")]
12613    Enum,
12614    #[serde(rename = "ENUM_KIND")]
12615    EnumKind,
12616    #[serde(rename = "FLOAT")]
12617    Float,
12618    #[serde(rename = "FLOAT_KIND")]
12619    FloatKind,
12620    #[serde(rename = "INPUT")]
12621    Input,
12622    #[serde(rename = "INPUT_KIND")]
12623    InputKind,
12624    #[serde(rename = "INTEGER")]
12625    Integer,
12626    #[serde(rename = "INTEGER_KIND")]
12627    IntegerKind,
12628    #[serde(rename = "INTERFACE")]
12629    Interface,
12630    #[serde(rename = "INTERFACE_KIND")]
12631    InterfaceKind,
12632    #[serde(rename = "LIST")]
12633    List,
12634    #[serde(rename = "LIST_KIND")]
12635    ListKind,
12636    #[serde(rename = "OBJECT")]
12637    Object,
12638    #[serde(rename = "OBJECT_KIND")]
12639    ObjectKind,
12640    #[serde(rename = "SCALAR")]
12641    Scalar,
12642    #[serde(rename = "SCALAR_KIND")]
12643    ScalarKind,
12644    #[serde(rename = "STRING")]
12645    String,
12646    #[serde(rename = "STRING_KIND")]
12647    StringKind,
12648    #[serde(rename = "VOID")]
12649    Void,
12650    #[serde(rename = "VOID_KIND")]
12651    VoidKind,
12652}