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 gitignore: Option<bool>,
1836    #[builder(setter(into, strip_option), default)]
1837    pub include: Option<Vec<&'a str>>,
1838    #[builder(setter(into, strip_option), default)]
1839    pub no_cache: Option<bool>,
1840}
1841#[derive(Builder, Debug, PartialEq)]
1842pub struct AddressFileOpts<'a> {
1843    #[builder(setter(into, strip_option), default)]
1844    pub exclude: Option<Vec<&'a str>>,
1845    #[builder(setter(into, strip_option), default)]
1846    pub gitignore: Option<bool>,
1847    #[builder(setter(into, strip_option), default)]
1848    pub include: Option<Vec<&'a str>>,
1849    #[builder(setter(into, strip_option), default)]
1850    pub no_cache: Option<bool>,
1851}
1852impl Address {
1853    /// Load a container from the address.
1854    pub fn container(&self) -> Container {
1855        let query = self.selection.select("container");
1856        Container {
1857            proc: self.proc.clone(),
1858            selection: query,
1859            graphql_client: self.graphql_client.clone(),
1860        }
1861    }
1862    /// Load a directory from the address.
1863    ///
1864    /// # Arguments
1865    ///
1866    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1867    pub fn directory(&self) -> Directory {
1868        let query = self.selection.select("directory");
1869        Directory {
1870            proc: self.proc.clone(),
1871            selection: query,
1872            graphql_client: self.graphql_client.clone(),
1873        }
1874    }
1875    /// Load a directory from the address.
1876    ///
1877    /// # Arguments
1878    ///
1879    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1880    pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
1881        let mut query = self.selection.select("directory");
1882        if let Some(exclude) = opts.exclude {
1883            query = query.arg("exclude", exclude);
1884        }
1885        if let Some(include) = opts.include {
1886            query = query.arg("include", include);
1887        }
1888        if let Some(gitignore) = opts.gitignore {
1889            query = query.arg("gitignore", gitignore);
1890        }
1891        if let Some(no_cache) = opts.no_cache {
1892            query = query.arg("noCache", no_cache);
1893        }
1894        Directory {
1895            proc: self.proc.clone(),
1896            selection: query,
1897            graphql_client: self.graphql_client.clone(),
1898        }
1899    }
1900    /// Load a file from the address.
1901    ///
1902    /// # Arguments
1903    ///
1904    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1905    pub fn file(&self) -> File {
1906        let query = self.selection.select("file");
1907        File {
1908            proc: self.proc.clone(),
1909            selection: query,
1910            graphql_client: self.graphql_client.clone(),
1911        }
1912    }
1913    /// Load a file from the address.
1914    ///
1915    /// # Arguments
1916    ///
1917    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
1918    pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
1919        let mut query = self.selection.select("file");
1920        if let Some(exclude) = opts.exclude {
1921            query = query.arg("exclude", exclude);
1922        }
1923        if let Some(include) = opts.include {
1924            query = query.arg("include", include);
1925        }
1926        if let Some(gitignore) = opts.gitignore {
1927            query = query.arg("gitignore", gitignore);
1928        }
1929        if let Some(no_cache) = opts.no_cache {
1930            query = query.arg("noCache", no_cache);
1931        }
1932        File {
1933            proc: self.proc.clone(),
1934            selection: query,
1935            graphql_client: self.graphql_client.clone(),
1936        }
1937    }
1938    /// Load a git ref (branch, tag or commit) from the address.
1939    pub fn git_ref(&self) -> GitRef {
1940        let query = self.selection.select("gitRef");
1941        GitRef {
1942            proc: self.proc.clone(),
1943            selection: query,
1944            graphql_client: self.graphql_client.clone(),
1945        }
1946    }
1947    /// Load a git repository from the address.
1948    pub fn git_repository(&self) -> GitRepository {
1949        let query = self.selection.select("gitRepository");
1950        GitRepository {
1951            proc: self.proc.clone(),
1952            selection: query,
1953            graphql_client: self.graphql_client.clone(),
1954        }
1955    }
1956    /// A unique identifier for this Address.
1957    pub async fn id(&self) -> Result<AddressId, DaggerError> {
1958        let query = self.selection.select("id");
1959        query.execute(self.graphql_client.clone()).await
1960    }
1961    /// Load a secret from the address.
1962    pub fn secret(&self) -> Secret {
1963        let query = self.selection.select("secret");
1964        Secret {
1965            proc: self.proc.clone(),
1966            selection: query,
1967            graphql_client: self.graphql_client.clone(),
1968        }
1969    }
1970    /// Load a service from the address.
1971    pub fn service(&self) -> Service {
1972        let query = self.selection.select("service");
1973        Service {
1974            proc: self.proc.clone(),
1975            selection: query,
1976            graphql_client: self.graphql_client.clone(),
1977        }
1978    }
1979    /// Load a local socket from the address.
1980    pub fn socket(&self) -> Socket {
1981        let query = self.selection.select("socket");
1982        Socket {
1983            proc: self.proc.clone(),
1984            selection: query,
1985            graphql_client: self.graphql_client.clone(),
1986        }
1987    }
1988    /// The address value
1989    pub async fn value(&self) -> Result<String, DaggerError> {
1990        let query = self.selection.select("value");
1991        query.execute(self.graphql_client.clone()).await
1992    }
1993}
1994#[derive(Clone)]
1995pub struct Binding {
1996    pub proc: Option<Arc<DaggerSessionProc>>,
1997    pub selection: Selection,
1998    pub graphql_client: DynGraphQLClient,
1999}
2000impl Binding {
2001    /// Retrieve the binding value, as type Address
2002    pub fn as_address(&self) -> Address {
2003        let query = self.selection.select("asAddress");
2004        Address {
2005            proc: self.proc.clone(),
2006            selection: query,
2007            graphql_client: self.graphql_client.clone(),
2008        }
2009    }
2010    /// Retrieve the binding value, as type CacheVolume
2011    pub fn as_cache_volume(&self) -> CacheVolume {
2012        let query = self.selection.select("asCacheVolume");
2013        CacheVolume {
2014            proc: self.proc.clone(),
2015            selection: query,
2016            graphql_client: self.graphql_client.clone(),
2017        }
2018    }
2019    /// Retrieve the binding value, as type Changeset
2020    pub fn as_changeset(&self) -> Changeset {
2021        let query = self.selection.select("asChangeset");
2022        Changeset {
2023            proc: self.proc.clone(),
2024            selection: query,
2025            graphql_client: self.graphql_client.clone(),
2026        }
2027    }
2028    /// Retrieve the binding value, as type Cloud
2029    pub fn as_cloud(&self) -> Cloud {
2030        let query = self.selection.select("asCloud");
2031        Cloud {
2032            proc: self.proc.clone(),
2033            selection: query,
2034            graphql_client: self.graphql_client.clone(),
2035        }
2036    }
2037    /// Retrieve the binding value, as type Container
2038    pub fn as_container(&self) -> Container {
2039        let query = self.selection.select("asContainer");
2040        Container {
2041            proc: self.proc.clone(),
2042            selection: query,
2043            graphql_client: self.graphql_client.clone(),
2044        }
2045    }
2046    /// Retrieve the binding value, as type Directory
2047    pub fn as_directory(&self) -> Directory {
2048        let query = self.selection.select("asDirectory");
2049        Directory {
2050            proc: self.proc.clone(),
2051            selection: query,
2052            graphql_client: self.graphql_client.clone(),
2053        }
2054    }
2055    /// Retrieve the binding value, as type Env
2056    pub fn as_env(&self) -> Env {
2057        let query = self.selection.select("asEnv");
2058        Env {
2059            proc: self.proc.clone(),
2060            selection: query,
2061            graphql_client: self.graphql_client.clone(),
2062        }
2063    }
2064    /// Retrieve the binding value, as type EnvFile
2065    pub fn as_env_file(&self) -> EnvFile {
2066        let query = self.selection.select("asEnvFile");
2067        EnvFile {
2068            proc: self.proc.clone(),
2069            selection: query,
2070            graphql_client: self.graphql_client.clone(),
2071        }
2072    }
2073    /// Retrieve the binding value, as type File
2074    pub fn as_file(&self) -> File {
2075        let query = self.selection.select("asFile");
2076        File {
2077            proc: self.proc.clone(),
2078            selection: query,
2079            graphql_client: self.graphql_client.clone(),
2080        }
2081    }
2082    /// Retrieve the binding value, as type GitRef
2083    pub fn as_git_ref(&self) -> GitRef {
2084        let query = self.selection.select("asGitRef");
2085        GitRef {
2086            proc: self.proc.clone(),
2087            selection: query,
2088            graphql_client: self.graphql_client.clone(),
2089        }
2090    }
2091    /// Retrieve the binding value, as type GitRepository
2092    pub fn as_git_repository(&self) -> GitRepository {
2093        let query = self.selection.select("asGitRepository");
2094        GitRepository {
2095            proc: self.proc.clone(),
2096            selection: query,
2097            graphql_client: self.graphql_client.clone(),
2098        }
2099    }
2100    /// Retrieve the binding value, as type JSONValue
2101    pub fn as_json_value(&self) -> JsonValue {
2102        let query = self.selection.select("asJSONValue");
2103        JsonValue {
2104            proc: self.proc.clone(),
2105            selection: query,
2106            graphql_client: self.graphql_client.clone(),
2107        }
2108    }
2109    /// Retrieve the binding value, as type Module
2110    pub fn as_module(&self) -> Module {
2111        let query = self.selection.select("asModule");
2112        Module {
2113            proc: self.proc.clone(),
2114            selection: query,
2115            graphql_client: self.graphql_client.clone(),
2116        }
2117    }
2118    /// Retrieve the binding value, as type ModuleConfigClient
2119    pub fn as_module_config_client(&self) -> ModuleConfigClient {
2120        let query = self.selection.select("asModuleConfigClient");
2121        ModuleConfigClient {
2122            proc: self.proc.clone(),
2123            selection: query,
2124            graphql_client: self.graphql_client.clone(),
2125        }
2126    }
2127    /// Retrieve the binding value, as type ModuleSource
2128    pub fn as_module_source(&self) -> ModuleSource {
2129        let query = self.selection.select("asModuleSource");
2130        ModuleSource {
2131            proc: self.proc.clone(),
2132            selection: query,
2133            graphql_client: self.graphql_client.clone(),
2134        }
2135    }
2136    /// Retrieve the binding value, as type SearchResult
2137    pub fn as_search_result(&self) -> SearchResult {
2138        let query = self.selection.select("asSearchResult");
2139        SearchResult {
2140            proc: self.proc.clone(),
2141            selection: query,
2142            graphql_client: self.graphql_client.clone(),
2143        }
2144    }
2145    /// Retrieve the binding value, as type SearchSubmatch
2146    pub fn as_search_submatch(&self) -> SearchSubmatch {
2147        let query = self.selection.select("asSearchSubmatch");
2148        SearchSubmatch {
2149            proc: self.proc.clone(),
2150            selection: query,
2151            graphql_client: self.graphql_client.clone(),
2152        }
2153    }
2154    /// Retrieve the binding value, as type Secret
2155    pub fn as_secret(&self) -> Secret {
2156        let query = self.selection.select("asSecret");
2157        Secret {
2158            proc: self.proc.clone(),
2159            selection: query,
2160            graphql_client: self.graphql_client.clone(),
2161        }
2162    }
2163    /// Retrieve the binding value, as type Service
2164    pub fn as_service(&self) -> Service {
2165        let query = self.selection.select("asService");
2166        Service {
2167            proc: self.proc.clone(),
2168            selection: query,
2169            graphql_client: self.graphql_client.clone(),
2170        }
2171    }
2172    /// Retrieve the binding value, as type Socket
2173    pub fn as_socket(&self) -> Socket {
2174        let query = self.selection.select("asSocket");
2175        Socket {
2176            proc: self.proc.clone(),
2177            selection: query,
2178            graphql_client: self.graphql_client.clone(),
2179        }
2180    }
2181    /// Returns the binding's string value
2182    pub async fn as_string(&self) -> Result<String, DaggerError> {
2183        let query = self.selection.select("asString");
2184        query.execute(self.graphql_client.clone()).await
2185    }
2186    /// Returns the digest of the binding value
2187    pub async fn digest(&self) -> Result<String, DaggerError> {
2188        let query = self.selection.select("digest");
2189        query.execute(self.graphql_client.clone()).await
2190    }
2191    /// A unique identifier for this Binding.
2192    pub async fn id(&self) -> Result<BindingId, DaggerError> {
2193        let query = self.selection.select("id");
2194        query.execute(self.graphql_client.clone()).await
2195    }
2196    /// Returns true if the binding is null
2197    pub async fn is_null(&self) -> Result<bool, DaggerError> {
2198        let query = self.selection.select("isNull");
2199        query.execute(self.graphql_client.clone()).await
2200    }
2201    /// Returns the binding name
2202    pub async fn name(&self) -> Result<String, DaggerError> {
2203        let query = self.selection.select("name");
2204        query.execute(self.graphql_client.clone()).await
2205    }
2206    /// Returns the binding type
2207    pub async fn type_name(&self) -> Result<String, DaggerError> {
2208        let query = self.selection.select("typeName");
2209        query.execute(self.graphql_client.clone()).await
2210    }
2211}
2212#[derive(Clone)]
2213pub struct CacheVolume {
2214    pub proc: Option<Arc<DaggerSessionProc>>,
2215    pub selection: Selection,
2216    pub graphql_client: DynGraphQLClient,
2217}
2218impl CacheVolume {
2219    /// A unique identifier for this CacheVolume.
2220    pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
2221        let query = self.selection.select("id");
2222        query.execute(self.graphql_client.clone()).await
2223    }
2224}
2225#[derive(Clone)]
2226pub struct Changeset {
2227    pub proc: Option<Arc<DaggerSessionProc>>,
2228    pub selection: Selection,
2229    pub graphql_client: DynGraphQLClient,
2230}
2231impl Changeset {
2232    /// Files and directories that were added in the newer directory.
2233    pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2234        let query = self.selection.select("addedPaths");
2235        query.execute(self.graphql_client.clone()).await
2236    }
2237    /// The newer/upper snapshot.
2238    pub fn after(&self) -> Directory {
2239        let query = self.selection.select("after");
2240        Directory {
2241            proc: self.proc.clone(),
2242            selection: query,
2243            graphql_client: self.graphql_client.clone(),
2244        }
2245    }
2246    /// Return a Git-compatible patch of the changes
2247    pub fn as_patch(&self) -> File {
2248        let query = self.selection.select("asPatch");
2249        File {
2250            proc: self.proc.clone(),
2251            selection: query,
2252            graphql_client: self.graphql_client.clone(),
2253        }
2254    }
2255    /// The older/lower snapshot to compare against.
2256    pub fn before(&self) -> Directory {
2257        let query = self.selection.select("before");
2258        Directory {
2259            proc: self.proc.clone(),
2260            selection: query,
2261            graphql_client: self.graphql_client.clone(),
2262        }
2263    }
2264    /// Applies the diff represented by this changeset to a path on the host.
2265    ///
2266    /// # Arguments
2267    ///
2268    /// * `path` - Location of the copied directory (e.g., "logs/").
2269    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2270        let mut query = self.selection.select("export");
2271        query = query.arg("path", path.into());
2272        query.execute(self.graphql_client.clone()).await
2273    }
2274    /// A unique identifier for this Changeset.
2275    pub async fn id(&self) -> Result<ChangesetId, DaggerError> {
2276        let query = self.selection.select("id");
2277        query.execute(self.graphql_client.clone()).await
2278    }
2279    /// Returns true if the changeset is empty (i.e. there are no changes).
2280    pub async fn is_empty(&self) -> Result<bool, DaggerError> {
2281        let query = self.selection.select("isEmpty");
2282        query.execute(self.graphql_client.clone()).await
2283    }
2284    /// Return a snapshot containing only the created and modified files
2285    pub fn layer(&self) -> Directory {
2286        let query = self.selection.select("layer");
2287        Directory {
2288            proc: self.proc.clone(),
2289            selection: query,
2290            graphql_client: self.graphql_client.clone(),
2291        }
2292    }
2293    /// Files and directories that existed before and were updated in the newer directory.
2294    pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2295        let query = self.selection.select("modifiedPaths");
2296        query.execute(self.graphql_client.clone()).await
2297    }
2298    /// Files and directories that were removed. Directories are indicated by a trailing slash, and their child paths are not included.
2299    pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2300        let query = self.selection.select("removedPaths");
2301        query.execute(self.graphql_client.clone()).await
2302    }
2303    /// Force evaluation in the engine.
2304    pub async fn sync(&self) -> Result<ChangesetId, DaggerError> {
2305        let query = self.selection.select("sync");
2306        query.execute(self.graphql_client.clone()).await
2307    }
2308}
2309#[derive(Clone)]
2310pub struct Cloud {
2311    pub proc: Option<Arc<DaggerSessionProc>>,
2312    pub selection: Selection,
2313    pub graphql_client: DynGraphQLClient,
2314}
2315impl Cloud {
2316    /// A unique identifier for this Cloud.
2317    pub async fn id(&self) -> Result<CloudId, DaggerError> {
2318        let query = self.selection.select("id");
2319        query.execute(self.graphql_client.clone()).await
2320    }
2321    /// The trace URL for the current session
2322    pub async fn trace_url(&self) -> Result<String, DaggerError> {
2323        let query = self.selection.select("traceURL");
2324        query.execute(self.graphql_client.clone()).await
2325    }
2326}
2327#[derive(Clone)]
2328pub struct Container {
2329    pub proc: Option<Arc<DaggerSessionProc>>,
2330    pub selection: Selection,
2331    pub graphql_client: DynGraphQLClient,
2332}
2333#[derive(Builder, Debug, PartialEq)]
2334pub struct ContainerAsServiceOpts<'a> {
2335    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2336    /// If empty, the container's default command is used.
2337    #[builder(setter(into, strip_option), default)]
2338    pub args: Option<Vec<&'a str>>,
2339    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2340    #[builder(setter(into, strip_option), default)]
2341    pub expand: Option<bool>,
2342    /// Provides Dagger access to the executed command.
2343    #[builder(setter(into, strip_option), default)]
2344    pub experimental_privileged_nesting: Option<bool>,
2345    /// 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.
2346    #[builder(setter(into, strip_option), default)]
2347    pub insecure_root_capabilities: Option<bool>,
2348    /// If set, skip the automatic init process injected into containers by default.
2349    /// 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.
2350    #[builder(setter(into, strip_option), default)]
2351    pub no_init: Option<bool>,
2352    /// If the container has an entrypoint, prepend it to the args.
2353    #[builder(setter(into, strip_option), default)]
2354    pub use_entrypoint: Option<bool>,
2355}
2356#[derive(Builder, Debug, PartialEq)]
2357pub struct ContainerAsTarballOpts {
2358    /// Force each layer of the image to use the specified compression algorithm.
2359    /// 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.
2360    #[builder(setter(into, strip_option), default)]
2361    pub forced_compression: Option<ImageLayerCompression>,
2362    /// Use the specified media types for the image's layers.
2363    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2364    #[builder(setter(into, strip_option), default)]
2365    pub media_types: Option<ImageMediaTypes>,
2366    /// Identifiers for other platform specific containers.
2367    /// Used for multi-platform images.
2368    #[builder(setter(into, strip_option), default)]
2369    pub platform_variants: Option<Vec<ContainerId>>,
2370}
2371#[derive(Builder, Debug, PartialEq)]
2372pub struct ContainerDirectoryOpts {
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}
2377#[derive(Builder, Debug, PartialEq)]
2378pub struct ContainerExistsOpts {
2379    /// If specified, do not follow symlinks.
2380    #[builder(setter(into, strip_option), default)]
2381    pub do_not_follow_symlinks: Option<bool>,
2382    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
2383    #[builder(setter(into, strip_option), default)]
2384    pub expected_type: Option<ExistsType>,
2385}
2386#[derive(Builder, Debug, PartialEq)]
2387pub struct ContainerExportOpts {
2388    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2389    #[builder(setter(into, strip_option), default)]
2390    pub expand: Option<bool>,
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 ContainerExportImageOpts {
2406    /// Force each layer of the exported image to use the specified compression algorithm.
2407    /// 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.
2408    #[builder(setter(into, strip_option), default)]
2409    pub forced_compression: Option<ImageLayerCompression>,
2410    /// Use the specified media types for the exported image's layers.
2411    /// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
2412    #[builder(setter(into, strip_option), default)]
2413    pub media_types: Option<ImageMediaTypes>,
2414    /// Identifiers for other platform specific containers.
2415    /// Used for multi-platform image.
2416    #[builder(setter(into, strip_option), default)]
2417    pub platform_variants: Option<Vec<ContainerId>>,
2418}
2419#[derive(Builder, Debug, PartialEq)]
2420pub struct ContainerFileOpts {
2421    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2422    #[builder(setter(into, strip_option), default)]
2423    pub expand: Option<bool>,
2424}
2425#[derive(Builder, Debug, PartialEq)]
2426pub struct ContainerImportOpts<'a> {
2427    /// Identifies the tag to import from the archive, if the archive bundles multiple tags.
2428    #[builder(setter(into, strip_option), default)]
2429    pub tag: Option<&'a str>,
2430}
2431#[derive(Builder, Debug, PartialEq)]
2432pub struct ContainerPublishOpts {
2433    /// Force each layer of the published image to use the specified compression algorithm.
2434    /// 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.
2435    #[builder(setter(into, strip_option), default)]
2436    pub forced_compression: Option<ImageLayerCompression>,
2437    /// Use the specified media types for the published image's layers.
2438    /// Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
2439    #[builder(setter(into, strip_option), default)]
2440    pub media_types: Option<ImageMediaTypes>,
2441    /// Identifiers for other platform specific containers.
2442    /// Used for multi-platform image.
2443    #[builder(setter(into, strip_option), default)]
2444    pub platform_variants: Option<Vec<ContainerId>>,
2445}
2446#[derive(Builder, Debug, PartialEq)]
2447pub struct ContainerTerminalOpts<'a> {
2448    /// If set, override the container's default terminal command and invoke these command arguments instead.
2449    #[builder(setter(into, strip_option), default)]
2450    pub cmd: Option<Vec<&'a str>>,
2451    /// Provides Dagger access to the executed command.
2452    #[builder(setter(into, strip_option), default)]
2453    pub experimental_privileged_nesting: Option<bool>,
2454    /// 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.
2455    #[builder(setter(into, strip_option), default)]
2456    pub insecure_root_capabilities: Option<bool>,
2457}
2458#[derive(Builder, Debug, PartialEq)]
2459pub struct ContainerUpOpts<'a> {
2460    /// Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
2461    /// If empty, the container's default command is used.
2462    #[builder(setter(into, strip_option), default)]
2463    pub args: Option<Vec<&'a str>>,
2464    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2465    #[builder(setter(into, strip_option), default)]
2466    pub expand: Option<bool>,
2467    /// Provides Dagger access to the executed command.
2468    #[builder(setter(into, strip_option), default)]
2469    pub experimental_privileged_nesting: Option<bool>,
2470    /// 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.
2471    #[builder(setter(into, strip_option), default)]
2472    pub insecure_root_capabilities: Option<bool>,
2473    /// If set, skip the automatic init process injected into containers by default.
2474    /// 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.
2475    #[builder(setter(into, strip_option), default)]
2476    pub no_init: Option<bool>,
2477    /// List of frontend/backend port mappings to forward.
2478    /// Frontend is the port accepting traffic on the host, backend is the service port.
2479    #[builder(setter(into, strip_option), default)]
2480    pub ports: Option<Vec<PortForward>>,
2481    /// Bind each tunnel port to a random port on the host.
2482    #[builder(setter(into, strip_option), default)]
2483    pub random: Option<bool>,
2484    /// If the container has an entrypoint, prepend it to the args.
2485    #[builder(setter(into, strip_option), default)]
2486    pub use_entrypoint: Option<bool>,
2487}
2488#[derive(Builder, Debug, PartialEq)]
2489pub struct ContainerWithDefaultTerminalCmdOpts {
2490    /// Provides Dagger access to the executed command.
2491    #[builder(setter(into, strip_option), default)]
2492    pub experimental_privileged_nesting: Option<bool>,
2493    /// 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.
2494    #[builder(setter(into, strip_option), default)]
2495    pub insecure_root_capabilities: Option<bool>,
2496}
2497#[derive(Builder, Debug, PartialEq)]
2498pub struct ContainerWithDirectoryOpts<'a> {
2499    /// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
2500    #[builder(setter(into, strip_option), default)]
2501    pub exclude: Option<Vec<&'a str>>,
2502    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2503    #[builder(setter(into, strip_option), default)]
2504    pub expand: Option<bool>,
2505    /// Apply .gitignore rules when writing the directory.
2506    #[builder(setter(into, strip_option), default)]
2507    pub gitignore: Option<bool>,
2508    /// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
2509    #[builder(setter(into, strip_option), default)]
2510    pub include: Option<Vec<&'a str>>,
2511    /// A user:group to set for the directory and its contents.
2512    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2513    /// If the group is omitted, it defaults to the same as the user.
2514    #[builder(setter(into, strip_option), default)]
2515    pub owner: Option<&'a str>,
2516}
2517#[derive(Builder, Debug, PartialEq)]
2518pub struct ContainerWithEntrypointOpts {
2519    /// Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
2520    #[builder(setter(into, strip_option), default)]
2521    pub keep_default_args: Option<bool>,
2522}
2523#[derive(Builder, Debug, PartialEq)]
2524pub struct ContainerWithEnvVariableOpts {
2525    /// Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
2526    #[builder(setter(into, strip_option), default)]
2527    pub expand: Option<bool>,
2528}
2529#[derive(Builder, Debug, PartialEq)]
2530pub struct ContainerWithExecOpts<'a> {
2531    /// Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2532    #[builder(setter(into, strip_option), default)]
2533    pub expand: Option<bool>,
2534    /// Exit codes this command is allowed to exit with without error
2535    #[builder(setter(into, strip_option), default)]
2536    pub expect: Option<ReturnType>,
2537    /// Provides Dagger access to the executed command.
2538    #[builder(setter(into, strip_option), default)]
2539    pub experimental_privileged_nesting: Option<bool>,
2540    /// Execute the command with all root capabilities. Like --privileged in Docker
2541    /// 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.
2542    #[builder(setter(into, strip_option), default)]
2543    pub insecure_root_capabilities: Option<bool>,
2544    /// Skip the automatic init process injected into containers by default.
2545    /// 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.
2546    #[builder(setter(into, strip_option), default)]
2547    pub no_init: Option<bool>,
2548    /// Redirect the command's standard error to a file in the container. Example: "./stderr.txt"
2549    #[builder(setter(into, strip_option), default)]
2550    pub redirect_stderr: Option<&'a str>,
2551    /// Redirect the command's standard input from a file in the container. Example: "./stdin.txt"
2552    #[builder(setter(into, strip_option), default)]
2553    pub redirect_stdin: Option<&'a str>,
2554    /// Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
2555    #[builder(setter(into, strip_option), default)]
2556    pub redirect_stdout: Option<&'a str>,
2557    /// Content to write to the command's standard input. Example: "Hello world")
2558    #[builder(setter(into, strip_option), default)]
2559    pub stdin: Option<&'a str>,
2560    /// Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
2561    #[builder(setter(into, strip_option), default)]
2562    pub use_entrypoint: Option<bool>,
2563}
2564#[derive(Builder, Debug, PartialEq)]
2565pub struct ContainerWithExposedPortOpts<'a> {
2566    /// Port description. Example: "payment API endpoint"
2567    #[builder(setter(into, strip_option), default)]
2568    pub description: Option<&'a str>,
2569    /// Skip the health check when run as a service.
2570    #[builder(setter(into, strip_option), default)]
2571    pub experimental_skip_healthcheck: Option<bool>,
2572    /// Network protocol. Example: "tcp"
2573    #[builder(setter(into, strip_option), default)]
2574    pub protocol: Option<NetworkProtocol>,
2575}
2576#[derive(Builder, Debug, PartialEq)]
2577pub struct ContainerWithFileOpts<'a> {
2578    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2579    #[builder(setter(into, strip_option), default)]
2580    pub expand: Option<bool>,
2581    /// A user:group to set for the file.
2582    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2583    /// If the group is omitted, it defaults to the same as the user.
2584    #[builder(setter(into, strip_option), default)]
2585    pub owner: Option<&'a str>,
2586    /// Permissions of the new file. Example: 0600
2587    #[builder(setter(into, strip_option), default)]
2588    pub permissions: Option<isize>,
2589}
2590#[derive(Builder, Debug, PartialEq)]
2591pub struct ContainerWithFilesOpts<'a> {
2592    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2593    #[builder(setter(into, strip_option), default)]
2594    pub expand: Option<bool>,
2595    /// A user:group to set for the files.
2596    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2597    /// If the group is omitted, it defaults to the same as the user.
2598    #[builder(setter(into, strip_option), default)]
2599    pub owner: Option<&'a str>,
2600    /// Permission given to the copied files (e.g., 0600).
2601    #[builder(setter(into, strip_option), default)]
2602    pub permissions: Option<isize>,
2603}
2604#[derive(Builder, Debug, PartialEq)]
2605pub struct ContainerWithMountedCacheOpts<'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 cache directory.
2610    /// 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.
2611    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2612    /// If the group is omitted, it defaults to the same as the user.
2613    #[builder(setter(into, strip_option), default)]
2614    pub owner: Option<&'a str>,
2615    /// Sharing mode of the cache volume.
2616    #[builder(setter(into, strip_option), default)]
2617    pub sharing: Option<CacheSharingMode>,
2618    /// Identifier of the directory to use as the cache volume's root.
2619    #[builder(setter(into, strip_option), default)]
2620    pub source: Option<DirectoryId>,
2621}
2622#[derive(Builder, Debug, PartialEq)]
2623pub struct ContainerWithMountedDirectoryOpts<'a> {
2624    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2625    #[builder(setter(into, strip_option), default)]
2626    pub expand: Option<bool>,
2627    /// A user:group to set for the mounted directory and its contents.
2628    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2629    /// If the group is omitted, it defaults to the same as the user.
2630    #[builder(setter(into, strip_option), default)]
2631    pub owner: Option<&'a str>,
2632}
2633#[derive(Builder, Debug, PartialEq)]
2634pub struct ContainerWithMountedFileOpts<'a> {
2635    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2636    #[builder(setter(into, strip_option), default)]
2637    pub expand: Option<bool>,
2638    /// A user or user:group to set for the mounted file.
2639    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2640    /// If the group is omitted, it defaults to the same as the user.
2641    #[builder(setter(into, strip_option), default)]
2642    pub owner: Option<&'a str>,
2643}
2644#[derive(Builder, Debug, PartialEq)]
2645pub struct ContainerWithMountedSecretOpts<'a> {
2646    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2647    #[builder(setter(into, strip_option), default)]
2648    pub expand: Option<bool>,
2649    /// Permission given to the mounted secret (e.g., 0600).
2650    /// This option requires an owner to be set to be active.
2651    #[builder(setter(into, strip_option), default)]
2652    pub mode: Option<isize>,
2653    /// A user:group to set for the mounted secret.
2654    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2655    /// If the group is omitted, it defaults to the same as the user.
2656    #[builder(setter(into, strip_option), default)]
2657    pub owner: Option<&'a str>,
2658}
2659#[derive(Builder, Debug, PartialEq)]
2660pub struct ContainerWithMountedTempOpts {
2661    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2662    #[builder(setter(into, strip_option), default)]
2663    pub expand: Option<bool>,
2664    /// Size of the temporary directory in bytes.
2665    #[builder(setter(into, strip_option), default)]
2666    pub size: Option<isize>,
2667}
2668#[derive(Builder, Debug, PartialEq)]
2669pub struct ContainerWithNewFileOpts<'a> {
2670    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2671    #[builder(setter(into, strip_option), default)]
2672    pub expand: Option<bool>,
2673    /// A user:group to set for the file.
2674    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2675    /// If the group is omitted, it defaults to the same as the user.
2676    #[builder(setter(into, strip_option), default)]
2677    pub owner: Option<&'a str>,
2678    /// Permissions of the new file. Example: 0600
2679    #[builder(setter(into, strip_option), default)]
2680    pub permissions: Option<isize>,
2681}
2682#[derive(Builder, Debug, PartialEq)]
2683pub struct ContainerWithSymlinkOpts {
2684    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2685    #[builder(setter(into, strip_option), default)]
2686    pub expand: Option<bool>,
2687}
2688#[derive(Builder, Debug, PartialEq)]
2689pub struct ContainerWithUnixSocketOpts<'a> {
2690    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2691    #[builder(setter(into, strip_option), default)]
2692    pub expand: Option<bool>,
2693    /// A user:group to set for the mounted socket.
2694    /// The user and group can either be an ID (1000:1000) or a name (foo:bar).
2695    /// If the group is omitted, it defaults to the same as the user.
2696    #[builder(setter(into, strip_option), default)]
2697    pub owner: Option<&'a str>,
2698}
2699#[derive(Builder, Debug, PartialEq)]
2700pub struct ContainerWithWorkdirOpts {
2701    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2702    #[builder(setter(into, strip_option), default)]
2703    pub expand: Option<bool>,
2704}
2705#[derive(Builder, Debug, PartialEq)]
2706pub struct ContainerWithoutDirectoryOpts {
2707    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2708    #[builder(setter(into, strip_option), default)]
2709    pub expand: Option<bool>,
2710}
2711#[derive(Builder, Debug, PartialEq)]
2712pub struct ContainerWithoutEntrypointOpts {
2713    /// Don't remove the default arguments when unsetting the entrypoint.
2714    #[builder(setter(into, strip_option), default)]
2715    pub keep_default_args: Option<bool>,
2716}
2717#[derive(Builder, Debug, PartialEq)]
2718pub struct ContainerWithoutExposedPortOpts {
2719    /// Port protocol to unexpose
2720    #[builder(setter(into, strip_option), default)]
2721    pub protocol: Option<NetworkProtocol>,
2722}
2723#[derive(Builder, Debug, PartialEq)]
2724pub struct ContainerWithoutFileOpts {
2725    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2726    #[builder(setter(into, strip_option), default)]
2727    pub expand: Option<bool>,
2728}
2729#[derive(Builder, Debug, PartialEq)]
2730pub struct ContainerWithoutFilesOpts {
2731    /// Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
2732    #[builder(setter(into, strip_option), default)]
2733    pub expand: Option<bool>,
2734}
2735#[derive(Builder, Debug, PartialEq)]
2736pub struct ContainerWithoutMountOpts {
2737    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2738    #[builder(setter(into, strip_option), default)]
2739    pub expand: Option<bool>,
2740}
2741#[derive(Builder, Debug, PartialEq)]
2742pub struct ContainerWithoutUnixSocketOpts {
2743    /// Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
2744    #[builder(setter(into, strip_option), default)]
2745    pub expand: Option<bool>,
2746}
2747impl Container {
2748    /// Turn the container into a Service.
2749    /// Be sure to set any exposed ports before this conversion.
2750    ///
2751    /// # Arguments
2752    ///
2753    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2754    pub fn as_service(&self) -> Service {
2755        let query = self.selection.select("asService");
2756        Service {
2757            proc: self.proc.clone(),
2758            selection: query,
2759            graphql_client: self.graphql_client.clone(),
2760        }
2761    }
2762    /// Turn the container into a Service.
2763    /// Be sure to set any exposed ports before this conversion.
2764    ///
2765    /// # Arguments
2766    ///
2767    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2768    pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2769        let mut query = self.selection.select("asService");
2770        if let Some(args) = opts.args {
2771            query = query.arg("args", args);
2772        }
2773        if let Some(use_entrypoint) = opts.use_entrypoint {
2774            query = query.arg("useEntrypoint", use_entrypoint);
2775        }
2776        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2777            query = query.arg(
2778                "experimentalPrivilegedNesting",
2779                experimental_privileged_nesting,
2780            );
2781        }
2782        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2783            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2784        }
2785        if let Some(expand) = opts.expand {
2786            query = query.arg("expand", expand);
2787        }
2788        if let Some(no_init) = opts.no_init {
2789            query = query.arg("noInit", no_init);
2790        }
2791        Service {
2792            proc: self.proc.clone(),
2793            selection: query,
2794            graphql_client: self.graphql_client.clone(),
2795        }
2796    }
2797    /// Package the container state as an OCI image, and return it as a tar archive
2798    ///
2799    /// # Arguments
2800    ///
2801    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2802    pub fn as_tarball(&self) -> File {
2803        let query = self.selection.select("asTarball");
2804        File {
2805            proc: self.proc.clone(),
2806            selection: query,
2807            graphql_client: self.graphql_client.clone(),
2808        }
2809    }
2810    /// Package the container state as an OCI image, and return it as a tar archive
2811    ///
2812    /// # Arguments
2813    ///
2814    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2815    pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2816        let mut query = self.selection.select("asTarball");
2817        if let Some(platform_variants) = opts.platform_variants {
2818            query = query.arg("platformVariants", platform_variants);
2819        }
2820        if let Some(forced_compression) = opts.forced_compression {
2821            query = query.arg("forcedCompression", forced_compression);
2822        }
2823        if let Some(media_types) = opts.media_types {
2824            query = query.arg("mediaTypes", media_types);
2825        }
2826        File {
2827            proc: self.proc.clone(),
2828            selection: query,
2829            graphql_client: self.graphql_client.clone(),
2830        }
2831    }
2832    /// The combined buffered standard output and standard error stream of the last executed command
2833    /// Returns an error if no command was executed
2834    pub async fn combined_output(&self) -> Result<String, DaggerError> {
2835        let query = self.selection.select("combinedOutput");
2836        query.execute(self.graphql_client.clone()).await
2837    }
2838    /// Return the container's default arguments.
2839    pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2840        let query = self.selection.select("defaultArgs");
2841        query.execute(self.graphql_client.clone()).await
2842    }
2843    /// Retrieve a directory from the container's root filesystem
2844    /// Mounts are included.
2845    ///
2846    /// # Arguments
2847    ///
2848    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2849    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2850    pub fn directory(&self, path: impl Into<String>) -> Directory {
2851        let mut query = self.selection.select("directory");
2852        query = query.arg("path", path.into());
2853        Directory {
2854            proc: self.proc.clone(),
2855            selection: query,
2856            graphql_client: self.graphql_client.clone(),
2857        }
2858    }
2859    /// Retrieve a directory from the container's root filesystem
2860    /// Mounts are included.
2861    ///
2862    /// # Arguments
2863    ///
2864    /// * `path` - The path of the directory to retrieve (e.g., "./src").
2865    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2866    pub fn directory_opts(
2867        &self,
2868        path: impl Into<String>,
2869        opts: ContainerDirectoryOpts,
2870    ) -> Directory {
2871        let mut query = self.selection.select("directory");
2872        query = query.arg("path", path.into());
2873        if let Some(expand) = opts.expand {
2874            query = query.arg("expand", expand);
2875        }
2876        Directory {
2877            proc: self.proc.clone(),
2878            selection: query,
2879            graphql_client: self.graphql_client.clone(),
2880        }
2881    }
2882    /// Return the container's OCI entrypoint.
2883    pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2884        let query = self.selection.select("entrypoint");
2885        query.execute(self.graphql_client.clone()).await
2886    }
2887    /// Retrieves the value of the specified environment variable.
2888    ///
2889    /// # Arguments
2890    ///
2891    /// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
2892    pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2893        let mut query = self.selection.select("envVariable");
2894        query = query.arg("name", name.into());
2895        query.execute(self.graphql_client.clone()).await
2896    }
2897    /// Retrieves the list of environment variables passed to commands.
2898    pub fn env_variables(&self) -> Vec<EnvVariable> {
2899        let query = self.selection.select("envVariables");
2900        vec![EnvVariable {
2901            proc: self.proc.clone(),
2902            selection: query,
2903            graphql_client: self.graphql_client.clone(),
2904        }]
2905    }
2906    /// check if a file or directory exists
2907    ///
2908    /// # Arguments
2909    ///
2910    /// * `path` - Path to check (e.g., "/file.txt").
2911    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2912    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2913        let mut query = self.selection.select("exists");
2914        query = query.arg("path", path.into());
2915        query.execute(self.graphql_client.clone()).await
2916    }
2917    /// check if a file or directory exists
2918    ///
2919    /// # Arguments
2920    ///
2921    /// * `path` - Path to check (e.g., "/file.txt").
2922    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2923    pub async fn exists_opts(
2924        &self,
2925        path: impl Into<String>,
2926        opts: ContainerExistsOpts,
2927    ) -> Result<bool, DaggerError> {
2928        let mut query = self.selection.select("exists");
2929        query = query.arg("path", path.into());
2930        if let Some(expected_type) = opts.expected_type {
2931            query = query.arg("expectedType", expected_type);
2932        }
2933        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2934            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2935        }
2936        query.execute(self.graphql_client.clone()).await
2937    }
2938    /// The exit code of the last executed command
2939    /// Returns an error if no command was executed
2940    pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2941        let query = self.selection.select("exitCode");
2942        query.execute(self.graphql_client.clone()).await
2943    }
2944    /// EXPERIMENTAL API! Subject to change/removal at any time.
2945    /// Configures all available GPUs on the host to be accessible to this container.
2946    /// This currently works for Nvidia devices only.
2947    pub fn experimental_with_all_gp_us(&self) -> Container {
2948        let query = self.selection.select("experimentalWithAllGPUs");
2949        Container {
2950            proc: self.proc.clone(),
2951            selection: query,
2952            graphql_client: self.graphql_client.clone(),
2953        }
2954    }
2955    /// EXPERIMENTAL API! Subject to change/removal at any time.
2956    /// Configures the provided list of devices to be accessible to this container.
2957    /// This currently works for Nvidia devices only.
2958    ///
2959    /// # Arguments
2960    ///
2961    /// * `devices` - List of devices to be accessible to this container.
2962    pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2963        let mut query = self.selection.select("experimentalWithGPU");
2964        query = query.arg(
2965            "devices",
2966            devices
2967                .into_iter()
2968                .map(|i| i.into())
2969                .collect::<Vec<String>>(),
2970        );
2971        Container {
2972            proc: self.proc.clone(),
2973            selection: query,
2974            graphql_client: self.graphql_client.clone(),
2975        }
2976    }
2977    /// Writes the container as an OCI tarball to the destination file path on the host.
2978    /// It can also export platform variants.
2979    ///
2980    /// # Arguments
2981    ///
2982    /// * `path` - Host's destination path (e.g., "./tarball").
2983    ///
2984    /// Path can be relative to the engine's workdir or absolute.
2985    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
2986    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2987        let mut query = self.selection.select("export");
2988        query = query.arg("path", path.into());
2989        query.execute(self.graphql_client.clone()).await
2990    }
2991    /// Writes the container as an OCI tarball to the destination file path on the host.
2992    /// It can also export platform variants.
2993    ///
2994    /// # Arguments
2995    ///
2996    /// * `path` - Host's destination path (e.g., "./tarball").
2997    ///
2998    /// Path can be relative to the engine's workdir or absolute.
2999    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3000    pub async fn export_opts(
3001        &self,
3002        path: impl Into<String>,
3003        opts: ContainerExportOpts,
3004    ) -> Result<String, DaggerError> {
3005        let mut query = self.selection.select("export");
3006        query = query.arg("path", path.into());
3007        if let Some(platform_variants) = opts.platform_variants {
3008            query = query.arg("platformVariants", platform_variants);
3009        }
3010        if let Some(forced_compression) = opts.forced_compression {
3011            query = query.arg("forcedCompression", forced_compression);
3012        }
3013        if let Some(media_types) = opts.media_types {
3014            query = query.arg("mediaTypes", media_types);
3015        }
3016        if let Some(expand) = opts.expand {
3017            query = query.arg("expand", expand);
3018        }
3019        query.execute(self.graphql_client.clone()).await
3020    }
3021    /// Exports the container as an image to the host's container image store.
3022    ///
3023    /// # Arguments
3024    ///
3025    /// * `name` - Name of image to export to in the host's store
3026    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3027    pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
3028        let mut query = self.selection.select("exportImage");
3029        query = query.arg("name", name.into());
3030        query.execute(self.graphql_client.clone()).await
3031    }
3032    /// Exports the container as an image to the host's container image store.
3033    ///
3034    /// # Arguments
3035    ///
3036    /// * `name` - Name of image to export to in the host's store
3037    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3038    pub async fn export_image_opts(
3039        &self,
3040        name: impl Into<String>,
3041        opts: ContainerExportImageOpts,
3042    ) -> Result<Void, DaggerError> {
3043        let mut query = self.selection.select("exportImage");
3044        query = query.arg("name", name.into());
3045        if let Some(platform_variants) = opts.platform_variants {
3046            query = query.arg("platformVariants", platform_variants);
3047        }
3048        if let Some(forced_compression) = opts.forced_compression {
3049            query = query.arg("forcedCompression", forced_compression);
3050        }
3051        if let Some(media_types) = opts.media_types {
3052            query = query.arg("mediaTypes", media_types);
3053        }
3054        query.execute(self.graphql_client.clone()).await
3055    }
3056    /// Retrieves the list of exposed ports.
3057    /// This includes ports already exposed by the image, even if not explicitly added with dagger.
3058    pub fn exposed_ports(&self) -> Vec<Port> {
3059        let query = self.selection.select("exposedPorts");
3060        vec![Port {
3061            proc: self.proc.clone(),
3062            selection: query,
3063            graphql_client: self.graphql_client.clone(),
3064        }]
3065    }
3066    /// Retrieves a file at the given path.
3067    /// Mounts are included.
3068    ///
3069    /// # Arguments
3070    ///
3071    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3072    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3073    pub fn file(&self, path: impl Into<String>) -> File {
3074        let mut query = self.selection.select("file");
3075        query = query.arg("path", path.into());
3076        File {
3077            proc: self.proc.clone(),
3078            selection: query,
3079            graphql_client: self.graphql_client.clone(),
3080        }
3081    }
3082    /// Retrieves a file at the given path.
3083    /// Mounts are included.
3084    ///
3085    /// # Arguments
3086    ///
3087    /// * `path` - The path of the file to retrieve (e.g., "./README.md").
3088    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3089    pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3090        let mut query = self.selection.select("file");
3091        query = query.arg("path", path.into());
3092        if let Some(expand) = opts.expand {
3093            query = query.arg("expand", expand);
3094        }
3095        File {
3096            proc: self.proc.clone(),
3097            selection: query,
3098            graphql_client: self.graphql_client.clone(),
3099        }
3100    }
3101    /// Download a container image, and apply it to the container state. All previous state will be lost.
3102    ///
3103    /// # Arguments
3104    ///
3105    /// * `address` - Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
3106    pub fn from(&self, address: impl Into<String>) -> Container {
3107        let mut query = self.selection.select("from");
3108        query = query.arg("address", address.into());
3109        Container {
3110            proc: self.proc.clone(),
3111            selection: query,
3112            graphql_client: self.graphql_client.clone(),
3113        }
3114    }
3115    /// A unique identifier for this Container.
3116    pub async fn id(&self) -> Result<ContainerId, DaggerError> {
3117        let query = self.selection.select("id");
3118        query.execute(self.graphql_client.clone()).await
3119    }
3120    /// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
3121    pub async fn image_ref(&self) -> Result<String, DaggerError> {
3122        let query = self.selection.select("imageRef");
3123        query.execute(self.graphql_client.clone()).await
3124    }
3125    /// Reads the container from an OCI tarball.
3126    ///
3127    /// # Arguments
3128    ///
3129    /// * `source` - File to read the container from.
3130    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3131    pub fn import(&self, source: impl IntoID<FileId>) -> Container {
3132        let mut query = self.selection.select("import");
3133        query = query.arg_lazy(
3134            "source",
3135            Box::new(move || {
3136                let source = source.clone();
3137                Box::pin(async move { source.into_id().await.unwrap().quote() })
3138            }),
3139        );
3140        Container {
3141            proc: self.proc.clone(),
3142            selection: query,
3143            graphql_client: self.graphql_client.clone(),
3144        }
3145    }
3146    /// Reads the container from an OCI tarball.
3147    ///
3148    /// # Arguments
3149    ///
3150    /// * `source` - File to read the container from.
3151    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3152    pub fn import_opts<'a>(
3153        &self,
3154        source: impl IntoID<FileId>,
3155        opts: ContainerImportOpts<'a>,
3156    ) -> Container {
3157        let mut query = self.selection.select("import");
3158        query = query.arg_lazy(
3159            "source",
3160            Box::new(move || {
3161                let source = source.clone();
3162                Box::pin(async move { source.into_id().await.unwrap().quote() })
3163            }),
3164        );
3165        if let Some(tag) = opts.tag {
3166            query = query.arg("tag", tag);
3167        }
3168        Container {
3169            proc: self.proc.clone(),
3170            selection: query,
3171            graphql_client: self.graphql_client.clone(),
3172        }
3173    }
3174    /// Retrieves the value of the specified label.
3175    ///
3176    /// # Arguments
3177    ///
3178    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3179    pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3180        let mut query = self.selection.select("label");
3181        query = query.arg("name", name.into());
3182        query.execute(self.graphql_client.clone()).await
3183    }
3184    /// Retrieves the list of labels passed to container.
3185    pub fn labels(&self) -> Vec<Label> {
3186        let query = self.selection.select("labels");
3187        vec![Label {
3188            proc: self.proc.clone(),
3189            selection: query,
3190            graphql_client: self.graphql_client.clone(),
3191        }]
3192    }
3193    /// Retrieves the list of paths where a directory is mounted.
3194    pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
3195        let query = self.selection.select("mounts");
3196        query.execute(self.graphql_client.clone()).await
3197    }
3198    /// The platform this container executes and publishes as.
3199    pub async fn platform(&self) -> Result<Platform, DaggerError> {
3200        let query = self.selection.select("platform");
3201        query.execute(self.graphql_client.clone()).await
3202    }
3203    /// Package the container state as an OCI image, and publish it to a registry
3204    /// Returns the fully qualified address of the published image, with digest
3205    ///
3206    /// # Arguments
3207    ///
3208    /// * `address` - The OCI address to publish to
3209    ///
3210    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
3211    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3212    pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
3213        let mut query = self.selection.select("publish");
3214        query = query.arg("address", address.into());
3215        query.execute(self.graphql_client.clone()).await
3216    }
3217    /// Package the container state as an OCI image, and publish it to a registry
3218    /// Returns the fully qualified address of the published image, with digest
3219    ///
3220    /// # Arguments
3221    ///
3222    /// * `address` - The OCI address to publish to
3223    ///
3224    /// Same format as "docker push". Example: "registry.example.com/user/repo:tag"
3225    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3226    pub async fn publish_opts(
3227        &self,
3228        address: impl Into<String>,
3229        opts: ContainerPublishOpts,
3230    ) -> Result<String, DaggerError> {
3231        let mut query = self.selection.select("publish");
3232        query = query.arg("address", address.into());
3233        if let Some(platform_variants) = opts.platform_variants {
3234            query = query.arg("platformVariants", platform_variants);
3235        }
3236        if let Some(forced_compression) = opts.forced_compression {
3237            query = query.arg("forcedCompression", forced_compression);
3238        }
3239        if let Some(media_types) = opts.media_types {
3240            query = query.arg("mediaTypes", media_types);
3241        }
3242        query.execute(self.graphql_client.clone()).await
3243    }
3244    /// 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.
3245    pub fn rootfs(&self) -> Directory {
3246        let query = self.selection.select("rootfs");
3247        Directory {
3248            proc: self.proc.clone(),
3249            selection: query,
3250            graphql_client: self.graphql_client.clone(),
3251        }
3252    }
3253    /// The buffered standard error stream of the last executed command
3254    /// Returns an error if no command was executed
3255    pub async fn stderr(&self) -> Result<String, DaggerError> {
3256        let query = self.selection.select("stderr");
3257        query.execute(self.graphql_client.clone()).await
3258    }
3259    /// The buffered standard output stream of the last executed command
3260    /// Returns an error if no command was executed
3261    pub async fn stdout(&self) -> Result<String, DaggerError> {
3262        let query = self.selection.select("stdout");
3263        query.execute(self.graphql_client.clone()).await
3264    }
3265    /// Forces evaluation of the pipeline in the engine.
3266    /// It doesn't run the default command if no exec has been set.
3267    pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
3268        let query = self.selection.select("sync");
3269        query.execute(self.graphql_client.clone()).await
3270    }
3271    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
3272    ///
3273    /// # Arguments
3274    ///
3275    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3276    pub fn terminal(&self) -> Container {
3277        let query = self.selection.select("terminal");
3278        Container {
3279            proc: self.proc.clone(),
3280            selection: query,
3281            graphql_client: self.graphql_client.clone(),
3282        }
3283    }
3284    /// Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
3285    ///
3286    /// # Arguments
3287    ///
3288    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3289    pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
3290        let mut query = self.selection.select("terminal");
3291        if let Some(cmd) = opts.cmd {
3292            query = query.arg("cmd", cmd);
3293        }
3294        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3295            query = query.arg(
3296                "experimentalPrivilegedNesting",
3297                experimental_privileged_nesting,
3298            );
3299        }
3300        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3301            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3302        }
3303        Container {
3304            proc: self.proc.clone(),
3305            selection: query,
3306            graphql_client: self.graphql_client.clone(),
3307        }
3308    }
3309    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3310    /// Be sure to set any exposed ports before calling this api.
3311    ///
3312    /// # Arguments
3313    ///
3314    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3315    pub async fn up(&self) -> Result<Void, DaggerError> {
3316        let query = self.selection.select("up");
3317        query.execute(self.graphql_client.clone()).await
3318    }
3319    /// Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.
3320    /// Be sure to set any exposed ports before calling this api.
3321    ///
3322    /// # Arguments
3323    ///
3324    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3325    pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
3326        let mut query = self.selection.select("up");
3327        if let Some(random) = opts.random {
3328            query = query.arg("random", random);
3329        }
3330        if let Some(ports) = opts.ports {
3331            query = query.arg("ports", ports);
3332        }
3333        if let Some(args) = opts.args {
3334            query = query.arg("args", args);
3335        }
3336        if let Some(use_entrypoint) = opts.use_entrypoint {
3337            query = query.arg("useEntrypoint", use_entrypoint);
3338        }
3339        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3340            query = query.arg(
3341                "experimentalPrivilegedNesting",
3342                experimental_privileged_nesting,
3343            );
3344        }
3345        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3346            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3347        }
3348        if let Some(expand) = opts.expand {
3349            query = query.arg("expand", expand);
3350        }
3351        if let Some(no_init) = opts.no_init {
3352            query = query.arg("noInit", no_init);
3353        }
3354        query.execute(self.graphql_client.clone()).await
3355    }
3356    /// Retrieves the user to be set for all commands.
3357    pub async fn user(&self) -> Result<String, DaggerError> {
3358        let query = self.selection.select("user");
3359        query.execute(self.graphql_client.clone()).await
3360    }
3361    /// Retrieves this container plus the given OCI anotation.
3362    ///
3363    /// # Arguments
3364    ///
3365    /// * `name` - The name of the annotation.
3366    /// * `value` - The value of the annotation.
3367    pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3368        let mut query = self.selection.select("withAnnotation");
3369        query = query.arg("name", name.into());
3370        query = query.arg("value", value.into());
3371        Container {
3372            proc: self.proc.clone(),
3373            selection: query,
3374            graphql_client: self.graphql_client.clone(),
3375        }
3376    }
3377    /// Configures default arguments for future commands. Like CMD in Dockerfile.
3378    ///
3379    /// # Arguments
3380    ///
3381    /// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
3382    pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
3383        let mut query = self.selection.select("withDefaultArgs");
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(&self, args: Vec<impl Into<String>>) -> Container {
3401        let mut query = self.selection.select("withDefaultTerminalCmd");
3402        query = query.arg(
3403            "args",
3404            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3405        );
3406        Container {
3407            proc: self.proc.clone(),
3408            selection: query,
3409            graphql_client: self.graphql_client.clone(),
3410        }
3411    }
3412    /// Set the default command to invoke for the container's terminal API.
3413    ///
3414    /// # Arguments
3415    ///
3416    /// * `args` - The args of the command.
3417    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3418    pub fn with_default_terminal_cmd_opts(
3419        &self,
3420        args: Vec<impl Into<String>>,
3421        opts: ContainerWithDefaultTerminalCmdOpts,
3422    ) -> Container {
3423        let mut query = self.selection.select("withDefaultTerminalCmd");
3424        query = query.arg(
3425            "args",
3426            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3427        );
3428        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3429            query = query.arg(
3430                "experimentalPrivilegedNesting",
3431                experimental_privileged_nesting,
3432            );
3433        }
3434        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3435            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3436        }
3437        Container {
3438            proc: self.proc.clone(),
3439            selection: query,
3440            graphql_client: self.graphql_client.clone(),
3441        }
3442    }
3443    /// Return a new container snapshot, with a directory added to its filesystem
3444    ///
3445    /// # Arguments
3446    ///
3447    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
3448    /// * `source` - Identifier of the directory to write
3449    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3450    pub fn with_directory(
3451        &self,
3452        path: impl Into<String>,
3453        source: impl IntoID<DirectoryId>,
3454    ) -> Container {
3455        let mut query = self.selection.select("withDirectory");
3456        query = query.arg("path", path.into());
3457        query = query.arg_lazy(
3458            "source",
3459            Box::new(move || {
3460                let source = source.clone();
3461                Box::pin(async move { source.into_id().await.unwrap().quote() })
3462            }),
3463        );
3464        Container {
3465            proc: self.proc.clone(),
3466            selection: query,
3467            graphql_client: self.graphql_client.clone(),
3468        }
3469    }
3470    /// Return a new container snapshot, with a directory added to its filesystem
3471    ///
3472    /// # Arguments
3473    ///
3474    /// * `path` - Location of the written directory (e.g., "/tmp/directory").
3475    /// * `source` - Identifier of the directory to write
3476    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3477    pub fn with_directory_opts<'a>(
3478        &self,
3479        path: impl Into<String>,
3480        source: impl IntoID<DirectoryId>,
3481        opts: ContainerWithDirectoryOpts<'a>,
3482    ) -> Container {
3483        let mut query = self.selection.select("withDirectory");
3484        query = query.arg("path", path.into());
3485        query = query.arg_lazy(
3486            "source",
3487            Box::new(move || {
3488                let source = source.clone();
3489                Box::pin(async move { source.into_id().await.unwrap().quote() })
3490            }),
3491        );
3492        if let Some(exclude) = opts.exclude {
3493            query = query.arg("exclude", exclude);
3494        }
3495        if let Some(include) = opts.include {
3496            query = query.arg("include", include);
3497        }
3498        if let Some(gitignore) = opts.gitignore {
3499            query = query.arg("gitignore", gitignore);
3500        }
3501        if let Some(owner) = opts.owner {
3502            query = query.arg("owner", owner);
3503        }
3504        if let Some(expand) = opts.expand {
3505            query = query.arg("expand", expand);
3506        }
3507        Container {
3508            proc: self.proc.clone(),
3509            selection: query,
3510            graphql_client: self.graphql_client.clone(),
3511        }
3512    }
3513    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
3514    ///
3515    /// # Arguments
3516    ///
3517    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
3518    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3519    pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
3520        let mut query = self.selection.select("withEntrypoint");
3521        query = query.arg(
3522            "args",
3523            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3524        );
3525        Container {
3526            proc: self.proc.clone(),
3527            selection: query,
3528            graphql_client: self.graphql_client.clone(),
3529        }
3530    }
3531    /// Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
3532    ///
3533    /// # Arguments
3534    ///
3535    /// * `args` - Arguments of the entrypoint. Example: ["go", "run"].
3536    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3537    pub fn with_entrypoint_opts(
3538        &self,
3539        args: Vec<impl Into<String>>,
3540        opts: ContainerWithEntrypointOpts,
3541    ) -> Container {
3542        let mut query = self.selection.select("withEntrypoint");
3543        query = query.arg(
3544            "args",
3545            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3546        );
3547        if let Some(keep_default_args) = opts.keep_default_args {
3548            query = query.arg("keepDefaultArgs", keep_default_args);
3549        }
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(
3564        &self,
3565        name: impl Into<String>,
3566        value: impl Into<String>,
3567    ) -> Container {
3568        let mut query = self.selection.select("withEnvVariable");
3569        query = query.arg("name", name.into());
3570        query = query.arg("value", value.into());
3571        Container {
3572            proc: self.proc.clone(),
3573            selection: query,
3574            graphql_client: self.graphql_client.clone(),
3575        }
3576    }
3577    /// Set a new environment variable in the container.
3578    ///
3579    /// # Arguments
3580    ///
3581    /// * `name` - Name of the environment variable (e.g., "HOST").
3582    /// * `value` - Value of the environment variable. (e.g., "localhost").
3583    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3584    pub fn with_env_variable_opts(
3585        &self,
3586        name: impl Into<String>,
3587        value: impl Into<String>,
3588        opts: ContainerWithEnvVariableOpts,
3589    ) -> Container {
3590        let mut query = self.selection.select("withEnvVariable");
3591        query = query.arg("name", name.into());
3592        query = query.arg("value", value.into());
3593        if let Some(expand) = opts.expand {
3594            query = query.arg("expand", expand);
3595        }
3596        Container {
3597            proc: self.proc.clone(),
3598            selection: query,
3599            graphql_client: self.graphql_client.clone(),
3600        }
3601    }
3602    /// Raise an error.
3603    ///
3604    /// # Arguments
3605    ///
3606    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
3607    pub fn with_error(&self, err: impl Into<String>) -> Container {
3608        let mut query = self.selection.select("withError");
3609        query = query.arg("err", err.into());
3610        Container {
3611            proc: self.proc.clone(),
3612            selection: query,
3613            graphql_client: self.graphql_client.clone(),
3614        }
3615    }
3616    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3617    ///
3618    /// # Arguments
3619    ///
3620    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3621    ///
3622    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3623    ///
3624    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3625    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3626    pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3627        let mut query = self.selection.select("withExec");
3628        query = query.arg(
3629            "args",
3630            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3631        );
3632        Container {
3633            proc: self.proc.clone(),
3634            selection: query,
3635            graphql_client: self.graphql_client.clone(),
3636        }
3637    }
3638    /// Execute a command in the container, and return a new snapshot of the container state after execution.
3639    ///
3640    /// # Arguments
3641    ///
3642    /// * `args` - Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
3643    ///
3644    /// To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
3645    ///
3646    /// Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
3647    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3648    pub fn with_exec_opts<'a>(
3649        &self,
3650        args: Vec<impl Into<String>>,
3651        opts: ContainerWithExecOpts<'a>,
3652    ) -> Container {
3653        let mut query = self.selection.select("withExec");
3654        query = query.arg(
3655            "args",
3656            args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3657        );
3658        if let Some(use_entrypoint) = opts.use_entrypoint {
3659            query = query.arg("useEntrypoint", use_entrypoint);
3660        }
3661        if let Some(stdin) = opts.stdin {
3662            query = query.arg("stdin", stdin);
3663        }
3664        if let Some(redirect_stdin) = opts.redirect_stdin {
3665            query = query.arg("redirectStdin", redirect_stdin);
3666        }
3667        if let Some(redirect_stdout) = opts.redirect_stdout {
3668            query = query.arg("redirectStdout", redirect_stdout);
3669        }
3670        if let Some(redirect_stderr) = opts.redirect_stderr {
3671            query = query.arg("redirectStderr", redirect_stderr);
3672        }
3673        if let Some(expect) = opts.expect {
3674            query = query.arg("expect", expect);
3675        }
3676        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3677            query = query.arg(
3678                "experimentalPrivilegedNesting",
3679                experimental_privileged_nesting,
3680            );
3681        }
3682        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3683            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3684        }
3685        if let Some(expand) = opts.expand {
3686            query = query.arg("expand", expand);
3687        }
3688        if let Some(no_init) = opts.no_init {
3689            query = query.arg("noInit", no_init);
3690        }
3691        Container {
3692            proc: self.proc.clone(),
3693            selection: query,
3694            graphql_client: self.graphql_client.clone(),
3695        }
3696    }
3697    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3698    /// Exposed ports serve two purposes:
3699    /// - For health checks and introspection, when running services
3700    /// - For setting the EXPOSE OCI field when publishing the container
3701    ///
3702    /// # Arguments
3703    ///
3704    /// * `port` - Port number to expose. Example: 8080
3705    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3706    pub fn with_exposed_port(&self, port: isize) -> Container {
3707        let mut query = self.selection.select("withExposedPort");
3708        query = query.arg("port", port);
3709        Container {
3710            proc: self.proc.clone(),
3711            selection: query,
3712            graphql_client: self.graphql_client.clone(),
3713        }
3714    }
3715    /// Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
3716    /// Exposed ports serve two purposes:
3717    /// - For health checks and introspection, when running services
3718    /// - For setting the EXPOSE OCI field when publishing the container
3719    ///
3720    /// # Arguments
3721    ///
3722    /// * `port` - Port number to expose. Example: 8080
3723    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3724    pub fn with_exposed_port_opts<'a>(
3725        &self,
3726        port: isize,
3727        opts: ContainerWithExposedPortOpts<'a>,
3728    ) -> Container {
3729        let mut query = self.selection.select("withExposedPort");
3730        query = query.arg("port", port);
3731        if let Some(protocol) = opts.protocol {
3732            query = query.arg("protocol", protocol);
3733        }
3734        if let Some(description) = opts.description {
3735            query = query.arg("description", description);
3736        }
3737        if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3738            query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3739        }
3740        Container {
3741            proc: self.proc.clone(),
3742            selection: query,
3743            graphql_client: self.graphql_client.clone(),
3744        }
3745    }
3746    /// Return a container snapshot with a file added
3747    ///
3748    /// # Arguments
3749    ///
3750    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3751    /// * `source` - File to add
3752    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3753    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
3754        let mut query = self.selection.select("withFile");
3755        query = query.arg("path", path.into());
3756        query = query.arg_lazy(
3757            "source",
3758            Box::new(move || {
3759                let source = source.clone();
3760                Box::pin(async move { source.into_id().await.unwrap().quote() })
3761            }),
3762        );
3763        Container {
3764            proc: self.proc.clone(),
3765            selection: query,
3766            graphql_client: self.graphql_client.clone(),
3767        }
3768    }
3769    /// Return a container snapshot with a file added
3770    ///
3771    /// # Arguments
3772    ///
3773    /// * `path` - Path of the new file. Example: "/path/to/new-file.txt"
3774    /// * `source` - File to add
3775    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3776    pub fn with_file_opts<'a>(
3777        &self,
3778        path: impl Into<String>,
3779        source: impl IntoID<FileId>,
3780        opts: ContainerWithFileOpts<'a>,
3781    ) -> Container {
3782        let mut query = self.selection.select("withFile");
3783        query = query.arg("path", path.into());
3784        query = query.arg_lazy(
3785            "source",
3786            Box::new(move || {
3787                let source = source.clone();
3788                Box::pin(async move { source.into_id().await.unwrap().quote() })
3789            }),
3790        );
3791        if let Some(permissions) = opts.permissions {
3792            query = query.arg("permissions", permissions);
3793        }
3794        if let Some(owner) = opts.owner {
3795            query = query.arg("owner", owner);
3796        }
3797        if let Some(expand) = opts.expand {
3798            query = query.arg("expand", expand);
3799        }
3800        Container {
3801            proc: self.proc.clone(),
3802            selection: query,
3803            graphql_client: self.graphql_client.clone(),
3804        }
3805    }
3806    /// Retrieves this container plus the contents of the given files copied to the given path.
3807    ///
3808    /// # Arguments
3809    ///
3810    /// * `path` - Location where copied files should be placed (e.g., "/src").
3811    /// * `sources` - Identifiers of the files to copy.
3812    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3813    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
3814        let mut query = self.selection.select("withFiles");
3815        query = query.arg("path", path.into());
3816        query = query.arg("sources", sources);
3817        Container {
3818            proc: self.proc.clone(),
3819            selection: query,
3820            graphql_client: self.graphql_client.clone(),
3821        }
3822    }
3823    /// Retrieves this container plus the contents of the given files copied to the given path.
3824    ///
3825    /// # Arguments
3826    ///
3827    /// * `path` - Location where copied files should be placed (e.g., "/src").
3828    /// * `sources` - Identifiers of the files to copy.
3829    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3830    pub fn with_files_opts<'a>(
3831        &self,
3832        path: impl Into<String>,
3833        sources: Vec<FileId>,
3834        opts: ContainerWithFilesOpts<'a>,
3835    ) -> Container {
3836        let mut query = self.selection.select("withFiles");
3837        query = query.arg("path", path.into());
3838        query = query.arg("sources", sources);
3839        if let Some(permissions) = opts.permissions {
3840            query = query.arg("permissions", permissions);
3841        }
3842        if let Some(owner) = opts.owner {
3843            query = query.arg("owner", owner);
3844        }
3845        if let Some(expand) = opts.expand {
3846            query = query.arg("expand", expand);
3847        }
3848        Container {
3849            proc: self.proc.clone(),
3850            selection: query,
3851            graphql_client: self.graphql_client.clone(),
3852        }
3853    }
3854    /// Retrieves this container plus the given label.
3855    ///
3856    /// # Arguments
3857    ///
3858    /// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
3859    /// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
3860    pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3861        let mut query = self.selection.select("withLabel");
3862        query = query.arg("name", name.into());
3863        query = query.arg("value", value.into());
3864        Container {
3865            proc: self.proc.clone(),
3866            selection: query,
3867            graphql_client: self.graphql_client.clone(),
3868        }
3869    }
3870    /// Retrieves this container plus a cache volume mounted at the given path.
3871    ///
3872    /// # Arguments
3873    ///
3874    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3875    /// * `cache` - Identifier of the cache volume to mount.
3876    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3877    pub fn with_mounted_cache(
3878        &self,
3879        path: impl Into<String>,
3880        cache: impl IntoID<CacheVolumeId>,
3881    ) -> Container {
3882        let mut query = self.selection.select("withMountedCache");
3883        query = query.arg("path", path.into());
3884        query = query.arg_lazy(
3885            "cache",
3886            Box::new(move || {
3887                let cache = cache.clone();
3888                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3889            }),
3890        );
3891        Container {
3892            proc: self.proc.clone(),
3893            selection: query,
3894            graphql_client: self.graphql_client.clone(),
3895        }
3896    }
3897    /// Retrieves this container plus a cache volume mounted at the given path.
3898    ///
3899    /// # Arguments
3900    ///
3901    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
3902    /// * `cache` - Identifier of the cache volume to mount.
3903    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3904    pub fn with_mounted_cache_opts<'a>(
3905        &self,
3906        path: impl Into<String>,
3907        cache: impl IntoID<CacheVolumeId>,
3908        opts: ContainerWithMountedCacheOpts<'a>,
3909    ) -> Container {
3910        let mut query = self.selection.select("withMountedCache");
3911        query = query.arg("path", path.into());
3912        query = query.arg_lazy(
3913            "cache",
3914            Box::new(move || {
3915                let cache = cache.clone();
3916                Box::pin(async move { cache.into_id().await.unwrap().quote() })
3917            }),
3918        );
3919        if let Some(source) = opts.source {
3920            query = query.arg("source", source);
3921        }
3922        if let Some(sharing) = opts.sharing {
3923            query = query.arg("sharing", sharing);
3924        }
3925        if let Some(owner) = opts.owner {
3926            query = query.arg("owner", owner);
3927        }
3928        if let Some(expand) = opts.expand {
3929            query = query.arg("expand", expand);
3930        }
3931        Container {
3932            proc: self.proc.clone(),
3933            selection: query,
3934            graphql_client: self.graphql_client.clone(),
3935        }
3936    }
3937    /// Retrieves this container plus a directory mounted at the given path.
3938    ///
3939    /// # Arguments
3940    ///
3941    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3942    /// * `source` - Identifier of the mounted directory.
3943    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3944    pub fn with_mounted_directory(
3945        &self,
3946        path: impl Into<String>,
3947        source: impl IntoID<DirectoryId>,
3948    ) -> Container {
3949        let mut query = self.selection.select("withMountedDirectory");
3950        query = query.arg("path", path.into());
3951        query = query.arg_lazy(
3952            "source",
3953            Box::new(move || {
3954                let source = source.clone();
3955                Box::pin(async move { source.into_id().await.unwrap().quote() })
3956            }),
3957        );
3958        Container {
3959            proc: self.proc.clone(),
3960            selection: query,
3961            graphql_client: self.graphql_client.clone(),
3962        }
3963    }
3964    /// Retrieves this container plus a directory mounted at the given path.
3965    ///
3966    /// # Arguments
3967    ///
3968    /// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
3969    /// * `source` - Identifier of the mounted directory.
3970    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
3971    pub fn with_mounted_directory_opts<'a>(
3972        &self,
3973        path: impl Into<String>,
3974        source: impl IntoID<DirectoryId>,
3975        opts: ContainerWithMountedDirectoryOpts<'a>,
3976    ) -> Container {
3977        let mut query = self.selection.select("withMountedDirectory");
3978        query = query.arg("path", path.into());
3979        query = query.arg_lazy(
3980            "source",
3981            Box::new(move || {
3982                let source = source.clone();
3983                Box::pin(async move { source.into_id().await.unwrap().quote() })
3984            }),
3985        );
3986        if let Some(owner) = opts.owner {
3987            query = query.arg("owner", owner);
3988        }
3989        if let Some(expand) = opts.expand {
3990            query = query.arg("expand", expand);
3991        }
3992        Container {
3993            proc: self.proc.clone(),
3994            selection: query,
3995            graphql_client: self.graphql_client.clone(),
3996        }
3997    }
3998    /// Retrieves this container plus a file mounted at the given path.
3999    ///
4000    /// # Arguments
4001    ///
4002    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4003    /// * `source` - Identifier of the mounted file.
4004    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4005    pub fn with_mounted_file(
4006        &self,
4007        path: impl Into<String>,
4008        source: impl IntoID<FileId>,
4009    ) -> Container {
4010        let mut query = self.selection.select("withMountedFile");
4011        query = query.arg("path", path.into());
4012        query = query.arg_lazy(
4013            "source",
4014            Box::new(move || {
4015                let source = source.clone();
4016                Box::pin(async move { source.into_id().await.unwrap().quote() })
4017            }),
4018        );
4019        Container {
4020            proc: self.proc.clone(),
4021            selection: query,
4022            graphql_client: self.graphql_client.clone(),
4023        }
4024    }
4025    /// Retrieves this container plus a file mounted at the given path.
4026    ///
4027    /// # Arguments
4028    ///
4029    /// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
4030    /// * `source` - Identifier of the mounted file.
4031    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4032    pub fn with_mounted_file_opts<'a>(
4033        &self,
4034        path: impl Into<String>,
4035        source: impl IntoID<FileId>,
4036        opts: ContainerWithMountedFileOpts<'a>,
4037    ) -> Container {
4038        let mut query = self.selection.select("withMountedFile");
4039        query = query.arg("path", path.into());
4040        query = query.arg_lazy(
4041            "source",
4042            Box::new(move || {
4043                let source = source.clone();
4044                Box::pin(async move { source.into_id().await.unwrap().quote() })
4045            }),
4046        );
4047        if let Some(owner) = opts.owner {
4048            query = query.arg("owner", owner);
4049        }
4050        if let Some(expand) = opts.expand {
4051            query = query.arg("expand", expand);
4052        }
4053        Container {
4054            proc: self.proc.clone(),
4055            selection: query,
4056            graphql_client: self.graphql_client.clone(),
4057        }
4058    }
4059    /// Retrieves this container plus a secret mounted into a file at the given path.
4060    ///
4061    /// # Arguments
4062    ///
4063    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4064    /// * `source` - Identifier of the secret to mount.
4065    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4066    pub fn with_mounted_secret(
4067        &self,
4068        path: impl Into<String>,
4069        source: impl IntoID<SecretId>,
4070    ) -> Container {
4071        let mut query = self.selection.select("withMountedSecret");
4072        query = query.arg("path", path.into());
4073        query = query.arg_lazy(
4074            "source",
4075            Box::new(move || {
4076                let source = source.clone();
4077                Box::pin(async move { source.into_id().await.unwrap().quote() })
4078            }),
4079        );
4080        Container {
4081            proc: self.proc.clone(),
4082            selection: query,
4083            graphql_client: self.graphql_client.clone(),
4084        }
4085    }
4086    /// Retrieves this container plus a secret mounted into a file at the given path.
4087    ///
4088    /// # Arguments
4089    ///
4090    /// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
4091    /// * `source` - Identifier of the secret to mount.
4092    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4093    pub fn with_mounted_secret_opts<'a>(
4094        &self,
4095        path: impl Into<String>,
4096        source: impl IntoID<SecretId>,
4097        opts: ContainerWithMountedSecretOpts<'a>,
4098    ) -> Container {
4099        let mut query = self.selection.select("withMountedSecret");
4100        query = query.arg("path", path.into());
4101        query = query.arg_lazy(
4102            "source",
4103            Box::new(move || {
4104                let source = source.clone();
4105                Box::pin(async move { source.into_id().await.unwrap().quote() })
4106            }),
4107        );
4108        if let Some(owner) = opts.owner {
4109            query = query.arg("owner", owner);
4110        }
4111        if let Some(mode) = opts.mode {
4112            query = query.arg("mode", mode);
4113        }
4114        if let Some(expand) = opts.expand {
4115            query = query.arg("expand", expand);
4116        }
4117        Container {
4118            proc: self.proc.clone(),
4119            selection: query,
4120            graphql_client: self.graphql_client.clone(),
4121        }
4122    }
4123    /// 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.
4124    ///
4125    /// # Arguments
4126    ///
4127    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4128    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4129    pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4130        let mut query = self.selection.select("withMountedTemp");
4131        query = query.arg("path", path.into());
4132        Container {
4133            proc: self.proc.clone(),
4134            selection: query,
4135            graphql_client: self.graphql_client.clone(),
4136        }
4137    }
4138    /// 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.
4139    ///
4140    /// # Arguments
4141    ///
4142    /// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
4143    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4144    pub fn with_mounted_temp_opts(
4145        &self,
4146        path: impl Into<String>,
4147        opts: ContainerWithMountedTempOpts,
4148    ) -> Container {
4149        let mut query = self.selection.select("withMountedTemp");
4150        query = query.arg("path", path.into());
4151        if let Some(size) = opts.size {
4152            query = query.arg("size", size);
4153        }
4154        if let Some(expand) = opts.expand {
4155            query = query.arg("expand", expand);
4156        }
4157        Container {
4158            proc: self.proc.clone(),
4159            selection: query,
4160            graphql_client: self.graphql_client.clone(),
4161        }
4162    }
4163    /// Return a new container snapshot, with a file added to its filesystem with text content
4164    ///
4165    /// # Arguments
4166    ///
4167    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4168    /// * `contents` - Contents of the new file. Example: "Hello world!"
4169    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4170    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
4171        let mut query = self.selection.select("withNewFile");
4172        query = query.arg("path", path.into());
4173        query = query.arg("contents", contents.into());
4174        Container {
4175            proc: self.proc.clone(),
4176            selection: query,
4177            graphql_client: self.graphql_client.clone(),
4178        }
4179    }
4180    /// Return a new container snapshot, with a file added to its filesystem with text content
4181    ///
4182    /// # Arguments
4183    ///
4184    /// * `path` - Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
4185    /// * `contents` - Contents of the new file. Example: "Hello world!"
4186    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4187    pub fn with_new_file_opts<'a>(
4188        &self,
4189        path: impl Into<String>,
4190        contents: impl Into<String>,
4191        opts: ContainerWithNewFileOpts<'a>,
4192    ) -> Container {
4193        let mut query = self.selection.select("withNewFile");
4194        query = query.arg("path", path.into());
4195        query = query.arg("contents", contents.into());
4196        if let Some(permissions) = opts.permissions {
4197            query = query.arg("permissions", permissions);
4198        }
4199        if let Some(owner) = opts.owner {
4200            query = query.arg("owner", owner);
4201        }
4202        if let Some(expand) = opts.expand {
4203            query = query.arg("expand", expand);
4204        }
4205        Container {
4206            proc: self.proc.clone(),
4207            selection: query,
4208            graphql_client: self.graphql_client.clone(),
4209        }
4210    }
4211    /// Attach credentials for future publishing to a registry. Use in combination with publish
4212    ///
4213    /// # Arguments
4214    ///
4215    /// * `address` - The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
4216    /// * `username` - The username to authenticate with. Example: "alice"
4217    /// * `secret` - The API key, password or token to authenticate to this registry
4218    pub fn with_registry_auth(
4219        &self,
4220        address: impl Into<String>,
4221        username: impl Into<String>,
4222        secret: impl IntoID<SecretId>,
4223    ) -> Container {
4224        let mut query = self.selection.select("withRegistryAuth");
4225        query = query.arg("address", address.into());
4226        query = query.arg("username", username.into());
4227        query = query.arg_lazy(
4228            "secret",
4229            Box::new(move || {
4230                let secret = secret.clone();
4231                Box::pin(async move { secret.into_id().await.unwrap().quote() })
4232            }),
4233        );
4234        Container {
4235            proc: self.proc.clone(),
4236            selection: query,
4237            graphql_client: self.graphql_client.clone(),
4238        }
4239    }
4240    /// Change the container's root filesystem. The previous root filesystem will be lost.
4241    ///
4242    /// # Arguments
4243    ///
4244    /// * `directory` - The new root filesystem.
4245    pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
4246        let mut query = self.selection.select("withRootfs");
4247        query = query.arg_lazy(
4248            "directory",
4249            Box::new(move || {
4250                let directory = directory.clone();
4251                Box::pin(async move { directory.into_id().await.unwrap().quote() })
4252            }),
4253        );
4254        Container {
4255            proc: self.proc.clone(),
4256            selection: query,
4257            graphql_client: self.graphql_client.clone(),
4258        }
4259    }
4260    /// Set a new environment variable, using a secret value
4261    ///
4262    /// # Arguments
4263    ///
4264    /// * `name` - Name of the secret variable (e.g., "API_SECRET").
4265    /// * `secret` - Identifier of the secret value.
4266    pub fn with_secret_variable(
4267        &self,
4268        name: impl Into<String>,
4269        secret: impl IntoID<SecretId>,
4270    ) -> Container {
4271        let mut query = self.selection.select("withSecretVariable");
4272        query = query.arg("name", name.into());
4273        query = query.arg_lazy(
4274            "secret",
4275            Box::new(move || {
4276                let secret = secret.clone();
4277                Box::pin(async move { secret.into_id().await.unwrap().quote() })
4278            }),
4279        );
4280        Container {
4281            proc: self.proc.clone(),
4282            selection: query,
4283            graphql_client: self.graphql_client.clone(),
4284        }
4285    }
4286    /// Establish a runtime dependency from a container to a network service.
4287    /// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
4288    /// The service will be reachable from the container via the provided hostname alias.
4289    /// The service dependency will also convey to any files or directories produced by the container.
4290    ///
4291    /// # Arguments
4292    ///
4293    /// * `alias` - Hostname that will resolve to the target service (only accessible from within this container)
4294    /// * `service` - The target service
4295    pub fn with_service_binding(
4296        &self,
4297        alias: impl Into<String>,
4298        service: impl IntoID<ServiceId>,
4299    ) -> Container {
4300        let mut query = self.selection.select("withServiceBinding");
4301        query = query.arg("alias", alias.into());
4302        query = query.arg_lazy(
4303            "service",
4304            Box::new(move || {
4305                let service = service.clone();
4306                Box::pin(async move { service.into_id().await.unwrap().quote() })
4307            }),
4308        );
4309        Container {
4310            proc: self.proc.clone(),
4311            selection: query,
4312            graphql_client: self.graphql_client.clone(),
4313        }
4314    }
4315    /// Return a snapshot with a symlink
4316    ///
4317    /// # Arguments
4318    ///
4319    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4320    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4321    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4322    pub fn with_symlink(
4323        &self,
4324        target: impl Into<String>,
4325        link_name: impl Into<String>,
4326    ) -> Container {
4327        let mut query = self.selection.select("withSymlink");
4328        query = query.arg("target", target.into());
4329        query = query.arg("linkName", link_name.into());
4330        Container {
4331            proc: self.proc.clone(),
4332            selection: query,
4333            graphql_client: self.graphql_client.clone(),
4334        }
4335    }
4336    /// Return a snapshot with a symlink
4337    ///
4338    /// # Arguments
4339    ///
4340    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
4341    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
4342    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4343    pub fn with_symlink_opts(
4344        &self,
4345        target: impl Into<String>,
4346        link_name: impl Into<String>,
4347        opts: ContainerWithSymlinkOpts,
4348    ) -> Container {
4349        let mut query = self.selection.select("withSymlink");
4350        query = query.arg("target", target.into());
4351        query = query.arg("linkName", link_name.into());
4352        if let Some(expand) = opts.expand {
4353            query = query.arg("expand", expand);
4354        }
4355        Container {
4356            proc: self.proc.clone(),
4357            selection: query,
4358            graphql_client: self.graphql_client.clone(),
4359        }
4360    }
4361    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4362    ///
4363    /// # Arguments
4364    ///
4365    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4366    /// * `source` - Identifier of the socket to forward.
4367    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4368    pub fn with_unix_socket(
4369        &self,
4370        path: impl Into<String>,
4371        source: impl IntoID<SocketId>,
4372    ) -> Container {
4373        let mut query = self.selection.select("withUnixSocket");
4374        query = query.arg("path", path.into());
4375        query = query.arg_lazy(
4376            "source",
4377            Box::new(move || {
4378                let source = source.clone();
4379                Box::pin(async move { source.into_id().await.unwrap().quote() })
4380            }),
4381        );
4382        Container {
4383            proc: self.proc.clone(),
4384            selection: query,
4385            graphql_client: self.graphql_client.clone(),
4386        }
4387    }
4388    /// Retrieves this container plus a socket forwarded to the given Unix socket path.
4389    ///
4390    /// # Arguments
4391    ///
4392    /// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
4393    /// * `source` - Identifier of the socket to forward.
4394    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4395    pub fn with_unix_socket_opts<'a>(
4396        &self,
4397        path: impl Into<String>,
4398        source: impl IntoID<SocketId>,
4399        opts: ContainerWithUnixSocketOpts<'a>,
4400    ) -> Container {
4401        let mut query = self.selection.select("withUnixSocket");
4402        query = query.arg("path", path.into());
4403        query = query.arg_lazy(
4404            "source",
4405            Box::new(move || {
4406                let source = source.clone();
4407                Box::pin(async move { source.into_id().await.unwrap().quote() })
4408            }),
4409        );
4410        if let Some(owner) = opts.owner {
4411            query = query.arg("owner", owner);
4412        }
4413        if let Some(expand) = opts.expand {
4414            query = query.arg("expand", expand);
4415        }
4416        Container {
4417            proc: self.proc.clone(),
4418            selection: query,
4419            graphql_client: self.graphql_client.clone(),
4420        }
4421    }
4422    /// Retrieves this container with a different command user.
4423    ///
4424    /// # Arguments
4425    ///
4426    /// * `name` - The user to set (e.g., "root").
4427    pub fn with_user(&self, name: impl Into<String>) -> Container {
4428        let mut query = self.selection.select("withUser");
4429        query = query.arg("name", name.into());
4430        Container {
4431            proc: self.proc.clone(),
4432            selection: query,
4433            graphql_client: self.graphql_client.clone(),
4434        }
4435    }
4436    /// Change the container's working directory. Like WORKDIR in Dockerfile.
4437    ///
4438    /// # Arguments
4439    ///
4440    /// * `path` - The path to set as the working directory (e.g., "/app").
4441    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4442    pub fn with_workdir(&self, path: impl Into<String>) -> Container {
4443        let mut query = self.selection.select("withWorkdir");
4444        query = query.arg("path", path.into());
4445        Container {
4446            proc: self.proc.clone(),
4447            selection: query,
4448            graphql_client: self.graphql_client.clone(),
4449        }
4450    }
4451    /// Change the container's working directory. Like WORKDIR in Dockerfile.
4452    ///
4453    /// # Arguments
4454    ///
4455    /// * `path` - The path to set as the working directory (e.g., "/app").
4456    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4457    pub fn with_workdir_opts(
4458        &self,
4459        path: impl Into<String>,
4460        opts: ContainerWithWorkdirOpts,
4461    ) -> Container {
4462        let mut query = self.selection.select("withWorkdir");
4463        query = query.arg("path", path.into());
4464        if let Some(expand) = opts.expand {
4465            query = query.arg("expand", expand);
4466        }
4467        Container {
4468            proc: self.proc.clone(),
4469            selection: query,
4470            graphql_client: self.graphql_client.clone(),
4471        }
4472    }
4473    /// Retrieves this container minus the given OCI annotation.
4474    ///
4475    /// # Arguments
4476    ///
4477    /// * `name` - The name of the annotation.
4478    pub fn without_annotation(&self, name: impl Into<String>) -> Container {
4479        let mut query = self.selection.select("withoutAnnotation");
4480        query = query.arg("name", name.into());
4481        Container {
4482            proc: self.proc.clone(),
4483            selection: query,
4484            graphql_client: self.graphql_client.clone(),
4485        }
4486    }
4487    /// Remove the container's default arguments.
4488    pub fn without_default_args(&self) -> Container {
4489        let query = self.selection.select("withoutDefaultArgs");
4490        Container {
4491            proc: self.proc.clone(),
4492            selection: query,
4493            graphql_client: self.graphql_client.clone(),
4494        }
4495    }
4496    /// Return a new container snapshot, with a directory removed from its filesystem
4497    ///
4498    /// # Arguments
4499    ///
4500    /// * `path` - Location of the directory to remove (e.g., ".github/").
4501    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4502    pub fn without_directory(&self, path: impl Into<String>) -> Container {
4503        let mut query = self.selection.select("withoutDirectory");
4504        query = query.arg("path", path.into());
4505        Container {
4506            proc: self.proc.clone(),
4507            selection: query,
4508            graphql_client: self.graphql_client.clone(),
4509        }
4510    }
4511    /// Return a new container snapshot, with a directory removed from its filesystem
4512    ///
4513    /// # Arguments
4514    ///
4515    /// * `path` - Location of the directory to remove (e.g., ".github/").
4516    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4517    pub fn without_directory_opts(
4518        &self,
4519        path: impl Into<String>,
4520        opts: ContainerWithoutDirectoryOpts,
4521    ) -> Container {
4522        let mut query = self.selection.select("withoutDirectory");
4523        query = query.arg("path", path.into());
4524        if let Some(expand) = opts.expand {
4525            query = query.arg("expand", expand);
4526        }
4527        Container {
4528            proc: self.proc.clone(),
4529            selection: query,
4530            graphql_client: self.graphql_client.clone(),
4531        }
4532    }
4533    /// Reset the container's OCI entrypoint.
4534    ///
4535    /// # Arguments
4536    ///
4537    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4538    pub fn without_entrypoint(&self) -> Container {
4539        let query = self.selection.select("withoutEntrypoint");
4540        Container {
4541            proc: self.proc.clone(),
4542            selection: query,
4543            graphql_client: self.graphql_client.clone(),
4544        }
4545    }
4546    /// Reset the container's OCI entrypoint.
4547    ///
4548    /// # Arguments
4549    ///
4550    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4551    pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4552        let mut query = self.selection.select("withoutEntrypoint");
4553        if let Some(keep_default_args) = opts.keep_default_args {
4554            query = query.arg("keepDefaultArgs", keep_default_args);
4555        }
4556        Container {
4557            proc: self.proc.clone(),
4558            selection: query,
4559            graphql_client: self.graphql_client.clone(),
4560        }
4561    }
4562    /// Retrieves this container minus the given environment variable.
4563    ///
4564    /// # Arguments
4565    ///
4566    /// * `name` - The name of the environment variable (e.g., "HOST").
4567    pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4568        let mut query = self.selection.select("withoutEnvVariable");
4569        query = query.arg("name", name.into());
4570        Container {
4571            proc: self.proc.clone(),
4572            selection: query,
4573            graphql_client: self.graphql_client.clone(),
4574        }
4575    }
4576    /// Unexpose a previously exposed port.
4577    ///
4578    /// # Arguments
4579    ///
4580    /// * `port` - Port number to unexpose
4581    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4582    pub fn without_exposed_port(&self, port: isize) -> Container {
4583        let mut query = self.selection.select("withoutExposedPort");
4584        query = query.arg("port", port);
4585        Container {
4586            proc: self.proc.clone(),
4587            selection: query,
4588            graphql_client: self.graphql_client.clone(),
4589        }
4590    }
4591    /// Unexpose a previously exposed port.
4592    ///
4593    /// # Arguments
4594    ///
4595    /// * `port` - Port number to unexpose
4596    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4597    pub fn without_exposed_port_opts(
4598        &self,
4599        port: isize,
4600        opts: ContainerWithoutExposedPortOpts,
4601    ) -> Container {
4602        let mut query = self.selection.select("withoutExposedPort");
4603        query = query.arg("port", port);
4604        if let Some(protocol) = opts.protocol {
4605            query = query.arg("protocol", protocol);
4606        }
4607        Container {
4608            proc: self.proc.clone(),
4609            selection: query,
4610            graphql_client: self.graphql_client.clone(),
4611        }
4612    }
4613    /// Retrieves this container with the file at the given path removed.
4614    ///
4615    /// # Arguments
4616    ///
4617    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4618    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4619    pub fn without_file(&self, path: impl Into<String>) -> Container {
4620        let mut query = self.selection.select("withoutFile");
4621        query = query.arg("path", path.into());
4622        Container {
4623            proc: self.proc.clone(),
4624            selection: query,
4625            graphql_client: self.graphql_client.clone(),
4626        }
4627    }
4628    /// Retrieves this container with the file at the given path removed.
4629    ///
4630    /// # Arguments
4631    ///
4632    /// * `path` - Location of the file to remove (e.g., "/file.txt").
4633    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4634    pub fn without_file_opts(
4635        &self,
4636        path: impl Into<String>,
4637        opts: ContainerWithoutFileOpts,
4638    ) -> Container {
4639        let mut query = self.selection.select("withoutFile");
4640        query = query.arg("path", path.into());
4641        if let Some(expand) = opts.expand {
4642            query = query.arg("expand", expand);
4643        }
4644        Container {
4645            proc: self.proc.clone(),
4646            selection: query,
4647            graphql_client: self.graphql_client.clone(),
4648        }
4649    }
4650    /// Return a new container spanshot with specified files removed
4651    ///
4652    /// # Arguments
4653    ///
4654    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4655    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4656    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4657        let mut query = self.selection.select("withoutFiles");
4658        query = query.arg(
4659            "paths",
4660            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4661        );
4662        Container {
4663            proc: self.proc.clone(),
4664            selection: query,
4665            graphql_client: self.graphql_client.clone(),
4666        }
4667    }
4668    /// Return a new container spanshot with specified files removed
4669    ///
4670    /// # Arguments
4671    ///
4672    /// * `paths` - Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
4673    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4674    pub fn without_files_opts(
4675        &self,
4676        paths: Vec<impl Into<String>>,
4677        opts: ContainerWithoutFilesOpts,
4678    ) -> Container {
4679        let mut query = self.selection.select("withoutFiles");
4680        query = query.arg(
4681            "paths",
4682            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4683        );
4684        if let Some(expand) = opts.expand {
4685            query = query.arg("expand", expand);
4686        }
4687        Container {
4688            proc: self.proc.clone(),
4689            selection: query,
4690            graphql_client: self.graphql_client.clone(),
4691        }
4692    }
4693    /// Retrieves this container minus the given environment label.
4694    ///
4695    /// # Arguments
4696    ///
4697    /// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
4698    pub fn without_label(&self, name: impl Into<String>) -> Container {
4699        let mut query = self.selection.select("withoutLabel");
4700        query = query.arg("name", name.into());
4701        Container {
4702            proc: self.proc.clone(),
4703            selection: query,
4704            graphql_client: self.graphql_client.clone(),
4705        }
4706    }
4707    /// Retrieves this container after unmounting everything at the given path.
4708    ///
4709    /// # Arguments
4710    ///
4711    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4712    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4713    pub fn without_mount(&self, path: impl Into<String>) -> Container {
4714        let mut query = self.selection.select("withoutMount");
4715        query = query.arg("path", path.into());
4716        Container {
4717            proc: self.proc.clone(),
4718            selection: query,
4719            graphql_client: self.graphql_client.clone(),
4720        }
4721    }
4722    /// Retrieves this container after unmounting everything at the given path.
4723    ///
4724    /// # Arguments
4725    ///
4726    /// * `path` - Location of the cache directory (e.g., "/root/.npm").
4727    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4728    pub fn without_mount_opts(
4729        &self,
4730        path: impl Into<String>,
4731        opts: ContainerWithoutMountOpts,
4732    ) -> Container {
4733        let mut query = self.selection.select("withoutMount");
4734        query = query.arg("path", path.into());
4735        if let Some(expand) = opts.expand {
4736            query = query.arg("expand", expand);
4737        }
4738        Container {
4739            proc: self.proc.clone(),
4740            selection: query,
4741            graphql_client: self.graphql_client.clone(),
4742        }
4743    }
4744    /// Retrieves this container without the registry authentication of a given address.
4745    ///
4746    /// # Arguments
4747    ///
4748    /// * `address` - Registry's address to remove the authentication from.
4749    ///
4750    /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
4751    pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4752        let mut query = self.selection.select("withoutRegistryAuth");
4753        query = query.arg("address", address.into());
4754        Container {
4755            proc: self.proc.clone(),
4756            selection: query,
4757            graphql_client: self.graphql_client.clone(),
4758        }
4759    }
4760    /// Retrieves this container minus the given environment variable containing the secret.
4761    ///
4762    /// # Arguments
4763    ///
4764    /// * `name` - The name of the environment variable (e.g., "HOST").
4765    pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4766        let mut query = self.selection.select("withoutSecretVariable");
4767        query = query.arg("name", name.into());
4768        Container {
4769            proc: self.proc.clone(),
4770            selection: query,
4771            graphql_client: self.graphql_client.clone(),
4772        }
4773    }
4774    /// Retrieves this container with a previously added Unix socket removed.
4775    ///
4776    /// # Arguments
4777    ///
4778    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4779    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4780    pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4781        let mut query = self.selection.select("withoutUnixSocket");
4782        query = query.arg("path", path.into());
4783        Container {
4784            proc: self.proc.clone(),
4785            selection: query,
4786            graphql_client: self.graphql_client.clone(),
4787        }
4788    }
4789    /// Retrieves this container with a previously added Unix socket removed.
4790    ///
4791    /// # Arguments
4792    ///
4793    /// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
4794    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4795    pub fn without_unix_socket_opts(
4796        &self,
4797        path: impl Into<String>,
4798        opts: ContainerWithoutUnixSocketOpts,
4799    ) -> Container {
4800        let mut query = self.selection.select("withoutUnixSocket");
4801        query = query.arg("path", path.into());
4802        if let Some(expand) = opts.expand {
4803            query = query.arg("expand", expand);
4804        }
4805        Container {
4806            proc: self.proc.clone(),
4807            selection: query,
4808            graphql_client: self.graphql_client.clone(),
4809        }
4810    }
4811    /// Retrieves this container with an unset command user.
4812    /// Should default to root.
4813    pub fn without_user(&self) -> Container {
4814        let query = self.selection.select("withoutUser");
4815        Container {
4816            proc: self.proc.clone(),
4817            selection: query,
4818            graphql_client: self.graphql_client.clone(),
4819        }
4820    }
4821    /// Unset the container's working directory.
4822    /// Should default to "/".
4823    pub fn without_workdir(&self) -> Container {
4824        let query = self.selection.select("withoutWorkdir");
4825        Container {
4826            proc: self.proc.clone(),
4827            selection: query,
4828            graphql_client: self.graphql_client.clone(),
4829        }
4830    }
4831    /// Retrieves the working directory for all commands.
4832    pub async fn workdir(&self) -> Result<String, DaggerError> {
4833        let query = self.selection.select("workdir");
4834        query.execute(self.graphql_client.clone()).await
4835    }
4836}
4837#[derive(Clone)]
4838pub struct CurrentModule {
4839    pub proc: Option<Arc<DaggerSessionProc>>,
4840    pub selection: Selection,
4841    pub graphql_client: DynGraphQLClient,
4842}
4843#[derive(Builder, Debug, PartialEq)]
4844pub struct CurrentModuleWorkdirOpts<'a> {
4845    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
4846    #[builder(setter(into, strip_option), default)]
4847    pub exclude: Option<Vec<&'a str>>,
4848    /// Apply .gitignore filter rules inside the directory
4849    #[builder(setter(into, strip_option), default)]
4850    pub gitignore: Option<bool>,
4851    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4852    #[builder(setter(into, strip_option), default)]
4853    pub include: Option<Vec<&'a str>>,
4854}
4855impl CurrentModule {
4856    /// A unique identifier for this CurrentModule.
4857    pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
4858        let query = self.selection.select("id");
4859        query.execute(self.graphql_client.clone()).await
4860    }
4861    /// The name of the module being executed in
4862    pub async fn name(&self) -> Result<String, DaggerError> {
4863        let query = self.selection.select("name");
4864        query.execute(self.graphql_client.clone()).await
4865    }
4866    /// The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
4867    pub fn source(&self) -> Directory {
4868        let query = self.selection.select("source");
4869        Directory {
4870            proc: self.proc.clone(),
4871            selection: query,
4872            graphql_client: self.graphql_client.clone(),
4873        }
4874    }
4875    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4876    ///
4877    /// # Arguments
4878    ///
4879    /// * `path` - Location of the directory to access (e.g., ".").
4880    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4881    pub fn workdir(&self, path: impl Into<String>) -> Directory {
4882        let mut query = self.selection.select("workdir");
4883        query = query.arg("path", path.into());
4884        Directory {
4885            proc: self.proc.clone(),
4886            selection: query,
4887            graphql_client: self.graphql_client.clone(),
4888        }
4889    }
4890    /// Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
4891    ///
4892    /// # Arguments
4893    ///
4894    /// * `path` - Location of the directory to access (e.g., ".").
4895    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
4896    pub fn workdir_opts<'a>(
4897        &self,
4898        path: impl Into<String>,
4899        opts: CurrentModuleWorkdirOpts<'a>,
4900    ) -> Directory {
4901        let mut query = self.selection.select("workdir");
4902        query = query.arg("path", path.into());
4903        if let Some(exclude) = opts.exclude {
4904            query = query.arg("exclude", exclude);
4905        }
4906        if let Some(include) = opts.include {
4907            query = query.arg("include", include);
4908        }
4909        if let Some(gitignore) = opts.gitignore {
4910            query = query.arg("gitignore", gitignore);
4911        }
4912        Directory {
4913            proc: self.proc.clone(),
4914            selection: query,
4915            graphql_client: self.graphql_client.clone(),
4916        }
4917    }
4918    /// 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.
4919    ///
4920    /// # Arguments
4921    ///
4922    /// * `path` - Location of the file to retrieve (e.g., "README.md").
4923    pub fn workdir_file(&self, path: impl Into<String>) -> File {
4924        let mut query = self.selection.select("workdirFile");
4925        query = query.arg("path", path.into());
4926        File {
4927            proc: self.proc.clone(),
4928            selection: query,
4929            graphql_client: self.graphql_client.clone(),
4930        }
4931    }
4932}
4933#[derive(Clone)]
4934pub struct Directory {
4935    pub proc: Option<Arc<DaggerSessionProc>>,
4936    pub selection: Selection,
4937    pub graphql_client: DynGraphQLClient,
4938}
4939#[derive(Builder, Debug, PartialEq)]
4940pub struct DirectoryAsModuleOpts<'a> {
4941    /// An optional subpath of the directory which contains the module's configuration file.
4942    /// If not set, the module source code is loaded from the root of the directory.
4943    #[builder(setter(into, strip_option), default)]
4944    pub source_root_path: Option<&'a str>,
4945}
4946#[derive(Builder, Debug, PartialEq)]
4947pub struct DirectoryAsModuleSourceOpts<'a> {
4948    /// An optional subpath of the directory which contains the module's configuration file.
4949    /// If not set, the module source code is loaded from the root of the directory.
4950    #[builder(setter(into, strip_option), default)]
4951    pub source_root_path: Option<&'a str>,
4952}
4953#[derive(Builder, Debug, PartialEq)]
4954pub struct DirectoryDockerBuildOpts<'a> {
4955    /// Build arguments to use in the build.
4956    #[builder(setter(into, strip_option), default)]
4957    pub build_args: Option<Vec<BuildArg>>,
4958    /// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
4959    #[builder(setter(into, strip_option), default)]
4960    pub dockerfile: Option<&'a str>,
4961    /// If set, skip the automatic init process injected into containers created by RUN statements.
4962    /// 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.
4963    #[builder(setter(into, strip_option), default)]
4964    pub no_init: Option<bool>,
4965    /// The platform to build.
4966    #[builder(setter(into, strip_option), default)]
4967    pub platform: Option<Platform>,
4968    /// Secrets to pass to the build.
4969    /// They will be mounted at /run/secrets/[secret-name].
4970    #[builder(setter(into, strip_option), default)]
4971    pub secrets: Option<Vec<SecretId>>,
4972    /// Target build stage to build.
4973    #[builder(setter(into, strip_option), default)]
4974    pub target: Option<&'a str>,
4975}
4976#[derive(Builder, Debug, PartialEq)]
4977pub struct DirectoryEntriesOpts<'a> {
4978    /// Location of the directory to look at (e.g., "/src").
4979    #[builder(setter(into, strip_option), default)]
4980    pub path: Option<&'a str>,
4981}
4982#[derive(Builder, Debug, PartialEq)]
4983pub struct DirectoryExistsOpts {
4984    /// If specified, do not follow symlinks.
4985    #[builder(setter(into, strip_option), default)]
4986    pub do_not_follow_symlinks: Option<bool>,
4987    /// If specified, also validate the type of file (e.g. "REGULAR_TYPE", "DIRECTORY_TYPE", or "SYMLINK_TYPE").
4988    #[builder(setter(into, strip_option), default)]
4989    pub expected_type: Option<ExistsType>,
4990}
4991#[derive(Builder, Debug, PartialEq)]
4992pub struct DirectoryExportOpts {
4993    /// 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.
4994    #[builder(setter(into, strip_option), default)]
4995    pub wipe: Option<bool>,
4996}
4997#[derive(Builder, Debug, PartialEq)]
4998pub struct DirectoryFilterOpts<'a> {
4999    /// If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
5000    #[builder(setter(into, strip_option), default)]
5001    pub exclude: Option<Vec<&'a str>>,
5002    /// If set, apply .gitignore rules when filtering the directory.
5003    #[builder(setter(into, strip_option), default)]
5004    pub gitignore: Option<bool>,
5005    /// If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
5006    #[builder(setter(into, strip_option), default)]
5007    pub include: Option<Vec<&'a str>>,
5008}
5009#[derive(Builder, Debug, PartialEq)]
5010pub struct DirectorySearchOpts<'a> {
5011    /// Allow the . pattern to match newlines in multiline mode.
5012    #[builder(setter(into, strip_option), default)]
5013    pub dotall: Option<bool>,
5014    /// Only return matching files, not lines and content
5015    #[builder(setter(into, strip_option), default)]
5016    pub files_only: Option<bool>,
5017    /// Glob patterns to match (e.g., "*.md")
5018    #[builder(setter(into, strip_option), default)]
5019    pub globs: Option<Vec<&'a str>>,
5020    /// Enable case-insensitive matching.
5021    #[builder(setter(into, strip_option), default)]
5022    pub insensitive: Option<bool>,
5023    /// Limit the number of results to return
5024    #[builder(setter(into, strip_option), default)]
5025    pub limit: Option<isize>,
5026    /// Interpret the pattern as a literal string instead of a regular expression.
5027    #[builder(setter(into, strip_option), default)]
5028    pub literal: Option<bool>,
5029    /// Enable searching across multiple lines.
5030    #[builder(setter(into, strip_option), default)]
5031    pub multiline: Option<bool>,
5032    /// Directory or file paths to search
5033    #[builder(setter(into, strip_option), default)]
5034    pub paths: Option<Vec<&'a str>>,
5035    /// Skip hidden files (files starting with .).
5036    #[builder(setter(into, strip_option), default)]
5037    pub skip_hidden: Option<bool>,
5038    /// Honor .gitignore, .ignore, and .rgignore files.
5039    #[builder(setter(into, strip_option), default)]
5040    pub skip_ignored: Option<bool>,
5041}
5042#[derive(Builder, Debug, PartialEq)]
5043pub struct DirectoryTerminalOpts<'a> {
5044    /// If set, override the container's default terminal command and invoke these command arguments instead.
5045    #[builder(setter(into, strip_option), default)]
5046    pub cmd: Option<Vec<&'a str>>,
5047    /// If set, override the default container used for the terminal.
5048    #[builder(setter(into, strip_option), default)]
5049    pub container: Option<ContainerId>,
5050    /// Provides Dagger access to the executed command.
5051    #[builder(setter(into, strip_option), default)]
5052    pub experimental_privileged_nesting: Option<bool>,
5053    /// 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.
5054    #[builder(setter(into, strip_option), default)]
5055    pub insecure_root_capabilities: Option<bool>,
5056}
5057#[derive(Builder, Debug, PartialEq)]
5058pub struct DirectoryWithDirectoryOpts<'a> {
5059    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
5060    #[builder(setter(into, strip_option), default)]
5061    pub exclude: Option<Vec<&'a str>>,
5062    /// Apply .gitignore filter rules inside the directory
5063    #[builder(setter(into, strip_option), default)]
5064    pub gitignore: Option<bool>,
5065    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
5066    #[builder(setter(into, strip_option), default)]
5067    pub include: Option<Vec<&'a str>>,
5068    /// A user:group to set for the copied directory and its contents.
5069    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5070    /// If the group is omitted, it defaults to the same as the user.
5071    #[builder(setter(into, strip_option), default)]
5072    pub owner: Option<&'a str>,
5073}
5074#[derive(Builder, Debug, PartialEq)]
5075pub struct DirectoryWithFileOpts<'a> {
5076    /// A user:group to set for the copied directory and its contents.
5077    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5078    /// If the group is omitted, it defaults to the same as the user.
5079    #[builder(setter(into, strip_option), default)]
5080    pub owner: Option<&'a str>,
5081    /// Permission given to the copied file (e.g., 0600).
5082    #[builder(setter(into, strip_option), default)]
5083    pub permissions: Option<isize>,
5084}
5085#[derive(Builder, Debug, PartialEq)]
5086pub struct DirectoryWithFilesOpts {
5087    /// Permission given to the copied files (e.g., 0600).
5088    #[builder(setter(into, strip_option), default)]
5089    pub permissions: Option<isize>,
5090}
5091#[derive(Builder, Debug, PartialEq)]
5092pub struct DirectoryWithNewDirectoryOpts {
5093    /// Permission granted to the created directory (e.g., 0777).
5094    #[builder(setter(into, strip_option), default)]
5095    pub permissions: Option<isize>,
5096}
5097#[derive(Builder, Debug, PartialEq)]
5098pub struct DirectoryWithNewFileOpts {
5099    /// Permissions of the new file. Example: 0600
5100    #[builder(setter(into, strip_option), default)]
5101    pub permissions: Option<isize>,
5102}
5103impl Directory {
5104    /// Converts this directory to a local git repository
5105    pub fn as_git(&self) -> GitRepository {
5106        let query = self.selection.select("asGit");
5107        GitRepository {
5108            proc: self.proc.clone(),
5109            selection: query,
5110            graphql_client: self.graphql_client.clone(),
5111        }
5112    }
5113    /// Load the directory as a Dagger module source
5114    ///
5115    /// # Arguments
5116    ///
5117    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5118    pub fn as_module(&self) -> Module {
5119        let query = self.selection.select("asModule");
5120        Module {
5121            proc: self.proc.clone(),
5122            selection: query,
5123            graphql_client: self.graphql_client.clone(),
5124        }
5125    }
5126    /// Load the directory as a Dagger module source
5127    ///
5128    /// # Arguments
5129    ///
5130    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5131    pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
5132        let mut query = self.selection.select("asModule");
5133        if let Some(source_root_path) = opts.source_root_path {
5134            query = query.arg("sourceRootPath", source_root_path);
5135        }
5136        Module {
5137            proc: self.proc.clone(),
5138            selection: query,
5139            graphql_client: self.graphql_client.clone(),
5140        }
5141    }
5142    /// Load the directory as a Dagger module source
5143    ///
5144    /// # Arguments
5145    ///
5146    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5147    pub fn as_module_source(&self) -> ModuleSource {
5148        let query = self.selection.select("asModuleSource");
5149        ModuleSource {
5150            proc: self.proc.clone(),
5151            selection: query,
5152            graphql_client: self.graphql_client.clone(),
5153        }
5154    }
5155    /// Load the directory as a Dagger module source
5156    ///
5157    /// # Arguments
5158    ///
5159    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5160    pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
5161        let mut query = self.selection.select("asModuleSource");
5162        if let Some(source_root_path) = opts.source_root_path {
5163            query = query.arg("sourceRootPath", source_root_path);
5164        }
5165        ModuleSource {
5166            proc: self.proc.clone(),
5167            selection: query,
5168            graphql_client: self.graphql_client.clone(),
5169        }
5170    }
5171    /// Return the difference between this directory and another directory, typically an older snapshot.
5172    /// The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.
5173    ///
5174    /// # Arguments
5175    ///
5176    /// * `from` - The base directory snapshot to compare against
5177    pub fn changes(&self, from: impl IntoID<DirectoryId>) -> Changeset {
5178        let mut query = self.selection.select("changes");
5179        query = query.arg_lazy(
5180            "from",
5181            Box::new(move || {
5182                let from = from.clone();
5183                Box::pin(async move { from.into_id().await.unwrap().quote() })
5184            }),
5185        );
5186        Changeset {
5187            proc: self.proc.clone(),
5188            selection: query,
5189            graphql_client: self.graphql_client.clone(),
5190        }
5191    }
5192    /// Change the owner of the directory contents recursively.
5193    ///
5194    /// # Arguments
5195    ///
5196    /// * `path` - Path of the directory to change ownership of (e.g., "/").
5197    /// * `owner` - A user:group to set for the mounted directory and its contents.
5198    ///
5199    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
5200    ///
5201    /// If the group is omitted, it defaults to the same as the user.
5202    pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
5203        let mut query = self.selection.select("chown");
5204        query = query.arg("path", path.into());
5205        query = query.arg("owner", owner.into());
5206        Directory {
5207            proc: self.proc.clone(),
5208            selection: query,
5209            graphql_client: self.graphql_client.clone(),
5210        }
5211    }
5212    /// Return the difference between this directory and an another directory. The difference is encoded as a directory.
5213    ///
5214    /// # Arguments
5215    ///
5216    /// * `other` - The directory to compare against
5217    pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
5218        let mut query = self.selection.select("diff");
5219        query = query.arg_lazy(
5220            "other",
5221            Box::new(move || {
5222                let other = other.clone();
5223                Box::pin(async move { other.into_id().await.unwrap().quote() })
5224            }),
5225        );
5226        Directory {
5227            proc: self.proc.clone(),
5228            selection: query,
5229            graphql_client: self.graphql_client.clone(),
5230        }
5231    }
5232    /// 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.
5233    pub async fn digest(&self) -> Result<String, DaggerError> {
5234        let query = self.selection.select("digest");
5235        query.execute(self.graphql_client.clone()).await
5236    }
5237    /// Retrieves a directory at the given path.
5238    ///
5239    /// # Arguments
5240    ///
5241    /// * `path` - Location of the directory to retrieve. Example: "/src"
5242    pub fn directory(&self, path: impl Into<String>) -> Directory {
5243        let mut query = self.selection.select("directory");
5244        query = query.arg("path", path.into());
5245        Directory {
5246            proc: self.proc.clone(),
5247            selection: query,
5248            graphql_client: self.graphql_client.clone(),
5249        }
5250    }
5251    /// 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.
5252    ///
5253    /// # Arguments
5254    ///
5255    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5256    pub fn docker_build(&self) -> Container {
5257        let query = self.selection.select("dockerBuild");
5258        Container {
5259            proc: self.proc.clone(),
5260            selection: query,
5261            graphql_client: self.graphql_client.clone(),
5262        }
5263    }
5264    /// 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.
5265    ///
5266    /// # Arguments
5267    ///
5268    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5269    pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5270        let mut query = self.selection.select("dockerBuild");
5271        if let Some(dockerfile) = opts.dockerfile {
5272            query = query.arg("dockerfile", dockerfile);
5273        }
5274        if let Some(platform) = opts.platform {
5275            query = query.arg("platform", platform);
5276        }
5277        if let Some(build_args) = opts.build_args {
5278            query = query.arg("buildArgs", build_args);
5279        }
5280        if let Some(target) = opts.target {
5281            query = query.arg("target", target);
5282        }
5283        if let Some(secrets) = opts.secrets {
5284            query = query.arg("secrets", secrets);
5285        }
5286        if let Some(no_init) = opts.no_init {
5287            query = query.arg("noInit", no_init);
5288        }
5289        Container {
5290            proc: self.proc.clone(),
5291            selection: query,
5292            graphql_client: self.graphql_client.clone(),
5293        }
5294    }
5295    /// Returns a list of files and directories at the given path.
5296    ///
5297    /// # Arguments
5298    ///
5299    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5300    pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
5301        let query = self.selection.select("entries");
5302        query.execute(self.graphql_client.clone()).await
5303    }
5304    /// Returns a list of files and directories at the given path.
5305    ///
5306    /// # Arguments
5307    ///
5308    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5309    pub async fn entries_opts<'a>(
5310        &self,
5311        opts: DirectoryEntriesOpts<'a>,
5312    ) -> Result<Vec<String>, DaggerError> {
5313        let mut query = self.selection.select("entries");
5314        if let Some(path) = opts.path {
5315            query = query.arg("path", path);
5316        }
5317        query.execute(self.graphql_client.clone()).await
5318    }
5319    /// check if a file or directory exists
5320    ///
5321    /// # Arguments
5322    ///
5323    /// * `path` - Path to check (e.g., "/file.txt").
5324    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5325    pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5326        let mut query = self.selection.select("exists");
5327        query = query.arg("path", path.into());
5328        query.execute(self.graphql_client.clone()).await
5329    }
5330    /// check if a file or directory exists
5331    ///
5332    /// # Arguments
5333    ///
5334    /// * `path` - Path to check (e.g., "/file.txt").
5335    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5336    pub async fn exists_opts(
5337        &self,
5338        path: impl Into<String>,
5339        opts: DirectoryExistsOpts,
5340    ) -> Result<bool, DaggerError> {
5341        let mut query = self.selection.select("exists");
5342        query = query.arg("path", path.into());
5343        if let Some(expected_type) = opts.expected_type {
5344            query = query.arg("expectedType", expected_type);
5345        }
5346        if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5347            query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5348        }
5349        query.execute(self.graphql_client.clone()).await
5350    }
5351    /// Writes the contents of the directory to a path on the host.
5352    ///
5353    /// # Arguments
5354    ///
5355    /// * `path` - Location of the copied directory (e.g., "logs/").
5356    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5357    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5358        let mut query = self.selection.select("export");
5359        query = query.arg("path", path.into());
5360        query.execute(self.graphql_client.clone()).await
5361    }
5362    /// Writes the contents of the directory to a path on the host.
5363    ///
5364    /// # Arguments
5365    ///
5366    /// * `path` - Location of the copied directory (e.g., "logs/").
5367    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5368    pub async fn export_opts(
5369        &self,
5370        path: impl Into<String>,
5371        opts: DirectoryExportOpts,
5372    ) -> Result<String, DaggerError> {
5373        let mut query = self.selection.select("export");
5374        query = query.arg("path", path.into());
5375        if let Some(wipe) = opts.wipe {
5376            query = query.arg("wipe", wipe);
5377        }
5378        query.execute(self.graphql_client.clone()).await
5379    }
5380    /// Retrieve a file at the given path.
5381    ///
5382    /// # Arguments
5383    ///
5384    /// * `path` - Location of the file to retrieve (e.g., "README.md").
5385    pub fn file(&self, path: impl Into<String>) -> File {
5386        let mut query = self.selection.select("file");
5387        query = query.arg("path", path.into());
5388        File {
5389            proc: self.proc.clone(),
5390            selection: query,
5391            graphql_client: self.graphql_client.clone(),
5392        }
5393    }
5394    /// Return a snapshot with some paths included or excluded
5395    ///
5396    /// # Arguments
5397    ///
5398    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5399    pub fn filter(&self) -> Directory {
5400        let query = self.selection.select("filter");
5401        Directory {
5402            proc: self.proc.clone(),
5403            selection: query,
5404            graphql_client: self.graphql_client.clone(),
5405        }
5406    }
5407    /// Return a snapshot with some paths included or excluded
5408    ///
5409    /// # Arguments
5410    ///
5411    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5412    pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5413        let mut query = self.selection.select("filter");
5414        if let Some(exclude) = opts.exclude {
5415            query = query.arg("exclude", exclude);
5416        }
5417        if let Some(include) = opts.include {
5418            query = query.arg("include", include);
5419        }
5420        if let Some(gitignore) = opts.gitignore {
5421            query = query.arg("gitignore", gitignore);
5422        }
5423        Directory {
5424            proc: self.proc.clone(),
5425            selection: query,
5426            graphql_client: self.graphql_client.clone(),
5427        }
5428    }
5429    /// Search up the directory tree for a file or directory, and return its path. If no match, return null
5430    ///
5431    /// # Arguments
5432    ///
5433    /// * `name` - The name of the file or directory to search for
5434    /// * `start` - The path to start the search from
5435    pub async fn find_up(
5436        &self,
5437        name: impl Into<String>,
5438        start: impl Into<String>,
5439    ) -> Result<String, DaggerError> {
5440        let mut query = self.selection.select("findUp");
5441        query = query.arg("name", name.into());
5442        query = query.arg("start", start.into());
5443        query.execute(self.graphql_client.clone()).await
5444    }
5445    /// Returns a list of files and directories that matche the given pattern.
5446    ///
5447    /// # Arguments
5448    ///
5449    /// * `pattern` - Pattern to match (e.g., "*.md").
5450    pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5451        let mut query = self.selection.select("glob");
5452        query = query.arg("pattern", pattern.into());
5453        query.execute(self.graphql_client.clone()).await
5454    }
5455    /// A unique identifier for this Directory.
5456    pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
5457        let query = self.selection.select("id");
5458        query.execute(self.graphql_client.clone()).await
5459    }
5460    /// Returns the name of the directory.
5461    pub async fn name(&self) -> Result<String, DaggerError> {
5462        let query = self.selection.select("name");
5463        query.execute(self.graphql_client.clone()).await
5464    }
5465    /// Searches for content matching the given regular expression or literal string.
5466    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5467    ///
5468    /// # Arguments
5469    ///
5470    /// * `pattern` - The text to match.
5471    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5472    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
5473        let mut query = self.selection.select("search");
5474        query = query.arg("pattern", pattern.into());
5475        vec![SearchResult {
5476            proc: self.proc.clone(),
5477            selection: query,
5478            graphql_client: self.graphql_client.clone(),
5479        }]
5480    }
5481    /// Searches for content matching the given regular expression or literal string.
5482    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
5483    ///
5484    /// # Arguments
5485    ///
5486    /// * `pattern` - The text to match.
5487    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5488    pub fn search_opts<'a>(
5489        &self,
5490        pattern: impl Into<String>,
5491        opts: DirectorySearchOpts<'a>,
5492    ) -> Vec<SearchResult> {
5493        let mut query = self.selection.select("search");
5494        query = query.arg("pattern", pattern.into());
5495        if let Some(paths) = opts.paths {
5496            query = query.arg("paths", paths);
5497        }
5498        if let Some(globs) = opts.globs {
5499            query = query.arg("globs", globs);
5500        }
5501        if let Some(literal) = opts.literal {
5502            query = query.arg("literal", literal);
5503        }
5504        if let Some(multiline) = opts.multiline {
5505            query = query.arg("multiline", multiline);
5506        }
5507        if let Some(dotall) = opts.dotall {
5508            query = query.arg("dotall", dotall);
5509        }
5510        if let Some(insensitive) = opts.insensitive {
5511            query = query.arg("insensitive", insensitive);
5512        }
5513        if let Some(skip_ignored) = opts.skip_ignored {
5514            query = query.arg("skipIgnored", skip_ignored);
5515        }
5516        if let Some(skip_hidden) = opts.skip_hidden {
5517            query = query.arg("skipHidden", skip_hidden);
5518        }
5519        if let Some(files_only) = opts.files_only {
5520            query = query.arg("filesOnly", files_only);
5521        }
5522        if let Some(limit) = opts.limit {
5523            query = query.arg("limit", limit);
5524        }
5525        vec![SearchResult {
5526            proc: self.proc.clone(),
5527            selection: query,
5528            graphql_client: self.graphql_client.clone(),
5529        }]
5530    }
5531    /// Force evaluation in the engine.
5532    pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
5533        let query = self.selection.select("sync");
5534        query.execute(self.graphql_client.clone()).await
5535    }
5536    /// Opens an interactive terminal in new container with this directory mounted inside.
5537    ///
5538    /// # Arguments
5539    ///
5540    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5541    pub fn terminal(&self) -> Directory {
5542        let query = self.selection.select("terminal");
5543        Directory {
5544            proc: self.proc.clone(),
5545            selection: query,
5546            graphql_client: self.graphql_client.clone(),
5547        }
5548    }
5549    /// Opens an interactive terminal in new container with this directory mounted inside.
5550    ///
5551    /// # Arguments
5552    ///
5553    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5554    pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5555        let mut query = self.selection.select("terminal");
5556        if let Some(container) = opts.container {
5557            query = query.arg("container", container);
5558        }
5559        if let Some(cmd) = opts.cmd {
5560            query = query.arg("cmd", cmd);
5561        }
5562        if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5563            query = query.arg(
5564                "experimentalPrivilegedNesting",
5565                experimental_privileged_nesting,
5566            );
5567        }
5568        if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5569            query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5570        }
5571        Directory {
5572            proc: self.proc.clone(),
5573            selection: query,
5574            graphql_client: self.graphql_client.clone(),
5575        }
5576    }
5577    /// Return a directory with changes from another directory applied to it.
5578    ///
5579    /// # Arguments
5580    ///
5581    /// * `changes` - Changes to apply to the directory
5582    pub fn with_changes(&self, changes: impl IntoID<ChangesetId>) -> Directory {
5583        let mut query = self.selection.select("withChanges");
5584        query = query.arg_lazy(
5585            "changes",
5586            Box::new(move || {
5587                let changes = changes.clone();
5588                Box::pin(async move { changes.into_id().await.unwrap().quote() })
5589            }),
5590        );
5591        Directory {
5592            proc: self.proc.clone(),
5593            selection: query,
5594            graphql_client: self.graphql_client.clone(),
5595        }
5596    }
5597    /// Return a snapshot with a directory added
5598    ///
5599    /// # Arguments
5600    ///
5601    /// * `path` - Location of the written directory (e.g., "/src/").
5602    /// * `source` - Identifier of the directory to copy.
5603    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5604    pub fn with_directory(
5605        &self,
5606        path: impl Into<String>,
5607        source: impl IntoID<DirectoryId>,
5608    ) -> Directory {
5609        let mut query = self.selection.select("withDirectory");
5610        query = query.arg("path", path.into());
5611        query = query.arg_lazy(
5612            "source",
5613            Box::new(move || {
5614                let source = source.clone();
5615                Box::pin(async move { source.into_id().await.unwrap().quote() })
5616            }),
5617        );
5618        Directory {
5619            proc: self.proc.clone(),
5620            selection: query,
5621            graphql_client: self.graphql_client.clone(),
5622        }
5623    }
5624    /// Return a snapshot with a directory added
5625    ///
5626    /// # Arguments
5627    ///
5628    /// * `path` - Location of the written directory (e.g., "/src/").
5629    /// * `source` - Identifier of the directory to copy.
5630    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5631    pub fn with_directory_opts<'a>(
5632        &self,
5633        path: impl Into<String>,
5634        source: impl IntoID<DirectoryId>,
5635        opts: DirectoryWithDirectoryOpts<'a>,
5636    ) -> Directory {
5637        let mut query = self.selection.select("withDirectory");
5638        query = query.arg("path", path.into());
5639        query = query.arg_lazy(
5640            "source",
5641            Box::new(move || {
5642                let source = source.clone();
5643                Box::pin(async move { source.into_id().await.unwrap().quote() })
5644            }),
5645        );
5646        if let Some(exclude) = opts.exclude {
5647            query = query.arg("exclude", exclude);
5648        }
5649        if let Some(include) = opts.include {
5650            query = query.arg("include", include);
5651        }
5652        if let Some(gitignore) = opts.gitignore {
5653            query = query.arg("gitignore", gitignore);
5654        }
5655        if let Some(owner) = opts.owner {
5656            query = query.arg("owner", owner);
5657        }
5658        Directory {
5659            proc: self.proc.clone(),
5660            selection: query,
5661            graphql_client: self.graphql_client.clone(),
5662        }
5663    }
5664    /// Raise an error.
5665    ///
5666    /// # Arguments
5667    ///
5668    /// * `err` - Message of the error to raise. If empty, the error will be ignored.
5669    pub fn with_error(&self, err: impl Into<String>) -> Directory {
5670        let mut query = self.selection.select("withError");
5671        query = query.arg("err", err.into());
5672        Directory {
5673            proc: self.proc.clone(),
5674            selection: query,
5675            graphql_client: self.graphql_client.clone(),
5676        }
5677    }
5678    /// Retrieves this directory plus the contents of the given file copied to the given path.
5679    ///
5680    /// # Arguments
5681    ///
5682    /// * `path` - Location of the copied file (e.g., "/file.txt").
5683    /// * `source` - Identifier of the file to copy.
5684    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5685    pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
5686        let mut query = self.selection.select("withFile");
5687        query = query.arg("path", path.into());
5688        query = query.arg_lazy(
5689            "source",
5690            Box::new(move || {
5691                let source = source.clone();
5692                Box::pin(async move { source.into_id().await.unwrap().quote() })
5693            }),
5694        );
5695        Directory {
5696            proc: self.proc.clone(),
5697            selection: query,
5698            graphql_client: self.graphql_client.clone(),
5699        }
5700    }
5701    /// Retrieves this directory plus the contents of the given file copied to the given path.
5702    ///
5703    /// # Arguments
5704    ///
5705    /// * `path` - Location of the copied file (e.g., "/file.txt").
5706    /// * `source` - Identifier of the file to copy.
5707    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5708    pub fn with_file_opts<'a>(
5709        &self,
5710        path: impl Into<String>,
5711        source: impl IntoID<FileId>,
5712        opts: DirectoryWithFileOpts<'a>,
5713    ) -> Directory {
5714        let mut query = self.selection.select("withFile");
5715        query = query.arg("path", path.into());
5716        query = query.arg_lazy(
5717            "source",
5718            Box::new(move || {
5719                let source = source.clone();
5720                Box::pin(async move { source.into_id().await.unwrap().quote() })
5721            }),
5722        );
5723        if let Some(permissions) = opts.permissions {
5724            query = query.arg("permissions", permissions);
5725        }
5726        if let Some(owner) = opts.owner {
5727            query = query.arg("owner", owner);
5728        }
5729        Directory {
5730            proc: self.proc.clone(),
5731            selection: query,
5732            graphql_client: self.graphql_client.clone(),
5733        }
5734    }
5735    /// Retrieves this directory plus the contents of the given files copied to the given path.
5736    ///
5737    /// # Arguments
5738    ///
5739    /// * `path` - Location where copied files should be placed (e.g., "/src").
5740    /// * `sources` - Identifiers of the files to copy.
5741    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5742    pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
5743        let mut query = self.selection.select("withFiles");
5744        query = query.arg("path", path.into());
5745        query = query.arg("sources", sources);
5746        Directory {
5747            proc: self.proc.clone(),
5748            selection: query,
5749            graphql_client: self.graphql_client.clone(),
5750        }
5751    }
5752    /// Retrieves this directory plus the contents of the given files copied to the given path.
5753    ///
5754    /// # Arguments
5755    ///
5756    /// * `path` - Location where copied files should be placed (e.g., "/src").
5757    /// * `sources` - Identifiers of the files to copy.
5758    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5759    pub fn with_files_opts(
5760        &self,
5761        path: impl Into<String>,
5762        sources: Vec<FileId>,
5763        opts: DirectoryWithFilesOpts,
5764    ) -> Directory {
5765        let mut query = self.selection.select("withFiles");
5766        query = query.arg("path", path.into());
5767        query = query.arg("sources", sources);
5768        if let Some(permissions) = opts.permissions {
5769            query = query.arg("permissions", permissions);
5770        }
5771        Directory {
5772            proc: self.proc.clone(),
5773            selection: query,
5774            graphql_client: self.graphql_client.clone(),
5775        }
5776    }
5777    /// Retrieves this directory plus a new directory created at the given path.
5778    ///
5779    /// # Arguments
5780    ///
5781    /// * `path` - Location of the directory created (e.g., "/logs").
5782    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5783    pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5784        let mut query = self.selection.select("withNewDirectory");
5785        query = query.arg("path", path.into());
5786        Directory {
5787            proc: self.proc.clone(),
5788            selection: query,
5789            graphql_client: self.graphql_client.clone(),
5790        }
5791    }
5792    /// Retrieves this directory plus a new directory created at the given path.
5793    ///
5794    /// # Arguments
5795    ///
5796    /// * `path` - Location of the directory created (e.g., "/logs").
5797    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5798    pub fn with_new_directory_opts(
5799        &self,
5800        path: impl Into<String>,
5801        opts: DirectoryWithNewDirectoryOpts,
5802    ) -> Directory {
5803        let mut query = self.selection.select("withNewDirectory");
5804        query = query.arg("path", path.into());
5805        if let Some(permissions) = opts.permissions {
5806            query = query.arg("permissions", permissions);
5807        }
5808        Directory {
5809            proc: self.proc.clone(),
5810            selection: query,
5811            graphql_client: self.graphql_client.clone(),
5812        }
5813    }
5814    /// Return a snapshot with a new file added
5815    ///
5816    /// # Arguments
5817    ///
5818    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5819    /// * `contents` - Contents of the new file. Example: "Hello world!"
5820    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5821    pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5822        let mut query = self.selection.select("withNewFile");
5823        query = query.arg("path", path.into());
5824        query = query.arg("contents", contents.into());
5825        Directory {
5826            proc: self.proc.clone(),
5827            selection: query,
5828            graphql_client: self.graphql_client.clone(),
5829        }
5830    }
5831    /// Return a snapshot with a new file added
5832    ///
5833    /// # Arguments
5834    ///
5835    /// * `path` - Path of the new file. Example: "foo/bar.txt"
5836    /// * `contents` - Contents of the new file. Example: "Hello world!"
5837    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
5838    pub fn with_new_file_opts(
5839        &self,
5840        path: impl Into<String>,
5841        contents: impl Into<String>,
5842        opts: DirectoryWithNewFileOpts,
5843    ) -> Directory {
5844        let mut query = self.selection.select("withNewFile");
5845        query = query.arg("path", path.into());
5846        query = query.arg("contents", contents.into());
5847        if let Some(permissions) = opts.permissions {
5848            query = query.arg("permissions", permissions);
5849        }
5850        Directory {
5851            proc: self.proc.clone(),
5852            selection: query,
5853            graphql_client: self.graphql_client.clone(),
5854        }
5855    }
5856    /// Retrieves this directory with the given Git-compatible patch applied.
5857    ///
5858    /// # Arguments
5859    ///
5860    /// * `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").
5861    pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5862        let mut query = self.selection.select("withPatch");
5863        query = query.arg("patch", patch.into());
5864        Directory {
5865            proc: self.proc.clone(),
5866            selection: query,
5867            graphql_client: self.graphql_client.clone(),
5868        }
5869    }
5870    /// Retrieves this directory with the given Git-compatible patch file applied.
5871    ///
5872    /// # Arguments
5873    ///
5874    /// * `patch` - File containing the patch to apply
5875    pub fn with_patch_file(&self, patch: impl IntoID<FileId>) -> Directory {
5876        let mut query = self.selection.select("withPatchFile");
5877        query = query.arg_lazy(
5878            "patch",
5879            Box::new(move || {
5880                let patch = patch.clone();
5881                Box::pin(async move { patch.into_id().await.unwrap().quote() })
5882            }),
5883        );
5884        Directory {
5885            proc: self.proc.clone(),
5886            selection: query,
5887            graphql_client: self.graphql_client.clone(),
5888        }
5889    }
5890    /// Return a snapshot with a symlink
5891    ///
5892    /// # Arguments
5893    ///
5894    /// * `target` - Location of the file or directory to link to (e.g., "/existing/file").
5895    /// * `link_name` - Location where the symbolic link will be created (e.g., "/new-file-link").
5896    pub fn with_symlink(
5897        &self,
5898        target: impl Into<String>,
5899        link_name: impl Into<String>,
5900    ) -> Directory {
5901        let mut query = self.selection.select("withSymlink");
5902        query = query.arg("target", target.into());
5903        query = query.arg("linkName", link_name.into());
5904        Directory {
5905            proc: self.proc.clone(),
5906            selection: query,
5907            graphql_client: self.graphql_client.clone(),
5908        }
5909    }
5910    /// Retrieves this directory with all file/dir timestamps set to the given time.
5911    ///
5912    /// # Arguments
5913    ///
5914    /// * `timestamp` - Timestamp to set dir/files in.
5915    ///
5916    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
5917    pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5918        let mut query = self.selection.select("withTimestamps");
5919        query = query.arg("timestamp", timestamp);
5920        Directory {
5921            proc: self.proc.clone(),
5922            selection: query,
5923            graphql_client: self.graphql_client.clone(),
5924        }
5925    }
5926    /// Return a snapshot with a subdirectory removed
5927    ///
5928    /// # Arguments
5929    ///
5930    /// * `path` - Path of the subdirectory to remove. Example: ".github/workflows"
5931    pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5932        let mut query = self.selection.select("withoutDirectory");
5933        query = query.arg("path", path.into());
5934        Directory {
5935            proc: self.proc.clone(),
5936            selection: query,
5937            graphql_client: self.graphql_client.clone(),
5938        }
5939    }
5940    /// Return a snapshot with a file removed
5941    ///
5942    /// # Arguments
5943    ///
5944    /// * `path` - Path of the file to remove (e.g., "/file.txt").
5945    pub fn without_file(&self, path: impl Into<String>) -> Directory {
5946        let mut query = self.selection.select("withoutFile");
5947        query = query.arg("path", path.into());
5948        Directory {
5949            proc: self.proc.clone(),
5950            selection: query,
5951            graphql_client: self.graphql_client.clone(),
5952        }
5953    }
5954    /// Return a snapshot with files removed
5955    ///
5956    /// # Arguments
5957    ///
5958    /// * `paths` - Paths of the files to remove (e.g., ["/file.txt"]).
5959    pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5960        let mut query = self.selection.select("withoutFiles");
5961        query = query.arg(
5962            "paths",
5963            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5964        );
5965        Directory {
5966            proc: self.proc.clone(),
5967            selection: query,
5968            graphql_client: self.graphql_client.clone(),
5969        }
5970    }
5971}
5972#[derive(Clone)]
5973pub struct Engine {
5974    pub proc: Option<Arc<DaggerSessionProc>>,
5975    pub selection: Selection,
5976    pub graphql_client: DynGraphQLClient,
5977}
5978impl Engine {
5979    /// The list of connected client IDs
5980    pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
5981        let query = self.selection.select("clients");
5982        query.execute(self.graphql_client.clone()).await
5983    }
5984    /// A unique identifier for this Engine.
5985    pub async fn id(&self) -> Result<EngineId, DaggerError> {
5986        let query = self.selection.select("id");
5987        query.execute(self.graphql_client.clone()).await
5988    }
5989    /// The local (on-disk) cache for the Dagger engine
5990    pub fn local_cache(&self) -> EngineCache {
5991        let query = self.selection.select("localCache");
5992        EngineCache {
5993            proc: self.proc.clone(),
5994            selection: query,
5995            graphql_client: self.graphql_client.clone(),
5996        }
5997    }
5998    /// The name of the engine instance.
5999    pub async fn name(&self) -> Result<String, DaggerError> {
6000        let query = self.selection.select("name");
6001        query.execute(self.graphql_client.clone()).await
6002    }
6003}
6004#[derive(Clone)]
6005pub struct EngineCache {
6006    pub proc: Option<Arc<DaggerSessionProc>>,
6007    pub selection: Selection,
6008    pub graphql_client: DynGraphQLClient,
6009}
6010#[derive(Builder, Debug, PartialEq)]
6011pub struct EngineCacheEntrySetOpts<'a> {
6012    #[builder(setter(into, strip_option), default)]
6013    pub key: Option<&'a str>,
6014}
6015#[derive(Builder, Debug, PartialEq)]
6016pub struct EngineCachePruneOpts {
6017    /// Use the engine-wide default pruning policy if true, otherwise prune the whole cache of any releasable entries.
6018    #[builder(setter(into, strip_option), default)]
6019    pub use_default_policy: Option<bool>,
6020}
6021impl EngineCache {
6022    /// The current set of entries in the cache
6023    ///
6024    /// # Arguments
6025    ///
6026    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6027    pub fn entry_set(&self) -> EngineCacheEntrySet {
6028        let query = self.selection.select("entrySet");
6029        EngineCacheEntrySet {
6030            proc: self.proc.clone(),
6031            selection: query,
6032            graphql_client: self.graphql_client.clone(),
6033        }
6034    }
6035    /// The current set of entries in the cache
6036    ///
6037    /// # Arguments
6038    ///
6039    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6040    pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
6041        let mut query = self.selection.select("entrySet");
6042        if let Some(key) = opts.key {
6043            query = query.arg("key", key);
6044        }
6045        EngineCacheEntrySet {
6046            proc: self.proc.clone(),
6047            selection: query,
6048            graphql_client: self.graphql_client.clone(),
6049        }
6050    }
6051    /// A unique identifier for this EngineCache.
6052    pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
6053        let query = self.selection.select("id");
6054        query.execute(self.graphql_client.clone()).await
6055    }
6056    /// The maximum bytes to keep in the cache without pruning.
6057    pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
6058        let query = self.selection.select("maxUsedSpace");
6059        query.execute(self.graphql_client.clone()).await
6060    }
6061    /// The target amount of free disk space the garbage collector will attempt to leave.
6062    pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
6063        let query = self.selection.select("minFreeSpace");
6064        query.execute(self.graphql_client.clone()).await
6065    }
6066    /// Prune the cache of releaseable entries
6067    ///
6068    /// # Arguments
6069    ///
6070    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6071    pub async fn prune(&self) -> Result<Void, DaggerError> {
6072        let query = self.selection.select("prune");
6073        query.execute(self.graphql_client.clone()).await
6074    }
6075    /// Prune the cache of releaseable entries
6076    ///
6077    /// # Arguments
6078    ///
6079    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
6080    pub async fn prune_opts(&self, opts: EngineCachePruneOpts) -> Result<Void, DaggerError> {
6081        let mut query = self.selection.select("prune");
6082        if let Some(use_default_policy) = opts.use_default_policy {
6083            query = query.arg("useDefaultPolicy", use_default_policy);
6084        }
6085        query.execute(self.graphql_client.clone()).await
6086    }
6087    /// The minimum amount of disk space this policy is guaranteed to retain.
6088    pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
6089        let query = self.selection.select("reservedSpace");
6090        query.execute(self.graphql_client.clone()).await
6091    }
6092    /// The target number of bytes to keep when pruning.
6093    pub async fn target_space(&self) -> Result<isize, DaggerError> {
6094        let query = self.selection.select("targetSpace");
6095        query.execute(self.graphql_client.clone()).await
6096    }
6097}
6098#[derive(Clone)]
6099pub struct EngineCacheEntry {
6100    pub proc: Option<Arc<DaggerSessionProc>>,
6101    pub selection: Selection,
6102    pub graphql_client: DynGraphQLClient,
6103}
6104impl EngineCacheEntry {
6105    /// Whether the cache entry is actively being used.
6106    pub async fn actively_used(&self) -> Result<bool, DaggerError> {
6107        let query = self.selection.select("activelyUsed");
6108        query.execute(self.graphql_client.clone()).await
6109    }
6110    /// The time the cache entry was created, in Unix nanoseconds.
6111    pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
6112        let query = self.selection.select("createdTimeUnixNano");
6113        query.execute(self.graphql_client.clone()).await
6114    }
6115    /// The description of the cache entry.
6116    pub async fn description(&self) -> Result<String, DaggerError> {
6117        let query = self.selection.select("description");
6118        query.execute(self.graphql_client.clone()).await
6119    }
6120    /// The disk space used by the cache entry.
6121    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6122        let query = self.selection.select("diskSpaceBytes");
6123        query.execute(self.graphql_client.clone()).await
6124    }
6125    /// A unique identifier for this EngineCacheEntry.
6126    pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
6127        let query = self.selection.select("id");
6128        query.execute(self.graphql_client.clone()).await
6129    }
6130    /// The most recent time the cache entry was used, in Unix nanoseconds.
6131    pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
6132        let query = self.selection.select("mostRecentUseTimeUnixNano");
6133        query.execute(self.graphql_client.clone()).await
6134    }
6135}
6136#[derive(Clone)]
6137pub struct EngineCacheEntrySet {
6138    pub proc: Option<Arc<DaggerSessionProc>>,
6139    pub selection: Selection,
6140    pub graphql_client: DynGraphQLClient,
6141}
6142impl EngineCacheEntrySet {
6143    /// The total disk space used by the cache entries in this set.
6144    pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6145        let query = self.selection.select("diskSpaceBytes");
6146        query.execute(self.graphql_client.clone()).await
6147    }
6148    /// The list of individual cache entries in the set
6149    pub fn entries(&self) -> Vec<EngineCacheEntry> {
6150        let query = self.selection.select("entries");
6151        vec![EngineCacheEntry {
6152            proc: self.proc.clone(),
6153            selection: query,
6154            graphql_client: self.graphql_client.clone(),
6155        }]
6156    }
6157    /// The number of cache entries in this set.
6158    pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6159        let query = self.selection.select("entryCount");
6160        query.execute(self.graphql_client.clone()).await
6161    }
6162    /// A unique identifier for this EngineCacheEntrySet.
6163    pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
6164        let query = self.selection.select("id");
6165        query.execute(self.graphql_client.clone()).await
6166    }
6167}
6168#[derive(Clone)]
6169pub struct EnumTypeDef {
6170    pub proc: Option<Arc<DaggerSessionProc>>,
6171    pub selection: Selection,
6172    pub graphql_client: DynGraphQLClient,
6173}
6174impl EnumTypeDef {
6175    /// A doc string for the enum, if any.
6176    pub async fn description(&self) -> Result<String, DaggerError> {
6177        let query = self.selection.select("description");
6178        query.execute(self.graphql_client.clone()).await
6179    }
6180    /// A unique identifier for this EnumTypeDef.
6181    pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
6182        let query = self.selection.select("id");
6183        query.execute(self.graphql_client.clone()).await
6184    }
6185    /// The members of the enum.
6186    pub fn members(&self) -> Vec<EnumValueTypeDef> {
6187        let query = self.selection.select("members");
6188        vec![EnumValueTypeDef {
6189            proc: self.proc.clone(),
6190            selection: query,
6191            graphql_client: self.graphql_client.clone(),
6192        }]
6193    }
6194    /// The name of the enum.
6195    pub async fn name(&self) -> Result<String, DaggerError> {
6196        let query = self.selection.select("name");
6197        query.execute(self.graphql_client.clone()).await
6198    }
6199    /// The location of this enum declaration.
6200    pub fn source_map(&self) -> SourceMap {
6201        let query = self.selection.select("sourceMap");
6202        SourceMap {
6203            proc: self.proc.clone(),
6204            selection: query,
6205            graphql_client: self.graphql_client.clone(),
6206        }
6207    }
6208    /// If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
6209    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6210        let query = self.selection.select("sourceModuleName");
6211        query.execute(self.graphql_client.clone()).await
6212    }
6213    pub fn values(&self) -> Vec<EnumValueTypeDef> {
6214        let query = self.selection.select("values");
6215        vec![EnumValueTypeDef {
6216            proc: self.proc.clone(),
6217            selection: query,
6218            graphql_client: self.graphql_client.clone(),
6219        }]
6220    }
6221}
6222#[derive(Clone)]
6223pub struct EnumValueTypeDef {
6224    pub proc: Option<Arc<DaggerSessionProc>>,
6225    pub selection: Selection,
6226    pub graphql_client: DynGraphQLClient,
6227}
6228impl EnumValueTypeDef {
6229    /// A doc string for the enum member, if any.
6230    pub async fn description(&self) -> Result<String, DaggerError> {
6231        let query = self.selection.select("description");
6232        query.execute(self.graphql_client.clone()).await
6233    }
6234    /// A unique identifier for this EnumValueTypeDef.
6235    pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
6236        let query = self.selection.select("id");
6237        query.execute(self.graphql_client.clone()).await
6238    }
6239    /// The name of the enum member.
6240    pub async fn name(&self) -> Result<String, DaggerError> {
6241        let query = self.selection.select("name");
6242        query.execute(self.graphql_client.clone()).await
6243    }
6244    /// The location of this enum member declaration.
6245    pub fn source_map(&self) -> SourceMap {
6246        let query = self.selection.select("sourceMap");
6247        SourceMap {
6248            proc: self.proc.clone(),
6249            selection: query,
6250            graphql_client: self.graphql_client.clone(),
6251        }
6252    }
6253    /// The value of the enum member
6254    pub async fn value(&self) -> Result<String, DaggerError> {
6255        let query = self.selection.select("value");
6256        query.execute(self.graphql_client.clone()).await
6257    }
6258}
6259#[derive(Clone)]
6260pub struct Env {
6261    pub proc: Option<Arc<DaggerSessionProc>>,
6262    pub selection: Selection,
6263    pub graphql_client: DynGraphQLClient,
6264}
6265impl Env {
6266    /// A unique identifier for this Env.
6267    pub async fn id(&self) -> Result<EnvId, DaggerError> {
6268        let query = self.selection.select("id");
6269        query.execute(self.graphql_client.clone()).await
6270    }
6271    /// Retrieves an input binding by name
6272    pub fn input(&self, name: impl Into<String>) -> Binding {
6273        let mut query = self.selection.select("input");
6274        query = query.arg("name", name.into());
6275        Binding {
6276            proc: self.proc.clone(),
6277            selection: query,
6278            graphql_client: self.graphql_client.clone(),
6279        }
6280    }
6281    /// Returns all input bindings provided to the environment
6282    pub fn inputs(&self) -> Vec<Binding> {
6283        let query = self.selection.select("inputs");
6284        vec![Binding {
6285            proc: self.proc.clone(),
6286            selection: query,
6287            graphql_client: self.graphql_client.clone(),
6288        }]
6289    }
6290    /// Retrieves an output binding by name
6291    pub fn output(&self, name: impl Into<String>) -> Binding {
6292        let mut query = self.selection.select("output");
6293        query = query.arg("name", name.into());
6294        Binding {
6295            proc: self.proc.clone(),
6296            selection: query,
6297            graphql_client: self.graphql_client.clone(),
6298        }
6299    }
6300    /// Returns all declared output bindings for the environment
6301    pub fn outputs(&self) -> Vec<Binding> {
6302        let query = self.selection.select("outputs");
6303        vec![Binding {
6304            proc: self.proc.clone(),
6305            selection: query,
6306            graphql_client: self.graphql_client.clone(),
6307        }]
6308    }
6309    /// Create or update a binding of type Address in the environment
6310    ///
6311    /// # Arguments
6312    ///
6313    /// * `name` - The name of the binding
6314    /// * `value` - The Address value to assign to the binding
6315    /// * `description` - The purpose of the input
6316    pub fn with_address_input(
6317        &self,
6318        name: impl Into<String>,
6319        value: impl IntoID<AddressId>,
6320        description: impl Into<String>,
6321    ) -> Env {
6322        let mut query = self.selection.select("withAddressInput");
6323        query = query.arg("name", name.into());
6324        query = query.arg_lazy(
6325            "value",
6326            Box::new(move || {
6327                let value = value.clone();
6328                Box::pin(async move { value.into_id().await.unwrap().quote() })
6329            }),
6330        );
6331        query = query.arg("description", description.into());
6332        Env {
6333            proc: self.proc.clone(),
6334            selection: query,
6335            graphql_client: self.graphql_client.clone(),
6336        }
6337    }
6338    /// Declare a desired Address output to be assigned in the environment
6339    ///
6340    /// # Arguments
6341    ///
6342    /// * `name` - The name of the binding
6343    /// * `description` - A description of the desired value of the binding
6344    pub fn with_address_output(
6345        &self,
6346        name: impl Into<String>,
6347        description: impl Into<String>,
6348    ) -> Env {
6349        let mut query = self.selection.select("withAddressOutput");
6350        query = query.arg("name", name.into());
6351        query = query.arg("description", description.into());
6352        Env {
6353            proc: self.proc.clone(),
6354            selection: query,
6355            graphql_client: self.graphql_client.clone(),
6356        }
6357    }
6358    /// Create or update a binding of type CacheVolume in the environment
6359    ///
6360    /// # Arguments
6361    ///
6362    /// * `name` - The name of the binding
6363    /// * `value` - The CacheVolume value to assign to the binding
6364    /// * `description` - The purpose of the input
6365    pub fn with_cache_volume_input(
6366        &self,
6367        name: impl Into<String>,
6368        value: impl IntoID<CacheVolumeId>,
6369        description: impl Into<String>,
6370    ) -> Env {
6371        let mut query = self.selection.select("withCacheVolumeInput");
6372        query = query.arg("name", name.into());
6373        query = query.arg_lazy(
6374            "value",
6375            Box::new(move || {
6376                let value = value.clone();
6377                Box::pin(async move { value.into_id().await.unwrap().quote() })
6378            }),
6379        );
6380        query = query.arg("description", description.into());
6381        Env {
6382            proc: self.proc.clone(),
6383            selection: query,
6384            graphql_client: self.graphql_client.clone(),
6385        }
6386    }
6387    /// Declare a desired CacheVolume output to be assigned in the environment
6388    ///
6389    /// # Arguments
6390    ///
6391    /// * `name` - The name of the binding
6392    /// * `description` - A description of the desired value of the binding
6393    pub fn with_cache_volume_output(
6394        &self,
6395        name: impl Into<String>,
6396        description: impl Into<String>,
6397    ) -> Env {
6398        let mut query = self.selection.select("withCacheVolumeOutput");
6399        query = query.arg("name", name.into());
6400        query = query.arg("description", description.into());
6401        Env {
6402            proc: self.proc.clone(),
6403            selection: query,
6404            graphql_client: self.graphql_client.clone(),
6405        }
6406    }
6407    /// Create or update a binding of type Changeset in the environment
6408    ///
6409    /// # Arguments
6410    ///
6411    /// * `name` - The name of the binding
6412    /// * `value` - The Changeset value to assign to the binding
6413    /// * `description` - The purpose of the input
6414    pub fn with_changeset_input(
6415        &self,
6416        name: impl Into<String>,
6417        value: impl IntoID<ChangesetId>,
6418        description: impl Into<String>,
6419    ) -> Env {
6420        let mut query = self.selection.select("withChangesetInput");
6421        query = query.arg("name", name.into());
6422        query = query.arg_lazy(
6423            "value",
6424            Box::new(move || {
6425                let value = value.clone();
6426                Box::pin(async move { value.into_id().await.unwrap().quote() })
6427            }),
6428        );
6429        query = query.arg("description", description.into());
6430        Env {
6431            proc: self.proc.clone(),
6432            selection: query,
6433            graphql_client: self.graphql_client.clone(),
6434        }
6435    }
6436    /// Declare a desired Changeset output to be assigned in the environment
6437    ///
6438    /// # Arguments
6439    ///
6440    /// * `name` - The name of the binding
6441    /// * `description` - A description of the desired value of the binding
6442    pub fn with_changeset_output(
6443        &self,
6444        name: impl Into<String>,
6445        description: impl Into<String>,
6446    ) -> Env {
6447        let mut query = self.selection.select("withChangesetOutput");
6448        query = query.arg("name", name.into());
6449        query = query.arg("description", description.into());
6450        Env {
6451            proc: self.proc.clone(),
6452            selection: query,
6453            graphql_client: self.graphql_client.clone(),
6454        }
6455    }
6456    /// Create or update a binding of type Cloud in the environment
6457    ///
6458    /// # Arguments
6459    ///
6460    /// * `name` - The name of the binding
6461    /// * `value` - The Cloud value to assign to the binding
6462    /// * `description` - The purpose of the input
6463    pub fn with_cloud_input(
6464        &self,
6465        name: impl Into<String>,
6466        value: impl IntoID<CloudId>,
6467        description: impl Into<String>,
6468    ) -> Env {
6469        let mut query = self.selection.select("withCloudInput");
6470        query = query.arg("name", name.into());
6471        query = query.arg_lazy(
6472            "value",
6473            Box::new(move || {
6474                let value = value.clone();
6475                Box::pin(async move { value.into_id().await.unwrap().quote() })
6476            }),
6477        );
6478        query = query.arg("description", description.into());
6479        Env {
6480            proc: self.proc.clone(),
6481            selection: query,
6482            graphql_client: self.graphql_client.clone(),
6483        }
6484    }
6485    /// Declare a desired Cloud output to be assigned in the environment
6486    ///
6487    /// # Arguments
6488    ///
6489    /// * `name` - The name of the binding
6490    /// * `description` - A description of the desired value of the binding
6491    pub fn with_cloud_output(
6492        &self,
6493        name: impl Into<String>,
6494        description: impl Into<String>,
6495    ) -> Env {
6496        let mut query = self.selection.select("withCloudOutput");
6497        query = query.arg("name", name.into());
6498        query = query.arg("description", description.into());
6499        Env {
6500            proc: self.proc.clone(),
6501            selection: query,
6502            graphql_client: self.graphql_client.clone(),
6503        }
6504    }
6505    /// Create or update a binding of type Container in the environment
6506    ///
6507    /// # Arguments
6508    ///
6509    /// * `name` - The name of the binding
6510    /// * `value` - The Container value to assign to the binding
6511    /// * `description` - The purpose of the input
6512    pub fn with_container_input(
6513        &self,
6514        name: impl Into<String>,
6515        value: impl IntoID<ContainerId>,
6516        description: impl Into<String>,
6517    ) -> Env {
6518        let mut query = self.selection.select("withContainerInput");
6519        query = query.arg("name", name.into());
6520        query = query.arg_lazy(
6521            "value",
6522            Box::new(move || {
6523                let value = value.clone();
6524                Box::pin(async move { value.into_id().await.unwrap().quote() })
6525            }),
6526        );
6527        query = query.arg("description", description.into());
6528        Env {
6529            proc: self.proc.clone(),
6530            selection: query,
6531            graphql_client: self.graphql_client.clone(),
6532        }
6533    }
6534    /// Declare a desired Container output to be assigned in the environment
6535    ///
6536    /// # Arguments
6537    ///
6538    /// * `name` - The name of the binding
6539    /// * `description` - A description of the desired value of the binding
6540    pub fn with_container_output(
6541        &self,
6542        name: impl Into<String>,
6543        description: impl Into<String>,
6544    ) -> Env {
6545        let mut query = self.selection.select("withContainerOutput");
6546        query = query.arg("name", name.into());
6547        query = query.arg("description", description.into());
6548        Env {
6549            proc: self.proc.clone(),
6550            selection: query,
6551            graphql_client: self.graphql_client.clone(),
6552        }
6553    }
6554    /// Installs the current module into the environment, exposing its functions to the model
6555    /// Contextual path arguments will be populated using the environment's workspace.
6556    pub fn with_current_module(&self) -> Env {
6557        let query = self.selection.select("withCurrentModule");
6558        Env {
6559            proc: self.proc.clone(),
6560            selection: query,
6561            graphql_client: self.graphql_client.clone(),
6562        }
6563    }
6564    /// Create or update a binding of type Directory in the environment
6565    ///
6566    /// # Arguments
6567    ///
6568    /// * `name` - The name of the binding
6569    /// * `value` - The Directory value to assign to the binding
6570    /// * `description` - The purpose of the input
6571    pub fn with_directory_input(
6572        &self,
6573        name: impl Into<String>,
6574        value: impl IntoID<DirectoryId>,
6575        description: impl Into<String>,
6576    ) -> Env {
6577        let mut query = self.selection.select("withDirectoryInput");
6578        query = query.arg("name", name.into());
6579        query = query.arg_lazy(
6580            "value",
6581            Box::new(move || {
6582                let value = value.clone();
6583                Box::pin(async move { value.into_id().await.unwrap().quote() })
6584            }),
6585        );
6586        query = query.arg("description", description.into());
6587        Env {
6588            proc: self.proc.clone(),
6589            selection: query,
6590            graphql_client: self.graphql_client.clone(),
6591        }
6592    }
6593    /// Declare a desired Directory output to be assigned in the environment
6594    ///
6595    /// # Arguments
6596    ///
6597    /// * `name` - The name of the binding
6598    /// * `description` - A description of the desired value of the binding
6599    pub fn with_directory_output(
6600        &self,
6601        name: impl Into<String>,
6602        description: impl Into<String>,
6603    ) -> Env {
6604        let mut query = self.selection.select("withDirectoryOutput");
6605        query = query.arg("name", name.into());
6606        query = query.arg("description", description.into());
6607        Env {
6608            proc: self.proc.clone(),
6609            selection: query,
6610            graphql_client: self.graphql_client.clone(),
6611        }
6612    }
6613    /// Create or update a binding of type EnvFile in the environment
6614    ///
6615    /// # Arguments
6616    ///
6617    /// * `name` - The name of the binding
6618    /// * `value` - The EnvFile value to assign to the binding
6619    /// * `description` - The purpose of the input
6620    pub fn with_env_file_input(
6621        &self,
6622        name: impl Into<String>,
6623        value: impl IntoID<EnvFileId>,
6624        description: impl Into<String>,
6625    ) -> Env {
6626        let mut query = self.selection.select("withEnvFileInput");
6627        query = query.arg("name", name.into());
6628        query = query.arg_lazy(
6629            "value",
6630            Box::new(move || {
6631                let value = value.clone();
6632                Box::pin(async move { value.into_id().await.unwrap().quote() })
6633            }),
6634        );
6635        query = query.arg("description", description.into());
6636        Env {
6637            proc: self.proc.clone(),
6638            selection: query,
6639            graphql_client: self.graphql_client.clone(),
6640        }
6641    }
6642    /// Declare a desired EnvFile output to be assigned in the environment
6643    ///
6644    /// # Arguments
6645    ///
6646    /// * `name` - The name of the binding
6647    /// * `description` - A description of the desired value of the binding
6648    pub fn with_env_file_output(
6649        &self,
6650        name: impl Into<String>,
6651        description: impl Into<String>,
6652    ) -> Env {
6653        let mut query = self.selection.select("withEnvFileOutput");
6654        query = query.arg("name", name.into());
6655        query = query.arg("description", description.into());
6656        Env {
6657            proc: self.proc.clone(),
6658            selection: query,
6659            graphql_client: self.graphql_client.clone(),
6660        }
6661    }
6662    /// Create or update a binding of type Env in the environment
6663    ///
6664    /// # Arguments
6665    ///
6666    /// * `name` - The name of the binding
6667    /// * `value` - The Env value to assign to the binding
6668    /// * `description` - The purpose of the input
6669    pub fn with_env_input(
6670        &self,
6671        name: impl Into<String>,
6672        value: impl IntoID<EnvId>,
6673        description: impl Into<String>,
6674    ) -> Env {
6675        let mut query = self.selection.select("withEnvInput");
6676        query = query.arg("name", name.into());
6677        query = query.arg_lazy(
6678            "value",
6679            Box::new(move || {
6680                let value = value.clone();
6681                Box::pin(async move { value.into_id().await.unwrap().quote() })
6682            }),
6683        );
6684        query = query.arg("description", description.into());
6685        Env {
6686            proc: self.proc.clone(),
6687            selection: query,
6688            graphql_client: self.graphql_client.clone(),
6689        }
6690    }
6691    /// Declare a desired Env output to be assigned in the environment
6692    ///
6693    /// # Arguments
6694    ///
6695    /// * `name` - The name of the binding
6696    /// * `description` - A description of the desired value of the binding
6697    pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6698        let mut query = self.selection.select("withEnvOutput");
6699        query = query.arg("name", name.into());
6700        query = query.arg("description", description.into());
6701        Env {
6702            proc: self.proc.clone(),
6703            selection: query,
6704            graphql_client: self.graphql_client.clone(),
6705        }
6706    }
6707    /// Create or update a binding of type File in the environment
6708    ///
6709    /// # Arguments
6710    ///
6711    /// * `name` - The name of the binding
6712    /// * `value` - The File value to assign to the binding
6713    /// * `description` - The purpose of the input
6714    pub fn with_file_input(
6715        &self,
6716        name: impl Into<String>,
6717        value: impl IntoID<FileId>,
6718        description: impl Into<String>,
6719    ) -> Env {
6720        let mut query = self.selection.select("withFileInput");
6721        query = query.arg("name", name.into());
6722        query = query.arg_lazy(
6723            "value",
6724            Box::new(move || {
6725                let value = value.clone();
6726                Box::pin(async move { value.into_id().await.unwrap().quote() })
6727            }),
6728        );
6729        query = query.arg("description", description.into());
6730        Env {
6731            proc: self.proc.clone(),
6732            selection: query,
6733            graphql_client: self.graphql_client.clone(),
6734        }
6735    }
6736    /// Declare a desired File output to be assigned in the environment
6737    ///
6738    /// # Arguments
6739    ///
6740    /// * `name` - The name of the binding
6741    /// * `description` - A description of the desired value of the binding
6742    pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6743        let mut query = self.selection.select("withFileOutput");
6744        query = query.arg("name", name.into());
6745        query = query.arg("description", description.into());
6746        Env {
6747            proc: self.proc.clone(),
6748            selection: query,
6749            graphql_client: self.graphql_client.clone(),
6750        }
6751    }
6752    /// Create or update a binding of type GitRef in the environment
6753    ///
6754    /// # Arguments
6755    ///
6756    /// * `name` - The name of the binding
6757    /// * `value` - The GitRef value to assign to the binding
6758    /// * `description` - The purpose of the input
6759    pub fn with_git_ref_input(
6760        &self,
6761        name: impl Into<String>,
6762        value: impl IntoID<GitRefId>,
6763        description: impl Into<String>,
6764    ) -> Env {
6765        let mut query = self.selection.select("withGitRefInput");
6766        query = query.arg("name", name.into());
6767        query = query.arg_lazy(
6768            "value",
6769            Box::new(move || {
6770                let value = value.clone();
6771                Box::pin(async move { value.into_id().await.unwrap().quote() })
6772            }),
6773        );
6774        query = query.arg("description", description.into());
6775        Env {
6776            proc: self.proc.clone(),
6777            selection: query,
6778            graphql_client: self.graphql_client.clone(),
6779        }
6780    }
6781    /// Declare a desired GitRef output to be assigned in the environment
6782    ///
6783    /// # Arguments
6784    ///
6785    /// * `name` - The name of the binding
6786    /// * `description` - A description of the desired value of the binding
6787    pub fn with_git_ref_output(
6788        &self,
6789        name: impl Into<String>,
6790        description: impl Into<String>,
6791    ) -> Env {
6792        let mut query = self.selection.select("withGitRefOutput");
6793        query = query.arg("name", name.into());
6794        query = query.arg("description", description.into());
6795        Env {
6796            proc: self.proc.clone(),
6797            selection: query,
6798            graphql_client: self.graphql_client.clone(),
6799        }
6800    }
6801    /// Create or update a binding of type GitRepository in the environment
6802    ///
6803    /// # Arguments
6804    ///
6805    /// * `name` - The name of the binding
6806    /// * `value` - The GitRepository value to assign to the binding
6807    /// * `description` - The purpose of the input
6808    pub fn with_git_repository_input(
6809        &self,
6810        name: impl Into<String>,
6811        value: impl IntoID<GitRepositoryId>,
6812        description: impl Into<String>,
6813    ) -> Env {
6814        let mut query = self.selection.select("withGitRepositoryInput");
6815        query = query.arg("name", name.into());
6816        query = query.arg_lazy(
6817            "value",
6818            Box::new(move || {
6819                let value = value.clone();
6820                Box::pin(async move { value.into_id().await.unwrap().quote() })
6821            }),
6822        );
6823        query = query.arg("description", description.into());
6824        Env {
6825            proc: self.proc.clone(),
6826            selection: query,
6827            graphql_client: self.graphql_client.clone(),
6828        }
6829    }
6830    /// Declare a desired GitRepository output to be assigned in the environment
6831    ///
6832    /// # Arguments
6833    ///
6834    /// * `name` - The name of the binding
6835    /// * `description` - A description of the desired value of the binding
6836    pub fn with_git_repository_output(
6837        &self,
6838        name: impl Into<String>,
6839        description: impl Into<String>,
6840    ) -> Env {
6841        let mut query = self.selection.select("withGitRepositoryOutput");
6842        query = query.arg("name", name.into());
6843        query = query.arg("description", description.into());
6844        Env {
6845            proc: self.proc.clone(),
6846            selection: query,
6847            graphql_client: self.graphql_client.clone(),
6848        }
6849    }
6850    /// Create or update a binding of type JSONValue in the environment
6851    ///
6852    /// # Arguments
6853    ///
6854    /// * `name` - The name of the binding
6855    /// * `value` - The JSONValue value to assign to the binding
6856    /// * `description` - The purpose of the input
6857    pub fn with_json_value_input(
6858        &self,
6859        name: impl Into<String>,
6860        value: impl IntoID<JsonValueId>,
6861        description: impl Into<String>,
6862    ) -> Env {
6863        let mut query = self.selection.select("withJSONValueInput");
6864        query = query.arg("name", name.into());
6865        query = query.arg_lazy(
6866            "value",
6867            Box::new(move || {
6868                let value = value.clone();
6869                Box::pin(async move { value.into_id().await.unwrap().quote() })
6870            }),
6871        );
6872        query = query.arg("description", description.into());
6873        Env {
6874            proc: self.proc.clone(),
6875            selection: query,
6876            graphql_client: self.graphql_client.clone(),
6877        }
6878    }
6879    /// Declare a desired JSONValue output to be assigned in the environment
6880    ///
6881    /// # Arguments
6882    ///
6883    /// * `name` - The name of the binding
6884    /// * `description` - A description of the desired value of the binding
6885    pub fn with_json_value_output(
6886        &self,
6887        name: impl Into<String>,
6888        description: impl Into<String>,
6889    ) -> Env {
6890        let mut query = self.selection.select("withJSONValueOutput");
6891        query = query.arg("name", name.into());
6892        query = query.arg("description", description.into());
6893        Env {
6894            proc: self.proc.clone(),
6895            selection: query,
6896            graphql_client: self.graphql_client.clone(),
6897        }
6898    }
6899    /// Installs a module into the environment, exposing its functions to the model
6900    /// Contextual path arguments will be populated using the environment's workspace.
6901    pub fn with_module(&self, module: impl IntoID<ModuleId>) -> Env {
6902        let mut query = self.selection.select("withModule");
6903        query = query.arg_lazy(
6904            "module",
6905            Box::new(move || {
6906                let module = module.clone();
6907                Box::pin(async move { module.into_id().await.unwrap().quote() })
6908            }),
6909        );
6910        Env {
6911            proc: self.proc.clone(),
6912            selection: query,
6913            graphql_client: self.graphql_client.clone(),
6914        }
6915    }
6916    /// Create or update a binding of type ModuleConfigClient in the environment
6917    ///
6918    /// # Arguments
6919    ///
6920    /// * `name` - The name of the binding
6921    /// * `value` - The ModuleConfigClient value to assign to the binding
6922    /// * `description` - The purpose of the input
6923    pub fn with_module_config_client_input(
6924        &self,
6925        name: impl Into<String>,
6926        value: impl IntoID<ModuleConfigClientId>,
6927        description: impl Into<String>,
6928    ) -> Env {
6929        let mut query = self.selection.select("withModuleConfigClientInput");
6930        query = query.arg("name", name.into());
6931        query = query.arg_lazy(
6932            "value",
6933            Box::new(move || {
6934                let value = value.clone();
6935                Box::pin(async move { value.into_id().await.unwrap().quote() })
6936            }),
6937        );
6938        query = query.arg("description", description.into());
6939        Env {
6940            proc: self.proc.clone(),
6941            selection: query,
6942            graphql_client: self.graphql_client.clone(),
6943        }
6944    }
6945    /// Declare a desired ModuleConfigClient output to be assigned in the environment
6946    ///
6947    /// # Arguments
6948    ///
6949    /// * `name` - The name of the binding
6950    /// * `description` - A description of the desired value of the binding
6951    pub fn with_module_config_client_output(
6952        &self,
6953        name: impl Into<String>,
6954        description: impl Into<String>,
6955    ) -> Env {
6956        let mut query = self.selection.select("withModuleConfigClientOutput");
6957        query = query.arg("name", name.into());
6958        query = query.arg("description", description.into());
6959        Env {
6960            proc: self.proc.clone(),
6961            selection: query,
6962            graphql_client: self.graphql_client.clone(),
6963        }
6964    }
6965    /// Create or update a binding of type Module in the environment
6966    ///
6967    /// # Arguments
6968    ///
6969    /// * `name` - The name of the binding
6970    /// * `value` - The Module value to assign to the binding
6971    /// * `description` - The purpose of the input
6972    pub fn with_module_input(
6973        &self,
6974        name: impl Into<String>,
6975        value: impl IntoID<ModuleId>,
6976        description: impl Into<String>,
6977    ) -> Env {
6978        let mut query = self.selection.select("withModuleInput");
6979        query = query.arg("name", name.into());
6980        query = query.arg_lazy(
6981            "value",
6982            Box::new(move || {
6983                let value = value.clone();
6984                Box::pin(async move { value.into_id().await.unwrap().quote() })
6985            }),
6986        );
6987        query = query.arg("description", description.into());
6988        Env {
6989            proc: self.proc.clone(),
6990            selection: query,
6991            graphql_client: self.graphql_client.clone(),
6992        }
6993    }
6994    /// Declare a desired Module output to be assigned in the environment
6995    ///
6996    /// # Arguments
6997    ///
6998    /// * `name` - The name of the binding
6999    /// * `description` - A description of the desired value of the binding
7000    pub fn with_module_output(
7001        &self,
7002        name: impl Into<String>,
7003        description: impl Into<String>,
7004    ) -> Env {
7005        let mut query = self.selection.select("withModuleOutput");
7006        query = query.arg("name", name.into());
7007        query = query.arg("description", description.into());
7008        Env {
7009            proc: self.proc.clone(),
7010            selection: query,
7011            graphql_client: self.graphql_client.clone(),
7012        }
7013    }
7014    /// Create or update a binding of type ModuleSource in the environment
7015    ///
7016    /// # Arguments
7017    ///
7018    /// * `name` - The name of the binding
7019    /// * `value` - The ModuleSource value to assign to the binding
7020    /// * `description` - The purpose of the input
7021    pub fn with_module_source_input(
7022        &self,
7023        name: impl Into<String>,
7024        value: impl IntoID<ModuleSourceId>,
7025        description: impl Into<String>,
7026    ) -> Env {
7027        let mut query = self.selection.select("withModuleSourceInput");
7028        query = query.arg("name", name.into());
7029        query = query.arg_lazy(
7030            "value",
7031            Box::new(move || {
7032                let value = value.clone();
7033                Box::pin(async move { value.into_id().await.unwrap().quote() })
7034            }),
7035        );
7036        query = query.arg("description", description.into());
7037        Env {
7038            proc: self.proc.clone(),
7039            selection: query,
7040            graphql_client: self.graphql_client.clone(),
7041        }
7042    }
7043    /// Declare a desired ModuleSource output to be assigned in the environment
7044    ///
7045    /// # Arguments
7046    ///
7047    /// * `name` - The name of the binding
7048    /// * `description` - A description of the desired value of the binding
7049    pub fn with_module_source_output(
7050        &self,
7051        name: impl Into<String>,
7052        description: impl Into<String>,
7053    ) -> Env {
7054        let mut query = self.selection.select("withModuleSourceOutput");
7055        query = query.arg("name", name.into());
7056        query = query.arg("description", description.into());
7057        Env {
7058            proc: self.proc.clone(),
7059            selection: query,
7060            graphql_client: self.graphql_client.clone(),
7061        }
7062    }
7063    /// Create or update a binding of type SearchResult in the environment
7064    ///
7065    /// # Arguments
7066    ///
7067    /// * `name` - The name of the binding
7068    /// * `value` - The SearchResult value to assign to the binding
7069    /// * `description` - The purpose of the input
7070    pub fn with_search_result_input(
7071        &self,
7072        name: impl Into<String>,
7073        value: impl IntoID<SearchResultId>,
7074        description: impl Into<String>,
7075    ) -> Env {
7076        let mut query = self.selection.select("withSearchResultInput");
7077        query = query.arg("name", name.into());
7078        query = query.arg_lazy(
7079            "value",
7080            Box::new(move || {
7081                let value = value.clone();
7082                Box::pin(async move { value.into_id().await.unwrap().quote() })
7083            }),
7084        );
7085        query = query.arg("description", description.into());
7086        Env {
7087            proc: self.proc.clone(),
7088            selection: query,
7089            graphql_client: self.graphql_client.clone(),
7090        }
7091    }
7092    /// Declare a desired SearchResult output to be assigned in the environment
7093    ///
7094    /// # Arguments
7095    ///
7096    /// * `name` - The name of the binding
7097    /// * `description` - A description of the desired value of the binding
7098    pub fn with_search_result_output(
7099        &self,
7100        name: impl Into<String>,
7101        description: impl Into<String>,
7102    ) -> Env {
7103        let mut query = self.selection.select("withSearchResultOutput");
7104        query = query.arg("name", name.into());
7105        query = query.arg("description", description.into());
7106        Env {
7107            proc: self.proc.clone(),
7108            selection: query,
7109            graphql_client: self.graphql_client.clone(),
7110        }
7111    }
7112    /// Create or update a binding of type SearchSubmatch in the environment
7113    ///
7114    /// # Arguments
7115    ///
7116    /// * `name` - The name of the binding
7117    /// * `value` - The SearchSubmatch value to assign to the binding
7118    /// * `description` - The purpose of the input
7119    pub fn with_search_submatch_input(
7120        &self,
7121        name: impl Into<String>,
7122        value: impl IntoID<SearchSubmatchId>,
7123        description: impl Into<String>,
7124    ) -> Env {
7125        let mut query = self.selection.select("withSearchSubmatchInput");
7126        query = query.arg("name", name.into());
7127        query = query.arg_lazy(
7128            "value",
7129            Box::new(move || {
7130                let value = value.clone();
7131                Box::pin(async move { value.into_id().await.unwrap().quote() })
7132            }),
7133        );
7134        query = query.arg("description", description.into());
7135        Env {
7136            proc: self.proc.clone(),
7137            selection: query,
7138            graphql_client: self.graphql_client.clone(),
7139        }
7140    }
7141    /// Declare a desired SearchSubmatch output to be assigned in the environment
7142    ///
7143    /// # Arguments
7144    ///
7145    /// * `name` - The name of the binding
7146    /// * `description` - A description of the desired value of the binding
7147    pub fn with_search_submatch_output(
7148        &self,
7149        name: impl Into<String>,
7150        description: impl Into<String>,
7151    ) -> Env {
7152        let mut query = self.selection.select("withSearchSubmatchOutput");
7153        query = query.arg("name", name.into());
7154        query = query.arg("description", description.into());
7155        Env {
7156            proc: self.proc.clone(),
7157            selection: query,
7158            graphql_client: self.graphql_client.clone(),
7159        }
7160    }
7161    /// Create or update a binding of type Secret in the environment
7162    ///
7163    /// # Arguments
7164    ///
7165    /// * `name` - The name of the binding
7166    /// * `value` - The Secret value to assign to the binding
7167    /// * `description` - The purpose of the input
7168    pub fn with_secret_input(
7169        &self,
7170        name: impl Into<String>,
7171        value: impl IntoID<SecretId>,
7172        description: impl Into<String>,
7173    ) -> Env {
7174        let mut query = self.selection.select("withSecretInput");
7175        query = query.arg("name", name.into());
7176        query = query.arg_lazy(
7177            "value",
7178            Box::new(move || {
7179                let value = value.clone();
7180                Box::pin(async move { value.into_id().await.unwrap().quote() })
7181            }),
7182        );
7183        query = query.arg("description", description.into());
7184        Env {
7185            proc: self.proc.clone(),
7186            selection: query,
7187            graphql_client: self.graphql_client.clone(),
7188        }
7189    }
7190    /// Declare a desired Secret output to be assigned in the environment
7191    ///
7192    /// # Arguments
7193    ///
7194    /// * `name` - The name of the binding
7195    /// * `description` - A description of the desired value of the binding
7196    pub fn with_secret_output(
7197        &self,
7198        name: impl Into<String>,
7199        description: impl Into<String>,
7200    ) -> Env {
7201        let mut query = self.selection.select("withSecretOutput");
7202        query = query.arg("name", name.into());
7203        query = query.arg("description", description.into());
7204        Env {
7205            proc: self.proc.clone(),
7206            selection: query,
7207            graphql_client: self.graphql_client.clone(),
7208        }
7209    }
7210    /// Create or update a binding of type Service in the environment
7211    ///
7212    /// # Arguments
7213    ///
7214    /// * `name` - The name of the binding
7215    /// * `value` - The Service value to assign to the binding
7216    /// * `description` - The purpose of the input
7217    pub fn with_service_input(
7218        &self,
7219        name: impl Into<String>,
7220        value: impl IntoID<ServiceId>,
7221        description: impl Into<String>,
7222    ) -> Env {
7223        let mut query = self.selection.select("withServiceInput");
7224        query = query.arg("name", name.into());
7225        query = query.arg_lazy(
7226            "value",
7227            Box::new(move || {
7228                let value = value.clone();
7229                Box::pin(async move { value.into_id().await.unwrap().quote() })
7230            }),
7231        );
7232        query = query.arg("description", description.into());
7233        Env {
7234            proc: self.proc.clone(),
7235            selection: query,
7236            graphql_client: self.graphql_client.clone(),
7237        }
7238    }
7239    /// Declare a desired Service output to be assigned in the environment
7240    ///
7241    /// # Arguments
7242    ///
7243    /// * `name` - The name of the binding
7244    /// * `description` - A description of the desired value of the binding
7245    pub fn with_service_output(
7246        &self,
7247        name: impl Into<String>,
7248        description: impl Into<String>,
7249    ) -> Env {
7250        let mut query = self.selection.select("withServiceOutput");
7251        query = query.arg("name", name.into());
7252        query = query.arg("description", description.into());
7253        Env {
7254            proc: self.proc.clone(),
7255            selection: query,
7256            graphql_client: self.graphql_client.clone(),
7257        }
7258    }
7259    /// Create or update a binding of type Socket in the environment
7260    ///
7261    /// # Arguments
7262    ///
7263    /// * `name` - The name of the binding
7264    /// * `value` - The Socket value to assign to the binding
7265    /// * `description` - The purpose of the input
7266    pub fn with_socket_input(
7267        &self,
7268        name: impl Into<String>,
7269        value: impl IntoID<SocketId>,
7270        description: impl Into<String>,
7271    ) -> Env {
7272        let mut query = self.selection.select("withSocketInput");
7273        query = query.arg("name", name.into());
7274        query = query.arg_lazy(
7275            "value",
7276            Box::new(move || {
7277                let value = value.clone();
7278                Box::pin(async move { value.into_id().await.unwrap().quote() })
7279            }),
7280        );
7281        query = query.arg("description", description.into());
7282        Env {
7283            proc: self.proc.clone(),
7284            selection: query,
7285            graphql_client: self.graphql_client.clone(),
7286        }
7287    }
7288    /// Declare a desired Socket output to be assigned in the environment
7289    ///
7290    /// # Arguments
7291    ///
7292    /// * `name` - The name of the binding
7293    /// * `description` - A description of the desired value of the binding
7294    pub fn with_socket_output(
7295        &self,
7296        name: impl Into<String>,
7297        description: impl Into<String>,
7298    ) -> Env {
7299        let mut query = self.selection.select("withSocketOutput");
7300        query = query.arg("name", name.into());
7301        query = query.arg("description", description.into());
7302        Env {
7303            proc: self.proc.clone(),
7304            selection: query,
7305            graphql_client: self.graphql_client.clone(),
7306        }
7307    }
7308    /// Provides a string input binding to the environment
7309    ///
7310    /// # Arguments
7311    ///
7312    /// * `name` - The name of the binding
7313    /// * `value` - The string value to assign to the binding
7314    /// * `description` - The description of the input
7315    pub fn with_string_input(
7316        &self,
7317        name: impl Into<String>,
7318        value: impl Into<String>,
7319        description: impl Into<String>,
7320    ) -> Env {
7321        let mut query = self.selection.select("withStringInput");
7322        query = query.arg("name", name.into());
7323        query = query.arg("value", value.into());
7324        query = query.arg("description", description.into());
7325        Env {
7326            proc: self.proc.clone(),
7327            selection: query,
7328            graphql_client: self.graphql_client.clone(),
7329        }
7330    }
7331    /// Declares a desired string output binding
7332    ///
7333    /// # Arguments
7334    ///
7335    /// * `name` - The name of the binding
7336    /// * `description` - The description of the output
7337    pub fn with_string_output(
7338        &self,
7339        name: impl Into<String>,
7340        description: impl Into<String>,
7341    ) -> Env {
7342        let mut query = self.selection.select("withStringOutput");
7343        query = query.arg("name", name.into());
7344        query = query.arg("description", description.into());
7345        Env {
7346            proc: self.proc.clone(),
7347            selection: query,
7348            graphql_client: self.graphql_client.clone(),
7349        }
7350    }
7351    /// Returns a new environment with the provided workspace
7352    ///
7353    /// # Arguments
7354    ///
7355    /// * `workspace` - The directory to set as the host filesystem
7356    pub fn with_workspace(&self, workspace: impl IntoID<DirectoryId>) -> Env {
7357        let mut query = self.selection.select("withWorkspace");
7358        query = query.arg_lazy(
7359            "workspace",
7360            Box::new(move || {
7361                let workspace = workspace.clone();
7362                Box::pin(async move { workspace.into_id().await.unwrap().quote() })
7363            }),
7364        );
7365        Env {
7366            proc: self.proc.clone(),
7367            selection: query,
7368            graphql_client: self.graphql_client.clone(),
7369        }
7370    }
7371    /// Returns a new environment without any outputs
7372    pub fn without_outputs(&self) -> Env {
7373        let query = self.selection.select("withoutOutputs");
7374        Env {
7375            proc: self.proc.clone(),
7376            selection: query,
7377            graphql_client: self.graphql_client.clone(),
7378        }
7379    }
7380    pub fn workspace(&self) -> Directory {
7381        let query = self.selection.select("workspace");
7382        Directory {
7383            proc: self.proc.clone(),
7384            selection: query,
7385            graphql_client: self.graphql_client.clone(),
7386        }
7387    }
7388}
7389#[derive(Clone)]
7390pub struct EnvFile {
7391    pub proc: Option<Arc<DaggerSessionProc>>,
7392    pub selection: Selection,
7393    pub graphql_client: DynGraphQLClient,
7394}
7395#[derive(Builder, Debug, PartialEq)]
7396pub struct EnvFileGetOpts {
7397    /// Return the value exactly as written to the file. No quote removal or variable expansion
7398    #[builder(setter(into, strip_option), default)]
7399    pub raw: Option<bool>,
7400}
7401#[derive(Builder, Debug, PartialEq)]
7402pub struct EnvFileVariablesOpts {
7403    /// Return values exactly as written to the file. No quote removal or variable expansion
7404    #[builder(setter(into, strip_option), default)]
7405    pub raw: Option<bool>,
7406}
7407impl EnvFile {
7408    /// Return as a file
7409    pub fn as_file(&self) -> File {
7410        let query = self.selection.select("asFile");
7411        File {
7412            proc: self.proc.clone(),
7413            selection: query,
7414            graphql_client: self.graphql_client.clone(),
7415        }
7416    }
7417    /// Check if a variable exists
7418    ///
7419    /// # Arguments
7420    ///
7421    /// * `name` - Variable name
7422    pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
7423        let mut query = self.selection.select("exists");
7424        query = query.arg("name", name.into());
7425        query.execute(self.graphql_client.clone()).await
7426    }
7427    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
7428    ///
7429    /// # Arguments
7430    ///
7431    /// * `name` - Variable name
7432    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7433    pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
7434        let mut query = self.selection.select("get");
7435        query = query.arg("name", name.into());
7436        query.execute(self.graphql_client.clone()).await
7437    }
7438    /// Lookup a variable (last occurrence wins) and return its value, or an empty string
7439    ///
7440    /// # Arguments
7441    ///
7442    /// * `name` - Variable name
7443    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7444    pub async fn get_opts(
7445        &self,
7446        name: impl Into<String>,
7447        opts: EnvFileGetOpts,
7448    ) -> Result<String, DaggerError> {
7449        let mut query = self.selection.select("get");
7450        query = query.arg("name", name.into());
7451        if let Some(raw) = opts.raw {
7452            query = query.arg("raw", raw);
7453        }
7454        query.execute(self.graphql_client.clone()).await
7455    }
7456    /// A unique identifier for this EnvFile.
7457    pub async fn id(&self) -> Result<EnvFileId, DaggerError> {
7458        let query = self.selection.select("id");
7459        query.execute(self.graphql_client.clone()).await
7460    }
7461    /// Filters variables by prefix and removes the pref from keys. Variables without the prefix are excluded. For example, with the prefix "MY_APP_" and variables: MY_APP_TOKEN=topsecret MY_APP_NAME=hello FOO=bar the resulting environment will contain: TOKEN=topsecret NAME=hello
7462    ///
7463    /// # Arguments
7464    ///
7465    /// * `prefix` - The prefix to filter by
7466    pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
7467        let mut query = self.selection.select("namespace");
7468        query = query.arg("prefix", prefix.into());
7469        EnvFile {
7470            proc: self.proc.clone(),
7471            selection: query,
7472            graphql_client: self.graphql_client.clone(),
7473        }
7474    }
7475    /// Return all variables
7476    ///
7477    /// # Arguments
7478    ///
7479    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7480    pub fn variables(&self) -> Vec<EnvVariable> {
7481        let query = self.selection.select("variables");
7482        vec![EnvVariable {
7483            proc: self.proc.clone(),
7484            selection: query,
7485            graphql_client: self.graphql_client.clone(),
7486        }]
7487    }
7488    /// Return all variables
7489    ///
7490    /// # Arguments
7491    ///
7492    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7493    pub fn variables_opts(&self, opts: EnvFileVariablesOpts) -> Vec<EnvVariable> {
7494        let mut query = self.selection.select("variables");
7495        if let Some(raw) = opts.raw {
7496            query = query.arg("raw", raw);
7497        }
7498        vec![EnvVariable {
7499            proc: self.proc.clone(),
7500            selection: query,
7501            graphql_client: self.graphql_client.clone(),
7502        }]
7503    }
7504    /// Add a variable
7505    ///
7506    /// # Arguments
7507    ///
7508    /// * `name` - Variable name
7509    /// * `value` - Variable value
7510    pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
7511        let mut query = self.selection.select("withVariable");
7512        query = query.arg("name", name.into());
7513        query = query.arg("value", value.into());
7514        EnvFile {
7515            proc: self.proc.clone(),
7516            selection: query,
7517            graphql_client: self.graphql_client.clone(),
7518        }
7519    }
7520    /// Remove all occurrences of the named variable
7521    ///
7522    /// # Arguments
7523    ///
7524    /// * `name` - Variable name
7525    pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
7526        let mut query = self.selection.select("withoutVariable");
7527        query = query.arg("name", name.into());
7528        EnvFile {
7529            proc: self.proc.clone(),
7530            selection: query,
7531            graphql_client: self.graphql_client.clone(),
7532        }
7533    }
7534}
7535#[derive(Clone)]
7536pub struct EnvVariable {
7537    pub proc: Option<Arc<DaggerSessionProc>>,
7538    pub selection: Selection,
7539    pub graphql_client: DynGraphQLClient,
7540}
7541impl EnvVariable {
7542    /// A unique identifier for this EnvVariable.
7543    pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
7544        let query = self.selection.select("id");
7545        query.execute(self.graphql_client.clone()).await
7546    }
7547    /// The environment variable name.
7548    pub async fn name(&self) -> Result<String, DaggerError> {
7549        let query = self.selection.select("name");
7550        query.execute(self.graphql_client.clone()).await
7551    }
7552    /// The environment variable value.
7553    pub async fn value(&self) -> Result<String, DaggerError> {
7554        let query = self.selection.select("value");
7555        query.execute(self.graphql_client.clone()).await
7556    }
7557}
7558#[derive(Clone)]
7559pub struct Error {
7560    pub proc: Option<Arc<DaggerSessionProc>>,
7561    pub selection: Selection,
7562    pub graphql_client: DynGraphQLClient,
7563}
7564impl Error {
7565    /// A unique identifier for this Error.
7566    pub async fn id(&self) -> Result<ErrorId, DaggerError> {
7567        let query = self.selection.select("id");
7568        query.execute(self.graphql_client.clone()).await
7569    }
7570    /// A description of the error.
7571    pub async fn message(&self) -> Result<String, DaggerError> {
7572        let query = self.selection.select("message");
7573        query.execute(self.graphql_client.clone()).await
7574    }
7575    /// The extensions of the error.
7576    pub fn values(&self) -> Vec<ErrorValue> {
7577        let query = self.selection.select("values");
7578        vec![ErrorValue {
7579            proc: self.proc.clone(),
7580            selection: query,
7581            graphql_client: self.graphql_client.clone(),
7582        }]
7583    }
7584    /// Add a value to the error.
7585    ///
7586    /// # Arguments
7587    ///
7588    /// * `name` - The name of the value.
7589    /// * `value` - The value to store on the error.
7590    pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
7591        let mut query = self.selection.select("withValue");
7592        query = query.arg("name", name.into());
7593        query = query.arg("value", value);
7594        Error {
7595            proc: self.proc.clone(),
7596            selection: query,
7597            graphql_client: self.graphql_client.clone(),
7598        }
7599    }
7600}
7601#[derive(Clone)]
7602pub struct ErrorValue {
7603    pub proc: Option<Arc<DaggerSessionProc>>,
7604    pub selection: Selection,
7605    pub graphql_client: DynGraphQLClient,
7606}
7607impl ErrorValue {
7608    /// A unique identifier for this ErrorValue.
7609    pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
7610        let query = self.selection.select("id");
7611        query.execute(self.graphql_client.clone()).await
7612    }
7613    /// The name of the value.
7614    pub async fn name(&self) -> Result<String, DaggerError> {
7615        let query = self.selection.select("name");
7616        query.execute(self.graphql_client.clone()).await
7617    }
7618    /// The value.
7619    pub async fn value(&self) -> Result<Json, DaggerError> {
7620        let query = self.selection.select("value");
7621        query.execute(self.graphql_client.clone()).await
7622    }
7623}
7624#[derive(Clone)]
7625pub struct FieldTypeDef {
7626    pub proc: Option<Arc<DaggerSessionProc>>,
7627    pub selection: Selection,
7628    pub graphql_client: DynGraphQLClient,
7629}
7630impl FieldTypeDef {
7631    /// A doc string for the field, if any.
7632    pub async fn description(&self) -> Result<String, DaggerError> {
7633        let query = self.selection.select("description");
7634        query.execute(self.graphql_client.clone()).await
7635    }
7636    /// A unique identifier for this FieldTypeDef.
7637    pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
7638        let query = self.selection.select("id");
7639        query.execute(self.graphql_client.clone()).await
7640    }
7641    /// The name of the field in lowerCamelCase format.
7642    pub async fn name(&self) -> Result<String, DaggerError> {
7643        let query = self.selection.select("name");
7644        query.execute(self.graphql_client.clone()).await
7645    }
7646    /// The location of this field declaration.
7647    pub fn source_map(&self) -> SourceMap {
7648        let query = self.selection.select("sourceMap");
7649        SourceMap {
7650            proc: self.proc.clone(),
7651            selection: query,
7652            graphql_client: self.graphql_client.clone(),
7653        }
7654    }
7655    /// The type of the field.
7656    pub fn type_def(&self) -> TypeDef {
7657        let query = self.selection.select("typeDef");
7658        TypeDef {
7659            proc: self.proc.clone(),
7660            selection: query,
7661            graphql_client: self.graphql_client.clone(),
7662        }
7663    }
7664}
7665#[derive(Clone)]
7666pub struct File {
7667    pub proc: Option<Arc<DaggerSessionProc>>,
7668    pub selection: Selection,
7669    pub graphql_client: DynGraphQLClient,
7670}
7671#[derive(Builder, Debug, PartialEq)]
7672pub struct FileAsEnvFileOpts {
7673    /// Replace "${VAR}" or "$VAR" with the value of other vars
7674    #[builder(setter(into, strip_option), default)]
7675    pub expand: Option<bool>,
7676}
7677#[derive(Builder, Debug, PartialEq)]
7678pub struct FileContentsOpts {
7679    /// Maximum number of lines to read
7680    #[builder(setter(into, strip_option), default)]
7681    pub limit_lines: Option<isize>,
7682    /// Start reading after this line
7683    #[builder(setter(into, strip_option), default)]
7684    pub offset_lines: Option<isize>,
7685}
7686#[derive(Builder, Debug, PartialEq)]
7687pub struct FileDigestOpts {
7688    /// If true, exclude metadata from the digest.
7689    #[builder(setter(into, strip_option), default)]
7690    pub exclude_metadata: Option<bool>,
7691}
7692#[derive(Builder, Debug, PartialEq)]
7693pub struct FileExportOpts {
7694    /// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
7695    #[builder(setter(into, strip_option), default)]
7696    pub allow_parent_dir_path: Option<bool>,
7697}
7698#[derive(Builder, Debug, PartialEq)]
7699pub struct FileSearchOpts<'a> {
7700    /// Allow the . pattern to match newlines in multiline mode.
7701    #[builder(setter(into, strip_option), default)]
7702    pub dotall: Option<bool>,
7703    /// Only return matching files, not lines and content
7704    #[builder(setter(into, strip_option), default)]
7705    pub files_only: Option<bool>,
7706    #[builder(setter(into, strip_option), default)]
7707    pub globs: Option<Vec<&'a str>>,
7708    /// Enable case-insensitive matching.
7709    #[builder(setter(into, strip_option), default)]
7710    pub insensitive: Option<bool>,
7711    /// Limit the number of results to return
7712    #[builder(setter(into, strip_option), default)]
7713    pub limit: Option<isize>,
7714    /// Interpret the pattern as a literal string instead of a regular expression.
7715    #[builder(setter(into, strip_option), default)]
7716    pub literal: Option<bool>,
7717    /// Enable searching across multiple lines.
7718    #[builder(setter(into, strip_option), default)]
7719    pub multiline: Option<bool>,
7720    #[builder(setter(into, strip_option), default)]
7721    pub paths: Option<Vec<&'a str>>,
7722    /// Skip hidden files (files starting with .).
7723    #[builder(setter(into, strip_option), default)]
7724    pub skip_hidden: Option<bool>,
7725    /// Honor .gitignore, .ignore, and .rgignore files.
7726    #[builder(setter(into, strip_option), default)]
7727    pub skip_ignored: Option<bool>,
7728}
7729#[derive(Builder, Debug, PartialEq)]
7730pub struct FileWithReplacedOpts {
7731    /// Replace all occurrences of the pattern.
7732    #[builder(setter(into, strip_option), default)]
7733    pub all: Option<bool>,
7734    /// Replace the first match starting from the specified line.
7735    #[builder(setter(into, strip_option), default)]
7736    pub first_from: Option<isize>,
7737}
7738impl File {
7739    /// Parse as an env file
7740    ///
7741    /// # Arguments
7742    ///
7743    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7744    pub fn as_env_file(&self) -> EnvFile {
7745        let query = self.selection.select("asEnvFile");
7746        EnvFile {
7747            proc: self.proc.clone(),
7748            selection: query,
7749            graphql_client: self.graphql_client.clone(),
7750        }
7751    }
7752    /// Parse as an env file
7753    ///
7754    /// # Arguments
7755    ///
7756    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7757    pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
7758        let mut query = self.selection.select("asEnvFile");
7759        if let Some(expand) = opts.expand {
7760            query = query.arg("expand", expand);
7761        }
7762        EnvFile {
7763            proc: self.proc.clone(),
7764            selection: query,
7765            graphql_client: self.graphql_client.clone(),
7766        }
7767    }
7768    /// Change the owner of the file recursively.
7769    ///
7770    /// # Arguments
7771    ///
7772    /// * `owner` - A user:group to set for the file.
7773    ///
7774    /// The user and group must be an ID (1000:1000), not a name (foo:bar).
7775    ///
7776    /// If the group is omitted, it defaults to the same as the user.
7777    pub fn chown(&self, owner: impl Into<String>) -> File {
7778        let mut query = self.selection.select("chown");
7779        query = query.arg("owner", owner.into());
7780        File {
7781            proc: self.proc.clone(),
7782            selection: query,
7783            graphql_client: self.graphql_client.clone(),
7784        }
7785    }
7786    /// Retrieves the contents of the file.
7787    ///
7788    /// # Arguments
7789    ///
7790    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7791    pub async fn contents(&self) -> Result<String, DaggerError> {
7792        let query = self.selection.select("contents");
7793        query.execute(self.graphql_client.clone()).await
7794    }
7795    /// Retrieves the contents of the file.
7796    ///
7797    /// # Arguments
7798    ///
7799    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7800    pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
7801        let mut query = self.selection.select("contents");
7802        if let Some(offset_lines) = opts.offset_lines {
7803            query = query.arg("offsetLines", offset_lines);
7804        }
7805        if let Some(limit_lines) = opts.limit_lines {
7806            query = query.arg("limitLines", limit_lines);
7807        }
7808        query.execute(self.graphql_client.clone()).await
7809    }
7810    /// 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.
7811    ///
7812    /// # Arguments
7813    ///
7814    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7815    pub async fn digest(&self) -> Result<String, DaggerError> {
7816        let query = self.selection.select("digest");
7817        query.execute(self.graphql_client.clone()).await
7818    }
7819    /// 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.
7820    ///
7821    /// # Arguments
7822    ///
7823    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7824    pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
7825        let mut query = self.selection.select("digest");
7826        if let Some(exclude_metadata) = opts.exclude_metadata {
7827            query = query.arg("excludeMetadata", exclude_metadata);
7828        }
7829        query.execute(self.graphql_client.clone()).await
7830    }
7831    /// Writes the file to a file path on the host.
7832    ///
7833    /// # Arguments
7834    ///
7835    /// * `path` - Location of the written directory (e.g., "output.txt").
7836    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7837    pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
7838        let mut query = self.selection.select("export");
7839        query = query.arg("path", path.into());
7840        query.execute(self.graphql_client.clone()).await
7841    }
7842    /// Writes the file to a file path on the host.
7843    ///
7844    /// # Arguments
7845    ///
7846    /// * `path` - Location of the written directory (e.g., "output.txt").
7847    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7848    pub async fn export_opts(
7849        &self,
7850        path: impl Into<String>,
7851        opts: FileExportOpts,
7852    ) -> Result<String, DaggerError> {
7853        let mut query = self.selection.select("export");
7854        query = query.arg("path", path.into());
7855        if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
7856            query = query.arg("allowParentDirPath", allow_parent_dir_path);
7857        }
7858        query.execute(self.graphql_client.clone()).await
7859    }
7860    /// A unique identifier for this File.
7861    pub async fn id(&self) -> Result<FileId, DaggerError> {
7862        let query = self.selection.select("id");
7863        query.execute(self.graphql_client.clone()).await
7864    }
7865    /// Retrieves the name of the file.
7866    pub async fn name(&self) -> Result<String, DaggerError> {
7867        let query = self.selection.select("name");
7868        query.execute(self.graphql_client.clone()).await
7869    }
7870    /// Searches for content matching the given regular expression or literal string.
7871    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
7872    ///
7873    /// # Arguments
7874    ///
7875    /// * `pattern` - The text to match.
7876    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7877    pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
7878        let mut query = self.selection.select("search");
7879        query = query.arg("pattern", pattern.into());
7880        vec![SearchResult {
7881            proc: self.proc.clone(),
7882            selection: query,
7883            graphql_client: self.graphql_client.clone(),
7884        }]
7885    }
7886    /// Searches for content matching the given regular expression or literal string.
7887    /// Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
7888    ///
7889    /// # Arguments
7890    ///
7891    /// * `pattern` - The text to match.
7892    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7893    pub fn search_opts<'a>(
7894        &self,
7895        pattern: impl Into<String>,
7896        opts: FileSearchOpts<'a>,
7897    ) -> Vec<SearchResult> {
7898        let mut query = self.selection.select("search");
7899        query = query.arg("pattern", pattern.into());
7900        if let Some(literal) = opts.literal {
7901            query = query.arg("literal", literal);
7902        }
7903        if let Some(multiline) = opts.multiline {
7904            query = query.arg("multiline", multiline);
7905        }
7906        if let Some(dotall) = opts.dotall {
7907            query = query.arg("dotall", dotall);
7908        }
7909        if let Some(insensitive) = opts.insensitive {
7910            query = query.arg("insensitive", insensitive);
7911        }
7912        if let Some(skip_ignored) = opts.skip_ignored {
7913            query = query.arg("skipIgnored", skip_ignored);
7914        }
7915        if let Some(skip_hidden) = opts.skip_hidden {
7916            query = query.arg("skipHidden", skip_hidden);
7917        }
7918        if let Some(files_only) = opts.files_only {
7919            query = query.arg("filesOnly", files_only);
7920        }
7921        if let Some(limit) = opts.limit {
7922            query = query.arg("limit", limit);
7923        }
7924        if let Some(paths) = opts.paths {
7925            query = query.arg("paths", paths);
7926        }
7927        if let Some(globs) = opts.globs {
7928            query = query.arg("globs", globs);
7929        }
7930        vec![SearchResult {
7931            proc: self.proc.clone(),
7932            selection: query,
7933            graphql_client: self.graphql_client.clone(),
7934        }]
7935    }
7936    /// Retrieves the size of the file, in bytes.
7937    pub async fn size(&self) -> Result<isize, DaggerError> {
7938        let query = self.selection.select("size");
7939        query.execute(self.graphql_client.clone()).await
7940    }
7941    /// Force evaluation in the engine.
7942    pub async fn sync(&self) -> Result<FileId, DaggerError> {
7943        let query = self.selection.select("sync");
7944        query.execute(self.graphql_client.clone()).await
7945    }
7946    /// Retrieves this file with its name set to the given name.
7947    ///
7948    /// # Arguments
7949    ///
7950    /// * `name` - Name to set file to.
7951    pub fn with_name(&self, name: impl Into<String>) -> File {
7952        let mut query = self.selection.select("withName");
7953        query = query.arg("name", name.into());
7954        File {
7955            proc: self.proc.clone(),
7956            selection: query,
7957            graphql_client: self.graphql_client.clone(),
7958        }
7959    }
7960    /// Retrieves the file with content replaced with the given text.
7961    /// If 'all' is true, all occurrences of the pattern will be replaced.
7962    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
7963    /// If neither are specified, and there are multiple matches for the pattern, this will error.
7964    /// If there are no matches for the pattern, this will error.
7965    ///
7966    /// # Arguments
7967    ///
7968    /// * `search` - The text to match.
7969    /// * `replacement` - The text to match.
7970    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7971    pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
7972        let mut query = self.selection.select("withReplaced");
7973        query = query.arg("search", search.into());
7974        query = query.arg("replacement", replacement.into());
7975        File {
7976            proc: self.proc.clone(),
7977            selection: query,
7978            graphql_client: self.graphql_client.clone(),
7979        }
7980    }
7981    /// Retrieves the file with content replaced with the given text.
7982    /// If 'all' is true, all occurrences of the pattern will be replaced.
7983    /// If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
7984    /// If neither are specified, and there are multiple matches for the pattern, this will error.
7985    /// If there are no matches for the pattern, this will error.
7986    ///
7987    /// # Arguments
7988    ///
7989    /// * `search` - The text to match.
7990    /// * `replacement` - The text to match.
7991    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
7992    pub fn with_replaced_opts(
7993        &self,
7994        search: impl Into<String>,
7995        replacement: impl Into<String>,
7996        opts: FileWithReplacedOpts,
7997    ) -> File {
7998        let mut query = self.selection.select("withReplaced");
7999        query = query.arg("search", search.into());
8000        query = query.arg("replacement", replacement.into());
8001        if let Some(all) = opts.all {
8002            query = query.arg("all", all);
8003        }
8004        if let Some(first_from) = opts.first_from {
8005            query = query.arg("firstFrom", first_from);
8006        }
8007        File {
8008            proc: self.proc.clone(),
8009            selection: query,
8010            graphql_client: self.graphql_client.clone(),
8011        }
8012    }
8013    /// Retrieves this file with its created/modified timestamps set to the given time.
8014    ///
8015    /// # Arguments
8016    ///
8017    /// * `timestamp` - Timestamp to set dir/files in.
8018    ///
8019    /// Formatted in seconds following Unix epoch (e.g., 1672531199).
8020    pub fn with_timestamps(&self, timestamp: isize) -> File {
8021        let mut query = self.selection.select("withTimestamps");
8022        query = query.arg("timestamp", timestamp);
8023        File {
8024            proc: self.proc.clone(),
8025            selection: query,
8026            graphql_client: self.graphql_client.clone(),
8027        }
8028    }
8029}
8030#[derive(Clone)]
8031pub struct Function {
8032    pub proc: Option<Arc<DaggerSessionProc>>,
8033    pub selection: Selection,
8034    pub graphql_client: DynGraphQLClient,
8035}
8036#[derive(Builder, Debug, PartialEq)]
8037pub struct FunctionWithArgOpts<'a> {
8038    /// If the argument is a Directory or File type, default to load path from context directory, relative to root directory.
8039    #[builder(setter(into, strip_option), default)]
8040    pub default_path: Option<&'a str>,
8041    /// A default value to use for this argument if not explicitly set by the caller, if any
8042    #[builder(setter(into, strip_option), default)]
8043    pub default_value: Option<Json>,
8044    /// A doc string for the argument, if any
8045    #[builder(setter(into, strip_option), default)]
8046    pub description: Option<&'a str>,
8047    /// Patterns to ignore when loading the contextual argument value.
8048    #[builder(setter(into, strip_option), default)]
8049    pub ignore: Option<Vec<&'a str>>,
8050    /// The source map for the argument definition.
8051    #[builder(setter(into, strip_option), default)]
8052    pub source_map: Option<SourceMapId>,
8053}
8054#[derive(Builder, Debug, PartialEq)]
8055pub struct FunctionWithCachePolicyOpts<'a> {
8056    /// The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
8057    #[builder(setter(into, strip_option), default)]
8058    pub time_to_live: Option<&'a str>,
8059}
8060impl Function {
8061    /// Arguments accepted by the function, if any.
8062    pub fn args(&self) -> Vec<FunctionArg> {
8063        let query = self.selection.select("args");
8064        vec![FunctionArg {
8065            proc: self.proc.clone(),
8066            selection: query,
8067            graphql_client: self.graphql_client.clone(),
8068        }]
8069    }
8070    /// A doc string for the function, if any.
8071    pub async fn description(&self) -> Result<String, DaggerError> {
8072        let query = self.selection.select("description");
8073        query.execute(self.graphql_client.clone()).await
8074    }
8075    /// A unique identifier for this Function.
8076    pub async fn id(&self) -> Result<FunctionId, DaggerError> {
8077        let query = self.selection.select("id");
8078        query.execute(self.graphql_client.clone()).await
8079    }
8080    /// The name of the function.
8081    pub async fn name(&self) -> Result<String, DaggerError> {
8082        let query = self.selection.select("name");
8083        query.execute(self.graphql_client.clone()).await
8084    }
8085    /// The type returned by the function.
8086    pub fn return_type(&self) -> TypeDef {
8087        let query = self.selection.select("returnType");
8088        TypeDef {
8089            proc: self.proc.clone(),
8090            selection: query,
8091            graphql_client: self.graphql_client.clone(),
8092        }
8093    }
8094    /// The location of this function declaration.
8095    pub fn source_map(&self) -> SourceMap {
8096        let query = self.selection.select("sourceMap");
8097        SourceMap {
8098            proc: self.proc.clone(),
8099            selection: query,
8100            graphql_client: self.graphql_client.clone(),
8101        }
8102    }
8103    /// Returns the function with the provided argument
8104    ///
8105    /// # Arguments
8106    ///
8107    /// * `name` - The name of the argument
8108    /// * `type_def` - The type of the argument
8109    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8110    pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
8111        let mut query = self.selection.select("withArg");
8112        query = query.arg("name", name.into());
8113        query = query.arg_lazy(
8114            "typeDef",
8115            Box::new(move || {
8116                let type_def = type_def.clone();
8117                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8118            }),
8119        );
8120        Function {
8121            proc: self.proc.clone(),
8122            selection: query,
8123            graphql_client: self.graphql_client.clone(),
8124        }
8125    }
8126    /// Returns the function with the provided argument
8127    ///
8128    /// # Arguments
8129    ///
8130    /// * `name` - The name of the argument
8131    /// * `type_def` - The type of the argument
8132    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8133    pub fn with_arg_opts<'a>(
8134        &self,
8135        name: impl Into<String>,
8136        type_def: impl IntoID<TypeDefId>,
8137        opts: FunctionWithArgOpts<'a>,
8138    ) -> Function {
8139        let mut query = self.selection.select("withArg");
8140        query = query.arg("name", name.into());
8141        query = query.arg_lazy(
8142            "typeDef",
8143            Box::new(move || {
8144                let type_def = type_def.clone();
8145                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8146            }),
8147        );
8148        if let Some(description) = opts.description {
8149            query = query.arg("description", description);
8150        }
8151        if let Some(default_value) = opts.default_value {
8152            query = query.arg("defaultValue", default_value);
8153        }
8154        if let Some(default_path) = opts.default_path {
8155            query = query.arg("defaultPath", default_path);
8156        }
8157        if let Some(ignore) = opts.ignore {
8158            query = query.arg("ignore", ignore);
8159        }
8160        if let Some(source_map) = opts.source_map {
8161            query = query.arg("sourceMap", source_map);
8162        }
8163        Function {
8164            proc: self.proc.clone(),
8165            selection: query,
8166            graphql_client: self.graphql_client.clone(),
8167        }
8168    }
8169    /// Returns the function updated to use the provided cache policy.
8170    ///
8171    /// # Arguments
8172    ///
8173    /// * `policy` - The cache policy to use.
8174    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8175    pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
8176        let mut query = self.selection.select("withCachePolicy");
8177        query = query.arg("policy", policy);
8178        Function {
8179            proc: self.proc.clone(),
8180            selection: query,
8181            graphql_client: self.graphql_client.clone(),
8182        }
8183    }
8184    /// Returns the function updated to use the provided cache policy.
8185    ///
8186    /// # Arguments
8187    ///
8188    /// * `policy` - The cache policy to use.
8189    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8190    pub fn with_cache_policy_opts<'a>(
8191        &self,
8192        policy: FunctionCachePolicy,
8193        opts: FunctionWithCachePolicyOpts<'a>,
8194    ) -> Function {
8195        let mut query = self.selection.select("withCachePolicy");
8196        query = query.arg("policy", policy);
8197        if let Some(time_to_live) = opts.time_to_live {
8198            query = query.arg("timeToLive", time_to_live);
8199        }
8200        Function {
8201            proc: self.proc.clone(),
8202            selection: query,
8203            graphql_client: self.graphql_client.clone(),
8204        }
8205    }
8206    /// Returns the function with the given doc string.
8207    ///
8208    /// # Arguments
8209    ///
8210    /// * `description` - The doc string to set.
8211    pub fn with_description(&self, description: impl Into<String>) -> Function {
8212        let mut query = self.selection.select("withDescription");
8213        query = query.arg("description", description.into());
8214        Function {
8215            proc: self.proc.clone(),
8216            selection: query,
8217            graphql_client: self.graphql_client.clone(),
8218        }
8219    }
8220    /// Returns the function with the given source map.
8221    ///
8222    /// # Arguments
8223    ///
8224    /// * `source_map` - The source map for the function definition.
8225    pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
8226        let mut query = self.selection.select("withSourceMap");
8227        query = query.arg_lazy(
8228            "sourceMap",
8229            Box::new(move || {
8230                let source_map = source_map.clone();
8231                Box::pin(async move { source_map.into_id().await.unwrap().quote() })
8232            }),
8233        );
8234        Function {
8235            proc: self.proc.clone(),
8236            selection: query,
8237            graphql_client: self.graphql_client.clone(),
8238        }
8239    }
8240}
8241#[derive(Clone)]
8242pub struct FunctionArg {
8243    pub proc: Option<Arc<DaggerSessionProc>>,
8244    pub selection: Selection,
8245    pub graphql_client: DynGraphQLClient,
8246}
8247impl FunctionArg {
8248    /// 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
8249    pub async fn default_path(&self) -> Result<String, DaggerError> {
8250        let query = self.selection.select("defaultPath");
8251        query.execute(self.graphql_client.clone()).await
8252    }
8253    /// A default value to use for this argument when not explicitly set by the caller, if any.
8254    pub async fn default_value(&self) -> Result<Json, DaggerError> {
8255        let query = self.selection.select("defaultValue");
8256        query.execute(self.graphql_client.clone()).await
8257    }
8258    /// A doc string for the argument, if any.
8259    pub async fn description(&self) -> Result<String, DaggerError> {
8260        let query = self.selection.select("description");
8261        query.execute(self.graphql_client.clone()).await
8262    }
8263    /// A unique identifier for this FunctionArg.
8264    pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
8265        let query = self.selection.select("id");
8266        query.execute(self.graphql_client.clone()).await
8267    }
8268    /// 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.
8269    pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
8270        let query = self.selection.select("ignore");
8271        query.execute(self.graphql_client.clone()).await
8272    }
8273    /// The name of the argument in lowerCamelCase format.
8274    pub async fn name(&self) -> Result<String, DaggerError> {
8275        let query = self.selection.select("name");
8276        query.execute(self.graphql_client.clone()).await
8277    }
8278    /// The location of this arg declaration.
8279    pub fn source_map(&self) -> SourceMap {
8280        let query = self.selection.select("sourceMap");
8281        SourceMap {
8282            proc: self.proc.clone(),
8283            selection: query,
8284            graphql_client: self.graphql_client.clone(),
8285        }
8286    }
8287    /// The type of the argument.
8288    pub fn type_def(&self) -> TypeDef {
8289        let query = self.selection.select("typeDef");
8290        TypeDef {
8291            proc: self.proc.clone(),
8292            selection: query,
8293            graphql_client: self.graphql_client.clone(),
8294        }
8295    }
8296}
8297#[derive(Clone)]
8298pub struct FunctionCall {
8299    pub proc: Option<Arc<DaggerSessionProc>>,
8300    pub selection: Selection,
8301    pub graphql_client: DynGraphQLClient,
8302}
8303impl FunctionCall {
8304    /// A unique identifier for this FunctionCall.
8305    pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
8306        let query = self.selection.select("id");
8307        query.execute(self.graphql_client.clone()).await
8308    }
8309    /// The argument values the function is being invoked with.
8310    pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
8311        let query = self.selection.select("inputArgs");
8312        vec![FunctionCallArgValue {
8313            proc: self.proc.clone(),
8314            selection: query,
8315            graphql_client: self.graphql_client.clone(),
8316        }]
8317    }
8318    /// The name of the function being called.
8319    pub async fn name(&self) -> Result<String, DaggerError> {
8320        let query = self.selection.select("name");
8321        query.execute(self.graphql_client.clone()).await
8322    }
8323    /// 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.
8324    pub async fn parent(&self) -> Result<Json, DaggerError> {
8325        let query = self.selection.select("parent");
8326        query.execute(self.graphql_client.clone()).await
8327    }
8328    /// 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.
8329    pub async fn parent_name(&self) -> Result<String, DaggerError> {
8330        let query = self.selection.select("parentName");
8331        query.execute(self.graphql_client.clone()).await
8332    }
8333    /// Return an error from the function.
8334    ///
8335    /// # Arguments
8336    ///
8337    /// * `error` - The error to return.
8338    pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
8339        let mut query = self.selection.select("returnError");
8340        query = query.arg_lazy(
8341            "error",
8342            Box::new(move || {
8343                let error = error.clone();
8344                Box::pin(async move { error.into_id().await.unwrap().quote() })
8345            }),
8346        );
8347        query.execute(self.graphql_client.clone()).await
8348    }
8349    /// Set the return value of the function call to the provided value.
8350    ///
8351    /// # Arguments
8352    ///
8353    /// * `value` - JSON serialization of the return value.
8354    pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
8355        let mut query = self.selection.select("returnValue");
8356        query = query.arg("value", value);
8357        query.execute(self.graphql_client.clone()).await
8358    }
8359}
8360#[derive(Clone)]
8361pub struct FunctionCallArgValue {
8362    pub proc: Option<Arc<DaggerSessionProc>>,
8363    pub selection: Selection,
8364    pub graphql_client: DynGraphQLClient,
8365}
8366impl FunctionCallArgValue {
8367    /// A unique identifier for this FunctionCallArgValue.
8368    pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
8369        let query = self.selection.select("id");
8370        query.execute(self.graphql_client.clone()).await
8371    }
8372    /// The name of the argument.
8373    pub async fn name(&self) -> Result<String, DaggerError> {
8374        let query = self.selection.select("name");
8375        query.execute(self.graphql_client.clone()).await
8376    }
8377    /// The value of the argument represented as a JSON serialized string.
8378    pub async fn value(&self) -> Result<Json, DaggerError> {
8379        let query = self.selection.select("value");
8380        query.execute(self.graphql_client.clone()).await
8381    }
8382}
8383#[derive(Clone)]
8384pub struct GeneratedCode {
8385    pub proc: Option<Arc<DaggerSessionProc>>,
8386    pub selection: Selection,
8387    pub graphql_client: DynGraphQLClient,
8388}
8389impl GeneratedCode {
8390    /// The directory containing the generated code.
8391    pub fn code(&self) -> Directory {
8392        let query = self.selection.select("code");
8393        Directory {
8394            proc: self.proc.clone(),
8395            selection: query,
8396            graphql_client: self.graphql_client.clone(),
8397        }
8398    }
8399    /// A unique identifier for this GeneratedCode.
8400    pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
8401        let query = self.selection.select("id");
8402        query.execute(self.graphql_client.clone()).await
8403    }
8404    /// List of paths to mark generated in version control (i.e. .gitattributes).
8405    pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
8406        let query = self.selection.select("vcsGeneratedPaths");
8407        query.execute(self.graphql_client.clone()).await
8408    }
8409    /// List of paths to ignore in version control (i.e. .gitignore).
8410    pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
8411        let query = self.selection.select("vcsIgnoredPaths");
8412        query.execute(self.graphql_client.clone()).await
8413    }
8414    /// Set the list of paths to mark generated in version control.
8415    pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8416        let mut query = self.selection.select("withVCSGeneratedPaths");
8417        query = query.arg(
8418            "paths",
8419            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8420        );
8421        GeneratedCode {
8422            proc: self.proc.clone(),
8423            selection: query,
8424            graphql_client: self.graphql_client.clone(),
8425        }
8426    }
8427    /// Set the list of paths to ignore in version control.
8428    pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8429        let mut query = self.selection.select("withVCSIgnoredPaths");
8430        query = query.arg(
8431            "paths",
8432            paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8433        );
8434        GeneratedCode {
8435            proc: self.proc.clone(),
8436            selection: query,
8437            graphql_client: self.graphql_client.clone(),
8438        }
8439    }
8440}
8441#[derive(Clone)]
8442pub struct GitRef {
8443    pub proc: Option<Arc<DaggerSessionProc>>,
8444    pub selection: Selection,
8445    pub graphql_client: DynGraphQLClient,
8446}
8447#[derive(Builder, Debug, PartialEq)]
8448pub struct GitRefTreeOpts {
8449    /// The depth of the tree to fetch.
8450    #[builder(setter(into, strip_option), default)]
8451    pub depth: Option<isize>,
8452    /// Set to true to discard .git directory.
8453    #[builder(setter(into, strip_option), default)]
8454    pub discard_git_dir: Option<bool>,
8455}
8456impl GitRef {
8457    /// The resolved commit id at this ref.
8458    pub async fn commit(&self) -> Result<String, DaggerError> {
8459        let query = self.selection.select("commit");
8460        query.execute(self.graphql_client.clone()).await
8461    }
8462    /// Find the best common ancestor between this ref and another ref.
8463    ///
8464    /// # Arguments
8465    ///
8466    /// * `other` - The other ref to compare against.
8467    pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
8468        let mut query = self.selection.select("commonAncestor");
8469        query = query.arg_lazy(
8470            "other",
8471            Box::new(move || {
8472                let other = other.clone();
8473                Box::pin(async move { other.into_id().await.unwrap().quote() })
8474            }),
8475        );
8476        GitRef {
8477            proc: self.proc.clone(),
8478            selection: query,
8479            graphql_client: self.graphql_client.clone(),
8480        }
8481    }
8482    /// A unique identifier for this GitRef.
8483    pub async fn id(&self) -> Result<GitRefId, DaggerError> {
8484        let query = self.selection.select("id");
8485        query.execute(self.graphql_client.clone()).await
8486    }
8487    /// The resolved ref name at this ref.
8488    pub async fn r#ref(&self) -> Result<String, DaggerError> {
8489        let query = self.selection.select("ref");
8490        query.execute(self.graphql_client.clone()).await
8491    }
8492    /// The filesystem tree at this ref.
8493    ///
8494    /// # Arguments
8495    ///
8496    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8497    pub fn tree(&self) -> Directory {
8498        let query = self.selection.select("tree");
8499        Directory {
8500            proc: self.proc.clone(),
8501            selection: query,
8502            graphql_client: self.graphql_client.clone(),
8503        }
8504    }
8505    /// The filesystem tree at this ref.
8506    ///
8507    /// # Arguments
8508    ///
8509    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8510    pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
8511        let mut query = self.selection.select("tree");
8512        if let Some(discard_git_dir) = opts.discard_git_dir {
8513            query = query.arg("discardGitDir", discard_git_dir);
8514        }
8515        if let Some(depth) = opts.depth {
8516            query = query.arg("depth", depth);
8517        }
8518        Directory {
8519            proc: self.proc.clone(),
8520            selection: query,
8521            graphql_client: self.graphql_client.clone(),
8522        }
8523    }
8524}
8525#[derive(Clone)]
8526pub struct GitRepository {
8527    pub proc: Option<Arc<DaggerSessionProc>>,
8528    pub selection: Selection,
8529    pub graphql_client: DynGraphQLClient,
8530}
8531#[derive(Builder, Debug, PartialEq)]
8532pub struct GitRepositoryBranchesOpts<'a> {
8533    /// Glob patterns (e.g., "refs/tags/v*").
8534    #[builder(setter(into, strip_option), default)]
8535    pub patterns: Option<Vec<&'a str>>,
8536}
8537#[derive(Builder, Debug, PartialEq)]
8538pub struct GitRepositoryTagsOpts<'a> {
8539    /// Glob patterns (e.g., "refs/tags/v*").
8540    #[builder(setter(into, strip_option), default)]
8541    pub patterns: Option<Vec<&'a str>>,
8542}
8543impl GitRepository {
8544    /// Returns details of a branch.
8545    ///
8546    /// # Arguments
8547    ///
8548    /// * `name` - Branch's name (e.g., "main").
8549    pub fn branch(&self, name: impl Into<String>) -> GitRef {
8550        let mut query = self.selection.select("branch");
8551        query = query.arg("name", name.into());
8552        GitRef {
8553            proc: self.proc.clone(),
8554            selection: query,
8555            graphql_client: self.graphql_client.clone(),
8556        }
8557    }
8558    /// branches that match any of the given glob patterns.
8559    ///
8560    /// # Arguments
8561    ///
8562    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8563    pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
8564        let query = self.selection.select("branches");
8565        query.execute(self.graphql_client.clone()).await
8566    }
8567    /// branches that match any of the given glob patterns.
8568    ///
8569    /// # Arguments
8570    ///
8571    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8572    pub async fn branches_opts<'a>(
8573        &self,
8574        opts: GitRepositoryBranchesOpts<'a>,
8575    ) -> Result<Vec<String>, DaggerError> {
8576        let mut query = self.selection.select("branches");
8577        if let Some(patterns) = opts.patterns {
8578            query = query.arg("patterns", patterns);
8579        }
8580        query.execute(self.graphql_client.clone()).await
8581    }
8582    /// Returns details of a commit.
8583    ///
8584    /// # Arguments
8585    ///
8586    /// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
8587    pub fn commit(&self, id: impl Into<String>) -> GitRef {
8588        let mut query = self.selection.select("commit");
8589        query = query.arg("id", id.into());
8590        GitRef {
8591            proc: self.proc.clone(),
8592            selection: query,
8593            graphql_client: self.graphql_client.clone(),
8594        }
8595    }
8596    /// Returns details for HEAD.
8597    pub fn head(&self) -> GitRef {
8598        let query = self.selection.select("head");
8599        GitRef {
8600            proc: self.proc.clone(),
8601            selection: query,
8602            graphql_client: self.graphql_client.clone(),
8603        }
8604    }
8605    /// A unique identifier for this GitRepository.
8606    pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
8607        let query = self.selection.select("id");
8608        query.execute(self.graphql_client.clone()).await
8609    }
8610    /// Returns details for the latest semver tag.
8611    pub fn latest_version(&self) -> GitRef {
8612        let query = self.selection.select("latestVersion");
8613        GitRef {
8614            proc: self.proc.clone(),
8615            selection: query,
8616            graphql_client: self.graphql_client.clone(),
8617        }
8618    }
8619    /// Returns details of a ref.
8620    ///
8621    /// # Arguments
8622    ///
8623    /// * `name` - Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
8624    pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
8625        let mut query = self.selection.select("ref");
8626        query = query.arg("name", name.into());
8627        GitRef {
8628            proc: self.proc.clone(),
8629            selection: query,
8630            graphql_client: self.graphql_client.clone(),
8631        }
8632    }
8633    /// Returns details of a tag.
8634    ///
8635    /// # Arguments
8636    ///
8637    /// * `name` - Tag's name (e.g., "v0.3.9").
8638    pub fn tag(&self, name: impl Into<String>) -> GitRef {
8639        let mut query = self.selection.select("tag");
8640        query = query.arg("name", name.into());
8641        GitRef {
8642            proc: self.proc.clone(),
8643            selection: query,
8644            graphql_client: self.graphql_client.clone(),
8645        }
8646    }
8647    /// tags that match any of the given glob patterns.
8648    ///
8649    /// # Arguments
8650    ///
8651    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8652    pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
8653        let query = self.selection.select("tags");
8654        query.execute(self.graphql_client.clone()).await
8655    }
8656    /// tags that match any of the given glob patterns.
8657    ///
8658    /// # Arguments
8659    ///
8660    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8661    pub async fn tags_opts<'a>(
8662        &self,
8663        opts: GitRepositoryTagsOpts<'a>,
8664    ) -> Result<Vec<String>, DaggerError> {
8665        let mut query = self.selection.select("tags");
8666        if let Some(patterns) = opts.patterns {
8667            query = query.arg("patterns", patterns);
8668        }
8669        query.execute(self.graphql_client.clone()).await
8670    }
8671    /// Returns the changeset of uncommitted changes in the git repository.
8672    pub fn uncommitted(&self) -> Changeset {
8673        let query = self.selection.select("uncommitted");
8674        Changeset {
8675            proc: self.proc.clone(),
8676            selection: query,
8677            graphql_client: self.graphql_client.clone(),
8678        }
8679    }
8680    /// The URL of the git repository.
8681    pub async fn url(&self) -> Result<String, DaggerError> {
8682        let query = self.selection.select("url");
8683        query.execute(self.graphql_client.clone()).await
8684    }
8685}
8686#[derive(Clone)]
8687pub struct Host {
8688    pub proc: Option<Arc<DaggerSessionProc>>,
8689    pub selection: Selection,
8690    pub graphql_client: DynGraphQLClient,
8691}
8692#[derive(Builder, Debug, PartialEq)]
8693pub struct HostDirectoryOpts<'a> {
8694    /// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
8695    #[builder(setter(into, strip_option), default)]
8696    pub exclude: Option<Vec<&'a str>>,
8697    /// Apply .gitignore filter rules inside the directory
8698    #[builder(setter(into, strip_option), default)]
8699    pub gitignore: Option<bool>,
8700    /// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
8701    #[builder(setter(into, strip_option), default)]
8702    pub include: Option<Vec<&'a str>>,
8703    /// If true, the directory will always be reloaded from the host.
8704    #[builder(setter(into, strip_option), default)]
8705    pub no_cache: Option<bool>,
8706}
8707#[derive(Builder, Debug, PartialEq)]
8708pub struct HostFileOpts {
8709    /// If true, the file will always be reloaded from the host.
8710    #[builder(setter(into, strip_option), default)]
8711    pub no_cache: Option<bool>,
8712}
8713#[derive(Builder, Debug, PartialEq)]
8714pub struct HostFindUpOpts {
8715    #[builder(setter(into, strip_option), default)]
8716    pub no_cache: Option<bool>,
8717}
8718#[derive(Builder, Debug, PartialEq)]
8719pub struct HostServiceOpts<'a> {
8720    /// Upstream host to forward traffic to.
8721    #[builder(setter(into, strip_option), default)]
8722    pub host: Option<&'a str>,
8723}
8724#[derive(Builder, Debug, PartialEq)]
8725pub struct HostTunnelOpts {
8726    /// Map each service port to the same port on the host, as if the service were running natively.
8727    /// Note: enabling may result in port conflicts.
8728    #[builder(setter(into, strip_option), default)]
8729    pub native: Option<bool>,
8730    /// Configure explicit port forwarding rules for the tunnel.
8731    /// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
8732    /// 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.
8733    /// If ports are given and native is true, the ports are additive.
8734    #[builder(setter(into, strip_option), default)]
8735    pub ports: Option<Vec<PortForward>>,
8736}
8737impl Host {
8738    /// Accesses a container image on the host.
8739    ///
8740    /// # Arguments
8741    ///
8742    /// * `name` - Name of the image to access.
8743    pub fn container_image(&self, name: impl Into<String>) -> Container {
8744        let mut query = self.selection.select("containerImage");
8745        query = query.arg("name", name.into());
8746        Container {
8747            proc: self.proc.clone(),
8748            selection: query,
8749            graphql_client: self.graphql_client.clone(),
8750        }
8751    }
8752    /// Accesses a directory on the host.
8753    ///
8754    /// # Arguments
8755    ///
8756    /// * `path` - Location of the directory to access (e.g., ".").
8757    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8758    pub fn directory(&self, path: impl Into<String>) -> Directory {
8759        let mut query = self.selection.select("directory");
8760        query = query.arg("path", path.into());
8761        Directory {
8762            proc: self.proc.clone(),
8763            selection: query,
8764            graphql_client: self.graphql_client.clone(),
8765        }
8766    }
8767    /// Accesses a directory on the host.
8768    ///
8769    /// # Arguments
8770    ///
8771    /// * `path` - Location of the directory to access (e.g., ".").
8772    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8773    pub fn directory_opts<'a>(
8774        &self,
8775        path: impl Into<String>,
8776        opts: HostDirectoryOpts<'a>,
8777    ) -> Directory {
8778        let mut query = self.selection.select("directory");
8779        query = query.arg("path", path.into());
8780        if let Some(exclude) = opts.exclude {
8781            query = query.arg("exclude", exclude);
8782        }
8783        if let Some(include) = opts.include {
8784            query = query.arg("include", include);
8785        }
8786        if let Some(no_cache) = opts.no_cache {
8787            query = query.arg("noCache", no_cache);
8788        }
8789        if let Some(gitignore) = opts.gitignore {
8790            query = query.arg("gitignore", gitignore);
8791        }
8792        Directory {
8793            proc: self.proc.clone(),
8794            selection: query,
8795            graphql_client: self.graphql_client.clone(),
8796        }
8797    }
8798    /// Accesses a file on the host.
8799    ///
8800    /// # Arguments
8801    ///
8802    /// * `path` - Location of the file to retrieve (e.g., "README.md").
8803    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8804    pub fn file(&self, path: impl Into<String>) -> File {
8805        let mut query = self.selection.select("file");
8806        query = query.arg("path", path.into());
8807        File {
8808            proc: self.proc.clone(),
8809            selection: query,
8810            graphql_client: self.graphql_client.clone(),
8811        }
8812    }
8813    /// Accesses a file on the host.
8814    ///
8815    /// # Arguments
8816    ///
8817    /// * `path` - Location of the file to retrieve (e.g., "README.md").
8818    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8819    pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
8820        let mut query = self.selection.select("file");
8821        query = query.arg("path", path.into());
8822        if let Some(no_cache) = opts.no_cache {
8823            query = query.arg("noCache", no_cache);
8824        }
8825        File {
8826            proc: self.proc.clone(),
8827            selection: query,
8828            graphql_client: self.graphql_client.clone(),
8829        }
8830    }
8831    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
8832    ///
8833    /// # Arguments
8834    ///
8835    /// * `name` - name of the file or directory to search for
8836    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8837    pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8838        let mut query = self.selection.select("findUp");
8839        query = query.arg("name", name.into());
8840        query.execute(self.graphql_client.clone()).await
8841    }
8842    /// Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null
8843    ///
8844    /// # Arguments
8845    ///
8846    /// * `name` - name of the file or directory to search for
8847    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8848    pub async fn find_up_opts(
8849        &self,
8850        name: impl Into<String>,
8851        opts: HostFindUpOpts,
8852    ) -> Result<String, DaggerError> {
8853        let mut query = self.selection.select("findUp");
8854        query = query.arg("name", name.into());
8855        if let Some(no_cache) = opts.no_cache {
8856            query = query.arg("noCache", no_cache);
8857        }
8858        query.execute(self.graphql_client.clone()).await
8859    }
8860    /// A unique identifier for this Host.
8861    pub async fn id(&self) -> Result<HostId, DaggerError> {
8862        let query = self.selection.select("id");
8863        query.execute(self.graphql_client.clone()).await
8864    }
8865    /// Creates a service that forwards traffic to a specified address via the host.
8866    ///
8867    /// # Arguments
8868    ///
8869    /// * `ports` - Ports to expose via the service, forwarding through the host network.
8870    ///
8871    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
8872    ///
8873    /// An empty set of ports is not valid; an error will be returned.
8874    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8875    pub fn service(&self, ports: Vec<PortForward>) -> Service {
8876        let mut query = self.selection.select("service");
8877        query = query.arg("ports", ports);
8878        Service {
8879            proc: self.proc.clone(),
8880            selection: query,
8881            graphql_client: self.graphql_client.clone(),
8882        }
8883    }
8884    /// Creates a service that forwards traffic to a specified address via the host.
8885    ///
8886    /// # Arguments
8887    ///
8888    /// * `ports` - Ports to expose via the service, forwarding through the host network.
8889    ///
8890    /// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
8891    ///
8892    /// An empty set of ports is not valid; an error will be returned.
8893    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8894    pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
8895        let mut query = self.selection.select("service");
8896        query = query.arg("ports", ports);
8897        if let Some(host) = opts.host {
8898            query = query.arg("host", host);
8899        }
8900        Service {
8901            proc: self.proc.clone(),
8902            selection: query,
8903            graphql_client: self.graphql_client.clone(),
8904        }
8905    }
8906    /// Creates a tunnel that forwards traffic from the host to a service.
8907    ///
8908    /// # Arguments
8909    ///
8910    /// * `service` - Service to send traffic from the tunnel.
8911    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8912    pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
8913        let mut query = self.selection.select("tunnel");
8914        query = query.arg_lazy(
8915            "service",
8916            Box::new(move || {
8917                let service = service.clone();
8918                Box::pin(async move { service.into_id().await.unwrap().quote() })
8919            }),
8920        );
8921        Service {
8922            proc: self.proc.clone(),
8923            selection: query,
8924            graphql_client: self.graphql_client.clone(),
8925        }
8926    }
8927    /// Creates a tunnel that forwards traffic from the host to a service.
8928    ///
8929    /// # Arguments
8930    ///
8931    /// * `service` - Service to send traffic from the tunnel.
8932    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
8933    pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
8934        let mut query = self.selection.select("tunnel");
8935        query = query.arg_lazy(
8936            "service",
8937            Box::new(move || {
8938                let service = service.clone();
8939                Box::pin(async move { service.into_id().await.unwrap().quote() })
8940            }),
8941        );
8942        if let Some(native) = opts.native {
8943            query = query.arg("native", native);
8944        }
8945        if let Some(ports) = opts.ports {
8946            query = query.arg("ports", ports);
8947        }
8948        Service {
8949            proc: self.proc.clone(),
8950            selection: query,
8951            graphql_client: self.graphql_client.clone(),
8952        }
8953    }
8954    /// Accesses a Unix socket on the host.
8955    ///
8956    /// # Arguments
8957    ///
8958    /// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
8959    pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
8960        let mut query = self.selection.select("unixSocket");
8961        query = query.arg("path", path.into());
8962        Socket {
8963            proc: self.proc.clone(),
8964            selection: query,
8965            graphql_client: self.graphql_client.clone(),
8966        }
8967    }
8968}
8969#[derive(Clone)]
8970pub struct InputTypeDef {
8971    pub proc: Option<Arc<DaggerSessionProc>>,
8972    pub selection: Selection,
8973    pub graphql_client: DynGraphQLClient,
8974}
8975impl InputTypeDef {
8976    /// Static fields defined on this input object, if any.
8977    pub fn fields(&self) -> Vec<FieldTypeDef> {
8978        let query = self.selection.select("fields");
8979        vec![FieldTypeDef {
8980            proc: self.proc.clone(),
8981            selection: query,
8982            graphql_client: self.graphql_client.clone(),
8983        }]
8984    }
8985    /// A unique identifier for this InputTypeDef.
8986    pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
8987        let query = self.selection.select("id");
8988        query.execute(self.graphql_client.clone()).await
8989    }
8990    /// The name of the input object.
8991    pub async fn name(&self) -> Result<String, DaggerError> {
8992        let query = self.selection.select("name");
8993        query.execute(self.graphql_client.clone()).await
8994    }
8995}
8996#[derive(Clone)]
8997pub struct InterfaceTypeDef {
8998    pub proc: Option<Arc<DaggerSessionProc>>,
8999    pub selection: Selection,
9000    pub graphql_client: DynGraphQLClient,
9001}
9002impl InterfaceTypeDef {
9003    /// The doc string for the interface, if any.
9004    pub async fn description(&self) -> Result<String, DaggerError> {
9005        let query = self.selection.select("description");
9006        query.execute(self.graphql_client.clone()).await
9007    }
9008    /// Functions defined on this interface, if any.
9009    pub fn functions(&self) -> Vec<Function> {
9010        let query = self.selection.select("functions");
9011        vec![Function {
9012            proc: self.proc.clone(),
9013            selection: query,
9014            graphql_client: self.graphql_client.clone(),
9015        }]
9016    }
9017    /// A unique identifier for this InterfaceTypeDef.
9018    pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
9019        let query = self.selection.select("id");
9020        query.execute(self.graphql_client.clone()).await
9021    }
9022    /// The name of the interface.
9023    pub async fn name(&self) -> Result<String, DaggerError> {
9024        let query = self.selection.select("name");
9025        query.execute(self.graphql_client.clone()).await
9026    }
9027    /// The location of this interface declaration.
9028    pub fn source_map(&self) -> SourceMap {
9029        let query = self.selection.select("sourceMap");
9030        SourceMap {
9031            proc: self.proc.clone(),
9032            selection: query,
9033            graphql_client: self.graphql_client.clone(),
9034        }
9035    }
9036    /// If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
9037    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9038        let query = self.selection.select("sourceModuleName");
9039        query.execute(self.graphql_client.clone()).await
9040    }
9041}
9042#[derive(Clone)]
9043pub struct JsonValue {
9044    pub proc: Option<Arc<DaggerSessionProc>>,
9045    pub selection: Selection,
9046    pub graphql_client: DynGraphQLClient,
9047}
9048#[derive(Builder, Debug, PartialEq)]
9049pub struct JsonValueContentsOpts<'a> {
9050    /// Optional line prefix
9051    #[builder(setter(into, strip_option), default)]
9052    pub indent: Option<&'a str>,
9053    /// Pretty-print
9054    #[builder(setter(into, strip_option), default)]
9055    pub pretty: Option<bool>,
9056}
9057impl JsonValue {
9058    /// Decode an array from json
9059    pub fn as_array(&self) -> Vec<JsonValue> {
9060        let query = self.selection.select("asArray");
9061        vec![JsonValue {
9062            proc: self.proc.clone(),
9063            selection: query,
9064            graphql_client: self.graphql_client.clone(),
9065        }]
9066    }
9067    /// Decode a boolean from json
9068    pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
9069        let query = self.selection.select("asBoolean");
9070        query.execute(self.graphql_client.clone()).await
9071    }
9072    /// Decode an integer from json
9073    pub async fn as_integer(&self) -> Result<isize, DaggerError> {
9074        let query = self.selection.select("asInteger");
9075        query.execute(self.graphql_client.clone()).await
9076    }
9077    /// Decode a string from json
9078    pub async fn as_string(&self) -> Result<String, DaggerError> {
9079        let query = self.selection.select("asString");
9080        query.execute(self.graphql_client.clone()).await
9081    }
9082    /// Return the value encoded as json
9083    ///
9084    /// # Arguments
9085    ///
9086    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9087    pub async fn contents(&self) -> Result<Json, DaggerError> {
9088        let query = self.selection.select("contents");
9089        query.execute(self.graphql_client.clone()).await
9090    }
9091    /// Return the value encoded as json
9092    ///
9093    /// # Arguments
9094    ///
9095    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9096    pub async fn contents_opts<'a>(
9097        &self,
9098        opts: JsonValueContentsOpts<'a>,
9099    ) -> Result<Json, DaggerError> {
9100        let mut query = self.selection.select("contents");
9101        if let Some(pretty) = opts.pretty {
9102            query = query.arg("pretty", pretty);
9103        }
9104        if let Some(indent) = opts.indent {
9105            query = query.arg("indent", indent);
9106        }
9107        query.execute(self.graphql_client.clone()).await
9108    }
9109    /// Lookup the field at the given path, and return its value.
9110    ///
9111    /// # Arguments
9112    ///
9113    /// * `path` - Path of the field to lookup, encoded as an array of field names
9114    pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
9115        let mut query = self.selection.select("field");
9116        query = query.arg(
9117            "path",
9118            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9119        );
9120        JsonValue {
9121            proc: self.proc.clone(),
9122            selection: query,
9123            graphql_client: self.graphql_client.clone(),
9124        }
9125    }
9126    /// List fields of the encoded object
9127    pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
9128        let query = self.selection.select("fields");
9129        query.execute(self.graphql_client.clone()).await
9130    }
9131    /// A unique identifier for this JSONValue.
9132    pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
9133        let query = self.selection.select("id");
9134        query.execute(self.graphql_client.clone()).await
9135    }
9136    /// Encode a boolean to json
9137    ///
9138    /// # Arguments
9139    ///
9140    /// * `value` - New boolean value
9141    pub fn new_boolean(&self, value: bool) -> JsonValue {
9142        let mut query = self.selection.select("newBoolean");
9143        query = query.arg("value", value);
9144        JsonValue {
9145            proc: self.proc.clone(),
9146            selection: query,
9147            graphql_client: self.graphql_client.clone(),
9148        }
9149    }
9150    /// Encode an integer to json
9151    ///
9152    /// # Arguments
9153    ///
9154    /// * `value` - New integer value
9155    pub fn new_integer(&self, value: isize) -> JsonValue {
9156        let mut query = self.selection.select("newInteger");
9157        query = query.arg("value", value);
9158        JsonValue {
9159            proc: self.proc.clone(),
9160            selection: query,
9161            graphql_client: self.graphql_client.clone(),
9162        }
9163    }
9164    /// Encode a string to json
9165    ///
9166    /// # Arguments
9167    ///
9168    /// * `value` - New string value
9169    pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
9170        let mut query = self.selection.select("newString");
9171        query = query.arg("value", value.into());
9172        JsonValue {
9173            proc: self.proc.clone(),
9174            selection: query,
9175            graphql_client: self.graphql_client.clone(),
9176        }
9177    }
9178    /// Return a new json value, decoded from the given content
9179    ///
9180    /// # Arguments
9181    ///
9182    /// * `contents` - New JSON-encoded contents
9183    pub fn with_contents(&self, contents: Json) -> JsonValue {
9184        let mut query = self.selection.select("withContents");
9185        query = query.arg("contents", contents);
9186        JsonValue {
9187            proc: self.proc.clone(),
9188            selection: query,
9189            graphql_client: self.graphql_client.clone(),
9190        }
9191    }
9192    /// Set a new field at the given path
9193    ///
9194    /// # Arguments
9195    ///
9196    /// * `path` - Path of the field to set, encoded as an array of field names
9197    /// * `value` - The new value of the field
9198    pub fn with_field(
9199        &self,
9200        path: Vec<impl Into<String>>,
9201        value: impl IntoID<JsonValueId>,
9202    ) -> JsonValue {
9203        let mut query = self.selection.select("withField");
9204        query = query.arg(
9205            "path",
9206            path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9207        );
9208        query = query.arg_lazy(
9209            "value",
9210            Box::new(move || {
9211                let value = value.clone();
9212                Box::pin(async move { value.into_id().await.unwrap().quote() })
9213            }),
9214        );
9215        JsonValue {
9216            proc: self.proc.clone(),
9217            selection: query,
9218            graphql_client: self.graphql_client.clone(),
9219        }
9220    }
9221}
9222#[derive(Clone)]
9223pub struct Llm {
9224    pub proc: Option<Arc<DaggerSessionProc>>,
9225    pub selection: Selection,
9226    pub graphql_client: DynGraphQLClient,
9227}
9228impl Llm {
9229    /// create a branch in the LLM's history
9230    pub fn attempt(&self, number: isize) -> Llm {
9231        let mut query = self.selection.select("attempt");
9232        query = query.arg("number", number);
9233        Llm {
9234            proc: self.proc.clone(),
9235            selection: query,
9236            graphql_client: self.graphql_client.clone(),
9237        }
9238    }
9239    /// returns the type of the current state
9240    pub fn bind_result(&self, name: impl Into<String>) -> Binding {
9241        let mut query = self.selection.select("bindResult");
9242        query = query.arg("name", name.into());
9243        Binding {
9244            proc: self.proc.clone(),
9245            selection: query,
9246            graphql_client: self.graphql_client.clone(),
9247        }
9248    }
9249    /// return the LLM's current environment
9250    pub fn env(&self) -> Env {
9251        let query = self.selection.select("env");
9252        Env {
9253            proc: self.proc.clone(),
9254            selection: query,
9255            graphql_client: self.graphql_client.clone(),
9256        }
9257    }
9258    /// Indicates whether there are any queued prompts or tool results to send to the model
9259    pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
9260        let query = self.selection.select("hasPrompt");
9261        query.execute(self.graphql_client.clone()).await
9262    }
9263    /// return the llm message history
9264    pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
9265        let query = self.selection.select("history");
9266        query.execute(self.graphql_client.clone()).await
9267    }
9268    /// return the raw llm message history as json
9269    pub async fn history_json(&self) -> Result<Json, DaggerError> {
9270        let query = self.selection.select("historyJSON");
9271        query.execute(self.graphql_client.clone()).await
9272    }
9273    /// A unique identifier for this LLM.
9274    pub async fn id(&self) -> Result<Llmid, DaggerError> {
9275        let query = self.selection.select("id");
9276        query.execute(self.graphql_client.clone()).await
9277    }
9278    /// return the last llm reply from the history
9279    pub async fn last_reply(&self) -> Result<String, DaggerError> {
9280        let query = self.selection.select("lastReply");
9281        query.execute(self.graphql_client.clone()).await
9282    }
9283    /// Submit the queued prompt, evaluate any tool calls, queue their results, and keep going until the model ends its turn
9284    pub fn r#loop(&self) -> Llm {
9285        let query = self.selection.select("loop");
9286        Llm {
9287            proc: self.proc.clone(),
9288            selection: query,
9289            graphql_client: self.graphql_client.clone(),
9290        }
9291    }
9292    /// return the model used by the llm
9293    pub async fn model(&self) -> Result<String, DaggerError> {
9294        let query = self.selection.select("model");
9295        query.execute(self.graphql_client.clone()).await
9296    }
9297    /// return the provider used by the llm
9298    pub async fn provider(&self) -> Result<String, DaggerError> {
9299        let query = self.selection.select("provider");
9300        query.execute(self.graphql_client.clone()).await
9301    }
9302    /// Submit the queued prompt or tool call results, evaluate any tool calls, and queue their results
9303    pub async fn step(&self) -> Result<Llmid, DaggerError> {
9304        let query = self.selection.select("step");
9305        query.execute(self.graphql_client.clone()).await
9306    }
9307    /// synchronize LLM state
9308    pub async fn sync(&self) -> Result<Llmid, DaggerError> {
9309        let query = self.selection.select("sync");
9310        query.execute(self.graphql_client.clone()).await
9311    }
9312    /// returns the token usage of the current state
9313    pub fn token_usage(&self) -> LlmTokenUsage {
9314        let query = self.selection.select("tokenUsage");
9315        LlmTokenUsage {
9316            proc: self.proc.clone(),
9317            selection: query,
9318            graphql_client: self.graphql_client.clone(),
9319        }
9320    }
9321    /// print documentation for available tools
9322    pub async fn tools(&self) -> Result<String, DaggerError> {
9323        let query = self.selection.select("tools");
9324        query.execute(self.graphql_client.clone()).await
9325    }
9326    /// Return a new LLM with the specified function no longer exposed as a tool
9327    ///
9328    /// # Arguments
9329    ///
9330    /// * `type_name` - The type name whose function will be blocked
9331    /// * `function` - The function to block
9332    ///
9333    /// Will be converted to lowerCamelCase if necessary.
9334    pub fn with_blocked_function(
9335        &self,
9336        type_name: impl Into<String>,
9337        function: impl Into<String>,
9338    ) -> Llm {
9339        let mut query = self.selection.select("withBlockedFunction");
9340        query = query.arg("typeName", type_name.into());
9341        query = query.arg("function", function.into());
9342        Llm {
9343            proc: self.proc.clone(),
9344            selection: query,
9345            graphql_client: self.graphql_client.clone(),
9346        }
9347    }
9348    /// allow the LLM to interact with an environment via MCP
9349    pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
9350        let mut query = self.selection.select("withEnv");
9351        query = query.arg_lazy(
9352            "env",
9353            Box::new(move || {
9354                let env = env.clone();
9355                Box::pin(async move { env.into_id().await.unwrap().quote() })
9356            }),
9357        );
9358        Llm {
9359            proc: self.proc.clone(),
9360            selection: query,
9361            graphql_client: self.graphql_client.clone(),
9362        }
9363    }
9364    /// Add an external MCP server to the LLM
9365    ///
9366    /// # Arguments
9367    ///
9368    /// * `name` - The name of the MCP server
9369    /// * `service` - The MCP service to run and communicate with over stdio
9370    pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<ServiceId>) -> Llm {
9371        let mut query = self.selection.select("withMCPServer");
9372        query = query.arg("name", name.into());
9373        query = query.arg_lazy(
9374            "service",
9375            Box::new(move || {
9376                let service = service.clone();
9377                Box::pin(async move { service.into_id().await.unwrap().quote() })
9378            }),
9379        );
9380        Llm {
9381            proc: self.proc.clone(),
9382            selection: query,
9383            graphql_client: self.graphql_client.clone(),
9384        }
9385    }
9386    /// swap out the llm model
9387    ///
9388    /// # Arguments
9389    ///
9390    /// * `model` - The model to use
9391    pub fn with_model(&self, model: impl Into<String>) -> Llm {
9392        let mut query = self.selection.select("withModel");
9393        query = query.arg("model", model.into());
9394        Llm {
9395            proc: self.proc.clone(),
9396            selection: query,
9397            graphql_client: self.graphql_client.clone(),
9398        }
9399    }
9400    /// append a prompt to the llm context
9401    ///
9402    /// # Arguments
9403    ///
9404    /// * `prompt` - The prompt to send
9405    pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
9406        let mut query = self.selection.select("withPrompt");
9407        query = query.arg("prompt", prompt.into());
9408        Llm {
9409            proc: self.proc.clone(),
9410            selection: query,
9411            graphql_client: self.graphql_client.clone(),
9412        }
9413    }
9414    /// append the contents of a file to the llm context
9415    ///
9416    /// # Arguments
9417    ///
9418    /// * `file` - The file to read the prompt from
9419    pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
9420        let mut query = self.selection.select("withPromptFile");
9421        query = query.arg_lazy(
9422            "file",
9423            Box::new(move || {
9424                let file = file.clone();
9425                Box::pin(async move { file.into_id().await.unwrap().quote() })
9426            }),
9427        );
9428        Llm {
9429            proc: self.proc.clone(),
9430            selection: query,
9431            graphql_client: self.graphql_client.clone(),
9432        }
9433    }
9434    /// Use a static set of tools for method calls, e.g. for MCP clients that do not support dynamic tool registration
9435    pub fn with_static_tools(&self) -> Llm {
9436        let query = self.selection.select("withStaticTools");
9437        Llm {
9438            proc: self.proc.clone(),
9439            selection: query,
9440            graphql_client: self.graphql_client.clone(),
9441        }
9442    }
9443    /// Add a system prompt to the LLM's environment
9444    ///
9445    /// # Arguments
9446    ///
9447    /// * `prompt` - The system prompt to send
9448    pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
9449        let mut query = self.selection.select("withSystemPrompt");
9450        query = query.arg("prompt", prompt.into());
9451        Llm {
9452            proc: self.proc.clone(),
9453            selection: query,
9454            graphql_client: self.graphql_client.clone(),
9455        }
9456    }
9457    /// Disable the default system prompt
9458    pub fn without_default_system_prompt(&self) -> Llm {
9459        let query = self.selection.select("withoutDefaultSystemPrompt");
9460        Llm {
9461            proc: self.proc.clone(),
9462            selection: query,
9463            graphql_client: self.graphql_client.clone(),
9464        }
9465    }
9466}
9467#[derive(Clone)]
9468pub struct LlmTokenUsage {
9469    pub proc: Option<Arc<DaggerSessionProc>>,
9470    pub selection: Selection,
9471    pub graphql_client: DynGraphQLClient,
9472}
9473impl LlmTokenUsage {
9474    pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
9475        let query = self.selection.select("cachedTokenReads");
9476        query.execute(self.graphql_client.clone()).await
9477    }
9478    pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
9479        let query = self.selection.select("cachedTokenWrites");
9480        query.execute(self.graphql_client.clone()).await
9481    }
9482    /// A unique identifier for this LLMTokenUsage.
9483    pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
9484        let query = self.selection.select("id");
9485        query.execute(self.graphql_client.clone()).await
9486    }
9487    pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
9488        let query = self.selection.select("inputTokens");
9489        query.execute(self.graphql_client.clone()).await
9490    }
9491    pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
9492        let query = self.selection.select("outputTokens");
9493        query.execute(self.graphql_client.clone()).await
9494    }
9495    pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
9496        let query = self.selection.select("totalTokens");
9497        query.execute(self.graphql_client.clone()).await
9498    }
9499}
9500#[derive(Clone)]
9501pub struct Label {
9502    pub proc: Option<Arc<DaggerSessionProc>>,
9503    pub selection: Selection,
9504    pub graphql_client: DynGraphQLClient,
9505}
9506impl Label {
9507    /// A unique identifier for this Label.
9508    pub async fn id(&self) -> Result<LabelId, DaggerError> {
9509        let query = self.selection.select("id");
9510        query.execute(self.graphql_client.clone()).await
9511    }
9512    /// The label name.
9513    pub async fn name(&self) -> Result<String, DaggerError> {
9514        let query = self.selection.select("name");
9515        query.execute(self.graphql_client.clone()).await
9516    }
9517    /// The label value.
9518    pub async fn value(&self) -> Result<String, DaggerError> {
9519        let query = self.selection.select("value");
9520        query.execute(self.graphql_client.clone()).await
9521    }
9522}
9523#[derive(Clone)]
9524pub struct ListTypeDef {
9525    pub proc: Option<Arc<DaggerSessionProc>>,
9526    pub selection: Selection,
9527    pub graphql_client: DynGraphQLClient,
9528}
9529impl ListTypeDef {
9530    /// The type of the elements in the list.
9531    pub fn element_type_def(&self) -> TypeDef {
9532        let query = self.selection.select("elementTypeDef");
9533        TypeDef {
9534            proc: self.proc.clone(),
9535            selection: query,
9536            graphql_client: self.graphql_client.clone(),
9537        }
9538    }
9539    /// A unique identifier for this ListTypeDef.
9540    pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
9541        let query = self.selection.select("id");
9542        query.execute(self.graphql_client.clone()).await
9543    }
9544}
9545#[derive(Clone)]
9546pub struct Module {
9547    pub proc: Option<Arc<DaggerSessionProc>>,
9548    pub selection: Selection,
9549    pub graphql_client: DynGraphQLClient,
9550}
9551#[derive(Builder, Debug, PartialEq)]
9552pub struct ModuleServeOpts {
9553    /// Expose the dependencies of this module to the client
9554    #[builder(setter(into, strip_option), default)]
9555    pub include_dependencies: Option<bool>,
9556}
9557impl Module {
9558    /// The dependencies of the module.
9559    pub fn dependencies(&self) -> Vec<Module> {
9560        let query = self.selection.select("dependencies");
9561        vec![Module {
9562            proc: self.proc.clone(),
9563            selection: query,
9564            graphql_client: self.graphql_client.clone(),
9565        }]
9566    }
9567    /// The doc string of the module, if any
9568    pub async fn description(&self) -> Result<String, DaggerError> {
9569        let query = self.selection.select("description");
9570        query.execute(self.graphql_client.clone()).await
9571    }
9572    /// Enumerations served by this module.
9573    pub fn enums(&self) -> Vec<TypeDef> {
9574        let query = self.selection.select("enums");
9575        vec![TypeDef {
9576            proc: self.proc.clone(),
9577            selection: query,
9578            graphql_client: self.graphql_client.clone(),
9579        }]
9580    }
9581    /// The generated files and directories made on top of the module source's context directory.
9582    pub fn generated_context_directory(&self) -> Directory {
9583        let query = self.selection.select("generatedContextDirectory");
9584        Directory {
9585            proc: self.proc.clone(),
9586            selection: query,
9587            graphql_client: self.graphql_client.clone(),
9588        }
9589    }
9590    /// A unique identifier for this Module.
9591    pub async fn id(&self) -> Result<ModuleId, DaggerError> {
9592        let query = self.selection.select("id");
9593        query.execute(self.graphql_client.clone()).await
9594    }
9595    /// Interfaces served by this module.
9596    pub fn interfaces(&self) -> Vec<TypeDef> {
9597        let query = self.selection.select("interfaces");
9598        vec![TypeDef {
9599            proc: self.proc.clone(),
9600            selection: query,
9601            graphql_client: self.graphql_client.clone(),
9602        }]
9603    }
9604    /// The introspection schema JSON file for this module.
9605    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
9606    /// Note: this is in the context of a module, so some core types may be hidden.
9607    pub fn introspection_schema_json(&self) -> File {
9608        let query = self.selection.select("introspectionSchemaJSON");
9609        File {
9610            proc: self.proc.clone(),
9611            selection: query,
9612            graphql_client: self.graphql_client.clone(),
9613        }
9614    }
9615    /// The name of the module
9616    pub async fn name(&self) -> Result<String, DaggerError> {
9617        let query = self.selection.select("name");
9618        query.execute(self.graphql_client.clone()).await
9619    }
9620    /// Objects served by this module.
9621    pub fn objects(&self) -> Vec<TypeDef> {
9622        let query = self.selection.select("objects");
9623        vec![TypeDef {
9624            proc: self.proc.clone(),
9625            selection: query,
9626            graphql_client: self.graphql_client.clone(),
9627        }]
9628    }
9629    /// The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
9630    pub fn runtime(&self) -> Container {
9631        let query = self.selection.select("runtime");
9632        Container {
9633            proc: self.proc.clone(),
9634            selection: query,
9635            graphql_client: self.graphql_client.clone(),
9636        }
9637    }
9638    /// The SDK config used by this module.
9639    pub fn sdk(&self) -> SdkConfig {
9640        let query = self.selection.select("sdk");
9641        SdkConfig {
9642            proc: self.proc.clone(),
9643            selection: query,
9644            graphql_client: self.graphql_client.clone(),
9645        }
9646    }
9647    /// Serve a module's API in the current session.
9648    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
9649    ///
9650    /// # Arguments
9651    ///
9652    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9653    pub async fn serve(&self) -> Result<Void, DaggerError> {
9654        let query = self.selection.select("serve");
9655        query.execute(self.graphql_client.clone()).await
9656    }
9657    /// Serve a module's API in the current session.
9658    /// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
9659    ///
9660    /// # Arguments
9661    ///
9662    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
9663    pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
9664        let mut query = self.selection.select("serve");
9665        if let Some(include_dependencies) = opts.include_dependencies {
9666            query = query.arg("includeDependencies", include_dependencies);
9667        }
9668        query.execute(self.graphql_client.clone()).await
9669    }
9670    /// The source for the module.
9671    pub fn source(&self) -> ModuleSource {
9672        let query = self.selection.select("source");
9673        ModuleSource {
9674            proc: self.proc.clone(),
9675            selection: query,
9676            graphql_client: self.graphql_client.clone(),
9677        }
9678    }
9679    /// Forces evaluation of the module, including any loading into the engine and associated validation.
9680    pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
9681        let query = self.selection.select("sync");
9682        query.execute(self.graphql_client.clone()).await
9683    }
9684    /// User-defined default values, loaded from local .env files.
9685    pub fn user_defaults(&self) -> EnvFile {
9686        let query = self.selection.select("userDefaults");
9687        EnvFile {
9688            proc: self.proc.clone(),
9689            selection: query,
9690            graphql_client: self.graphql_client.clone(),
9691        }
9692    }
9693    /// Retrieves the module with the given description
9694    ///
9695    /// # Arguments
9696    ///
9697    /// * `description` - The description to set
9698    pub fn with_description(&self, description: impl Into<String>) -> Module {
9699        let mut query = self.selection.select("withDescription");
9700        query = query.arg("description", description.into());
9701        Module {
9702            proc: self.proc.clone(),
9703            selection: query,
9704            graphql_client: self.graphql_client.clone(),
9705        }
9706    }
9707    /// This module plus the given Enum type and associated values
9708    pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
9709        let mut query = self.selection.select("withEnum");
9710        query = query.arg_lazy(
9711            "enum",
9712            Box::new(move || {
9713                let r#enum = r#enum.clone();
9714                Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
9715            }),
9716        );
9717        Module {
9718            proc: self.proc.clone(),
9719            selection: query,
9720            graphql_client: self.graphql_client.clone(),
9721        }
9722    }
9723    /// This module plus the given Interface type and associated functions
9724    pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
9725        let mut query = self.selection.select("withInterface");
9726        query = query.arg_lazy(
9727            "iface",
9728            Box::new(move || {
9729                let iface = iface.clone();
9730                Box::pin(async move { iface.into_id().await.unwrap().quote() })
9731            }),
9732        );
9733        Module {
9734            proc: self.proc.clone(),
9735            selection: query,
9736            graphql_client: self.graphql_client.clone(),
9737        }
9738    }
9739    /// This module plus the given Object type and associated functions.
9740    pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
9741        let mut query = self.selection.select("withObject");
9742        query = query.arg_lazy(
9743            "object",
9744            Box::new(move || {
9745                let object = object.clone();
9746                Box::pin(async move { object.into_id().await.unwrap().quote() })
9747            }),
9748        );
9749        Module {
9750            proc: self.proc.clone(),
9751            selection: query,
9752            graphql_client: self.graphql_client.clone(),
9753        }
9754    }
9755}
9756#[derive(Clone)]
9757pub struct ModuleConfigClient {
9758    pub proc: Option<Arc<DaggerSessionProc>>,
9759    pub selection: Selection,
9760    pub graphql_client: DynGraphQLClient,
9761}
9762impl ModuleConfigClient {
9763    /// The directory the client is generated in.
9764    pub async fn directory(&self) -> Result<String, DaggerError> {
9765        let query = self.selection.select("directory");
9766        query.execute(self.graphql_client.clone()).await
9767    }
9768    /// The generator to use
9769    pub async fn generator(&self) -> Result<String, DaggerError> {
9770        let query = self.selection.select("generator");
9771        query.execute(self.graphql_client.clone()).await
9772    }
9773    /// A unique identifier for this ModuleConfigClient.
9774    pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
9775        let query = self.selection.select("id");
9776        query.execute(self.graphql_client.clone()).await
9777    }
9778}
9779#[derive(Clone)]
9780pub struct ModuleSource {
9781    pub proc: Option<Arc<DaggerSessionProc>>,
9782    pub selection: Selection,
9783    pub graphql_client: DynGraphQLClient,
9784}
9785impl ModuleSource {
9786    /// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
9787    pub fn as_module(&self) -> Module {
9788        let query = self.selection.select("asModule");
9789        Module {
9790            proc: self.proc.clone(),
9791            selection: query,
9792            graphql_client: self.graphql_client.clone(),
9793        }
9794    }
9795    /// A human readable ref string representation of this module source.
9796    pub async fn as_string(&self) -> Result<String, DaggerError> {
9797        let query = self.selection.select("asString");
9798        query.execute(self.graphql_client.clone()).await
9799    }
9800    /// The blueprint referenced by the module source.
9801    pub fn blueprint(&self) -> ModuleSource {
9802        let query = self.selection.select("blueprint");
9803        ModuleSource {
9804            proc: self.proc.clone(),
9805            selection: query,
9806            graphql_client: self.graphql_client.clone(),
9807        }
9808    }
9809    /// The ref to clone the root of the git repo from. Only valid for git sources.
9810    pub async fn clone_ref(&self) -> Result<String, DaggerError> {
9811        let query = self.selection.select("cloneRef");
9812        query.execute(self.graphql_client.clone()).await
9813    }
9814    /// The resolved commit of the git repo this source points to.
9815    pub async fn commit(&self) -> Result<String, DaggerError> {
9816        let query = self.selection.select("commit");
9817        query.execute(self.graphql_client.clone()).await
9818    }
9819    /// The clients generated for the module.
9820    pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
9821        let query = self.selection.select("configClients");
9822        vec![ModuleConfigClient {
9823            proc: self.proc.clone(),
9824            selection: query,
9825            graphql_client: self.graphql_client.clone(),
9826        }]
9827    }
9828    /// Whether an existing dagger.json for the module was found.
9829    pub async fn config_exists(&self) -> Result<bool, DaggerError> {
9830        let query = self.selection.select("configExists");
9831        query.execute(self.graphql_client.clone()).await
9832    }
9833    /// The full directory loaded for the module source, including the source code as a subdirectory.
9834    pub fn context_directory(&self) -> Directory {
9835        let query = self.selection.select("contextDirectory");
9836        Directory {
9837            proc: self.proc.clone(),
9838            selection: query,
9839            graphql_client: self.graphql_client.clone(),
9840        }
9841    }
9842    /// The dependencies of the module source.
9843    pub fn dependencies(&self) -> Vec<ModuleSource> {
9844        let query = self.selection.select("dependencies");
9845        vec![ModuleSource {
9846            proc: self.proc.clone(),
9847            selection: query,
9848            graphql_client: self.graphql_client.clone(),
9849        }]
9850    }
9851    /// 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.
9852    pub async fn digest(&self) -> Result<String, DaggerError> {
9853        let query = self.selection.select("digest");
9854        query.execute(self.graphql_client.clone()).await
9855    }
9856    /// The directory containing the module configuration and source code (source code may be in a subdir).
9857    ///
9858    /// # Arguments
9859    ///
9860    /// * `path` - A subpath from the source directory to select.
9861    pub fn directory(&self, path: impl Into<String>) -> Directory {
9862        let mut query = self.selection.select("directory");
9863        query = query.arg("path", path.into());
9864        Directory {
9865            proc: self.proc.clone(),
9866            selection: query,
9867            graphql_client: self.graphql_client.clone(),
9868        }
9869    }
9870    /// The engine version of the module.
9871    pub async fn engine_version(&self) -> Result<String, DaggerError> {
9872        let query = self.selection.select("engineVersion");
9873        query.execute(self.graphql_client.clone()).await
9874    }
9875    /// The generated files and directories made on top of the module source's context directory.
9876    pub fn generated_context_directory(&self) -> Directory {
9877        let query = self.selection.select("generatedContextDirectory");
9878        Directory {
9879            proc: self.proc.clone(),
9880            selection: query,
9881            graphql_client: self.graphql_client.clone(),
9882        }
9883    }
9884    /// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
9885    pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
9886        let query = self.selection.select("htmlRepoURL");
9887        query.execute(self.graphql_client.clone()).await
9888    }
9889    /// The URL to the source's git repo in a web browser. Only valid for git sources.
9890    pub async fn html_url(&self) -> Result<String, DaggerError> {
9891        let query = self.selection.select("htmlURL");
9892        query.execute(self.graphql_client.clone()).await
9893    }
9894    /// A unique identifier for this ModuleSource.
9895    pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
9896        let query = self.selection.select("id");
9897        query.execute(self.graphql_client.clone()).await
9898    }
9899    /// The introspection schema JSON file for this module source.
9900    /// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
9901    /// Note: this is in the context of a module, so some core types may be hidden.
9902    pub fn introspection_schema_json(&self) -> File {
9903        let query = self.selection.select("introspectionSchemaJSON");
9904        File {
9905            proc: self.proc.clone(),
9906            selection: query,
9907            graphql_client: self.graphql_client.clone(),
9908        }
9909    }
9910    /// The kind of module source (currently local, git or dir).
9911    pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
9912        let query = self.selection.select("kind");
9913        query.execute(self.graphql_client.clone()).await
9914    }
9915    /// 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.
9916    pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
9917        let query = self.selection.select("localContextDirectoryPath");
9918        query.execute(self.graphql_client.clone()).await
9919    }
9920    /// The name of the module, including any setting via the withName API.
9921    pub async fn module_name(&self) -> Result<String, DaggerError> {
9922        let query = self.selection.select("moduleName");
9923        query.execute(self.graphql_client.clone()).await
9924    }
9925    /// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
9926    pub async fn module_original_name(&self) -> Result<String, DaggerError> {
9927        let query = self.selection.select("moduleOriginalName");
9928        query.execute(self.graphql_client.clone()).await
9929    }
9930    /// The original subpath used when instantiating this module source, relative to the context directory.
9931    pub async fn original_subpath(&self) -> Result<String, DaggerError> {
9932        let query = self.selection.select("originalSubpath");
9933        query.execute(self.graphql_client.clone()).await
9934    }
9935    /// The pinned version of this module source.
9936    pub async fn pin(&self) -> Result<String, DaggerError> {
9937        let query = self.selection.select("pin");
9938        query.execute(self.graphql_client.clone()).await
9939    }
9940    /// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
9941    pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
9942        let query = self.selection.select("repoRootPath");
9943        query.execute(self.graphql_client.clone()).await
9944    }
9945    /// The SDK configuration of the module.
9946    pub fn sdk(&self) -> SdkConfig {
9947        let query = self.selection.select("sdk");
9948        SdkConfig {
9949            proc: self.proc.clone(),
9950            selection: query,
9951            graphql_client: self.graphql_client.clone(),
9952        }
9953    }
9954    /// The path, relative to the context directory, that contains the module's dagger.json.
9955    pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
9956        let query = self.selection.select("sourceRootSubpath");
9957        query.execute(self.graphql_client.clone()).await
9958    }
9959    /// The path to the directory containing the module's source code, relative to the context directory.
9960    pub async fn source_subpath(&self) -> Result<String, DaggerError> {
9961        let query = self.selection.select("sourceSubpath");
9962        query.execute(self.graphql_client.clone()).await
9963    }
9964    /// Forces evaluation of the module source, including any loading into the engine and associated validation.
9965    pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
9966        let query = self.selection.select("sync");
9967        query.execute(self.graphql_client.clone()).await
9968    }
9969    /// The toolchains referenced by the module source.
9970    pub fn toolchains(&self) -> Vec<ModuleSource> {
9971        let query = self.selection.select("toolchains");
9972        vec![ModuleSource {
9973            proc: self.proc.clone(),
9974            selection: query,
9975            graphql_client: self.graphql_client.clone(),
9976        }]
9977    }
9978    /// User-defined defaults read from local .env files
9979    pub fn user_defaults(&self) -> EnvFile {
9980        let query = self.selection.select("userDefaults");
9981        EnvFile {
9982            proc: self.proc.clone(),
9983            selection: query,
9984            graphql_client: self.graphql_client.clone(),
9985        }
9986    }
9987    /// The specified version of the git repo this source points to.
9988    pub async fn version(&self) -> Result<String, DaggerError> {
9989        let query = self.selection.select("version");
9990        query.execute(self.graphql_client.clone()).await
9991    }
9992    /// Set a blueprint for the module source.
9993    ///
9994    /// # Arguments
9995    ///
9996    /// * `blueprint` - The blueprint module to set.
9997    pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
9998        let mut query = self.selection.select("withBlueprint");
9999        query = query.arg_lazy(
10000            "blueprint",
10001            Box::new(move || {
10002                let blueprint = blueprint.clone();
10003                Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
10004            }),
10005        );
10006        ModuleSource {
10007            proc: self.proc.clone(),
10008            selection: query,
10009            graphql_client: self.graphql_client.clone(),
10010        }
10011    }
10012    /// Update the module source with a new client to generate.
10013    ///
10014    /// # Arguments
10015    ///
10016    /// * `generator` - The generator to use
10017    /// * `output_dir` - The output directory for the generated client.
10018    pub fn with_client(
10019        &self,
10020        generator: impl Into<String>,
10021        output_dir: impl Into<String>,
10022    ) -> ModuleSource {
10023        let mut query = self.selection.select("withClient");
10024        query = query.arg("generator", generator.into());
10025        query = query.arg("outputDir", output_dir.into());
10026        ModuleSource {
10027            proc: self.proc.clone(),
10028            selection: query,
10029            graphql_client: self.graphql_client.clone(),
10030        }
10031    }
10032    /// Append the provided dependencies to the module source's dependency list.
10033    ///
10034    /// # Arguments
10035    ///
10036    /// * `dependencies` - The dependencies to append.
10037    pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
10038        let mut query = self.selection.select("withDependencies");
10039        query = query.arg("dependencies", dependencies);
10040        ModuleSource {
10041            proc: self.proc.clone(),
10042            selection: query,
10043            graphql_client: self.graphql_client.clone(),
10044        }
10045    }
10046    /// Upgrade the engine version of the module to the given value.
10047    ///
10048    /// # Arguments
10049    ///
10050    /// * `version` - The engine version to upgrade to.
10051    pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
10052        let mut query = self.selection.select("withEngineVersion");
10053        query = query.arg("version", version.into());
10054        ModuleSource {
10055            proc: self.proc.clone(),
10056            selection: query,
10057            graphql_client: self.graphql_client.clone(),
10058        }
10059    }
10060    /// Enable the experimental features for the module source.
10061    ///
10062    /// # Arguments
10063    ///
10064    /// * `features` - The experimental features to enable.
10065    pub fn with_experimental_features(
10066        &self,
10067        features: Vec<ModuleSourceExperimentalFeature>,
10068    ) -> ModuleSource {
10069        let mut query = self.selection.select("withExperimentalFeatures");
10070        query = query.arg("features", features);
10071        ModuleSource {
10072            proc: self.proc.clone(),
10073            selection: query,
10074            graphql_client: self.graphql_client.clone(),
10075        }
10076    }
10077    /// Update the module source with additional include patterns for files+directories from its context that are required for building it
10078    ///
10079    /// # Arguments
10080    ///
10081    /// * `patterns` - The new additional include patterns.
10082    pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
10083        let mut query = self.selection.select("withIncludes");
10084        query = query.arg(
10085            "patterns",
10086            patterns
10087                .into_iter()
10088                .map(|i| i.into())
10089                .collect::<Vec<String>>(),
10090        );
10091        ModuleSource {
10092            proc: self.proc.clone(),
10093            selection: query,
10094            graphql_client: self.graphql_client.clone(),
10095        }
10096    }
10097    /// Update the module source with a new name.
10098    ///
10099    /// # Arguments
10100    ///
10101    /// * `name` - The name to set.
10102    pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
10103        let mut query = self.selection.select("withName");
10104        query = query.arg("name", name.into());
10105        ModuleSource {
10106            proc: self.proc.clone(),
10107            selection: query,
10108            graphql_client: self.graphql_client.clone(),
10109        }
10110    }
10111    /// Update the module source with a new SDK.
10112    ///
10113    /// # Arguments
10114    ///
10115    /// * `source` - The SDK source to set.
10116    pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
10117        let mut query = self.selection.select("withSDK");
10118        query = query.arg("source", source.into());
10119        ModuleSource {
10120            proc: self.proc.clone(),
10121            selection: query,
10122            graphql_client: self.graphql_client.clone(),
10123        }
10124    }
10125    /// Update the module source with a new source subpath.
10126    ///
10127    /// # Arguments
10128    ///
10129    /// * `path` - The path to set as the source subpath. Must be relative to the module source's source root directory.
10130    pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
10131        let mut query = self.selection.select("withSourceSubpath");
10132        query = query.arg("path", path.into());
10133        ModuleSource {
10134            proc: self.proc.clone(),
10135            selection: query,
10136            graphql_client: self.graphql_client.clone(),
10137        }
10138    }
10139    /// Add toolchains to the module source.
10140    ///
10141    /// # Arguments
10142    ///
10143    /// * `toolchains` - The toolchain modules to add.
10144    pub fn with_toolchains(&self, toolchains: Vec<ModuleSourceId>) -> ModuleSource {
10145        let mut query = self.selection.select("withToolchains");
10146        query = query.arg("toolchains", toolchains);
10147        ModuleSource {
10148            proc: self.proc.clone(),
10149            selection: query,
10150            graphql_client: self.graphql_client.clone(),
10151        }
10152    }
10153    /// Update the blueprint module to the latest version.
10154    pub fn with_update_blueprint(&self) -> ModuleSource {
10155        let query = self.selection.select("withUpdateBlueprint");
10156        ModuleSource {
10157            proc: self.proc.clone(),
10158            selection: query,
10159            graphql_client: self.graphql_client.clone(),
10160        }
10161    }
10162    /// Update one or more module dependencies.
10163    ///
10164    /// # Arguments
10165    ///
10166    /// * `dependencies` - The dependencies to update.
10167    pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
10168        let mut query = self.selection.select("withUpdateDependencies");
10169        query = query.arg(
10170            "dependencies",
10171            dependencies
10172                .into_iter()
10173                .map(|i| i.into())
10174                .collect::<Vec<String>>(),
10175        );
10176        ModuleSource {
10177            proc: self.proc.clone(),
10178            selection: query,
10179            graphql_client: self.graphql_client.clone(),
10180        }
10181    }
10182    /// Update one or more toolchains.
10183    ///
10184    /// # Arguments
10185    ///
10186    /// * `toolchains` - The toolchains to update.
10187    pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
10188        let mut query = self.selection.select("withUpdateToolchains");
10189        query = query.arg(
10190            "toolchains",
10191            toolchains
10192                .into_iter()
10193                .map(|i| i.into())
10194                .collect::<Vec<String>>(),
10195        );
10196        ModuleSource {
10197            proc: self.proc.clone(),
10198            selection: query,
10199            graphql_client: self.graphql_client.clone(),
10200        }
10201    }
10202    /// Update one or more clients.
10203    ///
10204    /// # Arguments
10205    ///
10206    /// * `clients` - The clients to update
10207    pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
10208        let mut query = self.selection.select("withUpdatedClients");
10209        query = query.arg(
10210            "clients",
10211            clients
10212                .into_iter()
10213                .map(|i| i.into())
10214                .collect::<Vec<String>>(),
10215        );
10216        ModuleSource {
10217            proc: self.proc.clone(),
10218            selection: query,
10219            graphql_client: self.graphql_client.clone(),
10220        }
10221    }
10222    /// Remove the current blueprint from the module source.
10223    pub fn without_blueprint(&self) -> ModuleSource {
10224        let query = self.selection.select("withoutBlueprint");
10225        ModuleSource {
10226            proc: self.proc.clone(),
10227            selection: query,
10228            graphql_client: self.graphql_client.clone(),
10229        }
10230    }
10231    /// Remove a client from the module source.
10232    ///
10233    /// # Arguments
10234    ///
10235    /// * `path` - The path of the client to remove.
10236    pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
10237        let mut query = self.selection.select("withoutClient");
10238        query = query.arg("path", path.into());
10239        ModuleSource {
10240            proc: self.proc.clone(),
10241            selection: query,
10242            graphql_client: self.graphql_client.clone(),
10243        }
10244    }
10245    /// Remove the provided dependencies from the module source's dependency list.
10246    ///
10247    /// # Arguments
10248    ///
10249    /// * `dependencies` - The dependencies to remove.
10250    pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
10251        let mut query = self.selection.select("withoutDependencies");
10252        query = query.arg(
10253            "dependencies",
10254            dependencies
10255                .into_iter()
10256                .map(|i| i.into())
10257                .collect::<Vec<String>>(),
10258        );
10259        ModuleSource {
10260            proc: self.proc.clone(),
10261            selection: query,
10262            graphql_client: self.graphql_client.clone(),
10263        }
10264    }
10265    /// Disable experimental features for the module source.
10266    ///
10267    /// # Arguments
10268    ///
10269    /// * `features` - The experimental features to disable.
10270    pub fn without_experimental_features(
10271        &self,
10272        features: Vec<ModuleSourceExperimentalFeature>,
10273    ) -> ModuleSource {
10274        let mut query = self.selection.select("withoutExperimentalFeatures");
10275        query = query.arg("features", features);
10276        ModuleSource {
10277            proc: self.proc.clone(),
10278            selection: query,
10279            graphql_client: self.graphql_client.clone(),
10280        }
10281    }
10282    /// Remove the provided toolchains from the module source.
10283    ///
10284    /// # Arguments
10285    ///
10286    /// * `toolchains` - The toolchains to remove.
10287    pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
10288        let mut query = self.selection.select("withoutToolchains");
10289        query = query.arg(
10290            "toolchains",
10291            toolchains
10292                .into_iter()
10293                .map(|i| i.into())
10294                .collect::<Vec<String>>(),
10295        );
10296        ModuleSource {
10297            proc: self.proc.clone(),
10298            selection: query,
10299            graphql_client: self.graphql_client.clone(),
10300        }
10301    }
10302}
10303#[derive(Clone)]
10304pub struct ObjectTypeDef {
10305    pub proc: Option<Arc<DaggerSessionProc>>,
10306    pub selection: Selection,
10307    pub graphql_client: DynGraphQLClient,
10308}
10309impl ObjectTypeDef {
10310    /// The function used to construct new instances of this object, if any
10311    pub fn constructor(&self) -> Function {
10312        let query = self.selection.select("constructor");
10313        Function {
10314            proc: self.proc.clone(),
10315            selection: query,
10316            graphql_client: self.graphql_client.clone(),
10317        }
10318    }
10319    /// The doc string for the object, if any.
10320    pub async fn description(&self) -> Result<String, DaggerError> {
10321        let query = self.selection.select("description");
10322        query.execute(self.graphql_client.clone()).await
10323    }
10324    /// Static fields defined on this object, if any.
10325    pub fn fields(&self) -> Vec<FieldTypeDef> {
10326        let query = self.selection.select("fields");
10327        vec![FieldTypeDef {
10328            proc: self.proc.clone(),
10329            selection: query,
10330            graphql_client: self.graphql_client.clone(),
10331        }]
10332    }
10333    /// Functions defined on this object, if any.
10334    pub fn functions(&self) -> Vec<Function> {
10335        let query = self.selection.select("functions");
10336        vec![Function {
10337            proc: self.proc.clone(),
10338            selection: query,
10339            graphql_client: self.graphql_client.clone(),
10340        }]
10341    }
10342    /// A unique identifier for this ObjectTypeDef.
10343    pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
10344        let query = self.selection.select("id");
10345        query.execute(self.graphql_client.clone()).await
10346    }
10347    /// The name of the object.
10348    pub async fn name(&self) -> Result<String, DaggerError> {
10349        let query = self.selection.select("name");
10350        query.execute(self.graphql_client.clone()).await
10351    }
10352    /// The location of this object declaration.
10353    pub fn source_map(&self) -> SourceMap {
10354        let query = self.selection.select("sourceMap");
10355        SourceMap {
10356            proc: self.proc.clone(),
10357            selection: query,
10358            graphql_client: self.graphql_client.clone(),
10359        }
10360    }
10361    /// If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
10362    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10363        let query = self.selection.select("sourceModuleName");
10364        query.execute(self.graphql_client.clone()).await
10365    }
10366}
10367#[derive(Clone)]
10368pub struct Port {
10369    pub proc: Option<Arc<DaggerSessionProc>>,
10370    pub selection: Selection,
10371    pub graphql_client: DynGraphQLClient,
10372}
10373impl Port {
10374    /// The port description.
10375    pub async fn description(&self) -> Result<String, DaggerError> {
10376        let query = self.selection.select("description");
10377        query.execute(self.graphql_client.clone()).await
10378    }
10379    /// Skip the health check when run as a service.
10380    pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
10381        let query = self.selection.select("experimentalSkipHealthcheck");
10382        query.execute(self.graphql_client.clone()).await
10383    }
10384    /// A unique identifier for this Port.
10385    pub async fn id(&self) -> Result<PortId, DaggerError> {
10386        let query = self.selection.select("id");
10387        query.execute(self.graphql_client.clone()).await
10388    }
10389    /// The port number.
10390    pub async fn port(&self) -> Result<isize, DaggerError> {
10391        let query = self.selection.select("port");
10392        query.execute(self.graphql_client.clone()).await
10393    }
10394    /// The transport layer protocol.
10395    pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
10396        let query = self.selection.select("protocol");
10397        query.execute(self.graphql_client.clone()).await
10398    }
10399}
10400#[derive(Clone)]
10401pub struct Query {
10402    pub proc: Option<Arc<DaggerSessionProc>>,
10403    pub selection: Selection,
10404    pub graphql_client: DynGraphQLClient,
10405}
10406#[derive(Builder, Debug, PartialEq)]
10407pub struct QueryContainerOpts {
10408    /// Platform to initialize the container with. Defaults to the native platform of the current engine
10409    #[builder(setter(into, strip_option), default)]
10410    pub platform: Option<Platform>,
10411}
10412#[derive(Builder, Debug, PartialEq)]
10413pub struct QueryEnvOpts {
10414    /// Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
10415    #[builder(setter(into, strip_option), default)]
10416    pub privileged: Option<bool>,
10417    /// Allow new outputs to be declared and saved in the environment
10418    #[builder(setter(into, strip_option), default)]
10419    pub writable: Option<bool>,
10420}
10421#[derive(Builder, Debug, PartialEq)]
10422pub struct QueryEnvFileOpts {
10423    /// Replace "${VAR}" or "$VAR" with the value of other vars
10424    #[builder(setter(into, strip_option), default)]
10425    pub expand: Option<bool>,
10426}
10427#[derive(Builder, Debug, PartialEq)]
10428pub struct QueryFileOpts {
10429    /// Permissions of the new file. Example: 0600
10430    #[builder(setter(into, strip_option), default)]
10431    pub permissions: Option<isize>,
10432}
10433#[derive(Builder, Debug, PartialEq)]
10434pub struct QueryGitOpts<'a> {
10435    /// A service which must be started before the repo is fetched.
10436    #[builder(setter(into, strip_option), default)]
10437    pub experimental_service_host: Option<ServiceId>,
10438    /// Secret used to populate the Authorization HTTP header
10439    #[builder(setter(into, strip_option), default)]
10440    pub http_auth_header: Option<SecretId>,
10441    /// Secret used to populate the password during basic HTTP Authorization
10442    #[builder(setter(into, strip_option), default)]
10443    pub http_auth_token: Option<SecretId>,
10444    /// Username used to populate the password during basic HTTP Authorization
10445    #[builder(setter(into, strip_option), default)]
10446    pub http_auth_username: Option<&'a str>,
10447    /// DEPRECATED: Set to true to keep .git directory.
10448    #[builder(setter(into, strip_option), default)]
10449    pub keep_git_dir: Option<bool>,
10450    /// Set SSH auth socket
10451    #[builder(setter(into, strip_option), default)]
10452    pub ssh_auth_socket: Option<SocketId>,
10453    /// Set SSH known hosts
10454    #[builder(setter(into, strip_option), default)]
10455    pub ssh_known_hosts: Option<&'a str>,
10456}
10457#[derive(Builder, Debug, PartialEq)]
10458pub struct QueryHttpOpts<'a> {
10459    /// Secret used to populate the Authorization HTTP header
10460    #[builder(setter(into, strip_option), default)]
10461    pub auth_header: Option<SecretId>,
10462    /// A service which must be started before the URL is fetched.
10463    #[builder(setter(into, strip_option), default)]
10464    pub experimental_service_host: Option<ServiceId>,
10465    /// File name to use for the file. Defaults to the last part of the URL.
10466    #[builder(setter(into, strip_option), default)]
10467    pub name: Option<&'a str>,
10468    /// Permissions to set on the file.
10469    #[builder(setter(into, strip_option), default)]
10470    pub permissions: Option<isize>,
10471}
10472#[derive(Builder, Debug, PartialEq)]
10473pub struct QueryLlmOpts<'a> {
10474    /// Cap the number of API calls for this LLM
10475    #[builder(setter(into, strip_option), default)]
10476    pub max_api_calls: Option<isize>,
10477    /// Model to use
10478    #[builder(setter(into, strip_option), default)]
10479    pub model: Option<&'a str>,
10480}
10481#[derive(Builder, Debug, PartialEq)]
10482pub struct QueryModuleSourceOpts<'a> {
10483    /// 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.
10484    #[builder(setter(into, strip_option), default)]
10485    pub allow_not_exists: Option<bool>,
10486    /// If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.
10487    #[builder(setter(into, strip_option), default)]
10488    pub disable_find_up: Option<bool>,
10489    /// The pinned version of the module source
10490    #[builder(setter(into, strip_option), default)]
10491    pub ref_pin: Option<&'a str>,
10492    /// If set, error out if the ref string is not of the provided requireKind.
10493    #[builder(setter(into, strip_option), default)]
10494    pub require_kind: Option<ModuleSourceKind>,
10495}
10496#[derive(Builder, Debug, PartialEq)]
10497pub struct QuerySecretOpts<'a> {
10498    /// 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.
10499    /// 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.
10500    /// If not set, the cache key for the secret will be derived from its plaintext value as looked up when the secret is constructed.
10501    #[builder(setter(into, strip_option), default)]
10502    pub cache_key: Option<&'a str>,
10503}
10504impl Query {
10505    /// initialize an address to load directories, containers, secrets or other object types.
10506    pub fn address(&self, value: impl Into<String>) -> Address {
10507        let mut query = self.selection.select("address");
10508        query = query.arg("value", value.into());
10509        Address {
10510            proc: self.proc.clone(),
10511            selection: query,
10512            graphql_client: self.graphql_client.clone(),
10513        }
10514    }
10515    /// Constructs a cache volume for a given cache key.
10516    ///
10517    /// # Arguments
10518    ///
10519    /// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
10520    pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
10521        let mut query = self.selection.select("cacheVolume");
10522        query = query.arg("key", key.into());
10523        CacheVolume {
10524            proc: self.proc.clone(),
10525            selection: query,
10526            graphql_client: self.graphql_client.clone(),
10527        }
10528    }
10529    /// Dagger Cloud configuration and state
10530    pub fn cloud(&self) -> Cloud {
10531        let query = self.selection.select("cloud");
10532        Cloud {
10533            proc: self.proc.clone(),
10534            selection: query,
10535            graphql_client: self.graphql_client.clone(),
10536        }
10537    }
10538    /// Creates a scratch container, with no image or metadata.
10539    /// To pull an image, follow up with the "from" function.
10540    ///
10541    /// # Arguments
10542    ///
10543    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10544    pub fn container(&self) -> Container {
10545        let query = self.selection.select("container");
10546        Container {
10547            proc: self.proc.clone(),
10548            selection: query,
10549            graphql_client: self.graphql_client.clone(),
10550        }
10551    }
10552    /// Creates a scratch container, with no image or metadata.
10553    /// To pull an image, follow up with the "from" function.
10554    ///
10555    /// # Arguments
10556    ///
10557    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10558    pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
10559        let mut query = self.selection.select("container");
10560        if let Some(platform) = opts.platform {
10561            query = query.arg("platform", platform);
10562        }
10563        Container {
10564            proc: self.proc.clone(),
10565            selection: query,
10566            graphql_client: self.graphql_client.clone(),
10567        }
10568    }
10569    /// Returns the current environment
10570    /// 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.
10571    /// 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.
10572    pub fn current_env(&self) -> Env {
10573        let query = self.selection.select("currentEnv");
10574        Env {
10575            proc: self.proc.clone(),
10576            selection: query,
10577            graphql_client: self.graphql_client.clone(),
10578        }
10579    }
10580    /// The FunctionCall context that the SDK caller is currently executing in.
10581    /// If the caller is not currently executing in a function, this will return an error.
10582    pub fn current_function_call(&self) -> FunctionCall {
10583        let query = self.selection.select("currentFunctionCall");
10584        FunctionCall {
10585            proc: self.proc.clone(),
10586            selection: query,
10587            graphql_client: self.graphql_client.clone(),
10588        }
10589    }
10590    /// The module currently being served in the session, if any.
10591    pub fn current_module(&self) -> CurrentModule {
10592        let query = self.selection.select("currentModule");
10593        CurrentModule {
10594            proc: self.proc.clone(),
10595            selection: query,
10596            graphql_client: self.graphql_client.clone(),
10597        }
10598    }
10599    /// The TypeDef representations of the objects currently being served in the session.
10600    pub fn current_type_defs(&self) -> Vec<TypeDef> {
10601        let query = self.selection.select("currentTypeDefs");
10602        vec![TypeDef {
10603            proc: self.proc.clone(),
10604            selection: query,
10605            graphql_client: self.graphql_client.clone(),
10606        }]
10607    }
10608    /// The default platform of the engine.
10609    pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
10610        let query = self.selection.select("defaultPlatform");
10611        query.execute(self.graphql_client.clone()).await
10612    }
10613    /// Creates an empty directory.
10614    pub fn directory(&self) -> Directory {
10615        let query = self.selection.select("directory");
10616        Directory {
10617            proc: self.proc.clone(),
10618            selection: query,
10619            graphql_client: self.graphql_client.clone(),
10620        }
10621    }
10622    /// The Dagger engine container configuration and state
10623    pub fn engine(&self) -> Engine {
10624        let query = self.selection.select("engine");
10625        Engine {
10626            proc: self.proc.clone(),
10627            selection: query,
10628            graphql_client: self.graphql_client.clone(),
10629        }
10630    }
10631    /// Initializes a new environment
10632    ///
10633    /// # Arguments
10634    ///
10635    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10636    pub fn env(&self) -> Env {
10637        let query = self.selection.select("env");
10638        Env {
10639            proc: self.proc.clone(),
10640            selection: query,
10641            graphql_client: self.graphql_client.clone(),
10642        }
10643    }
10644    /// Initializes a new environment
10645    ///
10646    /// # Arguments
10647    ///
10648    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10649    pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
10650        let mut query = self.selection.select("env");
10651        if let Some(privileged) = opts.privileged {
10652            query = query.arg("privileged", privileged);
10653        }
10654        if let Some(writable) = opts.writable {
10655            query = query.arg("writable", writable);
10656        }
10657        Env {
10658            proc: self.proc.clone(),
10659            selection: query,
10660            graphql_client: self.graphql_client.clone(),
10661        }
10662    }
10663    /// Initialize an environment file
10664    ///
10665    /// # Arguments
10666    ///
10667    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10668    pub fn env_file(&self) -> EnvFile {
10669        let query = self.selection.select("envFile");
10670        EnvFile {
10671            proc: self.proc.clone(),
10672            selection: query,
10673            graphql_client: self.graphql_client.clone(),
10674        }
10675    }
10676    /// Initialize an environment file
10677    ///
10678    /// # Arguments
10679    ///
10680    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10681    pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
10682        let mut query = self.selection.select("envFile");
10683        if let Some(expand) = opts.expand {
10684            query = query.arg("expand", expand);
10685        }
10686        EnvFile {
10687            proc: self.proc.clone(),
10688            selection: query,
10689            graphql_client: self.graphql_client.clone(),
10690        }
10691    }
10692    /// Create a new error.
10693    ///
10694    /// # Arguments
10695    ///
10696    /// * `message` - A brief description of the error.
10697    pub fn error(&self, message: impl Into<String>) -> Error {
10698        let mut query = self.selection.select("error");
10699        query = query.arg("message", message.into());
10700        Error {
10701            proc: self.proc.clone(),
10702            selection: query,
10703            graphql_client: self.graphql_client.clone(),
10704        }
10705    }
10706    /// Creates a file with the specified contents.
10707    ///
10708    /// # Arguments
10709    ///
10710    /// * `name` - Name of the new file. Example: "foo.txt"
10711    /// * `contents` - Contents of the new file. Example: "Hello world!"
10712    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10713    pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
10714        let mut query = self.selection.select("file");
10715        query = query.arg("name", name.into());
10716        query = query.arg("contents", contents.into());
10717        File {
10718            proc: self.proc.clone(),
10719            selection: query,
10720            graphql_client: self.graphql_client.clone(),
10721        }
10722    }
10723    /// Creates a file with the specified contents.
10724    ///
10725    /// # Arguments
10726    ///
10727    /// * `name` - Name of the new file. Example: "foo.txt"
10728    /// * `contents` - Contents of the new file. Example: "Hello world!"
10729    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10730    pub fn file_opts(
10731        &self,
10732        name: impl Into<String>,
10733        contents: impl Into<String>,
10734        opts: QueryFileOpts,
10735    ) -> File {
10736        let mut query = self.selection.select("file");
10737        query = query.arg("name", name.into());
10738        query = query.arg("contents", contents.into());
10739        if let Some(permissions) = opts.permissions {
10740            query = query.arg("permissions", permissions);
10741        }
10742        File {
10743            proc: self.proc.clone(),
10744            selection: query,
10745            graphql_client: self.graphql_client.clone(),
10746        }
10747    }
10748    /// Creates a function.
10749    ///
10750    /// # Arguments
10751    ///
10752    /// * `name` - Name of the function, in its original format from the implementation language.
10753    /// * `return_type` - Return type of the function.
10754    pub fn function(
10755        &self,
10756        name: impl Into<String>,
10757        return_type: impl IntoID<TypeDefId>,
10758    ) -> Function {
10759        let mut query = self.selection.select("function");
10760        query = query.arg("name", name.into());
10761        query = query.arg_lazy(
10762            "returnType",
10763            Box::new(move || {
10764                let return_type = return_type.clone();
10765                Box::pin(async move { return_type.into_id().await.unwrap().quote() })
10766            }),
10767        );
10768        Function {
10769            proc: self.proc.clone(),
10770            selection: query,
10771            graphql_client: self.graphql_client.clone(),
10772        }
10773    }
10774    /// Create a code generation result, given a directory containing the generated code.
10775    pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
10776        let mut query = self.selection.select("generatedCode");
10777        query = query.arg_lazy(
10778            "code",
10779            Box::new(move || {
10780                let code = code.clone();
10781                Box::pin(async move { code.into_id().await.unwrap().quote() })
10782            }),
10783        );
10784        GeneratedCode {
10785            proc: self.proc.clone(),
10786            selection: query,
10787            graphql_client: self.graphql_client.clone(),
10788        }
10789    }
10790    /// Queries a Git repository.
10791    ///
10792    /// # Arguments
10793    ///
10794    /// * `url` - URL of the git repository.
10795    ///
10796    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
10797    ///
10798    /// Suffix ".git" is optional.
10799    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10800    pub fn git(&self, url: impl Into<String>) -> GitRepository {
10801        let mut query = self.selection.select("git");
10802        query = query.arg("url", url.into());
10803        GitRepository {
10804            proc: self.proc.clone(),
10805            selection: query,
10806            graphql_client: self.graphql_client.clone(),
10807        }
10808    }
10809    /// Queries a Git repository.
10810    ///
10811    /// # Arguments
10812    ///
10813    /// * `url` - URL of the git repository.
10814    ///
10815    /// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
10816    ///
10817    /// Suffix ".git" is optional.
10818    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10819    pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
10820        let mut query = self.selection.select("git");
10821        query = query.arg("url", url.into());
10822        if let Some(keep_git_dir) = opts.keep_git_dir {
10823            query = query.arg("keepGitDir", keep_git_dir);
10824        }
10825        if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
10826            query = query.arg("sshKnownHosts", ssh_known_hosts);
10827        }
10828        if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
10829            query = query.arg("sshAuthSocket", ssh_auth_socket);
10830        }
10831        if let Some(http_auth_username) = opts.http_auth_username {
10832            query = query.arg("httpAuthUsername", http_auth_username);
10833        }
10834        if let Some(http_auth_token) = opts.http_auth_token {
10835            query = query.arg("httpAuthToken", http_auth_token);
10836        }
10837        if let Some(http_auth_header) = opts.http_auth_header {
10838            query = query.arg("httpAuthHeader", http_auth_header);
10839        }
10840        if let Some(experimental_service_host) = opts.experimental_service_host {
10841            query = query.arg("experimentalServiceHost", experimental_service_host);
10842        }
10843        GitRepository {
10844            proc: self.proc.clone(),
10845            selection: query,
10846            graphql_client: self.graphql_client.clone(),
10847        }
10848    }
10849    /// Queries the host environment.
10850    pub fn host(&self) -> Host {
10851        let query = self.selection.select("host");
10852        Host {
10853            proc: self.proc.clone(),
10854            selection: query,
10855            graphql_client: self.graphql_client.clone(),
10856        }
10857    }
10858    /// Returns a file containing an http remote url content.
10859    ///
10860    /// # Arguments
10861    ///
10862    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
10863    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10864    pub fn http(&self, url: impl Into<String>) -> File {
10865        let mut query = self.selection.select("http");
10866        query = query.arg("url", url.into());
10867        File {
10868            proc: self.proc.clone(),
10869            selection: query,
10870            graphql_client: self.graphql_client.clone(),
10871        }
10872    }
10873    /// Returns a file containing an http remote url content.
10874    ///
10875    /// # Arguments
10876    ///
10877    /// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
10878    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10879    pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
10880        let mut query = self.selection.select("http");
10881        query = query.arg("url", url.into());
10882        if let Some(name) = opts.name {
10883            query = query.arg("name", name);
10884        }
10885        if let Some(permissions) = opts.permissions {
10886            query = query.arg("permissions", permissions);
10887        }
10888        if let Some(auth_header) = opts.auth_header {
10889            query = query.arg("authHeader", auth_header);
10890        }
10891        if let Some(experimental_service_host) = opts.experimental_service_host {
10892            query = query.arg("experimentalServiceHost", experimental_service_host);
10893        }
10894        File {
10895            proc: self.proc.clone(),
10896            selection: query,
10897            graphql_client: self.graphql_client.clone(),
10898        }
10899    }
10900    /// Initialize a JSON value
10901    pub fn json(&self) -> JsonValue {
10902        let query = self.selection.select("json");
10903        JsonValue {
10904            proc: self.proc.clone(),
10905            selection: query,
10906            graphql_client: self.graphql_client.clone(),
10907        }
10908    }
10909    /// Initialize a Large Language Model (LLM)
10910    ///
10911    /// # Arguments
10912    ///
10913    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10914    pub fn llm(&self) -> Llm {
10915        let query = self.selection.select("llm");
10916        Llm {
10917            proc: self.proc.clone(),
10918            selection: query,
10919            graphql_client: self.graphql_client.clone(),
10920        }
10921    }
10922    /// Initialize a Large Language Model (LLM)
10923    ///
10924    /// # Arguments
10925    ///
10926    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
10927    pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
10928        let mut query = self.selection.select("llm");
10929        if let Some(model) = opts.model {
10930            query = query.arg("model", model);
10931        }
10932        if let Some(max_api_calls) = opts.max_api_calls {
10933            query = query.arg("maxAPICalls", max_api_calls);
10934        }
10935        Llm {
10936            proc: self.proc.clone(),
10937            selection: query,
10938            graphql_client: self.graphql_client.clone(),
10939        }
10940    }
10941    /// Load a Address from its ID.
10942    pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
10943        let mut query = self.selection.select("loadAddressFromID");
10944        query = query.arg_lazy(
10945            "id",
10946            Box::new(move || {
10947                let id = id.clone();
10948                Box::pin(async move { id.into_id().await.unwrap().quote() })
10949            }),
10950        );
10951        Address {
10952            proc: self.proc.clone(),
10953            selection: query,
10954            graphql_client: self.graphql_client.clone(),
10955        }
10956    }
10957    /// Load a Binding from its ID.
10958    pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
10959        let mut query = self.selection.select("loadBindingFromID");
10960        query = query.arg_lazy(
10961            "id",
10962            Box::new(move || {
10963                let id = id.clone();
10964                Box::pin(async move { id.into_id().await.unwrap().quote() })
10965            }),
10966        );
10967        Binding {
10968            proc: self.proc.clone(),
10969            selection: query,
10970            graphql_client: self.graphql_client.clone(),
10971        }
10972    }
10973    /// Load a CacheVolume from its ID.
10974    pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
10975        let mut query = self.selection.select("loadCacheVolumeFromID");
10976        query = query.arg_lazy(
10977            "id",
10978            Box::new(move || {
10979                let id = id.clone();
10980                Box::pin(async move { id.into_id().await.unwrap().quote() })
10981            }),
10982        );
10983        CacheVolume {
10984            proc: self.proc.clone(),
10985            selection: query,
10986            graphql_client: self.graphql_client.clone(),
10987        }
10988    }
10989    /// Load a Changeset from its ID.
10990    pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
10991        let mut query = self.selection.select("loadChangesetFromID");
10992        query = query.arg_lazy(
10993            "id",
10994            Box::new(move || {
10995                let id = id.clone();
10996                Box::pin(async move { id.into_id().await.unwrap().quote() })
10997            }),
10998        );
10999        Changeset {
11000            proc: self.proc.clone(),
11001            selection: query,
11002            graphql_client: self.graphql_client.clone(),
11003        }
11004    }
11005    /// Load a Cloud from its ID.
11006    pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
11007        let mut query = self.selection.select("loadCloudFromID");
11008        query = query.arg_lazy(
11009            "id",
11010            Box::new(move || {
11011                let id = id.clone();
11012                Box::pin(async move { id.into_id().await.unwrap().quote() })
11013            }),
11014        );
11015        Cloud {
11016            proc: self.proc.clone(),
11017            selection: query,
11018            graphql_client: self.graphql_client.clone(),
11019        }
11020    }
11021    /// Load a Container from its ID.
11022    pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
11023        let mut query = self.selection.select("loadContainerFromID");
11024        query = query.arg_lazy(
11025            "id",
11026            Box::new(move || {
11027                let id = id.clone();
11028                Box::pin(async move { id.into_id().await.unwrap().quote() })
11029            }),
11030        );
11031        Container {
11032            proc: self.proc.clone(),
11033            selection: query,
11034            graphql_client: self.graphql_client.clone(),
11035        }
11036    }
11037    /// Load a CurrentModule from its ID.
11038    pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
11039        let mut query = self.selection.select("loadCurrentModuleFromID");
11040        query = query.arg_lazy(
11041            "id",
11042            Box::new(move || {
11043                let id = id.clone();
11044                Box::pin(async move { id.into_id().await.unwrap().quote() })
11045            }),
11046        );
11047        CurrentModule {
11048            proc: self.proc.clone(),
11049            selection: query,
11050            graphql_client: self.graphql_client.clone(),
11051        }
11052    }
11053    /// Load a Directory from its ID.
11054    pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
11055        let mut query = self.selection.select("loadDirectoryFromID");
11056        query = query.arg_lazy(
11057            "id",
11058            Box::new(move || {
11059                let id = id.clone();
11060                Box::pin(async move { id.into_id().await.unwrap().quote() })
11061            }),
11062        );
11063        Directory {
11064            proc: self.proc.clone(),
11065            selection: query,
11066            graphql_client: self.graphql_client.clone(),
11067        }
11068    }
11069    /// Load a EngineCacheEntry from its ID.
11070    pub fn load_engine_cache_entry_from_id(
11071        &self,
11072        id: impl IntoID<EngineCacheEntryId>,
11073    ) -> EngineCacheEntry {
11074        let mut query = self.selection.select("loadEngineCacheEntryFromID");
11075        query = query.arg_lazy(
11076            "id",
11077            Box::new(move || {
11078                let id = id.clone();
11079                Box::pin(async move { id.into_id().await.unwrap().quote() })
11080            }),
11081        );
11082        EngineCacheEntry {
11083            proc: self.proc.clone(),
11084            selection: query,
11085            graphql_client: self.graphql_client.clone(),
11086        }
11087    }
11088    /// Load a EngineCacheEntrySet from its ID.
11089    pub fn load_engine_cache_entry_set_from_id(
11090        &self,
11091        id: impl IntoID<EngineCacheEntrySetId>,
11092    ) -> EngineCacheEntrySet {
11093        let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
11094        query = query.arg_lazy(
11095            "id",
11096            Box::new(move || {
11097                let id = id.clone();
11098                Box::pin(async move { id.into_id().await.unwrap().quote() })
11099            }),
11100        );
11101        EngineCacheEntrySet {
11102            proc: self.proc.clone(),
11103            selection: query,
11104            graphql_client: self.graphql_client.clone(),
11105        }
11106    }
11107    /// Load a EngineCache from its ID.
11108    pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
11109        let mut query = self.selection.select("loadEngineCacheFromID");
11110        query = query.arg_lazy(
11111            "id",
11112            Box::new(move || {
11113                let id = id.clone();
11114                Box::pin(async move { id.into_id().await.unwrap().quote() })
11115            }),
11116        );
11117        EngineCache {
11118            proc: self.proc.clone(),
11119            selection: query,
11120            graphql_client: self.graphql_client.clone(),
11121        }
11122    }
11123    /// Load a Engine from its ID.
11124    pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
11125        let mut query = self.selection.select("loadEngineFromID");
11126        query = query.arg_lazy(
11127            "id",
11128            Box::new(move || {
11129                let id = id.clone();
11130                Box::pin(async move { id.into_id().await.unwrap().quote() })
11131            }),
11132        );
11133        Engine {
11134            proc: self.proc.clone(),
11135            selection: query,
11136            graphql_client: self.graphql_client.clone(),
11137        }
11138    }
11139    /// Load a EnumTypeDef from its ID.
11140    pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
11141        let mut query = self.selection.select("loadEnumTypeDefFromID");
11142        query = query.arg_lazy(
11143            "id",
11144            Box::new(move || {
11145                let id = id.clone();
11146                Box::pin(async move { id.into_id().await.unwrap().quote() })
11147            }),
11148        );
11149        EnumTypeDef {
11150            proc: self.proc.clone(),
11151            selection: query,
11152            graphql_client: self.graphql_client.clone(),
11153        }
11154    }
11155    /// Load a EnumValueTypeDef from its ID.
11156    pub fn load_enum_value_type_def_from_id(
11157        &self,
11158        id: impl IntoID<EnumValueTypeDefId>,
11159    ) -> EnumValueTypeDef {
11160        let mut query = self.selection.select("loadEnumValueTypeDefFromID");
11161        query = query.arg_lazy(
11162            "id",
11163            Box::new(move || {
11164                let id = id.clone();
11165                Box::pin(async move { id.into_id().await.unwrap().quote() })
11166            }),
11167        );
11168        EnumValueTypeDef {
11169            proc: self.proc.clone(),
11170            selection: query,
11171            graphql_client: self.graphql_client.clone(),
11172        }
11173    }
11174    /// Load a EnvFile from its ID.
11175    pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
11176        let mut query = self.selection.select("loadEnvFileFromID");
11177        query = query.arg_lazy(
11178            "id",
11179            Box::new(move || {
11180                let id = id.clone();
11181                Box::pin(async move { id.into_id().await.unwrap().quote() })
11182            }),
11183        );
11184        EnvFile {
11185            proc: self.proc.clone(),
11186            selection: query,
11187            graphql_client: self.graphql_client.clone(),
11188        }
11189    }
11190    /// Load a Env from its ID.
11191    pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
11192        let mut query = self.selection.select("loadEnvFromID");
11193        query = query.arg_lazy(
11194            "id",
11195            Box::new(move || {
11196                let id = id.clone();
11197                Box::pin(async move { id.into_id().await.unwrap().quote() })
11198            }),
11199        );
11200        Env {
11201            proc: self.proc.clone(),
11202            selection: query,
11203            graphql_client: self.graphql_client.clone(),
11204        }
11205    }
11206    /// Load a EnvVariable from its ID.
11207    pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
11208        let mut query = self.selection.select("loadEnvVariableFromID");
11209        query = query.arg_lazy(
11210            "id",
11211            Box::new(move || {
11212                let id = id.clone();
11213                Box::pin(async move { id.into_id().await.unwrap().quote() })
11214            }),
11215        );
11216        EnvVariable {
11217            proc: self.proc.clone(),
11218            selection: query,
11219            graphql_client: self.graphql_client.clone(),
11220        }
11221    }
11222    /// Load a Error from its ID.
11223    pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
11224        let mut query = self.selection.select("loadErrorFromID");
11225        query = query.arg_lazy(
11226            "id",
11227            Box::new(move || {
11228                let id = id.clone();
11229                Box::pin(async move { id.into_id().await.unwrap().quote() })
11230            }),
11231        );
11232        Error {
11233            proc: self.proc.clone(),
11234            selection: query,
11235            graphql_client: self.graphql_client.clone(),
11236        }
11237    }
11238    /// Load a ErrorValue from its ID.
11239    pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
11240        let mut query = self.selection.select("loadErrorValueFromID");
11241        query = query.arg_lazy(
11242            "id",
11243            Box::new(move || {
11244                let id = id.clone();
11245                Box::pin(async move { id.into_id().await.unwrap().quote() })
11246            }),
11247        );
11248        ErrorValue {
11249            proc: self.proc.clone(),
11250            selection: query,
11251            graphql_client: self.graphql_client.clone(),
11252        }
11253    }
11254    /// Load a FieldTypeDef from its ID.
11255    pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
11256        let mut query = self.selection.select("loadFieldTypeDefFromID");
11257        query = query.arg_lazy(
11258            "id",
11259            Box::new(move || {
11260                let id = id.clone();
11261                Box::pin(async move { id.into_id().await.unwrap().quote() })
11262            }),
11263        );
11264        FieldTypeDef {
11265            proc: self.proc.clone(),
11266            selection: query,
11267            graphql_client: self.graphql_client.clone(),
11268        }
11269    }
11270    /// Load a File from its ID.
11271    pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
11272        let mut query = self.selection.select("loadFileFromID");
11273        query = query.arg_lazy(
11274            "id",
11275            Box::new(move || {
11276                let id = id.clone();
11277                Box::pin(async move { id.into_id().await.unwrap().quote() })
11278            }),
11279        );
11280        File {
11281            proc: self.proc.clone(),
11282            selection: query,
11283            graphql_client: self.graphql_client.clone(),
11284        }
11285    }
11286    /// Load a FunctionArg from its ID.
11287    pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
11288        let mut query = self.selection.select("loadFunctionArgFromID");
11289        query = query.arg_lazy(
11290            "id",
11291            Box::new(move || {
11292                let id = id.clone();
11293                Box::pin(async move { id.into_id().await.unwrap().quote() })
11294            }),
11295        );
11296        FunctionArg {
11297            proc: self.proc.clone(),
11298            selection: query,
11299            graphql_client: self.graphql_client.clone(),
11300        }
11301    }
11302    /// Load a FunctionCallArgValue from its ID.
11303    pub fn load_function_call_arg_value_from_id(
11304        &self,
11305        id: impl IntoID<FunctionCallArgValueId>,
11306    ) -> FunctionCallArgValue {
11307        let mut query = self.selection.select("loadFunctionCallArgValueFromID");
11308        query = query.arg_lazy(
11309            "id",
11310            Box::new(move || {
11311                let id = id.clone();
11312                Box::pin(async move { id.into_id().await.unwrap().quote() })
11313            }),
11314        );
11315        FunctionCallArgValue {
11316            proc: self.proc.clone(),
11317            selection: query,
11318            graphql_client: self.graphql_client.clone(),
11319        }
11320    }
11321    /// Load a FunctionCall from its ID.
11322    pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
11323        let mut query = self.selection.select("loadFunctionCallFromID");
11324        query = query.arg_lazy(
11325            "id",
11326            Box::new(move || {
11327                let id = id.clone();
11328                Box::pin(async move { id.into_id().await.unwrap().quote() })
11329            }),
11330        );
11331        FunctionCall {
11332            proc: self.proc.clone(),
11333            selection: query,
11334            graphql_client: self.graphql_client.clone(),
11335        }
11336    }
11337    /// Load a Function from its ID.
11338    pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
11339        let mut query = self.selection.select("loadFunctionFromID");
11340        query = query.arg_lazy(
11341            "id",
11342            Box::new(move || {
11343                let id = id.clone();
11344                Box::pin(async move { id.into_id().await.unwrap().quote() })
11345            }),
11346        );
11347        Function {
11348            proc: self.proc.clone(),
11349            selection: query,
11350            graphql_client: self.graphql_client.clone(),
11351        }
11352    }
11353    /// Load a GeneratedCode from its ID.
11354    pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
11355        let mut query = self.selection.select("loadGeneratedCodeFromID");
11356        query = query.arg_lazy(
11357            "id",
11358            Box::new(move || {
11359                let id = id.clone();
11360                Box::pin(async move { id.into_id().await.unwrap().quote() })
11361            }),
11362        );
11363        GeneratedCode {
11364            proc: self.proc.clone(),
11365            selection: query,
11366            graphql_client: self.graphql_client.clone(),
11367        }
11368    }
11369    /// Load a GitRef from its ID.
11370    pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
11371        let mut query = self.selection.select("loadGitRefFromID");
11372        query = query.arg_lazy(
11373            "id",
11374            Box::new(move || {
11375                let id = id.clone();
11376                Box::pin(async move { id.into_id().await.unwrap().quote() })
11377            }),
11378        );
11379        GitRef {
11380            proc: self.proc.clone(),
11381            selection: query,
11382            graphql_client: self.graphql_client.clone(),
11383        }
11384    }
11385    /// Load a GitRepository from its ID.
11386    pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
11387        let mut query = self.selection.select("loadGitRepositoryFromID");
11388        query = query.arg_lazy(
11389            "id",
11390            Box::new(move || {
11391                let id = id.clone();
11392                Box::pin(async move { id.into_id().await.unwrap().quote() })
11393            }),
11394        );
11395        GitRepository {
11396            proc: self.proc.clone(),
11397            selection: query,
11398            graphql_client: self.graphql_client.clone(),
11399        }
11400    }
11401    /// Load a Host from its ID.
11402    pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
11403        let mut query = self.selection.select("loadHostFromID");
11404        query = query.arg_lazy(
11405            "id",
11406            Box::new(move || {
11407                let id = id.clone();
11408                Box::pin(async move { id.into_id().await.unwrap().quote() })
11409            }),
11410        );
11411        Host {
11412            proc: self.proc.clone(),
11413            selection: query,
11414            graphql_client: self.graphql_client.clone(),
11415        }
11416    }
11417    /// Load a InputTypeDef from its ID.
11418    pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
11419        let mut query = self.selection.select("loadInputTypeDefFromID");
11420        query = query.arg_lazy(
11421            "id",
11422            Box::new(move || {
11423                let id = id.clone();
11424                Box::pin(async move { id.into_id().await.unwrap().quote() })
11425            }),
11426        );
11427        InputTypeDef {
11428            proc: self.proc.clone(),
11429            selection: query,
11430            graphql_client: self.graphql_client.clone(),
11431        }
11432    }
11433    /// Load a InterfaceTypeDef from its ID.
11434    pub fn load_interface_type_def_from_id(
11435        &self,
11436        id: impl IntoID<InterfaceTypeDefId>,
11437    ) -> InterfaceTypeDef {
11438        let mut query = self.selection.select("loadInterfaceTypeDefFromID");
11439        query = query.arg_lazy(
11440            "id",
11441            Box::new(move || {
11442                let id = id.clone();
11443                Box::pin(async move { id.into_id().await.unwrap().quote() })
11444            }),
11445        );
11446        InterfaceTypeDef {
11447            proc: self.proc.clone(),
11448            selection: query,
11449            graphql_client: self.graphql_client.clone(),
11450        }
11451    }
11452    /// Load a JSONValue from its ID.
11453    pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
11454        let mut query = self.selection.select("loadJSONValueFromID");
11455        query = query.arg_lazy(
11456            "id",
11457            Box::new(move || {
11458                let id = id.clone();
11459                Box::pin(async move { id.into_id().await.unwrap().quote() })
11460            }),
11461        );
11462        JsonValue {
11463            proc: self.proc.clone(),
11464            selection: query,
11465            graphql_client: self.graphql_client.clone(),
11466        }
11467    }
11468    /// Load a LLM from its ID.
11469    pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
11470        let mut query = self.selection.select("loadLLMFromID");
11471        query = query.arg_lazy(
11472            "id",
11473            Box::new(move || {
11474                let id = id.clone();
11475                Box::pin(async move { id.into_id().await.unwrap().quote() })
11476            }),
11477        );
11478        Llm {
11479            proc: self.proc.clone(),
11480            selection: query,
11481            graphql_client: self.graphql_client.clone(),
11482        }
11483    }
11484    /// Load a LLMTokenUsage from its ID.
11485    pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
11486        let mut query = self.selection.select("loadLLMTokenUsageFromID");
11487        query = query.arg_lazy(
11488            "id",
11489            Box::new(move || {
11490                let id = id.clone();
11491                Box::pin(async move { id.into_id().await.unwrap().quote() })
11492            }),
11493        );
11494        LlmTokenUsage {
11495            proc: self.proc.clone(),
11496            selection: query,
11497            graphql_client: self.graphql_client.clone(),
11498        }
11499    }
11500    /// Load a Label from its ID.
11501    pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
11502        let mut query = self.selection.select("loadLabelFromID");
11503        query = query.arg_lazy(
11504            "id",
11505            Box::new(move || {
11506                let id = id.clone();
11507                Box::pin(async move { id.into_id().await.unwrap().quote() })
11508            }),
11509        );
11510        Label {
11511            proc: self.proc.clone(),
11512            selection: query,
11513            graphql_client: self.graphql_client.clone(),
11514        }
11515    }
11516    /// Load a ListTypeDef from its ID.
11517    pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
11518        let mut query = self.selection.select("loadListTypeDefFromID");
11519        query = query.arg_lazy(
11520            "id",
11521            Box::new(move || {
11522                let id = id.clone();
11523                Box::pin(async move { id.into_id().await.unwrap().quote() })
11524            }),
11525        );
11526        ListTypeDef {
11527            proc: self.proc.clone(),
11528            selection: query,
11529            graphql_client: self.graphql_client.clone(),
11530        }
11531    }
11532    /// Load a ModuleConfigClient from its ID.
11533    pub fn load_module_config_client_from_id(
11534        &self,
11535        id: impl IntoID<ModuleConfigClientId>,
11536    ) -> ModuleConfigClient {
11537        let mut query = self.selection.select("loadModuleConfigClientFromID");
11538        query = query.arg_lazy(
11539            "id",
11540            Box::new(move || {
11541                let id = id.clone();
11542                Box::pin(async move { id.into_id().await.unwrap().quote() })
11543            }),
11544        );
11545        ModuleConfigClient {
11546            proc: self.proc.clone(),
11547            selection: query,
11548            graphql_client: self.graphql_client.clone(),
11549        }
11550    }
11551    /// Load a Module from its ID.
11552    pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
11553        let mut query = self.selection.select("loadModuleFromID");
11554        query = query.arg_lazy(
11555            "id",
11556            Box::new(move || {
11557                let id = id.clone();
11558                Box::pin(async move { id.into_id().await.unwrap().quote() })
11559            }),
11560        );
11561        Module {
11562            proc: self.proc.clone(),
11563            selection: query,
11564            graphql_client: self.graphql_client.clone(),
11565        }
11566    }
11567    /// Load a ModuleSource from its ID.
11568    pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
11569        let mut query = self.selection.select("loadModuleSourceFromID");
11570        query = query.arg_lazy(
11571            "id",
11572            Box::new(move || {
11573                let id = id.clone();
11574                Box::pin(async move { id.into_id().await.unwrap().quote() })
11575            }),
11576        );
11577        ModuleSource {
11578            proc: self.proc.clone(),
11579            selection: query,
11580            graphql_client: self.graphql_client.clone(),
11581        }
11582    }
11583    /// Load a ObjectTypeDef from its ID.
11584    pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
11585        let mut query = self.selection.select("loadObjectTypeDefFromID");
11586        query = query.arg_lazy(
11587            "id",
11588            Box::new(move || {
11589                let id = id.clone();
11590                Box::pin(async move { id.into_id().await.unwrap().quote() })
11591            }),
11592        );
11593        ObjectTypeDef {
11594            proc: self.proc.clone(),
11595            selection: query,
11596            graphql_client: self.graphql_client.clone(),
11597        }
11598    }
11599    /// Load a Port from its ID.
11600    pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
11601        let mut query = self.selection.select("loadPortFromID");
11602        query = query.arg_lazy(
11603            "id",
11604            Box::new(move || {
11605                let id = id.clone();
11606                Box::pin(async move { id.into_id().await.unwrap().quote() })
11607            }),
11608        );
11609        Port {
11610            proc: self.proc.clone(),
11611            selection: query,
11612            graphql_client: self.graphql_client.clone(),
11613        }
11614    }
11615    /// Load a SDKConfig from its ID.
11616    pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
11617        let mut query = self.selection.select("loadSDKConfigFromID");
11618        query = query.arg_lazy(
11619            "id",
11620            Box::new(move || {
11621                let id = id.clone();
11622                Box::pin(async move { id.into_id().await.unwrap().quote() })
11623            }),
11624        );
11625        SdkConfig {
11626            proc: self.proc.clone(),
11627            selection: query,
11628            graphql_client: self.graphql_client.clone(),
11629        }
11630    }
11631    /// Load a ScalarTypeDef from its ID.
11632    pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
11633        let mut query = self.selection.select("loadScalarTypeDefFromID");
11634        query = query.arg_lazy(
11635            "id",
11636            Box::new(move || {
11637                let id = id.clone();
11638                Box::pin(async move { id.into_id().await.unwrap().quote() })
11639            }),
11640        );
11641        ScalarTypeDef {
11642            proc: self.proc.clone(),
11643            selection: query,
11644            graphql_client: self.graphql_client.clone(),
11645        }
11646    }
11647    /// Load a SearchResult from its ID.
11648    pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
11649        let mut query = self.selection.select("loadSearchResultFromID");
11650        query = query.arg_lazy(
11651            "id",
11652            Box::new(move || {
11653                let id = id.clone();
11654                Box::pin(async move { id.into_id().await.unwrap().quote() })
11655            }),
11656        );
11657        SearchResult {
11658            proc: self.proc.clone(),
11659            selection: query,
11660            graphql_client: self.graphql_client.clone(),
11661        }
11662    }
11663    /// Load a SearchSubmatch from its ID.
11664    pub fn load_search_submatch_from_id(
11665        &self,
11666        id: impl IntoID<SearchSubmatchId>,
11667    ) -> SearchSubmatch {
11668        let mut query = self.selection.select("loadSearchSubmatchFromID");
11669        query = query.arg_lazy(
11670            "id",
11671            Box::new(move || {
11672                let id = id.clone();
11673                Box::pin(async move { id.into_id().await.unwrap().quote() })
11674            }),
11675        );
11676        SearchSubmatch {
11677            proc: self.proc.clone(),
11678            selection: query,
11679            graphql_client: self.graphql_client.clone(),
11680        }
11681    }
11682    /// Load a Secret from its ID.
11683    pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
11684        let mut query = self.selection.select("loadSecretFromID");
11685        query = query.arg_lazy(
11686            "id",
11687            Box::new(move || {
11688                let id = id.clone();
11689                Box::pin(async move { id.into_id().await.unwrap().quote() })
11690            }),
11691        );
11692        Secret {
11693            proc: self.proc.clone(),
11694            selection: query,
11695            graphql_client: self.graphql_client.clone(),
11696        }
11697    }
11698    /// Load a Service from its ID.
11699    pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
11700        let mut query = self.selection.select("loadServiceFromID");
11701        query = query.arg_lazy(
11702            "id",
11703            Box::new(move || {
11704                let id = id.clone();
11705                Box::pin(async move { id.into_id().await.unwrap().quote() })
11706            }),
11707        );
11708        Service {
11709            proc: self.proc.clone(),
11710            selection: query,
11711            graphql_client: self.graphql_client.clone(),
11712        }
11713    }
11714    /// Load a Socket from its ID.
11715    pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
11716        let mut query = self.selection.select("loadSocketFromID");
11717        query = query.arg_lazy(
11718            "id",
11719            Box::new(move || {
11720                let id = id.clone();
11721                Box::pin(async move { id.into_id().await.unwrap().quote() })
11722            }),
11723        );
11724        Socket {
11725            proc: self.proc.clone(),
11726            selection: query,
11727            graphql_client: self.graphql_client.clone(),
11728        }
11729    }
11730    /// Load a SourceMap from its ID.
11731    pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
11732        let mut query = self.selection.select("loadSourceMapFromID");
11733        query = query.arg_lazy(
11734            "id",
11735            Box::new(move || {
11736                let id = id.clone();
11737                Box::pin(async move { id.into_id().await.unwrap().quote() })
11738            }),
11739        );
11740        SourceMap {
11741            proc: self.proc.clone(),
11742            selection: query,
11743            graphql_client: self.graphql_client.clone(),
11744        }
11745    }
11746    /// Load a Terminal from its ID.
11747    pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
11748        let mut query = self.selection.select("loadTerminalFromID");
11749        query = query.arg_lazy(
11750            "id",
11751            Box::new(move || {
11752                let id = id.clone();
11753                Box::pin(async move { id.into_id().await.unwrap().quote() })
11754            }),
11755        );
11756        Terminal {
11757            proc: self.proc.clone(),
11758            selection: query,
11759            graphql_client: self.graphql_client.clone(),
11760        }
11761    }
11762    /// Load a TypeDef from its ID.
11763    pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
11764        let mut query = self.selection.select("loadTypeDefFromID");
11765        query = query.arg_lazy(
11766            "id",
11767            Box::new(move || {
11768                let id = id.clone();
11769                Box::pin(async move { id.into_id().await.unwrap().quote() })
11770            }),
11771        );
11772        TypeDef {
11773            proc: self.proc.clone(),
11774            selection: query,
11775            graphql_client: self.graphql_client.clone(),
11776        }
11777    }
11778    /// Create a new module.
11779    pub fn module(&self) -> Module {
11780        let query = self.selection.select("module");
11781        Module {
11782            proc: self.proc.clone(),
11783            selection: query,
11784            graphql_client: self.graphql_client.clone(),
11785        }
11786    }
11787    /// Create a new module source instance from a source ref string
11788    ///
11789    /// # Arguments
11790    ///
11791    /// * `ref_string` - The string ref representation of the module source
11792    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11793    pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
11794        let mut query = self.selection.select("moduleSource");
11795        query = query.arg("refString", ref_string.into());
11796        ModuleSource {
11797            proc: self.proc.clone(),
11798            selection: query,
11799            graphql_client: self.graphql_client.clone(),
11800        }
11801    }
11802    /// Create a new module source instance from a source ref string
11803    ///
11804    /// # Arguments
11805    ///
11806    /// * `ref_string` - The string ref representation of the module source
11807    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11808    pub fn module_source_opts<'a>(
11809        &self,
11810        ref_string: impl Into<String>,
11811        opts: QueryModuleSourceOpts<'a>,
11812    ) -> ModuleSource {
11813        let mut query = self.selection.select("moduleSource");
11814        query = query.arg("refString", ref_string.into());
11815        if let Some(ref_pin) = opts.ref_pin {
11816            query = query.arg("refPin", ref_pin);
11817        }
11818        if let Some(disable_find_up) = opts.disable_find_up {
11819            query = query.arg("disableFindUp", disable_find_up);
11820        }
11821        if let Some(allow_not_exists) = opts.allow_not_exists {
11822            query = query.arg("allowNotExists", allow_not_exists);
11823        }
11824        if let Some(require_kind) = opts.require_kind {
11825            query = query.arg("requireKind", require_kind);
11826        }
11827        ModuleSource {
11828            proc: self.proc.clone(),
11829            selection: query,
11830            graphql_client: self.graphql_client.clone(),
11831        }
11832    }
11833    /// Creates a new secret.
11834    ///
11835    /// # Arguments
11836    ///
11837    /// * `uri` - The URI of the secret store
11838    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11839    pub fn secret(&self, uri: impl Into<String>) -> Secret {
11840        let mut query = self.selection.select("secret");
11841        query = query.arg("uri", uri.into());
11842        Secret {
11843            proc: self.proc.clone(),
11844            selection: query,
11845            graphql_client: self.graphql_client.clone(),
11846        }
11847    }
11848    /// Creates a new secret.
11849    ///
11850    /// # Arguments
11851    ///
11852    /// * `uri` - The URI of the secret store
11853    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
11854    pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
11855        let mut query = self.selection.select("secret");
11856        query = query.arg("uri", uri.into());
11857        if let Some(cache_key) = opts.cache_key {
11858            query = query.arg("cacheKey", cache_key);
11859        }
11860        Secret {
11861            proc: self.proc.clone(),
11862            selection: query,
11863            graphql_client: self.graphql_client.clone(),
11864        }
11865    }
11866    /// Sets a secret given a user defined name to its plaintext and returns the secret.
11867    /// The plaintext value is limited to a size of 128000 bytes.
11868    ///
11869    /// # Arguments
11870    ///
11871    /// * `name` - The user defined name for this secret
11872    /// * `plaintext` - The plaintext of the secret
11873    pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
11874        let mut query = self.selection.select("setSecret");
11875        query = query.arg("name", name.into());
11876        query = query.arg("plaintext", plaintext.into());
11877        Secret {
11878            proc: self.proc.clone(),
11879            selection: query,
11880            graphql_client: self.graphql_client.clone(),
11881        }
11882    }
11883    /// Creates source map metadata.
11884    ///
11885    /// # Arguments
11886    ///
11887    /// * `filename` - The filename from the module source.
11888    /// * `line` - The line number within the filename.
11889    /// * `column` - The column number within the line.
11890    pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
11891        let mut query = self.selection.select("sourceMap");
11892        query = query.arg("filename", filename.into());
11893        query = query.arg("line", line);
11894        query = query.arg("column", column);
11895        SourceMap {
11896            proc: self.proc.clone(),
11897            selection: query,
11898            graphql_client: self.graphql_client.clone(),
11899        }
11900    }
11901    /// Create a new TypeDef.
11902    pub fn type_def(&self) -> TypeDef {
11903        let query = self.selection.select("typeDef");
11904        TypeDef {
11905            proc: self.proc.clone(),
11906            selection: query,
11907            graphql_client: self.graphql_client.clone(),
11908        }
11909    }
11910    /// Get the current Dagger Engine version.
11911    pub async fn version(&self) -> Result<String, DaggerError> {
11912        let query = self.selection.select("version");
11913        query.execute(self.graphql_client.clone()).await
11914    }
11915}
11916#[derive(Clone)]
11917pub struct SdkConfig {
11918    pub proc: Option<Arc<DaggerSessionProc>>,
11919    pub selection: Selection,
11920    pub graphql_client: DynGraphQLClient,
11921}
11922impl SdkConfig {
11923    /// A unique identifier for this SDKConfig.
11924    pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
11925        let query = self.selection.select("id");
11926        query.execute(self.graphql_client.clone()).await
11927    }
11928    /// Source of the SDK. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
11929    pub async fn source(&self) -> Result<String, DaggerError> {
11930        let query = self.selection.select("source");
11931        query.execute(self.graphql_client.clone()).await
11932    }
11933}
11934#[derive(Clone)]
11935pub struct ScalarTypeDef {
11936    pub proc: Option<Arc<DaggerSessionProc>>,
11937    pub selection: Selection,
11938    pub graphql_client: DynGraphQLClient,
11939}
11940impl ScalarTypeDef {
11941    /// A doc string for the scalar, if any.
11942    pub async fn description(&self) -> Result<String, DaggerError> {
11943        let query = self.selection.select("description");
11944        query.execute(self.graphql_client.clone()).await
11945    }
11946    /// A unique identifier for this ScalarTypeDef.
11947    pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
11948        let query = self.selection.select("id");
11949        query.execute(self.graphql_client.clone()).await
11950    }
11951    /// The name of the scalar.
11952    pub async fn name(&self) -> Result<String, DaggerError> {
11953        let query = self.selection.select("name");
11954        query.execute(self.graphql_client.clone()).await
11955    }
11956    /// If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
11957    pub async fn source_module_name(&self) -> Result<String, DaggerError> {
11958        let query = self.selection.select("sourceModuleName");
11959        query.execute(self.graphql_client.clone()).await
11960    }
11961}
11962#[derive(Clone)]
11963pub struct SearchResult {
11964    pub proc: Option<Arc<DaggerSessionProc>>,
11965    pub selection: Selection,
11966    pub graphql_client: DynGraphQLClient,
11967}
11968impl SearchResult {
11969    /// The byte offset of this line within the file.
11970    pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
11971        let query = self.selection.select("absoluteOffset");
11972        query.execute(self.graphql_client.clone()).await
11973    }
11974    /// The path to the file that matched.
11975    pub async fn file_path(&self) -> Result<String, DaggerError> {
11976        let query = self.selection.select("filePath");
11977        query.execute(self.graphql_client.clone()).await
11978    }
11979    /// A unique identifier for this SearchResult.
11980    pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
11981        let query = self.selection.select("id");
11982        query.execute(self.graphql_client.clone()).await
11983    }
11984    /// The first line that matched.
11985    pub async fn line_number(&self) -> Result<isize, DaggerError> {
11986        let query = self.selection.select("lineNumber");
11987        query.execute(self.graphql_client.clone()).await
11988    }
11989    /// The line content that matched.
11990    pub async fn matched_lines(&self) -> Result<String, DaggerError> {
11991        let query = self.selection.select("matchedLines");
11992        query.execute(self.graphql_client.clone()).await
11993    }
11994    /// Sub-match positions and content within the matched lines.
11995    pub fn submatches(&self) -> Vec<SearchSubmatch> {
11996        let query = self.selection.select("submatches");
11997        vec![SearchSubmatch {
11998            proc: self.proc.clone(),
11999            selection: query,
12000            graphql_client: self.graphql_client.clone(),
12001        }]
12002    }
12003}
12004#[derive(Clone)]
12005pub struct SearchSubmatch {
12006    pub proc: Option<Arc<DaggerSessionProc>>,
12007    pub selection: Selection,
12008    pub graphql_client: DynGraphQLClient,
12009}
12010impl SearchSubmatch {
12011    /// The match's end offset within the matched lines.
12012    pub async fn end(&self) -> Result<isize, DaggerError> {
12013        let query = self.selection.select("end");
12014        query.execute(self.graphql_client.clone()).await
12015    }
12016    /// A unique identifier for this SearchSubmatch.
12017    pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
12018        let query = self.selection.select("id");
12019        query.execute(self.graphql_client.clone()).await
12020    }
12021    /// The match's start offset within the matched lines.
12022    pub async fn start(&self) -> Result<isize, DaggerError> {
12023        let query = self.selection.select("start");
12024        query.execute(self.graphql_client.clone()).await
12025    }
12026    /// The matched text.
12027    pub async fn text(&self) -> Result<String, DaggerError> {
12028        let query = self.selection.select("text");
12029        query.execute(self.graphql_client.clone()).await
12030    }
12031}
12032#[derive(Clone)]
12033pub struct Secret {
12034    pub proc: Option<Arc<DaggerSessionProc>>,
12035    pub selection: Selection,
12036    pub graphql_client: DynGraphQLClient,
12037}
12038impl Secret {
12039    /// A unique identifier for this Secret.
12040    pub async fn id(&self) -> Result<SecretId, DaggerError> {
12041        let query = self.selection.select("id");
12042        query.execute(self.graphql_client.clone()).await
12043    }
12044    /// The name of this secret.
12045    pub async fn name(&self) -> Result<String, DaggerError> {
12046        let query = self.selection.select("name");
12047        query.execute(self.graphql_client.clone()).await
12048    }
12049    /// The value of this secret.
12050    pub async fn plaintext(&self) -> Result<String, DaggerError> {
12051        let query = self.selection.select("plaintext");
12052        query.execute(self.graphql_client.clone()).await
12053    }
12054    /// The URI of this secret.
12055    pub async fn uri(&self) -> Result<String, DaggerError> {
12056        let query = self.selection.select("uri");
12057        query.execute(self.graphql_client.clone()).await
12058    }
12059}
12060#[derive(Clone)]
12061pub struct Service {
12062    pub proc: Option<Arc<DaggerSessionProc>>,
12063    pub selection: Selection,
12064    pub graphql_client: DynGraphQLClient,
12065}
12066#[derive(Builder, Debug, PartialEq)]
12067pub struct ServiceEndpointOpts<'a> {
12068    /// The exposed port number for the endpoint
12069    #[builder(setter(into, strip_option), default)]
12070    pub port: Option<isize>,
12071    /// Return a URL with the given scheme, eg. http for http://
12072    #[builder(setter(into, strip_option), default)]
12073    pub scheme: Option<&'a str>,
12074}
12075#[derive(Builder, Debug, PartialEq)]
12076pub struct ServiceStopOpts {
12077    /// Immediately kill the service without waiting for a graceful exit
12078    #[builder(setter(into, strip_option), default)]
12079    pub kill: Option<bool>,
12080}
12081#[derive(Builder, Debug, PartialEq)]
12082pub struct ServiceTerminalOpts<'a> {
12083    #[builder(setter(into, strip_option), default)]
12084    pub cmd: Option<Vec<&'a str>>,
12085}
12086#[derive(Builder, Debug, PartialEq)]
12087pub struct ServiceUpOpts {
12088    /// List of frontend/backend port mappings to forward.
12089    /// Frontend is the port accepting traffic on the host, backend is the service port.
12090    #[builder(setter(into, strip_option), default)]
12091    pub ports: Option<Vec<PortForward>>,
12092    /// Bind each tunnel port to a random port on the host.
12093    #[builder(setter(into, strip_option), default)]
12094    pub random: Option<bool>,
12095}
12096impl Service {
12097    /// Retrieves an endpoint that clients can use to reach this container.
12098    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
12099    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
12100    ///
12101    /// # Arguments
12102    ///
12103    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12104    pub async fn endpoint(&self) -> Result<String, DaggerError> {
12105        let query = self.selection.select("endpoint");
12106        query.execute(self.graphql_client.clone()).await
12107    }
12108    /// Retrieves an endpoint that clients can use to reach this container.
12109    /// If no port is specified, the first exposed port is used. If none exist an error is returned.
12110    /// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
12111    ///
12112    /// # Arguments
12113    ///
12114    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12115    pub async fn endpoint_opts<'a>(
12116        &self,
12117        opts: ServiceEndpointOpts<'a>,
12118    ) -> Result<String, DaggerError> {
12119        let mut query = self.selection.select("endpoint");
12120        if let Some(port) = opts.port {
12121            query = query.arg("port", port);
12122        }
12123        if let Some(scheme) = opts.scheme {
12124            query = query.arg("scheme", scheme);
12125        }
12126        query.execute(self.graphql_client.clone()).await
12127    }
12128    /// Retrieves a hostname which can be used by clients to reach this container.
12129    pub async fn hostname(&self) -> Result<String, DaggerError> {
12130        let query = self.selection.select("hostname");
12131        query.execute(self.graphql_client.clone()).await
12132    }
12133    /// A unique identifier for this Service.
12134    pub async fn id(&self) -> Result<ServiceId, DaggerError> {
12135        let query = self.selection.select("id");
12136        query.execute(self.graphql_client.clone()).await
12137    }
12138    /// Retrieves the list of ports provided by the service.
12139    pub fn ports(&self) -> Vec<Port> {
12140        let query = self.selection.select("ports");
12141        vec![Port {
12142            proc: self.proc.clone(),
12143            selection: query,
12144            graphql_client: self.graphql_client.clone(),
12145        }]
12146    }
12147    /// Start the service and wait for its health checks to succeed.
12148    /// Services bound to a Container do not need to be manually started.
12149    pub async fn start(&self) -> Result<ServiceId, DaggerError> {
12150        let query = self.selection.select("start");
12151        query.execute(self.graphql_client.clone()).await
12152    }
12153    /// Stop the service.
12154    ///
12155    /// # Arguments
12156    ///
12157    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12158    pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
12159        let query = self.selection.select("stop");
12160        query.execute(self.graphql_client.clone()).await
12161    }
12162    /// Stop the service.
12163    ///
12164    /// # Arguments
12165    ///
12166    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12167    pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
12168        let mut query = self.selection.select("stop");
12169        if let Some(kill) = opts.kill {
12170            query = query.arg("kill", kill);
12171        }
12172        query.execute(self.graphql_client.clone()).await
12173    }
12174    /// Forces evaluation of the pipeline in the engine.
12175    pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
12176        let query = self.selection.select("sync");
12177        query.execute(self.graphql_client.clone()).await
12178    }
12179    ///
12180    /// # Arguments
12181    ///
12182    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12183    pub fn terminal(&self) -> Service {
12184        let query = self.selection.select("terminal");
12185        Service {
12186            proc: self.proc.clone(),
12187            selection: query,
12188            graphql_client: self.graphql_client.clone(),
12189        }
12190    }
12191    ///
12192    /// # Arguments
12193    ///
12194    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12195    pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
12196        let mut query = self.selection.select("terminal");
12197        if let Some(cmd) = opts.cmd {
12198            query = query.arg("cmd", cmd);
12199        }
12200        Service {
12201            proc: self.proc.clone(),
12202            selection: query,
12203            graphql_client: self.graphql_client.clone(),
12204        }
12205    }
12206    /// Creates a tunnel that forwards traffic from the caller's network to this service.
12207    ///
12208    /// # Arguments
12209    ///
12210    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12211    pub async fn up(&self) -> Result<Void, DaggerError> {
12212        let query = self.selection.select("up");
12213        query.execute(self.graphql_client.clone()).await
12214    }
12215    /// Creates a tunnel that forwards traffic from the caller's network to this service.
12216    ///
12217    /// # Arguments
12218    ///
12219    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12220    pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
12221        let mut query = self.selection.select("up");
12222        if let Some(ports) = opts.ports {
12223            query = query.arg("ports", ports);
12224        }
12225        if let Some(random) = opts.random {
12226            query = query.arg("random", random);
12227        }
12228        query.execute(self.graphql_client.clone()).await
12229    }
12230    /// Configures a hostname which can be used by clients within the session to reach this container.
12231    ///
12232    /// # Arguments
12233    ///
12234    /// * `hostname` - The hostname to use.
12235    pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
12236        let mut query = self.selection.select("withHostname");
12237        query = query.arg("hostname", hostname.into());
12238        Service {
12239            proc: self.proc.clone(),
12240            selection: query,
12241            graphql_client: self.graphql_client.clone(),
12242        }
12243    }
12244}
12245#[derive(Clone)]
12246pub struct Socket {
12247    pub proc: Option<Arc<DaggerSessionProc>>,
12248    pub selection: Selection,
12249    pub graphql_client: DynGraphQLClient,
12250}
12251impl Socket {
12252    /// A unique identifier for this Socket.
12253    pub async fn id(&self) -> Result<SocketId, DaggerError> {
12254        let query = self.selection.select("id");
12255        query.execute(self.graphql_client.clone()).await
12256    }
12257}
12258#[derive(Clone)]
12259pub struct SourceMap {
12260    pub proc: Option<Arc<DaggerSessionProc>>,
12261    pub selection: Selection,
12262    pub graphql_client: DynGraphQLClient,
12263}
12264impl SourceMap {
12265    /// The column number within the line.
12266    pub async fn column(&self) -> Result<isize, DaggerError> {
12267        let query = self.selection.select("column");
12268        query.execute(self.graphql_client.clone()).await
12269    }
12270    /// The filename from the module source.
12271    pub async fn filename(&self) -> Result<String, DaggerError> {
12272        let query = self.selection.select("filename");
12273        query.execute(self.graphql_client.clone()).await
12274    }
12275    /// A unique identifier for this SourceMap.
12276    pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
12277        let query = self.selection.select("id");
12278        query.execute(self.graphql_client.clone()).await
12279    }
12280    /// The line number within the filename.
12281    pub async fn line(&self) -> Result<isize, DaggerError> {
12282        let query = self.selection.select("line");
12283        query.execute(self.graphql_client.clone()).await
12284    }
12285    /// The module dependency this was declared in.
12286    pub async fn module(&self) -> Result<String, DaggerError> {
12287        let query = self.selection.select("module");
12288        query.execute(self.graphql_client.clone()).await
12289    }
12290    /// The URL to the file, if any. This can be used to link to the source map in the browser.
12291    pub async fn url(&self) -> Result<String, DaggerError> {
12292        let query = self.selection.select("url");
12293        query.execute(self.graphql_client.clone()).await
12294    }
12295}
12296#[derive(Clone)]
12297pub struct Terminal {
12298    pub proc: Option<Arc<DaggerSessionProc>>,
12299    pub selection: Selection,
12300    pub graphql_client: DynGraphQLClient,
12301}
12302impl Terminal {
12303    /// A unique identifier for this Terminal.
12304    pub async fn id(&self) -> Result<TerminalId, DaggerError> {
12305        let query = self.selection.select("id");
12306        query.execute(self.graphql_client.clone()).await
12307    }
12308    /// Forces evaluation of the pipeline in the engine.
12309    /// It doesn't run the default command if no exec has been set.
12310    pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
12311        let query = self.selection.select("sync");
12312        query.execute(self.graphql_client.clone()).await
12313    }
12314}
12315#[derive(Clone)]
12316pub struct TypeDef {
12317    pub proc: Option<Arc<DaggerSessionProc>>,
12318    pub selection: Selection,
12319    pub graphql_client: DynGraphQLClient,
12320}
12321#[derive(Builder, Debug, PartialEq)]
12322pub struct TypeDefWithEnumOpts<'a> {
12323    /// A doc string for the enum, if any
12324    #[builder(setter(into, strip_option), default)]
12325    pub description: Option<&'a str>,
12326    /// The source map for the enum definition.
12327    #[builder(setter(into, strip_option), default)]
12328    pub source_map: Option<SourceMapId>,
12329}
12330#[derive(Builder, Debug, PartialEq)]
12331pub struct TypeDefWithEnumMemberOpts<'a> {
12332    /// A doc string for the member, if any
12333    #[builder(setter(into, strip_option), default)]
12334    pub description: Option<&'a str>,
12335    /// The source map for the enum member definition.
12336    #[builder(setter(into, strip_option), default)]
12337    pub source_map: Option<SourceMapId>,
12338    /// The value of the member in the enum
12339    #[builder(setter(into, strip_option), default)]
12340    pub value: Option<&'a str>,
12341}
12342#[derive(Builder, Debug, PartialEq)]
12343pub struct TypeDefWithEnumValueOpts<'a> {
12344    /// A doc string for the value, if any
12345    #[builder(setter(into, strip_option), default)]
12346    pub description: Option<&'a str>,
12347    /// The source map for the enum value definition.
12348    #[builder(setter(into, strip_option), default)]
12349    pub source_map: Option<SourceMapId>,
12350}
12351#[derive(Builder, Debug, PartialEq)]
12352pub struct TypeDefWithFieldOpts<'a> {
12353    /// A doc string for the field, if any
12354    #[builder(setter(into, strip_option), default)]
12355    pub description: Option<&'a str>,
12356    /// The source map for the field definition.
12357    #[builder(setter(into, strip_option), default)]
12358    pub source_map: Option<SourceMapId>,
12359}
12360#[derive(Builder, Debug, PartialEq)]
12361pub struct TypeDefWithInterfaceOpts<'a> {
12362    #[builder(setter(into, strip_option), default)]
12363    pub description: Option<&'a str>,
12364    #[builder(setter(into, strip_option), default)]
12365    pub source_map: Option<SourceMapId>,
12366}
12367#[derive(Builder, Debug, PartialEq)]
12368pub struct TypeDefWithObjectOpts<'a> {
12369    #[builder(setter(into, strip_option), default)]
12370    pub description: Option<&'a str>,
12371    #[builder(setter(into, strip_option), default)]
12372    pub source_map: Option<SourceMapId>,
12373}
12374#[derive(Builder, Debug, PartialEq)]
12375pub struct TypeDefWithScalarOpts<'a> {
12376    #[builder(setter(into, strip_option), default)]
12377    pub description: Option<&'a str>,
12378}
12379impl TypeDef {
12380    /// If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
12381    pub fn as_enum(&self) -> EnumTypeDef {
12382        let query = self.selection.select("asEnum");
12383        EnumTypeDef {
12384            proc: self.proc.clone(),
12385            selection: query,
12386            graphql_client: self.graphql_client.clone(),
12387        }
12388    }
12389    /// If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
12390    pub fn as_input(&self) -> InputTypeDef {
12391        let query = self.selection.select("asInput");
12392        InputTypeDef {
12393            proc: self.proc.clone(),
12394            selection: query,
12395            graphql_client: self.graphql_client.clone(),
12396        }
12397    }
12398    /// If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
12399    pub fn as_interface(&self) -> InterfaceTypeDef {
12400        let query = self.selection.select("asInterface");
12401        InterfaceTypeDef {
12402            proc: self.proc.clone(),
12403            selection: query,
12404            graphql_client: self.graphql_client.clone(),
12405        }
12406    }
12407    /// If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
12408    pub fn as_list(&self) -> ListTypeDef {
12409        let query = self.selection.select("asList");
12410        ListTypeDef {
12411            proc: self.proc.clone(),
12412            selection: query,
12413            graphql_client: self.graphql_client.clone(),
12414        }
12415    }
12416    /// If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
12417    pub fn as_object(&self) -> ObjectTypeDef {
12418        let query = self.selection.select("asObject");
12419        ObjectTypeDef {
12420            proc: self.proc.clone(),
12421            selection: query,
12422            graphql_client: self.graphql_client.clone(),
12423        }
12424    }
12425    /// If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
12426    pub fn as_scalar(&self) -> ScalarTypeDef {
12427        let query = self.selection.select("asScalar");
12428        ScalarTypeDef {
12429            proc: self.proc.clone(),
12430            selection: query,
12431            graphql_client: self.graphql_client.clone(),
12432        }
12433    }
12434    /// A unique identifier for this TypeDef.
12435    pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
12436        let query = self.selection.select("id");
12437        query.execute(self.graphql_client.clone()).await
12438    }
12439    /// The kind of type this is (e.g. primitive, list, object).
12440    pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
12441        let query = self.selection.select("kind");
12442        query.execute(self.graphql_client.clone()).await
12443    }
12444    /// Whether this type can be set to null. Defaults to false.
12445    pub async fn optional(&self) -> Result<bool, DaggerError> {
12446        let query = self.selection.select("optional");
12447        query.execute(self.graphql_client.clone()).await
12448    }
12449    /// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
12450    pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
12451        let mut query = self.selection.select("withConstructor");
12452        query = query.arg_lazy(
12453            "function",
12454            Box::new(move || {
12455                let function = function.clone();
12456                Box::pin(async move { function.into_id().await.unwrap().quote() })
12457            }),
12458        );
12459        TypeDef {
12460            proc: self.proc.clone(),
12461            selection: query,
12462            graphql_client: self.graphql_client.clone(),
12463        }
12464    }
12465    /// Returns a TypeDef of kind Enum with the provided name.
12466    /// 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.
12467    ///
12468    /// # Arguments
12469    ///
12470    /// * `name` - The name of the enum
12471    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12472    pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
12473        let mut query = self.selection.select("withEnum");
12474        query = query.arg("name", name.into());
12475        TypeDef {
12476            proc: self.proc.clone(),
12477            selection: query,
12478            graphql_client: self.graphql_client.clone(),
12479        }
12480    }
12481    /// Returns a TypeDef of kind Enum with the provided name.
12482    /// 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.
12483    ///
12484    /// # Arguments
12485    ///
12486    /// * `name` - The name of the enum
12487    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12488    pub fn with_enum_opts<'a>(
12489        &self,
12490        name: impl Into<String>,
12491        opts: TypeDefWithEnumOpts<'a>,
12492    ) -> TypeDef {
12493        let mut query = self.selection.select("withEnum");
12494        query = query.arg("name", name.into());
12495        if let Some(description) = opts.description {
12496            query = query.arg("description", description);
12497        }
12498        if let Some(source_map) = opts.source_map {
12499            query = query.arg("sourceMap", source_map);
12500        }
12501        TypeDef {
12502            proc: self.proc.clone(),
12503            selection: query,
12504            graphql_client: self.graphql_client.clone(),
12505        }
12506    }
12507    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
12508    ///
12509    /// # Arguments
12510    ///
12511    /// * `name` - The name of the member in the enum
12512    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12513    pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
12514        let mut query = self.selection.select("withEnumMember");
12515        query = query.arg("name", name.into());
12516        TypeDef {
12517            proc: self.proc.clone(),
12518            selection: query,
12519            graphql_client: self.graphql_client.clone(),
12520        }
12521    }
12522    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
12523    ///
12524    /// # Arguments
12525    ///
12526    /// * `name` - The name of the member in the enum
12527    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12528    pub fn with_enum_member_opts<'a>(
12529        &self,
12530        name: impl Into<String>,
12531        opts: TypeDefWithEnumMemberOpts<'a>,
12532    ) -> TypeDef {
12533        let mut query = self.selection.select("withEnumMember");
12534        query = query.arg("name", name.into());
12535        if let Some(value) = opts.value {
12536            query = query.arg("value", value);
12537        }
12538        if let Some(description) = opts.description {
12539            query = query.arg("description", description);
12540        }
12541        if let Some(source_map) = opts.source_map {
12542            query = query.arg("sourceMap", source_map);
12543        }
12544        TypeDef {
12545            proc: self.proc.clone(),
12546            selection: query,
12547            graphql_client: self.graphql_client.clone(),
12548        }
12549    }
12550    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
12551    ///
12552    /// # Arguments
12553    ///
12554    /// * `value` - The name of the value in the enum
12555    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12556    pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
12557        let mut query = self.selection.select("withEnumValue");
12558        query = query.arg("value", value.into());
12559        TypeDef {
12560            proc: self.proc.clone(),
12561            selection: query,
12562            graphql_client: self.graphql_client.clone(),
12563        }
12564    }
12565    /// Adds a static value for an Enum TypeDef, failing if the type is not an enum.
12566    ///
12567    /// # Arguments
12568    ///
12569    /// * `value` - The name of the value in the enum
12570    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12571    pub fn with_enum_value_opts<'a>(
12572        &self,
12573        value: impl Into<String>,
12574        opts: TypeDefWithEnumValueOpts<'a>,
12575    ) -> TypeDef {
12576        let mut query = self.selection.select("withEnumValue");
12577        query = query.arg("value", value.into());
12578        if let Some(description) = opts.description {
12579            query = query.arg("description", description);
12580        }
12581        if let Some(source_map) = opts.source_map {
12582            query = query.arg("sourceMap", source_map);
12583        }
12584        TypeDef {
12585            proc: self.proc.clone(),
12586            selection: query,
12587            graphql_client: self.graphql_client.clone(),
12588        }
12589    }
12590    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
12591    ///
12592    /// # Arguments
12593    ///
12594    /// * `name` - The name of the field in the object
12595    /// * `type_def` - The type of the field
12596    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12597    pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
12598        let mut query = self.selection.select("withField");
12599        query = query.arg("name", name.into());
12600        query = query.arg_lazy(
12601            "typeDef",
12602            Box::new(move || {
12603                let type_def = type_def.clone();
12604                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
12605            }),
12606        );
12607        TypeDef {
12608            proc: self.proc.clone(),
12609            selection: query,
12610            graphql_client: self.graphql_client.clone(),
12611        }
12612    }
12613    /// Adds a static field for an Object TypeDef, failing if the type is not an object.
12614    ///
12615    /// # Arguments
12616    ///
12617    /// * `name` - The name of the field in the object
12618    /// * `type_def` - The type of the field
12619    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12620    pub fn with_field_opts<'a>(
12621        &self,
12622        name: impl Into<String>,
12623        type_def: impl IntoID<TypeDefId>,
12624        opts: TypeDefWithFieldOpts<'a>,
12625    ) -> TypeDef {
12626        let mut query = self.selection.select("withField");
12627        query = query.arg("name", name.into());
12628        query = query.arg_lazy(
12629            "typeDef",
12630            Box::new(move || {
12631                let type_def = type_def.clone();
12632                Box::pin(async move { type_def.into_id().await.unwrap().quote() })
12633            }),
12634        );
12635        if let Some(description) = opts.description {
12636            query = query.arg("description", description);
12637        }
12638        if let Some(source_map) = opts.source_map {
12639            query = query.arg("sourceMap", source_map);
12640        }
12641        TypeDef {
12642            proc: self.proc.clone(),
12643            selection: query,
12644            graphql_client: self.graphql_client.clone(),
12645        }
12646    }
12647    /// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
12648    pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
12649        let mut query = self.selection.select("withFunction");
12650        query = query.arg_lazy(
12651            "function",
12652            Box::new(move || {
12653                let function = function.clone();
12654                Box::pin(async move { function.into_id().await.unwrap().quote() })
12655            }),
12656        );
12657        TypeDef {
12658            proc: self.proc.clone(),
12659            selection: query,
12660            graphql_client: self.graphql_client.clone(),
12661        }
12662    }
12663    /// Returns a TypeDef of kind Interface with the provided name.
12664    ///
12665    /// # Arguments
12666    ///
12667    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12668    pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
12669        let mut query = self.selection.select("withInterface");
12670        query = query.arg("name", name.into());
12671        TypeDef {
12672            proc: self.proc.clone(),
12673            selection: query,
12674            graphql_client: self.graphql_client.clone(),
12675        }
12676    }
12677    /// Returns a TypeDef of kind Interface with the provided name.
12678    ///
12679    /// # Arguments
12680    ///
12681    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12682    pub fn with_interface_opts<'a>(
12683        &self,
12684        name: impl Into<String>,
12685        opts: TypeDefWithInterfaceOpts<'a>,
12686    ) -> TypeDef {
12687        let mut query = self.selection.select("withInterface");
12688        query = query.arg("name", name.into());
12689        if let Some(description) = opts.description {
12690            query = query.arg("description", description);
12691        }
12692        if let Some(source_map) = opts.source_map {
12693            query = query.arg("sourceMap", source_map);
12694        }
12695        TypeDef {
12696            proc: self.proc.clone(),
12697            selection: query,
12698            graphql_client: self.graphql_client.clone(),
12699        }
12700    }
12701    /// Sets the kind of the type.
12702    pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
12703        let mut query = self.selection.select("withKind");
12704        query = query.arg("kind", kind);
12705        TypeDef {
12706            proc: self.proc.clone(),
12707            selection: query,
12708            graphql_client: self.graphql_client.clone(),
12709        }
12710    }
12711    /// Returns a TypeDef of kind List with the provided type for its elements.
12712    pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
12713        let mut query = self.selection.select("withListOf");
12714        query = query.arg_lazy(
12715            "elementType",
12716            Box::new(move || {
12717                let element_type = element_type.clone();
12718                Box::pin(async move { element_type.into_id().await.unwrap().quote() })
12719            }),
12720        );
12721        TypeDef {
12722            proc: self.proc.clone(),
12723            selection: query,
12724            graphql_client: self.graphql_client.clone(),
12725        }
12726    }
12727    /// Returns a TypeDef of kind Object with the provided name.
12728    /// 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.
12729    ///
12730    /// # Arguments
12731    ///
12732    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12733    pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
12734        let mut query = self.selection.select("withObject");
12735        query = query.arg("name", name.into());
12736        TypeDef {
12737            proc: self.proc.clone(),
12738            selection: query,
12739            graphql_client: self.graphql_client.clone(),
12740        }
12741    }
12742    /// Returns a TypeDef of kind Object with the provided name.
12743    /// 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.
12744    ///
12745    /// # Arguments
12746    ///
12747    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12748    pub fn with_object_opts<'a>(
12749        &self,
12750        name: impl Into<String>,
12751        opts: TypeDefWithObjectOpts<'a>,
12752    ) -> TypeDef {
12753        let mut query = self.selection.select("withObject");
12754        query = query.arg("name", name.into());
12755        if let Some(description) = opts.description {
12756            query = query.arg("description", description);
12757        }
12758        if let Some(source_map) = opts.source_map {
12759            query = query.arg("sourceMap", source_map);
12760        }
12761        TypeDef {
12762            proc: self.proc.clone(),
12763            selection: query,
12764            graphql_client: self.graphql_client.clone(),
12765        }
12766    }
12767    /// Sets whether this type can be set to null.
12768    pub fn with_optional(&self, optional: bool) -> TypeDef {
12769        let mut query = self.selection.select("withOptional");
12770        query = query.arg("optional", optional);
12771        TypeDef {
12772            proc: self.proc.clone(),
12773            selection: query,
12774            graphql_client: self.graphql_client.clone(),
12775        }
12776    }
12777    /// Returns a TypeDef of kind Scalar with the provided name.
12778    ///
12779    /// # Arguments
12780    ///
12781    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12782    pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
12783        let mut query = self.selection.select("withScalar");
12784        query = query.arg("name", name.into());
12785        TypeDef {
12786            proc: self.proc.clone(),
12787            selection: query,
12788            graphql_client: self.graphql_client.clone(),
12789        }
12790    }
12791    /// Returns a TypeDef of kind Scalar with the provided name.
12792    ///
12793    /// # Arguments
12794    ///
12795    /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
12796    pub fn with_scalar_opts<'a>(
12797        &self,
12798        name: impl Into<String>,
12799        opts: TypeDefWithScalarOpts<'a>,
12800    ) -> TypeDef {
12801        let mut query = self.selection.select("withScalar");
12802        query = query.arg("name", name.into());
12803        if let Some(description) = opts.description {
12804            query = query.arg("description", description);
12805        }
12806        TypeDef {
12807            proc: self.proc.clone(),
12808            selection: query,
12809            graphql_client: self.graphql_client.clone(),
12810        }
12811    }
12812}
12813#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12814pub enum CacheSharingMode {
12815    #[serde(rename = "LOCKED")]
12816    Locked,
12817    #[serde(rename = "PRIVATE")]
12818    Private,
12819    #[serde(rename = "SHARED")]
12820    Shared,
12821}
12822#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12823pub enum ExistsType {
12824    #[serde(rename = "DIRECTORY_TYPE")]
12825    DirectoryType,
12826    #[serde(rename = "REGULAR_TYPE")]
12827    RegularType,
12828    #[serde(rename = "SYMLINK_TYPE")]
12829    SymlinkType,
12830}
12831#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12832pub enum FunctionCachePolicy {
12833    #[serde(rename = "Default")]
12834    Default,
12835    #[serde(rename = "Never")]
12836    Never,
12837    #[serde(rename = "PerSession")]
12838    PerSession,
12839}
12840#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12841pub enum ImageLayerCompression {
12842    #[serde(rename = "EStarGZ")]
12843    EStarGz,
12844    #[serde(rename = "ESTARGZ")]
12845    Estargz,
12846    #[serde(rename = "Gzip")]
12847    Gzip,
12848    #[serde(rename = "Uncompressed")]
12849    Uncompressed,
12850    #[serde(rename = "Zstd")]
12851    Zstd,
12852}
12853#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12854pub enum ImageMediaTypes {
12855    #[serde(rename = "DOCKER")]
12856    Docker,
12857    #[serde(rename = "DockerMediaTypes")]
12858    DockerMediaTypes,
12859    #[serde(rename = "OCI")]
12860    Oci,
12861    #[serde(rename = "OCIMediaTypes")]
12862    OciMediaTypes,
12863}
12864#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12865pub enum ModuleSourceExperimentalFeature {
12866    #[serde(rename = "SELF_CALLS")]
12867    SelfCalls,
12868}
12869#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12870pub enum ModuleSourceKind {
12871    #[serde(rename = "DIR")]
12872    Dir,
12873    #[serde(rename = "DIR_SOURCE")]
12874    DirSource,
12875    #[serde(rename = "GIT")]
12876    Git,
12877    #[serde(rename = "GIT_SOURCE")]
12878    GitSource,
12879    #[serde(rename = "LOCAL")]
12880    Local,
12881    #[serde(rename = "LOCAL_SOURCE")]
12882    LocalSource,
12883}
12884#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12885pub enum NetworkProtocol {
12886    #[serde(rename = "TCP")]
12887    Tcp,
12888    #[serde(rename = "UDP")]
12889    Udp,
12890}
12891#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12892pub enum ReturnType {
12893    #[serde(rename = "ANY")]
12894    Any,
12895    #[serde(rename = "FAILURE")]
12896    Failure,
12897    #[serde(rename = "SUCCESS")]
12898    Success,
12899}
12900#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
12901pub enum TypeDefKind {
12902    #[serde(rename = "BOOLEAN")]
12903    Boolean,
12904    #[serde(rename = "BOOLEAN_KIND")]
12905    BooleanKind,
12906    #[serde(rename = "ENUM")]
12907    Enum,
12908    #[serde(rename = "ENUM_KIND")]
12909    EnumKind,
12910    #[serde(rename = "FLOAT")]
12911    Float,
12912    #[serde(rename = "FLOAT_KIND")]
12913    FloatKind,
12914    #[serde(rename = "INPUT")]
12915    Input,
12916    #[serde(rename = "INPUT_KIND")]
12917    InputKind,
12918    #[serde(rename = "INTEGER")]
12919    Integer,
12920    #[serde(rename = "INTEGER_KIND")]
12921    IntegerKind,
12922    #[serde(rename = "INTERFACE")]
12923    Interface,
12924    #[serde(rename = "INTERFACE_KIND")]
12925    InterfaceKind,
12926    #[serde(rename = "LIST")]
12927    List,
12928    #[serde(rename = "LIST_KIND")]
12929    ListKind,
12930    #[serde(rename = "OBJECT")]
12931    Object,
12932    #[serde(rename = "OBJECT_KIND")]
12933    ObjectKind,
12934    #[serde(rename = "SCALAR")]
12935    Scalar,
12936    #[serde(rename = "SCALAR_KIND")]
12937    ScalarKind,
12938    #[serde(rename = "STRING")]
12939    String,
12940    #[serde(rename = "STRING_KIND")]
12941    StringKind,
12942    #[serde(rename = "VOID")]
12943    Void,
12944    #[serde(rename = "VOID_KIND")]
12945    VoidKind,
12946}