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 ModuleId(pub String);
927impl From<&str> for ModuleId {
928 fn from(value: &str) -> Self {
929 Self(value.to_string())
930 }
931}
932impl From<String> for ModuleId {
933 fn from(value: String) -> Self {
934 Self(value)
935 }
936}
937impl IntoID<ModuleId> for Module {
938 fn into_id(
939 self,
940 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
941 {
942 Box::pin(async move { self.id().await })
943 }
944}
945impl IntoID<ModuleId> for ModuleId {
946 fn into_id(
947 self,
948 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
949 {
950 Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
951 }
952}
953impl ModuleId {
954 fn quote(&self) -> String {
955 format!("\"{}\"", self.0.clone())
956 }
957}
958#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
959pub struct ModuleSourceId(pub String);
960impl From<&str> for ModuleSourceId {
961 fn from(value: &str) -> Self {
962 Self(value.to_string())
963 }
964}
965impl From<String> for ModuleSourceId {
966 fn from(value: String) -> Self {
967 Self(value)
968 }
969}
970impl IntoID<ModuleSourceId> for ModuleSource {
971 fn into_id(
972 self,
973 ) -> std::pin::Pin<
974 Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
975 > {
976 Box::pin(async move { self.id().await })
977 }
978}
979impl IntoID<ModuleSourceId> for ModuleSourceId {
980 fn into_id(
981 self,
982 ) -> std::pin::Pin<
983 Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
984 > {
985 Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
986 }
987}
988impl ModuleSourceId {
989 fn quote(&self) -> String {
990 format!("\"{}\"", self.0.clone())
991 }
992}
993#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
994pub struct ObjectTypeDefId(pub String);
995impl From<&str> for ObjectTypeDefId {
996 fn from(value: &str) -> Self {
997 Self(value.to_string())
998 }
999}
1000impl From<String> for ObjectTypeDefId {
1001 fn from(value: String) -> Self {
1002 Self(value)
1003 }
1004}
1005impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
1006 fn into_id(
1007 self,
1008 ) -> std::pin::Pin<
1009 Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1010 > {
1011 Box::pin(async move { self.id().await })
1012 }
1013}
1014impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
1015 fn into_id(
1016 self,
1017 ) -> std::pin::Pin<
1018 Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
1019 > {
1020 Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
1021 }
1022}
1023impl ObjectTypeDefId {
1024 fn quote(&self) -> String {
1025 format!("\"{}\"", self.0.clone())
1026 }
1027}
1028#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1029pub struct Platform(pub String);
1030impl From<&str> for Platform {
1031 fn from(value: &str) -> Self {
1032 Self(value.to_string())
1033 }
1034}
1035impl From<String> for Platform {
1036 fn from(value: String) -> Self {
1037 Self(value)
1038 }
1039}
1040impl Platform {
1041 fn quote(&self) -> String {
1042 format!("\"{}\"", self.0.clone())
1043 }
1044}
1045#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1046pub struct PortId(pub String);
1047impl From<&str> for PortId {
1048 fn from(value: &str) -> Self {
1049 Self(value.to_string())
1050 }
1051}
1052impl From<String> for PortId {
1053 fn from(value: String) -> Self {
1054 Self(value)
1055 }
1056}
1057impl IntoID<PortId> for Port {
1058 fn into_id(
1059 self,
1060 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1061 {
1062 Box::pin(async move { self.id().await })
1063 }
1064}
1065impl IntoID<PortId> for PortId {
1066 fn into_id(
1067 self,
1068 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
1069 {
1070 Box::pin(async move { Ok::<PortId, DaggerError>(self) })
1071 }
1072}
1073impl PortId {
1074 fn quote(&self) -> String {
1075 format!("\"{}\"", self.0.clone())
1076 }
1077}
1078#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1079pub struct SdkConfigId(pub String);
1080impl From<&str> for SdkConfigId {
1081 fn from(value: &str) -> Self {
1082 Self(value.to_string())
1083 }
1084}
1085impl From<String> for SdkConfigId {
1086 fn from(value: String) -> Self {
1087 Self(value)
1088 }
1089}
1090impl IntoID<SdkConfigId> for SdkConfig {
1091 fn into_id(
1092 self,
1093 ) -> std::pin::Pin<
1094 Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1095 > {
1096 Box::pin(async move { self.id().await })
1097 }
1098}
1099impl IntoID<SdkConfigId> for SdkConfigId {
1100 fn into_id(
1101 self,
1102 ) -> std::pin::Pin<
1103 Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
1104 > {
1105 Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
1106 }
1107}
1108impl SdkConfigId {
1109 fn quote(&self) -> String {
1110 format!("\"{}\"", self.0.clone())
1111 }
1112}
1113#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1114pub struct ScalarTypeDefId(pub String);
1115impl From<&str> for ScalarTypeDefId {
1116 fn from(value: &str) -> Self {
1117 Self(value.to_string())
1118 }
1119}
1120impl From<String> for ScalarTypeDefId {
1121 fn from(value: String) -> Self {
1122 Self(value)
1123 }
1124}
1125impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
1126 fn into_id(
1127 self,
1128 ) -> std::pin::Pin<
1129 Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1130 > {
1131 Box::pin(async move { self.id().await })
1132 }
1133}
1134impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
1135 fn into_id(
1136 self,
1137 ) -> std::pin::Pin<
1138 Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
1139 > {
1140 Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
1141 }
1142}
1143impl ScalarTypeDefId {
1144 fn quote(&self) -> String {
1145 format!("\"{}\"", self.0.clone())
1146 }
1147}
1148#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1149pub struct SecretId(pub String);
1150impl From<&str> for SecretId {
1151 fn from(value: &str) -> Self {
1152 Self(value.to_string())
1153 }
1154}
1155impl From<String> for SecretId {
1156 fn from(value: String) -> Self {
1157 Self(value)
1158 }
1159}
1160impl IntoID<SecretId> for Secret {
1161 fn into_id(
1162 self,
1163 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1164 {
1165 Box::pin(async move { self.id().await })
1166 }
1167}
1168impl IntoID<SecretId> for SecretId {
1169 fn into_id(
1170 self,
1171 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
1172 {
1173 Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
1174 }
1175}
1176impl SecretId {
1177 fn quote(&self) -> String {
1178 format!("\"{}\"", self.0.clone())
1179 }
1180}
1181#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1182pub struct ServiceId(pub String);
1183impl From<&str> for ServiceId {
1184 fn from(value: &str) -> Self {
1185 Self(value.to_string())
1186 }
1187}
1188impl From<String> for ServiceId {
1189 fn from(value: String) -> Self {
1190 Self(value)
1191 }
1192}
1193impl IntoID<ServiceId> for Service {
1194 fn into_id(
1195 self,
1196 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1197 {
1198 Box::pin(async move { self.id().await })
1199 }
1200}
1201impl IntoID<ServiceId> for ServiceId {
1202 fn into_id(
1203 self,
1204 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
1205 {
1206 Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
1207 }
1208}
1209impl ServiceId {
1210 fn quote(&self) -> String {
1211 format!("\"{}\"", self.0.clone())
1212 }
1213}
1214#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1215pub struct SocketId(pub String);
1216impl From<&str> for SocketId {
1217 fn from(value: &str) -> Self {
1218 Self(value.to_string())
1219 }
1220}
1221impl From<String> for SocketId {
1222 fn from(value: String) -> Self {
1223 Self(value)
1224 }
1225}
1226impl IntoID<SocketId> for Socket {
1227 fn into_id(
1228 self,
1229 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1230 {
1231 Box::pin(async move { self.id().await })
1232 }
1233}
1234impl IntoID<SocketId> for SocketId {
1235 fn into_id(
1236 self,
1237 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
1238 {
1239 Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
1240 }
1241}
1242impl SocketId {
1243 fn quote(&self) -> String {
1244 format!("\"{}\"", self.0.clone())
1245 }
1246}
1247#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1248pub struct SourceMapId(pub String);
1249impl From<&str> for SourceMapId {
1250 fn from(value: &str) -> Self {
1251 Self(value.to_string())
1252 }
1253}
1254impl From<String> for SourceMapId {
1255 fn from(value: String) -> Self {
1256 Self(value)
1257 }
1258}
1259impl IntoID<SourceMapId> for SourceMap {
1260 fn into_id(
1261 self,
1262 ) -> std::pin::Pin<
1263 Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1264 > {
1265 Box::pin(async move { self.id().await })
1266 }
1267}
1268impl IntoID<SourceMapId> for SourceMapId {
1269 fn into_id(
1270 self,
1271 ) -> std::pin::Pin<
1272 Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
1273 > {
1274 Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
1275 }
1276}
1277impl SourceMapId {
1278 fn quote(&self) -> String {
1279 format!("\"{}\"", self.0.clone())
1280 }
1281}
1282#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1283pub struct TerminalId(pub String);
1284impl From<&str> for TerminalId {
1285 fn from(value: &str) -> Self {
1286 Self(value.to_string())
1287 }
1288}
1289impl From<String> for TerminalId {
1290 fn from(value: String) -> Self {
1291 Self(value)
1292 }
1293}
1294impl IntoID<TerminalId> for Terminal {
1295 fn into_id(
1296 self,
1297 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1298 {
1299 Box::pin(async move { self.id().await })
1300 }
1301}
1302impl IntoID<TerminalId> for TerminalId {
1303 fn into_id(
1304 self,
1305 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
1306 {
1307 Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
1308 }
1309}
1310impl TerminalId {
1311 fn quote(&self) -> String {
1312 format!("\"{}\"", self.0.clone())
1313 }
1314}
1315#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1316pub struct TypeDefId(pub String);
1317impl From<&str> for TypeDefId {
1318 fn from(value: &str) -> Self {
1319 Self(value.to_string())
1320 }
1321}
1322impl From<String> for TypeDefId {
1323 fn from(value: String) -> Self {
1324 Self(value)
1325 }
1326}
1327impl IntoID<TypeDefId> for TypeDef {
1328 fn into_id(
1329 self,
1330 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1331 {
1332 Box::pin(async move { self.id().await })
1333 }
1334}
1335impl IntoID<TypeDefId> for TypeDefId {
1336 fn into_id(
1337 self,
1338 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
1339 {
1340 Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
1341 }
1342}
1343impl TypeDefId {
1344 fn quote(&self) -> String {
1345 format!("\"{}\"", self.0.clone())
1346 }
1347}
1348#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
1349pub struct Void(pub String);
1350impl From<&str> for Void {
1351 fn from(value: &str) -> Self {
1352 Self(value.to_string())
1353 }
1354}
1355impl From<String> for Void {
1356 fn from(value: String) -> Self {
1357 Self(value)
1358 }
1359}
1360impl Void {
1361 fn quote(&self) -> String {
1362 format!("\"{}\"", self.0.clone())
1363 }
1364}
1365#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1366pub struct BuildArg {
1367 pub name: String,
1368 pub value: String,
1369}
1370#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1371pub struct PipelineLabel {
1372 pub name: String,
1373 pub value: String,
1374}
1375#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
1376pub struct PortForward {
1377 pub backend: isize,
1378 pub frontend: isize,
1379 pub protocol: NetworkProtocol,
1380}
1381#[derive(Clone)]
1382pub struct CacheVolume {
1383 pub proc: Option<Arc<DaggerSessionProc>>,
1384 pub selection: Selection,
1385 pub graphql_client: DynGraphQLClient,
1386}
1387impl CacheVolume {
1388 pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
1390 let query = self.selection.select("id");
1391 query.execute(self.graphql_client.clone()).await
1392 }
1393}
1394#[derive(Clone)]
1395pub struct Container {
1396 pub proc: Option<Arc<DaggerSessionProc>>,
1397 pub selection: Selection,
1398 pub graphql_client: DynGraphQLClient,
1399}
1400#[derive(Builder, Debug, PartialEq)]
1401pub struct ContainerAsServiceOpts<'a> {
1402 #[builder(setter(into, strip_option), default)]
1405 pub args: Option<Vec<&'a str>>,
1406 #[builder(setter(into, strip_option), default)]
1408 pub expand: Option<bool>,
1409 #[builder(setter(into, strip_option), default)]
1412 pub experimental_privileged_nesting: Option<bool>,
1413 #[builder(setter(into, strip_option), default)]
1415 pub insecure_root_capabilities: Option<bool>,
1416 #[builder(setter(into, strip_option), default)]
1419 pub no_init: Option<bool>,
1420 #[builder(setter(into, strip_option), default)]
1422 pub use_entrypoint: Option<bool>,
1423}
1424#[derive(Builder, Debug, PartialEq)]
1425pub struct ContainerAsTarballOpts {
1426 #[builder(setter(into, strip_option), default)]
1429 pub forced_compression: Option<ImageLayerCompression>,
1430 #[builder(setter(into, strip_option), default)]
1433 pub media_types: Option<ImageMediaTypes>,
1434 #[builder(setter(into, strip_option), default)]
1437 pub platform_variants: Option<Vec<ContainerId>>,
1438}
1439#[derive(Builder, Debug, PartialEq)]
1440pub struct ContainerBuildOpts<'a> {
1441 #[builder(setter(into, strip_option), default)]
1443 pub build_args: Option<Vec<BuildArg>>,
1444 #[builder(setter(into, strip_option), default)]
1446 pub dockerfile: Option<&'a str>,
1447 #[builder(setter(into, strip_option), default)]
1451 pub secrets: Option<Vec<SecretId>>,
1452 #[builder(setter(into, strip_option), default)]
1454 pub target: Option<&'a str>,
1455}
1456#[derive(Builder, Debug, PartialEq)]
1457pub struct ContainerDirectoryOpts {
1458 #[builder(setter(into, strip_option), default)]
1460 pub expand: Option<bool>,
1461}
1462#[derive(Builder, Debug, PartialEq)]
1463pub struct ContainerExportOpts {
1464 #[builder(setter(into, strip_option), default)]
1466 pub expand: Option<bool>,
1467 #[builder(setter(into, strip_option), default)]
1470 pub forced_compression: Option<ImageLayerCompression>,
1471 #[builder(setter(into, strip_option), default)]
1474 pub media_types: Option<ImageMediaTypes>,
1475 #[builder(setter(into, strip_option), default)]
1478 pub platform_variants: Option<Vec<ContainerId>>,
1479}
1480#[derive(Builder, Debug, PartialEq)]
1481pub struct ContainerFileOpts {
1482 #[builder(setter(into, strip_option), default)]
1484 pub expand: Option<bool>,
1485}
1486#[derive(Builder, Debug, PartialEq)]
1487pub struct ContainerImportOpts<'a> {
1488 #[builder(setter(into, strip_option), default)]
1490 pub tag: Option<&'a str>,
1491}
1492#[derive(Builder, Debug, PartialEq)]
1493pub struct ContainerPublishOpts {
1494 #[builder(setter(into, strip_option), default)]
1497 pub forced_compression: Option<ImageLayerCompression>,
1498 #[builder(setter(into, strip_option), default)]
1501 pub media_types: Option<ImageMediaTypes>,
1502 #[builder(setter(into, strip_option), default)]
1505 pub platform_variants: Option<Vec<ContainerId>>,
1506}
1507#[derive(Builder, Debug, PartialEq)]
1508pub struct ContainerTerminalOpts<'a> {
1509 #[builder(setter(into, strip_option), default)]
1511 pub cmd: Option<Vec<&'a str>>,
1512 #[builder(setter(into, strip_option), default)]
1515 pub experimental_privileged_nesting: Option<bool>,
1516 #[builder(setter(into, strip_option), default)]
1518 pub insecure_root_capabilities: Option<bool>,
1519}
1520#[derive(Builder, Debug, PartialEq)]
1521pub struct ContainerUpOpts<'a> {
1522 #[builder(setter(into, strip_option), default)]
1525 pub args: Option<Vec<&'a str>>,
1526 #[builder(setter(into, strip_option), default)]
1528 pub expand: Option<bool>,
1529 #[builder(setter(into, strip_option), default)]
1532 pub experimental_privileged_nesting: Option<bool>,
1533 #[builder(setter(into, strip_option), default)]
1535 pub insecure_root_capabilities: Option<bool>,
1536 #[builder(setter(into, strip_option), default)]
1539 pub no_init: Option<bool>,
1540 #[builder(setter(into, strip_option), default)]
1543 pub ports: Option<Vec<PortForward>>,
1544 #[builder(setter(into, strip_option), default)]
1546 pub random: Option<bool>,
1547 #[builder(setter(into, strip_option), default)]
1549 pub use_entrypoint: Option<bool>,
1550}
1551#[derive(Builder, Debug, PartialEq)]
1552pub struct ContainerWithDefaultTerminalCmdOpts {
1553 #[builder(setter(into, strip_option), default)]
1556 pub experimental_privileged_nesting: Option<bool>,
1557 #[builder(setter(into, strip_option), default)]
1559 pub insecure_root_capabilities: Option<bool>,
1560}
1561#[derive(Builder, Debug, PartialEq)]
1562pub struct ContainerWithDirectoryOpts<'a> {
1563 #[builder(setter(into, strip_option), default)]
1565 pub exclude: Option<Vec<&'a str>>,
1566 #[builder(setter(into, strip_option), default)]
1568 pub expand: Option<bool>,
1569 #[builder(setter(into, strip_option), default)]
1571 pub include: Option<Vec<&'a str>>,
1572 #[builder(setter(into, strip_option), default)]
1576 pub owner: Option<&'a str>,
1577}
1578#[derive(Builder, Debug, PartialEq)]
1579pub struct ContainerWithEntrypointOpts {
1580 #[builder(setter(into, strip_option), default)]
1582 pub keep_default_args: Option<bool>,
1583}
1584#[derive(Builder, Debug, PartialEq)]
1585pub struct ContainerWithEnvVariableOpts {
1586 #[builder(setter(into, strip_option), default)]
1588 pub expand: Option<bool>,
1589}
1590#[derive(Builder, Debug, PartialEq)]
1591pub struct ContainerWithExecOpts<'a> {
1592 #[builder(setter(into, strip_option), default)]
1594 pub expand: Option<bool>,
1595 #[builder(setter(into, strip_option), default)]
1597 pub expect: Option<ReturnType>,
1598 #[builder(setter(into, strip_option), default)]
1601 pub experimental_privileged_nesting: Option<bool>,
1602 #[builder(setter(into, strip_option), default)]
1604 pub insecure_root_capabilities: Option<bool>,
1605 #[builder(setter(into, strip_option), default)]
1608 pub no_init: Option<bool>,
1609 #[builder(setter(into, strip_option), default)]
1611 pub redirect_stderr: Option<&'a str>,
1612 #[builder(setter(into, strip_option), default)]
1614 pub redirect_stdout: Option<&'a str>,
1615 #[builder(setter(into, strip_option), default)]
1617 pub stdin: Option<&'a str>,
1618 #[builder(setter(into, strip_option), default)]
1620 pub use_entrypoint: Option<bool>,
1621}
1622#[derive(Builder, Debug, PartialEq)]
1623pub struct ContainerWithExposedPortOpts<'a> {
1624 #[builder(setter(into, strip_option), default)]
1626 pub description: Option<&'a str>,
1627 #[builder(setter(into, strip_option), default)]
1629 pub experimental_skip_healthcheck: Option<bool>,
1630 #[builder(setter(into, strip_option), default)]
1632 pub protocol: Option<NetworkProtocol>,
1633}
1634#[derive(Builder, Debug, PartialEq)]
1635pub struct ContainerWithFileOpts<'a> {
1636 #[builder(setter(into, strip_option), default)]
1638 pub expand: Option<bool>,
1639 #[builder(setter(into, strip_option), default)]
1643 pub owner: Option<&'a str>,
1644 #[builder(setter(into, strip_option), default)]
1646 pub permissions: Option<isize>,
1647}
1648#[derive(Builder, Debug, PartialEq)]
1649pub struct ContainerWithFilesOpts<'a> {
1650 #[builder(setter(into, strip_option), default)]
1652 pub expand: Option<bool>,
1653 #[builder(setter(into, strip_option), default)]
1657 pub owner: Option<&'a str>,
1658 #[builder(setter(into, strip_option), default)]
1660 pub permissions: Option<isize>,
1661}
1662#[derive(Builder, Debug, PartialEq)]
1663pub struct ContainerWithMountedCacheOpts<'a> {
1664 #[builder(setter(into, strip_option), default)]
1666 pub expand: Option<bool>,
1667 #[builder(setter(into, strip_option), default)]
1672 pub owner: Option<&'a str>,
1673 #[builder(setter(into, strip_option), default)]
1675 pub sharing: Option<CacheSharingMode>,
1676 #[builder(setter(into, strip_option), default)]
1678 pub source: Option<DirectoryId>,
1679}
1680#[derive(Builder, Debug, PartialEq)]
1681pub struct ContainerWithMountedDirectoryOpts<'a> {
1682 #[builder(setter(into, strip_option), default)]
1684 pub expand: Option<bool>,
1685 #[builder(setter(into, strip_option), default)]
1689 pub owner: Option<&'a str>,
1690}
1691#[derive(Builder, Debug, PartialEq)]
1692pub struct ContainerWithMountedFileOpts<'a> {
1693 #[builder(setter(into, strip_option), default)]
1695 pub expand: Option<bool>,
1696 #[builder(setter(into, strip_option), default)]
1700 pub owner: Option<&'a str>,
1701}
1702#[derive(Builder, Debug, PartialEq)]
1703pub struct ContainerWithMountedSecretOpts<'a> {
1704 #[builder(setter(into, strip_option), default)]
1706 pub expand: Option<bool>,
1707 #[builder(setter(into, strip_option), default)]
1710 pub mode: Option<isize>,
1711 #[builder(setter(into, strip_option), default)]
1715 pub owner: Option<&'a str>,
1716}
1717#[derive(Builder, Debug, PartialEq)]
1718pub struct ContainerWithMountedTempOpts {
1719 #[builder(setter(into, strip_option), default)]
1721 pub expand: Option<bool>,
1722 #[builder(setter(into, strip_option), default)]
1724 pub size: Option<isize>,
1725}
1726#[derive(Builder, Debug, PartialEq)]
1727pub struct ContainerWithNewFileOpts<'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 #[builder(setter(into, strip_option), default)]
1738 pub permissions: Option<isize>,
1739}
1740#[derive(Builder, Debug, PartialEq)]
1741pub struct ContainerWithUnixSocketOpts<'a> {
1742 #[builder(setter(into, strip_option), default)]
1744 pub expand: Option<bool>,
1745 #[builder(setter(into, strip_option), default)]
1749 pub owner: Option<&'a str>,
1750}
1751#[derive(Builder, Debug, PartialEq)]
1752pub struct ContainerWithWorkdirOpts {
1753 #[builder(setter(into, strip_option), default)]
1755 pub expand: Option<bool>,
1756}
1757#[derive(Builder, Debug, PartialEq)]
1758pub struct ContainerWithoutDirectoryOpts {
1759 #[builder(setter(into, strip_option), default)]
1761 pub expand: Option<bool>,
1762}
1763#[derive(Builder, Debug, PartialEq)]
1764pub struct ContainerWithoutEntrypointOpts {
1765 #[builder(setter(into, strip_option), default)]
1767 pub keep_default_args: Option<bool>,
1768}
1769#[derive(Builder, Debug, PartialEq)]
1770pub struct ContainerWithoutExposedPortOpts {
1771 #[builder(setter(into, strip_option), default)]
1773 pub protocol: Option<NetworkProtocol>,
1774}
1775#[derive(Builder, Debug, PartialEq)]
1776pub struct ContainerWithoutFileOpts {
1777 #[builder(setter(into, strip_option), default)]
1779 pub expand: Option<bool>,
1780}
1781#[derive(Builder, Debug, PartialEq)]
1782pub struct ContainerWithoutFilesOpts {
1783 #[builder(setter(into, strip_option), default)]
1785 pub expand: Option<bool>,
1786}
1787#[derive(Builder, Debug, PartialEq)]
1788pub struct ContainerWithoutMountOpts {
1789 #[builder(setter(into, strip_option), default)]
1791 pub expand: Option<bool>,
1792}
1793#[derive(Builder, Debug, PartialEq)]
1794pub struct ContainerWithoutUnixSocketOpts {
1795 #[builder(setter(into, strip_option), default)]
1797 pub expand: Option<bool>,
1798}
1799impl Container {
1800 pub fn as_service(&self) -> Service {
1807 let query = self.selection.select("asService");
1808 Service {
1809 proc: self.proc.clone(),
1810 selection: query,
1811 graphql_client: self.graphql_client.clone(),
1812 }
1813 }
1814 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
1821 let mut query = self.selection.select("asService");
1822 if let Some(args) = opts.args {
1823 query = query.arg("args", args);
1824 }
1825 if let Some(use_entrypoint) = opts.use_entrypoint {
1826 query = query.arg("useEntrypoint", use_entrypoint);
1827 }
1828 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
1829 query = query.arg(
1830 "experimentalPrivilegedNesting",
1831 experimental_privileged_nesting,
1832 );
1833 }
1834 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
1835 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
1836 }
1837 if let Some(expand) = opts.expand {
1838 query = query.arg("expand", expand);
1839 }
1840 if let Some(no_init) = opts.no_init {
1841 query = query.arg("noInit", no_init);
1842 }
1843 Service {
1844 proc: self.proc.clone(),
1845 selection: query,
1846 graphql_client: self.graphql_client.clone(),
1847 }
1848 }
1849 pub fn as_tarball(&self) -> File {
1855 let query = self.selection.select("asTarball");
1856 File {
1857 proc: self.proc.clone(),
1858 selection: query,
1859 graphql_client: self.graphql_client.clone(),
1860 }
1861 }
1862 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
1868 let mut query = self.selection.select("asTarball");
1869 if let Some(platform_variants) = opts.platform_variants {
1870 query = query.arg("platformVariants", platform_variants);
1871 }
1872 if let Some(forced_compression) = opts.forced_compression {
1873 query = query.arg("forcedCompression", forced_compression);
1874 }
1875 if let Some(media_types) = opts.media_types {
1876 query = query.arg("mediaTypes", media_types);
1877 }
1878 File {
1879 proc: self.proc.clone(),
1880 selection: query,
1881 graphql_client: self.graphql_client.clone(),
1882 }
1883 }
1884 pub fn build(&self, context: impl IntoID<DirectoryId>) -> Container {
1891 let mut query = self.selection.select("build");
1892 query = query.arg_lazy(
1893 "context",
1894 Box::new(move || {
1895 let context = context.clone();
1896 Box::pin(async move { context.into_id().await.unwrap().quote() })
1897 }),
1898 );
1899 Container {
1900 proc: self.proc.clone(),
1901 selection: query,
1902 graphql_client: self.graphql_client.clone(),
1903 }
1904 }
1905 pub fn build_opts<'a>(
1912 &self,
1913 context: impl IntoID<DirectoryId>,
1914 opts: ContainerBuildOpts<'a>,
1915 ) -> Container {
1916 let mut query = self.selection.select("build");
1917 query = query.arg_lazy(
1918 "context",
1919 Box::new(move || {
1920 let context = context.clone();
1921 Box::pin(async move { context.into_id().await.unwrap().quote() })
1922 }),
1923 );
1924 if let Some(dockerfile) = opts.dockerfile {
1925 query = query.arg("dockerfile", dockerfile);
1926 }
1927 if let Some(target) = opts.target {
1928 query = query.arg("target", target);
1929 }
1930 if let Some(build_args) = opts.build_args {
1931 query = query.arg("buildArgs", build_args);
1932 }
1933 if let Some(secrets) = opts.secrets {
1934 query = query.arg("secrets", secrets);
1935 }
1936 Container {
1937 proc: self.proc.clone(),
1938 selection: query,
1939 graphql_client: self.graphql_client.clone(),
1940 }
1941 }
1942 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
1944 let query = self.selection.select("defaultArgs");
1945 query.execute(self.graphql_client.clone()).await
1946 }
1947 pub fn directory(&self, path: impl Into<String>) -> Directory {
1955 let mut query = self.selection.select("directory");
1956 query = query.arg("path", path.into());
1957 Directory {
1958 proc: self.proc.clone(),
1959 selection: query,
1960 graphql_client: self.graphql_client.clone(),
1961 }
1962 }
1963 pub fn directory_opts(
1971 &self,
1972 path: impl Into<String>,
1973 opts: ContainerDirectoryOpts,
1974 ) -> Directory {
1975 let mut query = self.selection.select("directory");
1976 query = query.arg("path", path.into());
1977 if let Some(expand) = opts.expand {
1978 query = query.arg("expand", expand);
1979 }
1980 Directory {
1981 proc: self.proc.clone(),
1982 selection: query,
1983 graphql_client: self.graphql_client.clone(),
1984 }
1985 }
1986 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
1988 let query = self.selection.select("entrypoint");
1989 query.execute(self.graphql_client.clone()).await
1990 }
1991 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
1997 let mut query = self.selection.select("envVariable");
1998 query = query.arg("name", name.into());
1999 query.execute(self.graphql_client.clone()).await
2000 }
2001 pub fn env_variables(&self) -> Vec<EnvVariable> {
2003 let query = self.selection.select("envVariables");
2004 vec![EnvVariable {
2005 proc: self.proc.clone(),
2006 selection: query,
2007 graphql_client: self.graphql_client.clone(),
2008 }]
2009 }
2010 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2013 let query = self.selection.select("exitCode");
2014 query.execute(self.graphql_client.clone()).await
2015 }
2016 pub fn experimental_with_all_gp_us(&self) -> Container {
2020 let query = self.selection.select("experimentalWithAllGPUs");
2021 Container {
2022 proc: self.proc.clone(),
2023 selection: query,
2024 graphql_client: self.graphql_client.clone(),
2025 }
2026 }
2027 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2035 let mut query = self.selection.select("experimentalWithGPU");
2036 query = query.arg(
2037 "devices",
2038 devices
2039 .into_iter()
2040 .map(|i| i.into())
2041 .collect::<Vec<String>>(),
2042 );
2043 Container {
2044 proc: self.proc.clone(),
2045 selection: query,
2046 graphql_client: self.graphql_client.clone(),
2047 }
2048 }
2049 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2059 let mut query = self.selection.select("export");
2060 query = query.arg("path", path.into());
2061 query.execute(self.graphql_client.clone()).await
2062 }
2063 pub async fn export_opts(
2073 &self,
2074 path: impl Into<String>,
2075 opts: ContainerExportOpts,
2076 ) -> Result<String, DaggerError> {
2077 let mut query = self.selection.select("export");
2078 query = query.arg("path", path.into());
2079 if let Some(platform_variants) = opts.platform_variants {
2080 query = query.arg("platformVariants", platform_variants);
2081 }
2082 if let Some(forced_compression) = opts.forced_compression {
2083 query = query.arg("forcedCompression", forced_compression);
2084 }
2085 if let Some(media_types) = opts.media_types {
2086 query = query.arg("mediaTypes", media_types);
2087 }
2088 if let Some(expand) = opts.expand {
2089 query = query.arg("expand", expand);
2090 }
2091 query.execute(self.graphql_client.clone()).await
2092 }
2093 pub fn exposed_ports(&self) -> Vec<Port> {
2096 let query = self.selection.select("exposedPorts");
2097 vec![Port {
2098 proc: self.proc.clone(),
2099 selection: query,
2100 graphql_client: self.graphql_client.clone(),
2101 }]
2102 }
2103 pub fn file(&self, path: impl Into<String>) -> File {
2111 let mut query = self.selection.select("file");
2112 query = query.arg("path", path.into());
2113 File {
2114 proc: self.proc.clone(),
2115 selection: query,
2116 graphql_client: self.graphql_client.clone(),
2117 }
2118 }
2119 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2127 let mut query = self.selection.select("file");
2128 query = query.arg("path", path.into());
2129 if let Some(expand) = opts.expand {
2130 query = query.arg("expand", expand);
2131 }
2132 File {
2133 proc: self.proc.clone(),
2134 selection: query,
2135 graphql_client: self.graphql_client.clone(),
2136 }
2137 }
2138 pub fn from(&self, address: impl Into<String>) -> Container {
2146 let mut query = self.selection.select("from");
2147 query = query.arg("address", address.into());
2148 Container {
2149 proc: self.proc.clone(),
2150 selection: query,
2151 graphql_client: self.graphql_client.clone(),
2152 }
2153 }
2154 pub async fn id(&self) -> Result<ContainerId, DaggerError> {
2156 let query = self.selection.select("id");
2157 query.execute(self.graphql_client.clone()).await
2158 }
2159 pub async fn image_ref(&self) -> Result<String, DaggerError> {
2161 let query = self.selection.select("imageRef");
2162 query.execute(self.graphql_client.clone()).await
2163 }
2164 pub fn import(&self, source: impl IntoID<FileId>) -> Container {
2171 let mut query = self.selection.select("import");
2172 query = query.arg_lazy(
2173 "source",
2174 Box::new(move || {
2175 let source = source.clone();
2176 Box::pin(async move { source.into_id().await.unwrap().quote() })
2177 }),
2178 );
2179 Container {
2180 proc: self.proc.clone(),
2181 selection: query,
2182 graphql_client: self.graphql_client.clone(),
2183 }
2184 }
2185 pub fn import_opts<'a>(
2192 &self,
2193 source: impl IntoID<FileId>,
2194 opts: ContainerImportOpts<'a>,
2195 ) -> Container {
2196 let mut query = self.selection.select("import");
2197 query = query.arg_lazy(
2198 "source",
2199 Box::new(move || {
2200 let source = source.clone();
2201 Box::pin(async move { source.into_id().await.unwrap().quote() })
2202 }),
2203 );
2204 if let Some(tag) = opts.tag {
2205 query = query.arg("tag", tag);
2206 }
2207 Container {
2208 proc: self.proc.clone(),
2209 selection: query,
2210 graphql_client: self.graphql_client.clone(),
2211 }
2212 }
2213 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2219 let mut query = self.selection.select("label");
2220 query = query.arg("name", name.into());
2221 query.execute(self.graphql_client.clone()).await
2222 }
2223 pub fn labels(&self) -> Vec<Label> {
2225 let query = self.selection.select("labels");
2226 vec![Label {
2227 proc: self.proc.clone(),
2228 selection: query,
2229 graphql_client: self.graphql_client.clone(),
2230 }]
2231 }
2232 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2234 let query = self.selection.select("mounts");
2235 query.execute(self.graphql_client.clone()).await
2236 }
2237 pub async fn platform(&self) -> Result<Platform, DaggerError> {
2239 let query = self.selection.select("platform");
2240 query.execute(self.graphql_client.clone()).await
2241 }
2242 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2253 let mut query = self.selection.select("publish");
2254 query = query.arg("address", address.into());
2255 query.execute(self.graphql_client.clone()).await
2256 }
2257 pub async fn publish_opts(
2268 &self,
2269 address: impl Into<String>,
2270 opts: ContainerPublishOpts,
2271 ) -> Result<String, DaggerError> {
2272 let mut query = self.selection.select("publish");
2273 query = query.arg("address", address.into());
2274 if let Some(platform_variants) = opts.platform_variants {
2275 query = query.arg("platformVariants", platform_variants);
2276 }
2277 if let Some(forced_compression) = opts.forced_compression {
2278 query = query.arg("forcedCompression", forced_compression);
2279 }
2280 if let Some(media_types) = opts.media_types {
2281 query = query.arg("mediaTypes", media_types);
2282 }
2283 query.execute(self.graphql_client.clone()).await
2284 }
2285 pub fn rootfs(&self) -> Directory {
2287 let query = self.selection.select("rootfs");
2288 Directory {
2289 proc: self.proc.clone(),
2290 selection: query,
2291 graphql_client: self.graphql_client.clone(),
2292 }
2293 }
2294 pub async fn stderr(&self) -> Result<String, DaggerError> {
2297 let query = self.selection.select("stderr");
2298 query.execute(self.graphql_client.clone()).await
2299 }
2300 pub async fn stdout(&self) -> Result<String, DaggerError> {
2303 let query = self.selection.select("stdout");
2304 query.execute(self.graphql_client.clone()).await
2305 }
2306 pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
2309 let query = self.selection.select("sync");
2310 query.execute(self.graphql_client.clone()).await
2311 }
2312 pub fn terminal(&self) -> Container {
2318 let query = self.selection.select("terminal");
2319 Container {
2320 proc: self.proc.clone(),
2321 selection: query,
2322 graphql_client: self.graphql_client.clone(),
2323 }
2324 }
2325 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2331 let mut query = self.selection.select("terminal");
2332 if let Some(cmd) = opts.cmd {
2333 query = query.arg("cmd", cmd);
2334 }
2335 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2336 query = query.arg(
2337 "experimentalPrivilegedNesting",
2338 experimental_privileged_nesting,
2339 );
2340 }
2341 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2342 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2343 }
2344 Container {
2345 proc: self.proc.clone(),
2346 selection: query,
2347 graphql_client: self.graphql_client.clone(),
2348 }
2349 }
2350 pub async fn up(&self) -> Result<Void, DaggerError> {
2357 let query = self.selection.select("up");
2358 query.execute(self.graphql_client.clone()).await
2359 }
2360 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
2367 let mut query = self.selection.select("up");
2368 if let Some(ports) = opts.ports {
2369 query = query.arg("ports", ports);
2370 }
2371 if let Some(random) = opts.random {
2372 query = query.arg("random", random);
2373 }
2374 if let Some(args) = opts.args {
2375 query = query.arg("args", args);
2376 }
2377 if let Some(use_entrypoint) = opts.use_entrypoint {
2378 query = query.arg("useEntrypoint", use_entrypoint);
2379 }
2380 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2381 query = query.arg(
2382 "experimentalPrivilegedNesting",
2383 experimental_privileged_nesting,
2384 );
2385 }
2386 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2387 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2388 }
2389 if let Some(expand) = opts.expand {
2390 query = query.arg("expand", expand);
2391 }
2392 if let Some(no_init) = opts.no_init {
2393 query = query.arg("noInit", no_init);
2394 }
2395 query.execute(self.graphql_client.clone()).await
2396 }
2397 pub async fn user(&self) -> Result<String, DaggerError> {
2399 let query = self.selection.select("user");
2400 query.execute(self.graphql_client.clone()).await
2401 }
2402 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2409 let mut query = self.selection.select("withAnnotation");
2410 query = query.arg("name", name.into());
2411 query = query.arg("value", value.into());
2412 Container {
2413 proc: self.proc.clone(),
2414 selection: query,
2415 graphql_client: self.graphql_client.clone(),
2416 }
2417 }
2418 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
2424 let mut query = self.selection.select("withDefaultArgs");
2425 query = query.arg(
2426 "args",
2427 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2428 );
2429 Container {
2430 proc: self.proc.clone(),
2431 selection: query,
2432 graphql_client: self.graphql_client.clone(),
2433 }
2434 }
2435 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
2442 let mut query = self.selection.select("withDefaultTerminalCmd");
2443 query = query.arg(
2444 "args",
2445 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2446 );
2447 Container {
2448 proc: self.proc.clone(),
2449 selection: query,
2450 graphql_client: self.graphql_client.clone(),
2451 }
2452 }
2453 pub fn with_default_terminal_cmd_opts(
2460 &self,
2461 args: Vec<impl Into<String>>,
2462 opts: ContainerWithDefaultTerminalCmdOpts,
2463 ) -> Container {
2464 let mut query = self.selection.select("withDefaultTerminalCmd");
2465 query = query.arg(
2466 "args",
2467 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2468 );
2469 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2470 query = query.arg(
2471 "experimentalPrivilegedNesting",
2472 experimental_privileged_nesting,
2473 );
2474 }
2475 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2476 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2477 }
2478 Container {
2479 proc: self.proc.clone(),
2480 selection: query,
2481 graphql_client: self.graphql_client.clone(),
2482 }
2483 }
2484 pub fn with_directory(
2492 &self,
2493 path: impl Into<String>,
2494 directory: impl IntoID<DirectoryId>,
2495 ) -> Container {
2496 let mut query = self.selection.select("withDirectory");
2497 query = query.arg("path", path.into());
2498 query = query.arg_lazy(
2499 "directory",
2500 Box::new(move || {
2501 let directory = directory.clone();
2502 Box::pin(async move { directory.into_id().await.unwrap().quote() })
2503 }),
2504 );
2505 Container {
2506 proc: self.proc.clone(),
2507 selection: query,
2508 graphql_client: self.graphql_client.clone(),
2509 }
2510 }
2511 pub fn with_directory_opts<'a>(
2519 &self,
2520 path: impl Into<String>,
2521 directory: impl IntoID<DirectoryId>,
2522 opts: ContainerWithDirectoryOpts<'a>,
2523 ) -> Container {
2524 let mut query = self.selection.select("withDirectory");
2525 query = query.arg("path", path.into());
2526 query = query.arg_lazy(
2527 "directory",
2528 Box::new(move || {
2529 let directory = directory.clone();
2530 Box::pin(async move { directory.into_id().await.unwrap().quote() })
2531 }),
2532 );
2533 if let Some(exclude) = opts.exclude {
2534 query = query.arg("exclude", exclude);
2535 }
2536 if let Some(include) = opts.include {
2537 query = query.arg("include", include);
2538 }
2539 if let Some(owner) = opts.owner {
2540 query = query.arg("owner", owner);
2541 }
2542 if let Some(expand) = opts.expand {
2543 query = query.arg("expand", expand);
2544 }
2545 Container {
2546 proc: self.proc.clone(),
2547 selection: query,
2548 graphql_client: self.graphql_client.clone(),
2549 }
2550 }
2551 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
2558 let mut query = self.selection.select("withEntrypoint");
2559 query = query.arg(
2560 "args",
2561 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2562 );
2563 Container {
2564 proc: self.proc.clone(),
2565 selection: query,
2566 graphql_client: self.graphql_client.clone(),
2567 }
2568 }
2569 pub fn with_entrypoint_opts(
2576 &self,
2577 args: Vec<impl Into<String>>,
2578 opts: ContainerWithEntrypointOpts,
2579 ) -> Container {
2580 let mut query = self.selection.select("withEntrypoint");
2581 query = query.arg(
2582 "args",
2583 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2584 );
2585 if let Some(keep_default_args) = opts.keep_default_args {
2586 query = query.arg("keepDefaultArgs", keep_default_args);
2587 }
2588 Container {
2589 proc: self.proc.clone(),
2590 selection: query,
2591 graphql_client: self.graphql_client.clone(),
2592 }
2593 }
2594 pub fn with_env_variable(
2602 &self,
2603 name: impl Into<String>,
2604 value: impl Into<String>,
2605 ) -> Container {
2606 let mut query = self.selection.select("withEnvVariable");
2607 query = query.arg("name", name.into());
2608 query = query.arg("value", value.into());
2609 Container {
2610 proc: self.proc.clone(),
2611 selection: query,
2612 graphql_client: self.graphql_client.clone(),
2613 }
2614 }
2615 pub fn with_env_variable_opts(
2623 &self,
2624 name: impl Into<String>,
2625 value: impl Into<String>,
2626 opts: ContainerWithEnvVariableOpts,
2627 ) -> Container {
2628 let mut query = self.selection.select("withEnvVariable");
2629 query = query.arg("name", name.into());
2630 query = query.arg("value", value.into());
2631 if let Some(expand) = opts.expand {
2632 query = query.arg("expand", expand);
2633 }
2634 Container {
2635 proc: self.proc.clone(),
2636 selection: query,
2637 graphql_client: self.graphql_client.clone(),
2638 }
2639 }
2640 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
2649 let mut query = self.selection.select("withExec");
2650 query = query.arg(
2651 "args",
2652 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2653 );
2654 Container {
2655 proc: self.proc.clone(),
2656 selection: query,
2657 graphql_client: self.graphql_client.clone(),
2658 }
2659 }
2660 pub fn with_exec_opts<'a>(
2669 &self,
2670 args: Vec<impl Into<String>>,
2671 opts: ContainerWithExecOpts<'a>,
2672 ) -> Container {
2673 let mut query = self.selection.select("withExec");
2674 query = query.arg(
2675 "args",
2676 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2677 );
2678 if let Some(use_entrypoint) = opts.use_entrypoint {
2679 query = query.arg("useEntrypoint", use_entrypoint);
2680 }
2681 if let Some(stdin) = opts.stdin {
2682 query = query.arg("stdin", stdin);
2683 }
2684 if let Some(redirect_stdout) = opts.redirect_stdout {
2685 query = query.arg("redirectStdout", redirect_stdout);
2686 }
2687 if let Some(redirect_stderr) = opts.redirect_stderr {
2688 query = query.arg("redirectStderr", redirect_stderr);
2689 }
2690 if let Some(expect) = opts.expect {
2691 query = query.arg("expect", expect);
2692 }
2693 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2694 query = query.arg(
2695 "experimentalPrivilegedNesting",
2696 experimental_privileged_nesting,
2697 );
2698 }
2699 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2700 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2701 }
2702 if let Some(expand) = opts.expand {
2703 query = query.arg("expand", expand);
2704 }
2705 if let Some(no_init) = opts.no_init {
2706 query = query.arg("noInit", no_init);
2707 }
2708 Container {
2709 proc: self.proc.clone(),
2710 selection: query,
2711 graphql_client: self.graphql_client.clone(),
2712 }
2713 }
2714 pub fn with_exposed_port(&self, port: isize) -> Container {
2724 let mut query = self.selection.select("withExposedPort");
2725 query = query.arg("port", port);
2726 Container {
2727 proc: self.proc.clone(),
2728 selection: query,
2729 graphql_client: self.graphql_client.clone(),
2730 }
2731 }
2732 pub fn with_exposed_port_opts<'a>(
2742 &self,
2743 port: isize,
2744 opts: ContainerWithExposedPortOpts<'a>,
2745 ) -> Container {
2746 let mut query = self.selection.select("withExposedPort");
2747 query = query.arg("port", port);
2748 if let Some(protocol) = opts.protocol {
2749 query = query.arg("protocol", protocol);
2750 }
2751 if let Some(description) = opts.description {
2752 query = query.arg("description", description);
2753 }
2754 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
2755 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
2756 }
2757 Container {
2758 proc: self.proc.clone(),
2759 selection: query,
2760 graphql_client: self.graphql_client.clone(),
2761 }
2762 }
2763 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
2771 let mut query = self.selection.select("withFile");
2772 query = query.arg("path", path.into());
2773 query = query.arg_lazy(
2774 "source",
2775 Box::new(move || {
2776 let source = source.clone();
2777 Box::pin(async move { source.into_id().await.unwrap().quote() })
2778 }),
2779 );
2780 Container {
2781 proc: self.proc.clone(),
2782 selection: query,
2783 graphql_client: self.graphql_client.clone(),
2784 }
2785 }
2786 pub fn with_file_opts<'a>(
2794 &self,
2795 path: impl Into<String>,
2796 source: impl IntoID<FileId>,
2797 opts: ContainerWithFileOpts<'a>,
2798 ) -> Container {
2799 let mut query = self.selection.select("withFile");
2800 query = query.arg("path", path.into());
2801 query = query.arg_lazy(
2802 "source",
2803 Box::new(move || {
2804 let source = source.clone();
2805 Box::pin(async move { source.into_id().await.unwrap().quote() })
2806 }),
2807 );
2808 if let Some(permissions) = opts.permissions {
2809 query = query.arg("permissions", permissions);
2810 }
2811 if let Some(owner) = opts.owner {
2812 query = query.arg("owner", owner);
2813 }
2814 if let Some(expand) = opts.expand {
2815 query = query.arg("expand", expand);
2816 }
2817 Container {
2818 proc: self.proc.clone(),
2819 selection: query,
2820 graphql_client: self.graphql_client.clone(),
2821 }
2822 }
2823 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
2831 let mut query = self.selection.select("withFiles");
2832 query = query.arg("path", path.into());
2833 query = query.arg("sources", sources);
2834 Container {
2835 proc: self.proc.clone(),
2836 selection: query,
2837 graphql_client: self.graphql_client.clone(),
2838 }
2839 }
2840 pub fn with_files_opts<'a>(
2848 &self,
2849 path: impl Into<String>,
2850 sources: Vec<FileId>,
2851 opts: ContainerWithFilesOpts<'a>,
2852 ) -> Container {
2853 let mut query = self.selection.select("withFiles");
2854 query = query.arg("path", path.into());
2855 query = query.arg("sources", sources);
2856 if let Some(permissions) = opts.permissions {
2857 query = query.arg("permissions", permissions);
2858 }
2859 if let Some(owner) = opts.owner {
2860 query = query.arg("owner", owner);
2861 }
2862 if let Some(expand) = opts.expand {
2863 query = query.arg("expand", expand);
2864 }
2865 Container {
2866 proc: self.proc.clone(),
2867 selection: query,
2868 graphql_client: self.graphql_client.clone(),
2869 }
2870 }
2871 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2878 let mut query = self.selection.select("withLabel");
2879 query = query.arg("name", name.into());
2880 query = query.arg("value", value.into());
2881 Container {
2882 proc: self.proc.clone(),
2883 selection: query,
2884 graphql_client: self.graphql_client.clone(),
2885 }
2886 }
2887 pub fn with_mounted_cache(
2895 &self,
2896 path: impl Into<String>,
2897 cache: impl IntoID<CacheVolumeId>,
2898 ) -> Container {
2899 let mut query = self.selection.select("withMountedCache");
2900 query = query.arg("path", path.into());
2901 query = query.arg_lazy(
2902 "cache",
2903 Box::new(move || {
2904 let cache = cache.clone();
2905 Box::pin(async move { cache.into_id().await.unwrap().quote() })
2906 }),
2907 );
2908 Container {
2909 proc: self.proc.clone(),
2910 selection: query,
2911 graphql_client: self.graphql_client.clone(),
2912 }
2913 }
2914 pub fn with_mounted_cache_opts<'a>(
2922 &self,
2923 path: impl Into<String>,
2924 cache: impl IntoID<CacheVolumeId>,
2925 opts: ContainerWithMountedCacheOpts<'a>,
2926 ) -> Container {
2927 let mut query = self.selection.select("withMountedCache");
2928 query = query.arg("path", path.into());
2929 query = query.arg_lazy(
2930 "cache",
2931 Box::new(move || {
2932 let cache = cache.clone();
2933 Box::pin(async move { cache.into_id().await.unwrap().quote() })
2934 }),
2935 );
2936 if let Some(source) = opts.source {
2937 query = query.arg("source", source);
2938 }
2939 if let Some(sharing) = opts.sharing {
2940 query = query.arg("sharing", sharing);
2941 }
2942 if let Some(owner) = opts.owner {
2943 query = query.arg("owner", owner);
2944 }
2945 if let Some(expand) = opts.expand {
2946 query = query.arg("expand", expand);
2947 }
2948 Container {
2949 proc: self.proc.clone(),
2950 selection: query,
2951 graphql_client: self.graphql_client.clone(),
2952 }
2953 }
2954 pub fn with_mounted_directory(
2962 &self,
2963 path: impl Into<String>,
2964 source: impl IntoID<DirectoryId>,
2965 ) -> Container {
2966 let mut query = self.selection.select("withMountedDirectory");
2967 query = query.arg("path", path.into());
2968 query = query.arg_lazy(
2969 "source",
2970 Box::new(move || {
2971 let source = source.clone();
2972 Box::pin(async move { source.into_id().await.unwrap().quote() })
2973 }),
2974 );
2975 Container {
2976 proc: self.proc.clone(),
2977 selection: query,
2978 graphql_client: self.graphql_client.clone(),
2979 }
2980 }
2981 pub fn with_mounted_directory_opts<'a>(
2989 &self,
2990 path: impl Into<String>,
2991 source: impl IntoID<DirectoryId>,
2992 opts: ContainerWithMountedDirectoryOpts<'a>,
2993 ) -> Container {
2994 let mut query = self.selection.select("withMountedDirectory");
2995 query = query.arg("path", path.into());
2996 query = query.arg_lazy(
2997 "source",
2998 Box::new(move || {
2999 let source = source.clone();
3000 Box::pin(async move { source.into_id().await.unwrap().quote() })
3001 }),
3002 );
3003 if let Some(owner) = opts.owner {
3004 query = query.arg("owner", owner);
3005 }
3006 if let Some(expand) = opts.expand {
3007 query = query.arg("expand", expand);
3008 }
3009 Container {
3010 proc: self.proc.clone(),
3011 selection: query,
3012 graphql_client: self.graphql_client.clone(),
3013 }
3014 }
3015 pub fn with_mounted_file(
3023 &self,
3024 path: impl Into<String>,
3025 source: impl IntoID<FileId>,
3026 ) -> Container {
3027 let mut query = self.selection.select("withMountedFile");
3028 query = query.arg("path", path.into());
3029 query = query.arg_lazy(
3030 "source",
3031 Box::new(move || {
3032 let source = source.clone();
3033 Box::pin(async move { source.into_id().await.unwrap().quote() })
3034 }),
3035 );
3036 Container {
3037 proc: self.proc.clone(),
3038 selection: query,
3039 graphql_client: self.graphql_client.clone(),
3040 }
3041 }
3042 pub fn with_mounted_file_opts<'a>(
3050 &self,
3051 path: impl Into<String>,
3052 source: impl IntoID<FileId>,
3053 opts: ContainerWithMountedFileOpts<'a>,
3054 ) -> Container {
3055 let mut query = self.selection.select("withMountedFile");
3056 query = query.arg("path", path.into());
3057 query = query.arg_lazy(
3058 "source",
3059 Box::new(move || {
3060 let source = source.clone();
3061 Box::pin(async move { source.into_id().await.unwrap().quote() })
3062 }),
3063 );
3064 if let Some(owner) = opts.owner {
3065 query = query.arg("owner", owner);
3066 }
3067 if let Some(expand) = opts.expand {
3068 query = query.arg("expand", expand);
3069 }
3070 Container {
3071 proc: self.proc.clone(),
3072 selection: query,
3073 graphql_client: self.graphql_client.clone(),
3074 }
3075 }
3076 pub fn with_mounted_secret(
3084 &self,
3085 path: impl Into<String>,
3086 source: impl IntoID<SecretId>,
3087 ) -> Container {
3088 let mut query = self.selection.select("withMountedSecret");
3089 query = query.arg("path", path.into());
3090 query = query.arg_lazy(
3091 "source",
3092 Box::new(move || {
3093 let source = source.clone();
3094 Box::pin(async move { source.into_id().await.unwrap().quote() })
3095 }),
3096 );
3097 Container {
3098 proc: self.proc.clone(),
3099 selection: query,
3100 graphql_client: self.graphql_client.clone(),
3101 }
3102 }
3103 pub fn with_mounted_secret_opts<'a>(
3111 &self,
3112 path: impl Into<String>,
3113 source: impl IntoID<SecretId>,
3114 opts: ContainerWithMountedSecretOpts<'a>,
3115 ) -> Container {
3116 let mut query = self.selection.select("withMountedSecret");
3117 query = query.arg("path", path.into());
3118 query = query.arg_lazy(
3119 "source",
3120 Box::new(move || {
3121 let source = source.clone();
3122 Box::pin(async move { source.into_id().await.unwrap().quote() })
3123 }),
3124 );
3125 if let Some(owner) = opts.owner {
3126 query = query.arg("owner", owner);
3127 }
3128 if let Some(mode) = opts.mode {
3129 query = query.arg("mode", mode);
3130 }
3131 if let Some(expand) = opts.expand {
3132 query = query.arg("expand", expand);
3133 }
3134 Container {
3135 proc: self.proc.clone(),
3136 selection: query,
3137 graphql_client: self.graphql_client.clone(),
3138 }
3139 }
3140 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3147 let mut query = self.selection.select("withMountedTemp");
3148 query = query.arg("path", path.into());
3149 Container {
3150 proc: self.proc.clone(),
3151 selection: query,
3152 graphql_client: self.graphql_client.clone(),
3153 }
3154 }
3155 pub fn with_mounted_temp_opts(
3162 &self,
3163 path: impl Into<String>,
3164 opts: ContainerWithMountedTempOpts,
3165 ) -> Container {
3166 let mut query = self.selection.select("withMountedTemp");
3167 query = query.arg("path", path.into());
3168 if let Some(size) = opts.size {
3169 query = query.arg("size", size);
3170 }
3171 if let Some(expand) = opts.expand {
3172 query = query.arg("expand", expand);
3173 }
3174 Container {
3175 proc: self.proc.clone(),
3176 selection: query,
3177 graphql_client: self.graphql_client.clone(),
3178 }
3179 }
3180 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3188 let mut query = self.selection.select("withNewFile");
3189 query = query.arg("path", path.into());
3190 query = query.arg("contents", contents.into());
3191 Container {
3192 proc: self.proc.clone(),
3193 selection: query,
3194 graphql_client: self.graphql_client.clone(),
3195 }
3196 }
3197 pub fn with_new_file_opts<'a>(
3205 &self,
3206 path: impl Into<String>,
3207 contents: impl Into<String>,
3208 opts: ContainerWithNewFileOpts<'a>,
3209 ) -> Container {
3210 let mut query = self.selection.select("withNewFile");
3211 query = query.arg("path", path.into());
3212 query = query.arg("contents", contents.into());
3213 if let Some(permissions) = opts.permissions {
3214 query = query.arg("permissions", permissions);
3215 }
3216 if let Some(owner) = opts.owner {
3217 query = query.arg("owner", owner);
3218 }
3219 if let Some(expand) = opts.expand {
3220 query = query.arg("expand", expand);
3221 }
3222 Container {
3223 proc: self.proc.clone(),
3224 selection: query,
3225 graphql_client: self.graphql_client.clone(),
3226 }
3227 }
3228 pub fn with_registry_auth(
3238 &self,
3239 address: impl Into<String>,
3240 username: impl Into<String>,
3241 secret: impl IntoID<SecretId>,
3242 ) -> Container {
3243 let mut query = self.selection.select("withRegistryAuth");
3244 query = query.arg("address", address.into());
3245 query = query.arg("username", username.into());
3246 query = query.arg_lazy(
3247 "secret",
3248 Box::new(move || {
3249 let secret = secret.clone();
3250 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3251 }),
3252 );
3253 Container {
3254 proc: self.proc.clone(),
3255 selection: query,
3256 graphql_client: self.graphql_client.clone(),
3257 }
3258 }
3259 pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
3265 let mut query = self.selection.select("withRootfs");
3266 query = query.arg_lazy(
3267 "directory",
3268 Box::new(move || {
3269 let directory = directory.clone();
3270 Box::pin(async move { directory.into_id().await.unwrap().quote() })
3271 }),
3272 );
3273 Container {
3274 proc: self.proc.clone(),
3275 selection: query,
3276 graphql_client: self.graphql_client.clone(),
3277 }
3278 }
3279 pub fn with_secret_variable(
3286 &self,
3287 name: impl Into<String>,
3288 secret: impl IntoID<SecretId>,
3289 ) -> Container {
3290 let mut query = self.selection.select("withSecretVariable");
3291 query = query.arg("name", name.into());
3292 query = query.arg_lazy(
3293 "secret",
3294 Box::new(move || {
3295 let secret = secret.clone();
3296 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3297 }),
3298 );
3299 Container {
3300 proc: self.proc.clone(),
3301 selection: query,
3302 graphql_client: self.graphql_client.clone(),
3303 }
3304 }
3305 pub fn with_service_binding(
3315 &self,
3316 alias: impl Into<String>,
3317 service: impl IntoID<ServiceId>,
3318 ) -> Container {
3319 let mut query = self.selection.select("withServiceBinding");
3320 query = query.arg("alias", alias.into());
3321 query = query.arg_lazy(
3322 "service",
3323 Box::new(move || {
3324 let service = service.clone();
3325 Box::pin(async move { service.into_id().await.unwrap().quote() })
3326 }),
3327 );
3328 Container {
3329 proc: self.proc.clone(),
3330 selection: query,
3331 graphql_client: self.graphql_client.clone(),
3332 }
3333 }
3334 pub fn with_unix_socket(
3342 &self,
3343 path: impl Into<String>,
3344 source: impl IntoID<SocketId>,
3345 ) -> Container {
3346 let mut query = self.selection.select("withUnixSocket");
3347 query = query.arg("path", path.into());
3348 query = query.arg_lazy(
3349 "source",
3350 Box::new(move || {
3351 let source = source.clone();
3352 Box::pin(async move { source.into_id().await.unwrap().quote() })
3353 }),
3354 );
3355 Container {
3356 proc: self.proc.clone(),
3357 selection: query,
3358 graphql_client: self.graphql_client.clone(),
3359 }
3360 }
3361 pub fn with_unix_socket_opts<'a>(
3369 &self,
3370 path: impl Into<String>,
3371 source: impl IntoID<SocketId>,
3372 opts: ContainerWithUnixSocketOpts<'a>,
3373 ) -> Container {
3374 let mut query = self.selection.select("withUnixSocket");
3375 query = query.arg("path", path.into());
3376 query = query.arg_lazy(
3377 "source",
3378 Box::new(move || {
3379 let source = source.clone();
3380 Box::pin(async move { source.into_id().await.unwrap().quote() })
3381 }),
3382 );
3383 if let Some(owner) = opts.owner {
3384 query = query.arg("owner", owner);
3385 }
3386 if let Some(expand) = opts.expand {
3387 query = query.arg("expand", expand);
3388 }
3389 Container {
3390 proc: self.proc.clone(),
3391 selection: query,
3392 graphql_client: self.graphql_client.clone(),
3393 }
3394 }
3395 pub fn with_user(&self, name: impl Into<String>) -> Container {
3401 let mut query = self.selection.select("withUser");
3402 query = query.arg("name", name.into());
3403 Container {
3404 proc: self.proc.clone(),
3405 selection: query,
3406 graphql_client: self.graphql_client.clone(),
3407 }
3408 }
3409 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3416 let mut query = self.selection.select("withWorkdir");
3417 query = query.arg("path", path.into());
3418 Container {
3419 proc: self.proc.clone(),
3420 selection: query,
3421 graphql_client: self.graphql_client.clone(),
3422 }
3423 }
3424 pub fn with_workdir_opts(
3431 &self,
3432 path: impl Into<String>,
3433 opts: ContainerWithWorkdirOpts,
3434 ) -> Container {
3435 let mut query = self.selection.select("withWorkdir");
3436 query = query.arg("path", path.into());
3437 if let Some(expand) = opts.expand {
3438 query = query.arg("expand", expand);
3439 }
3440 Container {
3441 proc: self.proc.clone(),
3442 selection: query,
3443 graphql_client: self.graphql_client.clone(),
3444 }
3445 }
3446 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3452 let mut query = self.selection.select("withoutAnnotation");
3453 query = query.arg("name", name.into());
3454 Container {
3455 proc: self.proc.clone(),
3456 selection: query,
3457 graphql_client: self.graphql_client.clone(),
3458 }
3459 }
3460 pub fn without_default_args(&self) -> Container {
3462 let query = self.selection.select("withoutDefaultArgs");
3463 Container {
3464 proc: self.proc.clone(),
3465 selection: query,
3466 graphql_client: self.graphql_client.clone(),
3467 }
3468 }
3469 pub fn without_directory(&self, path: impl Into<String>) -> Container {
3476 let mut query = self.selection.select("withoutDirectory");
3477 query = query.arg("path", path.into());
3478 Container {
3479 proc: self.proc.clone(),
3480 selection: query,
3481 graphql_client: self.graphql_client.clone(),
3482 }
3483 }
3484 pub fn without_directory_opts(
3491 &self,
3492 path: impl Into<String>,
3493 opts: ContainerWithoutDirectoryOpts,
3494 ) -> Container {
3495 let mut query = self.selection.select("withoutDirectory");
3496 query = query.arg("path", path.into());
3497 if let Some(expand) = opts.expand {
3498 query = query.arg("expand", expand);
3499 }
3500 Container {
3501 proc: self.proc.clone(),
3502 selection: query,
3503 graphql_client: self.graphql_client.clone(),
3504 }
3505 }
3506 pub fn without_entrypoint(&self) -> Container {
3512 let query = self.selection.select("withoutEntrypoint");
3513 Container {
3514 proc: self.proc.clone(),
3515 selection: query,
3516 graphql_client: self.graphql_client.clone(),
3517 }
3518 }
3519 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
3525 let mut query = self.selection.select("withoutEntrypoint");
3526 if let Some(keep_default_args) = opts.keep_default_args {
3527 query = query.arg("keepDefaultArgs", keep_default_args);
3528 }
3529 Container {
3530 proc: self.proc.clone(),
3531 selection: query,
3532 graphql_client: self.graphql_client.clone(),
3533 }
3534 }
3535 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
3541 let mut query = self.selection.select("withoutEnvVariable");
3542 query = query.arg("name", name.into());
3543 Container {
3544 proc: self.proc.clone(),
3545 selection: query,
3546 graphql_client: self.graphql_client.clone(),
3547 }
3548 }
3549 pub fn without_exposed_port(&self, port: isize) -> Container {
3556 let mut query = self.selection.select("withoutExposedPort");
3557 query = query.arg("port", port);
3558 Container {
3559 proc: self.proc.clone(),
3560 selection: query,
3561 graphql_client: self.graphql_client.clone(),
3562 }
3563 }
3564 pub fn without_exposed_port_opts(
3571 &self,
3572 port: isize,
3573 opts: ContainerWithoutExposedPortOpts,
3574 ) -> Container {
3575 let mut query = self.selection.select("withoutExposedPort");
3576 query = query.arg("port", port);
3577 if let Some(protocol) = opts.protocol {
3578 query = query.arg("protocol", protocol);
3579 }
3580 Container {
3581 proc: self.proc.clone(),
3582 selection: query,
3583 graphql_client: self.graphql_client.clone(),
3584 }
3585 }
3586 pub fn without_file(&self, path: impl Into<String>) -> Container {
3593 let mut query = self.selection.select("withoutFile");
3594 query = query.arg("path", path.into());
3595 Container {
3596 proc: self.proc.clone(),
3597 selection: query,
3598 graphql_client: self.graphql_client.clone(),
3599 }
3600 }
3601 pub fn without_file_opts(
3608 &self,
3609 path: impl Into<String>,
3610 opts: ContainerWithoutFileOpts,
3611 ) -> Container {
3612 let mut query = self.selection.select("withoutFile");
3613 query = query.arg("path", path.into());
3614 if let Some(expand) = opts.expand {
3615 query = query.arg("expand", expand);
3616 }
3617 Container {
3618 proc: self.proc.clone(),
3619 selection: query,
3620 graphql_client: self.graphql_client.clone(),
3621 }
3622 }
3623 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
3630 let mut query = self.selection.select("withoutFiles");
3631 query = query.arg(
3632 "paths",
3633 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3634 );
3635 Container {
3636 proc: self.proc.clone(),
3637 selection: query,
3638 graphql_client: self.graphql_client.clone(),
3639 }
3640 }
3641 pub fn without_files_opts(
3648 &self,
3649 paths: Vec<impl Into<String>>,
3650 opts: ContainerWithoutFilesOpts,
3651 ) -> Container {
3652 let mut query = self.selection.select("withoutFiles");
3653 query = query.arg(
3654 "paths",
3655 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3656 );
3657 if let Some(expand) = opts.expand {
3658 query = query.arg("expand", expand);
3659 }
3660 Container {
3661 proc: self.proc.clone(),
3662 selection: query,
3663 graphql_client: self.graphql_client.clone(),
3664 }
3665 }
3666 pub fn without_label(&self, name: impl Into<String>) -> Container {
3672 let mut query = self.selection.select("withoutLabel");
3673 query = query.arg("name", name.into());
3674 Container {
3675 proc: self.proc.clone(),
3676 selection: query,
3677 graphql_client: self.graphql_client.clone(),
3678 }
3679 }
3680 pub fn without_mount(&self, path: impl Into<String>) -> Container {
3687 let mut query = self.selection.select("withoutMount");
3688 query = query.arg("path", path.into());
3689 Container {
3690 proc: self.proc.clone(),
3691 selection: query,
3692 graphql_client: self.graphql_client.clone(),
3693 }
3694 }
3695 pub fn without_mount_opts(
3702 &self,
3703 path: impl Into<String>,
3704 opts: ContainerWithoutMountOpts,
3705 ) -> Container {
3706 let mut query = self.selection.select("withoutMount");
3707 query = query.arg("path", path.into());
3708 if let Some(expand) = opts.expand {
3709 query = query.arg("expand", expand);
3710 }
3711 Container {
3712 proc: self.proc.clone(),
3713 selection: query,
3714 graphql_client: self.graphql_client.clone(),
3715 }
3716 }
3717 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
3725 let mut query = self.selection.select("withoutRegistryAuth");
3726 query = query.arg("address", address.into());
3727 Container {
3728 proc: self.proc.clone(),
3729 selection: query,
3730 graphql_client: self.graphql_client.clone(),
3731 }
3732 }
3733 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
3739 let mut query = self.selection.select("withoutSecretVariable");
3740 query = query.arg("name", name.into());
3741 Container {
3742 proc: self.proc.clone(),
3743 selection: query,
3744 graphql_client: self.graphql_client.clone(),
3745 }
3746 }
3747 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
3754 let mut query = self.selection.select("withoutUnixSocket");
3755 query = query.arg("path", path.into());
3756 Container {
3757 proc: self.proc.clone(),
3758 selection: query,
3759 graphql_client: self.graphql_client.clone(),
3760 }
3761 }
3762 pub fn without_unix_socket_opts(
3769 &self,
3770 path: impl Into<String>,
3771 opts: ContainerWithoutUnixSocketOpts,
3772 ) -> Container {
3773 let mut query = self.selection.select("withoutUnixSocket");
3774 query = query.arg("path", path.into());
3775 if let Some(expand) = opts.expand {
3776 query = query.arg("expand", expand);
3777 }
3778 Container {
3779 proc: self.proc.clone(),
3780 selection: query,
3781 graphql_client: self.graphql_client.clone(),
3782 }
3783 }
3784 pub fn without_user(&self) -> Container {
3787 let query = self.selection.select("withoutUser");
3788 Container {
3789 proc: self.proc.clone(),
3790 selection: query,
3791 graphql_client: self.graphql_client.clone(),
3792 }
3793 }
3794 pub fn without_workdir(&self) -> Container {
3797 let query = self.selection.select("withoutWorkdir");
3798 Container {
3799 proc: self.proc.clone(),
3800 selection: query,
3801 graphql_client: self.graphql_client.clone(),
3802 }
3803 }
3804 pub async fn workdir(&self) -> Result<String, DaggerError> {
3806 let query = self.selection.select("workdir");
3807 query.execute(self.graphql_client.clone()).await
3808 }
3809}
3810#[derive(Clone)]
3811pub struct CurrentModule {
3812 pub proc: Option<Arc<DaggerSessionProc>>,
3813 pub selection: Selection,
3814 pub graphql_client: DynGraphQLClient,
3815}
3816#[derive(Builder, Debug, PartialEq)]
3817pub struct CurrentModuleWorkdirOpts<'a> {
3818 #[builder(setter(into, strip_option), default)]
3820 pub exclude: Option<Vec<&'a str>>,
3821 #[builder(setter(into, strip_option), default)]
3823 pub include: Option<Vec<&'a str>>,
3824}
3825impl CurrentModule {
3826 pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
3828 let query = self.selection.select("id");
3829 query.execute(self.graphql_client.clone()).await
3830 }
3831 pub async fn name(&self) -> Result<String, DaggerError> {
3833 let query = self.selection.select("name");
3834 query.execute(self.graphql_client.clone()).await
3835 }
3836 pub fn source(&self) -> Directory {
3838 let query = self.selection.select("source");
3839 Directory {
3840 proc: self.proc.clone(),
3841 selection: query,
3842 graphql_client: self.graphql_client.clone(),
3843 }
3844 }
3845 pub fn workdir(&self, path: impl Into<String>) -> Directory {
3852 let mut query = self.selection.select("workdir");
3853 query = query.arg("path", path.into());
3854 Directory {
3855 proc: self.proc.clone(),
3856 selection: query,
3857 graphql_client: self.graphql_client.clone(),
3858 }
3859 }
3860 pub fn workdir_opts<'a>(
3867 &self,
3868 path: impl Into<String>,
3869 opts: CurrentModuleWorkdirOpts<'a>,
3870 ) -> Directory {
3871 let mut query = self.selection.select("workdir");
3872 query = query.arg("path", path.into());
3873 if let Some(exclude) = opts.exclude {
3874 query = query.arg("exclude", exclude);
3875 }
3876 if let Some(include) = opts.include {
3877 query = query.arg("include", include);
3878 }
3879 Directory {
3880 proc: self.proc.clone(),
3881 selection: query,
3882 graphql_client: self.graphql_client.clone(),
3883 }
3884 }
3885 pub fn workdir_file(&self, path: impl Into<String>) -> File {
3891 let mut query = self.selection.select("workdirFile");
3892 query = query.arg("path", path.into());
3893 File {
3894 proc: self.proc.clone(),
3895 selection: query,
3896 graphql_client: self.graphql_client.clone(),
3897 }
3898 }
3899}
3900#[derive(Clone)]
3901pub struct Directory {
3902 pub proc: Option<Arc<DaggerSessionProc>>,
3903 pub selection: Selection,
3904 pub graphql_client: DynGraphQLClient,
3905}
3906#[derive(Builder, Debug, PartialEq)]
3907pub struct DirectoryAsModuleOpts<'a> {
3908 #[builder(setter(into, strip_option), default)]
3911 pub source_root_path: Option<&'a str>,
3912}
3913#[derive(Builder, Debug, PartialEq)]
3914pub struct DirectoryAsModuleSourceOpts<'a> {
3915 #[builder(setter(into, strip_option), default)]
3918 pub source_root_path: Option<&'a str>,
3919}
3920#[derive(Builder, Debug, PartialEq)]
3921pub struct DirectoryDockerBuildOpts<'a> {
3922 #[builder(setter(into, strip_option), default)]
3924 pub build_args: Option<Vec<BuildArg>>,
3925 #[builder(setter(into, strip_option), default)]
3927 pub dockerfile: Option<&'a str>,
3928 #[builder(setter(into, strip_option), default)]
3930 pub platform: Option<Platform>,
3931 #[builder(setter(into, strip_option), default)]
3934 pub secrets: Option<Vec<SecretId>>,
3935 #[builder(setter(into, strip_option), default)]
3937 pub target: Option<&'a str>,
3938}
3939#[derive(Builder, Debug, PartialEq)]
3940pub struct DirectoryEntriesOpts<'a> {
3941 #[builder(setter(into, strip_option), default)]
3943 pub path: Option<&'a str>,
3944}
3945#[derive(Builder, Debug, PartialEq)]
3946pub struct DirectoryExportOpts {
3947 #[builder(setter(into, strip_option), default)]
3949 pub wipe: Option<bool>,
3950}
3951#[derive(Builder, Debug, PartialEq)]
3952pub struct DirectoryTerminalOpts<'a> {
3953 #[builder(setter(into, strip_option), default)]
3955 pub cmd: Option<Vec<&'a str>>,
3956 #[builder(setter(into, strip_option), default)]
3958 pub container: Option<ContainerId>,
3959 #[builder(setter(into, strip_option), default)]
3962 pub experimental_privileged_nesting: Option<bool>,
3963 #[builder(setter(into, strip_option), default)]
3965 pub insecure_root_capabilities: Option<bool>,
3966}
3967#[derive(Builder, Debug, PartialEq)]
3968pub struct DirectoryWithDirectoryOpts<'a> {
3969 #[builder(setter(into, strip_option), default)]
3971 pub exclude: Option<Vec<&'a str>>,
3972 #[builder(setter(into, strip_option), default)]
3974 pub include: Option<Vec<&'a str>>,
3975}
3976#[derive(Builder, Debug, PartialEq)]
3977pub struct DirectoryWithFileOpts {
3978 #[builder(setter(into, strip_option), default)]
3980 pub permissions: Option<isize>,
3981}
3982#[derive(Builder, Debug, PartialEq)]
3983pub struct DirectoryWithFilesOpts {
3984 #[builder(setter(into, strip_option), default)]
3986 pub permissions: Option<isize>,
3987}
3988#[derive(Builder, Debug, PartialEq)]
3989pub struct DirectoryWithNewDirectoryOpts {
3990 #[builder(setter(into, strip_option), default)]
3992 pub permissions: Option<isize>,
3993}
3994#[derive(Builder, Debug, PartialEq)]
3995pub struct DirectoryWithNewFileOpts {
3996 #[builder(setter(into, strip_option), default)]
3998 pub permissions: Option<isize>,
3999}
4000impl Directory {
4001 pub fn as_module(&self) -> Module {
4007 let query = self.selection.select("asModule");
4008 Module {
4009 proc: self.proc.clone(),
4010 selection: query,
4011 graphql_client: self.graphql_client.clone(),
4012 }
4013 }
4014 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4020 let mut query = self.selection.select("asModule");
4021 if let Some(source_root_path) = opts.source_root_path {
4022 query = query.arg("sourceRootPath", source_root_path);
4023 }
4024 Module {
4025 proc: self.proc.clone(),
4026 selection: query,
4027 graphql_client: self.graphql_client.clone(),
4028 }
4029 }
4030 pub fn as_module_source(&self) -> ModuleSource {
4036 let query = self.selection.select("asModuleSource");
4037 ModuleSource {
4038 proc: self.proc.clone(),
4039 selection: query,
4040 graphql_client: self.graphql_client.clone(),
4041 }
4042 }
4043 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4049 let mut query = self.selection.select("asModuleSource");
4050 if let Some(source_root_path) = opts.source_root_path {
4051 query = query.arg("sourceRootPath", source_root_path);
4052 }
4053 ModuleSource {
4054 proc: self.proc.clone(),
4055 selection: query,
4056 graphql_client: self.graphql_client.clone(),
4057 }
4058 }
4059 pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
4065 let mut query = self.selection.select("diff");
4066 query = query.arg_lazy(
4067 "other",
4068 Box::new(move || {
4069 let other = other.clone();
4070 Box::pin(async move { other.into_id().await.unwrap().quote() })
4071 }),
4072 );
4073 Directory {
4074 proc: self.proc.clone(),
4075 selection: query,
4076 graphql_client: self.graphql_client.clone(),
4077 }
4078 }
4079 pub async fn digest(&self) -> Result<String, DaggerError> {
4081 let query = self.selection.select("digest");
4082 query.execute(self.graphql_client.clone()).await
4083 }
4084 pub fn directory(&self, path: impl Into<String>) -> Directory {
4090 let mut query = self.selection.select("directory");
4091 query = query.arg("path", path.into());
4092 Directory {
4093 proc: self.proc.clone(),
4094 selection: query,
4095 graphql_client: self.graphql_client.clone(),
4096 }
4097 }
4098 pub fn docker_build(&self) -> Container {
4104 let query = self.selection.select("dockerBuild");
4105 Container {
4106 proc: self.proc.clone(),
4107 selection: query,
4108 graphql_client: self.graphql_client.clone(),
4109 }
4110 }
4111 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
4117 let mut query = self.selection.select("dockerBuild");
4118 if let Some(platform) = opts.platform {
4119 query = query.arg("platform", platform);
4120 }
4121 if let Some(dockerfile) = opts.dockerfile {
4122 query = query.arg("dockerfile", dockerfile);
4123 }
4124 if let Some(target) = opts.target {
4125 query = query.arg("target", target);
4126 }
4127 if let Some(build_args) = opts.build_args {
4128 query = query.arg("buildArgs", build_args);
4129 }
4130 if let Some(secrets) = opts.secrets {
4131 query = query.arg("secrets", secrets);
4132 }
4133 Container {
4134 proc: self.proc.clone(),
4135 selection: query,
4136 graphql_client: self.graphql_client.clone(),
4137 }
4138 }
4139 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
4145 let query = self.selection.select("entries");
4146 query.execute(self.graphql_client.clone()).await
4147 }
4148 pub async fn entries_opts<'a>(
4154 &self,
4155 opts: DirectoryEntriesOpts<'a>,
4156 ) -> Result<Vec<String>, DaggerError> {
4157 let mut query = self.selection.select("entries");
4158 if let Some(path) = opts.path {
4159 query = query.arg("path", path);
4160 }
4161 query.execute(self.graphql_client.clone()).await
4162 }
4163 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4170 let mut query = self.selection.select("export");
4171 query = query.arg("path", path.into());
4172 query.execute(self.graphql_client.clone()).await
4173 }
4174 pub async fn export_opts(
4181 &self,
4182 path: impl Into<String>,
4183 opts: DirectoryExportOpts,
4184 ) -> Result<String, DaggerError> {
4185 let mut query = self.selection.select("export");
4186 query = query.arg("path", path.into());
4187 if let Some(wipe) = opts.wipe {
4188 query = query.arg("wipe", wipe);
4189 }
4190 query.execute(self.graphql_client.clone()).await
4191 }
4192 pub fn file(&self, path: impl Into<String>) -> File {
4198 let mut query = self.selection.select("file");
4199 query = query.arg("path", path.into());
4200 File {
4201 proc: self.proc.clone(),
4202 selection: query,
4203 graphql_client: self.graphql_client.clone(),
4204 }
4205 }
4206 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
4212 let mut query = self.selection.select("glob");
4213 query = query.arg("pattern", pattern.into());
4214 query.execute(self.graphql_client.clone()).await
4215 }
4216 pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
4218 let query = self.selection.select("id");
4219 query.execute(self.graphql_client.clone()).await
4220 }
4221 pub async fn name(&self) -> Result<String, DaggerError> {
4223 let query = self.selection.select("name");
4224 query.execute(self.graphql_client.clone()).await
4225 }
4226 pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
4228 let query = self.selection.select("sync");
4229 query.execute(self.graphql_client.clone()).await
4230 }
4231 pub fn terminal(&self) -> Directory {
4237 let query = self.selection.select("terminal");
4238 Directory {
4239 proc: self.proc.clone(),
4240 selection: query,
4241 graphql_client: self.graphql_client.clone(),
4242 }
4243 }
4244 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
4250 let mut query = self.selection.select("terminal");
4251 if let Some(cmd) = opts.cmd {
4252 query = query.arg("cmd", cmd);
4253 }
4254 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4255 query = query.arg(
4256 "experimentalPrivilegedNesting",
4257 experimental_privileged_nesting,
4258 );
4259 }
4260 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4261 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4262 }
4263 if let Some(container) = opts.container {
4264 query = query.arg("container", container);
4265 }
4266 Directory {
4267 proc: self.proc.clone(),
4268 selection: query,
4269 graphql_client: self.graphql_client.clone(),
4270 }
4271 }
4272 pub fn with_directory(
4280 &self,
4281 path: impl Into<String>,
4282 directory: impl IntoID<DirectoryId>,
4283 ) -> Directory {
4284 let mut query = self.selection.select("withDirectory");
4285 query = query.arg("path", path.into());
4286 query = query.arg_lazy(
4287 "directory",
4288 Box::new(move || {
4289 let directory = directory.clone();
4290 Box::pin(async move { directory.into_id().await.unwrap().quote() })
4291 }),
4292 );
4293 Directory {
4294 proc: self.proc.clone(),
4295 selection: query,
4296 graphql_client: self.graphql_client.clone(),
4297 }
4298 }
4299 pub fn with_directory_opts<'a>(
4307 &self,
4308 path: impl Into<String>,
4309 directory: impl IntoID<DirectoryId>,
4310 opts: DirectoryWithDirectoryOpts<'a>,
4311 ) -> Directory {
4312 let mut query = self.selection.select("withDirectory");
4313 query = query.arg("path", path.into());
4314 query = query.arg_lazy(
4315 "directory",
4316 Box::new(move || {
4317 let directory = directory.clone();
4318 Box::pin(async move { directory.into_id().await.unwrap().quote() })
4319 }),
4320 );
4321 if let Some(exclude) = opts.exclude {
4322 query = query.arg("exclude", exclude);
4323 }
4324 if let Some(include) = opts.include {
4325 query = query.arg("include", include);
4326 }
4327 Directory {
4328 proc: self.proc.clone(),
4329 selection: query,
4330 graphql_client: self.graphql_client.clone(),
4331 }
4332 }
4333 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
4341 let mut query = self.selection.select("withFile");
4342 query = query.arg("path", path.into());
4343 query = query.arg_lazy(
4344 "source",
4345 Box::new(move || {
4346 let source = source.clone();
4347 Box::pin(async move { source.into_id().await.unwrap().quote() })
4348 }),
4349 );
4350 Directory {
4351 proc: self.proc.clone(),
4352 selection: query,
4353 graphql_client: self.graphql_client.clone(),
4354 }
4355 }
4356 pub fn with_file_opts(
4364 &self,
4365 path: impl Into<String>,
4366 source: impl IntoID<FileId>,
4367 opts: DirectoryWithFileOpts,
4368 ) -> Directory {
4369 let mut query = self.selection.select("withFile");
4370 query = query.arg("path", path.into());
4371 query = query.arg_lazy(
4372 "source",
4373 Box::new(move || {
4374 let source = source.clone();
4375 Box::pin(async move { source.into_id().await.unwrap().quote() })
4376 }),
4377 );
4378 if let Some(permissions) = opts.permissions {
4379 query = query.arg("permissions", permissions);
4380 }
4381 Directory {
4382 proc: self.proc.clone(),
4383 selection: query,
4384 graphql_client: self.graphql_client.clone(),
4385 }
4386 }
4387 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
4395 let mut query = self.selection.select("withFiles");
4396 query = query.arg("path", path.into());
4397 query = query.arg("sources", sources);
4398 Directory {
4399 proc: self.proc.clone(),
4400 selection: query,
4401 graphql_client: self.graphql_client.clone(),
4402 }
4403 }
4404 pub fn with_files_opts(
4412 &self,
4413 path: impl Into<String>,
4414 sources: Vec<FileId>,
4415 opts: DirectoryWithFilesOpts,
4416 ) -> Directory {
4417 let mut query = self.selection.select("withFiles");
4418 query = query.arg("path", path.into());
4419 query = query.arg("sources", sources);
4420 if let Some(permissions) = opts.permissions {
4421 query = query.arg("permissions", permissions);
4422 }
4423 Directory {
4424 proc: self.proc.clone(),
4425 selection: query,
4426 graphql_client: self.graphql_client.clone(),
4427 }
4428 }
4429 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
4436 let mut query = self.selection.select("withNewDirectory");
4437 query = query.arg("path", path.into());
4438 Directory {
4439 proc: self.proc.clone(),
4440 selection: query,
4441 graphql_client: self.graphql_client.clone(),
4442 }
4443 }
4444 pub fn with_new_directory_opts(
4451 &self,
4452 path: impl Into<String>,
4453 opts: DirectoryWithNewDirectoryOpts,
4454 ) -> Directory {
4455 let mut query = self.selection.select("withNewDirectory");
4456 query = query.arg("path", path.into());
4457 if let Some(permissions) = opts.permissions {
4458 query = query.arg("permissions", permissions);
4459 }
4460 Directory {
4461 proc: self.proc.clone(),
4462 selection: query,
4463 graphql_client: self.graphql_client.clone(),
4464 }
4465 }
4466 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
4474 let mut query = self.selection.select("withNewFile");
4475 query = query.arg("path", path.into());
4476 query = query.arg("contents", contents.into());
4477 Directory {
4478 proc: self.proc.clone(),
4479 selection: query,
4480 graphql_client: self.graphql_client.clone(),
4481 }
4482 }
4483 pub fn with_new_file_opts(
4491 &self,
4492 path: impl Into<String>,
4493 contents: impl Into<String>,
4494 opts: DirectoryWithNewFileOpts,
4495 ) -> Directory {
4496 let mut query = self.selection.select("withNewFile");
4497 query = query.arg("path", path.into());
4498 query = query.arg("contents", contents.into());
4499 if let Some(permissions) = opts.permissions {
4500 query = query.arg("permissions", permissions);
4501 }
4502 Directory {
4503 proc: self.proc.clone(),
4504 selection: query,
4505 graphql_client: self.graphql_client.clone(),
4506 }
4507 }
4508 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
4516 let mut query = self.selection.select("withTimestamps");
4517 query = query.arg("timestamp", timestamp);
4518 Directory {
4519 proc: self.proc.clone(),
4520 selection: query,
4521 graphql_client: self.graphql_client.clone(),
4522 }
4523 }
4524 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
4530 let mut query = self.selection.select("withoutDirectory");
4531 query = query.arg("path", path.into());
4532 Directory {
4533 proc: self.proc.clone(),
4534 selection: query,
4535 graphql_client: self.graphql_client.clone(),
4536 }
4537 }
4538 pub fn without_file(&self, path: impl Into<String>) -> Directory {
4544 let mut query = self.selection.select("withoutFile");
4545 query = query.arg("path", path.into());
4546 Directory {
4547 proc: self.proc.clone(),
4548 selection: query,
4549 graphql_client: self.graphql_client.clone(),
4550 }
4551 }
4552 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
4558 let mut query = self.selection.select("withoutFiles");
4559 query = query.arg(
4560 "paths",
4561 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4562 );
4563 Directory {
4564 proc: self.proc.clone(),
4565 selection: query,
4566 graphql_client: self.graphql_client.clone(),
4567 }
4568 }
4569}
4570#[derive(Clone)]
4571pub struct Engine {
4572 pub proc: Option<Arc<DaggerSessionProc>>,
4573 pub selection: Selection,
4574 pub graphql_client: DynGraphQLClient,
4575}
4576impl Engine {
4577 pub async fn id(&self) -> Result<EngineId, DaggerError> {
4579 let query = self.selection.select("id");
4580 query.execute(self.graphql_client.clone()).await
4581 }
4582 pub fn local_cache(&self) -> EngineCache {
4584 let query = self.selection.select("localCache");
4585 EngineCache {
4586 proc: self.proc.clone(),
4587 selection: query,
4588 graphql_client: self.graphql_client.clone(),
4589 }
4590 }
4591}
4592#[derive(Clone)]
4593pub struct EngineCache {
4594 pub proc: Option<Arc<DaggerSessionProc>>,
4595 pub selection: Selection,
4596 pub graphql_client: DynGraphQLClient,
4597}
4598#[derive(Builder, Debug, PartialEq)]
4599pub struct EngineCacheEntrySetOpts<'a> {
4600 #[builder(setter(into, strip_option), default)]
4601 pub key: Option<&'a str>,
4602}
4603impl EngineCache {
4604 pub fn entry_set(&self) -> EngineCacheEntrySet {
4610 let query = self.selection.select("entrySet");
4611 EngineCacheEntrySet {
4612 proc: self.proc.clone(),
4613 selection: query,
4614 graphql_client: self.graphql_client.clone(),
4615 }
4616 }
4617 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
4623 let mut query = self.selection.select("entrySet");
4624 if let Some(key) = opts.key {
4625 query = query.arg("key", key);
4626 }
4627 EngineCacheEntrySet {
4628 proc: self.proc.clone(),
4629 selection: query,
4630 graphql_client: self.graphql_client.clone(),
4631 }
4632 }
4633 pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
4635 let query = self.selection.select("id");
4636 query.execute(self.graphql_client.clone()).await
4637 }
4638 pub async fn keep_bytes(&self) -> Result<isize, DaggerError> {
4640 let query = self.selection.select("keepBytes");
4641 query.execute(self.graphql_client.clone()).await
4642 }
4643 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
4645 let query = self.selection.select("maxUsedSpace");
4646 query.execute(self.graphql_client.clone()).await
4647 }
4648 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
4650 let query = self.selection.select("minFreeSpace");
4651 query.execute(self.graphql_client.clone()).await
4652 }
4653 pub async fn prune(&self) -> Result<Void, DaggerError> {
4655 let query = self.selection.select("prune");
4656 query.execute(self.graphql_client.clone()).await
4657 }
4658 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
4659 let query = self.selection.select("reservedSpace");
4660 query.execute(self.graphql_client.clone()).await
4661 }
4662}
4663#[derive(Clone)]
4664pub struct EngineCacheEntry {
4665 pub proc: Option<Arc<DaggerSessionProc>>,
4666 pub selection: Selection,
4667 pub graphql_client: DynGraphQLClient,
4668}
4669impl EngineCacheEntry {
4670 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
4672 let query = self.selection.select("activelyUsed");
4673 query.execute(self.graphql_client.clone()).await
4674 }
4675 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
4677 let query = self.selection.select("createdTimeUnixNano");
4678 query.execute(self.graphql_client.clone()).await
4679 }
4680 pub async fn description(&self) -> Result<String, DaggerError> {
4682 let query = self.selection.select("description");
4683 query.execute(self.graphql_client.clone()).await
4684 }
4685 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
4687 let query = self.selection.select("diskSpaceBytes");
4688 query.execute(self.graphql_client.clone()).await
4689 }
4690 pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
4692 let query = self.selection.select("id");
4693 query.execute(self.graphql_client.clone()).await
4694 }
4695 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
4697 let query = self.selection.select("mostRecentUseTimeUnixNano");
4698 query.execute(self.graphql_client.clone()).await
4699 }
4700}
4701#[derive(Clone)]
4702pub struct EngineCacheEntrySet {
4703 pub proc: Option<Arc<DaggerSessionProc>>,
4704 pub selection: Selection,
4705 pub graphql_client: DynGraphQLClient,
4706}
4707impl EngineCacheEntrySet {
4708 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
4710 let query = self.selection.select("diskSpaceBytes");
4711 query.execute(self.graphql_client.clone()).await
4712 }
4713 pub fn entries(&self) -> Vec<EngineCacheEntry> {
4715 let query = self.selection.select("entries");
4716 vec![EngineCacheEntry {
4717 proc: self.proc.clone(),
4718 selection: query,
4719 graphql_client: self.graphql_client.clone(),
4720 }]
4721 }
4722 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
4724 let query = self.selection.select("entryCount");
4725 query.execute(self.graphql_client.clone()).await
4726 }
4727 pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
4729 let query = self.selection.select("id");
4730 query.execute(self.graphql_client.clone()).await
4731 }
4732}
4733#[derive(Clone)]
4734pub struct EnumTypeDef {
4735 pub proc: Option<Arc<DaggerSessionProc>>,
4736 pub selection: Selection,
4737 pub graphql_client: DynGraphQLClient,
4738}
4739impl EnumTypeDef {
4740 pub async fn description(&self) -> Result<String, DaggerError> {
4742 let query = self.selection.select("description");
4743 query.execute(self.graphql_client.clone()).await
4744 }
4745 pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
4747 let query = self.selection.select("id");
4748 query.execute(self.graphql_client.clone()).await
4749 }
4750 pub async fn name(&self) -> Result<String, DaggerError> {
4752 let query = self.selection.select("name");
4753 query.execute(self.graphql_client.clone()).await
4754 }
4755 pub fn source_map(&self) -> SourceMap {
4757 let query = self.selection.select("sourceMap");
4758 SourceMap {
4759 proc: self.proc.clone(),
4760 selection: query,
4761 graphql_client: self.graphql_client.clone(),
4762 }
4763 }
4764 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
4766 let query = self.selection.select("sourceModuleName");
4767 query.execute(self.graphql_client.clone()).await
4768 }
4769 pub fn values(&self) -> Vec<EnumValueTypeDef> {
4771 let query = self.selection.select("values");
4772 vec![EnumValueTypeDef {
4773 proc: self.proc.clone(),
4774 selection: query,
4775 graphql_client: self.graphql_client.clone(),
4776 }]
4777 }
4778}
4779#[derive(Clone)]
4780pub struct EnumValueTypeDef {
4781 pub proc: Option<Arc<DaggerSessionProc>>,
4782 pub selection: Selection,
4783 pub graphql_client: DynGraphQLClient,
4784}
4785impl EnumValueTypeDef {
4786 pub async fn description(&self) -> Result<String, DaggerError> {
4788 let query = self.selection.select("description");
4789 query.execute(self.graphql_client.clone()).await
4790 }
4791 pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
4793 let query = self.selection.select("id");
4794 query.execute(self.graphql_client.clone()).await
4795 }
4796 pub async fn name(&self) -> Result<String, DaggerError> {
4798 let query = self.selection.select("name");
4799 query.execute(self.graphql_client.clone()).await
4800 }
4801 pub fn source_map(&self) -> SourceMap {
4803 let query = self.selection.select("sourceMap");
4804 SourceMap {
4805 proc: self.proc.clone(),
4806 selection: query,
4807 graphql_client: self.graphql_client.clone(),
4808 }
4809 }
4810}
4811#[derive(Clone)]
4812pub struct EnvVariable {
4813 pub proc: Option<Arc<DaggerSessionProc>>,
4814 pub selection: Selection,
4815 pub graphql_client: DynGraphQLClient,
4816}
4817impl EnvVariable {
4818 pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
4820 let query = self.selection.select("id");
4821 query.execute(self.graphql_client.clone()).await
4822 }
4823 pub async fn name(&self) -> Result<String, DaggerError> {
4825 let query = self.selection.select("name");
4826 query.execute(self.graphql_client.clone()).await
4827 }
4828 pub async fn value(&self) -> Result<String, DaggerError> {
4830 let query = self.selection.select("value");
4831 query.execute(self.graphql_client.clone()).await
4832 }
4833}
4834#[derive(Clone)]
4835pub struct Error {
4836 pub proc: Option<Arc<DaggerSessionProc>>,
4837 pub selection: Selection,
4838 pub graphql_client: DynGraphQLClient,
4839}
4840impl Error {
4841 pub async fn id(&self) -> Result<ErrorId, DaggerError> {
4843 let query = self.selection.select("id");
4844 query.execute(self.graphql_client.clone()).await
4845 }
4846 pub async fn message(&self) -> Result<String, DaggerError> {
4848 let query = self.selection.select("message");
4849 query.execute(self.graphql_client.clone()).await
4850 }
4851}
4852#[derive(Clone)]
4853pub struct FieldTypeDef {
4854 pub proc: Option<Arc<DaggerSessionProc>>,
4855 pub selection: Selection,
4856 pub graphql_client: DynGraphQLClient,
4857}
4858impl FieldTypeDef {
4859 pub async fn description(&self) -> Result<String, DaggerError> {
4861 let query = self.selection.select("description");
4862 query.execute(self.graphql_client.clone()).await
4863 }
4864 pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
4866 let query = self.selection.select("id");
4867 query.execute(self.graphql_client.clone()).await
4868 }
4869 pub async fn name(&self) -> Result<String, DaggerError> {
4871 let query = self.selection.select("name");
4872 query.execute(self.graphql_client.clone()).await
4873 }
4874 pub fn source_map(&self) -> SourceMap {
4876 let query = self.selection.select("sourceMap");
4877 SourceMap {
4878 proc: self.proc.clone(),
4879 selection: query,
4880 graphql_client: self.graphql_client.clone(),
4881 }
4882 }
4883 pub fn type_def(&self) -> TypeDef {
4885 let query = self.selection.select("typeDef");
4886 TypeDef {
4887 proc: self.proc.clone(),
4888 selection: query,
4889 graphql_client: self.graphql_client.clone(),
4890 }
4891 }
4892}
4893#[derive(Clone)]
4894pub struct File {
4895 pub proc: Option<Arc<DaggerSessionProc>>,
4896 pub selection: Selection,
4897 pub graphql_client: DynGraphQLClient,
4898}
4899#[derive(Builder, Debug, PartialEq)]
4900pub struct FileDigestOpts {
4901 #[builder(setter(into, strip_option), default)]
4903 pub exclude_metadata: Option<bool>,
4904}
4905#[derive(Builder, Debug, PartialEq)]
4906pub struct FileExportOpts {
4907 #[builder(setter(into, strip_option), default)]
4909 pub allow_parent_dir_path: Option<bool>,
4910}
4911impl File {
4912 pub async fn contents(&self) -> Result<String, DaggerError> {
4914 let query = self.selection.select("contents");
4915 query.execute(self.graphql_client.clone()).await
4916 }
4917 pub async fn digest(&self) -> Result<String, DaggerError> {
4923 let query = self.selection.select("digest");
4924 query.execute(self.graphql_client.clone()).await
4925 }
4926 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
4932 let mut query = self.selection.select("digest");
4933 if let Some(exclude_metadata) = opts.exclude_metadata {
4934 query = query.arg("excludeMetadata", exclude_metadata);
4935 }
4936 query.execute(self.graphql_client.clone()).await
4937 }
4938 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4945 let mut query = self.selection.select("export");
4946 query = query.arg("path", path.into());
4947 query.execute(self.graphql_client.clone()).await
4948 }
4949 pub async fn export_opts(
4956 &self,
4957 path: impl Into<String>,
4958 opts: FileExportOpts,
4959 ) -> Result<String, DaggerError> {
4960 let mut query = self.selection.select("export");
4961 query = query.arg("path", path.into());
4962 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
4963 query = query.arg("allowParentDirPath", allow_parent_dir_path);
4964 }
4965 query.execute(self.graphql_client.clone()).await
4966 }
4967 pub async fn id(&self) -> Result<FileId, DaggerError> {
4969 let query = self.selection.select("id");
4970 query.execute(self.graphql_client.clone()).await
4971 }
4972 pub async fn name(&self) -> Result<String, DaggerError> {
4974 let query = self.selection.select("name");
4975 query.execute(self.graphql_client.clone()).await
4976 }
4977 pub async fn size(&self) -> Result<isize, DaggerError> {
4979 let query = self.selection.select("size");
4980 query.execute(self.graphql_client.clone()).await
4981 }
4982 pub async fn sync(&self) -> Result<FileId, DaggerError> {
4984 let query = self.selection.select("sync");
4985 query.execute(self.graphql_client.clone()).await
4986 }
4987 pub fn with_name(&self, name: impl Into<String>) -> File {
4993 let mut query = self.selection.select("withName");
4994 query = query.arg("name", name.into());
4995 File {
4996 proc: self.proc.clone(),
4997 selection: query,
4998 graphql_client: self.graphql_client.clone(),
4999 }
5000 }
5001 pub fn with_timestamps(&self, timestamp: isize) -> File {
5009 let mut query = self.selection.select("withTimestamps");
5010 query = query.arg("timestamp", timestamp);
5011 File {
5012 proc: self.proc.clone(),
5013 selection: query,
5014 graphql_client: self.graphql_client.clone(),
5015 }
5016 }
5017}
5018#[derive(Clone)]
5019pub struct Function {
5020 pub proc: Option<Arc<DaggerSessionProc>>,
5021 pub selection: Selection,
5022 pub graphql_client: DynGraphQLClient,
5023}
5024#[derive(Builder, Debug, PartialEq)]
5025pub struct FunctionWithArgOpts<'a> {
5026 #[builder(setter(into, strip_option), default)]
5028 pub default_path: Option<&'a str>,
5029 #[builder(setter(into, strip_option), default)]
5031 pub default_value: Option<Json>,
5032 #[builder(setter(into, strip_option), default)]
5034 pub description: Option<&'a str>,
5035 #[builder(setter(into, strip_option), default)]
5037 pub ignore: Option<Vec<&'a str>>,
5038 #[builder(setter(into, strip_option), default)]
5039 pub source_map: Option<SourceMapId>,
5040}
5041impl Function {
5042 pub fn args(&self) -> Vec<FunctionArg> {
5044 let query = self.selection.select("args");
5045 vec![FunctionArg {
5046 proc: self.proc.clone(),
5047 selection: query,
5048 graphql_client: self.graphql_client.clone(),
5049 }]
5050 }
5051 pub async fn description(&self) -> Result<String, DaggerError> {
5053 let query = self.selection.select("description");
5054 query.execute(self.graphql_client.clone()).await
5055 }
5056 pub async fn id(&self) -> Result<FunctionId, DaggerError> {
5058 let query = self.selection.select("id");
5059 query.execute(self.graphql_client.clone()).await
5060 }
5061 pub async fn name(&self) -> Result<String, DaggerError> {
5063 let query = self.selection.select("name");
5064 query.execute(self.graphql_client.clone()).await
5065 }
5066 pub fn return_type(&self) -> TypeDef {
5068 let query = self.selection.select("returnType");
5069 TypeDef {
5070 proc: self.proc.clone(),
5071 selection: query,
5072 graphql_client: self.graphql_client.clone(),
5073 }
5074 }
5075 pub fn source_map(&self) -> SourceMap {
5077 let query = self.selection.select("sourceMap");
5078 SourceMap {
5079 proc: self.proc.clone(),
5080 selection: query,
5081 graphql_client: self.graphql_client.clone(),
5082 }
5083 }
5084 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
5092 let mut query = self.selection.select("withArg");
5093 query = query.arg("name", name.into());
5094 query = query.arg_lazy(
5095 "typeDef",
5096 Box::new(move || {
5097 let type_def = type_def.clone();
5098 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
5099 }),
5100 );
5101 Function {
5102 proc: self.proc.clone(),
5103 selection: query,
5104 graphql_client: self.graphql_client.clone(),
5105 }
5106 }
5107 pub fn with_arg_opts<'a>(
5115 &self,
5116 name: impl Into<String>,
5117 type_def: impl IntoID<TypeDefId>,
5118 opts: FunctionWithArgOpts<'a>,
5119 ) -> Function {
5120 let mut query = self.selection.select("withArg");
5121 query = query.arg("name", name.into());
5122 query = query.arg_lazy(
5123 "typeDef",
5124 Box::new(move || {
5125 let type_def = type_def.clone();
5126 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
5127 }),
5128 );
5129 if let Some(description) = opts.description {
5130 query = query.arg("description", description);
5131 }
5132 if let Some(default_value) = opts.default_value {
5133 query = query.arg("defaultValue", default_value);
5134 }
5135 if let Some(default_path) = opts.default_path {
5136 query = query.arg("defaultPath", default_path);
5137 }
5138 if let Some(ignore) = opts.ignore {
5139 query = query.arg("ignore", ignore);
5140 }
5141 if let Some(source_map) = opts.source_map {
5142 query = query.arg("sourceMap", source_map);
5143 }
5144 Function {
5145 proc: self.proc.clone(),
5146 selection: query,
5147 graphql_client: self.graphql_client.clone(),
5148 }
5149 }
5150 pub fn with_description(&self, description: impl Into<String>) -> Function {
5156 let mut query = self.selection.select("withDescription");
5157 query = query.arg("description", description.into());
5158 Function {
5159 proc: self.proc.clone(),
5160 selection: query,
5161 graphql_client: self.graphql_client.clone(),
5162 }
5163 }
5164 pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
5170 let mut query = self.selection.select("withSourceMap");
5171 query = query.arg_lazy(
5172 "sourceMap",
5173 Box::new(move || {
5174 let source_map = source_map.clone();
5175 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
5176 }),
5177 );
5178 Function {
5179 proc: self.proc.clone(),
5180 selection: query,
5181 graphql_client: self.graphql_client.clone(),
5182 }
5183 }
5184}
5185#[derive(Clone)]
5186pub struct FunctionArg {
5187 pub proc: Option<Arc<DaggerSessionProc>>,
5188 pub selection: Selection,
5189 pub graphql_client: DynGraphQLClient,
5190}
5191impl FunctionArg {
5192 pub async fn default_path(&self) -> Result<String, DaggerError> {
5194 let query = self.selection.select("defaultPath");
5195 query.execute(self.graphql_client.clone()).await
5196 }
5197 pub async fn default_value(&self) -> Result<Json, DaggerError> {
5199 let query = self.selection.select("defaultValue");
5200 query.execute(self.graphql_client.clone()).await
5201 }
5202 pub async fn description(&self) -> Result<String, DaggerError> {
5204 let query = self.selection.select("description");
5205 query.execute(self.graphql_client.clone()).await
5206 }
5207 pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
5209 let query = self.selection.select("id");
5210 query.execute(self.graphql_client.clone()).await
5211 }
5212 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
5214 let query = self.selection.select("ignore");
5215 query.execute(self.graphql_client.clone()).await
5216 }
5217 pub async fn name(&self) -> Result<String, DaggerError> {
5219 let query = self.selection.select("name");
5220 query.execute(self.graphql_client.clone()).await
5221 }
5222 pub fn source_map(&self) -> SourceMap {
5224 let query = self.selection.select("sourceMap");
5225 SourceMap {
5226 proc: self.proc.clone(),
5227 selection: query,
5228 graphql_client: self.graphql_client.clone(),
5229 }
5230 }
5231 pub fn type_def(&self) -> TypeDef {
5233 let query = self.selection.select("typeDef");
5234 TypeDef {
5235 proc: self.proc.clone(),
5236 selection: query,
5237 graphql_client: self.graphql_client.clone(),
5238 }
5239 }
5240}
5241#[derive(Clone)]
5242pub struct FunctionCall {
5243 pub proc: Option<Arc<DaggerSessionProc>>,
5244 pub selection: Selection,
5245 pub graphql_client: DynGraphQLClient,
5246}
5247impl FunctionCall {
5248 pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
5250 let query = self.selection.select("id");
5251 query.execute(self.graphql_client.clone()).await
5252 }
5253 pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
5255 let query = self.selection.select("inputArgs");
5256 vec![FunctionCallArgValue {
5257 proc: self.proc.clone(),
5258 selection: query,
5259 graphql_client: self.graphql_client.clone(),
5260 }]
5261 }
5262 pub async fn name(&self) -> Result<String, DaggerError> {
5264 let query = self.selection.select("name");
5265 query.execute(self.graphql_client.clone()).await
5266 }
5267 pub async fn parent(&self) -> Result<Json, DaggerError> {
5269 let query = self.selection.select("parent");
5270 query.execute(self.graphql_client.clone()).await
5271 }
5272 pub async fn parent_name(&self) -> Result<String, DaggerError> {
5274 let query = self.selection.select("parentName");
5275 query.execute(self.graphql_client.clone()).await
5276 }
5277 pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
5283 let mut query = self.selection.select("returnError");
5284 query = query.arg_lazy(
5285 "error",
5286 Box::new(move || {
5287 let error = error.clone();
5288 Box::pin(async move { error.into_id().await.unwrap().quote() })
5289 }),
5290 );
5291 query.execute(self.graphql_client.clone()).await
5292 }
5293 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
5299 let mut query = self.selection.select("returnValue");
5300 query = query.arg("value", value);
5301 query.execute(self.graphql_client.clone()).await
5302 }
5303}
5304#[derive(Clone)]
5305pub struct FunctionCallArgValue {
5306 pub proc: Option<Arc<DaggerSessionProc>>,
5307 pub selection: Selection,
5308 pub graphql_client: DynGraphQLClient,
5309}
5310impl FunctionCallArgValue {
5311 pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
5313 let query = self.selection.select("id");
5314 query.execute(self.graphql_client.clone()).await
5315 }
5316 pub async fn name(&self) -> Result<String, DaggerError> {
5318 let query = self.selection.select("name");
5319 query.execute(self.graphql_client.clone()).await
5320 }
5321 pub async fn value(&self) -> Result<Json, DaggerError> {
5323 let query = self.selection.select("value");
5324 query.execute(self.graphql_client.clone()).await
5325 }
5326}
5327#[derive(Clone)]
5328pub struct GeneratedCode {
5329 pub proc: Option<Arc<DaggerSessionProc>>,
5330 pub selection: Selection,
5331 pub graphql_client: DynGraphQLClient,
5332}
5333impl GeneratedCode {
5334 pub fn code(&self) -> Directory {
5336 let query = self.selection.select("code");
5337 Directory {
5338 proc: self.proc.clone(),
5339 selection: query,
5340 graphql_client: self.graphql_client.clone(),
5341 }
5342 }
5343 pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
5345 let query = self.selection.select("id");
5346 query.execute(self.graphql_client.clone()).await
5347 }
5348 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
5350 let query = self.selection.select("vcsGeneratedPaths");
5351 query.execute(self.graphql_client.clone()).await
5352 }
5353 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
5355 let query = self.selection.select("vcsIgnoredPaths");
5356 query.execute(self.graphql_client.clone()).await
5357 }
5358 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
5360 let mut query = self.selection.select("withVCSGeneratedPaths");
5361 query = query.arg(
5362 "paths",
5363 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5364 );
5365 GeneratedCode {
5366 proc: self.proc.clone(),
5367 selection: query,
5368 graphql_client: self.graphql_client.clone(),
5369 }
5370 }
5371 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
5373 let mut query = self.selection.select("withVCSIgnoredPaths");
5374 query = query.arg(
5375 "paths",
5376 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5377 );
5378 GeneratedCode {
5379 proc: self.proc.clone(),
5380 selection: query,
5381 graphql_client: self.graphql_client.clone(),
5382 }
5383 }
5384}
5385#[derive(Clone)]
5386pub struct GitRef {
5387 pub proc: Option<Arc<DaggerSessionProc>>,
5388 pub selection: Selection,
5389 pub graphql_client: DynGraphQLClient,
5390}
5391#[derive(Builder, Debug, PartialEq)]
5392pub struct GitRefTreeOpts {
5393 #[builder(setter(into, strip_option), default)]
5395 pub discard_git_dir: Option<bool>,
5396}
5397impl GitRef {
5398 pub async fn commit(&self) -> Result<String, DaggerError> {
5400 let query = self.selection.select("commit");
5401 query.execute(self.graphql_client.clone()).await
5402 }
5403 pub async fn id(&self) -> Result<GitRefId, DaggerError> {
5405 let query = self.selection.select("id");
5406 query.execute(self.graphql_client.clone()).await
5407 }
5408 pub fn tree(&self) -> Directory {
5414 let query = self.selection.select("tree");
5415 Directory {
5416 proc: self.proc.clone(),
5417 selection: query,
5418 graphql_client: self.graphql_client.clone(),
5419 }
5420 }
5421 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
5427 let mut query = self.selection.select("tree");
5428 if let Some(discard_git_dir) = opts.discard_git_dir {
5429 query = query.arg("discardGitDir", discard_git_dir);
5430 }
5431 Directory {
5432 proc: self.proc.clone(),
5433 selection: query,
5434 graphql_client: self.graphql_client.clone(),
5435 }
5436 }
5437}
5438#[derive(Clone)]
5439pub struct GitRepository {
5440 pub proc: Option<Arc<DaggerSessionProc>>,
5441 pub selection: Selection,
5442 pub graphql_client: DynGraphQLClient,
5443}
5444#[derive(Builder, Debug, PartialEq)]
5445pub struct GitRepositoryTagsOpts<'a> {
5446 #[builder(setter(into, strip_option), default)]
5448 pub patterns: Option<Vec<&'a str>>,
5449}
5450impl GitRepository {
5451 pub fn branch(&self, name: impl Into<String>) -> GitRef {
5457 let mut query = self.selection.select("branch");
5458 query = query.arg("name", name.into());
5459 GitRef {
5460 proc: self.proc.clone(),
5461 selection: query,
5462 graphql_client: self.graphql_client.clone(),
5463 }
5464 }
5465 pub fn commit(&self, id: impl Into<String>) -> GitRef {
5471 let mut query = self.selection.select("commit");
5472 query = query.arg("id", id.into());
5473 GitRef {
5474 proc: self.proc.clone(),
5475 selection: query,
5476 graphql_client: self.graphql_client.clone(),
5477 }
5478 }
5479 pub fn head(&self) -> GitRef {
5481 let query = self.selection.select("head");
5482 GitRef {
5483 proc: self.proc.clone(),
5484 selection: query,
5485 graphql_client: self.graphql_client.clone(),
5486 }
5487 }
5488 pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
5490 let query = self.selection.select("id");
5491 query.execute(self.graphql_client.clone()).await
5492 }
5493 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
5499 let mut query = self.selection.select("ref");
5500 query = query.arg("name", name.into());
5501 GitRef {
5502 proc: self.proc.clone(),
5503 selection: query,
5504 graphql_client: self.graphql_client.clone(),
5505 }
5506 }
5507 pub fn tag(&self, name: impl Into<String>) -> GitRef {
5513 let mut query = self.selection.select("tag");
5514 query = query.arg("name", name.into());
5515 GitRef {
5516 proc: self.proc.clone(),
5517 selection: query,
5518 graphql_client: self.graphql_client.clone(),
5519 }
5520 }
5521 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
5527 let query = self.selection.select("tags");
5528 query.execute(self.graphql_client.clone()).await
5529 }
5530 pub async fn tags_opts<'a>(
5536 &self,
5537 opts: GitRepositoryTagsOpts<'a>,
5538 ) -> Result<Vec<String>, DaggerError> {
5539 let mut query = self.selection.select("tags");
5540 if let Some(patterns) = opts.patterns {
5541 query = query.arg("patterns", patterns);
5542 }
5543 query.execute(self.graphql_client.clone()).await
5544 }
5545 pub fn with_auth_header(&self, header: impl IntoID<SecretId>) -> GitRepository {
5551 let mut query = self.selection.select("withAuthHeader");
5552 query = query.arg_lazy(
5553 "header",
5554 Box::new(move || {
5555 let header = header.clone();
5556 Box::pin(async move { header.into_id().await.unwrap().quote() })
5557 }),
5558 );
5559 GitRepository {
5560 proc: self.proc.clone(),
5561 selection: query,
5562 graphql_client: self.graphql_client.clone(),
5563 }
5564 }
5565 pub fn with_auth_token(&self, token: impl IntoID<SecretId>) -> GitRepository {
5571 let mut query = self.selection.select("withAuthToken");
5572 query = query.arg_lazy(
5573 "token",
5574 Box::new(move || {
5575 let token = token.clone();
5576 Box::pin(async move { token.into_id().await.unwrap().quote() })
5577 }),
5578 );
5579 GitRepository {
5580 proc: self.proc.clone(),
5581 selection: query,
5582 graphql_client: self.graphql_client.clone(),
5583 }
5584 }
5585}
5586#[derive(Clone)]
5587pub struct Host {
5588 pub proc: Option<Arc<DaggerSessionProc>>,
5589 pub selection: Selection,
5590 pub graphql_client: DynGraphQLClient,
5591}
5592#[derive(Builder, Debug, PartialEq)]
5593pub struct HostDirectoryOpts<'a> {
5594 #[builder(setter(into, strip_option), default)]
5596 pub exclude: Option<Vec<&'a str>>,
5597 #[builder(setter(into, strip_option), default)]
5599 pub include: Option<Vec<&'a str>>,
5600}
5601#[derive(Builder, Debug, PartialEq)]
5602pub struct HostServiceOpts<'a> {
5603 #[builder(setter(into, strip_option), default)]
5605 pub host: Option<&'a str>,
5606}
5607#[derive(Builder, Debug, PartialEq)]
5608pub struct HostTunnelOpts {
5609 #[builder(setter(into, strip_option), default)]
5612 pub native: Option<bool>,
5613 #[builder(setter(into, strip_option), default)]
5618 pub ports: Option<Vec<PortForward>>,
5619}
5620impl Host {
5621 pub fn directory(&self, path: impl Into<String>) -> Directory {
5628 let mut query = self.selection.select("directory");
5629 query = query.arg("path", path.into());
5630 Directory {
5631 proc: self.proc.clone(),
5632 selection: query,
5633 graphql_client: self.graphql_client.clone(),
5634 }
5635 }
5636 pub fn directory_opts<'a>(
5643 &self,
5644 path: impl Into<String>,
5645 opts: HostDirectoryOpts<'a>,
5646 ) -> Directory {
5647 let mut query = self.selection.select("directory");
5648 query = query.arg("path", path.into());
5649 if let Some(exclude) = opts.exclude {
5650 query = query.arg("exclude", exclude);
5651 }
5652 if let Some(include) = opts.include {
5653 query = query.arg("include", include);
5654 }
5655 Directory {
5656 proc: self.proc.clone(),
5657 selection: query,
5658 graphql_client: self.graphql_client.clone(),
5659 }
5660 }
5661 pub fn file(&self, path: impl Into<String>) -> File {
5667 let mut query = self.selection.select("file");
5668 query = query.arg("path", path.into());
5669 File {
5670 proc: self.proc.clone(),
5671 selection: query,
5672 graphql_client: self.graphql_client.clone(),
5673 }
5674 }
5675 pub async fn id(&self) -> Result<HostId, DaggerError> {
5677 let query = self.selection.select("id");
5678 query.execute(self.graphql_client.clone()).await
5679 }
5680 pub fn service(&self, ports: Vec<PortForward>) -> Service {
5691 let mut query = self.selection.select("service");
5692 query = query.arg("ports", ports);
5693 Service {
5694 proc: self.proc.clone(),
5695 selection: query,
5696 graphql_client: self.graphql_client.clone(),
5697 }
5698 }
5699 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
5710 let mut query = self.selection.select("service");
5711 query = query.arg("ports", ports);
5712 if let Some(host) = opts.host {
5713 query = query.arg("host", host);
5714 }
5715 Service {
5716 proc: self.proc.clone(),
5717 selection: query,
5718 graphql_client: self.graphql_client.clone(),
5719 }
5720 }
5721 pub fn set_secret_file(&self, name: impl Into<String>, path: impl Into<String>) -> Secret {
5729 let mut query = self.selection.select("setSecretFile");
5730 query = query.arg("name", name.into());
5731 query = query.arg("path", path.into());
5732 Secret {
5733 proc: self.proc.clone(),
5734 selection: query,
5735 graphql_client: self.graphql_client.clone(),
5736 }
5737 }
5738 pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
5745 let mut query = self.selection.select("tunnel");
5746 query = query.arg_lazy(
5747 "service",
5748 Box::new(move || {
5749 let service = service.clone();
5750 Box::pin(async move { service.into_id().await.unwrap().quote() })
5751 }),
5752 );
5753 Service {
5754 proc: self.proc.clone(),
5755 selection: query,
5756 graphql_client: self.graphql_client.clone(),
5757 }
5758 }
5759 pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
5766 let mut query = self.selection.select("tunnel");
5767 query = query.arg_lazy(
5768 "service",
5769 Box::new(move || {
5770 let service = service.clone();
5771 Box::pin(async move { service.into_id().await.unwrap().quote() })
5772 }),
5773 );
5774 if let Some(ports) = opts.ports {
5775 query = query.arg("ports", ports);
5776 }
5777 if let Some(native) = opts.native {
5778 query = query.arg("native", native);
5779 }
5780 Service {
5781 proc: self.proc.clone(),
5782 selection: query,
5783 graphql_client: self.graphql_client.clone(),
5784 }
5785 }
5786 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
5792 let mut query = self.selection.select("unixSocket");
5793 query = query.arg("path", path.into());
5794 Socket {
5795 proc: self.proc.clone(),
5796 selection: query,
5797 graphql_client: self.graphql_client.clone(),
5798 }
5799 }
5800}
5801#[derive(Clone)]
5802pub struct InputTypeDef {
5803 pub proc: Option<Arc<DaggerSessionProc>>,
5804 pub selection: Selection,
5805 pub graphql_client: DynGraphQLClient,
5806}
5807impl InputTypeDef {
5808 pub fn fields(&self) -> Vec<FieldTypeDef> {
5810 let query = self.selection.select("fields");
5811 vec![FieldTypeDef {
5812 proc: self.proc.clone(),
5813 selection: query,
5814 graphql_client: self.graphql_client.clone(),
5815 }]
5816 }
5817 pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
5819 let query = self.selection.select("id");
5820 query.execute(self.graphql_client.clone()).await
5821 }
5822 pub async fn name(&self) -> Result<String, DaggerError> {
5824 let query = self.selection.select("name");
5825 query.execute(self.graphql_client.clone()).await
5826 }
5827}
5828#[derive(Clone)]
5829pub struct InterfaceTypeDef {
5830 pub proc: Option<Arc<DaggerSessionProc>>,
5831 pub selection: Selection,
5832 pub graphql_client: DynGraphQLClient,
5833}
5834impl InterfaceTypeDef {
5835 pub async fn description(&self) -> Result<String, DaggerError> {
5837 let query = self.selection.select("description");
5838 query.execute(self.graphql_client.clone()).await
5839 }
5840 pub fn functions(&self) -> Vec<Function> {
5842 let query = self.selection.select("functions");
5843 vec![Function {
5844 proc: self.proc.clone(),
5845 selection: query,
5846 graphql_client: self.graphql_client.clone(),
5847 }]
5848 }
5849 pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
5851 let query = self.selection.select("id");
5852 query.execute(self.graphql_client.clone()).await
5853 }
5854 pub async fn name(&self) -> Result<String, DaggerError> {
5856 let query = self.selection.select("name");
5857 query.execute(self.graphql_client.clone()).await
5858 }
5859 pub fn source_map(&self) -> SourceMap {
5861 let query = self.selection.select("sourceMap");
5862 SourceMap {
5863 proc: self.proc.clone(),
5864 selection: query,
5865 graphql_client: self.graphql_client.clone(),
5866 }
5867 }
5868 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
5870 let query = self.selection.select("sourceModuleName");
5871 query.execute(self.graphql_client.clone()).await
5872 }
5873}
5874#[derive(Clone)]
5875pub struct Label {
5876 pub proc: Option<Arc<DaggerSessionProc>>,
5877 pub selection: Selection,
5878 pub graphql_client: DynGraphQLClient,
5879}
5880impl Label {
5881 pub async fn id(&self) -> Result<LabelId, DaggerError> {
5883 let query = self.selection.select("id");
5884 query.execute(self.graphql_client.clone()).await
5885 }
5886 pub async fn name(&self) -> Result<String, DaggerError> {
5888 let query = self.selection.select("name");
5889 query.execute(self.graphql_client.clone()).await
5890 }
5891 pub async fn value(&self) -> Result<String, DaggerError> {
5893 let query = self.selection.select("value");
5894 query.execute(self.graphql_client.clone()).await
5895 }
5896}
5897#[derive(Clone)]
5898pub struct ListTypeDef {
5899 pub proc: Option<Arc<DaggerSessionProc>>,
5900 pub selection: Selection,
5901 pub graphql_client: DynGraphQLClient,
5902}
5903impl ListTypeDef {
5904 pub fn element_type_def(&self) -> TypeDef {
5906 let query = self.selection.select("elementTypeDef");
5907 TypeDef {
5908 proc: self.proc.clone(),
5909 selection: query,
5910 graphql_client: self.graphql_client.clone(),
5911 }
5912 }
5913 pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
5915 let query = self.selection.select("id");
5916 query.execute(self.graphql_client.clone()).await
5917 }
5918}
5919#[derive(Clone)]
5920pub struct Module {
5921 pub proc: Option<Arc<DaggerSessionProc>>,
5922 pub selection: Selection,
5923 pub graphql_client: DynGraphQLClient,
5924}
5925impl Module {
5926 pub fn dependencies(&self) -> Vec<Module> {
5928 let query = self.selection.select("dependencies");
5929 vec![Module {
5930 proc: self.proc.clone(),
5931 selection: query,
5932 graphql_client: self.graphql_client.clone(),
5933 }]
5934 }
5935 pub async fn description(&self) -> Result<String, DaggerError> {
5937 let query = self.selection.select("description");
5938 query.execute(self.graphql_client.clone()).await
5939 }
5940 pub fn enums(&self) -> Vec<TypeDef> {
5942 let query = self.selection.select("enums");
5943 vec![TypeDef {
5944 proc: self.proc.clone(),
5945 selection: query,
5946 graphql_client: self.graphql_client.clone(),
5947 }]
5948 }
5949 pub fn generated_context_directory(&self) -> Directory {
5951 let query = self.selection.select("generatedContextDirectory");
5952 Directory {
5953 proc: self.proc.clone(),
5954 selection: query,
5955 graphql_client: self.graphql_client.clone(),
5956 }
5957 }
5958 pub async fn id(&self) -> Result<ModuleId, DaggerError> {
5960 let query = self.selection.select("id");
5961 query.execute(self.graphql_client.clone()).await
5962 }
5963 pub fn interfaces(&self) -> Vec<TypeDef> {
5965 let query = self.selection.select("interfaces");
5966 vec![TypeDef {
5967 proc: self.proc.clone(),
5968 selection: query,
5969 graphql_client: self.graphql_client.clone(),
5970 }]
5971 }
5972 pub async fn name(&self) -> Result<String, DaggerError> {
5974 let query = self.selection.select("name");
5975 query.execute(self.graphql_client.clone()).await
5976 }
5977 pub fn objects(&self) -> Vec<TypeDef> {
5979 let query = self.selection.select("objects");
5980 vec![TypeDef {
5981 proc: self.proc.clone(),
5982 selection: query,
5983 graphql_client: self.graphql_client.clone(),
5984 }]
5985 }
5986 pub fn runtime(&self) -> Container {
5988 let query = self.selection.select("runtime");
5989 Container {
5990 proc: self.proc.clone(),
5991 selection: query,
5992 graphql_client: self.graphql_client.clone(),
5993 }
5994 }
5995 pub fn sdk(&self) -> SdkConfig {
5997 let query = self.selection.select("sdk");
5998 SdkConfig {
5999 proc: self.proc.clone(),
6000 selection: query,
6001 graphql_client: self.graphql_client.clone(),
6002 }
6003 }
6004 pub async fn serve(&self) -> Result<Void, DaggerError> {
6007 let query = self.selection.select("serve");
6008 query.execute(self.graphql_client.clone()).await
6009 }
6010 pub fn source(&self) -> ModuleSource {
6012 let query = self.selection.select("source");
6013 ModuleSource {
6014 proc: self.proc.clone(),
6015 selection: query,
6016 graphql_client: self.graphql_client.clone(),
6017 }
6018 }
6019 pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
6021 let query = self.selection.select("sync");
6022 query.execute(self.graphql_client.clone()).await
6023 }
6024 pub fn with_description(&self, description: impl Into<String>) -> Module {
6030 let mut query = self.selection.select("withDescription");
6031 query = query.arg("description", description.into());
6032 Module {
6033 proc: self.proc.clone(),
6034 selection: query,
6035 graphql_client: self.graphql_client.clone(),
6036 }
6037 }
6038 pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
6040 let mut query = self.selection.select("withEnum");
6041 query = query.arg_lazy(
6042 "enum",
6043 Box::new(move || {
6044 let r#enum = r#enum.clone();
6045 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
6046 }),
6047 );
6048 Module {
6049 proc: self.proc.clone(),
6050 selection: query,
6051 graphql_client: self.graphql_client.clone(),
6052 }
6053 }
6054 pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
6056 let mut query = self.selection.select("withInterface");
6057 query = query.arg_lazy(
6058 "iface",
6059 Box::new(move || {
6060 let iface = iface.clone();
6061 Box::pin(async move { iface.into_id().await.unwrap().quote() })
6062 }),
6063 );
6064 Module {
6065 proc: self.proc.clone(),
6066 selection: query,
6067 graphql_client: self.graphql_client.clone(),
6068 }
6069 }
6070 pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
6072 let mut query = self.selection.select("withObject");
6073 query = query.arg_lazy(
6074 "object",
6075 Box::new(move || {
6076 let object = object.clone();
6077 Box::pin(async move { object.into_id().await.unwrap().quote() })
6078 }),
6079 );
6080 Module {
6081 proc: self.proc.clone(),
6082 selection: query,
6083 graphql_client: self.graphql_client.clone(),
6084 }
6085 }
6086}
6087#[derive(Clone)]
6088pub struct ModuleSource {
6089 pub proc: Option<Arc<DaggerSessionProc>>,
6090 pub selection: Selection,
6091 pub graphql_client: DynGraphQLClient,
6092}
6093impl ModuleSource {
6094 pub fn as_module(&self) -> Module {
6096 let query = self.selection.select("asModule");
6097 Module {
6098 proc: self.proc.clone(),
6099 selection: query,
6100 graphql_client: self.graphql_client.clone(),
6101 }
6102 }
6103 pub async fn as_string(&self) -> Result<String, DaggerError> {
6105 let query = self.selection.select("asString");
6106 query.execute(self.graphql_client.clone()).await
6107 }
6108 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
6110 let query = self.selection.select("cloneRef");
6111 query.execute(self.graphql_client.clone()).await
6112 }
6113 pub async fn commit(&self) -> Result<String, DaggerError> {
6115 let query = self.selection.select("commit");
6116 query.execute(self.graphql_client.clone()).await
6117 }
6118 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
6120 let query = self.selection.select("configExists");
6121 query.execute(self.graphql_client.clone()).await
6122 }
6123 pub fn context_directory(&self) -> Directory {
6125 let query = self.selection.select("contextDirectory");
6126 Directory {
6127 proc: self.proc.clone(),
6128 selection: query,
6129 graphql_client: self.graphql_client.clone(),
6130 }
6131 }
6132 pub fn dependencies(&self) -> Vec<ModuleSource> {
6134 let query = self.selection.select("dependencies");
6135 vec![ModuleSource {
6136 proc: self.proc.clone(),
6137 selection: query,
6138 graphql_client: self.graphql_client.clone(),
6139 }]
6140 }
6141 pub async fn digest(&self) -> Result<String, DaggerError> {
6143 let query = self.selection.select("digest");
6144 query.execute(self.graphql_client.clone()).await
6145 }
6146 pub fn directory(&self, path: impl Into<String>) -> Directory {
6152 let mut query = self.selection.select("directory");
6153 query = query.arg("path", path.into());
6154 Directory {
6155 proc: self.proc.clone(),
6156 selection: query,
6157 graphql_client: self.graphql_client.clone(),
6158 }
6159 }
6160 pub async fn engine_version(&self) -> Result<String, DaggerError> {
6162 let query = self.selection.select("engineVersion");
6163 query.execute(self.graphql_client.clone()).await
6164 }
6165 pub fn generated_context_directory(&self) -> Directory {
6167 let query = self.selection.select("generatedContextDirectory");
6168 Directory {
6169 proc: self.proc.clone(),
6170 selection: query,
6171 graphql_client: self.graphql_client.clone(),
6172 }
6173 }
6174 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
6176 let query = self.selection.select("htmlRepoURL");
6177 query.execute(self.graphql_client.clone()).await
6178 }
6179 pub async fn html_url(&self) -> Result<String, DaggerError> {
6181 let query = self.selection.select("htmlURL");
6182 query.execute(self.graphql_client.clone()).await
6183 }
6184 pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
6186 let query = self.selection.select("id");
6187 query.execute(self.graphql_client.clone()).await
6188 }
6189 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
6191 let query = self.selection.select("kind");
6192 query.execute(self.graphql_client.clone()).await
6193 }
6194 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
6196 let query = self.selection.select("localContextDirectoryPath");
6197 query.execute(self.graphql_client.clone()).await
6198 }
6199 pub async fn module_name(&self) -> Result<String, DaggerError> {
6201 let query = self.selection.select("moduleName");
6202 query.execute(self.graphql_client.clone()).await
6203 }
6204 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
6206 let query = self.selection.select("moduleOriginalName");
6207 query.execute(self.graphql_client.clone()).await
6208 }
6209 pub async fn pin(&self) -> Result<String, DaggerError> {
6211 let query = self.selection.select("pin");
6212 query.execute(self.graphql_client.clone()).await
6213 }
6214 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
6216 let query = self.selection.select("repoRootPath");
6217 query.execute(self.graphql_client.clone()).await
6218 }
6219 pub fn sdk(&self) -> SdkConfig {
6221 let query = self.selection.select("sdk");
6222 SdkConfig {
6223 proc: self.proc.clone(),
6224 selection: query,
6225 graphql_client: self.graphql_client.clone(),
6226 }
6227 }
6228 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
6230 let query = self.selection.select("sourceRootSubpath");
6231 query.execute(self.graphql_client.clone()).await
6232 }
6233 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
6235 let query = self.selection.select("sourceSubpath");
6236 query.execute(self.graphql_client.clone()).await
6237 }
6238 pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
6240 let query = self.selection.select("sync");
6241 query.execute(self.graphql_client.clone()).await
6242 }
6243 pub async fn version(&self) -> Result<String, DaggerError> {
6245 let query = self.selection.select("version");
6246 query.execute(self.graphql_client.clone()).await
6247 }
6248 pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
6254 let mut query = self.selection.select("withDependencies");
6255 query = query.arg("dependencies", dependencies);
6256 ModuleSource {
6257 proc: self.proc.clone(),
6258 selection: query,
6259 graphql_client: self.graphql_client.clone(),
6260 }
6261 }
6262 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
6268 let mut query = self.selection.select("withEngineVersion");
6269 query = query.arg("version", version.into());
6270 ModuleSource {
6271 proc: self.proc.clone(),
6272 selection: query,
6273 graphql_client: self.graphql_client.clone(),
6274 }
6275 }
6276 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
6282 let mut query = self.selection.select("withIncludes");
6283 query = query.arg(
6284 "patterns",
6285 patterns
6286 .into_iter()
6287 .map(|i| i.into())
6288 .collect::<Vec<String>>(),
6289 );
6290 ModuleSource {
6291 proc: self.proc.clone(),
6292 selection: query,
6293 graphql_client: self.graphql_client.clone(),
6294 }
6295 }
6296 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
6302 let mut query = self.selection.select("withName");
6303 query = query.arg("name", name.into());
6304 ModuleSource {
6305 proc: self.proc.clone(),
6306 selection: query,
6307 graphql_client: self.graphql_client.clone(),
6308 }
6309 }
6310 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
6316 let mut query = self.selection.select("withSDK");
6317 query = query.arg("source", source.into());
6318 ModuleSource {
6319 proc: self.proc.clone(),
6320 selection: query,
6321 graphql_client: self.graphql_client.clone(),
6322 }
6323 }
6324 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
6330 let mut query = self.selection.select("withSourceSubpath");
6331 query = query.arg("path", path.into());
6332 ModuleSource {
6333 proc: self.proc.clone(),
6334 selection: query,
6335 graphql_client: self.graphql_client.clone(),
6336 }
6337 }
6338 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
6344 let mut query = self.selection.select("withUpdateDependencies");
6345 query = query.arg(
6346 "dependencies",
6347 dependencies
6348 .into_iter()
6349 .map(|i| i.into())
6350 .collect::<Vec<String>>(),
6351 );
6352 ModuleSource {
6353 proc: self.proc.clone(),
6354 selection: query,
6355 graphql_client: self.graphql_client.clone(),
6356 }
6357 }
6358 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
6364 let mut query = self.selection.select("withoutDependencies");
6365 query = query.arg(
6366 "dependencies",
6367 dependencies
6368 .into_iter()
6369 .map(|i| i.into())
6370 .collect::<Vec<String>>(),
6371 );
6372 ModuleSource {
6373 proc: self.proc.clone(),
6374 selection: query,
6375 graphql_client: self.graphql_client.clone(),
6376 }
6377 }
6378}
6379#[derive(Clone)]
6380pub struct ObjectTypeDef {
6381 pub proc: Option<Arc<DaggerSessionProc>>,
6382 pub selection: Selection,
6383 pub graphql_client: DynGraphQLClient,
6384}
6385impl ObjectTypeDef {
6386 pub fn constructor(&self) -> Function {
6388 let query = self.selection.select("constructor");
6389 Function {
6390 proc: self.proc.clone(),
6391 selection: query,
6392 graphql_client: self.graphql_client.clone(),
6393 }
6394 }
6395 pub async fn description(&self) -> Result<String, DaggerError> {
6397 let query = self.selection.select("description");
6398 query.execute(self.graphql_client.clone()).await
6399 }
6400 pub fn fields(&self) -> Vec<FieldTypeDef> {
6402 let query = self.selection.select("fields");
6403 vec![FieldTypeDef {
6404 proc: self.proc.clone(),
6405 selection: query,
6406 graphql_client: self.graphql_client.clone(),
6407 }]
6408 }
6409 pub fn functions(&self) -> Vec<Function> {
6411 let query = self.selection.select("functions");
6412 vec![Function {
6413 proc: self.proc.clone(),
6414 selection: query,
6415 graphql_client: self.graphql_client.clone(),
6416 }]
6417 }
6418 pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
6420 let query = self.selection.select("id");
6421 query.execute(self.graphql_client.clone()).await
6422 }
6423 pub async fn name(&self) -> Result<String, DaggerError> {
6425 let query = self.selection.select("name");
6426 query.execute(self.graphql_client.clone()).await
6427 }
6428 pub fn source_map(&self) -> SourceMap {
6430 let query = self.selection.select("sourceMap");
6431 SourceMap {
6432 proc: self.proc.clone(),
6433 selection: query,
6434 graphql_client: self.graphql_client.clone(),
6435 }
6436 }
6437 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6439 let query = self.selection.select("sourceModuleName");
6440 query.execute(self.graphql_client.clone()).await
6441 }
6442}
6443#[derive(Clone)]
6444pub struct Port {
6445 pub proc: Option<Arc<DaggerSessionProc>>,
6446 pub selection: Selection,
6447 pub graphql_client: DynGraphQLClient,
6448}
6449impl Port {
6450 pub async fn description(&self) -> Result<String, DaggerError> {
6452 let query = self.selection.select("description");
6453 query.execute(self.graphql_client.clone()).await
6454 }
6455 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
6457 let query = self.selection.select("experimentalSkipHealthcheck");
6458 query.execute(self.graphql_client.clone()).await
6459 }
6460 pub async fn id(&self) -> Result<PortId, DaggerError> {
6462 let query = self.selection.select("id");
6463 query.execute(self.graphql_client.clone()).await
6464 }
6465 pub async fn port(&self) -> Result<isize, DaggerError> {
6467 let query = self.selection.select("port");
6468 query.execute(self.graphql_client.clone()).await
6469 }
6470 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
6472 let query = self.selection.select("protocol");
6473 query.execute(self.graphql_client.clone()).await
6474 }
6475}
6476#[derive(Clone)]
6477pub struct Query {
6478 pub proc: Option<Arc<DaggerSessionProc>>,
6479 pub selection: Selection,
6480 pub graphql_client: DynGraphQLClient,
6481}
6482#[derive(Builder, Debug, PartialEq)]
6483pub struct QueryCacheVolumeOpts<'a> {
6484 #[builder(setter(into, strip_option), default)]
6485 pub namespace: Option<&'a str>,
6486}
6487#[derive(Builder, Debug, PartialEq)]
6488pub struct QueryContainerOpts {
6489 #[builder(setter(into, strip_option), default)]
6491 pub platform: Option<Platform>,
6492}
6493#[derive(Builder, Debug, PartialEq)]
6494pub struct QueryGitOpts<'a> {
6495 #[builder(setter(into, strip_option), default)]
6497 pub experimental_service_host: Option<ServiceId>,
6498 #[builder(setter(into, strip_option), default)]
6500 pub keep_git_dir: Option<bool>,
6501 #[builder(setter(into, strip_option), default)]
6503 pub ssh_auth_socket: Option<SocketId>,
6504 #[builder(setter(into, strip_option), default)]
6506 pub ssh_known_hosts: Option<&'a str>,
6507}
6508#[derive(Builder, Debug, PartialEq)]
6509pub struct QueryHttpOpts {
6510 #[builder(setter(into, strip_option), default)]
6512 pub experimental_service_host: Option<ServiceId>,
6513}
6514#[derive(Builder, Debug, PartialEq)]
6515pub struct QueryLoadSecretFromNameOpts<'a> {
6516 #[builder(setter(into, strip_option), default)]
6517 pub accessor: Option<&'a str>,
6518}
6519#[derive(Builder, Debug, PartialEq)]
6520pub struct QueryModuleSourceOpts<'a> {
6521 #[builder(setter(into, strip_option), default)]
6523 pub allow_not_exists: Option<bool>,
6524 #[builder(setter(into, strip_option), default)]
6526 pub disable_find_up: Option<bool>,
6527 #[builder(setter(into, strip_option), default)]
6529 pub ref_pin: Option<&'a str>,
6530 #[builder(setter(into, strip_option), default)]
6532 pub require_kind: Option<ModuleSourceKind>,
6533}
6534impl Query {
6535 pub fn builtin_container(&self, digest: impl Into<String>) -> Container {
6541 let mut query = self.selection.select("builtinContainer");
6542 query = query.arg("digest", digest.into());
6543 Container {
6544 proc: self.proc.clone(),
6545 selection: query,
6546 graphql_client: self.graphql_client.clone(),
6547 }
6548 }
6549 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
6556 let mut query = self.selection.select("cacheVolume");
6557 query = query.arg("key", key.into());
6558 CacheVolume {
6559 proc: self.proc.clone(),
6560 selection: query,
6561 graphql_client: self.graphql_client.clone(),
6562 }
6563 }
6564 pub fn cache_volume_opts<'a>(
6571 &self,
6572 key: impl Into<String>,
6573 opts: QueryCacheVolumeOpts<'a>,
6574 ) -> CacheVolume {
6575 let mut query = self.selection.select("cacheVolume");
6576 query = query.arg("key", key.into());
6577 if let Some(namespace) = opts.namespace {
6578 query = query.arg("namespace", namespace);
6579 }
6580 CacheVolume {
6581 proc: self.proc.clone(),
6582 selection: query,
6583 graphql_client: self.graphql_client.clone(),
6584 }
6585 }
6586 pub fn container(&self) -> Container {
6593 let query = self.selection.select("container");
6594 Container {
6595 proc: self.proc.clone(),
6596 selection: query,
6597 graphql_client: self.graphql_client.clone(),
6598 }
6599 }
6600 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
6607 let mut query = self.selection.select("container");
6608 if let Some(platform) = opts.platform {
6609 query = query.arg("platform", platform);
6610 }
6611 Container {
6612 proc: self.proc.clone(),
6613 selection: query,
6614 graphql_client: self.graphql_client.clone(),
6615 }
6616 }
6617 pub fn current_function_call(&self) -> FunctionCall {
6620 let query = self.selection.select("currentFunctionCall");
6621 FunctionCall {
6622 proc: self.proc.clone(),
6623 selection: query,
6624 graphql_client: self.graphql_client.clone(),
6625 }
6626 }
6627 pub fn current_module(&self) -> CurrentModule {
6629 let query = self.selection.select("currentModule");
6630 CurrentModule {
6631 proc: self.proc.clone(),
6632 selection: query,
6633 graphql_client: self.graphql_client.clone(),
6634 }
6635 }
6636 pub fn current_type_defs(&self) -> Vec<TypeDef> {
6638 let query = self.selection.select("currentTypeDefs");
6639 vec![TypeDef {
6640 proc: self.proc.clone(),
6641 selection: query,
6642 graphql_client: self.graphql_client.clone(),
6643 }]
6644 }
6645 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
6647 let query = self.selection.select("defaultPlatform");
6648 query.execute(self.graphql_client.clone()).await
6649 }
6650 pub fn directory(&self) -> Directory {
6652 let query = self.selection.select("directory");
6653 Directory {
6654 proc: self.proc.clone(),
6655 selection: query,
6656 graphql_client: self.graphql_client.clone(),
6657 }
6658 }
6659 pub fn engine(&self) -> Engine {
6661 let query = self.selection.select("engine");
6662 Engine {
6663 proc: self.proc.clone(),
6664 selection: query,
6665 graphql_client: self.graphql_client.clone(),
6666 }
6667 }
6668 pub fn error(&self, message: impl Into<String>) -> Error {
6674 let mut query = self.selection.select("error");
6675 query = query.arg("message", message.into());
6676 Error {
6677 proc: self.proc.clone(),
6678 selection: query,
6679 graphql_client: self.graphql_client.clone(),
6680 }
6681 }
6682 pub fn function(
6689 &self,
6690 name: impl Into<String>,
6691 return_type: impl IntoID<TypeDefId>,
6692 ) -> Function {
6693 let mut query = self.selection.select("function");
6694 query = query.arg("name", name.into());
6695 query = query.arg_lazy(
6696 "returnType",
6697 Box::new(move || {
6698 let return_type = return_type.clone();
6699 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
6700 }),
6701 );
6702 Function {
6703 proc: self.proc.clone(),
6704 selection: query,
6705 graphql_client: self.graphql_client.clone(),
6706 }
6707 }
6708 pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
6710 let mut query = self.selection.select("generatedCode");
6711 query = query.arg_lazy(
6712 "code",
6713 Box::new(move || {
6714 let code = code.clone();
6715 Box::pin(async move { code.into_id().await.unwrap().quote() })
6716 }),
6717 );
6718 GeneratedCode {
6719 proc: self.proc.clone(),
6720 selection: query,
6721 graphql_client: self.graphql_client.clone(),
6722 }
6723 }
6724 pub fn git(&self, url: impl Into<String>) -> GitRepository {
6735 let mut query = self.selection.select("git");
6736 query = query.arg("url", url.into());
6737 GitRepository {
6738 proc: self.proc.clone(),
6739 selection: query,
6740 graphql_client: self.graphql_client.clone(),
6741 }
6742 }
6743 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
6754 let mut query = self.selection.select("git");
6755 query = query.arg("url", url.into());
6756 if let Some(keep_git_dir) = opts.keep_git_dir {
6757 query = query.arg("keepGitDir", keep_git_dir);
6758 }
6759 if let Some(experimental_service_host) = opts.experimental_service_host {
6760 query = query.arg("experimentalServiceHost", experimental_service_host);
6761 }
6762 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
6763 query = query.arg("sshKnownHosts", ssh_known_hosts);
6764 }
6765 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
6766 query = query.arg("sshAuthSocket", ssh_auth_socket);
6767 }
6768 GitRepository {
6769 proc: self.proc.clone(),
6770 selection: query,
6771 graphql_client: self.graphql_client.clone(),
6772 }
6773 }
6774 pub fn host(&self) -> Host {
6776 let query = self.selection.select("host");
6777 Host {
6778 proc: self.proc.clone(),
6779 selection: query,
6780 graphql_client: self.graphql_client.clone(),
6781 }
6782 }
6783 pub fn http(&self, url: impl Into<String>) -> File {
6790 let mut query = self.selection.select("http");
6791 query = query.arg("url", url.into());
6792 File {
6793 proc: self.proc.clone(),
6794 selection: query,
6795 graphql_client: self.graphql_client.clone(),
6796 }
6797 }
6798 pub fn http_opts(&self, url: impl Into<String>, opts: QueryHttpOpts) -> File {
6805 let mut query = self.selection.select("http");
6806 query = query.arg("url", url.into());
6807 if let Some(experimental_service_host) = opts.experimental_service_host {
6808 query = query.arg("experimentalServiceHost", experimental_service_host);
6809 }
6810 File {
6811 proc: self.proc.clone(),
6812 selection: query,
6813 graphql_client: self.graphql_client.clone(),
6814 }
6815 }
6816 pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
6818 let mut query = self.selection.select("loadCacheVolumeFromID");
6819 query = query.arg_lazy(
6820 "id",
6821 Box::new(move || {
6822 let id = id.clone();
6823 Box::pin(async move { id.into_id().await.unwrap().quote() })
6824 }),
6825 );
6826 CacheVolume {
6827 proc: self.proc.clone(),
6828 selection: query,
6829 graphql_client: self.graphql_client.clone(),
6830 }
6831 }
6832 pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
6834 let mut query = self.selection.select("loadContainerFromID");
6835 query = query.arg_lazy(
6836 "id",
6837 Box::new(move || {
6838 let id = id.clone();
6839 Box::pin(async move { id.into_id().await.unwrap().quote() })
6840 }),
6841 );
6842 Container {
6843 proc: self.proc.clone(),
6844 selection: query,
6845 graphql_client: self.graphql_client.clone(),
6846 }
6847 }
6848 pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
6850 let mut query = self.selection.select("loadCurrentModuleFromID");
6851 query = query.arg_lazy(
6852 "id",
6853 Box::new(move || {
6854 let id = id.clone();
6855 Box::pin(async move { id.into_id().await.unwrap().quote() })
6856 }),
6857 );
6858 CurrentModule {
6859 proc: self.proc.clone(),
6860 selection: query,
6861 graphql_client: self.graphql_client.clone(),
6862 }
6863 }
6864 pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
6866 let mut query = self.selection.select("loadDirectoryFromID");
6867 query = query.arg_lazy(
6868 "id",
6869 Box::new(move || {
6870 let id = id.clone();
6871 Box::pin(async move { id.into_id().await.unwrap().quote() })
6872 }),
6873 );
6874 Directory {
6875 proc: self.proc.clone(),
6876 selection: query,
6877 graphql_client: self.graphql_client.clone(),
6878 }
6879 }
6880 pub fn load_engine_cache_entry_from_id(
6882 &self,
6883 id: impl IntoID<EngineCacheEntryId>,
6884 ) -> EngineCacheEntry {
6885 let mut query = self.selection.select("loadEngineCacheEntryFromID");
6886 query = query.arg_lazy(
6887 "id",
6888 Box::new(move || {
6889 let id = id.clone();
6890 Box::pin(async move { id.into_id().await.unwrap().quote() })
6891 }),
6892 );
6893 EngineCacheEntry {
6894 proc: self.proc.clone(),
6895 selection: query,
6896 graphql_client: self.graphql_client.clone(),
6897 }
6898 }
6899 pub fn load_engine_cache_entry_set_from_id(
6901 &self,
6902 id: impl IntoID<EngineCacheEntrySetId>,
6903 ) -> EngineCacheEntrySet {
6904 let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
6905 query = query.arg_lazy(
6906 "id",
6907 Box::new(move || {
6908 let id = id.clone();
6909 Box::pin(async move { id.into_id().await.unwrap().quote() })
6910 }),
6911 );
6912 EngineCacheEntrySet {
6913 proc: self.proc.clone(),
6914 selection: query,
6915 graphql_client: self.graphql_client.clone(),
6916 }
6917 }
6918 pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
6920 let mut query = self.selection.select("loadEngineCacheFromID");
6921 query = query.arg_lazy(
6922 "id",
6923 Box::new(move || {
6924 let id = id.clone();
6925 Box::pin(async move { id.into_id().await.unwrap().quote() })
6926 }),
6927 );
6928 EngineCache {
6929 proc: self.proc.clone(),
6930 selection: query,
6931 graphql_client: self.graphql_client.clone(),
6932 }
6933 }
6934 pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
6936 let mut query = self.selection.select("loadEngineFromID");
6937 query = query.arg_lazy(
6938 "id",
6939 Box::new(move || {
6940 let id = id.clone();
6941 Box::pin(async move { id.into_id().await.unwrap().quote() })
6942 }),
6943 );
6944 Engine {
6945 proc: self.proc.clone(),
6946 selection: query,
6947 graphql_client: self.graphql_client.clone(),
6948 }
6949 }
6950 pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
6952 let mut query = self.selection.select("loadEnumTypeDefFromID");
6953 query = query.arg_lazy(
6954 "id",
6955 Box::new(move || {
6956 let id = id.clone();
6957 Box::pin(async move { id.into_id().await.unwrap().quote() })
6958 }),
6959 );
6960 EnumTypeDef {
6961 proc: self.proc.clone(),
6962 selection: query,
6963 graphql_client: self.graphql_client.clone(),
6964 }
6965 }
6966 pub fn load_enum_value_type_def_from_id(
6968 &self,
6969 id: impl IntoID<EnumValueTypeDefId>,
6970 ) -> EnumValueTypeDef {
6971 let mut query = self.selection.select("loadEnumValueTypeDefFromID");
6972 query = query.arg_lazy(
6973 "id",
6974 Box::new(move || {
6975 let id = id.clone();
6976 Box::pin(async move { id.into_id().await.unwrap().quote() })
6977 }),
6978 );
6979 EnumValueTypeDef {
6980 proc: self.proc.clone(),
6981 selection: query,
6982 graphql_client: self.graphql_client.clone(),
6983 }
6984 }
6985 pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
6987 let mut query = self.selection.select("loadEnvVariableFromID");
6988 query = query.arg_lazy(
6989 "id",
6990 Box::new(move || {
6991 let id = id.clone();
6992 Box::pin(async move { id.into_id().await.unwrap().quote() })
6993 }),
6994 );
6995 EnvVariable {
6996 proc: self.proc.clone(),
6997 selection: query,
6998 graphql_client: self.graphql_client.clone(),
6999 }
7000 }
7001 pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
7003 let mut query = self.selection.select("loadErrorFromID");
7004 query = query.arg_lazy(
7005 "id",
7006 Box::new(move || {
7007 let id = id.clone();
7008 Box::pin(async move { id.into_id().await.unwrap().quote() })
7009 }),
7010 );
7011 Error {
7012 proc: self.proc.clone(),
7013 selection: query,
7014 graphql_client: self.graphql_client.clone(),
7015 }
7016 }
7017 pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
7019 let mut query = self.selection.select("loadFieldTypeDefFromID");
7020 query = query.arg_lazy(
7021 "id",
7022 Box::new(move || {
7023 let id = id.clone();
7024 Box::pin(async move { id.into_id().await.unwrap().quote() })
7025 }),
7026 );
7027 FieldTypeDef {
7028 proc: self.proc.clone(),
7029 selection: query,
7030 graphql_client: self.graphql_client.clone(),
7031 }
7032 }
7033 pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
7035 let mut query = self.selection.select("loadFileFromID");
7036 query = query.arg_lazy(
7037 "id",
7038 Box::new(move || {
7039 let id = id.clone();
7040 Box::pin(async move { id.into_id().await.unwrap().quote() })
7041 }),
7042 );
7043 File {
7044 proc: self.proc.clone(),
7045 selection: query,
7046 graphql_client: self.graphql_client.clone(),
7047 }
7048 }
7049 pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
7051 let mut query = self.selection.select("loadFunctionArgFromID");
7052 query = query.arg_lazy(
7053 "id",
7054 Box::new(move || {
7055 let id = id.clone();
7056 Box::pin(async move { id.into_id().await.unwrap().quote() })
7057 }),
7058 );
7059 FunctionArg {
7060 proc: self.proc.clone(),
7061 selection: query,
7062 graphql_client: self.graphql_client.clone(),
7063 }
7064 }
7065 pub fn load_function_call_arg_value_from_id(
7067 &self,
7068 id: impl IntoID<FunctionCallArgValueId>,
7069 ) -> FunctionCallArgValue {
7070 let mut query = self.selection.select("loadFunctionCallArgValueFromID");
7071 query = query.arg_lazy(
7072 "id",
7073 Box::new(move || {
7074 let id = id.clone();
7075 Box::pin(async move { id.into_id().await.unwrap().quote() })
7076 }),
7077 );
7078 FunctionCallArgValue {
7079 proc: self.proc.clone(),
7080 selection: query,
7081 graphql_client: self.graphql_client.clone(),
7082 }
7083 }
7084 pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
7086 let mut query = self.selection.select("loadFunctionCallFromID");
7087 query = query.arg_lazy(
7088 "id",
7089 Box::new(move || {
7090 let id = id.clone();
7091 Box::pin(async move { id.into_id().await.unwrap().quote() })
7092 }),
7093 );
7094 FunctionCall {
7095 proc: self.proc.clone(),
7096 selection: query,
7097 graphql_client: self.graphql_client.clone(),
7098 }
7099 }
7100 pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
7102 let mut query = self.selection.select("loadFunctionFromID");
7103 query = query.arg_lazy(
7104 "id",
7105 Box::new(move || {
7106 let id = id.clone();
7107 Box::pin(async move { id.into_id().await.unwrap().quote() })
7108 }),
7109 );
7110 Function {
7111 proc: self.proc.clone(),
7112 selection: query,
7113 graphql_client: self.graphql_client.clone(),
7114 }
7115 }
7116 pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
7118 let mut query = self.selection.select("loadGeneratedCodeFromID");
7119 query = query.arg_lazy(
7120 "id",
7121 Box::new(move || {
7122 let id = id.clone();
7123 Box::pin(async move { id.into_id().await.unwrap().quote() })
7124 }),
7125 );
7126 GeneratedCode {
7127 proc: self.proc.clone(),
7128 selection: query,
7129 graphql_client: self.graphql_client.clone(),
7130 }
7131 }
7132 pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
7134 let mut query = self.selection.select("loadGitRefFromID");
7135 query = query.arg_lazy(
7136 "id",
7137 Box::new(move || {
7138 let id = id.clone();
7139 Box::pin(async move { id.into_id().await.unwrap().quote() })
7140 }),
7141 );
7142 GitRef {
7143 proc: self.proc.clone(),
7144 selection: query,
7145 graphql_client: self.graphql_client.clone(),
7146 }
7147 }
7148 pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
7150 let mut query = self.selection.select("loadGitRepositoryFromID");
7151 query = query.arg_lazy(
7152 "id",
7153 Box::new(move || {
7154 let id = id.clone();
7155 Box::pin(async move { id.into_id().await.unwrap().quote() })
7156 }),
7157 );
7158 GitRepository {
7159 proc: self.proc.clone(),
7160 selection: query,
7161 graphql_client: self.graphql_client.clone(),
7162 }
7163 }
7164 pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
7166 let mut query = self.selection.select("loadHostFromID");
7167 query = query.arg_lazy(
7168 "id",
7169 Box::new(move || {
7170 let id = id.clone();
7171 Box::pin(async move { id.into_id().await.unwrap().quote() })
7172 }),
7173 );
7174 Host {
7175 proc: self.proc.clone(),
7176 selection: query,
7177 graphql_client: self.graphql_client.clone(),
7178 }
7179 }
7180 pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
7182 let mut query = self.selection.select("loadInputTypeDefFromID");
7183 query = query.arg_lazy(
7184 "id",
7185 Box::new(move || {
7186 let id = id.clone();
7187 Box::pin(async move { id.into_id().await.unwrap().quote() })
7188 }),
7189 );
7190 InputTypeDef {
7191 proc: self.proc.clone(),
7192 selection: query,
7193 graphql_client: self.graphql_client.clone(),
7194 }
7195 }
7196 pub fn load_interface_type_def_from_id(
7198 &self,
7199 id: impl IntoID<InterfaceTypeDefId>,
7200 ) -> InterfaceTypeDef {
7201 let mut query = self.selection.select("loadInterfaceTypeDefFromID");
7202 query = query.arg_lazy(
7203 "id",
7204 Box::new(move || {
7205 let id = id.clone();
7206 Box::pin(async move { id.into_id().await.unwrap().quote() })
7207 }),
7208 );
7209 InterfaceTypeDef {
7210 proc: self.proc.clone(),
7211 selection: query,
7212 graphql_client: self.graphql_client.clone(),
7213 }
7214 }
7215 pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
7217 let mut query = self.selection.select("loadLabelFromID");
7218 query = query.arg_lazy(
7219 "id",
7220 Box::new(move || {
7221 let id = id.clone();
7222 Box::pin(async move { id.into_id().await.unwrap().quote() })
7223 }),
7224 );
7225 Label {
7226 proc: self.proc.clone(),
7227 selection: query,
7228 graphql_client: self.graphql_client.clone(),
7229 }
7230 }
7231 pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
7233 let mut query = self.selection.select("loadListTypeDefFromID");
7234 query = query.arg_lazy(
7235 "id",
7236 Box::new(move || {
7237 let id = id.clone();
7238 Box::pin(async move { id.into_id().await.unwrap().quote() })
7239 }),
7240 );
7241 ListTypeDef {
7242 proc: self.proc.clone(),
7243 selection: query,
7244 graphql_client: self.graphql_client.clone(),
7245 }
7246 }
7247 pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
7249 let mut query = self.selection.select("loadModuleFromID");
7250 query = query.arg_lazy(
7251 "id",
7252 Box::new(move || {
7253 let id = id.clone();
7254 Box::pin(async move { id.into_id().await.unwrap().quote() })
7255 }),
7256 );
7257 Module {
7258 proc: self.proc.clone(),
7259 selection: query,
7260 graphql_client: self.graphql_client.clone(),
7261 }
7262 }
7263 pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
7265 let mut query = self.selection.select("loadModuleSourceFromID");
7266 query = query.arg_lazy(
7267 "id",
7268 Box::new(move || {
7269 let id = id.clone();
7270 Box::pin(async move { id.into_id().await.unwrap().quote() })
7271 }),
7272 );
7273 ModuleSource {
7274 proc: self.proc.clone(),
7275 selection: query,
7276 graphql_client: self.graphql_client.clone(),
7277 }
7278 }
7279 pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
7281 let mut query = self.selection.select("loadObjectTypeDefFromID");
7282 query = query.arg_lazy(
7283 "id",
7284 Box::new(move || {
7285 let id = id.clone();
7286 Box::pin(async move { id.into_id().await.unwrap().quote() })
7287 }),
7288 );
7289 ObjectTypeDef {
7290 proc: self.proc.clone(),
7291 selection: query,
7292 graphql_client: self.graphql_client.clone(),
7293 }
7294 }
7295 pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
7297 let mut query = self.selection.select("loadPortFromID");
7298 query = query.arg_lazy(
7299 "id",
7300 Box::new(move || {
7301 let id = id.clone();
7302 Box::pin(async move { id.into_id().await.unwrap().quote() })
7303 }),
7304 );
7305 Port {
7306 proc: self.proc.clone(),
7307 selection: query,
7308 graphql_client: self.graphql_client.clone(),
7309 }
7310 }
7311 pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
7313 let mut query = self.selection.select("loadSDKConfigFromID");
7314 query = query.arg_lazy(
7315 "id",
7316 Box::new(move || {
7317 let id = id.clone();
7318 Box::pin(async move { id.into_id().await.unwrap().quote() })
7319 }),
7320 );
7321 SdkConfig {
7322 proc: self.proc.clone(),
7323 selection: query,
7324 graphql_client: self.graphql_client.clone(),
7325 }
7326 }
7327 pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
7329 let mut query = self.selection.select("loadScalarTypeDefFromID");
7330 query = query.arg_lazy(
7331 "id",
7332 Box::new(move || {
7333 let id = id.clone();
7334 Box::pin(async move { id.into_id().await.unwrap().quote() })
7335 }),
7336 );
7337 ScalarTypeDef {
7338 proc: self.proc.clone(),
7339 selection: query,
7340 graphql_client: self.graphql_client.clone(),
7341 }
7342 }
7343 pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
7345 let mut query = self.selection.select("loadSecretFromID");
7346 query = query.arg_lazy(
7347 "id",
7348 Box::new(move || {
7349 let id = id.clone();
7350 Box::pin(async move { id.into_id().await.unwrap().quote() })
7351 }),
7352 );
7353 Secret {
7354 proc: self.proc.clone(),
7355 selection: query,
7356 graphql_client: self.graphql_client.clone(),
7357 }
7358 }
7359 pub fn load_secret_from_name(&self, name: impl Into<String>) -> Secret {
7365 let mut query = self.selection.select("loadSecretFromName");
7366 query = query.arg("name", name.into());
7367 Secret {
7368 proc: self.proc.clone(),
7369 selection: query,
7370 graphql_client: self.graphql_client.clone(),
7371 }
7372 }
7373 pub fn load_secret_from_name_opts<'a>(
7379 &self,
7380 name: impl Into<String>,
7381 opts: QueryLoadSecretFromNameOpts<'a>,
7382 ) -> Secret {
7383 let mut query = self.selection.select("loadSecretFromName");
7384 query = query.arg("name", name.into());
7385 if let Some(accessor) = opts.accessor {
7386 query = query.arg("accessor", accessor);
7387 }
7388 Secret {
7389 proc: self.proc.clone(),
7390 selection: query,
7391 graphql_client: self.graphql_client.clone(),
7392 }
7393 }
7394 pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
7396 let mut query = self.selection.select("loadServiceFromID");
7397 query = query.arg_lazy(
7398 "id",
7399 Box::new(move || {
7400 let id = id.clone();
7401 Box::pin(async move { id.into_id().await.unwrap().quote() })
7402 }),
7403 );
7404 Service {
7405 proc: self.proc.clone(),
7406 selection: query,
7407 graphql_client: self.graphql_client.clone(),
7408 }
7409 }
7410 pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
7412 let mut query = self.selection.select("loadSocketFromID");
7413 query = query.arg_lazy(
7414 "id",
7415 Box::new(move || {
7416 let id = id.clone();
7417 Box::pin(async move { id.into_id().await.unwrap().quote() })
7418 }),
7419 );
7420 Socket {
7421 proc: self.proc.clone(),
7422 selection: query,
7423 graphql_client: self.graphql_client.clone(),
7424 }
7425 }
7426 pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
7428 let mut query = self.selection.select("loadSourceMapFromID");
7429 query = query.arg_lazy(
7430 "id",
7431 Box::new(move || {
7432 let id = id.clone();
7433 Box::pin(async move { id.into_id().await.unwrap().quote() })
7434 }),
7435 );
7436 SourceMap {
7437 proc: self.proc.clone(),
7438 selection: query,
7439 graphql_client: self.graphql_client.clone(),
7440 }
7441 }
7442 pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
7444 let mut query = self.selection.select("loadTerminalFromID");
7445 query = query.arg_lazy(
7446 "id",
7447 Box::new(move || {
7448 let id = id.clone();
7449 Box::pin(async move { id.into_id().await.unwrap().quote() })
7450 }),
7451 );
7452 Terminal {
7453 proc: self.proc.clone(),
7454 selection: query,
7455 graphql_client: self.graphql_client.clone(),
7456 }
7457 }
7458 pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
7460 let mut query = self.selection.select("loadTypeDefFromID");
7461 query = query.arg_lazy(
7462 "id",
7463 Box::new(move || {
7464 let id = id.clone();
7465 Box::pin(async move { id.into_id().await.unwrap().quote() })
7466 }),
7467 );
7468 TypeDef {
7469 proc: self.proc.clone(),
7470 selection: query,
7471 graphql_client: self.graphql_client.clone(),
7472 }
7473 }
7474 pub fn module(&self) -> Module {
7476 let query = self.selection.select("module");
7477 Module {
7478 proc: self.proc.clone(),
7479 selection: query,
7480 graphql_client: self.graphql_client.clone(),
7481 }
7482 }
7483 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
7490 let mut query = self.selection.select("moduleSource");
7491 query = query.arg("refString", ref_string.into());
7492 ModuleSource {
7493 proc: self.proc.clone(),
7494 selection: query,
7495 graphql_client: self.graphql_client.clone(),
7496 }
7497 }
7498 pub fn module_source_opts<'a>(
7505 &self,
7506 ref_string: impl Into<String>,
7507 opts: QueryModuleSourceOpts<'a>,
7508 ) -> ModuleSource {
7509 let mut query = self.selection.select("moduleSource");
7510 query = query.arg("refString", ref_string.into());
7511 if let Some(ref_pin) = opts.ref_pin {
7512 query = query.arg("refPin", ref_pin);
7513 }
7514 if let Some(disable_find_up) = opts.disable_find_up {
7515 query = query.arg("disableFindUp", disable_find_up);
7516 }
7517 if let Some(allow_not_exists) = opts.allow_not_exists {
7518 query = query.arg("allowNotExists", allow_not_exists);
7519 }
7520 if let Some(require_kind) = opts.require_kind {
7521 query = query.arg("requireKind", require_kind);
7522 }
7523 ModuleSource {
7524 proc: self.proc.clone(),
7525 selection: query,
7526 graphql_client: self.graphql_client.clone(),
7527 }
7528 }
7529 pub fn secret(&self, uri: impl Into<String>) -> Secret {
7535 let mut query = self.selection.select("secret");
7536 query = query.arg("uri", uri.into());
7537 Secret {
7538 proc: self.proc.clone(),
7539 selection: query,
7540 graphql_client: self.graphql_client.clone(),
7541 }
7542 }
7543 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
7551 let mut query = self.selection.select("setSecret");
7552 query = query.arg("name", name.into());
7553 query = query.arg("plaintext", plaintext.into());
7554 Secret {
7555 proc: self.proc.clone(),
7556 selection: query,
7557 graphql_client: self.graphql_client.clone(),
7558 }
7559 }
7560 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
7568 let mut query = self.selection.select("sourceMap");
7569 query = query.arg("filename", filename.into());
7570 query = query.arg("line", line);
7571 query = query.arg("column", column);
7572 SourceMap {
7573 proc: self.proc.clone(),
7574 selection: query,
7575 graphql_client: self.graphql_client.clone(),
7576 }
7577 }
7578 pub fn type_def(&self) -> TypeDef {
7580 let query = self.selection.select("typeDef");
7581 TypeDef {
7582 proc: self.proc.clone(),
7583 selection: query,
7584 graphql_client: self.graphql_client.clone(),
7585 }
7586 }
7587 pub async fn version(&self) -> Result<String, DaggerError> {
7589 let query = self.selection.select("version");
7590 query.execute(self.graphql_client.clone()).await
7591 }
7592}
7593#[derive(Clone)]
7594pub struct SdkConfig {
7595 pub proc: Option<Arc<DaggerSessionProc>>,
7596 pub selection: Selection,
7597 pub graphql_client: DynGraphQLClient,
7598}
7599impl SdkConfig {
7600 pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
7602 let query = self.selection.select("id");
7603 query.execute(self.graphql_client.clone()).await
7604 }
7605 pub async fn source(&self) -> Result<String, DaggerError> {
7607 let query = self.selection.select("source");
7608 query.execute(self.graphql_client.clone()).await
7609 }
7610}
7611#[derive(Clone)]
7612pub struct ScalarTypeDef {
7613 pub proc: Option<Arc<DaggerSessionProc>>,
7614 pub selection: Selection,
7615 pub graphql_client: DynGraphQLClient,
7616}
7617impl ScalarTypeDef {
7618 pub async fn description(&self) -> Result<String, DaggerError> {
7620 let query = self.selection.select("description");
7621 query.execute(self.graphql_client.clone()).await
7622 }
7623 pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
7625 let query = self.selection.select("id");
7626 query.execute(self.graphql_client.clone()).await
7627 }
7628 pub async fn name(&self) -> Result<String, DaggerError> {
7630 let query = self.selection.select("name");
7631 query.execute(self.graphql_client.clone()).await
7632 }
7633 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
7635 let query = self.selection.select("sourceModuleName");
7636 query.execute(self.graphql_client.clone()).await
7637 }
7638}
7639#[derive(Clone)]
7640pub struct Secret {
7641 pub proc: Option<Arc<DaggerSessionProc>>,
7642 pub selection: Selection,
7643 pub graphql_client: DynGraphQLClient,
7644}
7645impl Secret {
7646 pub async fn id(&self) -> Result<SecretId, DaggerError> {
7648 let query = self.selection.select("id");
7649 query.execute(self.graphql_client.clone()).await
7650 }
7651 pub async fn name(&self) -> Result<String, DaggerError> {
7653 let query = self.selection.select("name");
7654 query.execute(self.graphql_client.clone()).await
7655 }
7656 pub async fn plaintext(&self) -> Result<String, DaggerError> {
7658 let query = self.selection.select("plaintext");
7659 query.execute(self.graphql_client.clone()).await
7660 }
7661 pub async fn uri(&self) -> Result<String, DaggerError> {
7663 let query = self.selection.select("uri");
7664 query.execute(self.graphql_client.clone()).await
7665 }
7666}
7667#[derive(Clone)]
7668pub struct Service {
7669 pub proc: Option<Arc<DaggerSessionProc>>,
7670 pub selection: Selection,
7671 pub graphql_client: DynGraphQLClient,
7672}
7673#[derive(Builder, Debug, PartialEq)]
7674pub struct ServiceEndpointOpts<'a> {
7675 #[builder(setter(into, strip_option), default)]
7677 pub port: Option<isize>,
7678 #[builder(setter(into, strip_option), default)]
7680 pub scheme: Option<&'a str>,
7681}
7682#[derive(Builder, Debug, PartialEq)]
7683pub struct ServiceStopOpts {
7684 #[builder(setter(into, strip_option), default)]
7686 pub kill: Option<bool>,
7687}
7688#[derive(Builder, Debug, PartialEq)]
7689pub struct ServiceUpOpts {
7690 #[builder(setter(into, strip_option), default)]
7693 pub ports: Option<Vec<PortForward>>,
7694 #[builder(setter(into, strip_option), default)]
7696 pub random: Option<bool>,
7697}
7698impl Service {
7699 pub async fn endpoint(&self) -> Result<String, DaggerError> {
7707 let query = self.selection.select("endpoint");
7708 query.execute(self.graphql_client.clone()).await
7709 }
7710 pub async fn endpoint_opts<'a>(
7718 &self,
7719 opts: ServiceEndpointOpts<'a>,
7720 ) -> Result<String, DaggerError> {
7721 let mut query = self.selection.select("endpoint");
7722 if let Some(port) = opts.port {
7723 query = query.arg("port", port);
7724 }
7725 if let Some(scheme) = opts.scheme {
7726 query = query.arg("scheme", scheme);
7727 }
7728 query.execute(self.graphql_client.clone()).await
7729 }
7730 pub async fn hostname(&self) -> Result<String, DaggerError> {
7732 let query = self.selection.select("hostname");
7733 query.execute(self.graphql_client.clone()).await
7734 }
7735 pub async fn id(&self) -> Result<ServiceId, DaggerError> {
7737 let query = self.selection.select("id");
7738 query.execute(self.graphql_client.clone()).await
7739 }
7740 pub fn ports(&self) -> Vec<Port> {
7742 let query = self.selection.select("ports");
7743 vec![Port {
7744 proc: self.proc.clone(),
7745 selection: query,
7746 graphql_client: self.graphql_client.clone(),
7747 }]
7748 }
7749 pub async fn start(&self) -> Result<ServiceId, DaggerError> {
7752 let query = self.selection.select("start");
7753 query.execute(self.graphql_client.clone()).await
7754 }
7755 pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
7761 let query = self.selection.select("stop");
7762 query.execute(self.graphql_client.clone()).await
7763 }
7764 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
7770 let mut query = self.selection.select("stop");
7771 if let Some(kill) = opts.kill {
7772 query = query.arg("kill", kill);
7773 }
7774 query.execute(self.graphql_client.clone()).await
7775 }
7776 pub async fn up(&self) -> Result<Void, DaggerError> {
7782 let query = self.selection.select("up");
7783 query.execute(self.graphql_client.clone()).await
7784 }
7785 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
7791 let mut query = self.selection.select("up");
7792 if let Some(ports) = opts.ports {
7793 query = query.arg("ports", ports);
7794 }
7795 if let Some(random) = opts.random {
7796 query = query.arg("random", random);
7797 }
7798 query.execute(self.graphql_client.clone()).await
7799 }
7800 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
7806 let mut query = self.selection.select("withHostname");
7807 query = query.arg("hostname", hostname.into());
7808 Service {
7809 proc: self.proc.clone(),
7810 selection: query,
7811 graphql_client: self.graphql_client.clone(),
7812 }
7813 }
7814}
7815#[derive(Clone)]
7816pub struct Socket {
7817 pub proc: Option<Arc<DaggerSessionProc>>,
7818 pub selection: Selection,
7819 pub graphql_client: DynGraphQLClient,
7820}
7821impl Socket {
7822 pub async fn id(&self) -> Result<SocketId, DaggerError> {
7824 let query = self.selection.select("id");
7825 query.execute(self.graphql_client.clone()).await
7826 }
7827}
7828#[derive(Clone)]
7829pub struct SourceMap {
7830 pub proc: Option<Arc<DaggerSessionProc>>,
7831 pub selection: Selection,
7832 pub graphql_client: DynGraphQLClient,
7833}
7834impl SourceMap {
7835 pub async fn column(&self) -> Result<isize, DaggerError> {
7837 let query = self.selection.select("column");
7838 query.execute(self.graphql_client.clone()).await
7839 }
7840 pub async fn filename(&self) -> Result<String, DaggerError> {
7842 let query = self.selection.select("filename");
7843 query.execute(self.graphql_client.clone()).await
7844 }
7845 pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
7847 let query = self.selection.select("id");
7848 query.execute(self.graphql_client.clone()).await
7849 }
7850 pub async fn line(&self) -> Result<isize, DaggerError> {
7852 let query = self.selection.select("line");
7853 query.execute(self.graphql_client.clone()).await
7854 }
7855 pub async fn module(&self) -> Result<String, DaggerError> {
7857 let query = self.selection.select("module");
7858 query.execute(self.graphql_client.clone()).await
7859 }
7860}
7861#[derive(Clone)]
7862pub struct Terminal {
7863 pub proc: Option<Arc<DaggerSessionProc>>,
7864 pub selection: Selection,
7865 pub graphql_client: DynGraphQLClient,
7866}
7867impl Terminal {
7868 pub async fn id(&self) -> Result<TerminalId, DaggerError> {
7870 let query = self.selection.select("id");
7871 query.execute(self.graphql_client.clone()).await
7872 }
7873 pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
7876 let query = self.selection.select("sync");
7877 query.execute(self.graphql_client.clone()).await
7878 }
7879}
7880#[derive(Clone)]
7881pub struct TypeDef {
7882 pub proc: Option<Arc<DaggerSessionProc>>,
7883 pub selection: Selection,
7884 pub graphql_client: DynGraphQLClient,
7885}
7886#[derive(Builder, Debug, PartialEq)]
7887pub struct TypeDefWithEnumOpts<'a> {
7888 #[builder(setter(into, strip_option), default)]
7890 pub description: Option<&'a str>,
7891 #[builder(setter(into, strip_option), default)]
7893 pub source_map: Option<SourceMapId>,
7894}
7895#[derive(Builder, Debug, PartialEq)]
7896pub struct TypeDefWithEnumValueOpts<'a> {
7897 #[builder(setter(into, strip_option), default)]
7899 pub description: Option<&'a str>,
7900 #[builder(setter(into, strip_option), default)]
7902 pub source_map: Option<SourceMapId>,
7903}
7904#[derive(Builder, Debug, PartialEq)]
7905pub struct TypeDefWithFieldOpts<'a> {
7906 #[builder(setter(into, strip_option), default)]
7908 pub description: Option<&'a str>,
7909 #[builder(setter(into, strip_option), default)]
7911 pub source_map: Option<SourceMapId>,
7912}
7913#[derive(Builder, Debug, PartialEq)]
7914pub struct TypeDefWithInterfaceOpts<'a> {
7915 #[builder(setter(into, strip_option), default)]
7916 pub description: Option<&'a str>,
7917 #[builder(setter(into, strip_option), default)]
7918 pub source_map: Option<SourceMapId>,
7919}
7920#[derive(Builder, Debug, PartialEq)]
7921pub struct TypeDefWithObjectOpts<'a> {
7922 #[builder(setter(into, strip_option), default)]
7923 pub description: Option<&'a str>,
7924 #[builder(setter(into, strip_option), default)]
7925 pub source_map: Option<SourceMapId>,
7926}
7927#[derive(Builder, Debug, PartialEq)]
7928pub struct TypeDefWithScalarOpts<'a> {
7929 #[builder(setter(into, strip_option), default)]
7930 pub description: Option<&'a str>,
7931}
7932impl TypeDef {
7933 pub fn as_enum(&self) -> EnumTypeDef {
7935 let query = self.selection.select("asEnum");
7936 EnumTypeDef {
7937 proc: self.proc.clone(),
7938 selection: query,
7939 graphql_client: self.graphql_client.clone(),
7940 }
7941 }
7942 pub fn as_input(&self) -> InputTypeDef {
7944 let query = self.selection.select("asInput");
7945 InputTypeDef {
7946 proc: self.proc.clone(),
7947 selection: query,
7948 graphql_client: self.graphql_client.clone(),
7949 }
7950 }
7951 pub fn as_interface(&self) -> InterfaceTypeDef {
7953 let query = self.selection.select("asInterface");
7954 InterfaceTypeDef {
7955 proc: self.proc.clone(),
7956 selection: query,
7957 graphql_client: self.graphql_client.clone(),
7958 }
7959 }
7960 pub fn as_list(&self) -> ListTypeDef {
7962 let query = self.selection.select("asList");
7963 ListTypeDef {
7964 proc: self.proc.clone(),
7965 selection: query,
7966 graphql_client: self.graphql_client.clone(),
7967 }
7968 }
7969 pub fn as_object(&self) -> ObjectTypeDef {
7971 let query = self.selection.select("asObject");
7972 ObjectTypeDef {
7973 proc: self.proc.clone(),
7974 selection: query,
7975 graphql_client: self.graphql_client.clone(),
7976 }
7977 }
7978 pub fn as_scalar(&self) -> ScalarTypeDef {
7980 let query = self.selection.select("asScalar");
7981 ScalarTypeDef {
7982 proc: self.proc.clone(),
7983 selection: query,
7984 graphql_client: self.graphql_client.clone(),
7985 }
7986 }
7987 pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
7989 let query = self.selection.select("id");
7990 query.execute(self.graphql_client.clone()).await
7991 }
7992 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
7994 let query = self.selection.select("kind");
7995 query.execute(self.graphql_client.clone()).await
7996 }
7997 pub async fn optional(&self) -> Result<bool, DaggerError> {
7999 let query = self.selection.select("optional");
8000 query.execute(self.graphql_client.clone()).await
8001 }
8002 pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
8004 let mut query = self.selection.select("withConstructor");
8005 query = query.arg_lazy(
8006 "function",
8007 Box::new(move || {
8008 let function = function.clone();
8009 Box::pin(async move { function.into_id().await.unwrap().quote() })
8010 }),
8011 );
8012 TypeDef {
8013 proc: self.proc.clone(),
8014 selection: query,
8015 graphql_client: self.graphql_client.clone(),
8016 }
8017 }
8018 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
8026 let mut query = self.selection.select("withEnum");
8027 query = query.arg("name", name.into());
8028 TypeDef {
8029 proc: self.proc.clone(),
8030 selection: query,
8031 graphql_client: self.graphql_client.clone(),
8032 }
8033 }
8034 pub fn with_enum_opts<'a>(
8042 &self,
8043 name: impl Into<String>,
8044 opts: TypeDefWithEnumOpts<'a>,
8045 ) -> TypeDef {
8046 let mut query = self.selection.select("withEnum");
8047 query = query.arg("name", name.into());
8048 if let Some(description) = opts.description {
8049 query = query.arg("description", description);
8050 }
8051 if let Some(source_map) = opts.source_map {
8052 query = query.arg("sourceMap", source_map);
8053 }
8054 TypeDef {
8055 proc: self.proc.clone(),
8056 selection: query,
8057 graphql_client: self.graphql_client.clone(),
8058 }
8059 }
8060 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
8067 let mut query = self.selection.select("withEnumValue");
8068 query = query.arg("value", value.into());
8069 TypeDef {
8070 proc: self.proc.clone(),
8071 selection: query,
8072 graphql_client: self.graphql_client.clone(),
8073 }
8074 }
8075 pub fn with_enum_value_opts<'a>(
8082 &self,
8083 value: impl Into<String>,
8084 opts: TypeDefWithEnumValueOpts<'a>,
8085 ) -> TypeDef {
8086 let mut query = self.selection.select("withEnumValue");
8087 query = query.arg("value", value.into());
8088 if let Some(description) = opts.description {
8089 query = query.arg("description", description);
8090 }
8091 if let Some(source_map) = opts.source_map {
8092 query = query.arg("sourceMap", source_map);
8093 }
8094 TypeDef {
8095 proc: self.proc.clone(),
8096 selection: query,
8097 graphql_client: self.graphql_client.clone(),
8098 }
8099 }
8100 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
8108 let mut query = self.selection.select("withField");
8109 query = query.arg("name", name.into());
8110 query = query.arg_lazy(
8111 "typeDef",
8112 Box::new(move || {
8113 let type_def = type_def.clone();
8114 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8115 }),
8116 );
8117 TypeDef {
8118 proc: self.proc.clone(),
8119 selection: query,
8120 graphql_client: self.graphql_client.clone(),
8121 }
8122 }
8123 pub fn with_field_opts<'a>(
8131 &self,
8132 name: impl Into<String>,
8133 type_def: impl IntoID<TypeDefId>,
8134 opts: TypeDefWithFieldOpts<'a>,
8135 ) -> TypeDef {
8136 let mut query = self.selection.select("withField");
8137 query = query.arg("name", name.into());
8138 query = query.arg_lazy(
8139 "typeDef",
8140 Box::new(move || {
8141 let type_def = type_def.clone();
8142 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8143 }),
8144 );
8145 if let Some(description) = opts.description {
8146 query = query.arg("description", description);
8147 }
8148 if let Some(source_map) = opts.source_map {
8149 query = query.arg("sourceMap", source_map);
8150 }
8151 TypeDef {
8152 proc: self.proc.clone(),
8153 selection: query,
8154 graphql_client: self.graphql_client.clone(),
8155 }
8156 }
8157 pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
8159 let mut query = self.selection.select("withFunction");
8160 query = query.arg_lazy(
8161 "function",
8162 Box::new(move || {
8163 let function = function.clone();
8164 Box::pin(async move { function.into_id().await.unwrap().quote() })
8165 }),
8166 );
8167 TypeDef {
8168 proc: self.proc.clone(),
8169 selection: query,
8170 graphql_client: self.graphql_client.clone(),
8171 }
8172 }
8173 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
8179 let mut query = self.selection.select("withInterface");
8180 query = query.arg("name", name.into());
8181 TypeDef {
8182 proc: self.proc.clone(),
8183 selection: query,
8184 graphql_client: self.graphql_client.clone(),
8185 }
8186 }
8187 pub fn with_interface_opts<'a>(
8193 &self,
8194 name: impl Into<String>,
8195 opts: TypeDefWithInterfaceOpts<'a>,
8196 ) -> TypeDef {
8197 let mut query = self.selection.select("withInterface");
8198 query = query.arg("name", name.into());
8199 if let Some(description) = opts.description {
8200 query = query.arg("description", description);
8201 }
8202 if let Some(source_map) = opts.source_map {
8203 query = query.arg("sourceMap", source_map);
8204 }
8205 TypeDef {
8206 proc: self.proc.clone(),
8207 selection: query,
8208 graphql_client: self.graphql_client.clone(),
8209 }
8210 }
8211 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
8213 let mut query = self.selection.select("withKind");
8214 query = query.arg("kind", kind);
8215 TypeDef {
8216 proc: self.proc.clone(),
8217 selection: query,
8218 graphql_client: self.graphql_client.clone(),
8219 }
8220 }
8221 pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
8223 let mut query = self.selection.select("withListOf");
8224 query = query.arg_lazy(
8225 "elementType",
8226 Box::new(move || {
8227 let element_type = element_type.clone();
8228 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
8229 }),
8230 );
8231 TypeDef {
8232 proc: self.proc.clone(),
8233 selection: query,
8234 graphql_client: self.graphql_client.clone(),
8235 }
8236 }
8237 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
8244 let mut query = self.selection.select("withObject");
8245 query = query.arg("name", name.into());
8246 TypeDef {
8247 proc: self.proc.clone(),
8248 selection: query,
8249 graphql_client: self.graphql_client.clone(),
8250 }
8251 }
8252 pub fn with_object_opts<'a>(
8259 &self,
8260 name: impl Into<String>,
8261 opts: TypeDefWithObjectOpts<'a>,
8262 ) -> TypeDef {
8263 let mut query = self.selection.select("withObject");
8264 query = query.arg("name", name.into());
8265 if let Some(description) = opts.description {
8266 query = query.arg("description", description);
8267 }
8268 if let Some(source_map) = opts.source_map {
8269 query = query.arg("sourceMap", source_map);
8270 }
8271 TypeDef {
8272 proc: self.proc.clone(),
8273 selection: query,
8274 graphql_client: self.graphql_client.clone(),
8275 }
8276 }
8277 pub fn with_optional(&self, optional: bool) -> TypeDef {
8279 let mut query = self.selection.select("withOptional");
8280 query = query.arg("optional", optional);
8281 TypeDef {
8282 proc: self.proc.clone(),
8283 selection: query,
8284 graphql_client: self.graphql_client.clone(),
8285 }
8286 }
8287 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
8293 let mut query = self.selection.select("withScalar");
8294 query = query.arg("name", name.into());
8295 TypeDef {
8296 proc: self.proc.clone(),
8297 selection: query,
8298 graphql_client: self.graphql_client.clone(),
8299 }
8300 }
8301 pub fn with_scalar_opts<'a>(
8307 &self,
8308 name: impl Into<String>,
8309 opts: TypeDefWithScalarOpts<'a>,
8310 ) -> TypeDef {
8311 let mut query = self.selection.select("withScalar");
8312 query = query.arg("name", name.into());
8313 if let Some(description) = opts.description {
8314 query = query.arg("description", description);
8315 }
8316 TypeDef {
8317 proc: self.proc.clone(),
8318 selection: query,
8319 graphql_client: self.graphql_client.clone(),
8320 }
8321 }
8322}
8323#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8324pub enum CacheSharingMode {
8325 #[serde(rename = "LOCKED")]
8326 Locked,
8327 #[serde(rename = "PRIVATE")]
8328 Private,
8329 #[serde(rename = "SHARED")]
8330 Shared,
8331}
8332#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8333pub enum ImageLayerCompression {
8334 #[serde(rename = "EStarGZ")]
8335 EStarGz,
8336 #[serde(rename = "Gzip")]
8337 Gzip,
8338 #[serde(rename = "Uncompressed")]
8339 Uncompressed,
8340 #[serde(rename = "Zstd")]
8341 Zstd,
8342}
8343#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8344pub enum ImageMediaTypes {
8345 #[serde(rename = "DockerMediaTypes")]
8346 DockerMediaTypes,
8347 #[serde(rename = "OCIMediaTypes")]
8348 OciMediaTypes,
8349}
8350#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8351pub enum ModuleSourceKind {
8352 #[serde(rename = "DIR_SOURCE")]
8353 DirSource,
8354 #[serde(rename = "GIT_SOURCE")]
8355 GitSource,
8356 #[serde(rename = "LOCAL_SOURCE")]
8357 LocalSource,
8358}
8359#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8360pub enum NetworkProtocol {
8361 #[serde(rename = "TCP")]
8362 Tcp,
8363 #[serde(rename = "UDP")]
8364 Udp,
8365}
8366#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8367pub enum ReturnType {
8368 #[serde(rename = "ANY")]
8369 Any,
8370 #[serde(rename = "FAILURE")]
8371 Failure,
8372 #[serde(rename = "SUCCESS")]
8373 Success,
8374}
8375#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8376pub enum TypeDefKind {
8377 #[serde(rename = "BOOLEAN_KIND")]
8378 BooleanKind,
8379 #[serde(rename = "ENUM_KIND")]
8380 EnumKind,
8381 #[serde(rename = "FLOAT_KIND")]
8382 FloatKind,
8383 #[serde(rename = "INPUT_KIND")]
8384 InputKind,
8385 #[serde(rename = "INTEGER_KIND")]
8386 IntegerKind,
8387 #[serde(rename = "INTERFACE_KIND")]
8388 InterfaceKind,
8389 #[serde(rename = "LIST_KIND")]
8390 ListKind,
8391 #[serde(rename = "OBJECT_KIND")]
8392 ObjectKind,
8393 #[serde(rename = "SCALAR_KIND")]
8394 ScalarKind,
8395 #[serde(rename = "STRING_KIND")]
8396 StringKind,
8397 #[serde(rename = "VOID_KIND")]
8398 VoidKind,
8399}