1#![allow(clippy::needless_lifetimes)]
2
3use crate::core::cli_session::DaggerSessionProc;
4use crate::core::graphql_client::DynGraphQLClient;
5use crate::errors::DaggerError;
6use crate::id::IntoID;
7use crate::querybuilder::Selection;
8use derive_builder::Builder;
9use serde::{Deserialize, Serialize};
10use std::sync::Arc;
11
12#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
13pub struct AddressId(pub String);
14impl From<&str> for AddressId {
15 fn from(value: &str) -> Self {
16 Self(value.to_string())
17 }
18}
19impl From<String> for AddressId {
20 fn from(value: String) -> Self {
21 Self(value)
22 }
23}
24impl IntoID<AddressId> for Address {
25 fn into_id(
26 self,
27 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<AddressId, DaggerError>> + Send>>
28 {
29 Box::pin(async move { self.id().await })
30 }
31}
32impl IntoID<AddressId> for AddressId {
33 fn into_id(
34 self,
35 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<AddressId, DaggerError>> + Send>>
36 {
37 Box::pin(async move { Ok::<AddressId, DaggerError>(self) })
38 }
39}
40impl AddressId {
41 fn quote(&self) -> String {
42 format!("\"{}\"", self.0.clone())
43 }
44}
45#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
46pub struct BindingId(pub String);
47impl From<&str> for BindingId {
48 fn from(value: &str) -> Self {
49 Self(value.to_string())
50 }
51}
52impl From<String> for BindingId {
53 fn from(value: String) -> Self {
54 Self(value)
55 }
56}
57impl IntoID<BindingId> for Binding {
58 fn into_id(
59 self,
60 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
61 {
62 Box::pin(async move { self.id().await })
63 }
64}
65impl IntoID<BindingId> for BindingId {
66 fn into_id(
67 self,
68 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
69 {
70 Box::pin(async move { Ok::<BindingId, DaggerError>(self) })
71 }
72}
73impl BindingId {
74 fn quote(&self) -> String {
75 format!("\"{}\"", self.0.clone())
76 }
77}
78#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
79pub struct CacheVolumeId(pub String);
80impl From<&str> for CacheVolumeId {
81 fn from(value: &str) -> Self {
82 Self(value.to_string())
83 }
84}
85impl From<String> for CacheVolumeId {
86 fn from(value: String) -> Self {
87 Self(value)
88 }
89}
90impl IntoID<CacheVolumeId> for CacheVolume {
91 fn into_id(
92 self,
93 ) -> std::pin::Pin<
94 Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
95 > {
96 Box::pin(async move { self.id().await })
97 }
98}
99impl IntoID<CacheVolumeId> for CacheVolumeId {
100 fn into_id(
101 self,
102 ) -> std::pin::Pin<
103 Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
104 > {
105 Box::pin(async move { Ok::<CacheVolumeId, DaggerError>(self) })
106 }
107}
108impl CacheVolumeId {
109 fn quote(&self) -> String {
110 format!("\"{}\"", self.0.clone())
111 }
112}
113#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
114pub struct ChangesetId(pub String);
115impl From<&str> for ChangesetId {
116 fn from(value: &str) -> Self {
117 Self(value.to_string())
118 }
119}
120impl From<String> for ChangesetId {
121 fn from(value: String) -> Self {
122 Self(value)
123 }
124}
125impl IntoID<ChangesetId> for Changeset {
126 fn into_id(
127 self,
128 ) -> std::pin::Pin<
129 Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
130 > {
131 Box::pin(async move { self.id().await })
132 }
133}
134impl IntoID<ChangesetId> for ChangesetId {
135 fn into_id(
136 self,
137 ) -> std::pin::Pin<
138 Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
139 > {
140 Box::pin(async move { Ok::<ChangesetId, DaggerError>(self) })
141 }
142}
143impl ChangesetId {
144 fn quote(&self) -> String {
145 format!("\"{}\"", self.0.clone())
146 }
147}
148#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
149pub struct CheckGroupId(pub String);
150impl From<&str> for CheckGroupId {
151 fn from(value: &str) -> Self {
152 Self(value.to_string())
153 }
154}
155impl From<String> for CheckGroupId {
156 fn from(value: String) -> Self {
157 Self(value)
158 }
159}
160impl IntoID<CheckGroupId> for CheckGroup {
161 fn into_id(
162 self,
163 ) -> std::pin::Pin<
164 Box<dyn core::future::Future<Output = Result<CheckGroupId, DaggerError>> + Send>,
165 > {
166 Box::pin(async move { self.id().await })
167 }
168}
169impl IntoID<CheckGroupId> for CheckGroupId {
170 fn into_id(
171 self,
172 ) -> std::pin::Pin<
173 Box<dyn core::future::Future<Output = Result<CheckGroupId, DaggerError>> + Send>,
174 > {
175 Box::pin(async move { Ok::<CheckGroupId, DaggerError>(self) })
176 }
177}
178impl CheckGroupId {
179 fn quote(&self) -> String {
180 format!("\"{}\"", self.0.clone())
181 }
182}
183#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
184pub struct CheckId(pub String);
185impl From<&str> for CheckId {
186 fn from(value: &str) -> Self {
187 Self(value.to_string())
188 }
189}
190impl From<String> for CheckId {
191 fn from(value: String) -> Self {
192 Self(value)
193 }
194}
195impl IntoID<CheckId> for Check {
196 fn into_id(
197 self,
198 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CheckId, DaggerError>> + Send>>
199 {
200 Box::pin(async move { self.id().await })
201 }
202}
203impl IntoID<CheckId> for CheckId {
204 fn into_id(
205 self,
206 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CheckId, DaggerError>> + Send>>
207 {
208 Box::pin(async move { Ok::<CheckId, DaggerError>(self) })
209 }
210}
211impl CheckId {
212 fn quote(&self) -> String {
213 format!("\"{}\"", self.0.clone())
214 }
215}
216#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
217pub struct CloudId(pub String);
218impl From<&str> for CloudId {
219 fn from(value: &str) -> Self {
220 Self(value.to_string())
221 }
222}
223impl From<String> for CloudId {
224 fn from(value: String) -> Self {
225 Self(value)
226 }
227}
228impl IntoID<CloudId> for Cloud {
229 fn into_id(
230 self,
231 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
232 {
233 Box::pin(async move { self.id().await })
234 }
235}
236impl IntoID<CloudId> for CloudId {
237 fn into_id(
238 self,
239 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
240 {
241 Box::pin(async move { Ok::<CloudId, DaggerError>(self) })
242 }
243}
244impl CloudId {
245 fn quote(&self) -> String {
246 format!("\"{}\"", self.0.clone())
247 }
248}
249#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
250pub struct ContainerId(pub String);
251impl From<&str> for ContainerId {
252 fn from(value: &str) -> Self {
253 Self(value.to_string())
254 }
255}
256impl From<String> for ContainerId {
257 fn from(value: String) -> Self {
258 Self(value)
259 }
260}
261impl IntoID<ContainerId> for Container {
262 fn into_id(
263 self,
264 ) -> std::pin::Pin<
265 Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
266 > {
267 Box::pin(async move { self.id().await })
268 }
269}
270impl IntoID<ContainerId> for ContainerId {
271 fn into_id(
272 self,
273 ) -> std::pin::Pin<
274 Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
275 > {
276 Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
277 }
278}
279impl ContainerId {
280 fn quote(&self) -> String {
281 format!("\"{}\"", self.0.clone())
282 }
283}
284#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
285pub struct CurrentModuleId(pub String);
286impl From<&str> for CurrentModuleId {
287 fn from(value: &str) -> Self {
288 Self(value.to_string())
289 }
290}
291impl From<String> for CurrentModuleId {
292 fn from(value: String) -> Self {
293 Self(value)
294 }
295}
296impl IntoID<CurrentModuleId> for CurrentModule {
297 fn into_id(
298 self,
299 ) -> std::pin::Pin<
300 Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
301 > {
302 Box::pin(async move { self.id().await })
303 }
304}
305impl IntoID<CurrentModuleId> for CurrentModuleId {
306 fn into_id(
307 self,
308 ) -> std::pin::Pin<
309 Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
310 > {
311 Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
312 }
313}
314impl CurrentModuleId {
315 fn quote(&self) -> String {
316 format!("\"{}\"", self.0.clone())
317 }
318}
319#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
320pub struct DirectoryId(pub String);
321impl From<&str> for DirectoryId {
322 fn from(value: &str) -> Self {
323 Self(value.to_string())
324 }
325}
326impl From<String> for DirectoryId {
327 fn from(value: String) -> Self {
328 Self(value)
329 }
330}
331impl IntoID<DirectoryId> for Directory {
332 fn into_id(
333 self,
334 ) -> std::pin::Pin<
335 Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
336 > {
337 Box::pin(async move { self.id().await })
338 }
339}
340impl IntoID<DirectoryId> for DirectoryId {
341 fn into_id(
342 self,
343 ) -> std::pin::Pin<
344 Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
345 > {
346 Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
347 }
348}
349impl DirectoryId {
350 fn quote(&self) -> String {
351 format!("\"{}\"", self.0.clone())
352 }
353}
354#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
355pub struct EngineCacheEntryId(pub String);
356impl From<&str> for EngineCacheEntryId {
357 fn from(value: &str) -> Self {
358 Self(value.to_string())
359 }
360}
361impl From<String> for EngineCacheEntryId {
362 fn from(value: String) -> Self {
363 Self(value)
364 }
365}
366impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
367 fn into_id(
368 self,
369 ) -> std::pin::Pin<
370 Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
371 > {
372 Box::pin(async move { self.id().await })
373 }
374}
375impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
376 fn into_id(
377 self,
378 ) -> std::pin::Pin<
379 Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
380 > {
381 Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
382 }
383}
384impl EngineCacheEntryId {
385 fn quote(&self) -> String {
386 format!("\"{}\"", self.0.clone())
387 }
388}
389#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
390pub struct EngineCacheEntrySetId(pub String);
391impl From<&str> for EngineCacheEntrySetId {
392 fn from(value: &str) -> Self {
393 Self(value.to_string())
394 }
395}
396impl From<String> for EngineCacheEntrySetId {
397 fn from(value: String) -> Self {
398 Self(value)
399 }
400}
401impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
402 fn into_id(
403 self,
404 ) -> std::pin::Pin<
405 Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
406 > {
407 Box::pin(async move { self.id().await })
408 }
409}
410impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
411 fn into_id(
412 self,
413 ) -> std::pin::Pin<
414 Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
415 > {
416 Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
417 }
418}
419impl EngineCacheEntrySetId {
420 fn quote(&self) -> String {
421 format!("\"{}\"", self.0.clone())
422 }
423}
424#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
425pub struct EngineCacheId(pub String);
426impl From<&str> for EngineCacheId {
427 fn from(value: &str) -> Self {
428 Self(value.to_string())
429 }
430}
431impl From<String> for EngineCacheId {
432 fn from(value: String) -> Self {
433 Self(value)
434 }
435}
436impl IntoID<EngineCacheId> for EngineCache {
437 fn into_id(
438 self,
439 ) -> std::pin::Pin<
440 Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
441 > {
442 Box::pin(async move { self.id().await })
443 }
444}
445impl IntoID<EngineCacheId> for EngineCacheId {
446 fn into_id(
447 self,
448 ) -> std::pin::Pin<
449 Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
450 > {
451 Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
452 }
453}
454impl EngineCacheId {
455 fn quote(&self) -> String {
456 format!("\"{}\"", self.0.clone())
457 }
458}
459#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
460pub struct EngineId(pub String);
461impl From<&str> for EngineId {
462 fn from(value: &str) -> Self {
463 Self(value.to_string())
464 }
465}
466impl From<String> for EngineId {
467 fn from(value: String) -> Self {
468 Self(value)
469 }
470}
471impl IntoID<EngineId> for Engine {
472 fn into_id(
473 self,
474 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
475 {
476 Box::pin(async move { self.id().await })
477 }
478}
479impl IntoID<EngineId> for EngineId {
480 fn into_id(
481 self,
482 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
483 {
484 Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
485 }
486}
487impl EngineId {
488 fn quote(&self) -> String {
489 format!("\"{}\"", self.0.clone())
490 }
491}
492#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
493pub struct EnumTypeDefId(pub String);
494impl From<&str> for EnumTypeDefId {
495 fn from(value: &str) -> Self {
496 Self(value.to_string())
497 }
498}
499impl From<String> for EnumTypeDefId {
500 fn from(value: String) -> Self {
501 Self(value)
502 }
503}
504impl IntoID<EnumTypeDefId> for EnumTypeDef {
505 fn into_id(
506 self,
507 ) -> std::pin::Pin<
508 Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
509 > {
510 Box::pin(async move { self.id().await })
511 }
512}
513impl IntoID<EnumTypeDefId> for EnumTypeDefId {
514 fn into_id(
515 self,
516 ) -> std::pin::Pin<
517 Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
518 > {
519 Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
520 }
521}
522impl EnumTypeDefId {
523 fn quote(&self) -> String {
524 format!("\"{}\"", self.0.clone())
525 }
526}
527#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
528pub struct EnumValueTypeDefId(pub String);
529impl From<&str> for EnumValueTypeDefId {
530 fn from(value: &str) -> Self {
531 Self(value.to_string())
532 }
533}
534impl From<String> for EnumValueTypeDefId {
535 fn from(value: String) -> Self {
536 Self(value)
537 }
538}
539impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
540 fn into_id(
541 self,
542 ) -> std::pin::Pin<
543 Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
544 > {
545 Box::pin(async move { self.id().await })
546 }
547}
548impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
549 fn into_id(
550 self,
551 ) -> std::pin::Pin<
552 Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
553 > {
554 Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
555 }
556}
557impl EnumValueTypeDefId {
558 fn quote(&self) -> String {
559 format!("\"{}\"", self.0.clone())
560 }
561}
562#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
563pub struct EnvFileId(pub String);
564impl From<&str> for EnvFileId {
565 fn from(value: &str) -> Self {
566 Self(value.to_string())
567 }
568}
569impl From<String> for EnvFileId {
570 fn from(value: String) -> Self {
571 Self(value)
572 }
573}
574impl IntoID<EnvFileId> for EnvFile {
575 fn into_id(
576 self,
577 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
578 {
579 Box::pin(async move { self.id().await })
580 }
581}
582impl IntoID<EnvFileId> for EnvFileId {
583 fn into_id(
584 self,
585 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
586 {
587 Box::pin(async move { Ok::<EnvFileId, DaggerError>(self) })
588 }
589}
590impl EnvFileId {
591 fn quote(&self) -> String {
592 format!("\"{}\"", self.0.clone())
593 }
594}
595#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
596pub struct EnvId(pub String);
597impl From<&str> for EnvId {
598 fn from(value: &str) -> Self {
599 Self(value.to_string())
600 }
601}
602impl From<String> for EnvId {
603 fn from(value: String) -> Self {
604 Self(value)
605 }
606}
607impl IntoID<EnvId> for Env {
608 fn into_id(
609 self,
610 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
611 {
612 Box::pin(async move { self.id().await })
613 }
614}
615impl IntoID<EnvId> for EnvId {
616 fn into_id(
617 self,
618 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
619 {
620 Box::pin(async move { Ok::<EnvId, DaggerError>(self) })
621 }
622}
623impl EnvId {
624 fn quote(&self) -> String {
625 format!("\"{}\"", self.0.clone())
626 }
627}
628#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
629pub struct EnvVariableId(pub String);
630impl From<&str> for EnvVariableId {
631 fn from(value: &str) -> Self {
632 Self(value.to_string())
633 }
634}
635impl From<String> for EnvVariableId {
636 fn from(value: String) -> Self {
637 Self(value)
638 }
639}
640impl IntoID<EnvVariableId> for EnvVariable {
641 fn into_id(
642 self,
643 ) -> std::pin::Pin<
644 Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
645 > {
646 Box::pin(async move { self.id().await })
647 }
648}
649impl IntoID<EnvVariableId> for EnvVariableId {
650 fn into_id(
651 self,
652 ) -> std::pin::Pin<
653 Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
654 > {
655 Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
656 }
657}
658impl EnvVariableId {
659 fn quote(&self) -> String {
660 format!("\"{}\"", self.0.clone())
661 }
662}
663#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
664pub struct ErrorId(pub String);
665impl From<&str> for ErrorId {
666 fn from(value: &str) -> Self {
667 Self(value.to_string())
668 }
669}
670impl From<String> for ErrorId {
671 fn from(value: String) -> Self {
672 Self(value)
673 }
674}
675impl IntoID<ErrorId> for Error {
676 fn into_id(
677 self,
678 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
679 {
680 Box::pin(async move { self.id().await })
681 }
682}
683impl IntoID<ErrorId> for ErrorId {
684 fn into_id(
685 self,
686 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
687 {
688 Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
689 }
690}
691impl ErrorId {
692 fn quote(&self) -> String {
693 format!("\"{}\"", self.0.clone())
694 }
695}
696#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
697pub struct ErrorValueId(pub String);
698impl From<&str> for ErrorValueId {
699 fn from(value: &str) -> Self {
700 Self(value.to_string())
701 }
702}
703impl From<String> for ErrorValueId {
704 fn from(value: String) -> Self {
705 Self(value)
706 }
707}
708impl IntoID<ErrorValueId> for ErrorValue {
709 fn into_id(
710 self,
711 ) -> std::pin::Pin<
712 Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
713 > {
714 Box::pin(async move { self.id().await })
715 }
716}
717impl IntoID<ErrorValueId> for ErrorValueId {
718 fn into_id(
719 self,
720 ) -> std::pin::Pin<
721 Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
722 > {
723 Box::pin(async move { Ok::<ErrorValueId, DaggerError>(self) })
724 }
725}
726impl ErrorValueId {
727 fn quote(&self) -> String {
728 format!("\"{}\"", self.0.clone())
729 }
730}
731#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
732pub struct FieldTypeDefId(pub String);
733impl From<&str> for FieldTypeDefId {
734 fn from(value: &str) -> Self {
735 Self(value.to_string())
736 }
737}
738impl From<String> for FieldTypeDefId {
739 fn from(value: String) -> Self {
740 Self(value)
741 }
742}
743impl IntoID<FieldTypeDefId> for FieldTypeDef {
744 fn into_id(
745 self,
746 ) -> std::pin::Pin<
747 Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
748 > {
749 Box::pin(async move { self.id().await })
750 }
751}
752impl IntoID<FieldTypeDefId> for FieldTypeDefId {
753 fn into_id(
754 self,
755 ) -> std::pin::Pin<
756 Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
757 > {
758 Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
759 }
760}
761impl FieldTypeDefId {
762 fn quote(&self) -> String {
763 format!("\"{}\"", self.0.clone())
764 }
765}
766#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
767pub struct FileId(pub String);
768impl From<&str> for FileId {
769 fn from(value: &str) -> Self {
770 Self(value.to_string())
771 }
772}
773impl From<String> for FileId {
774 fn from(value: String) -> Self {
775 Self(value)
776 }
777}
778impl IntoID<FileId> for File {
779 fn into_id(
780 self,
781 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
782 {
783 Box::pin(async move { self.id().await })
784 }
785}
786impl IntoID<FileId> for FileId {
787 fn into_id(
788 self,
789 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
790 {
791 Box::pin(async move { Ok::<FileId, DaggerError>(self) })
792 }
793}
794impl FileId {
795 fn quote(&self) -> String {
796 format!("\"{}\"", self.0.clone())
797 }
798}
799#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
800pub struct FunctionArgId(pub String);
801impl From<&str> for FunctionArgId {
802 fn from(value: &str) -> Self {
803 Self(value.to_string())
804 }
805}
806impl From<String> for FunctionArgId {
807 fn from(value: String) -> Self {
808 Self(value)
809 }
810}
811impl IntoID<FunctionArgId> for FunctionArg {
812 fn into_id(
813 self,
814 ) -> std::pin::Pin<
815 Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
816 > {
817 Box::pin(async move { self.id().await })
818 }
819}
820impl IntoID<FunctionArgId> for FunctionArgId {
821 fn into_id(
822 self,
823 ) -> std::pin::Pin<
824 Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
825 > {
826 Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
827 }
828}
829impl FunctionArgId {
830 fn quote(&self) -> String {
831 format!("\"{}\"", self.0.clone())
832 }
833}
834#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
835pub struct FunctionCallArgValueId(pub String);
836impl From<&str> for FunctionCallArgValueId {
837 fn from(value: &str) -> Self {
838 Self(value.to_string())
839 }
840}
841impl From<String> for FunctionCallArgValueId {
842 fn from(value: String) -> Self {
843 Self(value)
844 }
845}
846impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
847 fn into_id(
848 self,
849 ) -> std::pin::Pin<
850 Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
851 > {
852 Box::pin(async move { self.id().await })
853 }
854}
855impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
856 fn into_id(
857 self,
858 ) -> std::pin::Pin<
859 Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
860 > {
861 Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
862 }
863}
864impl FunctionCallArgValueId {
865 fn quote(&self) -> String {
866 format!("\"{}\"", self.0.clone())
867 }
868}
869#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
870pub struct FunctionCallId(pub String);
871impl From<&str> for FunctionCallId {
872 fn from(value: &str) -> Self {
873 Self(value.to_string())
874 }
875}
876impl From<String> for FunctionCallId {
877 fn from(value: String) -> Self {
878 Self(value)
879 }
880}
881impl IntoID<FunctionCallId> for FunctionCall {
882 fn into_id(
883 self,
884 ) -> std::pin::Pin<
885 Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
886 > {
887 Box::pin(async move { self.id().await })
888 }
889}
890impl IntoID<FunctionCallId> for FunctionCallId {
891 fn into_id(
892 self,
893 ) -> std::pin::Pin<
894 Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
895 > {
896 Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
897 }
898}
899impl FunctionCallId {
900 fn quote(&self) -> String {
901 format!("\"{}\"", self.0.clone())
902 }
903}
904#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
905pub struct FunctionId(pub String);
906impl From<&str> for FunctionId {
907 fn from(value: &str) -> Self {
908 Self(value.to_string())
909 }
910}
911impl From<String> for FunctionId {
912 fn from(value: String) -> Self {
913 Self(value)
914 }
915}
916impl IntoID<FunctionId> for Function {
917 fn into_id(
918 self,
919 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
920 {
921 Box::pin(async move { self.id().await })
922 }
923}
924impl IntoID<FunctionId> for FunctionId {
925 fn into_id(
926 self,
927 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
928 {
929 Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
930 }
931}
932impl FunctionId {
933 fn quote(&self) -> String {
934 format!("\"{}\"", self.0.clone())
935 }
936}
937#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
938pub struct GeneratedCodeId(pub String);
939impl From<&str> for GeneratedCodeId {
940 fn from(value: &str) -> Self {
941 Self(value.to_string())
942 }
943}
944impl From<String> for GeneratedCodeId {
945 fn from(value: String) -> Self {
946 Self(value)
947 }
948}
949impl IntoID<GeneratedCodeId> for GeneratedCode {
950 fn into_id(
951 self,
952 ) -> std::pin::Pin<
953 Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
954 > {
955 Box::pin(async move { self.id().await })
956 }
957}
958impl IntoID<GeneratedCodeId> for GeneratedCodeId {
959 fn into_id(
960 self,
961 ) -> std::pin::Pin<
962 Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
963 > {
964 Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
965 }
966}
967impl GeneratedCodeId {
968 fn quote(&self) -> String {
969 format!("\"{}\"", self.0.clone())
970 }
971}
972#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
973pub struct GitRefId(pub String);
974impl From<&str> for GitRefId {
975 fn from(value: &str) -> Self {
976 Self(value.to_string())
977 }
978}
979impl From<String> for GitRefId {
980 fn from(value: String) -> Self {
981 Self(value)
982 }
983}
984impl IntoID<GitRefId> for GitRef {
985 fn into_id(
986 self,
987 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
988 {
989 Box::pin(async move { self.id().await })
990 }
991}
992impl IntoID<GitRefId> for GitRefId {
993 fn into_id(
994 self,
995 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
996 {
997 Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
998 }
999}
1000impl GitRefId {
1001 fn quote(&self) -> String {
1002 format!("\"{}\"", self.0.clone())
1003 }
1004}
1005#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1006pub struct GitRepositoryId(pub String);
1007impl From<&str> for GitRepositoryId {
1008 fn from(value: &str) -> Self {
1009 Self(value.to_string())
1010 }
1011}
1012impl From<String> for GitRepositoryId {
1013 fn from(value: String) -> Self {
1014 Self(value)
1015 }
1016}
1017impl IntoID<GitRepositoryId> for GitRepository {
1018 fn into_id(
1019 self,
1020 ) -> std::pin::Pin<
1021 Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
1022 > {
1023 Box::pin(async move { self.id().await })
1024 }
1025}
1026impl IntoID<GitRepositoryId> for GitRepositoryId {
1027 fn into_id(
1028 self,
1029 ) -> std::pin::Pin<
1030 Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
1031 > {
1032 Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
1033 }
1034}
1035impl GitRepositoryId {
1036 fn quote(&self) -> String {
1037 format!("\"{}\"", self.0.clone())
1038 }
1039}
1040#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1041pub struct HostId(pub String);
1042impl From<&str> for HostId {
1043 fn from(value: &str) -> Self {
1044 Self(value.to_string())
1045 }
1046}
1047impl From<String> for HostId {
1048 fn from(value: String) -> Self {
1049 Self(value)
1050 }
1051}
1052impl IntoID<HostId> for Host {
1053 fn into_id(
1054 self,
1055 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
1056 {
1057 Box::pin(async move { self.id().await })
1058 }
1059}
1060impl IntoID<HostId> for HostId {
1061 fn into_id(
1062 self,
1063 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
1064 {
1065 Box::pin(async move { Ok::<HostId, DaggerError>(self) })
1066 }
1067}
1068impl HostId {
1069 fn quote(&self) -> String {
1070 format!("\"{}\"", self.0.clone())
1071 }
1072}
1073#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1074pub struct InputTypeDefId(pub String);
1075impl From<&str> for InputTypeDefId {
1076 fn from(value: &str) -> Self {
1077 Self(value.to_string())
1078 }
1079}
1080impl From<String> for InputTypeDefId {
1081 fn from(value: String) -> Self {
1082 Self(value)
1083 }
1084}
1085impl IntoID<InputTypeDefId> for InputTypeDef {
1086 fn into_id(
1087 self,
1088 ) -> std::pin::Pin<
1089 Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1090 > {
1091 Box::pin(async move { self.id().await })
1092 }
1093}
1094impl IntoID<InputTypeDefId> for InputTypeDefId {
1095 fn into_id(
1096 self,
1097 ) -> std::pin::Pin<
1098 Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
1099 > {
1100 Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
1101 }
1102}
1103impl InputTypeDefId {
1104 fn quote(&self) -> String {
1105 format!("\"{}\"", self.0.clone())
1106 }
1107}
1108#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1109pub struct InterfaceTypeDefId(pub String);
1110impl From<&str> for InterfaceTypeDefId {
1111 fn from(value: &str) -> Self {
1112 Self(value.to_string())
1113 }
1114}
1115impl From<String> for InterfaceTypeDefId {
1116 fn from(value: String) -> Self {
1117 Self(value)
1118 }
1119}
1120impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
1121 fn into_id(
1122 self,
1123 ) -> std::pin::Pin<
1124 Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1125 > {
1126 Box::pin(async move { self.id().await })
1127 }
1128}
1129impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
1130 fn into_id(
1131 self,
1132 ) -> std::pin::Pin<
1133 Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
1134 > {
1135 Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
1136 }
1137}
1138impl InterfaceTypeDefId {
1139 fn quote(&self) -> String {
1140 format!("\"{}\"", self.0.clone())
1141 }
1142}
1143#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1144pub struct Json(pub String);
1145impl From<&str> for Json {
1146 fn from(value: &str) -> Self {
1147 Self(value.to_string())
1148 }
1149}
1150impl From<String> for Json {
1151 fn from(value: String) -> Self {
1152 Self(value)
1153 }
1154}
1155impl Json {
1156 fn quote(&self) -> String {
1157 format!("\"{}\"", self.0.clone())
1158 }
1159}
1160#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1161pub struct JsonValueId(pub String);
1162impl From<&str> for JsonValueId {
1163 fn from(value: &str) -> Self {
1164 Self(value.to_string())
1165 }
1166}
1167impl From<String> for JsonValueId {
1168 fn from(value: String) -> Self {
1169 Self(value)
1170 }
1171}
1172impl IntoID<JsonValueId> for JsonValue {
1173 fn into_id(
1174 self,
1175 ) -> std::pin::Pin<
1176 Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1177 > {
1178 Box::pin(async move { self.id().await })
1179 }
1180}
1181impl IntoID<JsonValueId> for JsonValueId {
1182 fn into_id(
1183 self,
1184 ) -> std::pin::Pin<
1185 Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
1186 > {
1187 Box::pin(async move { Ok::<JsonValueId, DaggerError>(self) })
1188 }
1189}
1190impl JsonValueId {
1191 fn quote(&self) -> String {
1192 format!("\"{}\"", self.0.clone())
1193 }
1194}
1195#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1196pub struct Llmid(pub String);
1197impl From<&str> for Llmid {
1198 fn from(value: &str) -> Self {
1199 Self(value.to_string())
1200 }
1201}
1202impl From<String> for Llmid {
1203 fn from(value: String) -> Self {
1204 Self(value)
1205 }
1206}
1207impl IntoID<Llmid> for Llm {
1208 fn into_id(
1209 self,
1210 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1211 {
1212 Box::pin(async move { self.id().await })
1213 }
1214}
1215impl IntoID<Llmid> for Llmid {
1216 fn into_id(
1217 self,
1218 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
1219 {
1220 Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
1221 }
1222}
1223impl Llmid {
1224 fn quote(&self) -> String {
1225 format!("\"{}\"", self.0.clone())
1226 }
1227}
1228#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1229pub struct LlmTokenUsageId(pub String);
1230impl From<&str> for LlmTokenUsageId {
1231 fn from(value: &str) -> Self {
1232 Self(value.to_string())
1233 }
1234}
1235impl From<String> for LlmTokenUsageId {
1236 fn from(value: String) -> Self {
1237 Self(value)
1238 }
1239}
1240impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
1241 fn into_id(
1242 self,
1243 ) -> std::pin::Pin<
1244 Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1245 > {
1246 Box::pin(async move { self.id().await })
1247 }
1248}
1249impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
1250 fn into_id(
1251 self,
1252 ) -> std::pin::Pin<
1253 Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
1254 > {
1255 Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
1256 }
1257}
1258impl LlmTokenUsageId {
1259 fn quote(&self) -> String {
1260 format!("\"{}\"", self.0.clone())
1261 }
1262}
1263#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1264pub struct LabelId(pub String);
1265impl From<&str> for LabelId {
1266 fn from(value: &str) -> Self {
1267 Self(value.to_string())
1268 }
1269}
1270impl From<String> for LabelId {
1271 fn from(value: String) -> Self {
1272 Self(value)
1273 }
1274}
1275impl IntoID<LabelId> for Label {
1276 fn into_id(
1277 self,
1278 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1279 {
1280 Box::pin(async move { self.id().await })
1281 }
1282}
1283impl IntoID<LabelId> for LabelId {
1284 fn into_id(
1285 self,
1286 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
1287 {
1288 Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
1289 }
1290}
1291impl LabelId {
1292 fn quote(&self) -> String {
1293 format!("\"{}\"", self.0.clone())
1294 }
1295}
1296#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1297pub struct ListTypeDefId(pub String);
1298impl From<&str> for ListTypeDefId {
1299 fn from(value: &str) -> Self {
1300 Self(value.to_string())
1301 }
1302}
1303impl From<String> for ListTypeDefId {
1304 fn from(value: String) -> Self {
1305 Self(value)
1306 }
1307}
1308impl IntoID<ListTypeDefId> for ListTypeDef {
1309 fn into_id(
1310 self,
1311 ) -> std::pin::Pin<
1312 Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1313 > {
1314 Box::pin(async move { self.id().await })
1315 }
1316}
1317impl IntoID<ListTypeDefId> for ListTypeDefId {
1318 fn into_id(
1319 self,
1320 ) -> std::pin::Pin<
1321 Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
1322 > {
1323 Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
1324 }
1325}
1326impl ListTypeDefId {
1327 fn quote(&self) -> String {
1328 format!("\"{}\"", self.0.clone())
1329 }
1330}
1331#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1332pub struct ModuleConfigClientId(pub String);
1333impl From<&str> for ModuleConfigClientId {
1334 fn from(value: &str) -> Self {
1335 Self(value.to_string())
1336 }
1337}
1338impl From<String> for ModuleConfigClientId {
1339 fn from(value: String) -> Self {
1340 Self(value)
1341 }
1342}
1343impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
1344 fn into_id(
1345 self,
1346 ) -> std::pin::Pin<
1347 Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1348 > {
1349 Box::pin(async move { self.id().await })
1350 }
1351}
1352impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
1353 fn into_id(
1354 self,
1355 ) -> std::pin::Pin<
1356 Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
1357 > {
1358 Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
1359 }
1360}
1361impl ModuleConfigClientId {
1362 fn quote(&self) -> String {
1363 format!("\"{}\"", self.0.clone())
1364 }
1365}
1366#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1367pub struct ModuleId(pub String);
1368impl From<&str> for ModuleId {
1369 fn from(value: &str) -> Self {
1370 Self(value.to_string())
1371 }
1372}
1373impl From<String> for ModuleId {
1374 fn from(value: String) -> Self {
1375 Self(value)
1376 }
1377}
1378impl IntoID<ModuleId> for Module {
1379 fn into_id(
1380 self,
1381 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1382 {
1383 Box::pin(async move { self.id().await })
1384 }
1385}
1386impl IntoID<ModuleId> for ModuleId {
1387 fn into_id(
1388 self,
1389 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
1390 {
1391 Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
1392 }
1393}
1394impl ModuleId {
1395 fn quote(&self) -> String {
1396 format!("\"{}\"", self.0.clone())
1397 }
1398}
1399#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1400pub struct ModuleSourceId(pub String);
1401impl From<&str> for ModuleSourceId {
1402 fn from(value: &str) -> Self {
1403 Self(value.to_string())
1404 }
1405}
1406impl From<String> for ModuleSourceId {
1407 fn from(value: String) -> Self {
1408 Self(value)
1409 }
1410}
1411impl IntoID<ModuleSourceId> for ModuleSource {
1412 fn into_id(
1413 self,
1414 ) -> std::pin::Pin<
1415 Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1416 > {
1417 Box::pin(async move { self.id().await })
1418 }
1419}
1420impl IntoID<ModuleSourceId> for ModuleSourceId {
1421 fn into_id(
1422 self,
1423 ) -> std::pin::Pin<
1424 Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1425 > {
1426 Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1427 }
1428}
1429impl ModuleSourceId {
1430 fn quote(&self) -> String {
1431 format!("\"{}\"", self.0.clone())
1432 }
1433}
1434#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1435pub struct ObjectTypeDefId(pub String);
1436impl From<&str> for ObjectTypeDefId {
1437 fn from(value: &str) -> Self {
1438 Self(value.to_string())
1439 }
1440}
1441impl From<String> for ObjectTypeDefId {
1442 fn from(value: String) -> Self {
1443 Self(value)
1444 }
1445}
1446impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1447 fn into_id(
1448 self,
1449 ) -> std::pin::Pin<
1450 Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1451 > {
1452 Box::pin(async move { self.id().await })
1453 }
1454}
1455impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1456 fn into_id(
1457 self,
1458 ) -> std::pin::Pin<
1459 Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1460 > {
1461 Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1462 }
1463}
1464impl ObjectTypeDefId {
1465 fn quote(&self) -> String {
1466 format!("\"{}\"", self.0.clone())
1467 }
1468}
1469#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1470pub struct Platform(pub String);
1471impl From<&str> for Platform {
1472 fn from(value: &str) -> Self {
1473 Self(value.to_string())
1474 }
1475}
1476impl From<String> for Platform {
1477 fn from(value: String) -> Self {
1478 Self(value)
1479 }
1480}
1481impl Platform {
1482 fn quote(&self) -> String {
1483 format!("\"{}\"", self.0.clone())
1484 }
1485}
1486#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1487pub struct PortId(pub String);
1488impl From<&str> for PortId {
1489 fn from(value: &str) -> Self {
1490 Self(value.to_string())
1491 }
1492}
1493impl From<String> for PortId {
1494 fn from(value: String) -> Self {
1495 Self(value)
1496 }
1497}
1498impl IntoID<PortId> for Port {
1499 fn into_id(
1500 self,
1501 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1502 {
1503 Box::pin(async move { self.id().await })
1504 }
1505}
1506impl IntoID<PortId> for PortId {
1507 fn into_id(
1508 self,
1509 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1510 {
1511 Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1512 }
1513}
1514impl PortId {
1515 fn quote(&self) -> String {
1516 format!("\"{}\"", self.0.clone())
1517 }
1518}
1519#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1520pub struct SdkConfigId(pub String);
1521impl From<&str> for SdkConfigId {
1522 fn from(value: &str) -> Self {
1523 Self(value.to_string())
1524 }
1525}
1526impl From<String> for SdkConfigId {
1527 fn from(value: String) -> Self {
1528 Self(value)
1529 }
1530}
1531impl IntoID<SdkConfigId> for SdkConfig {
1532 fn into_id(
1533 self,
1534 ) -> std::pin::Pin<
1535 Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1536 > {
1537 Box::pin(async move { self.id().await })
1538 }
1539}
1540impl IntoID<SdkConfigId> for SdkConfigId {
1541 fn into_id(
1542 self,
1543 ) -> std::pin::Pin<
1544 Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1545 > {
1546 Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1547 }
1548}
1549impl SdkConfigId {
1550 fn quote(&self) -> String {
1551 format!("\"{}\"", self.0.clone())
1552 }
1553}
1554#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1555pub struct ScalarTypeDefId(pub String);
1556impl From<&str> for ScalarTypeDefId {
1557 fn from(value: &str) -> Self {
1558 Self(value.to_string())
1559 }
1560}
1561impl From<String> for ScalarTypeDefId {
1562 fn from(value: String) -> Self {
1563 Self(value)
1564 }
1565}
1566impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1567 fn into_id(
1568 self,
1569 ) -> std::pin::Pin<
1570 Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1571 > {
1572 Box::pin(async move { self.id().await })
1573 }
1574}
1575impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1576 fn into_id(
1577 self,
1578 ) -> std::pin::Pin<
1579 Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1580 > {
1581 Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1582 }
1583}
1584impl ScalarTypeDefId {
1585 fn quote(&self) -> String {
1586 format!("\"{}\"", self.0.clone())
1587 }
1588}
1589#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1590pub struct SearchResultId(pub String);
1591impl From<&str> for SearchResultId {
1592 fn from(value: &str) -> Self {
1593 Self(value.to_string())
1594 }
1595}
1596impl From<String> for SearchResultId {
1597 fn from(value: String) -> Self {
1598 Self(value)
1599 }
1600}
1601impl IntoID<SearchResultId> for SearchResult {
1602 fn into_id(
1603 self,
1604 ) -> std::pin::Pin<
1605 Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1606 > {
1607 Box::pin(async move { self.id().await })
1608 }
1609}
1610impl IntoID<SearchResultId> for SearchResultId {
1611 fn into_id(
1612 self,
1613 ) -> std::pin::Pin<
1614 Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
1615 > {
1616 Box::pin(async move { Ok::<SearchResultId, DaggerError>(self) })
1617 }
1618}
1619impl SearchResultId {
1620 fn quote(&self) -> String {
1621 format!("\"{}\"", self.0.clone())
1622 }
1623}
1624#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1625pub struct SearchSubmatchId(pub String);
1626impl From<&str> for SearchSubmatchId {
1627 fn from(value: &str) -> Self {
1628 Self(value.to_string())
1629 }
1630}
1631impl From<String> for SearchSubmatchId {
1632 fn from(value: String) -> Self {
1633 Self(value)
1634 }
1635}
1636impl IntoID<SearchSubmatchId> for SearchSubmatch {
1637 fn into_id(
1638 self,
1639 ) -> std::pin::Pin<
1640 Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1641 > {
1642 Box::pin(async move { self.id().await })
1643 }
1644}
1645impl IntoID<SearchSubmatchId> for SearchSubmatchId {
1646 fn into_id(
1647 self,
1648 ) -> std::pin::Pin<
1649 Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
1650 > {
1651 Box::pin(async move { Ok::<SearchSubmatchId, DaggerError>(self) })
1652 }
1653}
1654impl SearchSubmatchId {
1655 fn quote(&self) -> String {
1656 format!("\"{}\"", self.0.clone())
1657 }
1658}
1659#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1660pub struct SecretId(pub String);
1661impl From<&str> for SecretId {
1662 fn from(value: &str) -> Self {
1663 Self(value.to_string())
1664 }
1665}
1666impl From<String> for SecretId {
1667 fn from(value: String) -> Self {
1668 Self(value)
1669 }
1670}
1671impl IntoID<SecretId> for Secret {
1672 fn into_id(
1673 self,
1674 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1675 {
1676 Box::pin(async move { self.id().await })
1677 }
1678}
1679impl IntoID<SecretId> for SecretId {
1680 fn into_id(
1681 self,
1682 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1683 {
1684 Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1685 }
1686}
1687impl SecretId {
1688 fn quote(&self) -> String {
1689 format!("\"{}\"", self.0.clone())
1690 }
1691}
1692#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1693pub struct ServiceId(pub String);
1694impl From<&str> for ServiceId {
1695 fn from(value: &str) -> Self {
1696 Self(value.to_string())
1697 }
1698}
1699impl From<String> for ServiceId {
1700 fn from(value: String) -> Self {
1701 Self(value)
1702 }
1703}
1704impl IntoID<ServiceId> for Service {
1705 fn into_id(
1706 self,
1707 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1708 {
1709 Box::pin(async move { self.id().await })
1710 }
1711}
1712impl IntoID<ServiceId> for ServiceId {
1713 fn into_id(
1714 self,
1715 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1716 {
1717 Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1718 }
1719}
1720impl ServiceId {
1721 fn quote(&self) -> String {
1722 format!("\"{}\"", self.0.clone())
1723 }
1724}
1725#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1726pub struct SocketId(pub String);
1727impl From<&str> for SocketId {
1728 fn from(value: &str) -> Self {
1729 Self(value.to_string())
1730 }
1731}
1732impl From<String> for SocketId {
1733 fn from(value: String) -> Self {
1734 Self(value)
1735 }
1736}
1737impl IntoID<SocketId> for Socket {
1738 fn into_id(
1739 self,
1740 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1741 {
1742 Box::pin(async move { self.id().await })
1743 }
1744}
1745impl IntoID<SocketId> for SocketId {
1746 fn into_id(
1747 self,
1748 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1749 {
1750 Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1751 }
1752}
1753impl SocketId {
1754 fn quote(&self) -> String {
1755 format!("\"{}\"", self.0.clone())
1756 }
1757}
1758#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1759pub struct SourceMapId(pub String);
1760impl From<&str> for SourceMapId {
1761 fn from(value: &str) -> Self {
1762 Self(value.to_string())
1763 }
1764}
1765impl From<String> for SourceMapId {
1766 fn from(value: String) -> Self {
1767 Self(value)
1768 }
1769}
1770impl IntoID<SourceMapId> for SourceMap {
1771 fn into_id(
1772 self,
1773 ) -> std::pin::Pin<
1774 Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1775 > {
1776 Box::pin(async move { self.id().await })
1777 }
1778}
1779impl IntoID<SourceMapId> for SourceMapId {
1780 fn into_id(
1781 self,
1782 ) -> std::pin::Pin<
1783 Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1784 > {
1785 Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1786 }
1787}
1788impl SourceMapId {
1789 fn quote(&self) -> String {
1790 format!("\"{}\"", self.0.clone())
1791 }
1792}
1793#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1794pub struct TerminalId(pub String);
1795impl From<&str> for TerminalId {
1796 fn from(value: &str) -> Self {
1797 Self(value.to_string())
1798 }
1799}
1800impl From<String> for TerminalId {
1801 fn from(value: String) -> Self {
1802 Self(value)
1803 }
1804}
1805impl IntoID<TerminalId> for Terminal {
1806 fn into_id(
1807 self,
1808 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1809 {
1810 Box::pin(async move { self.id().await })
1811 }
1812}
1813impl IntoID<TerminalId> for TerminalId {
1814 fn into_id(
1815 self,
1816 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1817 {
1818 Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
1819 }
1820}
1821impl TerminalId {
1822 fn quote(&self) -> String {
1823 format!("\"{}\"", self.0.clone())
1824 }
1825}
1826#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1827pub struct TypeDefId(pub String);
1828impl From<&str> for TypeDefId {
1829 fn from(value: &str) -> Self {
1830 Self(value.to_string())
1831 }
1832}
1833impl From<String> for TypeDefId {
1834 fn from(value: String) -> Self {
1835 Self(value)
1836 }
1837}
1838impl IntoID<TypeDefId> for TypeDef {
1839 fn into_id(
1840 self,
1841 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1842 {
1843 Box::pin(async move { self.id().await })
1844 }
1845}
1846impl IntoID<TypeDefId> for TypeDefId {
1847 fn into_id(
1848 self,
1849 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1850 {
1851 Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
1852 }
1853}
1854impl TypeDefId {
1855 fn quote(&self) -> String {
1856 format!("\"{}\"", self.0.clone())
1857 }
1858}
1859#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1860pub struct Void(pub String);
1861impl From<&str> for Void {
1862 fn from(value: &str) -> Self {
1863 Self(value.to_string())
1864 }
1865}
1866impl From<String> for Void {
1867 fn from(value: String) -> Self {
1868 Self(value)
1869 }
1870}
1871impl Void {
1872 fn quote(&self) -> String {
1873 format!("\"{}\"", self.0.clone())
1874 }
1875}
1876#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1877pub struct BuildArg {
1878 pub name: String,
1879 pub value: String,
1880}
1881#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1882pub struct PipelineLabel {
1883 pub name: String,
1884 pub value: String,
1885}
1886#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1887pub struct PortForward {
1888 pub backend: isize,
1889 pub frontend: isize,
1890 pub protocol: NetworkProtocol,
1891}
1892#[derive(Clone)]
1893pub struct Address {
1894 pub proc: Option<Arc<DaggerSessionProc>>,
1895 pub selection: Selection,
1896 pub graphql_client: DynGraphQLClient,
1897}
1898#[derive(Builder, Debug, PartialEq)]
1899pub struct AddressDirectoryOpts<'a> {
1900 #[builder(setter(into, strip_option), default)]
1901 pub exclude: Option<Vec<&'a str>>,
1902 #[builder(setter(into, strip_option), default)]
1903 pub gitignore: Option<bool>,
1904 #[builder(setter(into, strip_option), default)]
1905 pub include: Option<Vec<&'a str>>,
1906 #[builder(setter(into, strip_option), default)]
1907 pub no_cache: Option<bool>,
1908}
1909#[derive(Builder, Debug, PartialEq)]
1910pub struct AddressFileOpts<'a> {
1911 #[builder(setter(into, strip_option), default)]
1912 pub exclude: Option<Vec<&'a str>>,
1913 #[builder(setter(into, strip_option), default)]
1914 pub gitignore: Option<bool>,
1915 #[builder(setter(into, strip_option), default)]
1916 pub include: Option<Vec<&'a str>>,
1917 #[builder(setter(into, strip_option), default)]
1918 pub no_cache: Option<bool>,
1919}
1920impl Address {
1921 pub fn container(&self) -> Container {
1923 let query = self.selection.select("container");
1924 Container {
1925 proc: self.proc.clone(),
1926 selection: query,
1927 graphql_client: self.graphql_client.clone(),
1928 }
1929 }
1930 pub fn directory(&self) -> Directory {
1936 let query = self.selection.select("directory");
1937 Directory {
1938 proc: self.proc.clone(),
1939 selection: query,
1940 graphql_client: self.graphql_client.clone(),
1941 }
1942 }
1943 pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
1949 let mut query = self.selection.select("directory");
1950 if let Some(exclude) = opts.exclude {
1951 query = query.arg("exclude", exclude);
1952 }
1953 if let Some(include) = opts.include {
1954 query = query.arg("include", include);
1955 }
1956 if let Some(gitignore) = opts.gitignore {
1957 query = query.arg("gitignore", gitignore);
1958 }
1959 if let Some(no_cache) = opts.no_cache {
1960 query = query.arg("noCache", no_cache);
1961 }
1962 Directory {
1963 proc: self.proc.clone(),
1964 selection: query,
1965 graphql_client: self.graphql_client.clone(),
1966 }
1967 }
1968 pub fn file(&self) -> File {
1974 let query = self.selection.select("file");
1975 File {
1976 proc: self.proc.clone(),
1977 selection: query,
1978 graphql_client: self.graphql_client.clone(),
1979 }
1980 }
1981 pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
1987 let mut query = self.selection.select("file");
1988 if let Some(exclude) = opts.exclude {
1989 query = query.arg("exclude", exclude);
1990 }
1991 if let Some(include) = opts.include {
1992 query = query.arg("include", include);
1993 }
1994 if let Some(gitignore) = opts.gitignore {
1995 query = query.arg("gitignore", gitignore);
1996 }
1997 if let Some(no_cache) = opts.no_cache {
1998 query = query.arg("noCache", no_cache);
1999 }
2000 File {
2001 proc: self.proc.clone(),
2002 selection: query,
2003 graphql_client: self.graphql_client.clone(),
2004 }
2005 }
2006 pub fn git_ref(&self) -> GitRef {
2008 let query = self.selection.select("gitRef");
2009 GitRef {
2010 proc: self.proc.clone(),
2011 selection: query,
2012 graphql_client: self.graphql_client.clone(),
2013 }
2014 }
2015 pub fn git_repository(&self) -> GitRepository {
2017 let query = self.selection.select("gitRepository");
2018 GitRepository {
2019 proc: self.proc.clone(),
2020 selection: query,
2021 graphql_client: self.graphql_client.clone(),
2022 }
2023 }
2024 pub async fn id(&self) -> Result<AddressId, DaggerError> {
2026 let query = self.selection.select("id");
2027 query.execute(self.graphql_client.clone()).await
2028 }
2029 pub fn secret(&self) -> Secret {
2031 let query = self.selection.select("secret");
2032 Secret {
2033 proc: self.proc.clone(),
2034 selection: query,
2035 graphql_client: self.graphql_client.clone(),
2036 }
2037 }
2038 pub fn service(&self) -> Service {
2040 let query = self.selection.select("service");
2041 Service {
2042 proc: self.proc.clone(),
2043 selection: query,
2044 graphql_client: self.graphql_client.clone(),
2045 }
2046 }
2047 pub fn socket(&self) -> Socket {
2049 let query = self.selection.select("socket");
2050 Socket {
2051 proc: self.proc.clone(),
2052 selection: query,
2053 graphql_client: self.graphql_client.clone(),
2054 }
2055 }
2056 pub async fn value(&self) -> Result<String, DaggerError> {
2058 let query = self.selection.select("value");
2059 query.execute(self.graphql_client.clone()).await
2060 }
2061}
2062#[derive(Clone)]
2063pub struct Binding {
2064 pub proc: Option<Arc<DaggerSessionProc>>,
2065 pub selection: Selection,
2066 pub graphql_client: DynGraphQLClient,
2067}
2068impl Binding {
2069 pub fn as_address(&self) -> Address {
2071 let query = self.selection.select("asAddress");
2072 Address {
2073 proc: self.proc.clone(),
2074 selection: query,
2075 graphql_client: self.graphql_client.clone(),
2076 }
2077 }
2078 pub fn as_cache_volume(&self) -> CacheVolume {
2080 let query = self.selection.select("asCacheVolume");
2081 CacheVolume {
2082 proc: self.proc.clone(),
2083 selection: query,
2084 graphql_client: self.graphql_client.clone(),
2085 }
2086 }
2087 pub fn as_changeset(&self) -> Changeset {
2089 let query = self.selection.select("asChangeset");
2090 Changeset {
2091 proc: self.proc.clone(),
2092 selection: query,
2093 graphql_client: self.graphql_client.clone(),
2094 }
2095 }
2096 pub fn as_check(&self) -> Check {
2098 let query = self.selection.select("asCheck");
2099 Check {
2100 proc: self.proc.clone(),
2101 selection: query,
2102 graphql_client: self.graphql_client.clone(),
2103 }
2104 }
2105 pub fn as_check_group(&self) -> CheckGroup {
2107 let query = self.selection.select("asCheckGroup");
2108 CheckGroup {
2109 proc: self.proc.clone(),
2110 selection: query,
2111 graphql_client: self.graphql_client.clone(),
2112 }
2113 }
2114 pub fn as_cloud(&self) -> Cloud {
2116 let query = self.selection.select("asCloud");
2117 Cloud {
2118 proc: self.proc.clone(),
2119 selection: query,
2120 graphql_client: self.graphql_client.clone(),
2121 }
2122 }
2123 pub fn as_container(&self) -> Container {
2125 let query = self.selection.select("asContainer");
2126 Container {
2127 proc: self.proc.clone(),
2128 selection: query,
2129 graphql_client: self.graphql_client.clone(),
2130 }
2131 }
2132 pub fn as_directory(&self) -> Directory {
2134 let query = self.selection.select("asDirectory");
2135 Directory {
2136 proc: self.proc.clone(),
2137 selection: query,
2138 graphql_client: self.graphql_client.clone(),
2139 }
2140 }
2141 pub fn as_env(&self) -> Env {
2143 let query = self.selection.select("asEnv");
2144 Env {
2145 proc: self.proc.clone(),
2146 selection: query,
2147 graphql_client: self.graphql_client.clone(),
2148 }
2149 }
2150 pub fn as_env_file(&self) -> EnvFile {
2152 let query = self.selection.select("asEnvFile");
2153 EnvFile {
2154 proc: self.proc.clone(),
2155 selection: query,
2156 graphql_client: self.graphql_client.clone(),
2157 }
2158 }
2159 pub fn as_file(&self) -> File {
2161 let query = self.selection.select("asFile");
2162 File {
2163 proc: self.proc.clone(),
2164 selection: query,
2165 graphql_client: self.graphql_client.clone(),
2166 }
2167 }
2168 pub fn as_git_ref(&self) -> GitRef {
2170 let query = self.selection.select("asGitRef");
2171 GitRef {
2172 proc: self.proc.clone(),
2173 selection: query,
2174 graphql_client: self.graphql_client.clone(),
2175 }
2176 }
2177 pub fn as_git_repository(&self) -> GitRepository {
2179 let query = self.selection.select("asGitRepository");
2180 GitRepository {
2181 proc: self.proc.clone(),
2182 selection: query,
2183 graphql_client: self.graphql_client.clone(),
2184 }
2185 }
2186 pub fn as_json_value(&self) -> JsonValue {
2188 let query = self.selection.select("asJSONValue");
2189 JsonValue {
2190 proc: self.proc.clone(),
2191 selection: query,
2192 graphql_client: self.graphql_client.clone(),
2193 }
2194 }
2195 pub fn as_module(&self) -> Module {
2197 let query = self.selection.select("asModule");
2198 Module {
2199 proc: self.proc.clone(),
2200 selection: query,
2201 graphql_client: self.graphql_client.clone(),
2202 }
2203 }
2204 pub fn as_module_config_client(&self) -> ModuleConfigClient {
2206 let query = self.selection.select("asModuleConfigClient");
2207 ModuleConfigClient {
2208 proc: self.proc.clone(),
2209 selection: query,
2210 graphql_client: self.graphql_client.clone(),
2211 }
2212 }
2213 pub fn as_module_source(&self) -> ModuleSource {
2215 let query = self.selection.select("asModuleSource");
2216 ModuleSource {
2217 proc: self.proc.clone(),
2218 selection: query,
2219 graphql_client: self.graphql_client.clone(),
2220 }
2221 }
2222 pub fn as_search_result(&self) -> SearchResult {
2224 let query = self.selection.select("asSearchResult");
2225 SearchResult {
2226 proc: self.proc.clone(),
2227 selection: query,
2228 graphql_client: self.graphql_client.clone(),
2229 }
2230 }
2231 pub fn as_search_submatch(&self) -> SearchSubmatch {
2233 let query = self.selection.select("asSearchSubmatch");
2234 SearchSubmatch {
2235 proc: self.proc.clone(),
2236 selection: query,
2237 graphql_client: self.graphql_client.clone(),
2238 }
2239 }
2240 pub fn as_secret(&self) -> Secret {
2242 let query = self.selection.select("asSecret");
2243 Secret {
2244 proc: self.proc.clone(),
2245 selection: query,
2246 graphql_client: self.graphql_client.clone(),
2247 }
2248 }
2249 pub fn as_service(&self) -> Service {
2251 let query = self.selection.select("asService");
2252 Service {
2253 proc: self.proc.clone(),
2254 selection: query,
2255 graphql_client: self.graphql_client.clone(),
2256 }
2257 }
2258 pub fn as_socket(&self) -> Socket {
2260 let query = self.selection.select("asSocket");
2261 Socket {
2262 proc: self.proc.clone(),
2263 selection: query,
2264 graphql_client: self.graphql_client.clone(),
2265 }
2266 }
2267 pub async fn as_string(&self) -> Result<String, DaggerError> {
2269 let query = self.selection.select("asString");
2270 query.execute(self.graphql_client.clone()).await
2271 }
2272 pub async fn digest(&self) -> Result<String, DaggerError> {
2274 let query = self.selection.select("digest");
2275 query.execute(self.graphql_client.clone()).await
2276 }
2277 pub async fn id(&self) -> Result<BindingId, DaggerError> {
2279 let query = self.selection.select("id");
2280 query.execute(self.graphql_client.clone()).await
2281 }
2282 pub async fn is_null(&self) -> Result<bool, DaggerError> {
2284 let query = self.selection.select("isNull");
2285 query.execute(self.graphql_client.clone()).await
2286 }
2287 pub async fn name(&self) -> Result<String, DaggerError> {
2289 let query = self.selection.select("name");
2290 query.execute(self.graphql_client.clone()).await
2291 }
2292 pub async fn type_name(&self) -> Result<String, DaggerError> {
2294 let query = self.selection.select("typeName");
2295 query.execute(self.graphql_client.clone()).await
2296 }
2297}
2298#[derive(Clone)]
2299pub struct CacheVolume {
2300 pub proc: Option<Arc<DaggerSessionProc>>,
2301 pub selection: Selection,
2302 pub graphql_client: DynGraphQLClient,
2303}
2304impl CacheVolume {
2305 pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
2307 let query = self.selection.select("id");
2308 query.execute(self.graphql_client.clone()).await
2309 }
2310}
2311#[derive(Clone)]
2312pub struct Changeset {
2313 pub proc: Option<Arc<DaggerSessionProc>>,
2314 pub selection: Selection,
2315 pub graphql_client: DynGraphQLClient,
2316}
2317impl Changeset {
2318 pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
2320 let query = self.selection.select("addedPaths");
2321 query.execute(self.graphql_client.clone()).await
2322 }
2323 pub fn after(&self) -> Directory {
2325 let query = self.selection.select("after");
2326 Directory {
2327 proc: self.proc.clone(),
2328 selection: query,
2329 graphql_client: self.graphql_client.clone(),
2330 }
2331 }
2332 pub fn as_patch(&self) -> File {
2334 let query = self.selection.select("asPatch");
2335 File {
2336 proc: self.proc.clone(),
2337 selection: query,
2338 graphql_client: self.graphql_client.clone(),
2339 }
2340 }
2341 pub fn before(&self) -> Directory {
2343 let query = self.selection.select("before");
2344 Directory {
2345 proc: self.proc.clone(),
2346 selection: query,
2347 graphql_client: self.graphql_client.clone(),
2348 }
2349 }
2350 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2356 let mut query = self.selection.select("export");
2357 query = query.arg("path", path.into());
2358 query.execute(self.graphql_client.clone()).await
2359 }
2360 pub async fn id(&self) -> Result<ChangesetId, DaggerError> {
2362 let query = self.selection.select("id");
2363 query.execute(self.graphql_client.clone()).await
2364 }
2365 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
2367 let query = self.selection.select("isEmpty");
2368 query.execute(self.graphql_client.clone()).await
2369 }
2370 pub fn layer(&self) -> Directory {
2372 let query = self.selection.select("layer");
2373 Directory {
2374 proc: self.proc.clone(),
2375 selection: query,
2376 graphql_client: self.graphql_client.clone(),
2377 }
2378 }
2379 pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
2381 let query = self.selection.select("modifiedPaths");
2382 query.execute(self.graphql_client.clone()).await
2383 }
2384 pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
2386 let query = self.selection.select("removedPaths");
2387 query.execute(self.graphql_client.clone()).await
2388 }
2389 pub async fn sync(&self) -> Result<ChangesetId, DaggerError> {
2391 let query = self.selection.select("sync");
2392 query.execute(self.graphql_client.clone()).await
2393 }
2394}
2395#[derive(Clone)]
2396pub struct Check {
2397 pub proc: Option<Arc<DaggerSessionProc>>,
2398 pub selection: Selection,
2399 pub graphql_client: DynGraphQLClient,
2400}
2401impl Check {
2402 pub async fn completed(&self) -> Result<bool, DaggerError> {
2404 let query = self.selection.select("completed");
2405 query.execute(self.graphql_client.clone()).await
2406 }
2407 pub async fn description(&self) -> Result<String, DaggerError> {
2409 let query = self.selection.select("description");
2410 query.execute(self.graphql_client.clone()).await
2411 }
2412 pub async fn id(&self) -> Result<CheckId, DaggerError> {
2414 let query = self.selection.select("id");
2415 query.execute(self.graphql_client.clone()).await
2416 }
2417 pub async fn name(&self) -> Result<String, DaggerError> {
2419 let query = self.selection.select("name");
2420 query.execute(self.graphql_client.clone()).await
2421 }
2422 pub async fn passed(&self) -> Result<bool, DaggerError> {
2424 let query = self.selection.select("passed");
2425 query.execute(self.graphql_client.clone()).await
2426 }
2427 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
2429 let query = self.selection.select("path");
2430 query.execute(self.graphql_client.clone()).await
2431 }
2432 pub async fn result_emoji(&self) -> Result<String, DaggerError> {
2434 let query = self.selection.select("resultEmoji");
2435 query.execute(self.graphql_client.clone()).await
2436 }
2437 pub fn run(&self) -> Check {
2439 let query = self.selection.select("run");
2440 Check {
2441 proc: self.proc.clone(),
2442 selection: query,
2443 graphql_client: self.graphql_client.clone(),
2444 }
2445 }
2446}
2447#[derive(Clone)]
2448pub struct CheckGroup {
2449 pub proc: Option<Arc<DaggerSessionProc>>,
2450 pub selection: Selection,
2451 pub graphql_client: DynGraphQLClient,
2452}
2453impl CheckGroup {
2454 pub async fn id(&self) -> Result<CheckGroupId, DaggerError> {
2456 let query = self.selection.select("id");
2457 query.execute(self.graphql_client.clone()).await
2458 }
2459 pub fn list(&self) -> Vec<Check> {
2461 let query = self.selection.select("list");
2462 vec![Check {
2463 proc: self.proc.clone(),
2464 selection: query,
2465 graphql_client: self.graphql_client.clone(),
2466 }]
2467 }
2468 pub fn report(&self) -> File {
2470 let query = self.selection.select("report");
2471 File {
2472 proc: self.proc.clone(),
2473 selection: query,
2474 graphql_client: self.graphql_client.clone(),
2475 }
2476 }
2477 pub fn run(&self) -> CheckGroup {
2479 let query = self.selection.select("run");
2480 CheckGroup {
2481 proc: self.proc.clone(),
2482 selection: query,
2483 graphql_client: self.graphql_client.clone(),
2484 }
2485 }
2486}
2487#[derive(Clone)]
2488pub struct Cloud {
2489 pub proc: Option<Arc<DaggerSessionProc>>,
2490 pub selection: Selection,
2491 pub graphql_client: DynGraphQLClient,
2492}
2493impl Cloud {
2494 pub async fn id(&self) -> Result<CloudId, DaggerError> {
2496 let query = self.selection.select("id");
2497 query.execute(self.graphql_client.clone()).await
2498 }
2499 pub async fn trace_url(&self) -> Result<String, DaggerError> {
2501 let query = self.selection.select("traceURL");
2502 query.execute(self.graphql_client.clone()).await
2503 }
2504}
2505#[derive(Clone)]
2506pub struct Container {
2507 pub proc: Option<Arc<DaggerSessionProc>>,
2508 pub selection: Selection,
2509 pub graphql_client: DynGraphQLClient,
2510}
2511#[derive(Builder, Debug, PartialEq)]
2512pub struct ContainerAsServiceOpts<'a> {
2513 #[builder(setter(into, strip_option), default)]
2516 pub args: Option<Vec<&'a str>>,
2517 #[builder(setter(into, strip_option), default)]
2519 pub expand: Option<bool>,
2520 #[builder(setter(into, strip_option), default)]
2522 pub experimental_privileged_nesting: Option<bool>,
2523 #[builder(setter(into, strip_option), default)]
2525 pub insecure_root_capabilities: Option<bool>,
2526 #[builder(setter(into, strip_option), default)]
2529 pub no_init: Option<bool>,
2530 #[builder(setter(into, strip_option), default)]
2532 pub use_entrypoint: Option<bool>,
2533}
2534#[derive(Builder, Debug, PartialEq)]
2535pub struct ContainerAsTarballOpts {
2536 #[builder(setter(into, strip_option), default)]
2539 pub forced_compression: Option<ImageLayerCompression>,
2540 #[builder(setter(into, strip_option), default)]
2543 pub media_types: Option<ImageMediaTypes>,
2544 #[builder(setter(into, strip_option), default)]
2547 pub platform_variants: Option<Vec<ContainerId>>,
2548}
2549#[derive(Builder, Debug, PartialEq)]
2550pub struct ContainerDirectoryOpts {
2551 #[builder(setter(into, strip_option), default)]
2553 pub expand: Option<bool>,
2554}
2555#[derive(Builder, Debug, PartialEq)]
2556pub struct ContainerExistsOpts {
2557 #[builder(setter(into, strip_option), default)]
2559 pub do_not_follow_symlinks: Option<bool>,
2560 #[builder(setter(into, strip_option), default)]
2562 pub expected_type: Option<ExistsType>,
2563}
2564#[derive(Builder, Debug, PartialEq)]
2565pub struct ContainerExportOpts {
2566 #[builder(setter(into, strip_option), default)]
2568 pub expand: Option<bool>,
2569 #[builder(setter(into, strip_option), default)]
2572 pub forced_compression: Option<ImageLayerCompression>,
2573 #[builder(setter(into, strip_option), default)]
2576 pub media_types: Option<ImageMediaTypes>,
2577 #[builder(setter(into, strip_option), default)]
2580 pub platform_variants: Option<Vec<ContainerId>>,
2581}
2582#[derive(Builder, Debug, PartialEq)]
2583pub struct ContainerExportImageOpts {
2584 #[builder(setter(into, strip_option), default)]
2587 pub forced_compression: Option<ImageLayerCompression>,
2588 #[builder(setter(into, strip_option), default)]
2591 pub media_types: Option<ImageMediaTypes>,
2592 #[builder(setter(into, strip_option), default)]
2595 pub platform_variants: Option<Vec<ContainerId>>,
2596}
2597#[derive(Builder, Debug, PartialEq)]
2598pub struct ContainerFileOpts {
2599 #[builder(setter(into, strip_option), default)]
2601 pub expand: Option<bool>,
2602}
2603#[derive(Builder, Debug, PartialEq)]
2604pub struct ContainerImportOpts<'a> {
2605 #[builder(setter(into, strip_option), default)]
2607 pub tag: Option<&'a str>,
2608}
2609#[derive(Builder, Debug, PartialEq)]
2610pub struct ContainerPublishOpts {
2611 #[builder(setter(into, strip_option), default)]
2614 pub forced_compression: Option<ImageLayerCompression>,
2615 #[builder(setter(into, strip_option), default)]
2618 pub media_types: Option<ImageMediaTypes>,
2619 #[builder(setter(into, strip_option), default)]
2622 pub platform_variants: Option<Vec<ContainerId>>,
2623}
2624#[derive(Builder, Debug, PartialEq)]
2625pub struct ContainerTerminalOpts<'a> {
2626 #[builder(setter(into, strip_option), default)]
2628 pub cmd: Option<Vec<&'a str>>,
2629 #[builder(setter(into, strip_option), default)]
2631 pub experimental_privileged_nesting: Option<bool>,
2632 #[builder(setter(into, strip_option), default)]
2634 pub insecure_root_capabilities: Option<bool>,
2635}
2636#[derive(Builder, Debug, PartialEq)]
2637pub struct ContainerUpOpts<'a> {
2638 #[builder(setter(into, strip_option), default)]
2641 pub args: Option<Vec<&'a str>>,
2642 #[builder(setter(into, strip_option), default)]
2644 pub expand: Option<bool>,
2645 #[builder(setter(into, strip_option), default)]
2647 pub experimental_privileged_nesting: Option<bool>,
2648 #[builder(setter(into, strip_option), default)]
2650 pub insecure_root_capabilities: Option<bool>,
2651 #[builder(setter(into, strip_option), default)]
2654 pub no_init: Option<bool>,
2655 #[builder(setter(into, strip_option), default)]
2658 pub ports: Option<Vec<PortForward>>,
2659 #[builder(setter(into, strip_option), default)]
2661 pub random: Option<bool>,
2662 #[builder(setter(into, strip_option), default)]
2664 pub use_entrypoint: Option<bool>,
2665}
2666#[derive(Builder, Debug, PartialEq)]
2667pub struct ContainerWithDefaultTerminalCmdOpts {
2668 #[builder(setter(into, strip_option), default)]
2670 pub experimental_privileged_nesting: Option<bool>,
2671 #[builder(setter(into, strip_option), default)]
2673 pub insecure_root_capabilities: Option<bool>,
2674}
2675#[derive(Builder, Debug, PartialEq)]
2676pub struct ContainerWithDirectoryOpts<'a> {
2677 #[builder(setter(into, strip_option), default)]
2679 pub exclude: Option<Vec<&'a str>>,
2680 #[builder(setter(into, strip_option), default)]
2682 pub expand: Option<bool>,
2683 #[builder(setter(into, strip_option), default)]
2685 pub gitignore: Option<bool>,
2686 #[builder(setter(into, strip_option), default)]
2688 pub include: Option<Vec<&'a str>>,
2689 #[builder(setter(into, strip_option), default)]
2693 pub owner: Option<&'a str>,
2694}
2695#[derive(Builder, Debug, PartialEq)]
2696pub struct ContainerWithEntrypointOpts {
2697 #[builder(setter(into, strip_option), default)]
2699 pub keep_default_args: Option<bool>,
2700}
2701#[derive(Builder, Debug, PartialEq)]
2702pub struct ContainerWithEnvVariableOpts {
2703 #[builder(setter(into, strip_option), default)]
2705 pub expand: Option<bool>,
2706}
2707#[derive(Builder, Debug, PartialEq)]
2708pub struct ContainerWithExecOpts<'a> {
2709 #[builder(setter(into, strip_option), default)]
2711 pub expand: Option<bool>,
2712 #[builder(setter(into, strip_option), default)]
2714 pub expect: Option<ReturnType>,
2715 #[builder(setter(into, strip_option), default)]
2717 pub experimental_privileged_nesting: Option<bool>,
2718 #[builder(setter(into, strip_option), default)]
2721 pub insecure_root_capabilities: Option<bool>,
2722 #[builder(setter(into, strip_option), default)]
2725 pub no_init: Option<bool>,
2726 #[builder(setter(into, strip_option), default)]
2728 pub redirect_stderr: Option<&'a str>,
2729 #[builder(setter(into, strip_option), default)]
2731 pub redirect_stdin: Option<&'a str>,
2732 #[builder(setter(into, strip_option), default)]
2734 pub redirect_stdout: Option<&'a str>,
2735 #[builder(setter(into, strip_option), default)]
2737 pub stdin: Option<&'a str>,
2738 #[builder(setter(into, strip_option), default)]
2740 pub use_entrypoint: Option<bool>,
2741}
2742#[derive(Builder, Debug, PartialEq)]
2743pub struct ContainerWithExposedPortOpts<'a> {
2744 #[builder(setter(into, strip_option), default)]
2746 pub description: Option<&'a str>,
2747 #[builder(setter(into, strip_option), default)]
2749 pub experimental_skip_healthcheck: Option<bool>,
2750 #[builder(setter(into, strip_option), default)]
2752 pub protocol: Option<NetworkProtocol>,
2753}
2754#[derive(Builder, Debug, PartialEq)]
2755pub struct ContainerWithFileOpts<'a> {
2756 #[builder(setter(into, strip_option), default)]
2758 pub expand: Option<bool>,
2759 #[builder(setter(into, strip_option), default)]
2763 pub owner: Option<&'a str>,
2764 #[builder(setter(into, strip_option), default)]
2766 pub permissions: Option<isize>,
2767}
2768#[derive(Builder, Debug, PartialEq)]
2769pub struct ContainerWithFilesOpts<'a> {
2770 #[builder(setter(into, strip_option), default)]
2772 pub expand: Option<bool>,
2773 #[builder(setter(into, strip_option), default)]
2777 pub owner: Option<&'a str>,
2778 #[builder(setter(into, strip_option), default)]
2780 pub permissions: Option<isize>,
2781}
2782#[derive(Builder, Debug, PartialEq)]
2783pub struct ContainerWithMountedCacheOpts<'a> {
2784 #[builder(setter(into, strip_option), default)]
2786 pub expand: Option<bool>,
2787 #[builder(setter(into, strip_option), default)]
2792 pub owner: Option<&'a str>,
2793 #[builder(setter(into, strip_option), default)]
2795 pub sharing: Option<CacheSharingMode>,
2796 #[builder(setter(into, strip_option), default)]
2798 pub source: Option<DirectoryId>,
2799}
2800#[derive(Builder, Debug, PartialEq)]
2801pub struct ContainerWithMountedDirectoryOpts<'a> {
2802 #[builder(setter(into, strip_option), default)]
2804 pub expand: Option<bool>,
2805 #[builder(setter(into, strip_option), default)]
2809 pub owner: Option<&'a str>,
2810}
2811#[derive(Builder, Debug, PartialEq)]
2812pub struct ContainerWithMountedFileOpts<'a> {
2813 #[builder(setter(into, strip_option), default)]
2815 pub expand: Option<bool>,
2816 #[builder(setter(into, strip_option), default)]
2820 pub owner: Option<&'a str>,
2821}
2822#[derive(Builder, Debug, PartialEq)]
2823pub struct ContainerWithMountedSecretOpts<'a> {
2824 #[builder(setter(into, strip_option), default)]
2826 pub expand: Option<bool>,
2827 #[builder(setter(into, strip_option), default)]
2830 pub mode: Option<isize>,
2831 #[builder(setter(into, strip_option), default)]
2835 pub owner: Option<&'a str>,
2836}
2837#[derive(Builder, Debug, PartialEq)]
2838pub struct ContainerWithMountedTempOpts {
2839 #[builder(setter(into, strip_option), default)]
2841 pub expand: Option<bool>,
2842 #[builder(setter(into, strip_option), default)]
2844 pub size: Option<isize>,
2845}
2846#[derive(Builder, Debug, PartialEq)]
2847pub struct ContainerWithNewFileOpts<'a> {
2848 #[builder(setter(into, strip_option), default)]
2850 pub expand: Option<bool>,
2851 #[builder(setter(into, strip_option), default)]
2855 pub owner: Option<&'a str>,
2856 #[builder(setter(into, strip_option), default)]
2858 pub permissions: Option<isize>,
2859}
2860#[derive(Builder, Debug, PartialEq)]
2861pub struct ContainerWithSymlinkOpts {
2862 #[builder(setter(into, strip_option), default)]
2864 pub expand: Option<bool>,
2865}
2866#[derive(Builder, Debug, PartialEq)]
2867pub struct ContainerWithUnixSocketOpts<'a> {
2868 #[builder(setter(into, strip_option), default)]
2870 pub expand: Option<bool>,
2871 #[builder(setter(into, strip_option), default)]
2875 pub owner: Option<&'a str>,
2876}
2877#[derive(Builder, Debug, PartialEq)]
2878pub struct ContainerWithWorkdirOpts {
2879 #[builder(setter(into, strip_option), default)]
2881 pub expand: Option<bool>,
2882}
2883#[derive(Builder, Debug, PartialEq)]
2884pub struct ContainerWithoutDirectoryOpts {
2885 #[builder(setter(into, strip_option), default)]
2887 pub expand: Option<bool>,
2888}
2889#[derive(Builder, Debug, PartialEq)]
2890pub struct ContainerWithoutEntrypointOpts {
2891 #[builder(setter(into, strip_option), default)]
2893 pub keep_default_args: Option<bool>,
2894}
2895#[derive(Builder, Debug, PartialEq)]
2896pub struct ContainerWithoutExposedPortOpts {
2897 #[builder(setter(into, strip_option), default)]
2899 pub protocol: Option<NetworkProtocol>,
2900}
2901#[derive(Builder, Debug, PartialEq)]
2902pub struct ContainerWithoutFileOpts {
2903 #[builder(setter(into, strip_option), default)]
2905 pub expand: Option<bool>,
2906}
2907#[derive(Builder, Debug, PartialEq)]
2908pub struct ContainerWithoutFilesOpts {
2909 #[builder(setter(into, strip_option), default)]
2911 pub expand: Option<bool>,
2912}
2913#[derive(Builder, Debug, PartialEq)]
2914pub struct ContainerWithoutMountOpts {
2915 #[builder(setter(into, strip_option), default)]
2917 pub expand: Option<bool>,
2918}
2919#[derive(Builder, Debug, PartialEq)]
2920pub struct ContainerWithoutUnixSocketOpts {
2921 #[builder(setter(into, strip_option), default)]
2923 pub expand: Option<bool>,
2924}
2925impl Container {
2926 pub fn as_service(&self) -> Service {
2933 let query = self.selection.select("asService");
2934 Service {
2935 proc: self.proc.clone(),
2936 selection: query,
2937 graphql_client: self.graphql_client.clone(),
2938 }
2939 }
2940 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2947 let mut query = self.selection.select("asService");
2948 if let Some(args) = opts.args {
2949 query = query.arg("args", args);
2950 }
2951 if let Some(use_entrypoint) = opts.use_entrypoint {
2952 query = query.arg("useEntrypoint", use_entrypoint);
2953 }
2954 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2955 query = query.arg(
2956 "experimentalPrivilegedNesting",
2957 experimental_privileged_nesting,
2958 );
2959 }
2960 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2961 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2962 }
2963 if let Some(expand) = opts.expand {
2964 query = query.arg("expand", expand);
2965 }
2966 if let Some(no_init) = opts.no_init {
2967 query = query.arg("noInit", no_init);
2968 }
2969 Service {
2970 proc: self.proc.clone(),
2971 selection: query,
2972 graphql_client: self.graphql_client.clone(),
2973 }
2974 }
2975 pub fn as_tarball(&self) -> File {
2981 let query = self.selection.select("asTarball");
2982 File {
2983 proc: self.proc.clone(),
2984 selection: query,
2985 graphql_client: self.graphql_client.clone(),
2986 }
2987 }
2988 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2994 let mut query = self.selection.select("asTarball");
2995 if let Some(platform_variants) = opts.platform_variants {
2996 query = query.arg("platformVariants", platform_variants);
2997 }
2998 if let Some(forced_compression) = opts.forced_compression {
2999 query = query.arg("forcedCompression", forced_compression);
3000 }
3001 if let Some(media_types) = opts.media_types {
3002 query = query.arg("mediaTypes", media_types);
3003 }
3004 File {
3005 proc: self.proc.clone(),
3006 selection: query,
3007 graphql_client: self.graphql_client.clone(),
3008 }
3009 }
3010 pub async fn combined_output(&self) -> Result<String, DaggerError> {
3013 let query = self.selection.select("combinedOutput");
3014 query.execute(self.graphql_client.clone()).await
3015 }
3016 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
3018 let query = self.selection.select("defaultArgs");
3019 query.execute(self.graphql_client.clone()).await
3020 }
3021 pub fn directory(&self, path: impl Into<String>) -> Directory {
3029 let mut query = self.selection.select("directory");
3030 query = query.arg("path", path.into());
3031 Directory {
3032 proc: self.proc.clone(),
3033 selection: query,
3034 graphql_client: self.graphql_client.clone(),
3035 }
3036 }
3037 pub fn directory_opts(
3045 &self,
3046 path: impl Into<String>,
3047 opts: ContainerDirectoryOpts,
3048 ) -> Directory {
3049 let mut query = self.selection.select("directory");
3050 query = query.arg("path", path.into());
3051 if let Some(expand) = opts.expand {
3052 query = query.arg("expand", expand);
3053 }
3054 Directory {
3055 proc: self.proc.clone(),
3056 selection: query,
3057 graphql_client: self.graphql_client.clone(),
3058 }
3059 }
3060 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
3062 let query = self.selection.select("entrypoint");
3063 query.execute(self.graphql_client.clone()).await
3064 }
3065 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3071 let mut query = self.selection.select("envVariable");
3072 query = query.arg("name", name.into());
3073 query.execute(self.graphql_client.clone()).await
3074 }
3075 pub fn env_variables(&self) -> Vec<EnvVariable> {
3077 let query = self.selection.select("envVariables");
3078 vec![EnvVariable {
3079 proc: self.proc.clone(),
3080 selection: query,
3081 graphql_client: self.graphql_client.clone(),
3082 }]
3083 }
3084 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
3091 let mut query = self.selection.select("exists");
3092 query = query.arg("path", path.into());
3093 query.execute(self.graphql_client.clone()).await
3094 }
3095 pub async fn exists_opts(
3102 &self,
3103 path: impl Into<String>,
3104 opts: ContainerExistsOpts,
3105 ) -> Result<bool, DaggerError> {
3106 let mut query = self.selection.select("exists");
3107 query = query.arg("path", path.into());
3108 if let Some(expected_type) = opts.expected_type {
3109 query = query.arg("expectedType", expected_type);
3110 }
3111 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
3112 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
3113 }
3114 query.execute(self.graphql_client.clone()).await
3115 }
3116 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
3119 let query = self.selection.select("exitCode");
3120 query.execute(self.graphql_client.clone()).await
3121 }
3122 pub fn experimental_with_all_gp_us(&self) -> Container {
3126 let query = self.selection.select("experimentalWithAllGPUs");
3127 Container {
3128 proc: self.proc.clone(),
3129 selection: query,
3130 graphql_client: self.graphql_client.clone(),
3131 }
3132 }
3133 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
3141 let mut query = self.selection.select("experimentalWithGPU");
3142 query = query.arg(
3143 "devices",
3144 devices
3145 .into_iter()
3146 .map(|i| i.into())
3147 .collect::<Vec<String>>(),
3148 );
3149 Container {
3150 proc: self.proc.clone(),
3151 selection: query,
3152 graphql_client: self.graphql_client.clone(),
3153 }
3154 }
3155 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
3165 let mut query = self.selection.select("export");
3166 query = query.arg("path", path.into());
3167 query.execute(self.graphql_client.clone()).await
3168 }
3169 pub async fn export_opts(
3179 &self,
3180 path: impl Into<String>,
3181 opts: ContainerExportOpts,
3182 ) -> Result<String, DaggerError> {
3183 let mut query = self.selection.select("export");
3184 query = query.arg("path", path.into());
3185 if let Some(platform_variants) = opts.platform_variants {
3186 query = query.arg("platformVariants", platform_variants);
3187 }
3188 if let Some(forced_compression) = opts.forced_compression {
3189 query = query.arg("forcedCompression", forced_compression);
3190 }
3191 if let Some(media_types) = opts.media_types {
3192 query = query.arg("mediaTypes", media_types);
3193 }
3194 if let Some(expand) = opts.expand {
3195 query = query.arg("expand", expand);
3196 }
3197 query.execute(self.graphql_client.clone()).await
3198 }
3199 pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
3206 let mut query = self.selection.select("exportImage");
3207 query = query.arg("name", name.into());
3208 query.execute(self.graphql_client.clone()).await
3209 }
3210 pub async fn export_image_opts(
3217 &self,
3218 name: impl Into<String>,
3219 opts: ContainerExportImageOpts,
3220 ) -> Result<Void, DaggerError> {
3221 let mut query = self.selection.select("exportImage");
3222 query = query.arg("name", name.into());
3223 if let Some(platform_variants) = opts.platform_variants {
3224 query = query.arg("platformVariants", platform_variants);
3225 }
3226 if let Some(forced_compression) = opts.forced_compression {
3227 query = query.arg("forcedCompression", forced_compression);
3228 }
3229 if let Some(media_types) = opts.media_types {
3230 query = query.arg("mediaTypes", media_types);
3231 }
3232 query.execute(self.graphql_client.clone()).await
3233 }
3234 pub fn exposed_ports(&self) -> Vec<Port> {
3237 let query = self.selection.select("exposedPorts");
3238 vec![Port {
3239 proc: self.proc.clone(),
3240 selection: query,
3241 graphql_client: self.graphql_client.clone(),
3242 }]
3243 }
3244 pub fn file(&self, path: impl Into<String>) -> File {
3252 let mut query = self.selection.select("file");
3253 query = query.arg("path", path.into());
3254 File {
3255 proc: self.proc.clone(),
3256 selection: query,
3257 graphql_client: self.graphql_client.clone(),
3258 }
3259 }
3260 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
3268 let mut query = self.selection.select("file");
3269 query = query.arg("path", path.into());
3270 if let Some(expand) = opts.expand {
3271 query = query.arg("expand", expand);
3272 }
3273 File {
3274 proc: self.proc.clone(),
3275 selection: query,
3276 graphql_client: self.graphql_client.clone(),
3277 }
3278 }
3279 pub fn from(&self, address: impl Into<String>) -> Container {
3285 let mut query = self.selection.select("from");
3286 query = query.arg("address", address.into());
3287 Container {
3288 proc: self.proc.clone(),
3289 selection: query,
3290 graphql_client: self.graphql_client.clone(),
3291 }
3292 }
3293 pub async fn id(&self) -> Result<ContainerId, DaggerError> {
3295 let query = self.selection.select("id");
3296 query.execute(self.graphql_client.clone()).await
3297 }
3298 pub async fn image_ref(&self) -> Result<String, DaggerError> {
3300 let query = self.selection.select("imageRef");
3301 query.execute(self.graphql_client.clone()).await
3302 }
3303 pub fn import(&self, source: impl IntoID<FileId>) -> Container {
3310 let mut query = self.selection.select("import");
3311 query = query.arg_lazy(
3312 "source",
3313 Box::new(move || {
3314 let source = source.clone();
3315 Box::pin(async move { source.into_id().await.unwrap().quote() })
3316 }),
3317 );
3318 Container {
3319 proc: self.proc.clone(),
3320 selection: query,
3321 graphql_client: self.graphql_client.clone(),
3322 }
3323 }
3324 pub fn import_opts<'a>(
3331 &self,
3332 source: impl IntoID<FileId>,
3333 opts: ContainerImportOpts<'a>,
3334 ) -> Container {
3335 let mut query = self.selection.select("import");
3336 query = query.arg_lazy(
3337 "source",
3338 Box::new(move || {
3339 let source = source.clone();
3340 Box::pin(async move { source.into_id().await.unwrap().quote() })
3341 }),
3342 );
3343 if let Some(tag) = opts.tag {
3344 query = query.arg("tag", tag);
3345 }
3346 Container {
3347 proc: self.proc.clone(),
3348 selection: query,
3349 graphql_client: self.graphql_client.clone(),
3350 }
3351 }
3352 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
3358 let mut query = self.selection.select("label");
3359 query = query.arg("name", name.into());
3360 query.execute(self.graphql_client.clone()).await
3361 }
3362 pub fn labels(&self) -> Vec<Label> {
3364 let query = self.selection.select("labels");
3365 vec![Label {
3366 proc: self.proc.clone(),
3367 selection: query,
3368 graphql_client: self.graphql_client.clone(),
3369 }]
3370 }
3371 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
3373 let query = self.selection.select("mounts");
3374 query.execute(self.graphql_client.clone()).await
3375 }
3376 pub async fn platform(&self) -> Result<Platform, DaggerError> {
3378 let query = self.selection.select("platform");
3379 query.execute(self.graphql_client.clone()).await
3380 }
3381 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
3391 let mut query = self.selection.select("publish");
3392 query = query.arg("address", address.into());
3393 query.execute(self.graphql_client.clone()).await
3394 }
3395 pub async fn publish_opts(
3405 &self,
3406 address: impl Into<String>,
3407 opts: ContainerPublishOpts,
3408 ) -> Result<String, DaggerError> {
3409 let mut query = self.selection.select("publish");
3410 query = query.arg("address", address.into());
3411 if let Some(platform_variants) = opts.platform_variants {
3412 query = query.arg("platformVariants", platform_variants);
3413 }
3414 if let Some(forced_compression) = opts.forced_compression {
3415 query = query.arg("forcedCompression", forced_compression);
3416 }
3417 if let Some(media_types) = opts.media_types {
3418 query = query.arg("mediaTypes", media_types);
3419 }
3420 query.execute(self.graphql_client.clone()).await
3421 }
3422 pub fn rootfs(&self) -> Directory {
3424 let query = self.selection.select("rootfs");
3425 Directory {
3426 proc: self.proc.clone(),
3427 selection: query,
3428 graphql_client: self.graphql_client.clone(),
3429 }
3430 }
3431 pub async fn stderr(&self) -> Result<String, DaggerError> {
3434 let query = self.selection.select("stderr");
3435 query.execute(self.graphql_client.clone()).await
3436 }
3437 pub async fn stdout(&self) -> Result<String, DaggerError> {
3440 let query = self.selection.select("stdout");
3441 query.execute(self.graphql_client.clone()).await
3442 }
3443 pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
3446 let query = self.selection.select("sync");
3447 query.execute(self.graphql_client.clone()).await
3448 }
3449 pub fn terminal(&self) -> Container {
3455 let query = self.selection.select("terminal");
3456 Container {
3457 proc: self.proc.clone(),
3458 selection: query,
3459 graphql_client: self.graphql_client.clone(),
3460 }
3461 }
3462 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
3468 let mut query = self.selection.select("terminal");
3469 if let Some(cmd) = opts.cmd {
3470 query = query.arg("cmd", cmd);
3471 }
3472 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3473 query = query.arg(
3474 "experimentalPrivilegedNesting",
3475 experimental_privileged_nesting,
3476 );
3477 }
3478 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3479 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3480 }
3481 Container {
3482 proc: self.proc.clone(),
3483 selection: query,
3484 graphql_client: self.graphql_client.clone(),
3485 }
3486 }
3487 pub async fn up(&self) -> Result<Void, DaggerError> {
3494 let query = self.selection.select("up");
3495 query.execute(self.graphql_client.clone()).await
3496 }
3497 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
3504 let mut query = self.selection.select("up");
3505 if let Some(random) = opts.random {
3506 query = query.arg("random", random);
3507 }
3508 if let Some(ports) = opts.ports {
3509 query = query.arg("ports", ports);
3510 }
3511 if let Some(args) = opts.args {
3512 query = query.arg("args", args);
3513 }
3514 if let Some(use_entrypoint) = opts.use_entrypoint {
3515 query = query.arg("useEntrypoint", use_entrypoint);
3516 }
3517 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3518 query = query.arg(
3519 "experimentalPrivilegedNesting",
3520 experimental_privileged_nesting,
3521 );
3522 }
3523 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3524 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3525 }
3526 if let Some(expand) = opts.expand {
3527 query = query.arg("expand", expand);
3528 }
3529 if let Some(no_init) = opts.no_init {
3530 query = query.arg("noInit", no_init);
3531 }
3532 query.execute(self.graphql_client.clone()).await
3533 }
3534 pub async fn user(&self) -> Result<String, DaggerError> {
3536 let query = self.selection.select("user");
3537 query.execute(self.graphql_client.clone()).await
3538 }
3539 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3546 let mut query = self.selection.select("withAnnotation");
3547 query = query.arg("name", name.into());
3548 query = query.arg("value", value.into());
3549 Container {
3550 proc: self.proc.clone(),
3551 selection: query,
3552 graphql_client: self.graphql_client.clone(),
3553 }
3554 }
3555 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
3561 let mut query = self.selection.select("withDefaultArgs");
3562 query = query.arg(
3563 "args",
3564 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3565 );
3566 Container {
3567 proc: self.proc.clone(),
3568 selection: query,
3569 graphql_client: self.graphql_client.clone(),
3570 }
3571 }
3572 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
3579 let mut query = self.selection.select("withDefaultTerminalCmd");
3580 query = query.arg(
3581 "args",
3582 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3583 );
3584 Container {
3585 proc: self.proc.clone(),
3586 selection: query,
3587 graphql_client: self.graphql_client.clone(),
3588 }
3589 }
3590 pub fn with_default_terminal_cmd_opts(
3597 &self,
3598 args: Vec<impl Into<String>>,
3599 opts: ContainerWithDefaultTerminalCmdOpts,
3600 ) -> Container {
3601 let mut query = self.selection.select("withDefaultTerminalCmd");
3602 query = query.arg(
3603 "args",
3604 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3605 );
3606 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3607 query = query.arg(
3608 "experimentalPrivilegedNesting",
3609 experimental_privileged_nesting,
3610 );
3611 }
3612 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3613 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3614 }
3615 Container {
3616 proc: self.proc.clone(),
3617 selection: query,
3618 graphql_client: self.graphql_client.clone(),
3619 }
3620 }
3621 pub fn with_directory(
3629 &self,
3630 path: impl Into<String>,
3631 source: impl IntoID<DirectoryId>,
3632 ) -> Container {
3633 let mut query = self.selection.select("withDirectory");
3634 query = query.arg("path", path.into());
3635 query = query.arg_lazy(
3636 "source",
3637 Box::new(move || {
3638 let source = source.clone();
3639 Box::pin(async move { source.into_id().await.unwrap().quote() })
3640 }),
3641 );
3642 Container {
3643 proc: self.proc.clone(),
3644 selection: query,
3645 graphql_client: self.graphql_client.clone(),
3646 }
3647 }
3648 pub fn with_directory_opts<'a>(
3656 &self,
3657 path: impl Into<String>,
3658 source: impl IntoID<DirectoryId>,
3659 opts: ContainerWithDirectoryOpts<'a>,
3660 ) -> Container {
3661 let mut query = self.selection.select("withDirectory");
3662 query = query.arg("path", path.into());
3663 query = query.arg_lazy(
3664 "source",
3665 Box::new(move || {
3666 let source = source.clone();
3667 Box::pin(async move { source.into_id().await.unwrap().quote() })
3668 }),
3669 );
3670 if let Some(exclude) = opts.exclude {
3671 query = query.arg("exclude", exclude);
3672 }
3673 if let Some(include) = opts.include {
3674 query = query.arg("include", include);
3675 }
3676 if let Some(gitignore) = opts.gitignore {
3677 query = query.arg("gitignore", gitignore);
3678 }
3679 if let Some(owner) = opts.owner {
3680 query = query.arg("owner", owner);
3681 }
3682 if let Some(expand) = opts.expand {
3683 query = query.arg("expand", expand);
3684 }
3685 Container {
3686 proc: self.proc.clone(),
3687 selection: query,
3688 graphql_client: self.graphql_client.clone(),
3689 }
3690 }
3691 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
3698 let mut query = self.selection.select("withEntrypoint");
3699 query = query.arg(
3700 "args",
3701 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3702 );
3703 Container {
3704 proc: self.proc.clone(),
3705 selection: query,
3706 graphql_client: self.graphql_client.clone(),
3707 }
3708 }
3709 pub fn with_entrypoint_opts(
3716 &self,
3717 args: Vec<impl Into<String>>,
3718 opts: ContainerWithEntrypointOpts,
3719 ) -> Container {
3720 let mut query = self.selection.select("withEntrypoint");
3721 query = query.arg(
3722 "args",
3723 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3724 );
3725 if let Some(keep_default_args) = opts.keep_default_args {
3726 query = query.arg("keepDefaultArgs", keep_default_args);
3727 }
3728 Container {
3729 proc: self.proc.clone(),
3730 selection: query,
3731 graphql_client: self.graphql_client.clone(),
3732 }
3733 }
3734 pub fn with_env_variable(
3742 &self,
3743 name: impl Into<String>,
3744 value: impl Into<String>,
3745 ) -> Container {
3746 let mut query = self.selection.select("withEnvVariable");
3747 query = query.arg("name", name.into());
3748 query = query.arg("value", value.into());
3749 Container {
3750 proc: self.proc.clone(),
3751 selection: query,
3752 graphql_client: self.graphql_client.clone(),
3753 }
3754 }
3755 pub fn with_env_variable_opts(
3763 &self,
3764 name: impl Into<String>,
3765 value: impl Into<String>,
3766 opts: ContainerWithEnvVariableOpts,
3767 ) -> Container {
3768 let mut query = self.selection.select("withEnvVariable");
3769 query = query.arg("name", name.into());
3770 query = query.arg("value", value.into());
3771 if let Some(expand) = opts.expand {
3772 query = query.arg("expand", expand);
3773 }
3774 Container {
3775 proc: self.proc.clone(),
3776 selection: query,
3777 graphql_client: self.graphql_client.clone(),
3778 }
3779 }
3780 pub fn with_error(&self, err: impl Into<String>) -> Container {
3786 let mut query = self.selection.select("withError");
3787 query = query.arg("err", err.into());
3788 Container {
3789 proc: self.proc.clone(),
3790 selection: query,
3791 graphql_client: self.graphql_client.clone(),
3792 }
3793 }
3794 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3805 let mut query = self.selection.select("withExec");
3806 query = query.arg(
3807 "args",
3808 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3809 );
3810 Container {
3811 proc: self.proc.clone(),
3812 selection: query,
3813 graphql_client: self.graphql_client.clone(),
3814 }
3815 }
3816 pub fn with_exec_opts<'a>(
3827 &self,
3828 args: Vec<impl Into<String>>,
3829 opts: ContainerWithExecOpts<'a>,
3830 ) -> Container {
3831 let mut query = self.selection.select("withExec");
3832 query = query.arg(
3833 "args",
3834 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3835 );
3836 if let Some(use_entrypoint) = opts.use_entrypoint {
3837 query = query.arg("useEntrypoint", use_entrypoint);
3838 }
3839 if let Some(stdin) = opts.stdin {
3840 query = query.arg("stdin", stdin);
3841 }
3842 if let Some(redirect_stdin) = opts.redirect_stdin {
3843 query = query.arg("redirectStdin", redirect_stdin);
3844 }
3845 if let Some(redirect_stdout) = opts.redirect_stdout {
3846 query = query.arg("redirectStdout", redirect_stdout);
3847 }
3848 if let Some(redirect_stderr) = opts.redirect_stderr {
3849 query = query.arg("redirectStderr", redirect_stderr);
3850 }
3851 if let Some(expect) = opts.expect {
3852 query = query.arg("expect", expect);
3853 }
3854 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3855 query = query.arg(
3856 "experimentalPrivilegedNesting",
3857 experimental_privileged_nesting,
3858 );
3859 }
3860 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3861 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3862 }
3863 if let Some(expand) = opts.expand {
3864 query = query.arg("expand", expand);
3865 }
3866 if let Some(no_init) = opts.no_init {
3867 query = query.arg("noInit", no_init);
3868 }
3869 Container {
3870 proc: self.proc.clone(),
3871 selection: query,
3872 graphql_client: self.graphql_client.clone(),
3873 }
3874 }
3875 pub fn with_exposed_port(&self, port: isize) -> Container {
3885 let mut query = self.selection.select("withExposedPort");
3886 query = query.arg("port", port);
3887 Container {
3888 proc: self.proc.clone(),
3889 selection: query,
3890 graphql_client: self.graphql_client.clone(),
3891 }
3892 }
3893 pub fn with_exposed_port_opts<'a>(
3903 &self,
3904 port: isize,
3905 opts: ContainerWithExposedPortOpts<'a>,
3906 ) -> Container {
3907 let mut query = self.selection.select("withExposedPort");
3908 query = query.arg("port", port);
3909 if let Some(protocol) = opts.protocol {
3910 query = query.arg("protocol", protocol);
3911 }
3912 if let Some(description) = opts.description {
3913 query = query.arg("description", description);
3914 }
3915 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3916 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3917 }
3918 Container {
3919 proc: self.proc.clone(),
3920 selection: query,
3921 graphql_client: self.graphql_client.clone(),
3922 }
3923 }
3924 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
3932 let mut query = self.selection.select("withFile");
3933 query = query.arg("path", path.into());
3934 query = query.arg_lazy(
3935 "source",
3936 Box::new(move || {
3937 let source = source.clone();
3938 Box::pin(async move { source.into_id().await.unwrap().quote() })
3939 }),
3940 );
3941 Container {
3942 proc: self.proc.clone(),
3943 selection: query,
3944 graphql_client: self.graphql_client.clone(),
3945 }
3946 }
3947 pub fn with_file_opts<'a>(
3955 &self,
3956 path: impl Into<String>,
3957 source: impl IntoID<FileId>,
3958 opts: ContainerWithFileOpts<'a>,
3959 ) -> Container {
3960 let mut query = self.selection.select("withFile");
3961 query = query.arg("path", path.into());
3962 query = query.arg_lazy(
3963 "source",
3964 Box::new(move || {
3965 let source = source.clone();
3966 Box::pin(async move { source.into_id().await.unwrap().quote() })
3967 }),
3968 );
3969 if let Some(permissions) = opts.permissions {
3970 query = query.arg("permissions", permissions);
3971 }
3972 if let Some(owner) = opts.owner {
3973 query = query.arg("owner", owner);
3974 }
3975 if let Some(expand) = opts.expand {
3976 query = query.arg("expand", expand);
3977 }
3978 Container {
3979 proc: self.proc.clone(),
3980 selection: query,
3981 graphql_client: self.graphql_client.clone(),
3982 }
3983 }
3984 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
3992 let mut query = self.selection.select("withFiles");
3993 query = query.arg("path", path.into());
3994 query = query.arg("sources", sources);
3995 Container {
3996 proc: self.proc.clone(),
3997 selection: query,
3998 graphql_client: self.graphql_client.clone(),
3999 }
4000 }
4001 pub fn with_files_opts<'a>(
4009 &self,
4010 path: impl Into<String>,
4011 sources: Vec<FileId>,
4012 opts: ContainerWithFilesOpts<'a>,
4013 ) -> Container {
4014 let mut query = self.selection.select("withFiles");
4015 query = query.arg("path", path.into());
4016 query = query.arg("sources", sources);
4017 if let Some(permissions) = opts.permissions {
4018 query = query.arg("permissions", permissions);
4019 }
4020 if let Some(owner) = opts.owner {
4021 query = query.arg("owner", owner);
4022 }
4023 if let Some(expand) = opts.expand {
4024 query = query.arg("expand", expand);
4025 }
4026 Container {
4027 proc: self.proc.clone(),
4028 selection: query,
4029 graphql_client: self.graphql_client.clone(),
4030 }
4031 }
4032 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
4039 let mut query = self.selection.select("withLabel");
4040 query = query.arg("name", name.into());
4041 query = query.arg("value", value.into());
4042 Container {
4043 proc: self.proc.clone(),
4044 selection: query,
4045 graphql_client: self.graphql_client.clone(),
4046 }
4047 }
4048 pub fn with_mounted_cache(
4056 &self,
4057 path: impl Into<String>,
4058 cache: impl IntoID<CacheVolumeId>,
4059 ) -> Container {
4060 let mut query = self.selection.select("withMountedCache");
4061 query = query.arg("path", path.into());
4062 query = query.arg_lazy(
4063 "cache",
4064 Box::new(move || {
4065 let cache = cache.clone();
4066 Box::pin(async move { cache.into_id().await.unwrap().quote() })
4067 }),
4068 );
4069 Container {
4070 proc: self.proc.clone(),
4071 selection: query,
4072 graphql_client: self.graphql_client.clone(),
4073 }
4074 }
4075 pub fn with_mounted_cache_opts<'a>(
4083 &self,
4084 path: impl Into<String>,
4085 cache: impl IntoID<CacheVolumeId>,
4086 opts: ContainerWithMountedCacheOpts<'a>,
4087 ) -> Container {
4088 let mut query = self.selection.select("withMountedCache");
4089 query = query.arg("path", path.into());
4090 query = query.arg_lazy(
4091 "cache",
4092 Box::new(move || {
4093 let cache = cache.clone();
4094 Box::pin(async move { cache.into_id().await.unwrap().quote() })
4095 }),
4096 );
4097 if let Some(source) = opts.source {
4098 query = query.arg("source", source);
4099 }
4100 if let Some(sharing) = opts.sharing {
4101 query = query.arg("sharing", sharing);
4102 }
4103 if let Some(owner) = opts.owner {
4104 query = query.arg("owner", owner);
4105 }
4106 if let Some(expand) = opts.expand {
4107 query = query.arg("expand", expand);
4108 }
4109 Container {
4110 proc: self.proc.clone(),
4111 selection: query,
4112 graphql_client: self.graphql_client.clone(),
4113 }
4114 }
4115 pub fn with_mounted_directory(
4123 &self,
4124 path: impl Into<String>,
4125 source: impl IntoID<DirectoryId>,
4126 ) -> Container {
4127 let mut query = self.selection.select("withMountedDirectory");
4128 query = query.arg("path", path.into());
4129 query = query.arg_lazy(
4130 "source",
4131 Box::new(move || {
4132 let source = source.clone();
4133 Box::pin(async move { source.into_id().await.unwrap().quote() })
4134 }),
4135 );
4136 Container {
4137 proc: self.proc.clone(),
4138 selection: query,
4139 graphql_client: self.graphql_client.clone(),
4140 }
4141 }
4142 pub fn with_mounted_directory_opts<'a>(
4150 &self,
4151 path: impl Into<String>,
4152 source: impl IntoID<DirectoryId>,
4153 opts: ContainerWithMountedDirectoryOpts<'a>,
4154 ) -> Container {
4155 let mut query = self.selection.select("withMountedDirectory");
4156 query = query.arg("path", path.into());
4157 query = query.arg_lazy(
4158 "source",
4159 Box::new(move || {
4160 let source = source.clone();
4161 Box::pin(async move { source.into_id().await.unwrap().quote() })
4162 }),
4163 );
4164 if let Some(owner) = opts.owner {
4165 query = query.arg("owner", owner);
4166 }
4167 if let Some(expand) = opts.expand {
4168 query = query.arg("expand", expand);
4169 }
4170 Container {
4171 proc: self.proc.clone(),
4172 selection: query,
4173 graphql_client: self.graphql_client.clone(),
4174 }
4175 }
4176 pub fn with_mounted_file(
4184 &self,
4185 path: impl Into<String>,
4186 source: impl IntoID<FileId>,
4187 ) -> Container {
4188 let mut query = self.selection.select("withMountedFile");
4189 query = query.arg("path", path.into());
4190 query = query.arg_lazy(
4191 "source",
4192 Box::new(move || {
4193 let source = source.clone();
4194 Box::pin(async move { source.into_id().await.unwrap().quote() })
4195 }),
4196 );
4197 Container {
4198 proc: self.proc.clone(),
4199 selection: query,
4200 graphql_client: self.graphql_client.clone(),
4201 }
4202 }
4203 pub fn with_mounted_file_opts<'a>(
4211 &self,
4212 path: impl Into<String>,
4213 source: impl IntoID<FileId>,
4214 opts: ContainerWithMountedFileOpts<'a>,
4215 ) -> Container {
4216 let mut query = self.selection.select("withMountedFile");
4217 query = query.arg("path", path.into());
4218 query = query.arg_lazy(
4219 "source",
4220 Box::new(move || {
4221 let source = source.clone();
4222 Box::pin(async move { source.into_id().await.unwrap().quote() })
4223 }),
4224 );
4225 if let Some(owner) = opts.owner {
4226 query = query.arg("owner", owner);
4227 }
4228 if let Some(expand) = opts.expand {
4229 query = query.arg("expand", expand);
4230 }
4231 Container {
4232 proc: self.proc.clone(),
4233 selection: query,
4234 graphql_client: self.graphql_client.clone(),
4235 }
4236 }
4237 pub fn with_mounted_secret(
4245 &self,
4246 path: impl Into<String>,
4247 source: impl IntoID<SecretId>,
4248 ) -> Container {
4249 let mut query = self.selection.select("withMountedSecret");
4250 query = query.arg("path", path.into());
4251 query = query.arg_lazy(
4252 "source",
4253 Box::new(move || {
4254 let source = source.clone();
4255 Box::pin(async move { source.into_id().await.unwrap().quote() })
4256 }),
4257 );
4258 Container {
4259 proc: self.proc.clone(),
4260 selection: query,
4261 graphql_client: self.graphql_client.clone(),
4262 }
4263 }
4264 pub fn with_mounted_secret_opts<'a>(
4272 &self,
4273 path: impl Into<String>,
4274 source: impl IntoID<SecretId>,
4275 opts: ContainerWithMountedSecretOpts<'a>,
4276 ) -> Container {
4277 let mut query = self.selection.select("withMountedSecret");
4278 query = query.arg("path", path.into());
4279 query = query.arg_lazy(
4280 "source",
4281 Box::new(move || {
4282 let source = source.clone();
4283 Box::pin(async move { source.into_id().await.unwrap().quote() })
4284 }),
4285 );
4286 if let Some(owner) = opts.owner {
4287 query = query.arg("owner", owner);
4288 }
4289 if let Some(mode) = opts.mode {
4290 query = query.arg("mode", mode);
4291 }
4292 if let Some(expand) = opts.expand {
4293 query = query.arg("expand", expand);
4294 }
4295 Container {
4296 proc: self.proc.clone(),
4297 selection: query,
4298 graphql_client: self.graphql_client.clone(),
4299 }
4300 }
4301 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
4308 let mut query = self.selection.select("withMountedTemp");
4309 query = query.arg("path", path.into());
4310 Container {
4311 proc: self.proc.clone(),
4312 selection: query,
4313 graphql_client: self.graphql_client.clone(),
4314 }
4315 }
4316 pub fn with_mounted_temp_opts(
4323 &self,
4324 path: impl Into<String>,
4325 opts: ContainerWithMountedTempOpts,
4326 ) -> Container {
4327 let mut query = self.selection.select("withMountedTemp");
4328 query = query.arg("path", path.into());
4329 if let Some(size) = opts.size {
4330 query = query.arg("size", size);
4331 }
4332 if let Some(expand) = opts.expand {
4333 query = query.arg("expand", expand);
4334 }
4335 Container {
4336 proc: self.proc.clone(),
4337 selection: query,
4338 graphql_client: self.graphql_client.clone(),
4339 }
4340 }
4341 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
4349 let mut query = self.selection.select("withNewFile");
4350 query = query.arg("path", path.into());
4351 query = query.arg("contents", contents.into());
4352 Container {
4353 proc: self.proc.clone(),
4354 selection: query,
4355 graphql_client: self.graphql_client.clone(),
4356 }
4357 }
4358 pub fn with_new_file_opts<'a>(
4366 &self,
4367 path: impl Into<String>,
4368 contents: impl Into<String>,
4369 opts: ContainerWithNewFileOpts<'a>,
4370 ) -> Container {
4371 let mut query = self.selection.select("withNewFile");
4372 query = query.arg("path", path.into());
4373 query = query.arg("contents", contents.into());
4374 if let Some(permissions) = opts.permissions {
4375 query = query.arg("permissions", permissions);
4376 }
4377 if let Some(owner) = opts.owner {
4378 query = query.arg("owner", owner);
4379 }
4380 if let Some(expand) = opts.expand {
4381 query = query.arg("expand", expand);
4382 }
4383 Container {
4384 proc: self.proc.clone(),
4385 selection: query,
4386 graphql_client: self.graphql_client.clone(),
4387 }
4388 }
4389 pub fn with_registry_auth(
4397 &self,
4398 address: impl Into<String>,
4399 username: impl Into<String>,
4400 secret: impl IntoID<SecretId>,
4401 ) -> Container {
4402 let mut query = self.selection.select("withRegistryAuth");
4403 query = query.arg("address", address.into());
4404 query = query.arg("username", username.into());
4405 query = query.arg_lazy(
4406 "secret",
4407 Box::new(move || {
4408 let secret = secret.clone();
4409 Box::pin(async move { secret.into_id().await.unwrap().quote() })
4410 }),
4411 );
4412 Container {
4413 proc: self.proc.clone(),
4414 selection: query,
4415 graphql_client: self.graphql_client.clone(),
4416 }
4417 }
4418 pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
4424 let mut query = self.selection.select("withRootfs");
4425 query = query.arg_lazy(
4426 "directory",
4427 Box::new(move || {
4428 let directory = directory.clone();
4429 Box::pin(async move { directory.into_id().await.unwrap().quote() })
4430 }),
4431 );
4432 Container {
4433 proc: self.proc.clone(),
4434 selection: query,
4435 graphql_client: self.graphql_client.clone(),
4436 }
4437 }
4438 pub fn with_secret_variable(
4445 &self,
4446 name: impl Into<String>,
4447 secret: impl IntoID<SecretId>,
4448 ) -> Container {
4449 let mut query = self.selection.select("withSecretVariable");
4450 query = query.arg("name", name.into());
4451 query = query.arg_lazy(
4452 "secret",
4453 Box::new(move || {
4454 let secret = secret.clone();
4455 Box::pin(async move { secret.into_id().await.unwrap().quote() })
4456 }),
4457 );
4458 Container {
4459 proc: self.proc.clone(),
4460 selection: query,
4461 graphql_client: self.graphql_client.clone(),
4462 }
4463 }
4464 pub fn with_service_binding(
4474 &self,
4475 alias: impl Into<String>,
4476 service: impl IntoID<ServiceId>,
4477 ) -> Container {
4478 let mut query = self.selection.select("withServiceBinding");
4479 query = query.arg("alias", alias.into());
4480 query = query.arg_lazy(
4481 "service",
4482 Box::new(move || {
4483 let service = service.clone();
4484 Box::pin(async move { service.into_id().await.unwrap().quote() })
4485 }),
4486 );
4487 Container {
4488 proc: self.proc.clone(),
4489 selection: query,
4490 graphql_client: self.graphql_client.clone(),
4491 }
4492 }
4493 pub fn with_symlink(
4501 &self,
4502 target: impl Into<String>,
4503 link_name: impl Into<String>,
4504 ) -> Container {
4505 let mut query = self.selection.select("withSymlink");
4506 query = query.arg("target", target.into());
4507 query = query.arg("linkName", link_name.into());
4508 Container {
4509 proc: self.proc.clone(),
4510 selection: query,
4511 graphql_client: self.graphql_client.clone(),
4512 }
4513 }
4514 pub fn with_symlink_opts(
4522 &self,
4523 target: impl Into<String>,
4524 link_name: impl Into<String>,
4525 opts: ContainerWithSymlinkOpts,
4526 ) -> Container {
4527 let mut query = self.selection.select("withSymlink");
4528 query = query.arg("target", target.into());
4529 query = query.arg("linkName", link_name.into());
4530 if let Some(expand) = opts.expand {
4531 query = query.arg("expand", expand);
4532 }
4533 Container {
4534 proc: self.proc.clone(),
4535 selection: query,
4536 graphql_client: self.graphql_client.clone(),
4537 }
4538 }
4539 pub fn with_unix_socket(
4547 &self,
4548 path: impl Into<String>,
4549 source: impl IntoID<SocketId>,
4550 ) -> Container {
4551 let mut query = self.selection.select("withUnixSocket");
4552 query = query.arg("path", path.into());
4553 query = query.arg_lazy(
4554 "source",
4555 Box::new(move || {
4556 let source = source.clone();
4557 Box::pin(async move { source.into_id().await.unwrap().quote() })
4558 }),
4559 );
4560 Container {
4561 proc: self.proc.clone(),
4562 selection: query,
4563 graphql_client: self.graphql_client.clone(),
4564 }
4565 }
4566 pub fn with_unix_socket_opts<'a>(
4574 &self,
4575 path: impl Into<String>,
4576 source: impl IntoID<SocketId>,
4577 opts: ContainerWithUnixSocketOpts<'a>,
4578 ) -> Container {
4579 let mut query = self.selection.select("withUnixSocket");
4580 query = query.arg("path", path.into());
4581 query = query.arg_lazy(
4582 "source",
4583 Box::new(move || {
4584 let source = source.clone();
4585 Box::pin(async move { source.into_id().await.unwrap().quote() })
4586 }),
4587 );
4588 if let Some(owner) = opts.owner {
4589 query = query.arg("owner", owner);
4590 }
4591 if let Some(expand) = opts.expand {
4592 query = query.arg("expand", expand);
4593 }
4594 Container {
4595 proc: self.proc.clone(),
4596 selection: query,
4597 graphql_client: self.graphql_client.clone(),
4598 }
4599 }
4600 pub fn with_user(&self, name: impl Into<String>) -> Container {
4606 let mut query = self.selection.select("withUser");
4607 query = query.arg("name", name.into());
4608 Container {
4609 proc: self.proc.clone(),
4610 selection: query,
4611 graphql_client: self.graphql_client.clone(),
4612 }
4613 }
4614 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
4621 let mut query = self.selection.select("withWorkdir");
4622 query = query.arg("path", path.into());
4623 Container {
4624 proc: self.proc.clone(),
4625 selection: query,
4626 graphql_client: self.graphql_client.clone(),
4627 }
4628 }
4629 pub fn with_workdir_opts(
4636 &self,
4637 path: impl Into<String>,
4638 opts: ContainerWithWorkdirOpts,
4639 ) -> Container {
4640 let mut query = self.selection.select("withWorkdir");
4641 query = query.arg("path", path.into());
4642 if let Some(expand) = opts.expand {
4643 query = query.arg("expand", expand);
4644 }
4645 Container {
4646 proc: self.proc.clone(),
4647 selection: query,
4648 graphql_client: self.graphql_client.clone(),
4649 }
4650 }
4651 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
4657 let mut query = self.selection.select("withoutAnnotation");
4658 query = query.arg("name", name.into());
4659 Container {
4660 proc: self.proc.clone(),
4661 selection: query,
4662 graphql_client: self.graphql_client.clone(),
4663 }
4664 }
4665 pub fn without_default_args(&self) -> Container {
4667 let query = self.selection.select("withoutDefaultArgs");
4668 Container {
4669 proc: self.proc.clone(),
4670 selection: query,
4671 graphql_client: self.graphql_client.clone(),
4672 }
4673 }
4674 pub fn without_directory(&self, path: impl Into<String>) -> Container {
4681 let mut query = self.selection.select("withoutDirectory");
4682 query = query.arg("path", path.into());
4683 Container {
4684 proc: self.proc.clone(),
4685 selection: query,
4686 graphql_client: self.graphql_client.clone(),
4687 }
4688 }
4689 pub fn without_directory_opts(
4696 &self,
4697 path: impl Into<String>,
4698 opts: ContainerWithoutDirectoryOpts,
4699 ) -> Container {
4700 let mut query = self.selection.select("withoutDirectory");
4701 query = query.arg("path", path.into());
4702 if let Some(expand) = opts.expand {
4703 query = query.arg("expand", expand);
4704 }
4705 Container {
4706 proc: self.proc.clone(),
4707 selection: query,
4708 graphql_client: self.graphql_client.clone(),
4709 }
4710 }
4711 pub fn without_entrypoint(&self) -> Container {
4717 let query = self.selection.select("withoutEntrypoint");
4718 Container {
4719 proc: self.proc.clone(),
4720 selection: query,
4721 graphql_client: self.graphql_client.clone(),
4722 }
4723 }
4724 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4730 let mut query = self.selection.select("withoutEntrypoint");
4731 if let Some(keep_default_args) = opts.keep_default_args {
4732 query = query.arg("keepDefaultArgs", keep_default_args);
4733 }
4734 Container {
4735 proc: self.proc.clone(),
4736 selection: query,
4737 graphql_client: self.graphql_client.clone(),
4738 }
4739 }
4740 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4746 let mut query = self.selection.select("withoutEnvVariable");
4747 query = query.arg("name", name.into());
4748 Container {
4749 proc: self.proc.clone(),
4750 selection: query,
4751 graphql_client: self.graphql_client.clone(),
4752 }
4753 }
4754 pub fn without_exposed_port(&self, port: isize) -> Container {
4761 let mut query = self.selection.select("withoutExposedPort");
4762 query = query.arg("port", port);
4763 Container {
4764 proc: self.proc.clone(),
4765 selection: query,
4766 graphql_client: self.graphql_client.clone(),
4767 }
4768 }
4769 pub fn without_exposed_port_opts(
4776 &self,
4777 port: isize,
4778 opts: ContainerWithoutExposedPortOpts,
4779 ) -> Container {
4780 let mut query = self.selection.select("withoutExposedPort");
4781 query = query.arg("port", port);
4782 if let Some(protocol) = opts.protocol {
4783 query = query.arg("protocol", protocol);
4784 }
4785 Container {
4786 proc: self.proc.clone(),
4787 selection: query,
4788 graphql_client: self.graphql_client.clone(),
4789 }
4790 }
4791 pub fn without_file(&self, path: impl Into<String>) -> Container {
4798 let mut query = self.selection.select("withoutFile");
4799 query = query.arg("path", path.into());
4800 Container {
4801 proc: self.proc.clone(),
4802 selection: query,
4803 graphql_client: self.graphql_client.clone(),
4804 }
4805 }
4806 pub fn without_file_opts(
4813 &self,
4814 path: impl Into<String>,
4815 opts: ContainerWithoutFileOpts,
4816 ) -> Container {
4817 let mut query = self.selection.select("withoutFile");
4818 query = query.arg("path", path.into());
4819 if let Some(expand) = opts.expand {
4820 query = query.arg("expand", expand);
4821 }
4822 Container {
4823 proc: self.proc.clone(),
4824 selection: query,
4825 graphql_client: self.graphql_client.clone(),
4826 }
4827 }
4828 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4835 let mut query = self.selection.select("withoutFiles");
4836 query = query.arg(
4837 "paths",
4838 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4839 );
4840 Container {
4841 proc: self.proc.clone(),
4842 selection: query,
4843 graphql_client: self.graphql_client.clone(),
4844 }
4845 }
4846 pub fn without_files_opts(
4853 &self,
4854 paths: Vec<impl Into<String>>,
4855 opts: ContainerWithoutFilesOpts,
4856 ) -> Container {
4857 let mut query = self.selection.select("withoutFiles");
4858 query = query.arg(
4859 "paths",
4860 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4861 );
4862 if let Some(expand) = opts.expand {
4863 query = query.arg("expand", expand);
4864 }
4865 Container {
4866 proc: self.proc.clone(),
4867 selection: query,
4868 graphql_client: self.graphql_client.clone(),
4869 }
4870 }
4871 pub fn without_label(&self, name: impl Into<String>) -> Container {
4877 let mut query = self.selection.select("withoutLabel");
4878 query = query.arg("name", name.into());
4879 Container {
4880 proc: self.proc.clone(),
4881 selection: query,
4882 graphql_client: self.graphql_client.clone(),
4883 }
4884 }
4885 pub fn without_mount(&self, path: impl Into<String>) -> Container {
4892 let mut query = self.selection.select("withoutMount");
4893 query = query.arg("path", path.into());
4894 Container {
4895 proc: self.proc.clone(),
4896 selection: query,
4897 graphql_client: self.graphql_client.clone(),
4898 }
4899 }
4900 pub fn without_mount_opts(
4907 &self,
4908 path: impl Into<String>,
4909 opts: ContainerWithoutMountOpts,
4910 ) -> Container {
4911 let mut query = self.selection.select("withoutMount");
4912 query = query.arg("path", path.into());
4913 if let Some(expand) = opts.expand {
4914 query = query.arg("expand", expand);
4915 }
4916 Container {
4917 proc: self.proc.clone(),
4918 selection: query,
4919 graphql_client: self.graphql_client.clone(),
4920 }
4921 }
4922 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4930 let mut query = self.selection.select("withoutRegistryAuth");
4931 query = query.arg("address", address.into());
4932 Container {
4933 proc: self.proc.clone(),
4934 selection: query,
4935 graphql_client: self.graphql_client.clone(),
4936 }
4937 }
4938 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4944 let mut query = self.selection.select("withoutSecretVariable");
4945 query = query.arg("name", name.into());
4946 Container {
4947 proc: self.proc.clone(),
4948 selection: query,
4949 graphql_client: self.graphql_client.clone(),
4950 }
4951 }
4952 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4959 let mut query = self.selection.select("withoutUnixSocket");
4960 query = query.arg("path", path.into());
4961 Container {
4962 proc: self.proc.clone(),
4963 selection: query,
4964 graphql_client: self.graphql_client.clone(),
4965 }
4966 }
4967 pub fn without_unix_socket_opts(
4974 &self,
4975 path: impl Into<String>,
4976 opts: ContainerWithoutUnixSocketOpts,
4977 ) -> Container {
4978 let mut query = self.selection.select("withoutUnixSocket");
4979 query = query.arg("path", path.into());
4980 if let Some(expand) = opts.expand {
4981 query = query.arg("expand", expand);
4982 }
4983 Container {
4984 proc: self.proc.clone(),
4985 selection: query,
4986 graphql_client: self.graphql_client.clone(),
4987 }
4988 }
4989 pub fn without_user(&self) -> Container {
4992 let query = self.selection.select("withoutUser");
4993 Container {
4994 proc: self.proc.clone(),
4995 selection: query,
4996 graphql_client: self.graphql_client.clone(),
4997 }
4998 }
4999 pub fn without_workdir(&self) -> Container {
5002 let query = self.selection.select("withoutWorkdir");
5003 Container {
5004 proc: self.proc.clone(),
5005 selection: query,
5006 graphql_client: self.graphql_client.clone(),
5007 }
5008 }
5009 pub async fn workdir(&self) -> Result<String, DaggerError> {
5011 let query = self.selection.select("workdir");
5012 query.execute(self.graphql_client.clone()).await
5013 }
5014}
5015#[derive(Clone)]
5016pub struct CurrentModule {
5017 pub proc: Option<Arc<DaggerSessionProc>>,
5018 pub selection: Selection,
5019 pub graphql_client: DynGraphQLClient,
5020}
5021#[derive(Builder, Debug, PartialEq)]
5022pub struct CurrentModuleWorkdirOpts<'a> {
5023 #[builder(setter(into, strip_option), default)]
5025 pub exclude: Option<Vec<&'a str>>,
5026 #[builder(setter(into, strip_option), default)]
5028 pub gitignore: Option<bool>,
5029 #[builder(setter(into, strip_option), default)]
5031 pub include: Option<Vec<&'a str>>,
5032}
5033impl CurrentModule {
5034 pub fn dependencies(&self) -> Vec<Module> {
5036 let query = self.selection.select("dependencies");
5037 vec![Module {
5038 proc: self.proc.clone(),
5039 selection: query,
5040 graphql_client: self.graphql_client.clone(),
5041 }]
5042 }
5043 pub fn generated_context_directory(&self) -> Directory {
5045 let query = self.selection.select("generatedContextDirectory");
5046 Directory {
5047 proc: self.proc.clone(),
5048 selection: query,
5049 graphql_client: self.graphql_client.clone(),
5050 }
5051 }
5052 pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
5054 let query = self.selection.select("id");
5055 query.execute(self.graphql_client.clone()).await
5056 }
5057 pub async fn name(&self) -> Result<String, DaggerError> {
5059 let query = self.selection.select("name");
5060 query.execute(self.graphql_client.clone()).await
5061 }
5062 pub fn source(&self) -> Directory {
5064 let query = self.selection.select("source");
5065 Directory {
5066 proc: self.proc.clone(),
5067 selection: query,
5068 graphql_client: self.graphql_client.clone(),
5069 }
5070 }
5071 pub fn workdir(&self, path: impl Into<String>) -> Directory {
5078 let mut query = self.selection.select("workdir");
5079 query = query.arg("path", path.into());
5080 Directory {
5081 proc: self.proc.clone(),
5082 selection: query,
5083 graphql_client: self.graphql_client.clone(),
5084 }
5085 }
5086 pub fn workdir_opts<'a>(
5093 &self,
5094 path: impl Into<String>,
5095 opts: CurrentModuleWorkdirOpts<'a>,
5096 ) -> Directory {
5097 let mut query = self.selection.select("workdir");
5098 query = query.arg("path", path.into());
5099 if let Some(exclude) = opts.exclude {
5100 query = query.arg("exclude", exclude);
5101 }
5102 if let Some(include) = opts.include {
5103 query = query.arg("include", include);
5104 }
5105 if let Some(gitignore) = opts.gitignore {
5106 query = query.arg("gitignore", gitignore);
5107 }
5108 Directory {
5109 proc: self.proc.clone(),
5110 selection: query,
5111 graphql_client: self.graphql_client.clone(),
5112 }
5113 }
5114 pub fn workdir_file(&self, path: impl Into<String>) -> File {
5120 let mut query = self.selection.select("workdirFile");
5121 query = query.arg("path", path.into());
5122 File {
5123 proc: self.proc.clone(),
5124 selection: query,
5125 graphql_client: self.graphql_client.clone(),
5126 }
5127 }
5128}
5129#[derive(Clone)]
5130pub struct Directory {
5131 pub proc: Option<Arc<DaggerSessionProc>>,
5132 pub selection: Selection,
5133 pub graphql_client: DynGraphQLClient,
5134}
5135#[derive(Builder, Debug, PartialEq)]
5136pub struct DirectoryAsModuleOpts<'a> {
5137 #[builder(setter(into, strip_option), default)]
5140 pub source_root_path: Option<&'a str>,
5141}
5142#[derive(Builder, Debug, PartialEq)]
5143pub struct DirectoryAsModuleSourceOpts<'a> {
5144 #[builder(setter(into, strip_option), default)]
5147 pub source_root_path: Option<&'a str>,
5148}
5149#[derive(Builder, Debug, PartialEq)]
5150pub struct DirectoryDockerBuildOpts<'a> {
5151 #[builder(setter(into, strip_option), default)]
5153 pub build_args: Option<Vec<BuildArg>>,
5154 #[builder(setter(into, strip_option), default)]
5156 pub dockerfile: Option<&'a str>,
5157 #[builder(setter(into, strip_option), default)]
5160 pub no_init: Option<bool>,
5161 #[builder(setter(into, strip_option), default)]
5163 pub platform: Option<Platform>,
5164 #[builder(setter(into, strip_option), default)]
5167 pub secrets: Option<Vec<SecretId>>,
5168 #[builder(setter(into, strip_option), default)]
5170 pub target: Option<&'a str>,
5171}
5172#[derive(Builder, Debug, PartialEq)]
5173pub struct DirectoryEntriesOpts<'a> {
5174 #[builder(setter(into, strip_option), default)]
5176 pub path: Option<&'a str>,
5177}
5178#[derive(Builder, Debug, PartialEq)]
5179pub struct DirectoryExistsOpts {
5180 #[builder(setter(into, strip_option), default)]
5182 pub do_not_follow_symlinks: Option<bool>,
5183 #[builder(setter(into, strip_option), default)]
5185 pub expected_type: Option<ExistsType>,
5186}
5187#[derive(Builder, Debug, PartialEq)]
5188pub struct DirectoryExportOpts {
5189 #[builder(setter(into, strip_option), default)]
5191 pub wipe: Option<bool>,
5192}
5193#[derive(Builder, Debug, PartialEq)]
5194pub struct DirectoryFilterOpts<'a> {
5195 #[builder(setter(into, strip_option), default)]
5197 pub exclude: Option<Vec<&'a str>>,
5198 #[builder(setter(into, strip_option), default)]
5200 pub gitignore: Option<bool>,
5201 #[builder(setter(into, strip_option), default)]
5203 pub include: Option<Vec<&'a str>>,
5204}
5205#[derive(Builder, Debug, PartialEq)]
5206pub struct DirectorySearchOpts<'a> {
5207 #[builder(setter(into, strip_option), default)]
5209 pub dotall: Option<bool>,
5210 #[builder(setter(into, strip_option), default)]
5212 pub files_only: Option<bool>,
5213 #[builder(setter(into, strip_option), default)]
5215 pub globs: Option<Vec<&'a str>>,
5216 #[builder(setter(into, strip_option), default)]
5218 pub insensitive: Option<bool>,
5219 #[builder(setter(into, strip_option), default)]
5221 pub limit: Option<isize>,
5222 #[builder(setter(into, strip_option), default)]
5224 pub literal: Option<bool>,
5225 #[builder(setter(into, strip_option), default)]
5227 pub multiline: Option<bool>,
5228 #[builder(setter(into, strip_option), default)]
5230 pub paths: Option<Vec<&'a str>>,
5231 #[builder(setter(into, strip_option), default)]
5233 pub skip_hidden: Option<bool>,
5234 #[builder(setter(into, strip_option), default)]
5236 pub skip_ignored: Option<bool>,
5237}
5238#[derive(Builder, Debug, PartialEq)]
5239pub struct DirectoryTerminalOpts<'a> {
5240 #[builder(setter(into, strip_option), default)]
5242 pub cmd: Option<Vec<&'a str>>,
5243 #[builder(setter(into, strip_option), default)]
5245 pub container: Option<ContainerId>,
5246 #[builder(setter(into, strip_option), default)]
5248 pub experimental_privileged_nesting: Option<bool>,
5249 #[builder(setter(into, strip_option), default)]
5251 pub insecure_root_capabilities: Option<bool>,
5252}
5253#[derive(Builder, Debug, PartialEq)]
5254pub struct DirectoryWithDirectoryOpts<'a> {
5255 #[builder(setter(into, strip_option), default)]
5257 pub exclude: Option<Vec<&'a str>>,
5258 #[builder(setter(into, strip_option), default)]
5260 pub gitignore: Option<bool>,
5261 #[builder(setter(into, strip_option), default)]
5263 pub include: Option<Vec<&'a str>>,
5264 #[builder(setter(into, strip_option), default)]
5268 pub owner: Option<&'a str>,
5269}
5270#[derive(Builder, Debug, PartialEq)]
5271pub struct DirectoryWithFileOpts<'a> {
5272 #[builder(setter(into, strip_option), default)]
5276 pub owner: Option<&'a str>,
5277 #[builder(setter(into, strip_option), default)]
5279 pub permissions: Option<isize>,
5280}
5281#[derive(Builder, Debug, PartialEq)]
5282pub struct DirectoryWithFilesOpts {
5283 #[builder(setter(into, strip_option), default)]
5285 pub permissions: Option<isize>,
5286}
5287#[derive(Builder, Debug, PartialEq)]
5288pub struct DirectoryWithNewDirectoryOpts {
5289 #[builder(setter(into, strip_option), default)]
5291 pub permissions: Option<isize>,
5292}
5293#[derive(Builder, Debug, PartialEq)]
5294pub struct DirectoryWithNewFileOpts {
5295 #[builder(setter(into, strip_option), default)]
5297 pub permissions: Option<isize>,
5298}
5299impl Directory {
5300 pub fn as_git(&self) -> GitRepository {
5302 let query = self.selection.select("asGit");
5303 GitRepository {
5304 proc: self.proc.clone(),
5305 selection: query,
5306 graphql_client: self.graphql_client.clone(),
5307 }
5308 }
5309 pub fn as_module(&self) -> Module {
5315 let query = self.selection.select("asModule");
5316 Module {
5317 proc: self.proc.clone(),
5318 selection: query,
5319 graphql_client: self.graphql_client.clone(),
5320 }
5321 }
5322 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
5328 let mut query = self.selection.select("asModule");
5329 if let Some(source_root_path) = opts.source_root_path {
5330 query = query.arg("sourceRootPath", source_root_path);
5331 }
5332 Module {
5333 proc: self.proc.clone(),
5334 selection: query,
5335 graphql_client: self.graphql_client.clone(),
5336 }
5337 }
5338 pub fn as_module_source(&self) -> ModuleSource {
5344 let query = self.selection.select("asModuleSource");
5345 ModuleSource {
5346 proc: self.proc.clone(),
5347 selection: query,
5348 graphql_client: self.graphql_client.clone(),
5349 }
5350 }
5351 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
5357 let mut query = self.selection.select("asModuleSource");
5358 if let Some(source_root_path) = opts.source_root_path {
5359 query = query.arg("sourceRootPath", source_root_path);
5360 }
5361 ModuleSource {
5362 proc: self.proc.clone(),
5363 selection: query,
5364 graphql_client: self.graphql_client.clone(),
5365 }
5366 }
5367 pub fn changes(&self, from: impl IntoID<DirectoryId>) -> Changeset {
5374 let mut query = self.selection.select("changes");
5375 query = query.arg_lazy(
5376 "from",
5377 Box::new(move || {
5378 let from = from.clone();
5379 Box::pin(async move { from.into_id().await.unwrap().quote() })
5380 }),
5381 );
5382 Changeset {
5383 proc: self.proc.clone(),
5384 selection: query,
5385 graphql_client: self.graphql_client.clone(),
5386 }
5387 }
5388 pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
5399 let mut query = self.selection.select("chown");
5400 query = query.arg("path", path.into());
5401 query = query.arg("owner", owner.into());
5402 Directory {
5403 proc: self.proc.clone(),
5404 selection: query,
5405 graphql_client: self.graphql_client.clone(),
5406 }
5407 }
5408 pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
5414 let mut query = self.selection.select("diff");
5415 query = query.arg_lazy(
5416 "other",
5417 Box::new(move || {
5418 let other = other.clone();
5419 Box::pin(async move { other.into_id().await.unwrap().quote() })
5420 }),
5421 );
5422 Directory {
5423 proc: self.proc.clone(),
5424 selection: query,
5425 graphql_client: self.graphql_client.clone(),
5426 }
5427 }
5428 pub async fn digest(&self) -> Result<String, DaggerError> {
5430 let query = self.selection.select("digest");
5431 query.execute(self.graphql_client.clone()).await
5432 }
5433 pub fn directory(&self, path: impl Into<String>) -> Directory {
5439 let mut query = self.selection.select("directory");
5440 query = query.arg("path", path.into());
5441 Directory {
5442 proc: self.proc.clone(),
5443 selection: query,
5444 graphql_client: self.graphql_client.clone(),
5445 }
5446 }
5447 pub fn docker_build(&self) -> Container {
5453 let query = self.selection.select("dockerBuild");
5454 Container {
5455 proc: self.proc.clone(),
5456 selection: query,
5457 graphql_client: self.graphql_client.clone(),
5458 }
5459 }
5460 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5466 let mut query = self.selection.select("dockerBuild");
5467 if let Some(dockerfile) = opts.dockerfile {
5468 query = query.arg("dockerfile", dockerfile);
5469 }
5470 if let Some(platform) = opts.platform {
5471 query = query.arg("platform", platform);
5472 }
5473 if let Some(build_args) = opts.build_args {
5474 query = query.arg("buildArgs", build_args);
5475 }
5476 if let Some(target) = opts.target {
5477 query = query.arg("target", target);
5478 }
5479 if let Some(secrets) = opts.secrets {
5480 query = query.arg("secrets", secrets);
5481 }
5482 if let Some(no_init) = opts.no_init {
5483 query = query.arg("noInit", no_init);
5484 }
5485 Container {
5486 proc: self.proc.clone(),
5487 selection: query,
5488 graphql_client: self.graphql_client.clone(),
5489 }
5490 }
5491 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
5497 let query = self.selection.select("entries");
5498 query.execute(self.graphql_client.clone()).await
5499 }
5500 pub async fn entries_opts<'a>(
5506 &self,
5507 opts: DirectoryEntriesOpts<'a>,
5508 ) -> Result<Vec<String>, DaggerError> {
5509 let mut query = self.selection.select("entries");
5510 if let Some(path) = opts.path {
5511 query = query.arg("path", path);
5512 }
5513 query.execute(self.graphql_client.clone()).await
5514 }
5515 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5522 let mut query = self.selection.select("exists");
5523 query = query.arg("path", path.into());
5524 query.execute(self.graphql_client.clone()).await
5525 }
5526 pub async fn exists_opts(
5533 &self,
5534 path: impl Into<String>,
5535 opts: DirectoryExistsOpts,
5536 ) -> Result<bool, DaggerError> {
5537 let mut query = self.selection.select("exists");
5538 query = query.arg("path", path.into());
5539 if let Some(expected_type) = opts.expected_type {
5540 query = query.arg("expectedType", expected_type);
5541 }
5542 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5543 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5544 }
5545 query.execute(self.graphql_client.clone()).await
5546 }
5547 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5554 let mut query = self.selection.select("export");
5555 query = query.arg("path", path.into());
5556 query.execute(self.graphql_client.clone()).await
5557 }
5558 pub async fn export_opts(
5565 &self,
5566 path: impl Into<String>,
5567 opts: DirectoryExportOpts,
5568 ) -> Result<String, DaggerError> {
5569 let mut query = self.selection.select("export");
5570 query = query.arg("path", path.into());
5571 if let Some(wipe) = opts.wipe {
5572 query = query.arg("wipe", wipe);
5573 }
5574 query.execute(self.graphql_client.clone()).await
5575 }
5576 pub fn file(&self, path: impl Into<String>) -> File {
5582 let mut query = self.selection.select("file");
5583 query = query.arg("path", path.into());
5584 File {
5585 proc: self.proc.clone(),
5586 selection: query,
5587 graphql_client: self.graphql_client.clone(),
5588 }
5589 }
5590 pub fn filter(&self) -> Directory {
5596 let query = self.selection.select("filter");
5597 Directory {
5598 proc: self.proc.clone(),
5599 selection: query,
5600 graphql_client: self.graphql_client.clone(),
5601 }
5602 }
5603 pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5609 let mut query = self.selection.select("filter");
5610 if let Some(exclude) = opts.exclude {
5611 query = query.arg("exclude", exclude);
5612 }
5613 if let Some(include) = opts.include {
5614 query = query.arg("include", include);
5615 }
5616 if let Some(gitignore) = opts.gitignore {
5617 query = query.arg("gitignore", gitignore);
5618 }
5619 Directory {
5620 proc: self.proc.clone(),
5621 selection: query,
5622 graphql_client: self.graphql_client.clone(),
5623 }
5624 }
5625 pub async fn find_up(
5632 &self,
5633 name: impl Into<String>,
5634 start: impl Into<String>,
5635 ) -> Result<String, DaggerError> {
5636 let mut query = self.selection.select("findUp");
5637 query = query.arg("name", name.into());
5638 query = query.arg("start", start.into());
5639 query.execute(self.graphql_client.clone()).await
5640 }
5641 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5647 let mut query = self.selection.select("glob");
5648 query = query.arg("pattern", pattern.into());
5649 query.execute(self.graphql_client.clone()).await
5650 }
5651 pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
5653 let query = self.selection.select("id");
5654 query.execute(self.graphql_client.clone()).await
5655 }
5656 pub async fn name(&self) -> Result<String, DaggerError> {
5658 let query = self.selection.select("name");
5659 query.execute(self.graphql_client.clone()).await
5660 }
5661 pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
5669 let mut query = self.selection.select("search");
5670 query = query.arg("pattern", pattern.into());
5671 vec![SearchResult {
5672 proc: self.proc.clone(),
5673 selection: query,
5674 graphql_client: self.graphql_client.clone(),
5675 }]
5676 }
5677 pub fn search_opts<'a>(
5685 &self,
5686 pattern: impl Into<String>,
5687 opts: DirectorySearchOpts<'a>,
5688 ) -> Vec<SearchResult> {
5689 let mut query = self.selection.select("search");
5690 query = query.arg("pattern", pattern.into());
5691 if let Some(paths) = opts.paths {
5692 query = query.arg("paths", paths);
5693 }
5694 if let Some(globs) = opts.globs {
5695 query = query.arg("globs", globs);
5696 }
5697 if let Some(literal) = opts.literal {
5698 query = query.arg("literal", literal);
5699 }
5700 if let Some(multiline) = opts.multiline {
5701 query = query.arg("multiline", multiline);
5702 }
5703 if let Some(dotall) = opts.dotall {
5704 query = query.arg("dotall", dotall);
5705 }
5706 if let Some(insensitive) = opts.insensitive {
5707 query = query.arg("insensitive", insensitive);
5708 }
5709 if let Some(skip_ignored) = opts.skip_ignored {
5710 query = query.arg("skipIgnored", skip_ignored);
5711 }
5712 if let Some(skip_hidden) = opts.skip_hidden {
5713 query = query.arg("skipHidden", skip_hidden);
5714 }
5715 if let Some(files_only) = opts.files_only {
5716 query = query.arg("filesOnly", files_only);
5717 }
5718 if let Some(limit) = opts.limit {
5719 query = query.arg("limit", limit);
5720 }
5721 vec![SearchResult {
5722 proc: self.proc.clone(),
5723 selection: query,
5724 graphql_client: self.graphql_client.clone(),
5725 }]
5726 }
5727 pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
5729 let query = self.selection.select("sync");
5730 query.execute(self.graphql_client.clone()).await
5731 }
5732 pub fn terminal(&self) -> Directory {
5738 let query = self.selection.select("terminal");
5739 Directory {
5740 proc: self.proc.clone(),
5741 selection: query,
5742 graphql_client: self.graphql_client.clone(),
5743 }
5744 }
5745 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5751 let mut query = self.selection.select("terminal");
5752 if let Some(container) = opts.container {
5753 query = query.arg("container", container);
5754 }
5755 if let Some(cmd) = opts.cmd {
5756 query = query.arg("cmd", cmd);
5757 }
5758 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5759 query = query.arg(
5760 "experimentalPrivilegedNesting",
5761 experimental_privileged_nesting,
5762 );
5763 }
5764 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5765 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5766 }
5767 Directory {
5768 proc: self.proc.clone(),
5769 selection: query,
5770 graphql_client: self.graphql_client.clone(),
5771 }
5772 }
5773 pub fn with_changes(&self, changes: impl IntoID<ChangesetId>) -> Directory {
5779 let mut query = self.selection.select("withChanges");
5780 query = query.arg_lazy(
5781 "changes",
5782 Box::new(move || {
5783 let changes = changes.clone();
5784 Box::pin(async move { changes.into_id().await.unwrap().quote() })
5785 }),
5786 );
5787 Directory {
5788 proc: self.proc.clone(),
5789 selection: query,
5790 graphql_client: self.graphql_client.clone(),
5791 }
5792 }
5793 pub fn with_directory(
5801 &self,
5802 path: impl Into<String>,
5803 source: impl IntoID<DirectoryId>,
5804 ) -> Directory {
5805 let mut query = self.selection.select("withDirectory");
5806 query = query.arg("path", path.into());
5807 query = query.arg_lazy(
5808 "source",
5809 Box::new(move || {
5810 let source = source.clone();
5811 Box::pin(async move { source.into_id().await.unwrap().quote() })
5812 }),
5813 );
5814 Directory {
5815 proc: self.proc.clone(),
5816 selection: query,
5817 graphql_client: self.graphql_client.clone(),
5818 }
5819 }
5820 pub fn with_directory_opts<'a>(
5828 &self,
5829 path: impl Into<String>,
5830 source: impl IntoID<DirectoryId>,
5831 opts: DirectoryWithDirectoryOpts<'a>,
5832 ) -> Directory {
5833 let mut query = self.selection.select("withDirectory");
5834 query = query.arg("path", path.into());
5835 query = query.arg_lazy(
5836 "source",
5837 Box::new(move || {
5838 let source = source.clone();
5839 Box::pin(async move { source.into_id().await.unwrap().quote() })
5840 }),
5841 );
5842 if let Some(exclude) = opts.exclude {
5843 query = query.arg("exclude", exclude);
5844 }
5845 if let Some(include) = opts.include {
5846 query = query.arg("include", include);
5847 }
5848 if let Some(gitignore) = opts.gitignore {
5849 query = query.arg("gitignore", gitignore);
5850 }
5851 if let Some(owner) = opts.owner {
5852 query = query.arg("owner", owner);
5853 }
5854 Directory {
5855 proc: self.proc.clone(),
5856 selection: query,
5857 graphql_client: self.graphql_client.clone(),
5858 }
5859 }
5860 pub fn with_error(&self, err: impl Into<String>) -> Directory {
5866 let mut query = self.selection.select("withError");
5867 query = query.arg("err", err.into());
5868 Directory {
5869 proc: self.proc.clone(),
5870 selection: query,
5871 graphql_client: self.graphql_client.clone(),
5872 }
5873 }
5874 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
5882 let mut query = self.selection.select("withFile");
5883 query = query.arg("path", path.into());
5884 query = query.arg_lazy(
5885 "source",
5886 Box::new(move || {
5887 let source = source.clone();
5888 Box::pin(async move { source.into_id().await.unwrap().quote() })
5889 }),
5890 );
5891 Directory {
5892 proc: self.proc.clone(),
5893 selection: query,
5894 graphql_client: self.graphql_client.clone(),
5895 }
5896 }
5897 pub fn with_file_opts<'a>(
5905 &self,
5906 path: impl Into<String>,
5907 source: impl IntoID<FileId>,
5908 opts: DirectoryWithFileOpts<'a>,
5909 ) -> Directory {
5910 let mut query = self.selection.select("withFile");
5911 query = query.arg("path", path.into());
5912 query = query.arg_lazy(
5913 "source",
5914 Box::new(move || {
5915 let source = source.clone();
5916 Box::pin(async move { source.into_id().await.unwrap().quote() })
5917 }),
5918 );
5919 if let Some(permissions) = opts.permissions {
5920 query = query.arg("permissions", permissions);
5921 }
5922 if let Some(owner) = opts.owner {
5923 query = query.arg("owner", owner);
5924 }
5925 Directory {
5926 proc: self.proc.clone(),
5927 selection: query,
5928 graphql_client: self.graphql_client.clone(),
5929 }
5930 }
5931 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
5939 let mut query = self.selection.select("withFiles");
5940 query = query.arg("path", path.into());
5941 query = query.arg("sources", sources);
5942 Directory {
5943 proc: self.proc.clone(),
5944 selection: query,
5945 graphql_client: self.graphql_client.clone(),
5946 }
5947 }
5948 pub fn with_files_opts(
5956 &self,
5957 path: impl Into<String>,
5958 sources: Vec<FileId>,
5959 opts: DirectoryWithFilesOpts,
5960 ) -> Directory {
5961 let mut query = self.selection.select("withFiles");
5962 query = query.arg("path", path.into());
5963 query = query.arg("sources", sources);
5964 if let Some(permissions) = opts.permissions {
5965 query = query.arg("permissions", permissions);
5966 }
5967 Directory {
5968 proc: self.proc.clone(),
5969 selection: query,
5970 graphql_client: self.graphql_client.clone(),
5971 }
5972 }
5973 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5980 let mut query = self.selection.select("withNewDirectory");
5981 query = query.arg("path", path.into());
5982 Directory {
5983 proc: self.proc.clone(),
5984 selection: query,
5985 graphql_client: self.graphql_client.clone(),
5986 }
5987 }
5988 pub fn with_new_directory_opts(
5995 &self,
5996 path: impl Into<String>,
5997 opts: DirectoryWithNewDirectoryOpts,
5998 ) -> Directory {
5999 let mut query = self.selection.select("withNewDirectory");
6000 query = query.arg("path", path.into());
6001 if let Some(permissions) = opts.permissions {
6002 query = query.arg("permissions", permissions);
6003 }
6004 Directory {
6005 proc: self.proc.clone(),
6006 selection: query,
6007 graphql_client: self.graphql_client.clone(),
6008 }
6009 }
6010 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
6018 let mut query = self.selection.select("withNewFile");
6019 query = query.arg("path", path.into());
6020 query = query.arg("contents", contents.into());
6021 Directory {
6022 proc: self.proc.clone(),
6023 selection: query,
6024 graphql_client: self.graphql_client.clone(),
6025 }
6026 }
6027 pub fn with_new_file_opts(
6035 &self,
6036 path: impl Into<String>,
6037 contents: impl Into<String>,
6038 opts: DirectoryWithNewFileOpts,
6039 ) -> Directory {
6040 let mut query = self.selection.select("withNewFile");
6041 query = query.arg("path", path.into());
6042 query = query.arg("contents", contents.into());
6043 if let Some(permissions) = opts.permissions {
6044 query = query.arg("permissions", permissions);
6045 }
6046 Directory {
6047 proc: self.proc.clone(),
6048 selection: query,
6049 graphql_client: self.graphql_client.clone(),
6050 }
6051 }
6052 pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
6058 let mut query = self.selection.select("withPatch");
6059 query = query.arg("patch", patch.into());
6060 Directory {
6061 proc: self.proc.clone(),
6062 selection: query,
6063 graphql_client: self.graphql_client.clone(),
6064 }
6065 }
6066 pub fn with_patch_file(&self, patch: impl IntoID<FileId>) -> Directory {
6072 let mut query = self.selection.select("withPatchFile");
6073 query = query.arg_lazy(
6074 "patch",
6075 Box::new(move || {
6076 let patch = patch.clone();
6077 Box::pin(async move { patch.into_id().await.unwrap().quote() })
6078 }),
6079 );
6080 Directory {
6081 proc: self.proc.clone(),
6082 selection: query,
6083 graphql_client: self.graphql_client.clone(),
6084 }
6085 }
6086 pub fn with_symlink(
6093 &self,
6094 target: impl Into<String>,
6095 link_name: impl Into<String>,
6096 ) -> Directory {
6097 let mut query = self.selection.select("withSymlink");
6098 query = query.arg("target", target.into());
6099 query = query.arg("linkName", link_name.into());
6100 Directory {
6101 proc: self.proc.clone(),
6102 selection: query,
6103 graphql_client: self.graphql_client.clone(),
6104 }
6105 }
6106 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
6114 let mut query = self.selection.select("withTimestamps");
6115 query = query.arg("timestamp", timestamp);
6116 Directory {
6117 proc: self.proc.clone(),
6118 selection: query,
6119 graphql_client: self.graphql_client.clone(),
6120 }
6121 }
6122 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
6128 let mut query = self.selection.select("withoutDirectory");
6129 query = query.arg("path", path.into());
6130 Directory {
6131 proc: self.proc.clone(),
6132 selection: query,
6133 graphql_client: self.graphql_client.clone(),
6134 }
6135 }
6136 pub fn without_file(&self, path: impl Into<String>) -> Directory {
6142 let mut query = self.selection.select("withoutFile");
6143 query = query.arg("path", path.into());
6144 Directory {
6145 proc: self.proc.clone(),
6146 selection: query,
6147 graphql_client: self.graphql_client.clone(),
6148 }
6149 }
6150 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
6156 let mut query = self.selection.select("withoutFiles");
6157 query = query.arg(
6158 "paths",
6159 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
6160 );
6161 Directory {
6162 proc: self.proc.clone(),
6163 selection: query,
6164 graphql_client: self.graphql_client.clone(),
6165 }
6166 }
6167}
6168#[derive(Clone)]
6169pub struct Engine {
6170 pub proc: Option<Arc<DaggerSessionProc>>,
6171 pub selection: Selection,
6172 pub graphql_client: DynGraphQLClient,
6173}
6174impl Engine {
6175 pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
6177 let query = self.selection.select("clients");
6178 query.execute(self.graphql_client.clone()).await
6179 }
6180 pub async fn id(&self) -> Result<EngineId, DaggerError> {
6182 let query = self.selection.select("id");
6183 query.execute(self.graphql_client.clone()).await
6184 }
6185 pub fn local_cache(&self) -> EngineCache {
6187 let query = self.selection.select("localCache");
6188 EngineCache {
6189 proc: self.proc.clone(),
6190 selection: query,
6191 graphql_client: self.graphql_client.clone(),
6192 }
6193 }
6194 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}
6200#[derive(Clone)]
6201pub struct EngineCache {
6202 pub proc: Option<Arc<DaggerSessionProc>>,
6203 pub selection: Selection,
6204 pub graphql_client: DynGraphQLClient,
6205}
6206#[derive(Builder, Debug, PartialEq)]
6207pub struct EngineCacheEntrySetOpts<'a> {
6208 #[builder(setter(into, strip_option), default)]
6209 pub key: Option<&'a str>,
6210}
6211#[derive(Builder, Debug, PartialEq)]
6212pub struct EngineCachePruneOpts {
6213 #[builder(setter(into, strip_option), default)]
6215 pub use_default_policy: Option<bool>,
6216}
6217impl EngineCache {
6218 pub fn entry_set(&self) -> EngineCacheEntrySet {
6224 let query = self.selection.select("entrySet");
6225 EngineCacheEntrySet {
6226 proc: self.proc.clone(),
6227 selection: query,
6228 graphql_client: self.graphql_client.clone(),
6229 }
6230 }
6231 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
6237 let mut query = self.selection.select("entrySet");
6238 if let Some(key) = opts.key {
6239 query = query.arg("key", key);
6240 }
6241 EngineCacheEntrySet {
6242 proc: self.proc.clone(),
6243 selection: query,
6244 graphql_client: self.graphql_client.clone(),
6245 }
6246 }
6247 pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
6249 let query = self.selection.select("id");
6250 query.execute(self.graphql_client.clone()).await
6251 }
6252 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
6254 let query = self.selection.select("maxUsedSpace");
6255 query.execute(self.graphql_client.clone()).await
6256 }
6257 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
6259 let query = self.selection.select("minFreeSpace");
6260 query.execute(self.graphql_client.clone()).await
6261 }
6262 pub async fn prune(&self) -> Result<Void, DaggerError> {
6268 let query = self.selection.select("prune");
6269 query.execute(self.graphql_client.clone()).await
6270 }
6271 pub async fn prune_opts(&self, opts: EngineCachePruneOpts) -> Result<Void, DaggerError> {
6277 let mut query = self.selection.select("prune");
6278 if let Some(use_default_policy) = opts.use_default_policy {
6279 query = query.arg("useDefaultPolicy", use_default_policy);
6280 }
6281 query.execute(self.graphql_client.clone()).await
6282 }
6283 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
6285 let query = self.selection.select("reservedSpace");
6286 query.execute(self.graphql_client.clone()).await
6287 }
6288 pub async fn target_space(&self) -> Result<isize, DaggerError> {
6290 let query = self.selection.select("targetSpace");
6291 query.execute(self.graphql_client.clone()).await
6292 }
6293}
6294#[derive(Clone)]
6295pub struct EngineCacheEntry {
6296 pub proc: Option<Arc<DaggerSessionProc>>,
6297 pub selection: Selection,
6298 pub graphql_client: DynGraphQLClient,
6299}
6300impl EngineCacheEntry {
6301 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
6303 let query = self.selection.select("activelyUsed");
6304 query.execute(self.graphql_client.clone()).await
6305 }
6306 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
6308 let query = self.selection.select("createdTimeUnixNano");
6309 query.execute(self.graphql_client.clone()).await
6310 }
6311 pub async fn description(&self) -> Result<String, DaggerError> {
6313 let query = self.selection.select("description");
6314 query.execute(self.graphql_client.clone()).await
6315 }
6316 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6318 let query = self.selection.select("diskSpaceBytes");
6319 query.execute(self.graphql_client.clone()).await
6320 }
6321 pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
6323 let query = self.selection.select("id");
6324 query.execute(self.graphql_client.clone()).await
6325 }
6326 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
6328 let query = self.selection.select("mostRecentUseTimeUnixNano");
6329 query.execute(self.graphql_client.clone()).await
6330 }
6331}
6332#[derive(Clone)]
6333pub struct EngineCacheEntrySet {
6334 pub proc: Option<Arc<DaggerSessionProc>>,
6335 pub selection: Selection,
6336 pub graphql_client: DynGraphQLClient,
6337}
6338impl EngineCacheEntrySet {
6339 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6341 let query = self.selection.select("diskSpaceBytes");
6342 query.execute(self.graphql_client.clone()).await
6343 }
6344 pub fn entries(&self) -> Vec<EngineCacheEntry> {
6346 let query = self.selection.select("entries");
6347 vec![EngineCacheEntry {
6348 proc: self.proc.clone(),
6349 selection: query,
6350 graphql_client: self.graphql_client.clone(),
6351 }]
6352 }
6353 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6355 let query = self.selection.select("entryCount");
6356 query.execute(self.graphql_client.clone()).await
6357 }
6358 pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
6360 let query = self.selection.select("id");
6361 query.execute(self.graphql_client.clone()).await
6362 }
6363}
6364#[derive(Clone)]
6365pub struct EnumTypeDef {
6366 pub proc: Option<Arc<DaggerSessionProc>>,
6367 pub selection: Selection,
6368 pub graphql_client: DynGraphQLClient,
6369}
6370impl EnumTypeDef {
6371 pub async fn description(&self) -> Result<String, DaggerError> {
6373 let query = self.selection.select("description");
6374 query.execute(self.graphql_client.clone()).await
6375 }
6376 pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
6378 let query = self.selection.select("id");
6379 query.execute(self.graphql_client.clone()).await
6380 }
6381 pub fn members(&self) -> Vec<EnumValueTypeDef> {
6383 let query = self.selection.select("members");
6384 vec![EnumValueTypeDef {
6385 proc: self.proc.clone(),
6386 selection: query,
6387 graphql_client: self.graphql_client.clone(),
6388 }]
6389 }
6390 pub async fn name(&self) -> Result<String, DaggerError> {
6392 let query = self.selection.select("name");
6393 query.execute(self.graphql_client.clone()).await
6394 }
6395 pub fn source_map(&self) -> SourceMap {
6397 let query = self.selection.select("sourceMap");
6398 SourceMap {
6399 proc: self.proc.clone(),
6400 selection: query,
6401 graphql_client: self.graphql_client.clone(),
6402 }
6403 }
6404 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6406 let query = self.selection.select("sourceModuleName");
6407 query.execute(self.graphql_client.clone()).await
6408 }
6409 pub fn values(&self) -> Vec<EnumValueTypeDef> {
6410 let query = self.selection.select("values");
6411 vec![EnumValueTypeDef {
6412 proc: self.proc.clone(),
6413 selection: query,
6414 graphql_client: self.graphql_client.clone(),
6415 }]
6416 }
6417}
6418#[derive(Clone)]
6419pub struct EnumValueTypeDef {
6420 pub proc: Option<Arc<DaggerSessionProc>>,
6421 pub selection: Selection,
6422 pub graphql_client: DynGraphQLClient,
6423}
6424impl EnumValueTypeDef {
6425 pub async fn deprecated(&self) -> Result<String, DaggerError> {
6427 let query = self.selection.select("deprecated");
6428 query.execute(self.graphql_client.clone()).await
6429 }
6430 pub async fn description(&self) -> Result<String, DaggerError> {
6432 let query = self.selection.select("description");
6433 query.execute(self.graphql_client.clone()).await
6434 }
6435 pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
6437 let query = self.selection.select("id");
6438 query.execute(self.graphql_client.clone()).await
6439 }
6440 pub async fn name(&self) -> Result<String, DaggerError> {
6442 let query = self.selection.select("name");
6443 query.execute(self.graphql_client.clone()).await
6444 }
6445 pub fn source_map(&self) -> SourceMap {
6447 let query = self.selection.select("sourceMap");
6448 SourceMap {
6449 proc: self.proc.clone(),
6450 selection: query,
6451 graphql_client: self.graphql_client.clone(),
6452 }
6453 }
6454 pub async fn value(&self) -> Result<String, DaggerError> {
6456 let query = self.selection.select("value");
6457 query.execute(self.graphql_client.clone()).await
6458 }
6459}
6460#[derive(Clone)]
6461pub struct Env {
6462 pub proc: Option<Arc<DaggerSessionProc>>,
6463 pub selection: Selection,
6464 pub graphql_client: DynGraphQLClient,
6465}
6466impl Env {
6467 pub async fn id(&self) -> Result<EnvId, DaggerError> {
6469 let query = self.selection.select("id");
6470 query.execute(self.graphql_client.clone()).await
6471 }
6472 pub fn input(&self, name: impl Into<String>) -> Binding {
6474 let mut query = self.selection.select("input");
6475 query = query.arg("name", name.into());
6476 Binding {
6477 proc: self.proc.clone(),
6478 selection: query,
6479 graphql_client: self.graphql_client.clone(),
6480 }
6481 }
6482 pub fn inputs(&self) -> Vec<Binding> {
6484 let query = self.selection.select("inputs");
6485 vec![Binding {
6486 proc: self.proc.clone(),
6487 selection: query,
6488 graphql_client: self.graphql_client.clone(),
6489 }]
6490 }
6491 pub fn output(&self, name: impl Into<String>) -> Binding {
6493 let mut query = self.selection.select("output");
6494 query = query.arg("name", name.into());
6495 Binding {
6496 proc: self.proc.clone(),
6497 selection: query,
6498 graphql_client: self.graphql_client.clone(),
6499 }
6500 }
6501 pub fn outputs(&self) -> Vec<Binding> {
6503 let query = self.selection.select("outputs");
6504 vec![Binding {
6505 proc: self.proc.clone(),
6506 selection: query,
6507 graphql_client: self.graphql_client.clone(),
6508 }]
6509 }
6510 pub fn with_address_input(
6518 &self,
6519 name: impl Into<String>,
6520 value: impl IntoID<AddressId>,
6521 description: impl Into<String>,
6522 ) -> Env {
6523 let mut query = self.selection.select("withAddressInput");
6524 query = query.arg("name", name.into());
6525 query = query.arg_lazy(
6526 "value",
6527 Box::new(move || {
6528 let value = value.clone();
6529 Box::pin(async move { value.into_id().await.unwrap().quote() })
6530 }),
6531 );
6532 query = query.arg("description", description.into());
6533 Env {
6534 proc: self.proc.clone(),
6535 selection: query,
6536 graphql_client: self.graphql_client.clone(),
6537 }
6538 }
6539 pub fn with_address_output(
6546 &self,
6547 name: impl Into<String>,
6548 description: impl Into<String>,
6549 ) -> Env {
6550 let mut query = self.selection.select("withAddressOutput");
6551 query = query.arg("name", name.into());
6552 query = query.arg("description", description.into());
6553 Env {
6554 proc: self.proc.clone(),
6555 selection: query,
6556 graphql_client: self.graphql_client.clone(),
6557 }
6558 }
6559 pub fn with_cache_volume_input(
6567 &self,
6568 name: impl Into<String>,
6569 value: impl IntoID<CacheVolumeId>,
6570 description: impl Into<String>,
6571 ) -> Env {
6572 let mut query = self.selection.select("withCacheVolumeInput");
6573 query = query.arg("name", name.into());
6574 query = query.arg_lazy(
6575 "value",
6576 Box::new(move || {
6577 let value = value.clone();
6578 Box::pin(async move { value.into_id().await.unwrap().quote() })
6579 }),
6580 );
6581 query = query.arg("description", description.into());
6582 Env {
6583 proc: self.proc.clone(),
6584 selection: query,
6585 graphql_client: self.graphql_client.clone(),
6586 }
6587 }
6588 pub fn with_cache_volume_output(
6595 &self,
6596 name: impl Into<String>,
6597 description: impl Into<String>,
6598 ) -> Env {
6599 let mut query = self.selection.select("withCacheVolumeOutput");
6600 query = query.arg("name", name.into());
6601 query = query.arg("description", description.into());
6602 Env {
6603 proc: self.proc.clone(),
6604 selection: query,
6605 graphql_client: self.graphql_client.clone(),
6606 }
6607 }
6608 pub fn with_changeset_input(
6616 &self,
6617 name: impl Into<String>,
6618 value: impl IntoID<ChangesetId>,
6619 description: impl Into<String>,
6620 ) -> Env {
6621 let mut query = self.selection.select("withChangesetInput");
6622 query = query.arg("name", name.into());
6623 query = query.arg_lazy(
6624 "value",
6625 Box::new(move || {
6626 let value = value.clone();
6627 Box::pin(async move { value.into_id().await.unwrap().quote() })
6628 }),
6629 );
6630 query = query.arg("description", description.into());
6631 Env {
6632 proc: self.proc.clone(),
6633 selection: query,
6634 graphql_client: self.graphql_client.clone(),
6635 }
6636 }
6637 pub fn with_changeset_output(
6644 &self,
6645 name: impl Into<String>,
6646 description: impl Into<String>,
6647 ) -> Env {
6648 let mut query = self.selection.select("withChangesetOutput");
6649 query = query.arg("name", name.into());
6650 query = query.arg("description", description.into());
6651 Env {
6652 proc: self.proc.clone(),
6653 selection: query,
6654 graphql_client: self.graphql_client.clone(),
6655 }
6656 }
6657 pub fn with_check_group_input(
6665 &self,
6666 name: impl Into<String>,
6667 value: impl IntoID<CheckGroupId>,
6668 description: impl Into<String>,
6669 ) -> Env {
6670 let mut query = self.selection.select("withCheckGroupInput");
6671 query = query.arg("name", name.into());
6672 query = query.arg_lazy(
6673 "value",
6674 Box::new(move || {
6675 let value = value.clone();
6676 Box::pin(async move { value.into_id().await.unwrap().quote() })
6677 }),
6678 );
6679 query = query.arg("description", description.into());
6680 Env {
6681 proc: self.proc.clone(),
6682 selection: query,
6683 graphql_client: self.graphql_client.clone(),
6684 }
6685 }
6686 pub fn with_check_group_output(
6693 &self,
6694 name: impl Into<String>,
6695 description: impl Into<String>,
6696 ) -> Env {
6697 let mut query = self.selection.select("withCheckGroupOutput");
6698 query = query.arg("name", name.into());
6699 query = query.arg("description", description.into());
6700 Env {
6701 proc: self.proc.clone(),
6702 selection: query,
6703 graphql_client: self.graphql_client.clone(),
6704 }
6705 }
6706 pub fn with_check_input(
6714 &self,
6715 name: impl Into<String>,
6716 value: impl IntoID<CheckId>,
6717 description: impl Into<String>,
6718 ) -> Env {
6719 let mut query = self.selection.select("withCheckInput");
6720 query = query.arg("name", name.into());
6721 query = query.arg_lazy(
6722 "value",
6723 Box::new(move || {
6724 let value = value.clone();
6725 Box::pin(async move { value.into_id().await.unwrap().quote() })
6726 }),
6727 );
6728 query = query.arg("description", description.into());
6729 Env {
6730 proc: self.proc.clone(),
6731 selection: query,
6732 graphql_client: self.graphql_client.clone(),
6733 }
6734 }
6735 pub fn with_check_output(
6742 &self,
6743 name: impl Into<String>,
6744 description: impl Into<String>,
6745 ) -> Env {
6746 let mut query = self.selection.select("withCheckOutput");
6747 query = query.arg("name", name.into());
6748 query = query.arg("description", description.into());
6749 Env {
6750 proc: self.proc.clone(),
6751 selection: query,
6752 graphql_client: self.graphql_client.clone(),
6753 }
6754 }
6755 pub fn with_cloud_input(
6763 &self,
6764 name: impl Into<String>,
6765 value: impl IntoID<CloudId>,
6766 description: impl Into<String>,
6767 ) -> Env {
6768 let mut query = self.selection.select("withCloudInput");
6769 query = query.arg("name", name.into());
6770 query = query.arg_lazy(
6771 "value",
6772 Box::new(move || {
6773 let value = value.clone();
6774 Box::pin(async move { value.into_id().await.unwrap().quote() })
6775 }),
6776 );
6777 query = query.arg("description", description.into());
6778 Env {
6779 proc: self.proc.clone(),
6780 selection: query,
6781 graphql_client: self.graphql_client.clone(),
6782 }
6783 }
6784 pub fn with_cloud_output(
6791 &self,
6792 name: impl Into<String>,
6793 description: impl Into<String>,
6794 ) -> Env {
6795 let mut query = self.selection.select("withCloudOutput");
6796 query = query.arg("name", name.into());
6797 query = query.arg("description", description.into());
6798 Env {
6799 proc: self.proc.clone(),
6800 selection: query,
6801 graphql_client: self.graphql_client.clone(),
6802 }
6803 }
6804 pub fn with_container_input(
6812 &self,
6813 name: impl Into<String>,
6814 value: impl IntoID<ContainerId>,
6815 description: impl Into<String>,
6816 ) -> Env {
6817 let mut query = self.selection.select("withContainerInput");
6818 query = query.arg("name", name.into());
6819 query = query.arg_lazy(
6820 "value",
6821 Box::new(move || {
6822 let value = value.clone();
6823 Box::pin(async move { value.into_id().await.unwrap().quote() })
6824 }),
6825 );
6826 query = query.arg("description", description.into());
6827 Env {
6828 proc: self.proc.clone(),
6829 selection: query,
6830 graphql_client: self.graphql_client.clone(),
6831 }
6832 }
6833 pub fn with_container_output(
6840 &self,
6841 name: impl Into<String>,
6842 description: impl Into<String>,
6843 ) -> Env {
6844 let mut query = self.selection.select("withContainerOutput");
6845 query = query.arg("name", name.into());
6846 query = query.arg("description", description.into());
6847 Env {
6848 proc: self.proc.clone(),
6849 selection: query,
6850 graphql_client: self.graphql_client.clone(),
6851 }
6852 }
6853 pub fn with_current_module(&self) -> Env {
6856 let query = self.selection.select("withCurrentModule");
6857 Env {
6858 proc: self.proc.clone(),
6859 selection: query,
6860 graphql_client: self.graphql_client.clone(),
6861 }
6862 }
6863 pub fn with_directory_input(
6871 &self,
6872 name: impl Into<String>,
6873 value: impl IntoID<DirectoryId>,
6874 description: impl Into<String>,
6875 ) -> Env {
6876 let mut query = self.selection.select("withDirectoryInput");
6877 query = query.arg("name", name.into());
6878 query = query.arg_lazy(
6879 "value",
6880 Box::new(move || {
6881 let value = value.clone();
6882 Box::pin(async move { value.into_id().await.unwrap().quote() })
6883 }),
6884 );
6885 query = query.arg("description", description.into());
6886 Env {
6887 proc: self.proc.clone(),
6888 selection: query,
6889 graphql_client: self.graphql_client.clone(),
6890 }
6891 }
6892 pub fn with_directory_output(
6899 &self,
6900 name: impl Into<String>,
6901 description: impl Into<String>,
6902 ) -> Env {
6903 let mut query = self.selection.select("withDirectoryOutput");
6904 query = query.arg("name", name.into());
6905 query = query.arg("description", description.into());
6906 Env {
6907 proc: self.proc.clone(),
6908 selection: query,
6909 graphql_client: self.graphql_client.clone(),
6910 }
6911 }
6912 pub fn with_env_file_input(
6920 &self,
6921 name: impl Into<String>,
6922 value: impl IntoID<EnvFileId>,
6923 description: impl Into<String>,
6924 ) -> Env {
6925 let mut query = self.selection.select("withEnvFileInput");
6926 query = query.arg("name", name.into());
6927 query = query.arg_lazy(
6928 "value",
6929 Box::new(move || {
6930 let value = value.clone();
6931 Box::pin(async move { value.into_id().await.unwrap().quote() })
6932 }),
6933 );
6934 query = query.arg("description", description.into());
6935 Env {
6936 proc: self.proc.clone(),
6937 selection: query,
6938 graphql_client: self.graphql_client.clone(),
6939 }
6940 }
6941 pub fn with_env_file_output(
6948 &self,
6949 name: impl Into<String>,
6950 description: impl Into<String>,
6951 ) -> Env {
6952 let mut query = self.selection.select("withEnvFileOutput");
6953 query = query.arg("name", name.into());
6954 query = query.arg("description", description.into());
6955 Env {
6956 proc: self.proc.clone(),
6957 selection: query,
6958 graphql_client: self.graphql_client.clone(),
6959 }
6960 }
6961 pub fn with_env_input(
6969 &self,
6970 name: impl Into<String>,
6971 value: impl IntoID<EnvId>,
6972 description: impl Into<String>,
6973 ) -> Env {
6974 let mut query = self.selection.select("withEnvInput");
6975 query = query.arg("name", name.into());
6976 query = query.arg_lazy(
6977 "value",
6978 Box::new(move || {
6979 let value = value.clone();
6980 Box::pin(async move { value.into_id().await.unwrap().quote() })
6981 }),
6982 );
6983 query = query.arg("description", description.into());
6984 Env {
6985 proc: self.proc.clone(),
6986 selection: query,
6987 graphql_client: self.graphql_client.clone(),
6988 }
6989 }
6990 pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
6997 let mut query = self.selection.select("withEnvOutput");
6998 query = query.arg("name", name.into());
6999 query = query.arg("description", description.into());
7000 Env {
7001 proc: self.proc.clone(),
7002 selection: query,
7003 graphql_client: self.graphql_client.clone(),
7004 }
7005 }
7006 pub fn with_file_input(
7014 &self,
7015 name: impl Into<String>,
7016 value: impl IntoID<FileId>,
7017 description: impl Into<String>,
7018 ) -> Env {
7019 let mut query = self.selection.select("withFileInput");
7020 query = query.arg("name", name.into());
7021 query = query.arg_lazy(
7022 "value",
7023 Box::new(move || {
7024 let value = value.clone();
7025 Box::pin(async move { value.into_id().await.unwrap().quote() })
7026 }),
7027 );
7028 query = query.arg("description", description.into());
7029 Env {
7030 proc: self.proc.clone(),
7031 selection: query,
7032 graphql_client: self.graphql_client.clone(),
7033 }
7034 }
7035 pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7042 let mut query = self.selection.select("withFileOutput");
7043 query = query.arg("name", name.into());
7044 query = query.arg("description", description.into());
7045 Env {
7046 proc: self.proc.clone(),
7047 selection: query,
7048 graphql_client: self.graphql_client.clone(),
7049 }
7050 }
7051 pub fn with_git_ref_input(
7059 &self,
7060 name: impl Into<String>,
7061 value: impl IntoID<GitRefId>,
7062 description: impl Into<String>,
7063 ) -> Env {
7064 let mut query = self.selection.select("withGitRefInput");
7065 query = query.arg("name", name.into());
7066 query = query.arg_lazy(
7067 "value",
7068 Box::new(move || {
7069 let value = value.clone();
7070 Box::pin(async move { value.into_id().await.unwrap().quote() })
7071 }),
7072 );
7073 query = query.arg("description", description.into());
7074 Env {
7075 proc: self.proc.clone(),
7076 selection: query,
7077 graphql_client: self.graphql_client.clone(),
7078 }
7079 }
7080 pub fn with_git_ref_output(
7087 &self,
7088 name: impl Into<String>,
7089 description: impl Into<String>,
7090 ) -> Env {
7091 let mut query = self.selection.select("withGitRefOutput");
7092 query = query.arg("name", name.into());
7093 query = query.arg("description", description.into());
7094 Env {
7095 proc: self.proc.clone(),
7096 selection: query,
7097 graphql_client: self.graphql_client.clone(),
7098 }
7099 }
7100 pub fn with_git_repository_input(
7108 &self,
7109 name: impl Into<String>,
7110 value: impl IntoID<GitRepositoryId>,
7111 description: impl Into<String>,
7112 ) -> Env {
7113 let mut query = self.selection.select("withGitRepositoryInput");
7114 query = query.arg("name", name.into());
7115 query = query.arg_lazy(
7116 "value",
7117 Box::new(move || {
7118 let value = value.clone();
7119 Box::pin(async move { value.into_id().await.unwrap().quote() })
7120 }),
7121 );
7122 query = query.arg("description", description.into());
7123 Env {
7124 proc: self.proc.clone(),
7125 selection: query,
7126 graphql_client: self.graphql_client.clone(),
7127 }
7128 }
7129 pub fn with_git_repository_output(
7136 &self,
7137 name: impl Into<String>,
7138 description: impl Into<String>,
7139 ) -> Env {
7140 let mut query = self.selection.select("withGitRepositoryOutput");
7141 query = query.arg("name", name.into());
7142 query = query.arg("description", description.into());
7143 Env {
7144 proc: self.proc.clone(),
7145 selection: query,
7146 graphql_client: self.graphql_client.clone(),
7147 }
7148 }
7149 pub fn with_json_value_input(
7157 &self,
7158 name: impl Into<String>,
7159 value: impl IntoID<JsonValueId>,
7160 description: impl Into<String>,
7161 ) -> Env {
7162 let mut query = self.selection.select("withJSONValueInput");
7163 query = query.arg("name", name.into());
7164 query = query.arg_lazy(
7165 "value",
7166 Box::new(move || {
7167 let value = value.clone();
7168 Box::pin(async move { value.into_id().await.unwrap().quote() })
7169 }),
7170 );
7171 query = query.arg("description", description.into());
7172 Env {
7173 proc: self.proc.clone(),
7174 selection: query,
7175 graphql_client: self.graphql_client.clone(),
7176 }
7177 }
7178 pub fn with_json_value_output(
7185 &self,
7186 name: impl Into<String>,
7187 description: impl Into<String>,
7188 ) -> Env {
7189 let mut query = self.selection.select("withJSONValueOutput");
7190 query = query.arg("name", name.into());
7191 query = query.arg("description", description.into());
7192 Env {
7193 proc: self.proc.clone(),
7194 selection: query,
7195 graphql_client: self.graphql_client.clone(),
7196 }
7197 }
7198 pub fn with_module(&self, module: impl IntoID<ModuleId>) -> Env {
7201 let mut query = self.selection.select("withModule");
7202 query = query.arg_lazy(
7203 "module",
7204 Box::new(move || {
7205 let module = module.clone();
7206 Box::pin(async move { module.into_id().await.unwrap().quote() })
7207 }),
7208 );
7209 Env {
7210 proc: self.proc.clone(),
7211 selection: query,
7212 graphql_client: self.graphql_client.clone(),
7213 }
7214 }
7215 pub fn with_module_config_client_input(
7223 &self,
7224 name: impl Into<String>,
7225 value: impl IntoID<ModuleConfigClientId>,
7226 description: impl Into<String>,
7227 ) -> Env {
7228 let mut query = self.selection.select("withModuleConfigClientInput");
7229 query = query.arg("name", name.into());
7230 query = query.arg_lazy(
7231 "value",
7232 Box::new(move || {
7233 let value = value.clone();
7234 Box::pin(async move { value.into_id().await.unwrap().quote() })
7235 }),
7236 );
7237 query = query.arg("description", description.into());
7238 Env {
7239 proc: self.proc.clone(),
7240 selection: query,
7241 graphql_client: self.graphql_client.clone(),
7242 }
7243 }
7244 pub fn with_module_config_client_output(
7251 &self,
7252 name: impl Into<String>,
7253 description: impl Into<String>,
7254 ) -> Env {
7255 let mut query = self.selection.select("withModuleConfigClientOutput");
7256 query = query.arg("name", name.into());
7257 query = query.arg("description", description.into());
7258 Env {
7259 proc: self.proc.clone(),
7260 selection: query,
7261 graphql_client: self.graphql_client.clone(),
7262 }
7263 }
7264 pub fn with_module_input(
7272 &self,
7273 name: impl Into<String>,
7274 value: impl IntoID<ModuleId>,
7275 description: impl Into<String>,
7276 ) -> Env {
7277 let mut query = self.selection.select("withModuleInput");
7278 query = query.arg("name", name.into());
7279 query = query.arg_lazy(
7280 "value",
7281 Box::new(move || {
7282 let value = value.clone();
7283 Box::pin(async move { value.into_id().await.unwrap().quote() })
7284 }),
7285 );
7286 query = query.arg("description", description.into());
7287 Env {
7288 proc: self.proc.clone(),
7289 selection: query,
7290 graphql_client: self.graphql_client.clone(),
7291 }
7292 }
7293 pub fn with_module_output(
7300 &self,
7301 name: impl Into<String>,
7302 description: impl Into<String>,
7303 ) -> Env {
7304 let mut query = self.selection.select("withModuleOutput");
7305 query = query.arg("name", name.into());
7306 query = query.arg("description", description.into());
7307 Env {
7308 proc: self.proc.clone(),
7309 selection: query,
7310 graphql_client: self.graphql_client.clone(),
7311 }
7312 }
7313 pub fn with_module_source_input(
7321 &self,
7322 name: impl Into<String>,
7323 value: impl IntoID<ModuleSourceId>,
7324 description: impl Into<String>,
7325 ) -> Env {
7326 let mut query = self.selection.select("withModuleSourceInput");
7327 query = query.arg("name", name.into());
7328 query = query.arg_lazy(
7329 "value",
7330 Box::new(move || {
7331 let value = value.clone();
7332 Box::pin(async move { value.into_id().await.unwrap().quote() })
7333 }),
7334 );
7335 query = query.arg("description", description.into());
7336 Env {
7337 proc: self.proc.clone(),
7338 selection: query,
7339 graphql_client: self.graphql_client.clone(),
7340 }
7341 }
7342 pub fn with_module_source_output(
7349 &self,
7350 name: impl Into<String>,
7351 description: impl Into<String>,
7352 ) -> Env {
7353 let mut query = self.selection.select("withModuleSourceOutput");
7354 query = query.arg("name", name.into());
7355 query = query.arg("description", description.into());
7356 Env {
7357 proc: self.proc.clone(),
7358 selection: query,
7359 graphql_client: self.graphql_client.clone(),
7360 }
7361 }
7362 pub fn with_search_result_input(
7370 &self,
7371 name: impl Into<String>,
7372 value: impl IntoID<SearchResultId>,
7373 description: impl Into<String>,
7374 ) -> Env {
7375 let mut query = self.selection.select("withSearchResultInput");
7376 query = query.arg("name", name.into());
7377 query = query.arg_lazy(
7378 "value",
7379 Box::new(move || {
7380 let value = value.clone();
7381 Box::pin(async move { value.into_id().await.unwrap().quote() })
7382 }),
7383 );
7384 query = query.arg("description", description.into());
7385 Env {
7386 proc: self.proc.clone(),
7387 selection: query,
7388 graphql_client: self.graphql_client.clone(),
7389 }
7390 }
7391 pub fn with_search_result_output(
7398 &self,
7399 name: impl Into<String>,
7400 description: impl Into<String>,
7401 ) -> Env {
7402 let mut query = self.selection.select("withSearchResultOutput");
7403 query = query.arg("name", name.into());
7404 query = query.arg("description", description.into());
7405 Env {
7406 proc: self.proc.clone(),
7407 selection: query,
7408 graphql_client: self.graphql_client.clone(),
7409 }
7410 }
7411 pub fn with_search_submatch_input(
7419 &self,
7420 name: impl Into<String>,
7421 value: impl IntoID<SearchSubmatchId>,
7422 description: impl Into<String>,
7423 ) -> Env {
7424 let mut query = self.selection.select("withSearchSubmatchInput");
7425 query = query.arg("name", name.into());
7426 query = query.arg_lazy(
7427 "value",
7428 Box::new(move || {
7429 let value = value.clone();
7430 Box::pin(async move { value.into_id().await.unwrap().quote() })
7431 }),
7432 );
7433 query = query.arg("description", description.into());
7434 Env {
7435 proc: self.proc.clone(),
7436 selection: query,
7437 graphql_client: self.graphql_client.clone(),
7438 }
7439 }
7440 pub fn with_search_submatch_output(
7447 &self,
7448 name: impl Into<String>,
7449 description: impl Into<String>,
7450 ) -> Env {
7451 let mut query = self.selection.select("withSearchSubmatchOutput");
7452 query = query.arg("name", name.into());
7453 query = query.arg("description", description.into());
7454 Env {
7455 proc: self.proc.clone(),
7456 selection: query,
7457 graphql_client: self.graphql_client.clone(),
7458 }
7459 }
7460 pub fn with_secret_input(
7468 &self,
7469 name: impl Into<String>,
7470 value: impl IntoID<SecretId>,
7471 description: impl Into<String>,
7472 ) -> Env {
7473 let mut query = self.selection.select("withSecretInput");
7474 query = query.arg("name", name.into());
7475 query = query.arg_lazy(
7476 "value",
7477 Box::new(move || {
7478 let value = value.clone();
7479 Box::pin(async move { value.into_id().await.unwrap().quote() })
7480 }),
7481 );
7482 query = query.arg("description", description.into());
7483 Env {
7484 proc: self.proc.clone(),
7485 selection: query,
7486 graphql_client: self.graphql_client.clone(),
7487 }
7488 }
7489 pub fn with_secret_output(
7496 &self,
7497 name: impl Into<String>,
7498 description: impl Into<String>,
7499 ) -> Env {
7500 let mut query = self.selection.select("withSecretOutput");
7501 query = query.arg("name", name.into());
7502 query = query.arg("description", description.into());
7503 Env {
7504 proc: self.proc.clone(),
7505 selection: query,
7506 graphql_client: self.graphql_client.clone(),
7507 }
7508 }
7509 pub fn with_service_input(
7517 &self,
7518 name: impl Into<String>,
7519 value: impl IntoID<ServiceId>,
7520 description: impl Into<String>,
7521 ) -> Env {
7522 let mut query = self.selection.select("withServiceInput");
7523 query = query.arg("name", name.into());
7524 query = query.arg_lazy(
7525 "value",
7526 Box::new(move || {
7527 let value = value.clone();
7528 Box::pin(async move { value.into_id().await.unwrap().quote() })
7529 }),
7530 );
7531 query = query.arg("description", description.into());
7532 Env {
7533 proc: self.proc.clone(),
7534 selection: query,
7535 graphql_client: self.graphql_client.clone(),
7536 }
7537 }
7538 pub fn with_service_output(
7545 &self,
7546 name: impl Into<String>,
7547 description: impl Into<String>,
7548 ) -> Env {
7549 let mut query = self.selection.select("withServiceOutput");
7550 query = query.arg("name", name.into());
7551 query = query.arg("description", description.into());
7552 Env {
7553 proc: self.proc.clone(),
7554 selection: query,
7555 graphql_client: self.graphql_client.clone(),
7556 }
7557 }
7558 pub fn with_socket_input(
7566 &self,
7567 name: impl Into<String>,
7568 value: impl IntoID<SocketId>,
7569 description: impl Into<String>,
7570 ) -> Env {
7571 let mut query = self.selection.select("withSocketInput");
7572 query = query.arg("name", name.into());
7573 query = query.arg_lazy(
7574 "value",
7575 Box::new(move || {
7576 let value = value.clone();
7577 Box::pin(async move { value.into_id().await.unwrap().quote() })
7578 }),
7579 );
7580 query = query.arg("description", description.into());
7581 Env {
7582 proc: self.proc.clone(),
7583 selection: query,
7584 graphql_client: self.graphql_client.clone(),
7585 }
7586 }
7587 pub fn with_socket_output(
7594 &self,
7595 name: impl Into<String>,
7596 description: impl Into<String>,
7597 ) -> Env {
7598 let mut query = self.selection.select("withSocketOutput");
7599 query = query.arg("name", name.into());
7600 query = query.arg("description", description.into());
7601 Env {
7602 proc: self.proc.clone(),
7603 selection: query,
7604 graphql_client: self.graphql_client.clone(),
7605 }
7606 }
7607 pub fn with_string_input(
7615 &self,
7616 name: impl Into<String>,
7617 value: impl Into<String>,
7618 description: impl Into<String>,
7619 ) -> Env {
7620 let mut query = self.selection.select("withStringInput");
7621 query = query.arg("name", name.into());
7622 query = query.arg("value", value.into());
7623 query = query.arg("description", description.into());
7624 Env {
7625 proc: self.proc.clone(),
7626 selection: query,
7627 graphql_client: self.graphql_client.clone(),
7628 }
7629 }
7630 pub fn with_string_output(
7637 &self,
7638 name: impl Into<String>,
7639 description: impl Into<String>,
7640 ) -> Env {
7641 let mut query = self.selection.select("withStringOutput");
7642 query = query.arg("name", name.into());
7643 query = query.arg("description", description.into());
7644 Env {
7645 proc: self.proc.clone(),
7646 selection: query,
7647 graphql_client: self.graphql_client.clone(),
7648 }
7649 }
7650 pub fn with_workspace(&self, workspace: impl IntoID<DirectoryId>) -> Env {
7656 let mut query = self.selection.select("withWorkspace");
7657 query = query.arg_lazy(
7658 "workspace",
7659 Box::new(move || {
7660 let workspace = workspace.clone();
7661 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
7662 }),
7663 );
7664 Env {
7665 proc: self.proc.clone(),
7666 selection: query,
7667 graphql_client: self.graphql_client.clone(),
7668 }
7669 }
7670 pub fn without_outputs(&self) -> Env {
7672 let query = self.selection.select("withoutOutputs");
7673 Env {
7674 proc: self.proc.clone(),
7675 selection: query,
7676 graphql_client: self.graphql_client.clone(),
7677 }
7678 }
7679 pub fn workspace(&self) -> Directory {
7680 let query = self.selection.select("workspace");
7681 Directory {
7682 proc: self.proc.clone(),
7683 selection: query,
7684 graphql_client: self.graphql_client.clone(),
7685 }
7686 }
7687}
7688#[derive(Clone)]
7689pub struct EnvFile {
7690 pub proc: Option<Arc<DaggerSessionProc>>,
7691 pub selection: Selection,
7692 pub graphql_client: DynGraphQLClient,
7693}
7694#[derive(Builder, Debug, PartialEq)]
7695pub struct EnvFileGetOpts {
7696 #[builder(setter(into, strip_option), default)]
7698 pub raw: Option<bool>,
7699}
7700#[derive(Builder, Debug, PartialEq)]
7701pub struct EnvFileVariablesOpts {
7702 #[builder(setter(into, strip_option), default)]
7704 pub raw: Option<bool>,
7705}
7706impl EnvFile {
7707 pub fn as_file(&self) -> File {
7709 let query = self.selection.select("asFile");
7710 File {
7711 proc: self.proc.clone(),
7712 selection: query,
7713 graphql_client: self.graphql_client.clone(),
7714 }
7715 }
7716 pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
7722 let mut query = self.selection.select("exists");
7723 query = query.arg("name", name.into());
7724 query.execute(self.graphql_client.clone()).await
7725 }
7726 pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
7733 let mut query = self.selection.select("get");
7734 query = query.arg("name", name.into());
7735 query.execute(self.graphql_client.clone()).await
7736 }
7737 pub async fn get_opts(
7744 &self,
7745 name: impl Into<String>,
7746 opts: EnvFileGetOpts,
7747 ) -> Result<String, DaggerError> {
7748 let mut query = self.selection.select("get");
7749 query = query.arg("name", name.into());
7750 if let Some(raw) = opts.raw {
7751 query = query.arg("raw", raw);
7752 }
7753 query.execute(self.graphql_client.clone()).await
7754 }
7755 pub async fn id(&self) -> Result<EnvFileId, DaggerError> {
7757 let query = self.selection.select("id");
7758 query.execute(self.graphql_client.clone()).await
7759 }
7760 pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
7766 let mut query = self.selection.select("namespace");
7767 query = query.arg("prefix", prefix.into());
7768 EnvFile {
7769 proc: self.proc.clone(),
7770 selection: query,
7771 graphql_client: self.graphql_client.clone(),
7772 }
7773 }
7774 pub fn variables(&self) -> Vec<EnvVariable> {
7780 let query = self.selection.select("variables");
7781 vec![EnvVariable {
7782 proc: self.proc.clone(),
7783 selection: query,
7784 graphql_client: self.graphql_client.clone(),
7785 }]
7786 }
7787 pub fn variables_opts(&self, opts: EnvFileVariablesOpts) -> Vec<EnvVariable> {
7793 let mut query = self.selection.select("variables");
7794 if let Some(raw) = opts.raw {
7795 query = query.arg("raw", raw);
7796 }
7797 vec![EnvVariable {
7798 proc: self.proc.clone(),
7799 selection: query,
7800 graphql_client: self.graphql_client.clone(),
7801 }]
7802 }
7803 pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
7810 let mut query = self.selection.select("withVariable");
7811 query = query.arg("name", name.into());
7812 query = query.arg("value", value.into());
7813 EnvFile {
7814 proc: self.proc.clone(),
7815 selection: query,
7816 graphql_client: self.graphql_client.clone(),
7817 }
7818 }
7819 pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
7825 let mut query = self.selection.select("withoutVariable");
7826 query = query.arg("name", name.into());
7827 EnvFile {
7828 proc: self.proc.clone(),
7829 selection: query,
7830 graphql_client: self.graphql_client.clone(),
7831 }
7832 }
7833}
7834#[derive(Clone)]
7835pub struct EnvVariable {
7836 pub proc: Option<Arc<DaggerSessionProc>>,
7837 pub selection: Selection,
7838 pub graphql_client: DynGraphQLClient,
7839}
7840impl EnvVariable {
7841 pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
7843 let query = self.selection.select("id");
7844 query.execute(self.graphql_client.clone()).await
7845 }
7846 pub async fn name(&self) -> Result<String, DaggerError> {
7848 let query = self.selection.select("name");
7849 query.execute(self.graphql_client.clone()).await
7850 }
7851 pub async fn value(&self) -> Result<String, DaggerError> {
7853 let query = self.selection.select("value");
7854 query.execute(self.graphql_client.clone()).await
7855 }
7856}
7857#[derive(Clone)]
7858pub struct Error {
7859 pub proc: Option<Arc<DaggerSessionProc>>,
7860 pub selection: Selection,
7861 pub graphql_client: DynGraphQLClient,
7862}
7863impl Error {
7864 pub async fn id(&self) -> Result<ErrorId, DaggerError> {
7866 let query = self.selection.select("id");
7867 query.execute(self.graphql_client.clone()).await
7868 }
7869 pub async fn message(&self) -> Result<String, DaggerError> {
7871 let query = self.selection.select("message");
7872 query.execute(self.graphql_client.clone()).await
7873 }
7874 pub fn values(&self) -> Vec<ErrorValue> {
7876 let query = self.selection.select("values");
7877 vec![ErrorValue {
7878 proc: self.proc.clone(),
7879 selection: query,
7880 graphql_client: self.graphql_client.clone(),
7881 }]
7882 }
7883 pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
7890 let mut query = self.selection.select("withValue");
7891 query = query.arg("name", name.into());
7892 query = query.arg("value", value);
7893 Error {
7894 proc: self.proc.clone(),
7895 selection: query,
7896 graphql_client: self.graphql_client.clone(),
7897 }
7898 }
7899}
7900#[derive(Clone)]
7901pub struct ErrorValue {
7902 pub proc: Option<Arc<DaggerSessionProc>>,
7903 pub selection: Selection,
7904 pub graphql_client: DynGraphQLClient,
7905}
7906impl ErrorValue {
7907 pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
7909 let query = self.selection.select("id");
7910 query.execute(self.graphql_client.clone()).await
7911 }
7912 pub async fn name(&self) -> Result<String, DaggerError> {
7914 let query = self.selection.select("name");
7915 query.execute(self.graphql_client.clone()).await
7916 }
7917 pub async fn value(&self) -> Result<Json, DaggerError> {
7919 let query = self.selection.select("value");
7920 query.execute(self.graphql_client.clone()).await
7921 }
7922}
7923#[derive(Clone)]
7924pub struct FieldTypeDef {
7925 pub proc: Option<Arc<DaggerSessionProc>>,
7926 pub selection: Selection,
7927 pub graphql_client: DynGraphQLClient,
7928}
7929impl FieldTypeDef {
7930 pub async fn deprecated(&self) -> Result<String, DaggerError> {
7932 let query = self.selection.select("deprecated");
7933 query.execute(self.graphql_client.clone()).await
7934 }
7935 pub async fn description(&self) -> Result<String, DaggerError> {
7937 let query = self.selection.select("description");
7938 query.execute(self.graphql_client.clone()).await
7939 }
7940 pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
7942 let query = self.selection.select("id");
7943 query.execute(self.graphql_client.clone()).await
7944 }
7945 pub async fn name(&self) -> Result<String, DaggerError> {
7947 let query = self.selection.select("name");
7948 query.execute(self.graphql_client.clone()).await
7949 }
7950 pub fn source_map(&self) -> SourceMap {
7952 let query = self.selection.select("sourceMap");
7953 SourceMap {
7954 proc: self.proc.clone(),
7955 selection: query,
7956 graphql_client: self.graphql_client.clone(),
7957 }
7958 }
7959 pub fn type_def(&self) -> TypeDef {
7961 let query = self.selection.select("typeDef");
7962 TypeDef {
7963 proc: self.proc.clone(),
7964 selection: query,
7965 graphql_client: self.graphql_client.clone(),
7966 }
7967 }
7968}
7969#[derive(Clone)]
7970pub struct File {
7971 pub proc: Option<Arc<DaggerSessionProc>>,
7972 pub selection: Selection,
7973 pub graphql_client: DynGraphQLClient,
7974}
7975#[derive(Builder, Debug, PartialEq)]
7976pub struct FileAsEnvFileOpts {
7977 #[builder(setter(into, strip_option), default)]
7979 pub expand: Option<bool>,
7980}
7981#[derive(Builder, Debug, PartialEq)]
7982pub struct FileContentsOpts {
7983 #[builder(setter(into, strip_option), default)]
7985 pub limit_lines: Option<isize>,
7986 #[builder(setter(into, strip_option), default)]
7988 pub offset_lines: Option<isize>,
7989}
7990#[derive(Builder, Debug, PartialEq)]
7991pub struct FileDigestOpts {
7992 #[builder(setter(into, strip_option), default)]
7994 pub exclude_metadata: Option<bool>,
7995}
7996#[derive(Builder, Debug, PartialEq)]
7997pub struct FileExportOpts {
7998 #[builder(setter(into, strip_option), default)]
8000 pub allow_parent_dir_path: Option<bool>,
8001}
8002#[derive(Builder, Debug, PartialEq)]
8003pub struct FileSearchOpts<'a> {
8004 #[builder(setter(into, strip_option), default)]
8006 pub dotall: Option<bool>,
8007 #[builder(setter(into, strip_option), default)]
8009 pub files_only: Option<bool>,
8010 #[builder(setter(into, strip_option), default)]
8011 pub globs: Option<Vec<&'a str>>,
8012 #[builder(setter(into, strip_option), default)]
8014 pub insensitive: Option<bool>,
8015 #[builder(setter(into, strip_option), default)]
8017 pub limit: Option<isize>,
8018 #[builder(setter(into, strip_option), default)]
8020 pub literal: Option<bool>,
8021 #[builder(setter(into, strip_option), default)]
8023 pub multiline: Option<bool>,
8024 #[builder(setter(into, strip_option), default)]
8025 pub paths: Option<Vec<&'a str>>,
8026 #[builder(setter(into, strip_option), default)]
8028 pub skip_hidden: Option<bool>,
8029 #[builder(setter(into, strip_option), default)]
8031 pub skip_ignored: Option<bool>,
8032}
8033#[derive(Builder, Debug, PartialEq)]
8034pub struct FileWithReplacedOpts {
8035 #[builder(setter(into, strip_option), default)]
8037 pub all: Option<bool>,
8038 #[builder(setter(into, strip_option), default)]
8040 pub first_from: Option<isize>,
8041}
8042impl File {
8043 pub fn as_env_file(&self) -> EnvFile {
8049 let query = self.selection.select("asEnvFile");
8050 EnvFile {
8051 proc: self.proc.clone(),
8052 selection: query,
8053 graphql_client: self.graphql_client.clone(),
8054 }
8055 }
8056 pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
8062 let mut query = self.selection.select("asEnvFile");
8063 if let Some(expand) = opts.expand {
8064 query = query.arg("expand", expand);
8065 }
8066 EnvFile {
8067 proc: self.proc.clone(),
8068 selection: query,
8069 graphql_client: self.graphql_client.clone(),
8070 }
8071 }
8072 pub fn chown(&self, owner: impl Into<String>) -> File {
8082 let mut query = self.selection.select("chown");
8083 query = query.arg("owner", owner.into());
8084 File {
8085 proc: self.proc.clone(),
8086 selection: query,
8087 graphql_client: self.graphql_client.clone(),
8088 }
8089 }
8090 pub async fn contents(&self) -> Result<String, DaggerError> {
8096 let query = self.selection.select("contents");
8097 query.execute(self.graphql_client.clone()).await
8098 }
8099 pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
8105 let mut query = self.selection.select("contents");
8106 if let Some(offset_lines) = opts.offset_lines {
8107 query = query.arg("offsetLines", offset_lines);
8108 }
8109 if let Some(limit_lines) = opts.limit_lines {
8110 query = query.arg("limitLines", limit_lines);
8111 }
8112 query.execute(self.graphql_client.clone()).await
8113 }
8114 pub async fn digest(&self) -> Result<String, DaggerError> {
8120 let query = self.selection.select("digest");
8121 query.execute(self.graphql_client.clone()).await
8122 }
8123 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
8129 let mut query = self.selection.select("digest");
8130 if let Some(exclude_metadata) = opts.exclude_metadata {
8131 query = query.arg("excludeMetadata", exclude_metadata);
8132 }
8133 query.execute(self.graphql_client.clone()).await
8134 }
8135 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
8142 let mut query = self.selection.select("export");
8143 query = query.arg("path", path.into());
8144 query.execute(self.graphql_client.clone()).await
8145 }
8146 pub async fn export_opts(
8153 &self,
8154 path: impl Into<String>,
8155 opts: FileExportOpts,
8156 ) -> Result<String, DaggerError> {
8157 let mut query = self.selection.select("export");
8158 query = query.arg("path", path.into());
8159 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
8160 query = query.arg("allowParentDirPath", allow_parent_dir_path);
8161 }
8162 query.execute(self.graphql_client.clone()).await
8163 }
8164 pub async fn id(&self) -> Result<FileId, DaggerError> {
8166 let query = self.selection.select("id");
8167 query.execute(self.graphql_client.clone()).await
8168 }
8169 pub async fn name(&self) -> Result<String, DaggerError> {
8171 let query = self.selection.select("name");
8172 query.execute(self.graphql_client.clone()).await
8173 }
8174 pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
8182 let mut query = self.selection.select("search");
8183 query = query.arg("pattern", pattern.into());
8184 vec![SearchResult {
8185 proc: self.proc.clone(),
8186 selection: query,
8187 graphql_client: self.graphql_client.clone(),
8188 }]
8189 }
8190 pub fn search_opts<'a>(
8198 &self,
8199 pattern: impl Into<String>,
8200 opts: FileSearchOpts<'a>,
8201 ) -> Vec<SearchResult> {
8202 let mut query = self.selection.select("search");
8203 query = query.arg("pattern", pattern.into());
8204 if let Some(literal) = opts.literal {
8205 query = query.arg("literal", literal);
8206 }
8207 if let Some(multiline) = opts.multiline {
8208 query = query.arg("multiline", multiline);
8209 }
8210 if let Some(dotall) = opts.dotall {
8211 query = query.arg("dotall", dotall);
8212 }
8213 if let Some(insensitive) = opts.insensitive {
8214 query = query.arg("insensitive", insensitive);
8215 }
8216 if let Some(skip_ignored) = opts.skip_ignored {
8217 query = query.arg("skipIgnored", skip_ignored);
8218 }
8219 if let Some(skip_hidden) = opts.skip_hidden {
8220 query = query.arg("skipHidden", skip_hidden);
8221 }
8222 if let Some(files_only) = opts.files_only {
8223 query = query.arg("filesOnly", files_only);
8224 }
8225 if let Some(limit) = opts.limit {
8226 query = query.arg("limit", limit);
8227 }
8228 if let Some(paths) = opts.paths {
8229 query = query.arg("paths", paths);
8230 }
8231 if let Some(globs) = opts.globs {
8232 query = query.arg("globs", globs);
8233 }
8234 vec![SearchResult {
8235 proc: self.proc.clone(),
8236 selection: query,
8237 graphql_client: self.graphql_client.clone(),
8238 }]
8239 }
8240 pub async fn size(&self) -> Result<isize, DaggerError> {
8242 let query = self.selection.select("size");
8243 query.execute(self.graphql_client.clone()).await
8244 }
8245 pub async fn sync(&self) -> Result<FileId, DaggerError> {
8247 let query = self.selection.select("sync");
8248 query.execute(self.graphql_client.clone()).await
8249 }
8250 pub fn with_name(&self, name: impl Into<String>) -> File {
8256 let mut query = self.selection.select("withName");
8257 query = query.arg("name", name.into());
8258 File {
8259 proc: self.proc.clone(),
8260 selection: query,
8261 graphql_client: self.graphql_client.clone(),
8262 }
8263 }
8264 pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
8276 let mut query = self.selection.select("withReplaced");
8277 query = query.arg("search", search.into());
8278 query = query.arg("replacement", replacement.into());
8279 File {
8280 proc: self.proc.clone(),
8281 selection: query,
8282 graphql_client: self.graphql_client.clone(),
8283 }
8284 }
8285 pub fn with_replaced_opts(
8297 &self,
8298 search: impl Into<String>,
8299 replacement: impl Into<String>,
8300 opts: FileWithReplacedOpts,
8301 ) -> File {
8302 let mut query = self.selection.select("withReplaced");
8303 query = query.arg("search", search.into());
8304 query = query.arg("replacement", replacement.into());
8305 if let Some(all) = opts.all {
8306 query = query.arg("all", all);
8307 }
8308 if let Some(first_from) = opts.first_from {
8309 query = query.arg("firstFrom", first_from);
8310 }
8311 File {
8312 proc: self.proc.clone(),
8313 selection: query,
8314 graphql_client: self.graphql_client.clone(),
8315 }
8316 }
8317 pub fn with_timestamps(&self, timestamp: isize) -> File {
8325 let mut query = self.selection.select("withTimestamps");
8326 query = query.arg("timestamp", timestamp);
8327 File {
8328 proc: self.proc.clone(),
8329 selection: query,
8330 graphql_client: self.graphql_client.clone(),
8331 }
8332 }
8333}
8334#[derive(Clone)]
8335pub struct Function {
8336 pub proc: Option<Arc<DaggerSessionProc>>,
8337 pub selection: Selection,
8338 pub graphql_client: DynGraphQLClient,
8339}
8340#[derive(Builder, Debug, PartialEq)]
8341pub struct FunctionWithArgOpts<'a> {
8342 #[builder(setter(into, strip_option), default)]
8344 pub default_path: Option<&'a str>,
8345 #[builder(setter(into, strip_option), default)]
8347 pub default_value: Option<Json>,
8348 #[builder(setter(into, strip_option), default)]
8350 pub deprecated: Option<&'a str>,
8351 #[builder(setter(into, strip_option), default)]
8353 pub description: Option<&'a str>,
8354 #[builder(setter(into, strip_option), default)]
8356 pub ignore: Option<Vec<&'a str>>,
8357 #[builder(setter(into, strip_option), default)]
8359 pub source_map: Option<SourceMapId>,
8360}
8361#[derive(Builder, Debug, PartialEq)]
8362pub struct FunctionWithCachePolicyOpts<'a> {
8363 #[builder(setter(into, strip_option), default)]
8365 pub time_to_live: Option<&'a str>,
8366}
8367#[derive(Builder, Debug, PartialEq)]
8368pub struct FunctionWithDeprecatedOpts<'a> {
8369 #[builder(setter(into, strip_option), default)]
8371 pub reason: Option<&'a str>,
8372}
8373impl Function {
8374 pub fn args(&self) -> Vec<FunctionArg> {
8376 let query = self.selection.select("args");
8377 vec![FunctionArg {
8378 proc: self.proc.clone(),
8379 selection: query,
8380 graphql_client: self.graphql_client.clone(),
8381 }]
8382 }
8383 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8385 let query = self.selection.select("deprecated");
8386 query.execute(self.graphql_client.clone()).await
8387 }
8388 pub async fn description(&self) -> Result<String, DaggerError> {
8390 let query = self.selection.select("description");
8391 query.execute(self.graphql_client.clone()).await
8392 }
8393 pub async fn id(&self) -> Result<FunctionId, DaggerError> {
8395 let query = self.selection.select("id");
8396 query.execute(self.graphql_client.clone()).await
8397 }
8398 pub async fn name(&self) -> Result<String, DaggerError> {
8400 let query = self.selection.select("name");
8401 query.execute(self.graphql_client.clone()).await
8402 }
8403 pub fn return_type(&self) -> TypeDef {
8405 let query = self.selection.select("returnType");
8406 TypeDef {
8407 proc: self.proc.clone(),
8408 selection: query,
8409 graphql_client: self.graphql_client.clone(),
8410 }
8411 }
8412 pub fn source_map(&self) -> SourceMap {
8414 let query = self.selection.select("sourceMap");
8415 SourceMap {
8416 proc: self.proc.clone(),
8417 selection: query,
8418 graphql_client: self.graphql_client.clone(),
8419 }
8420 }
8421 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
8429 let mut query = self.selection.select("withArg");
8430 query = query.arg("name", name.into());
8431 query = query.arg_lazy(
8432 "typeDef",
8433 Box::new(move || {
8434 let type_def = type_def.clone();
8435 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8436 }),
8437 );
8438 Function {
8439 proc: self.proc.clone(),
8440 selection: query,
8441 graphql_client: self.graphql_client.clone(),
8442 }
8443 }
8444 pub fn with_arg_opts<'a>(
8452 &self,
8453 name: impl Into<String>,
8454 type_def: impl IntoID<TypeDefId>,
8455 opts: FunctionWithArgOpts<'a>,
8456 ) -> Function {
8457 let mut query = self.selection.select("withArg");
8458 query = query.arg("name", name.into());
8459 query = query.arg_lazy(
8460 "typeDef",
8461 Box::new(move || {
8462 let type_def = type_def.clone();
8463 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8464 }),
8465 );
8466 if let Some(description) = opts.description {
8467 query = query.arg("description", description);
8468 }
8469 if let Some(default_value) = opts.default_value {
8470 query = query.arg("defaultValue", default_value);
8471 }
8472 if let Some(default_path) = opts.default_path {
8473 query = query.arg("defaultPath", default_path);
8474 }
8475 if let Some(ignore) = opts.ignore {
8476 query = query.arg("ignore", ignore);
8477 }
8478 if let Some(source_map) = opts.source_map {
8479 query = query.arg("sourceMap", source_map);
8480 }
8481 if let Some(deprecated) = opts.deprecated {
8482 query = query.arg("deprecated", deprecated);
8483 }
8484 Function {
8485 proc: self.proc.clone(),
8486 selection: query,
8487 graphql_client: self.graphql_client.clone(),
8488 }
8489 }
8490 pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
8497 let mut query = self.selection.select("withCachePolicy");
8498 query = query.arg("policy", policy);
8499 Function {
8500 proc: self.proc.clone(),
8501 selection: query,
8502 graphql_client: self.graphql_client.clone(),
8503 }
8504 }
8505 pub fn with_cache_policy_opts<'a>(
8512 &self,
8513 policy: FunctionCachePolicy,
8514 opts: FunctionWithCachePolicyOpts<'a>,
8515 ) -> Function {
8516 let mut query = self.selection.select("withCachePolicy");
8517 query = query.arg("policy", policy);
8518 if let Some(time_to_live) = opts.time_to_live {
8519 query = query.arg("timeToLive", time_to_live);
8520 }
8521 Function {
8522 proc: self.proc.clone(),
8523 selection: query,
8524 graphql_client: self.graphql_client.clone(),
8525 }
8526 }
8527 pub fn with_check(&self) -> Function {
8529 let query = self.selection.select("withCheck");
8530 Function {
8531 proc: self.proc.clone(),
8532 selection: query,
8533 graphql_client: self.graphql_client.clone(),
8534 }
8535 }
8536 pub fn with_deprecated(&self) -> Function {
8542 let query = self.selection.select("withDeprecated");
8543 Function {
8544 proc: self.proc.clone(),
8545 selection: query,
8546 graphql_client: self.graphql_client.clone(),
8547 }
8548 }
8549 pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
8555 let mut query = self.selection.select("withDeprecated");
8556 if let Some(reason) = opts.reason {
8557 query = query.arg("reason", reason);
8558 }
8559 Function {
8560 proc: self.proc.clone(),
8561 selection: query,
8562 graphql_client: self.graphql_client.clone(),
8563 }
8564 }
8565 pub fn with_description(&self, description: impl Into<String>) -> Function {
8571 let mut query = self.selection.select("withDescription");
8572 query = query.arg("description", description.into());
8573 Function {
8574 proc: self.proc.clone(),
8575 selection: query,
8576 graphql_client: self.graphql_client.clone(),
8577 }
8578 }
8579 pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
8585 let mut query = self.selection.select("withSourceMap");
8586 query = query.arg_lazy(
8587 "sourceMap",
8588 Box::new(move || {
8589 let source_map = source_map.clone();
8590 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
8591 }),
8592 );
8593 Function {
8594 proc: self.proc.clone(),
8595 selection: query,
8596 graphql_client: self.graphql_client.clone(),
8597 }
8598 }
8599}
8600#[derive(Clone)]
8601pub struct FunctionArg {
8602 pub proc: Option<Arc<DaggerSessionProc>>,
8603 pub selection: Selection,
8604 pub graphql_client: DynGraphQLClient,
8605}
8606impl FunctionArg {
8607 pub async fn default_path(&self) -> Result<String, DaggerError> {
8609 let query = self.selection.select("defaultPath");
8610 query.execute(self.graphql_client.clone()).await
8611 }
8612 pub async fn default_value(&self) -> Result<Json, DaggerError> {
8614 let query = self.selection.select("defaultValue");
8615 query.execute(self.graphql_client.clone()).await
8616 }
8617 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8619 let query = self.selection.select("deprecated");
8620 query.execute(self.graphql_client.clone()).await
8621 }
8622 pub async fn description(&self) -> Result<String, DaggerError> {
8624 let query = self.selection.select("description");
8625 query.execute(self.graphql_client.clone()).await
8626 }
8627 pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
8629 let query = self.selection.select("id");
8630 query.execute(self.graphql_client.clone()).await
8631 }
8632 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
8634 let query = self.selection.select("ignore");
8635 query.execute(self.graphql_client.clone()).await
8636 }
8637 pub async fn name(&self) -> Result<String, DaggerError> {
8639 let query = self.selection.select("name");
8640 query.execute(self.graphql_client.clone()).await
8641 }
8642 pub fn source_map(&self) -> SourceMap {
8644 let query = self.selection.select("sourceMap");
8645 SourceMap {
8646 proc: self.proc.clone(),
8647 selection: query,
8648 graphql_client: self.graphql_client.clone(),
8649 }
8650 }
8651 pub fn type_def(&self) -> TypeDef {
8653 let query = self.selection.select("typeDef");
8654 TypeDef {
8655 proc: self.proc.clone(),
8656 selection: query,
8657 graphql_client: self.graphql_client.clone(),
8658 }
8659 }
8660}
8661#[derive(Clone)]
8662pub struct FunctionCall {
8663 pub proc: Option<Arc<DaggerSessionProc>>,
8664 pub selection: Selection,
8665 pub graphql_client: DynGraphQLClient,
8666}
8667impl FunctionCall {
8668 pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
8670 let query = self.selection.select("id");
8671 query.execute(self.graphql_client.clone()).await
8672 }
8673 pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
8675 let query = self.selection.select("inputArgs");
8676 vec![FunctionCallArgValue {
8677 proc: self.proc.clone(),
8678 selection: query,
8679 graphql_client: self.graphql_client.clone(),
8680 }]
8681 }
8682 pub async fn name(&self) -> Result<String, DaggerError> {
8684 let query = self.selection.select("name");
8685 query.execute(self.graphql_client.clone()).await
8686 }
8687 pub async fn parent(&self) -> Result<Json, DaggerError> {
8689 let query = self.selection.select("parent");
8690 query.execute(self.graphql_client.clone()).await
8691 }
8692 pub async fn parent_name(&self) -> Result<String, DaggerError> {
8694 let query = self.selection.select("parentName");
8695 query.execute(self.graphql_client.clone()).await
8696 }
8697 pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
8703 let mut query = self.selection.select("returnError");
8704 query = query.arg_lazy(
8705 "error",
8706 Box::new(move || {
8707 let error = error.clone();
8708 Box::pin(async move { error.into_id().await.unwrap().quote() })
8709 }),
8710 );
8711 query.execute(self.graphql_client.clone()).await
8712 }
8713 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
8719 let mut query = self.selection.select("returnValue");
8720 query = query.arg("value", value);
8721 query.execute(self.graphql_client.clone()).await
8722 }
8723}
8724#[derive(Clone)]
8725pub struct FunctionCallArgValue {
8726 pub proc: Option<Arc<DaggerSessionProc>>,
8727 pub selection: Selection,
8728 pub graphql_client: DynGraphQLClient,
8729}
8730impl FunctionCallArgValue {
8731 pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
8733 let query = self.selection.select("id");
8734 query.execute(self.graphql_client.clone()).await
8735 }
8736 pub async fn name(&self) -> Result<String, DaggerError> {
8738 let query = self.selection.select("name");
8739 query.execute(self.graphql_client.clone()).await
8740 }
8741 pub async fn value(&self) -> Result<Json, DaggerError> {
8743 let query = self.selection.select("value");
8744 query.execute(self.graphql_client.clone()).await
8745 }
8746}
8747#[derive(Clone)]
8748pub struct GeneratedCode {
8749 pub proc: Option<Arc<DaggerSessionProc>>,
8750 pub selection: Selection,
8751 pub graphql_client: DynGraphQLClient,
8752}
8753impl GeneratedCode {
8754 pub fn code(&self) -> Directory {
8756 let query = self.selection.select("code");
8757 Directory {
8758 proc: self.proc.clone(),
8759 selection: query,
8760 graphql_client: self.graphql_client.clone(),
8761 }
8762 }
8763 pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
8765 let query = self.selection.select("id");
8766 query.execute(self.graphql_client.clone()).await
8767 }
8768 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
8770 let query = self.selection.select("vcsGeneratedPaths");
8771 query.execute(self.graphql_client.clone()).await
8772 }
8773 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
8775 let query = self.selection.select("vcsIgnoredPaths");
8776 query.execute(self.graphql_client.clone()).await
8777 }
8778 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8780 let mut query = self.selection.select("withVCSGeneratedPaths");
8781 query = query.arg(
8782 "paths",
8783 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8784 );
8785 GeneratedCode {
8786 proc: self.proc.clone(),
8787 selection: query,
8788 graphql_client: self.graphql_client.clone(),
8789 }
8790 }
8791 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
8793 let mut query = self.selection.select("withVCSIgnoredPaths");
8794 query = query.arg(
8795 "paths",
8796 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
8797 );
8798 GeneratedCode {
8799 proc: self.proc.clone(),
8800 selection: query,
8801 graphql_client: self.graphql_client.clone(),
8802 }
8803 }
8804}
8805#[derive(Clone)]
8806pub struct GitRef {
8807 pub proc: Option<Arc<DaggerSessionProc>>,
8808 pub selection: Selection,
8809 pub graphql_client: DynGraphQLClient,
8810}
8811#[derive(Builder, Debug, PartialEq)]
8812pub struct GitRefTreeOpts {
8813 #[builder(setter(into, strip_option), default)]
8815 pub depth: Option<isize>,
8816 #[builder(setter(into, strip_option), default)]
8818 pub discard_git_dir: Option<bool>,
8819}
8820impl GitRef {
8821 pub async fn commit(&self) -> Result<String, DaggerError> {
8823 let query = self.selection.select("commit");
8824 query.execute(self.graphql_client.clone()).await
8825 }
8826 pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
8832 let mut query = self.selection.select("commonAncestor");
8833 query = query.arg_lazy(
8834 "other",
8835 Box::new(move || {
8836 let other = other.clone();
8837 Box::pin(async move { other.into_id().await.unwrap().quote() })
8838 }),
8839 );
8840 GitRef {
8841 proc: self.proc.clone(),
8842 selection: query,
8843 graphql_client: self.graphql_client.clone(),
8844 }
8845 }
8846 pub async fn id(&self) -> Result<GitRefId, DaggerError> {
8848 let query = self.selection.select("id");
8849 query.execute(self.graphql_client.clone()).await
8850 }
8851 pub async fn r#ref(&self) -> Result<String, DaggerError> {
8853 let query = self.selection.select("ref");
8854 query.execute(self.graphql_client.clone()).await
8855 }
8856 pub fn tree(&self) -> Directory {
8862 let query = self.selection.select("tree");
8863 Directory {
8864 proc: self.proc.clone(),
8865 selection: query,
8866 graphql_client: self.graphql_client.clone(),
8867 }
8868 }
8869 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
8875 let mut query = self.selection.select("tree");
8876 if let Some(discard_git_dir) = opts.discard_git_dir {
8877 query = query.arg("discardGitDir", discard_git_dir);
8878 }
8879 if let Some(depth) = opts.depth {
8880 query = query.arg("depth", depth);
8881 }
8882 Directory {
8883 proc: self.proc.clone(),
8884 selection: query,
8885 graphql_client: self.graphql_client.clone(),
8886 }
8887 }
8888}
8889#[derive(Clone)]
8890pub struct GitRepository {
8891 pub proc: Option<Arc<DaggerSessionProc>>,
8892 pub selection: Selection,
8893 pub graphql_client: DynGraphQLClient,
8894}
8895#[derive(Builder, Debug, PartialEq)]
8896pub struct GitRepositoryBranchesOpts<'a> {
8897 #[builder(setter(into, strip_option), default)]
8899 pub patterns: Option<Vec<&'a str>>,
8900}
8901#[derive(Builder, Debug, PartialEq)]
8902pub struct GitRepositoryTagsOpts<'a> {
8903 #[builder(setter(into, strip_option), default)]
8905 pub patterns: Option<Vec<&'a str>>,
8906}
8907impl GitRepository {
8908 pub fn branch(&self, name: impl Into<String>) -> GitRef {
8914 let mut query = self.selection.select("branch");
8915 query = query.arg("name", name.into());
8916 GitRef {
8917 proc: self.proc.clone(),
8918 selection: query,
8919 graphql_client: self.graphql_client.clone(),
8920 }
8921 }
8922 pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
8928 let query = self.selection.select("branches");
8929 query.execute(self.graphql_client.clone()).await
8930 }
8931 pub async fn branches_opts<'a>(
8937 &self,
8938 opts: GitRepositoryBranchesOpts<'a>,
8939 ) -> Result<Vec<String>, DaggerError> {
8940 let mut query = self.selection.select("branches");
8941 if let Some(patterns) = opts.patterns {
8942 query = query.arg("patterns", patterns);
8943 }
8944 query.execute(self.graphql_client.clone()).await
8945 }
8946 pub fn commit(&self, id: impl Into<String>) -> GitRef {
8952 let mut query = self.selection.select("commit");
8953 query = query.arg("id", id.into());
8954 GitRef {
8955 proc: self.proc.clone(),
8956 selection: query,
8957 graphql_client: self.graphql_client.clone(),
8958 }
8959 }
8960 pub fn head(&self) -> GitRef {
8962 let query = self.selection.select("head");
8963 GitRef {
8964 proc: self.proc.clone(),
8965 selection: query,
8966 graphql_client: self.graphql_client.clone(),
8967 }
8968 }
8969 pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
8971 let query = self.selection.select("id");
8972 query.execute(self.graphql_client.clone()).await
8973 }
8974 pub fn latest_version(&self) -> GitRef {
8976 let query = self.selection.select("latestVersion");
8977 GitRef {
8978 proc: self.proc.clone(),
8979 selection: query,
8980 graphql_client: self.graphql_client.clone(),
8981 }
8982 }
8983 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
8989 let mut query = self.selection.select("ref");
8990 query = query.arg("name", name.into());
8991 GitRef {
8992 proc: self.proc.clone(),
8993 selection: query,
8994 graphql_client: self.graphql_client.clone(),
8995 }
8996 }
8997 pub fn tag(&self, name: impl Into<String>) -> GitRef {
9003 let mut query = self.selection.select("tag");
9004 query = query.arg("name", name.into());
9005 GitRef {
9006 proc: self.proc.clone(),
9007 selection: query,
9008 graphql_client: self.graphql_client.clone(),
9009 }
9010 }
9011 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
9017 let query = self.selection.select("tags");
9018 query.execute(self.graphql_client.clone()).await
9019 }
9020 pub async fn tags_opts<'a>(
9026 &self,
9027 opts: GitRepositoryTagsOpts<'a>,
9028 ) -> Result<Vec<String>, DaggerError> {
9029 let mut query = self.selection.select("tags");
9030 if let Some(patterns) = opts.patterns {
9031 query = query.arg("patterns", patterns);
9032 }
9033 query.execute(self.graphql_client.clone()).await
9034 }
9035 pub fn uncommitted(&self) -> Changeset {
9037 let query = self.selection.select("uncommitted");
9038 Changeset {
9039 proc: self.proc.clone(),
9040 selection: query,
9041 graphql_client: self.graphql_client.clone(),
9042 }
9043 }
9044 pub async fn url(&self) -> Result<String, DaggerError> {
9046 let query = self.selection.select("url");
9047 query.execute(self.graphql_client.clone()).await
9048 }
9049}
9050#[derive(Clone)]
9051pub struct Host {
9052 pub proc: Option<Arc<DaggerSessionProc>>,
9053 pub selection: Selection,
9054 pub graphql_client: DynGraphQLClient,
9055}
9056#[derive(Builder, Debug, PartialEq)]
9057pub struct HostDirectoryOpts<'a> {
9058 #[builder(setter(into, strip_option), default)]
9060 pub exclude: Option<Vec<&'a str>>,
9061 #[builder(setter(into, strip_option), default)]
9063 pub gitignore: Option<bool>,
9064 #[builder(setter(into, strip_option), default)]
9066 pub include: Option<Vec<&'a str>>,
9067 #[builder(setter(into, strip_option), default)]
9069 pub no_cache: Option<bool>,
9070}
9071#[derive(Builder, Debug, PartialEq)]
9072pub struct HostFileOpts {
9073 #[builder(setter(into, strip_option), default)]
9075 pub no_cache: Option<bool>,
9076}
9077#[derive(Builder, Debug, PartialEq)]
9078pub struct HostFindUpOpts {
9079 #[builder(setter(into, strip_option), default)]
9080 pub no_cache: Option<bool>,
9081}
9082#[derive(Builder, Debug, PartialEq)]
9083pub struct HostServiceOpts<'a> {
9084 #[builder(setter(into, strip_option), default)]
9086 pub host: Option<&'a str>,
9087}
9088#[derive(Builder, Debug, PartialEq)]
9089pub struct HostTunnelOpts {
9090 #[builder(setter(into, strip_option), default)]
9093 pub native: Option<bool>,
9094 #[builder(setter(into, strip_option), default)]
9099 pub ports: Option<Vec<PortForward>>,
9100}
9101impl Host {
9102 pub fn container_image(&self, name: impl Into<String>) -> Container {
9108 let mut query = self.selection.select("containerImage");
9109 query = query.arg("name", name.into());
9110 Container {
9111 proc: self.proc.clone(),
9112 selection: query,
9113 graphql_client: self.graphql_client.clone(),
9114 }
9115 }
9116 pub fn directory(&self, path: impl Into<String>) -> Directory {
9123 let mut query = self.selection.select("directory");
9124 query = query.arg("path", path.into());
9125 Directory {
9126 proc: self.proc.clone(),
9127 selection: query,
9128 graphql_client: self.graphql_client.clone(),
9129 }
9130 }
9131 pub fn directory_opts<'a>(
9138 &self,
9139 path: impl Into<String>,
9140 opts: HostDirectoryOpts<'a>,
9141 ) -> Directory {
9142 let mut query = self.selection.select("directory");
9143 query = query.arg("path", path.into());
9144 if let Some(exclude) = opts.exclude {
9145 query = query.arg("exclude", exclude);
9146 }
9147 if let Some(include) = opts.include {
9148 query = query.arg("include", include);
9149 }
9150 if let Some(no_cache) = opts.no_cache {
9151 query = query.arg("noCache", no_cache);
9152 }
9153 if let Some(gitignore) = opts.gitignore {
9154 query = query.arg("gitignore", gitignore);
9155 }
9156 Directory {
9157 proc: self.proc.clone(),
9158 selection: query,
9159 graphql_client: self.graphql_client.clone(),
9160 }
9161 }
9162 pub fn file(&self, path: impl Into<String>) -> File {
9169 let mut query = self.selection.select("file");
9170 query = query.arg("path", path.into());
9171 File {
9172 proc: self.proc.clone(),
9173 selection: query,
9174 graphql_client: self.graphql_client.clone(),
9175 }
9176 }
9177 pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
9184 let mut query = self.selection.select("file");
9185 query = query.arg("path", path.into());
9186 if let Some(no_cache) = opts.no_cache {
9187 query = query.arg("noCache", no_cache);
9188 }
9189 File {
9190 proc: self.proc.clone(),
9191 selection: query,
9192 graphql_client: self.graphql_client.clone(),
9193 }
9194 }
9195 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
9202 let mut query = self.selection.select("findUp");
9203 query = query.arg("name", name.into());
9204 query.execute(self.graphql_client.clone()).await
9205 }
9206 pub async fn find_up_opts(
9213 &self,
9214 name: impl Into<String>,
9215 opts: HostFindUpOpts,
9216 ) -> Result<String, DaggerError> {
9217 let mut query = self.selection.select("findUp");
9218 query = query.arg("name", name.into());
9219 if let Some(no_cache) = opts.no_cache {
9220 query = query.arg("noCache", no_cache);
9221 }
9222 query.execute(self.graphql_client.clone()).await
9223 }
9224 pub async fn id(&self) -> Result<HostId, DaggerError> {
9226 let query = self.selection.select("id");
9227 query.execute(self.graphql_client.clone()).await
9228 }
9229 pub fn service(&self, ports: Vec<PortForward>) -> Service {
9240 let mut query = self.selection.select("service");
9241 query = query.arg("ports", ports);
9242 Service {
9243 proc: self.proc.clone(),
9244 selection: query,
9245 graphql_client: self.graphql_client.clone(),
9246 }
9247 }
9248 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
9259 let mut query = self.selection.select("service");
9260 query = query.arg("ports", ports);
9261 if let Some(host) = opts.host {
9262 query = query.arg("host", host);
9263 }
9264 Service {
9265 proc: self.proc.clone(),
9266 selection: query,
9267 graphql_client: self.graphql_client.clone(),
9268 }
9269 }
9270 pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
9277 let mut query = self.selection.select("tunnel");
9278 query = query.arg_lazy(
9279 "service",
9280 Box::new(move || {
9281 let service = service.clone();
9282 Box::pin(async move { service.into_id().await.unwrap().quote() })
9283 }),
9284 );
9285 Service {
9286 proc: self.proc.clone(),
9287 selection: query,
9288 graphql_client: self.graphql_client.clone(),
9289 }
9290 }
9291 pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
9298 let mut query = self.selection.select("tunnel");
9299 query = query.arg_lazy(
9300 "service",
9301 Box::new(move || {
9302 let service = service.clone();
9303 Box::pin(async move { service.into_id().await.unwrap().quote() })
9304 }),
9305 );
9306 if let Some(native) = opts.native {
9307 query = query.arg("native", native);
9308 }
9309 if let Some(ports) = opts.ports {
9310 query = query.arg("ports", ports);
9311 }
9312 Service {
9313 proc: self.proc.clone(),
9314 selection: query,
9315 graphql_client: self.graphql_client.clone(),
9316 }
9317 }
9318 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
9324 let mut query = self.selection.select("unixSocket");
9325 query = query.arg("path", path.into());
9326 Socket {
9327 proc: self.proc.clone(),
9328 selection: query,
9329 graphql_client: self.graphql_client.clone(),
9330 }
9331 }
9332}
9333#[derive(Clone)]
9334pub struct InputTypeDef {
9335 pub proc: Option<Arc<DaggerSessionProc>>,
9336 pub selection: Selection,
9337 pub graphql_client: DynGraphQLClient,
9338}
9339impl InputTypeDef {
9340 pub fn fields(&self) -> Vec<FieldTypeDef> {
9342 let query = self.selection.select("fields");
9343 vec![FieldTypeDef {
9344 proc: self.proc.clone(),
9345 selection: query,
9346 graphql_client: self.graphql_client.clone(),
9347 }]
9348 }
9349 pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
9351 let query = self.selection.select("id");
9352 query.execute(self.graphql_client.clone()).await
9353 }
9354 pub async fn name(&self) -> Result<String, DaggerError> {
9356 let query = self.selection.select("name");
9357 query.execute(self.graphql_client.clone()).await
9358 }
9359}
9360#[derive(Clone)]
9361pub struct InterfaceTypeDef {
9362 pub proc: Option<Arc<DaggerSessionProc>>,
9363 pub selection: Selection,
9364 pub graphql_client: DynGraphQLClient,
9365}
9366impl InterfaceTypeDef {
9367 pub async fn description(&self) -> Result<String, DaggerError> {
9369 let query = self.selection.select("description");
9370 query.execute(self.graphql_client.clone()).await
9371 }
9372 pub fn functions(&self) -> Vec<Function> {
9374 let query = self.selection.select("functions");
9375 vec![Function {
9376 proc: self.proc.clone(),
9377 selection: query,
9378 graphql_client: self.graphql_client.clone(),
9379 }]
9380 }
9381 pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
9383 let query = self.selection.select("id");
9384 query.execute(self.graphql_client.clone()).await
9385 }
9386 pub async fn name(&self) -> Result<String, DaggerError> {
9388 let query = self.selection.select("name");
9389 query.execute(self.graphql_client.clone()).await
9390 }
9391 pub fn source_map(&self) -> SourceMap {
9393 let query = self.selection.select("sourceMap");
9394 SourceMap {
9395 proc: self.proc.clone(),
9396 selection: query,
9397 graphql_client: self.graphql_client.clone(),
9398 }
9399 }
9400 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9402 let query = self.selection.select("sourceModuleName");
9403 query.execute(self.graphql_client.clone()).await
9404 }
9405}
9406#[derive(Clone)]
9407pub struct JsonValue {
9408 pub proc: Option<Arc<DaggerSessionProc>>,
9409 pub selection: Selection,
9410 pub graphql_client: DynGraphQLClient,
9411}
9412#[derive(Builder, Debug, PartialEq)]
9413pub struct JsonValueContentsOpts<'a> {
9414 #[builder(setter(into, strip_option), default)]
9416 pub indent: Option<&'a str>,
9417 #[builder(setter(into, strip_option), default)]
9419 pub pretty: Option<bool>,
9420}
9421impl JsonValue {
9422 pub fn as_array(&self) -> Vec<JsonValue> {
9424 let query = self.selection.select("asArray");
9425 vec![JsonValue {
9426 proc: self.proc.clone(),
9427 selection: query,
9428 graphql_client: self.graphql_client.clone(),
9429 }]
9430 }
9431 pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
9433 let query = self.selection.select("asBoolean");
9434 query.execute(self.graphql_client.clone()).await
9435 }
9436 pub async fn as_integer(&self) -> Result<isize, DaggerError> {
9438 let query = self.selection.select("asInteger");
9439 query.execute(self.graphql_client.clone()).await
9440 }
9441 pub async fn as_string(&self) -> Result<String, DaggerError> {
9443 let query = self.selection.select("asString");
9444 query.execute(self.graphql_client.clone()).await
9445 }
9446 pub async fn contents(&self) -> Result<Json, DaggerError> {
9452 let query = self.selection.select("contents");
9453 query.execute(self.graphql_client.clone()).await
9454 }
9455 pub async fn contents_opts<'a>(
9461 &self,
9462 opts: JsonValueContentsOpts<'a>,
9463 ) -> Result<Json, DaggerError> {
9464 let mut query = self.selection.select("contents");
9465 if let Some(pretty) = opts.pretty {
9466 query = query.arg("pretty", pretty);
9467 }
9468 if let Some(indent) = opts.indent {
9469 query = query.arg("indent", indent);
9470 }
9471 query.execute(self.graphql_client.clone()).await
9472 }
9473 pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
9479 let mut query = self.selection.select("field");
9480 query = query.arg(
9481 "path",
9482 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9483 );
9484 JsonValue {
9485 proc: self.proc.clone(),
9486 selection: query,
9487 graphql_client: self.graphql_client.clone(),
9488 }
9489 }
9490 pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
9492 let query = self.selection.select("fields");
9493 query.execute(self.graphql_client.clone()).await
9494 }
9495 pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
9497 let query = self.selection.select("id");
9498 query.execute(self.graphql_client.clone()).await
9499 }
9500 pub fn new_boolean(&self, value: bool) -> JsonValue {
9506 let mut query = self.selection.select("newBoolean");
9507 query = query.arg("value", value);
9508 JsonValue {
9509 proc: self.proc.clone(),
9510 selection: query,
9511 graphql_client: self.graphql_client.clone(),
9512 }
9513 }
9514 pub fn new_integer(&self, value: isize) -> JsonValue {
9520 let mut query = self.selection.select("newInteger");
9521 query = query.arg("value", value);
9522 JsonValue {
9523 proc: self.proc.clone(),
9524 selection: query,
9525 graphql_client: self.graphql_client.clone(),
9526 }
9527 }
9528 pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
9534 let mut query = self.selection.select("newString");
9535 query = query.arg("value", value.into());
9536 JsonValue {
9537 proc: self.proc.clone(),
9538 selection: query,
9539 graphql_client: self.graphql_client.clone(),
9540 }
9541 }
9542 pub fn with_contents(&self, contents: Json) -> JsonValue {
9548 let mut query = self.selection.select("withContents");
9549 query = query.arg("contents", contents);
9550 JsonValue {
9551 proc: self.proc.clone(),
9552 selection: query,
9553 graphql_client: self.graphql_client.clone(),
9554 }
9555 }
9556 pub fn with_field(
9563 &self,
9564 path: Vec<impl Into<String>>,
9565 value: impl IntoID<JsonValueId>,
9566 ) -> JsonValue {
9567 let mut query = self.selection.select("withField");
9568 query = query.arg(
9569 "path",
9570 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9571 );
9572 query = query.arg_lazy(
9573 "value",
9574 Box::new(move || {
9575 let value = value.clone();
9576 Box::pin(async move { value.into_id().await.unwrap().quote() })
9577 }),
9578 );
9579 JsonValue {
9580 proc: self.proc.clone(),
9581 selection: query,
9582 graphql_client: self.graphql_client.clone(),
9583 }
9584 }
9585}
9586#[derive(Clone)]
9587pub struct Llm {
9588 pub proc: Option<Arc<DaggerSessionProc>>,
9589 pub selection: Selection,
9590 pub graphql_client: DynGraphQLClient,
9591}
9592impl Llm {
9593 pub fn attempt(&self, number: isize) -> Llm {
9595 let mut query = self.selection.select("attempt");
9596 query = query.arg("number", number);
9597 Llm {
9598 proc: self.proc.clone(),
9599 selection: query,
9600 graphql_client: self.graphql_client.clone(),
9601 }
9602 }
9603 pub fn bind_result(&self, name: impl Into<String>) -> Binding {
9605 let mut query = self.selection.select("bindResult");
9606 query = query.arg("name", name.into());
9607 Binding {
9608 proc: self.proc.clone(),
9609 selection: query,
9610 graphql_client: self.graphql_client.clone(),
9611 }
9612 }
9613 pub fn env(&self) -> Env {
9615 let query = self.selection.select("env");
9616 Env {
9617 proc: self.proc.clone(),
9618 selection: query,
9619 graphql_client: self.graphql_client.clone(),
9620 }
9621 }
9622 pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
9624 let query = self.selection.select("hasPrompt");
9625 query.execute(self.graphql_client.clone()).await
9626 }
9627 pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
9629 let query = self.selection.select("history");
9630 query.execute(self.graphql_client.clone()).await
9631 }
9632 pub async fn history_json(&self) -> Result<Json, DaggerError> {
9634 let query = self.selection.select("historyJSON");
9635 query.execute(self.graphql_client.clone()).await
9636 }
9637 pub async fn id(&self) -> Result<Llmid, DaggerError> {
9639 let query = self.selection.select("id");
9640 query.execute(self.graphql_client.clone()).await
9641 }
9642 pub async fn last_reply(&self) -> Result<String, DaggerError> {
9644 let query = self.selection.select("lastReply");
9645 query.execute(self.graphql_client.clone()).await
9646 }
9647 pub fn r#loop(&self) -> Llm {
9649 let query = self.selection.select("loop");
9650 Llm {
9651 proc: self.proc.clone(),
9652 selection: query,
9653 graphql_client: self.graphql_client.clone(),
9654 }
9655 }
9656 pub async fn model(&self) -> Result<String, DaggerError> {
9658 let query = self.selection.select("model");
9659 query.execute(self.graphql_client.clone()).await
9660 }
9661 pub async fn provider(&self) -> Result<String, DaggerError> {
9663 let query = self.selection.select("provider");
9664 query.execute(self.graphql_client.clone()).await
9665 }
9666 pub async fn step(&self) -> Result<Llmid, DaggerError> {
9668 let query = self.selection.select("step");
9669 query.execute(self.graphql_client.clone()).await
9670 }
9671 pub async fn sync(&self) -> Result<Llmid, DaggerError> {
9673 let query = self.selection.select("sync");
9674 query.execute(self.graphql_client.clone()).await
9675 }
9676 pub fn token_usage(&self) -> LlmTokenUsage {
9678 let query = self.selection.select("tokenUsage");
9679 LlmTokenUsage {
9680 proc: self.proc.clone(),
9681 selection: query,
9682 graphql_client: self.graphql_client.clone(),
9683 }
9684 }
9685 pub async fn tools(&self) -> Result<String, DaggerError> {
9687 let query = self.selection.select("tools");
9688 query.execute(self.graphql_client.clone()).await
9689 }
9690 pub fn with_blocked_function(
9699 &self,
9700 type_name: impl Into<String>,
9701 function: impl Into<String>,
9702 ) -> Llm {
9703 let mut query = self.selection.select("withBlockedFunction");
9704 query = query.arg("typeName", type_name.into());
9705 query = query.arg("function", function.into());
9706 Llm {
9707 proc: self.proc.clone(),
9708 selection: query,
9709 graphql_client: self.graphql_client.clone(),
9710 }
9711 }
9712 pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
9714 let mut query = self.selection.select("withEnv");
9715 query = query.arg_lazy(
9716 "env",
9717 Box::new(move || {
9718 let env = env.clone();
9719 Box::pin(async move { env.into_id().await.unwrap().quote() })
9720 }),
9721 );
9722 Llm {
9723 proc: self.proc.clone(),
9724 selection: query,
9725 graphql_client: self.graphql_client.clone(),
9726 }
9727 }
9728 pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<ServiceId>) -> Llm {
9735 let mut query = self.selection.select("withMCPServer");
9736 query = query.arg("name", name.into());
9737 query = query.arg_lazy(
9738 "service",
9739 Box::new(move || {
9740 let service = service.clone();
9741 Box::pin(async move { service.into_id().await.unwrap().quote() })
9742 }),
9743 );
9744 Llm {
9745 proc: self.proc.clone(),
9746 selection: query,
9747 graphql_client: self.graphql_client.clone(),
9748 }
9749 }
9750 pub fn with_model(&self, model: impl Into<String>) -> Llm {
9756 let mut query = self.selection.select("withModel");
9757 query = query.arg("model", model.into());
9758 Llm {
9759 proc: self.proc.clone(),
9760 selection: query,
9761 graphql_client: self.graphql_client.clone(),
9762 }
9763 }
9764 pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
9770 let mut query = self.selection.select("withPrompt");
9771 query = query.arg("prompt", prompt.into());
9772 Llm {
9773 proc: self.proc.clone(),
9774 selection: query,
9775 graphql_client: self.graphql_client.clone(),
9776 }
9777 }
9778 pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
9784 let mut query = self.selection.select("withPromptFile");
9785 query = query.arg_lazy(
9786 "file",
9787 Box::new(move || {
9788 let file = file.clone();
9789 Box::pin(async move { file.into_id().await.unwrap().quote() })
9790 }),
9791 );
9792 Llm {
9793 proc: self.proc.clone(),
9794 selection: query,
9795 graphql_client: self.graphql_client.clone(),
9796 }
9797 }
9798 pub fn with_static_tools(&self) -> Llm {
9800 let query = self.selection.select("withStaticTools");
9801 Llm {
9802 proc: self.proc.clone(),
9803 selection: query,
9804 graphql_client: self.graphql_client.clone(),
9805 }
9806 }
9807 pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
9813 let mut query = self.selection.select("withSystemPrompt");
9814 query = query.arg("prompt", prompt.into());
9815 Llm {
9816 proc: self.proc.clone(),
9817 selection: query,
9818 graphql_client: self.graphql_client.clone(),
9819 }
9820 }
9821 pub fn without_default_system_prompt(&self) -> Llm {
9823 let query = self.selection.select("withoutDefaultSystemPrompt");
9824 Llm {
9825 proc: self.proc.clone(),
9826 selection: query,
9827 graphql_client: self.graphql_client.clone(),
9828 }
9829 }
9830 pub fn without_message_history(&self) -> Llm {
9832 let query = self.selection.select("withoutMessageHistory");
9833 Llm {
9834 proc: self.proc.clone(),
9835 selection: query,
9836 graphql_client: self.graphql_client.clone(),
9837 }
9838 }
9839 pub fn without_system_prompts(&self) -> Llm {
9841 let query = self.selection.select("withoutSystemPrompts");
9842 Llm {
9843 proc: self.proc.clone(),
9844 selection: query,
9845 graphql_client: self.graphql_client.clone(),
9846 }
9847 }
9848}
9849#[derive(Clone)]
9850pub struct LlmTokenUsage {
9851 pub proc: Option<Arc<DaggerSessionProc>>,
9852 pub selection: Selection,
9853 pub graphql_client: DynGraphQLClient,
9854}
9855impl LlmTokenUsage {
9856 pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
9857 let query = self.selection.select("cachedTokenReads");
9858 query.execute(self.graphql_client.clone()).await
9859 }
9860 pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
9861 let query = self.selection.select("cachedTokenWrites");
9862 query.execute(self.graphql_client.clone()).await
9863 }
9864 pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
9866 let query = self.selection.select("id");
9867 query.execute(self.graphql_client.clone()).await
9868 }
9869 pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
9870 let query = self.selection.select("inputTokens");
9871 query.execute(self.graphql_client.clone()).await
9872 }
9873 pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
9874 let query = self.selection.select("outputTokens");
9875 query.execute(self.graphql_client.clone()).await
9876 }
9877 pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
9878 let query = self.selection.select("totalTokens");
9879 query.execute(self.graphql_client.clone()).await
9880 }
9881}
9882#[derive(Clone)]
9883pub struct Label {
9884 pub proc: Option<Arc<DaggerSessionProc>>,
9885 pub selection: Selection,
9886 pub graphql_client: DynGraphQLClient,
9887}
9888impl Label {
9889 pub async fn id(&self) -> Result<LabelId, DaggerError> {
9891 let query = self.selection.select("id");
9892 query.execute(self.graphql_client.clone()).await
9893 }
9894 pub async fn name(&self) -> Result<String, DaggerError> {
9896 let query = self.selection.select("name");
9897 query.execute(self.graphql_client.clone()).await
9898 }
9899 pub async fn value(&self) -> Result<String, DaggerError> {
9901 let query = self.selection.select("value");
9902 query.execute(self.graphql_client.clone()).await
9903 }
9904}
9905#[derive(Clone)]
9906pub struct ListTypeDef {
9907 pub proc: Option<Arc<DaggerSessionProc>>,
9908 pub selection: Selection,
9909 pub graphql_client: DynGraphQLClient,
9910}
9911impl ListTypeDef {
9912 pub fn element_type_def(&self) -> TypeDef {
9914 let query = self.selection.select("elementTypeDef");
9915 TypeDef {
9916 proc: self.proc.clone(),
9917 selection: query,
9918 graphql_client: self.graphql_client.clone(),
9919 }
9920 }
9921 pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
9923 let query = self.selection.select("id");
9924 query.execute(self.graphql_client.clone()).await
9925 }
9926}
9927#[derive(Clone)]
9928pub struct Module {
9929 pub proc: Option<Arc<DaggerSessionProc>>,
9930 pub selection: Selection,
9931 pub graphql_client: DynGraphQLClient,
9932}
9933#[derive(Builder, Debug, PartialEq)]
9934pub struct ModuleChecksOpts<'a> {
9935 #[builder(setter(into, strip_option), default)]
9937 pub include: Option<Vec<&'a str>>,
9938}
9939#[derive(Builder, Debug, PartialEq)]
9940pub struct ModuleServeOpts {
9941 #[builder(setter(into, strip_option), default)]
9943 pub include_dependencies: Option<bool>,
9944}
9945impl Module {
9946 pub fn check(&self, name: impl Into<String>) -> Check {
9952 let mut query = self.selection.select("check");
9953 query = query.arg("name", name.into());
9954 Check {
9955 proc: self.proc.clone(),
9956 selection: query,
9957 graphql_client: self.graphql_client.clone(),
9958 }
9959 }
9960 pub fn checks(&self) -> CheckGroup {
9966 let query = self.selection.select("checks");
9967 CheckGroup {
9968 proc: self.proc.clone(),
9969 selection: query,
9970 graphql_client: self.graphql_client.clone(),
9971 }
9972 }
9973 pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
9979 let mut query = self.selection.select("checks");
9980 if let Some(include) = opts.include {
9981 query = query.arg("include", include);
9982 }
9983 CheckGroup {
9984 proc: self.proc.clone(),
9985 selection: query,
9986 graphql_client: self.graphql_client.clone(),
9987 }
9988 }
9989 pub fn dependencies(&self) -> Vec<Module> {
9991 let query = self.selection.select("dependencies");
9992 vec![Module {
9993 proc: self.proc.clone(),
9994 selection: query,
9995 graphql_client: self.graphql_client.clone(),
9996 }]
9997 }
9998 pub async fn description(&self) -> Result<String, DaggerError> {
10000 let query = self.selection.select("description");
10001 query.execute(self.graphql_client.clone()).await
10002 }
10003 pub fn enums(&self) -> Vec<TypeDef> {
10005 let query = self.selection.select("enums");
10006 vec![TypeDef {
10007 proc: self.proc.clone(),
10008 selection: query,
10009 graphql_client: self.graphql_client.clone(),
10010 }]
10011 }
10012 pub fn generated_context_directory(&self) -> Directory {
10014 let query = self.selection.select("generatedContextDirectory");
10015 Directory {
10016 proc: self.proc.clone(),
10017 selection: query,
10018 graphql_client: self.graphql_client.clone(),
10019 }
10020 }
10021 pub async fn id(&self) -> Result<ModuleId, DaggerError> {
10023 let query = self.selection.select("id");
10024 query.execute(self.graphql_client.clone()).await
10025 }
10026 pub fn interfaces(&self) -> Vec<TypeDef> {
10028 let query = self.selection.select("interfaces");
10029 vec![TypeDef {
10030 proc: self.proc.clone(),
10031 selection: query,
10032 graphql_client: self.graphql_client.clone(),
10033 }]
10034 }
10035 pub fn introspection_schema_json(&self) -> File {
10039 let query = self.selection.select("introspectionSchemaJSON");
10040 File {
10041 proc: self.proc.clone(),
10042 selection: query,
10043 graphql_client: self.graphql_client.clone(),
10044 }
10045 }
10046 pub async fn name(&self) -> Result<String, DaggerError> {
10048 let query = self.selection.select("name");
10049 query.execute(self.graphql_client.clone()).await
10050 }
10051 pub fn objects(&self) -> Vec<TypeDef> {
10053 let query = self.selection.select("objects");
10054 vec![TypeDef {
10055 proc: self.proc.clone(),
10056 selection: query,
10057 graphql_client: self.graphql_client.clone(),
10058 }]
10059 }
10060 pub fn runtime(&self) -> Container {
10062 let query = self.selection.select("runtime");
10063 Container {
10064 proc: self.proc.clone(),
10065 selection: query,
10066 graphql_client: self.graphql_client.clone(),
10067 }
10068 }
10069 pub fn sdk(&self) -> SdkConfig {
10071 let query = self.selection.select("sdk");
10072 SdkConfig {
10073 proc: self.proc.clone(),
10074 selection: query,
10075 graphql_client: self.graphql_client.clone(),
10076 }
10077 }
10078 pub async fn serve(&self) -> Result<Void, DaggerError> {
10085 let query = self.selection.select("serve");
10086 query.execute(self.graphql_client.clone()).await
10087 }
10088 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
10095 let mut query = self.selection.select("serve");
10096 if let Some(include_dependencies) = opts.include_dependencies {
10097 query = query.arg("includeDependencies", include_dependencies);
10098 }
10099 query.execute(self.graphql_client.clone()).await
10100 }
10101 pub fn source(&self) -> ModuleSource {
10103 let query = self.selection.select("source");
10104 ModuleSource {
10105 proc: self.proc.clone(),
10106 selection: query,
10107 graphql_client: self.graphql_client.clone(),
10108 }
10109 }
10110 pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
10112 let query = self.selection.select("sync");
10113 query.execute(self.graphql_client.clone()).await
10114 }
10115 pub fn user_defaults(&self) -> EnvFile {
10117 let query = self.selection.select("userDefaults");
10118 EnvFile {
10119 proc: self.proc.clone(),
10120 selection: query,
10121 graphql_client: self.graphql_client.clone(),
10122 }
10123 }
10124 pub fn with_description(&self, description: impl Into<String>) -> Module {
10130 let mut query = self.selection.select("withDescription");
10131 query = query.arg("description", description.into());
10132 Module {
10133 proc: self.proc.clone(),
10134 selection: query,
10135 graphql_client: self.graphql_client.clone(),
10136 }
10137 }
10138 pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
10140 let mut query = self.selection.select("withEnum");
10141 query = query.arg_lazy(
10142 "enum",
10143 Box::new(move || {
10144 let r#enum = r#enum.clone();
10145 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
10146 }),
10147 );
10148 Module {
10149 proc: self.proc.clone(),
10150 selection: query,
10151 graphql_client: self.graphql_client.clone(),
10152 }
10153 }
10154 pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
10156 let mut query = self.selection.select("withInterface");
10157 query = query.arg_lazy(
10158 "iface",
10159 Box::new(move || {
10160 let iface = iface.clone();
10161 Box::pin(async move { iface.into_id().await.unwrap().quote() })
10162 }),
10163 );
10164 Module {
10165 proc: self.proc.clone(),
10166 selection: query,
10167 graphql_client: self.graphql_client.clone(),
10168 }
10169 }
10170 pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
10172 let mut query = self.selection.select("withObject");
10173 query = query.arg_lazy(
10174 "object",
10175 Box::new(move || {
10176 let object = object.clone();
10177 Box::pin(async move { object.into_id().await.unwrap().quote() })
10178 }),
10179 );
10180 Module {
10181 proc: self.proc.clone(),
10182 selection: query,
10183 graphql_client: self.graphql_client.clone(),
10184 }
10185 }
10186}
10187#[derive(Clone)]
10188pub struct ModuleConfigClient {
10189 pub proc: Option<Arc<DaggerSessionProc>>,
10190 pub selection: Selection,
10191 pub graphql_client: DynGraphQLClient,
10192}
10193impl ModuleConfigClient {
10194 pub async fn directory(&self) -> Result<String, DaggerError> {
10196 let query = self.selection.select("directory");
10197 query.execute(self.graphql_client.clone()).await
10198 }
10199 pub async fn generator(&self) -> Result<String, DaggerError> {
10201 let query = self.selection.select("generator");
10202 query.execute(self.graphql_client.clone()).await
10203 }
10204 pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
10206 let query = self.selection.select("id");
10207 query.execute(self.graphql_client.clone()).await
10208 }
10209}
10210#[derive(Clone)]
10211pub struct ModuleSource {
10212 pub proc: Option<Arc<DaggerSessionProc>>,
10213 pub selection: Selection,
10214 pub graphql_client: DynGraphQLClient,
10215}
10216impl ModuleSource {
10217 pub fn as_module(&self) -> Module {
10219 let query = self.selection.select("asModule");
10220 Module {
10221 proc: self.proc.clone(),
10222 selection: query,
10223 graphql_client: self.graphql_client.clone(),
10224 }
10225 }
10226 pub async fn as_string(&self) -> Result<String, DaggerError> {
10228 let query = self.selection.select("asString");
10229 query.execute(self.graphql_client.clone()).await
10230 }
10231 pub fn blueprint(&self) -> ModuleSource {
10233 let query = self.selection.select("blueprint");
10234 ModuleSource {
10235 proc: self.proc.clone(),
10236 selection: query,
10237 graphql_client: self.graphql_client.clone(),
10238 }
10239 }
10240 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
10242 let query = self.selection.select("cloneRef");
10243 query.execute(self.graphql_client.clone()).await
10244 }
10245 pub async fn commit(&self) -> Result<String, DaggerError> {
10247 let query = self.selection.select("commit");
10248 query.execute(self.graphql_client.clone()).await
10249 }
10250 pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
10252 let query = self.selection.select("configClients");
10253 vec![ModuleConfigClient {
10254 proc: self.proc.clone(),
10255 selection: query,
10256 graphql_client: self.graphql_client.clone(),
10257 }]
10258 }
10259 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
10261 let query = self.selection.select("configExists");
10262 query.execute(self.graphql_client.clone()).await
10263 }
10264 pub fn context_directory(&self) -> Directory {
10266 let query = self.selection.select("contextDirectory");
10267 Directory {
10268 proc: self.proc.clone(),
10269 selection: query,
10270 graphql_client: self.graphql_client.clone(),
10271 }
10272 }
10273 pub fn dependencies(&self) -> Vec<ModuleSource> {
10275 let query = self.selection.select("dependencies");
10276 vec![ModuleSource {
10277 proc: self.proc.clone(),
10278 selection: query,
10279 graphql_client: self.graphql_client.clone(),
10280 }]
10281 }
10282 pub async fn digest(&self) -> Result<String, DaggerError> {
10284 let query = self.selection.select("digest");
10285 query.execute(self.graphql_client.clone()).await
10286 }
10287 pub fn directory(&self, path: impl Into<String>) -> Directory {
10293 let mut query = self.selection.select("directory");
10294 query = query.arg("path", path.into());
10295 Directory {
10296 proc: self.proc.clone(),
10297 selection: query,
10298 graphql_client: self.graphql_client.clone(),
10299 }
10300 }
10301 pub async fn engine_version(&self) -> Result<String, DaggerError> {
10303 let query = self.selection.select("engineVersion");
10304 query.execute(self.graphql_client.clone()).await
10305 }
10306 pub fn generated_context_directory(&self) -> Directory {
10308 let query = self.selection.select("generatedContextDirectory");
10309 Directory {
10310 proc: self.proc.clone(),
10311 selection: query,
10312 graphql_client: self.graphql_client.clone(),
10313 }
10314 }
10315 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
10317 let query = self.selection.select("htmlRepoURL");
10318 query.execute(self.graphql_client.clone()).await
10319 }
10320 pub async fn html_url(&self) -> Result<String, DaggerError> {
10322 let query = self.selection.select("htmlURL");
10323 query.execute(self.graphql_client.clone()).await
10324 }
10325 pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
10327 let query = self.selection.select("id");
10328 query.execute(self.graphql_client.clone()).await
10329 }
10330 pub fn introspection_schema_json(&self) -> File {
10334 let query = self.selection.select("introspectionSchemaJSON");
10335 File {
10336 proc: self.proc.clone(),
10337 selection: query,
10338 graphql_client: self.graphql_client.clone(),
10339 }
10340 }
10341 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
10343 let query = self.selection.select("kind");
10344 query.execute(self.graphql_client.clone()).await
10345 }
10346 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
10348 let query = self.selection.select("localContextDirectoryPath");
10349 query.execute(self.graphql_client.clone()).await
10350 }
10351 pub async fn module_name(&self) -> Result<String, DaggerError> {
10353 let query = self.selection.select("moduleName");
10354 query.execute(self.graphql_client.clone()).await
10355 }
10356 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
10358 let query = self.selection.select("moduleOriginalName");
10359 query.execute(self.graphql_client.clone()).await
10360 }
10361 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
10363 let query = self.selection.select("originalSubpath");
10364 query.execute(self.graphql_client.clone()).await
10365 }
10366 pub async fn pin(&self) -> Result<String, DaggerError> {
10368 let query = self.selection.select("pin");
10369 query.execute(self.graphql_client.clone()).await
10370 }
10371 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
10373 let query = self.selection.select("repoRootPath");
10374 query.execute(self.graphql_client.clone()).await
10375 }
10376 pub fn sdk(&self) -> SdkConfig {
10378 let query = self.selection.select("sdk");
10379 SdkConfig {
10380 proc: self.proc.clone(),
10381 selection: query,
10382 graphql_client: self.graphql_client.clone(),
10383 }
10384 }
10385 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
10387 let query = self.selection.select("sourceRootSubpath");
10388 query.execute(self.graphql_client.clone()).await
10389 }
10390 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
10392 let query = self.selection.select("sourceSubpath");
10393 query.execute(self.graphql_client.clone()).await
10394 }
10395 pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
10397 let query = self.selection.select("sync");
10398 query.execute(self.graphql_client.clone()).await
10399 }
10400 pub fn toolchains(&self) -> Vec<ModuleSource> {
10402 let query = self.selection.select("toolchains");
10403 vec![ModuleSource {
10404 proc: self.proc.clone(),
10405 selection: query,
10406 graphql_client: self.graphql_client.clone(),
10407 }]
10408 }
10409 pub fn user_defaults(&self) -> EnvFile {
10411 let query = self.selection.select("userDefaults");
10412 EnvFile {
10413 proc: self.proc.clone(),
10414 selection: query,
10415 graphql_client: self.graphql_client.clone(),
10416 }
10417 }
10418 pub async fn version(&self) -> Result<String, DaggerError> {
10420 let query = self.selection.select("version");
10421 query.execute(self.graphql_client.clone()).await
10422 }
10423 pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
10429 let mut query = self.selection.select("withBlueprint");
10430 query = query.arg_lazy(
10431 "blueprint",
10432 Box::new(move || {
10433 let blueprint = blueprint.clone();
10434 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
10435 }),
10436 );
10437 ModuleSource {
10438 proc: self.proc.clone(),
10439 selection: query,
10440 graphql_client: self.graphql_client.clone(),
10441 }
10442 }
10443 pub fn with_client(
10450 &self,
10451 generator: impl Into<String>,
10452 output_dir: impl Into<String>,
10453 ) -> ModuleSource {
10454 let mut query = self.selection.select("withClient");
10455 query = query.arg("generator", generator.into());
10456 query = query.arg("outputDir", output_dir.into());
10457 ModuleSource {
10458 proc: self.proc.clone(),
10459 selection: query,
10460 graphql_client: self.graphql_client.clone(),
10461 }
10462 }
10463 pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
10469 let mut query = self.selection.select("withDependencies");
10470 query = query.arg("dependencies", dependencies);
10471 ModuleSource {
10472 proc: self.proc.clone(),
10473 selection: query,
10474 graphql_client: self.graphql_client.clone(),
10475 }
10476 }
10477 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
10483 let mut query = self.selection.select("withEngineVersion");
10484 query = query.arg("version", version.into());
10485 ModuleSource {
10486 proc: self.proc.clone(),
10487 selection: query,
10488 graphql_client: self.graphql_client.clone(),
10489 }
10490 }
10491 pub fn with_experimental_features(
10497 &self,
10498 features: Vec<ModuleSourceExperimentalFeature>,
10499 ) -> ModuleSource {
10500 let mut query = self.selection.select("withExperimentalFeatures");
10501 query = query.arg("features", features);
10502 ModuleSource {
10503 proc: self.proc.clone(),
10504 selection: query,
10505 graphql_client: self.graphql_client.clone(),
10506 }
10507 }
10508 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
10514 let mut query = self.selection.select("withIncludes");
10515 query = query.arg(
10516 "patterns",
10517 patterns
10518 .into_iter()
10519 .map(|i| i.into())
10520 .collect::<Vec<String>>(),
10521 );
10522 ModuleSource {
10523 proc: self.proc.clone(),
10524 selection: query,
10525 graphql_client: self.graphql_client.clone(),
10526 }
10527 }
10528 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
10534 let mut query = self.selection.select("withName");
10535 query = query.arg("name", name.into());
10536 ModuleSource {
10537 proc: self.proc.clone(),
10538 selection: query,
10539 graphql_client: self.graphql_client.clone(),
10540 }
10541 }
10542 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
10548 let mut query = self.selection.select("withSDK");
10549 query = query.arg("source", source.into());
10550 ModuleSource {
10551 proc: self.proc.clone(),
10552 selection: query,
10553 graphql_client: self.graphql_client.clone(),
10554 }
10555 }
10556 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
10562 let mut query = self.selection.select("withSourceSubpath");
10563 query = query.arg("path", path.into());
10564 ModuleSource {
10565 proc: self.proc.clone(),
10566 selection: query,
10567 graphql_client: self.graphql_client.clone(),
10568 }
10569 }
10570 pub fn with_toolchains(&self, toolchains: Vec<ModuleSourceId>) -> ModuleSource {
10576 let mut query = self.selection.select("withToolchains");
10577 query = query.arg("toolchains", toolchains);
10578 ModuleSource {
10579 proc: self.proc.clone(),
10580 selection: query,
10581 graphql_client: self.graphql_client.clone(),
10582 }
10583 }
10584 pub fn with_update_blueprint(&self) -> ModuleSource {
10586 let query = self.selection.select("withUpdateBlueprint");
10587 ModuleSource {
10588 proc: self.proc.clone(),
10589 selection: query,
10590 graphql_client: self.graphql_client.clone(),
10591 }
10592 }
10593 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
10599 let mut query = self.selection.select("withUpdateDependencies");
10600 query = query.arg(
10601 "dependencies",
10602 dependencies
10603 .into_iter()
10604 .map(|i| i.into())
10605 .collect::<Vec<String>>(),
10606 );
10607 ModuleSource {
10608 proc: self.proc.clone(),
10609 selection: query,
10610 graphql_client: self.graphql_client.clone(),
10611 }
10612 }
10613 pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
10619 let mut query = self.selection.select("withUpdateToolchains");
10620 query = query.arg(
10621 "toolchains",
10622 toolchains
10623 .into_iter()
10624 .map(|i| i.into())
10625 .collect::<Vec<String>>(),
10626 );
10627 ModuleSource {
10628 proc: self.proc.clone(),
10629 selection: query,
10630 graphql_client: self.graphql_client.clone(),
10631 }
10632 }
10633 pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
10639 let mut query = self.selection.select("withUpdatedClients");
10640 query = query.arg(
10641 "clients",
10642 clients
10643 .into_iter()
10644 .map(|i| i.into())
10645 .collect::<Vec<String>>(),
10646 );
10647 ModuleSource {
10648 proc: self.proc.clone(),
10649 selection: query,
10650 graphql_client: self.graphql_client.clone(),
10651 }
10652 }
10653 pub fn without_blueprint(&self) -> ModuleSource {
10655 let query = self.selection.select("withoutBlueprint");
10656 ModuleSource {
10657 proc: self.proc.clone(),
10658 selection: query,
10659 graphql_client: self.graphql_client.clone(),
10660 }
10661 }
10662 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
10668 let mut query = self.selection.select("withoutClient");
10669 query = query.arg("path", path.into());
10670 ModuleSource {
10671 proc: self.proc.clone(),
10672 selection: query,
10673 graphql_client: self.graphql_client.clone(),
10674 }
10675 }
10676 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
10682 let mut query = self.selection.select("withoutDependencies");
10683 query = query.arg(
10684 "dependencies",
10685 dependencies
10686 .into_iter()
10687 .map(|i| i.into())
10688 .collect::<Vec<String>>(),
10689 );
10690 ModuleSource {
10691 proc: self.proc.clone(),
10692 selection: query,
10693 graphql_client: self.graphql_client.clone(),
10694 }
10695 }
10696 pub fn without_experimental_features(
10702 &self,
10703 features: Vec<ModuleSourceExperimentalFeature>,
10704 ) -> ModuleSource {
10705 let mut query = self.selection.select("withoutExperimentalFeatures");
10706 query = query.arg("features", features);
10707 ModuleSource {
10708 proc: self.proc.clone(),
10709 selection: query,
10710 graphql_client: self.graphql_client.clone(),
10711 }
10712 }
10713 pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
10719 let mut query = self.selection.select("withoutToolchains");
10720 query = query.arg(
10721 "toolchains",
10722 toolchains
10723 .into_iter()
10724 .map(|i| i.into())
10725 .collect::<Vec<String>>(),
10726 );
10727 ModuleSource {
10728 proc: self.proc.clone(),
10729 selection: query,
10730 graphql_client: self.graphql_client.clone(),
10731 }
10732 }
10733}
10734#[derive(Clone)]
10735pub struct ObjectTypeDef {
10736 pub proc: Option<Arc<DaggerSessionProc>>,
10737 pub selection: Selection,
10738 pub graphql_client: DynGraphQLClient,
10739}
10740impl ObjectTypeDef {
10741 pub fn constructor(&self) -> Function {
10743 let query = self.selection.select("constructor");
10744 Function {
10745 proc: self.proc.clone(),
10746 selection: query,
10747 graphql_client: self.graphql_client.clone(),
10748 }
10749 }
10750 pub async fn deprecated(&self) -> Result<String, DaggerError> {
10752 let query = self.selection.select("deprecated");
10753 query.execute(self.graphql_client.clone()).await
10754 }
10755 pub async fn description(&self) -> Result<String, DaggerError> {
10757 let query = self.selection.select("description");
10758 query.execute(self.graphql_client.clone()).await
10759 }
10760 pub fn fields(&self) -> Vec<FieldTypeDef> {
10762 let query = self.selection.select("fields");
10763 vec![FieldTypeDef {
10764 proc: self.proc.clone(),
10765 selection: query,
10766 graphql_client: self.graphql_client.clone(),
10767 }]
10768 }
10769 pub fn functions(&self) -> Vec<Function> {
10771 let query = self.selection.select("functions");
10772 vec![Function {
10773 proc: self.proc.clone(),
10774 selection: query,
10775 graphql_client: self.graphql_client.clone(),
10776 }]
10777 }
10778 pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
10780 let query = self.selection.select("id");
10781 query.execute(self.graphql_client.clone()).await
10782 }
10783 pub async fn name(&self) -> Result<String, DaggerError> {
10785 let query = self.selection.select("name");
10786 query.execute(self.graphql_client.clone()).await
10787 }
10788 pub fn source_map(&self) -> SourceMap {
10790 let query = self.selection.select("sourceMap");
10791 SourceMap {
10792 proc: self.proc.clone(),
10793 selection: query,
10794 graphql_client: self.graphql_client.clone(),
10795 }
10796 }
10797 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10799 let query = self.selection.select("sourceModuleName");
10800 query.execute(self.graphql_client.clone()).await
10801 }
10802}
10803#[derive(Clone)]
10804pub struct Port {
10805 pub proc: Option<Arc<DaggerSessionProc>>,
10806 pub selection: Selection,
10807 pub graphql_client: DynGraphQLClient,
10808}
10809impl Port {
10810 pub async fn description(&self) -> Result<String, DaggerError> {
10812 let query = self.selection.select("description");
10813 query.execute(self.graphql_client.clone()).await
10814 }
10815 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
10817 let query = self.selection.select("experimentalSkipHealthcheck");
10818 query.execute(self.graphql_client.clone()).await
10819 }
10820 pub async fn id(&self) -> Result<PortId, DaggerError> {
10822 let query = self.selection.select("id");
10823 query.execute(self.graphql_client.clone()).await
10824 }
10825 pub async fn port(&self) -> Result<isize, DaggerError> {
10827 let query = self.selection.select("port");
10828 query.execute(self.graphql_client.clone()).await
10829 }
10830 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
10832 let query = self.selection.select("protocol");
10833 query.execute(self.graphql_client.clone()).await
10834 }
10835}
10836#[derive(Clone)]
10837pub struct Query {
10838 pub proc: Option<Arc<DaggerSessionProc>>,
10839 pub selection: Selection,
10840 pub graphql_client: DynGraphQLClient,
10841}
10842#[derive(Builder, Debug, PartialEq)]
10843pub struct QueryContainerOpts {
10844 #[builder(setter(into, strip_option), default)]
10846 pub platform: Option<Platform>,
10847}
10848#[derive(Builder, Debug, PartialEq)]
10849pub struct QueryEnvOpts {
10850 #[builder(setter(into, strip_option), default)]
10852 pub privileged: Option<bool>,
10853 #[builder(setter(into, strip_option), default)]
10855 pub writable: Option<bool>,
10856}
10857#[derive(Builder, Debug, PartialEq)]
10858pub struct QueryEnvFileOpts {
10859 #[builder(setter(into, strip_option), default)]
10861 pub expand: Option<bool>,
10862}
10863#[derive(Builder, Debug, PartialEq)]
10864pub struct QueryFileOpts {
10865 #[builder(setter(into, strip_option), default)]
10867 pub permissions: Option<isize>,
10868}
10869#[derive(Builder, Debug, PartialEq)]
10870pub struct QueryGitOpts<'a> {
10871 #[builder(setter(into, strip_option), default)]
10873 pub experimental_service_host: Option<ServiceId>,
10874 #[builder(setter(into, strip_option), default)]
10876 pub http_auth_header: Option<SecretId>,
10877 #[builder(setter(into, strip_option), default)]
10879 pub http_auth_token: Option<SecretId>,
10880 #[builder(setter(into, strip_option), default)]
10882 pub http_auth_username: Option<&'a str>,
10883 #[builder(setter(into, strip_option), default)]
10885 pub keep_git_dir: Option<bool>,
10886 #[builder(setter(into, strip_option), default)]
10888 pub ssh_auth_socket: Option<SocketId>,
10889 #[builder(setter(into, strip_option), default)]
10891 pub ssh_known_hosts: Option<&'a str>,
10892}
10893#[derive(Builder, Debug, PartialEq)]
10894pub struct QueryHttpOpts<'a> {
10895 #[builder(setter(into, strip_option), default)]
10897 pub auth_header: Option<SecretId>,
10898 #[builder(setter(into, strip_option), default)]
10900 pub experimental_service_host: Option<ServiceId>,
10901 #[builder(setter(into, strip_option), default)]
10903 pub name: Option<&'a str>,
10904 #[builder(setter(into, strip_option), default)]
10906 pub permissions: Option<isize>,
10907}
10908#[derive(Builder, Debug, PartialEq)]
10909pub struct QueryLlmOpts<'a> {
10910 #[builder(setter(into, strip_option), default)]
10912 pub max_api_calls: Option<isize>,
10913 #[builder(setter(into, strip_option), default)]
10915 pub model: Option<&'a str>,
10916}
10917#[derive(Builder, Debug, PartialEq)]
10918pub struct QueryModuleSourceOpts<'a> {
10919 #[builder(setter(into, strip_option), default)]
10921 pub allow_not_exists: Option<bool>,
10922 #[builder(setter(into, strip_option), default)]
10924 pub disable_find_up: Option<bool>,
10925 #[builder(setter(into, strip_option), default)]
10927 pub ref_pin: Option<&'a str>,
10928 #[builder(setter(into, strip_option), default)]
10930 pub require_kind: Option<ModuleSourceKind>,
10931}
10932#[derive(Builder, Debug, PartialEq)]
10933pub struct QuerySecretOpts<'a> {
10934 #[builder(setter(into, strip_option), default)]
10938 pub cache_key: Option<&'a str>,
10939}
10940impl Query {
10941 pub fn address(&self, value: impl Into<String>) -> Address {
10943 let mut query = self.selection.select("address");
10944 query = query.arg("value", value.into());
10945 Address {
10946 proc: self.proc.clone(),
10947 selection: query,
10948 graphql_client: self.graphql_client.clone(),
10949 }
10950 }
10951 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
10957 let mut query = self.selection.select("cacheVolume");
10958 query = query.arg("key", key.into());
10959 CacheVolume {
10960 proc: self.proc.clone(),
10961 selection: query,
10962 graphql_client: self.graphql_client.clone(),
10963 }
10964 }
10965 pub fn cloud(&self) -> Cloud {
10967 let query = self.selection.select("cloud");
10968 Cloud {
10969 proc: self.proc.clone(),
10970 selection: query,
10971 graphql_client: self.graphql_client.clone(),
10972 }
10973 }
10974 pub fn container(&self) -> Container {
10981 let query = self.selection.select("container");
10982 Container {
10983 proc: self.proc.clone(),
10984 selection: query,
10985 graphql_client: self.graphql_client.clone(),
10986 }
10987 }
10988 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
10995 let mut query = self.selection.select("container");
10996 if let Some(platform) = opts.platform {
10997 query = query.arg("platform", platform);
10998 }
10999 Container {
11000 proc: self.proc.clone(),
11001 selection: query,
11002 graphql_client: self.graphql_client.clone(),
11003 }
11004 }
11005 pub fn current_env(&self) -> Env {
11009 let query = self.selection.select("currentEnv");
11010 Env {
11011 proc: self.proc.clone(),
11012 selection: query,
11013 graphql_client: self.graphql_client.clone(),
11014 }
11015 }
11016 pub fn current_function_call(&self) -> FunctionCall {
11019 let query = self.selection.select("currentFunctionCall");
11020 FunctionCall {
11021 proc: self.proc.clone(),
11022 selection: query,
11023 graphql_client: self.graphql_client.clone(),
11024 }
11025 }
11026 pub fn current_module(&self) -> CurrentModule {
11028 let query = self.selection.select("currentModule");
11029 CurrentModule {
11030 proc: self.proc.clone(),
11031 selection: query,
11032 graphql_client: self.graphql_client.clone(),
11033 }
11034 }
11035 pub fn current_type_defs(&self) -> Vec<TypeDef> {
11037 let query = self.selection.select("currentTypeDefs");
11038 vec![TypeDef {
11039 proc: self.proc.clone(),
11040 selection: query,
11041 graphql_client: self.graphql_client.clone(),
11042 }]
11043 }
11044 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
11046 let query = self.selection.select("defaultPlatform");
11047 query.execute(self.graphql_client.clone()).await
11048 }
11049 pub fn directory(&self) -> Directory {
11051 let query = self.selection.select("directory");
11052 Directory {
11053 proc: self.proc.clone(),
11054 selection: query,
11055 graphql_client: self.graphql_client.clone(),
11056 }
11057 }
11058 pub fn engine(&self) -> Engine {
11060 let query = self.selection.select("engine");
11061 Engine {
11062 proc: self.proc.clone(),
11063 selection: query,
11064 graphql_client: self.graphql_client.clone(),
11065 }
11066 }
11067 pub fn env(&self) -> Env {
11073 let query = self.selection.select("env");
11074 Env {
11075 proc: self.proc.clone(),
11076 selection: query,
11077 graphql_client: self.graphql_client.clone(),
11078 }
11079 }
11080 pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
11086 let mut query = self.selection.select("env");
11087 if let Some(privileged) = opts.privileged {
11088 query = query.arg("privileged", privileged);
11089 }
11090 if let Some(writable) = opts.writable {
11091 query = query.arg("writable", writable);
11092 }
11093 Env {
11094 proc: self.proc.clone(),
11095 selection: query,
11096 graphql_client: self.graphql_client.clone(),
11097 }
11098 }
11099 pub fn env_file(&self) -> EnvFile {
11105 let query = self.selection.select("envFile");
11106 EnvFile {
11107 proc: self.proc.clone(),
11108 selection: query,
11109 graphql_client: self.graphql_client.clone(),
11110 }
11111 }
11112 pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
11118 let mut query = self.selection.select("envFile");
11119 if let Some(expand) = opts.expand {
11120 query = query.arg("expand", expand);
11121 }
11122 EnvFile {
11123 proc: self.proc.clone(),
11124 selection: query,
11125 graphql_client: self.graphql_client.clone(),
11126 }
11127 }
11128 pub fn error(&self, message: impl Into<String>) -> Error {
11134 let mut query = self.selection.select("error");
11135 query = query.arg("message", message.into());
11136 Error {
11137 proc: self.proc.clone(),
11138 selection: query,
11139 graphql_client: self.graphql_client.clone(),
11140 }
11141 }
11142 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
11150 let mut query = self.selection.select("file");
11151 query = query.arg("name", name.into());
11152 query = query.arg("contents", contents.into());
11153 File {
11154 proc: self.proc.clone(),
11155 selection: query,
11156 graphql_client: self.graphql_client.clone(),
11157 }
11158 }
11159 pub fn file_opts(
11167 &self,
11168 name: impl Into<String>,
11169 contents: impl Into<String>,
11170 opts: QueryFileOpts,
11171 ) -> File {
11172 let mut query = self.selection.select("file");
11173 query = query.arg("name", name.into());
11174 query = query.arg("contents", contents.into());
11175 if let Some(permissions) = opts.permissions {
11176 query = query.arg("permissions", permissions);
11177 }
11178 File {
11179 proc: self.proc.clone(),
11180 selection: query,
11181 graphql_client: self.graphql_client.clone(),
11182 }
11183 }
11184 pub fn function(
11191 &self,
11192 name: impl Into<String>,
11193 return_type: impl IntoID<TypeDefId>,
11194 ) -> Function {
11195 let mut query = self.selection.select("function");
11196 query = query.arg("name", name.into());
11197 query = query.arg_lazy(
11198 "returnType",
11199 Box::new(move || {
11200 let return_type = return_type.clone();
11201 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
11202 }),
11203 );
11204 Function {
11205 proc: self.proc.clone(),
11206 selection: query,
11207 graphql_client: self.graphql_client.clone(),
11208 }
11209 }
11210 pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
11212 let mut query = self.selection.select("generatedCode");
11213 query = query.arg_lazy(
11214 "code",
11215 Box::new(move || {
11216 let code = code.clone();
11217 Box::pin(async move { code.into_id().await.unwrap().quote() })
11218 }),
11219 );
11220 GeneratedCode {
11221 proc: self.proc.clone(),
11222 selection: query,
11223 graphql_client: self.graphql_client.clone(),
11224 }
11225 }
11226 pub fn git(&self, url: impl Into<String>) -> GitRepository {
11237 let mut query = self.selection.select("git");
11238 query = query.arg("url", url.into());
11239 GitRepository {
11240 proc: self.proc.clone(),
11241 selection: query,
11242 graphql_client: self.graphql_client.clone(),
11243 }
11244 }
11245 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
11256 let mut query = self.selection.select("git");
11257 query = query.arg("url", url.into());
11258 if let Some(keep_git_dir) = opts.keep_git_dir {
11259 query = query.arg("keepGitDir", keep_git_dir);
11260 }
11261 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
11262 query = query.arg("sshKnownHosts", ssh_known_hosts);
11263 }
11264 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
11265 query = query.arg("sshAuthSocket", ssh_auth_socket);
11266 }
11267 if let Some(http_auth_username) = opts.http_auth_username {
11268 query = query.arg("httpAuthUsername", http_auth_username);
11269 }
11270 if let Some(http_auth_token) = opts.http_auth_token {
11271 query = query.arg("httpAuthToken", http_auth_token);
11272 }
11273 if let Some(http_auth_header) = opts.http_auth_header {
11274 query = query.arg("httpAuthHeader", http_auth_header);
11275 }
11276 if let Some(experimental_service_host) = opts.experimental_service_host {
11277 query = query.arg("experimentalServiceHost", experimental_service_host);
11278 }
11279 GitRepository {
11280 proc: self.proc.clone(),
11281 selection: query,
11282 graphql_client: self.graphql_client.clone(),
11283 }
11284 }
11285 pub fn host(&self) -> Host {
11287 let query = self.selection.select("host");
11288 Host {
11289 proc: self.proc.clone(),
11290 selection: query,
11291 graphql_client: self.graphql_client.clone(),
11292 }
11293 }
11294 pub fn http(&self, url: impl Into<String>) -> File {
11301 let mut query = self.selection.select("http");
11302 query = query.arg("url", url.into());
11303 File {
11304 proc: self.proc.clone(),
11305 selection: query,
11306 graphql_client: self.graphql_client.clone(),
11307 }
11308 }
11309 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
11316 let mut query = self.selection.select("http");
11317 query = query.arg("url", url.into());
11318 if let Some(name) = opts.name {
11319 query = query.arg("name", name);
11320 }
11321 if let Some(permissions) = opts.permissions {
11322 query = query.arg("permissions", permissions);
11323 }
11324 if let Some(auth_header) = opts.auth_header {
11325 query = query.arg("authHeader", auth_header);
11326 }
11327 if let Some(experimental_service_host) = opts.experimental_service_host {
11328 query = query.arg("experimentalServiceHost", experimental_service_host);
11329 }
11330 File {
11331 proc: self.proc.clone(),
11332 selection: query,
11333 graphql_client: self.graphql_client.clone(),
11334 }
11335 }
11336 pub fn json(&self) -> JsonValue {
11338 let query = self.selection.select("json");
11339 JsonValue {
11340 proc: self.proc.clone(),
11341 selection: query,
11342 graphql_client: self.graphql_client.clone(),
11343 }
11344 }
11345 pub fn llm(&self) -> Llm {
11351 let query = self.selection.select("llm");
11352 Llm {
11353 proc: self.proc.clone(),
11354 selection: query,
11355 graphql_client: self.graphql_client.clone(),
11356 }
11357 }
11358 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
11364 let mut query = self.selection.select("llm");
11365 if let Some(model) = opts.model {
11366 query = query.arg("model", model);
11367 }
11368 if let Some(max_api_calls) = opts.max_api_calls {
11369 query = query.arg("maxAPICalls", max_api_calls);
11370 }
11371 Llm {
11372 proc: self.proc.clone(),
11373 selection: query,
11374 graphql_client: self.graphql_client.clone(),
11375 }
11376 }
11377 pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
11379 let mut query = self.selection.select("loadAddressFromID");
11380 query = query.arg_lazy(
11381 "id",
11382 Box::new(move || {
11383 let id = id.clone();
11384 Box::pin(async move { id.into_id().await.unwrap().quote() })
11385 }),
11386 );
11387 Address {
11388 proc: self.proc.clone(),
11389 selection: query,
11390 graphql_client: self.graphql_client.clone(),
11391 }
11392 }
11393 pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
11395 let mut query = self.selection.select("loadBindingFromID");
11396 query = query.arg_lazy(
11397 "id",
11398 Box::new(move || {
11399 let id = id.clone();
11400 Box::pin(async move { id.into_id().await.unwrap().quote() })
11401 }),
11402 );
11403 Binding {
11404 proc: self.proc.clone(),
11405 selection: query,
11406 graphql_client: self.graphql_client.clone(),
11407 }
11408 }
11409 pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
11411 let mut query = self.selection.select("loadCacheVolumeFromID");
11412 query = query.arg_lazy(
11413 "id",
11414 Box::new(move || {
11415 let id = id.clone();
11416 Box::pin(async move { id.into_id().await.unwrap().quote() })
11417 }),
11418 );
11419 CacheVolume {
11420 proc: self.proc.clone(),
11421 selection: query,
11422 graphql_client: self.graphql_client.clone(),
11423 }
11424 }
11425 pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
11427 let mut query = self.selection.select("loadChangesetFromID");
11428 query = query.arg_lazy(
11429 "id",
11430 Box::new(move || {
11431 let id = id.clone();
11432 Box::pin(async move { id.into_id().await.unwrap().quote() })
11433 }),
11434 );
11435 Changeset {
11436 proc: self.proc.clone(),
11437 selection: query,
11438 graphql_client: self.graphql_client.clone(),
11439 }
11440 }
11441 pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
11443 let mut query = self.selection.select("loadCheckFromID");
11444 query = query.arg_lazy(
11445 "id",
11446 Box::new(move || {
11447 let id = id.clone();
11448 Box::pin(async move { id.into_id().await.unwrap().quote() })
11449 }),
11450 );
11451 Check {
11452 proc: self.proc.clone(),
11453 selection: query,
11454 graphql_client: self.graphql_client.clone(),
11455 }
11456 }
11457 pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
11459 let mut query = self.selection.select("loadCheckGroupFromID");
11460 query = query.arg_lazy(
11461 "id",
11462 Box::new(move || {
11463 let id = id.clone();
11464 Box::pin(async move { id.into_id().await.unwrap().quote() })
11465 }),
11466 );
11467 CheckGroup {
11468 proc: self.proc.clone(),
11469 selection: query,
11470 graphql_client: self.graphql_client.clone(),
11471 }
11472 }
11473 pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
11475 let mut query = self.selection.select("loadCloudFromID");
11476 query = query.arg_lazy(
11477 "id",
11478 Box::new(move || {
11479 let id = id.clone();
11480 Box::pin(async move { id.into_id().await.unwrap().quote() })
11481 }),
11482 );
11483 Cloud {
11484 proc: self.proc.clone(),
11485 selection: query,
11486 graphql_client: self.graphql_client.clone(),
11487 }
11488 }
11489 pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
11491 let mut query = self.selection.select("loadContainerFromID");
11492 query = query.arg_lazy(
11493 "id",
11494 Box::new(move || {
11495 let id = id.clone();
11496 Box::pin(async move { id.into_id().await.unwrap().quote() })
11497 }),
11498 );
11499 Container {
11500 proc: self.proc.clone(),
11501 selection: query,
11502 graphql_client: self.graphql_client.clone(),
11503 }
11504 }
11505 pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
11507 let mut query = self.selection.select("loadCurrentModuleFromID");
11508 query = query.arg_lazy(
11509 "id",
11510 Box::new(move || {
11511 let id = id.clone();
11512 Box::pin(async move { id.into_id().await.unwrap().quote() })
11513 }),
11514 );
11515 CurrentModule {
11516 proc: self.proc.clone(),
11517 selection: query,
11518 graphql_client: self.graphql_client.clone(),
11519 }
11520 }
11521 pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
11523 let mut query = self.selection.select("loadDirectoryFromID");
11524 query = query.arg_lazy(
11525 "id",
11526 Box::new(move || {
11527 let id = id.clone();
11528 Box::pin(async move { id.into_id().await.unwrap().quote() })
11529 }),
11530 );
11531 Directory {
11532 proc: self.proc.clone(),
11533 selection: query,
11534 graphql_client: self.graphql_client.clone(),
11535 }
11536 }
11537 pub fn load_engine_cache_entry_from_id(
11539 &self,
11540 id: impl IntoID<EngineCacheEntryId>,
11541 ) -> EngineCacheEntry {
11542 let mut query = self.selection.select("loadEngineCacheEntryFromID");
11543 query = query.arg_lazy(
11544 "id",
11545 Box::new(move || {
11546 let id = id.clone();
11547 Box::pin(async move { id.into_id().await.unwrap().quote() })
11548 }),
11549 );
11550 EngineCacheEntry {
11551 proc: self.proc.clone(),
11552 selection: query,
11553 graphql_client: self.graphql_client.clone(),
11554 }
11555 }
11556 pub fn load_engine_cache_entry_set_from_id(
11558 &self,
11559 id: impl IntoID<EngineCacheEntrySetId>,
11560 ) -> EngineCacheEntrySet {
11561 let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
11562 query = query.arg_lazy(
11563 "id",
11564 Box::new(move || {
11565 let id = id.clone();
11566 Box::pin(async move { id.into_id().await.unwrap().quote() })
11567 }),
11568 );
11569 EngineCacheEntrySet {
11570 proc: self.proc.clone(),
11571 selection: query,
11572 graphql_client: self.graphql_client.clone(),
11573 }
11574 }
11575 pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
11577 let mut query = self.selection.select("loadEngineCacheFromID");
11578 query = query.arg_lazy(
11579 "id",
11580 Box::new(move || {
11581 let id = id.clone();
11582 Box::pin(async move { id.into_id().await.unwrap().quote() })
11583 }),
11584 );
11585 EngineCache {
11586 proc: self.proc.clone(),
11587 selection: query,
11588 graphql_client: self.graphql_client.clone(),
11589 }
11590 }
11591 pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
11593 let mut query = self.selection.select("loadEngineFromID");
11594 query = query.arg_lazy(
11595 "id",
11596 Box::new(move || {
11597 let id = id.clone();
11598 Box::pin(async move { id.into_id().await.unwrap().quote() })
11599 }),
11600 );
11601 Engine {
11602 proc: self.proc.clone(),
11603 selection: query,
11604 graphql_client: self.graphql_client.clone(),
11605 }
11606 }
11607 pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
11609 let mut query = self.selection.select("loadEnumTypeDefFromID");
11610 query = query.arg_lazy(
11611 "id",
11612 Box::new(move || {
11613 let id = id.clone();
11614 Box::pin(async move { id.into_id().await.unwrap().quote() })
11615 }),
11616 );
11617 EnumTypeDef {
11618 proc: self.proc.clone(),
11619 selection: query,
11620 graphql_client: self.graphql_client.clone(),
11621 }
11622 }
11623 pub fn load_enum_value_type_def_from_id(
11625 &self,
11626 id: impl IntoID<EnumValueTypeDefId>,
11627 ) -> EnumValueTypeDef {
11628 let mut query = self.selection.select("loadEnumValueTypeDefFromID");
11629 query = query.arg_lazy(
11630 "id",
11631 Box::new(move || {
11632 let id = id.clone();
11633 Box::pin(async move { id.into_id().await.unwrap().quote() })
11634 }),
11635 );
11636 EnumValueTypeDef {
11637 proc: self.proc.clone(),
11638 selection: query,
11639 graphql_client: self.graphql_client.clone(),
11640 }
11641 }
11642 pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
11644 let mut query = self.selection.select("loadEnvFileFromID");
11645 query = query.arg_lazy(
11646 "id",
11647 Box::new(move || {
11648 let id = id.clone();
11649 Box::pin(async move { id.into_id().await.unwrap().quote() })
11650 }),
11651 );
11652 EnvFile {
11653 proc: self.proc.clone(),
11654 selection: query,
11655 graphql_client: self.graphql_client.clone(),
11656 }
11657 }
11658 pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
11660 let mut query = self.selection.select("loadEnvFromID");
11661 query = query.arg_lazy(
11662 "id",
11663 Box::new(move || {
11664 let id = id.clone();
11665 Box::pin(async move { id.into_id().await.unwrap().quote() })
11666 }),
11667 );
11668 Env {
11669 proc: self.proc.clone(),
11670 selection: query,
11671 graphql_client: self.graphql_client.clone(),
11672 }
11673 }
11674 pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
11676 let mut query = self.selection.select("loadEnvVariableFromID");
11677 query = query.arg_lazy(
11678 "id",
11679 Box::new(move || {
11680 let id = id.clone();
11681 Box::pin(async move { id.into_id().await.unwrap().quote() })
11682 }),
11683 );
11684 EnvVariable {
11685 proc: self.proc.clone(),
11686 selection: query,
11687 graphql_client: self.graphql_client.clone(),
11688 }
11689 }
11690 pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
11692 let mut query = self.selection.select("loadErrorFromID");
11693 query = query.arg_lazy(
11694 "id",
11695 Box::new(move || {
11696 let id = id.clone();
11697 Box::pin(async move { id.into_id().await.unwrap().quote() })
11698 }),
11699 );
11700 Error {
11701 proc: self.proc.clone(),
11702 selection: query,
11703 graphql_client: self.graphql_client.clone(),
11704 }
11705 }
11706 pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
11708 let mut query = self.selection.select("loadErrorValueFromID");
11709 query = query.arg_lazy(
11710 "id",
11711 Box::new(move || {
11712 let id = id.clone();
11713 Box::pin(async move { id.into_id().await.unwrap().quote() })
11714 }),
11715 );
11716 ErrorValue {
11717 proc: self.proc.clone(),
11718 selection: query,
11719 graphql_client: self.graphql_client.clone(),
11720 }
11721 }
11722 pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
11724 let mut query = self.selection.select("loadFieldTypeDefFromID");
11725 query = query.arg_lazy(
11726 "id",
11727 Box::new(move || {
11728 let id = id.clone();
11729 Box::pin(async move { id.into_id().await.unwrap().quote() })
11730 }),
11731 );
11732 FieldTypeDef {
11733 proc: self.proc.clone(),
11734 selection: query,
11735 graphql_client: self.graphql_client.clone(),
11736 }
11737 }
11738 pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
11740 let mut query = self.selection.select("loadFileFromID");
11741 query = query.arg_lazy(
11742 "id",
11743 Box::new(move || {
11744 let id = id.clone();
11745 Box::pin(async move { id.into_id().await.unwrap().quote() })
11746 }),
11747 );
11748 File {
11749 proc: self.proc.clone(),
11750 selection: query,
11751 graphql_client: self.graphql_client.clone(),
11752 }
11753 }
11754 pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
11756 let mut query = self.selection.select("loadFunctionArgFromID");
11757 query = query.arg_lazy(
11758 "id",
11759 Box::new(move || {
11760 let id = id.clone();
11761 Box::pin(async move { id.into_id().await.unwrap().quote() })
11762 }),
11763 );
11764 FunctionArg {
11765 proc: self.proc.clone(),
11766 selection: query,
11767 graphql_client: self.graphql_client.clone(),
11768 }
11769 }
11770 pub fn load_function_call_arg_value_from_id(
11772 &self,
11773 id: impl IntoID<FunctionCallArgValueId>,
11774 ) -> FunctionCallArgValue {
11775 let mut query = self.selection.select("loadFunctionCallArgValueFromID");
11776 query = query.arg_lazy(
11777 "id",
11778 Box::new(move || {
11779 let id = id.clone();
11780 Box::pin(async move { id.into_id().await.unwrap().quote() })
11781 }),
11782 );
11783 FunctionCallArgValue {
11784 proc: self.proc.clone(),
11785 selection: query,
11786 graphql_client: self.graphql_client.clone(),
11787 }
11788 }
11789 pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
11791 let mut query = self.selection.select("loadFunctionCallFromID");
11792 query = query.arg_lazy(
11793 "id",
11794 Box::new(move || {
11795 let id = id.clone();
11796 Box::pin(async move { id.into_id().await.unwrap().quote() })
11797 }),
11798 );
11799 FunctionCall {
11800 proc: self.proc.clone(),
11801 selection: query,
11802 graphql_client: self.graphql_client.clone(),
11803 }
11804 }
11805 pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
11807 let mut query = self.selection.select("loadFunctionFromID");
11808 query = query.arg_lazy(
11809 "id",
11810 Box::new(move || {
11811 let id = id.clone();
11812 Box::pin(async move { id.into_id().await.unwrap().quote() })
11813 }),
11814 );
11815 Function {
11816 proc: self.proc.clone(),
11817 selection: query,
11818 graphql_client: self.graphql_client.clone(),
11819 }
11820 }
11821 pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
11823 let mut query = self.selection.select("loadGeneratedCodeFromID");
11824 query = query.arg_lazy(
11825 "id",
11826 Box::new(move || {
11827 let id = id.clone();
11828 Box::pin(async move { id.into_id().await.unwrap().quote() })
11829 }),
11830 );
11831 GeneratedCode {
11832 proc: self.proc.clone(),
11833 selection: query,
11834 graphql_client: self.graphql_client.clone(),
11835 }
11836 }
11837 pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
11839 let mut query = self.selection.select("loadGitRefFromID");
11840 query = query.arg_lazy(
11841 "id",
11842 Box::new(move || {
11843 let id = id.clone();
11844 Box::pin(async move { id.into_id().await.unwrap().quote() })
11845 }),
11846 );
11847 GitRef {
11848 proc: self.proc.clone(),
11849 selection: query,
11850 graphql_client: self.graphql_client.clone(),
11851 }
11852 }
11853 pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
11855 let mut query = self.selection.select("loadGitRepositoryFromID");
11856 query = query.arg_lazy(
11857 "id",
11858 Box::new(move || {
11859 let id = id.clone();
11860 Box::pin(async move { id.into_id().await.unwrap().quote() })
11861 }),
11862 );
11863 GitRepository {
11864 proc: self.proc.clone(),
11865 selection: query,
11866 graphql_client: self.graphql_client.clone(),
11867 }
11868 }
11869 pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
11871 let mut query = self.selection.select("loadHostFromID");
11872 query = query.arg_lazy(
11873 "id",
11874 Box::new(move || {
11875 let id = id.clone();
11876 Box::pin(async move { id.into_id().await.unwrap().quote() })
11877 }),
11878 );
11879 Host {
11880 proc: self.proc.clone(),
11881 selection: query,
11882 graphql_client: self.graphql_client.clone(),
11883 }
11884 }
11885 pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
11887 let mut query = self.selection.select("loadInputTypeDefFromID");
11888 query = query.arg_lazy(
11889 "id",
11890 Box::new(move || {
11891 let id = id.clone();
11892 Box::pin(async move { id.into_id().await.unwrap().quote() })
11893 }),
11894 );
11895 InputTypeDef {
11896 proc: self.proc.clone(),
11897 selection: query,
11898 graphql_client: self.graphql_client.clone(),
11899 }
11900 }
11901 pub fn load_interface_type_def_from_id(
11903 &self,
11904 id: impl IntoID<InterfaceTypeDefId>,
11905 ) -> InterfaceTypeDef {
11906 let mut query = self.selection.select("loadInterfaceTypeDefFromID");
11907 query = query.arg_lazy(
11908 "id",
11909 Box::new(move || {
11910 let id = id.clone();
11911 Box::pin(async move { id.into_id().await.unwrap().quote() })
11912 }),
11913 );
11914 InterfaceTypeDef {
11915 proc: self.proc.clone(),
11916 selection: query,
11917 graphql_client: self.graphql_client.clone(),
11918 }
11919 }
11920 pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
11922 let mut query = self.selection.select("loadJSONValueFromID");
11923 query = query.arg_lazy(
11924 "id",
11925 Box::new(move || {
11926 let id = id.clone();
11927 Box::pin(async move { id.into_id().await.unwrap().quote() })
11928 }),
11929 );
11930 JsonValue {
11931 proc: self.proc.clone(),
11932 selection: query,
11933 graphql_client: self.graphql_client.clone(),
11934 }
11935 }
11936 pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
11938 let mut query = self.selection.select("loadLLMFromID");
11939 query = query.arg_lazy(
11940 "id",
11941 Box::new(move || {
11942 let id = id.clone();
11943 Box::pin(async move { id.into_id().await.unwrap().quote() })
11944 }),
11945 );
11946 Llm {
11947 proc: self.proc.clone(),
11948 selection: query,
11949 graphql_client: self.graphql_client.clone(),
11950 }
11951 }
11952 pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
11954 let mut query = self.selection.select("loadLLMTokenUsageFromID");
11955 query = query.arg_lazy(
11956 "id",
11957 Box::new(move || {
11958 let id = id.clone();
11959 Box::pin(async move { id.into_id().await.unwrap().quote() })
11960 }),
11961 );
11962 LlmTokenUsage {
11963 proc: self.proc.clone(),
11964 selection: query,
11965 graphql_client: self.graphql_client.clone(),
11966 }
11967 }
11968 pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
11970 let mut query = self.selection.select("loadLabelFromID");
11971 query = query.arg_lazy(
11972 "id",
11973 Box::new(move || {
11974 let id = id.clone();
11975 Box::pin(async move { id.into_id().await.unwrap().quote() })
11976 }),
11977 );
11978 Label {
11979 proc: self.proc.clone(),
11980 selection: query,
11981 graphql_client: self.graphql_client.clone(),
11982 }
11983 }
11984 pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
11986 let mut query = self.selection.select("loadListTypeDefFromID");
11987 query = query.arg_lazy(
11988 "id",
11989 Box::new(move || {
11990 let id = id.clone();
11991 Box::pin(async move { id.into_id().await.unwrap().quote() })
11992 }),
11993 );
11994 ListTypeDef {
11995 proc: self.proc.clone(),
11996 selection: query,
11997 graphql_client: self.graphql_client.clone(),
11998 }
11999 }
12000 pub fn load_module_config_client_from_id(
12002 &self,
12003 id: impl IntoID<ModuleConfigClientId>,
12004 ) -> ModuleConfigClient {
12005 let mut query = self.selection.select("loadModuleConfigClientFromID");
12006 query = query.arg_lazy(
12007 "id",
12008 Box::new(move || {
12009 let id = id.clone();
12010 Box::pin(async move { id.into_id().await.unwrap().quote() })
12011 }),
12012 );
12013 ModuleConfigClient {
12014 proc: self.proc.clone(),
12015 selection: query,
12016 graphql_client: self.graphql_client.clone(),
12017 }
12018 }
12019 pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
12021 let mut query = self.selection.select("loadModuleFromID");
12022 query = query.arg_lazy(
12023 "id",
12024 Box::new(move || {
12025 let id = id.clone();
12026 Box::pin(async move { id.into_id().await.unwrap().quote() })
12027 }),
12028 );
12029 Module {
12030 proc: self.proc.clone(),
12031 selection: query,
12032 graphql_client: self.graphql_client.clone(),
12033 }
12034 }
12035 pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
12037 let mut query = self.selection.select("loadModuleSourceFromID");
12038 query = query.arg_lazy(
12039 "id",
12040 Box::new(move || {
12041 let id = id.clone();
12042 Box::pin(async move { id.into_id().await.unwrap().quote() })
12043 }),
12044 );
12045 ModuleSource {
12046 proc: self.proc.clone(),
12047 selection: query,
12048 graphql_client: self.graphql_client.clone(),
12049 }
12050 }
12051 pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
12053 let mut query = self.selection.select("loadObjectTypeDefFromID");
12054 query = query.arg_lazy(
12055 "id",
12056 Box::new(move || {
12057 let id = id.clone();
12058 Box::pin(async move { id.into_id().await.unwrap().quote() })
12059 }),
12060 );
12061 ObjectTypeDef {
12062 proc: self.proc.clone(),
12063 selection: query,
12064 graphql_client: self.graphql_client.clone(),
12065 }
12066 }
12067 pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
12069 let mut query = self.selection.select("loadPortFromID");
12070 query = query.arg_lazy(
12071 "id",
12072 Box::new(move || {
12073 let id = id.clone();
12074 Box::pin(async move { id.into_id().await.unwrap().quote() })
12075 }),
12076 );
12077 Port {
12078 proc: self.proc.clone(),
12079 selection: query,
12080 graphql_client: self.graphql_client.clone(),
12081 }
12082 }
12083 pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
12085 let mut query = self.selection.select("loadSDKConfigFromID");
12086 query = query.arg_lazy(
12087 "id",
12088 Box::new(move || {
12089 let id = id.clone();
12090 Box::pin(async move { id.into_id().await.unwrap().quote() })
12091 }),
12092 );
12093 SdkConfig {
12094 proc: self.proc.clone(),
12095 selection: query,
12096 graphql_client: self.graphql_client.clone(),
12097 }
12098 }
12099 pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
12101 let mut query = self.selection.select("loadScalarTypeDefFromID");
12102 query = query.arg_lazy(
12103 "id",
12104 Box::new(move || {
12105 let id = id.clone();
12106 Box::pin(async move { id.into_id().await.unwrap().quote() })
12107 }),
12108 );
12109 ScalarTypeDef {
12110 proc: self.proc.clone(),
12111 selection: query,
12112 graphql_client: self.graphql_client.clone(),
12113 }
12114 }
12115 pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
12117 let mut query = self.selection.select("loadSearchResultFromID");
12118 query = query.arg_lazy(
12119 "id",
12120 Box::new(move || {
12121 let id = id.clone();
12122 Box::pin(async move { id.into_id().await.unwrap().quote() })
12123 }),
12124 );
12125 SearchResult {
12126 proc: self.proc.clone(),
12127 selection: query,
12128 graphql_client: self.graphql_client.clone(),
12129 }
12130 }
12131 pub fn load_search_submatch_from_id(
12133 &self,
12134 id: impl IntoID<SearchSubmatchId>,
12135 ) -> SearchSubmatch {
12136 let mut query = self.selection.select("loadSearchSubmatchFromID");
12137 query = query.arg_lazy(
12138 "id",
12139 Box::new(move || {
12140 let id = id.clone();
12141 Box::pin(async move { id.into_id().await.unwrap().quote() })
12142 }),
12143 );
12144 SearchSubmatch {
12145 proc: self.proc.clone(),
12146 selection: query,
12147 graphql_client: self.graphql_client.clone(),
12148 }
12149 }
12150 pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
12152 let mut query = self.selection.select("loadSecretFromID");
12153 query = query.arg_lazy(
12154 "id",
12155 Box::new(move || {
12156 let id = id.clone();
12157 Box::pin(async move { id.into_id().await.unwrap().quote() })
12158 }),
12159 );
12160 Secret {
12161 proc: self.proc.clone(),
12162 selection: query,
12163 graphql_client: self.graphql_client.clone(),
12164 }
12165 }
12166 pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
12168 let mut query = self.selection.select("loadServiceFromID");
12169 query = query.arg_lazy(
12170 "id",
12171 Box::new(move || {
12172 let id = id.clone();
12173 Box::pin(async move { id.into_id().await.unwrap().quote() })
12174 }),
12175 );
12176 Service {
12177 proc: self.proc.clone(),
12178 selection: query,
12179 graphql_client: self.graphql_client.clone(),
12180 }
12181 }
12182 pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
12184 let mut query = self.selection.select("loadSocketFromID");
12185 query = query.arg_lazy(
12186 "id",
12187 Box::new(move || {
12188 let id = id.clone();
12189 Box::pin(async move { id.into_id().await.unwrap().quote() })
12190 }),
12191 );
12192 Socket {
12193 proc: self.proc.clone(),
12194 selection: query,
12195 graphql_client: self.graphql_client.clone(),
12196 }
12197 }
12198 pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
12200 let mut query = self.selection.select("loadSourceMapFromID");
12201 query = query.arg_lazy(
12202 "id",
12203 Box::new(move || {
12204 let id = id.clone();
12205 Box::pin(async move { id.into_id().await.unwrap().quote() })
12206 }),
12207 );
12208 SourceMap {
12209 proc: self.proc.clone(),
12210 selection: query,
12211 graphql_client: self.graphql_client.clone(),
12212 }
12213 }
12214 pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
12216 let mut query = self.selection.select("loadTerminalFromID");
12217 query = query.arg_lazy(
12218 "id",
12219 Box::new(move || {
12220 let id = id.clone();
12221 Box::pin(async move { id.into_id().await.unwrap().quote() })
12222 }),
12223 );
12224 Terminal {
12225 proc: self.proc.clone(),
12226 selection: query,
12227 graphql_client: self.graphql_client.clone(),
12228 }
12229 }
12230 pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
12232 let mut query = self.selection.select("loadTypeDefFromID");
12233 query = query.arg_lazy(
12234 "id",
12235 Box::new(move || {
12236 let id = id.clone();
12237 Box::pin(async move { id.into_id().await.unwrap().quote() })
12238 }),
12239 );
12240 TypeDef {
12241 proc: self.proc.clone(),
12242 selection: query,
12243 graphql_client: self.graphql_client.clone(),
12244 }
12245 }
12246 pub fn module(&self) -> Module {
12248 let query = self.selection.select("module");
12249 Module {
12250 proc: self.proc.clone(),
12251 selection: query,
12252 graphql_client: self.graphql_client.clone(),
12253 }
12254 }
12255 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
12262 let mut query = self.selection.select("moduleSource");
12263 query = query.arg("refString", ref_string.into());
12264 ModuleSource {
12265 proc: self.proc.clone(),
12266 selection: query,
12267 graphql_client: self.graphql_client.clone(),
12268 }
12269 }
12270 pub fn module_source_opts<'a>(
12277 &self,
12278 ref_string: impl Into<String>,
12279 opts: QueryModuleSourceOpts<'a>,
12280 ) -> ModuleSource {
12281 let mut query = self.selection.select("moduleSource");
12282 query = query.arg("refString", ref_string.into());
12283 if let Some(ref_pin) = opts.ref_pin {
12284 query = query.arg("refPin", ref_pin);
12285 }
12286 if let Some(disable_find_up) = opts.disable_find_up {
12287 query = query.arg("disableFindUp", disable_find_up);
12288 }
12289 if let Some(allow_not_exists) = opts.allow_not_exists {
12290 query = query.arg("allowNotExists", allow_not_exists);
12291 }
12292 if let Some(require_kind) = opts.require_kind {
12293 query = query.arg("requireKind", require_kind);
12294 }
12295 ModuleSource {
12296 proc: self.proc.clone(),
12297 selection: query,
12298 graphql_client: self.graphql_client.clone(),
12299 }
12300 }
12301 pub fn secret(&self, uri: impl Into<String>) -> Secret {
12308 let mut query = self.selection.select("secret");
12309 query = query.arg("uri", uri.into());
12310 Secret {
12311 proc: self.proc.clone(),
12312 selection: query,
12313 graphql_client: self.graphql_client.clone(),
12314 }
12315 }
12316 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
12323 let mut query = self.selection.select("secret");
12324 query = query.arg("uri", uri.into());
12325 if let Some(cache_key) = opts.cache_key {
12326 query = query.arg("cacheKey", cache_key);
12327 }
12328 Secret {
12329 proc: self.proc.clone(),
12330 selection: query,
12331 graphql_client: self.graphql_client.clone(),
12332 }
12333 }
12334 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
12342 let mut query = self.selection.select("setSecret");
12343 query = query.arg("name", name.into());
12344 query = query.arg("plaintext", plaintext.into());
12345 Secret {
12346 proc: self.proc.clone(),
12347 selection: query,
12348 graphql_client: self.graphql_client.clone(),
12349 }
12350 }
12351 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
12359 let mut query = self.selection.select("sourceMap");
12360 query = query.arg("filename", filename.into());
12361 query = query.arg("line", line);
12362 query = query.arg("column", column);
12363 SourceMap {
12364 proc: self.proc.clone(),
12365 selection: query,
12366 graphql_client: self.graphql_client.clone(),
12367 }
12368 }
12369 pub fn type_def(&self) -> TypeDef {
12371 let query = self.selection.select("typeDef");
12372 TypeDef {
12373 proc: self.proc.clone(),
12374 selection: query,
12375 graphql_client: self.graphql_client.clone(),
12376 }
12377 }
12378 pub async fn version(&self) -> Result<String, DaggerError> {
12380 let query = self.selection.select("version");
12381 query.execute(self.graphql_client.clone()).await
12382 }
12383}
12384#[derive(Clone)]
12385pub struct SdkConfig {
12386 pub proc: Option<Arc<DaggerSessionProc>>,
12387 pub selection: Selection,
12388 pub graphql_client: DynGraphQLClient,
12389}
12390impl SdkConfig {
12391 pub async fn debug(&self) -> Result<bool, DaggerError> {
12393 let query = self.selection.select("debug");
12394 query.execute(self.graphql_client.clone()).await
12395 }
12396 pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
12398 let query = self.selection.select("id");
12399 query.execute(self.graphql_client.clone()).await
12400 }
12401 pub async fn source(&self) -> Result<String, DaggerError> {
12403 let query = self.selection.select("source");
12404 query.execute(self.graphql_client.clone()).await
12405 }
12406}
12407#[derive(Clone)]
12408pub struct ScalarTypeDef {
12409 pub proc: Option<Arc<DaggerSessionProc>>,
12410 pub selection: Selection,
12411 pub graphql_client: DynGraphQLClient,
12412}
12413impl ScalarTypeDef {
12414 pub async fn description(&self) -> Result<String, DaggerError> {
12416 let query = self.selection.select("description");
12417 query.execute(self.graphql_client.clone()).await
12418 }
12419 pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
12421 let query = self.selection.select("id");
12422 query.execute(self.graphql_client.clone()).await
12423 }
12424 pub async fn name(&self) -> Result<String, DaggerError> {
12426 let query = self.selection.select("name");
12427 query.execute(self.graphql_client.clone()).await
12428 }
12429 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12431 let query = self.selection.select("sourceModuleName");
12432 query.execute(self.graphql_client.clone()).await
12433 }
12434}
12435#[derive(Clone)]
12436pub struct SearchResult {
12437 pub proc: Option<Arc<DaggerSessionProc>>,
12438 pub selection: Selection,
12439 pub graphql_client: DynGraphQLClient,
12440}
12441impl SearchResult {
12442 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
12444 let query = self.selection.select("absoluteOffset");
12445 query.execute(self.graphql_client.clone()).await
12446 }
12447 pub async fn file_path(&self) -> Result<String, DaggerError> {
12449 let query = self.selection.select("filePath");
12450 query.execute(self.graphql_client.clone()).await
12451 }
12452 pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
12454 let query = self.selection.select("id");
12455 query.execute(self.graphql_client.clone()).await
12456 }
12457 pub async fn line_number(&self) -> Result<isize, DaggerError> {
12459 let query = self.selection.select("lineNumber");
12460 query.execute(self.graphql_client.clone()).await
12461 }
12462 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
12464 let query = self.selection.select("matchedLines");
12465 query.execute(self.graphql_client.clone()).await
12466 }
12467 pub fn submatches(&self) -> Vec<SearchSubmatch> {
12469 let query = self.selection.select("submatches");
12470 vec![SearchSubmatch {
12471 proc: self.proc.clone(),
12472 selection: query,
12473 graphql_client: self.graphql_client.clone(),
12474 }]
12475 }
12476}
12477#[derive(Clone)]
12478pub struct SearchSubmatch {
12479 pub proc: Option<Arc<DaggerSessionProc>>,
12480 pub selection: Selection,
12481 pub graphql_client: DynGraphQLClient,
12482}
12483impl SearchSubmatch {
12484 pub async fn end(&self) -> Result<isize, DaggerError> {
12486 let query = self.selection.select("end");
12487 query.execute(self.graphql_client.clone()).await
12488 }
12489 pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
12491 let query = self.selection.select("id");
12492 query.execute(self.graphql_client.clone()).await
12493 }
12494 pub async fn start(&self) -> Result<isize, DaggerError> {
12496 let query = self.selection.select("start");
12497 query.execute(self.graphql_client.clone()).await
12498 }
12499 pub async fn text(&self) -> Result<String, DaggerError> {
12501 let query = self.selection.select("text");
12502 query.execute(self.graphql_client.clone()).await
12503 }
12504}
12505#[derive(Clone)]
12506pub struct Secret {
12507 pub proc: Option<Arc<DaggerSessionProc>>,
12508 pub selection: Selection,
12509 pub graphql_client: DynGraphQLClient,
12510}
12511impl Secret {
12512 pub async fn id(&self) -> Result<SecretId, DaggerError> {
12514 let query = self.selection.select("id");
12515 query.execute(self.graphql_client.clone()).await
12516 }
12517 pub async fn name(&self) -> Result<String, DaggerError> {
12519 let query = self.selection.select("name");
12520 query.execute(self.graphql_client.clone()).await
12521 }
12522 pub async fn plaintext(&self) -> Result<String, DaggerError> {
12524 let query = self.selection.select("plaintext");
12525 query.execute(self.graphql_client.clone()).await
12526 }
12527 pub async fn uri(&self) -> Result<String, DaggerError> {
12529 let query = self.selection.select("uri");
12530 query.execute(self.graphql_client.clone()).await
12531 }
12532}
12533#[derive(Clone)]
12534pub struct Service {
12535 pub proc: Option<Arc<DaggerSessionProc>>,
12536 pub selection: Selection,
12537 pub graphql_client: DynGraphQLClient,
12538}
12539#[derive(Builder, Debug, PartialEq)]
12540pub struct ServiceEndpointOpts<'a> {
12541 #[builder(setter(into, strip_option), default)]
12543 pub port: Option<isize>,
12544 #[builder(setter(into, strip_option), default)]
12546 pub scheme: Option<&'a str>,
12547}
12548#[derive(Builder, Debug, PartialEq)]
12549pub struct ServiceStopOpts {
12550 #[builder(setter(into, strip_option), default)]
12552 pub kill: Option<bool>,
12553}
12554#[derive(Builder, Debug, PartialEq)]
12555pub struct ServiceTerminalOpts<'a> {
12556 #[builder(setter(into, strip_option), default)]
12557 pub cmd: Option<Vec<&'a str>>,
12558}
12559#[derive(Builder, Debug, PartialEq)]
12560pub struct ServiceUpOpts {
12561 #[builder(setter(into, strip_option), default)]
12564 pub ports: Option<Vec<PortForward>>,
12565 #[builder(setter(into, strip_option), default)]
12567 pub random: Option<bool>,
12568}
12569impl Service {
12570 pub async fn endpoint(&self) -> Result<String, DaggerError> {
12578 let query = self.selection.select("endpoint");
12579 query.execute(self.graphql_client.clone()).await
12580 }
12581 pub async fn endpoint_opts<'a>(
12589 &self,
12590 opts: ServiceEndpointOpts<'a>,
12591 ) -> Result<String, DaggerError> {
12592 let mut query = self.selection.select("endpoint");
12593 if let Some(port) = opts.port {
12594 query = query.arg("port", port);
12595 }
12596 if let Some(scheme) = opts.scheme {
12597 query = query.arg("scheme", scheme);
12598 }
12599 query.execute(self.graphql_client.clone()).await
12600 }
12601 pub async fn hostname(&self) -> Result<String, DaggerError> {
12603 let query = self.selection.select("hostname");
12604 query.execute(self.graphql_client.clone()).await
12605 }
12606 pub async fn id(&self) -> Result<ServiceId, DaggerError> {
12608 let query = self.selection.select("id");
12609 query.execute(self.graphql_client.clone()).await
12610 }
12611 pub fn ports(&self) -> Vec<Port> {
12613 let query = self.selection.select("ports");
12614 vec![Port {
12615 proc: self.proc.clone(),
12616 selection: query,
12617 graphql_client: self.graphql_client.clone(),
12618 }]
12619 }
12620 pub async fn start(&self) -> Result<ServiceId, DaggerError> {
12623 let query = self.selection.select("start");
12624 query.execute(self.graphql_client.clone()).await
12625 }
12626 pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
12632 let query = self.selection.select("stop");
12633 query.execute(self.graphql_client.clone()).await
12634 }
12635 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
12641 let mut query = self.selection.select("stop");
12642 if let Some(kill) = opts.kill {
12643 query = query.arg("kill", kill);
12644 }
12645 query.execute(self.graphql_client.clone()).await
12646 }
12647 pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
12649 let query = self.selection.select("sync");
12650 query.execute(self.graphql_client.clone()).await
12651 }
12652 pub fn terminal(&self) -> Service {
12657 let query = self.selection.select("terminal");
12658 Service {
12659 proc: self.proc.clone(),
12660 selection: query,
12661 graphql_client: self.graphql_client.clone(),
12662 }
12663 }
12664 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
12669 let mut query = self.selection.select("terminal");
12670 if let Some(cmd) = opts.cmd {
12671 query = query.arg("cmd", cmd);
12672 }
12673 Service {
12674 proc: self.proc.clone(),
12675 selection: query,
12676 graphql_client: self.graphql_client.clone(),
12677 }
12678 }
12679 pub async fn up(&self) -> Result<Void, DaggerError> {
12685 let query = self.selection.select("up");
12686 query.execute(self.graphql_client.clone()).await
12687 }
12688 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
12694 let mut query = self.selection.select("up");
12695 if let Some(ports) = opts.ports {
12696 query = query.arg("ports", ports);
12697 }
12698 if let Some(random) = opts.random {
12699 query = query.arg("random", random);
12700 }
12701 query.execute(self.graphql_client.clone()).await
12702 }
12703 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
12709 let mut query = self.selection.select("withHostname");
12710 query = query.arg("hostname", hostname.into());
12711 Service {
12712 proc: self.proc.clone(),
12713 selection: query,
12714 graphql_client: self.graphql_client.clone(),
12715 }
12716 }
12717}
12718#[derive(Clone)]
12719pub struct Socket {
12720 pub proc: Option<Arc<DaggerSessionProc>>,
12721 pub selection: Selection,
12722 pub graphql_client: DynGraphQLClient,
12723}
12724impl Socket {
12725 pub async fn id(&self) -> Result<SocketId, DaggerError> {
12727 let query = self.selection.select("id");
12728 query.execute(self.graphql_client.clone()).await
12729 }
12730}
12731#[derive(Clone)]
12732pub struct SourceMap {
12733 pub proc: Option<Arc<DaggerSessionProc>>,
12734 pub selection: Selection,
12735 pub graphql_client: DynGraphQLClient,
12736}
12737impl SourceMap {
12738 pub async fn column(&self) -> Result<isize, DaggerError> {
12740 let query = self.selection.select("column");
12741 query.execute(self.graphql_client.clone()).await
12742 }
12743 pub async fn filename(&self) -> Result<String, DaggerError> {
12745 let query = self.selection.select("filename");
12746 query.execute(self.graphql_client.clone()).await
12747 }
12748 pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
12750 let query = self.selection.select("id");
12751 query.execute(self.graphql_client.clone()).await
12752 }
12753 pub async fn line(&self) -> Result<isize, DaggerError> {
12755 let query = self.selection.select("line");
12756 query.execute(self.graphql_client.clone()).await
12757 }
12758 pub async fn module(&self) -> Result<String, DaggerError> {
12760 let query = self.selection.select("module");
12761 query.execute(self.graphql_client.clone()).await
12762 }
12763 pub async fn url(&self) -> Result<String, DaggerError> {
12765 let query = self.selection.select("url");
12766 query.execute(self.graphql_client.clone()).await
12767 }
12768}
12769#[derive(Clone)]
12770pub struct Terminal {
12771 pub proc: Option<Arc<DaggerSessionProc>>,
12772 pub selection: Selection,
12773 pub graphql_client: DynGraphQLClient,
12774}
12775impl Terminal {
12776 pub async fn id(&self) -> Result<TerminalId, DaggerError> {
12778 let query = self.selection.select("id");
12779 query.execute(self.graphql_client.clone()).await
12780 }
12781 pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
12784 let query = self.selection.select("sync");
12785 query.execute(self.graphql_client.clone()).await
12786 }
12787}
12788#[derive(Clone)]
12789pub struct TypeDef {
12790 pub proc: Option<Arc<DaggerSessionProc>>,
12791 pub selection: Selection,
12792 pub graphql_client: DynGraphQLClient,
12793}
12794#[derive(Builder, Debug, PartialEq)]
12795pub struct TypeDefWithEnumOpts<'a> {
12796 #[builder(setter(into, strip_option), default)]
12798 pub description: Option<&'a str>,
12799 #[builder(setter(into, strip_option), default)]
12801 pub source_map: Option<SourceMapId>,
12802}
12803#[derive(Builder, Debug, PartialEq)]
12804pub struct TypeDefWithEnumMemberOpts<'a> {
12805 #[builder(setter(into, strip_option), default)]
12807 pub deprecated: Option<&'a str>,
12808 #[builder(setter(into, strip_option), default)]
12810 pub description: Option<&'a str>,
12811 #[builder(setter(into, strip_option), default)]
12813 pub source_map: Option<SourceMapId>,
12814 #[builder(setter(into, strip_option), default)]
12816 pub value: Option<&'a str>,
12817}
12818#[derive(Builder, Debug, PartialEq)]
12819pub struct TypeDefWithEnumValueOpts<'a> {
12820 #[builder(setter(into, strip_option), default)]
12822 pub deprecated: Option<&'a str>,
12823 #[builder(setter(into, strip_option), default)]
12825 pub description: Option<&'a str>,
12826 #[builder(setter(into, strip_option), default)]
12828 pub source_map: Option<SourceMapId>,
12829}
12830#[derive(Builder, Debug, PartialEq)]
12831pub struct TypeDefWithFieldOpts<'a> {
12832 #[builder(setter(into, strip_option), default)]
12834 pub deprecated: Option<&'a str>,
12835 #[builder(setter(into, strip_option), default)]
12837 pub description: Option<&'a str>,
12838 #[builder(setter(into, strip_option), default)]
12840 pub source_map: Option<SourceMapId>,
12841}
12842#[derive(Builder, Debug, PartialEq)]
12843pub struct TypeDefWithInterfaceOpts<'a> {
12844 #[builder(setter(into, strip_option), default)]
12845 pub description: Option<&'a str>,
12846 #[builder(setter(into, strip_option), default)]
12847 pub source_map: Option<SourceMapId>,
12848}
12849#[derive(Builder, Debug, PartialEq)]
12850pub struct TypeDefWithObjectOpts<'a> {
12851 #[builder(setter(into, strip_option), default)]
12852 pub deprecated: Option<&'a str>,
12853 #[builder(setter(into, strip_option), default)]
12854 pub description: Option<&'a str>,
12855 #[builder(setter(into, strip_option), default)]
12856 pub source_map: Option<SourceMapId>,
12857}
12858#[derive(Builder, Debug, PartialEq)]
12859pub struct TypeDefWithScalarOpts<'a> {
12860 #[builder(setter(into, strip_option), default)]
12861 pub description: Option<&'a str>,
12862}
12863impl TypeDef {
12864 pub fn as_enum(&self) -> EnumTypeDef {
12866 let query = self.selection.select("asEnum");
12867 EnumTypeDef {
12868 proc: self.proc.clone(),
12869 selection: query,
12870 graphql_client: self.graphql_client.clone(),
12871 }
12872 }
12873 pub fn as_input(&self) -> InputTypeDef {
12875 let query = self.selection.select("asInput");
12876 InputTypeDef {
12877 proc: self.proc.clone(),
12878 selection: query,
12879 graphql_client: self.graphql_client.clone(),
12880 }
12881 }
12882 pub fn as_interface(&self) -> InterfaceTypeDef {
12884 let query = self.selection.select("asInterface");
12885 InterfaceTypeDef {
12886 proc: self.proc.clone(),
12887 selection: query,
12888 graphql_client: self.graphql_client.clone(),
12889 }
12890 }
12891 pub fn as_list(&self) -> ListTypeDef {
12893 let query = self.selection.select("asList");
12894 ListTypeDef {
12895 proc: self.proc.clone(),
12896 selection: query,
12897 graphql_client: self.graphql_client.clone(),
12898 }
12899 }
12900 pub fn as_object(&self) -> ObjectTypeDef {
12902 let query = self.selection.select("asObject");
12903 ObjectTypeDef {
12904 proc: self.proc.clone(),
12905 selection: query,
12906 graphql_client: self.graphql_client.clone(),
12907 }
12908 }
12909 pub fn as_scalar(&self) -> ScalarTypeDef {
12911 let query = self.selection.select("asScalar");
12912 ScalarTypeDef {
12913 proc: self.proc.clone(),
12914 selection: query,
12915 graphql_client: self.graphql_client.clone(),
12916 }
12917 }
12918 pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
12920 let query = self.selection.select("id");
12921 query.execute(self.graphql_client.clone()).await
12922 }
12923 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
12925 let query = self.selection.select("kind");
12926 query.execute(self.graphql_client.clone()).await
12927 }
12928 pub async fn optional(&self) -> Result<bool, DaggerError> {
12930 let query = self.selection.select("optional");
12931 query.execute(self.graphql_client.clone()).await
12932 }
12933 pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
12935 let mut query = self.selection.select("withConstructor");
12936 query = query.arg_lazy(
12937 "function",
12938 Box::new(move || {
12939 let function = function.clone();
12940 Box::pin(async move { function.into_id().await.unwrap().quote() })
12941 }),
12942 );
12943 TypeDef {
12944 proc: self.proc.clone(),
12945 selection: query,
12946 graphql_client: self.graphql_client.clone(),
12947 }
12948 }
12949 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
12957 let mut query = self.selection.select("withEnum");
12958 query = query.arg("name", name.into());
12959 TypeDef {
12960 proc: self.proc.clone(),
12961 selection: query,
12962 graphql_client: self.graphql_client.clone(),
12963 }
12964 }
12965 pub fn with_enum_opts<'a>(
12973 &self,
12974 name: impl Into<String>,
12975 opts: TypeDefWithEnumOpts<'a>,
12976 ) -> TypeDef {
12977 let mut query = self.selection.select("withEnum");
12978 query = query.arg("name", name.into());
12979 if let Some(description) = opts.description {
12980 query = query.arg("description", description);
12981 }
12982 if let Some(source_map) = opts.source_map {
12983 query = query.arg("sourceMap", source_map);
12984 }
12985 TypeDef {
12986 proc: self.proc.clone(),
12987 selection: query,
12988 graphql_client: self.graphql_client.clone(),
12989 }
12990 }
12991 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
12998 let mut query = self.selection.select("withEnumMember");
12999 query = query.arg("name", name.into());
13000 TypeDef {
13001 proc: self.proc.clone(),
13002 selection: query,
13003 graphql_client: self.graphql_client.clone(),
13004 }
13005 }
13006 pub fn with_enum_member_opts<'a>(
13013 &self,
13014 name: impl Into<String>,
13015 opts: TypeDefWithEnumMemberOpts<'a>,
13016 ) -> TypeDef {
13017 let mut query = self.selection.select("withEnumMember");
13018 query = query.arg("name", name.into());
13019 if let Some(value) = opts.value {
13020 query = query.arg("value", value);
13021 }
13022 if let Some(description) = opts.description {
13023 query = query.arg("description", description);
13024 }
13025 if let Some(source_map) = opts.source_map {
13026 query = query.arg("sourceMap", source_map);
13027 }
13028 if let Some(deprecated) = opts.deprecated {
13029 query = query.arg("deprecated", deprecated);
13030 }
13031 TypeDef {
13032 proc: self.proc.clone(),
13033 selection: query,
13034 graphql_client: self.graphql_client.clone(),
13035 }
13036 }
13037 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
13044 let mut query = self.selection.select("withEnumValue");
13045 query = query.arg("value", value.into());
13046 TypeDef {
13047 proc: self.proc.clone(),
13048 selection: query,
13049 graphql_client: self.graphql_client.clone(),
13050 }
13051 }
13052 pub fn with_enum_value_opts<'a>(
13059 &self,
13060 value: impl Into<String>,
13061 opts: TypeDefWithEnumValueOpts<'a>,
13062 ) -> TypeDef {
13063 let mut query = self.selection.select("withEnumValue");
13064 query = query.arg("value", value.into());
13065 if let Some(description) = opts.description {
13066 query = query.arg("description", description);
13067 }
13068 if let Some(source_map) = opts.source_map {
13069 query = query.arg("sourceMap", source_map);
13070 }
13071 if let Some(deprecated) = opts.deprecated {
13072 query = query.arg("deprecated", deprecated);
13073 }
13074 TypeDef {
13075 proc: self.proc.clone(),
13076 selection: query,
13077 graphql_client: self.graphql_client.clone(),
13078 }
13079 }
13080 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
13088 let mut query = self.selection.select("withField");
13089 query = query.arg("name", name.into());
13090 query = query.arg_lazy(
13091 "typeDef",
13092 Box::new(move || {
13093 let type_def = type_def.clone();
13094 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
13095 }),
13096 );
13097 TypeDef {
13098 proc: self.proc.clone(),
13099 selection: query,
13100 graphql_client: self.graphql_client.clone(),
13101 }
13102 }
13103 pub fn with_field_opts<'a>(
13111 &self,
13112 name: impl Into<String>,
13113 type_def: impl IntoID<TypeDefId>,
13114 opts: TypeDefWithFieldOpts<'a>,
13115 ) -> TypeDef {
13116 let mut query = self.selection.select("withField");
13117 query = query.arg("name", name.into());
13118 query = query.arg_lazy(
13119 "typeDef",
13120 Box::new(move || {
13121 let type_def = type_def.clone();
13122 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
13123 }),
13124 );
13125 if let Some(description) = opts.description {
13126 query = query.arg("description", description);
13127 }
13128 if let Some(source_map) = opts.source_map {
13129 query = query.arg("sourceMap", source_map);
13130 }
13131 if let Some(deprecated) = opts.deprecated {
13132 query = query.arg("deprecated", deprecated);
13133 }
13134 TypeDef {
13135 proc: self.proc.clone(),
13136 selection: query,
13137 graphql_client: self.graphql_client.clone(),
13138 }
13139 }
13140 pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
13142 let mut query = self.selection.select("withFunction");
13143 query = query.arg_lazy(
13144 "function",
13145 Box::new(move || {
13146 let function = function.clone();
13147 Box::pin(async move { function.into_id().await.unwrap().quote() })
13148 }),
13149 );
13150 TypeDef {
13151 proc: self.proc.clone(),
13152 selection: query,
13153 graphql_client: self.graphql_client.clone(),
13154 }
13155 }
13156 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
13162 let mut query = self.selection.select("withInterface");
13163 query = query.arg("name", name.into());
13164 TypeDef {
13165 proc: self.proc.clone(),
13166 selection: query,
13167 graphql_client: self.graphql_client.clone(),
13168 }
13169 }
13170 pub fn with_interface_opts<'a>(
13176 &self,
13177 name: impl Into<String>,
13178 opts: TypeDefWithInterfaceOpts<'a>,
13179 ) -> TypeDef {
13180 let mut query = self.selection.select("withInterface");
13181 query = query.arg("name", name.into());
13182 if let Some(description) = opts.description {
13183 query = query.arg("description", description);
13184 }
13185 if let Some(source_map) = opts.source_map {
13186 query = query.arg("sourceMap", source_map);
13187 }
13188 TypeDef {
13189 proc: self.proc.clone(),
13190 selection: query,
13191 graphql_client: self.graphql_client.clone(),
13192 }
13193 }
13194 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
13196 let mut query = self.selection.select("withKind");
13197 query = query.arg("kind", kind);
13198 TypeDef {
13199 proc: self.proc.clone(),
13200 selection: query,
13201 graphql_client: self.graphql_client.clone(),
13202 }
13203 }
13204 pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
13206 let mut query = self.selection.select("withListOf");
13207 query = query.arg_lazy(
13208 "elementType",
13209 Box::new(move || {
13210 let element_type = element_type.clone();
13211 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
13212 }),
13213 );
13214 TypeDef {
13215 proc: self.proc.clone(),
13216 selection: query,
13217 graphql_client: self.graphql_client.clone(),
13218 }
13219 }
13220 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
13227 let mut query = self.selection.select("withObject");
13228 query = query.arg("name", name.into());
13229 TypeDef {
13230 proc: self.proc.clone(),
13231 selection: query,
13232 graphql_client: self.graphql_client.clone(),
13233 }
13234 }
13235 pub fn with_object_opts<'a>(
13242 &self,
13243 name: impl Into<String>,
13244 opts: TypeDefWithObjectOpts<'a>,
13245 ) -> TypeDef {
13246 let mut query = self.selection.select("withObject");
13247 query = query.arg("name", name.into());
13248 if let Some(description) = opts.description {
13249 query = query.arg("description", description);
13250 }
13251 if let Some(source_map) = opts.source_map {
13252 query = query.arg("sourceMap", source_map);
13253 }
13254 if let Some(deprecated) = opts.deprecated {
13255 query = query.arg("deprecated", deprecated);
13256 }
13257 TypeDef {
13258 proc: self.proc.clone(),
13259 selection: query,
13260 graphql_client: self.graphql_client.clone(),
13261 }
13262 }
13263 pub fn with_optional(&self, optional: bool) -> TypeDef {
13265 let mut query = self.selection.select("withOptional");
13266 query = query.arg("optional", optional);
13267 TypeDef {
13268 proc: self.proc.clone(),
13269 selection: query,
13270 graphql_client: self.graphql_client.clone(),
13271 }
13272 }
13273 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
13279 let mut query = self.selection.select("withScalar");
13280 query = query.arg("name", name.into());
13281 TypeDef {
13282 proc: self.proc.clone(),
13283 selection: query,
13284 graphql_client: self.graphql_client.clone(),
13285 }
13286 }
13287 pub fn with_scalar_opts<'a>(
13293 &self,
13294 name: impl Into<String>,
13295 opts: TypeDefWithScalarOpts<'a>,
13296 ) -> TypeDef {
13297 let mut query = self.selection.select("withScalar");
13298 query = query.arg("name", name.into());
13299 if let Some(description) = opts.description {
13300 query = query.arg("description", description);
13301 }
13302 TypeDef {
13303 proc: self.proc.clone(),
13304 selection: query,
13305 graphql_client: self.graphql_client.clone(),
13306 }
13307 }
13308}
13309#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13310pub enum CacheSharingMode {
13311 #[serde(rename = "LOCKED")]
13312 Locked,
13313 #[serde(rename = "PRIVATE")]
13314 Private,
13315 #[serde(rename = "SHARED")]
13316 Shared,
13317}
13318#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13319pub enum ExistsType {
13320 #[serde(rename = "DIRECTORY_TYPE")]
13321 DirectoryType,
13322 #[serde(rename = "REGULAR_TYPE")]
13323 RegularType,
13324 #[serde(rename = "SYMLINK_TYPE")]
13325 SymlinkType,
13326}
13327#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13328pub enum FunctionCachePolicy {
13329 #[serde(rename = "Default")]
13330 Default,
13331 #[serde(rename = "Never")]
13332 Never,
13333 #[serde(rename = "PerSession")]
13334 PerSession,
13335}
13336#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13337pub enum ImageLayerCompression {
13338 #[serde(rename = "EStarGZ")]
13339 EStarGz,
13340 #[serde(rename = "ESTARGZ")]
13341 Estargz,
13342 #[serde(rename = "Gzip")]
13343 Gzip,
13344 #[serde(rename = "Uncompressed")]
13345 Uncompressed,
13346 #[serde(rename = "Zstd")]
13347 Zstd,
13348}
13349#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13350pub enum ImageMediaTypes {
13351 #[serde(rename = "DOCKER")]
13352 Docker,
13353 #[serde(rename = "DockerMediaTypes")]
13354 DockerMediaTypes,
13355 #[serde(rename = "OCI")]
13356 Oci,
13357 #[serde(rename = "OCIMediaTypes")]
13358 OciMediaTypes,
13359}
13360#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13361pub enum ModuleSourceExperimentalFeature {
13362 #[serde(rename = "SELF_CALLS")]
13363 SelfCalls,
13364}
13365#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13366pub enum ModuleSourceKind {
13367 #[serde(rename = "DIR")]
13368 Dir,
13369 #[serde(rename = "DIR_SOURCE")]
13370 DirSource,
13371 #[serde(rename = "GIT")]
13372 Git,
13373 #[serde(rename = "GIT_SOURCE")]
13374 GitSource,
13375 #[serde(rename = "LOCAL")]
13376 Local,
13377 #[serde(rename = "LOCAL_SOURCE")]
13378 LocalSource,
13379}
13380#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13381pub enum NetworkProtocol {
13382 #[serde(rename = "TCP")]
13383 Tcp,
13384 #[serde(rename = "UDP")]
13385 Udp,
13386}
13387#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13388pub enum ReturnType {
13389 #[serde(rename = "ANY")]
13390 Any,
13391 #[serde(rename = "FAILURE")]
13392 Failure,
13393 #[serde(rename = "SUCCESS")]
13394 Success,
13395}
13396#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
13397pub enum TypeDefKind {
13398 #[serde(rename = "BOOLEAN")]
13399 Boolean,
13400 #[serde(rename = "BOOLEAN_KIND")]
13401 BooleanKind,
13402 #[serde(rename = "ENUM")]
13403 Enum,
13404 #[serde(rename = "ENUM_KIND")]
13405 EnumKind,
13406 #[serde(rename = "FLOAT")]
13407 Float,
13408 #[serde(rename = "FLOAT_KIND")]
13409 FloatKind,
13410 #[serde(rename = "INPUT")]
13411 Input,
13412 #[serde(rename = "INPUT_KIND")]
13413 InputKind,
13414 #[serde(rename = "INTEGER")]
13415 Integer,
13416 #[serde(rename = "INTEGER_KIND")]
13417 IntegerKind,
13418 #[serde(rename = "INTERFACE")]
13419 Interface,
13420 #[serde(rename = "INTERFACE_KIND")]
13421 InterfaceKind,
13422 #[serde(rename = "LIST")]
13423 List,
13424 #[serde(rename = "LIST_KIND")]
13425 ListKind,
13426 #[serde(rename = "OBJECT")]
13427 Object,
13428 #[serde(rename = "OBJECT_KIND")]
13429 ObjectKind,
13430 #[serde(rename = "SCALAR")]
13431 Scalar,
13432 #[serde(rename = "SCALAR_KIND")]
13433 ScalarKind,
13434 #[serde(rename = "STRING")]
13435 String,
13436 #[serde(rename = "STRING_KIND")]
13437 StringKind,
13438 #[serde(rename = "VOID")]
13439 Void,
13440 #[serde(rename = "VOID_KIND")]
13441 VoidKind,
13442}