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 CacheVolumeId(pub String);
14impl From<&str> for CacheVolumeId {
15 fn from(value: &str) -> Self {
16 Self(value.to_string())
17 }
18}
19impl From<String> for CacheVolumeId {
20 fn from(value: String) -> Self {
21 Self(value)
22 }
23}
24impl IntoID<CacheVolumeId> for CacheVolume {
25 fn into_id(
26 self,
27 ) -> std::pin::Pin<
28 Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
29 > {
30 Box::pin(async move { self.id().await })
31 }
32}
33impl IntoID<CacheVolumeId> for CacheVolumeId {
34 fn into_id(
35 self,
36 ) -> std::pin::Pin<
37 Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
38 > {
39 Box::pin(async move { Ok::<CacheVolumeId, DaggerError>(self) })
40 }
41}
42impl CacheVolumeId {
43 fn quote(&self) -> String {
44 format!("\"{}\"", self.0.clone())
45 }
46}
47#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
48pub struct ContainerId(pub String);
49impl From<&str> for ContainerId {
50 fn from(value: &str) -> Self {
51 Self(value.to_string())
52 }
53}
54impl From<String> for ContainerId {
55 fn from(value: String) -> Self {
56 Self(value)
57 }
58}
59impl IntoID<ContainerId> for Container {
60 fn into_id(
61 self,
62 ) -> std::pin::Pin<
63 Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
64 > {
65 Box::pin(async move { self.id().await })
66 }
67}
68impl IntoID<ContainerId> for ContainerId {
69 fn into_id(
70 self,
71 ) -> std::pin::Pin<
72 Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
73 > {
74 Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
75 }
76}
77impl ContainerId {
78 fn quote(&self) -> String {
79 format!("\"{}\"", self.0.clone())
80 }
81}
82#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
83pub struct CurrentModuleId(pub String);
84impl From<&str> for CurrentModuleId {
85 fn from(value: &str) -> Self {
86 Self(value.to_string())
87 }
88}
89impl From<String> for CurrentModuleId {
90 fn from(value: String) -> Self {
91 Self(value)
92 }
93}
94impl IntoID<CurrentModuleId> for CurrentModule {
95 fn into_id(
96 self,
97 ) -> std::pin::Pin<
98 Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
99 > {
100 Box::pin(async move { self.id().await })
101 }
102}
103impl IntoID<CurrentModuleId> for CurrentModuleId {
104 fn into_id(
105 self,
106 ) -> std::pin::Pin<
107 Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
108 > {
109 Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
110 }
111}
112impl CurrentModuleId {
113 fn quote(&self) -> String {
114 format!("\"{}\"", self.0.clone())
115 }
116}
117#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
118pub struct DirectoryId(pub String);
119impl From<&str> for DirectoryId {
120 fn from(value: &str) -> Self {
121 Self(value.to_string())
122 }
123}
124impl From<String> for DirectoryId {
125 fn from(value: String) -> Self {
126 Self(value)
127 }
128}
129impl IntoID<DirectoryId> for Directory {
130 fn into_id(
131 self,
132 ) -> std::pin::Pin<
133 Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
134 > {
135 Box::pin(async move { self.id().await })
136 }
137}
138impl IntoID<DirectoryId> for DirectoryId {
139 fn into_id(
140 self,
141 ) -> std::pin::Pin<
142 Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
143 > {
144 Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
145 }
146}
147impl DirectoryId {
148 fn quote(&self) -> String {
149 format!("\"{}\"", self.0.clone())
150 }
151}
152#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
153pub struct EngineCacheEntryId(pub String);
154impl From<&str> for EngineCacheEntryId {
155 fn from(value: &str) -> Self {
156 Self(value.to_string())
157 }
158}
159impl From<String> for EngineCacheEntryId {
160 fn from(value: String) -> Self {
161 Self(value)
162 }
163}
164impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
165 fn into_id(
166 self,
167 ) -> std::pin::Pin<
168 Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
169 > {
170 Box::pin(async move { self.id().await })
171 }
172}
173impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
174 fn into_id(
175 self,
176 ) -> std::pin::Pin<
177 Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
178 > {
179 Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
180 }
181}
182impl EngineCacheEntryId {
183 fn quote(&self) -> String {
184 format!("\"{}\"", self.0.clone())
185 }
186}
187#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
188pub struct EngineCacheEntrySetId(pub String);
189impl From<&str> for EngineCacheEntrySetId {
190 fn from(value: &str) -> Self {
191 Self(value.to_string())
192 }
193}
194impl From<String> for EngineCacheEntrySetId {
195 fn from(value: String) -> Self {
196 Self(value)
197 }
198}
199impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
200 fn into_id(
201 self,
202 ) -> std::pin::Pin<
203 Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
204 > {
205 Box::pin(async move { self.id().await })
206 }
207}
208impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
209 fn into_id(
210 self,
211 ) -> std::pin::Pin<
212 Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
213 > {
214 Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
215 }
216}
217impl EngineCacheEntrySetId {
218 fn quote(&self) -> String {
219 format!("\"{}\"", self.0.clone())
220 }
221}
222#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
223pub struct EngineCacheId(pub String);
224impl From<&str> for EngineCacheId {
225 fn from(value: &str) -> Self {
226 Self(value.to_string())
227 }
228}
229impl From<String> for EngineCacheId {
230 fn from(value: String) -> Self {
231 Self(value)
232 }
233}
234impl IntoID<EngineCacheId> for EngineCache {
235 fn into_id(
236 self,
237 ) -> std::pin::Pin<
238 Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
239 > {
240 Box::pin(async move { self.id().await })
241 }
242}
243impl IntoID<EngineCacheId> for EngineCacheId {
244 fn into_id(
245 self,
246 ) -> std::pin::Pin<
247 Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
248 > {
249 Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
250 }
251}
252impl EngineCacheId {
253 fn quote(&self) -> String {
254 format!("\"{}\"", self.0.clone())
255 }
256}
257#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
258pub struct EngineId(pub String);
259impl From<&str> for EngineId {
260 fn from(value: &str) -> Self {
261 Self(value.to_string())
262 }
263}
264impl From<String> for EngineId {
265 fn from(value: String) -> Self {
266 Self(value)
267 }
268}
269impl IntoID<EngineId> for Engine {
270 fn into_id(
271 self,
272 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
273 {
274 Box::pin(async move { self.id().await })
275 }
276}
277impl IntoID<EngineId> for EngineId {
278 fn into_id(
279 self,
280 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
281 {
282 Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
283 }
284}
285impl EngineId {
286 fn quote(&self) -> String {
287 format!("\"{}\"", self.0.clone())
288 }
289}
290#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
291pub struct EnumTypeDefId(pub String);
292impl From<&str> for EnumTypeDefId {
293 fn from(value: &str) -> Self {
294 Self(value.to_string())
295 }
296}
297impl From<String> for EnumTypeDefId {
298 fn from(value: String) -> Self {
299 Self(value)
300 }
301}
302impl IntoID<EnumTypeDefId> for EnumTypeDef {
303 fn into_id(
304 self,
305 ) -> std::pin::Pin<
306 Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
307 > {
308 Box::pin(async move { self.id().await })
309 }
310}
311impl IntoID<EnumTypeDefId> for EnumTypeDefId {
312 fn into_id(
313 self,
314 ) -> std::pin::Pin<
315 Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
316 > {
317 Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
318 }
319}
320impl EnumTypeDefId {
321 fn quote(&self) -> String {
322 format!("\"{}\"", self.0.clone())
323 }
324}
325#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
326pub struct EnumValueTypeDefId(pub String);
327impl From<&str> for EnumValueTypeDefId {
328 fn from(value: &str) -> Self {
329 Self(value.to_string())
330 }
331}
332impl From<String> for EnumValueTypeDefId {
333 fn from(value: String) -> Self {
334 Self(value)
335 }
336}
337impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
338 fn into_id(
339 self,
340 ) -> std::pin::Pin<
341 Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
342 > {
343 Box::pin(async move { self.id().await })
344 }
345}
346impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
347 fn into_id(
348 self,
349 ) -> std::pin::Pin<
350 Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
351 > {
352 Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
353 }
354}
355impl EnumValueTypeDefId {
356 fn quote(&self) -> String {
357 format!("\"{}\"", self.0.clone())
358 }
359}
360#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
361pub struct EnvVariableId(pub String);
362impl From<&str> for EnvVariableId {
363 fn from(value: &str) -> Self {
364 Self(value.to_string())
365 }
366}
367impl From<String> for EnvVariableId {
368 fn from(value: String) -> Self {
369 Self(value)
370 }
371}
372impl IntoID<EnvVariableId> for EnvVariable {
373 fn into_id(
374 self,
375 ) -> std::pin::Pin<
376 Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
377 > {
378 Box::pin(async move { self.id().await })
379 }
380}
381impl IntoID<EnvVariableId> for EnvVariableId {
382 fn into_id(
383 self,
384 ) -> std::pin::Pin<
385 Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
386 > {
387 Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
388 }
389}
390impl EnvVariableId {
391 fn quote(&self) -> String {
392 format!("\"{}\"", self.0.clone())
393 }
394}
395#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
396pub struct ErrorId(pub String);
397impl From<&str> for ErrorId {
398 fn from(value: &str) -> Self {
399 Self(value.to_string())
400 }
401}
402impl From<String> for ErrorId {
403 fn from(value: String) -> Self {
404 Self(value)
405 }
406}
407impl IntoID<ErrorId> for Error {
408 fn into_id(
409 self,
410 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
411 {
412 Box::pin(async move { self.id().await })
413 }
414}
415impl IntoID<ErrorId> for ErrorId {
416 fn into_id(
417 self,
418 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
419 {
420 Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
421 }
422}
423impl ErrorId {
424 fn quote(&self) -> String {
425 format!("\"{}\"", self.0.clone())
426 }
427}
428#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
429pub struct FieldTypeDefId(pub String);
430impl From<&str> for FieldTypeDefId {
431 fn from(value: &str) -> Self {
432 Self(value.to_string())
433 }
434}
435impl From<String> for FieldTypeDefId {
436 fn from(value: String) -> Self {
437 Self(value)
438 }
439}
440impl IntoID<FieldTypeDefId> for FieldTypeDef {
441 fn into_id(
442 self,
443 ) -> std::pin::Pin<
444 Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
445 > {
446 Box::pin(async move { self.id().await })
447 }
448}
449impl IntoID<FieldTypeDefId> for FieldTypeDefId {
450 fn into_id(
451 self,
452 ) -> std::pin::Pin<
453 Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
454 > {
455 Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
456 }
457}
458impl FieldTypeDefId {
459 fn quote(&self) -> String {
460 format!("\"{}\"", self.0.clone())
461 }
462}
463#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
464pub struct FileId(pub String);
465impl From<&str> for FileId {
466 fn from(value: &str) -> Self {
467 Self(value.to_string())
468 }
469}
470impl From<String> for FileId {
471 fn from(value: String) -> Self {
472 Self(value)
473 }
474}
475impl IntoID<FileId> for File {
476 fn into_id(
477 self,
478 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
479 {
480 Box::pin(async move { self.id().await })
481 }
482}
483impl IntoID<FileId> for FileId {
484 fn into_id(
485 self,
486 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
487 {
488 Box::pin(async move { Ok::<FileId, DaggerError>(self) })
489 }
490}
491impl FileId {
492 fn quote(&self) -> String {
493 format!("\"{}\"", self.0.clone())
494 }
495}
496#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
497pub struct FunctionArgId(pub String);
498impl From<&str> for FunctionArgId {
499 fn from(value: &str) -> Self {
500 Self(value.to_string())
501 }
502}
503impl From<String> for FunctionArgId {
504 fn from(value: String) -> Self {
505 Self(value)
506 }
507}
508impl IntoID<FunctionArgId> for FunctionArg {
509 fn into_id(
510 self,
511 ) -> std::pin::Pin<
512 Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
513 > {
514 Box::pin(async move { self.id().await })
515 }
516}
517impl IntoID<FunctionArgId> for FunctionArgId {
518 fn into_id(
519 self,
520 ) -> std::pin::Pin<
521 Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
522 > {
523 Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
524 }
525}
526impl FunctionArgId {
527 fn quote(&self) -> String {
528 format!("\"{}\"", self.0.clone())
529 }
530}
531#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
532pub struct FunctionCallArgValueId(pub String);
533impl From<&str> for FunctionCallArgValueId {
534 fn from(value: &str) -> Self {
535 Self(value.to_string())
536 }
537}
538impl From<String> for FunctionCallArgValueId {
539 fn from(value: String) -> Self {
540 Self(value)
541 }
542}
543impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
544 fn into_id(
545 self,
546 ) -> std::pin::Pin<
547 Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
548 > {
549 Box::pin(async move { self.id().await })
550 }
551}
552impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
553 fn into_id(
554 self,
555 ) -> std::pin::Pin<
556 Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
557 > {
558 Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
559 }
560}
561impl FunctionCallArgValueId {
562 fn quote(&self) -> String {
563 format!("\"{}\"", self.0.clone())
564 }
565}
566#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
567pub struct FunctionCallId(pub String);
568impl From<&str> for FunctionCallId {
569 fn from(value: &str) -> Self {
570 Self(value.to_string())
571 }
572}
573impl From<String> for FunctionCallId {
574 fn from(value: String) -> Self {
575 Self(value)
576 }
577}
578impl IntoID<FunctionCallId> for FunctionCall {
579 fn into_id(
580 self,
581 ) -> std::pin::Pin<
582 Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
583 > {
584 Box::pin(async move { self.id().await })
585 }
586}
587impl IntoID<FunctionCallId> for FunctionCallId {
588 fn into_id(
589 self,
590 ) -> std::pin::Pin<
591 Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
592 > {
593 Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
594 }
595}
596impl FunctionCallId {
597 fn quote(&self) -> String {
598 format!("\"{}\"", self.0.clone())
599 }
600}
601#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
602pub struct FunctionId(pub String);
603impl From<&str> for FunctionId {
604 fn from(value: &str) -> Self {
605 Self(value.to_string())
606 }
607}
608impl From<String> for FunctionId {
609 fn from(value: String) -> Self {
610 Self(value)
611 }
612}
613impl IntoID<FunctionId> for Function {
614 fn into_id(
615 self,
616 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
617 {
618 Box::pin(async move { self.id().await })
619 }
620}
621impl IntoID<FunctionId> for FunctionId {
622 fn into_id(
623 self,
624 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
625 {
626 Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
627 }
628}
629impl FunctionId {
630 fn quote(&self) -> String {
631 format!("\"{}\"", self.0.clone())
632 }
633}
634#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
635pub struct GeneratedCodeId(pub String);
636impl From<&str> for GeneratedCodeId {
637 fn from(value: &str) -> Self {
638 Self(value.to_string())
639 }
640}
641impl From<String> for GeneratedCodeId {
642 fn from(value: String) -> Self {
643 Self(value)
644 }
645}
646impl IntoID<GeneratedCodeId> for GeneratedCode {
647 fn into_id(
648 self,
649 ) -> std::pin::Pin<
650 Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
651 > {
652 Box::pin(async move { self.id().await })
653 }
654}
655impl IntoID<GeneratedCodeId> for GeneratedCodeId {
656 fn into_id(
657 self,
658 ) -> std::pin::Pin<
659 Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
660 > {
661 Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
662 }
663}
664impl GeneratedCodeId {
665 fn quote(&self) -> String {
666 format!("\"{}\"", self.0.clone())
667 }
668}
669#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
670pub struct GitRefId(pub String);
671impl From<&str> for GitRefId {
672 fn from(value: &str) -> Self {
673 Self(value.to_string())
674 }
675}
676impl From<String> for GitRefId {
677 fn from(value: String) -> Self {
678 Self(value)
679 }
680}
681impl IntoID<GitRefId> for GitRef {
682 fn into_id(
683 self,
684 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
685 {
686 Box::pin(async move { self.id().await })
687 }
688}
689impl IntoID<GitRefId> for GitRefId {
690 fn into_id(
691 self,
692 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
693 {
694 Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
695 }
696}
697impl GitRefId {
698 fn quote(&self) -> String {
699 format!("\"{}\"", self.0.clone())
700 }
701}
702#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
703pub struct GitRepositoryId(pub String);
704impl From<&str> for GitRepositoryId {
705 fn from(value: &str) -> Self {
706 Self(value.to_string())
707 }
708}
709impl From<String> for GitRepositoryId {
710 fn from(value: String) -> Self {
711 Self(value)
712 }
713}
714impl IntoID<GitRepositoryId> for GitRepository {
715 fn into_id(
716 self,
717 ) -> std::pin::Pin<
718 Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
719 > {
720 Box::pin(async move { self.id().await })
721 }
722}
723impl IntoID<GitRepositoryId> for GitRepositoryId {
724 fn into_id(
725 self,
726 ) -> std::pin::Pin<
727 Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
728 > {
729 Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
730 }
731}
732impl GitRepositoryId {
733 fn quote(&self) -> String {
734 format!("\"{}\"", self.0.clone())
735 }
736}
737#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
738pub struct HostId(pub String);
739impl From<&str> for HostId {
740 fn from(value: &str) -> Self {
741 Self(value.to_string())
742 }
743}
744impl From<String> for HostId {
745 fn from(value: String) -> Self {
746 Self(value)
747 }
748}
749impl IntoID<HostId> for Host {
750 fn into_id(
751 self,
752 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
753 {
754 Box::pin(async move { self.id().await })
755 }
756}
757impl IntoID<HostId> for HostId {
758 fn into_id(
759 self,
760 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
761 {
762 Box::pin(async move { Ok::<HostId, DaggerError>(self) })
763 }
764}
765impl HostId {
766 fn quote(&self) -> String {
767 format!("\"{}\"", self.0.clone())
768 }
769}
770#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
771pub struct InputTypeDefId(pub String);
772impl From<&str> for InputTypeDefId {
773 fn from(value: &str) -> Self {
774 Self(value.to_string())
775 }
776}
777impl From<String> for InputTypeDefId {
778 fn from(value: String) -> Self {
779 Self(value)
780 }
781}
782impl IntoID<InputTypeDefId> for InputTypeDef {
783 fn into_id(
784 self,
785 ) -> std::pin::Pin<
786 Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
787 > {
788 Box::pin(async move { self.id().await })
789 }
790}
791impl IntoID<InputTypeDefId> for InputTypeDefId {
792 fn into_id(
793 self,
794 ) -> std::pin::Pin<
795 Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
796 > {
797 Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
798 }
799}
800impl InputTypeDefId {
801 fn quote(&self) -> String {
802 format!("\"{}\"", self.0.clone())
803 }
804}
805#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
806pub struct InterfaceTypeDefId(pub String);
807impl From<&str> for InterfaceTypeDefId {
808 fn from(value: &str) -> Self {
809 Self(value.to_string())
810 }
811}
812impl From<String> for InterfaceTypeDefId {
813 fn from(value: String) -> Self {
814 Self(value)
815 }
816}
817impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
818 fn into_id(
819 self,
820 ) -> std::pin::Pin<
821 Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
822 > {
823 Box::pin(async move { self.id().await })
824 }
825}
826impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
827 fn into_id(
828 self,
829 ) -> std::pin::Pin<
830 Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
831 > {
832 Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
833 }
834}
835impl InterfaceTypeDefId {
836 fn quote(&self) -> String {
837 format!("\"{}\"", self.0.clone())
838 }
839}
840#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
841pub struct Json(pub String);
842impl From<&str> for Json {
843 fn from(value: &str) -> Self {
844 Self(value.to_string())
845 }
846}
847impl From<String> for Json {
848 fn from(value: String) -> Self {
849 Self(value)
850 }
851}
852impl Json {
853 fn quote(&self) -> String {
854 format!("\"{}\"", self.0.clone())
855 }
856}
857#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
858pub struct LabelId(pub String);
859impl From<&str> for LabelId {
860 fn from(value: &str) -> Self {
861 Self(value.to_string())
862 }
863}
864impl From<String> for LabelId {
865 fn from(value: String) -> Self {
866 Self(value)
867 }
868}
869impl IntoID<LabelId> for Label {
870 fn into_id(
871 self,
872 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
873 {
874 Box::pin(async move { self.id().await })
875 }
876}
877impl IntoID<LabelId> for LabelId {
878 fn into_id(
879 self,
880 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
881 {
882 Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
883 }
884}
885impl LabelId {
886 fn quote(&self) -> String {
887 format!("\"{}\"", self.0.clone())
888 }
889}
890#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
891pub struct ListTypeDefId(pub String);
892impl From<&str> for ListTypeDefId {
893 fn from(value: &str) -> Self {
894 Self(value.to_string())
895 }
896}
897impl From<String> for ListTypeDefId {
898 fn from(value: String) -> Self {
899 Self(value)
900 }
901}
902impl IntoID<ListTypeDefId> for ListTypeDef {
903 fn into_id(
904 self,
905 ) -> std::pin::Pin<
906 Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
907 > {
908 Box::pin(async move { self.id().await })
909 }
910}
911impl IntoID<ListTypeDefId> for ListTypeDefId {
912 fn into_id(
913 self,
914 ) -> std::pin::Pin<
915 Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
916 > {
917 Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
918 }
919}
920impl ListTypeDefId {
921 fn quote(&self) -> String {
922 format!("\"{}\"", self.0.clone())
923 }
924}
925#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
926pub struct ModuleConfigClientId(pub String);
927impl From<&str> for ModuleConfigClientId {
928 fn from(value: &str) -> Self {
929 Self(value.to_string())
930 }
931}
932impl From<String> for ModuleConfigClientId {
933 fn from(value: String) -> Self {
934 Self(value)
935 }
936}
937impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
938 fn into_id(
939 self,
940 ) -> std::pin::Pin<
941 Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
942 > {
943 Box::pin(async move { self.id().await })
944 }
945}
946impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
947 fn into_id(
948 self,
949 ) -> std::pin::Pin<
950 Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
951 > {
952 Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
953 }
954}
955impl ModuleConfigClientId {
956 fn quote(&self) -> String {
957 format!("\"{}\"", self.0.clone())
958 }
959}
960#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
961pub struct ModuleId(pub String);
962impl From<&str> for ModuleId {
963 fn from(value: &str) -> Self {
964 Self(value.to_string())
965 }
966}
967impl From<String> for ModuleId {
968 fn from(value: String) -> Self {
969 Self(value)
970 }
971}
972impl IntoID<ModuleId> for Module {
973 fn into_id(
974 self,
975 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
976 {
977 Box::pin(async move { self.id().await })
978 }
979}
980impl IntoID<ModuleId> for ModuleId {
981 fn into_id(
982 self,
983 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
984 {
985 Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
986 }
987}
988impl ModuleId {
989 fn quote(&self) -> String {
990 format!("\"{}\"", self.0.clone())
991 }
992}
993#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
994pub struct ModuleSourceId(pub String);
995impl From<&str> for ModuleSourceId {
996 fn from(value: &str) -> Self {
997 Self(value.to_string())
998 }
999}
1000impl From<String> for ModuleSourceId {
1001 fn from(value: String) -> Self {
1002 Self(value)
1003 }
1004}
1005impl IntoID<ModuleSourceId> for ModuleSource {
1006 fn into_id(
1007 self,
1008 ) -> std::pin::Pin<
1009 Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1010 > {
1011 Box::pin(async move { self.id().await })
1012 }
1013}
1014impl IntoID<ModuleSourceId> for ModuleSourceId {
1015 fn into_id(
1016 self,
1017 ) -> std::pin::Pin<
1018 Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
1019 > {
1020 Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
1021 }
1022}
1023impl ModuleSourceId {
1024 fn quote(&self) -> String {
1025 format!("\"{}\"", self.0.clone())
1026 }
1027}
1028#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1029pub struct ObjectTypeDefId(pub String);
1030impl From<&str> for ObjectTypeDefId {
1031 fn from(value: &str) -> Self {
1032 Self(value.to_string())
1033 }
1034}
1035impl From<String> for ObjectTypeDefId {
1036 fn from(value: String) -> Self {
1037 Self(value)
1038 }
1039}
1040impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1041 fn into_id(
1042 self,
1043 ) -> std::pin::Pin<
1044 Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1045 > {
1046 Box::pin(async move { self.id().await })
1047 }
1048}
1049impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1050 fn into_id(
1051 self,
1052 ) -> std::pin::Pin<
1053 Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1054 > {
1055 Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1056 }
1057}
1058impl ObjectTypeDefId {
1059 fn quote(&self) -> String {
1060 format!("\"{}\"", self.0.clone())
1061 }
1062}
1063#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1064pub struct Platform(pub String);
1065impl From<&str> for Platform {
1066 fn from(value: &str) -> Self {
1067 Self(value.to_string())
1068 }
1069}
1070impl From<String> for Platform {
1071 fn from(value: String) -> Self {
1072 Self(value)
1073 }
1074}
1075impl Platform {
1076 fn quote(&self) -> String {
1077 format!("\"{}\"", self.0.clone())
1078 }
1079}
1080#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1081pub struct PortId(pub String);
1082impl From<&str> for PortId {
1083 fn from(value: &str) -> Self {
1084 Self(value.to_string())
1085 }
1086}
1087impl From<String> for PortId {
1088 fn from(value: String) -> Self {
1089 Self(value)
1090 }
1091}
1092impl IntoID<PortId> for Port {
1093 fn into_id(
1094 self,
1095 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1096 {
1097 Box::pin(async move { self.id().await })
1098 }
1099}
1100impl IntoID<PortId> for PortId {
1101 fn into_id(
1102 self,
1103 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1104 {
1105 Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1106 }
1107}
1108impl PortId {
1109 fn quote(&self) -> String {
1110 format!("\"{}\"", self.0.clone())
1111 }
1112}
1113#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1114pub struct SdkConfigId(pub String);
1115impl From<&str> for SdkConfigId {
1116 fn from(value: &str) -> Self {
1117 Self(value.to_string())
1118 }
1119}
1120impl From<String> for SdkConfigId {
1121 fn from(value: String) -> Self {
1122 Self(value)
1123 }
1124}
1125impl IntoID<SdkConfigId> for SdkConfig {
1126 fn into_id(
1127 self,
1128 ) -> std::pin::Pin<
1129 Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1130 > {
1131 Box::pin(async move { self.id().await })
1132 }
1133}
1134impl IntoID<SdkConfigId> for SdkConfigId {
1135 fn into_id(
1136 self,
1137 ) -> std::pin::Pin<
1138 Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1139 > {
1140 Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1141 }
1142}
1143impl SdkConfigId {
1144 fn quote(&self) -> String {
1145 format!("\"{}\"", self.0.clone())
1146 }
1147}
1148#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1149pub struct ScalarTypeDefId(pub String);
1150impl From<&str> for ScalarTypeDefId {
1151 fn from(value: &str) -> Self {
1152 Self(value.to_string())
1153 }
1154}
1155impl From<String> for ScalarTypeDefId {
1156 fn from(value: String) -> Self {
1157 Self(value)
1158 }
1159}
1160impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1161 fn into_id(
1162 self,
1163 ) -> std::pin::Pin<
1164 Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1165 > {
1166 Box::pin(async move { self.id().await })
1167 }
1168}
1169impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1170 fn into_id(
1171 self,
1172 ) -> std::pin::Pin<
1173 Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1174 > {
1175 Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1176 }
1177}
1178impl ScalarTypeDefId {
1179 fn quote(&self) -> String {
1180 format!("\"{}\"", self.0.clone())
1181 }
1182}
1183#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1184pub struct SecretId(pub String);
1185impl From<&str> for SecretId {
1186 fn from(value: &str) -> Self {
1187 Self(value.to_string())
1188 }
1189}
1190impl From<String> for SecretId {
1191 fn from(value: String) -> Self {
1192 Self(value)
1193 }
1194}
1195impl IntoID<SecretId> for Secret {
1196 fn into_id(
1197 self,
1198 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1199 {
1200 Box::pin(async move { self.id().await })
1201 }
1202}
1203impl IntoID<SecretId> for SecretId {
1204 fn into_id(
1205 self,
1206 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1207 {
1208 Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1209 }
1210}
1211impl SecretId {
1212 fn quote(&self) -> String {
1213 format!("\"{}\"", self.0.clone())
1214 }
1215}
1216#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1217pub struct ServiceId(pub String);
1218impl From<&str> for ServiceId {
1219 fn from(value: &str) -> Self {
1220 Self(value.to_string())
1221 }
1222}
1223impl From<String> for ServiceId {
1224 fn from(value: String) -> Self {
1225 Self(value)
1226 }
1227}
1228impl IntoID<ServiceId> for Service {
1229 fn into_id(
1230 self,
1231 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1232 {
1233 Box::pin(async move { self.id().await })
1234 }
1235}
1236impl IntoID<ServiceId> for ServiceId {
1237 fn into_id(
1238 self,
1239 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1240 {
1241 Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1242 }
1243}
1244impl ServiceId {
1245 fn quote(&self) -> String {
1246 format!("\"{}\"", self.0.clone())
1247 }
1248}
1249#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1250pub struct SocketId(pub String);
1251impl From<&str> for SocketId {
1252 fn from(value: &str) -> Self {
1253 Self(value.to_string())
1254 }
1255}
1256impl From<String> for SocketId {
1257 fn from(value: String) -> Self {
1258 Self(value)
1259 }
1260}
1261impl IntoID<SocketId> for Socket {
1262 fn into_id(
1263 self,
1264 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1265 {
1266 Box::pin(async move { self.id().await })
1267 }
1268}
1269impl IntoID<SocketId> for SocketId {
1270 fn into_id(
1271 self,
1272 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1273 {
1274 Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1275 }
1276}
1277impl SocketId {
1278 fn quote(&self) -> String {
1279 format!("\"{}\"", self.0.clone())
1280 }
1281}
1282#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1283pub struct SourceMapId(pub String);
1284impl From<&str> for SourceMapId {
1285 fn from(value: &str) -> Self {
1286 Self(value.to_string())
1287 }
1288}
1289impl From<String> for SourceMapId {
1290 fn from(value: String) -> Self {
1291 Self(value)
1292 }
1293}
1294impl IntoID<SourceMapId> for SourceMap {
1295 fn into_id(
1296 self,
1297 ) -> std::pin::Pin<
1298 Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1299 > {
1300 Box::pin(async move { self.id().await })
1301 }
1302}
1303impl IntoID<SourceMapId> for SourceMapId {
1304 fn into_id(
1305 self,
1306 ) -> std::pin::Pin<
1307 Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1308 > {
1309 Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1310 }
1311}
1312impl SourceMapId {
1313 fn quote(&self) -> String {
1314 format!("\"{}\"", self.0.clone())
1315 }
1316}
1317#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1318pub struct TerminalId(pub String);
1319impl From<&str> for TerminalId {
1320 fn from(value: &str) -> Self {
1321 Self(value.to_string())
1322 }
1323}
1324impl From<String> for TerminalId {
1325 fn from(value: String) -> Self {
1326 Self(value)
1327 }
1328}
1329impl IntoID<TerminalId> for Terminal {
1330 fn into_id(
1331 self,
1332 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1333 {
1334 Box::pin(async move { self.id().await })
1335 }
1336}
1337impl IntoID<TerminalId> for TerminalId {
1338 fn into_id(
1339 self,
1340 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1341 {
1342 Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
1343 }
1344}
1345impl TerminalId {
1346 fn quote(&self) -> String {
1347 format!("\"{}\"", self.0.clone())
1348 }
1349}
1350#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1351pub struct TypeDefId(pub String);
1352impl From<&str> for TypeDefId {
1353 fn from(value: &str) -> Self {
1354 Self(value.to_string())
1355 }
1356}
1357impl From<String> for TypeDefId {
1358 fn from(value: String) -> Self {
1359 Self(value)
1360 }
1361}
1362impl IntoID<TypeDefId> for TypeDef {
1363 fn into_id(
1364 self,
1365 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1366 {
1367 Box::pin(async move { self.id().await })
1368 }
1369}
1370impl IntoID<TypeDefId> for TypeDefId {
1371 fn into_id(
1372 self,
1373 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1374 {
1375 Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
1376 }
1377}
1378impl TypeDefId {
1379 fn quote(&self) -> String {
1380 format!("\"{}\"", self.0.clone())
1381 }
1382}
1383#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1384pub struct Void(pub String);
1385impl From<&str> for Void {
1386 fn from(value: &str) -> Self {
1387 Self(value.to_string())
1388 }
1389}
1390impl From<String> for Void {
1391 fn from(value: String) -> Self {
1392 Self(value)
1393 }
1394}
1395impl Void {
1396 fn quote(&self) -> String {
1397 format!("\"{}\"", self.0.clone())
1398 }
1399}
1400#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1401pub struct BuildArg {
1402 pub name: String,
1403 pub value: String,
1404}
1405#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1406pub struct PipelineLabel {
1407 pub name: String,
1408 pub value: String,
1409}
1410#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1411pub struct PortForward {
1412 pub backend: isize,
1413 pub frontend: isize,
1414 pub protocol: NetworkProtocol,
1415}
1416#[derive(Clone)]
1417pub struct CacheVolume {
1418 pub proc: Option<Arc<DaggerSessionProc>>,
1419 pub selection: Selection,
1420 pub graphql_client: DynGraphQLClient,
1421}
1422impl CacheVolume {
1423 pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
1425 let query = self.selection.select("id");
1426 query.execute(self.graphql_client.clone()).await
1427 }
1428}
1429#[derive(Clone)]
1430pub struct Container {
1431 pub proc: Option<Arc<DaggerSessionProc>>,
1432 pub selection: Selection,
1433 pub graphql_client: DynGraphQLClient,
1434}
1435#[derive(Builder, Debug, PartialEq)]
1436pub struct ContainerAsServiceOpts<'a> {
1437 #[builder(setter(into, strip_option), default)]
1440 pub args: Option<Vec<&'a str>>,
1441 #[builder(setter(into, strip_option), default)]
1443 pub expand: Option<bool>,
1444 #[builder(setter(into, strip_option), default)]
1447 pub experimental_privileged_nesting: Option<bool>,
1448 #[builder(setter(into, strip_option), default)]
1450 pub insecure_root_capabilities: Option<bool>,
1451 #[builder(setter(into, strip_option), default)]
1454 pub no_init: Option<bool>,
1455 #[builder(setter(into, strip_option), default)]
1457 pub use_entrypoint: Option<bool>,
1458}
1459#[derive(Builder, Debug, PartialEq)]
1460pub struct ContainerAsTarballOpts {
1461 #[builder(setter(into, strip_option), default)]
1464 pub forced_compression: Option<ImageLayerCompression>,
1465 #[builder(setter(into, strip_option), default)]
1468 pub media_types: Option<ImageMediaTypes>,
1469 #[builder(setter(into, strip_option), default)]
1472 pub platform_variants: Option<Vec<ContainerId>>,
1473}
1474#[derive(Builder, Debug, PartialEq)]
1475pub struct ContainerBuildOpts<'a> {
1476 #[builder(setter(into, strip_option), default)]
1478 pub build_args: Option<Vec<BuildArg>>,
1479 #[builder(setter(into, strip_option), default)]
1481 pub dockerfile: Option<&'a str>,
1482 #[builder(setter(into, strip_option), default)]
1486 pub secrets: Option<Vec<SecretId>>,
1487 #[builder(setter(into, strip_option), default)]
1489 pub target: Option<&'a str>,
1490}
1491#[derive(Builder, Debug, PartialEq)]
1492pub struct ContainerDirectoryOpts {
1493 #[builder(setter(into, strip_option), default)]
1495 pub expand: Option<bool>,
1496}
1497#[derive(Builder, Debug, PartialEq)]
1498pub struct ContainerExportOpts {
1499 #[builder(setter(into, strip_option), default)]
1501 pub expand: Option<bool>,
1502 #[builder(setter(into, strip_option), default)]
1505 pub forced_compression: Option<ImageLayerCompression>,
1506 #[builder(setter(into, strip_option), default)]
1509 pub media_types: Option<ImageMediaTypes>,
1510 #[builder(setter(into, strip_option), default)]
1513 pub platform_variants: Option<Vec<ContainerId>>,
1514}
1515#[derive(Builder, Debug, PartialEq)]
1516pub struct ContainerFileOpts {
1517 #[builder(setter(into, strip_option), default)]
1519 pub expand: Option<bool>,
1520}
1521#[derive(Builder, Debug, PartialEq)]
1522pub struct ContainerImportOpts<'a> {
1523 #[builder(setter(into, strip_option), default)]
1525 pub tag: Option<&'a str>,
1526}
1527#[derive(Builder, Debug, PartialEq)]
1528pub struct ContainerPublishOpts {
1529 #[builder(setter(into, strip_option), default)]
1532 pub forced_compression: Option<ImageLayerCompression>,
1533 #[builder(setter(into, strip_option), default)]
1536 pub media_types: Option<ImageMediaTypes>,
1537 #[builder(setter(into, strip_option), default)]
1540 pub platform_variants: Option<Vec<ContainerId>>,
1541}
1542#[derive(Builder, Debug, PartialEq)]
1543pub struct ContainerTerminalOpts<'a> {
1544 #[builder(setter(into, strip_option), default)]
1546 pub cmd: Option<Vec<&'a str>>,
1547 #[builder(setter(into, strip_option), default)]
1550 pub experimental_privileged_nesting: Option<bool>,
1551 #[builder(setter(into, strip_option), default)]
1553 pub insecure_root_capabilities: Option<bool>,
1554}
1555#[derive(Builder, Debug, PartialEq)]
1556pub struct ContainerUpOpts<'a> {
1557 #[builder(setter(into, strip_option), default)]
1560 pub args: Option<Vec<&'a str>>,
1561 #[builder(setter(into, strip_option), default)]
1563 pub expand: Option<bool>,
1564 #[builder(setter(into, strip_option), default)]
1567 pub experimental_privileged_nesting: Option<bool>,
1568 #[builder(setter(into, strip_option), default)]
1570 pub insecure_root_capabilities: Option<bool>,
1571 #[builder(setter(into, strip_option), default)]
1574 pub no_init: Option<bool>,
1575 #[builder(setter(into, strip_option), default)]
1578 pub ports: Option<Vec<PortForward>>,
1579 #[builder(setter(into, strip_option), default)]
1581 pub random: Option<bool>,
1582 #[builder(setter(into, strip_option), default)]
1584 pub use_entrypoint: Option<bool>,
1585}
1586#[derive(Builder, Debug, PartialEq)]
1587pub struct ContainerWithDefaultTerminalCmdOpts {
1588 #[builder(setter(into, strip_option), default)]
1591 pub experimental_privileged_nesting: Option<bool>,
1592 #[builder(setter(into, strip_option), default)]
1594 pub insecure_root_capabilities: Option<bool>,
1595}
1596#[derive(Builder, Debug, PartialEq)]
1597pub struct ContainerWithDirectoryOpts<'a> {
1598 #[builder(setter(into, strip_option), default)]
1600 pub exclude: Option<Vec<&'a str>>,
1601 #[builder(setter(into, strip_option), default)]
1603 pub expand: Option<bool>,
1604 #[builder(setter(into, strip_option), default)]
1606 pub include: Option<Vec<&'a str>>,
1607 #[builder(setter(into, strip_option), default)]
1611 pub owner: Option<&'a str>,
1612}
1613#[derive(Builder, Debug, PartialEq)]
1614pub struct ContainerWithEntrypointOpts {
1615 #[builder(setter(into, strip_option), default)]
1617 pub keep_default_args: Option<bool>,
1618}
1619#[derive(Builder, Debug, PartialEq)]
1620pub struct ContainerWithEnvVariableOpts {
1621 #[builder(setter(into, strip_option), default)]
1623 pub expand: Option<bool>,
1624}
1625#[derive(Builder, Debug, PartialEq)]
1626pub struct ContainerWithExecOpts<'a> {
1627 #[builder(setter(into, strip_option), default)]
1629 pub expand: Option<bool>,
1630 #[builder(setter(into, strip_option), default)]
1632 pub expect: Option<ReturnType>,
1633 #[builder(setter(into, strip_option), default)]
1636 pub experimental_privileged_nesting: Option<bool>,
1637 #[builder(setter(into, strip_option), default)]
1639 pub insecure_root_capabilities: Option<bool>,
1640 #[builder(setter(into, strip_option), default)]
1643 pub no_init: Option<bool>,
1644 #[builder(setter(into, strip_option), default)]
1646 pub redirect_stderr: Option<&'a str>,
1647 #[builder(setter(into, strip_option), default)]
1649 pub redirect_stdout: Option<&'a str>,
1650 #[builder(setter(into, strip_option), default)]
1652 pub stdin: Option<&'a str>,
1653 #[builder(setter(into, strip_option), default)]
1655 pub use_entrypoint: Option<bool>,
1656}
1657#[derive(Builder, Debug, PartialEq)]
1658pub struct ContainerWithExposedPortOpts<'a> {
1659 #[builder(setter(into, strip_option), default)]
1661 pub description: Option<&'a str>,
1662 #[builder(setter(into, strip_option), default)]
1664 pub experimental_skip_healthcheck: Option<bool>,
1665 #[builder(setter(into, strip_option), default)]
1667 pub protocol: Option<NetworkProtocol>,
1668}
1669#[derive(Builder, Debug, PartialEq)]
1670pub struct ContainerWithFileOpts<'a> {
1671 #[builder(setter(into, strip_option), default)]
1673 pub expand: Option<bool>,
1674 #[builder(setter(into, strip_option), default)]
1678 pub owner: Option<&'a str>,
1679 #[builder(setter(into, strip_option), default)]
1681 pub permissions: Option<isize>,
1682}
1683#[derive(Builder, Debug, PartialEq)]
1684pub struct ContainerWithFilesOpts<'a> {
1685 #[builder(setter(into, strip_option), default)]
1687 pub expand: Option<bool>,
1688 #[builder(setter(into, strip_option), default)]
1692 pub owner: Option<&'a str>,
1693 #[builder(setter(into, strip_option), default)]
1695 pub permissions: Option<isize>,
1696}
1697#[derive(Builder, Debug, PartialEq)]
1698pub struct ContainerWithMountedCacheOpts<'a> {
1699 #[builder(setter(into, strip_option), default)]
1701 pub expand: Option<bool>,
1702 #[builder(setter(into, strip_option), default)]
1707 pub owner: Option<&'a str>,
1708 #[builder(setter(into, strip_option), default)]
1710 pub sharing: Option<CacheSharingMode>,
1711 #[builder(setter(into, strip_option), default)]
1713 pub source: Option<DirectoryId>,
1714}
1715#[derive(Builder, Debug, PartialEq)]
1716pub struct ContainerWithMountedDirectoryOpts<'a> {
1717 #[builder(setter(into, strip_option), default)]
1719 pub expand: Option<bool>,
1720 #[builder(setter(into, strip_option), default)]
1724 pub owner: Option<&'a str>,
1725}
1726#[derive(Builder, Debug, PartialEq)]
1727pub struct ContainerWithMountedFileOpts<'a> {
1728 #[builder(setter(into, strip_option), default)]
1730 pub expand: Option<bool>,
1731 #[builder(setter(into, strip_option), default)]
1735 pub owner: Option<&'a str>,
1736}
1737#[derive(Builder, Debug, PartialEq)]
1738pub struct ContainerWithMountedSecretOpts<'a> {
1739 #[builder(setter(into, strip_option), default)]
1741 pub expand: Option<bool>,
1742 #[builder(setter(into, strip_option), default)]
1745 pub mode: Option<isize>,
1746 #[builder(setter(into, strip_option), default)]
1750 pub owner: Option<&'a str>,
1751}
1752#[derive(Builder, Debug, PartialEq)]
1753pub struct ContainerWithMountedTempOpts {
1754 #[builder(setter(into, strip_option), default)]
1756 pub expand: Option<bool>,
1757 #[builder(setter(into, strip_option), default)]
1759 pub size: Option<isize>,
1760}
1761#[derive(Builder, Debug, PartialEq)]
1762pub struct ContainerWithNewFileOpts<'a> {
1763 #[builder(setter(into, strip_option), default)]
1765 pub expand: Option<bool>,
1766 #[builder(setter(into, strip_option), default)]
1770 pub owner: Option<&'a str>,
1771 #[builder(setter(into, strip_option), default)]
1773 pub permissions: Option<isize>,
1774}
1775#[derive(Builder, Debug, PartialEq)]
1776pub struct ContainerWithUnixSocketOpts<'a> {
1777 #[builder(setter(into, strip_option), default)]
1779 pub expand: Option<bool>,
1780 #[builder(setter(into, strip_option), default)]
1784 pub owner: Option<&'a str>,
1785}
1786#[derive(Builder, Debug, PartialEq)]
1787pub struct ContainerWithWorkdirOpts {
1788 #[builder(setter(into, strip_option), default)]
1790 pub expand: Option<bool>,
1791}
1792#[derive(Builder, Debug, PartialEq)]
1793pub struct ContainerWithoutDirectoryOpts {
1794 #[builder(setter(into, strip_option), default)]
1796 pub expand: Option<bool>,
1797}
1798#[derive(Builder, Debug, PartialEq)]
1799pub struct ContainerWithoutEntrypointOpts {
1800 #[builder(setter(into, strip_option), default)]
1802 pub keep_default_args: Option<bool>,
1803}
1804#[derive(Builder, Debug, PartialEq)]
1805pub struct ContainerWithoutExposedPortOpts {
1806 #[builder(setter(into, strip_option), default)]
1808 pub protocol: Option<NetworkProtocol>,
1809}
1810#[derive(Builder, Debug, PartialEq)]
1811pub struct ContainerWithoutFileOpts {
1812 #[builder(setter(into, strip_option), default)]
1814 pub expand: Option<bool>,
1815}
1816#[derive(Builder, Debug, PartialEq)]
1817pub struct ContainerWithoutFilesOpts {
1818 #[builder(setter(into, strip_option), default)]
1820 pub expand: Option<bool>,
1821}
1822#[derive(Builder, Debug, PartialEq)]
1823pub struct ContainerWithoutMountOpts {
1824 #[builder(setter(into, strip_option), default)]
1826 pub expand: Option<bool>,
1827}
1828#[derive(Builder, Debug, PartialEq)]
1829pub struct ContainerWithoutUnixSocketOpts {
1830 #[builder(setter(into, strip_option), default)]
1832 pub expand: Option<bool>,
1833}
1834impl Container {
1835 pub fn as_service(&self) -> Service {
1842 let query = self.selection.select("asService");
1843 Service {
1844 proc: self.proc.clone(),
1845 selection: query,
1846 graphql_client: self.graphql_client.clone(),
1847 }
1848 }
1849 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
1856 let mut query = self.selection.select("asService");
1857 if let Some(args) = opts.args {
1858 query = query.arg("args", args);
1859 }
1860 if let Some(use_entrypoint) = opts.use_entrypoint {
1861 query = query.arg("useEntrypoint", use_entrypoint);
1862 }
1863 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
1864 query = query.arg(
1865 "experimentalPrivilegedNesting",
1866 experimental_privileged_nesting,
1867 );
1868 }
1869 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
1870 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
1871 }
1872 if let Some(expand) = opts.expand {
1873 query = query.arg("expand", expand);
1874 }
1875 if let Some(no_init) = opts.no_init {
1876 query = query.arg("noInit", no_init);
1877 }
1878 Service {
1879 proc: self.proc.clone(),
1880 selection: query,
1881 graphql_client: self.graphql_client.clone(),
1882 }
1883 }
1884 pub fn as_tarball(&self) -> File {
1890 let query = self.selection.select("asTarball");
1891 File {
1892 proc: self.proc.clone(),
1893 selection: query,
1894 graphql_client: self.graphql_client.clone(),
1895 }
1896 }
1897 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
1903 let mut query = self.selection.select("asTarball");
1904 if let Some(platform_variants) = opts.platform_variants {
1905 query = query.arg("platformVariants", platform_variants);
1906 }
1907 if let Some(forced_compression) = opts.forced_compression {
1908 query = query.arg("forcedCompression", forced_compression);
1909 }
1910 if let Some(media_types) = opts.media_types {
1911 query = query.arg("mediaTypes", media_types);
1912 }
1913 File {
1914 proc: self.proc.clone(),
1915 selection: query,
1916 graphql_client: self.graphql_client.clone(),
1917 }
1918 }
1919 pub fn build(&self, context: impl IntoID<DirectoryId>) -> Container {
1926 let mut query = self.selection.select("build");
1927 query = query.arg_lazy(
1928 "context",
1929 Box::new(move || {
1930 let context = context.clone();
1931 Box::pin(async move { context.into_id().await.unwrap().quote() })
1932 }),
1933 );
1934 Container {
1935 proc: self.proc.clone(),
1936 selection: query,
1937 graphql_client: self.graphql_client.clone(),
1938 }
1939 }
1940 pub fn build_opts<'a>(
1947 &self,
1948 context: impl IntoID<DirectoryId>,
1949 opts: ContainerBuildOpts<'a>,
1950 ) -> Container {
1951 let mut query = self.selection.select("build");
1952 query = query.arg_lazy(
1953 "context",
1954 Box::new(move || {
1955 let context = context.clone();
1956 Box::pin(async move { context.into_id().await.unwrap().quote() })
1957 }),
1958 );
1959 if let Some(dockerfile) = opts.dockerfile {
1960 query = query.arg("dockerfile", dockerfile);
1961 }
1962 if let Some(target) = opts.target {
1963 query = query.arg("target", target);
1964 }
1965 if let Some(build_args) = opts.build_args {
1966 query = query.arg("buildArgs", build_args);
1967 }
1968 if let Some(secrets) = opts.secrets {
1969 query = query.arg("secrets", secrets);
1970 }
1971 Container {
1972 proc: self.proc.clone(),
1973 selection: query,
1974 graphql_client: self.graphql_client.clone(),
1975 }
1976 }
1977 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
1979 let query = self.selection.select("defaultArgs");
1980 query.execute(self.graphql_client.clone()).await
1981 }
1982 pub fn directory(&self, path: impl Into<String>) -> Directory {
1990 let mut query = self.selection.select("directory");
1991 query = query.arg("path", path.into());
1992 Directory {
1993 proc: self.proc.clone(),
1994 selection: query,
1995 graphql_client: self.graphql_client.clone(),
1996 }
1997 }
1998 pub fn directory_opts(
2006 &self,
2007 path: impl Into<String>,
2008 opts: ContainerDirectoryOpts,
2009 ) -> Directory {
2010 let mut query = self.selection.select("directory");
2011 query = query.arg("path", path.into());
2012 if let Some(expand) = opts.expand {
2013 query = query.arg("expand", expand);
2014 }
2015 Directory {
2016 proc: self.proc.clone(),
2017 selection: query,
2018 graphql_client: self.graphql_client.clone(),
2019 }
2020 }
2021 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2023 let query = self.selection.select("entrypoint");
2024 query.execute(self.graphql_client.clone()).await
2025 }
2026 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2032 let mut query = self.selection.select("envVariable");
2033 query = query.arg("name", name.into());
2034 query.execute(self.graphql_client.clone()).await
2035 }
2036 pub fn env_variables(&self) -> Vec<EnvVariable> {
2038 let query = self.selection.select("envVariables");
2039 vec![EnvVariable {
2040 proc: self.proc.clone(),
2041 selection: query,
2042 graphql_client: self.graphql_client.clone(),
2043 }]
2044 }
2045 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2048 let query = self.selection.select("exitCode");
2049 query.execute(self.graphql_client.clone()).await
2050 }
2051 pub fn experimental_with_all_gp_us(&self) -> Container {
2055 let query = self.selection.select("experimentalWithAllGPUs");
2056 Container {
2057 proc: self.proc.clone(),
2058 selection: query,
2059 graphql_client: self.graphql_client.clone(),
2060 }
2061 }
2062 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2070 let mut query = self.selection.select("experimentalWithGPU");
2071 query = query.arg(
2072 "devices",
2073 devices
2074 .into_iter()
2075 .map(|i| i.into())
2076 .collect::<Vec<String>>(),
2077 );
2078 Container {
2079 proc: self.proc.clone(),
2080 selection: query,
2081 graphql_client: self.graphql_client.clone(),
2082 }
2083 }
2084 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2094 let mut query = self.selection.select("export");
2095 query = query.arg("path", path.into());
2096 query.execute(self.graphql_client.clone()).await
2097 }
2098 pub async fn export_opts(
2108 &self,
2109 path: impl Into<String>,
2110 opts: ContainerExportOpts,
2111 ) -> Result<String, DaggerError> {
2112 let mut query = self.selection.select("export");
2113 query = query.arg("path", path.into());
2114 if let Some(platform_variants) = opts.platform_variants {
2115 query = query.arg("platformVariants", platform_variants);
2116 }
2117 if let Some(forced_compression) = opts.forced_compression {
2118 query = query.arg("forcedCompression", forced_compression);
2119 }
2120 if let Some(media_types) = opts.media_types {
2121 query = query.arg("mediaTypes", media_types);
2122 }
2123 if let Some(expand) = opts.expand {
2124 query = query.arg("expand", expand);
2125 }
2126 query.execute(self.graphql_client.clone()).await
2127 }
2128 pub fn exposed_ports(&self) -> Vec<Port> {
2131 let query = self.selection.select("exposedPorts");
2132 vec![Port {
2133 proc: self.proc.clone(),
2134 selection: query,
2135 graphql_client: self.graphql_client.clone(),
2136 }]
2137 }
2138 pub fn file(&self, path: impl Into<String>) -> File {
2146 let mut query = self.selection.select("file");
2147 query = query.arg("path", path.into());
2148 File {
2149 proc: self.proc.clone(),
2150 selection: query,
2151 graphql_client: self.graphql_client.clone(),
2152 }
2153 }
2154 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2162 let mut query = self.selection.select("file");
2163 query = query.arg("path", path.into());
2164 if let Some(expand) = opts.expand {
2165 query = query.arg("expand", expand);
2166 }
2167 File {
2168 proc: self.proc.clone(),
2169 selection: query,
2170 graphql_client: self.graphql_client.clone(),
2171 }
2172 }
2173 pub fn from(&self, address: impl Into<String>) -> Container {
2181 let mut query = self.selection.select("from");
2182 query = query.arg("address", address.into());
2183 Container {
2184 proc: self.proc.clone(),
2185 selection: query,
2186 graphql_client: self.graphql_client.clone(),
2187 }
2188 }
2189 pub async fn id(&self) -> Result<ContainerId, DaggerError> {
2191 let query = self.selection.select("id");
2192 query.execute(self.graphql_client.clone()).await
2193 }
2194 pub async fn image_ref(&self) -> Result<String, DaggerError> {
2196 let query = self.selection.select("imageRef");
2197 query.execute(self.graphql_client.clone()).await
2198 }
2199 pub fn import(&self, source: impl IntoID<FileId>) -> Container {
2206 let mut query = self.selection.select("import");
2207 query = query.arg_lazy(
2208 "source",
2209 Box::new(move || {
2210 let source = source.clone();
2211 Box::pin(async move { source.into_id().await.unwrap().quote() })
2212 }),
2213 );
2214 Container {
2215 proc: self.proc.clone(),
2216 selection: query,
2217 graphql_client: self.graphql_client.clone(),
2218 }
2219 }
2220 pub fn import_opts<'a>(
2227 &self,
2228 source: impl IntoID<FileId>,
2229 opts: ContainerImportOpts<'a>,
2230 ) -> Container {
2231 let mut query = self.selection.select("import");
2232 query = query.arg_lazy(
2233 "source",
2234 Box::new(move || {
2235 let source = source.clone();
2236 Box::pin(async move { source.into_id().await.unwrap().quote() })
2237 }),
2238 );
2239 if let Some(tag) = opts.tag {
2240 query = query.arg("tag", tag);
2241 }
2242 Container {
2243 proc: self.proc.clone(),
2244 selection: query,
2245 graphql_client: self.graphql_client.clone(),
2246 }
2247 }
2248 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2254 let mut query = self.selection.select("label");
2255 query = query.arg("name", name.into());
2256 query.execute(self.graphql_client.clone()).await
2257 }
2258 pub fn labels(&self) -> Vec<Label> {
2260 let query = self.selection.select("labels");
2261 vec![Label {
2262 proc: self.proc.clone(),
2263 selection: query,
2264 graphql_client: self.graphql_client.clone(),
2265 }]
2266 }
2267 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2269 let query = self.selection.select("mounts");
2270 query.execute(self.graphql_client.clone()).await
2271 }
2272 pub async fn platform(&self) -> Result<Platform, DaggerError> {
2274 let query = self.selection.select("platform");
2275 query.execute(self.graphql_client.clone()).await
2276 }
2277 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2288 let mut query = self.selection.select("publish");
2289 query = query.arg("address", address.into());
2290 query.execute(self.graphql_client.clone()).await
2291 }
2292 pub async fn publish_opts(
2303 &self,
2304 address: impl Into<String>,
2305 opts: ContainerPublishOpts,
2306 ) -> Result<String, DaggerError> {
2307 let mut query = self.selection.select("publish");
2308 query = query.arg("address", address.into());
2309 if let Some(platform_variants) = opts.platform_variants {
2310 query = query.arg("platformVariants", platform_variants);
2311 }
2312 if let Some(forced_compression) = opts.forced_compression {
2313 query = query.arg("forcedCompression", forced_compression);
2314 }
2315 if let Some(media_types) = opts.media_types {
2316 query = query.arg("mediaTypes", media_types);
2317 }
2318 query.execute(self.graphql_client.clone()).await
2319 }
2320 pub fn rootfs(&self) -> Directory {
2322 let query = self.selection.select("rootfs");
2323 Directory {
2324 proc: self.proc.clone(),
2325 selection: query,
2326 graphql_client: self.graphql_client.clone(),
2327 }
2328 }
2329 pub async fn stderr(&self) -> Result<String, DaggerError> {
2332 let query = self.selection.select("stderr");
2333 query.execute(self.graphql_client.clone()).await
2334 }
2335 pub async fn stdout(&self) -> Result<String, DaggerError> {
2338 let query = self.selection.select("stdout");
2339 query.execute(self.graphql_client.clone()).await
2340 }
2341 pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
2344 let query = self.selection.select("sync");
2345 query.execute(self.graphql_client.clone()).await
2346 }
2347 pub fn terminal(&self) -> Container {
2353 let query = self.selection.select("terminal");
2354 Container {
2355 proc: self.proc.clone(),
2356 selection: query,
2357 graphql_client: self.graphql_client.clone(),
2358 }
2359 }
2360 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2366 let mut query = self.selection.select("terminal");
2367 if let Some(cmd) = opts.cmd {
2368 query = query.arg("cmd", cmd);
2369 }
2370 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2371 query = query.arg(
2372 "experimentalPrivilegedNesting",
2373 experimental_privileged_nesting,
2374 );
2375 }
2376 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2377 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2378 }
2379 Container {
2380 proc: self.proc.clone(),
2381 selection: query,
2382 graphql_client: self.graphql_client.clone(),
2383 }
2384 }
2385 pub async fn up(&self) -> Result<Void, DaggerError> {
2392 let query = self.selection.select("up");
2393 query.execute(self.graphql_client.clone()).await
2394 }
2395 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
2402 let mut query = self.selection.select("up");
2403 if let Some(ports) = opts.ports {
2404 query = query.arg("ports", ports);
2405 }
2406 if let Some(random) = opts.random {
2407 query = query.arg("random", random);
2408 }
2409 if let Some(args) = opts.args {
2410 query = query.arg("args", args);
2411 }
2412 if let Some(use_entrypoint) = opts.use_entrypoint {
2413 query = query.arg("useEntrypoint", use_entrypoint);
2414 }
2415 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2416 query = query.arg(
2417 "experimentalPrivilegedNesting",
2418 experimental_privileged_nesting,
2419 );
2420 }
2421 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2422 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2423 }
2424 if let Some(expand) = opts.expand {
2425 query = query.arg("expand", expand);
2426 }
2427 if let Some(no_init) = opts.no_init {
2428 query = query.arg("noInit", no_init);
2429 }
2430 query.execute(self.graphql_client.clone()).await
2431 }
2432 pub async fn user(&self) -> Result<String, DaggerError> {
2434 let query = self.selection.select("user");
2435 query.execute(self.graphql_client.clone()).await
2436 }
2437 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2444 let mut query = self.selection.select("withAnnotation");
2445 query = query.arg("name", name.into());
2446 query = query.arg("value", value.into());
2447 Container {
2448 proc: self.proc.clone(),
2449 selection: query,
2450 graphql_client: self.graphql_client.clone(),
2451 }
2452 }
2453 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
2459 let mut query = self.selection.select("withDefaultArgs");
2460 query = query.arg(
2461 "args",
2462 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2463 );
2464 Container {
2465 proc: self.proc.clone(),
2466 selection: query,
2467 graphql_client: self.graphql_client.clone(),
2468 }
2469 }
2470 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
2477 let mut query = self.selection.select("withDefaultTerminalCmd");
2478 query = query.arg(
2479 "args",
2480 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2481 );
2482 Container {
2483 proc: self.proc.clone(),
2484 selection: query,
2485 graphql_client: self.graphql_client.clone(),
2486 }
2487 }
2488 pub fn with_default_terminal_cmd_opts(
2495 &self,
2496 args: Vec<impl Into<String>>,
2497 opts: ContainerWithDefaultTerminalCmdOpts,
2498 ) -> Container {
2499 let mut query = self.selection.select("withDefaultTerminalCmd");
2500 query = query.arg(
2501 "args",
2502 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2503 );
2504 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2505 query = query.arg(
2506 "experimentalPrivilegedNesting",
2507 experimental_privileged_nesting,
2508 );
2509 }
2510 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2511 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2512 }
2513 Container {
2514 proc: self.proc.clone(),
2515 selection: query,
2516 graphql_client: self.graphql_client.clone(),
2517 }
2518 }
2519 pub fn with_directory(
2527 &self,
2528 path: impl Into<String>,
2529 directory: impl IntoID<DirectoryId>,
2530 ) -> Container {
2531 let mut query = self.selection.select("withDirectory");
2532 query = query.arg("path", path.into());
2533 query = query.arg_lazy(
2534 "directory",
2535 Box::new(move || {
2536 let directory = directory.clone();
2537 Box::pin(async move { directory.into_id().await.unwrap().quote() })
2538 }),
2539 );
2540 Container {
2541 proc: self.proc.clone(),
2542 selection: query,
2543 graphql_client: self.graphql_client.clone(),
2544 }
2545 }
2546 pub fn with_directory_opts<'a>(
2554 &self,
2555 path: impl Into<String>,
2556 directory: impl IntoID<DirectoryId>,
2557 opts: ContainerWithDirectoryOpts<'a>,
2558 ) -> Container {
2559 let mut query = self.selection.select("withDirectory");
2560 query = query.arg("path", path.into());
2561 query = query.arg_lazy(
2562 "directory",
2563 Box::new(move || {
2564 let directory = directory.clone();
2565 Box::pin(async move { directory.into_id().await.unwrap().quote() })
2566 }),
2567 );
2568 if let Some(exclude) = opts.exclude {
2569 query = query.arg("exclude", exclude);
2570 }
2571 if let Some(include) = opts.include {
2572 query = query.arg("include", include);
2573 }
2574 if let Some(owner) = opts.owner {
2575 query = query.arg("owner", owner);
2576 }
2577 if let Some(expand) = opts.expand {
2578 query = query.arg("expand", expand);
2579 }
2580 Container {
2581 proc: self.proc.clone(),
2582 selection: query,
2583 graphql_client: self.graphql_client.clone(),
2584 }
2585 }
2586 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
2593 let mut query = self.selection.select("withEntrypoint");
2594 query = query.arg(
2595 "args",
2596 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2597 );
2598 Container {
2599 proc: self.proc.clone(),
2600 selection: query,
2601 graphql_client: self.graphql_client.clone(),
2602 }
2603 }
2604 pub fn with_entrypoint_opts(
2611 &self,
2612 args: Vec<impl Into<String>>,
2613 opts: ContainerWithEntrypointOpts,
2614 ) -> Container {
2615 let mut query = self.selection.select("withEntrypoint");
2616 query = query.arg(
2617 "args",
2618 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2619 );
2620 if let Some(keep_default_args) = opts.keep_default_args {
2621 query = query.arg("keepDefaultArgs", keep_default_args);
2622 }
2623 Container {
2624 proc: self.proc.clone(),
2625 selection: query,
2626 graphql_client: self.graphql_client.clone(),
2627 }
2628 }
2629 pub fn with_env_variable(
2637 &self,
2638 name: impl Into<String>,
2639 value: impl Into<String>,
2640 ) -> Container {
2641 let mut query = self.selection.select("withEnvVariable");
2642 query = query.arg("name", name.into());
2643 query = query.arg("value", value.into());
2644 Container {
2645 proc: self.proc.clone(),
2646 selection: query,
2647 graphql_client: self.graphql_client.clone(),
2648 }
2649 }
2650 pub fn with_env_variable_opts(
2658 &self,
2659 name: impl Into<String>,
2660 value: impl Into<String>,
2661 opts: ContainerWithEnvVariableOpts,
2662 ) -> Container {
2663 let mut query = self.selection.select("withEnvVariable");
2664 query = query.arg("name", name.into());
2665 query = query.arg("value", value.into());
2666 if let Some(expand) = opts.expand {
2667 query = query.arg("expand", expand);
2668 }
2669 Container {
2670 proc: self.proc.clone(),
2671 selection: query,
2672 graphql_client: self.graphql_client.clone(),
2673 }
2674 }
2675 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
2684 let mut query = self.selection.select("withExec");
2685 query = query.arg(
2686 "args",
2687 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2688 );
2689 Container {
2690 proc: self.proc.clone(),
2691 selection: query,
2692 graphql_client: self.graphql_client.clone(),
2693 }
2694 }
2695 pub fn with_exec_opts<'a>(
2704 &self,
2705 args: Vec<impl Into<String>>,
2706 opts: ContainerWithExecOpts<'a>,
2707 ) -> Container {
2708 let mut query = self.selection.select("withExec");
2709 query = query.arg(
2710 "args",
2711 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2712 );
2713 if let Some(use_entrypoint) = opts.use_entrypoint {
2714 query = query.arg("useEntrypoint", use_entrypoint);
2715 }
2716 if let Some(stdin) = opts.stdin {
2717 query = query.arg("stdin", stdin);
2718 }
2719 if let Some(redirect_stdout) = opts.redirect_stdout {
2720 query = query.arg("redirectStdout", redirect_stdout);
2721 }
2722 if let Some(redirect_stderr) = opts.redirect_stderr {
2723 query = query.arg("redirectStderr", redirect_stderr);
2724 }
2725 if let Some(expect) = opts.expect {
2726 query = query.arg("expect", expect);
2727 }
2728 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2729 query = query.arg(
2730 "experimentalPrivilegedNesting",
2731 experimental_privileged_nesting,
2732 );
2733 }
2734 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2735 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2736 }
2737 if let Some(expand) = opts.expand {
2738 query = query.arg("expand", expand);
2739 }
2740 if let Some(no_init) = opts.no_init {
2741 query = query.arg("noInit", no_init);
2742 }
2743 Container {
2744 proc: self.proc.clone(),
2745 selection: query,
2746 graphql_client: self.graphql_client.clone(),
2747 }
2748 }
2749 pub fn with_exposed_port(&self, port: isize) -> Container {
2759 let mut query = self.selection.select("withExposedPort");
2760 query = query.arg("port", port);
2761 Container {
2762 proc: self.proc.clone(),
2763 selection: query,
2764 graphql_client: self.graphql_client.clone(),
2765 }
2766 }
2767 pub fn with_exposed_port_opts<'a>(
2777 &self,
2778 port: isize,
2779 opts: ContainerWithExposedPortOpts<'a>,
2780 ) -> Container {
2781 let mut query = self.selection.select("withExposedPort");
2782 query = query.arg("port", port);
2783 if let Some(protocol) = opts.protocol {
2784 query = query.arg("protocol", protocol);
2785 }
2786 if let Some(description) = opts.description {
2787 query = query.arg("description", description);
2788 }
2789 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
2790 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
2791 }
2792 Container {
2793 proc: self.proc.clone(),
2794 selection: query,
2795 graphql_client: self.graphql_client.clone(),
2796 }
2797 }
2798 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
2806 let mut query = self.selection.select("withFile");
2807 query = query.arg("path", path.into());
2808 query = query.arg_lazy(
2809 "source",
2810 Box::new(move || {
2811 let source = source.clone();
2812 Box::pin(async move { source.into_id().await.unwrap().quote() })
2813 }),
2814 );
2815 Container {
2816 proc: self.proc.clone(),
2817 selection: query,
2818 graphql_client: self.graphql_client.clone(),
2819 }
2820 }
2821 pub fn with_file_opts<'a>(
2829 &self,
2830 path: impl Into<String>,
2831 source: impl IntoID<FileId>,
2832 opts: ContainerWithFileOpts<'a>,
2833 ) -> Container {
2834 let mut query = self.selection.select("withFile");
2835 query = query.arg("path", path.into());
2836 query = query.arg_lazy(
2837 "source",
2838 Box::new(move || {
2839 let source = source.clone();
2840 Box::pin(async move { source.into_id().await.unwrap().quote() })
2841 }),
2842 );
2843 if let Some(permissions) = opts.permissions {
2844 query = query.arg("permissions", permissions);
2845 }
2846 if let Some(owner) = opts.owner {
2847 query = query.arg("owner", owner);
2848 }
2849 if let Some(expand) = opts.expand {
2850 query = query.arg("expand", expand);
2851 }
2852 Container {
2853 proc: self.proc.clone(),
2854 selection: query,
2855 graphql_client: self.graphql_client.clone(),
2856 }
2857 }
2858 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
2866 let mut query = self.selection.select("withFiles");
2867 query = query.arg("path", path.into());
2868 query = query.arg("sources", sources);
2869 Container {
2870 proc: self.proc.clone(),
2871 selection: query,
2872 graphql_client: self.graphql_client.clone(),
2873 }
2874 }
2875 pub fn with_files_opts<'a>(
2883 &self,
2884 path: impl Into<String>,
2885 sources: Vec<FileId>,
2886 opts: ContainerWithFilesOpts<'a>,
2887 ) -> Container {
2888 let mut query = self.selection.select("withFiles");
2889 query = query.arg("path", path.into());
2890 query = query.arg("sources", sources);
2891 if let Some(permissions) = opts.permissions {
2892 query = query.arg("permissions", permissions);
2893 }
2894 if let Some(owner) = opts.owner {
2895 query = query.arg("owner", owner);
2896 }
2897 if let Some(expand) = opts.expand {
2898 query = query.arg("expand", expand);
2899 }
2900 Container {
2901 proc: self.proc.clone(),
2902 selection: query,
2903 graphql_client: self.graphql_client.clone(),
2904 }
2905 }
2906 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2913 let mut query = self.selection.select("withLabel");
2914 query = query.arg("name", name.into());
2915 query = query.arg("value", value.into());
2916 Container {
2917 proc: self.proc.clone(),
2918 selection: query,
2919 graphql_client: self.graphql_client.clone(),
2920 }
2921 }
2922 pub fn with_mounted_cache(
2930 &self,
2931 path: impl Into<String>,
2932 cache: impl IntoID<CacheVolumeId>,
2933 ) -> Container {
2934 let mut query = self.selection.select("withMountedCache");
2935 query = query.arg("path", path.into());
2936 query = query.arg_lazy(
2937 "cache",
2938 Box::new(move || {
2939 let cache = cache.clone();
2940 Box::pin(async move { cache.into_id().await.unwrap().quote() })
2941 }),
2942 );
2943 Container {
2944 proc: self.proc.clone(),
2945 selection: query,
2946 graphql_client: self.graphql_client.clone(),
2947 }
2948 }
2949 pub fn with_mounted_cache_opts<'a>(
2957 &self,
2958 path: impl Into<String>,
2959 cache: impl IntoID<CacheVolumeId>,
2960 opts: ContainerWithMountedCacheOpts<'a>,
2961 ) -> Container {
2962 let mut query = self.selection.select("withMountedCache");
2963 query = query.arg("path", path.into());
2964 query = query.arg_lazy(
2965 "cache",
2966 Box::new(move || {
2967 let cache = cache.clone();
2968 Box::pin(async move { cache.into_id().await.unwrap().quote() })
2969 }),
2970 );
2971 if let Some(source) = opts.source {
2972 query = query.arg("source", source);
2973 }
2974 if let Some(sharing) = opts.sharing {
2975 query = query.arg("sharing", sharing);
2976 }
2977 if let Some(owner) = opts.owner {
2978 query = query.arg("owner", owner);
2979 }
2980 if let Some(expand) = opts.expand {
2981 query = query.arg("expand", expand);
2982 }
2983 Container {
2984 proc: self.proc.clone(),
2985 selection: query,
2986 graphql_client: self.graphql_client.clone(),
2987 }
2988 }
2989 pub fn with_mounted_directory(
2997 &self,
2998 path: impl Into<String>,
2999 source: impl IntoID<DirectoryId>,
3000 ) -> Container {
3001 let mut query = self.selection.select("withMountedDirectory");
3002 query = query.arg("path", path.into());
3003 query = query.arg_lazy(
3004 "source",
3005 Box::new(move || {
3006 let source = source.clone();
3007 Box::pin(async move { source.into_id().await.unwrap().quote() })
3008 }),
3009 );
3010 Container {
3011 proc: self.proc.clone(),
3012 selection: query,
3013 graphql_client: self.graphql_client.clone(),
3014 }
3015 }
3016 pub fn with_mounted_directory_opts<'a>(
3024 &self,
3025 path: impl Into<String>,
3026 source: impl IntoID<DirectoryId>,
3027 opts: ContainerWithMountedDirectoryOpts<'a>,
3028 ) -> Container {
3029 let mut query = self.selection.select("withMountedDirectory");
3030 query = query.arg("path", path.into());
3031 query = query.arg_lazy(
3032 "source",
3033 Box::new(move || {
3034 let source = source.clone();
3035 Box::pin(async move { source.into_id().await.unwrap().quote() })
3036 }),
3037 );
3038 if let Some(owner) = opts.owner {
3039 query = query.arg("owner", owner);
3040 }
3041 if let Some(expand) = opts.expand {
3042 query = query.arg("expand", expand);
3043 }
3044 Container {
3045 proc: self.proc.clone(),
3046 selection: query,
3047 graphql_client: self.graphql_client.clone(),
3048 }
3049 }
3050 pub fn with_mounted_file(
3058 &self,
3059 path: impl Into<String>,
3060 source: impl IntoID<FileId>,
3061 ) -> Container {
3062 let mut query = self.selection.select("withMountedFile");
3063 query = query.arg("path", path.into());
3064 query = query.arg_lazy(
3065 "source",
3066 Box::new(move || {
3067 let source = source.clone();
3068 Box::pin(async move { source.into_id().await.unwrap().quote() })
3069 }),
3070 );
3071 Container {
3072 proc: self.proc.clone(),
3073 selection: query,
3074 graphql_client: self.graphql_client.clone(),
3075 }
3076 }
3077 pub fn with_mounted_file_opts<'a>(
3085 &self,
3086 path: impl Into<String>,
3087 source: impl IntoID<FileId>,
3088 opts: ContainerWithMountedFileOpts<'a>,
3089 ) -> Container {
3090 let mut query = self.selection.select("withMountedFile");
3091 query = query.arg("path", path.into());
3092 query = query.arg_lazy(
3093 "source",
3094 Box::new(move || {
3095 let source = source.clone();
3096 Box::pin(async move { source.into_id().await.unwrap().quote() })
3097 }),
3098 );
3099 if let Some(owner) = opts.owner {
3100 query = query.arg("owner", owner);
3101 }
3102 if let Some(expand) = opts.expand {
3103 query = query.arg("expand", expand);
3104 }
3105 Container {
3106 proc: self.proc.clone(),
3107 selection: query,
3108 graphql_client: self.graphql_client.clone(),
3109 }
3110 }
3111 pub fn with_mounted_secret(
3119 &self,
3120 path: impl Into<String>,
3121 source: impl IntoID<SecretId>,
3122 ) -> Container {
3123 let mut query = self.selection.select("withMountedSecret");
3124 query = query.arg("path", path.into());
3125 query = query.arg_lazy(
3126 "source",
3127 Box::new(move || {
3128 let source = source.clone();
3129 Box::pin(async move { source.into_id().await.unwrap().quote() })
3130 }),
3131 );
3132 Container {
3133 proc: self.proc.clone(),
3134 selection: query,
3135 graphql_client: self.graphql_client.clone(),
3136 }
3137 }
3138 pub fn with_mounted_secret_opts<'a>(
3146 &self,
3147 path: impl Into<String>,
3148 source: impl IntoID<SecretId>,
3149 opts: ContainerWithMountedSecretOpts<'a>,
3150 ) -> Container {
3151 let mut query = self.selection.select("withMountedSecret");
3152 query = query.arg("path", path.into());
3153 query = query.arg_lazy(
3154 "source",
3155 Box::new(move || {
3156 let source = source.clone();
3157 Box::pin(async move { source.into_id().await.unwrap().quote() })
3158 }),
3159 );
3160 if let Some(owner) = opts.owner {
3161 query = query.arg("owner", owner);
3162 }
3163 if let Some(mode) = opts.mode {
3164 query = query.arg("mode", mode);
3165 }
3166 if let Some(expand) = opts.expand {
3167 query = query.arg("expand", expand);
3168 }
3169 Container {
3170 proc: self.proc.clone(),
3171 selection: query,
3172 graphql_client: self.graphql_client.clone(),
3173 }
3174 }
3175 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3182 let mut query = self.selection.select("withMountedTemp");
3183 query = query.arg("path", path.into());
3184 Container {
3185 proc: self.proc.clone(),
3186 selection: query,
3187 graphql_client: self.graphql_client.clone(),
3188 }
3189 }
3190 pub fn with_mounted_temp_opts(
3197 &self,
3198 path: impl Into<String>,
3199 opts: ContainerWithMountedTempOpts,
3200 ) -> Container {
3201 let mut query = self.selection.select("withMountedTemp");
3202 query = query.arg("path", path.into());
3203 if let Some(size) = opts.size {
3204 query = query.arg("size", size);
3205 }
3206 if let Some(expand) = opts.expand {
3207 query = query.arg("expand", expand);
3208 }
3209 Container {
3210 proc: self.proc.clone(),
3211 selection: query,
3212 graphql_client: self.graphql_client.clone(),
3213 }
3214 }
3215 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3223 let mut query = self.selection.select("withNewFile");
3224 query = query.arg("path", path.into());
3225 query = query.arg("contents", contents.into());
3226 Container {
3227 proc: self.proc.clone(),
3228 selection: query,
3229 graphql_client: self.graphql_client.clone(),
3230 }
3231 }
3232 pub fn with_new_file_opts<'a>(
3240 &self,
3241 path: impl Into<String>,
3242 contents: impl Into<String>,
3243 opts: ContainerWithNewFileOpts<'a>,
3244 ) -> Container {
3245 let mut query = self.selection.select("withNewFile");
3246 query = query.arg("path", path.into());
3247 query = query.arg("contents", contents.into());
3248 if let Some(permissions) = opts.permissions {
3249 query = query.arg("permissions", permissions);
3250 }
3251 if let Some(owner) = opts.owner {
3252 query = query.arg("owner", owner);
3253 }
3254 if let Some(expand) = opts.expand {
3255 query = query.arg("expand", expand);
3256 }
3257 Container {
3258 proc: self.proc.clone(),
3259 selection: query,
3260 graphql_client: self.graphql_client.clone(),
3261 }
3262 }
3263 pub fn with_registry_auth(
3273 &self,
3274 address: impl Into<String>,
3275 username: impl Into<String>,
3276 secret: impl IntoID<SecretId>,
3277 ) -> Container {
3278 let mut query = self.selection.select("withRegistryAuth");
3279 query = query.arg("address", address.into());
3280 query = query.arg("username", username.into());
3281 query = query.arg_lazy(
3282 "secret",
3283 Box::new(move || {
3284 let secret = secret.clone();
3285 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3286 }),
3287 );
3288 Container {
3289 proc: self.proc.clone(),
3290 selection: query,
3291 graphql_client: self.graphql_client.clone(),
3292 }
3293 }
3294 pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
3300 let mut query = self.selection.select("withRootfs");
3301 query = query.arg_lazy(
3302 "directory",
3303 Box::new(move || {
3304 let directory = directory.clone();
3305 Box::pin(async move { directory.into_id().await.unwrap().quote() })
3306 }),
3307 );
3308 Container {
3309 proc: self.proc.clone(),
3310 selection: query,
3311 graphql_client: self.graphql_client.clone(),
3312 }
3313 }
3314 pub fn with_secret_variable(
3321 &self,
3322 name: impl Into<String>,
3323 secret: impl IntoID<SecretId>,
3324 ) -> Container {
3325 let mut query = self.selection.select("withSecretVariable");
3326 query = query.arg("name", name.into());
3327 query = query.arg_lazy(
3328 "secret",
3329 Box::new(move || {
3330 let secret = secret.clone();
3331 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3332 }),
3333 );
3334 Container {
3335 proc: self.proc.clone(),
3336 selection: query,
3337 graphql_client: self.graphql_client.clone(),
3338 }
3339 }
3340 pub fn with_service_binding(
3350 &self,
3351 alias: impl Into<String>,
3352 service: impl IntoID<ServiceId>,
3353 ) -> Container {
3354 let mut query = self.selection.select("withServiceBinding");
3355 query = query.arg("alias", alias.into());
3356 query = query.arg_lazy(
3357 "service",
3358 Box::new(move || {
3359 let service = service.clone();
3360 Box::pin(async move { service.into_id().await.unwrap().quote() })
3361 }),
3362 );
3363 Container {
3364 proc: self.proc.clone(),
3365 selection: query,
3366 graphql_client: self.graphql_client.clone(),
3367 }
3368 }
3369 pub fn with_unix_socket(
3377 &self,
3378 path: impl Into<String>,
3379 source: impl IntoID<SocketId>,
3380 ) -> Container {
3381 let mut query = self.selection.select("withUnixSocket");
3382 query = query.arg("path", path.into());
3383 query = query.arg_lazy(
3384 "source",
3385 Box::new(move || {
3386 let source = source.clone();
3387 Box::pin(async move { source.into_id().await.unwrap().quote() })
3388 }),
3389 );
3390 Container {
3391 proc: self.proc.clone(),
3392 selection: query,
3393 graphql_client: self.graphql_client.clone(),
3394 }
3395 }
3396 pub fn with_unix_socket_opts<'a>(
3404 &self,
3405 path: impl Into<String>,
3406 source: impl IntoID<SocketId>,
3407 opts: ContainerWithUnixSocketOpts<'a>,
3408 ) -> Container {
3409 let mut query = self.selection.select("withUnixSocket");
3410 query = query.arg("path", path.into());
3411 query = query.arg_lazy(
3412 "source",
3413 Box::new(move || {
3414 let source = source.clone();
3415 Box::pin(async move { source.into_id().await.unwrap().quote() })
3416 }),
3417 );
3418 if let Some(owner) = opts.owner {
3419 query = query.arg("owner", owner);
3420 }
3421 if let Some(expand) = opts.expand {
3422 query = query.arg("expand", expand);
3423 }
3424 Container {
3425 proc: self.proc.clone(),
3426 selection: query,
3427 graphql_client: self.graphql_client.clone(),
3428 }
3429 }
3430 pub fn with_user(&self, name: impl Into<String>) -> Container {
3436 let mut query = self.selection.select("withUser");
3437 query = query.arg("name", name.into());
3438 Container {
3439 proc: self.proc.clone(),
3440 selection: query,
3441 graphql_client: self.graphql_client.clone(),
3442 }
3443 }
3444 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3451 let mut query = self.selection.select("withWorkdir");
3452 query = query.arg("path", path.into());
3453 Container {
3454 proc: self.proc.clone(),
3455 selection: query,
3456 graphql_client: self.graphql_client.clone(),
3457 }
3458 }
3459 pub fn with_workdir_opts(
3466 &self,
3467 path: impl Into<String>,
3468 opts: ContainerWithWorkdirOpts,
3469 ) -> Container {
3470 let mut query = self.selection.select("withWorkdir");
3471 query = query.arg("path", path.into());
3472 if let Some(expand) = opts.expand {
3473 query = query.arg("expand", expand);
3474 }
3475 Container {
3476 proc: self.proc.clone(),
3477 selection: query,
3478 graphql_client: self.graphql_client.clone(),
3479 }
3480 }
3481 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3487 let mut query = self.selection.select("withoutAnnotation");
3488 query = query.arg("name", name.into());
3489 Container {
3490 proc: self.proc.clone(),
3491 selection: query,
3492 graphql_client: self.graphql_client.clone(),
3493 }
3494 }
3495 pub fn without_default_args(&self) -> Container {
3497 let query = self.selection.select("withoutDefaultArgs");
3498 Container {
3499 proc: self.proc.clone(),
3500 selection: query,
3501 graphql_client: self.graphql_client.clone(),
3502 }
3503 }
3504 pub fn without_directory(&self, path: impl Into<String>) -> Container {
3511 let mut query = self.selection.select("withoutDirectory");
3512 query = query.arg("path", path.into());
3513 Container {
3514 proc: self.proc.clone(),
3515 selection: query,
3516 graphql_client: self.graphql_client.clone(),
3517 }
3518 }
3519 pub fn without_directory_opts(
3526 &self,
3527 path: impl Into<String>,
3528 opts: ContainerWithoutDirectoryOpts,
3529 ) -> Container {
3530 let mut query = self.selection.select("withoutDirectory");
3531 query = query.arg("path", path.into());
3532 if let Some(expand) = opts.expand {
3533 query = query.arg("expand", expand);
3534 }
3535 Container {
3536 proc: self.proc.clone(),
3537 selection: query,
3538 graphql_client: self.graphql_client.clone(),
3539 }
3540 }
3541 pub fn without_entrypoint(&self) -> Container {
3547 let query = self.selection.select("withoutEntrypoint");
3548 Container {
3549 proc: self.proc.clone(),
3550 selection: query,
3551 graphql_client: self.graphql_client.clone(),
3552 }
3553 }
3554 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
3560 let mut query = self.selection.select("withoutEntrypoint");
3561 if let Some(keep_default_args) = opts.keep_default_args {
3562 query = query.arg("keepDefaultArgs", keep_default_args);
3563 }
3564 Container {
3565 proc: self.proc.clone(),
3566 selection: query,
3567 graphql_client: self.graphql_client.clone(),
3568 }
3569 }
3570 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
3576 let mut query = self.selection.select("withoutEnvVariable");
3577 query = query.arg("name", name.into());
3578 Container {
3579 proc: self.proc.clone(),
3580 selection: query,
3581 graphql_client: self.graphql_client.clone(),
3582 }
3583 }
3584 pub fn without_exposed_port(&self, port: isize) -> Container {
3591 let mut query = self.selection.select("withoutExposedPort");
3592 query = query.arg("port", port);
3593 Container {
3594 proc: self.proc.clone(),
3595 selection: query,
3596 graphql_client: self.graphql_client.clone(),
3597 }
3598 }
3599 pub fn without_exposed_port_opts(
3606 &self,
3607 port: isize,
3608 opts: ContainerWithoutExposedPortOpts,
3609 ) -> Container {
3610 let mut query = self.selection.select("withoutExposedPort");
3611 query = query.arg("port", port);
3612 if let Some(protocol) = opts.protocol {
3613 query = query.arg("protocol", protocol);
3614 }
3615 Container {
3616 proc: self.proc.clone(),
3617 selection: query,
3618 graphql_client: self.graphql_client.clone(),
3619 }
3620 }
3621 pub fn without_file(&self, path: impl Into<String>) -> Container {
3628 let mut query = self.selection.select("withoutFile");
3629 query = query.arg("path", path.into());
3630 Container {
3631 proc: self.proc.clone(),
3632 selection: query,
3633 graphql_client: self.graphql_client.clone(),
3634 }
3635 }
3636 pub fn without_file_opts(
3643 &self,
3644 path: impl Into<String>,
3645 opts: ContainerWithoutFileOpts,
3646 ) -> Container {
3647 let mut query = self.selection.select("withoutFile");
3648 query = query.arg("path", path.into());
3649 if let Some(expand) = opts.expand {
3650 query = query.arg("expand", expand);
3651 }
3652 Container {
3653 proc: self.proc.clone(),
3654 selection: query,
3655 graphql_client: self.graphql_client.clone(),
3656 }
3657 }
3658 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
3665 let mut query = self.selection.select("withoutFiles");
3666 query = query.arg(
3667 "paths",
3668 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3669 );
3670 Container {
3671 proc: self.proc.clone(),
3672 selection: query,
3673 graphql_client: self.graphql_client.clone(),
3674 }
3675 }
3676 pub fn without_files_opts(
3683 &self,
3684 paths: Vec<impl Into<String>>,
3685 opts: ContainerWithoutFilesOpts,
3686 ) -> Container {
3687 let mut query = self.selection.select("withoutFiles");
3688 query = query.arg(
3689 "paths",
3690 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3691 );
3692 if let Some(expand) = opts.expand {
3693 query = query.arg("expand", expand);
3694 }
3695 Container {
3696 proc: self.proc.clone(),
3697 selection: query,
3698 graphql_client: self.graphql_client.clone(),
3699 }
3700 }
3701 pub fn without_label(&self, name: impl Into<String>) -> Container {
3707 let mut query = self.selection.select("withoutLabel");
3708 query = query.arg("name", name.into());
3709 Container {
3710 proc: self.proc.clone(),
3711 selection: query,
3712 graphql_client: self.graphql_client.clone(),
3713 }
3714 }
3715 pub fn without_mount(&self, path: impl Into<String>) -> Container {
3722 let mut query = self.selection.select("withoutMount");
3723 query = query.arg("path", path.into());
3724 Container {
3725 proc: self.proc.clone(),
3726 selection: query,
3727 graphql_client: self.graphql_client.clone(),
3728 }
3729 }
3730 pub fn without_mount_opts(
3737 &self,
3738 path: impl Into<String>,
3739 opts: ContainerWithoutMountOpts,
3740 ) -> Container {
3741 let mut query = self.selection.select("withoutMount");
3742 query = query.arg("path", path.into());
3743 if let Some(expand) = opts.expand {
3744 query = query.arg("expand", expand);
3745 }
3746 Container {
3747 proc: self.proc.clone(),
3748 selection: query,
3749 graphql_client: self.graphql_client.clone(),
3750 }
3751 }
3752 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
3760 let mut query = self.selection.select("withoutRegistryAuth");
3761 query = query.arg("address", address.into());
3762 Container {
3763 proc: self.proc.clone(),
3764 selection: query,
3765 graphql_client: self.graphql_client.clone(),
3766 }
3767 }
3768 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
3774 let mut query = self.selection.select("withoutSecretVariable");
3775 query = query.arg("name", name.into());
3776 Container {
3777 proc: self.proc.clone(),
3778 selection: query,
3779 graphql_client: self.graphql_client.clone(),
3780 }
3781 }
3782 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
3789 let mut query = self.selection.select("withoutUnixSocket");
3790 query = query.arg("path", path.into());
3791 Container {
3792 proc: self.proc.clone(),
3793 selection: query,
3794 graphql_client: self.graphql_client.clone(),
3795 }
3796 }
3797 pub fn without_unix_socket_opts(
3804 &self,
3805 path: impl Into<String>,
3806 opts: ContainerWithoutUnixSocketOpts,
3807 ) -> Container {
3808 let mut query = self.selection.select("withoutUnixSocket");
3809 query = query.arg("path", path.into());
3810 if let Some(expand) = opts.expand {
3811 query = query.arg("expand", expand);
3812 }
3813 Container {
3814 proc: self.proc.clone(),
3815 selection: query,
3816 graphql_client: self.graphql_client.clone(),
3817 }
3818 }
3819 pub fn without_user(&self) -> Container {
3822 let query = self.selection.select("withoutUser");
3823 Container {
3824 proc: self.proc.clone(),
3825 selection: query,
3826 graphql_client: self.graphql_client.clone(),
3827 }
3828 }
3829 pub fn without_workdir(&self) -> Container {
3832 let query = self.selection.select("withoutWorkdir");
3833 Container {
3834 proc: self.proc.clone(),
3835 selection: query,
3836 graphql_client: self.graphql_client.clone(),
3837 }
3838 }
3839 pub async fn workdir(&self) -> Result<String, DaggerError> {
3841 let query = self.selection.select("workdir");
3842 query.execute(self.graphql_client.clone()).await
3843 }
3844}
3845#[derive(Clone)]
3846pub struct CurrentModule {
3847 pub proc: Option<Arc<DaggerSessionProc>>,
3848 pub selection: Selection,
3849 pub graphql_client: DynGraphQLClient,
3850}
3851#[derive(Builder, Debug, PartialEq)]
3852pub struct CurrentModuleWorkdirOpts<'a> {
3853 #[builder(setter(into, strip_option), default)]
3855 pub exclude: Option<Vec<&'a str>>,
3856 #[builder(setter(into, strip_option), default)]
3858 pub include: Option<Vec<&'a str>>,
3859}
3860impl CurrentModule {
3861 pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
3863 let query = self.selection.select("id");
3864 query.execute(self.graphql_client.clone()).await
3865 }
3866 pub async fn name(&self) -> Result<String, DaggerError> {
3868 let query = self.selection.select("name");
3869 query.execute(self.graphql_client.clone()).await
3870 }
3871 pub fn source(&self) -> Directory {
3873 let query = self.selection.select("source");
3874 Directory {
3875 proc: self.proc.clone(),
3876 selection: query,
3877 graphql_client: self.graphql_client.clone(),
3878 }
3879 }
3880 pub fn workdir(&self, path: impl Into<String>) -> Directory {
3887 let mut query = self.selection.select("workdir");
3888 query = query.arg("path", path.into());
3889 Directory {
3890 proc: self.proc.clone(),
3891 selection: query,
3892 graphql_client: self.graphql_client.clone(),
3893 }
3894 }
3895 pub fn workdir_opts<'a>(
3902 &self,
3903 path: impl Into<String>,
3904 opts: CurrentModuleWorkdirOpts<'a>,
3905 ) -> Directory {
3906 let mut query = self.selection.select("workdir");
3907 query = query.arg("path", path.into());
3908 if let Some(exclude) = opts.exclude {
3909 query = query.arg("exclude", exclude);
3910 }
3911 if let Some(include) = opts.include {
3912 query = query.arg("include", include);
3913 }
3914 Directory {
3915 proc: self.proc.clone(),
3916 selection: query,
3917 graphql_client: self.graphql_client.clone(),
3918 }
3919 }
3920 pub fn workdir_file(&self, path: impl Into<String>) -> File {
3926 let mut query = self.selection.select("workdirFile");
3927 query = query.arg("path", path.into());
3928 File {
3929 proc: self.proc.clone(),
3930 selection: query,
3931 graphql_client: self.graphql_client.clone(),
3932 }
3933 }
3934}
3935#[derive(Clone)]
3936pub struct Directory {
3937 pub proc: Option<Arc<DaggerSessionProc>>,
3938 pub selection: Selection,
3939 pub graphql_client: DynGraphQLClient,
3940}
3941#[derive(Builder, Debug, PartialEq)]
3942pub struct DirectoryAsModuleOpts<'a> {
3943 #[builder(setter(into, strip_option), default)]
3946 pub source_root_path: Option<&'a str>,
3947}
3948#[derive(Builder, Debug, PartialEq)]
3949pub struct DirectoryAsModuleSourceOpts<'a> {
3950 #[builder(setter(into, strip_option), default)]
3953 pub source_root_path: Option<&'a str>,
3954}
3955#[derive(Builder, Debug, PartialEq)]
3956pub struct DirectoryDockerBuildOpts<'a> {
3957 #[builder(setter(into, strip_option), default)]
3959 pub build_args: Option<Vec<BuildArg>>,
3960 #[builder(setter(into, strip_option), default)]
3962 pub dockerfile: Option<&'a str>,
3963 #[builder(setter(into, strip_option), default)]
3965 pub platform: Option<Platform>,
3966 #[builder(setter(into, strip_option), default)]
3969 pub secrets: Option<Vec<SecretId>>,
3970 #[builder(setter(into, strip_option), default)]
3972 pub target: Option<&'a str>,
3973}
3974#[derive(Builder, Debug, PartialEq)]
3975pub struct DirectoryEntriesOpts<'a> {
3976 #[builder(setter(into, strip_option), default)]
3978 pub path: Option<&'a str>,
3979}
3980#[derive(Builder, Debug, PartialEq)]
3981pub struct DirectoryExportOpts {
3982 #[builder(setter(into, strip_option), default)]
3984 pub wipe: Option<bool>,
3985}
3986#[derive(Builder, Debug, PartialEq)]
3987pub struct DirectoryTerminalOpts<'a> {
3988 #[builder(setter(into, strip_option), default)]
3990 pub cmd: Option<Vec<&'a str>>,
3991 #[builder(setter(into, strip_option), default)]
3993 pub container: Option<ContainerId>,
3994 #[builder(setter(into, strip_option), default)]
3997 pub experimental_privileged_nesting: Option<bool>,
3998 #[builder(setter(into, strip_option), default)]
4000 pub insecure_root_capabilities: Option<bool>,
4001}
4002#[derive(Builder, Debug, PartialEq)]
4003pub struct DirectoryWithDirectoryOpts<'a> {
4004 #[builder(setter(into, strip_option), default)]
4006 pub exclude: Option<Vec<&'a str>>,
4007 #[builder(setter(into, strip_option), default)]
4009 pub include: Option<Vec<&'a str>>,
4010}
4011#[derive(Builder, Debug, PartialEq)]
4012pub struct DirectoryWithFileOpts {
4013 #[builder(setter(into, strip_option), default)]
4015 pub permissions: Option<isize>,
4016}
4017#[derive(Builder, Debug, PartialEq)]
4018pub struct DirectoryWithFilesOpts {
4019 #[builder(setter(into, strip_option), default)]
4021 pub permissions: Option<isize>,
4022}
4023#[derive(Builder, Debug, PartialEq)]
4024pub struct DirectoryWithNewDirectoryOpts {
4025 #[builder(setter(into, strip_option), default)]
4027 pub permissions: Option<isize>,
4028}
4029#[derive(Builder, Debug, PartialEq)]
4030pub struct DirectoryWithNewFileOpts {
4031 #[builder(setter(into, strip_option), default)]
4033 pub permissions: Option<isize>,
4034}
4035impl Directory {
4036 pub fn as_git(&self) -> GitRepository {
4038 let query = self.selection.select("asGit");
4039 GitRepository {
4040 proc: self.proc.clone(),
4041 selection: query,
4042 graphql_client: self.graphql_client.clone(),
4043 }
4044 }
4045 pub fn as_module(&self) -> Module {
4051 let query = self.selection.select("asModule");
4052 Module {
4053 proc: self.proc.clone(),
4054 selection: query,
4055 graphql_client: self.graphql_client.clone(),
4056 }
4057 }
4058 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4064 let mut query = self.selection.select("asModule");
4065 if let Some(source_root_path) = opts.source_root_path {
4066 query = query.arg("sourceRootPath", source_root_path);
4067 }
4068 Module {
4069 proc: self.proc.clone(),
4070 selection: query,
4071 graphql_client: self.graphql_client.clone(),
4072 }
4073 }
4074 pub fn as_module_source(&self) -> ModuleSource {
4080 let query = self.selection.select("asModuleSource");
4081 ModuleSource {
4082 proc: self.proc.clone(),
4083 selection: query,
4084 graphql_client: self.graphql_client.clone(),
4085 }
4086 }
4087 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4093 let mut query = self.selection.select("asModuleSource");
4094 if let Some(source_root_path) = opts.source_root_path {
4095 query = query.arg("sourceRootPath", source_root_path);
4096 }
4097 ModuleSource {
4098 proc: self.proc.clone(),
4099 selection: query,
4100 graphql_client: self.graphql_client.clone(),
4101 }
4102 }
4103 pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
4109 let mut query = self.selection.select("diff");
4110 query = query.arg_lazy(
4111 "other",
4112 Box::new(move || {
4113 let other = other.clone();
4114 Box::pin(async move { other.into_id().await.unwrap().quote() })
4115 }),
4116 );
4117 Directory {
4118 proc: self.proc.clone(),
4119 selection: query,
4120 graphql_client: self.graphql_client.clone(),
4121 }
4122 }
4123 pub async fn digest(&self) -> Result<String, DaggerError> {
4125 let query = self.selection.select("digest");
4126 query.execute(self.graphql_client.clone()).await
4127 }
4128 pub fn directory(&self, path: impl Into<String>) -> Directory {
4134 let mut query = self.selection.select("directory");
4135 query = query.arg("path", path.into());
4136 Directory {
4137 proc: self.proc.clone(),
4138 selection: query,
4139 graphql_client: self.graphql_client.clone(),
4140 }
4141 }
4142 pub fn docker_build(&self) -> Container {
4148 let query = self.selection.select("dockerBuild");
4149 Container {
4150 proc: self.proc.clone(),
4151 selection: query,
4152 graphql_client: self.graphql_client.clone(),
4153 }
4154 }
4155 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
4161 let mut query = self.selection.select("dockerBuild");
4162 if let Some(platform) = opts.platform {
4163 query = query.arg("platform", platform);
4164 }
4165 if let Some(dockerfile) = opts.dockerfile {
4166 query = query.arg("dockerfile", dockerfile);
4167 }
4168 if let Some(target) = opts.target {
4169 query = query.arg("target", target);
4170 }
4171 if let Some(build_args) = opts.build_args {
4172 query = query.arg("buildArgs", build_args);
4173 }
4174 if let Some(secrets) = opts.secrets {
4175 query = query.arg("secrets", secrets);
4176 }
4177 Container {
4178 proc: self.proc.clone(),
4179 selection: query,
4180 graphql_client: self.graphql_client.clone(),
4181 }
4182 }
4183 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
4189 let query = self.selection.select("entries");
4190 query.execute(self.graphql_client.clone()).await
4191 }
4192 pub async fn entries_opts<'a>(
4198 &self,
4199 opts: DirectoryEntriesOpts<'a>,
4200 ) -> Result<Vec<String>, DaggerError> {
4201 let mut query = self.selection.select("entries");
4202 if let Some(path) = opts.path {
4203 query = query.arg("path", path);
4204 }
4205 query.execute(self.graphql_client.clone()).await
4206 }
4207 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4214 let mut query = self.selection.select("export");
4215 query = query.arg("path", path.into());
4216 query.execute(self.graphql_client.clone()).await
4217 }
4218 pub async fn export_opts(
4225 &self,
4226 path: impl Into<String>,
4227 opts: DirectoryExportOpts,
4228 ) -> Result<String, DaggerError> {
4229 let mut query = self.selection.select("export");
4230 query = query.arg("path", path.into());
4231 if let Some(wipe) = opts.wipe {
4232 query = query.arg("wipe", wipe);
4233 }
4234 query.execute(self.graphql_client.clone()).await
4235 }
4236 pub fn file(&self, path: impl Into<String>) -> File {
4242 let mut query = self.selection.select("file");
4243 query = query.arg("path", path.into());
4244 File {
4245 proc: self.proc.clone(),
4246 selection: query,
4247 graphql_client: self.graphql_client.clone(),
4248 }
4249 }
4250 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
4256 let mut query = self.selection.select("glob");
4257 query = query.arg("pattern", pattern.into());
4258 query.execute(self.graphql_client.clone()).await
4259 }
4260 pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
4262 let query = self.selection.select("id");
4263 query.execute(self.graphql_client.clone()).await
4264 }
4265 pub async fn name(&self) -> Result<String, DaggerError> {
4267 let query = self.selection.select("name");
4268 query.execute(self.graphql_client.clone()).await
4269 }
4270 pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
4272 let query = self.selection.select("sync");
4273 query.execute(self.graphql_client.clone()).await
4274 }
4275 pub fn terminal(&self) -> Directory {
4281 let query = self.selection.select("terminal");
4282 Directory {
4283 proc: self.proc.clone(),
4284 selection: query,
4285 graphql_client: self.graphql_client.clone(),
4286 }
4287 }
4288 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
4294 let mut query = self.selection.select("terminal");
4295 if let Some(cmd) = opts.cmd {
4296 query = query.arg("cmd", cmd);
4297 }
4298 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4299 query = query.arg(
4300 "experimentalPrivilegedNesting",
4301 experimental_privileged_nesting,
4302 );
4303 }
4304 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4305 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4306 }
4307 if let Some(container) = opts.container {
4308 query = query.arg("container", container);
4309 }
4310 Directory {
4311 proc: self.proc.clone(),
4312 selection: query,
4313 graphql_client: self.graphql_client.clone(),
4314 }
4315 }
4316 pub fn with_directory(
4324 &self,
4325 path: impl Into<String>,
4326 directory: impl IntoID<DirectoryId>,
4327 ) -> Directory {
4328 let mut query = self.selection.select("withDirectory");
4329 query = query.arg("path", path.into());
4330 query = query.arg_lazy(
4331 "directory",
4332 Box::new(move || {
4333 let directory = directory.clone();
4334 Box::pin(async move { directory.into_id().await.unwrap().quote() })
4335 }),
4336 );
4337 Directory {
4338 proc: self.proc.clone(),
4339 selection: query,
4340 graphql_client: self.graphql_client.clone(),
4341 }
4342 }
4343 pub fn with_directory_opts<'a>(
4351 &self,
4352 path: impl Into<String>,
4353 directory: impl IntoID<DirectoryId>,
4354 opts: DirectoryWithDirectoryOpts<'a>,
4355 ) -> Directory {
4356 let mut query = self.selection.select("withDirectory");
4357 query = query.arg("path", path.into());
4358 query = query.arg_lazy(
4359 "directory",
4360 Box::new(move || {
4361 let directory = directory.clone();
4362 Box::pin(async move { directory.into_id().await.unwrap().quote() })
4363 }),
4364 );
4365 if let Some(exclude) = opts.exclude {
4366 query = query.arg("exclude", exclude);
4367 }
4368 if let Some(include) = opts.include {
4369 query = query.arg("include", include);
4370 }
4371 Directory {
4372 proc: self.proc.clone(),
4373 selection: query,
4374 graphql_client: self.graphql_client.clone(),
4375 }
4376 }
4377 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
4385 let mut query = self.selection.select("withFile");
4386 query = query.arg("path", path.into());
4387 query = query.arg_lazy(
4388 "source",
4389 Box::new(move || {
4390 let source = source.clone();
4391 Box::pin(async move { source.into_id().await.unwrap().quote() })
4392 }),
4393 );
4394 Directory {
4395 proc: self.proc.clone(),
4396 selection: query,
4397 graphql_client: self.graphql_client.clone(),
4398 }
4399 }
4400 pub fn with_file_opts(
4408 &self,
4409 path: impl Into<String>,
4410 source: impl IntoID<FileId>,
4411 opts: DirectoryWithFileOpts,
4412 ) -> Directory {
4413 let mut query = self.selection.select("withFile");
4414 query = query.arg("path", path.into());
4415 query = query.arg_lazy(
4416 "source",
4417 Box::new(move || {
4418 let source = source.clone();
4419 Box::pin(async move { source.into_id().await.unwrap().quote() })
4420 }),
4421 );
4422 if let Some(permissions) = opts.permissions {
4423 query = query.arg("permissions", permissions);
4424 }
4425 Directory {
4426 proc: self.proc.clone(),
4427 selection: query,
4428 graphql_client: self.graphql_client.clone(),
4429 }
4430 }
4431 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
4439 let mut query = self.selection.select("withFiles");
4440 query = query.arg("path", path.into());
4441 query = query.arg("sources", sources);
4442 Directory {
4443 proc: self.proc.clone(),
4444 selection: query,
4445 graphql_client: self.graphql_client.clone(),
4446 }
4447 }
4448 pub fn with_files_opts(
4456 &self,
4457 path: impl Into<String>,
4458 sources: Vec<FileId>,
4459 opts: DirectoryWithFilesOpts,
4460 ) -> Directory {
4461 let mut query = self.selection.select("withFiles");
4462 query = query.arg("path", path.into());
4463 query = query.arg("sources", sources);
4464 if let Some(permissions) = opts.permissions {
4465 query = query.arg("permissions", permissions);
4466 }
4467 Directory {
4468 proc: self.proc.clone(),
4469 selection: query,
4470 graphql_client: self.graphql_client.clone(),
4471 }
4472 }
4473 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
4480 let mut query = self.selection.select("withNewDirectory");
4481 query = query.arg("path", path.into());
4482 Directory {
4483 proc: self.proc.clone(),
4484 selection: query,
4485 graphql_client: self.graphql_client.clone(),
4486 }
4487 }
4488 pub fn with_new_directory_opts(
4495 &self,
4496 path: impl Into<String>,
4497 opts: DirectoryWithNewDirectoryOpts,
4498 ) -> Directory {
4499 let mut query = self.selection.select("withNewDirectory");
4500 query = query.arg("path", path.into());
4501 if let Some(permissions) = opts.permissions {
4502 query = query.arg("permissions", permissions);
4503 }
4504 Directory {
4505 proc: self.proc.clone(),
4506 selection: query,
4507 graphql_client: self.graphql_client.clone(),
4508 }
4509 }
4510 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
4518 let mut query = self.selection.select("withNewFile");
4519 query = query.arg("path", path.into());
4520 query = query.arg("contents", contents.into());
4521 Directory {
4522 proc: self.proc.clone(),
4523 selection: query,
4524 graphql_client: self.graphql_client.clone(),
4525 }
4526 }
4527 pub fn with_new_file_opts(
4535 &self,
4536 path: impl Into<String>,
4537 contents: impl Into<String>,
4538 opts: DirectoryWithNewFileOpts,
4539 ) -> Directory {
4540 let mut query = self.selection.select("withNewFile");
4541 query = query.arg("path", path.into());
4542 query = query.arg("contents", contents.into());
4543 if let Some(permissions) = opts.permissions {
4544 query = query.arg("permissions", permissions);
4545 }
4546 Directory {
4547 proc: self.proc.clone(),
4548 selection: query,
4549 graphql_client: self.graphql_client.clone(),
4550 }
4551 }
4552 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
4560 let mut query = self.selection.select("withTimestamps");
4561 query = query.arg("timestamp", timestamp);
4562 Directory {
4563 proc: self.proc.clone(),
4564 selection: query,
4565 graphql_client: self.graphql_client.clone(),
4566 }
4567 }
4568 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
4574 let mut query = self.selection.select("withoutDirectory");
4575 query = query.arg("path", path.into());
4576 Directory {
4577 proc: self.proc.clone(),
4578 selection: query,
4579 graphql_client: self.graphql_client.clone(),
4580 }
4581 }
4582 pub fn without_file(&self, path: impl Into<String>) -> Directory {
4588 let mut query = self.selection.select("withoutFile");
4589 query = query.arg("path", path.into());
4590 Directory {
4591 proc: self.proc.clone(),
4592 selection: query,
4593 graphql_client: self.graphql_client.clone(),
4594 }
4595 }
4596 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
4602 let mut query = self.selection.select("withoutFiles");
4603 query = query.arg(
4604 "paths",
4605 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4606 );
4607 Directory {
4608 proc: self.proc.clone(),
4609 selection: query,
4610 graphql_client: self.graphql_client.clone(),
4611 }
4612 }
4613}
4614#[derive(Clone)]
4615pub struct Engine {
4616 pub proc: Option<Arc<DaggerSessionProc>>,
4617 pub selection: Selection,
4618 pub graphql_client: DynGraphQLClient,
4619}
4620impl Engine {
4621 pub async fn id(&self) -> Result<EngineId, DaggerError> {
4623 let query = self.selection.select("id");
4624 query.execute(self.graphql_client.clone()).await
4625 }
4626 pub fn local_cache(&self) -> EngineCache {
4628 let query = self.selection.select("localCache");
4629 EngineCache {
4630 proc: self.proc.clone(),
4631 selection: query,
4632 graphql_client: self.graphql_client.clone(),
4633 }
4634 }
4635}
4636#[derive(Clone)]
4637pub struct EngineCache {
4638 pub proc: Option<Arc<DaggerSessionProc>>,
4639 pub selection: Selection,
4640 pub graphql_client: DynGraphQLClient,
4641}
4642#[derive(Builder, Debug, PartialEq)]
4643pub struct EngineCacheEntrySetOpts<'a> {
4644 #[builder(setter(into, strip_option), default)]
4645 pub key: Option<&'a str>,
4646}
4647impl EngineCache {
4648 pub fn entry_set(&self) -> EngineCacheEntrySet {
4654 let query = self.selection.select("entrySet");
4655 EngineCacheEntrySet {
4656 proc: self.proc.clone(),
4657 selection: query,
4658 graphql_client: self.graphql_client.clone(),
4659 }
4660 }
4661 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
4667 let mut query = self.selection.select("entrySet");
4668 if let Some(key) = opts.key {
4669 query = query.arg("key", key);
4670 }
4671 EngineCacheEntrySet {
4672 proc: self.proc.clone(),
4673 selection: query,
4674 graphql_client: self.graphql_client.clone(),
4675 }
4676 }
4677 pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
4679 let query = self.selection.select("id");
4680 query.execute(self.graphql_client.clone()).await
4681 }
4682 pub async fn keep_bytes(&self) -> Result<isize, DaggerError> {
4684 let query = self.selection.select("keepBytes");
4685 query.execute(self.graphql_client.clone()).await
4686 }
4687 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
4689 let query = self.selection.select("maxUsedSpace");
4690 query.execute(self.graphql_client.clone()).await
4691 }
4692 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
4694 let query = self.selection.select("minFreeSpace");
4695 query.execute(self.graphql_client.clone()).await
4696 }
4697 pub async fn prune(&self) -> Result<Void, DaggerError> {
4699 let query = self.selection.select("prune");
4700 query.execute(self.graphql_client.clone()).await
4701 }
4702 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
4703 let query = self.selection.select("reservedSpace");
4704 query.execute(self.graphql_client.clone()).await
4705 }
4706}
4707#[derive(Clone)]
4708pub struct EngineCacheEntry {
4709 pub proc: Option<Arc<DaggerSessionProc>>,
4710 pub selection: Selection,
4711 pub graphql_client: DynGraphQLClient,
4712}
4713impl EngineCacheEntry {
4714 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
4716 let query = self.selection.select("activelyUsed");
4717 query.execute(self.graphql_client.clone()).await
4718 }
4719 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
4721 let query = self.selection.select("createdTimeUnixNano");
4722 query.execute(self.graphql_client.clone()).await
4723 }
4724 pub async fn description(&self) -> Result<String, DaggerError> {
4726 let query = self.selection.select("description");
4727 query.execute(self.graphql_client.clone()).await
4728 }
4729 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
4731 let query = self.selection.select("diskSpaceBytes");
4732 query.execute(self.graphql_client.clone()).await
4733 }
4734 pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
4736 let query = self.selection.select("id");
4737 query.execute(self.graphql_client.clone()).await
4738 }
4739 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
4741 let query = self.selection.select("mostRecentUseTimeUnixNano");
4742 query.execute(self.graphql_client.clone()).await
4743 }
4744}
4745#[derive(Clone)]
4746pub struct EngineCacheEntrySet {
4747 pub proc: Option<Arc<DaggerSessionProc>>,
4748 pub selection: Selection,
4749 pub graphql_client: DynGraphQLClient,
4750}
4751impl EngineCacheEntrySet {
4752 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
4754 let query = self.selection.select("diskSpaceBytes");
4755 query.execute(self.graphql_client.clone()).await
4756 }
4757 pub fn entries(&self) -> Vec<EngineCacheEntry> {
4759 let query = self.selection.select("entries");
4760 vec![EngineCacheEntry {
4761 proc: self.proc.clone(),
4762 selection: query,
4763 graphql_client: self.graphql_client.clone(),
4764 }]
4765 }
4766 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
4768 let query = self.selection.select("entryCount");
4769 query.execute(self.graphql_client.clone()).await
4770 }
4771 pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
4773 let query = self.selection.select("id");
4774 query.execute(self.graphql_client.clone()).await
4775 }
4776}
4777#[derive(Clone)]
4778pub struct EnumTypeDef {
4779 pub proc: Option<Arc<DaggerSessionProc>>,
4780 pub selection: Selection,
4781 pub graphql_client: DynGraphQLClient,
4782}
4783impl EnumTypeDef {
4784 pub async fn description(&self) -> Result<String, DaggerError> {
4786 let query = self.selection.select("description");
4787 query.execute(self.graphql_client.clone()).await
4788 }
4789 pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
4791 let query = self.selection.select("id");
4792 query.execute(self.graphql_client.clone()).await
4793 }
4794 pub async fn name(&self) -> Result<String, DaggerError> {
4796 let query = self.selection.select("name");
4797 query.execute(self.graphql_client.clone()).await
4798 }
4799 pub fn source_map(&self) -> SourceMap {
4801 let query = self.selection.select("sourceMap");
4802 SourceMap {
4803 proc: self.proc.clone(),
4804 selection: query,
4805 graphql_client: self.graphql_client.clone(),
4806 }
4807 }
4808 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
4810 let query = self.selection.select("sourceModuleName");
4811 query.execute(self.graphql_client.clone()).await
4812 }
4813 pub fn values(&self) -> Vec<EnumValueTypeDef> {
4815 let query = self.selection.select("values");
4816 vec![EnumValueTypeDef {
4817 proc: self.proc.clone(),
4818 selection: query,
4819 graphql_client: self.graphql_client.clone(),
4820 }]
4821 }
4822}
4823#[derive(Clone)]
4824pub struct EnumValueTypeDef {
4825 pub proc: Option<Arc<DaggerSessionProc>>,
4826 pub selection: Selection,
4827 pub graphql_client: DynGraphQLClient,
4828}
4829impl EnumValueTypeDef {
4830 pub async fn description(&self) -> Result<String, DaggerError> {
4832 let query = self.selection.select("description");
4833 query.execute(self.graphql_client.clone()).await
4834 }
4835 pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
4837 let query = self.selection.select("id");
4838 query.execute(self.graphql_client.clone()).await
4839 }
4840 pub async fn name(&self) -> Result<String, DaggerError> {
4842 let query = self.selection.select("name");
4843 query.execute(self.graphql_client.clone()).await
4844 }
4845 pub fn source_map(&self) -> SourceMap {
4847 let query = self.selection.select("sourceMap");
4848 SourceMap {
4849 proc: self.proc.clone(),
4850 selection: query,
4851 graphql_client: self.graphql_client.clone(),
4852 }
4853 }
4854}
4855#[derive(Clone)]
4856pub struct EnvVariable {
4857 pub proc: Option<Arc<DaggerSessionProc>>,
4858 pub selection: Selection,
4859 pub graphql_client: DynGraphQLClient,
4860}
4861impl EnvVariable {
4862 pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
4864 let query = self.selection.select("id");
4865 query.execute(self.graphql_client.clone()).await
4866 }
4867 pub async fn name(&self) -> Result<String, DaggerError> {
4869 let query = self.selection.select("name");
4870 query.execute(self.graphql_client.clone()).await
4871 }
4872 pub async fn value(&self) -> Result<String, DaggerError> {
4874 let query = self.selection.select("value");
4875 query.execute(self.graphql_client.clone()).await
4876 }
4877}
4878#[derive(Clone)]
4879pub struct Error {
4880 pub proc: Option<Arc<DaggerSessionProc>>,
4881 pub selection: Selection,
4882 pub graphql_client: DynGraphQLClient,
4883}
4884impl Error {
4885 pub async fn id(&self) -> Result<ErrorId, DaggerError> {
4887 let query = self.selection.select("id");
4888 query.execute(self.graphql_client.clone()).await
4889 }
4890 pub async fn message(&self) -> Result<String, DaggerError> {
4892 let query = self.selection.select("message");
4893 query.execute(self.graphql_client.clone()).await
4894 }
4895}
4896#[derive(Clone)]
4897pub struct FieldTypeDef {
4898 pub proc: Option<Arc<DaggerSessionProc>>,
4899 pub selection: Selection,
4900 pub graphql_client: DynGraphQLClient,
4901}
4902impl FieldTypeDef {
4903 pub async fn description(&self) -> Result<String, DaggerError> {
4905 let query = self.selection.select("description");
4906 query.execute(self.graphql_client.clone()).await
4907 }
4908 pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
4910 let query = self.selection.select("id");
4911 query.execute(self.graphql_client.clone()).await
4912 }
4913 pub async fn name(&self) -> Result<String, DaggerError> {
4915 let query = self.selection.select("name");
4916 query.execute(self.graphql_client.clone()).await
4917 }
4918 pub fn source_map(&self) -> SourceMap {
4920 let query = self.selection.select("sourceMap");
4921 SourceMap {
4922 proc: self.proc.clone(),
4923 selection: query,
4924 graphql_client: self.graphql_client.clone(),
4925 }
4926 }
4927 pub fn type_def(&self) -> TypeDef {
4929 let query = self.selection.select("typeDef");
4930 TypeDef {
4931 proc: self.proc.clone(),
4932 selection: query,
4933 graphql_client: self.graphql_client.clone(),
4934 }
4935 }
4936}
4937#[derive(Clone)]
4938pub struct File {
4939 pub proc: Option<Arc<DaggerSessionProc>>,
4940 pub selection: Selection,
4941 pub graphql_client: DynGraphQLClient,
4942}
4943#[derive(Builder, Debug, PartialEq)]
4944pub struct FileDigestOpts {
4945 #[builder(setter(into, strip_option), default)]
4947 pub exclude_metadata: Option<bool>,
4948}
4949#[derive(Builder, Debug, PartialEq)]
4950pub struct FileExportOpts {
4951 #[builder(setter(into, strip_option), default)]
4953 pub allow_parent_dir_path: Option<bool>,
4954}
4955impl File {
4956 pub async fn contents(&self) -> Result<String, DaggerError> {
4958 let query = self.selection.select("contents");
4959 query.execute(self.graphql_client.clone()).await
4960 }
4961 pub async fn digest(&self) -> Result<String, DaggerError> {
4967 let query = self.selection.select("digest");
4968 query.execute(self.graphql_client.clone()).await
4969 }
4970 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
4976 let mut query = self.selection.select("digest");
4977 if let Some(exclude_metadata) = opts.exclude_metadata {
4978 query = query.arg("excludeMetadata", exclude_metadata);
4979 }
4980 query.execute(self.graphql_client.clone()).await
4981 }
4982 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4989 let mut query = self.selection.select("export");
4990 query = query.arg("path", path.into());
4991 query.execute(self.graphql_client.clone()).await
4992 }
4993 pub async fn export_opts(
5000 &self,
5001 path: impl Into<String>,
5002 opts: FileExportOpts,
5003 ) -> Result<String, DaggerError> {
5004 let mut query = self.selection.select("export");
5005 query = query.arg("path", path.into());
5006 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
5007 query = query.arg("allowParentDirPath", allow_parent_dir_path);
5008 }
5009 query.execute(self.graphql_client.clone()).await
5010 }
5011 pub async fn id(&self) -> Result<FileId, DaggerError> {
5013 let query = self.selection.select("id");
5014 query.execute(self.graphql_client.clone()).await
5015 }
5016 pub async fn name(&self) -> Result<String, DaggerError> {
5018 let query = self.selection.select("name");
5019 query.execute(self.graphql_client.clone()).await
5020 }
5021 pub async fn size(&self) -> Result<isize, DaggerError> {
5023 let query = self.selection.select("size");
5024 query.execute(self.graphql_client.clone()).await
5025 }
5026 pub async fn sync(&self) -> Result<FileId, DaggerError> {
5028 let query = self.selection.select("sync");
5029 query.execute(self.graphql_client.clone()).await
5030 }
5031 pub fn with_name(&self, name: impl Into<String>) -> File {
5037 let mut query = self.selection.select("withName");
5038 query = query.arg("name", name.into());
5039 File {
5040 proc: self.proc.clone(),
5041 selection: query,
5042 graphql_client: self.graphql_client.clone(),
5043 }
5044 }
5045 pub fn with_timestamps(&self, timestamp: isize) -> File {
5053 let mut query = self.selection.select("withTimestamps");
5054 query = query.arg("timestamp", timestamp);
5055 File {
5056 proc: self.proc.clone(),
5057 selection: query,
5058 graphql_client: self.graphql_client.clone(),
5059 }
5060 }
5061}
5062#[derive(Clone)]
5063pub struct Function {
5064 pub proc: Option<Arc<DaggerSessionProc>>,
5065 pub selection: Selection,
5066 pub graphql_client: DynGraphQLClient,
5067}
5068#[derive(Builder, Debug, PartialEq)]
5069pub struct FunctionWithArgOpts<'a> {
5070 #[builder(setter(into, strip_option), default)]
5072 pub default_path: Option<&'a str>,
5073 #[builder(setter(into, strip_option), default)]
5075 pub default_value: Option<Json>,
5076 #[builder(setter(into, strip_option), default)]
5078 pub description: Option<&'a str>,
5079 #[builder(setter(into, strip_option), default)]
5081 pub ignore: Option<Vec<&'a str>>,
5082 #[builder(setter(into, strip_option), default)]
5083 pub source_map: Option<SourceMapId>,
5084}
5085impl Function {
5086 pub fn args(&self) -> Vec<FunctionArg> {
5088 let query = self.selection.select("args");
5089 vec![FunctionArg {
5090 proc: self.proc.clone(),
5091 selection: query,
5092 graphql_client: self.graphql_client.clone(),
5093 }]
5094 }
5095 pub async fn description(&self) -> Result<String, DaggerError> {
5097 let query = self.selection.select("description");
5098 query.execute(self.graphql_client.clone()).await
5099 }
5100 pub async fn id(&self) -> Result<FunctionId, DaggerError> {
5102 let query = self.selection.select("id");
5103 query.execute(self.graphql_client.clone()).await
5104 }
5105 pub async fn name(&self) -> Result<String, DaggerError> {
5107 let query = self.selection.select("name");
5108 query.execute(self.graphql_client.clone()).await
5109 }
5110 pub fn return_type(&self) -> TypeDef {
5112 let query = self.selection.select("returnType");
5113 TypeDef {
5114 proc: self.proc.clone(),
5115 selection: query,
5116 graphql_client: self.graphql_client.clone(),
5117 }
5118 }
5119 pub fn source_map(&self) -> SourceMap {
5121 let query = self.selection.select("sourceMap");
5122 SourceMap {
5123 proc: self.proc.clone(),
5124 selection: query,
5125 graphql_client: self.graphql_client.clone(),
5126 }
5127 }
5128 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
5136 let mut query = self.selection.select("withArg");
5137 query = query.arg("name", name.into());
5138 query = query.arg_lazy(
5139 "typeDef",
5140 Box::new(move || {
5141 let type_def = type_def.clone();
5142 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
5143 }),
5144 );
5145 Function {
5146 proc: self.proc.clone(),
5147 selection: query,
5148 graphql_client: self.graphql_client.clone(),
5149 }
5150 }
5151 pub fn with_arg_opts<'a>(
5159 &self,
5160 name: impl Into<String>,
5161 type_def: impl IntoID<TypeDefId>,
5162 opts: FunctionWithArgOpts<'a>,
5163 ) -> Function {
5164 let mut query = self.selection.select("withArg");
5165 query = query.arg("name", name.into());
5166 query = query.arg_lazy(
5167 "typeDef",
5168 Box::new(move || {
5169 let type_def = type_def.clone();
5170 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
5171 }),
5172 );
5173 if let Some(description) = opts.description {
5174 query = query.arg("description", description);
5175 }
5176 if let Some(default_value) = opts.default_value {
5177 query = query.arg("defaultValue", default_value);
5178 }
5179 if let Some(default_path) = opts.default_path {
5180 query = query.arg("defaultPath", default_path);
5181 }
5182 if let Some(ignore) = opts.ignore {
5183 query = query.arg("ignore", ignore);
5184 }
5185 if let Some(source_map) = opts.source_map {
5186 query = query.arg("sourceMap", source_map);
5187 }
5188 Function {
5189 proc: self.proc.clone(),
5190 selection: query,
5191 graphql_client: self.graphql_client.clone(),
5192 }
5193 }
5194 pub fn with_description(&self, description: impl Into<String>) -> Function {
5200 let mut query = self.selection.select("withDescription");
5201 query = query.arg("description", description.into());
5202 Function {
5203 proc: self.proc.clone(),
5204 selection: query,
5205 graphql_client: self.graphql_client.clone(),
5206 }
5207 }
5208 pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
5214 let mut query = self.selection.select("withSourceMap");
5215 query = query.arg_lazy(
5216 "sourceMap",
5217 Box::new(move || {
5218 let source_map = source_map.clone();
5219 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
5220 }),
5221 );
5222 Function {
5223 proc: self.proc.clone(),
5224 selection: query,
5225 graphql_client: self.graphql_client.clone(),
5226 }
5227 }
5228}
5229#[derive(Clone)]
5230pub struct FunctionArg {
5231 pub proc: Option<Arc<DaggerSessionProc>>,
5232 pub selection: Selection,
5233 pub graphql_client: DynGraphQLClient,
5234}
5235impl FunctionArg {
5236 pub async fn default_path(&self) -> Result<String, DaggerError> {
5238 let query = self.selection.select("defaultPath");
5239 query.execute(self.graphql_client.clone()).await
5240 }
5241 pub async fn default_value(&self) -> Result<Json, DaggerError> {
5243 let query = self.selection.select("defaultValue");
5244 query.execute(self.graphql_client.clone()).await
5245 }
5246 pub async fn description(&self) -> Result<String, DaggerError> {
5248 let query = self.selection.select("description");
5249 query.execute(self.graphql_client.clone()).await
5250 }
5251 pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
5253 let query = self.selection.select("id");
5254 query.execute(self.graphql_client.clone()).await
5255 }
5256 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
5258 let query = self.selection.select("ignore");
5259 query.execute(self.graphql_client.clone()).await
5260 }
5261 pub async fn name(&self) -> Result<String, DaggerError> {
5263 let query = self.selection.select("name");
5264 query.execute(self.graphql_client.clone()).await
5265 }
5266 pub fn source_map(&self) -> SourceMap {
5268 let query = self.selection.select("sourceMap");
5269 SourceMap {
5270 proc: self.proc.clone(),
5271 selection: query,
5272 graphql_client: self.graphql_client.clone(),
5273 }
5274 }
5275 pub fn type_def(&self) -> TypeDef {
5277 let query = self.selection.select("typeDef");
5278 TypeDef {
5279 proc: self.proc.clone(),
5280 selection: query,
5281 graphql_client: self.graphql_client.clone(),
5282 }
5283 }
5284}
5285#[derive(Clone)]
5286pub struct FunctionCall {
5287 pub proc: Option<Arc<DaggerSessionProc>>,
5288 pub selection: Selection,
5289 pub graphql_client: DynGraphQLClient,
5290}
5291impl FunctionCall {
5292 pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
5294 let query = self.selection.select("id");
5295 query.execute(self.graphql_client.clone()).await
5296 }
5297 pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
5299 let query = self.selection.select("inputArgs");
5300 vec![FunctionCallArgValue {
5301 proc: self.proc.clone(),
5302 selection: query,
5303 graphql_client: self.graphql_client.clone(),
5304 }]
5305 }
5306 pub async fn name(&self) -> Result<String, DaggerError> {
5308 let query = self.selection.select("name");
5309 query.execute(self.graphql_client.clone()).await
5310 }
5311 pub async fn parent(&self) -> Result<Json, DaggerError> {
5313 let query = self.selection.select("parent");
5314 query.execute(self.graphql_client.clone()).await
5315 }
5316 pub async fn parent_name(&self) -> Result<String, DaggerError> {
5318 let query = self.selection.select("parentName");
5319 query.execute(self.graphql_client.clone()).await
5320 }
5321 pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
5327 let mut query = self.selection.select("returnError");
5328 query = query.arg_lazy(
5329 "error",
5330 Box::new(move || {
5331 let error = error.clone();
5332 Box::pin(async move { error.into_id().await.unwrap().quote() })
5333 }),
5334 );
5335 query.execute(self.graphql_client.clone()).await
5336 }
5337 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
5343 let mut query = self.selection.select("returnValue");
5344 query = query.arg("value", value);
5345 query.execute(self.graphql_client.clone()).await
5346 }
5347}
5348#[derive(Clone)]
5349pub struct FunctionCallArgValue {
5350 pub proc: Option<Arc<DaggerSessionProc>>,
5351 pub selection: Selection,
5352 pub graphql_client: DynGraphQLClient,
5353}
5354impl FunctionCallArgValue {
5355 pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
5357 let query = self.selection.select("id");
5358 query.execute(self.graphql_client.clone()).await
5359 }
5360 pub async fn name(&self) -> Result<String, DaggerError> {
5362 let query = self.selection.select("name");
5363 query.execute(self.graphql_client.clone()).await
5364 }
5365 pub async fn value(&self) -> Result<Json, DaggerError> {
5367 let query = self.selection.select("value");
5368 query.execute(self.graphql_client.clone()).await
5369 }
5370}
5371#[derive(Clone)]
5372pub struct GeneratedCode {
5373 pub proc: Option<Arc<DaggerSessionProc>>,
5374 pub selection: Selection,
5375 pub graphql_client: DynGraphQLClient,
5376}
5377impl GeneratedCode {
5378 pub fn code(&self) -> Directory {
5380 let query = self.selection.select("code");
5381 Directory {
5382 proc: self.proc.clone(),
5383 selection: query,
5384 graphql_client: self.graphql_client.clone(),
5385 }
5386 }
5387 pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
5389 let query = self.selection.select("id");
5390 query.execute(self.graphql_client.clone()).await
5391 }
5392 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
5394 let query = self.selection.select("vcsGeneratedPaths");
5395 query.execute(self.graphql_client.clone()).await
5396 }
5397 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
5399 let query = self.selection.select("vcsIgnoredPaths");
5400 query.execute(self.graphql_client.clone()).await
5401 }
5402 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
5404 let mut query = self.selection.select("withVCSGeneratedPaths");
5405 query = query.arg(
5406 "paths",
5407 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5408 );
5409 GeneratedCode {
5410 proc: self.proc.clone(),
5411 selection: query,
5412 graphql_client: self.graphql_client.clone(),
5413 }
5414 }
5415 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
5417 let mut query = self.selection.select("withVCSIgnoredPaths");
5418 query = query.arg(
5419 "paths",
5420 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5421 );
5422 GeneratedCode {
5423 proc: self.proc.clone(),
5424 selection: query,
5425 graphql_client: self.graphql_client.clone(),
5426 }
5427 }
5428}
5429#[derive(Clone)]
5430pub struct GitRef {
5431 pub proc: Option<Arc<DaggerSessionProc>>,
5432 pub selection: Selection,
5433 pub graphql_client: DynGraphQLClient,
5434}
5435#[derive(Builder, Debug, PartialEq)]
5436pub struct GitRefTreeOpts {
5437 #[builder(setter(into, strip_option), default)]
5439 pub discard_git_dir: Option<bool>,
5440}
5441impl GitRef {
5442 pub async fn commit(&self) -> Result<String, DaggerError> {
5444 let query = self.selection.select("commit");
5445 query.execute(self.graphql_client.clone()).await
5446 }
5447 pub async fn id(&self) -> Result<GitRefId, DaggerError> {
5449 let query = self.selection.select("id");
5450 query.execute(self.graphql_client.clone()).await
5451 }
5452 pub fn tree(&self) -> Directory {
5458 let query = self.selection.select("tree");
5459 Directory {
5460 proc: self.proc.clone(),
5461 selection: query,
5462 graphql_client: self.graphql_client.clone(),
5463 }
5464 }
5465 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
5471 let mut query = self.selection.select("tree");
5472 if let Some(discard_git_dir) = opts.discard_git_dir {
5473 query = query.arg("discardGitDir", discard_git_dir);
5474 }
5475 Directory {
5476 proc: self.proc.clone(),
5477 selection: query,
5478 graphql_client: self.graphql_client.clone(),
5479 }
5480 }
5481}
5482#[derive(Clone)]
5483pub struct GitRepository {
5484 pub proc: Option<Arc<DaggerSessionProc>>,
5485 pub selection: Selection,
5486 pub graphql_client: DynGraphQLClient,
5487}
5488#[derive(Builder, Debug, PartialEq)]
5489pub struct GitRepositoryTagsOpts<'a> {
5490 #[builder(setter(into, strip_option), default)]
5492 pub patterns: Option<Vec<&'a str>>,
5493}
5494impl GitRepository {
5495 pub fn branch(&self, name: impl Into<String>) -> GitRef {
5501 let mut query = self.selection.select("branch");
5502 query = query.arg("name", name.into());
5503 GitRef {
5504 proc: self.proc.clone(),
5505 selection: query,
5506 graphql_client: self.graphql_client.clone(),
5507 }
5508 }
5509 pub fn commit(&self, id: impl Into<String>) -> GitRef {
5515 let mut query = self.selection.select("commit");
5516 query = query.arg("id", id.into());
5517 GitRef {
5518 proc: self.proc.clone(),
5519 selection: query,
5520 graphql_client: self.graphql_client.clone(),
5521 }
5522 }
5523 pub fn head(&self) -> GitRef {
5525 let query = self.selection.select("head");
5526 GitRef {
5527 proc: self.proc.clone(),
5528 selection: query,
5529 graphql_client: self.graphql_client.clone(),
5530 }
5531 }
5532 pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
5534 let query = self.selection.select("id");
5535 query.execute(self.graphql_client.clone()).await
5536 }
5537 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
5543 let mut query = self.selection.select("ref");
5544 query = query.arg("name", name.into());
5545 GitRef {
5546 proc: self.proc.clone(),
5547 selection: query,
5548 graphql_client: self.graphql_client.clone(),
5549 }
5550 }
5551 pub fn tag(&self, name: impl Into<String>) -> GitRef {
5557 let mut query = self.selection.select("tag");
5558 query = query.arg("name", name.into());
5559 GitRef {
5560 proc: self.proc.clone(),
5561 selection: query,
5562 graphql_client: self.graphql_client.clone(),
5563 }
5564 }
5565 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
5571 let query = self.selection.select("tags");
5572 query.execute(self.graphql_client.clone()).await
5573 }
5574 pub async fn tags_opts<'a>(
5580 &self,
5581 opts: GitRepositoryTagsOpts<'a>,
5582 ) -> Result<Vec<String>, DaggerError> {
5583 let mut query = self.selection.select("tags");
5584 if let Some(patterns) = opts.patterns {
5585 query = query.arg("patterns", patterns);
5586 }
5587 query.execute(self.graphql_client.clone()).await
5588 }
5589 pub fn with_auth_header(&self, header: impl IntoID<SecretId>) -> GitRepository {
5595 let mut query = self.selection.select("withAuthHeader");
5596 query = query.arg_lazy(
5597 "header",
5598 Box::new(move || {
5599 let header = header.clone();
5600 Box::pin(async move { header.into_id().await.unwrap().quote() })
5601 }),
5602 );
5603 GitRepository {
5604 proc: self.proc.clone(),
5605 selection: query,
5606 graphql_client: self.graphql_client.clone(),
5607 }
5608 }
5609 pub fn with_auth_token(&self, token: impl IntoID<SecretId>) -> GitRepository {
5615 let mut query = self.selection.select("withAuthToken");
5616 query = query.arg_lazy(
5617 "token",
5618 Box::new(move || {
5619 let token = token.clone();
5620 Box::pin(async move { token.into_id().await.unwrap().quote() })
5621 }),
5622 );
5623 GitRepository {
5624 proc: self.proc.clone(),
5625 selection: query,
5626 graphql_client: self.graphql_client.clone(),
5627 }
5628 }
5629}
5630#[derive(Clone)]
5631pub struct Host {
5632 pub proc: Option<Arc<DaggerSessionProc>>,
5633 pub selection: Selection,
5634 pub graphql_client: DynGraphQLClient,
5635}
5636#[derive(Builder, Debug, PartialEq)]
5637pub struct HostDirectoryOpts<'a> {
5638 #[builder(setter(into, strip_option), default)]
5640 pub exclude: Option<Vec<&'a str>>,
5641 #[builder(setter(into, strip_option), default)]
5643 pub include: Option<Vec<&'a str>>,
5644}
5645#[derive(Builder, Debug, PartialEq)]
5646pub struct HostServiceOpts<'a> {
5647 #[builder(setter(into, strip_option), default)]
5649 pub host: Option<&'a str>,
5650}
5651#[derive(Builder, Debug, PartialEq)]
5652pub struct HostTunnelOpts {
5653 #[builder(setter(into, strip_option), default)]
5656 pub native: Option<bool>,
5657 #[builder(setter(into, strip_option), default)]
5662 pub ports: Option<Vec<PortForward>>,
5663}
5664impl Host {
5665 pub fn directory(&self, path: impl Into<String>) -> Directory {
5672 let mut query = self.selection.select("directory");
5673 query = query.arg("path", path.into());
5674 Directory {
5675 proc: self.proc.clone(),
5676 selection: query,
5677 graphql_client: self.graphql_client.clone(),
5678 }
5679 }
5680 pub fn directory_opts<'a>(
5687 &self,
5688 path: impl Into<String>,
5689 opts: HostDirectoryOpts<'a>,
5690 ) -> Directory {
5691 let mut query = self.selection.select("directory");
5692 query = query.arg("path", path.into());
5693 if let Some(exclude) = opts.exclude {
5694 query = query.arg("exclude", exclude);
5695 }
5696 if let Some(include) = opts.include {
5697 query = query.arg("include", include);
5698 }
5699 Directory {
5700 proc: self.proc.clone(),
5701 selection: query,
5702 graphql_client: self.graphql_client.clone(),
5703 }
5704 }
5705 pub fn file(&self, path: impl Into<String>) -> File {
5711 let mut query = self.selection.select("file");
5712 query = query.arg("path", path.into());
5713 File {
5714 proc: self.proc.clone(),
5715 selection: query,
5716 graphql_client: self.graphql_client.clone(),
5717 }
5718 }
5719 pub async fn id(&self) -> Result<HostId, DaggerError> {
5721 let query = self.selection.select("id");
5722 query.execute(self.graphql_client.clone()).await
5723 }
5724 pub fn service(&self, ports: Vec<PortForward>) -> Service {
5735 let mut query = self.selection.select("service");
5736 query = query.arg("ports", ports);
5737 Service {
5738 proc: self.proc.clone(),
5739 selection: query,
5740 graphql_client: self.graphql_client.clone(),
5741 }
5742 }
5743 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
5754 let mut query = self.selection.select("service");
5755 query = query.arg("ports", ports);
5756 if let Some(host) = opts.host {
5757 query = query.arg("host", host);
5758 }
5759 Service {
5760 proc: self.proc.clone(),
5761 selection: query,
5762 graphql_client: self.graphql_client.clone(),
5763 }
5764 }
5765 pub fn set_secret_file(&self, name: impl Into<String>, path: impl Into<String>) -> Secret {
5773 let mut query = self.selection.select("setSecretFile");
5774 query = query.arg("name", name.into());
5775 query = query.arg("path", path.into());
5776 Secret {
5777 proc: self.proc.clone(),
5778 selection: query,
5779 graphql_client: self.graphql_client.clone(),
5780 }
5781 }
5782 pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
5789 let mut query = self.selection.select("tunnel");
5790 query = query.arg_lazy(
5791 "service",
5792 Box::new(move || {
5793 let service = service.clone();
5794 Box::pin(async move { service.into_id().await.unwrap().quote() })
5795 }),
5796 );
5797 Service {
5798 proc: self.proc.clone(),
5799 selection: query,
5800 graphql_client: self.graphql_client.clone(),
5801 }
5802 }
5803 pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
5810 let mut query = self.selection.select("tunnel");
5811 query = query.arg_lazy(
5812 "service",
5813 Box::new(move || {
5814 let service = service.clone();
5815 Box::pin(async move { service.into_id().await.unwrap().quote() })
5816 }),
5817 );
5818 if let Some(ports) = opts.ports {
5819 query = query.arg("ports", ports);
5820 }
5821 if let Some(native) = opts.native {
5822 query = query.arg("native", native);
5823 }
5824 Service {
5825 proc: self.proc.clone(),
5826 selection: query,
5827 graphql_client: self.graphql_client.clone(),
5828 }
5829 }
5830 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
5836 let mut query = self.selection.select("unixSocket");
5837 query = query.arg("path", path.into());
5838 Socket {
5839 proc: self.proc.clone(),
5840 selection: query,
5841 graphql_client: self.graphql_client.clone(),
5842 }
5843 }
5844}
5845#[derive(Clone)]
5846pub struct InputTypeDef {
5847 pub proc: Option<Arc<DaggerSessionProc>>,
5848 pub selection: Selection,
5849 pub graphql_client: DynGraphQLClient,
5850}
5851impl InputTypeDef {
5852 pub fn fields(&self) -> Vec<FieldTypeDef> {
5854 let query = self.selection.select("fields");
5855 vec![FieldTypeDef {
5856 proc: self.proc.clone(),
5857 selection: query,
5858 graphql_client: self.graphql_client.clone(),
5859 }]
5860 }
5861 pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
5863 let query = self.selection.select("id");
5864 query.execute(self.graphql_client.clone()).await
5865 }
5866 pub async fn name(&self) -> Result<String, DaggerError> {
5868 let query = self.selection.select("name");
5869 query.execute(self.graphql_client.clone()).await
5870 }
5871}
5872#[derive(Clone)]
5873pub struct InterfaceTypeDef {
5874 pub proc: Option<Arc<DaggerSessionProc>>,
5875 pub selection: Selection,
5876 pub graphql_client: DynGraphQLClient,
5877}
5878impl InterfaceTypeDef {
5879 pub async fn description(&self) -> Result<String, DaggerError> {
5881 let query = self.selection.select("description");
5882 query.execute(self.graphql_client.clone()).await
5883 }
5884 pub fn functions(&self) -> Vec<Function> {
5886 let query = self.selection.select("functions");
5887 vec![Function {
5888 proc: self.proc.clone(),
5889 selection: query,
5890 graphql_client: self.graphql_client.clone(),
5891 }]
5892 }
5893 pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
5895 let query = self.selection.select("id");
5896 query.execute(self.graphql_client.clone()).await
5897 }
5898 pub async fn name(&self) -> Result<String, DaggerError> {
5900 let query = self.selection.select("name");
5901 query.execute(self.graphql_client.clone()).await
5902 }
5903 pub fn source_map(&self) -> SourceMap {
5905 let query = self.selection.select("sourceMap");
5906 SourceMap {
5907 proc: self.proc.clone(),
5908 selection: query,
5909 graphql_client: self.graphql_client.clone(),
5910 }
5911 }
5912 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
5914 let query = self.selection.select("sourceModuleName");
5915 query.execute(self.graphql_client.clone()).await
5916 }
5917}
5918#[derive(Clone)]
5919pub struct Label {
5920 pub proc: Option<Arc<DaggerSessionProc>>,
5921 pub selection: Selection,
5922 pub graphql_client: DynGraphQLClient,
5923}
5924impl Label {
5925 pub async fn id(&self) -> Result<LabelId, DaggerError> {
5927 let query = self.selection.select("id");
5928 query.execute(self.graphql_client.clone()).await
5929 }
5930 pub async fn name(&self) -> Result<String, DaggerError> {
5932 let query = self.selection.select("name");
5933 query.execute(self.graphql_client.clone()).await
5934 }
5935 pub async fn value(&self) -> Result<String, DaggerError> {
5937 let query = self.selection.select("value");
5938 query.execute(self.graphql_client.clone()).await
5939 }
5940}
5941#[derive(Clone)]
5942pub struct ListTypeDef {
5943 pub proc: Option<Arc<DaggerSessionProc>>,
5944 pub selection: Selection,
5945 pub graphql_client: DynGraphQLClient,
5946}
5947impl ListTypeDef {
5948 pub fn element_type_def(&self) -> TypeDef {
5950 let query = self.selection.select("elementTypeDef");
5951 TypeDef {
5952 proc: self.proc.clone(),
5953 selection: query,
5954 graphql_client: self.graphql_client.clone(),
5955 }
5956 }
5957 pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
5959 let query = self.selection.select("id");
5960 query.execute(self.graphql_client.clone()).await
5961 }
5962}
5963#[derive(Clone)]
5964pub struct Module {
5965 pub proc: Option<Arc<DaggerSessionProc>>,
5966 pub selection: Selection,
5967 pub graphql_client: DynGraphQLClient,
5968}
5969impl Module {
5970 pub fn dependencies(&self) -> Vec<Module> {
5972 let query = self.selection.select("dependencies");
5973 vec![Module {
5974 proc: self.proc.clone(),
5975 selection: query,
5976 graphql_client: self.graphql_client.clone(),
5977 }]
5978 }
5979 pub async fn description(&self) -> Result<String, DaggerError> {
5981 let query = self.selection.select("description");
5982 query.execute(self.graphql_client.clone()).await
5983 }
5984 pub fn enums(&self) -> Vec<TypeDef> {
5986 let query = self.selection.select("enums");
5987 vec![TypeDef {
5988 proc: self.proc.clone(),
5989 selection: query,
5990 graphql_client: self.graphql_client.clone(),
5991 }]
5992 }
5993 pub fn generated_context_directory(&self) -> Directory {
5995 let query = self.selection.select("generatedContextDirectory");
5996 Directory {
5997 proc: self.proc.clone(),
5998 selection: query,
5999 graphql_client: self.graphql_client.clone(),
6000 }
6001 }
6002 pub async fn id(&self) -> Result<ModuleId, DaggerError> {
6004 let query = self.selection.select("id");
6005 query.execute(self.graphql_client.clone()).await
6006 }
6007 pub fn interfaces(&self) -> Vec<TypeDef> {
6009 let query = self.selection.select("interfaces");
6010 vec![TypeDef {
6011 proc: self.proc.clone(),
6012 selection: query,
6013 graphql_client: self.graphql_client.clone(),
6014 }]
6015 }
6016 pub async fn name(&self) -> Result<String, DaggerError> {
6018 let query = self.selection.select("name");
6019 query.execute(self.graphql_client.clone()).await
6020 }
6021 pub fn objects(&self) -> Vec<TypeDef> {
6023 let query = self.selection.select("objects");
6024 vec![TypeDef {
6025 proc: self.proc.clone(),
6026 selection: query,
6027 graphql_client: self.graphql_client.clone(),
6028 }]
6029 }
6030 pub fn runtime(&self) -> Container {
6032 let query = self.selection.select("runtime");
6033 Container {
6034 proc: self.proc.clone(),
6035 selection: query,
6036 graphql_client: self.graphql_client.clone(),
6037 }
6038 }
6039 pub fn sdk(&self) -> SdkConfig {
6041 let query = self.selection.select("sdk");
6042 SdkConfig {
6043 proc: self.proc.clone(),
6044 selection: query,
6045 graphql_client: self.graphql_client.clone(),
6046 }
6047 }
6048 pub async fn serve(&self) -> Result<Void, DaggerError> {
6051 let query = self.selection.select("serve");
6052 query.execute(self.graphql_client.clone()).await
6053 }
6054 pub fn source(&self) -> ModuleSource {
6056 let query = self.selection.select("source");
6057 ModuleSource {
6058 proc: self.proc.clone(),
6059 selection: query,
6060 graphql_client: self.graphql_client.clone(),
6061 }
6062 }
6063 pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
6065 let query = self.selection.select("sync");
6066 query.execute(self.graphql_client.clone()).await
6067 }
6068 pub fn with_description(&self, description: impl Into<String>) -> Module {
6074 let mut query = self.selection.select("withDescription");
6075 query = query.arg("description", description.into());
6076 Module {
6077 proc: self.proc.clone(),
6078 selection: query,
6079 graphql_client: self.graphql_client.clone(),
6080 }
6081 }
6082 pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
6084 let mut query = self.selection.select("withEnum");
6085 query = query.arg_lazy(
6086 "enum",
6087 Box::new(move || {
6088 let r#enum = r#enum.clone();
6089 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
6090 }),
6091 );
6092 Module {
6093 proc: self.proc.clone(),
6094 selection: query,
6095 graphql_client: self.graphql_client.clone(),
6096 }
6097 }
6098 pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
6100 let mut query = self.selection.select("withInterface");
6101 query = query.arg_lazy(
6102 "iface",
6103 Box::new(move || {
6104 let iface = iface.clone();
6105 Box::pin(async move { iface.into_id().await.unwrap().quote() })
6106 }),
6107 );
6108 Module {
6109 proc: self.proc.clone(),
6110 selection: query,
6111 graphql_client: self.graphql_client.clone(),
6112 }
6113 }
6114 pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
6116 let mut query = self.selection.select("withObject");
6117 query = query.arg_lazy(
6118 "object",
6119 Box::new(move || {
6120 let object = object.clone();
6121 Box::pin(async move { object.into_id().await.unwrap().quote() })
6122 }),
6123 );
6124 Module {
6125 proc: self.proc.clone(),
6126 selection: query,
6127 graphql_client: self.graphql_client.clone(),
6128 }
6129 }
6130}
6131#[derive(Clone)]
6132pub struct ModuleConfigClient {
6133 pub proc: Option<Arc<DaggerSessionProc>>,
6134 pub selection: Selection,
6135 pub graphql_client: DynGraphQLClient,
6136}
6137impl ModuleConfigClient {
6138 pub async fn dev(&self) -> Result<bool, DaggerError> {
6140 let query = self.selection.select("dev");
6141 query.execute(self.graphql_client.clone()).await
6142 }
6143 pub async fn directory(&self) -> Result<String, DaggerError> {
6145 let query = self.selection.select("directory");
6146 query.execute(self.graphql_client.clone()).await
6147 }
6148 pub async fn generator(&self) -> Result<String, DaggerError> {
6150 let query = self.selection.select("generator");
6151 query.execute(self.graphql_client.clone()).await
6152 }
6153 pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
6155 let query = self.selection.select("id");
6156 query.execute(self.graphql_client.clone()).await
6157 }
6158}
6159#[derive(Clone)]
6160pub struct ModuleSource {
6161 pub proc: Option<Arc<DaggerSessionProc>>,
6162 pub selection: Selection,
6163 pub graphql_client: DynGraphQLClient,
6164}
6165#[derive(Builder, Debug, PartialEq)]
6166pub struct ModuleSourceWithClientOpts {
6167 #[builder(setter(into, strip_option), default)]
6169 pub dev: Option<bool>,
6170}
6171impl ModuleSource {
6172 pub fn as_module(&self) -> Module {
6174 let query = self.selection.select("asModule");
6175 Module {
6176 proc: self.proc.clone(),
6177 selection: query,
6178 graphql_client: self.graphql_client.clone(),
6179 }
6180 }
6181 pub async fn as_string(&self) -> Result<String, DaggerError> {
6183 let query = self.selection.select("asString");
6184 query.execute(self.graphql_client.clone()).await
6185 }
6186 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
6188 let query = self.selection.select("cloneRef");
6189 query.execute(self.graphql_client.clone()).await
6190 }
6191 pub async fn commit(&self) -> Result<String, DaggerError> {
6193 let query = self.selection.select("commit");
6194 query.execute(self.graphql_client.clone()).await
6195 }
6196 pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
6198 let query = self.selection.select("configClients");
6199 vec![ModuleConfigClient {
6200 proc: self.proc.clone(),
6201 selection: query,
6202 graphql_client: self.graphql_client.clone(),
6203 }]
6204 }
6205 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
6207 let query = self.selection.select("configExists");
6208 query.execute(self.graphql_client.clone()).await
6209 }
6210 pub fn context_directory(&self) -> Directory {
6212 let query = self.selection.select("contextDirectory");
6213 Directory {
6214 proc: self.proc.clone(),
6215 selection: query,
6216 graphql_client: self.graphql_client.clone(),
6217 }
6218 }
6219 pub fn dependencies(&self) -> Vec<ModuleSource> {
6221 let query = self.selection.select("dependencies");
6222 vec![ModuleSource {
6223 proc: self.proc.clone(),
6224 selection: query,
6225 graphql_client: self.graphql_client.clone(),
6226 }]
6227 }
6228 pub async fn digest(&self) -> Result<String, DaggerError> {
6230 let query = self.selection.select("digest");
6231 query.execute(self.graphql_client.clone()).await
6232 }
6233 pub fn directory(&self, path: impl Into<String>) -> Directory {
6239 let mut query = self.selection.select("directory");
6240 query = query.arg("path", path.into());
6241 Directory {
6242 proc: self.proc.clone(),
6243 selection: query,
6244 graphql_client: self.graphql_client.clone(),
6245 }
6246 }
6247 pub async fn engine_version(&self) -> Result<String, DaggerError> {
6249 let query = self.selection.select("engineVersion");
6250 query.execute(self.graphql_client.clone()).await
6251 }
6252 pub fn generated_context_directory(&self) -> Directory {
6254 let query = self.selection.select("generatedContextDirectory");
6255 Directory {
6256 proc: self.proc.clone(),
6257 selection: query,
6258 graphql_client: self.graphql_client.clone(),
6259 }
6260 }
6261 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
6263 let query = self.selection.select("htmlRepoURL");
6264 query.execute(self.graphql_client.clone()).await
6265 }
6266 pub async fn html_url(&self) -> Result<String, DaggerError> {
6268 let query = self.selection.select("htmlURL");
6269 query.execute(self.graphql_client.clone()).await
6270 }
6271 pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
6273 let query = self.selection.select("id");
6274 query.execute(self.graphql_client.clone()).await
6275 }
6276 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
6278 let query = self.selection.select("kind");
6279 query.execute(self.graphql_client.clone()).await
6280 }
6281 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
6283 let query = self.selection.select("localContextDirectoryPath");
6284 query.execute(self.graphql_client.clone()).await
6285 }
6286 pub async fn module_name(&self) -> Result<String, DaggerError> {
6288 let query = self.selection.select("moduleName");
6289 query.execute(self.graphql_client.clone()).await
6290 }
6291 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
6293 let query = self.selection.select("moduleOriginalName");
6294 query.execute(self.graphql_client.clone()).await
6295 }
6296 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
6298 let query = self.selection.select("originalSubpath");
6299 query.execute(self.graphql_client.clone()).await
6300 }
6301 pub async fn pin(&self) -> Result<String, DaggerError> {
6303 let query = self.selection.select("pin");
6304 query.execute(self.graphql_client.clone()).await
6305 }
6306 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
6308 let query = self.selection.select("repoRootPath");
6309 query.execute(self.graphql_client.clone()).await
6310 }
6311 pub fn sdk(&self) -> SdkConfig {
6313 let query = self.selection.select("sdk");
6314 SdkConfig {
6315 proc: self.proc.clone(),
6316 selection: query,
6317 graphql_client: self.graphql_client.clone(),
6318 }
6319 }
6320 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
6322 let query = self.selection.select("sourceRootSubpath");
6323 query.execute(self.graphql_client.clone()).await
6324 }
6325 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
6327 let query = self.selection.select("sourceSubpath");
6328 query.execute(self.graphql_client.clone()).await
6329 }
6330 pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
6332 let query = self.selection.select("sync");
6333 query.execute(self.graphql_client.clone()).await
6334 }
6335 pub async fn version(&self) -> Result<String, DaggerError> {
6337 let query = self.selection.select("version");
6338 query.execute(self.graphql_client.clone()).await
6339 }
6340 pub fn with_client(
6348 &self,
6349 generator: impl Into<String>,
6350 output_dir: impl Into<String>,
6351 ) -> ModuleSource {
6352 let mut query = self.selection.select("withClient");
6353 query = query.arg("generator", generator.into());
6354 query = query.arg("outputDir", output_dir.into());
6355 ModuleSource {
6356 proc: self.proc.clone(),
6357 selection: query,
6358 graphql_client: self.graphql_client.clone(),
6359 }
6360 }
6361 pub fn with_client_opts(
6369 &self,
6370 generator: impl Into<String>,
6371 output_dir: impl Into<String>,
6372 opts: ModuleSourceWithClientOpts,
6373 ) -> ModuleSource {
6374 let mut query = self.selection.select("withClient");
6375 query = query.arg("generator", generator.into());
6376 query = query.arg("outputDir", output_dir.into());
6377 if let Some(dev) = opts.dev {
6378 query = query.arg("dev", dev);
6379 }
6380 ModuleSource {
6381 proc: self.proc.clone(),
6382 selection: query,
6383 graphql_client: self.graphql_client.clone(),
6384 }
6385 }
6386 pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
6392 let mut query = self.selection.select("withDependencies");
6393 query = query.arg("dependencies", dependencies);
6394 ModuleSource {
6395 proc: self.proc.clone(),
6396 selection: query,
6397 graphql_client: self.graphql_client.clone(),
6398 }
6399 }
6400 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
6406 let mut query = self.selection.select("withEngineVersion");
6407 query = query.arg("version", version.into());
6408 ModuleSource {
6409 proc: self.proc.clone(),
6410 selection: query,
6411 graphql_client: self.graphql_client.clone(),
6412 }
6413 }
6414 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
6420 let mut query = self.selection.select("withIncludes");
6421 query = query.arg(
6422 "patterns",
6423 patterns
6424 .into_iter()
6425 .map(|i| i.into())
6426 .collect::<Vec<String>>(),
6427 );
6428 ModuleSource {
6429 proc: self.proc.clone(),
6430 selection: query,
6431 graphql_client: self.graphql_client.clone(),
6432 }
6433 }
6434 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
6440 let mut query = self.selection.select("withName");
6441 query = query.arg("name", name.into());
6442 ModuleSource {
6443 proc: self.proc.clone(),
6444 selection: query,
6445 graphql_client: self.graphql_client.clone(),
6446 }
6447 }
6448 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
6454 let mut query = self.selection.select("withSDK");
6455 query = query.arg("source", source.into());
6456 ModuleSource {
6457 proc: self.proc.clone(),
6458 selection: query,
6459 graphql_client: self.graphql_client.clone(),
6460 }
6461 }
6462 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
6468 let mut query = self.selection.select("withSourceSubpath");
6469 query = query.arg("path", path.into());
6470 ModuleSource {
6471 proc: self.proc.clone(),
6472 selection: query,
6473 graphql_client: self.graphql_client.clone(),
6474 }
6475 }
6476 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
6482 let mut query = self.selection.select("withUpdateDependencies");
6483 query = query.arg(
6484 "dependencies",
6485 dependencies
6486 .into_iter()
6487 .map(|i| i.into())
6488 .collect::<Vec<String>>(),
6489 );
6490 ModuleSource {
6491 proc: self.proc.clone(),
6492 selection: query,
6493 graphql_client: self.graphql_client.clone(),
6494 }
6495 }
6496 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
6502 let mut query = self.selection.select("withoutDependencies");
6503 query = query.arg(
6504 "dependencies",
6505 dependencies
6506 .into_iter()
6507 .map(|i| i.into())
6508 .collect::<Vec<String>>(),
6509 );
6510 ModuleSource {
6511 proc: self.proc.clone(),
6512 selection: query,
6513 graphql_client: self.graphql_client.clone(),
6514 }
6515 }
6516}
6517#[derive(Clone)]
6518pub struct ObjectTypeDef {
6519 pub proc: Option<Arc<DaggerSessionProc>>,
6520 pub selection: Selection,
6521 pub graphql_client: DynGraphQLClient,
6522}
6523impl ObjectTypeDef {
6524 pub fn constructor(&self) -> Function {
6526 let query = self.selection.select("constructor");
6527 Function {
6528 proc: self.proc.clone(),
6529 selection: query,
6530 graphql_client: self.graphql_client.clone(),
6531 }
6532 }
6533 pub async fn description(&self) -> Result<String, DaggerError> {
6535 let query = self.selection.select("description");
6536 query.execute(self.graphql_client.clone()).await
6537 }
6538 pub fn fields(&self) -> Vec<FieldTypeDef> {
6540 let query = self.selection.select("fields");
6541 vec![FieldTypeDef {
6542 proc: self.proc.clone(),
6543 selection: query,
6544 graphql_client: self.graphql_client.clone(),
6545 }]
6546 }
6547 pub fn functions(&self) -> Vec<Function> {
6549 let query = self.selection.select("functions");
6550 vec![Function {
6551 proc: self.proc.clone(),
6552 selection: query,
6553 graphql_client: self.graphql_client.clone(),
6554 }]
6555 }
6556 pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
6558 let query = self.selection.select("id");
6559 query.execute(self.graphql_client.clone()).await
6560 }
6561 pub async fn name(&self) -> Result<String, DaggerError> {
6563 let query = self.selection.select("name");
6564 query.execute(self.graphql_client.clone()).await
6565 }
6566 pub fn source_map(&self) -> SourceMap {
6568 let query = self.selection.select("sourceMap");
6569 SourceMap {
6570 proc: self.proc.clone(),
6571 selection: query,
6572 graphql_client: self.graphql_client.clone(),
6573 }
6574 }
6575 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6577 let query = self.selection.select("sourceModuleName");
6578 query.execute(self.graphql_client.clone()).await
6579 }
6580}
6581#[derive(Clone)]
6582pub struct Port {
6583 pub proc: Option<Arc<DaggerSessionProc>>,
6584 pub selection: Selection,
6585 pub graphql_client: DynGraphQLClient,
6586}
6587impl Port {
6588 pub async fn description(&self) -> Result<String, DaggerError> {
6590 let query = self.selection.select("description");
6591 query.execute(self.graphql_client.clone()).await
6592 }
6593 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
6595 let query = self.selection.select("experimentalSkipHealthcheck");
6596 query.execute(self.graphql_client.clone()).await
6597 }
6598 pub async fn id(&self) -> Result<PortId, DaggerError> {
6600 let query = self.selection.select("id");
6601 query.execute(self.graphql_client.clone()).await
6602 }
6603 pub async fn port(&self) -> Result<isize, DaggerError> {
6605 let query = self.selection.select("port");
6606 query.execute(self.graphql_client.clone()).await
6607 }
6608 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
6610 let query = self.selection.select("protocol");
6611 query.execute(self.graphql_client.clone()).await
6612 }
6613}
6614#[derive(Clone)]
6615pub struct Query {
6616 pub proc: Option<Arc<DaggerSessionProc>>,
6617 pub selection: Selection,
6618 pub graphql_client: DynGraphQLClient,
6619}
6620#[derive(Builder, Debug, PartialEq)]
6621pub struct QueryCacheVolumeOpts<'a> {
6622 #[builder(setter(into, strip_option), default)]
6623 pub namespace: Option<&'a str>,
6624}
6625#[derive(Builder, Debug, PartialEq)]
6626pub struct QueryContainerOpts {
6627 #[builder(setter(into, strip_option), default)]
6629 pub platform: Option<Platform>,
6630}
6631#[derive(Builder, Debug, PartialEq)]
6632pub struct QueryGitOpts<'a> {
6633 #[builder(setter(into, strip_option), default)]
6635 pub experimental_service_host: Option<ServiceId>,
6636 #[builder(setter(into, strip_option), default)]
6638 pub keep_git_dir: Option<bool>,
6639 #[builder(setter(into, strip_option), default)]
6641 pub ssh_auth_socket: Option<SocketId>,
6642 #[builder(setter(into, strip_option), default)]
6644 pub ssh_known_hosts: Option<&'a str>,
6645}
6646#[derive(Builder, Debug, PartialEq)]
6647pub struct QueryHttpOpts {
6648 #[builder(setter(into, strip_option), default)]
6650 pub experimental_service_host: Option<ServiceId>,
6651}
6652#[derive(Builder, Debug, PartialEq)]
6653pub struct QueryLoadSecretFromNameOpts<'a> {
6654 #[builder(setter(into, strip_option), default)]
6655 pub accessor: Option<&'a str>,
6656}
6657#[derive(Builder, Debug, PartialEq)]
6658pub struct QueryModuleSourceOpts<'a> {
6659 #[builder(setter(into, strip_option), default)]
6661 pub allow_not_exists: Option<bool>,
6662 #[builder(setter(into, strip_option), default)]
6664 pub disable_find_up: Option<bool>,
6665 #[builder(setter(into, strip_option), default)]
6667 pub ref_pin: Option<&'a str>,
6668 #[builder(setter(into, strip_option), default)]
6670 pub require_kind: Option<ModuleSourceKind>,
6671}
6672impl Query {
6673 pub fn builtin_container(&self, digest: impl Into<String>) -> Container {
6679 let mut query = self.selection.select("builtinContainer");
6680 query = query.arg("digest", digest.into());
6681 Container {
6682 proc: self.proc.clone(),
6683 selection: query,
6684 graphql_client: self.graphql_client.clone(),
6685 }
6686 }
6687 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
6694 let mut query = self.selection.select("cacheVolume");
6695 query = query.arg("key", key.into());
6696 CacheVolume {
6697 proc: self.proc.clone(),
6698 selection: query,
6699 graphql_client: self.graphql_client.clone(),
6700 }
6701 }
6702 pub fn cache_volume_opts<'a>(
6709 &self,
6710 key: impl Into<String>,
6711 opts: QueryCacheVolumeOpts<'a>,
6712 ) -> CacheVolume {
6713 let mut query = self.selection.select("cacheVolume");
6714 query = query.arg("key", key.into());
6715 if let Some(namespace) = opts.namespace {
6716 query = query.arg("namespace", namespace);
6717 }
6718 CacheVolume {
6719 proc: self.proc.clone(),
6720 selection: query,
6721 graphql_client: self.graphql_client.clone(),
6722 }
6723 }
6724 pub fn container(&self) -> Container {
6731 let query = self.selection.select("container");
6732 Container {
6733 proc: self.proc.clone(),
6734 selection: query,
6735 graphql_client: self.graphql_client.clone(),
6736 }
6737 }
6738 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
6745 let mut query = self.selection.select("container");
6746 if let Some(platform) = opts.platform {
6747 query = query.arg("platform", platform);
6748 }
6749 Container {
6750 proc: self.proc.clone(),
6751 selection: query,
6752 graphql_client: self.graphql_client.clone(),
6753 }
6754 }
6755 pub fn current_function_call(&self) -> FunctionCall {
6758 let query = self.selection.select("currentFunctionCall");
6759 FunctionCall {
6760 proc: self.proc.clone(),
6761 selection: query,
6762 graphql_client: self.graphql_client.clone(),
6763 }
6764 }
6765 pub fn current_module(&self) -> CurrentModule {
6767 let query = self.selection.select("currentModule");
6768 CurrentModule {
6769 proc: self.proc.clone(),
6770 selection: query,
6771 graphql_client: self.graphql_client.clone(),
6772 }
6773 }
6774 pub fn current_type_defs(&self) -> Vec<TypeDef> {
6776 let query = self.selection.select("currentTypeDefs");
6777 vec![TypeDef {
6778 proc: self.proc.clone(),
6779 selection: query,
6780 graphql_client: self.graphql_client.clone(),
6781 }]
6782 }
6783 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
6785 let query = self.selection.select("defaultPlatform");
6786 query.execute(self.graphql_client.clone()).await
6787 }
6788 pub fn directory(&self) -> Directory {
6790 let query = self.selection.select("directory");
6791 Directory {
6792 proc: self.proc.clone(),
6793 selection: query,
6794 graphql_client: self.graphql_client.clone(),
6795 }
6796 }
6797 pub fn engine(&self) -> Engine {
6799 let query = self.selection.select("engine");
6800 Engine {
6801 proc: self.proc.clone(),
6802 selection: query,
6803 graphql_client: self.graphql_client.clone(),
6804 }
6805 }
6806 pub fn error(&self, message: impl Into<String>) -> Error {
6812 let mut query = self.selection.select("error");
6813 query = query.arg("message", message.into());
6814 Error {
6815 proc: self.proc.clone(),
6816 selection: query,
6817 graphql_client: self.graphql_client.clone(),
6818 }
6819 }
6820 pub fn function(
6827 &self,
6828 name: impl Into<String>,
6829 return_type: impl IntoID<TypeDefId>,
6830 ) -> Function {
6831 let mut query = self.selection.select("function");
6832 query = query.arg("name", name.into());
6833 query = query.arg_lazy(
6834 "returnType",
6835 Box::new(move || {
6836 let return_type = return_type.clone();
6837 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
6838 }),
6839 );
6840 Function {
6841 proc: self.proc.clone(),
6842 selection: query,
6843 graphql_client: self.graphql_client.clone(),
6844 }
6845 }
6846 pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
6848 let mut query = self.selection.select("generatedCode");
6849 query = query.arg_lazy(
6850 "code",
6851 Box::new(move || {
6852 let code = code.clone();
6853 Box::pin(async move { code.into_id().await.unwrap().quote() })
6854 }),
6855 );
6856 GeneratedCode {
6857 proc: self.proc.clone(),
6858 selection: query,
6859 graphql_client: self.graphql_client.clone(),
6860 }
6861 }
6862 pub fn git(&self, url: impl Into<String>) -> GitRepository {
6873 let mut query = self.selection.select("git");
6874 query = query.arg("url", url.into());
6875 GitRepository {
6876 proc: self.proc.clone(),
6877 selection: query,
6878 graphql_client: self.graphql_client.clone(),
6879 }
6880 }
6881 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
6892 let mut query = self.selection.select("git");
6893 query = query.arg("url", url.into());
6894 if let Some(keep_git_dir) = opts.keep_git_dir {
6895 query = query.arg("keepGitDir", keep_git_dir);
6896 }
6897 if let Some(experimental_service_host) = opts.experimental_service_host {
6898 query = query.arg("experimentalServiceHost", experimental_service_host);
6899 }
6900 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
6901 query = query.arg("sshKnownHosts", ssh_known_hosts);
6902 }
6903 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
6904 query = query.arg("sshAuthSocket", ssh_auth_socket);
6905 }
6906 GitRepository {
6907 proc: self.proc.clone(),
6908 selection: query,
6909 graphql_client: self.graphql_client.clone(),
6910 }
6911 }
6912 pub fn host(&self) -> Host {
6914 let query = self.selection.select("host");
6915 Host {
6916 proc: self.proc.clone(),
6917 selection: query,
6918 graphql_client: self.graphql_client.clone(),
6919 }
6920 }
6921 pub fn http(&self, url: impl Into<String>) -> File {
6928 let mut query = self.selection.select("http");
6929 query = query.arg("url", url.into());
6930 File {
6931 proc: self.proc.clone(),
6932 selection: query,
6933 graphql_client: self.graphql_client.clone(),
6934 }
6935 }
6936 pub fn http_opts(&self, url: impl Into<String>, opts: QueryHttpOpts) -> File {
6943 let mut query = self.selection.select("http");
6944 query = query.arg("url", url.into());
6945 if let Some(experimental_service_host) = opts.experimental_service_host {
6946 query = query.arg("experimentalServiceHost", experimental_service_host);
6947 }
6948 File {
6949 proc: self.proc.clone(),
6950 selection: query,
6951 graphql_client: self.graphql_client.clone(),
6952 }
6953 }
6954 pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
6956 let mut query = self.selection.select("loadCacheVolumeFromID");
6957 query = query.arg_lazy(
6958 "id",
6959 Box::new(move || {
6960 let id = id.clone();
6961 Box::pin(async move { id.into_id().await.unwrap().quote() })
6962 }),
6963 );
6964 CacheVolume {
6965 proc: self.proc.clone(),
6966 selection: query,
6967 graphql_client: self.graphql_client.clone(),
6968 }
6969 }
6970 pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
6972 let mut query = self.selection.select("loadContainerFromID");
6973 query = query.arg_lazy(
6974 "id",
6975 Box::new(move || {
6976 let id = id.clone();
6977 Box::pin(async move { id.into_id().await.unwrap().quote() })
6978 }),
6979 );
6980 Container {
6981 proc: self.proc.clone(),
6982 selection: query,
6983 graphql_client: self.graphql_client.clone(),
6984 }
6985 }
6986 pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
6988 let mut query = self.selection.select("loadCurrentModuleFromID");
6989 query = query.arg_lazy(
6990 "id",
6991 Box::new(move || {
6992 let id = id.clone();
6993 Box::pin(async move { id.into_id().await.unwrap().quote() })
6994 }),
6995 );
6996 CurrentModule {
6997 proc: self.proc.clone(),
6998 selection: query,
6999 graphql_client: self.graphql_client.clone(),
7000 }
7001 }
7002 pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
7004 let mut query = self.selection.select("loadDirectoryFromID");
7005 query = query.arg_lazy(
7006 "id",
7007 Box::new(move || {
7008 let id = id.clone();
7009 Box::pin(async move { id.into_id().await.unwrap().quote() })
7010 }),
7011 );
7012 Directory {
7013 proc: self.proc.clone(),
7014 selection: query,
7015 graphql_client: self.graphql_client.clone(),
7016 }
7017 }
7018 pub fn load_engine_cache_entry_from_id(
7020 &self,
7021 id: impl IntoID<EngineCacheEntryId>,
7022 ) -> EngineCacheEntry {
7023 let mut query = self.selection.select("loadEngineCacheEntryFromID");
7024 query = query.arg_lazy(
7025 "id",
7026 Box::new(move || {
7027 let id = id.clone();
7028 Box::pin(async move { id.into_id().await.unwrap().quote() })
7029 }),
7030 );
7031 EngineCacheEntry {
7032 proc: self.proc.clone(),
7033 selection: query,
7034 graphql_client: self.graphql_client.clone(),
7035 }
7036 }
7037 pub fn load_engine_cache_entry_set_from_id(
7039 &self,
7040 id: impl IntoID<EngineCacheEntrySetId>,
7041 ) -> EngineCacheEntrySet {
7042 let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
7043 query = query.arg_lazy(
7044 "id",
7045 Box::new(move || {
7046 let id = id.clone();
7047 Box::pin(async move { id.into_id().await.unwrap().quote() })
7048 }),
7049 );
7050 EngineCacheEntrySet {
7051 proc: self.proc.clone(),
7052 selection: query,
7053 graphql_client: self.graphql_client.clone(),
7054 }
7055 }
7056 pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
7058 let mut query = self.selection.select("loadEngineCacheFromID");
7059 query = query.arg_lazy(
7060 "id",
7061 Box::new(move || {
7062 let id = id.clone();
7063 Box::pin(async move { id.into_id().await.unwrap().quote() })
7064 }),
7065 );
7066 EngineCache {
7067 proc: self.proc.clone(),
7068 selection: query,
7069 graphql_client: self.graphql_client.clone(),
7070 }
7071 }
7072 pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
7074 let mut query = self.selection.select("loadEngineFromID");
7075 query = query.arg_lazy(
7076 "id",
7077 Box::new(move || {
7078 let id = id.clone();
7079 Box::pin(async move { id.into_id().await.unwrap().quote() })
7080 }),
7081 );
7082 Engine {
7083 proc: self.proc.clone(),
7084 selection: query,
7085 graphql_client: self.graphql_client.clone(),
7086 }
7087 }
7088 pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
7090 let mut query = self.selection.select("loadEnumTypeDefFromID");
7091 query = query.arg_lazy(
7092 "id",
7093 Box::new(move || {
7094 let id = id.clone();
7095 Box::pin(async move { id.into_id().await.unwrap().quote() })
7096 }),
7097 );
7098 EnumTypeDef {
7099 proc: self.proc.clone(),
7100 selection: query,
7101 graphql_client: self.graphql_client.clone(),
7102 }
7103 }
7104 pub fn load_enum_value_type_def_from_id(
7106 &self,
7107 id: impl IntoID<EnumValueTypeDefId>,
7108 ) -> EnumValueTypeDef {
7109 let mut query = self.selection.select("loadEnumValueTypeDefFromID");
7110 query = query.arg_lazy(
7111 "id",
7112 Box::new(move || {
7113 let id = id.clone();
7114 Box::pin(async move { id.into_id().await.unwrap().quote() })
7115 }),
7116 );
7117 EnumValueTypeDef {
7118 proc: self.proc.clone(),
7119 selection: query,
7120 graphql_client: self.graphql_client.clone(),
7121 }
7122 }
7123 pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
7125 let mut query = self.selection.select("loadEnvVariableFromID");
7126 query = query.arg_lazy(
7127 "id",
7128 Box::new(move || {
7129 let id = id.clone();
7130 Box::pin(async move { id.into_id().await.unwrap().quote() })
7131 }),
7132 );
7133 EnvVariable {
7134 proc: self.proc.clone(),
7135 selection: query,
7136 graphql_client: self.graphql_client.clone(),
7137 }
7138 }
7139 pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
7141 let mut query = self.selection.select("loadErrorFromID");
7142 query = query.arg_lazy(
7143 "id",
7144 Box::new(move || {
7145 let id = id.clone();
7146 Box::pin(async move { id.into_id().await.unwrap().quote() })
7147 }),
7148 );
7149 Error {
7150 proc: self.proc.clone(),
7151 selection: query,
7152 graphql_client: self.graphql_client.clone(),
7153 }
7154 }
7155 pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
7157 let mut query = self.selection.select("loadFieldTypeDefFromID");
7158 query = query.arg_lazy(
7159 "id",
7160 Box::new(move || {
7161 let id = id.clone();
7162 Box::pin(async move { id.into_id().await.unwrap().quote() })
7163 }),
7164 );
7165 FieldTypeDef {
7166 proc: self.proc.clone(),
7167 selection: query,
7168 graphql_client: self.graphql_client.clone(),
7169 }
7170 }
7171 pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
7173 let mut query = self.selection.select("loadFileFromID");
7174 query = query.arg_lazy(
7175 "id",
7176 Box::new(move || {
7177 let id = id.clone();
7178 Box::pin(async move { id.into_id().await.unwrap().quote() })
7179 }),
7180 );
7181 File {
7182 proc: self.proc.clone(),
7183 selection: query,
7184 graphql_client: self.graphql_client.clone(),
7185 }
7186 }
7187 pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
7189 let mut query = self.selection.select("loadFunctionArgFromID");
7190 query = query.arg_lazy(
7191 "id",
7192 Box::new(move || {
7193 let id = id.clone();
7194 Box::pin(async move { id.into_id().await.unwrap().quote() })
7195 }),
7196 );
7197 FunctionArg {
7198 proc: self.proc.clone(),
7199 selection: query,
7200 graphql_client: self.graphql_client.clone(),
7201 }
7202 }
7203 pub fn load_function_call_arg_value_from_id(
7205 &self,
7206 id: impl IntoID<FunctionCallArgValueId>,
7207 ) -> FunctionCallArgValue {
7208 let mut query = self.selection.select("loadFunctionCallArgValueFromID");
7209 query = query.arg_lazy(
7210 "id",
7211 Box::new(move || {
7212 let id = id.clone();
7213 Box::pin(async move { id.into_id().await.unwrap().quote() })
7214 }),
7215 );
7216 FunctionCallArgValue {
7217 proc: self.proc.clone(),
7218 selection: query,
7219 graphql_client: self.graphql_client.clone(),
7220 }
7221 }
7222 pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
7224 let mut query = self.selection.select("loadFunctionCallFromID");
7225 query = query.arg_lazy(
7226 "id",
7227 Box::new(move || {
7228 let id = id.clone();
7229 Box::pin(async move { id.into_id().await.unwrap().quote() })
7230 }),
7231 );
7232 FunctionCall {
7233 proc: self.proc.clone(),
7234 selection: query,
7235 graphql_client: self.graphql_client.clone(),
7236 }
7237 }
7238 pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
7240 let mut query = self.selection.select("loadFunctionFromID");
7241 query = query.arg_lazy(
7242 "id",
7243 Box::new(move || {
7244 let id = id.clone();
7245 Box::pin(async move { id.into_id().await.unwrap().quote() })
7246 }),
7247 );
7248 Function {
7249 proc: self.proc.clone(),
7250 selection: query,
7251 graphql_client: self.graphql_client.clone(),
7252 }
7253 }
7254 pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
7256 let mut query = self.selection.select("loadGeneratedCodeFromID");
7257 query = query.arg_lazy(
7258 "id",
7259 Box::new(move || {
7260 let id = id.clone();
7261 Box::pin(async move { id.into_id().await.unwrap().quote() })
7262 }),
7263 );
7264 GeneratedCode {
7265 proc: self.proc.clone(),
7266 selection: query,
7267 graphql_client: self.graphql_client.clone(),
7268 }
7269 }
7270 pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
7272 let mut query = self.selection.select("loadGitRefFromID");
7273 query = query.arg_lazy(
7274 "id",
7275 Box::new(move || {
7276 let id = id.clone();
7277 Box::pin(async move { id.into_id().await.unwrap().quote() })
7278 }),
7279 );
7280 GitRef {
7281 proc: self.proc.clone(),
7282 selection: query,
7283 graphql_client: self.graphql_client.clone(),
7284 }
7285 }
7286 pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
7288 let mut query = self.selection.select("loadGitRepositoryFromID");
7289 query = query.arg_lazy(
7290 "id",
7291 Box::new(move || {
7292 let id = id.clone();
7293 Box::pin(async move { id.into_id().await.unwrap().quote() })
7294 }),
7295 );
7296 GitRepository {
7297 proc: self.proc.clone(),
7298 selection: query,
7299 graphql_client: self.graphql_client.clone(),
7300 }
7301 }
7302 pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
7304 let mut query = self.selection.select("loadHostFromID");
7305 query = query.arg_lazy(
7306 "id",
7307 Box::new(move || {
7308 let id = id.clone();
7309 Box::pin(async move { id.into_id().await.unwrap().quote() })
7310 }),
7311 );
7312 Host {
7313 proc: self.proc.clone(),
7314 selection: query,
7315 graphql_client: self.graphql_client.clone(),
7316 }
7317 }
7318 pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
7320 let mut query = self.selection.select("loadInputTypeDefFromID");
7321 query = query.arg_lazy(
7322 "id",
7323 Box::new(move || {
7324 let id = id.clone();
7325 Box::pin(async move { id.into_id().await.unwrap().quote() })
7326 }),
7327 );
7328 InputTypeDef {
7329 proc: self.proc.clone(),
7330 selection: query,
7331 graphql_client: self.graphql_client.clone(),
7332 }
7333 }
7334 pub fn load_interface_type_def_from_id(
7336 &self,
7337 id: impl IntoID<InterfaceTypeDefId>,
7338 ) -> InterfaceTypeDef {
7339 let mut query = self.selection.select("loadInterfaceTypeDefFromID");
7340 query = query.arg_lazy(
7341 "id",
7342 Box::new(move || {
7343 let id = id.clone();
7344 Box::pin(async move { id.into_id().await.unwrap().quote() })
7345 }),
7346 );
7347 InterfaceTypeDef {
7348 proc: self.proc.clone(),
7349 selection: query,
7350 graphql_client: self.graphql_client.clone(),
7351 }
7352 }
7353 pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
7355 let mut query = self.selection.select("loadLabelFromID");
7356 query = query.arg_lazy(
7357 "id",
7358 Box::new(move || {
7359 let id = id.clone();
7360 Box::pin(async move { id.into_id().await.unwrap().quote() })
7361 }),
7362 );
7363 Label {
7364 proc: self.proc.clone(),
7365 selection: query,
7366 graphql_client: self.graphql_client.clone(),
7367 }
7368 }
7369 pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
7371 let mut query = self.selection.select("loadListTypeDefFromID");
7372 query = query.arg_lazy(
7373 "id",
7374 Box::new(move || {
7375 let id = id.clone();
7376 Box::pin(async move { id.into_id().await.unwrap().quote() })
7377 }),
7378 );
7379 ListTypeDef {
7380 proc: self.proc.clone(),
7381 selection: query,
7382 graphql_client: self.graphql_client.clone(),
7383 }
7384 }
7385 pub fn load_module_config_client_from_id(
7387 &self,
7388 id: impl IntoID<ModuleConfigClientId>,
7389 ) -> ModuleConfigClient {
7390 let mut query = self.selection.select("loadModuleConfigClientFromID");
7391 query = query.arg_lazy(
7392 "id",
7393 Box::new(move || {
7394 let id = id.clone();
7395 Box::pin(async move { id.into_id().await.unwrap().quote() })
7396 }),
7397 );
7398 ModuleConfigClient {
7399 proc: self.proc.clone(),
7400 selection: query,
7401 graphql_client: self.graphql_client.clone(),
7402 }
7403 }
7404 pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
7406 let mut query = self.selection.select("loadModuleFromID");
7407 query = query.arg_lazy(
7408 "id",
7409 Box::new(move || {
7410 let id = id.clone();
7411 Box::pin(async move { id.into_id().await.unwrap().quote() })
7412 }),
7413 );
7414 Module {
7415 proc: self.proc.clone(),
7416 selection: query,
7417 graphql_client: self.graphql_client.clone(),
7418 }
7419 }
7420 pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
7422 let mut query = self.selection.select("loadModuleSourceFromID");
7423 query = query.arg_lazy(
7424 "id",
7425 Box::new(move || {
7426 let id = id.clone();
7427 Box::pin(async move { id.into_id().await.unwrap().quote() })
7428 }),
7429 );
7430 ModuleSource {
7431 proc: self.proc.clone(),
7432 selection: query,
7433 graphql_client: self.graphql_client.clone(),
7434 }
7435 }
7436 pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
7438 let mut query = self.selection.select("loadObjectTypeDefFromID");
7439 query = query.arg_lazy(
7440 "id",
7441 Box::new(move || {
7442 let id = id.clone();
7443 Box::pin(async move { id.into_id().await.unwrap().quote() })
7444 }),
7445 );
7446 ObjectTypeDef {
7447 proc: self.proc.clone(),
7448 selection: query,
7449 graphql_client: self.graphql_client.clone(),
7450 }
7451 }
7452 pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
7454 let mut query = self.selection.select("loadPortFromID");
7455 query = query.arg_lazy(
7456 "id",
7457 Box::new(move || {
7458 let id = id.clone();
7459 Box::pin(async move { id.into_id().await.unwrap().quote() })
7460 }),
7461 );
7462 Port {
7463 proc: self.proc.clone(),
7464 selection: query,
7465 graphql_client: self.graphql_client.clone(),
7466 }
7467 }
7468 pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
7470 let mut query = self.selection.select("loadSDKConfigFromID");
7471 query = query.arg_lazy(
7472 "id",
7473 Box::new(move || {
7474 let id = id.clone();
7475 Box::pin(async move { id.into_id().await.unwrap().quote() })
7476 }),
7477 );
7478 SdkConfig {
7479 proc: self.proc.clone(),
7480 selection: query,
7481 graphql_client: self.graphql_client.clone(),
7482 }
7483 }
7484 pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
7486 let mut query = self.selection.select("loadScalarTypeDefFromID");
7487 query = query.arg_lazy(
7488 "id",
7489 Box::new(move || {
7490 let id = id.clone();
7491 Box::pin(async move { id.into_id().await.unwrap().quote() })
7492 }),
7493 );
7494 ScalarTypeDef {
7495 proc: self.proc.clone(),
7496 selection: query,
7497 graphql_client: self.graphql_client.clone(),
7498 }
7499 }
7500 pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
7502 let mut query = self.selection.select("loadSecretFromID");
7503 query = query.arg_lazy(
7504 "id",
7505 Box::new(move || {
7506 let id = id.clone();
7507 Box::pin(async move { id.into_id().await.unwrap().quote() })
7508 }),
7509 );
7510 Secret {
7511 proc: self.proc.clone(),
7512 selection: query,
7513 graphql_client: self.graphql_client.clone(),
7514 }
7515 }
7516 pub fn load_secret_from_name(&self, name: impl Into<String>) -> Secret {
7522 let mut query = self.selection.select("loadSecretFromName");
7523 query = query.arg("name", name.into());
7524 Secret {
7525 proc: self.proc.clone(),
7526 selection: query,
7527 graphql_client: self.graphql_client.clone(),
7528 }
7529 }
7530 pub fn load_secret_from_name_opts<'a>(
7536 &self,
7537 name: impl Into<String>,
7538 opts: QueryLoadSecretFromNameOpts<'a>,
7539 ) -> Secret {
7540 let mut query = self.selection.select("loadSecretFromName");
7541 query = query.arg("name", name.into());
7542 if let Some(accessor) = opts.accessor {
7543 query = query.arg("accessor", accessor);
7544 }
7545 Secret {
7546 proc: self.proc.clone(),
7547 selection: query,
7548 graphql_client: self.graphql_client.clone(),
7549 }
7550 }
7551 pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
7553 let mut query = self.selection.select("loadServiceFromID");
7554 query = query.arg_lazy(
7555 "id",
7556 Box::new(move || {
7557 let id = id.clone();
7558 Box::pin(async move { id.into_id().await.unwrap().quote() })
7559 }),
7560 );
7561 Service {
7562 proc: self.proc.clone(),
7563 selection: query,
7564 graphql_client: self.graphql_client.clone(),
7565 }
7566 }
7567 pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
7569 let mut query = self.selection.select("loadSocketFromID");
7570 query = query.arg_lazy(
7571 "id",
7572 Box::new(move || {
7573 let id = id.clone();
7574 Box::pin(async move { id.into_id().await.unwrap().quote() })
7575 }),
7576 );
7577 Socket {
7578 proc: self.proc.clone(),
7579 selection: query,
7580 graphql_client: self.graphql_client.clone(),
7581 }
7582 }
7583 pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
7585 let mut query = self.selection.select("loadSourceMapFromID");
7586 query = query.arg_lazy(
7587 "id",
7588 Box::new(move || {
7589 let id = id.clone();
7590 Box::pin(async move { id.into_id().await.unwrap().quote() })
7591 }),
7592 );
7593 SourceMap {
7594 proc: self.proc.clone(),
7595 selection: query,
7596 graphql_client: self.graphql_client.clone(),
7597 }
7598 }
7599 pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
7601 let mut query = self.selection.select("loadTerminalFromID");
7602 query = query.arg_lazy(
7603 "id",
7604 Box::new(move || {
7605 let id = id.clone();
7606 Box::pin(async move { id.into_id().await.unwrap().quote() })
7607 }),
7608 );
7609 Terminal {
7610 proc: self.proc.clone(),
7611 selection: query,
7612 graphql_client: self.graphql_client.clone(),
7613 }
7614 }
7615 pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
7617 let mut query = self.selection.select("loadTypeDefFromID");
7618 query = query.arg_lazy(
7619 "id",
7620 Box::new(move || {
7621 let id = id.clone();
7622 Box::pin(async move { id.into_id().await.unwrap().quote() })
7623 }),
7624 );
7625 TypeDef {
7626 proc: self.proc.clone(),
7627 selection: query,
7628 graphql_client: self.graphql_client.clone(),
7629 }
7630 }
7631 pub fn module(&self) -> Module {
7633 let query = self.selection.select("module");
7634 Module {
7635 proc: self.proc.clone(),
7636 selection: query,
7637 graphql_client: self.graphql_client.clone(),
7638 }
7639 }
7640 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
7647 let mut query = self.selection.select("moduleSource");
7648 query = query.arg("refString", ref_string.into());
7649 ModuleSource {
7650 proc: self.proc.clone(),
7651 selection: query,
7652 graphql_client: self.graphql_client.clone(),
7653 }
7654 }
7655 pub fn module_source_opts<'a>(
7662 &self,
7663 ref_string: impl Into<String>,
7664 opts: QueryModuleSourceOpts<'a>,
7665 ) -> ModuleSource {
7666 let mut query = self.selection.select("moduleSource");
7667 query = query.arg("refString", ref_string.into());
7668 if let Some(ref_pin) = opts.ref_pin {
7669 query = query.arg("refPin", ref_pin);
7670 }
7671 if let Some(disable_find_up) = opts.disable_find_up {
7672 query = query.arg("disableFindUp", disable_find_up);
7673 }
7674 if let Some(allow_not_exists) = opts.allow_not_exists {
7675 query = query.arg("allowNotExists", allow_not_exists);
7676 }
7677 if let Some(require_kind) = opts.require_kind {
7678 query = query.arg("requireKind", require_kind);
7679 }
7680 ModuleSource {
7681 proc: self.proc.clone(),
7682 selection: query,
7683 graphql_client: self.graphql_client.clone(),
7684 }
7685 }
7686 pub fn secret(&self, uri: impl Into<String>) -> Secret {
7692 let mut query = self.selection.select("secret");
7693 query = query.arg("uri", uri.into());
7694 Secret {
7695 proc: self.proc.clone(),
7696 selection: query,
7697 graphql_client: self.graphql_client.clone(),
7698 }
7699 }
7700 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
7708 let mut query = self.selection.select("setSecret");
7709 query = query.arg("name", name.into());
7710 query = query.arg("plaintext", plaintext.into());
7711 Secret {
7712 proc: self.proc.clone(),
7713 selection: query,
7714 graphql_client: self.graphql_client.clone(),
7715 }
7716 }
7717 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
7725 let mut query = self.selection.select("sourceMap");
7726 query = query.arg("filename", filename.into());
7727 query = query.arg("line", line);
7728 query = query.arg("column", column);
7729 SourceMap {
7730 proc: self.proc.clone(),
7731 selection: query,
7732 graphql_client: self.graphql_client.clone(),
7733 }
7734 }
7735 pub fn type_def(&self) -> TypeDef {
7737 let query = self.selection.select("typeDef");
7738 TypeDef {
7739 proc: self.proc.clone(),
7740 selection: query,
7741 graphql_client: self.graphql_client.clone(),
7742 }
7743 }
7744 pub async fn version(&self) -> Result<String, DaggerError> {
7746 let query = self.selection.select("version");
7747 query.execute(self.graphql_client.clone()).await
7748 }
7749}
7750#[derive(Clone)]
7751pub struct SdkConfig {
7752 pub proc: Option<Arc<DaggerSessionProc>>,
7753 pub selection: Selection,
7754 pub graphql_client: DynGraphQLClient,
7755}
7756impl SdkConfig {
7757 pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
7759 let query = self.selection.select("id");
7760 query.execute(self.graphql_client.clone()).await
7761 }
7762 pub async fn source(&self) -> Result<String, DaggerError> {
7764 let query = self.selection.select("source");
7765 query.execute(self.graphql_client.clone()).await
7766 }
7767}
7768#[derive(Clone)]
7769pub struct ScalarTypeDef {
7770 pub proc: Option<Arc<DaggerSessionProc>>,
7771 pub selection: Selection,
7772 pub graphql_client: DynGraphQLClient,
7773}
7774impl ScalarTypeDef {
7775 pub async fn description(&self) -> Result<String, DaggerError> {
7777 let query = self.selection.select("description");
7778 query.execute(self.graphql_client.clone()).await
7779 }
7780 pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
7782 let query = self.selection.select("id");
7783 query.execute(self.graphql_client.clone()).await
7784 }
7785 pub async fn name(&self) -> Result<String, DaggerError> {
7787 let query = self.selection.select("name");
7788 query.execute(self.graphql_client.clone()).await
7789 }
7790 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
7792 let query = self.selection.select("sourceModuleName");
7793 query.execute(self.graphql_client.clone()).await
7794 }
7795}
7796#[derive(Clone)]
7797pub struct Secret {
7798 pub proc: Option<Arc<DaggerSessionProc>>,
7799 pub selection: Selection,
7800 pub graphql_client: DynGraphQLClient,
7801}
7802impl Secret {
7803 pub async fn id(&self) -> Result<SecretId, DaggerError> {
7805 let query = self.selection.select("id");
7806 query.execute(self.graphql_client.clone()).await
7807 }
7808 pub async fn name(&self) -> Result<String, DaggerError> {
7810 let query = self.selection.select("name");
7811 query.execute(self.graphql_client.clone()).await
7812 }
7813 pub async fn plaintext(&self) -> Result<String, DaggerError> {
7815 let query = self.selection.select("plaintext");
7816 query.execute(self.graphql_client.clone()).await
7817 }
7818 pub async fn uri(&self) -> Result<String, DaggerError> {
7820 let query = self.selection.select("uri");
7821 query.execute(self.graphql_client.clone()).await
7822 }
7823}
7824#[derive(Clone)]
7825pub struct Service {
7826 pub proc: Option<Arc<DaggerSessionProc>>,
7827 pub selection: Selection,
7828 pub graphql_client: DynGraphQLClient,
7829}
7830#[derive(Builder, Debug, PartialEq)]
7831pub struct ServiceEndpointOpts<'a> {
7832 #[builder(setter(into, strip_option), default)]
7834 pub port: Option<isize>,
7835 #[builder(setter(into, strip_option), default)]
7837 pub scheme: Option<&'a str>,
7838}
7839#[derive(Builder, Debug, PartialEq)]
7840pub struct ServiceStopOpts {
7841 #[builder(setter(into, strip_option), default)]
7843 pub kill: Option<bool>,
7844}
7845#[derive(Builder, Debug, PartialEq)]
7846pub struct ServiceUpOpts {
7847 #[builder(setter(into, strip_option), default)]
7850 pub ports: Option<Vec<PortForward>>,
7851 #[builder(setter(into, strip_option), default)]
7853 pub random: Option<bool>,
7854}
7855impl Service {
7856 pub async fn endpoint(&self) -> Result<String, DaggerError> {
7864 let query = self.selection.select("endpoint");
7865 query.execute(self.graphql_client.clone()).await
7866 }
7867 pub async fn endpoint_opts<'a>(
7875 &self,
7876 opts: ServiceEndpointOpts<'a>,
7877 ) -> Result<String, DaggerError> {
7878 let mut query = self.selection.select("endpoint");
7879 if let Some(port) = opts.port {
7880 query = query.arg("port", port);
7881 }
7882 if let Some(scheme) = opts.scheme {
7883 query = query.arg("scheme", scheme);
7884 }
7885 query.execute(self.graphql_client.clone()).await
7886 }
7887 pub async fn hostname(&self) -> Result<String, DaggerError> {
7889 let query = self.selection.select("hostname");
7890 query.execute(self.graphql_client.clone()).await
7891 }
7892 pub async fn id(&self) -> Result<ServiceId, DaggerError> {
7894 let query = self.selection.select("id");
7895 query.execute(self.graphql_client.clone()).await
7896 }
7897 pub fn ports(&self) -> Vec<Port> {
7899 let query = self.selection.select("ports");
7900 vec![Port {
7901 proc: self.proc.clone(),
7902 selection: query,
7903 graphql_client: self.graphql_client.clone(),
7904 }]
7905 }
7906 pub async fn start(&self) -> Result<ServiceId, DaggerError> {
7909 let query = self.selection.select("start");
7910 query.execute(self.graphql_client.clone()).await
7911 }
7912 pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
7918 let query = self.selection.select("stop");
7919 query.execute(self.graphql_client.clone()).await
7920 }
7921 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
7927 let mut query = self.selection.select("stop");
7928 if let Some(kill) = opts.kill {
7929 query = query.arg("kill", kill);
7930 }
7931 query.execute(self.graphql_client.clone()).await
7932 }
7933 pub async fn up(&self) -> Result<Void, DaggerError> {
7939 let query = self.selection.select("up");
7940 query.execute(self.graphql_client.clone()).await
7941 }
7942 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
7948 let mut query = self.selection.select("up");
7949 if let Some(ports) = opts.ports {
7950 query = query.arg("ports", ports);
7951 }
7952 if let Some(random) = opts.random {
7953 query = query.arg("random", random);
7954 }
7955 query.execute(self.graphql_client.clone()).await
7956 }
7957 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
7963 let mut query = self.selection.select("withHostname");
7964 query = query.arg("hostname", hostname.into());
7965 Service {
7966 proc: self.proc.clone(),
7967 selection: query,
7968 graphql_client: self.graphql_client.clone(),
7969 }
7970 }
7971}
7972#[derive(Clone)]
7973pub struct Socket {
7974 pub proc: Option<Arc<DaggerSessionProc>>,
7975 pub selection: Selection,
7976 pub graphql_client: DynGraphQLClient,
7977}
7978impl Socket {
7979 pub async fn id(&self) -> Result<SocketId, DaggerError> {
7981 let query = self.selection.select("id");
7982 query.execute(self.graphql_client.clone()).await
7983 }
7984}
7985#[derive(Clone)]
7986pub struct SourceMap {
7987 pub proc: Option<Arc<DaggerSessionProc>>,
7988 pub selection: Selection,
7989 pub graphql_client: DynGraphQLClient,
7990}
7991impl SourceMap {
7992 pub async fn column(&self) -> Result<isize, DaggerError> {
7994 let query = self.selection.select("column");
7995 query.execute(self.graphql_client.clone()).await
7996 }
7997 pub async fn filename(&self) -> Result<String, DaggerError> {
7999 let query = self.selection.select("filename");
8000 query.execute(self.graphql_client.clone()).await
8001 }
8002 pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
8004 let query = self.selection.select("id");
8005 query.execute(self.graphql_client.clone()).await
8006 }
8007 pub async fn line(&self) -> Result<isize, DaggerError> {
8009 let query = self.selection.select("line");
8010 query.execute(self.graphql_client.clone()).await
8011 }
8012 pub async fn module(&self) -> Result<String, DaggerError> {
8014 let query = self.selection.select("module");
8015 query.execute(self.graphql_client.clone()).await
8016 }
8017}
8018#[derive(Clone)]
8019pub struct Terminal {
8020 pub proc: Option<Arc<DaggerSessionProc>>,
8021 pub selection: Selection,
8022 pub graphql_client: DynGraphQLClient,
8023}
8024impl Terminal {
8025 pub async fn id(&self) -> Result<TerminalId, DaggerError> {
8027 let query = self.selection.select("id");
8028 query.execute(self.graphql_client.clone()).await
8029 }
8030 pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
8033 let query = self.selection.select("sync");
8034 query.execute(self.graphql_client.clone()).await
8035 }
8036}
8037#[derive(Clone)]
8038pub struct TypeDef {
8039 pub proc: Option<Arc<DaggerSessionProc>>,
8040 pub selection: Selection,
8041 pub graphql_client: DynGraphQLClient,
8042}
8043#[derive(Builder, Debug, PartialEq)]
8044pub struct TypeDefWithEnumOpts<'a> {
8045 #[builder(setter(into, strip_option), default)]
8047 pub description: Option<&'a str>,
8048 #[builder(setter(into, strip_option), default)]
8050 pub source_map: Option<SourceMapId>,
8051}
8052#[derive(Builder, Debug, PartialEq)]
8053pub struct TypeDefWithEnumValueOpts<'a> {
8054 #[builder(setter(into, strip_option), default)]
8056 pub description: Option<&'a str>,
8057 #[builder(setter(into, strip_option), default)]
8059 pub source_map: Option<SourceMapId>,
8060}
8061#[derive(Builder, Debug, PartialEq)]
8062pub struct TypeDefWithFieldOpts<'a> {
8063 #[builder(setter(into, strip_option), default)]
8065 pub description: Option<&'a str>,
8066 #[builder(setter(into, strip_option), default)]
8068 pub source_map: Option<SourceMapId>,
8069}
8070#[derive(Builder, Debug, PartialEq)]
8071pub struct TypeDefWithInterfaceOpts<'a> {
8072 #[builder(setter(into, strip_option), default)]
8073 pub description: Option<&'a str>,
8074 #[builder(setter(into, strip_option), default)]
8075 pub source_map: Option<SourceMapId>,
8076}
8077#[derive(Builder, Debug, PartialEq)]
8078pub struct TypeDefWithObjectOpts<'a> {
8079 #[builder(setter(into, strip_option), default)]
8080 pub description: Option<&'a str>,
8081 #[builder(setter(into, strip_option), default)]
8082 pub source_map: Option<SourceMapId>,
8083}
8084#[derive(Builder, Debug, PartialEq)]
8085pub struct TypeDefWithScalarOpts<'a> {
8086 #[builder(setter(into, strip_option), default)]
8087 pub description: Option<&'a str>,
8088}
8089impl TypeDef {
8090 pub fn as_enum(&self) -> EnumTypeDef {
8092 let query = self.selection.select("asEnum");
8093 EnumTypeDef {
8094 proc: self.proc.clone(),
8095 selection: query,
8096 graphql_client: self.graphql_client.clone(),
8097 }
8098 }
8099 pub fn as_input(&self) -> InputTypeDef {
8101 let query = self.selection.select("asInput");
8102 InputTypeDef {
8103 proc: self.proc.clone(),
8104 selection: query,
8105 graphql_client: self.graphql_client.clone(),
8106 }
8107 }
8108 pub fn as_interface(&self) -> InterfaceTypeDef {
8110 let query = self.selection.select("asInterface");
8111 InterfaceTypeDef {
8112 proc: self.proc.clone(),
8113 selection: query,
8114 graphql_client: self.graphql_client.clone(),
8115 }
8116 }
8117 pub fn as_list(&self) -> ListTypeDef {
8119 let query = self.selection.select("asList");
8120 ListTypeDef {
8121 proc: self.proc.clone(),
8122 selection: query,
8123 graphql_client: self.graphql_client.clone(),
8124 }
8125 }
8126 pub fn as_object(&self) -> ObjectTypeDef {
8128 let query = self.selection.select("asObject");
8129 ObjectTypeDef {
8130 proc: self.proc.clone(),
8131 selection: query,
8132 graphql_client: self.graphql_client.clone(),
8133 }
8134 }
8135 pub fn as_scalar(&self) -> ScalarTypeDef {
8137 let query = self.selection.select("asScalar");
8138 ScalarTypeDef {
8139 proc: self.proc.clone(),
8140 selection: query,
8141 graphql_client: self.graphql_client.clone(),
8142 }
8143 }
8144 pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
8146 let query = self.selection.select("id");
8147 query.execute(self.graphql_client.clone()).await
8148 }
8149 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
8151 let query = self.selection.select("kind");
8152 query.execute(self.graphql_client.clone()).await
8153 }
8154 pub async fn optional(&self) -> Result<bool, DaggerError> {
8156 let query = self.selection.select("optional");
8157 query.execute(self.graphql_client.clone()).await
8158 }
8159 pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
8161 let mut query = self.selection.select("withConstructor");
8162 query = query.arg_lazy(
8163 "function",
8164 Box::new(move || {
8165 let function = function.clone();
8166 Box::pin(async move { function.into_id().await.unwrap().quote() })
8167 }),
8168 );
8169 TypeDef {
8170 proc: self.proc.clone(),
8171 selection: query,
8172 graphql_client: self.graphql_client.clone(),
8173 }
8174 }
8175 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
8183 let mut query = self.selection.select("withEnum");
8184 query = query.arg("name", name.into());
8185 TypeDef {
8186 proc: self.proc.clone(),
8187 selection: query,
8188 graphql_client: self.graphql_client.clone(),
8189 }
8190 }
8191 pub fn with_enum_opts<'a>(
8199 &self,
8200 name: impl Into<String>,
8201 opts: TypeDefWithEnumOpts<'a>,
8202 ) -> TypeDef {
8203 let mut query = self.selection.select("withEnum");
8204 query = query.arg("name", name.into());
8205 if let Some(description) = opts.description {
8206 query = query.arg("description", description);
8207 }
8208 if let Some(source_map) = opts.source_map {
8209 query = query.arg("sourceMap", source_map);
8210 }
8211 TypeDef {
8212 proc: self.proc.clone(),
8213 selection: query,
8214 graphql_client: self.graphql_client.clone(),
8215 }
8216 }
8217 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
8224 let mut query = self.selection.select("withEnumValue");
8225 query = query.arg("value", value.into());
8226 TypeDef {
8227 proc: self.proc.clone(),
8228 selection: query,
8229 graphql_client: self.graphql_client.clone(),
8230 }
8231 }
8232 pub fn with_enum_value_opts<'a>(
8239 &self,
8240 value: impl Into<String>,
8241 opts: TypeDefWithEnumValueOpts<'a>,
8242 ) -> TypeDef {
8243 let mut query = self.selection.select("withEnumValue");
8244 query = query.arg("value", value.into());
8245 if let Some(description) = opts.description {
8246 query = query.arg("description", description);
8247 }
8248 if let Some(source_map) = opts.source_map {
8249 query = query.arg("sourceMap", source_map);
8250 }
8251 TypeDef {
8252 proc: self.proc.clone(),
8253 selection: query,
8254 graphql_client: self.graphql_client.clone(),
8255 }
8256 }
8257 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
8265 let mut query = self.selection.select("withField");
8266 query = query.arg("name", name.into());
8267 query = query.arg_lazy(
8268 "typeDef",
8269 Box::new(move || {
8270 let type_def = type_def.clone();
8271 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8272 }),
8273 );
8274 TypeDef {
8275 proc: self.proc.clone(),
8276 selection: query,
8277 graphql_client: self.graphql_client.clone(),
8278 }
8279 }
8280 pub fn with_field_opts<'a>(
8288 &self,
8289 name: impl Into<String>,
8290 type_def: impl IntoID<TypeDefId>,
8291 opts: TypeDefWithFieldOpts<'a>,
8292 ) -> TypeDef {
8293 let mut query = self.selection.select("withField");
8294 query = query.arg("name", name.into());
8295 query = query.arg_lazy(
8296 "typeDef",
8297 Box::new(move || {
8298 let type_def = type_def.clone();
8299 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8300 }),
8301 );
8302 if let Some(description) = opts.description {
8303 query = query.arg("description", description);
8304 }
8305 if let Some(source_map) = opts.source_map {
8306 query = query.arg("sourceMap", source_map);
8307 }
8308 TypeDef {
8309 proc: self.proc.clone(),
8310 selection: query,
8311 graphql_client: self.graphql_client.clone(),
8312 }
8313 }
8314 pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
8316 let mut query = self.selection.select("withFunction");
8317 query = query.arg_lazy(
8318 "function",
8319 Box::new(move || {
8320 let function = function.clone();
8321 Box::pin(async move { function.into_id().await.unwrap().quote() })
8322 }),
8323 );
8324 TypeDef {
8325 proc: self.proc.clone(),
8326 selection: query,
8327 graphql_client: self.graphql_client.clone(),
8328 }
8329 }
8330 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
8336 let mut query = self.selection.select("withInterface");
8337 query = query.arg("name", name.into());
8338 TypeDef {
8339 proc: self.proc.clone(),
8340 selection: query,
8341 graphql_client: self.graphql_client.clone(),
8342 }
8343 }
8344 pub fn with_interface_opts<'a>(
8350 &self,
8351 name: impl Into<String>,
8352 opts: TypeDefWithInterfaceOpts<'a>,
8353 ) -> TypeDef {
8354 let mut query = self.selection.select("withInterface");
8355 query = query.arg("name", name.into());
8356 if let Some(description) = opts.description {
8357 query = query.arg("description", description);
8358 }
8359 if let Some(source_map) = opts.source_map {
8360 query = query.arg("sourceMap", source_map);
8361 }
8362 TypeDef {
8363 proc: self.proc.clone(),
8364 selection: query,
8365 graphql_client: self.graphql_client.clone(),
8366 }
8367 }
8368 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
8370 let mut query = self.selection.select("withKind");
8371 query = query.arg("kind", kind);
8372 TypeDef {
8373 proc: self.proc.clone(),
8374 selection: query,
8375 graphql_client: self.graphql_client.clone(),
8376 }
8377 }
8378 pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
8380 let mut query = self.selection.select("withListOf");
8381 query = query.arg_lazy(
8382 "elementType",
8383 Box::new(move || {
8384 let element_type = element_type.clone();
8385 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
8386 }),
8387 );
8388 TypeDef {
8389 proc: self.proc.clone(),
8390 selection: query,
8391 graphql_client: self.graphql_client.clone(),
8392 }
8393 }
8394 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
8401 let mut query = self.selection.select("withObject");
8402 query = query.arg("name", name.into());
8403 TypeDef {
8404 proc: self.proc.clone(),
8405 selection: query,
8406 graphql_client: self.graphql_client.clone(),
8407 }
8408 }
8409 pub fn with_object_opts<'a>(
8416 &self,
8417 name: impl Into<String>,
8418 opts: TypeDefWithObjectOpts<'a>,
8419 ) -> TypeDef {
8420 let mut query = self.selection.select("withObject");
8421 query = query.arg("name", name.into());
8422 if let Some(description) = opts.description {
8423 query = query.arg("description", description);
8424 }
8425 if let Some(source_map) = opts.source_map {
8426 query = query.arg("sourceMap", source_map);
8427 }
8428 TypeDef {
8429 proc: self.proc.clone(),
8430 selection: query,
8431 graphql_client: self.graphql_client.clone(),
8432 }
8433 }
8434 pub fn with_optional(&self, optional: bool) -> TypeDef {
8436 let mut query = self.selection.select("withOptional");
8437 query = query.arg("optional", optional);
8438 TypeDef {
8439 proc: self.proc.clone(),
8440 selection: query,
8441 graphql_client: self.graphql_client.clone(),
8442 }
8443 }
8444 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
8450 let mut query = self.selection.select("withScalar");
8451 query = query.arg("name", name.into());
8452 TypeDef {
8453 proc: self.proc.clone(),
8454 selection: query,
8455 graphql_client: self.graphql_client.clone(),
8456 }
8457 }
8458 pub fn with_scalar_opts<'a>(
8464 &self,
8465 name: impl Into<String>,
8466 opts: TypeDefWithScalarOpts<'a>,
8467 ) -> TypeDef {
8468 let mut query = self.selection.select("withScalar");
8469 query = query.arg("name", name.into());
8470 if let Some(description) = opts.description {
8471 query = query.arg("description", description);
8472 }
8473 TypeDef {
8474 proc: self.proc.clone(),
8475 selection: query,
8476 graphql_client: self.graphql_client.clone(),
8477 }
8478 }
8479}
8480#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8481pub enum CacheSharingMode {
8482 #[serde(rename = "LOCKED")]
8483 Locked,
8484 #[serde(rename = "PRIVATE")]
8485 Private,
8486 #[serde(rename = "SHARED")]
8487 Shared,
8488}
8489#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8490pub enum ImageLayerCompression {
8491 #[serde(rename = "EStarGZ")]
8492 EStarGz,
8493 #[serde(rename = "Gzip")]
8494 Gzip,
8495 #[serde(rename = "Uncompressed")]
8496 Uncompressed,
8497 #[serde(rename = "Zstd")]
8498 Zstd,
8499}
8500#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8501pub enum ImageMediaTypes {
8502 #[serde(rename = "DockerMediaTypes")]
8503 DockerMediaTypes,
8504 #[serde(rename = "OCIMediaTypes")]
8505 OciMediaTypes,
8506}
8507#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8508pub enum ModuleSourceKind {
8509 #[serde(rename = "DIR_SOURCE")]
8510 DirSource,
8511 #[serde(rename = "GIT_SOURCE")]
8512 GitSource,
8513 #[serde(rename = "LOCAL_SOURCE")]
8514 LocalSource,
8515}
8516#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8517pub enum NetworkProtocol {
8518 #[serde(rename = "TCP")]
8519 Tcp,
8520 #[serde(rename = "UDP")]
8521 Udp,
8522}
8523#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8524pub enum ReturnType {
8525 #[serde(rename = "ANY")]
8526 Any,
8527 #[serde(rename = "FAILURE")]
8528 Failure,
8529 #[serde(rename = "SUCCESS")]
8530 Success,
8531}
8532#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8533pub enum TypeDefKind {
8534 #[serde(rename = "BOOLEAN_KIND")]
8535 BooleanKind,
8536 #[serde(rename = "ENUM_KIND")]
8537 EnumKind,
8538 #[serde(rename = "FLOAT_KIND")]
8539 FloatKind,
8540 #[serde(rename = "INPUT_KIND")]
8541 InputKind,
8542 #[serde(rename = "INTEGER_KIND")]
8543 IntegerKind,
8544 #[serde(rename = "INTERFACE_KIND")]
8545 InterfaceKind,
8546 #[serde(rename = "LIST_KIND")]
8547 ListKind,
8548 #[serde(rename = "OBJECT_KIND")]
8549 ObjectKind,
8550 #[serde(rename = "SCALAR_KIND")]
8551 ScalarKind,
8552 #[serde(rename = "STRING_KIND")]
8553 StringKind,
8554 #[serde(rename = "VOID_KIND")]
8555 VoidKind,
8556}