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 sync(&self) -> Result<DirectoryId, DaggerError> {
4223 let query = self.selection.select("sync");
4224 query.execute(self.graphql_client.clone()).await
4225 }
4226 pub fn terminal(&self) -> Directory {
4232 let query = self.selection.select("terminal");
4233 Directory {
4234 proc: self.proc.clone(),
4235 selection: query,
4236 graphql_client: self.graphql_client.clone(),
4237 }
4238 }
4239 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
4245 let mut query = self.selection.select("terminal");
4246 if let Some(cmd) = opts.cmd {
4247 query = query.arg("cmd", cmd);
4248 }
4249 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
4250 query = query.arg(
4251 "experimentalPrivilegedNesting",
4252 experimental_privileged_nesting,
4253 );
4254 }
4255 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
4256 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
4257 }
4258 if let Some(container) = opts.container {
4259 query = query.arg("container", container);
4260 }
4261 Directory {
4262 proc: self.proc.clone(),
4263 selection: query,
4264 graphql_client: self.graphql_client.clone(),
4265 }
4266 }
4267 pub fn with_directory(
4275 &self,
4276 path: impl Into<String>,
4277 directory: impl IntoID<DirectoryId>,
4278 ) -> Directory {
4279 let mut query = self.selection.select("withDirectory");
4280 query = query.arg("path", path.into());
4281 query = query.arg_lazy(
4282 "directory",
4283 Box::new(move || {
4284 let directory = directory.clone();
4285 Box::pin(async move { directory.into_id().await.unwrap().quote() })
4286 }),
4287 );
4288 Directory {
4289 proc: self.proc.clone(),
4290 selection: query,
4291 graphql_client: self.graphql_client.clone(),
4292 }
4293 }
4294 pub fn with_directory_opts<'a>(
4302 &self,
4303 path: impl Into<String>,
4304 directory: impl IntoID<DirectoryId>,
4305 opts: DirectoryWithDirectoryOpts<'a>,
4306 ) -> Directory {
4307 let mut query = self.selection.select("withDirectory");
4308 query = query.arg("path", path.into());
4309 query = query.arg_lazy(
4310 "directory",
4311 Box::new(move || {
4312 let directory = directory.clone();
4313 Box::pin(async move { directory.into_id().await.unwrap().quote() })
4314 }),
4315 );
4316 if let Some(exclude) = opts.exclude {
4317 query = query.arg("exclude", exclude);
4318 }
4319 if let Some(include) = opts.include {
4320 query = query.arg("include", include);
4321 }
4322 Directory {
4323 proc: self.proc.clone(),
4324 selection: query,
4325 graphql_client: self.graphql_client.clone(),
4326 }
4327 }
4328 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
4336 let mut query = self.selection.select("withFile");
4337 query = query.arg("path", path.into());
4338 query = query.arg_lazy(
4339 "source",
4340 Box::new(move || {
4341 let source = source.clone();
4342 Box::pin(async move { source.into_id().await.unwrap().quote() })
4343 }),
4344 );
4345 Directory {
4346 proc: self.proc.clone(),
4347 selection: query,
4348 graphql_client: self.graphql_client.clone(),
4349 }
4350 }
4351 pub fn with_file_opts(
4359 &self,
4360 path: impl Into<String>,
4361 source: impl IntoID<FileId>,
4362 opts: DirectoryWithFileOpts,
4363 ) -> Directory {
4364 let mut query = self.selection.select("withFile");
4365 query = query.arg("path", path.into());
4366 query = query.arg_lazy(
4367 "source",
4368 Box::new(move || {
4369 let source = source.clone();
4370 Box::pin(async move { source.into_id().await.unwrap().quote() })
4371 }),
4372 );
4373 if let Some(permissions) = opts.permissions {
4374 query = query.arg("permissions", permissions);
4375 }
4376 Directory {
4377 proc: self.proc.clone(),
4378 selection: query,
4379 graphql_client: self.graphql_client.clone(),
4380 }
4381 }
4382 pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
4390 let mut query = self.selection.select("withFiles");
4391 query = query.arg("path", path.into());
4392 query = query.arg("sources", sources);
4393 Directory {
4394 proc: self.proc.clone(),
4395 selection: query,
4396 graphql_client: self.graphql_client.clone(),
4397 }
4398 }
4399 pub fn with_files_opts(
4407 &self,
4408 path: impl Into<String>,
4409 sources: Vec<FileId>,
4410 opts: DirectoryWithFilesOpts,
4411 ) -> Directory {
4412 let mut query = self.selection.select("withFiles");
4413 query = query.arg("path", path.into());
4414 query = query.arg("sources", sources);
4415 if let Some(permissions) = opts.permissions {
4416 query = query.arg("permissions", permissions);
4417 }
4418 Directory {
4419 proc: self.proc.clone(),
4420 selection: query,
4421 graphql_client: self.graphql_client.clone(),
4422 }
4423 }
4424 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
4431 let mut query = self.selection.select("withNewDirectory");
4432 query = query.arg("path", path.into());
4433 Directory {
4434 proc: self.proc.clone(),
4435 selection: query,
4436 graphql_client: self.graphql_client.clone(),
4437 }
4438 }
4439 pub fn with_new_directory_opts(
4446 &self,
4447 path: impl Into<String>,
4448 opts: DirectoryWithNewDirectoryOpts,
4449 ) -> Directory {
4450 let mut query = self.selection.select("withNewDirectory");
4451 query = query.arg("path", path.into());
4452 if let Some(permissions) = opts.permissions {
4453 query = query.arg("permissions", permissions);
4454 }
4455 Directory {
4456 proc: self.proc.clone(),
4457 selection: query,
4458 graphql_client: self.graphql_client.clone(),
4459 }
4460 }
4461 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
4469 let mut query = self.selection.select("withNewFile");
4470 query = query.arg("path", path.into());
4471 query = query.arg("contents", contents.into());
4472 Directory {
4473 proc: self.proc.clone(),
4474 selection: query,
4475 graphql_client: self.graphql_client.clone(),
4476 }
4477 }
4478 pub fn with_new_file_opts(
4486 &self,
4487 path: impl Into<String>,
4488 contents: impl Into<String>,
4489 opts: DirectoryWithNewFileOpts,
4490 ) -> Directory {
4491 let mut query = self.selection.select("withNewFile");
4492 query = query.arg("path", path.into());
4493 query = query.arg("contents", contents.into());
4494 if let Some(permissions) = opts.permissions {
4495 query = query.arg("permissions", permissions);
4496 }
4497 Directory {
4498 proc: self.proc.clone(),
4499 selection: query,
4500 graphql_client: self.graphql_client.clone(),
4501 }
4502 }
4503 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
4511 let mut query = self.selection.select("withTimestamps");
4512 query = query.arg("timestamp", timestamp);
4513 Directory {
4514 proc: self.proc.clone(),
4515 selection: query,
4516 graphql_client: self.graphql_client.clone(),
4517 }
4518 }
4519 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
4525 let mut query = self.selection.select("withoutDirectory");
4526 query = query.arg("path", path.into());
4527 Directory {
4528 proc: self.proc.clone(),
4529 selection: query,
4530 graphql_client: self.graphql_client.clone(),
4531 }
4532 }
4533 pub fn without_file(&self, path: impl Into<String>) -> Directory {
4539 let mut query = self.selection.select("withoutFile");
4540 query = query.arg("path", path.into());
4541 Directory {
4542 proc: self.proc.clone(),
4543 selection: query,
4544 graphql_client: self.graphql_client.clone(),
4545 }
4546 }
4547 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
4553 let mut query = self.selection.select("withoutFiles");
4554 query = query.arg(
4555 "paths",
4556 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4557 );
4558 Directory {
4559 proc: self.proc.clone(),
4560 selection: query,
4561 graphql_client: self.graphql_client.clone(),
4562 }
4563 }
4564}
4565#[derive(Clone)]
4566pub struct Engine {
4567 pub proc: Option<Arc<DaggerSessionProc>>,
4568 pub selection: Selection,
4569 pub graphql_client: DynGraphQLClient,
4570}
4571impl Engine {
4572 pub async fn id(&self) -> Result<EngineId, DaggerError> {
4574 let query = self.selection.select("id");
4575 query.execute(self.graphql_client.clone()).await
4576 }
4577 pub fn local_cache(&self) -> EngineCache {
4579 let query = self.selection.select("localCache");
4580 EngineCache {
4581 proc: self.proc.clone(),
4582 selection: query,
4583 graphql_client: self.graphql_client.clone(),
4584 }
4585 }
4586}
4587#[derive(Clone)]
4588pub struct EngineCache {
4589 pub proc: Option<Arc<DaggerSessionProc>>,
4590 pub selection: Selection,
4591 pub graphql_client: DynGraphQLClient,
4592}
4593#[derive(Builder, Debug, PartialEq)]
4594pub struct EngineCacheEntrySetOpts<'a> {
4595 #[builder(setter(into, strip_option), default)]
4596 pub key: Option<&'a str>,
4597}
4598impl EngineCache {
4599 pub fn entry_set(&self) -> EngineCacheEntrySet {
4605 let query = self.selection.select("entrySet");
4606 EngineCacheEntrySet {
4607 proc: self.proc.clone(),
4608 selection: query,
4609 graphql_client: self.graphql_client.clone(),
4610 }
4611 }
4612 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
4618 let mut query = self.selection.select("entrySet");
4619 if let Some(key) = opts.key {
4620 query = query.arg("key", key);
4621 }
4622 EngineCacheEntrySet {
4623 proc: self.proc.clone(),
4624 selection: query,
4625 graphql_client: self.graphql_client.clone(),
4626 }
4627 }
4628 pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
4630 let query = self.selection.select("id");
4631 query.execute(self.graphql_client.clone()).await
4632 }
4633 pub async fn keep_bytes(&self) -> Result<isize, DaggerError> {
4635 let query = self.selection.select("keepBytes");
4636 query.execute(self.graphql_client.clone()).await
4637 }
4638 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
4640 let query = self.selection.select("maxUsedSpace");
4641 query.execute(self.graphql_client.clone()).await
4642 }
4643 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
4645 let query = self.selection.select("minFreeSpace");
4646 query.execute(self.graphql_client.clone()).await
4647 }
4648 pub async fn prune(&self) -> Result<Void, DaggerError> {
4650 let query = self.selection.select("prune");
4651 query.execute(self.graphql_client.clone()).await
4652 }
4653 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
4654 let query = self.selection.select("reservedSpace");
4655 query.execute(self.graphql_client.clone()).await
4656 }
4657}
4658#[derive(Clone)]
4659pub struct EngineCacheEntry {
4660 pub proc: Option<Arc<DaggerSessionProc>>,
4661 pub selection: Selection,
4662 pub graphql_client: DynGraphQLClient,
4663}
4664impl EngineCacheEntry {
4665 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
4667 let query = self.selection.select("activelyUsed");
4668 query.execute(self.graphql_client.clone()).await
4669 }
4670 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
4672 let query = self.selection.select("createdTimeUnixNano");
4673 query.execute(self.graphql_client.clone()).await
4674 }
4675 pub async fn description(&self) -> Result<String, DaggerError> {
4677 let query = self.selection.select("description");
4678 query.execute(self.graphql_client.clone()).await
4679 }
4680 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
4682 let query = self.selection.select("diskSpaceBytes");
4683 query.execute(self.graphql_client.clone()).await
4684 }
4685 pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
4687 let query = self.selection.select("id");
4688 query.execute(self.graphql_client.clone()).await
4689 }
4690 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
4692 let query = self.selection.select("mostRecentUseTimeUnixNano");
4693 query.execute(self.graphql_client.clone()).await
4694 }
4695}
4696#[derive(Clone)]
4697pub struct EngineCacheEntrySet {
4698 pub proc: Option<Arc<DaggerSessionProc>>,
4699 pub selection: Selection,
4700 pub graphql_client: DynGraphQLClient,
4701}
4702impl EngineCacheEntrySet {
4703 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
4705 let query = self.selection.select("diskSpaceBytes");
4706 query.execute(self.graphql_client.clone()).await
4707 }
4708 pub fn entries(&self) -> Vec<EngineCacheEntry> {
4710 let query = self.selection.select("entries");
4711 vec![EngineCacheEntry {
4712 proc: self.proc.clone(),
4713 selection: query,
4714 graphql_client: self.graphql_client.clone(),
4715 }]
4716 }
4717 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
4719 let query = self.selection.select("entryCount");
4720 query.execute(self.graphql_client.clone()).await
4721 }
4722 pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
4724 let query = self.selection.select("id");
4725 query.execute(self.graphql_client.clone()).await
4726 }
4727}
4728#[derive(Clone)]
4729pub struct EnumTypeDef {
4730 pub proc: Option<Arc<DaggerSessionProc>>,
4731 pub selection: Selection,
4732 pub graphql_client: DynGraphQLClient,
4733}
4734impl EnumTypeDef {
4735 pub async fn description(&self) -> Result<String, DaggerError> {
4737 let query = self.selection.select("description");
4738 query.execute(self.graphql_client.clone()).await
4739 }
4740 pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
4742 let query = self.selection.select("id");
4743 query.execute(self.graphql_client.clone()).await
4744 }
4745 pub async fn name(&self) -> Result<String, DaggerError> {
4747 let query = self.selection.select("name");
4748 query.execute(self.graphql_client.clone()).await
4749 }
4750 pub fn source_map(&self) -> SourceMap {
4752 let query = self.selection.select("sourceMap");
4753 SourceMap {
4754 proc: self.proc.clone(),
4755 selection: query,
4756 graphql_client: self.graphql_client.clone(),
4757 }
4758 }
4759 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
4761 let query = self.selection.select("sourceModuleName");
4762 query.execute(self.graphql_client.clone()).await
4763 }
4764 pub fn values(&self) -> Vec<EnumValueTypeDef> {
4766 let query = self.selection.select("values");
4767 vec![EnumValueTypeDef {
4768 proc: self.proc.clone(),
4769 selection: query,
4770 graphql_client: self.graphql_client.clone(),
4771 }]
4772 }
4773}
4774#[derive(Clone)]
4775pub struct EnumValueTypeDef {
4776 pub proc: Option<Arc<DaggerSessionProc>>,
4777 pub selection: Selection,
4778 pub graphql_client: DynGraphQLClient,
4779}
4780impl EnumValueTypeDef {
4781 pub async fn description(&self) -> Result<String, DaggerError> {
4783 let query = self.selection.select("description");
4784 query.execute(self.graphql_client.clone()).await
4785 }
4786 pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
4788 let query = self.selection.select("id");
4789 query.execute(self.graphql_client.clone()).await
4790 }
4791 pub async fn name(&self) -> Result<String, DaggerError> {
4793 let query = self.selection.select("name");
4794 query.execute(self.graphql_client.clone()).await
4795 }
4796 pub fn source_map(&self) -> SourceMap {
4798 let query = self.selection.select("sourceMap");
4799 SourceMap {
4800 proc: self.proc.clone(),
4801 selection: query,
4802 graphql_client: self.graphql_client.clone(),
4803 }
4804 }
4805}
4806#[derive(Clone)]
4807pub struct EnvVariable {
4808 pub proc: Option<Arc<DaggerSessionProc>>,
4809 pub selection: Selection,
4810 pub graphql_client: DynGraphQLClient,
4811}
4812impl EnvVariable {
4813 pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
4815 let query = self.selection.select("id");
4816 query.execute(self.graphql_client.clone()).await
4817 }
4818 pub async fn name(&self) -> Result<String, DaggerError> {
4820 let query = self.selection.select("name");
4821 query.execute(self.graphql_client.clone()).await
4822 }
4823 pub async fn value(&self) -> Result<String, DaggerError> {
4825 let query = self.selection.select("value");
4826 query.execute(self.graphql_client.clone()).await
4827 }
4828}
4829#[derive(Clone)]
4830pub struct Error {
4831 pub proc: Option<Arc<DaggerSessionProc>>,
4832 pub selection: Selection,
4833 pub graphql_client: DynGraphQLClient,
4834}
4835impl Error {
4836 pub async fn id(&self) -> Result<ErrorId, DaggerError> {
4838 let query = self.selection.select("id");
4839 query.execute(self.graphql_client.clone()).await
4840 }
4841 pub async fn message(&self) -> Result<String, DaggerError> {
4843 let query = self.selection.select("message");
4844 query.execute(self.graphql_client.clone()).await
4845 }
4846}
4847#[derive(Clone)]
4848pub struct FieldTypeDef {
4849 pub proc: Option<Arc<DaggerSessionProc>>,
4850 pub selection: Selection,
4851 pub graphql_client: DynGraphQLClient,
4852}
4853impl FieldTypeDef {
4854 pub async fn description(&self) -> Result<String, DaggerError> {
4856 let query = self.selection.select("description");
4857 query.execute(self.graphql_client.clone()).await
4858 }
4859 pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
4861 let query = self.selection.select("id");
4862 query.execute(self.graphql_client.clone()).await
4863 }
4864 pub async fn name(&self) -> Result<String, DaggerError> {
4866 let query = self.selection.select("name");
4867 query.execute(self.graphql_client.clone()).await
4868 }
4869 pub fn source_map(&self) -> SourceMap {
4871 let query = self.selection.select("sourceMap");
4872 SourceMap {
4873 proc: self.proc.clone(),
4874 selection: query,
4875 graphql_client: self.graphql_client.clone(),
4876 }
4877 }
4878 pub fn type_def(&self) -> TypeDef {
4880 let query = self.selection.select("typeDef");
4881 TypeDef {
4882 proc: self.proc.clone(),
4883 selection: query,
4884 graphql_client: self.graphql_client.clone(),
4885 }
4886 }
4887}
4888#[derive(Clone)]
4889pub struct File {
4890 pub proc: Option<Arc<DaggerSessionProc>>,
4891 pub selection: Selection,
4892 pub graphql_client: DynGraphQLClient,
4893}
4894#[derive(Builder, Debug, PartialEq)]
4895pub struct FileDigestOpts {
4896 #[builder(setter(into, strip_option), default)]
4898 pub exclude_metadata: Option<bool>,
4899}
4900#[derive(Builder, Debug, PartialEq)]
4901pub struct FileExportOpts {
4902 #[builder(setter(into, strip_option), default)]
4904 pub allow_parent_dir_path: Option<bool>,
4905}
4906impl File {
4907 pub async fn contents(&self) -> Result<String, DaggerError> {
4909 let query = self.selection.select("contents");
4910 query.execute(self.graphql_client.clone()).await
4911 }
4912 pub async fn digest(&self) -> Result<String, DaggerError> {
4918 let query = self.selection.select("digest");
4919 query.execute(self.graphql_client.clone()).await
4920 }
4921 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
4927 let mut query = self.selection.select("digest");
4928 if let Some(exclude_metadata) = opts.exclude_metadata {
4929 query = query.arg("excludeMetadata", exclude_metadata);
4930 }
4931 query.execute(self.graphql_client.clone()).await
4932 }
4933 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
4940 let mut query = self.selection.select("export");
4941 query = query.arg("path", path.into());
4942 query.execute(self.graphql_client.clone()).await
4943 }
4944 pub async fn export_opts(
4951 &self,
4952 path: impl Into<String>,
4953 opts: FileExportOpts,
4954 ) -> Result<String, DaggerError> {
4955 let mut query = self.selection.select("export");
4956 query = query.arg("path", path.into());
4957 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
4958 query = query.arg("allowParentDirPath", allow_parent_dir_path);
4959 }
4960 query.execute(self.graphql_client.clone()).await
4961 }
4962 pub async fn id(&self) -> Result<FileId, DaggerError> {
4964 let query = self.selection.select("id");
4965 query.execute(self.graphql_client.clone()).await
4966 }
4967 pub async fn name(&self) -> Result<String, DaggerError> {
4969 let query = self.selection.select("name");
4970 query.execute(self.graphql_client.clone()).await
4971 }
4972 pub async fn size(&self) -> Result<isize, DaggerError> {
4974 let query = self.selection.select("size");
4975 query.execute(self.graphql_client.clone()).await
4976 }
4977 pub async fn sync(&self) -> Result<FileId, DaggerError> {
4979 let query = self.selection.select("sync");
4980 query.execute(self.graphql_client.clone()).await
4981 }
4982 pub fn with_name(&self, name: impl Into<String>) -> File {
4988 let mut query = self.selection.select("withName");
4989 query = query.arg("name", name.into());
4990 File {
4991 proc: self.proc.clone(),
4992 selection: query,
4993 graphql_client: self.graphql_client.clone(),
4994 }
4995 }
4996 pub fn with_timestamps(&self, timestamp: isize) -> File {
5004 let mut query = self.selection.select("withTimestamps");
5005 query = query.arg("timestamp", timestamp);
5006 File {
5007 proc: self.proc.clone(),
5008 selection: query,
5009 graphql_client: self.graphql_client.clone(),
5010 }
5011 }
5012}
5013#[derive(Clone)]
5014pub struct Function {
5015 pub proc: Option<Arc<DaggerSessionProc>>,
5016 pub selection: Selection,
5017 pub graphql_client: DynGraphQLClient,
5018}
5019#[derive(Builder, Debug, PartialEq)]
5020pub struct FunctionWithArgOpts<'a> {
5021 #[builder(setter(into, strip_option), default)]
5023 pub default_path: Option<&'a str>,
5024 #[builder(setter(into, strip_option), default)]
5026 pub default_value: Option<Json>,
5027 #[builder(setter(into, strip_option), default)]
5029 pub description: Option<&'a str>,
5030 #[builder(setter(into, strip_option), default)]
5032 pub ignore: Option<Vec<&'a str>>,
5033 #[builder(setter(into, strip_option), default)]
5034 pub source_map: Option<SourceMapId>,
5035}
5036impl Function {
5037 pub fn args(&self) -> Vec<FunctionArg> {
5039 let query = self.selection.select("args");
5040 vec![FunctionArg {
5041 proc: self.proc.clone(),
5042 selection: query,
5043 graphql_client: self.graphql_client.clone(),
5044 }]
5045 }
5046 pub async fn description(&self) -> Result<String, DaggerError> {
5048 let query = self.selection.select("description");
5049 query.execute(self.graphql_client.clone()).await
5050 }
5051 pub async fn id(&self) -> Result<FunctionId, DaggerError> {
5053 let query = self.selection.select("id");
5054 query.execute(self.graphql_client.clone()).await
5055 }
5056 pub async fn name(&self) -> Result<String, DaggerError> {
5058 let query = self.selection.select("name");
5059 query.execute(self.graphql_client.clone()).await
5060 }
5061 pub fn return_type(&self) -> TypeDef {
5063 let query = self.selection.select("returnType");
5064 TypeDef {
5065 proc: self.proc.clone(),
5066 selection: query,
5067 graphql_client: self.graphql_client.clone(),
5068 }
5069 }
5070 pub fn source_map(&self) -> SourceMap {
5072 let query = self.selection.select("sourceMap");
5073 SourceMap {
5074 proc: self.proc.clone(),
5075 selection: query,
5076 graphql_client: self.graphql_client.clone(),
5077 }
5078 }
5079 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
5087 let mut query = self.selection.select("withArg");
5088 query = query.arg("name", name.into());
5089 query = query.arg_lazy(
5090 "typeDef",
5091 Box::new(move || {
5092 let type_def = type_def.clone();
5093 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
5094 }),
5095 );
5096 Function {
5097 proc: self.proc.clone(),
5098 selection: query,
5099 graphql_client: self.graphql_client.clone(),
5100 }
5101 }
5102 pub fn with_arg_opts<'a>(
5110 &self,
5111 name: impl Into<String>,
5112 type_def: impl IntoID<TypeDefId>,
5113 opts: FunctionWithArgOpts<'a>,
5114 ) -> Function {
5115 let mut query = self.selection.select("withArg");
5116 query = query.arg("name", name.into());
5117 query = query.arg_lazy(
5118 "typeDef",
5119 Box::new(move || {
5120 let type_def = type_def.clone();
5121 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
5122 }),
5123 );
5124 if let Some(description) = opts.description {
5125 query = query.arg("description", description);
5126 }
5127 if let Some(default_value) = opts.default_value {
5128 query = query.arg("defaultValue", default_value);
5129 }
5130 if let Some(default_path) = opts.default_path {
5131 query = query.arg("defaultPath", default_path);
5132 }
5133 if let Some(ignore) = opts.ignore {
5134 query = query.arg("ignore", ignore);
5135 }
5136 if let Some(source_map) = opts.source_map {
5137 query = query.arg("sourceMap", source_map);
5138 }
5139 Function {
5140 proc: self.proc.clone(),
5141 selection: query,
5142 graphql_client: self.graphql_client.clone(),
5143 }
5144 }
5145 pub fn with_description(&self, description: impl Into<String>) -> Function {
5151 let mut query = self.selection.select("withDescription");
5152 query = query.arg("description", description.into());
5153 Function {
5154 proc: self.proc.clone(),
5155 selection: query,
5156 graphql_client: self.graphql_client.clone(),
5157 }
5158 }
5159 pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
5165 let mut query = self.selection.select("withSourceMap");
5166 query = query.arg_lazy(
5167 "sourceMap",
5168 Box::new(move || {
5169 let source_map = source_map.clone();
5170 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
5171 }),
5172 );
5173 Function {
5174 proc: self.proc.clone(),
5175 selection: query,
5176 graphql_client: self.graphql_client.clone(),
5177 }
5178 }
5179}
5180#[derive(Clone)]
5181pub struct FunctionArg {
5182 pub proc: Option<Arc<DaggerSessionProc>>,
5183 pub selection: Selection,
5184 pub graphql_client: DynGraphQLClient,
5185}
5186impl FunctionArg {
5187 pub async fn default_path(&self) -> Result<String, DaggerError> {
5189 let query = self.selection.select("defaultPath");
5190 query.execute(self.graphql_client.clone()).await
5191 }
5192 pub async fn default_value(&self) -> Result<Json, DaggerError> {
5194 let query = self.selection.select("defaultValue");
5195 query.execute(self.graphql_client.clone()).await
5196 }
5197 pub async fn description(&self) -> Result<String, DaggerError> {
5199 let query = self.selection.select("description");
5200 query.execute(self.graphql_client.clone()).await
5201 }
5202 pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
5204 let query = self.selection.select("id");
5205 query.execute(self.graphql_client.clone()).await
5206 }
5207 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
5209 let query = self.selection.select("ignore");
5210 query.execute(self.graphql_client.clone()).await
5211 }
5212 pub async fn name(&self) -> Result<String, DaggerError> {
5214 let query = self.selection.select("name");
5215 query.execute(self.graphql_client.clone()).await
5216 }
5217 pub fn source_map(&self) -> SourceMap {
5219 let query = self.selection.select("sourceMap");
5220 SourceMap {
5221 proc: self.proc.clone(),
5222 selection: query,
5223 graphql_client: self.graphql_client.clone(),
5224 }
5225 }
5226 pub fn type_def(&self) -> TypeDef {
5228 let query = self.selection.select("typeDef");
5229 TypeDef {
5230 proc: self.proc.clone(),
5231 selection: query,
5232 graphql_client: self.graphql_client.clone(),
5233 }
5234 }
5235}
5236#[derive(Clone)]
5237pub struct FunctionCall {
5238 pub proc: Option<Arc<DaggerSessionProc>>,
5239 pub selection: Selection,
5240 pub graphql_client: DynGraphQLClient,
5241}
5242impl FunctionCall {
5243 pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
5245 let query = self.selection.select("id");
5246 query.execute(self.graphql_client.clone()).await
5247 }
5248 pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
5250 let query = self.selection.select("inputArgs");
5251 vec![FunctionCallArgValue {
5252 proc: self.proc.clone(),
5253 selection: query,
5254 graphql_client: self.graphql_client.clone(),
5255 }]
5256 }
5257 pub async fn name(&self) -> Result<String, DaggerError> {
5259 let query = self.selection.select("name");
5260 query.execute(self.graphql_client.clone()).await
5261 }
5262 pub async fn parent(&self) -> Result<Json, DaggerError> {
5264 let query = self.selection.select("parent");
5265 query.execute(self.graphql_client.clone()).await
5266 }
5267 pub async fn parent_name(&self) -> Result<String, DaggerError> {
5269 let query = self.selection.select("parentName");
5270 query.execute(self.graphql_client.clone()).await
5271 }
5272 pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
5278 let mut query = self.selection.select("returnError");
5279 query = query.arg_lazy(
5280 "error",
5281 Box::new(move || {
5282 let error = error.clone();
5283 Box::pin(async move { error.into_id().await.unwrap().quote() })
5284 }),
5285 );
5286 query.execute(self.graphql_client.clone()).await
5287 }
5288 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
5294 let mut query = self.selection.select("returnValue");
5295 query = query.arg("value", value);
5296 query.execute(self.graphql_client.clone()).await
5297 }
5298}
5299#[derive(Clone)]
5300pub struct FunctionCallArgValue {
5301 pub proc: Option<Arc<DaggerSessionProc>>,
5302 pub selection: Selection,
5303 pub graphql_client: DynGraphQLClient,
5304}
5305impl FunctionCallArgValue {
5306 pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
5308 let query = self.selection.select("id");
5309 query.execute(self.graphql_client.clone()).await
5310 }
5311 pub async fn name(&self) -> Result<String, DaggerError> {
5313 let query = self.selection.select("name");
5314 query.execute(self.graphql_client.clone()).await
5315 }
5316 pub async fn value(&self) -> Result<Json, DaggerError> {
5318 let query = self.selection.select("value");
5319 query.execute(self.graphql_client.clone()).await
5320 }
5321}
5322#[derive(Clone)]
5323pub struct GeneratedCode {
5324 pub proc: Option<Arc<DaggerSessionProc>>,
5325 pub selection: Selection,
5326 pub graphql_client: DynGraphQLClient,
5327}
5328impl GeneratedCode {
5329 pub fn code(&self) -> Directory {
5331 let query = self.selection.select("code");
5332 Directory {
5333 proc: self.proc.clone(),
5334 selection: query,
5335 graphql_client: self.graphql_client.clone(),
5336 }
5337 }
5338 pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
5340 let query = self.selection.select("id");
5341 query.execute(self.graphql_client.clone()).await
5342 }
5343 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
5345 let query = self.selection.select("vcsGeneratedPaths");
5346 query.execute(self.graphql_client.clone()).await
5347 }
5348 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
5350 let query = self.selection.select("vcsIgnoredPaths");
5351 query.execute(self.graphql_client.clone()).await
5352 }
5353 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
5355 let mut query = self.selection.select("withVCSGeneratedPaths");
5356 query = query.arg(
5357 "paths",
5358 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5359 );
5360 GeneratedCode {
5361 proc: self.proc.clone(),
5362 selection: query,
5363 graphql_client: self.graphql_client.clone(),
5364 }
5365 }
5366 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
5368 let mut query = self.selection.select("withVCSIgnoredPaths");
5369 query = query.arg(
5370 "paths",
5371 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5372 );
5373 GeneratedCode {
5374 proc: self.proc.clone(),
5375 selection: query,
5376 graphql_client: self.graphql_client.clone(),
5377 }
5378 }
5379}
5380#[derive(Clone)]
5381pub struct GitRef {
5382 pub proc: Option<Arc<DaggerSessionProc>>,
5383 pub selection: Selection,
5384 pub graphql_client: DynGraphQLClient,
5385}
5386#[derive(Builder, Debug, PartialEq)]
5387pub struct GitRefTreeOpts {
5388 #[builder(setter(into, strip_option), default)]
5390 pub discard_git_dir: Option<bool>,
5391}
5392impl GitRef {
5393 pub async fn commit(&self) -> Result<String, DaggerError> {
5395 let query = self.selection.select("commit");
5396 query.execute(self.graphql_client.clone()).await
5397 }
5398 pub async fn id(&self) -> Result<GitRefId, DaggerError> {
5400 let query = self.selection.select("id");
5401 query.execute(self.graphql_client.clone()).await
5402 }
5403 pub fn tree(&self) -> Directory {
5409 let query = self.selection.select("tree");
5410 Directory {
5411 proc: self.proc.clone(),
5412 selection: query,
5413 graphql_client: self.graphql_client.clone(),
5414 }
5415 }
5416 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
5422 let mut query = self.selection.select("tree");
5423 if let Some(discard_git_dir) = opts.discard_git_dir {
5424 query = query.arg("discardGitDir", discard_git_dir);
5425 }
5426 Directory {
5427 proc: self.proc.clone(),
5428 selection: query,
5429 graphql_client: self.graphql_client.clone(),
5430 }
5431 }
5432}
5433#[derive(Clone)]
5434pub struct GitRepository {
5435 pub proc: Option<Arc<DaggerSessionProc>>,
5436 pub selection: Selection,
5437 pub graphql_client: DynGraphQLClient,
5438}
5439#[derive(Builder, Debug, PartialEq)]
5440pub struct GitRepositoryTagsOpts<'a> {
5441 #[builder(setter(into, strip_option), default)]
5443 pub patterns: Option<Vec<&'a str>>,
5444}
5445impl GitRepository {
5446 pub fn branch(&self, name: impl Into<String>) -> GitRef {
5452 let mut query = self.selection.select("branch");
5453 query = query.arg("name", name.into());
5454 GitRef {
5455 proc: self.proc.clone(),
5456 selection: query,
5457 graphql_client: self.graphql_client.clone(),
5458 }
5459 }
5460 pub fn commit(&self, id: impl Into<String>) -> GitRef {
5466 let mut query = self.selection.select("commit");
5467 query = query.arg("id", id.into());
5468 GitRef {
5469 proc: self.proc.clone(),
5470 selection: query,
5471 graphql_client: self.graphql_client.clone(),
5472 }
5473 }
5474 pub fn head(&self) -> GitRef {
5476 let query = self.selection.select("head");
5477 GitRef {
5478 proc: self.proc.clone(),
5479 selection: query,
5480 graphql_client: self.graphql_client.clone(),
5481 }
5482 }
5483 pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
5485 let query = self.selection.select("id");
5486 query.execute(self.graphql_client.clone()).await
5487 }
5488 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
5494 let mut query = self.selection.select("ref");
5495 query = query.arg("name", name.into());
5496 GitRef {
5497 proc: self.proc.clone(),
5498 selection: query,
5499 graphql_client: self.graphql_client.clone(),
5500 }
5501 }
5502 pub fn tag(&self, name: impl Into<String>) -> GitRef {
5508 let mut query = self.selection.select("tag");
5509 query = query.arg("name", name.into());
5510 GitRef {
5511 proc: self.proc.clone(),
5512 selection: query,
5513 graphql_client: self.graphql_client.clone(),
5514 }
5515 }
5516 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
5522 let query = self.selection.select("tags");
5523 query.execute(self.graphql_client.clone()).await
5524 }
5525 pub async fn tags_opts<'a>(
5531 &self,
5532 opts: GitRepositoryTagsOpts<'a>,
5533 ) -> Result<Vec<String>, DaggerError> {
5534 let mut query = self.selection.select("tags");
5535 if let Some(patterns) = opts.patterns {
5536 query = query.arg("patterns", patterns);
5537 }
5538 query.execute(self.graphql_client.clone()).await
5539 }
5540 pub fn with_auth_header(&self, header: impl IntoID<SecretId>) -> GitRepository {
5546 let mut query = self.selection.select("withAuthHeader");
5547 query = query.arg_lazy(
5548 "header",
5549 Box::new(move || {
5550 let header = header.clone();
5551 Box::pin(async move { header.into_id().await.unwrap().quote() })
5552 }),
5553 );
5554 GitRepository {
5555 proc: self.proc.clone(),
5556 selection: query,
5557 graphql_client: self.graphql_client.clone(),
5558 }
5559 }
5560 pub fn with_auth_token(&self, token: impl IntoID<SecretId>) -> GitRepository {
5566 let mut query = self.selection.select("withAuthToken");
5567 query = query.arg_lazy(
5568 "token",
5569 Box::new(move || {
5570 let token = token.clone();
5571 Box::pin(async move { token.into_id().await.unwrap().quote() })
5572 }),
5573 );
5574 GitRepository {
5575 proc: self.proc.clone(),
5576 selection: query,
5577 graphql_client: self.graphql_client.clone(),
5578 }
5579 }
5580}
5581#[derive(Clone)]
5582pub struct Host {
5583 pub proc: Option<Arc<DaggerSessionProc>>,
5584 pub selection: Selection,
5585 pub graphql_client: DynGraphQLClient,
5586}
5587#[derive(Builder, Debug, PartialEq)]
5588pub struct HostDirectoryOpts<'a> {
5589 #[builder(setter(into, strip_option), default)]
5591 pub exclude: Option<Vec<&'a str>>,
5592 #[builder(setter(into, strip_option), default)]
5594 pub include: Option<Vec<&'a str>>,
5595}
5596#[derive(Builder, Debug, PartialEq)]
5597pub struct HostServiceOpts<'a> {
5598 #[builder(setter(into, strip_option), default)]
5600 pub host: Option<&'a str>,
5601}
5602#[derive(Builder, Debug, PartialEq)]
5603pub struct HostTunnelOpts {
5604 #[builder(setter(into, strip_option), default)]
5607 pub native: Option<bool>,
5608 #[builder(setter(into, strip_option), default)]
5613 pub ports: Option<Vec<PortForward>>,
5614}
5615impl Host {
5616 pub fn directory(&self, path: impl Into<String>) -> Directory {
5623 let mut query = self.selection.select("directory");
5624 query = query.arg("path", path.into());
5625 Directory {
5626 proc: self.proc.clone(),
5627 selection: query,
5628 graphql_client: self.graphql_client.clone(),
5629 }
5630 }
5631 pub fn directory_opts<'a>(
5638 &self,
5639 path: impl Into<String>,
5640 opts: HostDirectoryOpts<'a>,
5641 ) -> Directory {
5642 let mut query = self.selection.select("directory");
5643 query = query.arg("path", path.into());
5644 if let Some(exclude) = opts.exclude {
5645 query = query.arg("exclude", exclude);
5646 }
5647 if let Some(include) = opts.include {
5648 query = query.arg("include", include);
5649 }
5650 Directory {
5651 proc: self.proc.clone(),
5652 selection: query,
5653 graphql_client: self.graphql_client.clone(),
5654 }
5655 }
5656 pub fn file(&self, path: impl Into<String>) -> File {
5662 let mut query = self.selection.select("file");
5663 query = query.arg("path", path.into());
5664 File {
5665 proc: self.proc.clone(),
5666 selection: query,
5667 graphql_client: self.graphql_client.clone(),
5668 }
5669 }
5670 pub async fn id(&self) -> Result<HostId, DaggerError> {
5672 let query = self.selection.select("id");
5673 query.execute(self.graphql_client.clone()).await
5674 }
5675 pub fn service(&self, ports: Vec<PortForward>) -> Service {
5686 let mut query = self.selection.select("service");
5687 query = query.arg("ports", ports);
5688 Service {
5689 proc: self.proc.clone(),
5690 selection: query,
5691 graphql_client: self.graphql_client.clone(),
5692 }
5693 }
5694 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
5705 let mut query = self.selection.select("service");
5706 query = query.arg("ports", ports);
5707 if let Some(host) = opts.host {
5708 query = query.arg("host", host);
5709 }
5710 Service {
5711 proc: self.proc.clone(),
5712 selection: query,
5713 graphql_client: self.graphql_client.clone(),
5714 }
5715 }
5716 pub fn set_secret_file(&self, name: impl Into<String>, path: impl Into<String>) -> Secret {
5724 let mut query = self.selection.select("setSecretFile");
5725 query = query.arg("name", name.into());
5726 query = query.arg("path", path.into());
5727 Secret {
5728 proc: self.proc.clone(),
5729 selection: query,
5730 graphql_client: self.graphql_client.clone(),
5731 }
5732 }
5733 pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
5740 let mut query = self.selection.select("tunnel");
5741 query = query.arg_lazy(
5742 "service",
5743 Box::new(move || {
5744 let service = service.clone();
5745 Box::pin(async move { service.into_id().await.unwrap().quote() })
5746 }),
5747 );
5748 Service {
5749 proc: self.proc.clone(),
5750 selection: query,
5751 graphql_client: self.graphql_client.clone(),
5752 }
5753 }
5754 pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
5761 let mut query = self.selection.select("tunnel");
5762 query = query.arg_lazy(
5763 "service",
5764 Box::new(move || {
5765 let service = service.clone();
5766 Box::pin(async move { service.into_id().await.unwrap().quote() })
5767 }),
5768 );
5769 if let Some(ports) = opts.ports {
5770 query = query.arg("ports", ports);
5771 }
5772 if let Some(native) = opts.native {
5773 query = query.arg("native", native);
5774 }
5775 Service {
5776 proc: self.proc.clone(),
5777 selection: query,
5778 graphql_client: self.graphql_client.clone(),
5779 }
5780 }
5781 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
5787 let mut query = self.selection.select("unixSocket");
5788 query = query.arg("path", path.into());
5789 Socket {
5790 proc: self.proc.clone(),
5791 selection: query,
5792 graphql_client: self.graphql_client.clone(),
5793 }
5794 }
5795}
5796#[derive(Clone)]
5797pub struct InputTypeDef {
5798 pub proc: Option<Arc<DaggerSessionProc>>,
5799 pub selection: Selection,
5800 pub graphql_client: DynGraphQLClient,
5801}
5802impl InputTypeDef {
5803 pub fn fields(&self) -> Vec<FieldTypeDef> {
5805 let query = self.selection.select("fields");
5806 vec![FieldTypeDef {
5807 proc: self.proc.clone(),
5808 selection: query,
5809 graphql_client: self.graphql_client.clone(),
5810 }]
5811 }
5812 pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
5814 let query = self.selection.select("id");
5815 query.execute(self.graphql_client.clone()).await
5816 }
5817 pub async fn name(&self) -> Result<String, DaggerError> {
5819 let query = self.selection.select("name");
5820 query.execute(self.graphql_client.clone()).await
5821 }
5822}
5823#[derive(Clone)]
5824pub struct InterfaceTypeDef {
5825 pub proc: Option<Arc<DaggerSessionProc>>,
5826 pub selection: Selection,
5827 pub graphql_client: DynGraphQLClient,
5828}
5829impl InterfaceTypeDef {
5830 pub async fn description(&self) -> Result<String, DaggerError> {
5832 let query = self.selection.select("description");
5833 query.execute(self.graphql_client.clone()).await
5834 }
5835 pub fn functions(&self) -> Vec<Function> {
5837 let query = self.selection.select("functions");
5838 vec![Function {
5839 proc: self.proc.clone(),
5840 selection: query,
5841 graphql_client: self.graphql_client.clone(),
5842 }]
5843 }
5844 pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
5846 let query = self.selection.select("id");
5847 query.execute(self.graphql_client.clone()).await
5848 }
5849 pub async fn name(&self) -> Result<String, DaggerError> {
5851 let query = self.selection.select("name");
5852 query.execute(self.graphql_client.clone()).await
5853 }
5854 pub fn source_map(&self) -> SourceMap {
5856 let query = self.selection.select("sourceMap");
5857 SourceMap {
5858 proc: self.proc.clone(),
5859 selection: query,
5860 graphql_client: self.graphql_client.clone(),
5861 }
5862 }
5863 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
5865 let query = self.selection.select("sourceModuleName");
5866 query.execute(self.graphql_client.clone()).await
5867 }
5868}
5869#[derive(Clone)]
5870pub struct Label {
5871 pub proc: Option<Arc<DaggerSessionProc>>,
5872 pub selection: Selection,
5873 pub graphql_client: DynGraphQLClient,
5874}
5875impl Label {
5876 pub async fn id(&self) -> Result<LabelId, DaggerError> {
5878 let query = self.selection.select("id");
5879 query.execute(self.graphql_client.clone()).await
5880 }
5881 pub async fn name(&self) -> Result<String, DaggerError> {
5883 let query = self.selection.select("name");
5884 query.execute(self.graphql_client.clone()).await
5885 }
5886 pub async fn value(&self) -> Result<String, DaggerError> {
5888 let query = self.selection.select("value");
5889 query.execute(self.graphql_client.clone()).await
5890 }
5891}
5892#[derive(Clone)]
5893pub struct ListTypeDef {
5894 pub proc: Option<Arc<DaggerSessionProc>>,
5895 pub selection: Selection,
5896 pub graphql_client: DynGraphQLClient,
5897}
5898impl ListTypeDef {
5899 pub fn element_type_def(&self) -> TypeDef {
5901 let query = self.selection.select("elementTypeDef");
5902 TypeDef {
5903 proc: self.proc.clone(),
5904 selection: query,
5905 graphql_client: self.graphql_client.clone(),
5906 }
5907 }
5908 pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
5910 let query = self.selection.select("id");
5911 query.execute(self.graphql_client.clone()).await
5912 }
5913}
5914#[derive(Clone)]
5915pub struct Module {
5916 pub proc: Option<Arc<DaggerSessionProc>>,
5917 pub selection: Selection,
5918 pub graphql_client: DynGraphQLClient,
5919}
5920impl Module {
5921 pub fn dependencies(&self) -> Vec<Module> {
5923 let query = self.selection.select("dependencies");
5924 vec![Module {
5925 proc: self.proc.clone(),
5926 selection: query,
5927 graphql_client: self.graphql_client.clone(),
5928 }]
5929 }
5930 pub async fn description(&self) -> Result<String, DaggerError> {
5932 let query = self.selection.select("description");
5933 query.execute(self.graphql_client.clone()).await
5934 }
5935 pub fn enums(&self) -> Vec<TypeDef> {
5937 let query = self.selection.select("enums");
5938 vec![TypeDef {
5939 proc: self.proc.clone(),
5940 selection: query,
5941 graphql_client: self.graphql_client.clone(),
5942 }]
5943 }
5944 pub fn generated_context_directory(&self) -> Directory {
5946 let query = self.selection.select("generatedContextDirectory");
5947 Directory {
5948 proc: self.proc.clone(),
5949 selection: query,
5950 graphql_client: self.graphql_client.clone(),
5951 }
5952 }
5953 pub async fn id(&self) -> Result<ModuleId, DaggerError> {
5955 let query = self.selection.select("id");
5956 query.execute(self.graphql_client.clone()).await
5957 }
5958 pub fn interfaces(&self) -> Vec<TypeDef> {
5960 let query = self.selection.select("interfaces");
5961 vec![TypeDef {
5962 proc: self.proc.clone(),
5963 selection: query,
5964 graphql_client: self.graphql_client.clone(),
5965 }]
5966 }
5967 pub async fn name(&self) -> Result<String, DaggerError> {
5969 let query = self.selection.select("name");
5970 query.execute(self.graphql_client.clone()).await
5971 }
5972 pub fn objects(&self) -> Vec<TypeDef> {
5974 let query = self.selection.select("objects");
5975 vec![TypeDef {
5976 proc: self.proc.clone(),
5977 selection: query,
5978 graphql_client: self.graphql_client.clone(),
5979 }]
5980 }
5981 pub fn runtime(&self) -> Container {
5983 let query = self.selection.select("runtime");
5984 Container {
5985 proc: self.proc.clone(),
5986 selection: query,
5987 graphql_client: self.graphql_client.clone(),
5988 }
5989 }
5990 pub fn sdk(&self) -> SdkConfig {
5992 let query = self.selection.select("sdk");
5993 SdkConfig {
5994 proc: self.proc.clone(),
5995 selection: query,
5996 graphql_client: self.graphql_client.clone(),
5997 }
5998 }
5999 pub async fn serve(&self) -> Result<Void, DaggerError> {
6002 let query = self.selection.select("serve");
6003 query.execute(self.graphql_client.clone()).await
6004 }
6005 pub fn source(&self) -> ModuleSource {
6007 let query = self.selection.select("source");
6008 ModuleSource {
6009 proc: self.proc.clone(),
6010 selection: query,
6011 graphql_client: self.graphql_client.clone(),
6012 }
6013 }
6014 pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
6016 let query = self.selection.select("sync");
6017 query.execute(self.graphql_client.clone()).await
6018 }
6019 pub fn with_description(&self, description: impl Into<String>) -> Module {
6025 let mut query = self.selection.select("withDescription");
6026 query = query.arg("description", description.into());
6027 Module {
6028 proc: self.proc.clone(),
6029 selection: query,
6030 graphql_client: self.graphql_client.clone(),
6031 }
6032 }
6033 pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
6035 let mut query = self.selection.select("withEnum");
6036 query = query.arg_lazy(
6037 "enum",
6038 Box::new(move || {
6039 let r#enum = r#enum.clone();
6040 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
6041 }),
6042 );
6043 Module {
6044 proc: self.proc.clone(),
6045 selection: query,
6046 graphql_client: self.graphql_client.clone(),
6047 }
6048 }
6049 pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
6051 let mut query = self.selection.select("withInterface");
6052 query = query.arg_lazy(
6053 "iface",
6054 Box::new(move || {
6055 let iface = iface.clone();
6056 Box::pin(async move { iface.into_id().await.unwrap().quote() })
6057 }),
6058 );
6059 Module {
6060 proc: self.proc.clone(),
6061 selection: query,
6062 graphql_client: self.graphql_client.clone(),
6063 }
6064 }
6065 pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
6067 let mut query = self.selection.select("withObject");
6068 query = query.arg_lazy(
6069 "object",
6070 Box::new(move || {
6071 let object = object.clone();
6072 Box::pin(async move { object.into_id().await.unwrap().quote() })
6073 }),
6074 );
6075 Module {
6076 proc: self.proc.clone(),
6077 selection: query,
6078 graphql_client: self.graphql_client.clone(),
6079 }
6080 }
6081}
6082#[derive(Clone)]
6083pub struct ModuleSource {
6084 pub proc: Option<Arc<DaggerSessionProc>>,
6085 pub selection: Selection,
6086 pub graphql_client: DynGraphQLClient,
6087}
6088impl ModuleSource {
6089 pub fn as_module(&self) -> Module {
6091 let query = self.selection.select("asModule");
6092 Module {
6093 proc: self.proc.clone(),
6094 selection: query,
6095 graphql_client: self.graphql_client.clone(),
6096 }
6097 }
6098 pub async fn as_string(&self) -> Result<String, DaggerError> {
6100 let query = self.selection.select("asString");
6101 query.execute(self.graphql_client.clone()).await
6102 }
6103 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
6105 let query = self.selection.select("cloneRef");
6106 query.execute(self.graphql_client.clone()).await
6107 }
6108 pub async fn commit(&self) -> Result<String, DaggerError> {
6110 let query = self.selection.select("commit");
6111 query.execute(self.graphql_client.clone()).await
6112 }
6113 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
6115 let query = self.selection.select("configExists");
6116 query.execute(self.graphql_client.clone()).await
6117 }
6118 pub fn context_directory(&self) -> Directory {
6120 let query = self.selection.select("contextDirectory");
6121 Directory {
6122 proc: self.proc.clone(),
6123 selection: query,
6124 graphql_client: self.graphql_client.clone(),
6125 }
6126 }
6127 pub fn dependencies(&self) -> Vec<ModuleSource> {
6129 let query = self.selection.select("dependencies");
6130 vec![ModuleSource {
6131 proc: self.proc.clone(),
6132 selection: query,
6133 graphql_client: self.graphql_client.clone(),
6134 }]
6135 }
6136 pub async fn digest(&self) -> Result<String, DaggerError> {
6138 let query = self.selection.select("digest");
6139 query.execute(self.graphql_client.clone()).await
6140 }
6141 pub fn directory(&self, path: impl Into<String>) -> Directory {
6147 let mut query = self.selection.select("directory");
6148 query = query.arg("path", path.into());
6149 Directory {
6150 proc: self.proc.clone(),
6151 selection: query,
6152 graphql_client: self.graphql_client.clone(),
6153 }
6154 }
6155 pub async fn engine_version(&self) -> Result<String, DaggerError> {
6157 let query = self.selection.select("engineVersion");
6158 query.execute(self.graphql_client.clone()).await
6159 }
6160 pub fn generated_context_directory(&self) -> Directory {
6162 let query = self.selection.select("generatedContextDirectory");
6163 Directory {
6164 proc: self.proc.clone(),
6165 selection: query,
6166 graphql_client: self.graphql_client.clone(),
6167 }
6168 }
6169 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
6171 let query = self.selection.select("htmlRepoURL");
6172 query.execute(self.graphql_client.clone()).await
6173 }
6174 pub async fn html_url(&self) -> Result<String, DaggerError> {
6176 let query = self.selection.select("htmlURL");
6177 query.execute(self.graphql_client.clone()).await
6178 }
6179 pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
6181 let query = self.selection.select("id");
6182 query.execute(self.graphql_client.clone()).await
6183 }
6184 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
6186 let query = self.selection.select("kind");
6187 query.execute(self.graphql_client.clone()).await
6188 }
6189 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
6191 let query = self.selection.select("localContextDirectoryPath");
6192 query.execute(self.graphql_client.clone()).await
6193 }
6194 pub async fn module_name(&self) -> Result<String, DaggerError> {
6196 let query = self.selection.select("moduleName");
6197 query.execute(self.graphql_client.clone()).await
6198 }
6199 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
6201 let query = self.selection.select("moduleOriginalName");
6202 query.execute(self.graphql_client.clone()).await
6203 }
6204 pub async fn pin(&self) -> Result<String, DaggerError> {
6206 let query = self.selection.select("pin");
6207 query.execute(self.graphql_client.clone()).await
6208 }
6209 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
6211 let query = self.selection.select("repoRootPath");
6212 query.execute(self.graphql_client.clone()).await
6213 }
6214 pub fn sdk(&self) -> SdkConfig {
6216 let query = self.selection.select("sdk");
6217 SdkConfig {
6218 proc: self.proc.clone(),
6219 selection: query,
6220 graphql_client: self.graphql_client.clone(),
6221 }
6222 }
6223 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
6225 let query = self.selection.select("sourceRootSubpath");
6226 query.execute(self.graphql_client.clone()).await
6227 }
6228 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
6230 let query = self.selection.select("sourceSubpath");
6231 query.execute(self.graphql_client.clone()).await
6232 }
6233 pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
6235 let query = self.selection.select("sync");
6236 query.execute(self.graphql_client.clone()).await
6237 }
6238 pub async fn version(&self) -> Result<String, DaggerError> {
6240 let query = self.selection.select("version");
6241 query.execute(self.graphql_client.clone()).await
6242 }
6243 pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
6249 let mut query = self.selection.select("withDependencies");
6250 query = query.arg("dependencies", dependencies);
6251 ModuleSource {
6252 proc: self.proc.clone(),
6253 selection: query,
6254 graphql_client: self.graphql_client.clone(),
6255 }
6256 }
6257 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
6263 let mut query = self.selection.select("withEngineVersion");
6264 query = query.arg("version", version.into());
6265 ModuleSource {
6266 proc: self.proc.clone(),
6267 selection: query,
6268 graphql_client: self.graphql_client.clone(),
6269 }
6270 }
6271 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
6277 let mut query = self.selection.select("withIncludes");
6278 query = query.arg(
6279 "patterns",
6280 patterns
6281 .into_iter()
6282 .map(|i| i.into())
6283 .collect::<Vec<String>>(),
6284 );
6285 ModuleSource {
6286 proc: self.proc.clone(),
6287 selection: query,
6288 graphql_client: self.graphql_client.clone(),
6289 }
6290 }
6291 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
6297 let mut query = self.selection.select("withName");
6298 query = query.arg("name", name.into());
6299 ModuleSource {
6300 proc: self.proc.clone(),
6301 selection: query,
6302 graphql_client: self.graphql_client.clone(),
6303 }
6304 }
6305 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
6311 let mut query = self.selection.select("withSDK");
6312 query = query.arg("source", source.into());
6313 ModuleSource {
6314 proc: self.proc.clone(),
6315 selection: query,
6316 graphql_client: self.graphql_client.clone(),
6317 }
6318 }
6319 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
6325 let mut query = self.selection.select("withSourceSubpath");
6326 query = query.arg("path", path.into());
6327 ModuleSource {
6328 proc: self.proc.clone(),
6329 selection: query,
6330 graphql_client: self.graphql_client.clone(),
6331 }
6332 }
6333 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
6339 let mut query = self.selection.select("withUpdateDependencies");
6340 query = query.arg(
6341 "dependencies",
6342 dependencies
6343 .into_iter()
6344 .map(|i| i.into())
6345 .collect::<Vec<String>>(),
6346 );
6347 ModuleSource {
6348 proc: self.proc.clone(),
6349 selection: query,
6350 graphql_client: self.graphql_client.clone(),
6351 }
6352 }
6353 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
6359 let mut query = self.selection.select("withoutDependencies");
6360 query = query.arg(
6361 "dependencies",
6362 dependencies
6363 .into_iter()
6364 .map(|i| i.into())
6365 .collect::<Vec<String>>(),
6366 );
6367 ModuleSource {
6368 proc: self.proc.clone(),
6369 selection: query,
6370 graphql_client: self.graphql_client.clone(),
6371 }
6372 }
6373}
6374#[derive(Clone)]
6375pub struct ObjectTypeDef {
6376 pub proc: Option<Arc<DaggerSessionProc>>,
6377 pub selection: Selection,
6378 pub graphql_client: DynGraphQLClient,
6379}
6380impl ObjectTypeDef {
6381 pub fn constructor(&self) -> Function {
6383 let query = self.selection.select("constructor");
6384 Function {
6385 proc: self.proc.clone(),
6386 selection: query,
6387 graphql_client: self.graphql_client.clone(),
6388 }
6389 }
6390 pub async fn description(&self) -> Result<String, DaggerError> {
6392 let query = self.selection.select("description");
6393 query.execute(self.graphql_client.clone()).await
6394 }
6395 pub fn fields(&self) -> Vec<FieldTypeDef> {
6397 let query = self.selection.select("fields");
6398 vec![FieldTypeDef {
6399 proc: self.proc.clone(),
6400 selection: query,
6401 graphql_client: self.graphql_client.clone(),
6402 }]
6403 }
6404 pub fn functions(&self) -> Vec<Function> {
6406 let query = self.selection.select("functions");
6407 vec![Function {
6408 proc: self.proc.clone(),
6409 selection: query,
6410 graphql_client: self.graphql_client.clone(),
6411 }]
6412 }
6413 pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
6415 let query = self.selection.select("id");
6416 query.execute(self.graphql_client.clone()).await
6417 }
6418 pub async fn name(&self) -> Result<String, DaggerError> {
6420 let query = self.selection.select("name");
6421 query.execute(self.graphql_client.clone()).await
6422 }
6423 pub fn source_map(&self) -> SourceMap {
6425 let query = self.selection.select("sourceMap");
6426 SourceMap {
6427 proc: self.proc.clone(),
6428 selection: query,
6429 graphql_client: self.graphql_client.clone(),
6430 }
6431 }
6432 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6434 let query = self.selection.select("sourceModuleName");
6435 query.execute(self.graphql_client.clone()).await
6436 }
6437}
6438#[derive(Clone)]
6439pub struct Port {
6440 pub proc: Option<Arc<DaggerSessionProc>>,
6441 pub selection: Selection,
6442 pub graphql_client: DynGraphQLClient,
6443}
6444impl Port {
6445 pub async fn description(&self) -> Result<String, DaggerError> {
6447 let query = self.selection.select("description");
6448 query.execute(self.graphql_client.clone()).await
6449 }
6450 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
6452 let query = self.selection.select("experimentalSkipHealthcheck");
6453 query.execute(self.graphql_client.clone()).await
6454 }
6455 pub async fn id(&self) -> Result<PortId, DaggerError> {
6457 let query = self.selection.select("id");
6458 query.execute(self.graphql_client.clone()).await
6459 }
6460 pub async fn port(&self) -> Result<isize, DaggerError> {
6462 let query = self.selection.select("port");
6463 query.execute(self.graphql_client.clone()).await
6464 }
6465 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
6467 let query = self.selection.select("protocol");
6468 query.execute(self.graphql_client.clone()).await
6469 }
6470}
6471#[derive(Clone)]
6472pub struct Query {
6473 pub proc: Option<Arc<DaggerSessionProc>>,
6474 pub selection: Selection,
6475 pub graphql_client: DynGraphQLClient,
6476}
6477#[derive(Builder, Debug, PartialEq)]
6478pub struct QueryCacheVolumeOpts<'a> {
6479 #[builder(setter(into, strip_option), default)]
6480 pub namespace: Option<&'a str>,
6481}
6482#[derive(Builder, Debug, PartialEq)]
6483pub struct QueryContainerOpts {
6484 #[builder(setter(into, strip_option), default)]
6486 pub platform: Option<Platform>,
6487}
6488#[derive(Builder, Debug, PartialEq)]
6489pub struct QueryGitOpts<'a> {
6490 #[builder(setter(into, strip_option), default)]
6492 pub experimental_service_host: Option<ServiceId>,
6493 #[builder(setter(into, strip_option), default)]
6495 pub keep_git_dir: Option<bool>,
6496 #[builder(setter(into, strip_option), default)]
6498 pub ssh_auth_socket: Option<SocketId>,
6499 #[builder(setter(into, strip_option), default)]
6501 pub ssh_known_hosts: Option<&'a str>,
6502}
6503#[derive(Builder, Debug, PartialEq)]
6504pub struct QueryHttpOpts {
6505 #[builder(setter(into, strip_option), default)]
6507 pub experimental_service_host: Option<ServiceId>,
6508}
6509#[derive(Builder, Debug, PartialEq)]
6510pub struct QueryLoadSecretFromNameOpts<'a> {
6511 #[builder(setter(into, strip_option), default)]
6512 pub accessor: Option<&'a str>,
6513}
6514#[derive(Builder, Debug, PartialEq)]
6515pub struct QueryModuleSourceOpts<'a> {
6516 #[builder(setter(into, strip_option), default)]
6518 pub allow_not_exists: Option<bool>,
6519 #[builder(setter(into, strip_option), default)]
6521 pub disable_find_up: Option<bool>,
6522 #[builder(setter(into, strip_option), default)]
6524 pub ref_pin: Option<&'a str>,
6525 #[builder(setter(into, strip_option), default)]
6527 pub require_kind: Option<ModuleSourceKind>,
6528}
6529impl Query {
6530 pub fn builtin_container(&self, digest: impl Into<String>) -> Container {
6536 let mut query = self.selection.select("builtinContainer");
6537 query = query.arg("digest", digest.into());
6538 Container {
6539 proc: self.proc.clone(),
6540 selection: query,
6541 graphql_client: self.graphql_client.clone(),
6542 }
6543 }
6544 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
6551 let mut query = self.selection.select("cacheVolume");
6552 query = query.arg("key", key.into());
6553 CacheVolume {
6554 proc: self.proc.clone(),
6555 selection: query,
6556 graphql_client: self.graphql_client.clone(),
6557 }
6558 }
6559 pub fn cache_volume_opts<'a>(
6566 &self,
6567 key: impl Into<String>,
6568 opts: QueryCacheVolumeOpts<'a>,
6569 ) -> CacheVolume {
6570 let mut query = self.selection.select("cacheVolume");
6571 query = query.arg("key", key.into());
6572 if let Some(namespace) = opts.namespace {
6573 query = query.arg("namespace", namespace);
6574 }
6575 CacheVolume {
6576 proc: self.proc.clone(),
6577 selection: query,
6578 graphql_client: self.graphql_client.clone(),
6579 }
6580 }
6581 pub fn container(&self) -> Container {
6588 let query = self.selection.select("container");
6589 Container {
6590 proc: self.proc.clone(),
6591 selection: query,
6592 graphql_client: self.graphql_client.clone(),
6593 }
6594 }
6595 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
6602 let mut query = self.selection.select("container");
6603 if let Some(platform) = opts.platform {
6604 query = query.arg("platform", platform);
6605 }
6606 Container {
6607 proc: self.proc.clone(),
6608 selection: query,
6609 graphql_client: self.graphql_client.clone(),
6610 }
6611 }
6612 pub fn current_function_call(&self) -> FunctionCall {
6615 let query = self.selection.select("currentFunctionCall");
6616 FunctionCall {
6617 proc: self.proc.clone(),
6618 selection: query,
6619 graphql_client: self.graphql_client.clone(),
6620 }
6621 }
6622 pub fn current_module(&self) -> CurrentModule {
6624 let query = self.selection.select("currentModule");
6625 CurrentModule {
6626 proc: self.proc.clone(),
6627 selection: query,
6628 graphql_client: self.graphql_client.clone(),
6629 }
6630 }
6631 pub fn current_type_defs(&self) -> Vec<TypeDef> {
6633 let query = self.selection.select("currentTypeDefs");
6634 vec![TypeDef {
6635 proc: self.proc.clone(),
6636 selection: query,
6637 graphql_client: self.graphql_client.clone(),
6638 }]
6639 }
6640 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
6642 let query = self.selection.select("defaultPlatform");
6643 query.execute(self.graphql_client.clone()).await
6644 }
6645 pub fn directory(&self) -> Directory {
6647 let query = self.selection.select("directory");
6648 Directory {
6649 proc: self.proc.clone(),
6650 selection: query,
6651 graphql_client: self.graphql_client.clone(),
6652 }
6653 }
6654 pub fn engine(&self) -> Engine {
6656 let query = self.selection.select("engine");
6657 Engine {
6658 proc: self.proc.clone(),
6659 selection: query,
6660 graphql_client: self.graphql_client.clone(),
6661 }
6662 }
6663 pub fn error(&self, message: impl Into<String>) -> Error {
6669 let mut query = self.selection.select("error");
6670 query = query.arg("message", message.into());
6671 Error {
6672 proc: self.proc.clone(),
6673 selection: query,
6674 graphql_client: self.graphql_client.clone(),
6675 }
6676 }
6677 pub fn function(
6684 &self,
6685 name: impl Into<String>,
6686 return_type: impl IntoID<TypeDefId>,
6687 ) -> Function {
6688 let mut query = self.selection.select("function");
6689 query = query.arg("name", name.into());
6690 query = query.arg_lazy(
6691 "returnType",
6692 Box::new(move || {
6693 let return_type = return_type.clone();
6694 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
6695 }),
6696 );
6697 Function {
6698 proc: self.proc.clone(),
6699 selection: query,
6700 graphql_client: self.graphql_client.clone(),
6701 }
6702 }
6703 pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
6705 let mut query = self.selection.select("generatedCode");
6706 query = query.arg_lazy(
6707 "code",
6708 Box::new(move || {
6709 let code = code.clone();
6710 Box::pin(async move { code.into_id().await.unwrap().quote() })
6711 }),
6712 );
6713 GeneratedCode {
6714 proc: self.proc.clone(),
6715 selection: query,
6716 graphql_client: self.graphql_client.clone(),
6717 }
6718 }
6719 pub fn git(&self, url: impl Into<String>) -> GitRepository {
6730 let mut query = self.selection.select("git");
6731 query = query.arg("url", url.into());
6732 GitRepository {
6733 proc: self.proc.clone(),
6734 selection: query,
6735 graphql_client: self.graphql_client.clone(),
6736 }
6737 }
6738 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
6749 let mut query = self.selection.select("git");
6750 query = query.arg("url", url.into());
6751 if let Some(keep_git_dir) = opts.keep_git_dir {
6752 query = query.arg("keepGitDir", keep_git_dir);
6753 }
6754 if let Some(experimental_service_host) = opts.experimental_service_host {
6755 query = query.arg("experimentalServiceHost", experimental_service_host);
6756 }
6757 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
6758 query = query.arg("sshKnownHosts", ssh_known_hosts);
6759 }
6760 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
6761 query = query.arg("sshAuthSocket", ssh_auth_socket);
6762 }
6763 GitRepository {
6764 proc: self.proc.clone(),
6765 selection: query,
6766 graphql_client: self.graphql_client.clone(),
6767 }
6768 }
6769 pub fn host(&self) -> Host {
6771 let query = self.selection.select("host");
6772 Host {
6773 proc: self.proc.clone(),
6774 selection: query,
6775 graphql_client: self.graphql_client.clone(),
6776 }
6777 }
6778 pub fn http(&self, url: impl Into<String>) -> File {
6785 let mut query = self.selection.select("http");
6786 query = query.arg("url", url.into());
6787 File {
6788 proc: self.proc.clone(),
6789 selection: query,
6790 graphql_client: self.graphql_client.clone(),
6791 }
6792 }
6793 pub fn http_opts(&self, url: impl Into<String>, opts: QueryHttpOpts) -> File {
6800 let mut query = self.selection.select("http");
6801 query = query.arg("url", url.into());
6802 if let Some(experimental_service_host) = opts.experimental_service_host {
6803 query = query.arg("experimentalServiceHost", experimental_service_host);
6804 }
6805 File {
6806 proc: self.proc.clone(),
6807 selection: query,
6808 graphql_client: self.graphql_client.clone(),
6809 }
6810 }
6811 pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
6813 let mut query = self.selection.select("loadCacheVolumeFromID");
6814 query = query.arg_lazy(
6815 "id",
6816 Box::new(move || {
6817 let id = id.clone();
6818 Box::pin(async move { id.into_id().await.unwrap().quote() })
6819 }),
6820 );
6821 CacheVolume {
6822 proc: self.proc.clone(),
6823 selection: query,
6824 graphql_client: self.graphql_client.clone(),
6825 }
6826 }
6827 pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
6829 let mut query = self.selection.select("loadContainerFromID");
6830 query = query.arg_lazy(
6831 "id",
6832 Box::new(move || {
6833 let id = id.clone();
6834 Box::pin(async move { id.into_id().await.unwrap().quote() })
6835 }),
6836 );
6837 Container {
6838 proc: self.proc.clone(),
6839 selection: query,
6840 graphql_client: self.graphql_client.clone(),
6841 }
6842 }
6843 pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
6845 let mut query = self.selection.select("loadCurrentModuleFromID");
6846 query = query.arg_lazy(
6847 "id",
6848 Box::new(move || {
6849 let id = id.clone();
6850 Box::pin(async move { id.into_id().await.unwrap().quote() })
6851 }),
6852 );
6853 CurrentModule {
6854 proc: self.proc.clone(),
6855 selection: query,
6856 graphql_client: self.graphql_client.clone(),
6857 }
6858 }
6859 pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
6861 let mut query = self.selection.select("loadDirectoryFromID");
6862 query = query.arg_lazy(
6863 "id",
6864 Box::new(move || {
6865 let id = id.clone();
6866 Box::pin(async move { id.into_id().await.unwrap().quote() })
6867 }),
6868 );
6869 Directory {
6870 proc: self.proc.clone(),
6871 selection: query,
6872 graphql_client: self.graphql_client.clone(),
6873 }
6874 }
6875 pub fn load_engine_cache_entry_from_id(
6877 &self,
6878 id: impl IntoID<EngineCacheEntryId>,
6879 ) -> EngineCacheEntry {
6880 let mut query = self.selection.select("loadEngineCacheEntryFromID");
6881 query = query.arg_lazy(
6882 "id",
6883 Box::new(move || {
6884 let id = id.clone();
6885 Box::pin(async move { id.into_id().await.unwrap().quote() })
6886 }),
6887 );
6888 EngineCacheEntry {
6889 proc: self.proc.clone(),
6890 selection: query,
6891 graphql_client: self.graphql_client.clone(),
6892 }
6893 }
6894 pub fn load_engine_cache_entry_set_from_id(
6896 &self,
6897 id: impl IntoID<EngineCacheEntrySetId>,
6898 ) -> EngineCacheEntrySet {
6899 let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
6900 query = query.arg_lazy(
6901 "id",
6902 Box::new(move || {
6903 let id = id.clone();
6904 Box::pin(async move { id.into_id().await.unwrap().quote() })
6905 }),
6906 );
6907 EngineCacheEntrySet {
6908 proc: self.proc.clone(),
6909 selection: query,
6910 graphql_client: self.graphql_client.clone(),
6911 }
6912 }
6913 pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
6915 let mut query = self.selection.select("loadEngineCacheFromID");
6916 query = query.arg_lazy(
6917 "id",
6918 Box::new(move || {
6919 let id = id.clone();
6920 Box::pin(async move { id.into_id().await.unwrap().quote() })
6921 }),
6922 );
6923 EngineCache {
6924 proc: self.proc.clone(),
6925 selection: query,
6926 graphql_client: self.graphql_client.clone(),
6927 }
6928 }
6929 pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
6931 let mut query = self.selection.select("loadEngineFromID");
6932 query = query.arg_lazy(
6933 "id",
6934 Box::new(move || {
6935 let id = id.clone();
6936 Box::pin(async move { id.into_id().await.unwrap().quote() })
6937 }),
6938 );
6939 Engine {
6940 proc: self.proc.clone(),
6941 selection: query,
6942 graphql_client: self.graphql_client.clone(),
6943 }
6944 }
6945 pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
6947 let mut query = self.selection.select("loadEnumTypeDefFromID");
6948 query = query.arg_lazy(
6949 "id",
6950 Box::new(move || {
6951 let id = id.clone();
6952 Box::pin(async move { id.into_id().await.unwrap().quote() })
6953 }),
6954 );
6955 EnumTypeDef {
6956 proc: self.proc.clone(),
6957 selection: query,
6958 graphql_client: self.graphql_client.clone(),
6959 }
6960 }
6961 pub fn load_enum_value_type_def_from_id(
6963 &self,
6964 id: impl IntoID<EnumValueTypeDefId>,
6965 ) -> EnumValueTypeDef {
6966 let mut query = self.selection.select("loadEnumValueTypeDefFromID");
6967 query = query.arg_lazy(
6968 "id",
6969 Box::new(move || {
6970 let id = id.clone();
6971 Box::pin(async move { id.into_id().await.unwrap().quote() })
6972 }),
6973 );
6974 EnumValueTypeDef {
6975 proc: self.proc.clone(),
6976 selection: query,
6977 graphql_client: self.graphql_client.clone(),
6978 }
6979 }
6980 pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
6982 let mut query = self.selection.select("loadEnvVariableFromID");
6983 query = query.arg_lazy(
6984 "id",
6985 Box::new(move || {
6986 let id = id.clone();
6987 Box::pin(async move { id.into_id().await.unwrap().quote() })
6988 }),
6989 );
6990 EnvVariable {
6991 proc: self.proc.clone(),
6992 selection: query,
6993 graphql_client: self.graphql_client.clone(),
6994 }
6995 }
6996 pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
6998 let mut query = self.selection.select("loadErrorFromID");
6999 query = query.arg_lazy(
7000 "id",
7001 Box::new(move || {
7002 let id = id.clone();
7003 Box::pin(async move { id.into_id().await.unwrap().quote() })
7004 }),
7005 );
7006 Error {
7007 proc: self.proc.clone(),
7008 selection: query,
7009 graphql_client: self.graphql_client.clone(),
7010 }
7011 }
7012 pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
7014 let mut query = self.selection.select("loadFieldTypeDefFromID");
7015 query = query.arg_lazy(
7016 "id",
7017 Box::new(move || {
7018 let id = id.clone();
7019 Box::pin(async move { id.into_id().await.unwrap().quote() })
7020 }),
7021 );
7022 FieldTypeDef {
7023 proc: self.proc.clone(),
7024 selection: query,
7025 graphql_client: self.graphql_client.clone(),
7026 }
7027 }
7028 pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
7030 let mut query = self.selection.select("loadFileFromID");
7031 query = query.arg_lazy(
7032 "id",
7033 Box::new(move || {
7034 let id = id.clone();
7035 Box::pin(async move { id.into_id().await.unwrap().quote() })
7036 }),
7037 );
7038 File {
7039 proc: self.proc.clone(),
7040 selection: query,
7041 graphql_client: self.graphql_client.clone(),
7042 }
7043 }
7044 pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
7046 let mut query = self.selection.select("loadFunctionArgFromID");
7047 query = query.arg_lazy(
7048 "id",
7049 Box::new(move || {
7050 let id = id.clone();
7051 Box::pin(async move { id.into_id().await.unwrap().quote() })
7052 }),
7053 );
7054 FunctionArg {
7055 proc: self.proc.clone(),
7056 selection: query,
7057 graphql_client: self.graphql_client.clone(),
7058 }
7059 }
7060 pub fn load_function_call_arg_value_from_id(
7062 &self,
7063 id: impl IntoID<FunctionCallArgValueId>,
7064 ) -> FunctionCallArgValue {
7065 let mut query = self.selection.select("loadFunctionCallArgValueFromID");
7066 query = query.arg_lazy(
7067 "id",
7068 Box::new(move || {
7069 let id = id.clone();
7070 Box::pin(async move { id.into_id().await.unwrap().quote() })
7071 }),
7072 );
7073 FunctionCallArgValue {
7074 proc: self.proc.clone(),
7075 selection: query,
7076 graphql_client: self.graphql_client.clone(),
7077 }
7078 }
7079 pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
7081 let mut query = self.selection.select("loadFunctionCallFromID");
7082 query = query.arg_lazy(
7083 "id",
7084 Box::new(move || {
7085 let id = id.clone();
7086 Box::pin(async move { id.into_id().await.unwrap().quote() })
7087 }),
7088 );
7089 FunctionCall {
7090 proc: self.proc.clone(),
7091 selection: query,
7092 graphql_client: self.graphql_client.clone(),
7093 }
7094 }
7095 pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
7097 let mut query = self.selection.select("loadFunctionFromID");
7098 query = query.arg_lazy(
7099 "id",
7100 Box::new(move || {
7101 let id = id.clone();
7102 Box::pin(async move { id.into_id().await.unwrap().quote() })
7103 }),
7104 );
7105 Function {
7106 proc: self.proc.clone(),
7107 selection: query,
7108 graphql_client: self.graphql_client.clone(),
7109 }
7110 }
7111 pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
7113 let mut query = self.selection.select("loadGeneratedCodeFromID");
7114 query = query.arg_lazy(
7115 "id",
7116 Box::new(move || {
7117 let id = id.clone();
7118 Box::pin(async move { id.into_id().await.unwrap().quote() })
7119 }),
7120 );
7121 GeneratedCode {
7122 proc: self.proc.clone(),
7123 selection: query,
7124 graphql_client: self.graphql_client.clone(),
7125 }
7126 }
7127 pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
7129 let mut query = self.selection.select("loadGitRefFromID");
7130 query = query.arg_lazy(
7131 "id",
7132 Box::new(move || {
7133 let id = id.clone();
7134 Box::pin(async move { id.into_id().await.unwrap().quote() })
7135 }),
7136 );
7137 GitRef {
7138 proc: self.proc.clone(),
7139 selection: query,
7140 graphql_client: self.graphql_client.clone(),
7141 }
7142 }
7143 pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
7145 let mut query = self.selection.select("loadGitRepositoryFromID");
7146 query = query.arg_lazy(
7147 "id",
7148 Box::new(move || {
7149 let id = id.clone();
7150 Box::pin(async move { id.into_id().await.unwrap().quote() })
7151 }),
7152 );
7153 GitRepository {
7154 proc: self.proc.clone(),
7155 selection: query,
7156 graphql_client: self.graphql_client.clone(),
7157 }
7158 }
7159 pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
7161 let mut query = self.selection.select("loadHostFromID");
7162 query = query.arg_lazy(
7163 "id",
7164 Box::new(move || {
7165 let id = id.clone();
7166 Box::pin(async move { id.into_id().await.unwrap().quote() })
7167 }),
7168 );
7169 Host {
7170 proc: self.proc.clone(),
7171 selection: query,
7172 graphql_client: self.graphql_client.clone(),
7173 }
7174 }
7175 pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
7177 let mut query = self.selection.select("loadInputTypeDefFromID");
7178 query = query.arg_lazy(
7179 "id",
7180 Box::new(move || {
7181 let id = id.clone();
7182 Box::pin(async move { id.into_id().await.unwrap().quote() })
7183 }),
7184 );
7185 InputTypeDef {
7186 proc: self.proc.clone(),
7187 selection: query,
7188 graphql_client: self.graphql_client.clone(),
7189 }
7190 }
7191 pub fn load_interface_type_def_from_id(
7193 &self,
7194 id: impl IntoID<InterfaceTypeDefId>,
7195 ) -> InterfaceTypeDef {
7196 let mut query = self.selection.select("loadInterfaceTypeDefFromID");
7197 query = query.arg_lazy(
7198 "id",
7199 Box::new(move || {
7200 let id = id.clone();
7201 Box::pin(async move { id.into_id().await.unwrap().quote() })
7202 }),
7203 );
7204 InterfaceTypeDef {
7205 proc: self.proc.clone(),
7206 selection: query,
7207 graphql_client: self.graphql_client.clone(),
7208 }
7209 }
7210 pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
7212 let mut query = self.selection.select("loadLabelFromID");
7213 query = query.arg_lazy(
7214 "id",
7215 Box::new(move || {
7216 let id = id.clone();
7217 Box::pin(async move { id.into_id().await.unwrap().quote() })
7218 }),
7219 );
7220 Label {
7221 proc: self.proc.clone(),
7222 selection: query,
7223 graphql_client: self.graphql_client.clone(),
7224 }
7225 }
7226 pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
7228 let mut query = self.selection.select("loadListTypeDefFromID");
7229 query = query.arg_lazy(
7230 "id",
7231 Box::new(move || {
7232 let id = id.clone();
7233 Box::pin(async move { id.into_id().await.unwrap().quote() })
7234 }),
7235 );
7236 ListTypeDef {
7237 proc: self.proc.clone(),
7238 selection: query,
7239 graphql_client: self.graphql_client.clone(),
7240 }
7241 }
7242 pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
7244 let mut query = self.selection.select("loadModuleFromID");
7245 query = query.arg_lazy(
7246 "id",
7247 Box::new(move || {
7248 let id = id.clone();
7249 Box::pin(async move { id.into_id().await.unwrap().quote() })
7250 }),
7251 );
7252 Module {
7253 proc: self.proc.clone(),
7254 selection: query,
7255 graphql_client: self.graphql_client.clone(),
7256 }
7257 }
7258 pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
7260 let mut query = self.selection.select("loadModuleSourceFromID");
7261 query = query.arg_lazy(
7262 "id",
7263 Box::new(move || {
7264 let id = id.clone();
7265 Box::pin(async move { id.into_id().await.unwrap().quote() })
7266 }),
7267 );
7268 ModuleSource {
7269 proc: self.proc.clone(),
7270 selection: query,
7271 graphql_client: self.graphql_client.clone(),
7272 }
7273 }
7274 pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
7276 let mut query = self.selection.select("loadObjectTypeDefFromID");
7277 query = query.arg_lazy(
7278 "id",
7279 Box::new(move || {
7280 let id = id.clone();
7281 Box::pin(async move { id.into_id().await.unwrap().quote() })
7282 }),
7283 );
7284 ObjectTypeDef {
7285 proc: self.proc.clone(),
7286 selection: query,
7287 graphql_client: self.graphql_client.clone(),
7288 }
7289 }
7290 pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
7292 let mut query = self.selection.select("loadPortFromID");
7293 query = query.arg_lazy(
7294 "id",
7295 Box::new(move || {
7296 let id = id.clone();
7297 Box::pin(async move { id.into_id().await.unwrap().quote() })
7298 }),
7299 );
7300 Port {
7301 proc: self.proc.clone(),
7302 selection: query,
7303 graphql_client: self.graphql_client.clone(),
7304 }
7305 }
7306 pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
7308 let mut query = self.selection.select("loadSDKConfigFromID");
7309 query = query.arg_lazy(
7310 "id",
7311 Box::new(move || {
7312 let id = id.clone();
7313 Box::pin(async move { id.into_id().await.unwrap().quote() })
7314 }),
7315 );
7316 SdkConfig {
7317 proc: self.proc.clone(),
7318 selection: query,
7319 graphql_client: self.graphql_client.clone(),
7320 }
7321 }
7322 pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
7324 let mut query = self.selection.select("loadScalarTypeDefFromID");
7325 query = query.arg_lazy(
7326 "id",
7327 Box::new(move || {
7328 let id = id.clone();
7329 Box::pin(async move { id.into_id().await.unwrap().quote() })
7330 }),
7331 );
7332 ScalarTypeDef {
7333 proc: self.proc.clone(),
7334 selection: query,
7335 graphql_client: self.graphql_client.clone(),
7336 }
7337 }
7338 pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
7340 let mut query = self.selection.select("loadSecretFromID");
7341 query = query.arg_lazy(
7342 "id",
7343 Box::new(move || {
7344 let id = id.clone();
7345 Box::pin(async move { id.into_id().await.unwrap().quote() })
7346 }),
7347 );
7348 Secret {
7349 proc: self.proc.clone(),
7350 selection: query,
7351 graphql_client: self.graphql_client.clone(),
7352 }
7353 }
7354 pub fn load_secret_from_name(&self, name: impl Into<String>) -> Secret {
7360 let mut query = self.selection.select("loadSecretFromName");
7361 query = query.arg("name", name.into());
7362 Secret {
7363 proc: self.proc.clone(),
7364 selection: query,
7365 graphql_client: self.graphql_client.clone(),
7366 }
7367 }
7368 pub fn load_secret_from_name_opts<'a>(
7374 &self,
7375 name: impl Into<String>,
7376 opts: QueryLoadSecretFromNameOpts<'a>,
7377 ) -> Secret {
7378 let mut query = self.selection.select("loadSecretFromName");
7379 query = query.arg("name", name.into());
7380 if let Some(accessor) = opts.accessor {
7381 query = query.arg("accessor", accessor);
7382 }
7383 Secret {
7384 proc: self.proc.clone(),
7385 selection: query,
7386 graphql_client: self.graphql_client.clone(),
7387 }
7388 }
7389 pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
7391 let mut query = self.selection.select("loadServiceFromID");
7392 query = query.arg_lazy(
7393 "id",
7394 Box::new(move || {
7395 let id = id.clone();
7396 Box::pin(async move { id.into_id().await.unwrap().quote() })
7397 }),
7398 );
7399 Service {
7400 proc: self.proc.clone(),
7401 selection: query,
7402 graphql_client: self.graphql_client.clone(),
7403 }
7404 }
7405 pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
7407 let mut query = self.selection.select("loadSocketFromID");
7408 query = query.arg_lazy(
7409 "id",
7410 Box::new(move || {
7411 let id = id.clone();
7412 Box::pin(async move { id.into_id().await.unwrap().quote() })
7413 }),
7414 );
7415 Socket {
7416 proc: self.proc.clone(),
7417 selection: query,
7418 graphql_client: self.graphql_client.clone(),
7419 }
7420 }
7421 pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
7423 let mut query = self.selection.select("loadSourceMapFromID");
7424 query = query.arg_lazy(
7425 "id",
7426 Box::new(move || {
7427 let id = id.clone();
7428 Box::pin(async move { id.into_id().await.unwrap().quote() })
7429 }),
7430 );
7431 SourceMap {
7432 proc: self.proc.clone(),
7433 selection: query,
7434 graphql_client: self.graphql_client.clone(),
7435 }
7436 }
7437 pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
7439 let mut query = self.selection.select("loadTerminalFromID");
7440 query = query.arg_lazy(
7441 "id",
7442 Box::new(move || {
7443 let id = id.clone();
7444 Box::pin(async move { id.into_id().await.unwrap().quote() })
7445 }),
7446 );
7447 Terminal {
7448 proc: self.proc.clone(),
7449 selection: query,
7450 graphql_client: self.graphql_client.clone(),
7451 }
7452 }
7453 pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
7455 let mut query = self.selection.select("loadTypeDefFromID");
7456 query = query.arg_lazy(
7457 "id",
7458 Box::new(move || {
7459 let id = id.clone();
7460 Box::pin(async move { id.into_id().await.unwrap().quote() })
7461 }),
7462 );
7463 TypeDef {
7464 proc: self.proc.clone(),
7465 selection: query,
7466 graphql_client: self.graphql_client.clone(),
7467 }
7468 }
7469 pub fn module(&self) -> Module {
7471 let query = self.selection.select("module");
7472 Module {
7473 proc: self.proc.clone(),
7474 selection: query,
7475 graphql_client: self.graphql_client.clone(),
7476 }
7477 }
7478 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
7485 let mut query = self.selection.select("moduleSource");
7486 query = query.arg("refString", ref_string.into());
7487 ModuleSource {
7488 proc: self.proc.clone(),
7489 selection: query,
7490 graphql_client: self.graphql_client.clone(),
7491 }
7492 }
7493 pub fn module_source_opts<'a>(
7500 &self,
7501 ref_string: impl Into<String>,
7502 opts: QueryModuleSourceOpts<'a>,
7503 ) -> ModuleSource {
7504 let mut query = self.selection.select("moduleSource");
7505 query = query.arg("refString", ref_string.into());
7506 if let Some(ref_pin) = opts.ref_pin {
7507 query = query.arg("refPin", ref_pin);
7508 }
7509 if let Some(disable_find_up) = opts.disable_find_up {
7510 query = query.arg("disableFindUp", disable_find_up);
7511 }
7512 if let Some(allow_not_exists) = opts.allow_not_exists {
7513 query = query.arg("allowNotExists", allow_not_exists);
7514 }
7515 if let Some(require_kind) = opts.require_kind {
7516 query = query.arg("requireKind", require_kind);
7517 }
7518 ModuleSource {
7519 proc: self.proc.clone(),
7520 selection: query,
7521 graphql_client: self.graphql_client.clone(),
7522 }
7523 }
7524 pub fn secret(&self, uri: impl Into<String>) -> Secret {
7530 let mut query = self.selection.select("secret");
7531 query = query.arg("uri", uri.into());
7532 Secret {
7533 proc: self.proc.clone(),
7534 selection: query,
7535 graphql_client: self.graphql_client.clone(),
7536 }
7537 }
7538 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
7546 let mut query = self.selection.select("setSecret");
7547 query = query.arg("name", name.into());
7548 query = query.arg("plaintext", plaintext.into());
7549 Secret {
7550 proc: self.proc.clone(),
7551 selection: query,
7552 graphql_client: self.graphql_client.clone(),
7553 }
7554 }
7555 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
7563 let mut query = self.selection.select("sourceMap");
7564 query = query.arg("filename", filename.into());
7565 query = query.arg("line", line);
7566 query = query.arg("column", column);
7567 SourceMap {
7568 proc: self.proc.clone(),
7569 selection: query,
7570 graphql_client: self.graphql_client.clone(),
7571 }
7572 }
7573 pub fn type_def(&self) -> TypeDef {
7575 let query = self.selection.select("typeDef");
7576 TypeDef {
7577 proc: self.proc.clone(),
7578 selection: query,
7579 graphql_client: self.graphql_client.clone(),
7580 }
7581 }
7582 pub async fn version(&self) -> Result<String, DaggerError> {
7584 let query = self.selection.select("version");
7585 query.execute(self.graphql_client.clone()).await
7586 }
7587}
7588#[derive(Clone)]
7589pub struct SdkConfig {
7590 pub proc: Option<Arc<DaggerSessionProc>>,
7591 pub selection: Selection,
7592 pub graphql_client: DynGraphQLClient,
7593}
7594impl SdkConfig {
7595 pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
7597 let query = self.selection.select("id");
7598 query.execute(self.graphql_client.clone()).await
7599 }
7600 pub async fn source(&self) -> Result<String, DaggerError> {
7602 let query = self.selection.select("source");
7603 query.execute(self.graphql_client.clone()).await
7604 }
7605}
7606#[derive(Clone)]
7607pub struct ScalarTypeDef {
7608 pub proc: Option<Arc<DaggerSessionProc>>,
7609 pub selection: Selection,
7610 pub graphql_client: DynGraphQLClient,
7611}
7612impl ScalarTypeDef {
7613 pub async fn description(&self) -> Result<String, DaggerError> {
7615 let query = self.selection.select("description");
7616 query.execute(self.graphql_client.clone()).await
7617 }
7618 pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
7620 let query = self.selection.select("id");
7621 query.execute(self.graphql_client.clone()).await
7622 }
7623 pub async fn name(&self) -> Result<String, DaggerError> {
7625 let query = self.selection.select("name");
7626 query.execute(self.graphql_client.clone()).await
7627 }
7628 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
7630 let query = self.selection.select("sourceModuleName");
7631 query.execute(self.graphql_client.clone()).await
7632 }
7633}
7634#[derive(Clone)]
7635pub struct Secret {
7636 pub proc: Option<Arc<DaggerSessionProc>>,
7637 pub selection: Selection,
7638 pub graphql_client: DynGraphQLClient,
7639}
7640impl Secret {
7641 pub async fn id(&self) -> Result<SecretId, DaggerError> {
7643 let query = self.selection.select("id");
7644 query.execute(self.graphql_client.clone()).await
7645 }
7646 pub async fn name(&self) -> Result<String, DaggerError> {
7648 let query = self.selection.select("name");
7649 query.execute(self.graphql_client.clone()).await
7650 }
7651 pub async fn plaintext(&self) -> Result<String, DaggerError> {
7653 let query = self.selection.select("plaintext");
7654 query.execute(self.graphql_client.clone()).await
7655 }
7656 pub async fn uri(&self) -> Result<String, DaggerError> {
7658 let query = self.selection.select("uri");
7659 query.execute(self.graphql_client.clone()).await
7660 }
7661}
7662#[derive(Clone)]
7663pub struct Service {
7664 pub proc: Option<Arc<DaggerSessionProc>>,
7665 pub selection: Selection,
7666 pub graphql_client: DynGraphQLClient,
7667}
7668#[derive(Builder, Debug, PartialEq)]
7669pub struct ServiceEndpointOpts<'a> {
7670 #[builder(setter(into, strip_option), default)]
7672 pub port: Option<isize>,
7673 #[builder(setter(into, strip_option), default)]
7675 pub scheme: Option<&'a str>,
7676}
7677#[derive(Builder, Debug, PartialEq)]
7678pub struct ServiceStopOpts {
7679 #[builder(setter(into, strip_option), default)]
7681 pub kill: Option<bool>,
7682}
7683#[derive(Builder, Debug, PartialEq)]
7684pub struct ServiceUpOpts {
7685 #[builder(setter(into, strip_option), default)]
7688 pub ports: Option<Vec<PortForward>>,
7689 #[builder(setter(into, strip_option), default)]
7691 pub random: Option<bool>,
7692}
7693impl Service {
7694 pub async fn endpoint(&self) -> Result<String, DaggerError> {
7702 let query = self.selection.select("endpoint");
7703 query.execute(self.graphql_client.clone()).await
7704 }
7705 pub async fn endpoint_opts<'a>(
7713 &self,
7714 opts: ServiceEndpointOpts<'a>,
7715 ) -> Result<String, DaggerError> {
7716 let mut query = self.selection.select("endpoint");
7717 if let Some(port) = opts.port {
7718 query = query.arg("port", port);
7719 }
7720 if let Some(scheme) = opts.scheme {
7721 query = query.arg("scheme", scheme);
7722 }
7723 query.execute(self.graphql_client.clone()).await
7724 }
7725 pub async fn hostname(&self) -> Result<String, DaggerError> {
7727 let query = self.selection.select("hostname");
7728 query.execute(self.graphql_client.clone()).await
7729 }
7730 pub async fn id(&self) -> Result<ServiceId, DaggerError> {
7732 let query = self.selection.select("id");
7733 query.execute(self.graphql_client.clone()).await
7734 }
7735 pub fn ports(&self) -> Vec<Port> {
7737 let query = self.selection.select("ports");
7738 vec![Port {
7739 proc: self.proc.clone(),
7740 selection: query,
7741 graphql_client: self.graphql_client.clone(),
7742 }]
7743 }
7744 pub async fn start(&self) -> Result<ServiceId, DaggerError> {
7747 let query = self.selection.select("start");
7748 query.execute(self.graphql_client.clone()).await
7749 }
7750 pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
7756 let query = self.selection.select("stop");
7757 query.execute(self.graphql_client.clone()).await
7758 }
7759 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
7765 let mut query = self.selection.select("stop");
7766 if let Some(kill) = opts.kill {
7767 query = query.arg("kill", kill);
7768 }
7769 query.execute(self.graphql_client.clone()).await
7770 }
7771 pub async fn up(&self) -> Result<Void, DaggerError> {
7777 let query = self.selection.select("up");
7778 query.execute(self.graphql_client.clone()).await
7779 }
7780 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
7786 let mut query = self.selection.select("up");
7787 if let Some(ports) = opts.ports {
7788 query = query.arg("ports", ports);
7789 }
7790 if let Some(random) = opts.random {
7791 query = query.arg("random", random);
7792 }
7793 query.execute(self.graphql_client.clone()).await
7794 }
7795 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
7801 let mut query = self.selection.select("withHostname");
7802 query = query.arg("hostname", hostname.into());
7803 Service {
7804 proc: self.proc.clone(),
7805 selection: query,
7806 graphql_client: self.graphql_client.clone(),
7807 }
7808 }
7809}
7810#[derive(Clone)]
7811pub struct Socket {
7812 pub proc: Option<Arc<DaggerSessionProc>>,
7813 pub selection: Selection,
7814 pub graphql_client: DynGraphQLClient,
7815}
7816impl Socket {
7817 pub async fn id(&self) -> Result<SocketId, DaggerError> {
7819 let query = self.selection.select("id");
7820 query.execute(self.graphql_client.clone()).await
7821 }
7822}
7823#[derive(Clone)]
7824pub struct SourceMap {
7825 pub proc: Option<Arc<DaggerSessionProc>>,
7826 pub selection: Selection,
7827 pub graphql_client: DynGraphQLClient,
7828}
7829impl SourceMap {
7830 pub async fn column(&self) -> Result<isize, DaggerError> {
7832 let query = self.selection.select("column");
7833 query.execute(self.graphql_client.clone()).await
7834 }
7835 pub async fn filename(&self) -> Result<String, DaggerError> {
7837 let query = self.selection.select("filename");
7838 query.execute(self.graphql_client.clone()).await
7839 }
7840 pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
7842 let query = self.selection.select("id");
7843 query.execute(self.graphql_client.clone()).await
7844 }
7845 pub async fn line(&self) -> Result<isize, DaggerError> {
7847 let query = self.selection.select("line");
7848 query.execute(self.graphql_client.clone()).await
7849 }
7850 pub async fn module(&self) -> Result<String, DaggerError> {
7852 let query = self.selection.select("module");
7853 query.execute(self.graphql_client.clone()).await
7854 }
7855}
7856#[derive(Clone)]
7857pub struct Terminal {
7858 pub proc: Option<Arc<DaggerSessionProc>>,
7859 pub selection: Selection,
7860 pub graphql_client: DynGraphQLClient,
7861}
7862impl Terminal {
7863 pub async fn id(&self) -> Result<TerminalId, DaggerError> {
7865 let query = self.selection.select("id");
7866 query.execute(self.graphql_client.clone()).await
7867 }
7868 pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
7871 let query = self.selection.select("sync");
7872 query.execute(self.graphql_client.clone()).await
7873 }
7874}
7875#[derive(Clone)]
7876pub struct TypeDef {
7877 pub proc: Option<Arc<DaggerSessionProc>>,
7878 pub selection: Selection,
7879 pub graphql_client: DynGraphQLClient,
7880}
7881#[derive(Builder, Debug, PartialEq)]
7882pub struct TypeDefWithEnumOpts<'a> {
7883 #[builder(setter(into, strip_option), default)]
7885 pub description: Option<&'a str>,
7886 #[builder(setter(into, strip_option), default)]
7888 pub source_map: Option<SourceMapId>,
7889}
7890#[derive(Builder, Debug, PartialEq)]
7891pub struct TypeDefWithEnumValueOpts<'a> {
7892 #[builder(setter(into, strip_option), default)]
7894 pub description: Option<&'a str>,
7895 #[builder(setter(into, strip_option), default)]
7897 pub source_map: Option<SourceMapId>,
7898}
7899#[derive(Builder, Debug, PartialEq)]
7900pub struct TypeDefWithFieldOpts<'a> {
7901 #[builder(setter(into, strip_option), default)]
7903 pub description: Option<&'a str>,
7904 #[builder(setter(into, strip_option), default)]
7906 pub source_map: Option<SourceMapId>,
7907}
7908#[derive(Builder, Debug, PartialEq)]
7909pub struct TypeDefWithInterfaceOpts<'a> {
7910 #[builder(setter(into, strip_option), default)]
7911 pub description: Option<&'a str>,
7912 #[builder(setter(into, strip_option), default)]
7913 pub source_map: Option<SourceMapId>,
7914}
7915#[derive(Builder, Debug, PartialEq)]
7916pub struct TypeDefWithObjectOpts<'a> {
7917 #[builder(setter(into, strip_option), default)]
7918 pub description: Option<&'a str>,
7919 #[builder(setter(into, strip_option), default)]
7920 pub source_map: Option<SourceMapId>,
7921}
7922#[derive(Builder, Debug, PartialEq)]
7923pub struct TypeDefWithScalarOpts<'a> {
7924 #[builder(setter(into, strip_option), default)]
7925 pub description: Option<&'a str>,
7926}
7927impl TypeDef {
7928 pub fn as_enum(&self) -> EnumTypeDef {
7930 let query = self.selection.select("asEnum");
7931 EnumTypeDef {
7932 proc: self.proc.clone(),
7933 selection: query,
7934 graphql_client: self.graphql_client.clone(),
7935 }
7936 }
7937 pub fn as_input(&self) -> InputTypeDef {
7939 let query = self.selection.select("asInput");
7940 InputTypeDef {
7941 proc: self.proc.clone(),
7942 selection: query,
7943 graphql_client: self.graphql_client.clone(),
7944 }
7945 }
7946 pub fn as_interface(&self) -> InterfaceTypeDef {
7948 let query = self.selection.select("asInterface");
7949 InterfaceTypeDef {
7950 proc: self.proc.clone(),
7951 selection: query,
7952 graphql_client: self.graphql_client.clone(),
7953 }
7954 }
7955 pub fn as_list(&self) -> ListTypeDef {
7957 let query = self.selection.select("asList");
7958 ListTypeDef {
7959 proc: self.proc.clone(),
7960 selection: query,
7961 graphql_client: self.graphql_client.clone(),
7962 }
7963 }
7964 pub fn as_object(&self) -> ObjectTypeDef {
7966 let query = self.selection.select("asObject");
7967 ObjectTypeDef {
7968 proc: self.proc.clone(),
7969 selection: query,
7970 graphql_client: self.graphql_client.clone(),
7971 }
7972 }
7973 pub fn as_scalar(&self) -> ScalarTypeDef {
7975 let query = self.selection.select("asScalar");
7976 ScalarTypeDef {
7977 proc: self.proc.clone(),
7978 selection: query,
7979 graphql_client: self.graphql_client.clone(),
7980 }
7981 }
7982 pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
7984 let query = self.selection.select("id");
7985 query.execute(self.graphql_client.clone()).await
7986 }
7987 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
7989 let query = self.selection.select("kind");
7990 query.execute(self.graphql_client.clone()).await
7991 }
7992 pub async fn optional(&self) -> Result<bool, DaggerError> {
7994 let query = self.selection.select("optional");
7995 query.execute(self.graphql_client.clone()).await
7996 }
7997 pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
7999 let mut query = self.selection.select("withConstructor");
8000 query = query.arg_lazy(
8001 "function",
8002 Box::new(move || {
8003 let function = function.clone();
8004 Box::pin(async move { function.into_id().await.unwrap().quote() })
8005 }),
8006 );
8007 TypeDef {
8008 proc: self.proc.clone(),
8009 selection: query,
8010 graphql_client: self.graphql_client.clone(),
8011 }
8012 }
8013 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
8021 let mut query = self.selection.select("withEnum");
8022 query = query.arg("name", name.into());
8023 TypeDef {
8024 proc: self.proc.clone(),
8025 selection: query,
8026 graphql_client: self.graphql_client.clone(),
8027 }
8028 }
8029 pub fn with_enum_opts<'a>(
8037 &self,
8038 name: impl Into<String>,
8039 opts: TypeDefWithEnumOpts<'a>,
8040 ) -> TypeDef {
8041 let mut query = self.selection.select("withEnum");
8042 query = query.arg("name", name.into());
8043 if let Some(description) = opts.description {
8044 query = query.arg("description", description);
8045 }
8046 if let Some(source_map) = opts.source_map {
8047 query = query.arg("sourceMap", source_map);
8048 }
8049 TypeDef {
8050 proc: self.proc.clone(),
8051 selection: query,
8052 graphql_client: self.graphql_client.clone(),
8053 }
8054 }
8055 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
8062 let mut query = self.selection.select("withEnumValue");
8063 query = query.arg("value", value.into());
8064 TypeDef {
8065 proc: self.proc.clone(),
8066 selection: query,
8067 graphql_client: self.graphql_client.clone(),
8068 }
8069 }
8070 pub fn with_enum_value_opts<'a>(
8077 &self,
8078 value: impl Into<String>,
8079 opts: TypeDefWithEnumValueOpts<'a>,
8080 ) -> TypeDef {
8081 let mut query = self.selection.select("withEnumValue");
8082 query = query.arg("value", value.into());
8083 if let Some(description) = opts.description {
8084 query = query.arg("description", description);
8085 }
8086 if let Some(source_map) = opts.source_map {
8087 query = query.arg("sourceMap", source_map);
8088 }
8089 TypeDef {
8090 proc: self.proc.clone(),
8091 selection: query,
8092 graphql_client: self.graphql_client.clone(),
8093 }
8094 }
8095 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
8103 let mut query = self.selection.select("withField");
8104 query = query.arg("name", name.into());
8105 query = query.arg_lazy(
8106 "typeDef",
8107 Box::new(move || {
8108 let type_def = type_def.clone();
8109 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8110 }),
8111 );
8112 TypeDef {
8113 proc: self.proc.clone(),
8114 selection: query,
8115 graphql_client: self.graphql_client.clone(),
8116 }
8117 }
8118 pub fn with_field_opts<'a>(
8126 &self,
8127 name: impl Into<String>,
8128 type_def: impl IntoID<TypeDefId>,
8129 opts: TypeDefWithFieldOpts<'a>,
8130 ) -> TypeDef {
8131 let mut query = self.selection.select("withField");
8132 query = query.arg("name", name.into());
8133 query = query.arg_lazy(
8134 "typeDef",
8135 Box::new(move || {
8136 let type_def = type_def.clone();
8137 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
8138 }),
8139 );
8140 if let Some(description) = opts.description {
8141 query = query.arg("description", description);
8142 }
8143 if let Some(source_map) = opts.source_map {
8144 query = query.arg("sourceMap", source_map);
8145 }
8146 TypeDef {
8147 proc: self.proc.clone(),
8148 selection: query,
8149 graphql_client: self.graphql_client.clone(),
8150 }
8151 }
8152 pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
8154 let mut query = self.selection.select("withFunction");
8155 query = query.arg_lazy(
8156 "function",
8157 Box::new(move || {
8158 let function = function.clone();
8159 Box::pin(async move { function.into_id().await.unwrap().quote() })
8160 }),
8161 );
8162 TypeDef {
8163 proc: self.proc.clone(),
8164 selection: query,
8165 graphql_client: self.graphql_client.clone(),
8166 }
8167 }
8168 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
8174 let mut query = self.selection.select("withInterface");
8175 query = query.arg("name", name.into());
8176 TypeDef {
8177 proc: self.proc.clone(),
8178 selection: query,
8179 graphql_client: self.graphql_client.clone(),
8180 }
8181 }
8182 pub fn with_interface_opts<'a>(
8188 &self,
8189 name: impl Into<String>,
8190 opts: TypeDefWithInterfaceOpts<'a>,
8191 ) -> TypeDef {
8192 let mut query = self.selection.select("withInterface");
8193 query = query.arg("name", name.into());
8194 if let Some(description) = opts.description {
8195 query = query.arg("description", description);
8196 }
8197 if let Some(source_map) = opts.source_map {
8198 query = query.arg("sourceMap", source_map);
8199 }
8200 TypeDef {
8201 proc: self.proc.clone(),
8202 selection: query,
8203 graphql_client: self.graphql_client.clone(),
8204 }
8205 }
8206 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
8208 let mut query = self.selection.select("withKind");
8209 query = query.arg("kind", kind);
8210 TypeDef {
8211 proc: self.proc.clone(),
8212 selection: query,
8213 graphql_client: self.graphql_client.clone(),
8214 }
8215 }
8216 pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
8218 let mut query = self.selection.select("withListOf");
8219 query = query.arg_lazy(
8220 "elementType",
8221 Box::new(move || {
8222 let element_type = element_type.clone();
8223 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
8224 }),
8225 );
8226 TypeDef {
8227 proc: self.proc.clone(),
8228 selection: query,
8229 graphql_client: self.graphql_client.clone(),
8230 }
8231 }
8232 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
8239 let mut query = self.selection.select("withObject");
8240 query = query.arg("name", name.into());
8241 TypeDef {
8242 proc: self.proc.clone(),
8243 selection: query,
8244 graphql_client: self.graphql_client.clone(),
8245 }
8246 }
8247 pub fn with_object_opts<'a>(
8254 &self,
8255 name: impl Into<String>,
8256 opts: TypeDefWithObjectOpts<'a>,
8257 ) -> TypeDef {
8258 let mut query = self.selection.select("withObject");
8259 query = query.arg("name", name.into());
8260 if let Some(description) = opts.description {
8261 query = query.arg("description", description);
8262 }
8263 if let Some(source_map) = opts.source_map {
8264 query = query.arg("sourceMap", source_map);
8265 }
8266 TypeDef {
8267 proc: self.proc.clone(),
8268 selection: query,
8269 graphql_client: self.graphql_client.clone(),
8270 }
8271 }
8272 pub fn with_optional(&self, optional: bool) -> TypeDef {
8274 let mut query = self.selection.select("withOptional");
8275 query = query.arg("optional", optional);
8276 TypeDef {
8277 proc: self.proc.clone(),
8278 selection: query,
8279 graphql_client: self.graphql_client.clone(),
8280 }
8281 }
8282 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
8288 let mut query = self.selection.select("withScalar");
8289 query = query.arg("name", name.into());
8290 TypeDef {
8291 proc: self.proc.clone(),
8292 selection: query,
8293 graphql_client: self.graphql_client.clone(),
8294 }
8295 }
8296 pub fn with_scalar_opts<'a>(
8302 &self,
8303 name: impl Into<String>,
8304 opts: TypeDefWithScalarOpts<'a>,
8305 ) -> TypeDef {
8306 let mut query = self.selection.select("withScalar");
8307 query = query.arg("name", name.into());
8308 if let Some(description) = opts.description {
8309 query = query.arg("description", description);
8310 }
8311 TypeDef {
8312 proc: self.proc.clone(),
8313 selection: query,
8314 graphql_client: self.graphql_client.clone(),
8315 }
8316 }
8317}
8318#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8319pub enum CacheSharingMode {
8320 #[serde(rename = "LOCKED")]
8321 Locked,
8322 #[serde(rename = "PRIVATE")]
8323 Private,
8324 #[serde(rename = "SHARED")]
8325 Shared,
8326}
8327#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8328pub enum ImageLayerCompression {
8329 #[serde(rename = "EStarGZ")]
8330 EStarGz,
8331 #[serde(rename = "Gzip")]
8332 Gzip,
8333 #[serde(rename = "Uncompressed")]
8334 Uncompressed,
8335 #[serde(rename = "Zstd")]
8336 Zstd,
8337}
8338#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8339pub enum ImageMediaTypes {
8340 #[serde(rename = "DockerMediaTypes")]
8341 DockerMediaTypes,
8342 #[serde(rename = "OCIMediaTypes")]
8343 OciMediaTypes,
8344}
8345#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8346pub enum ModuleSourceKind {
8347 #[serde(rename = "DIR_SOURCE")]
8348 DirSource,
8349 #[serde(rename = "GIT_SOURCE")]
8350 GitSource,
8351 #[serde(rename = "LOCAL_SOURCE")]
8352 LocalSource,
8353}
8354#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8355pub enum NetworkProtocol {
8356 #[serde(rename = "TCP")]
8357 Tcp,
8358 #[serde(rename = "UDP")]
8359 Udp,
8360}
8361#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8362pub enum ReturnType {
8363 #[serde(rename = "ANY")]
8364 Any,
8365 #[serde(rename = "FAILURE")]
8366 Failure,
8367 #[serde(rename = "SUCCESS")]
8368 Success,
8369}
8370#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
8371pub enum TypeDefKind {
8372 #[serde(rename = "BOOLEAN_KIND")]
8373 BooleanKind,
8374 #[serde(rename = "ENUM_KIND")]
8375 EnumKind,
8376 #[serde(rename = "FLOAT_KIND")]
8377 FloatKind,
8378 #[serde(rename = "INPUT_KIND")]
8379 InputKind,
8380 #[serde(rename = "INTEGER_KIND")]
8381 IntegerKind,
8382 #[serde(rename = "INTERFACE_KIND")]
8383 InterfaceKind,
8384 #[serde(rename = "LIST_KIND")]
8385 ListKind,
8386 #[serde(rename = "OBJECT_KIND")]
8387 ObjectKind,
8388 #[serde(rename = "SCALAR_KIND")]
8389 ScalarKind,
8390 #[serde(rename = "STRING_KIND")]
8391 StringKind,
8392 #[serde(rename = "VOID_KIND")]
8393 VoidKind,
8394}